コード例 #1
0
    public void StartCooldown(TrinitySpellInfo spellInfo, TrinitySpell spell = null)
    {
        float cooldown = spellInfo.RecoveryTime;

        float currentTime = Time.time;
        float recTime     = currentTime;

        // #TODO : Add modifiers

        // replace negative cooldowns by 0
        if (cooldown < 0)
        {
            cooldown = 0;
        }

        // no cooldown after applying spell mods
        if (cooldown == 0)
        {
            return;
        }

        recTime = currentTime + cooldown;

        // self spell cooldown
        if (recTime != currentTime)
        {
            AddCooldown(spellInfo.Id, recTime);
        }
    }
コード例 #2
0
    public void HandleCooldowns(TrinitySpellInfo spellInfo, TrinitySpell spell)
    {
        if (spellInfo.IsPassive() || (spell != null && spell.IsIgnoringCooldowns()))
        {
            return;
        }

        StartCooldown(spellInfo, spell);
    }
コード例 #3
0
    public void CastSpell(SpellCastTargets targets, TrinitySpellInfo spellInfo, TriggerCastFlags triggerFlags, AuraEffect triggeredByAura, Guid originalCaster)
    {
        if (spellInfo == null)
        {
            Debug.LogError("Unknown spell for unit: " + gameObject.name);
            return;
        }

        TrinitySpell spell = new TrinitySpell(this, spellInfo, triggerFlags, originalCaster);

        spell.Prepare(targets, triggeredByAura);
    }
コード例 #4
0
    public float CalcRadius(Unit caster, TrinitySpell spell)
    {
        if (Radius == null)
        {
            return(0.0f);
        }

        float radius = Radius.RadiusMin;

        if (radius == 0.0f)
        {
            radius = Radius.RadiusMax;
        }

        return(radius);
    }
コード例 #5
0
    public float GetMaxRange(bool positive, Unit caster = null, TrinitySpell spell = null)
    {
        if (Range == null)
        {
            return(0.0f);
        }
        float range;

        if (positive)
        {
            range = Range.MaxRangeFriend;
        }
        else
        {
            range = Range.MaxRangeHostile;
        }

        return(range);
    }