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);
}
}
Aggregations