Ejemplo n.º 1
0
  /**
   * @param cooldownId
   * @return
   */
  public boolean isSkillDisabled(SkillTemplate template) {

    if (skillCoolDowns == null) return false;

    int cooldownId = template.getCooldownId();
    Long coolDown = skillCoolDowns.get(cooldownId);
    if (coolDown == null) {
      return false;
    }

    if (coolDown < System.currentTimeMillis()) {
      removeSkillCoolDown(cooldownId);
      return false;
    }

    /*
     * Some shared cooldown skills have indipendent and different cooldown they must not be blocked
     */
    if (skillCoolDownsBase != null && skillCoolDownsBase.get(cooldownId) != null) {
      if ((template.getDuration()
              + template.getCooldown() * 100
              + skillCoolDownsBase.get(cooldownId))
          < System.currentTimeMillis()) return false;
    }

    return true;
  }
Ejemplo n.º 2
0
 private boolean canUseSkillInMove() {
   if (castingSkill != null) {
     SkillTemplate st = DataManager.SKILL_DATA.getSkillTemplate(castingSkill.getSkillId());
     if (st.getStartconditions() != null && st.getMovedCondition() != null) {
       if (!st.getMovedCondition().isAllow()) return false;
     }
   }
   return true;
 }
Ejemplo n.º 3
0
 public int getSkillCooldown(SkillTemplate template) {
   return template.getCooldown();
 }