Search in sources :

Example 1 with King

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King in project shattered-pixel-dungeon-gdx by 00-Evan.

the class CityBossLevel method press.

@Override
public void press(int cell, Char hero) {
    super.press(cell, hero);
    if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) {
        enteredArena = true;
        seal();
        for (Mob m : mobs) {
            // bring the first ally with you
            if (m.alignment == Char.Alignment.ALLY) {
                m.pos = Dungeon.hero.pos + (Random.Int(2) == 0 ? +1 : -1);
                m.sprite.place(m.pos);
                break;
            }
        }
        King boss = new King();
        boss.state = boss.WANDERING;
        int count = 0;
        do {
            boss.pos = Random.Int(length());
        } while (!passable[boss.pos] || !outsideEntraceRoom(boss.pos) || (heroFOV[boss.pos] && count++ < 20));
        GameScene.add(boss);
        if (heroFOV[boss.pos]) {
            boss.notice();
            boss.sprite.alpha(0);
            boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f));
        }
        set(arenaDoor, Terrain.LOCKED_DOOR);
        GameScene.updateMap(arenaDoor);
        Dungeon.observe();
    }
}
Also used : Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob) King(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King) AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Aggregations

King (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King)1 Mob (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob)1 AlphaTweener (com.watabou.noosa.tweeners.AlphaTweener)1