Ejemplo n.º 1
0
    @Override
    public void execute(Hero hero, String action) {

      super.execute(hero, action);

      if (action.equals(Food.AC_EAT)) {
        ScrollOfTeleportation.teleportHero(hero);
        hero.spendAndNext(1);
        hero.curAction = null;
        Buff.affect(hero, Vertigo.class, Vertigo.DURATION * 2);
      }
    }
Ejemplo n.º 2
0
  public void effect(int pos, Char ch) {
    if (ch instanceof Hero) {
      Hero hero = (Hero) ch;
      ScrollOfTeleportation.teleportHero(hero);
      hero.spendAndNext(1);
      hero.curAction = null;

    } else if (ch instanceof Mob) {

      int newPos = Dungeon.level.randomRespawnCell();
      if (newPos != -1) {
        ch.setPos(newPos);
        ch.getSprite().place(ch.getPos());
        ch.getSprite().setVisible(Dungeon.visible[pos]);
      }
    }

    if (Dungeon.visible[pos]) {
      CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
    }
  }