v0.3.0c: refactored finding a character, no longer need to maintain chars[] array

This commit is contained in:
Evan Debenham
2015-06-06 00:17:07 -04:00
parent 3cf7979a4c
commit dbeff25d2c
12 changed files with 9 additions and 46 deletions
@@ -181,8 +181,6 @@ public class Ghost extends NPC {
}
if (newPos != -1) {
Actor.freeCell(pos);
CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
pos = newPos;
sprite.place(pos);
@@ -317,7 +315,6 @@ public class Ghost extends NPC {
ghost.pos = level.randomRespawnCell();
} while (ghost.pos == -1);
level.mobs.add( ghost );
Actor.occupyCell( ghost );
spawned = true;
//dungeon depth determines type of quest.
@@ -217,9 +217,8 @@ public class Imp extends NPC {
npc.pos = level.randomRespawnCell();
} while (npc.pos == -1 || level.heaps.get( npc.pos ) != null);
level.mobs.add( npc );
Actor.occupyCell( npc );
spawned = true;
spawned = true;
alternative = Random.Int( 2 ) == 0;
given = false;
@@ -214,7 +214,6 @@ public class Wandmaker extends NPC {
npc.pos = room.random();
} while (level.map[npc.pos] == Terrain.ENTRANCE || level.map[npc.pos] == Terrain.SIGN);
level.mobs.add( npc );
Actor.occupyCell( npc );
spawned = true;
alternative = Random.Int( 2 ) == 0;