@Override public boolean act() { if (target.isAlive()) { if ((level = Random.NormalIntRange(level / 2, level)) > 0) { target.damage(level, this); if (target.sprite.visible) { Splash.at( target.sprite.center(), -PointF.PI / 2, PointF.PI / 6, target.sprite.blood(), Math.min(10 * level / target.HT, 10)); } if (target == Dungeon.hero && !target.isAlive()) { Dungeon.fail(getClass()); GLog.n(Messages.get(this, "ondeath")); } spend(TICK); } else { detach(); } } else { detach(); } return true; }
public boolean checkOwner(Char owner) { if (!owner.isAlive() && owner instanceof Hero) { Dungeon.fail(Utils.format(ResultDescriptions.GLYPH, name())); GLog.n("%s killed you...", name()); Badges.validateDeathFromGlyph(); return true; } else { return false; } }