v0.2.4: Switched to Watabou's much more elegant logic for items falling between floors
This commit is contained in:
parent
61246dcc46
commit
5fcc1a612a
|
@ -19,11 +19,6 @@ package com.shatteredpixel.shatteredpixeldungeon;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
@ -34,11 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Ankh;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Ankh;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||||
|
@ -64,13 +56,16 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndResurrect;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndResurrect;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
|
import com.watabou.utils.Bundlable;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
import com.watabou.utils.PathFinder;
|
import com.watabou.utils.PathFinder;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
import com.watabou.utils.SparseArray;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
@ -133,6 +128,8 @@ public class Dungeon {
|
||||||
// Hero's field of view
|
// Hero's field of view
|
||||||
public static boolean[] visible = new boolean[Level.LENGTH];
|
public static boolean[] visible = new boolean[Level.LENGTH];
|
||||||
|
|
||||||
|
public static SparseArray<ArrayList<Item>> droppedItems;
|
||||||
|
|
||||||
public static int version;
|
public static int version;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
|
@ -159,7 +156,9 @@ public class Dungeon {
|
||||||
|
|
||||||
depth = 0;
|
depth = 0;
|
||||||
gold = 0;
|
gold = 0;
|
||||||
|
|
||||||
|
droppedItems = new SparseArray<ArrayList<Item>>();
|
||||||
|
|
||||||
for (limitedDrops a : limitedDrops.values())
|
for (limitedDrops a : limitedDrops.values())
|
||||||
a.count = 0;
|
a.count = 0;
|
||||||
|
|
||||||
|
@ -301,24 +300,6 @@ public class Dungeon {
|
||||||
Actor.add( level.respawner() );
|
Actor.add( level.respawner() );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Potion potion : level.fallingPotions){
|
|
||||||
|
|
||||||
int cell = level.randomRespawnCell();
|
|
||||||
while (cell == -1)
|
|
||||||
cell = level.randomRespawnCell();
|
|
||||||
|
|
||||||
if (potion instanceof PotionOfLiquidFlame)
|
|
||||||
GameScene.add( Blob.seed( cell, 2, Fire.class));
|
|
||||||
else if (potion instanceof PotionOfToxicGas)
|
|
||||||
GameScene.add( Blob.seed( cell, 1000, ToxicGas.class ) );
|
|
||||||
else if (potion instanceof PotionOfParalyticGas)
|
|
||||||
GameScene.add( Blob.seed( cell, 1000, ParalyticGas.class ) );
|
|
||||||
else if (potion instanceof PotionOfLevitation)
|
|
||||||
GameScene.add( Blob.seed( cell, 1000, ConfusionGas.class ) );
|
|
||||||
|
|
||||||
}
|
|
||||||
level.fallingPotions.clear();
|
|
||||||
|
|
||||||
hero.pos = pos != -1 ? pos : level.exit;
|
hero.pos = pos != -1 ? pos : level.exit;
|
||||||
|
|
||||||
Light light = hero.buff( Light.class );
|
Light light = hero.buff( Light.class );
|
||||||
|
@ -328,11 +309,20 @@ public class Dungeon {
|
||||||
try {
|
try {
|
||||||
saveAll();
|
saveAll();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
/*This only catches IO errors. Yes, this means things can do wrong, and they can go wrong catastrophically.
|
/*This only catches IO errors. Yes, this means things can go wrong, and they can go wrong catastrophically.
|
||||||
But when they do the user will get a nice 'report this issue' dialogue, and I can fix the bug.*/
|
But when they do the user will get a nice 'report this issue' dialogue, and I can fix the bug.*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void dropToChasm( Item item ) {
|
||||||
|
int depth = Dungeon.depth + 1;
|
||||||
|
ArrayList<Item> dropped = (ArrayList<Item>)Dungeon.droppedItems.get( depth );
|
||||||
|
if (dropped == null) {
|
||||||
|
Dungeon.droppedItems.put( depth, dropped = new ArrayList<Item>() );
|
||||||
|
}
|
||||||
|
dropped.add( item );
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean posNeeded() {
|
public static boolean posNeeded() {
|
||||||
int[] quota = {4, 2, 9, 4, 14, 6, 19, 8, 24, 9};
|
int[] quota = {4, 2, 9, 4, 14, 6, 19, 8, 24, 9};
|
||||||
return chance( quota, limitedDrops.strengthPotions.count );
|
return chance( quota, limitedDrops.strengthPotions.count );
|
||||||
|
@ -377,7 +367,7 @@ public class Dungeon {
|
||||||
private static final String HERO = "hero";
|
private static final String HERO = "hero";
|
||||||
private static final String GOLD = "gold";
|
private static final String GOLD = "gold";
|
||||||
private static final String DEPTH = "depth";
|
private static final String DEPTH = "depth";
|
||||||
private static final String QUICKSLOT = "quickslot";
|
private static final String DROPPED = "dropped%d";
|
||||||
private static final String LEVEL = "level";
|
private static final String LEVEL = "level";
|
||||||
private static final String LIMDROPS = "limiteddrops";
|
private static final String LIMDROPS = "limiteddrops";
|
||||||
private static final String DV = "dewVial";
|
private static final String DV = "dewVial";
|
||||||
|
@ -427,6 +417,10 @@ public class Dungeon {
|
||||||
bundle.put( GOLD, gold );
|
bundle.put( GOLD, gold );
|
||||||
bundle.put( DEPTH, depth );
|
bundle.put( DEPTH, depth );
|
||||||
|
|
||||||
|
for (int d : droppedItems.keyArray()) {
|
||||||
|
bundle.put(String.format(DROPPED, d), droppedItems.get(d));
|
||||||
|
}
|
||||||
|
|
||||||
quickslot.storePlaceholders( bundle );
|
quickslot.storePlaceholders( bundle );
|
||||||
|
|
||||||
bundle.put( WT, transmutation );
|
bundle.put( WT, transmutation );
|
||||||
|
@ -507,7 +501,7 @@ public class Dungeon {
|
||||||
public static void loadGame( HeroClass cl ) throws IOException {
|
public static void loadGame( HeroClass cl ) throws IOException {
|
||||||
loadGame( gameFile( cl ), true );
|
loadGame( gameFile( cl ), true );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadGame( String fileName ) throws IOException {
|
public static void loadGame( String fileName ) throws IOException {
|
||||||
loadGame( fileName, false );
|
loadGame( fileName, false );
|
||||||
}
|
}
|
||||||
|
@ -601,6 +595,17 @@ public class Dungeon {
|
||||||
Journal.restoreFromBundle( bundle );
|
Journal.restoreFromBundle( bundle );
|
||||||
Generator.restoreFromBundle( bundle );
|
Generator.restoreFromBundle( bundle );
|
||||||
|
|
||||||
|
droppedItems = new SparseArray<ArrayList<Item>>();
|
||||||
|
for (int i=2; i <= Statistics.deepestFloor + 1; i++) {
|
||||||
|
ArrayList<Item> dropped = new ArrayList<Item>();
|
||||||
|
for (Bundlable b : bundle.getCollection( String.format( DROPPED, i ) ) ) {
|
||||||
|
dropped.add( (Item)b );
|
||||||
|
}
|
||||||
|
if (!dropped.isEmpty()) {
|
||||||
|
droppedItems.put( i, dropped );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//logic for pre 0.2.4 bags, remove when no longer supporting those saves.
|
//logic for pre 0.2.4 bags, remove when no longer supporting those saves.
|
||||||
if (version <= 32){
|
if (version <= 32){
|
||||||
int deepest = Statistics.deepestFloor;
|
int deepest = Statistics.deepestFloor;
|
||||||
|
|
|
@ -51,7 +51,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.SeedPouch;
|
import com.shatteredpixel.shatteredpixeldungeon.items.bags.SeedPouch;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||||
|
@ -154,9 +153,6 @@ public abstract class Level implements Bundlable {
|
||||||
public SparseArray<Plant> plants;
|
public SparseArray<Plant> plants;
|
||||||
|
|
||||||
protected ArrayList<Item> itemsToSpawn = new ArrayList<Item>();
|
protected ArrayList<Item> itemsToSpawn = new ArrayList<Item>();
|
||||||
|
|
||||||
public ArrayList<Item> fallingItems = new ArrayList<Item>();
|
|
||||||
public ArrayList<Potion> fallingPotions = new ArrayList<Potion>();
|
|
||||||
|
|
||||||
public int color1 = 0x004400;
|
public int color1 = 0x004400;
|
||||||
public int color2 = 0x88CC44;
|
public int color2 = 0x88CC44;
|
||||||
|
@ -174,7 +170,6 @@ public abstract class Level implements Bundlable {
|
||||||
private static final String PLANTS = "plants";
|
private static final String PLANTS = "plants";
|
||||||
private static final String MOBS = "mobs";
|
private static final String MOBS = "mobs";
|
||||||
private static final String BLOBS = "blobs";
|
private static final String BLOBS = "blobs";
|
||||||
private static final String FALLING = "falling";
|
|
||||||
private static final String FEELING = "feeling";
|
private static final String FEELING = "feeling";
|
||||||
|
|
||||||
public void create() {
|
public void create() {
|
||||||
|
@ -339,8 +334,6 @@ public abstract class Level implements Bundlable {
|
||||||
blobs.put( blob.getClass(), blob );
|
blobs.put( blob.getClass(), blob );
|
||||||
}
|
}
|
||||||
|
|
||||||
fallingItems = (ArrayList)bundle.getCollection( FALLING );
|
|
||||||
|
|
||||||
feeling = bundle.getEnum( FEELING, Feeling.class );
|
feeling = bundle.getEnum( FEELING, Feeling.class );
|
||||||
if (feeling == Feeling.DARK)
|
if (feeling == Feeling.DARK)
|
||||||
viewDistance = (int)Math.ceil(viewDistance/3f);
|
viewDistance = (int)Math.ceil(viewDistance/3f);
|
||||||
|
@ -361,7 +354,6 @@ public abstract class Level implements Bundlable {
|
||||||
bundle.put( PLANTS, plants.values() );
|
bundle.put( PLANTS, plants.values() );
|
||||||
bundle.put( MOBS, mobs );
|
bundle.put( MOBS, mobs );
|
||||||
bundle.put( BLOBS, blobs.values() );
|
bundle.put( BLOBS, blobs.values() );
|
||||||
bundle.put( FALLING, fallingItems);
|
|
||||||
bundle.put( FEELING, feeling );
|
bundle.put( FEELING, feeling );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,8 +626,8 @@ public abstract class Level implements Bundlable {
|
||||||
heap = new Heap();
|
heap = new Heap();
|
||||||
heap.pos = cell;
|
heap.pos = cell;
|
||||||
if (map[cell] == Terrain.CHASM || (Dungeon.level != null && pit[cell])) {
|
if (map[cell] == Terrain.CHASM || (Dungeon.level != null && pit[cell])) {
|
||||||
|
Dungeon.dropToChasm( item );
|
||||||
GameScene.discard( heap );
|
GameScene.discard( heap );
|
||||||
fallingItems.add(item);
|
|
||||||
} else {
|
} else {
|
||||||
heaps.put( cell, heap );
|
heaps.put( cell, heap );
|
||||||
GameScene.add( heap );
|
GameScene.add( heap );
|
||||||
|
|
|
@ -18,8 +18,11 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.*;
|
import com.shatteredpixel.shatteredpixeldungeon.*;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.LootIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.LootIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ResumeIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ResumeIndicator;
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
|
@ -306,7 +309,24 @@ public class GameScene extends PixelScene {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayList<Item> dropped = Dungeon.droppedItems.get( Dungeon.depth );
|
||||||
|
if (dropped != null) {
|
||||||
|
for (Item item : dropped) {
|
||||||
|
int pos = Dungeon.level.randomRespawnCell();
|
||||||
|
if (item instanceof Potion) {
|
||||||
|
((Potion)item).shatter( pos );
|
||||||
|
} else if (item instanceof Plant.Seed) {
|
||||||
|
Dungeon.level.plant( (Plant.Seed)item, pos );
|
||||||
|
} else if (item instanceof Honeypot) {
|
||||||
|
(Honeypot)item.shatter( pos );
|
||||||
|
} else {
|
||||||
|
Dungeon.level.drop( item, pos );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Dungeon.droppedItems.remove( Dungeon.depth );
|
||||||
|
}
|
||||||
|
|
||||||
Camera.main.target = hero;
|
Camera.main.target = hero;
|
||||||
fadeIn();
|
fadeIn();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndError;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndError;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory;
|
||||||
|
@ -35,7 +33,6 @@ import com.watabou.noosa.audio.Sample;
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class InterlevelScene extends PixelScene {
|
public class InterlevelScene extends PixelScene {
|
||||||
|
|
||||||
|
@ -212,9 +209,6 @@ public class InterlevelScene extends PixelScene {
|
||||||
|
|
||||||
private void descend() throws IOException {
|
private void descend() throws IOException {
|
||||||
|
|
||||||
Level level;
|
|
||||||
ArrayList<Item> fallingItems = new ArrayList<Item>();
|
|
||||||
|
|
||||||
Actor.fixTime();
|
Actor.fixTime();
|
||||||
if (Dungeon.hero == null) {
|
if (Dungeon.hero == null) {
|
||||||
Dungeon.init();
|
Dungeon.init();
|
||||||
|
@ -223,64 +217,31 @@ public class InterlevelScene extends PixelScene {
|
||||||
noStory = false;
|
noStory = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
level = Dungeon.level;
|
|
||||||
|
|
||||||
fallingItems = level.fallingItems;
|
|
||||||
level.fallingItems = new ArrayList<Item>();
|
|
||||||
|
|
||||||
Dungeon.saveLevel();
|
Dungeon.saveLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Level level;
|
||||||
if (Dungeon.depth >= Statistics.deepestFloor) {
|
if (Dungeon.depth >= Statistics.deepestFloor) {
|
||||||
level = Dungeon.newLevel();
|
level = Dungeon.newLevel();
|
||||||
} else {
|
} else {
|
||||||
Dungeon.depth++;
|
Dungeon.depth++;
|
||||||
level = Dungeon.loadLevel( Dungeon.hero.heroClass );
|
level = Dungeon.loadLevel( Dungeon.hero.heroClass );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Item item : fallingItems){
|
|
||||||
int cell = level.randomRespawnCell();
|
|
||||||
while (cell == -1)
|
|
||||||
cell = level.randomRespawnCell();
|
|
||||||
|
|
||||||
if (!(item instanceof Potion))
|
|
||||||
level.drop(item, cell);
|
|
||||||
else
|
|
||||||
level.fallingPotions.add((Potion)item);
|
|
||||||
}
|
|
||||||
|
|
||||||
Dungeon.switchLevel( level, level.entrance );
|
Dungeon.switchLevel( level, level.entrance );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fall() throws IOException {
|
private void fall() throws IOException {
|
||||||
|
|
||||||
Level level = Dungeon.level;
|
|
||||||
|
|
||||||
ArrayList<Item> fallingItems = level.fallingItems;
|
|
||||||
level.fallingItems = new ArrayList<Item>();
|
|
||||||
|
|
||||||
Actor.fixTime();
|
Actor.fixTime();
|
||||||
Dungeon.saveLevel();
|
Dungeon.saveLevel();
|
||||||
|
|
||||||
|
Level level;
|
||||||
if (Dungeon.depth >= Statistics.deepestFloor) {
|
if (Dungeon.depth >= Statistics.deepestFloor) {
|
||||||
level = Dungeon.newLevel();
|
level = Dungeon.newLevel();
|
||||||
} else {
|
} else {
|
||||||
Dungeon.depth++;
|
Dungeon.depth++;
|
||||||
level = Dungeon.loadLevel( Dungeon.hero.heroClass );
|
level = Dungeon.loadLevel( Dungeon.hero.heroClass );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Item item : fallingItems){
|
|
||||||
int cell = level.randomRespawnCell();
|
|
||||||
while (cell == -1)
|
|
||||||
cell = level.randomRespawnCell();
|
|
||||||
|
|
||||||
if (!(item instanceof Potion))
|
|
||||||
level.drop(item, cell);
|
|
||||||
else
|
|
||||||
level.fallingPotions.add((Potion)item);
|
|
||||||
}
|
|
||||||
|
|
||||||
Dungeon.switchLevel( level, fallIntoPit ? level.pitCell() : level.randomRespawnCell() );
|
Dungeon.switchLevel( level, fallIntoPit ? level.pitCell() : level.randomRespawnCell() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user