Search in sources :

Example 1 with WndResurrect

use of com.watabou.pixeldungeon.windows.WndResurrect in project pixel-dungeon by watabou.

the class Hero method die.

@Override
public void die(Object cause) {
    curAction = null;
    DewVial.autoDrink(this);
    if (isAlive()) {
        new Flare(8, 32).color(0xFFFF66, true).show(sprite, 2f);
        return;
    }
    Actor.fixTime();
    super.die(cause);
    Ankh ankh = (Ankh) belongings.getItem(Ankh.class);
    if (ankh == null) {
        reallyDie(cause);
    } else {
        Dungeon.deleteGame(Dungeon.hero.heroClass, false);
        GameScene.show(new WndResurrect(ankh, cause));
    }
}
Also used : WndResurrect(com.watabou.pixeldungeon.windows.WndResurrect) Flare(com.watabou.pixeldungeon.effects.Flare) Ankh(com.watabou.pixeldungeon.items.Ankh)

Example 2 with WndResurrect

use of com.watabou.pixeldungeon.windows.WndResurrect in project pixel-dungeon-remix by NYRDS.

the class Hero method die.

@Override
public void die(Object cause) {
    clearActions();
    DewVial.autoDrink(this);
    if (isAlive()) {
        new Flare(8, 32).color(0xFFFF66, true).show(getSprite(), 2f);
        return;
    }
    Actor.fixTime();
    super.die(cause);
    Ankh ankh = belongings.getItem(Ankh.class);
    if (ankh == null) {
        if (this.subClass == HeroSubClass.LICH && this.getSoulPoints() == this.getSoulPointsMax()) {
            this.setSoulPoints(0);
            Dungeon.deleteGame(false);
            GameScene.show(new WndResurrect(null, cause));
        } else {
            reallyDie(cause);
        }
    } else {
        Dungeon.deleteGame(false);
        while (belongings.removeItem(ankh)) {
        }
        GameScene.show(new WndResurrect(ankh, cause));
    }
}
Also used : WndResurrect(com.watabou.pixeldungeon.windows.WndResurrect) Flare(com.watabou.pixeldungeon.effects.Flare) Ankh(com.watabou.pixeldungeon.items.Ankh)

Aggregations

Flare (com.watabou.pixeldungeon.effects.Flare)2 Ankh (com.watabou.pixeldungeon.items.Ankh)2 WndResurrect (com.watabou.pixeldungeon.windows.WndResurrect)2