@Override public boolean attack(Char enemy) { for (int i = 1; i < Ballistica.distance; i++) { int pos = Ballistica.trace[i]; Char ch = Actor.findChar(pos); if (ch == null) { continue; } if (hit(this, ch, true)) { ch.damage(Random.NormalIntRange(14, 20), this); if (Dungeon.visible[pos]) { ch.getSprite().flash(); CellEmitter.center(pos).burst(PurpleParticle.BURST, Random.IntRange(1, 2)); } if (!ch.isAlive() && ch == Dungeon.hero) { Dungeon.fail( Utils.format(ResultDescriptions.MOB, Utils.indefinite(getName()), Dungeon.depth)); GLog.n(TXT_DEATHGAZE_KILLED, getName()); } } else { ch.getSprite().showStatus(CharSprite.NEUTRAL, ch.defenseVerb()); } } return true; }
public void effect(int pos, Char ch) { if (ch instanceof Hero) { Hero hero = (Hero) ch; ScrollOfTeleportation.teleportHero(hero); hero.spendAndNext(1); hero.curAction = null; } else if (ch instanceof Mob) { int newPos = Dungeon.level.randomRespawnCell(); if (newPos != -1) { ch.setPos(newPos); ch.getSprite().place(ch.getPos()); ch.getSprite().setVisible(Dungeon.visible[pos]); } } if (Dungeon.visible[pos]) { CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); } }
protected void fx(int cell, Callback callback) { MagicMissile.blueLight(wandUser.getSprite().getParent(), wandUser.getPos(), cell, callback); Sample.INSTANCE.play(Assets.SND_ZAP); }