Ejemplo n.º 1
0
        public void Update(float deltaTime)
        {
            if (!SpellCastStarted)
            {
                return;
            }

            if (SpellCastCompleted)
            {
                return;
            }

            if (SpellCastCancelled)
            {
                return;
            }

            CurrentCastTime += deltaTime * Caster.System.AttributeSystem.Haste.Remap();
            Spell.UpdateCast(this);
            OnSpellCastProgress?.Invoke(this);

            if (CurrentCastTime >= Spell.CastTime)
            {
                Spell.CompleteCast(this);
                SpellCastCompleted = true;
                OnSpellCompleted?.Invoke(this);
            }
        }
Ejemplo n.º 2
0
        public void Start()
        {
            if (SpellCastStarted)
            {
                return;
            }

            Spell.StartCast(this);
            SpellCastStarted = true;
            OnSpellCastStarted?.Invoke(this);

            if (Spell.CastTime > 0)
            {
                return;
            }

            Spell.CompleteCast(this);
            SpellCastCompleted = true;
            OnSpellCompleted?.Invoke(this);
        }