use of com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion 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);
}
}
use of com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion in project shattered-pixel-dungeon-gdx by 00-Evan.
the class MissileWeapon method rangedHit.
protected void rangedHit(Char enemy, int cell) {
// unless a weapon is about to break, then break the one being thrown
if (parent != null) {
if (parent.durability <= parent.durabilityPerUse()) {
durability = 0;
parent.durability = MAX_DURABILITY;
} else {
parent.durability -= parent.durabilityPerUse();
}
parent = null;
} else {
durability -= durabilityPerUse();
}
if (durability > 0) {
// attempt to stick the missile weapon to the enemy, just drop it if we can't.
if (enemy.isAlive() && sticky) {
PinCushion p = Buff.affect(enemy, PinCushion.class);
if (p.target == enemy) {
p.stick(this);
return;
}
}
Dungeon.level.drop(this, enemy.pos).sprite.drop();
}
}
Aggregations