use of com.watabou.pixeldungeon.effects.Pushing in project pixel-dungeon by watabou.
the class CursePersonification method attackProc.
@Override
public int attackProc(Char enemy, int damage) {
for (int i = 0; i < Level.NEIGHBOURS8.length; i++) {
int ofs = Level.NEIGHBOURS8[i];
if (enemy.pos - pos == ofs) {
int newPos = enemy.pos + ofs;
if ((Level.passable[newPos] || Level.avoid[newPos]) && Actor.findChar(newPos) == null) {
Actor.addDelayed(new Pushing(enemy, enemy.pos, newPos), -1);
enemy.pos = newPos;
// FIXME
if (enemy instanceof Mob) {
Dungeon.level.mobPress((Mob) enemy);
} else {
Dungeon.level.press(newPos, enemy);
}
}
break;
}
}
return super.attackProc(enemy, damage);
}
Aggregations