Search in sources :

Example 1 with NecromancerRobe

use of com.nyrds.pixeldungeon.items.common.armor.NecromancerRobe in project pixel-dungeon-remix by NYRDS.

the class Mob method die.

@Override
public void die(Object cause) {
    runMobScript("onDie", cause);
    Hero hero = Dungeon.hero;
    {
        // TODO we should move this block out of Mob class
        if (hero.heroClass == HeroClass.NECROMANCER) {
            if (hero.isAlive()) {
                if (hero.belongings.armor instanceof NecromancerRobe) {
                    hero.accumulateSoulPoints();
                }
            }
        }
        for (Item item : hero.belongings) {
            if (item instanceof BlackSkull && item.isEquipped(hero)) {
                ((BlackSkull) item).mobDied(this, hero);
            }
        }
    }
    {
        if (hero.isAlive()) {
            if (!friendly(hero)) {
                Statistics.enemiesSlain++;
                Badges.validateMonstersSlain();
                Statistics.qualifiedForNoKilling = false;
                if (Dungeon.nightMode) {
                    Statistics.nightHunt++;
                } else {
                    Statistics.nightHunt = 0;
                }
                Badges.validateNightHunter();
            }
            if (!(cause instanceof Mob) || hero.heroClass == HeroClass.NECROMANCER) {
                if (hero.lvl() <= maxLvl && exp > 0) {
                    hero.earnExp(exp);
                }
            }
        }
    }
    super.die(cause);
    Library.identify(Library.MOB, getMobClassName());
    if (hero.lvl() <= maxLvl + 2) {
        dropLoot();
    }
    if (hero.isAlive() && !Dungeon.visible[getPos()]) {
        GLog.i(TXT_DIED);
    }
}
Also used : NecromancerRobe(com.nyrds.pixeldungeon.items.common.armor.NecromancerRobe) Item(com.watabou.pixeldungeon.items.Item) Hero(com.watabou.pixeldungeon.actors.hero.Hero) BlackSkull(com.nyrds.pixeldungeon.items.necropolis.BlackSkull)

Aggregations

NecromancerRobe (com.nyrds.pixeldungeon.items.common.armor.NecromancerRobe)1 BlackSkull (com.nyrds.pixeldungeon.items.necropolis.BlackSkull)1 Hero (com.watabou.pixeldungeon.actors.hero.Hero)1 Item (com.watabou.pixeldungeon.items.Item)1