@Override
  public void execute(Hero hero, String action) {

    super.execute(hero, action);

    if (action.equals(AC_EAT)) {

      switch (Random.Int(5)) {
        case 0:
          GLog.w("Oh it's hot!");
          Buff.affect(hero, Burning.class).reignite(hero);
          break;
        case 1:
          GLog.w("You can't feel your legs!");
          Buff.prolong(hero, Roots.class, Paralysis.duration(hero));
          break;
        case 2:
          GLog.w("You are not feeling well.");
          Buff.affect(hero, Poison.class).set(Poison.durationFactor(hero) * hero.HT / 5);
          break;
        case 3:
          GLog.w("You are stuffed.");
          Buff.prolong(hero, Slow.class, Slow.duration(hero));
          break;
      }
    }
  }
예제 #2
0
    @Override
    public int attackProc(Char enemy, int damage) {
      if (Random.Int(MAX_ARMY_SIZE) == 0) {
        Buff.prolong(enemy, Paralysis.class, 1);
      }

      return damage;
    }