From 28aff4cd7507f55a4c3f0ea3801f05f3d262b074 Mon Sep 17 00:00:00 2001 From: HungDK <> Date: Tue, 4 Nov 2025 14:37:15 +0700 Subject: [PATCH] Add work dead --- .../Scripts/Managers/EC_EPWork.cs | 63 +++++++++++++++++-- Assets/PerfectWorld/Scripts/Move/CECPlayer.cs | 18 +++--- 2 files changed, 67 insertions(+), 14 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_EPWork.cs b/Assets/PerfectWorld/Scripts/Managers/EC_EPWork.cs index be810fbd85..a278c6f4ef 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_EPWork.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_EPWork.cs @@ -229,7 +229,6 @@ namespace BrewMonster.Scripts return m_pWorkMan.GetPlayer(); } - public CECEPWork(int iWorkID, CECEPWorkMan pWorkMan) { m_iWorkID = iWorkID; @@ -310,12 +309,12 @@ namespace BrewMonster.Scripts // GetPlayer().TurnFaceTo(m_idCurSkillTarget); // } // if (GetPlayer().IsPlayingMoveAction() && !GetPlayer().IsWorkMoveRunning()) - // { // 从移动施法到停止移动、会一直在持续播放移动动作,此处暂停 + // { // 锟斤拷锟狡讹拷施锟斤拷锟斤拷停止锟狡讹拷锟斤拷锟斤拷一直锟节筹拷锟斤拷锟斤拷锟斤拷锟狡讹拷锟斤拷锟斤拷锟斤拷锟剿达拷锟斤拷停 // GetPlayer().PlayAction(CECPlayer::ACT_FIGHTSTAND); // } // if (!GetPlayer().IsPlayingAction()) // { - // GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_FIGHTSTAND); // 技能动作播放完成后、播放战斗站立动作 + // GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_FIGHTSTAND); // 锟斤拷锟杰讹拷锟斤拷锟斤拷锟斤拷锟斤拷珊蟆⒉锟斤拷锟秸斤拷锟秸撅拷锟斤拷锟斤拷锟 // } //} } @@ -443,9 +442,9 @@ namespace BrewMonster.Scripts } for (int i = 0; i < workList.Count; ++i) { - if (!CanRunSimultaneously(pWork, workList[i]) && // 要么同时共存 + if (!CanRunSimultaneously(pWork, workList[i]) && // 要么同时锟斤拷锟斤拷 !CanReplace(pWork, workList[i])) - { // 要么可以替换 + { // 要么锟斤拷锟斤拷锟芥换 return false; } } @@ -717,4 +716,58 @@ namespace BrewMonster.Scripts return true; } } + + public class CECEPWorkDead : CECEPWork + { + private uint m_dwParam; + public CECEPWorkDead(CECEPWorkMan pWorkMan, uint dwParam) + : base(CECEPWork.EP_work_ID.WORK_DEAD, pWorkMan) + { + m_dwParam = dwParam; + } + + void Start() + { + GetPlayer().m_iMoveMode = (int)MoveMode.MOVE_STAND; + + A3DVECTOR3 vCurPos = GetPlayer().GetPos(); + + int iFlag = 0; + // if (vCurPos.y < fWaterHei - m_MoveConst.fShoreDepth || + // (vCurPos.y < fWaterHei && fWaterHei - vGndPos.y > m_MoveConst.fShoreDepth)) + //TODO: Check in water + // if (GetPlayer().CheckWaterMoveEnv(vCurPos, fWaterHei, vGndPos.y)) + // iFlag = 1; + // else if (vCurPos.y > vGndPos.y + 0.5f) + // iFlag = 2; + + if (m_dwParam != null) + { + if (iFlag == 1) + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_WATERDIE_LOOP); + else if (iFlag == 2) + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_AIRDIE); + else + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_GROUNDDIE_LOOP); + } + else + { + if (iFlag == 1) + { + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_WATERDIE); + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_WATERDIE_LOOP, true, 200, true); + } + else if (iFlag == 2) + { + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_AIRDIE_ST); + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_AIRDIE, true, 200, true); + } + else + { + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_GROUNDDIE); + GetPlayer().PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_GROUNDDIE_LOOP, true, 200, true); + } + } + } + } } diff --git a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs index 5a78826190..182f4ad5d8 100644 --- a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs +++ b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs @@ -51,7 +51,7 @@ public abstract class CECPlayer : CECObject public static readonly int[] m_sciStateIDForStateAction = { 117 }; public MOVECONST m_MoveConst; // Const used when moving control - + public Move_Mode m_MoveMode; public MOVECONST[] aMoveConsts = new MOVECONST[PROFESSION.NUM_PROFESSION * GENDER.NUM_GENDER] { // 脦盲脧脌 @@ -1178,11 +1178,11 @@ public static class Duel_state // Duel state } //// Move mode -//public static class Move_Mode -//{ -// public const int MOVE_STAND = 0, -// MOVE_MOVE = 1, // Normal move, walk, run, swim or fly -// MOVE_JUMP = 2, -// MOVE_FREEFALL = 3, -// MOVE_SLIDE = 4; -//} \ No newline at end of file +public class Move_Mode +{ + public const int MOVE_STAND = 0, + MOVE_MOVE = 1, // Normal move, walk, run, swim or fly + MOVE_JUMP = 2, + MOVE_FREEFALL = 3, + MOVE_SLIDE = 4; +} \ No newline at end of file