Search in sources :

Example 1 with SoulMark

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

the class WandOfCorruption method corruptEnemy.

private void corruptEnemy(Mob enemy) {
    // cannot re-corrupt or doom an enemy, so give them a major debuff instead
    if (enemy.buff(Corruption.class) != null || enemy.buff(Doom.class) != null) {
        GLog.w(Messages.get(this, "already_corrupted"));
        return;
    }
    if (!enemy.isImmune(Corruption.class)) {
        enemy.HP = enemy.HT;
        for (Buff buff : enemy.buffs()) {
            if (buff.type == Buff.buffType.NEGATIVE && !(buff instanceof SoulMark)) {
                buff.detach();
            } else if (buff instanceof PinCushion) {
                buff.detach();
            }
        }
        Buff.affect(enemy, Corruption.class);
        Statistics.enemiesSlain++;
        Badges.validateMonstersSlain();
        Statistics.qualifiedForNoKilling = false;
        if (enemy.EXP > 0 && curUser.lvl <= enemy.maxLvl) {
            curUser.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP));
            curUser.earnExp(enemy.EXP);
        }
        enemy.rollToDropLoot();
    } else {
        Buff.affect(enemy, Doom.class);
    }
}
Also used : SoulMark(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark) Corruption(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption) PinCushion(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion) FlavourBuff(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff) Buff(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff)

Aggregations

Buff (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff)1 Corruption (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption)1 FlavourBuff (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff)1 PinCushion (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion)1 SoulMark (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark)1