push convert flow use skill combo

This commit is contained in:
VDH
2026-01-23 18:01:15 +07:00
parent ef366cfc32
commit 3de0850a2b
13 changed files with 2463 additions and 661 deletions
+23 -12
View File
@@ -33,6 +33,8 @@ public partial class CECGameRun
//[SerializeField] private Transform ground;
CECHostPlayer hostPlayer;
private CECWorld m_pWorld;
int m_iGameState; // Game state
protected CECUIManager m_pUIManager; // UI manager
@@ -105,7 +107,7 @@ public partial class CECGameRun
if (_npcServerPrefab == null)
{
BMLogger.LogError("CECGameRun::LoadPrefabs, Failed to load _npcServerPrefab prefab.");
}
}
#endif
}
@@ -344,17 +346,17 @@ public partial class CECGameRun
}
}
//TODO: flow in update fix later
/* Task.Run(() =>
{
GameSession.Context.Post(_ =>
{
if (m_pUIManager == null)
{
m_pUIManager = CECUIManager.Instance;
}
m_pUIManager.GetCDlgQuickBar().UpdateShortcuts();
}, null);
});*/
/* Task.Run(() =>
{
GameSession.Context.Post(_ =>
{
if (m_pUIManager == null)
{
m_pUIManager = CECUIManager.Instance;
}
m_pUIManager.GetCDlgQuickBar().UpdateShortcuts();
}, null);
});*/
// TODO: Uncomment when UI manager is available
// Load UI configs / 加载UI配置
@@ -525,4 +527,13 @@ public partial class CECGameRun
}
return szRet;
}
public int GetGameState() { return m_iGameState; }
}
public enum GameState
{
GS_NONE = 0, // None
GS_LOGIN, // Login in state
GS_GAME, // In game
};
+47 -30
View File
@@ -26,6 +26,7 @@ using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
using static BrewMonster.Scripts.Managers.EC_Inventory;
using static CECPlayerWrapper;
using cmd_select_target = CSNetwork.GPDataType.cmd_select_target;
using Host_work_ID = BrewMonster.Scripts.CECHPWork.Host_work_ID;
using Trace_reason = BrewMonster.CECHPWorkTrace.Trace_reason;
@@ -588,27 +589,36 @@ namespace BrewMonster
case int value when value == EC_MsgDef.MSG_HST_COMBO_SKILL_PREPARE: OnMsgComboSkillPrepare(Msg); break;
case int value when value == EC_MsgDef.MSG_PM_PLAYERFLY: OnMsgPlayerFly(Msg); break;
case int value when value == EC_MsgDef.MSG_HST_EMBEDITEM: OnMsgHstEmbedItem(Msg); break;
case int value when value == EC_MsgDef.MSG_HST_CONTINUECOMBOSKILL: OnMsgContinueComboSkill(Msg); break;
}
/*if (bActionStartSkill)
AP_ActionEvent(AP_EVENT_STARTSKILL, iActionTime);
/* if (bActionStartSkill)
AP_ActionEvent(AP_EVENT_STARTSKILL, iActionTime);
if (bDoOtherThing)
{
if (m_pComboSkill != null && !m_pComboSkill.IsStop())
{
if (CECAutoPolicy.GetInstance().IsAutoPolicyEnabled())
g_pGame.GetGameRun().PostMessage(MSG_HST_CONTINUECOMBOSKILL, MAN_PLAYER, 0, 0, m_pComboSkill.GetGroupIndex());
else
m_pComboSkill.Continue(false);
}
else
{
if (idTarget != 0 && idTarget != m_PlayerInfo.cid)
NormalAttackObject(idTarget, true);
}
}*/
}
if (bDoOtherThing)
{
if (m_pComboSkill != null && !m_pComboSkill.IsStop())
{
if (CECAutoPolicy.GetInstance().IsAutoPolicyEnabled())
g_pGame.GetGameRun().PostMessage(MSG_HST_CONTINUECOMBOSKILL, MAN_PLAYER, 0, 0, m_pComboSkill.GetGroupIndex());
else
m_pComboSkill.Continue(false);
}
else
{
if (idTarget != 0 && idTarget != m_PlayerInfo.cid)
NormalAttackObject(idTarget, true);
}
}*/
private void OnMsgContinueComboSkill(ECMSG Msg)
{
bool bMeleeing = ((int)Msg.dwParam1 == 1);
if (bMeleeing != m_bMelee) bMeleeing = m_bMelee;
int iGroupID = (int)Msg.dwParam2;
if (m_pComboSkill != null && m_pComboSkill.GetGroupIndex() == iGroupID && !m_pComboSkill.IsStop())
m_pComboSkill.Continue(bMeleeing);
}
private void OnMsgComboSkillPrepare(ECMSG Msg)
@@ -894,7 +904,7 @@ namespace BrewMonster
bool bActionStartSkill = false;
int iActionTime = 1000;
// CECPlayerWrapper* pWrapper = CECAutoPolicy::GetInstance().GetPlayerWrapper();
CECPlayerWrapper pWrapper = CECAutoPolicy.GetInstance().GetPlayerWrapper();
switch (Convert.ToInt32(Msg.dwParam2))
{
@@ -1012,7 +1022,7 @@ namespace BrewMonster
Debug.Log("HOST_STOP_SKILL");
//AP_ActionEvent(AP_EVENT_STOPSKILL);
AP.AP_ActionEvent((int)AP_EVENT.AP_EVENT_STOPSKILL);
if (pSkillToMatch != null)
{
// m_pWorkMan中的当前任何Work为最高优先级或、或 CECHPWorkSpell 处于最高优先级且队列中有Delay时间
@@ -1068,13 +1078,13 @@ namespace BrewMonster
// Print a notify message
// 打印提示消息
// g_pGame.GetGameRun().AddFixedMessage(FIXMSG_SKILLINTERRUPT);
Debug.Log("Skill interrupted!");
//EC_Game.GetGameRun().AddFixedMessage(FIXMSG_SKILLINTERRUPT);
BMLogger.LogError("Skill interrupted!");
//AP_ActionEvent(AP_EVENT_STOPSKILL);
AP.AP_ActionEvent((int)AP_EVENT. AP_EVENT_STOPSKILL);
// 通知策略技能被打断 | Notify policy that skill is interrupted
// CECAutoPolicy::GetInstance().SendEvent_SkillInterrupt(skill_id);
CECAutoPolicy.GetInstance().SendEvent_SkillInterrupt(skill_id);
break;
}
case int value2 when value2 == CommandID.OBJECT_CAST_INSTANT_SKILL:
@@ -1325,8 +1335,8 @@ namespace BrewMonster
break;
}
/* if (bActionStartSkill)
AP_ActionEvent(AP_EVENT_STARTSKILL, iActionTime);*/
if (bActionStartSkill)
AP.AP_ActionEvent((int)AP_EVENT.AP_EVENT_STARTSKILL, iActionTime);
if (bDoOtherThing)
{
@@ -1334,10 +1344,10 @@ namespace BrewMonster
{
// Continue combo skill
// 继续连击技能
// if (CECAutoPolicy::GetInstance().IsAutoPolicyEnabled())
// g_pGame.GetGameRun().PostMessage(MSG_HST_CONTINUECOMBOSKILL, MAN_PLAYER, 0, 0, m_pComboSkill.GetGroupIndex());
// else
m_pComboSkill.Continue(false);
if (CECAutoPolicy.GetInstance().IsAutoPolicyEnabled())
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_CONTINUECOMBOSKILL, MANAGER_INDEX.MAN_PLAYER, 0, 0, m_pComboSkill.GetGroupIndex());
else
m_pComboSkill.Continue(false);
}
else
{
@@ -6875,7 +6885,7 @@ namespace BrewMonster
return true;
}
void ClearComboSkill()
public void ClearComboSkill()
{
if (m_pComboSkill != null)
{
@@ -7266,6 +7276,13 @@ namespace BrewMonster
{
return m_pPetCorral;
}
public bool IsPlayerMoving()
{
return m_pWorkMan.IsMoving();
}
public CECComboSkill GetComboSkill() { return m_pComboSkill; }
}
public struct SkillShortCutConfig
{
+1
View File
@@ -69,6 +69,7 @@ public static class EC_Utility
Marshal.FreeHGlobal(ptr);
}
}
public static A3DVECTOR3 glb_DecompressDirH(byte byDir)
{
const float fInter = 360.0f / 256.0f;