@Override public int proc(Armor armor, Char attacker, Char defender, int damage) { int level = Math.max(0, armor.level); if (Random.Int(4) == 0) { Buff.prolong(defender, Roots.class, 5 - level / 5); Buff.affect(defender, Earthroot.Armor.class).level(5 * (level + 1)); CellEmitter.bottom(defender.pos).start(EarthParticle.FACTORY, 0.05f, 8); Camera.main.shake(1, 0.4f); } return damage; }
@Override public int proc(Armor armor, Char attacker, Char defender, int damage) { int level = Math.max(0, armor.level); if (Level.adjacent(attacker.pos, defender.pos) && Random.Int(level + 6) >= 5) { Buff.prolong(attacker, Frost.class, Frost.duration(attacker) * Random.Float(1f, 1.5f)); CellEmitter.get(attacker.pos).start(SnowParticle.FACTORY, 0.2f, 6); Buff.affect(defender, Burning.class).reignite(defender); defender.sprite.emitter().burst(FlameParticle.FACTORY, 5); } return damage; }
public static void change(Char ch) { Hero hero = Dungeon.hero; if (!ch.crawling) { Buff.affect(hero, Crawling.class, Crawling.DURATION); GLog.i("You lie on the ground. Enemies will struggle to detect you."); } else if (ch.crawling) { ch.crawling = false; } }
@Override public void execute(Hero hero, String action) { super.execute(hero, action); if (action.equals(AC_EAT)) { switch (Random.Int(5)) { case 0: GLog.i("You see your hands turn invisible!"); Buff.affect(hero, Invisibility.class, Invisibility.DURATION); break; case 1: GLog.i("You feel your skin hardens!"); Buff.affect(hero, Barkskin.class).level(hero.HT / 4); break; case 2: GLog.i("Refreshing!"); Buff.detach(hero, Poison.class); Buff.detach(hero, Cripple.class); Buff.detach(hero, Weakness.class); Buff.detach(hero, Bleeding.class); break; case 3: GLog.i("You feel better!"); if (hero.HP < hero.HT) { hero.HP = Math.min(hero.HP + hero.HT / 4, hero.HT); hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); } break; } } }