summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-02-07 19:13:54 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-02-07 19:13:54 +0100
commit2cad49940e96b53adac413f66dcbc690774dba44 (patch)
treeae0db84a67c5612f6842edfecd8eea4060352b0d /src/peds
parentUse original animation names from VCS (diff)
downloadre3-2cad49940e96b53adac413f66dcbc690774dba44.tar
re3-2cad49940e96b53adac413f66dcbc690774dba44.tar.gz
re3-2cad49940e96b53adac413f66dcbc690774dba44.tar.bz2
re3-2cad49940e96b53adac413f66dcbc690774dba44.tar.lz
re3-2cad49940e96b53adac413f66dcbc690774dba44.tar.xz
re3-2cad49940e96b53adac413f66dcbc690774dba44.tar.zst
re3-2cad49940e96b53adac413f66dcbc690774dba44.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp4
-rw-r--r--src/peds/Ped.h24
-rw-r--r--src/peds/PedFight.cpp50
-rw-r--r--src/peds/PlayerPed.cpp4
4 files changed, 41 insertions, 41 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index de474f38..1484d578 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -617,7 +617,7 @@ CPed::SetMoveAnim(void)
if (!animAssoc) {
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!animAssoc)
- animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2);
+ animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (animAssoc && m_nPedState == PED_FIGHT)
return;
@@ -1433,7 +1433,7 @@ CPed::CalculateNewVelocity(void)
fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED);
if(!fightAssoc)
- fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2);
+ fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc && !bIsDucking) {
LimbOrientation newUpperLegs;
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index ac776469..ec6574de 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -1015,16 +1015,16 @@ public:
static AnimationId Get3rdFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_COP3_RD))
- return ANIM_ATTACK_3;
+ return ANIM_WEAPON_FIRE_3RD;
else
return (AnimationId)0;
}
static AnimationId GetFireAnimGround(CWeaponInfo* weapon, bool kickFloorIfNone = true) {
if (weapon->IsFlagSet(WEAPONFLAG_GROUND_2ND))
- return ANIM_ATTACK_2;
+ return ANIM_WEAPON_CROUCHFIRE;
else if (weapon->IsFlagSet(WEAPONFLAG_GROUND_3RD))
- return ANIM_ATTACK_3;
+ return ANIM_WEAPON_FIRE_3RD;
else if (kickFloorIfNone)
return ANIM_STD_KICKGROUND;
else
@@ -1035,54 +1035,54 @@ public:
if (weapon->IsFlagSet(WEAPONFLAG_ANIMDETONATE))
return ANIM_STD_DETONATE;
else
- return ANIM_ATTACK_1;
+ return ANIM_WEAPON_FIRE;
}
static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
- return ANIM_ATTACK_EXTRA2;
+ return ANIM_WEAPON_CROUCHRELOAD;
else
return (AnimationId)0;
}
static AnimationId GetCrouchFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_CROUCHFIRE))
- return ANIM_ATTACK_2;
+ return ANIM_WEAPON_CROUCHFIRE;
else
return (AnimationId)0;
}
static AnimationId GetReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
- return ANIM_ATTACK_EXTRA1;
+ return ANIM_WEAPON_RELOAD;
else
return (AnimationId)0;
}
static AnimationId GetFightIdleWithMeleeAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_FIGHTMODE))
- return ANIM_ATTACK_EXTRA2;
+ return ANIM_MELEE_IDLE_FIGHTMODE;
else
return (AnimationId)0;
}
static AnimationId GetFinishingAttackAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_FINISH_3RD))
- return ANIM_ATTACK_3;
+ return ANIM_MELEE_ATTACK_FINISH;
else
return (AnimationId)0;
}
static AnimationId GetSecondFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_USE_2ND))
- return ANIM_ATTACK_2; // or ANIM_MELEE_ATTACK_2ND
+ return ANIM_WEAPON_FIRE_2ND;
else
return (AnimationId)0;
}
static AnimationId GetMeleeStartAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_PARTIALATTACK))
- return ANIM_ATTACK_EXTRA1;
+ return ANIM_MELEE_ATTACK_START;
else
return (AnimationId)0;
}
@@ -1090,7 +1090,7 @@ public:
static AnimationId GetThrowAnim(CWeaponInfo *weapon)
{
if (weapon->IsFlagSet(WEAPONFLAG_THROW))
- return ANIM_ATTACK_EXTRA1;
+ return ANIM_THROWABLE_START_THROW;
else
return (AnimationId)0;
}
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp
index 66c71927..79e01211 100644
--- a/src/peds/PedFight.cpp
+++ b/src/peds/PedFight.cpp
@@ -182,14 +182,14 @@ CPed::SetPointGunAt(CEntity *to)
if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) {
aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(curWeapon));
} else {
- aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
+ aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
}
if (!aimAssoc || aimAssoc->blendDelta < 0.0f) {
if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) {
aimAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, GetCrouchFireAnim(curWeapon), 4.0f);
} else {
- aimAssoc = CAnimManager::AddAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_ATTACK_1);
+ aimAssoc = CAnimManager::AddAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_WEAPON_FIRE);
}
aimAssoc->blendAmount = 0.0f;
@@ -204,7 +204,7 @@ CPed::PointGunAt(void)
{
CWeaponInfo *weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
float animLoopStart = weaponInfo->m_fAnimLoopStart;
- CAnimBlendAssociation *weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
+ CAnimBlendAssociation *weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
if (!weaponAssoc || weaponAssoc->blendDelta < 0.0f) {
if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) {
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo));
@@ -240,7 +240,7 @@ CPed::ClearPointGunAt(void)
RestorePreviousState();
}
weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
- animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
+ animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
if (!animAssoc || animAssoc->blendDelta < 0.0f) {
if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) {
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo));
@@ -284,7 +284,7 @@ CPed::SetAttack(CEntity *victim)
SetPedState(PED_ATTACK);
bIsAttacking = false;
- CAnimBlendAssociation *animAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_ATTACK_EXTRA1, 8.0f);
+ CAnimBlendAssociation *animAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_MELEE_ATTACK_START, 8.0f);
animAssoc->SetRun();
if (animAssoc->currentTime == animAssoc->hierarchy->totalLength)
animAssoc->SetCurrentTime(0.0f);
@@ -304,7 +304,7 @@ CPed::SetAttack(CEntity *victim)
if (m_nPedState != PED_ATTACK) {
SetPedState(PED_ATTACK);
bIsAttacking = false;
- CAnimBlendAssociation* animAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_ATTACK_EXTRA1, 8.0f);
+ CAnimBlendAssociation* animAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, ANIM_MELEE_ATTACK_START, 8.0f);
animAssoc->SetRun();
if (animAssoc->currentTime == animAssoc->hierarchy->totalLength)
animAssoc->SetCurrentTime(0.0f);
@@ -397,7 +397,7 @@ CPed::SetAttack(CEntity *victim)
AnimationId fireAnim;
if (curWeapon->IsFlagSet(WEAPONFLAG_THROW))
- fireAnim = ANIM_ATTACK_EXTRA1;
+ fireAnim = ANIM_THROWABLE_START_THROW;
else if (CGame::nastyGame && (curWeapon->IsFlagSet(WEAPONFLAG_GROUND_2ND) || curWeapon->IsFlagSet(WEAPONFLAG_GROUND_3RD))) {
PedOnGroundState pedOnGround = CheckForPedsOnGroundToAttack(this, nil);
if (pedOnGround > PED_IN_FRONT_OF_ATTACKER || pedOnGround == NO_PED && bIsStanding && m_pCurSurface && m_pCurSurface->IsVehicle()) {
@@ -509,13 +509,13 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
}
}
}
- } else if (attackAssoc && attackAssoc->animId == ANIM_ATTACK_EXTRA1 && currentWeapon->m_AnimToPlay == ASSOCGRP_THROW) {
+ } else if (attackAssoc && attackAssoc->animId == ANIM_THROWABLE_START_THROW && currentWeapon->m_AnimToPlay == ASSOCGRP_THROW) {
if ((!ped->IsPlayer() || ((CPlayerPed*)ped)->m_bHaveTargetSelected) && ped->IsPlayer()) {
attackAssoc->blendDelta = -1000.0f;
- newAnim = CAnimManager::AddAnimation(ped->GetClump(), currentWeapon->m_AnimToPlay, ANIM_ATTACK_2);
+ newAnim = CAnimManager::AddAnimation(ped->GetClump(), currentWeapon->m_AnimToPlay, ANIM_THROWABLE_THROWU);
} else {
attackAssoc->blendDelta = -1000.0;
- newAnim = CAnimManager::AddAnimation(ped->GetClump(), currentWeapon->m_AnimToPlay, ANIM_ATTACK_1);
+ newAnim = CAnimManager::AddAnimation(ped->GetClump(), currentWeapon->m_AnimToPlay, ANIM_THROWABLE_THROW);
}
newAnim->SetFinishCallback(FinishedAttackCB, ped);
@@ -538,17 +538,17 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
AnimationId groundAnim = GetFireAnimGround(currentWeapon);
CAnimBlendAssociation *groundAnimAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), groundAnim);
if (!(groundAnimAssoc && (groundAnimAssoc->blendAmount > 0.95f || groundAnimAssoc->blendDelta > 0.0f))) {
- if (attackAssoc && attackAssoc->animId == ANIM_ATTACK_1) {
+ if (attackAssoc && attackAssoc->animId == ANIM_MELEE_ATTACK) {
newAnim = CAnimManager::BlendAnimation(
ped->GetClump(), currentWeapon->m_AnimToPlay, GetSecondFireAnim(currentWeapon), 8.0f);
} else {
newAnim = CAnimManager::BlendAnimation(
- ped->GetClump(), currentWeapon->m_AnimToPlay, ANIM_ATTACK_1, 8.0f);
+ ped->GetClump(), currentWeapon->m_AnimToPlay, ANIM_MELEE_ATTACK, 8.0f);
}
newAnim->SetFinishCallback(FinishedAttackCB, ped);
}
} else {
- if (attackAssoc && attackAssoc->animId == ANIM_ATTACK_1 && currentWeapon->m_AnimToPlay == ASSOCGRP_UNARMED) {
+ if (attackAssoc && attackAssoc->animId == ANIM_MELEE_ATTACK && currentWeapon->m_AnimToPlay == ASSOCGRP_UNARMED) {
attackAssoc->blendDelta = -8.0f;
attackAssoc->flags |= ASSOC_DELETEFADEDOUT;
ped->ClearAttack();
@@ -556,7 +556,7 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
}
if (attackAssoc) {
if (currentWeapon->m_AnimToPlay == ASSOCGRP_THROW) {
- if ((attackAssoc->animId == ANIM_ATTACK_1 || attackAssoc->animId == ANIM_ATTACK_2) && ped->GetWeapon()->m_nAmmoTotal > 0) {
+ if ((attackAssoc->animId == ANIM_THROWABLE_THROW || attackAssoc->animId == ANIM_THROWABLE_THROWU) && ped->GetWeapon()->m_nAmmoTotal > 0) {
ped->RemoveWeaponModel(currentWeapon->m_nModelId);
ped->AddWeaponModel(currentWeapon->m_nModelId);
}
@@ -831,12 +831,12 @@ CPed::Attack(void)
if(ourWeapon->m_AnimToPlay != ASSOCGRP_BASEBALLBAT && ourWeapon->m_AnimToPlay != ASSOCGRP_GOLFCLUB) {
if (ourWeapon->m_eWeaponFire != WEAPON_FIRE_MELEE) {
- TransformToNode(firePos, (weaponAnimAssoc->animId == ANIM_ATTACK_2 && ourWeapon->m_AnimToPlay == ASSOCGRP_UNARMED) ? PED_FOOTR : PED_HANDR);
+ TransformToNode(firePos, (weaponAnimAssoc->animId == ANIM_MELEE_ATTACK_2ND && ourWeapon->m_AnimToPlay == ASSOCGRP_UNARMED) ? PED_FOOTR : PED_HANDR);
} else {
firePos = GetMatrix() * firePos;
}
} else {
- if (weaponAnimAssoc->animId == ANIM_ATTACK_2)
+ if (weaponAnimAssoc->animId == ANIM_MELEE_ATTACK_2ND)
firePos.z = 0.7f * ourWeapon->m_fRadius - 1.0f;
firePos = GetMatrix() * firePos;
@@ -859,7 +859,7 @@ CPed::Attack(void)
}
switch (ourWeapon->m_AnimToPlay) {
case ASSOCGRP_UNARMED:
- if (weaponAnimAssoc->animId == ANIM_ATTACK_1 || weaponAnimAssoc->animId == ANIM_ATTACK_EXTRA1)
+ if (weaponAnimAssoc->animId == ANIM_MELEE_ATTACK || weaponAnimAssoc->animId == ANIM_MELEE_ATTACK_START)
DMAudio.PlayOneShot(m_audioEntityId, SOUND_FIGHT_46, (damagerType | (GetWeapon()->m_eWeaponType << 8)));
break;
case ASSOCGRP_KNIFE:
@@ -882,7 +882,7 @@ CPed::Attack(void)
} else {
CVector firePos = ourWeapon->m_vecFireOffset;
- if (weaponAnimAssoc->animId == ANIM_ATTACK_2)
+ if (weaponAnimAssoc->animId == ANIM_MELEE_ATTACK_2ND)
firePos.z = 0.7f * ourWeapon->m_fRadius - 1.0f;
firePos = GetMatrix() * firePos;
@@ -996,7 +996,7 @@ CPed::Attack(void)
weaponAnimAssoc->SetFinishCallback(FinishedAttackCB, this);
} else if (GetSecondFireAnim(ourWeapon)) {
if (weaponAnimAssoc->animId == GetSecondFireAnim(ourWeapon)) {
- weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, ANIM_ATTACK_1, 8.0f);
+ weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, ANIM_WEAPON_FIRE, 8.0f);
} else {
weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, GetSecondFireAnim(ourWeapon), 8.0f);
}
@@ -1929,7 +1929,7 @@ CPed::EndFight(uint8 endType)
RestorePreviousState();
CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!animAssoc)
- animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2);
+ animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (animAssoc)
animAssoc->flags |= ASSOC_DELETEFADEDOUT;
@@ -4146,27 +4146,27 @@ CPed::RemoveWeaponAnims(int unused, float animDelta)
CAnimBlendAssociation *weaponAssoc;
//CWeaponInfo::GetWeaponInfo(unused);
- weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1);
+ weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
}
- weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_2);
+ weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE_2ND);
if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
}
- weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_3);
+ weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE_3RD);
if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
}
- weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA1);
+ weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_RELOAD);
if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
}
- weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2);
+ weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (weaponAssoc) {
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
if (weaponAssoc->flags & ASSOC_PARTIAL)
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index e457189a..9c668cf4 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -333,7 +333,7 @@ CPlayerPed::SetRealMoveAnim(void)
if (!curIdleAssoc)
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!curIdleAssoc)
- curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2);
+ curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (!((curRunStopAssoc && curRunStopAssoc->IsRunning()) || (curRunStopRAssoc && curRunStopRAssoc->IsRunning()))) {
@@ -406,7 +406,7 @@ CPlayerPed::SetRealMoveAnim(void)
delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED);
CAnimBlendAssociation *fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!fightIdleAnim)
- fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2);
+ fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
delete fightIdleAnim;
delete curSprintAssoc;