Merge remote-tracking branch 'origin/develop' into feature/chat_01
This commit is contained in:
@@ -51,7 +51,7 @@ namespace BrewMonster.Scripts
|
||||
_isInitialized = false;
|
||||
_initializationTcs = new UniTaskCompletionSource();
|
||||
Addressables.InitializeAsync().Completed += OnInitializeComplete;
|
||||
}
|
||||
}
|
||||
|
||||
#region Unity lifecycle
|
||||
private List<string> _assetToForceRelease = new();
|
||||
@@ -158,7 +158,7 @@ namespace BrewMonster.Scripts
|
||||
BMLogger.Log($"AddressableManager: Text asset handle is invalid or result is null, need to load new one: {assetPath}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var handle = Addressables.LoadAssetAsync<TextAsset>(assetPath);
|
||||
@@ -229,7 +229,7 @@ namespace BrewMonster.Scripts
|
||||
/// </summary>
|
||||
public async Task<AudioClip> LoadAudioClipAsync(string assetPath)
|
||||
{
|
||||
BMLogger.LogError($"HoangDEv : AddressableManager: LoadAudioClipAsync called with assetPath: {assetPath}");
|
||||
// BMLogger.LogError($"HoangDEv : AddressableManager: LoadAudioClipAsync called with assetPath: {assetPath}");
|
||||
RemoveFromReleaseAssetDictionary(assetPath);
|
||||
|
||||
if (_loadedAudioAssets.TryGetValue(assetPath, out _loadedAudioClipHandle))
|
||||
@@ -332,7 +332,7 @@ namespace BrewMonster.Scripts
|
||||
{
|
||||
if (handle.IsValid())
|
||||
{
|
||||
Addressables.Release(handle);
|
||||
Addressables.Release(handle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,12 +391,12 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
|
||||
@@ -105,8 +105,8 @@ namespace PerfectWorld.Scripts.Managers
|
||||
case EC_MsgDef.MSG_PM_PLAYEREXIT:
|
||||
OnMsgPlayerExit(Msg);
|
||||
break;
|
||||
case EC_MsgDef.MSG_PM_PLAYEREXTSTATE:
|
||||
OnMsgPlayerExtState(Msg);
|
||||
case EC_MsgDef.MSG_PM_PLAYEREXTSTATE:
|
||||
OnMsgPlayerExtState(Msg);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -811,7 +811,7 @@ namespace PerfectWorld.Scripts.Managers
|
||||
object pData;
|
||||
int idPlayer, iIndex;
|
||||
|
||||
BMLogger.LogError("OnMsgPlayerExtProp Msg.dwParam2=" + Msg.dwParam2);
|
||||
// BMLogger.LogError("OnMsgPlayerExtProp Msg.dwParam2=" + Msg.dwParam2);
|
||||
switch (Convert.ToInt32(Msg.dwParam2))
|
||||
{
|
||||
case CommandID.PLAYER_EXT_PROP_BASE:
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
"models/players/形象/夜影女/躯干/夜影女.ecm",
|
||||
"models/players/形象/月仙男/躯干/月仙男.ecm",
|
||||
"models/players/形象/月仙女/躯干/月仙女.ecm",
|
||||
|
||||
|
||||
// 胧族职业变身
|
||||
"models/players/形象/胧族变身夜影男/胧族变身夜影男.ecm",
|
||||
"models/players/形象/胧族变身夜影女/胧族变身夜影女.ecm",
|
||||
@@ -89,7 +89,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
"models/players/形象/胧族变身月仙女/胧族变身月仙女.ecm",
|
||||
};
|
||||
|
||||
public static NPCManager Instance
|
||||
public static NPCManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -98,12 +98,13 @@ namespace BrewMonster.Scripts.Managers
|
||||
instance = FindAnyObjectByType<NPCManager>();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<GameObject> GetModelPlayer(byte profession, byte gender)
|
||||
{
|
||||
var prefab = await AddressableManager.Instance.LoadPrefabAsync(_playerModelPaths[profession * GENDER.NUM_GENDER + gender]);
|
||||
// BMLogger.LogError("_playerModelPaths[profession * GENDER.NUM_GENDER + gender] = " + _playerModelPaths[profession * GENDER.NUM_GENDER + gender]);
|
||||
if (prefab == null)
|
||||
{
|
||||
BMLogger.LogError( $" [NPC Manager] Not found Prefab from Addressable with profession : {profession} gender : {gender}");
|
||||
@@ -118,7 +119,7 @@ namespace BrewMonster.Scripts.Managers
|
||||
{
|
||||
// The first 2 shapes are the matters, so we need to subtract 2 from the shape id
|
||||
// not sure it will cause any problem
|
||||
|
||||
|
||||
int tempShape = iShape-2;
|
||||
var prefab = await AddressableManager.Instance.LoadPrefabAsync(_playerModelPaths[tempShape]);
|
||||
if (prefab == null)
|
||||
@@ -132,4 +133,4 @@ namespace BrewMonster.Scripts.Managers
|
||||
}
|
||||
}
|
||||
}
|
||||
//models/players/形象/白虎/白虎
|
||||
//models/players/形象/白虎/白虎
|
||||
|
||||
@@ -111,9 +111,9 @@ namespace BrewMonster
|
||||
|
||||
public RIDINGPET m_RidingPet; // Riding pet information
|
||||
public GameObject m_pPetModel = null; // Pet model
|
||||
public RIDINGPET m_CandPet;// ID of candidate pet
|
||||
public RIDINGPET m_CandPet;// ID of candidate pet
|
||||
A3DVECTOR3 m_vNamePos; // Æï³Ë×´Ì¬Íæ¼ÒÐÕÃûµÄµ÷Õû
|
||||
// ÒÀ¸½ÀàÐÍ
|
||||
// ÒÀ¸½ÀàÐÍ
|
||||
AttachMode m_AttachMode = AttachMode.enumAttachNone;
|
||||
// ÒÀ¸½Õß»ò±»ÒÀ¸½Õßid
|
||||
protected int m_iBuddyId;
|
||||
@@ -259,7 +259,7 @@ namespace BrewMonster
|
||||
"蝶羽狐",
|
||||
// 默认摆摊模型
|
||||
"男",
|
||||
"女",
|
||||
"女",
|
||||
// 胧族
|
||||
"夜影男",
|
||||
"夜影女",
|
||||
@@ -285,7 +285,7 @@ namespace BrewMonster
|
||||
PLAYERMODEL_PROFESSION, // player profession related
|
||||
PLAYERMODEL_DUMMYTYPE2, // player buff related
|
||||
PLAYERMODEL_DUMMYTYPE3, // not use
|
||||
|
||||
|
||||
PLAYERMODEL_MAX,
|
||||
PLAYERMODEL_TYPEALL
|
||||
};
|
||||
@@ -308,7 +308,7 @@ namespace BrewMonster
|
||||
m_PlayerActions = _default_actions;
|
||||
m_iShape = 0;
|
||||
m_aEquips = new int[(int)IndexOfIteminEquipmentInventory.SIZE_ALL_EQUIPIVTR];
|
||||
queueActionEvent = new QueueActionEvent("", null, false, null, 200);
|
||||
queueActionEvent = new QueueActionEvent("", null, false, null, 200);
|
||||
}
|
||||
|
||||
/// <summary>This function will get the coressponding model player for the player based on the profession and gender </summary>
|
||||
@@ -334,12 +334,12 @@ namespace BrewMonster
|
||||
throw new InvalidOperationException(
|
||||
$"SetPlayerModel failed to initialize model. profession={profession}, gender={gender}");
|
||||
}
|
||||
|
||||
|
||||
// Cleanup old model if exists
|
||||
// 清理旧模型(如果存在)
|
||||
if (m_pPlayerCECModel != null && m_pPlayerModel != null)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
Debug.Log($"[CECPlayer] SetPlayerModel: profession: {profession}, gender: {gender}");
|
||||
Debug.Log($"[CECPlayer] SetPlayerModel: m_pPlayerCECModel: {m_pPlayerCECModel}");
|
||||
@@ -351,10 +351,10 @@ namespace BrewMonster
|
||||
m_pPlayerModel.SetActive(true);
|
||||
m_pModels[(int)PLAYERMODEL_TYPE.PLAYERMODEL_MAJOR] = m_pPlayerModel;
|
||||
m_iShape = 0;
|
||||
|
||||
|
||||
// Set the player model ready flag
|
||||
IsPlayerModelReady = true;
|
||||
|
||||
|
||||
// Update visual components after model is set (with delay to ensure NamedAnimancerComponent is available)
|
||||
// 设置模型后更新视觉组件(延迟以确保NamedAnimancerComponent可用)
|
||||
StartCoroutine(UpdateVisualComponentsDelayed());
|
||||
@@ -372,15 +372,15 @@ namespace BrewMonster
|
||||
ApplyShapeModelChange(m_pModels[iShapeType]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// try to load a new dummy model
|
||||
// if (bAtOnce || !IsLoadThreadReady())
|
||||
// {
|
||||
// CECModel* pDummyModel = NULL;
|
||||
|
||||
|
||||
// if (!LoadDummyModel(iShape, &pDummyModel) || !pDummyModel)
|
||||
// return false;
|
||||
|
||||
|
||||
// if (!SetDummyLoadResult(iShape, pDummyModel))
|
||||
// {
|
||||
// A3DRELEASE(pDummyModel);
|
||||
@@ -391,10 +391,10 @@ namespace BrewMonster
|
||||
// {
|
||||
// int iType = (m_iCID == OCID_HOST_NAVIGATER) ? MTL_ECM_HOST_NAVIGATER_DUMMY:MTL_ECM_PLAYER_DUMMY;
|
||||
// QueueECModelForLoad(
|
||||
// iType,
|
||||
// iType,
|
||||
// m_PlayerInfo.cid,
|
||||
// m_dwBornStamp,
|
||||
// GetPos(),
|
||||
// GetPos(),
|
||||
// NULL,
|
||||
// iShape);
|
||||
// }
|
||||
@@ -409,7 +409,7 @@ namespace BrewMonster
|
||||
m_pModels[iShapeType] = pDummyModel;
|
||||
m_aShapeID[iShapeType] = iShapeID;
|
||||
ApplyShapeModelChange(pDummyModel);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
protected void ApplyShapeModelChange(GameObject pModel)
|
||||
@@ -418,23 +418,23 @@ namespace BrewMonster
|
||||
int iBuddyId = m_iBuddyId;
|
||||
bool bHangerOn = m_bHangerOn;
|
||||
if (m_AttachMode != AttachMode.enumAttachNone) DetachBuddy(null, false);
|
||||
|
||||
|
||||
// logic transform but no model changed
|
||||
if(!pModel) pModel = GetMajorModel();
|
||||
OnModelChange(pModel);
|
||||
if(pModel && m_pPlayerModel && m_pPlayerModel != pModel)
|
||||
{
|
||||
{
|
||||
// sync the position
|
||||
//pModel->SetPos(m_pPlayerModel->GetPos());
|
||||
// pModel->SetDirAndUp(m_pPlayerModel->GetDir(), m_pPlayerModel->GetUp());
|
||||
pModel.transform.position = m_pPlayerModel.transform.position;
|
||||
pModel.transform.rotation = m_pPlayerModel.transform.rotation;
|
||||
// if (m_pPlayerModel.transform.forward != Vector3.zero)
|
||||
// {
|
||||
// {
|
||||
// Quaternion lookRot = Quaternion.LookRotation(m_pPlayerModel.transform.forward, m_pPlayerModel.transform.up);
|
||||
// transform.rotation = lookRot;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// TODO:sync wing
|
||||
// CECModel* pWing = m_pPlayerModel->GetChildModel(_wing);
|
||||
// m_pPlayerModel->RemoveChildModel(_wing, false);
|
||||
@@ -481,9 +481,9 @@ namespace BrewMonster
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// TODO:change the target
|
||||
if (m_pPlayerModel != pModel){
|
||||
if (m_pPlayerModel != pModel){
|
||||
// ClearShowExtendStates();
|
||||
// if (IsMajorModel(m_pPlayerModel)){
|
||||
// RemoveEquipGfx();
|
||||
@@ -502,15 +502,15 @@ namespace BrewMonster
|
||||
RecreateActionController();
|
||||
// RecreateBodyController();
|
||||
}
|
||||
|
||||
|
||||
// different ground mode
|
||||
SetUseGroundNormal( ShouldUseGroundNormalForCurrentShapeModel() );
|
||||
PlayAction(GetMoveStandAction(false, IsFighting()), true);
|
||||
|
||||
|
||||
// Update NPCVisual's namedAnimancer reference when model changes
|
||||
// 当模型更改时更新NPCVisual的namedAnimancer引用
|
||||
UpdateVisualComponents();
|
||||
|
||||
|
||||
// Todo: restore the attach state
|
||||
// if (iBuddyId)
|
||||
// {
|
||||
@@ -534,9 +534,9 @@ namespace BrewMonster
|
||||
// if (pChariot && pChariot->IsUpdateState())
|
||||
// {
|
||||
// PlayGfx(res_GFXFile(RES_GFX_LEVELUP), NULL, 4.0, PLAYERMODEL_TYPEALL);
|
||||
// BubbleText(BUBBLE_LEVELUP, 0);
|
||||
// BubbleText(BUBBLE_LEVELUP, 0);
|
||||
// pChariot->UpdateState(0,0);// �ָ�ս��������־
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -595,10 +595,10 @@ namespace BrewMonster
|
||||
return result;
|
||||
}
|
||||
protected virtual bool IsShapeModelChanged()
|
||||
{
|
||||
{
|
||||
return m_pModels[(int)PLAYERMODEL_TYPE.PLAYERMODEL_MAJOR] != m_pPlayerModel;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Update visual components (NPCVisual, PlayerVisual) when model changes
|
||||
/// 当模型更改时更新视觉组件(NPCVisual、PlayerVisual)
|
||||
@@ -613,7 +613,7 @@ namespace BrewMonster
|
||||
BMLogger.LogWarning("CECPlayer: UpdateVisualComponents - _pPlayerModel is null, cannot update visual components");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Update NPCVisual if it exists
|
||||
// 如果存在NPCVisual则更新它
|
||||
NPCVisual npcVisual = GetComponent<NPCVisual>();
|
||||
@@ -621,7 +621,7 @@ namespace BrewMonster
|
||||
{
|
||||
npcVisual.RefreshNamedAnimancer(modelRoot);
|
||||
}
|
||||
|
||||
|
||||
// Update PlayerVisual if it exists
|
||||
// 如果存在PlayerVisual则更新它
|
||||
PlayerVisual playerVisual = GetComponentInChildren<PlayerVisual>();
|
||||
@@ -640,10 +640,10 @@ namespace BrewMonster
|
||||
// Wait one frame for NamedAnimancerComponent to be available
|
||||
// 等待一帧以确保NamedAnimancerComponent可用
|
||||
yield return null;
|
||||
|
||||
|
||||
if (m_pPlayerModel == null)
|
||||
yield break;
|
||||
|
||||
|
||||
UpdateVisualComponents();
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ namespace BrewMonster
|
||||
StartCoroutine(InitializePlayerCECModelDelayed());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Set references on CECModel
|
||||
// 在CECModel上设置引用
|
||||
m_pPlayerCECModel.SetSkeletonBuilder(skeletonBuilder);
|
||||
@@ -757,10 +757,10 @@ namespace BrewMonster
|
||||
// Wait one frame for SkeletonBuilder to be built
|
||||
// 等待一帧以便SkeletonBuilder被构建
|
||||
yield return null;
|
||||
|
||||
|
||||
if (m_pPlayerModel == null)
|
||||
yield break;
|
||||
|
||||
|
||||
SkeletonBuilder skeletonBuilder = m_pPlayerModel.GetComponentInChildren<SkeletonBuilder>();
|
||||
if (skeletonBuilder != null)
|
||||
{
|
||||
@@ -770,7 +770,7 @@ namespace BrewMonster
|
||||
}
|
||||
m_pPlayerCECModel.SetSkeletonBuilder(skeletonBuilder);
|
||||
m_pPlayerCECModel.SetTransform(m_pPlayerModel.transform);
|
||||
|
||||
|
||||
// Initialize skeleton builder (ensures hooks are available)
|
||||
// 初始化骨架构建器(确保挂点可用)
|
||||
m_pPlayerCECModel.InitializeSkeletonBuilder();
|
||||
@@ -821,7 +821,7 @@ namespace BrewMonster
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ShowExtendStates(start, pData, count);
|
||||
Array.Copy(pData, start, m_aExtStates, start, count);
|
||||
if(GetExtState(111))
|
||||
@@ -848,18 +848,18 @@ namespace BrewMonster
|
||||
// return;
|
||||
|
||||
//static const char* szBasePath = "������\\״̬Ч��\\";
|
||||
|
||||
|
||||
const int bitSize = sizeof(uint) * 8;
|
||||
BMLogger.LogError($"[CECPlayer] ShowExtendStates: start: {start}, count: {count}, bitSize: {bitSize}");
|
||||
for (int index = 0; index<count; index++)
|
||||
{
|
||||
{
|
||||
int idState = index + start;
|
||||
for (int i=0; i < bitSize; i++)
|
||||
{
|
||||
int dwMask = 1 << i;
|
||||
int dwFlag1 = (int)(m_aExtStatesShown[idState] & dwMask);
|
||||
int dwFlag2 = (int)(pData[index] & dwMask);
|
||||
|
||||
|
||||
if ((dwFlag1 == 0 && dwFlag2 == 0) || (dwFlag1 != 0 && dwFlag2 != 0))
|
||||
continue;
|
||||
|
||||
@@ -906,17 +906,17 @@ namespace BrewMonster
|
||||
// else
|
||||
// {
|
||||
// // Add new state
|
||||
|
||||
|
||||
// const char* szHH = pvs->GetHH();
|
||||
// float fScale;
|
||||
|
||||
|
||||
// if (stricmp("HH_Head", szHH) == 0)
|
||||
// fScale = GetMajorModel()->GetOuterData()[0];
|
||||
// else if (stricmp("HH_Spine", szHH) == 0)
|
||||
// fScale = GetMajorModel()->GetOuterData()[1];
|
||||
// else
|
||||
// fScale = 1.0f;
|
||||
|
||||
|
||||
// CECModel *pWeapon = NULL;
|
||||
// bool bLeft (false);
|
||||
// if (IsWeaponHookPos(pvs->GetHH(), &bLeft, &pWeapon))
|
||||
@@ -1090,7 +1090,7 @@ namespace BrewMonster
|
||||
if (!string.IsNullOrEmpty(data.ActionName))
|
||||
{
|
||||
if (!skillActionMap.TryAdd(data.Name, data))
|
||||
{
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1172,7 +1172,7 @@ namespace BrewMonster
|
||||
// ❌ not found
|
||||
// Debug.LogWarning($"CECPlayer::BuildActionList() Failed to find skill action {idSkill}!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1237,7 +1237,7 @@ namespace BrewMonster
|
||||
// update show weapon states.
|
||||
m_bShowWeapon = action.data.hide_weapon != 0 ? false : true;
|
||||
}
|
||||
|
||||
|
||||
if( iAction >= (int)PLAYER_ACTION_TYPE.ACT_ATTACK_1 && iAction <= (int)PLAYER_ACTION_TYPE.ACT_ATTACK_4 )
|
||||
{
|
||||
// attack action should not be played by this function
|
||||
@@ -1245,7 +1245,7 @@ namespace BrewMonster
|
||||
}
|
||||
else if( iAction == (int)PLAYER_ACTION_TYPE.ACT_ATTACK_TOSS )
|
||||
{
|
||||
// we use toss second part action as a common action
|
||||
// we use toss second part action as a common action
|
||||
// sprintf(szAct, "%s_%s��", action.data->action_prefix, action.data->action_weapon_suffix[weapon_type].suffix);
|
||||
szAct = $"{action.data.ActionPrefix}_{action.data.action_weapon_suffix[weapon_type].Suffix}";
|
||||
if( !bQueue ){
|
||||
@@ -1256,9 +1256,9 @@ namespace BrewMonster
|
||||
return true;
|
||||
}
|
||||
else if( (
|
||||
iAction >= (int)PLAYER_ACTION_TYPE.ACT_EXP_WAVE &&
|
||||
iAction <= (int)PLAYER_ACTION_TYPE.ACT_EXP_KISS_END) ||
|
||||
(iAction >= (int)PLAYER_ACTION_TYPE.ACT_EXP_FIGHT &&
|
||||
iAction >= (int)PLAYER_ACTION_TYPE.ACT_EXP_WAVE &&
|
||||
iAction <= (int)PLAYER_ACTION_TYPE.ACT_EXP_KISS_END) ||
|
||||
(iAction >= (int)PLAYER_ACTION_TYPE.ACT_EXP_FIGHT &&
|
||||
iAction <= (int)PLAYER_ACTION_TYPE.ACT_EXP_DANCE) )
|
||||
{
|
||||
// ���鶯��
|
||||
@@ -1290,7 +1290,7 @@ namespace BrewMonster
|
||||
m_pActionController.QueueNonSkillActionWithName(iAction, szAct, iTransTime, false, false, false, true, null, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -1301,7 +1301,7 @@ namespace BrewMonster
|
||||
if( iAction == (int)PLAYER_ACTION_TYPE.ACT_FIGHTSTAND )
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
else if( iAction >= (int)PLAYER_ACTION_TYPE.ACT_PICKUP && iAction <= (int)PLAYER_ACTION_TYPE.ACT_PICKUP_MATTER )
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
|
||||
// if( iAction == (int)PLAYER_ACTION_TYPE.ACT_TWO_KISS )
|
||||
// sprintf(szAct, "վ��_����_˫��_ͨ��");
|
||||
@@ -1337,7 +1337,7 @@ namespace BrewMonster
|
||||
else if (m_bHangerOn)
|
||||
{
|
||||
if( iAction == (int)PLAYER_ACTION_TYPE.ACT_FIGHTSTAND )
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
else if( iAction >= (int)PLAYER_ACTION_TYPE.ACT_PICKUP && iAction <= (int)PLAYER_ACTION_TYPE.ACT_PICKUP_MATTER )
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
|
||||
@@ -1370,7 +1370,7 @@ namespace BrewMonster
|
||||
else if (m_AttachMode == AttachMode.enumAttachHugPlayer || m_AttachMode == AttachMode.enumAttachRideOnPlayer)
|
||||
{
|
||||
if( iAction == (int)PLAYER_ACTION_TYPE.ACT_FIGHTSTAND )
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
else if( iAction >= (int)PLAYER_ACTION_TYPE.ACT_PICKUP && iAction <= (int)PLAYER_ACTION_TYPE.ACT_PICKUP_MATTER )
|
||||
action = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_STAND];
|
||||
|
||||
@@ -1402,7 +1402,7 @@ namespace BrewMonster
|
||||
// else
|
||||
// {
|
||||
// QueueNonSkillActionWithName(iAction, szAct, iTransTime, bRestart, false, false, true, NULL, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);
|
||||
|
||||
|
||||
// if(pRightHandWeapon && IsUsingMagicWeapon())
|
||||
// pRightHandWeapon->QueueAction(_GenWeaponActionName(szAct, m_iGender), iTransTime, iAction, bRestart ? true : false);
|
||||
// }
|
||||
@@ -1414,7 +1414,7 @@ namespace BrewMonster
|
||||
CECPlayer pBuddy = m_pPlayerMan.GetPlayer(m_iBuddyId);
|
||||
if (pBuddy)
|
||||
{
|
||||
if( iAction == (int)PLAYER_ACTION_TYPE.ACT_STAND || iAction == (int)PLAYER_ACTION_TYPE.ACT_FIGHTSTAND ||
|
||||
if( iAction == (int)PLAYER_ACTION_TYPE.ACT_STAND || iAction == (int)PLAYER_ACTION_TYPE.ACT_FIGHTSTAND ||
|
||||
iAction == (int)PLAYER_ACTION_TYPE.ACT_RUN || iAction == (int)PLAYER_ACTION_TYPE.ACT_WALK || iAction == (int)PLAYER_ACTION_TYPE.ACT_JUMP_START ||
|
||||
iAction == (int)PLAYER_ACTION_TYPE.ACT_JUMP_LOOP || iAction == (int)PLAYER_ACTION_TYPE.ACT_JUMP_LAND || iAction == (int)PLAYER_ACTION_TYPE.ACT_WOUNDED ||
|
||||
iAction == (int)PLAYER_ACTION_TYPE.ACT_TWO_KISS )
|
||||
@@ -1452,7 +1452,7 @@ namespace BrewMonster
|
||||
// if( !bQueue )
|
||||
// {
|
||||
// if( !m_bShowWeapon )
|
||||
// ShowWeapon(false);
|
||||
// ShowWeapon(false);
|
||||
// else
|
||||
// {
|
||||
// // ��ʦ��Ծʱ��Ҫ���ط���
|
||||
@@ -1461,11 +1461,11 @@ namespace BrewMonster
|
||||
// else
|
||||
// ShowWeapon(true);
|
||||
// }
|
||||
|
||||
|
||||
// // ���ݲ��Ŷ�����������������λ��
|
||||
// UpdateWeaponHangerPosByAction(iAction);
|
||||
// }
|
||||
// EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szShapeName, szAct, iTransTime));
|
||||
// }
|
||||
// EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szShapeName, szAct, iTransTime));
|
||||
m_pActionController.PlayNonSkillActionWithName(iAction, szAct, bRestart, iTransTime);
|
||||
return true;
|
||||
}
|
||||
@@ -1659,7 +1659,7 @@ namespace BrewMonster
|
||||
//EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szShapeName, szAct, iTransTime, true));
|
||||
m_pActionController.PlayNonSkillActionWithName(iAction, szAct, true, iTransTime, bHideFX, attackEvent,COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);
|
||||
szAct = EC_Utility.BuildActionName(action, weapon_type, "落");
|
||||
queueActionEvent.SetData(szShapeName, szAct, SetApplyDamage, true, attackEvent, iTransTime,false);
|
||||
queueActionEvent.SetData(szShapeName, szAct, SetApplyDamage, true, attackEvent, iTransTime,false);
|
||||
//EventBus.PublishChannelClass(m_PlayerInfo.cid, queueActionEvent);
|
||||
m_pActionController.QueueNonSkillActionWithName(iAction, szAct, 0, false, bHideFX);
|
||||
//PlayNonSkillActionWithName(iAction, szAct, true, 200, true, ref pActFlag, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);gagága
|
||||
@@ -1706,7 +1706,7 @@ namespace BrewMonster
|
||||
|
||||
// nTime1 = m_pPlayerModel.GetComActTimeSpanByName(szAct);
|
||||
|
||||
szAct = EC_Utility.BuildActionName(action, weapon_type, "落", szActionMiddleName);
|
||||
szAct = EC_Utility.BuildActionName(action, weapon_type, "落", szActionMiddleName);
|
||||
queueActionEvent.SetData(szShapeName, szAct, SetApplyDamage, false, attackEvent, 0, false);
|
||||
//EventBus.PublishChannelClass(m_PlayerInfo.cid, queueActionEvent);
|
||||
m_pActionController.QueueNonSkillActionWithName(iAction, szAct, 0, false, false, true, false);
|
||||
@@ -1828,7 +1828,7 @@ namespace BrewMonster
|
||||
GetLeftWeaponHookPos(m_weaponHangerPos),
|
||||
GetLeftHandWeapon(),
|
||||
GetLeftWeaponOwnHookPos(GetLeftHandWeapon()));
|
||||
}
|
||||
}
|
||||
if (GetRightHandWeapon()){
|
||||
GetPlayerModel().AddChildModel(
|
||||
_right_hand_weapon,
|
||||
@@ -2123,7 +2123,7 @@ namespace BrewMonster
|
||||
}
|
||||
else if (nDamage == -1)
|
||||
{
|
||||
// when else player hit this player iDamage is -1,
|
||||
// when else player hit this player iDamage is -1,
|
||||
// Just play a wounded action
|
||||
if (!OnDamaged(skill))
|
||||
{
|
||||
@@ -2167,7 +2167,7 @@ namespace BrewMonster
|
||||
BubbleText((int)BubbleTextType.BUBBLE_HITMISSED, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void BubbleText(int iIndex, uint dwNum, int p1 = 0)
|
||||
{
|
||||
|
||||
@@ -2216,7 +2216,7 @@ namespace BrewMonster
|
||||
|
||||
if (!bHost)
|
||||
dwCol = new Color(237, 56, 0);
|
||||
|
||||
|
||||
if ((p1 & 0x0001) != 0)
|
||||
bubbleTextType = ImageResType.IMG_DEADLYSTRIKE;
|
||||
else if ((p1 & 0x0002) != 0)
|
||||
@@ -2248,7 +2248,7 @@ namespace BrewMonster
|
||||
break;
|
||||
|
||||
case (int)BubbleTextType.BUBBLE_HITMISSED:
|
||||
|
||||
|
||||
if (!bHost)
|
||||
dwCol = new Color(237, 56, 0);
|
||||
|
||||
@@ -2264,7 +2264,7 @@ namespace BrewMonster
|
||||
break;
|
||||
|
||||
case (int)BubbleTextType.BUBBLE_IMMUNE:
|
||||
|
||||
|
||||
if (!bHost)
|
||||
dwCol = new Color(237, 56, 0);
|
||||
|
||||
@@ -2298,12 +2298,12 @@ namespace BrewMonster
|
||||
dwCol = new Color(126, 206, 244);
|
||||
bubbleTextType = ImageResType.IMG_ADD;
|
||||
break;
|
||||
|
||||
|
||||
case (int)BubbleTextType.BUBBLE_DODGE_DEBUFF:
|
||||
|
||||
|
||||
if (!bHost)
|
||||
dwCol = new Color(237, 56, 0);
|
||||
|
||||
|
||||
bubbleTextType = ImageResType.IMG_DODGE_DEBUFF;
|
||||
break;
|
||||
|
||||
@@ -2471,12 +2471,12 @@ namespace BrewMonster
|
||||
szActionMiddleName = "_空中翅膀"; // Air with wings / 空中翅膀
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
szActionMiddleName = "_空中飞剑"; // Air with sword / 空中飞剑
|
||||
}
|
||||
|
||||
szActionMiddleName += "_施放起_";
|
||||
szAct = EC_Utility.BuildActionName(data, weapon_type, szActionMiddleName);
|
||||
szAct = EC_Utility.BuildActionName(data, weapon_type, szActionMiddleName);
|
||||
GetSkillSectionActionName(ref szAct, idSkill, nSection);
|
||||
|
||||
if (!PlaySkillAttackActionWithName(idSkill, szAct, bHideFX, attackEvent))
|
||||
@@ -2706,14 +2706,14 @@ namespace BrewMonster
|
||||
public static int GetRealmLayer(int realmLevel) { return realmLevel != 0 ? (realmLevel + 9) / 10 : 0; }
|
||||
|
||||
public static int GetRealmSubLevel(int realmLevel) { return realmLevel != 0 ? (realmLevel % 10 != 0 ? realmLevel % 10 : 10) : 0; }
|
||||
|
||||
|
||||
string GetFashionActionName()
|
||||
{
|
||||
// ����ʱװװ����Я���Ķ�������
|
||||
//
|
||||
string strAction = "";
|
||||
string strAction = "";
|
||||
|
||||
int[] local_check_order =
|
||||
int[] local_check_order =
|
||||
{
|
||||
(int)IndexOfIteminEquipmentInventory.EQUIPIVTR_FASHION_HEAD,
|
||||
(int)IndexOfIteminEquipmentInventory.EQUIPIVTR_FASHION_BODY,
|
||||
@@ -2738,7 +2738,7 @@ namespace BrewMonster
|
||||
|
||||
return strAction;
|
||||
}
|
||||
void GetFashionActionNameByID(int idEquipment, ref string strAction)
|
||||
void GetFashionActionNameByID(int idEquipment, ref string strAction)
|
||||
{
|
||||
if (idEquipment != 0)
|
||||
{
|
||||
@@ -2747,7 +2747,7 @@ namespace BrewMonster
|
||||
(uint)idEquipment,
|
||||
ID_SPACE.ID_SPACE_ESSENCE,
|
||||
ref dt);
|
||||
|
||||
|
||||
if (pEquip != null && dt == DATA_TYPE.DT_FASHION_ESSENCE)
|
||||
{
|
||||
FASHION_ESSENCE pEssence = (FASHION_ESSENCE)pEquip;
|
||||
@@ -2758,7 +2758,7 @@ namespace BrewMonster
|
||||
protected bool PlayGfx(string szPath, string szHook, float fScale /*1.0f*/, uint iShapeTypeMask /*(1<<PLAYERMODEL_MAJOR)*/, bool bForceNoRecord = false)
|
||||
{
|
||||
// bool bPlayed(false);
|
||||
// bool bSkipRecord = (iShapeTypeMask != PLAYERMODEL_TYPEALL) || bForceNoRecord;
|
||||
// bool bSkipRecord = (iShapeTypeMask != PLAYERMODEL_TYPEALL) || bForceNoRecord;
|
||||
// for(int i=0;i<PLAYERMODEL_MAX;i++)
|
||||
// {
|
||||
// if (m_pModels[i] && (iShapeTypeMask & (1<<i)))
|
||||
@@ -2791,7 +2791,7 @@ namespace BrewMonster
|
||||
if (prefab != null)
|
||||
{
|
||||
BMLogger.Log($"[GFX Spawn] Loading GFX: {path}, Prefab Name: {prefab.name}");
|
||||
|
||||
|
||||
if (_levelUpVfx != null)
|
||||
{
|
||||
if (_levelUpVfx.IsPlaying())
|
||||
@@ -2867,7 +2867,7 @@ namespace BrewMonster
|
||||
// Set part extend properties
|
||||
public void SetPartExtendProps(int iPropIdx, object pData)
|
||||
{
|
||||
BMLogger.LogError($"HoangDev: SetPartExtendProps iPropIdx={iPropIdx} pData={pData} ");
|
||||
// BMLogger.LogError($"HoangDev: SetPartExtendProps iPropIdx={iPropIdx} pData={pData} ");
|
||||
switch (iPropIdx)
|
||||
{
|
||||
case (int)ExtendPropertyClass.EXTPROPIDX_BASE:
|
||||
@@ -3346,7 +3346,7 @@ namespace BrewMonster
|
||||
|
||||
protected async Task<bool> LoadPlayerSkeleton(bool bAtOnce)
|
||||
{
|
||||
|
||||
|
||||
int[] aEnabledEquips = new int[InventoryConst.SIZE_ALL_EQUIPIVTR];
|
||||
for (int i = 0; i < InventoryConst.SIZE_ALL_EQUIPIVTR; i++)
|
||||
{
|
||||
@@ -3363,7 +3363,7 @@ namespace BrewMonster
|
||||
if (aEnabledEquips[InventoryConst.EQUIPIVTR_WEAPON] > 0)
|
||||
EquipMask |= 1 << InventoryConst.EQUIPIVTR_WEAPON;
|
||||
if (aEnabledEquips[InventoryConst.EQUIPIVTR_FASHION_WEAPON] > 0)
|
||||
EquipMask |= 1 << InventoryConst.EQUIPIVTR_FASHION_WEAPON;
|
||||
EquipMask |= 1 << InventoryConst.EQUIPIVTR_FASHION_WEAPON;
|
||||
Array.Copy(aEnabledEquips, aEquips, InventoryConst.IVTRSIZE_EQUIPPACK);
|
||||
DecideWeaponLoad(aEquips, EquipMask);
|
||||
|
||||
@@ -3489,11 +3489,11 @@ namespace BrewMonster
|
||||
// if (!bCanShowFashionWeaponBefore)
|
||||
// SET_WEAPON(EQUIPIVTR_FASHION_WEAPON, m_aEquips[EQUIPIVTR_FASHION_WEAPON]);
|
||||
// }
|
||||
// RECORD_NORMAL_WEAPON(
|
||||
// RECORD_NORMAL_WEAPON(
|
||||
// pWeapon->file_model_left, pWeapon->file_model_right, pSubType->action_type);
|
||||
// }
|
||||
// // ������ͨ����
|
||||
// else
|
||||
// else
|
||||
// {
|
||||
// bCanShowFashionWeapon = CanShowFashionWeapon(DEFAULT_ACTION_TYPE, m_iFashionWeaponType);
|
||||
// if (bCanShowFashionWeapon)
|
||||
@@ -3514,7 +3514,7 @@ namespace BrewMonster
|
||||
// bCanShowFashionWeapon = CanShowFashionWeapon(m_uAttackType, pFashion->action_type);
|
||||
// if (!bCanShowFashionWeapon)
|
||||
// {
|
||||
// if (pGameUI && this == g_pGame->GetGameRun()->GetHostPlayer() && InFashionMode())
|
||||
// if (pGameUI && this == g_pGame->GetGameRun()->GetHostPlayer() && InFashionMode())
|
||||
// pGameUI->AddChatMessage(pGameUI->GetStringFromTable(906), GP_CHAT_SYSTEM);
|
||||
// CLEAR_WEAPON(EQUIPIVTR_FASHION_WEAPON);
|
||||
// if (bCanShowFashionWeaponBefore)
|
||||
@@ -3522,7 +3522,7 @@ namespace BrewMonster
|
||||
// }
|
||||
// // ����ʾʱװ�������˴�Ҫ��m_stoneWeapon����
|
||||
// else CLEAR_WEAPON(EQUIPIVTR_WEAPON);
|
||||
// RECORD_FASHION_WEAPON(
|
||||
// RECORD_FASHION_WEAPON(
|
||||
// pFashion->file_model_left, pFashion->file_model_right, pFashion->action_type);
|
||||
// }
|
||||
// // ����ʱװ����
|
||||
@@ -3537,7 +3537,7 @@ namespace BrewMonster
|
||||
// RECORD_FASHION_WEAPON((char*)NULL, (char*)NULL, DEFAULT_ACTION_TYPE);
|
||||
// }
|
||||
// }
|
||||
// if (bCanShowFashionWeaponBefore && !bCanShowFashionWeapon
|
||||
// if (bCanShowFashionWeaponBefore && !bCanShowFashionWeapon
|
||||
// && pGameUI && !bFashionWeaponChanged && bNormalWeaponChanged && this == g_pGame->GetGameRun()->GetHostPlayer())
|
||||
// pGameUI->AddChatMessage(pGameUI->GetStringFromTable(906), GP_CHAT_SYSTEM);
|
||||
}
|
||||
@@ -3565,7 +3565,7 @@ namespace BrewMonster
|
||||
else
|
||||
m_dwResFlags &= ~dwFlag;
|
||||
}
|
||||
public virtual void Release()
|
||||
public virtual void Release()
|
||||
{
|
||||
//TODO: Implement this latter
|
||||
// DetachBuddy();
|
||||
@@ -3659,7 +3659,7 @@ namespace BrewMonster
|
||||
// }
|
||||
|
||||
// if (m_pPetCureGFX)
|
||||
// {
|
||||
// {
|
||||
// A3DGFXExMan *pGFXExMan = g_pGame->GetA3DGFXExMan();
|
||||
// if (pGFXExMan)
|
||||
// pGFXExMan->CacheReleasedGfx(m_pPetCureGFX);
|
||||
@@ -3678,13 +3678,13 @@ namespace BrewMonster
|
||||
// g_pGame->GetGFXCaster()->ReleaseGFXEx(m_pWaterWaveStill);
|
||||
// m_pWaterWaveStill = NULL;
|
||||
// }
|
||||
|
||||
|
||||
// if (m_pWaterWaveMove)
|
||||
// {
|
||||
// g_pGame->GetGFXCaster()->ReleaseGFXEx(m_pWaterWaveMove);
|
||||
// m_pWaterWaveMove = NULL;
|
||||
// }
|
||||
|
||||
|
||||
// if (m_pAirBubble)
|
||||
// {
|
||||
// g_pGame->GetGFXCaster()->ReleaseGFXEx(m_pAirBubble);
|
||||
@@ -3716,7 +3716,7 @@ namespace BrewMonster
|
||||
// }
|
||||
|
||||
// ClearBoothModel();
|
||||
|
||||
|
||||
// for (MOEffectMAP::iterator it = m_mapMOEffect.begin();it != m_mapMOEffect.end();++it)
|
||||
// {
|
||||
// A3DGFXExMan *pGFXExMan = g_pGame->GetA3DGFXExMan();
|
||||
@@ -3744,11 +3744,11 @@ namespace BrewMonster
|
||||
player.SetGroundNormal(GetGroundNormal());
|
||||
player.SetUseGroundNormal(GetUseGroundNormal());
|
||||
|
||||
// CECPlayer
|
||||
// CECPlayer
|
||||
player.m_PlayerInfo = GetPlayerInfo();
|
||||
player.SetBornStamp(GetBornStamp());
|
||||
player.name = GetName();
|
||||
//player.SetProps(&GetBasicProps(), &GetExtendProps());
|
||||
//player.SetProps(&GetBasicProps(), &GetExtendProps());
|
||||
player.m_iGender = GetGender();
|
||||
player.m_iProfession = GetProfession();
|
||||
//player.m_pvp = GetPVPInfo();
|
||||
@@ -3775,12 +3775,12 @@ namespace BrewMonster
|
||||
player.m_fTouchRad = GetTouchRadius();
|
||||
//player.m_byPariahLvl = GetPariahLevel();
|
||||
//player.SetBoothName(GetBoothName());
|
||||
|
||||
|
||||
// player.m_CustomizeFactor = m_CustomizeFactor;
|
||||
// player.ChangeCustomizeData(m_CustomizeData);
|
||||
// player.ChangeCustomizeData(m_CustomizeData);
|
||||
// for (int i=0; i < GetEffectCount(); i++)
|
||||
// player.ApplyEffect(GetEffect(i), true);
|
||||
|
||||
|
||||
// player.SetFactionID(GetFactionID());
|
||||
player.SetCurPetID(GetCurPetID());
|
||||
// player.SetCurrentTitle(GetCurrentTitle());
|
||||
@@ -3802,11 +3802,11 @@ namespace BrewMonster
|
||||
}
|
||||
public async Task TransformShape(byte iShape, bool bLoadAtOnce = false/* =false */)
|
||||
{
|
||||
SetShape(iShape);
|
||||
SetShape(iShape);
|
||||
//a_LogOutput(1, "CECPlayer::TransformShape(iShape=%d)(iShapeType=%d,iShapeID=%d)", iShape, PLAYERMODEL_GETTYPE(iShape), PLAYERMODEL_GETID(iShape));
|
||||
|
||||
|
||||
if (!GetMajorModel()) return;
|
||||
|
||||
|
||||
if (IsShapeChanged())
|
||||
{
|
||||
m_bWeaponAttached = false;
|
||||
@@ -3827,11 +3827,11 @@ namespace BrewMonster
|
||||
// | 7 6 | 5 4 3 2 1 0 |
|
||||
// |-TYPE-|-----Model ID-----|
|
||||
int iNewShape = (iShape & 0xff); // only accept 8bit
|
||||
// �Ծɵ�Shape�������ݽ�������
|
||||
// �Ծɵ�Shape�������ݽ�������
|
||||
FixOldShapeInfo(ref iNewShape);
|
||||
|
||||
|
||||
// ְҵ������Model IDҪ��ת��
|
||||
if( PLAYERMODEL_GETTYPE(iNewShape) == (int)PLAYERMODEL_TYPE.PLAYERMODEL_PROFESSION )
|
||||
if( PLAYERMODEL_GETTYPE(iNewShape) == (int)PLAYERMODEL_TYPE.PLAYERMODEL_PROFESSION )
|
||||
{
|
||||
int iRealID = _GetProfessionTransformModelID(
|
||||
m_iProfession, m_iGender, PLAYERMODEL_GETID(iNewShape));
|
||||
@@ -3840,7 +3840,7 @@ namespace BrewMonster
|
||||
// ��ְҵ������Model IDΪEC_Resource.h���ֵ���ʲ�������
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
// store the original data into 8~15 bit
|
||||
@@ -3852,7 +3852,7 @@ namespace BrewMonster
|
||||
if(iShape != 0 && PLAYERMODEL_GETTYPE(iShape) == 0)
|
||||
iShape |= 0x40;
|
||||
}
|
||||
public int _GetProfessionTransformModelID(int nChar, int nGender, int nModelID)
|
||||
public int _GetProfessionTransformModelID(int nChar, int nGender, int nModelID)
|
||||
{
|
||||
int result = 0;
|
||||
switch (nChar){
|
||||
@@ -3875,7 +3875,7 @@ namespace BrewMonster
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public struct PlayActionEvent
|
||||
@@ -4123,7 +4123,7 @@ namespace BrewMonster
|
||||
BUBBLE_HPWARN,
|
||||
BUBBLE_MPWARN,
|
||||
BUBBLE_REBOUND, // ����
|
||||
BUBBLE_BEAT_BACK, // ����
|
||||
BUBBLE_BEAT_BACK, // ����
|
||||
BUBBLE_ADD, // ��Ѫ�ļӺ�
|
||||
BUBBLE_DODGE_DEBUFF,
|
||||
BUBBLE_REALMEXP,
|
||||
@@ -4141,7 +4141,7 @@ namespace BrewMonster
|
||||
public int iDuelTimeCnt; // Duel time counter
|
||||
public int iDuelRlt; // Duel result. 0, no defined; 1-win; 2-lose; 3-draw
|
||||
};
|
||||
|
||||
|
||||
// Battle type / 战斗类型
|
||||
public enum BattleType
|
||||
{
|
||||
@@ -4150,7 +4150,7 @@ namespace BrewMonster
|
||||
BT_COUNTRY = 2, // Country war / 国战
|
||||
BT_CHARIOT = 3, // Chariot war / 战车战
|
||||
};
|
||||
|
||||
|
||||
// Score rank entry for country battle live show / 国战直播显示分数排行条目
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ScoreRankEntry
|
||||
@@ -4160,7 +4160,7 @@ namespace BrewMonster
|
||||
public int iKillCount; // Kill count / 击杀数
|
||||
public int iDeathCount; // Death count / 死亡数
|
||||
};
|
||||
|
||||
|
||||
// Death entry for country battle live show / 国战直播显示死亡条目
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct DeathEntry
|
||||
@@ -4169,7 +4169,7 @@ namespace BrewMonster
|
||||
public int idVictim; // Victim ID / 受害者ID
|
||||
public int iTime; // Death time / 死亡时间
|
||||
};
|
||||
|
||||
|
||||
// Battle information / 战斗信息
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct BATTLEINFO
|
||||
@@ -4183,7 +4183,7 @@ namespace BrewMonster
|
||||
public int iScore_I; // Score of invader / 攻击方分数
|
||||
public int iScore_D; // Score of defender / 防守方分数
|
||||
public int iEndTime; // Battle end time / 战斗结束时间
|
||||
|
||||
|
||||
// 国战专用数据 / Country war specific data
|
||||
public int iOffenseCountry; // Offense country / 攻击方国家
|
||||
public int iDefenceCountry; // Defence country / 防守方国家
|
||||
@@ -4194,7 +4194,7 @@ namespace BrewMonster
|
||||
public A3DVECTOR3 posCarrier; // 扛旗者位置(bFlagCarrier为false时有效)/ Carrier position (valid when bFlagCarrier is false)
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool bCarrierInvader; // 扛旗者是攻击方(bFlagCarrier为false时有效)/ Carrier is invader (valid when bFlagCarrier is false)
|
||||
|
||||
|
||||
public int iCombatTime; // 战斗时间(秒)/ Combat time (seconds)
|
||||
public int iAttendTime; // 参加战场时间(秒)/ Attend time (seconds)
|
||||
public int iKillCount; // 击杀次数 / Kill count
|
||||
@@ -4203,25 +4203,25 @@ namespace BrewMonster
|
||||
public int iCountryDeathCount;// 同国家死亡次数 / Same country death count
|
||||
public int iAttackerCount; // 攻击方人数 / Attacker count
|
||||
public int iDefenderCount; // 防守方人数 / Defender count
|
||||
|
||||
|
||||
public int iStrongHoldCount; // 据点个数 / Stronghold count
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public int[] iStrongHoldState; // 据点占领状态 8 == ARRAY_SIZE(COUNTRY_CONFIG::stronghold) / Stronghold occupation state
|
||||
|
||||
|
||||
// Score rank containers (using List instead of std::vector) / 分数排行容器(使用List代替std::vector)
|
||||
public List<ScoreRankEntry> OffenseRanks; // Offense ranks / 攻击方排行
|
||||
public List<ScoreRankEntry> DefenceRanks; // Defence ranks / 防守方排行
|
||||
|
||||
|
||||
// Death containers (using List instead of std::vector) / 死亡容器(使用List代替std::vector)
|
||||
public List<DeathEntry> OffenseDeaths; // Offense deaths / 攻击方死亡
|
||||
public List<DeathEntry> DefenceDeaths; // Defence deaths / 防守方死亡
|
||||
|
||||
|
||||
// 战车 / Chariot
|
||||
public int iChariot; // 战车id / Chariot id
|
||||
public int iEnergy; // 能量 / Energy
|
||||
public int iScoreSelf; // 自己成绩 / Self score
|
||||
public int iMultiKill; // 连杀 / Multi kill
|
||||
|
||||
|
||||
// Initialize arrays and lists / 初始化数组和列表
|
||||
public void Initialize()
|
||||
{
|
||||
@@ -4236,7 +4236,7 @@ namespace BrewMonster
|
||||
if (DefenceDeaths == null)
|
||||
DefenceDeaths = new List<DeathEntry>();
|
||||
}
|
||||
|
||||
|
||||
// Set country battle live show info / 设置国战直播显示信息
|
||||
// TODO: Implement when cmd_countrybattle_live_show_result is available
|
||||
// 当cmd_countrybattle_live_show_result可用时实现
|
||||
@@ -4245,31 +4245,31 @@ namespace BrewMonster
|
||||
// TODO: Implement SetCountryBattleLiveShowInfo
|
||||
// 实现SetCountryBattleLiveShowInfo
|
||||
}
|
||||
|
||||
|
||||
// Check if in guild war / 检查是否在帮派战中
|
||||
public bool IsGuildWar()
|
||||
{
|
||||
return nType == (int)BattleType.BT_GUILD;
|
||||
}
|
||||
|
||||
|
||||
// Check if in country war / 检查是否在国战中
|
||||
public bool IsCountryWar()
|
||||
{
|
||||
return nType == (int)BattleType.BT_COUNTRY;
|
||||
}
|
||||
|
||||
|
||||
// Check if is flag carrier / 检查是否是旗手
|
||||
public bool IsFlagCarrier()
|
||||
{
|
||||
return IsCountryWar() && bFlagCarrier;
|
||||
}
|
||||
|
||||
|
||||
// Check if in chariot war / 检查是否在战车战中
|
||||
public bool IsChariotWar()
|
||||
{
|
||||
return nType == (int)BattleType.BT_CHARIOT;
|
||||
}
|
||||
|
||||
|
||||
// Reset battle info / 重置战斗信息
|
||||
public void Reset()
|
||||
{
|
||||
|
||||
@@ -569,7 +569,7 @@ public class CECNPC : CECObject
|
||||
PlayModelAction((int)NPCActionIndex.ACT_IDLE);
|
||||
if (IsPetNPC() && !IsDead() && !IsDisappearing())
|
||||
{
|
||||
//OnPetSays(CECPetWords::TW_REST);
|
||||
//OnPetSays(CECPetWords::TW_REST);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -819,14 +819,14 @@ public class CECNPC : CECObject
|
||||
{
|
||||
if (iDamage == -1 || iDamage == -2)
|
||||
{
|
||||
// when else player hit this npc iDamage is -1,
|
||||
// when else player hit this npc iDamage is -1,
|
||||
// so if iDamage is -1 we will shoud the wounded animation
|
||||
if (iDamage == -1 && !m_bStartFight)
|
||||
PlayModelAction((int)NPCActionIndex.ACT_WOUNDED);
|
||||
FLoatingTextManager.Instance.ShowText(transform.position, iDamage, Color.red, 1.0f, ImageResType.NUM_IMAGE, this);
|
||||
|
||||
if ((dwModifier & (uint)MOD.MOD_IMMUNE) != 0 /* && !IsImmuneDisable()*/)
|
||||
BubbleText((int)MOD.MOD_IMMUNE, 0);
|
||||
BubbleText((int)MOD.MOD_IMMUNE, 0);
|
||||
else if ((dwModifier & (uint)MOD.MOD_NULLITY) != 0)
|
||||
BubbleText((int)MOD.MOD_NULLITY, 0);
|
||||
else if ((dwModifier & (uint)MOD.MOD_ENCHANT_FAILED) != 0)
|
||||
@@ -878,7 +878,7 @@ public class CECNPC : CECObject
|
||||
public void BubbleText(int iIndex, int dwNum, int p1 = 0/* 0 */)
|
||||
{
|
||||
//FLoatingTextManager.Instance.ShowText(transform.position, dwNum, Color.red, 1.0f, (uint)iIndex);
|
||||
Color displayColor = new Color(237, 56, 0);
|
||||
Color displayColor = new Color(237, 56, 0);
|
||||
ImageResType imageResType = ImageResType.NUM_IMAGE;
|
||||
switch (iIndex)
|
||||
{
|
||||
@@ -888,7 +888,7 @@ public class CECNPC : CECObject
|
||||
else if ((p1 & 0x0002) != 0)
|
||||
imageResType = ImageResType.IMG_RETORT;
|
||||
break;
|
||||
|
||||
|
||||
case (int)BubbleTextType.BUBBLE_HITMISSED:
|
||||
imageResType = ImageResType.IMG_HITMISSED;
|
||||
break;
|
||||
@@ -916,7 +916,7 @@ public class CECNPC : CECObject
|
||||
case (int)BubbleTextType.BUBBLE_DODGE_DEBUFF:
|
||||
imageResType = ImageResType.IMG_DODGE_DEBUFF;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
imageResType = ImageResType.NUM_IMAGE;
|
||||
break;
|
||||
}
|
||||
@@ -1167,10 +1167,6 @@ public class CECNPC : CECObject
|
||||
{
|
||||
SetDestDirAndUp(m_vStopDir, g_vAxisY, 150);
|
||||
}
|
||||
if (-2041571143 == m_NPCInfo.nid)
|
||||
{
|
||||
BMLogger.LogError($"cmd.dest={cmd.dest}");
|
||||
}
|
||||
WorkFinished((int)WorkID.WORK_MOVE);
|
||||
return;
|
||||
}
|
||||
@@ -1584,11 +1580,11 @@ public class CECNPC : CECObject
|
||||
m_pNPCModelPolicy.PlayModelAction(iAction, bRestart, null);
|
||||
}
|
||||
|
||||
bool IsDisappearing()
|
||||
bool IsDisappearing()
|
||||
{
|
||||
if(m_DisappearCnt != null)
|
||||
{
|
||||
return m_DisappearCnt.GetCounter() != 0 ? true : false;
|
||||
return m_DisappearCnt.GetCounter() != 0 ? true : false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1653,7 +1649,7 @@ public class CECNPC : CECObject
|
||||
|
||||
// Get NPC name color
|
||||
public virtual uint GetNameColor() { return 0xffffff00; }
|
||||
|
||||
|
||||
CECPateText m_pPateLastWords1;
|
||||
CECPateText m_pPateLastWords2;
|
||||
public void SetLastSaidWords(string words, int timeShow = -1)
|
||||
@@ -1696,7 +1692,7 @@ public class CECNPC : CECObject
|
||||
// Find the model GameObject (typically a child of this NPC)
|
||||
// 查找模型GameObject(通常是此NPC的子对象)
|
||||
GameObject modelObject = null;
|
||||
|
||||
|
||||
// Try to find model in children (where NPC models are typically placed)
|
||||
// 尝试在子对象中查找模型(NPC模型通常放置在那里)
|
||||
NPCVisual npcVisual = GetComponent<NPCVisual>();
|
||||
@@ -1710,7 +1706,7 @@ public class CECNPC : CECObject
|
||||
modelObject = skeleton.gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If no model found, try to find any child with SkeletonBuilder
|
||||
// 如果未找到模型,尝试查找任何带有SkeletonBuilder的子对象
|
||||
if (modelObject == null)
|
||||
@@ -1721,14 +1717,14 @@ public class CECNPC : CECObject
|
||||
modelObject = skeleton.gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (modelObject != null)
|
||||
{
|
||||
// Create and initialize CECModel instance
|
||||
// 创建并初始化CECModel实例
|
||||
m_pNPCCECModel = new CECModel();
|
||||
m_pNPCCECModel.SetTransform(modelObject.transform);
|
||||
|
||||
|
||||
// Find and set SkeletonBuilder
|
||||
// 查找并设置SkeletonBuilder
|
||||
SkeletonBuilder skeletonBuilder = modelObject.GetComponent<SkeletonBuilder>();
|
||||
@@ -1736,7 +1732,7 @@ public class CECNPC : CECObject
|
||||
{
|
||||
skeletonBuilder = modelObject.GetComponentInChildren<SkeletonBuilder>(true);
|
||||
}
|
||||
|
||||
|
||||
if (skeletonBuilder != null)
|
||||
{
|
||||
m_pNPCCECModel.SetSkeletonBuilder(skeletonBuilder);
|
||||
@@ -1744,7 +1740,7 @@ public class CECNPC : CECObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return m_pNPCCECModel;
|
||||
}
|
||||
|
||||
@@ -1770,7 +1766,7 @@ public class CECNPC : CECObject
|
||||
BUBBLE_LOSE,
|
||||
BUBBLE_SUCCESS,
|
||||
BUBBLE_REBOUND, // ����
|
||||
BUBBLE_BEAT_BACK, // ����
|
||||
BUBBLE_BEAT_BACK, // ����
|
||||
BUBBLE_DODGE_DEBUFF,
|
||||
};
|
||||
}
|
||||
@@ -1868,4 +1864,4 @@ public ref struct ByteReader
|
||||
var s = _span.Slice(_offset, len).ToArray();
|
||||
_offset += len; return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,14 +52,14 @@ public class NPCVisual : MonoBehaviour
|
||||
}
|
||||
private void OnClearComActFlagEvent(ClearComActFlagEvent @event)
|
||||
{
|
||||
if (_currentState != null)
|
||||
BMLogger.LogError("HoangDev: OnClearComActFlagEvent _currentState:" + _currentState.Clip.name);
|
||||
// if (_currentState != null)
|
||||
// BMLogger.LogError("HoangDev: OnClearComActFlagEvent _currentState:" + _currentState.Clip.name);
|
||||
|
||||
foreach (var state in _animationQueue)
|
||||
/*foreach (var state in _animationQueue)
|
||||
{
|
||||
BMLogger.LogMono(this,"HoangDev: OnClearComActFlagEvent state:" + state);
|
||||
}
|
||||
BMLogger.LogMono(this,"HoangDev: OnClearComActFlagEvent");
|
||||
BMLogger.LogMono(this,"HoangDev: OnClearComActFlagEvent");*/
|
||||
_animationQueue.Clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -1368,7 +1368,7 @@ namespace CSNetwork
|
||||
case CommandID.PLAYER_EXT_PROP_MOVE:
|
||||
case CommandID.PLAYER_EXT_PROP_ATK:
|
||||
case CommandID.PLAYER_EXT_PROP_DEF:
|
||||
BMLogger.LogError("EC_MsgDef.MSG_PM_PLAYEREXTPROP");
|
||||
// BMLogger.LogError("EC_MsgDef.MSG_PM_PLAYEREXTPROP");
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYEREXTPROP, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
case CommandID.OWN_EXT_PROP:
|
||||
|
||||
@@ -23,7 +23,7 @@ using BrewMonster.Scripts.ChatUI;
|
||||
|
||||
namespace BrewMonster.Network
|
||||
{
|
||||
// How to connect to the server:
|
||||
// How to connect to the server:
|
||||
// 1. Set the connection info
|
||||
// 2. Login
|
||||
public class UnityGameSession : MonoSingleton<UnityGameSession>
|
||||
@@ -58,7 +58,7 @@ namespace BrewMonster.Network
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
@@ -73,7 +73,7 @@ namespace BrewMonster.Network
|
||||
CECNPC.InitStaticRes();
|
||||
}
|
||||
/// <summary>
|
||||
/// Send a
|
||||
/// Send a
|
||||
/// </summary>
|
||||
/// <param name="protocol"></param>
|
||||
/// <param name="complete"></param>
|
||||
@@ -193,7 +193,7 @@ namespace BrewMonster.Network
|
||||
var path = Application.persistentDataPath;
|
||||
#endif
|
||||
_gameSession.SetLogPath(Path.Combine(path, "Logs", "GameSession.log"));
|
||||
|
||||
|
||||
// Subscribe to unexpected disconnects
|
||||
_gameSession.Disconnected += OnUnexpectedDisconnect;
|
||||
_gameSession.FriendRequestReceived += OnFriendRequestReceived;
|
||||
@@ -229,7 +229,7 @@ namespace BrewMonster.Network
|
||||
{
|
||||
// Mark this as an intentional disconnect to prevent showing error message
|
||||
_isIntentionalDisconnect = true;
|
||||
|
||||
|
||||
// We call after receive LOGOUT(0) or LOGOUT(1) from server, but the server may choose to disconnect immediately or not.
|
||||
// Send LOGOUT(outType) like the original client.
|
||||
// _gameSession.SendPlayerLogout(outType);
|
||||
@@ -249,7 +249,7 @@ namespace BrewMonster.Network
|
||||
{
|
||||
_gameSession.Disconnect();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Return to LoginScene.
|
||||
@@ -332,9 +332,9 @@ namespace BrewMonster.Network
|
||||
if ( currentScene.IsValid() && currentScene.name == LoginSceneName)
|
||||
{
|
||||
// LoginScene is already active, nothing to do.
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Load LoginScene additively if needed (do not unload keepSceneName, e.g., a61).
|
||||
var loginScene = SceneManager.GetSceneByName(LoginSceneName);
|
||||
if (!loginScene.IsValid() || !loginScene.isLoaded)
|
||||
@@ -451,6 +451,8 @@ namespace BrewMonster.Network
|
||||
}
|
||||
public static void RequesrQueryPlayerCash()
|
||||
{
|
||||
if(Instance == null) return;
|
||||
if(Instance._gameSession == null ) return;
|
||||
Instance._gameSession.c2s_SendCmdQueryCashInfo();
|
||||
}
|
||||
public static void RequestDropEquipItem(byte index)
|
||||
@@ -486,7 +488,7 @@ namespace BrewMonster.Network
|
||||
public static void RequestCheckSecurityPassWd(string password)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdOpenFashionTrash(password);
|
||||
}
|
||||
}
|
||||
public static void c2s_SendCmdContinueAction()
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdContinueAction();
|
||||
@@ -649,7 +651,7 @@ namespace BrewMonster.Network
|
||||
Instance._gameSession.c2s_SendCmdTaskNotify( pBuf, sz);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void c2s_CmdAutoTeamSetGoal(int type, int goal_id, int op)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdAutoTeamSetGoal(type, goal_id, op);//{ ::c2s_SendCmdAutoTeamSetGoal(type, goal_id, op); }
|
||||
@@ -760,12 +762,12 @@ namespace BrewMonster.Network
|
||||
{
|
||||
// Mark as intentional to prevent showing disconnect message
|
||||
_isIntentionalDisconnect = true;
|
||||
|
||||
|
||||
_gameSession.Disconnect();
|
||||
_gameSession.Dispose();
|
||||
CECNPC.ReleaseStaticRes();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Handles unexpected server disconnections. Shows a message box and returns to login.
|
||||
/// </summary>
|
||||
@@ -807,7 +809,7 @@ namespace BrewMonster.Network
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void c2s_CmdGoto(float x, float y, float z)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdGoto(x, y, z);
|
||||
@@ -846,7 +848,7 @@ namespace BrewMonster.Network
|
||||
// Don't tick/schedule outgoing C2S while we're in logout/role-select flow.
|
||||
if (!_suppressOutgoing)
|
||||
_gameSession?.CmdCache?.Tick(Time.deltaTime);
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// Debug: Press D to disconnect from server (Editor only)
|
||||
/* if (Input.GetKeyDown(KeyCode.D))
|
||||
@@ -860,9 +862,9 @@ namespace BrewMonster.Network
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void c2s_CmdPetCtrl(int idTarget, int cmd, object pParamBuf, int iParamLen)
|
||||
public static void c2s_CmdPetCtrl(int idTarget, int cmd, object pParamBuf, int iParamLen)
|
||||
{
|
||||
Instance._gameSession.SendCmdPetCtrl(idTarget, cmd, pParamBuf, iParamLen);
|
||||
Instance._gameSession.SendCmdPetCtrl(idTarget, cmd, pParamBuf, iParamLen);
|
||||
}
|
||||
|
||||
// Pet commands ...
|
||||
@@ -895,9 +897,9 @@ namespace BrewMonster.Network
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdNPCSevHatchPet(iIvtrIdx, idEgg);
|
||||
}
|
||||
public static void c2s_CmdNPCSevRestorePet(int iPetIdx)
|
||||
public static void c2s_CmdNPCSevRestorePet(int iPetIdx)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdNPCSevRestorePet(iPetIdx);
|
||||
Instance._gameSession.c2s_SendCmdNPCSevRestorePet(iPetIdx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ namespace BrewMonster
|
||||
&& GetModel().PlayActionByName(szActName, 1.0f, bRestart, nTransTime, true, (uint)iAction , bNoFx, attackEvent, dwFlagMode);
|
||||
if (!check)
|
||||
{
|
||||
BMLogger.LogError($"Fall back to base implementation: {szActName} failed");
|
||||
// BMLogger.LogError($"Fall back to base implementation: {szActName} failed");
|
||||
//fallback to base implementation(which is non policy based)
|
||||
base.PlayNonSkillActionWithName(iAction, szActName, bRestart, nTransTime, bNoFx, attackEvent, dwFlagMode);
|
||||
}
|
||||
@@ -384,7 +384,7 @@ namespace BrewMonster
|
||||
&& GetModel().PlayActionByName(szActName, 1.0f, true, 200, true);
|
||||
if (!check)
|
||||
{
|
||||
BMLogger.LogError($"Fall back to base implementation: {szActName} failed");
|
||||
// BMLogger.LogError($"Fall back to base implementation: {szActName} failed");
|
||||
//fallback to base implementation(which is non policy based)
|
||||
base.PlaySkillCastActionWithName(idSkill, szActName, bNoFX);
|
||||
}
|
||||
@@ -406,7 +406,7 @@ namespace BrewMonster
|
||||
}
|
||||
return check;
|
||||
}
|
||||
|
||||
|
||||
public override bool QueueSkillAttackActionWithName(int idSkill, string szActName, int nTransTime, bool bNoFX, bool bResetSpeed, bool bResetActFlag, CECAttackEvent attackEvent, uint dwNewFlagMode){
|
||||
//LOG_DEBUG_INFO(AString().Format("QueueSkillAttackActionWithName:%s", szActName));
|
||||
bool check = GetModel()!=null
|
||||
@@ -454,11 +454,11 @@ namespace BrewMonster
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override int GetLowerBodyAction(){
|
||||
public override int GetLowerBodyAction(){
|
||||
if (GetModel()!=null){
|
||||
return (int)GetModel().GetCurActionUserData();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace BrewMonster.Scripts
|
||||
/// </summary>
|
||||
public async UniTaskVoid PlaySkillSfxAtPointAsync(string address, Vector3 worldPos)
|
||||
{
|
||||
BMLogger.LogError ($"HoangDev PlaySkillSfxAtPointAsync: address={address}, worldPos={worldPos}");
|
||||
// BMLogger.LogError ($"HoangDev PlaySkillSfxAtPointAsync: address={address}, worldPos={worldPos}");
|
||||
if (string.IsNullOrEmpty(address)) return;
|
||||
var mgr = AddressableManager.Instance;
|
||||
if (mgr == null) return;
|
||||
|
||||
@@ -136,11 +136,11 @@ namespace BrewMonster
|
||||
: npcVisual == null
|
||||
? "npcVisual is null"
|
||||
: "TryGetNamePlateAnchorWorld failed (no usable SkinnedMeshRenderer/sharedMesh)";
|
||||
BMLogger.LogError(
|
||||
/*BMLogger.LogError(
|
||||
"[Cuong] [NameplateWorldAnchor] NPC: cannot use merged SMR bounds; using root fallback. " +
|
||||
$"Reason: {reason}. hostNpc={hostNpc.name} fallbackHeightAboveRoot={fallbackHeightAboveRoot} extraWorldYOffset={extraWorldYOffset}. " +
|
||||
"Formula: worldPos = hostNpc.transform.position + Vector3.up * (fallbackHeightAboveRoot + extraWorldYOffset). " +
|
||||
"When bounds OK: worldPos.x/z = combinedBounds.center.x/z, worldPos.y = combinedBounds.max.y + extraWorldYOffset.");
|
||||
"When bounds OK: worldPos.x/z = combinedBounds.center.x/z, worldPos.y = combinedBounds.max.y + extraWorldYOffset.");*/
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace BrewMonster
|
||||
PlayAttackEffect(pCmd.idTarget, pCmd.idSkill, 0, pCmd.iDamage, (uint)pCmd.attack_flag,
|
||||
pCmd.attack_speed * 50, ref refFake, pCmd.section);
|
||||
}
|
||||
void OnMsgHstSkillAttacked(ECMSG Msg)
|
||||
void OnMsgHstSkillAttacked(ECMSG Msg)
|
||||
{
|
||||
cmd_host_skill_attacked pCmd = GPDataTypeHelper.FromBytes<cmd_host_skill_attacked>((byte[])Msg.dwParam1);
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace BrewMonster
|
||||
Debug.Assert(m_pCurSkill != null, "Current skill should not be null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] OnMsgPlayerCastSkill: OBJECT_CAST_SKILL - Skill found, skillID={m_pCurSkill.GetSkillID()}, " +
|
||||
// $"IsChargeable={m_pCurSkill.IsChargeable()}");
|
||||
|
||||
@@ -345,8 +345,8 @@ namespace BrewMonster
|
||||
iWaitTime = pCmd.time + m_pCurSkill.GetExecuteTime();
|
||||
|
||||
CECHPWorkSpell pWork = (CECHPWorkSpell)m_pWorkMan.CreateWork(Host_work_ID.WORK_SPELLOBJECT);
|
||||
BMLogger.LogError($"[SKILL_CAST_DEBUG] OnMsgPlayerCastSkill: Created CECHPWorkSpell for skillID={m_pCurSkill.GetSkillID()}, " +
|
||||
$"executeTime={m_pCurSkill.GetExecuteTime()}, waitTime={iWaitTime}");
|
||||
/*BMLogger.LogError($"[SKILL_CAST_DEBUG] OnMsgPlayerCastSkill: Created CECHPWorkSpell for skillID={m_pCurSkill.GetSkillID()}, " +
|
||||
$"executeTime={m_pCurSkill.GetExecuteTime()}, waitTime={iWaitTime}");*/
|
||||
pWork.PrepareCast(pCmd.target, m_pCurSkill, iWaitTime);
|
||||
m_pWorkMan.StartWork_p1(pWork);
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] OnMsgPlayerCastSkill: OBJECT_CAST_SKILL - Created WORK_SPELLOBJECT, " +
|
||||
@@ -531,7 +531,7 @@ namespace BrewMonster
|
||||
cmd_object_cast_pos_skill pCmd =
|
||||
GPDataTypeHelper.FromBytes<cmd_object_cast_pos_skill>((byte[])Msg.dwParam1);
|
||||
Debug.Assert(pCmd.caster == m_PlayerInfo.cid);
|
||||
|
||||
|
||||
// Log position BEFORE flashmove processing
|
||||
// 记录闪移处理前的位置
|
||||
A3DVECTOR3 vHostPosBefore = EC_Utility.ToA3DVECTOR3(transform.position);
|
||||
@@ -553,7 +553,7 @@ namespace BrewMonster
|
||||
Debug.Assert(pSkill != null, "Skill should not be null");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] OnMsgPlayerCastSkill: OBJECT_CAST_POS_SKILL - Skill found, skillID={pSkill.GetSkillID()}, " +
|
||||
// $"type={pSkill.GetType()}, rangeType={pSkill.GetRangeType()}");
|
||||
|
||||
@@ -661,7 +661,7 @@ namespace BrewMonster
|
||||
|
||||
m_pWorkMan.StartWork_p2(pWork);
|
||||
iActionTime = nExecuteTime;
|
||||
|
||||
|
||||
// Update position tracking immediately so distance checks use correct position
|
||||
// The work will move the player visually over time, but we need position tracking
|
||||
// updated now so normal attacks can check distance correctly
|
||||
@@ -669,7 +669,7 @@ namespace BrewMonster
|
||||
// 工作将在时间上移动玩家,但我们需要现在更新位置跟踪,以便普通攻击可以正确检查距离
|
||||
m_MoveCtrl.SetHostLastPos(pCmd.pos);
|
||||
m_MoveCtrl.SetLastSevPos(pCmd.pos);
|
||||
|
||||
|
||||
// Log position AFTER updating position tracking
|
||||
// 记录更新位置跟踪后的位置
|
||||
A3DVECTOR3 vHostPosAfter = EC_Utility.ToA3DVECTOR3(transform.position);
|
||||
@@ -678,7 +678,7 @@ namespace BrewMonster
|
||||
$"SetHostLastPos=({pCmd.pos.x:F2}, {pCmd.pos.y:F2}, {pCmd.pos.z:F2}), " +
|
||||
$"destPos=({pCmd.pos.x:F2}, {pCmd.pos.y:F2}, {pCmd.pos.z:F2}), " +
|
||||
$"executeTime={nExecuteTime}, positionChange={A3d_Magnitude(pCmd.pos - vHostPosBefore):F2}");*/
|
||||
|
||||
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] OnMsgPlayerCastSkill: OBJECT_CAST_POS_SKILL - Created WORK_FLASHMOVE, " +
|
||||
// $"skillID={pSkill.GetSkillID()}, executeTime={nExecuteTime}, destPos=({pCmd.pos.x:F2}, {pCmd.pos.y:F2}, {pCmd.pos.z:F2}), " +
|
||||
// $"m_pPrepSkill={(m_pPrepSkill != null ? m_pPrepSkill.GetSkillID().ToString() : "null")}");
|
||||
@@ -785,22 +785,22 @@ namespace BrewMonster
|
||||
// 记录来自服务器的错误消息,用于调试距离问题
|
||||
//cmd_error_message pCmd = GPDataTypeHelper.FromBytes<cmd_error_message>((byte[])Msg.dwParam1);
|
||||
//int errorCode = pCmd.message;
|
||||
|
||||
|
||||
// Common error codes:
|
||||
// 2 = FIXMSG_NEEDMP (Need MP)
|
||||
// 20 = FIXMSG_NEEDITEM (Need item)
|
||||
// 21 = FIXMSG_TARGETISFAR (Target is too far)
|
||||
// 22 = FIXMSG_TARGETTOOCLOSE (Target too close)
|
||||
|
||||
|
||||
A3DVECTOR3 vHostPos = EC_Utility.ToA3DVECTOR3(transform.position);
|
||||
int idCurrentTarget = m_idSelTarget;
|
||||
CECObject pTarget = idCurrentTarget > 0 ? EC_ManMessageMono.Instance.GetObject(idCurrentTarget, 1) : null;
|
||||
|
||||
|
||||
if (pTarget != null)
|
||||
{
|
||||
A3DVECTOR3 vTargetPos = EC_Utility.ToA3DVECTOR3(pTarget.transform.position);
|
||||
float fDistance = A3d_Magnitude(vTargetPos - vHostPos);
|
||||
|
||||
|
||||
BMLogger.LogError($"[DISTANCE_DEBUG] ERROR_MESSAGE from server: errorCode=, " +
|
||||
$"hostPos=({vHostPos.x:F2}, {vHostPos.y:F2}, {vHostPos.z:F2}), " +
|
||||
$"targetPos=({vTargetPos.x:F2}, {vTargetPos.y:F2}, {vTargetPos.z:F2}), " +
|
||||
@@ -817,7 +817,7 @@ namespace BrewMonster
|
||||
$"m_pCurSkill={(m_pCurSkill != null ? m_pCurSkill.GetSkillID().ToString() : "null")}, " +
|
||||
$"m_pPrepSkill={(m_pPrepSkill != null ? m_pPrepSkill.GetSkillID().ToString() : "null")}");
|
||||
}
|
||||
|
||||
|
||||
bDoOtherThing = true;
|
||||
break;
|
||||
}
|
||||
@@ -903,7 +903,7 @@ namespace BrewMonster
|
||||
float fDistance = A3d_Magnitude(vTargetPos - vHostPos);
|
||||
float fAttackRange = m_ExtProps.ak.AttackRange;
|
||||
bool bCanTouch = CanTouchTarget(vHostPos,vTargetPos, cECNPC.GetTouchRadius(), 1); // 1 = melee
|
||||
|
||||
|
||||
BMLogger.Log($"[DISTANCE_DEBUG] NormalAttackObject: Entry, idTarget={idTarget}, " +
|
||||
$"hostPos=({vHostPos.x:F2}, {vHostPos.y:F2}, {vHostPos.z:F2}), " +
|
||||
$"targetPos=({vTargetPos.x:F2}, {vTargetPos.y:F2}, {vTargetPos.z:F2}), " +
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace BrewMonster
|
||||
int offset = sizeof(uint);
|
||||
int skillSize = Marshal.SizeOf<cmd_skill_data.SKILL>();
|
||||
pCmd.skill_list = new cmd_skill_data.SKILL[pCmd.skill_count];
|
||||
BMLogger.LogError("OnMsgHstSkillData: skill_count= " + pCmd.skill_count);
|
||||
// BMLogger.LogError("OnMsgHstSkillData: skill_count= " + pCmd.skill_count);
|
||||
for (int i = 0; i < pCmd.skill_count; i++)
|
||||
{
|
||||
pCmd.skill_list[i] = GPDataTypeHelper.FromBytes<cmd_skill_data.SKILL>((byte[])Msg.dwParam1, offset);
|
||||
@@ -517,7 +517,7 @@ namespace BrewMonster
|
||||
public bool ApplySkillShortcut(int idSkill, bool bCombo = false /* false */,
|
||||
int idSelTarget = 0 /* 0 */, int iForceAtk = -1 /* -1 */)
|
||||
{
|
||||
Debug.LogError($"ApplySkillShortcut: Skill 167 detected, calling idSkill :"+ idSkill);
|
||||
// Debug.LogError($"ApplySkillShortcut: Skill 167 detected, calling idSkill :"+ idSkill);
|
||||
|
||||
//StackChecker::ACTrace(4);
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] ApplySkillShortcut: Entry, skillID={idSkill}, bCombo={bCombo}, idSelTarget={idSelTarget}, iForceAtk={iForceAtk}, " +
|
||||
@@ -564,11 +564,11 @@ namespace BrewMonster
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] ApplySkillShortcut: BLOCKED - Skill {idSkill} not found");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] ApplySkillShortcut: Skill found, skillID={pSkill.GetSkillID()}, type={pSkill.GetType()}, " +
|
||||
// $"ReadyToCast={pSkill.ReadyToCast()}, IsInstant={pSkill.IsInstant()}, IsFlashMove={pSkill.GetType() == (int)Skilltype.TYPE_FLASHMOVE}");
|
||||
|
||||
//// If we press a chargeable skill again when it's being charged,
|
||||
//// If we press a chargeable skill again when it's being charged,
|
||||
//// we cast it out at once
|
||||
bool allowChargeRelease = IsSpellingMagic() && m_pCurSkill != null && m_pCurSkill.IsCharging() &&
|
||||
m_pCurSkill.GetSkillID() == pSkill.GetSkillID();
|
||||
@@ -696,12 +696,12 @@ namespace BrewMonster
|
||||
// For C#, we try to get the object and check if it's the host's active pet
|
||||
CECObject pPetObject = null;
|
||||
int activePetNPCID = m_pPetCorral.GetActivePetNPCID();
|
||||
|
||||
|
||||
if (idSelTarget != 0)
|
||||
{
|
||||
pPetObject = CECWorld.Instance.GetObject(idSelTarget, 0);
|
||||
}
|
||||
|
||||
|
||||
// If no pet found or target is host's active pet, cast on host's active pet
|
||||
if (pPetObject == null || idSelTarget == activePetNPCID)
|
||||
{
|
||||
@@ -878,7 +878,7 @@ namespace BrewMonster
|
||||
bool isSpelling = IsSpellingMagic();
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] CastSkill: Entry, prepSkillID={prepSkillID}, idTarget={idTarget}, bForceAttack={bForceAttack}, " +
|
||||
// $"ReadyToCast={readyToCast}, IsSpellingMagic={isSpelling}, IsFlashMoving={IsFlashMoving()}");
|
||||
|
||||
|
||||
// Check if prep skill is valid, ready to cast, and not currently spelling magic
|
||||
if (m_pPrepSkill == null || !m_pPrepSkill.ReadyToCast() || IsSpellingMagic())
|
||||
{
|
||||
@@ -998,7 +998,7 @@ namespace BrewMonster
|
||||
fDist = Mathf.Abs(fDist);
|
||||
A3DVECTOR3 vDest = m_MoveCtrl.FlashMove(vDir, 100.0f, fDist);
|
||||
UnityEngine.Vector3 vDestVec3 = EC_Utility.ToVector3(vDest);
|
||||
|
||||
|
||||
// Log position information before sending flashmove
|
||||
// 在发送闪移前记录位置信息
|
||||
A3DVECTOR3 vHostPos = EC_Utility.ToA3DVECTOR3(transform.position);
|
||||
@@ -1006,7 +1006,7 @@ namespace BrewMonster
|
||||
$"hostPos=({vHostPos.x:F2}, {vHostPos.y:F2}, {vHostPos.z:F2}), " +
|
||||
$"destPos=({vDestVec3.x:F2}, {vDestVec3.y:F2}, {vDestVec3.z:F2}), " +
|
||||
$"flashDistance={fDist:F2}, byPVPMask={byPVPMask}");
|
||||
|
||||
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] CastSkill: Sending c2s_CmdCastPosSkill (flashmove self), skillID={prepSkillID}, " +
|
||||
// $"pos=({vDestVec3.x:F2}, {vDestVec3.y:F2}, {vDestVec3.z:F2}), byPVPMask={byPVPMask}");
|
||||
UnityGameSession.c2s_CmdCastPosSkill(m_pPrepSkill.GetSkillID(), vDestVec3, byPVPMask, 0, 0);
|
||||
@@ -1135,7 +1135,7 @@ namespace BrewMonster
|
||||
|
||||
// 发送协议 (Send protocol)
|
||||
UnityEngine.Vector3 vMovePosVec3 = EC_Utility.ToVector3(vMovePos);
|
||||
|
||||
|
||||
// Log position information before sending flashmove
|
||||
// 在发送闪移前记录位置信息
|
||||
A3DVECTOR3 vHostPos2 = EC_Utility.ToA3DVECTOR3(transform.position);
|
||||
@@ -1157,7 +1157,7 @@ namespace BrewMonster
|
||||
$"destPos=({vMovePosVec3.x:F2}, {vMovePosVec3.y:F2}, {vMovePosVec3.z:F2}), " +
|
||||
$"target={idTarget} (target object is null), byPVPMask={byPVPMask}");
|
||||
}
|
||||
|
||||
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] CastSkill: Sending c2s_CmdCastPosSkill (flashmove target), skillID={prepSkillID}, " +
|
||||
// $"pos=({vMovePosVec3.x:F2}, {vMovePosVec3.y:F2}, {vMovePosVec3.z:F2}), target={idTarget}, byPVPMask={byPVPMask}");
|
||||
UnityGameSession.c2s_CmdCastPosSkill(m_pPrepSkill.GetSkillID(), vMovePosVec3, byPVPMask, 1, idTarget);
|
||||
@@ -1177,7 +1177,7 @@ namespace BrewMonster
|
||||
int targets = 1;
|
||||
targetsCastSkill = new int[targets];
|
||||
targetsCastSkill[0] = idTarget;
|
||||
|
||||
|
||||
// Log position and distance information before sending skill cast
|
||||
// Use server-tracked position instead of visual position for accurate distance checks
|
||||
// 在发送技能施放前记录位置和距离信息
|
||||
@@ -1191,7 +1191,7 @@ namespace BrewMonster
|
||||
float fDistance = A3d_Magnitude(vTargetPos - vHostPos);
|
||||
float fSkillRange = m_pPrepSkill.GetCastRange(m_ExtProps.ak.AttackRange, GetPrayDistancePlus());
|
||||
bool bCanTouch = CanTouchTarget(vTargetPos, cECNPC.GetTouchRadius(), 2); // 2 = skill
|
||||
|
||||
|
||||
/* BMLogger.Log($"[DISTANCE_DEBUG] CastSkill: Before sending c2s_CmdCastSkill (regular), skillID={prepSkillID}, " +
|
||||
$"hostPos=({vHostPos.x:F2}, {vHostPos.y:F2}, {vHostPos.z:F2}), " +
|
||||
$"targetPos=({vTargetPos.x:F2}, {vTargetPos.y:F2}, {vTargetPos.z:F2}), " +
|
||||
@@ -1205,7 +1205,7 @@ namespace BrewMonster
|
||||
$"hostPos=({vHostPos.x:F2}, {vHostPos.y:F2}, {vHostPos.z:F2}), " +
|
||||
$"target={idTarget} (target object is null), byPVPMask={byPVPMask2}");
|
||||
}*/
|
||||
|
||||
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] CastSkill: Sending c2s_CmdCastSkill (regular), skillID={prepSkillID}, " +
|
||||
// $"target={idTarget}, count={targets}, byPVPMask={byPVPMask2}");
|
||||
UnityGameSession.c2s_CmdCastSkill(m_pPrepSkill.GetSkillID(), byPVPMask2, targets, targetsCastSkill);
|
||||
@@ -1365,13 +1365,13 @@ namespace BrewMonster
|
||||
// Check skill cast condition
|
||||
// Returns: 0 if success, error code otherwise
|
||||
// Error codes: 1=invalid weapon, 2=need mp, 3=invalid state, 6=target wrong, 7=invalid state,
|
||||
// 8=need ap, 9=not enough ammo, 10=pack full, 11=invalid env, 12=hp unsatisfied,
|
||||
// 8=need ap, 9=not enough ammo, 10=pack full, 11=invalid env, 12=hp unsatisfied,
|
||||
// 13=combo skill not active, 20=need item
|
||||
public int CheckSkillCastCondition(CECSkill pSkill)
|
||||
{
|
||||
int skillID = pSkill != null ? pSkill.GetSkillID() : 0;
|
||||
// Debug.Log($"[SKILL_CAST_DEBUG] CheckSkillCastCondition: Entry, skillID={skillID}, SkillCore={(pSkill.SkillCore != null ? "not null" : "null")}");
|
||||
|
||||
|
||||
// Check if skill requires an item
|
||||
if (pSkill.SkillCore != null)
|
||||
{
|
||||
@@ -1417,11 +1417,11 @@ namespace BrewMonster
|
||||
}
|
||||
else if (!CanUseEquipment(pWeapon, ref iReason))
|
||||
{
|
||||
|
||||
|
||||
Info.weapon = (iReason == 5) ? (int)pWeapon.GetDBMajorType().id : 0; }
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
Info.weapon = (int)pWeapon.GetDBMajorType().id; }
|
||||
|
||||
//BMLogger.LogError(GetName() + " CheckSkillCastCondition: Weapon major type ID = " + Info.weapon);
|
||||
@@ -2005,5 +2005,5 @@ namespace BrewMonster
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BrewMonster
|
||||
handle.AddrOfPinnedObject(), typeof(cmd_host_correct_pos));
|
||||
handle.Free();
|
||||
//cmd_host_correct_pos pCmd = GPDataTypeHelper.FromBytes<cmd_host_correct_pos>((byte[])Msg.dwParam1);
|
||||
Debug.LogError("HoangDev :pCmd.pos " + pCmd.pos);
|
||||
// Debug.LogError("HoangDev :pCmd.pos " + pCmd.pos);
|
||||
SetPos(pCmd.pos);
|
||||
m_vVelocity.Clear();
|
||||
m_CDRInfo.vAbsVelocity.Clear();
|
||||
@@ -91,7 +91,7 @@ namespace BrewMonster
|
||||
// pScriptMan.GetContext().GetUI().SetTipDialogTitleAndContent(AC2AS_CP(CP_UTF8, pGameUI.GetStringFromTable(11350)), AC2AS_CP(CP_UTF8, (itr.second).strName));
|
||||
// pScriptMan.GetContext().GetUI().ShowTip(500, 500, 5000, 300);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// else if (Msg.dwParam2 == WAYPOINT_LIST)
|
||||
@@ -301,4 +301,4 @@ namespace BrewMonster
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public partial class CECGameRun : ITickable
|
||||
|
||||
private void LoadPrefabs()
|
||||
{
|
||||
BMLogger.LogError("CECGameRun::LoadPrefabs, Loading prefabs from Resources. Consider using Addressables for better performance and memory management.");
|
||||
BMLogger.LogWarning("CECGameRun::LoadPrefabs, Loading prefabs from Resources. Consider using Addressables for better performance and memory management.");
|
||||
_playerPrefab = Resources.Load<GameObject>(AddressResourceConfig.PlayerPrefab);
|
||||
_monsterPrefab = Resources.Load<GameObject>(AddressResourceConfig.MonsterPrefab);
|
||||
_npcServerPrefab = Resources.Load<GameObject>(AddressResourceConfig.NpcServerPrefab);
|
||||
|
||||
+479
-32
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user