internal virtual void OnSpellPrepare(S2C_SpellPrepare ret)
        {
            // 更新当前SM状态
            Type sepllSMType = typeof(SpecialMove_SpellPrepare);

            if (!IsDoingSepcialMove(sepllSMType))
            {
                DoSpecialMoveByType(sepllSMType, false);
            }

            SpecialMove_SpellPrepare spellSM = SpecialMove as SpecialMove_SpellPrepare;

            if (spellSM != null)
            {
                spellSM.PrepareData = ret;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 技能准备(吟唱, 无吟唱不会受到该消息)开始或更新
        /// </summary>
        private void OnRecvSpellPrepare(MessageReceivedEvent e)
        {
            S2C_SpellPrepare ret = MarshalConversion.PtrToStruct <S2C_SpellPrepare>(e.MessagePtr);

            if (ret.CasterId == GameEngine.EngineInstance.LocalPlayer.CharacterID)
            {
                GameEngine.EngineInstance.LocalPlayer.OnSpellPrepare(ret);

                // 显示吟唱进度条
                if (currentProgressBarTimeStamp <= ret.TimeStamp)
                {
                    if (ret.CurTime == 0)
                    {
                        prepareProgressBar.Hide();
                    }
                    else
                    {
                        NSpellInfo spell = NSpellInfo.FindInfo(ret.SpellId);
                        Debug.Assert(spell != null);

                        prepareTime    = ret.CurTime * 0.001f;
                        prepareMaxTime = ret.MaxTime * 0.001f;
                        prepareProgressBar.Progress  = prepareTime / prepareMaxTime;
                        prepareProgressBar.Text.Text = spell.Name;
                        prepareProgressBar.Show();
                        currentProgressBarTimeStamp = ret.TimeStamp;
                        currentProgressBarSpellID   = ret.SpellId;
                    }
                }
            }
            else
            {
                RemoteCharacterController rcc = GameEngine.EngineInstance.FindCharacterController(ret.CasterId);
                if (rcc != null)
                {
                    rcc.OnSpellPrepare(ret);
                }
                else
                {
                    NLogger.Instance.WriteString(LogType.Warning, string.Format("S2C_SpellPrepare can not find controller UintID=[{0}]", ret.CasterId));
                }
            }
        }