Search in sources :

Example 1 with PinCushion

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

Example 2 with PinCushion

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();
    }
}
Also used : PinCushion(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion)

Aggregations

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