v0.6.1: various improvements to the tengu boss fight

This commit is contained in:
Evan Debenham 2017-08-04 23:08:06 -04:00
parent 5285d2e576
commit 2dabf54a5d

View File

@ -297,7 +297,7 @@ public class PrisonBossLevel extends Level {
case FIGHT_START: case FIGHT_START:
changeMap(MAP_MAZE); changeMap(MAP_MAZE);
clearEntities((Room) new Room().set(0, 5, 8, 32)); //clear all but the entrance clearEntities((Room) new Room().set(0, 5, 8, 32)); //clear the entrance
Actor.remove(tengu); Actor.remove(tengu);
mobs.remove(tengu); mobs.remove(tengu);
@ -327,7 +327,13 @@ public class PrisonBossLevel extends Level {
Dungeon.hero.sprite.place(Dungeon.hero.pos); Dungeon.hero.sprite.place(Dungeon.hero.pos);
changeMap(MAP_ARENA); changeMap(MAP_ARENA);
clearEntities(null); clearEntities( (Room) new Room().set(0, 0, 10, 4)); //clear all but the area right around the teleport spot
//if any characters are left over, move them along the same way as the hero
for (Mob m : mobs){
m.pos += 9+3*32;
m.sprite().place(m.pos);
}
tengu.state = tengu.HUNTING; tengu.state = tengu.HUNTING;
do { do {
@ -335,6 +341,9 @@ public class PrisonBossLevel extends Level {
} while (solid[tengu.pos] || distance(tengu.pos, Dungeon.hero.pos) < 8); } while (solid[tengu.pos] || distance(tengu.pos, Dungeon.hero.pos) < 8);
GameScene.add(tengu); GameScene.add(tengu);
tengu.notice(); tengu.notice();
GameScene.flash(0xFFFFFF);
Sample.INSTANCE.play(Assets.SND_BLAST);
state = State.FIGHT_ARENA; state = State.FIGHT_ARENA;
break; break;
@ -362,13 +371,32 @@ public class PrisonBossLevel extends Level {
tengu.sprite.place(5 + 28 * 32); tengu.sprite.place(5 + 28 * 32);
changeMap(MAP_END); changeMap(MAP_END);
//remove all mobs, but preserve allies
ArrayList<Mob> allies = new ArrayList<>();
for(Mob m : mobs.toArray(new Mob[0])){
if (m.ally){
allies.add(m);
mobs.remove(m);
}
}
clearEntities(null); clearEntities(null);
for (Mob m : allies){
do{
m.pos = Random.IntRange(3, 7) + Random.IntRange(26, 30)*32;
} while (findMob(m.pos) != null);
m.sprite().place(m.pos);
mobs.add(m);
}
tengu.die(Dungeon.hero); tengu.die(Dungeon.hero);
for (Item item : storedItems) for (Item item : storedItems)
drop(item, randomPrisonCell()); drop(item, randomPrisonCell());
GameScene.flash(0xFFFFFF);
Sample.INSTANCE.play(Assets.SND_BLAST);
state = State.WON; state = State.WON;
break; break;
} }