Merge branch 'feature/HP_jump' into feature/movefix
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace BrewMonster.Scripts
|
||||
{
|
||||
using static BrewMonster.Scripts.CECHPWork;
|
||||
using WorkList = System.Collections.Generic.List<CECHPWork>;
|
||||
public class CECHPWork : CECObjectWork
|
||||
{
|
||||
@@ -439,31 +440,39 @@ namespace BrewMonster.Scripts
|
||||
|
||||
public bool DelayWork(int iPriority, CECHPWork pWork)
|
||||
{
|
||||
if (pWork == null){
|
||||
if (pWork == null)
|
||||
{
|
||||
// ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
if (!ValidatePriority(iPriority)){
|
||||
if (!ValidatePriority(iPriority))
|
||||
{
|
||||
// ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
if (!IsAnyWorkRunning()){
|
||||
if (!IsAnyWorkRunning())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (CanRunSimultaneouslyWithCurrentWork(iPriority, pWork)){
|
||||
if (CanRunSimultaneouslyWithCurrentWork(iPriority, pWork))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool bDelay = false;
|
||||
if (m_pHost.IsMeleeing()){
|
||||
if (m_pHost.IsMeleeing())
|
||||
{
|
||||
UnityGameSession.c2s_CmdCancelAction();
|
||||
bDelay = true;
|
||||
}else if (IsPickingUp() || IsSpellingMagic()){
|
||||
}
|
||||
else if (IsPickingUp() || IsSpellingMagic())
|
||||
{
|
||||
bDelay = true;
|
||||
}
|
||||
if (bDelay){
|
||||
if (bDelay)
|
||||
{
|
||||
ClearDelayedWork();
|
||||
m_Delayed.iPriority = iPriority;
|
||||
m_Delayed.pWork = pWork;
|
||||
m_Delayed.iPriority = iPriority;
|
||||
m_Delayed.pWork = pWork;
|
||||
// LOG_DEBUG_INFO(AString().Format("CECHPWork::%s delayed, priority=%d", pWork->GetWorkName(), iPriority));
|
||||
}
|
||||
return bDelay;
|
||||
@@ -498,15 +507,15 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
if (pWork.GetWorkID() == CECHPWork.Host_work_ID.WORK_TRACEOBJECT)
|
||||
{
|
||||
/* if (EC_Game.GetGameRun().GetHostInputFilter()->IsMoveUsagePressed())
|
||||
{
|
||||
CECHPWorkTrace pWorkTrace = pWork as CECHPWorkTrace;
|
||||
if (!pWorkTrace.CanTouch())
|
||||
{ // 2014-8-16 ������ͨ�����̲����ƶ�ʱ������������ CECHPWorkTrace,
|
||||
//delete pWorkTrace; // ������� CECHPWorkTrace ����ʱת��Ŀ��λ�á������ֱ����̲��ݵ����ƶ������·���˲�䶶��
|
||||
return false; // �� CECHPWorkTrace ��Ŀ��������Ӵ�ʱ�������� CECHPWorkTrace����ʵ�ּ��̿����ƶ��С���ij��Ӧ�ü���ʱ������ת���ʩ�ż���
|
||||
}
|
||||
}*/
|
||||
/* if (EC_Game.GetGameRun().GetHostInputFilter()->IsMoveUsagePressed())
|
||||
{
|
||||
CECHPWorkTrace pWorkTrace = pWork as CECHPWorkTrace;
|
||||
if (!pWorkTrace.CanTouch())
|
||||
{ // 2014-8-16 ������ͨ�����̲����ƶ�ʱ������������ CECHPWorkTrace,
|
||||
//delete pWorkTrace; // ������� CECHPWorkTrace ����ʱת��Ŀ��λ�á������ֱ����̲��ݵ����ƶ������·���˲�䶶��
|
||||
return false; // �� CECHPWorkTrace ��Ŀ��������Ӵ�ʱ�������� CECHPWorkTrace����ʵ�ּ��̿����ƶ��С���ij��Ӧ�ü���ʱ������ת���ʩ�ż���
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (!bNoDelay && DelayWork(iPriority, pWork))
|
||||
{
|
||||
@@ -656,7 +665,7 @@ namespace BrewMonster.Scripts
|
||||
if (ValidatePriority(m_iCurPriority))
|
||||
{
|
||||
WorkList workList = m_WorkStack[m_iCurPriority];
|
||||
if(workList != null)
|
||||
if (workList != null)
|
||||
{
|
||||
for (int i = 0; i < workList.Count; ++i)
|
||||
{
|
||||
@@ -678,7 +687,7 @@ namespace BrewMonster.Scripts
|
||||
return;
|
||||
}
|
||||
WorkList workList = m_WorkStack[m_iCurPriority];
|
||||
if(workList != null)
|
||||
if (workList != null)
|
||||
{
|
||||
for (int i = 0; i < workList.Count;)
|
||||
{
|
||||
@@ -689,19 +698,43 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
KillWork(m_iCurPriority, i);
|
||||
}
|
||||
if (workList.Count ==0)
|
||||
if (workList == null || workList.Count == 0)
|
||||
{
|
||||
StartAwaitingWorks();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsReviving()
|
||||
{
|
||||
return IsWorkRunning(Host_work_ID.WORK_REVIVE);
|
||||
}
|
||||
public bool IsSpellingMagic()
|
||||
{
|
||||
return IsWorkRunning(Host_work_ID.WORK_SPELLOBJECT);
|
||||
}
|
||||
public bool IsUsingItem()
|
||||
{
|
||||
return IsWorkRunning(Host_work_ID.WORK_USEITEM);
|
||||
}
|
||||
public bool IsPassiveMoving()
|
||||
{
|
||||
return IsWorkRunning(Host_work_ID.WORK_PASSIVEMOVE);
|
||||
}
|
||||
public bool IsSitting()
|
||||
{
|
||||
return IsWorkRunning(Host_work_ID.WORK_SIT);
|
||||
}
|
||||
//todo: use this method
|
||||
public void FinishAllWork(bool bGotoStand){
|
||||
for (int i =0; i < Work_priority.NUM_PRIORITY; ++ i){
|
||||
public void FinishAllWork(bool bGotoStand)
|
||||
{
|
||||
for (int i = 0; i < Work_priority.NUM_PRIORITY; ++i)
|
||||
{
|
||||
FinishWorkAtPriority(i);
|
||||
}
|
||||
ClearDelayedWork();
|
||||
if (bGotoStand){
|
||||
if (bGotoStand)
|
||||
{
|
||||
StartWork_p0(CreateWork(CECHPWork.Host_work_ID.WORK_STAND));
|
||||
}
|
||||
}
|
||||
@@ -709,12 +742,7 @@ namespace BrewMonster.Scripts
|
||||
{
|
||||
return IsWorkRunning(CECHPWork.Host_work_ID.WORK_PICKUP);
|
||||
}
|
||||
bool IsSpellingMagic()
|
||||
{
|
||||
return IsWorkRunning(CECHPWork.Host_work_ID.WORK_SPELLOBJECT);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class CECHPWorkPostTickCommand
|
||||
{
|
||||
public abstract bool Run(CECHPWorkMan pWorkMan);
|
||||
|
||||
@@ -107,7 +107,7 @@ class CECHPWorkMelee : CECHPWork
|
||||
return true;
|
||||
}
|
||||
// Reset work
|
||||
public virtual void Reset()
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
m_pHost.SetGroundInfoClient();
|
||||
float fDeltaTime = dwDeltaTime;
|
||||
if (m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_GROUND ||
|
||||
m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_WATER && m_pHost.IsJumping() && (m_pHost.m_CDRInfo.vAbsVelocity.y > 0 || m_pHost.m_CDRInfo.fYVel > 0))
|
||||
@@ -233,21 +233,99 @@ namespace BrewMonster.Scripts
|
||||
return true;
|
||||
}
|
||||
// Reset work
|
||||
public virtual void Reset()
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
m_iDestType = DestTypes.DEST_2D;
|
||||
m_bHaveDest = false;
|
||||
m_bMeetSlide = false;
|
||||
m_bReadyCancel = false;
|
||||
m_bGliding = false;
|
||||
m_fGlideTime = 0;
|
||||
m_fCurPitch = 0;
|
||||
m_fPushPitch = 0;
|
||||
m_fPushLean = 0;
|
||||
|
||||
m_bUseAutoMoveDialog = false;
|
||||
m_fAutoHeight = -1.0f;
|
||||
m_bAutoLand = false;
|
||||
m_bAutoFly = false;
|
||||
m_bReachedHeight = true;
|
||||
m_bAutoFlyPending = false;
|
||||
|
||||
m_iNPCTempleId = 0;
|
||||
m_iTaskId = 0;
|
||||
m_bSwitchTo2D = false;
|
||||
|
||||
m_bResetAutoPF = false;
|
||||
}
|
||||
// Work is cancel
|
||||
public virtual void Cancel()
|
||||
public override void Cancel()
|
||||
{
|
||||
//if (m_pHost.m_pMoveTargetGFX)
|
||||
// m_pHost.m_pMoveTargetGFX.Stop();
|
||||
|
||||
//A3DVECTOR3 vDir = m_pHost.GetDir();
|
||||
//vDir.y = 0;
|
||||
//vDir.Normalize();
|
||||
//if (!vDir.IsZero())
|
||||
//{
|
||||
// m_pHost.StopModelMove(vDir, g_vAxisY, 0);
|
||||
//}
|
||||
|
||||
ClearResetUseAutoPF();
|
||||
//if (CECIntelligentRoute::Instance().IsUsageMove())
|
||||
//{
|
||||
// if (!CECIntelligentRoute::Instance().IsIdle())
|
||||
// {
|
||||
// CECIntelligentRoute::Instance().ResetSearch();
|
||||
// m_bSwitchTo2D = true; // Æô¶¯·ÉÐÐÖжϺó»Ö¸´Ê±¡¢ÐèÒªÇл»µ½ DEST_2D ģʽ
|
||||
// }
|
||||
//}
|
||||
base.Cancel();
|
||||
//AP_ActionEvent(AP_EVENT_MOVEFINISHED);
|
||||
}
|
||||
|
||||
// This work is do player moving ?
|
||||
public virtual bool IsMoving() { return true; }
|
||||
public override bool IsMoving() { return true; }
|
||||
// Copy work data
|
||||
public virtual bool CopyData(CECHPWork pWork)
|
||||
public override bool CopyData(CECHPWork pWork)
|
||||
{
|
||||
if (!base.CopyData(pWork))
|
||||
return false;
|
||||
|
||||
CECHPWorkMove pSrc = pWork as CECHPWorkMove;
|
||||
|
||||
m_iDestType = pSrc.m_iDestType;
|
||||
m_bHaveDest = pSrc.m_bHaveDest;
|
||||
m_bMeetSlide = pSrc.m_bMeetSlide;
|
||||
m_bReadyCancel = pSrc.m_bReadyCancel;
|
||||
m_bGliding = pSrc.m_bGliding;
|
||||
m_fGlideTime = pSrc.m_fGlideTime;
|
||||
m_fGlideSpan = pSrc.m_fGlideSpan;
|
||||
m_fGlideAng = pSrc.m_fGlideAng;
|
||||
m_fGlideVel = pSrc.m_fGlideVel;
|
||||
m_fGlidePitch = pSrc.m_fGlidePitch;
|
||||
m_fCurPitch = pSrc.m_fCurPitch;
|
||||
m_fPushPitch = pSrc.m_fPushPitch;
|
||||
m_fPushLean = pSrc.m_fPushLean;
|
||||
m_iDestType = pSrc.m_iDestType;
|
||||
m_vMoveDest = pSrc.m_vMoveDest;
|
||||
m_vCurDir = pSrc.m_vCurDir;
|
||||
|
||||
m_bUseAutoMoveDialog = pSrc.m_bUseAutoMoveDialog;
|
||||
m_fAutoHeight = pSrc.m_fAutoHeight;
|
||||
m_bAutoLand = pSrc.m_bAutoLand;
|
||||
m_bAutoFly = pSrc.m_bAutoFly;
|
||||
m_bReachedHeight = pSrc.m_bReachedHeight;
|
||||
m_bAutoFlyPending = pSrc.m_bAutoFlyPending;
|
||||
|
||||
m_iNPCTempleId = pSrc.m_iNPCTempleId;
|
||||
m_iTaskId = pSrc.m_iTaskId;
|
||||
m_bSwitchTo2D = pSrc.m_bSwitchTo2D;
|
||||
|
||||
m_bResetAutoPF = pSrc.m_bResetAutoPF;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -326,9 +404,19 @@ namespace BrewMonster.Scripts
|
||||
//SetUseAutoMoveDialog(true);
|
||||
}
|
||||
// On first tick
|
||||
protected virtual void OnFirstTick()
|
||||
protected override void OnFirstTick()
|
||||
{
|
||||
m_pHost.m_iMoveMode = Move_Mode.MOVE_MOVE;
|
||||
//PlayMoveTargetGFX();
|
||||
|
||||
//if (m_pHost.m_iMoveEnv != CECPlayer::MOVEENV_AIR)
|
||||
// m_pHost.ShowWing(false);
|
||||
|
||||
if (!m_pHost.IsJumping())
|
||||
{
|
||||
int iAction = m_pHost.GetMoveStandAction(true);
|
||||
m_pHost.PlayAction(iAction, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Tick routine of walking on ground
|
||||
@@ -416,7 +504,7 @@ namespace BrewMonster.Scripts
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((GetMoveRelDirMask() & MoveInputMask) != 0)
|
||||
if ((GetMoveRelDirMask() & (uint)((MOVE_DIR.MD_LEFT | MOVE_DIR.MD_RIGHT | MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_BACK))) != 0)
|
||||
m_iDestType = DestTypes.DEST_PUSH;
|
||||
|
||||
if (m_iDestType == DestTypes.DEST_2D)
|
||||
@@ -434,6 +522,7 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
|
||||
vCurPos = m_pHost.m_MoveCtrl.GroundMove(m_vCurDir, fSpeed, fDeltaTime, m_pHost.m_fVertSpeed);
|
||||
Debug.LogError(vCurPos);
|
||||
UpdateFacingFromDelta(vCurPos);
|
||||
|
||||
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
|
||||
@@ -443,7 +532,7 @@ namespace BrewMonster.Scripts
|
||||
Finish();
|
||||
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
|
||||
}
|
||||
else if (m_pHost.m_GndInfo.bOnGround && cdr.vTPNormal != Vector3.zero)
|
||||
else if (cdr.vTPNormal != Vector3.zero)
|
||||
{
|
||||
A3DVECTOR3 vMoveDelta = vCurPos - m_pHost.GetPos();
|
||||
vMoveDelta.y = 0.0f;
|
||||
@@ -547,17 +636,19 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
else if (m_iDestType == DestTypes.DEST_PUSH)
|
||||
{
|
||||
A3DVECTOR3 vMoveDir = GPDataTypeHelper.g_vOrigin;
|
||||
Vector3 vMoveDir = Vector3.zero;//EC_Utility.ToVector3(GPDataTypeHelper.g_vOrigin);
|
||||
fSpeed = m_pHost.GetGroundSpeed();
|
||||
bool bFinish = false;
|
||||
|
||||
/*if (m_pHost.GetPushDir(vMoveDir, MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_BACK | MOVE_DIR.MD_LEFT | MOVE_DIR.MD_RIGHT, fDeltaTime))
|
||||
if (m_pHost.GetPushDir(ref vMoveDir, (uint)(MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_BACK | MOVE_DIR.MD_LEFT | MOVE_DIR.MD_RIGHT), fDeltaTime))
|
||||
{
|
||||
if (!vMoveDir.IsZero())
|
||||
if (vMoveDir != Vector3.zero)
|
||||
{
|
||||
//m_pHost.StartModelMove(vMoveDir, GPDataTypeHelper.g_vAxisY, 0);
|
||||
m_pHost.SetRotationHP(vMoveDir);
|
||||
}
|
||||
|
||||
vCurPos = m_pHost.m_MoveCtrl.GroundMove(vMoveDir, fSpeed, fDeltaTime, m_pHost.m_fVertSpeed);
|
||||
vCurPos = m_pHost.m_MoveCtrl.GroundMove(EC_Utility.ToA3DVECTOR3(vMoveDir), fSpeed, fDeltaTime, m_pHost.m_fVertSpeed);
|
||||
//Debug.LogError("vCurPos =" + vCurPos);
|
||||
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
|
||||
}
|
||||
else
|
||||
@@ -566,7 +657,7 @@ namespace BrewMonster.Scripts
|
||||
bFinish = true;
|
||||
else
|
||||
m_iDestType = DestTypes.DEST_2D;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (bFinish || m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
|
||||
{
|
||||
@@ -579,7 +670,7 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pHost.m_vVelocity = vMoveDir * fSpeed;
|
||||
m_pHost.m_vVelocity = EC_Utility.ToA3DVECTOR3(vMoveDir) * fSpeed;
|
||||
m_pHost.m_MoveCtrl.SendMoveCmd(
|
||||
vCurPos,
|
||||
2,
|
||||
@@ -588,10 +679,10 @@ namespace BrewMonster.Scripts
|
||||
iMoveMode);
|
||||
}
|
||||
}
|
||||
else if (m_iDestType == DestTypes.DEST_PUSH)
|
||||
{
|
||||
m_iDestType = DestTypes.DEST_2D;
|
||||
}
|
||||
//else if (m_iDestType == DestTypes.DEST_PUSH)
|
||||
//{
|
||||
// m_iDestType = DestTypes.DEST_2D;
|
||||
//}
|
||||
#if ENABLE_CEC_INTELLIGENT_ROUTE
|
||||
else if (IsAutoPF())
|
||||
{
|
||||
@@ -677,7 +768,7 @@ namespace BrewMonster.Scripts
|
||||
|
||||
protected void ClearResetUseAutoPF()
|
||||
{
|
||||
|
||||
m_bResetAutoPF = false;
|
||||
}
|
||||
protected void UpdateResetUseAutoPF()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace BrewMonster.Scripts
|
||||
protected bool m_bMoving; // moving flag
|
||||
protected bool m_bStopSlide; // stop sliding flag
|
||||
protected int m_iCurAction; // current playing action
|
||||
protected int m_oldAction; // cache old played action
|
||||
//protected int m_oldAction; // cache old played action
|
||||
|
||||
public CECHPWorkStand(CECHPWorkMan pWorkMan) : base(Host_work_ID.WORK_STAND, pWorkMan)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ namespace BrewMonster.Scripts
|
||||
var pWork = (CECHPWorkMove)m_pWorkMan.CreateWork(Host_work_ID.WORK_MOVETOPOS);
|
||||
if (pWork != null)
|
||||
{
|
||||
//pWork.SetDestination(CECHPWorkMove.Types.DEST_STANDJUMP, GPDataTypeHelper.g_vOrigin);
|
||||
pWork.SetDestination(CECHPWorkMove.DestTypes.DEST_STANDJUMP, GPDataTypeHelper.g_vOrigin);
|
||||
m_pWorkMan.SetPostTickCommand(new CECHPWorkPostTickRunWorkCommand(
|
||||
pWork, false, CECHPWorkMan.Work_priority.PRIORITY_1, true, (uint)dwDeltaTime));
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace BrewMonster.Scripts
|
||||
m_iCurAction = m_pHost.GetMoveStandAction(false, bFight);
|
||||
}
|
||||
|
||||
float fDeltaTime = dwDeltaTime * 0.001f;
|
||||
float fDeltaTime = dwDeltaTime /** 0.001f*/;
|
||||
|
||||
if (!m_pHost.IsRooting())
|
||||
{
|
||||
@@ -170,11 +170,11 @@ namespace BrewMonster.Scripts
|
||||
Tick_FlySwim(fDeltaTime);*/
|
||||
}
|
||||
|
||||
if (m_iPoseAction == (int)CECPlayer.PLAYER_ACTION_TYPE.ACT_STAND && m_oldAction != m_iCurAction)
|
||||
if (m_iPoseAction == (int)CECPlayer.PLAYER_ACTION_TYPE.ACT_STAND)
|
||||
{
|
||||
// Chariot war special case omitted for now
|
||||
m_pHost.PlayAction(m_iCurAction, false, 300);
|
||||
m_oldAction = m_iCurAction;
|
||||
m_pHost.PlayAction(m_iCurAction, false, 0);
|
||||
//m_oldAction = m_iCurAction;
|
||||
}
|
||||
|
||||
// Force to update object's direction and up
|
||||
@@ -225,25 +225,28 @@ namespace BrewMonster.Scripts
|
||||
}
|
||||
|
||||
// Tick routine of flying or swimming
|
||||
/* bool Tick_FlySwim(float fDeltaTime)
|
||||
{
|
||||
m_bMoving = false;
|
||||
/* bool Tick_FlySwim(float fDeltaTime)
|
||||
{
|
||||
m_bMoving = false;
|
||||
|
||||
if (m_pHost.m_iMoveEnv == CECPlayer.Move_environment.MOVEENV_WATER && !m_bWaterStop)
|
||||
{
|
||||
// Handle floating at water surface after falling into water
|
||||
A3DVECTOR3 vCurPos = m_pHost.GetPos();
|
||||
// ON_AIR_CDR_INFO not available in current C# port; approximate using CDR_INFO where applicable
|
||||
float fSpeed = m_pHost.GetSwimSpeedSev();
|
||||
if (m_pHost.m_iMoveEnv == CECPlayer.Move_environment.MOVEENV_WATER && !m_bWaterStop)
|
||||
{
|
||||
// Handle floating at water surface after falling into water
|
||||
A3DVECTOR3 vCurPos = m_pHost.GetPos();
|
||||
// ON_AIR_CDR_INFO not available in current C# port; approximate using CDR_INFO where applicable
|
||||
float fSpeed = m_pHost.GetSwimSpeedSev();
|
||||
|
||||
// As we don't have water height/extent readily available on host in this port,
|
||||
// retain structure and leave movement here minimal.
|
||||
// If water height APIs are added, restore the original logic.
|
||||
// m_bMoving = true; // enable when full water logic is available
|
||||
}
|
||||
// As we don't have water height/extent readily available on host in this port,
|
||||
// retain structure and leave movement here minimal.
|
||||
// If water height APIs are added, restore the original logic.
|
||||
// m_bMoving = true; // enable when full water logic is available
|
||||
}
|
||||
|
||||
return true;
|
||||
}*/
|
||||
return true;
|
||||
}*/
|
||||
|
||||
// Get stop sliding flag
|
||||
public bool GetStopSlideFlag() { return m_bStopSlide; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
using BrewMonster.Managers;
|
||||
using BrewMonster.Network;
|
||||
using BrewMonster.Scripts;
|
||||
using CSNetwork.GPDataType;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BrewMonster
|
||||
{
|
||||
public partial class CECHostPlayer
|
||||
{
|
||||
float _JumpTime = -1;
|
||||
|
||||
public void OnKeyDown()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0) && mainCam != null)
|
||||
{
|
||||
OnMsgLBtnClick();
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
//if (bInAutoMode) return;
|
||||
if (IsJumpInWater() || IsFlying())
|
||||
return;
|
||||
|
||||
if (IsUnderWater())
|
||||
{
|
||||
if (!CanTakeOffWater())
|
||||
return;
|
||||
else if (_JumpTime <= 0)
|
||||
{
|
||||
_JumpTime = Time.realtimeSinceStartup;
|
||||
return;
|
||||
}
|
||||
else if ((Time.realtimeSinceStartup - _JumpTime) < 1f) // logic in c++, _JumpTime is milisecond
|
||||
return;
|
||||
else
|
||||
_JumpTime = -1f;
|
||||
}
|
||||
|
||||
m_GndInfo.bOnGround = GroundCheck(out lastGroundHit);
|
||||
OnMsgHstJump();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnMsgLBtnClick()
|
||||
{
|
||||
int idTraceTarget = 0, idSelTarget = 0;
|
||||
bool bForceAttack = false;
|
||||
int iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_NONE;
|
||||
bool bWikiMonster = false;
|
||||
|
||||
ray = mainCam.ScreenPointToRay(Input.mousePosition);
|
||||
|
||||
if (Physics.Raycast(ray, out hit))
|
||||
{
|
||||
if (hit.collider.gameObject.TryGetComponent<CECObject>(out CECObject clickedObject))
|
||||
{
|
||||
int idObject = CECObject.GetObjectID(clickedObject);
|
||||
if (idObject != 0)
|
||||
{
|
||||
CECNPC pNPC = EC_ManMessageMono.Instance._CECNPCMan.GetNPC(idObject);
|
||||
if (pNPC != null)
|
||||
{
|
||||
if (!pNPC.IsDead() && m_idSelTarget == idObject)
|
||||
{
|
||||
idTraceTarget = idObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
idSelTarget = idObject;
|
||||
}
|
||||
|
||||
if (idTraceTarget != 0)
|
||||
{
|
||||
if (AttackableJudge(idObject, bForceAttack) == 1)
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_ATTACK;
|
||||
else if (pNPC.IsServerNPC())
|
||||
{
|
||||
if (!IsInBattle() || InSameBattleCamp(pNPC))
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_TALK;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// pCDS.m_RayTraceRt.iEntity == ECENT_PLAYER
|
||||
CECPlayer pPlayer = EC_ManMessageMono.Instance.EC_ManPlayer.GetPlayer(idObject);
|
||||
|
||||
// 1. Msg.dwParam4 is double click flag.
|
||||
// 2. Buddy player counld't be traced
|
||||
if (!pPlayer.IsDead() /*&& pPlayer.GetCharacterID() != m_iBuddyId*/ &&
|
||||
(m_idSelTarget == idObject /*|| (Msg.dwParam4 && m_idUCSelTarget == idObject)*/))
|
||||
{
|
||||
idTraceTarget = idObject;
|
||||
//bForceAttack = glb_GetForceAttackFlag(&Msg.dwParam3);
|
||||
|
||||
if (AttackableJudge(idObject, bForceAttack) == 1)
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_ATTACK;
|
||||
else if (pPlayer.GetBoothState() != 0)
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_TALK;
|
||||
}
|
||||
else
|
||||
{
|
||||
idSelTarget = idObject;
|
||||
}
|
||||
}
|
||||
|
||||
// cancel this action if not selectable
|
||||
if (!CanSelectTarget(idTraceTarget))
|
||||
{
|
||||
idTraceTarget = 0;
|
||||
//return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tell server we select a target
|
||||
if (idSelTarget != 0 && m_idSelTarget != idSelTarget)
|
||||
{
|
||||
m_idUCSelTarget = idSelTarget;
|
||||
SelectTarget(m_idUCSelTarget);
|
||||
}
|
||||
|
||||
if (idTraceTarget != 0)
|
||||
{
|
||||
if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
|
||||
{
|
||||
if (!CanDo(ActionCanDo.CANDO_MELEE))
|
||||
return;
|
||||
NormalAttackObject(idTraceTarget, bForceAttack);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!CanDo(ActionCanDo.CANDO_MOVETO))
|
||||
return;
|
||||
CECHPWork pWork;
|
||||
if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_PICKUP)
|
||||
{
|
||||
//PickupObject(idTraceTarget, false);
|
||||
}
|
||||
else if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_GATHER)
|
||||
{
|
||||
//PickupObject(idTraceTarget, true);
|
||||
}
|
||||
else if ((pWork = m_pWorkMan.GetWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT)) != null)
|
||||
{
|
||||
CECHPWorkTrace pWorkTrace = (pWork) as CECHPWorkTrace;
|
||||
pWorkTrace.SetTraceTarget(pWorkTrace.CreatTraceTarget(idTraceTarget, iTraceReason, bForceAttack));
|
||||
}
|
||||
else if (m_pWorkMan.CanStartWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT) && !bWikiMonster)
|
||||
{
|
||||
CECHPWorkTrace pWorkTrace = (CECHPWorkTrace)m_pWorkMan.CreateWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT);
|
||||
pWorkTrace.SetTraceTarget(pWorkTrace.CreatTraceTarget(idTraceTarget, iTraceReason, bForceAttack));
|
||||
m_pWorkMan.StartWork_p1(pWorkTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnMsgHstJump()
|
||||
{
|
||||
// first of all see if we need to cancel sitdown work.
|
||||
if (m_pWorkMan.IsSitting())
|
||||
{
|
||||
UnityGameSession.c2s_CmdStandUp();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CanDo(ActionCanDo.CANDO_JUMP))
|
||||
return;
|
||||
|
||||
float fVertSpeed = 10.0f;
|
||||
|
||||
if (m_iJumpCount == 0)
|
||||
{
|
||||
if (m_iMoveEnv == Move_environment.MOVEENV_WATER)
|
||||
{
|
||||
if (!IsUnderWater())
|
||||
return;
|
||||
|
||||
fVertSpeed = 7.0f;
|
||||
SetJumpInWater(true);
|
||||
}
|
||||
else if (!m_GndInfo.bOnGround)
|
||||
return;
|
||||
}
|
||||
|
||||
if (InSlidingState())
|
||||
return;
|
||||
|
||||
m_iJumpCount++;
|
||||
|
||||
m_fVertSpeed = fVertSpeed;
|
||||
m_CDRInfo.vAbsVelocity.y = fVertSpeed;
|
||||
m_CDRInfo.fYVel = 0.0f;
|
||||
m_CDRInfo.vTPNormal = Vector3.zero;
|
||||
|
||||
if (m_iJumpCount == 1)
|
||||
{
|
||||
m_MoveCtrl.SendMoveCmd(GetPos(), 2, GPDataTypeHelper.g_vAxisY, EC_Utility.ToA3DVECTOR3(m_CDRInfo.vAbsVelocity), m_iMoveMode, true);
|
||||
// BubbleText(BUBBLE_HITMISSED, 0);
|
||||
}
|
||||
|
||||
PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_JUMP_START);
|
||||
|
||||
PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_JUMP_LOOP, false, 0, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c64966b4075658b48a5bc694d91a47fc
|
||||
@@ -79,7 +79,9 @@ public abstract partial class CECPlayer : CECObject
|
||||
public static int MAX_REINCARNATION = 2;
|
||||
protected List<int> m_aCurEffects = new List<int>(); // Current effects
|
||||
byte m_ReincarnationCount = 0;
|
||||
string m_strName; // Player name
|
||||
string m_strName; // Player name
|
||||
// 需要是可能 || Need is possible
|
||||
protected bool m_bHangerOn = false;
|
||||
|
||||
public MOVECONST m_MoveConst; // Const used when moving control
|
||||
public Move_Mode m_MoveMode;
|
||||
|
||||
@@ -1256,5 +1256,12 @@ namespace CSNetwork
|
||||
gamedatasend.Data = C2SCommandFactory.CreateTaskNotifyCmd( pData, dwDataSize);
|
||||
SendProtocol(gamedatasend);
|
||||
}
|
||||
|
||||
public void c2s_SendCmdStandUp()
|
||||
{
|
||||
gamedatasend gamedatasend = new gamedatasend();
|
||||
gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.STAND_UP);
|
||||
SendProtocol(gamedatasend);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,6 +304,11 @@ namespace BrewMonster.Network
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdNPCSevTaskMatter(idTask);
|
||||
}
|
||||
|
||||
public static void c2s_CmdStandUp()
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdStandUp();
|
||||
}
|
||||
#region Task
|
||||
public static void c2s_CmdGetAllData(bool byPack, bool byEquip, bool byTask)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace BrewMonster
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
|
||||
_characterCtrl.HandleMovement();
|
||||
}
|
||||
}
|
||||
}
|
||||
+226
-237
@@ -2,6 +2,7 @@
|
||||
using BrewMonster.Assets.PerfectWorld.Scripts.Players;
|
||||
using BrewMonster.Managers;
|
||||
using BrewMonster.Network;
|
||||
using BrewMonster.PerfectWorld.Scripts.Vfx;
|
||||
using BrewMonster.Scripts;
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using BrewMonster.Scripts.Player;
|
||||
@@ -10,18 +11,17 @@ using CSNetwork;
|
||||
using CSNetwork.GPDataType;
|
||||
using CSNetwork.Protocols.RPCData;
|
||||
using ModelRenderer.Scripts.GameData;
|
||||
using PerfectWorld.Scripts.Managers;
|
||||
using PerfectWorld.Scripts.Player;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using BrewMonster.PerfectWorld.Scripts.Vfx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using Trace_reason = CECHPWorkTrace.Trace_reason;
|
||||
using Host_work_ID = BrewMonster.Scripts.CECHPWork.Host_work_ID;
|
||||
using PerfectWorld.Scripts.Managers;
|
||||
using Trace_reason = CECHPWorkTrace.Trace_reason;
|
||||
|
||||
namespace BrewMonster
|
||||
{
|
||||
@@ -85,6 +85,8 @@ namespace BrewMonster
|
||||
private CECSkill m_pCurSkill;
|
||||
private CECCounter m_IncantCnt;
|
||||
private bool m_bMelee;
|
||||
private int MAX_JUMP_COUNT = 2;
|
||||
bool m_bUsingTrashBox = false; // Whether being using trash box
|
||||
private float m_fPrayDistancePlus;
|
||||
private A3DVECTOR3 g_vOrigin = new A3DVECTOR3(0f);
|
||||
private Transform playerTransform;
|
||||
@@ -263,121 +265,7 @@ namespace BrewMonster
|
||||
// ccRadius = controller.radius; ccSkin = controller.skinWidth;
|
||||
|
||||
_playerStateMachine.UpdateState();
|
||||
if (Input.GetMouseButtonDown(0) && mainCam != null)
|
||||
{
|
||||
int idTraceTarget = 0, idSelTarget = 0;
|
||||
bool bForceAttack = false;
|
||||
int iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_NONE;
|
||||
bool bWikiMonster = false;
|
||||
|
||||
ray = mainCam.ScreenPointToRay(Input.mousePosition);
|
||||
|
||||
if (Physics.Raycast(ray, out hit))
|
||||
{
|
||||
if (hit.collider.gameObject.TryGetComponent<CECObject>(out CECObject clickedObject))
|
||||
{
|
||||
int idObject = CECObject.GetObjectID(clickedObject);
|
||||
if (idObject != 0)
|
||||
{
|
||||
CECNPC pNPC = EC_ManMessageMono.Instance._CECNPCMan.GetNPC(idObject);
|
||||
if (pNPC != null)
|
||||
{
|
||||
if (!pNPC.IsDead() && m_idSelTarget == idObject)
|
||||
{
|
||||
idTraceTarget = idObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
idSelTarget = idObject;
|
||||
}
|
||||
|
||||
if (idTraceTarget != 0)
|
||||
{
|
||||
if (AttackableJudge(idObject, bForceAttack) == 1)
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_ATTACK;
|
||||
else if (pNPC.IsServerNPC())
|
||||
{
|
||||
if (!IsInBattle() || InSameBattleCamp(pNPC))
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_TALK;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// pCDS.m_RayTraceRt.iEntity == ECENT_PLAYER
|
||||
CECPlayer pPlayer = EC_ManMessageMono.Instance.EC_ManPlayer.GetPlayer(idObject);
|
||||
|
||||
// 1. Msg.dwParam4 is double click flag.
|
||||
// 2. Buddy player counld't be traced
|
||||
if (!pPlayer.IsDead() /*&& pPlayer.GetCharacterID() != m_iBuddyId*/ &&
|
||||
(m_idSelTarget == idObject /*|| (Msg.dwParam4 && m_idUCSelTarget == idObject)*/))
|
||||
{
|
||||
idTraceTarget = idObject;
|
||||
//bForceAttack = glb_GetForceAttackFlag(&Msg.dwParam3);
|
||||
|
||||
if (AttackableJudge(idObject, bForceAttack) == 1)
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_ATTACK;
|
||||
else if (pPlayer.GetBoothState() != 0)
|
||||
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_TALK;
|
||||
}
|
||||
else
|
||||
{
|
||||
idSelTarget = idObject;
|
||||
}
|
||||
}
|
||||
|
||||
// cancel this action if not selectable
|
||||
if (!CanSelectTarget(idTraceTarget))
|
||||
{
|
||||
idTraceTarget = 0;
|
||||
//return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tell server we select a target
|
||||
if (idSelTarget != 0 && m_idSelTarget != idSelTarget)
|
||||
{
|
||||
m_idUCSelTarget = idSelTarget;
|
||||
SelectTarget(m_idUCSelTarget);
|
||||
}
|
||||
|
||||
if (idTraceTarget != 0)
|
||||
{
|
||||
if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
|
||||
{
|
||||
if (!CanDo(ActionCanDo.CANDO_MELEE))
|
||||
return;
|
||||
NormalAttackObject(idTraceTarget, bForceAttack);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!CanDo(ActionCanDo.CANDO_MOVETO))
|
||||
return;
|
||||
CECHPWork pWork;
|
||||
if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_PICKUP)
|
||||
{
|
||||
//PickupObject(idTraceTarget, false);
|
||||
}
|
||||
else if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_GATHER)
|
||||
{
|
||||
//PickupObject(idTraceTarget, true);
|
||||
}
|
||||
else if ((pWork = m_pWorkMan.GetWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT)) != null)
|
||||
{
|
||||
CECHPWorkTrace pWorkTrace = (pWork) as CECHPWorkTrace;
|
||||
pWorkTrace.SetTraceTarget(pWorkTrace.CreatTraceTarget(idTraceTarget, iTraceReason, bForceAttack));
|
||||
}
|
||||
else if (m_pWorkMan.CanStartWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT) && !bWikiMonster)
|
||||
{
|
||||
CECHPWorkTrace pWorkTrace = (CECHPWorkTrace)m_pWorkMan.CreateWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT);
|
||||
pWorkTrace.SetTraceTarget(pWorkTrace.CreatTraceTarget(idTraceTarget, iTraceReason, bForceAttack));
|
||||
m_pWorkMan.StartWork_p1(pWorkTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
OnKeyDown();
|
||||
|
||||
m_pWorkMan?.Tick(Time.deltaTime);
|
||||
|
||||
@@ -399,9 +287,9 @@ namespace BrewMonster
|
||||
isGrounded = GroundCheck(out lastGroundHit);
|
||||
m_GndInfo.bOnGround = isGrounded;
|
||||
// 2) Input tạm thời: giữ nguyên như bạn
|
||||
if (UnityEngine.Input.GetKeyDown(KeyCode.LeftShift)) SetStatusRun(true);
|
||||
if (UnityEngine.Input.GetKeyUp(KeyCode.LeftShift)) SetStatusRun(false);
|
||||
if (UnityEngine.Input.GetKeyDown(KeyCode.Space)) HandleJump();
|
||||
//if (UnityEngine.Input.GetKeyDown(KeyCode.LeftShift)) SetStatusRun(true);
|
||||
//if (UnityEngine.Input.GetKeyUp(KeyCode.LeftShift)) SetStatusRun(false);
|
||||
//if (UnityEngine.Input.GetKeyDown(KeyCode.Space)) HandleJump();
|
||||
|
||||
// 3) Trọng lực / sticky
|
||||
if (isGrounded && playerVelocity.y < 0f)
|
||||
@@ -645,8 +533,8 @@ namespace BrewMonster
|
||||
{
|
||||
// Update UI when profession changes, save all shortcut configurations
|
||||
// to remove effects from intermediate skills (invalid pointers)
|
||||
// C++: CECGameUIMan *pGameUIMan = g_pGame->GetGameRun()->GetUIManager()->GetInGameUIMan();
|
||||
// pGameUIMan->UpdateSkillRelatedUI();
|
||||
// C++: CECGameUIMan *pGameUIMan = g_pGame.GetGameRun().GetUIManager().GetInGameUIMan();
|
||||
// pGameUIMan.UpdateSkillRelatedUI();
|
||||
hostPlayer.UpdateSkillRelatedUI();
|
||||
}*/
|
||||
}
|
||||
@@ -674,24 +562,24 @@ namespace BrewMonster
|
||||
if (pCmd.iHP < m_BasicProps.iCurHP && m_BasicProps.iCurHP >= iLimit && pCmd.iHP < iLimit)
|
||||
{
|
||||
|
||||
/*if (CECUIHelper::GetGameUIMan()->IsShowLowHP()) {
|
||||
/*if (CECUIHelper::GetGameUIMan().IsShowLowHP()) {
|
||||
// ѪÁ¿µÍÓÚÁÙ½çÖµÔò²¥·ÅÌØÐ§
|
||||
const int GfxLastTime = 10000; // ³ÖÐøÊ±¼ä10Ãë
|
||||
CECUIHelper::GetGameUIMan()->GetScreenEffectMan()->StartEffect(CECScreenEffect::EFFECT_REDSPARK, GfxLastTime);
|
||||
CECUIHelper::GetGameUIMan().GetScreenEffectMan().StartEffect(CECScreenEffect::EFFECT_REDSPARK, GfxLastTime);
|
||||
}*/
|
||||
}
|
||||
|
||||
/*if (pCmd.iHP >= iLimit || pCmd.iHP <= 0) {
|
||||
// ѪÁ¿¸ßÓÚÁÙ½çÖµ»òËÀÍö£¬ÔòÍ£Ö¹²¥·ÅÌØÐ§
|
||||
CECUIHelper::GetGameUIMan()->GetScreenEffectMan()->FinishEffect(CECScreenEffect::EFFECT_REDSPARK);
|
||||
CECUIHelper::GetGameUIMan().GetScreenEffectMan().FinishEffect(CECScreenEffect::EFFECT_REDSPARK);
|
||||
}*/
|
||||
|
||||
/*iLimit = (int)(pCmd.iMaxMP * 0.2f);
|
||||
if (pCmd.iMP < m_BasicProps.iCurMP && m_BasicProps.iCurMP >= iLimit && pCmd.iMP < iLimit)
|
||||
BubbleText(BUBBLE_MPWARN, 0);*/
|
||||
|
||||
/*if (m_ExtProps.max_ap != pCmd->iMaxAP)
|
||||
g_pGame->GetGameRun()->AddFixedMessage(FIXMSG_ADDMAXAP, pCmd->iMaxAP - m_ExtProps.max_ap);*/
|
||||
/*if (m_ExtProps.max_ap != pCmd.iMaxAP)
|
||||
g_pGame.GetGameRun().AddFixedMessage(FIXMSG_ADDMAXAP, pCmd.iMaxAP - m_ExtProps.max_ap);*/
|
||||
}
|
||||
|
||||
m_BasicProps.iLevel = pCmd.sLevel;
|
||||
@@ -713,10 +601,10 @@ namespace BrewMonster
|
||||
|
||||
// UpdateGodEvilSprite();
|
||||
|
||||
/*CECGameUIMan* pGameUI = g_pGame->GetGameRun()->GetUIManager()->GetInGameUIMan();
|
||||
CDlgAutoHelp *pDlgHelp = dynamic_cast<CDlgAutoHelp *>(pGameUI->GetDialog("Win_WikiPop"));*/
|
||||
/*CECGameUIMan* pGameUI = g_pGame.GetGameRun().GetUIManager().GetInGameUIMan();
|
||||
CDlgAutoHelp *pDlgHelp = dynamic_cast<CDlgAutoHelp *>(pGameUI.GetDialog("Win_WikiPop"));*/
|
||||
/*if(pDlgHelp && m_bFight)
|
||||
pDlgHelp->SetAutoHelpState(false);*/
|
||||
pDlgHelp.SetAutoHelpState(false);*/
|
||||
}
|
||||
void SetLevel2(int level2, bool bFirstTime)
|
||||
{
|
||||
@@ -734,9 +622,9 @@ namespace BrewMonster
|
||||
if (pCmd.iDamage != 0 && (pCmd.cEquipment & 0x7f) != 0x7f)
|
||||
{
|
||||
/* char cEquip = (char)(pCmd.cEquipment & 0x7f);
|
||||
CECIvtrEquip pEquip = (CECIvtrEquip)m_pEquipPack->GetItem(cEquip);
|
||||
CECIvtrEquip pEquip = (CECIvtrEquip)m_pEquipPack.GetItem(cEquip);
|
||||
if (pEquip)
|
||||
pEquip->AddCurEndurance(ARMOR_RUIN_SPEED);*/
|
||||
pEquip.AddCurEndurance(ARMOR_RUIN_SPEED);*/
|
||||
}
|
||||
|
||||
// The host player is attacked, we should make an effect here
|
||||
@@ -801,7 +689,7 @@ namespace BrewMonster
|
||||
{
|
||||
cmd_be_hurt pCmd = (cmd_be_hurt)Msg.dwParam1;
|
||||
if (pCmd.damage != 0)
|
||||
Damaged(pCmd->damage);
|
||||
Damaged(pCmd.damage);
|
||||
}
|
||||
else if (cmd == CommandID.HURT_RESULT)
|
||||
{
|
||||
@@ -813,7 +701,7 @@ namespace BrewMonster
|
||||
{
|
||||
CECElsePlayer pTarget = m_pPlayerMan.GetElsePlayer(pCmd.target_id);
|
||||
if (pTarget)
|
||||
pTarget->Damaged(pCmd->damage);
|
||||
pTarget.Damaged(pCmd.damage);
|
||||
}
|
||||
else if (UnityGameSession.Instance.GameSession.ISNPCID(pCmd.target_id))
|
||||
{
|
||||
@@ -1206,32 +1094,32 @@ namespace BrewMonster
|
||||
// ASSERT(pCmd);
|
||||
//
|
||||
// // test code...
|
||||
// // g_pGame->GetRTDebug()->OutputNotifyMessage(RTDCOL_WARNING, _AL("start attack !"));
|
||||
// // g_pGame.GetRTDebug().OutputNotifyMessage(RTDCOL_WARNING, _AL("start attack !"));
|
||||
//
|
||||
// // Check whether target is the one that we have selected
|
||||
// if (m_idSelTarget != pCmd->idTarget)
|
||||
// g_pGame->RuntimeDebugInfo(RTDCOL_WARNING, _AL("Target has changed !"));
|
||||
// if (m_idSelTarget != pCmd.idTarget)
|
||||
// g_pGame.RuntimeDebugInfo(RTDCOL_WARNING, _AL("Target has changed !"));
|
||||
//
|
||||
// // If target turn to be un-attackable, cancel action
|
||||
// if (!AttackableJudge(pCmd->idTarget, true))
|
||||
// if (!AttackableJudge(pCmd.idTarget, true))
|
||||
// {
|
||||
// g_pGame->GetGameSession()->c2s_CmdCancelAction();
|
||||
// g_pGame->RuntimeDebugInfo(RTDCOL_WARNING, _AL("Cannel attacking !"));
|
||||
// g_pGame.GetGameSession().c2s_CmdCancelAction();
|
||||
// g_pGame.RuntimeDebugInfo(RTDCOL_WARNING, _AL("Cannel attacking !"));
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // Synchronize ammo amount
|
||||
// CECIvtrItem* pItem = m_pEquipPack->GetItem(EQUIPIVTR_PROJECTILE);
|
||||
// CECIvtrItem* pItem = m_pEquipPack.GetItem(EQUIPIVTR_PROJECTILE);
|
||||
// if (pItem)
|
||||
// {
|
||||
// if (!pCmd->ammo_remain)
|
||||
// m_pEquipPack->SetItem(EQUIPIVTR_PROJECTILE, NULL);
|
||||
// if (!pCmd.ammo_remain)
|
||||
// m_pEquipPack.SetItem(EQUIPIVTR_PROJECTILE, NULL);
|
||||
// else
|
||||
// pItem->SetAmount(pCmd->ammo_remain);
|
||||
// pItem.SetAmount(pCmd.ammo_remain);
|
||||
// }
|
||||
//
|
||||
// CECHPWorkMelee* pWork = (CECHPWorkMelee*)m_pWorkMan->CreateWork(CECHPWork::WORK_HACKOBJECT);
|
||||
// m_pWorkMan->StartWork_p1(pWork);
|
||||
// CECHPWorkMelee* pWork = (CECHPWorkMelee*)m_pWorkMan.CreateWork(CECHPWork::WORK_HACKOBJECT);
|
||||
// m_pWorkMan.StartWork_p1(pWork);
|
||||
//
|
||||
// m_bMelee = true;
|
||||
// AP_ActionEvent(AP_EVENT_STARTMELEE);
|
||||
@@ -1284,7 +1172,7 @@ namespace BrewMonster
|
||||
}
|
||||
|
||||
// #ifdef _SHOW_AUTOPOLICY_DEBUG
|
||||
// a_LogOutput(1, "Stop Attack, Reason = %d", pCmd->iReason);
|
||||
// a_LogOutput(1, "Stop Attack, Reason = %d", pCmd.iReason);
|
||||
// #endif
|
||||
}
|
||||
|
||||
@@ -1396,9 +1284,9 @@ namespace BrewMonster
|
||||
/*
|
||||
else if (IsSitting())
|
||||
{
|
||||
CECHPWorkSit* pWork = (CECHPWorkSit*)m_pWorkMan->CreateWork(CECHPWork.Host_work_ID.WORK_SIT);
|
||||
pWork->SetBeSittingFlag(true);
|
||||
m_pWorkMan->StartWork_p1(pWork);
|
||||
CECHPWorkSit* pWork = (CECHPWorkSit*)m_pWorkMan.CreateWork(CECHPWork.Host_work_ID.WORK_SIT);
|
||||
pWork.SetBeSittingFlag(true);
|
||||
m_pWorkMan.StartWork_p1(pWork);
|
||||
}*/
|
||||
|
||||
LoadResources();
|
||||
@@ -1414,10 +1302,10 @@ namespace BrewMonster
|
||||
{
|
||||
// Load GFX
|
||||
var gfxCaster = EC_Game.GetGFXCaster();
|
||||
// m_pMoveTargetGFX = g_pGame->GetGFXCaster()->LoadGFXEx(res_GFXFile(RES_GFX_MOVETARGET));
|
||||
// m_pMoveTargetGFX = g_pGame.GetGFXCaster().LoadGFXEx(res_GFXFile(RES_GFX_MOVETARGET));
|
||||
m_pSelectedGFX = await gfxCaster.LoadGFXEx(EC_Resource.res_GFXFile((int)GfxResourceType.RES_GFX_CURSORHOVER));
|
||||
m_pHoverGFX = await gfxCaster.LoadGFXEx(EC_Resource.res_GFXFile((int)GfxResourceType.RES_GFX_CURSORHOVER));
|
||||
// m_pFloatDust = g_pGame->GetGFXCaster()->LoadGFXEx(res_GFXFile(RES_GFX_FLOATING_DUST));
|
||||
// m_pFloatDust = g_pGame.GetGFXCaster().LoadGFXEx(res_GFXFile(RES_GFX_FLOATING_DUST));
|
||||
|
||||
if (true /*CECUIConfig::Instance().GetGameUI().bEnableActionSwitch*/)
|
||||
{
|
||||
@@ -1436,7 +1324,6 @@ namespace BrewMonster
|
||||
g_pGame.GetGameSession().c2s_CmdStandUp();
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (!CanDo(ActionCanDo.CANDO_MOVETO)) return;
|
||||
|
||||
bool bPushMove = true;
|
||||
@@ -1953,11 +1840,11 @@ namespace BrewMonster
|
||||
|
||||
//// If we press a chargeable skill again when it's being charged,
|
||||
//// we cast it out at once
|
||||
//if (IsSpellingMagic() && m_pCurSkill && m_pCurSkill->IsCharging() &&
|
||||
// m_pCurSkill->GetSkillID() == pSkill->GetSkillID())
|
||||
//if (IsSpellingMagic() && m_pCurSkill && m_pCurSkill.IsCharging() &&
|
||||
// m_pCurSkill.GetSkillID() == pSkill.GetSkillID())
|
||||
//{
|
||||
// m_pCurSkill->EndCharging();
|
||||
// g_pGame->GetGameSession()->c2s_CmdContinueAction();
|
||||
// m_pCurSkill.EndCharging();
|
||||
// g_pGame.GetGameSession().c2s_CmdContinueAction();
|
||||
// return true;
|
||||
//}
|
||||
|
||||
@@ -1976,12 +1863,12 @@ namespace BrewMonster
|
||||
// bForceAttack = iForceAtk > 0 ? true : false;
|
||||
|
||||
//// Check negative effect skill
|
||||
//if (pSkill->GetType() == CECSkill::TYPE_ATTACK || pSkill->GetType() == CECSkill::TYPE_CURSE)
|
||||
//if (pSkill.GetType() == CECSkill::TYPE_ATTACK || pSkill.GetType() == CECSkill::TYPE_CURSE)
|
||||
//{
|
||||
// if (idSelTarget == m_PlayerInfo.cid)
|
||||
// {
|
||||
// // Host cannot spell negative effect magic to himself.
|
||||
// g_pGame->GetGameRun()->AddFixedChannelMsg(FIXMSG_TARGETWRONG, GP_CHAT_FIGHT);
|
||||
// g_pGame.GetGameRun().AddFixedChannelMsg(FIXMSG_TARGETWRONG, GP_CHAT_FIGHT);
|
||||
// return false;
|
||||
// }
|
||||
// else if (idSelTarget)
|
||||
@@ -1995,8 +1882,8 @@ namespace BrewMonster
|
||||
int idCastTarget = idSelTarget;
|
||||
int iTargetType = pSkill.GetTargetType();
|
||||
|
||||
//if (pSkill->GetType() == CECSkill::TYPE_BLESS ||
|
||||
// pSkill->GetType() == CECSkill::TYPE_NEUTRALBLESS)
|
||||
//if (pSkill.GetType() == CECSkill::TYPE_BLESS ||
|
||||
// pSkill.GetType() == CECSkill::TYPE_NEUTRALBLESS)
|
||||
//{
|
||||
// if (!iTargetType || !ISPLAYERID(idSelTarget))
|
||||
// idCastTarget = m_PlayerInfo.cid;
|
||||
@@ -2007,7 +1894,7 @@ namespace BrewMonster
|
||||
// // If host has set bless skill filter only to himself, bless skill couldn't add to other players
|
||||
// BYTE byBLSMask = glb_BuildBLSMask();
|
||||
|
||||
// if (pSkill->GetRangeType() == CECSkill::RANGE_POINT)
|
||||
// if (pSkill.GetRangeType() == CECSkill::RANGE_POINT)
|
||||
// {
|
||||
// if (!IsTeamMember(idCastTarget))
|
||||
// {
|
||||
@@ -2015,31 +1902,31 @@ namespace BrewMonster
|
||||
// idCastTarget = m_PlayerInfo.cid;
|
||||
// else
|
||||
// {
|
||||
// CECElsePlayer* pPlayer = (CECElsePlayer*)g_pGame->GetGameRun()->GetWorld()->GetPlayerMan()->GetPlayer(idCastTarget);
|
||||
// CECElsePlayer* pPlayer = (CECElsePlayer*)g_pGame.GetGameRun().GetWorld().GetPlayerMan().GetPlayer(idCastTarget);
|
||||
// if (!pPlayer)
|
||||
// {
|
||||
// // Ä¿±êÏûʧ
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (pPlayer->IsInvader() || pPlayer->IsPariah())
|
||||
// if (pPlayer.IsInvader() || pPlayer.IsPariah())
|
||||
// {
|
||||
// if (byBLSMask & GP_BLSMASK_NORED)
|
||||
// idCastTarget = m_PlayerInfo.cid;
|
||||
// }
|
||||
|
||||
// if (!IsFactionMember(pPlayer->GetFactionID()))
|
||||
// if (!IsFactionMember(pPlayer.GetFactionID()))
|
||||
// {
|
||||
// if (byBLSMask & GP_BLSMASK_NOMAFIA)
|
||||
// idCastTarget = m_PlayerInfo.cid;
|
||||
// }
|
||||
|
||||
// if (!IsFactionAllianceMember(pPlayer->GetFactionID()))
|
||||
// if (!IsFactionAllianceMember(pPlayer.GetFactionID()))
|
||||
// {
|
||||
// if (byBLSMask & GP_BLSMASK_NOALLIANCE)
|
||||
// idCastTarget = m_PlayerInfo.cid;
|
||||
// }
|
||||
// if (GetForce() != pPlayer->GetForce())
|
||||
// if (GetForce() != pPlayer.GetForce())
|
||||
// {
|
||||
// if (byBLSMask & GP_BLSMASK_NOFORCE)
|
||||
// idCastTarget = m_PlayerInfo.cid;
|
||||
@@ -2055,29 +1942,29 @@ namespace BrewMonster
|
||||
// // If host is in battle, bless skill couldn't add to enemies
|
||||
// if (IsInBattle())
|
||||
// {
|
||||
// CECElsePlayer* pPlayer = m_pPlayerMan->GetElsePlayer(idCastTarget);
|
||||
// CECElsePlayer* pPlayer = m_pPlayerMan.GetElsePlayer(idCastTarget);
|
||||
// if (!InSameBattleCamp(pPlayer))
|
||||
// idCastTarget = m_PlayerInfo.cid;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//else if (pSkill->GetType() == CECSkill::TYPE_BLESSPET)
|
||||
//else if (pSkill.GetType() == CECSkill::TYPE_BLESSPET)
|
||||
//{
|
||||
// CECPet* pPet = g_pGame->GetGameRun()->GetWorld()->GetNPCMan()->GetPetByID(idSelTarget);
|
||||
// if (!pPet || pPet->GetMasterID() == GetCharacterID())
|
||||
// CECPet* pPet = g_pGame.GetGameRun().GetWorld().GetNPCMan().GetPetByID(idSelTarget);
|
||||
// if (!pPet || pPet.GetMasterID() == GetCharacterID())
|
||||
// {
|
||||
// // Spell skill on host's pet
|
||||
// CECPetData* pPetData = m_pPetCorral->GetActivePet();
|
||||
// CECPetData* pPetData = m_pPetCorral.GetActivePet();
|
||||
// if (!pPetData ||
|
||||
// pPetData->GetClass() != GP_PET_CLASS_COMBAT &&
|
||||
// pPetData->GetClass() != GP_PET_CLASS_SUMMON &&
|
||||
// pPetData->GetClass() != GP_PET_CLASS_EVOLUTION)
|
||||
// pPetData.GetClass() != GP_PET_CLASS_COMBAT &&
|
||||
// pPetData.GetClass() != GP_PET_CLASS_SUMMON &&
|
||||
// pPetData.GetClass() != GP_PET_CLASS_EVOLUTION)
|
||||
// return false;
|
||||
|
||||
// idCastTarget = m_pPetCorral->GetActivePetNPCID();
|
||||
// idCastTarget = m_pPetCorral.GetActivePetNPCID();
|
||||
// }
|
||||
// // Only fighting pet can be blessed.
|
||||
// if (pPet && !pPet->CanBeAttacked())
|
||||
// if (pPet && !pPet.CanBeAttacked())
|
||||
// return false;
|
||||
//}
|
||||
//else
|
||||
@@ -2087,7 +1974,7 @@ namespace BrewMonster
|
||||
//}
|
||||
|
||||
//// iTargetType == 4 means target must be pet. The problem is that pet will
|
||||
//// disappear from world after it died, so GetWorld()->GetObject() will return
|
||||
//// disappear from world after it died, so GetWorld().GetObject() will return
|
||||
//// NULL when host spells revive-pet skill on his dead pet. So, the target
|
||||
//// type of revive-pet skill should be 0
|
||||
//if (iTargetType)
|
||||
@@ -2099,7 +1986,7 @@ namespace BrewMonster
|
||||
// else if (iTargetType == 2)
|
||||
// iAliveFlag = 2;
|
||||
|
||||
// CECObject* pObject = g_pGame->GetGameRun()->GetWorld()->GetObject(idCastTarget, iAliveFlag);
|
||||
// CECObject* pObject = g_pGame.GetGameRun().GetWorld().GetObject(idCastTarget, iAliveFlag);
|
||||
// if (!pObject)
|
||||
// return false;
|
||||
//}
|
||||
@@ -2108,17 +1995,17 @@ namespace BrewMonster
|
||||
// (!iTargetType || idCastTarget == m_PlayerInfo.cid))
|
||||
//{
|
||||
// // Cast this skill need't checking cast distance
|
||||
// if (!pSkill->ReadyToCast())
|
||||
// if (!pSkill.ReadyToCast())
|
||||
// return false;
|
||||
|
||||
// // Prepare to cast skill, if skill isn't INSTANT and FLASHMOVE,
|
||||
// // we must stop moving and stand
|
||||
// if (!pSkill->IsInstant() && pSkill->GetType() != CECSkill::TYPE_FLASHMOVE)
|
||||
// if (!pSkill.IsInstant() && pSkill.GetType() != CECSkill::TYPE_FLASHMOVE)
|
||||
// {
|
||||
// if (!NaturallyStopMoving())
|
||||
// return false; // Couldn't stop naturally, so cancel casting skill
|
||||
// }
|
||||
// else if (pSkill->GetType() == CECSkill::TYPE_FLASHMOVE)
|
||||
// else if (pSkill.GetType() == CECSkill::TYPE_FLASHMOVE)
|
||||
// {
|
||||
// if (!CanDo(CANDO_FLASHMOVE))
|
||||
// return false;
|
||||
@@ -2134,12 +2021,12 @@ namespace BrewMonster
|
||||
//}
|
||||
//else // Have to trace selected object before cast skill
|
||||
//{
|
||||
// if (!pSkill->ReadyToCast())
|
||||
// if (!pSkill.ReadyToCast())
|
||||
// return false;
|
||||
|
||||
// if (CECCastSkillWhenMove::Instance().IsSkillSupported(pSkill->GetSkillID(), this) &&
|
||||
// m_pWorkMan->IsMovingToPosition() &&
|
||||
// m_pWorkMan->CanCastSkillImmediately(pSkill->GetSkillID()))
|
||||
// if (CECCastSkillWhenMove::Instance().IsSkillSupported(pSkill.GetSkillID(), this) &&
|
||||
// m_pWorkMan.IsMovingToPosition() &&
|
||||
// m_pWorkMan.CanCastSkillImmediately(pSkill.GetSkillID()))
|
||||
// {
|
||||
// m_pPrepSkill = pSkill;
|
||||
// return CastSkill(idCastTarget, bForceAttack);
|
||||
@@ -2149,7 +2036,7 @@ namespace BrewMonster
|
||||
bool bTraceOK = false;
|
||||
bool bUseAutoPF = false;
|
||||
/* CECPlayerWrapper* pWrapper = CECAutoPolicy::GetInstance().GetPlayerWrapper();
|
||||
if (CECAutoPolicy::GetInstance().IsAutoPolicyEnabled() && pWrapper->GetAttackError() >= 2)
|
||||
if (CECAutoPolicy::GetInstance().IsAutoPolicyEnabled() && pWrapper.GetAttackError() >= 2)
|
||||
bUseAutoPF = true;*/
|
||||
|
||||
if (idCastTarget == 0)
|
||||
@@ -2379,20 +2266,20 @@ namespace BrewMonster
|
||||
{
|
||||
/* CECConfigs pConfigs = EC_Game.GetConfigs();
|
||||
|
||||
if (pConfigs->GetGameSettings().bAtk_Player)
|
||||
if (pConfigs.GetGameSettings().bAtk_Player)
|
||||
{
|
||||
byMask |= GP_PVPMASK_FORCE;
|
||||
|
||||
if (pConfigs->GetGameSettings().bAtk_NoMafia)
|
||||
if (pConfigs.GetGameSettings().bAtk_NoMafia)
|
||||
byMask |= GP_PVPMASK_NOMAFIA;
|
||||
|
||||
if (pConfigs->GetGameSettings().bAtk_NoWhite)
|
||||
if (pConfigs.GetGameSettings().bAtk_NoWhite)
|
||||
byMask |= GP_PVPMASK_NOWHITE;
|
||||
|
||||
if (pConfigs->GetGameSettings().bAtk_NoAlliance)
|
||||
if (pConfigs.GetGameSettings().bAtk_NoAlliance)
|
||||
byMask |= GP_PVPMASK_NOALLIANCE;
|
||||
|
||||
if (pConfigs->GetGameSettings().bAtk_NoForce)
|
||||
if (pConfigs.GetGameSettings().bAtk_NoForce)
|
||||
byMask |= GP_PVPMASK_NOFORCE;
|
||||
}*/
|
||||
}
|
||||
@@ -2565,7 +2452,7 @@ namespace BrewMonster
|
||||
case ActionCanDo.CANDO_ASSISTSEL:
|
||||
|
||||
if (IsDead() || !GPDataTypeHelper.ISPLAYERID(m_idSelTarget) || m_idSelTarget == m_PlayerInfo.cid /*||
|
||||
!m_pTeam || !m_pTeam->GetMemberByID(m_idSelTarget) || m_iBuddyId || IsPassiveMove() ||
|
||||
!m_pTeam || !m_pTeam.GetMemberByID(m_idSelTarget) || m_iBuddyId || IsPassiveMove() ||
|
||||
m_playerLimits.test(PLAYER_LIMIT_NOCHANGESELECT)*/)
|
||||
bRet = false;
|
||||
|
||||
@@ -2655,21 +2542,21 @@ namespace BrewMonster
|
||||
|
||||
// break;
|
||||
|
||||
//case ActionCanDo.CANDO_JUMP:
|
||||
// {
|
||||
// if (IsDead() ||
|
||||
// m_iJumpCount >= MAX_JUMP_COUNT ||
|
||||
// // cannot jump more than one time if shape mode is type2
|
||||
// (IsJumping() && (GetShapeType() == PLAYERMODEL_DUMMYTYPE2)) ||
|
||||
// IsJumpInWater() || m_iMoveEnv == MOVEENV_AIR || IsSitting() ||
|
||||
// IsMeleeing() || IsTrading() || IsUsingTrashBox() || IsTalkingWithNPC() ||
|
||||
// IsChangingFace() || IsReviving() || IsSpellingMagic() || IsPicking() ||
|
||||
// IsGathering() || IsRooting() || GetBoothState() != 0 || m_bHangerOn || (IsJumping() && IsRidingOnPet()) ||
|
||||
// IsOperatingPet() || IsRebuildingPet() || IsUsingItem() || IsPassiveMove() || m_BattleInfo.IsChariotWar())
|
||||
// bRet = false;
|
||||
case ActionCanDo.CANDO_JUMP:
|
||||
{
|
||||
if (IsDead() ||
|
||||
m_iJumpCount >= MAX_JUMP_COUNT ||
|
||||
// cannot jump more than one time if shape mode is type2
|
||||
//(IsJumping() && (GetShapeType() == PLAYERMODEL_DUMMYTYPE2)) ||
|
||||
IsJumpInWater() || m_iMoveEnv == Move_environment.MOVEENV_AIR || IsSitting() ||
|
||||
IsMeleeing() || IsTrading() || IsUsingTrashBox() || IsTalkingWithNPC() ||
|
||||
IsChangingFace() || IsReviving() || IsSpellingMagic() || IsPicking() ||
|
||||
IsGathering() || IsRooting() || GetBoothState() != 0 || m_bHangerOn || /*(IsJumping() && IsRidingOnPet()) ||*/
|
||||
/*IsOperatingPet() || IsRebuildingPet() ||*/ IsUsingItem() || IsPassiveMove() /*|| m_BattleInfo.IsChariotWar()*/)
|
||||
bRet = false;
|
||||
|
||||
// break;
|
||||
// }
|
||||
break;
|
||||
}
|
||||
//case ActionCanDo.CANDO_FOLLOW:
|
||||
// {
|
||||
// if (IsDead() || IsAboutToDie() || IsSitting() || IsMeleeing() || IsReviving() ||
|
||||
@@ -2707,7 +2594,7 @@ namespace BrewMonster
|
||||
// IsMeleeing() || IsTrading() || IsUsingTrashBox() || IsTalkingWithNPC() ||
|
||||
// IsChangingFace() || IsReviving() || IsSpellingMagic() || IsPicking() ||
|
||||
// IsGathering() || IsRooting() || GetBoothState() != 0 ||
|
||||
// !m_pWorkMan->IsStanding() || m_iBuddyId ||
|
||||
// !m_pWorkMan.IsStanding() || m_iBuddyId ||
|
||||
// IsOperatingPet() || IsRebuildingPet() || IsUsingItem() || GetShapeType() == PLAYERMODEL_DUMMYTYPE2 || IsPassiveMove() ||
|
||||
// m_playerLimits.test(PLAYER_LIMIT_NOBIND))
|
||||
// bRet = false;
|
||||
@@ -2756,12 +2643,12 @@ namespace BrewMonster
|
||||
{
|
||||
|
||||
/*bool bForceAttack = false;
|
||||
CECInputCtrl* pInputCtrl = g_pGame->GetGameRun()->GetInputCtrl();
|
||||
CECInputCtrl* pInputCtrl = g_pGame.GetGameRun().GetInputCtrl();
|
||||
|
||||
if (pdwParam)
|
||||
bForceAttack = pInputCtrl->IsCtrlPressed(*pdwParam);
|
||||
bForceAttack = pInputCtrl.IsCtrlPressed(*pdwParam);
|
||||
else
|
||||
bForceAttack = pInputCtrl->KeyIsBeingPressed(VK_CONTROL);
|
||||
bForceAttack = pInputCtrl.KeyIsBeingPressed(VK_CONTROL);
|
||||
|
||||
return bForceAttack;*/
|
||||
return true;
|
||||
@@ -2985,6 +2872,16 @@ namespace BrewMonster
|
||||
}
|
||||
public bool GetPushDir(ref Vector3 vPushDir, uint dwMask, float deltaTime)
|
||||
{
|
||||
Vector3 vRight = Vector3.zero;
|
||||
vRight.x = joystick.Horizontal;
|
||||
vRight.z = joystick.Vertical;
|
||||
vRight.y = 0f;
|
||||
vRight.Normalize();
|
||||
if(vRight == Vector3.zero)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
vPushDir = vRight;
|
||||
/* // reset
|
||||
vPushDir = Vector3.zero;
|
||||
Vector3 vRight = Vector3.zero;
|
||||
@@ -3115,7 +3012,7 @@ namespace BrewMonster
|
||||
void UpdateGFXs(float dwDeltaTime)
|
||||
{
|
||||
// if (m_pLevelUpGFX)
|
||||
// m_pLevelUpGFX->SetParentTM(GetAbsoluteTM());
|
||||
// m_pLevelUpGFX.SetParentTM(GetAbsoluteTM());
|
||||
|
||||
if (m_pHoverGFX)// && m_idCurHover != m_idSelTarget)
|
||||
{
|
||||
@@ -3161,20 +3058,20 @@ namespace BrewMonster
|
||||
|
||||
// if (m_pFloatDust)
|
||||
// {
|
||||
// A3DTerrainWater* pWater = g_pGame->GetGameRun()->GetWorld()->GetTerrainWater();
|
||||
// A3DTerrainWater* pWater = g_pGame.GetGameRun().GetWorld().GetTerrainWater();
|
||||
//
|
||||
// if (pWater->IsUnderWater(m_CameraCoord.GetPos()))
|
||||
// if (pWater.IsUnderWater(m_CameraCoord.GetPos()))
|
||||
// {
|
||||
// if (m_pFloatDust->GetState() == ST_STOP)
|
||||
// if (m_pFloatDust.GetState() == ST_STOP)
|
||||
// {
|
||||
// m_pFloatDust->Start(true);
|
||||
// m_pFloatDust->TickAnimation(2000);
|
||||
// m_pFloatDust.Start(true);
|
||||
// m_pFloatDust.TickAnimation(2000);
|
||||
// }
|
||||
//
|
||||
// m_pFloatDust->SetParentTM(GetAbsoluteTM());
|
||||
// m_pFloatDust.SetParentTM(GetAbsoluteTM());
|
||||
// }
|
||||
// else if (m_pFloatDust->GetState() != ST_STOP)
|
||||
// m_pFloatDust->Stop();
|
||||
// else if (m_pFloatDust.GetState() != ST_STOP)
|
||||
// m_pFloatDust.Stop();
|
||||
// }
|
||||
// UpdateMonsterSpiritGfx(dwDeltaTime);
|
||||
}
|
||||
@@ -3182,16 +3079,16 @@ namespace BrewMonster
|
||||
// Level up
|
||||
public void LevelUp()
|
||||
{
|
||||
// CECGameSession *pSession = g_pGame->GetGameSession();
|
||||
// CECGameSession *pSession = g_pGame.GetGameSession();
|
||||
//
|
||||
// m_BasicProps.iLevel++;
|
||||
// g_pGame->GetGameRun()->AddFixedMessage(FIXMSG_LEVELUP, m_BasicProps.iLevel);
|
||||
// g_pGame.GetGameRun().AddFixedMessage(FIXMSG_LEVELUP, m_BasicProps.iLevel);
|
||||
//
|
||||
// // Get all extend properties
|
||||
// pSession->c2s_CmdGetExtProps();
|
||||
// pSession.c2s_CmdGetExtProps();
|
||||
|
||||
// if (m_pLevelUpGFX)
|
||||
// m_pLevelUpGFX->Start(true);
|
||||
// m_pLevelUpGFX.Start(true);
|
||||
PlayGfx(EC_Resource.res_GFXFile((int)GfxResourceType.RES_GFX_LEVELUP), null, 1f, 1);//PLAYERMODEL_TYPEALL
|
||||
|
||||
// // Popup notify bubble text
|
||||
@@ -3201,29 +3098,29 @@ namespace BrewMonster
|
||||
// ACHAR szInfo[40];
|
||||
// a_sprintf(szInfo, _AL("L%d"), m_BasicProps.iLevel);
|
||||
//
|
||||
// for (int i=0; i < m_pFriendMan->GetGroupNum(); i++)
|
||||
// for (int i=0; i < m_pFriendMan.GetGroupNum(); i++)
|
||||
// {
|
||||
// CECFriendMan::GROUP* pGroup = m_pFriendMan->GetGroupByIndex(i);
|
||||
// for (int j=0; j < pGroup->aFriends.GetSize(); j++)
|
||||
// CECFriendMan::GROUP* pGroup = m_pFriendMan.GetGroupByIndex(i);
|
||||
// for (int j=0; j < pGroup.aFriends.GetSize(); j++)
|
||||
// {
|
||||
// CECFriendMan::FRIEND* pFriend = pGroup->aFriends[j];
|
||||
// if (pFriend->IsGameOnline())
|
||||
// CECFriendMan::FRIEND* pFriend = pGroup.aFriends[j];
|
||||
// if (pFriend.IsGameOnline())
|
||||
// {
|
||||
// pSession->SendPrivateChatData(pFriend->GetName(),
|
||||
// szInfo, GNET::CHANNEL_USERINFO, pFriend->id);
|
||||
// pSession.SendPrivateChatData(pFriend.GetName(),
|
||||
// szInfo, GNET::CHANNEL_USERINFO, pFriend.id);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (GetBasicProps().iLevel==30)
|
||||
// {
|
||||
// CECGameUIMan* pGameUI = g_pGame->GetGameRun()->GetUIManager()->GetInGameUIMan();
|
||||
// pGameUI->AddChatMessage(pGameUI->GetStringFromTable(9638), GP_CHAT_SYSTEM);
|
||||
// CECGameUIMan* pGameUI = g_pGame.GetGameRun().GetUIManager().GetInGameUIMan();
|
||||
// pGameUI.AddChatMessage(pGameUI.GetStringFromTable(9638), GP_CHAT_SYSTEM);
|
||||
// }
|
||||
// if (GetBasicProps().iLevel>31)
|
||||
// {
|
||||
// CECGameUIMan* pGameUI = g_pGame->GetGameRun()->GetUIManager()->GetInGameUIMan();
|
||||
// ((CDlgOnlineAward*)pGameUI->GetDialog("Win_AddExp2"))->RestartWhenLevelup();
|
||||
// CECGameUIMan* pGameUI = g_pGame.GetGameRun().GetUIManager().GetInGameUIMan();
|
||||
// ((CDlgOnlineAward*)pGameUI.GetDialog("Win_AddExp2")).RestartWhenLevelup();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -3348,7 +3245,7 @@ namespace BrewMonster
|
||||
// first of all see if we need to cancel sitdown work.
|
||||
// if (m_pWorkMan.IsSitting())
|
||||
// {
|
||||
// g_pGame->GetGameSession()->c2s_CmdStandUp();
|
||||
// g_pGame.GetGameSession().c2s_CmdStandUp();
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@@ -3375,6 +3272,98 @@ namespace BrewMonster
|
||||
|
||||
return NormalAttackObject(idTarget, bForceAttack, bMoreClose);
|
||||
}
|
||||
|
||||
bool IsJumpInWater() { return m_bJumpInWater; }
|
||||
// Is under water
|
||||
bool IsUnderWater() { return m_iMoveEnv == Move_environment.MOVEENV_WATER ? true : false; }
|
||||
// Can jump or take off in water ?
|
||||
bool CanTakeOffWater()
|
||||
{
|
||||
return true;
|
||||
//A3DVECTOR3 vPos = GetPos();
|
||||
//if (vPos.y < EC_Game.GetGameRun().GetWorld().GetWaterHeight(vPos) - m_MoveConst.fShoreDepth)
|
||||
// return false;
|
||||
//else
|
||||
// return true;
|
||||
}
|
||||
|
||||
bool IsSitting() { return (m_dwStates & PlayerNPCState.GP_STATE_SITDOWN) != 0 ? true : false; }
|
||||
// Is host player open trash box ?
|
||||
bool IsUsingTrashBox() { return m_bUsingTrashBox; }
|
||||
// Is host player talking with NPC ?
|
||||
bool IsTalkingWithNPC() { return m_bTalkWithNPC; }
|
||||
// Is reviving
|
||||
bool IsReviving()
|
||||
{
|
||||
return m_pWorkMan.IsReviving();
|
||||
}
|
||||
// Is spelling magic
|
||||
bool IsSpellingMagic()
|
||||
{
|
||||
return m_pWorkMan.IsSpellingMagic();
|
||||
}
|
||||
// Is picking up something
|
||||
bool IsPicking()
|
||||
{
|
||||
return false;
|
||||
// TODO: fix later
|
||||
//CECHPWork pWork = m_pWorkMan.GetRunningWork(Host_work_ID.WORK_PICKUP);
|
||||
//if (pWork != null)
|
||||
//{
|
||||
// return !(pWork as CECHPWorkPick).IsGather();
|
||||
//}
|
||||
//else
|
||||
// return false;
|
||||
}
|
||||
|
||||
// Is gathering resources
|
||||
bool IsGathering()
|
||||
{
|
||||
return false;
|
||||
// TODO: fix later
|
||||
//CECHPWork pWork = m_pWorkMan.GetRunningWork(Host_work_ID.WORK_PICKUP);
|
||||
//if (pWork != null)
|
||||
// return (pWork as CECHPWorkPick).IsGather();
|
||||
//else
|
||||
// return false;
|
||||
}
|
||||
// Is using item ?
|
||||
bool IsUsingItem()
|
||||
{
|
||||
return m_pWorkMan.IsUsingItem();
|
||||
}
|
||||
bool IsPassiveMove()
|
||||
{
|
||||
return m_pWorkMan.IsPassiveMoving();
|
||||
}
|
||||
void SetJumpInWater(bool b) { m_bJumpInWater = b; }
|
||||
// Is host in sliding state (in the state, host is sliding on slope) ?
|
||||
bool InSlidingState()
|
||||
{
|
||||
if (m_iMoveMode != Move_Mode.MOVE_SLIDE)
|
||||
return false;
|
||||
CECHPWorkStand pWork = (m_pWorkMan.GetRunningWork(Host_work_ID.WORK_STAND) as CECHPWorkStand);
|
||||
if (pWork != null)
|
||||
{
|
||||
if (pWork.GetStopSlideFlag())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SetGroundInfoClient()
|
||||
{
|
||||
isGrounded = GroundCheck(out lastGroundHit);
|
||||
m_GndInfo.bOnGround = isGrounded;
|
||||
}
|
||||
|
||||
public void SetRotationHP(Vector3 dir)
|
||||
{
|
||||
transform.rotation = Quaternion.LookRotation(dir);
|
||||
}
|
||||
}
|
||||
|
||||
public enum StateAnim
|
||||
|
||||
Reference in New Issue
Block a user