public void observe() { if (weapon != null) { weapon.identify(); Badges.validateItemLevelAquired(weapon); } if (armor != null) { armor.identify(); Badges.validateItemLevelAquired(armor); } if (misc1 != null) { misc1.identify(); Badges.validateItemLevelAquired(misc1); } if (misc2 != null) { misc2.identify(); Badges.validateItemLevelAquired(misc2); } for (Item item : backpack) { item.cursedKnown = true; } }
@Override public void execute(Hero hero, String action) { if (action.equals(AC_EAT)) { detach(hero.belongings.backpack); ((Hunger) hero.buff(Hunger.class)).satisfy(energy); GLog.i(message); switch (hero.heroClass) { case WARRIOR: if (hero.HP < hero.HT) { hero.HP = Math.min(hero.HP + 5, hero.HT); hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); } break; case MAGE: hero.belongings.charge(false); ScrollOfRecharging.charge(hero); break; case ROGUE: case HUNTRESS: break; } hero.sprite.operate(hero.pos); hero.busy(); SpellSprite.show(hero, SpellSprite.FOOD); Sample.INSTANCE.play(Assets.SND_EAT); hero.spend(TIME_TO_EAT); Statistics.foodEaten++; Badges.validateFoodEaten(); } else { super.execute(hero, action); } }
@Override public void die(Object cause) { super.die(cause); Badges.validateRare(this); }