fix: update normal atk.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using BrewMonster;
|
||||
using CSNetwork.GPDataType;
|
||||
using ModelRenderer.Scripts.GameData;
|
||||
using PerfectWorld.Scripts.Player;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class EC_Player : MonoBehaviour
|
||||
public abstract class EC_Player : CECObject
|
||||
{
|
||||
private static PLAYER_ACTION[] _default_actions;
|
||||
private static PLAYER_ACTION[] _turning_actions;
|
||||
@@ -18,7 +19,12 @@ public abstract class EC_Player : MonoBehaviour
|
||||
uint m_dwStates; // Player's basic states
|
||||
protected ROLEEXTPROP m_ExtProps; // Extend properties
|
||||
protected float m_fTouchRad = 0.3f; // Touch radius
|
||||
|
||||
protected int m_iBattleCamp = Player_camp_in_battle.GP_BATTLE_CAMP_NONE; // Battle this player belongs to
|
||||
byte m_factionPVPMask; // pvp mask
|
||||
protected ROLEBASICPROP m_BasicProps;
|
||||
public int m_iMoveEnv = Move_environment.MOVEENV_GROUND; // Move environment
|
||||
public bool m_bWalkRun;
|
||||
public A3DAABB m_aabbServer; // Óë·þÎñÆ÷±£³ÖÒ»ÖµÄaabb£¬ ²»ÊÜËõ·ÅÓ°Ïì
|
||||
protected void Awake()
|
||||
{
|
||||
m_PlayerActions = _default_actions;
|
||||
@@ -280,6 +286,99 @@ public abstract class EC_Player : MonoBehaviour
|
||||
}
|
||||
|
||||
public float GetTouchRadius(){ return m_fTouchRad; }
|
||||
// Is player in battle
|
||||
public bool IsInBattle() { return m_iBattleCamp != Player_camp_in_battle.GP_BATTLE_CAMP_NONE; }
|
||||
|
||||
// Check whether specified npc in a same battle camp
|
||||
public bool InSameBattleCamp(CECNPC pNPC)
|
||||
{
|
||||
if (!pNPC || m_iBattleCamp == Player_camp_in_battle.GP_BATTLE_CAMP_NONE ||
|
||||
(m_iBattleCamp == Player_camp_in_battle.GP_BATTLE_CAMP_INVADER && !pNPC.IsInBattleInvaderCamp()) ||
|
||||
(m_iBattleCamp == Player_camp_in_battle.GP_BATTLE_CAMP_DEFENDER && !pNPC.IsInBattleDefenderCamp()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public bool IsInFactionPVP() => (m_factionPVPMask & 0x01) != 0;
|
||||
public bool CanAttackFactionPVPMineCar() => (m_factionPVPMask & 0x02) != 0;
|
||||
public bool CanAttackFactionPVPMineBase() => (m_factionPVPMask & 0x04) != 0;
|
||||
|
||||
// Get basic properties
|
||||
public ROLEBASICPROP GetBasicProps() { return m_BasicProps; }
|
||||
|
||||
public int GetMoveStandAction(bool bMove, bool bFight = false)
|
||||
{
|
||||
int iMoveEnv = m_iMoveEnv;
|
||||
//if (m_AttachMode != enumAttachNone)
|
||||
//{
|
||||
// bFight = false;
|
||||
// if (m_bHangerOn)
|
||||
// iMoveEnv = MOVEENV_GROUND;
|
||||
//}
|
||||
|
||||
int iAction = (int)PLAYER_ACTION_TYPE.ACT_STAND;
|
||||
|
||||
if (bMove)
|
||||
{
|
||||
// Play appropriate actions
|
||||
if (iMoveEnv == (int)MoveEnvironment.MOVEENV_GROUND)
|
||||
{
|
||||
if (m_bWalkRun)
|
||||
iAction = (int)PLAYER_ACTION_TYPE.ACT_RUN;
|
||||
else
|
||||
iAction = (int)PLAYER_ACTION_TYPE.ACT_WALK;
|
||||
}
|
||||
//else if (iMoveEnv == MOVEENV_AIR)
|
||||
//{
|
||||
// //if (/*UsingWing()*/ m_wingType == WINGTYPE_WING)
|
||||
// // iAction = ACT_FLY;
|
||||
// //else
|
||||
// // iAction = ACT_FLY_SWORD;
|
||||
//}
|
||||
//else if (iMoveEnv == MOVEENV_WATER)
|
||||
//{
|
||||
// //if (CanCombineWithMoveForSkill())
|
||||
// //{
|
||||
// // iAction = ACT_SWIM_FOR_MOVESKILL;
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// // iAction = ACT_SWIM;
|
||||
// //}
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Play appropriate actions
|
||||
if (iMoveEnv == (int)MoveEnvironment.MOVEENV_GROUND)
|
||||
{
|
||||
if (bFight)
|
||||
iAction = (int)PLAYER_ACTION_TYPE.ACT_FIGHTSTAND;
|
||||
else
|
||||
iAction = (int)PLAYER_ACTION_TYPE.ACT_STAND;
|
||||
}
|
||||
//else if (iMoveEnv == MOVEENV_AIR)
|
||||
//{
|
||||
// if (/*UsingWing()*/ m_wingType == WINGTYPE_WING)
|
||||
// iAction = ACT_HANGINAIR;
|
||||
// else
|
||||
// iAction = ACT_HANGINAIR_SWORD;
|
||||
//}
|
||||
//else if (iMoveEnv == MOVEENV_WATER)
|
||||
// iAction = ACT_HANGINWATER;
|
||||
}
|
||||
|
||||
return iAction;
|
||||
}
|
||||
|
||||
public float GetGroundSpeed()
|
||||
{
|
||||
// return m_bWalkRun ? g_pGame->GetConfigs()->GetHostRunSpeed() : m_ExtProps.mv.walk_speed;
|
||||
return m_bWalkRun ? m_ExtProps.mv.run_speed : m_ExtProps.mv.walk_speed;
|
||||
}
|
||||
|
||||
// Get move environment
|
||||
public int GetMoveEnv(){ return m_iMoveEnv; }
|
||||
}
|
||||
public struct PlayActionEvent
|
||||
{
|
||||
@@ -301,4 +400,22 @@ public struct INFO
|
||||
this.crc_c = crc_c;
|
||||
this.crc_e = crc_;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static class Duel_state // Duel state
|
||||
{
|
||||
public const int DUEL_ST_NONE = 0,
|
||||
DUEL_ST_PREPARE = 1,
|
||||
DUEL_ST_INDUEL = 2,
|
||||
DUEL_ST_STOPPING = 3;
|
||||
}
|
||||
|
||||
//// 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;
|
||||
//}
|
||||
Reference in New Issue
Block a user