@Override protected boolean doAttack(Char enemy) { if (Level.distance(pos, enemy.pos) <= 1) { return super.doAttack(enemy); } else { boolean visible = Level.fieldOfView[pos] || Level.fieldOfView[enemy.pos]; if (visible) { ((AirElementalSprite) sprite).zap(enemy.pos); } spend(TIME_TO_ZAP); if (hit(this, enemy, true)) { int dmg = Random.Int(2, (dmgMax / 3)); if (Level.water[enemy.pos] && !enemy.flying) { dmg *= 1.5f; } enemy.damage(dmg, LightningTrap.LIGHTNING); enemy.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); enemy.sprite.flash(); if (enemy == Dungeon.hero) { Camera.main.shake(2, 0.3f); if (!enemy.isAlive()) { Dungeon.fail(Utils.format(ResultDescriptions.MOB, Utils.indefinite(name))); GLog.n(TXT_LIGHTNING_KILLED, name); } } } else { enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb()); } return !visible; } }
@Override public String toString() { return levelKnown ? Utils.format( TXT_TO_STRING, super.toString(), STR ) : super.toString(); }
@Override public String toString() { return Utils.format(TXT_FROM_DEPTH, depth); }