Search in sources :

Example 1 with Terror

use of com.watabou.pixeldungeon.actors.buffs.Terror in project pixel-dungeon-remix by NYRDS.

the class ScrollOfTerror method doRead.

@Override
protected void doRead() {
    new Flare(5, 32).color(0xFF0000, true).show(getCurUser().getSprite(), 2f);
    Sample.INSTANCE.play(Assets.SND_READ);
    Invisibility.dispel(getCurUser());
    int count = 0;
    Mob affected = null;
    for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
        if (Dungeon.level.fieldOfView[mob.getPos()]) {
            Terror terror = Buff.affect(mob, Terror.class, Terror.DURATION);
            terror.source = getCurUser();
            count++;
            affected = mob;
        }
    }
    switch(count) {
        case 0:
            GLog.i(Game.getVar(R.string.ScrollOfTerror_Info1));
            break;
        case 1:
            GLog.i(Utils.format(Game.getVar(R.string.ScrollOfTerror_Info2), affected.getName()));
            break;
        default:
            GLog.i(Game.getVar(R.string.ScrollOfTerror_Info3));
    }
    setKnown();
    getCurUser().spendAndNext(TIME_TO_READ);
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Flare(com.watabou.pixeldungeon.effects.Flare) Terror(com.watabou.pixeldungeon.actors.buffs.Terror)

Example 2 with Terror

use of com.watabou.pixeldungeon.actors.buffs.Terror in project pixel-dungeon-remix by NYRDS.

the class Rat method canAttack.

@Override
protected boolean canAttack(Char enemy) {
    if (enemy.hasBuff(RatSkull.RatterAura.class)) {
        setState(FLEEING);
        if (!hasBuff(Terror.class)) {
            new Flare(5, 32).color(0xFF0000, true).show(getSprite(), 2f);
            Terror terror = Buff.affect(this, Terror.class, Terror.DURATION);
            terror.source = enemy;
            return false;
        }
    }
    return super.canAttack(enemy);
}
Also used : Flare(com.watabou.pixeldungeon.effects.Flare) RatSkull(com.watabou.pixeldungeon.items.quest.RatSkull) Terror(com.watabou.pixeldungeon.actors.buffs.Terror)

Aggregations

Terror (com.watabou.pixeldungeon.actors.buffs.Terror)2 Flare (com.watabou.pixeldungeon.effects.Flare)2 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)1 RatSkull (com.watabou.pixeldungeon.items.quest.RatSkull)1