Пример #1
0
  @Override
  public String getDescription(Hero hero) {
    String description = getDescription();
    // COOLDOWN
    int cooldown =
        (SkillConfigManager.getUseSetting(hero, this, SkillSetting.COOLDOWN.node(), 0, false)
                - SkillConfigManager.getUseSetting(
                        hero, this, SkillSetting.COOLDOWN_REDUCE.node(), 0, false)
                    * hero.getSkillLevel(this))
            / 1000;
    if (cooldown > 0) {
      description += " CD:" + cooldown + "s";
    }

    // MANA
    int mana =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.MANA.node(), 10, false)
            - (SkillConfigManager.getUseSetting(
                    hero, this, SkillSetting.MANA_REDUCE.node(), 0, false)
                * hero.getSkillLevel(this));
    if (mana > 0) {
      description += " M:" + mana;
    }

    // HEALTH_COST
    int healthCost =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.HEALTH_COST, 0, false)
            - (SkillConfigManager.getUseSetting(
                    hero, this, SkillSetting.HEALTH_COST_REDUCE, mana, true)
                * hero.getSkillLevel(this));
    if (healthCost > 0) {
      description += " HP:" + healthCost;
    }

    // STAMINA
    int staminaCost =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.STAMINA.node(), 0, false)
            - (SkillConfigManager.getUseSetting(
                    hero, this, SkillSetting.STAMINA_REDUCE.node(), 0, false)
                * hero.getSkillLevel(this));
    if (staminaCost > 0) {
      description += " FP:" + staminaCost;
    }

    // DELAY
    int delay =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.DELAY.node(), 0, false) / 1000;
    if (delay > 0) {
      description += " W:" + delay + "s";
    }

    // EXP
    int exp = SkillConfigManager.getUseSetting(hero, this, SkillSetting.EXP.node(), 0, false);
    if (exp > 0) {
      description += " XP:" + exp;
    }
    return description;
  }
  @Override
  public String getDescription(Hero hero) {
    long stunDuration =
        (long) SkillConfigManager.getUseSetting(hero, this, "stun-duration", 10000, false);
    if (stunDuration > 0) {
      stunDuration =
          (long)
                  (stunDuration
                      + (SkillConfigManager.getUseSetting(
                              hero, this, "duration-increase", 0.0, false)
                          * hero.getSkillLevel(this)))
              / 1000;
      stunDuration = stunDuration > 0 ? stunDuration : 0;
    }
    long slowDuration =
        (long) SkillConfigManager.getUseSetting(hero, this, "slow-duration", 0, false);
    if (slowDuration > 0) {
      slowDuration =
          (long)
                  (slowDuration
                      + (SkillConfigManager.getUseSetting(
                              hero, this, "duration-increase", 0.0, false)
                          * hero.getSkillLevel(this)))
              / 1000;
      slowDuration = slowDuration > 0 ? slowDuration : 0;
    }
    long rootDuration =
        (long) SkillConfigManager.getUseSetting(hero, this, "root-duration", 0, false);
    if (rootDuration > 0) {
      rootDuration =
          (long)
                  (rootDuration
                      + (SkillConfigManager.getUseSetting(
                              hero, this, "duration-increase", 0.0, false)
                          * hero.getSkillLevel(this)))
              / 1000;
      rootDuration = rootDuration > 0 ? rootDuration : 0;
    }
    long silenceDuration =
        (long) SkillConfigManager.getUseSetting(hero, this, "silence-duration", 0, false);
    if (silenceDuration > 0) {
      silenceDuration =
          (long)
                  (silenceDuration
                      + (SkillConfigManager.getUseSetting(
                              hero, this, "duration-increase", 0.0, false)
                          * hero.getSkillLevel(this)))
              / 1000;
      silenceDuration = silenceDuration > 0 ? silenceDuration : 0;
    }
    long invulnDuration =
        (long) SkillConfigManager.getUseSetting(hero, this, "invuln-duration", 0, false);
    if (invulnDuration > 0) {
      invulnDuration =
          (long)
                  (invulnDuration
                      + (SkillConfigManager.getUseSetting(
                              hero, this, "duration-increase", 0.0, false)
                          * hero.getSkillLevel(this)))
              / 1000;
      invulnDuration = invulnDuration > 0 ? invulnDuration : 0;
    }
    int damage =
        (int)
            (SkillConfigManager.getUseSetting(hero, this, SkillSetting.DAMAGE.node(), 0, false)
                + (SkillConfigManager.getUseSetting(hero, this, "damage-increase", 0.0, false)
                    * hero.getSkillLevel(this)));
    damage = damage > 0 ? damage : 0;
    int radius =
        (int)
            (SkillConfigManager.getUseSetting(hero, this, SkillSetting.RADIUS.node(), 2, false)
                + (SkillConfigManager.getUseSetting(
                        hero, this, SkillSetting.RADIUS_INCREASE.node(), 0.0, false)
                    * hero.getSkillLevel(this)));
    radius = radius > 0 ? radius : 0;
    int distance =
        (int)
            (SkillConfigManager.getUseSetting(
                    hero, this, SkillSetting.MAX_DISTANCE.node(), 15, false)
                + (SkillConfigManager.getUseSetting(
                        hero, this, SkillSetting.MAX_DISTANCE_INCREASE.node(), 0.0, false)
                    * hero.getSkillLevel(this)));
    distance = distance > 0 ? distance : 0;
    String description =
        getDescription()
            .replace("$1", damage + "")
            .replace("$2", radius + "")
            .replace("$3", distance + "");
    if (stunDuration > 0) {
      description += " Stun:" + stunDuration + "s";
    }
    if (slowDuration > 0) {
      description += " Slow:" + slowDuration + "s";
    }
    if (rootDuration > 0) {
      description += " Root:" + rootDuration + "s";
    }
    if (silenceDuration > 0) {
      description += " Silence:" + silenceDuration + "s";
    }
    if (invulnDuration > 0) {
      description += " Invuln:" + invulnDuration + "s";
    }

    // COOLDOWN
    int cooldown =
        (SkillConfigManager.getUseSetting(hero, this, SkillSetting.COOLDOWN.node(), 0, false)
                - SkillConfigManager.getUseSetting(
                        hero, this, SkillSetting.COOLDOWN_REDUCE.node(), 0, false)
                    * hero.getSkillLevel(this))
            / 1000;
    if (cooldown > 0) {
      description += " CD:" + cooldown + "s";
    }

    // MANA
    int mana =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.MANA.node(), 10, false)
            - (SkillConfigManager.getUseSetting(
                    hero, this, SkillSetting.MANA_REDUCE.node(), 0, false)
                * hero.getSkillLevel(this));
    if (mana > 0) {
      description += " M:" + mana;
    }

    // HEALTH_COST
    int healthCost =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.HEALTH_COST, 0, false)
            - (SkillConfigManager.getUseSetting(
                    hero, this, SkillSetting.HEALTH_COST_REDUCE, mana, true)
                * hero.getSkillLevel(this));
    if (healthCost > 0) {
      description += " HP:" + healthCost;
    }

    // STAMINA
    int staminaCost =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.STAMINA.node(), 0, false)
            - (SkillConfigManager.getUseSetting(
                    hero, this, SkillSetting.STAMINA_REDUCE.node(), 0, false)
                * hero.getSkillLevel(this));
    if (staminaCost > 0) {
      description += " FP:" + staminaCost;
    }

    // DELAY
    int delay =
        SkillConfigManager.getUseSetting(hero, this, SkillSetting.DELAY.node(), 0, false) / 1000;
    if (delay > 0) {
      description += " W:" + delay + "s";
    }

    // EXP
    int exp = SkillConfigManager.getUseSetting(hero, this, SkillSetting.EXP.node(), 0, false);
    if (exp > 0) {
      description += " XP:" + exp;
    }
    return description;
  }