change name file
This commit is contained in:
@@ -4870,7 +4870,7 @@ namespace BrewMonster
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] name; // name
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
|
||||
public uint[] action_mask; // fashion weapon action masks
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
using BrewMonster;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using static CECAttacksMan;
|
||||
|
||||
public class CECAttacksMan : MonoSingleton<CECAttacksMan>
|
||||
{
|
||||
private readonly List<CECAttackEvent> m_AttackList = new List<CECAttackEvent>();
|
||||
|
||||
public CECAttackerEvents FindAttackByAttacker(int idHost)
|
||||
{
|
||||
CECAttackerEvents result = new CECAttackerEvents();
|
||||
|
||||
foreach (var attack in m_AttackList)
|
||||
{
|
||||
if (attack.m_idHost == idHost)
|
||||
{
|
||||
result.Add(attack);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public CECAttackEvent AddMeleeAttack(int idHost, int idTarget, int idWeapon, uint dwModifier, int nDamage, int nTimeFly = 10)
|
||||
{
|
||||
var newEvent = new CECAttackEvent(
|
||||
this,
|
||||
idHost,
|
||||
0, // idCastTarget
|
||||
idTarget,
|
||||
idWeapon,
|
||||
0, // idSkill
|
||||
0, // nSkillLevel
|
||||
dwModifier,
|
||||
nDamage,
|
||||
200, // timeToBeFired
|
||||
nTimeFly // timeToDoDamage
|
||||
);
|
||||
m_AttackList.Add(newEvent);
|
||||
|
||||
newEvent.UpdateTargetFlag();
|
||||
return m_AttackList[m_AttackList.Count - 1];
|
||||
}
|
||||
|
||||
public CECAttackEvent AddSkillAttack(int idHost, int idCastTarget, int idTarget, int idWeapon, int idSkill, int nSkillLevel, uint dwModifier, int nDamage)
|
||||
{
|
||||
var newEvent = new CECAttackEvent(
|
||||
this,
|
||||
idHost,
|
||||
idCastTarget,
|
||||
idTarget,
|
||||
idWeapon,
|
||||
idSkill,
|
||||
nSkillLevel,
|
||||
dwModifier,
|
||||
nDamage,
|
||||
200, // timeToBeFired
|
||||
1000 // timeToDoDamage
|
||||
);
|
||||
m_AttackList.Add(newEvent);
|
||||
|
||||
newEvent.UpdateTargetFlag();
|
||||
return m_AttackList[m_AttackList.Count - 1];
|
||||
}
|
||||
|
||||
// === thêm tạm để code có thể compile ===
|
||||
public void AddAttack(CECAttackEvent evt)
|
||||
{
|
||||
m_AttackList.Add(evt);
|
||||
}
|
||||
public class TARGET_DATA
|
||||
{
|
||||
public int idTarget;
|
||||
public uint dwModifier;
|
||||
public int nDamage;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public class CECAttackEvent
|
||||
{
|
||||
public CECAttacksMan? m_pManager;
|
||||
|
||||
public bool m_bSignaled;
|
||||
public bool m_bDoFired;
|
||||
public bool m_bDoDamaged;
|
||||
public bool m_bFinished;
|
||||
|
||||
public uint m_timeLived;
|
||||
public uint m_timeToBeFired;
|
||||
public uint m_timeToDoDamage;
|
||||
|
||||
public int m_idHost;
|
||||
public int m_idCastTarget;
|
||||
public List<TARGET_DATA> m_targets = new List<TARGET_DATA>();
|
||||
|
||||
public int m_idWeapon;
|
||||
public int m_idSkill;
|
||||
public int m_nSkillLevel;
|
||||
public int m_nSkillSection;
|
||||
|
||||
public CECAttackEvent() { }
|
||||
|
||||
public CECAttackEvent(CECAttacksMan? pManager, int idHost, int idCastTarget, int idTarget,
|
||||
int idWeapon, int idSkill, int nSkillLevel, uint dwModifier,
|
||||
int nDamage, int nTimeToBeFired, int nTimeToDoDamage)
|
||||
{
|
||||
m_pManager = pManager;
|
||||
m_idHost = idHost;
|
||||
m_idCastTarget = idCastTarget;
|
||||
m_idWeapon = idWeapon;
|
||||
m_idSkill = idSkill;
|
||||
m_nSkillLevel = nSkillLevel;
|
||||
m_timeToBeFired = (uint)nTimeToBeFired;
|
||||
m_timeToDoDamage = (uint)nTimeToDoDamage;
|
||||
|
||||
AddTarget(idTarget, dwModifier, nDamage);
|
||||
}
|
||||
|
||||
public bool AddTarget(int idTarget, uint dwModifier, int nDamage)
|
||||
{
|
||||
m_targets.Add(new TARGET_DATA
|
||||
{
|
||||
idTarget = idTarget,
|
||||
dwModifier = dwModifier,
|
||||
nDamage = nDamage
|
||||
});
|
||||
return true;
|
||||
}
|
||||
public bool UpdateTargetFlag()
|
||||
{
|
||||
// update all targets' bAboutToDie flag
|
||||
|
||||
int nNumTargets = m_targets.Count;
|
||||
for (int i = 0; i < nNumTargets; i++)
|
||||
{
|
||||
TARGET_DATA data = m_targets[i];
|
||||
/*
|
||||
if( data.dwModifier & MOD_DEADLYSTRIKE )
|
||||
{
|
||||
int idTarget = data.idTarget;
|
||||
if (ISNPCID(idTarget))
|
||||
{
|
||||
CECNPC* pNPC = g_pGame->GetGameRun()->GetWorld()->GetNPCMan()->GetNPC(idTarget);
|
||||
if (!pNPC)
|
||||
return true;
|
||||
|
||||
pNPC->SetAboutToDie(true);
|
||||
}
|
||||
else if (ISPLAYERID(idTarget))
|
||||
{
|
||||
CECPlayer* pPlayer = g_pGame->GetGameRun()->GetWorld()->GetPlayerMan()->GetPlayer(idTarget);
|
||||
if (!pPlayer)
|
||||
return true;
|
||||
|
||||
pPlayer->SetAboutToDie(true);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public class CECAttackerEvents
|
||||
{
|
||||
private readonly List<CECAttackEvent> m_list = new List<CECAttackEvent>();
|
||||
|
||||
public void Add(CECAttackEvent? evt)
|
||||
{
|
||||
if (evt != null)
|
||||
m_list.Add(evt);
|
||||
}
|
||||
|
||||
public bool IsEmpty() => m_list.Count == 0;
|
||||
public int Count() => m_list.Count;
|
||||
|
||||
public CECAttackEvent? Find(int idSkill = 0, int nSkillSection = 0)
|
||||
{
|
||||
foreach (var evt in m_list)
|
||||
{
|
||||
if (evt.m_idSkill == idSkill && evt.m_nSkillSection == nSkillSection)
|
||||
return evt;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Signal()
|
||||
{
|
||||
foreach (var evt in m_list)
|
||||
evt.m_bSignaled = true;
|
||||
m_list.Clear();
|
||||
}
|
||||
|
||||
public static implicit operator bool(CECAttackerEvents events)
|
||||
{
|
||||
return !events.IsEmpty();
|
||||
}
|
||||
}
|
||||
enum MOD
|
||||
|
||||
{
|
||||
MOD_PHYSIC_ATTACK_RUNE = 0x0001, // ÎïÀí¹¥»÷ÓÅ»¯·ûÉúЧ
|
||||
MOD_MAGIC_ATTACK_RUNE = 0x0002, // ·¨Êõ¹¥»÷ÓÅ»¯·ûÉúЧ
|
||||
MOD_PHYSIC_DEFENCE_RUNE = 0x0004, // ÎïÀí·ÀÓùÓÅ»¯·ûÉúЧ
|
||||
MOD_MAGIC_DEFENCE_RUNE = 0x0008, // ·¨Êõ·ÀÓùÓÅ»¯·ûÉúЧ
|
||||
MOD_CRITICAL_STRIKE = 0x0010, // ±¬»÷
|
||||
MOD_RETORT = 0x0020, // ·´Õð
|
||||
MOD_NULLITY = 0x0040, // ÎÞЧ¹¥»÷
|
||||
MOD_IMMUNE = 0x0080, // ÃâÒßÁ˴˴ι¥»÷£¬ÓÅÏȼ¶¸ßÓÚÎÞЧ
|
||||
MOD_ENCHANT_FAILED = 0x0100, // enchant ʧ°Ü
|
||||
MOD_SUCCESS = 0x0200, // ³É¹¦
|
||||
MOD_DODGE_DAMAGE = 0x0400, // É˺¦¶ãÉÁ
|
||||
MOD_DODGE_DEBUFF = 0x0800, // ״̬¶ãÉÁ
|
||||
MOD_ATTACK_AURA = 0x1000, // ¹â»·¹¥»÷
|
||||
MOD_REBOUND = 0x2000, // ·´µ¯
|
||||
MOD_BEAT_BACK = 0x4000, // ·´»÷
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92009c5b4b0fd894790865cf674545fa
|
||||
@@ -148,7 +148,7 @@ class CECHPWorkMelee : CECHPWork
|
||||
protected virtual void OnFirstTick()
|
||||
{
|
||||
m_pHost.m_iMoveMode = (int)MoveMode.MOVE_STAND;
|
||||
m_pHost.PlayAction((int)EC_Player.PLAYER_ACTION_TYPE.ACT_ATTACK_1 + Random.Range(0, 3), true, 200, false);
|
||||
m_pHost.PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_ATTACK_1 + Random.Range(0, 3), true, 200, false);
|
||||
|
||||
m_idTarget = m_pHost.m_idSelTarget;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public abstract class CECTracedObject
|
||||
}
|
||||
else
|
||||
{
|
||||
EC_Player pPlayer = pObject.GetComponent<CECHostPlayer>();
|
||||
CECPlayer pPlayer = pObject.GetComponent<CECHostPlayer>();
|
||||
fTouchRadius = pPlayer.GetTouchRadius();
|
||||
}
|
||||
return m_pHost.CanTouchTarget(vHostPos, vTargetPos, fTouchRadius, iTouchReason, fMaxCut);
|
||||
@@ -384,7 +384,7 @@ public class CECTracedPlayer : CECTracedObject
|
||||
{
|
||||
return true;
|
||||
}
|
||||
EC_Player pPlayer = GetTargetObject() as EC_Player;
|
||||
CECPlayer pPlayer = GetTargetObject() as CECPlayer;
|
||||
if (pPlayer.IsElsePlayer())
|
||||
{
|
||||
if (pPlayer.IsDead())
|
||||
@@ -612,10 +612,10 @@ public class CECHPWorkTrace : CECHPWork
|
||||
{
|
||||
// Continue tracing object
|
||||
float fDeltaTime = dwDeltaTime /** 0.001f*/;
|
||||
if (m_pHost.m_iMoveEnv == EC_Player.Move_environment.MOVEENV_GROUND)
|
||||
if (m_pHost.m_iMoveEnv == CECPlayer.Move_environment.MOVEENV_GROUND)
|
||||
{
|
||||
// Play appropriate actions
|
||||
if (!m_pHost.IsJumping() && !m_pHost.IsPlayingAction((int)EC_Player.PLAYER_ACTION_TYPE.ACT_TRICK_RUN) &&
|
||||
if (!m_pHost.IsJumping() && !m_pHost.IsPlayingAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_TRICK_RUN) &&
|
||||
m_pHost.m_iMoveMode != (int)MoveMode.MOVE_SLIDE)
|
||||
{
|
||||
int iAction = m_pHost.GetMoveStandAction(true);
|
||||
@@ -807,7 +807,7 @@ public class CECHPWorkTrace : CECHPWork
|
||||
|
||||
if (m_pHost.m_iMoveMode == (int)MoveMode.MOVE_SLIDE)
|
||||
{
|
||||
m_pHost.PlayAction((int)EC_Player.PLAYER_ACTION_TYPE.ACT_JUMP_LOOP, false, 200, false);
|
||||
m_pHost.PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_JUMP_LOOP, false, 200, false);
|
||||
|
||||
// This will cause stop moming after we slide down.
|
||||
A3DVECTOR3 vDir = vTargetPos - vCurPos;
|
||||
|
||||
@@ -470,7 +470,7 @@ namespace PerfectWorld.Scripts.Managers
|
||||
}
|
||||
|
||||
// Get a player (may be host or else player) by id
|
||||
public EC_Player GetPlayer(int cid, uint dwBornStamp = 0)
|
||||
public CECPlayer GetPlayer(int cid, uint dwBornStamp = 0)
|
||||
{
|
||||
CECHostPlayer pHost = GetHostPlayer();
|
||||
if (pHost && pHost.GetCharacterID() == cid)
|
||||
|
||||
@@ -185,7 +185,7 @@ public class CECObject : MonoBehaviour
|
||||
return 0;
|
||||
|
||||
if (pObject.IsPlayer())
|
||||
return ((EC_Player)pObject).GetCharacterID();
|
||||
return ((CECPlayer)pObject).GetCharacterID();
|
||||
else if (pObject.IsNPC())
|
||||
return ((CECNPC)pObject).GetNPCID();
|
||||
//else if (pObject.IsMatter())
|
||||
|
||||
@@ -85,7 +85,7 @@ public class CECHostMove
|
||||
float fSpeed = 0f;
|
||||
switch (m_pHost.GetMoveEnv())
|
||||
{
|
||||
case EC_Player.Move_environment.MOVEENV_AIR:
|
||||
case CECPlayer.Move_environment.MOVEENV_AIR:
|
||||
|
||||
iMoveMode |= (int)GPMoveMode.GP_MOVE_AIR;
|
||||
fSpeed = m_pHost.GetFlySpeed();
|
||||
|
||||
@@ -5,9 +5,10 @@ using PerfectWorld.Scripts.Managers;
|
||||
using PerfectWorld.Scripts.Player;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class EC_Player : CECObject
|
||||
public abstract class CECPlayer : CECObject
|
||||
{
|
||||
private static PLAYER_ACTION[] _default_actions;
|
||||
private static PLAYER_ACTION[] _turning_actions;
|
||||
@@ -29,6 +30,12 @@ public abstract class EC_Player : CECObject
|
||||
public int m_iMoveEnv = Move_environment.MOVEENV_GROUND; // Move environment
|
||||
public bool m_bWalkRun;
|
||||
public A3DAABB m_aabbServer; // Óë·þÎñÆ÷±£³ÖÒ»ÖµÄaabb£¬ ²»ÊÜËõ·ÅÓ°Ïì
|
||||
|
||||
|
||||
const int NUM_WEAPON_TYPE = 15;
|
||||
|
||||
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
m_PlayerActions = _default_actions;
|
||||
@@ -52,12 +59,9 @@ public abstract class EC_Player : CECObject
|
||||
public bool IsDead() { return (m_dwStates & PlayerNPCState.GP_STATE_CORPSE) != 0; }
|
||||
|
||||
public bool IsValidAction(int iIndex) { return (iIndex >= 0 && iIndex < (int)PLAYER_ACTION_TYPE.ACT_MAX) ? true : false; }
|
||||
<<<<<<<< HEAD:Assets/PerfectWorld/Scripts/Move/CECPlayer.cs
|
||||
public int GetCharacterID() { return m_PlayerInfo.cid; }
|
||||
|
||||
|
||||
========
|
||||
>>>>>>>> origin/develop:Assets/PerfectWorld/Scripts/Move/EC_Player.cs
|
||||
private static void BuildActionList()
|
||||
{
|
||||
if (_default_actions == null)
|
||||
@@ -297,7 +301,288 @@ public abstract class EC_Player : CECObject
|
||||
ACT_MAX,
|
||||
ACT_CASTSKILL // Chỉ là placeholder cho skill actions
|
||||
}
|
||||
/* public void PlayAttackEffect(int idTarget, int idSkill, int skillLevel, int nDamage,
|
||||
uint dwModifier, int nAttackSpeed, ref int piAttackTime*//* NULL *//*, int nSection = 0)
|
||||
{
|
||||
if (!IsAllResReady())
|
||||
return;
|
||||
|
||||
if (idSkill == 0)
|
||||
{
|
||||
int idWeapon = IsShapeChanged() ? 0 : GetWeaponID();
|
||||
|
||||
int nTimeFly = 10;
|
||||
if (idWeapon != 0)
|
||||
{
|
||||
// ¿´¿´ÊDz»ÊÇÔ¶³ÌÎäÆ÷
|
||||
DATA_TYPE dt = default;
|
||||
WEAPON_ESSENCE? pWeapon = (WEAPON_ESSENCE)ElementDataManProvider.GetElementDataMan().get_data_ptr((uint)idWeapon, ID_SPACE.ID_SPACE_ESSENCE, ref dt);
|
||||
|
||||
if (dt == DATA_TYPE.DT_WEAPON_ESSENCE && pWeapon != null && pWeapon.Value.require_projectile != 0)
|
||||
{
|
||||
nTimeFly = 700;
|
||||
|
||||
if (m_aEquips[(int)EC_IvtrType.IndexOfIteminEquipmentInventory.EQUIPIVTR_PROJECTILE] != 0)
|
||||
idWeapon = m_aEquips[(int)EC_IvtrType.IndexOfIteminEquipmentInventory.EQUIPIVTR_PROJECTILE];
|
||||
}
|
||||
}
|
||||
|
||||
if (CECAttacksMan.Instance.FindAttackByAttacker(GetPlayerInfo().cid))
|
||||
{
|
||||
// Unity animation làm hộ r
|
||||
//ClearComActFlagAllRankNodes(true);
|
||||
}
|
||||
|
||||
// melee attack
|
||||
CECAttackEvent pAttack = CECAttacksMan.Instance.AddMeleeAttack(
|
||||
GetPlayerInfo().cid, idTarget, idWeapon, dwModifier, nDamage, nTimeFly);
|
||||
|
||||
if (pAttack != null)
|
||||
{
|
||||
if (!IsDead() && (dwModifier & (uint)MOD.MOD_RETORT) == 0
|
||||
&& (dwModifier & (uint)MOD.MOD_ATTACK_AURA) == 0
|
||||
&& PlayAttackAction(nAttackSpeed, piAttackTime, pAttack.m_bSignaled)
|
||||
&& (dwModifier & (uint)MOD.MOD_BEAT_BACK) == 0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
pAttack.m_bSignaled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (skillLevel == 0)
|
||||
{
|
||||
if (m_pCurSkill)
|
||||
skillLevel = m_pCurSkill->GetSkillLevel();
|
||||
else
|
||||
skillLevel = 1;
|
||||
}
|
||||
|
||||
CECAttackEvent* pAttack = NULL;
|
||||
|
||||
// first try to find if there is already a skill attack event in attackman
|
||||
CECAttackerEvents attackerEvents = g_pGame->GetGameRun()->GetWorld()->GetAttacksMan()->FindAttackByAttacker(GetPlayerInfo().cid);
|
||||
if (attackerEvents)
|
||||
{
|
||||
if (CECAttackEvent * pAttack = attackerEvents.Find(idSkill, nSection))
|
||||
{
|
||||
// Ãæ¹¥»÷µÄ·ÇµÚÒ»´ÎÉ˺¦ÏûÏ¢
|
||||
pAttack->AddTarget(idTarget, dwModifier, nDamage);
|
||||
goto EXIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
attackerEvents.Signal();
|
||||
}
|
||||
}
|
||||
if (GNET::ElementSkill::IsGoblinSkill(idSkill) &&
|
||||
GNET::ElementSkill::GetType(idSkill) == 2)
|
||||
{
|
||||
pAttack = g_pGame->GetGameRun()->GetWorld()->GetAttacksMan()->AddSkillAttack(
|
||||
GetPlayerInfo().cid, GetPlayerInfo().cid, idTarget, GetWeaponID(), idSkill, skillLevel, dwModifier, nDamage);
|
||||
}
|
||||
else
|
||||
{
|
||||
// begin a skill attack
|
||||
pAttack = g_pGame->GetGameRun()->GetWorld()->GetAttacksMan()->AddSkillAttack(
|
||||
GetPlayerInfo().cid, m_idCurSkillTarget, idTarget, GetWeaponID(), idSkill, skillLevel, dwModifier, nDamage);
|
||||
}
|
||||
|
||||
if (pAttack)
|
||||
{
|
||||
pAttack->SetSkillSection(nSection);
|
||||
if (!IsDead() && (dwModifier & CECAttackEvent::MOD_RETORT) == 0
|
||||
&& (dwModifier & CECAttackEvent::MOD_ATTACK_AURA) == 0
|
||||
&& PlaySkillAttackAction(idSkill, nAttackSpeed, NULL, nSection, &pAttack->m_bSignaled)
|
||||
&& (dwModifier & CECAttackEvent::MOD_BEAT_BACK) == 0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
pAttack->m_bSignaled = true;
|
||||
}
|
||||
}
|
||||
|
||||
EXIT:
|
||||
// For skill attacking, time is always set to 0
|
||||
if (piAttackTime)
|
||||
*piAttackTime = 0;
|
||||
}
|
||||
}
|
||||
public bool PlayAttackAction(int nAttackSpeed, out int attackTime, ref bool? pActFlag)
|
||||
{
|
||||
attackTime = 0;
|
||||
|
||||
if (m_pPlayerModel == null)
|
||||
return false;
|
||||
|
||||
int nRand = UnityEngine.Random.Range(0, 4);
|
||||
string szAct = string.Empty;
|
||||
|
||||
int weapon_type = GetShowingWeaponType();
|
||||
|
||||
int nTime1, nTime2;
|
||||
int iAction = ACT_ATTACK_1 + nRand;
|
||||
PLAYER_ACTION action = m_PlayerActions[iAction];
|
||||
|
||||
if (action.data == null || string.IsNullOrEmpty(action.data.action_prefix))
|
||||
return false;
|
||||
|
||||
ShowWeaponByConfig(action.data);
|
||||
|
||||
var pRightHandWeapon = GetRightHandWeapon();
|
||||
bool bHideFX = !CECOptimize.Instance.GFX.CanShowAttack(GetCharacterID(), GetClassID());
|
||||
|
||||
// ==============================
|
||||
// Ground Attack
|
||||
// ==============================
|
||||
if (GetMoveEnv() == MOVEENV_GROUND)
|
||||
{
|
||||
// “起” 动作(挥起)
|
||||
szAct = $"{action.data.action_prefix}_{action.data.action_weapon_suffix[weapon_type].suffix}Æð";
|
||||
PlayNonSkillActionWithName(iAction, szAct, true, 200, bHideFX, ref pActFlag, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);
|
||||
|
||||
if (pRightHandWeapon != null && IsUsingMagicWeapon())
|
||||
pRightHandWeapon.PlayActionByName(_GenWeaponActionName(szAct, m_iGender), 1.0f, true, 200, true, iAction, bHideFX);
|
||||
|
||||
nTime1 = m_pPlayerModel.GetComActTimeSpanByName(szAct);
|
||||
|
||||
// “收” 动作(挥下)
|
||||
szAct = $"{action.data.action_prefix}_{action.data.action_weapon_suffix[weapon_type].suffix}Âä";
|
||||
QueueNonSkillActionWithName(iAction, szAct, 0, false, bHideFX);
|
||||
|
||||
if (pRightHandWeapon != null && IsUsingMagicWeapon())
|
||||
pRightHandWeapon.QueueAction(_GenWeaponActionName(szAct, m_iGender), 0, iAction, false, false, bHideFX);
|
||||
|
||||
nTime2 = m_pPlayerModel.GetComActTimeSpanByName(szAct);
|
||||
}
|
||||
// ==============================
|
||||
// Air Attack
|
||||
// ==============================
|
||||
else
|
||||
{
|
||||
string szActionMiddleName;
|
||||
|
||||
if ((m_wingType == WINGTYPE_WING && IsFlying()) ||
|
||||
GetProfession() == PROF_ANGEL ||
|
||||
GetProfession() == PROF_ARCHOR ||
|
||||
GetProfession() == PROF_MONK ||
|
||||
GetProfession() == PROF_GHOST)
|
||||
{
|
||||
szActionMiddleName = "¿ÕÖгá°ò"; // tấn công trên không
|
||||
}
|
||||
else
|
||||
{
|
||||
szActionMiddleName = "¿ÕÖзɽ£"; // rơi xuống hoặc bay
|
||||
}
|
||||
|
||||
szAct = $"{action.data.action_prefix}_{szActionMiddleName}_{action.data.action_weapon_suffix[weapon_type].suffix}Æð";
|
||||
PlayNonSkillActionWithName(iAction, szAct, true, 200, bHideFX, ref pActFlag, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);
|
||||
|
||||
if (pRightHandWeapon != null && IsUsingMagicWeapon())
|
||||
pRightHandWeapon.PlayActionByName(_GenWeaponActionName(szAct, m_iGender), 1.0f, true, 200, true, iAction, bHideFX);
|
||||
|
||||
nTime1 = m_pPlayerModel.GetComActTimeSpanByName(szAct);
|
||||
|
||||
szAct = $"{action.data.action_prefix}_{szActionMiddleName}_{action.data.action_weapon_suffix[weapon_type].suffix}Âä";
|
||||
QueueNonSkillActionWithName(iAction, szAct, 0, false, bHideFX);
|
||||
|
||||
if (pRightHandWeapon != null && IsUsingMagicWeapon())
|
||||
pRightHandWeapon.QueueAction(_GenWeaponActionName(szAct, m_iGender), 0, iAction, false, false, bHideFX);
|
||||
|
||||
nTime2 = m_pPlayerModel.GetComActTimeSpanByName(szAct);
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Kết thúc bằng FightStand
|
||||
// ==============================
|
||||
PLAYER_ACTION stand_action = m_PlayerActions[ACT_FIGHTSTAND];
|
||||
szAct = $"{stand_action.data.action_prefix}_{stand_action.data.action_weapon_suffix[weapon_type].suffix}";
|
||||
|
||||
QueueNonSkillActionWithName(ACT_FIGHTSTAND, szAct, 300, false, bHideFX, true);
|
||||
|
||||
if (pRightHandWeapon != null && IsUsingMagicWeapon())
|
||||
pRightHandWeapon.QueueAction(_GenWeaponActionName(szAct, m_iGender), 300, iAction, false, false, bHideFX, true);
|
||||
|
||||
// ==============================
|
||||
// Điều chỉnh tốc độ phát animation theo tốc độ tấn công
|
||||
// ==============================
|
||||
if (nAttackSpeed > 0)
|
||||
{
|
||||
float vScale = (nTime1 + nTime2) / (float)nAttackSpeed;
|
||||
if (vScale > 0f)
|
||||
{
|
||||
m_pPlayerModel.SetPlaySpeed(vScale);
|
||||
|
||||
if (pRightHandWeapon != null && IsUsingMagicWeapon())
|
||||
pRightHandWeapon.SetPlaySpeed(vScale);
|
||||
}
|
||||
}
|
||||
|
||||
attackTime = nTime1 + nTime2;
|
||||
|
||||
// ==============================
|
||||
// Cập nhật vị trí weapon hanger (vũ khí)
|
||||
// ==============================
|
||||
UpdateWeaponHangerPosByAction(iAction);
|
||||
|
||||
return true;
|
||||
}
|
||||
public int GetShowingWeaponType()
|
||||
{
|
||||
int weapon_type = 0;
|
||||
if (CanShowFashionWeapon(m_uAttackType, m_iFashionWeaponType) && m_aEquips[EQUIPIVTR_FASHION_WEAPON] != 0)
|
||||
{
|
||||
weapon_type = (m_iFashionWeaponType == DEFAULT_ACTION_TYPE || !IsWeaponAttached()) ?
|
||||
10 : m_iFashionWeaponType;
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon_type = (m_uAttackType == DEFAULT_ACTION_TYPE || !IsWeaponAttached()) ?
|
||||
10 : m_uAttackType;
|
||||
}
|
||||
return weapon_type;
|
||||
}
|
||||
public bool CanShowFashionWeapon(int weapon_type, int fashion_weapon_type)
|
||||
{
|
||||
return IsFashionWeaponTypeFit(weapon_type, fashion_weapon_type) && InFashionMode();
|
||||
}
|
||||
public bool IsFashionWeaponTypeFit(int weapon_type, int fashion_weapon_type)
|
||||
{
|
||||
if (fashion_weapon_type < 0 || fashion_weapon_type >= NUM_WEAPON_TYPE) return false;
|
||||
FASHION_WEAPON_CONFIG? pConfig = GetFashionConfig();
|
||||
if (null == pConfig)
|
||||
{
|
||||
BMLogger.LogError("CECPlayer::GetFashionConfig, Failed to load fashion weapon config");
|
||||
return false;
|
||||
}
|
||||
int fashion_weapon_mask = (int)pConfig.Value.action_mask[fashion_weapon_type];
|
||||
return (fashion_weapon_mask & (1 << GetWeaponType(weapon_type))) != 0;
|
||||
}
|
||||
public FASHION_WEAPON_CONFIG GetFashionConfig()
|
||||
{
|
||||
FASHION_WEAPON_CONFIG? pFashionConfig = null;
|
||||
if (null == pFashionConfig)
|
||||
{
|
||||
elementdataman pDataMan = ElementDataManProvider.GetElementDataMan();
|
||||
DATA_TYPE DataType;
|
||||
uint tid = pDataMan.get_first_data_id(ID_SPACE_CONFIG, DataType);
|
||||
|
||||
while (tid)
|
||||
{
|
||||
if (DataType == DT_FASHION_WEAPON_CONFIG)
|
||||
{
|
||||
pFashionConfig = (FASHION_WEAPON_CONFIG*)pDataMan->get_data_ptr(tid, ID_SPACE_CONFIG, DataType);
|
||||
break;
|
||||
}
|
||||
tid = pDataMan->get_next_data_id(ID_SPACE_CONFIG, DataType);
|
||||
}
|
||||
}
|
||||
return pFashionConfig;
|
||||
}*/
|
||||
public float GetTouchRadius() { return m_fTouchRad; }
|
||||
// Is player in battle
|
||||
public bool IsInBattle() { return m_iBattleCamp != Player_camp_in_battle.GP_BATTLE_CAMP_NONE; }
|
||||
@@ -391,16 +676,11 @@ public abstract class EC_Player : CECObject
|
||||
}
|
||||
|
||||
// Get move environment
|
||||
<<<<<<<< HEAD:Assets/PerfectWorld/Scripts/Move/CECPlayer.cs
|
||||
public int GetMoveEnv() { return m_iMoveEnv; }
|
||||
public bool IsShapeChanged() { return m_iShape != 0; }
|
||||
public int GetWeaponID() { return m_aEquips[(int)EC_IvtrType.IndexOfIteminEquipmentInventory.EQUIPIVTR_WEAPON] & 0xffff; }
|
||||
public bool IsAllResReady() { return (m_dwResFlags & (uint)PlayerResourcesReadyFlag.RESFG_ALL) == (uint)PlayerResourcesReadyFlag.RESFG_ALL; }
|
||||
========
|
||||
public int GetMoveEnv(){ return m_iMoveEnv; }
|
||||
// Get character ID
|
||||
public int GetCharacterID(){ return m_PlayerInfo.cid; }
|
||||
>>>>>>>> origin/develop:Assets/PerfectWorld/Scripts/Move/EC_Player.cs
|
||||
}
|
||||
public struct PlayActionEvent
|
||||
{
|
||||
|
||||
@@ -74,8 +74,8 @@ namespace BrewMonster
|
||||
if (!(pObject = EC_ManPlayer.GetPlayer(idObject)))
|
||||
return null;
|
||||
|
||||
if ((iAliveFlag == 1 && (pObject as EC_Player).IsDead()) ||
|
||||
(iAliveFlag == 2 && !(pObject as EC_Player).IsDead()))
|
||||
if ((iAliveFlag == 1 && (pObject as CECPlayer).IsDead()) ||
|
||||
(iAliveFlag == 2 && !(pObject as CECPlayer).IsDead()))
|
||||
return null;
|
||||
}
|
||||
//else if (GPDataTypeHelper.ISMATTERID(idObject))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using UnityEngine;
|
||||
using static EC_Player;
|
||||
using static CECPlayer;
|
||||
|
||||
public class PlayerIdleState : PlayerState
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using UnityEngine;
|
||||
using static EC_Player;
|
||||
using static CECPlayer;
|
||||
|
||||
public class PlayerMoveState : PlayerState
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using UnityEngine;
|
||||
|
||||
namespace PerfectWorld.Scripts.Player
|
||||
{
|
||||
public class EC_ElsePlayer : EC_Player
|
||||
public class EC_ElsePlayer : CECPlayer
|
||||
{
|
||||
A3DVECTOR3 m_vMoveDir; // Player's velocity
|
||||
A3DVECTOR3 m_vServerPos; // Player's real position on server
|
||||
|
||||
@@ -21,7 +21,7 @@ using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using Scene = UnityEngine.SceneManagement.Scene;
|
||||
|
||||
public class CECHostPlayer : EC_Player
|
||||
public class CECHostPlayer : CECPlayer
|
||||
{
|
||||
[SerializeField] private TextMeshPro txtName;
|
||||
[SerializeField] private CharacterController controller;
|
||||
|
||||
@@ -4,7 +4,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using static EC_Player;
|
||||
using static CECPlayer;
|
||||
|
||||
public static class EC_Utility
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GameController : MonoBehaviour
|
||||
Debug.LogError("null prefab");
|
||||
return;
|
||||
}
|
||||
EC_Player.InitStaticRes();
|
||||
CECPlayer.InitStaticRes();
|
||||
hostPlayer = Instantiate(characterPrefab, transform);
|
||||
hostPlayer.InitCharacter(info);
|
||||
cinemachineCamera.Follow = hostPlayer.transform;
|
||||
|
||||
@@ -5,11 +5,11 @@ public class InitializePlayer /*: IAutoInitialize*/
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
EC_Player.Dispose();
|
||||
CECPlayer.Dispose();
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
EC_Player.InitStaticRes();
|
||||
CECPlayer.InitStaticRes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PlayerVisual : MonoBehaviour
|
||||
BrewMonster.BMLogger.LogError("animancer == null");
|
||||
return;
|
||||
}
|
||||
var player = GetComponentInParent<EC_Player>();
|
||||
var player = GetComponentInParent<CECPlayer>();
|
||||
if(player == null)
|
||||
{
|
||||
BrewMonster.BMLogger.LogError("player == null");
|
||||
|
||||
Reference in New Issue
Block a user