/// <summary> /// 保存AI状态信息 /// </summary> public void SaveAIState(S2C_CHANGE_PLOT_STATE msg) { ulong npc_id = msg.npc_id; byte in_scene = msg.in_scene; AIPlotState plot_state = (AIPlotState)msg.plot_state; if (m_CurrentAIUid > 0 && m_CurrentAIUid == npc_id && in_scene > 0) { m_LastAIUid = m_CurrentAIUid; OpenCountDownTimePanel(false); if (IsInAIArea() && !m_IsPlayIngAIEnd) { WwiseUtil.PlaySound((int)SoundID.AIAreaEnd, false, null); m_IsPlayIngAIEnd = true; } } /// TODO if (m_AIBossState.ContainsKey(m_CurrentAIUid) && m_AIBossState[m_CurrentAIUid].m_AIPlotState == AIPlotState.BeginBossTimeout) { StopAIActionEffect(m_AIActionEffect); } if (in_scene == 0 && m_CurrentAIUid == 0) //==0 means in AI { m_CurrentAIUid = npc_id; m_IsPlayIngEff = false; m_IsPlayIngAIEnd = false; } if (m_AIBossState.ContainsKey(npc_id)) { m_AIBossState[npc_id].m_AIPlotState = plot_state; m_AIBossState[npc_id].m_InScene = in_scene; } else { AIPlotInfo aIPlotInfo = new AIPlotInfo(); aIPlotInfo.m_AIPlotState = plot_state; aIPlotInfo.m_InScene = in_scene; m_AIBossState.Add(npc_id, aIPlotInfo); } if (plot_state == AIPlotState.CallingBossSuccess && in_scene > 0) { m_HasCallBossSuccess = true; } if (in_scene == 0) { SendMSAIBossMsgNotify(npc_id, m_PlayerAIState); } }
// AI状态(入口) private void OnSaveAIBossStateProtol(KProtoBuf buf) { S2C_CHANGE_PLOT_STATE msg = buf as S2C_CHANGE_PLOT_STATE; GetMSAIBossProxy().SaveAIState(msg); //Leyoutech.Utility.DebugUtility.LogErrorFormat("AIBOSS: ", "S2C_CHANGE_PLOT_STATE npc_id = {0}, plot_state = {1}", msg.npc_id, ((AIPlotState)msg.plot_state).ToString()); }