Ejemplo n.º 1
0
  public void earnExp(int exp) {

    this.exp += exp;

    boolean levelUp = false;
    while (this.exp >= maxExp()) {
      this.exp -= maxExp();
      lvl++;

      HT += 5;
      HP += 5;
      attackSkill++;
      defenseSkill++;

      if (lvl < 10) {
        updateAwareness();
      }

      levelUp = true;
    }

    if (levelUp) {

      GLog.p(TXT_NEW_LEVEL, lvl);
      sprite.showStatus(CharSprite.POSITIVE, TXT_LEVEL_UP);
      Sample.INSTANCE.play(Assets.SND_LEVELUP);

      Badges.validateLevelReached();
    }

    if (subClass == HeroSubClass.WARLOCK) {

      int value = Math.min(HT - HP, 1 + (Dungeon.depth - 1) / 5);
      if (value > 0) {
        HP += value;
        sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
      }

      ((Hunger) buff(Hunger.class)).satisfy(1);
    }
  }
Ejemplo n.º 2
0
  @Override
  public void use(BlobEmitter emitter) {
    super.use(emitter);

    emitter.pour(Speck.factory(Speck.TOXIC), 0.6f);
  }