@Override
  protected void doRead() {

    new Flare(5, 32).color(0xFF0000, true).show(curUser.sprite, 2f);
    Sample.INSTANCE.play(Assets.SND_READ);
    Invisibility.dispel();

    int count = 0;
    Mob affected = null;
    for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
      if (Level.fieldOfView[mob.pos]) {
        Buff.affect(mob, Terror.class, Terror.DURATION).object = curUser.id();

        count++;
        affected = mob;
      }
    }

    switch (count) {
      case 0:
        GLog.i("The scroll emits a brilliant flash of red light");
        break;
      case 1:
        GLog.i(
            "The scroll emits a brilliant flash of red light and the " + affected.name + " flees!");
        break;
      default:
        GLog.i("The scroll emits a brilliant flash of red light and the monsters flee!");
    }
    setKnown();

    readAnimation();
  }
Esempio n. 2
0
  protected void wandEffect(final int cell) {
    setKnown();

    QuickSlot.target(curItem, Actor.findChar(cell));

    if (curCharges > 0) {

      getCurUser().busy();

      fx(
          cell,
          new Callback() {
            @Override
            public void call() {
              onZap(cell);
              wandUsed();
            }
          });

      Invisibility.dispel(getCurUser());
    } else {

      getCurUser().spendAndNext(TIME_TO_ZAP);
      GLog.w(TXT_FIZZLES);
      levelKnown = true;

      if (Random.Int(5) == 0) {
        identify();
      }

      updateQuickslot();
    }
  }
Esempio n. 3
0
  @Override
  public void onAttackComplete() {

    AttackIndicator.target(enemy);

    attack(enemy);
    curAction = null;

    Invisibility.dispel();

    super.onAttackComplete();
  }