Beispiel #1
0
    private void AbilityAffectStealth(ActiveAbility ability)
    {
        var subtle         = (ability.FindAttribute("stealthy") != null);
        var stealthAbility = (ability.FindAttribute("stealth") != null);

        if (GetComponent <StatusEffectHost>().CheckForEffect("stealth") && (stealthAbility || (!subtle)))
        {
            GetComponent <StatusEffectHost>().RemoveEffectByName("stealth");
        }
        //else if (stealthAbility && !MonsterCombatant.AnyInCombat()) GetComponent<StatusEffectHost>().AddStatusEffect("stealth", 3600, good: true, ability: ability);
        else if (stealthAbility)
        {
            GetComponent <StatusEffectHost>().AddStatusEffect("stealth", Mathf.Infinity, good: true, ability: ability);
        }
    }
Beispiel #2
0
 private bool AbilityUsable(ActiveAbility ability)
 {
     if (GCDTime > 0)
     {
         return(false);
     }
     if (GetComponent <Health>().hp <= 0)
     {
         return(false);
     }
     if (GetComponent <StatusEffectHost>().CheckForEffect("paralysis") && ability.FindAttribute("usableWhileParalyzed") == null)
     {
         return(false);
     }
     if (GetComponent <Mana>().mp < ability.mpUsage || ability.currentCooldown > 0f)
     {
         return(false);
     }
     return(true);
 }
Beispiel #3
0
    private void AbilitySetCooldowns(ActiveAbility ability)
    {
        int level = 1;

        if (GetComponent <ExperienceGainer>() != null)
        {
            level = GetComponent <ExperienceGainer>().level;
        }
        else
        {
            level = GetComponent <MonsterScaler>().level;
        }
        //GCDTime = maxGCDTime * (1 - SecondaryStatUtility.CalcCooldownReduction(GetComponent<Character>().wisdom, level));
        var cooldownReduction = CharacterAttribute.attributes["cooldownReduction"].instances[GetComponent <Character>()].TotalValue / 100f;

        GCDTime = maxGCDTime * (1 - cooldownReduction);
        if (ability.FindAttribute("offGCD") != null)
        {
            GCDTime = 0f;
        }
        ability.currentCooldown = ability.cooldown * (1 - cooldownReduction);
    }
Beispiel #4
0
 private void AddAbilityInfo(ActiveAbility ability)
 {
     if (ability == null)
     {
         abilityNames.Add("");
         abilityIcons.Add(65);
         abilityCDs.Add(0);
         abilityDescriptions.Add("");
         abilityIsRanged.Add(false);
         abilityIsAttack.Add(false);
         abilityRadii.Add(0);
         abilityCurrentCDs.Add(0);
     }
     else
     {
         abilityNames.Add(ability.name);
         abilityIcons.Add(ability.icon);
         abilityCDs.Add(ability.cooldown);
         abilityDescriptions.Add(AbilityInterpolate(ability));
         abilityIsRanged.Add(ability is AttackAbility && ((AttackAbility)ability).isRanged);
         abilityIsAttack.Add(ability is AttackAbility);
         if (ability is AttackAbility)
         {
             abilityRadii.Add(((AttackAbility)ability).radius);
         }
         else if (ability.FindAttribute("disableDevice") != null)
         {
             abilityRadii.Add(2);
         }
         else
         {
             abilityRadii.Add(0);
         }
         abilityCurrentCDs.Add(0);
     }
 }