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