예제 #1
0
        public void DoIteration(Unit me, Unit target)
        {
            if (me.CombatState == CombatState.Stunned)
            {
                // TODO: check for un-stun abilities
                return;
            }

            CastSpellEventArgs argsCast = new CastSpellEventArgs
            {
                Spell = SpellStrategy.DoRoutine(me, target)
            };

            if (argsCast.Spell != null)
            {
                OnCastSpell.Invoke(this, argsCast);
            }

            if (me.CombatState == CombatState.Rooted)
            {
                // TODO: check for un-root abilities
                return;
            }

            MoveCharacterEventArgs argsMove = new MoveCharacterEventArgs
            {
                PositionToGoTo = MovementStrategy.CalculatePosition(me, target)
            };

            if (!argsMove.PositionToGoTo.Equals(new Vector3(0.0, 0.0, 0.0)))
            {
                OnMoveCharacter?.Invoke(this, argsMove);
            }
        }
예제 #2
0
 public static void CastSpell(int idx) => _castSpell?.Invoke(idx);