コード例 #1
0
ファイル: MagicState.cs プロジェクト: hooper82/ACE
        /// <summary>
        /// Called when the player finishes casting a spell
        /// </summary>
        public void OnCastDone()
        {
            Player.IsBusy      = false;
            IsCasting          = false;
            CastMotionDone     = false;
            TurnStarted        = false;
            IsTurning          = false;
            PendingTurnRelease = false;
            Player.TurnTarget  = null;
            CanQueue           = false;
            CastQueue          = null;

            CastGesture          = MotionCommand.Invalid;
            CastGestureStartTime = DateTime.MinValue;

            if (Player.RecordCast.Enabled)
            {
                Player.RecordCast.Log($"MagicState.OnCastDone()");
                Player.RecordCast.Log($"Player Location: {Player.Location.ToLOCString()}");
                if (CastSpellParams?.Target != null)
                {
                    Player.RecordCast.Log($"Target Location: {CastSpellParams.Target.Location.ToLOCString()}");
                }
                Player.RecordCast.Log("================================================================================");
                Player.RecordCast.Flush();
            }

            CastSpellParams = null;
            WindupParams    = null;
        }
コード例 #2
0
ファイル: MagicState.cs プロジェクト: hooper82/ACE
        /// <summary>
        /// Called when the player begins casting a spell
        /// </summary>
        public void OnCastStart()
        {
            Player.IsBusy      = true;
            IsCasting          = true;
            CastMotionDone     = false;
            TurnStarted        = false;
            IsTurning          = false;
            PendingTurnRelease = false;
            CanQueue           = false;
            CastQueue          = null;

            StartTime            = DateTime.UtcNow;
            CastGestureStartTime = DateTime.MinValue;

            if (Player.UnderLifestoneProtection)
            {
                Player.LifestoneProtectionDispel();
            }

            CastNum++;

            if (Player.RecordCast.Enabled)
            {
                Player.Session.Network.EnqueueSend(new GameMessageSystemChat($"Cast #: {CastNum}", ChatMessageType.Broadcast));
                Player.RecordCast.Log($"MagicState.OnCastStart({CastNum})");
                Player.RecordCast.Log($"Player Location: {Player.Location.ToLOCString()}");
            }
        }