Beispiel #1
0
 public void cooldownAbilities(Level mapLevel)
 {
     for (int i = 0; i < abilities.Length; i++)
     {
         if (abilities[i] != null)
         {
             if (abilities[i].type == AbilityTypes.Toggle)
             {
                 ToggleAbility toggled = (ToggleAbility)abilities[i];
                 toggled.updateToggle(level, this);
             }
             if (abilities[i].type == AbilityTypes.DOTAOE && !abilities[i].wasJustCast)
             {
                 DOTAreaOfEffect dot = (DOTAreaOfEffect)abilities[i];
                 dot.dotUsed    = false;
                 dot.willBeCast = true;
             }
             if (!abilities[i].wasJustCast)
             {
                 abilities[i].cooldown -= (abilities[i].cooldown > 0) ? 1 : 0;
             }
             abilities[i].wasJustCast = false;
         }
     }
 }
Beispiel #2
0
 private void updateDOTabilities(Level mapLevel)
 {
     for (int i = 0; i < abilities.Length; i++)
     {
         if (abilities[i] != null && abilities[i].type == AbilityTypes.DOTAOE && !abilities[i].wasJustCast)
         {
             DOTAreaOfEffect dot = (DOTAreaOfEffect)abilities[i];
             if (!dot.dotUsed && dot.willBeCast)
             {
                 dot.updateAOEPosition(mapLevel, mapLevel.CharacterEntities.FindPosition(this), this);
                 dot.dotUsed = true;
             }
         }
     }
 }