Search in sources :

Example 1 with BlackSkull

use of com.nyrds.pixeldungeon.items.necropolis.BlackSkull in project pixel-dungeon-remix by NYRDS.

the class Lich method die.

@Override
public void die(Object cause) {
    GameScene.bossSlain();
    if (Dungeon.hero.heroClass == HeroClass.NECROMANCER) {
        Dungeon.level.drop(new BlackSkullOfMastery(), getPos()).sprite.drop();
    } else {
        Dungeon.level.drop(new BlackSkull(), getPos()).sprite.drop();
    }
    super.die(cause);
    Dungeon.level.drop(new SkeletonKey(), getPos()).sprite.drop();
    // Kill everything
    skulls.clear();
    Mob mob = Dungeon.level.getRandomMob();
    while (mob != null) {
        mob.remove();
        mob = Dungeon.level.getRandomMob();
    }
    Badges.validateBossSlain(Badges.Badge.LICH_SLAIN);
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) BlackSkullOfMastery(com.nyrds.pixeldungeon.items.necropolis.BlackSkullOfMastery) BlackSkull(com.nyrds.pixeldungeon.items.necropolis.BlackSkull) SkeletonKey(com.watabou.pixeldungeon.items.keys.SkeletonKey)

Example 2 with BlackSkull

use of com.nyrds.pixeldungeon.items.necropolis.BlackSkull in project pixel-dungeon-remix by NYRDS.

the class WndChooseWay method btnBreakSpell.

private void btnBreakSpell(RedButton btnWay1) {
    RedButton btnWay2 = new RedButton(Utils.capitalize(TXT_BREAK_SPELL_BTN)) {

        @Override
        protected void onClick() {
            hide();
            Hero hero = Dungeon.hero;
            Item a = hero.belongings.getItem(BlackSkullOfMastery.class);
            a.removeItemFrom(hero);
            Item b = new BlackSkull();
            Dungeon.level.drop(b, hero.getPos()).sprite.drop();
        }
    };
    btnWay2.setRect(btnWay1.right() + GAP, btnWay1.top(), btnWay1.width(), BTN_HEIGHT);
    add(btnWay2);
}
Also used : Item(com.watabou.pixeldungeon.items.Item) MasteryItem(com.nyrds.pixeldungeon.items.common.MasteryItem) Hero(com.watabou.pixeldungeon.actors.hero.Hero) RedButton(com.watabou.pixeldungeon.ui.RedButton) BlackSkull(com.nyrds.pixeldungeon.items.necropolis.BlackSkull)

Example 3 with BlackSkull

use of com.nyrds.pixeldungeon.items.necropolis.BlackSkull 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

BlackSkull (com.nyrds.pixeldungeon.items.necropolis.BlackSkull)3 Hero (com.watabou.pixeldungeon.actors.hero.Hero)2 Item (com.watabou.pixeldungeon.items.Item)2 MasteryItem (com.nyrds.pixeldungeon.items.common.MasteryItem)1 NecromancerRobe (com.nyrds.pixeldungeon.items.common.armor.NecromancerRobe)1 BlackSkullOfMastery (com.nyrds.pixeldungeon.items.necropolis.BlackSkullOfMastery)1 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)1 SkeletonKey (com.watabou.pixeldungeon.items.keys.SkeletonKey)1 RedButton (com.watabou.pixeldungeon.ui.RedButton)1