Use our synonyms for attack anims again

This commit is contained in:
erorcun 2021-02-07 21:13:54 +03:00
parent 97351ad2c2
commit 2cad49940e
6 changed files with 72 additions and 56 deletions

View File

@ -232,25 +232,25 @@ AnimAssocDesc aBikeAnimDescs[] = {
{ ANIM_BIKE_RIDE_P, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING }, { ANIM_BIKE_RIDE_P, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
}; };
AnimAssocDesc aMeleeAnimDescs[] = { AnimAssocDesc aMeleeAnimDescs[] = {
{ ANIM_ATTACK_1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_EXTRA1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_ATTACK_EXTRA2, ASSOC_REPEAT }, { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
{ ANIM_ATTACK_3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
}; };
AnimAssocDesc aSwingAnimDescs[] = { AnimAssocDesc aSwingAnimDescs[] = {
{ ANIM_ATTACK_1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_EXTRA1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_EXTRA2, ASSOC_REPEAT }, { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
{ ANIM_ATTACK_3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aWeaponAnimDescs[] = { AnimAssocDesc aWeaponAnimDescs[] = {
{ ANIM_ATTACK_1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_WEAPON_FIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_WEAPON_CROUCHFIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_EXTRA1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_WEAPON_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_EXTRA2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_WEAPON_CROUCHRELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_ATTACK_3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_WEAPON_FIRE_3RD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
}; };
AnimAssocDesc aMedicAnimDescs[] = { AnimAssocDesc aMedicAnimDescs[] = {
{ ANIM_MEDIC_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MEDIC_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },

View File

@ -241,6 +241,22 @@ enum AnimationId
ANIM_ATTACK_EXTRA2, ANIM_ATTACK_EXTRA2,
ANIM_ATTACK_3, ANIM_ATTACK_3,
// our synonyms... because originals are hard to understand
ANIM_WEAPON_FIRE = ANIM_ATTACK_1,
ANIM_WEAPON_CROUCHFIRE,
ANIM_WEAPON_FIRE_2ND = ANIM_WEAPON_CROUCHFIRE,
ANIM_WEAPON_RELOAD,
ANIM_WEAPON_CROUCHRELOAD,
ANIM_WEAPON_FIRE_3RD,
ANIM_THROWABLE_THROW = ANIM_ATTACK_1,
ANIM_THROWABLE_THROWU,
ANIM_THROWABLE_START_THROW,
ANIM_MELEE_ATTACK = ANIM_ATTACK_1,
ANIM_MELEE_ATTACK_2ND,
ANIM_MELEE_ATTACK_START,
ANIM_MELEE_IDLE_FIGHTMODE,
ANIM_MELEE_ATTACK_FINISH,
ANIM_SUNBATHE_IDLE, ANIM_SUNBATHE_IDLE,
ANIM_SUNBATHE_DOWN, ANIM_SUNBATHE_DOWN,
ANIM_SUNBATHE_UP, ANIM_SUNBATHE_UP,

View File

@ -617,7 +617,7 @@ CPed::SetMoveAnim(void)
if (!animAssoc) { if (!animAssoc) {
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!animAssoc) if (!animAssoc)
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2); animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (animAssoc && m_nPedState == PED_FIGHT) if (animAssoc && m_nPedState == PED_FIGHT)
return; return;
@ -1433,7 +1433,7 @@ CPed::CalculateNewVelocity(void)
fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED);
if(!fightAssoc) if(!fightAssoc)
fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2); fightAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc && !bIsDucking) { if ((!idleAssoc || idleAssoc->blendAmount < 0.5f) && !fightAssoc && !bIsDucking) {
LimbOrientation newUpperLegs; LimbOrientation newUpperLegs;

View File

@ -1015,16 +1015,16 @@ public:
static AnimationId Get3rdFireAnim(CWeaponInfo* weapon) { static AnimationId Get3rdFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_COP3_RD)) if (weapon->IsFlagSet(WEAPONFLAG_COP3_RD))
return ANIM_ATTACK_3; return ANIM_WEAPON_FIRE_3RD;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetFireAnimGround(CWeaponInfo* weapon, bool kickFloorIfNone = true) { static AnimationId GetFireAnimGround(CWeaponInfo* weapon, bool kickFloorIfNone = true) {
if (weapon->IsFlagSet(WEAPONFLAG_GROUND_2ND)) if (weapon->IsFlagSet(WEAPONFLAG_GROUND_2ND))
return ANIM_ATTACK_2; return ANIM_WEAPON_CROUCHFIRE;
else if (weapon->IsFlagSet(WEAPONFLAG_GROUND_3RD)) else if (weapon->IsFlagSet(WEAPONFLAG_GROUND_3RD))
return ANIM_ATTACK_3; return ANIM_WEAPON_FIRE_3RD;
else if (kickFloorIfNone) else if (kickFloorIfNone)
return ANIM_STD_KICKGROUND; return ANIM_STD_KICKGROUND;
else else
@ -1035,54 +1035,54 @@ public:
if (weapon->IsFlagSet(WEAPONFLAG_ANIMDETONATE)) if (weapon->IsFlagSet(WEAPONFLAG_ANIMDETONATE))
return ANIM_STD_DETONATE; return ANIM_STD_DETONATE;
else else
return ANIM_ATTACK_1; return ANIM_WEAPON_FIRE;
} }
static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) { static AnimationId GetCrouchReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD)) if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
return ANIM_ATTACK_EXTRA2; return ANIM_WEAPON_CROUCHRELOAD;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetCrouchFireAnim(CWeaponInfo* weapon) { static AnimationId GetCrouchFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) if (weapon->IsFlagSet(WEAPONFLAG_CROUCHFIRE))
return ANIM_ATTACK_2; return ANIM_WEAPON_CROUCHFIRE;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetReloadAnim(CWeaponInfo* weapon) { static AnimationId GetReloadAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_RELOAD)) if (weapon->IsFlagSet(WEAPONFLAG_RELOAD))
return ANIM_ATTACK_EXTRA1; return ANIM_WEAPON_RELOAD;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetFightIdleWithMeleeAnim(CWeaponInfo* weapon) { static AnimationId GetFightIdleWithMeleeAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_FIGHTMODE)) if (weapon->IsFlagSet(WEAPONFLAG_FIGHTMODE))
return ANIM_ATTACK_EXTRA2; return ANIM_MELEE_IDLE_FIGHTMODE;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetFinishingAttackAnim(CWeaponInfo* weapon) { static AnimationId GetFinishingAttackAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_FINISH_3RD)) if (weapon->IsFlagSet(WEAPONFLAG_FINISH_3RD))
return ANIM_ATTACK_3; return ANIM_MELEE_ATTACK_FINISH;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetSecondFireAnim(CWeaponInfo* weapon) { static AnimationId GetSecondFireAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_USE_2ND)) if (weapon->IsFlagSet(WEAPONFLAG_USE_2ND))
return ANIM_ATTACK_2; // or ANIM_MELEE_ATTACK_2ND return ANIM_WEAPON_FIRE_2ND;
else else
return (AnimationId)0; return (AnimationId)0;
} }
static AnimationId GetMeleeStartAnim(CWeaponInfo* weapon) { static AnimationId GetMeleeStartAnim(CWeaponInfo* weapon) {
if (weapon->IsFlagSet(WEAPONFLAG_PARTIALATTACK)) if (weapon->IsFlagSet(WEAPONFLAG_PARTIALATTACK))
return ANIM_ATTACK_EXTRA1; return ANIM_MELEE_ATTACK_START;
else else
return (AnimationId)0; return (AnimationId)0;
} }
@ -1090,7 +1090,7 @@ public:
static AnimationId GetThrowAnim(CWeaponInfo *weapon) static AnimationId GetThrowAnim(CWeaponInfo *weapon)
{ {
if (weapon->IsFlagSet(WEAPONFLAG_THROW)) if (weapon->IsFlagSet(WEAPONFLAG_THROW))
return ANIM_ATTACK_EXTRA1; return ANIM_THROWABLE_START_THROW;
else else
return (AnimationId)0; return (AnimationId)0;
} }

View File

@ -182,14 +182,14 @@ CPed::SetPointGunAt(CEntity *to)
if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) { if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) {
aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(curWeapon)); aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(curWeapon));
} else { } else {
aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1); aimAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
} }
if (!aimAssoc || aimAssoc->blendDelta < 0.0f) { if (!aimAssoc || aimAssoc->blendDelta < 0.0f) {
if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) { if (bCrouchWhenShooting && bIsDucking && GetCrouchFireAnim(curWeapon)) {
aimAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, GetCrouchFireAnim(curWeapon), 4.0f); aimAssoc = CAnimManager::BlendAnimation(GetClump(), curWeapon->m_AnimToPlay, GetCrouchFireAnim(curWeapon), 4.0f);
} else { } 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; aimAssoc->blendAmount = 0.0f;
@ -204,7 +204,7 @@ CPed::PointGunAt(void)
{ {
CWeaponInfo *weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); CWeaponInfo *weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
float animLoopStart = weaponInfo->m_fAnimLoopStart; 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 (!weaponAssoc || weaponAssoc->blendDelta < 0.0f) {
if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) { if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) {
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo)); weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo));
@ -240,7 +240,7 @@ CPed::ClearPointGunAt(void)
RestorePreviousState(); RestorePreviousState();
} }
weaponInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); 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 (!animAssoc || animAssoc->blendDelta < 0.0f) {
if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) { if (weaponInfo->IsFlagSet(WEAPONFLAG_CROUCHFIRE)) {
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo)); animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weaponInfo));
@ -284,7 +284,7 @@ CPed::SetAttack(CEntity *victim)
SetPedState(PED_ATTACK); SetPedState(PED_ATTACK);
bIsAttacking = false; 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(); animAssoc->SetRun();
if (animAssoc->currentTime == animAssoc->hierarchy->totalLength) if (animAssoc->currentTime == animAssoc->hierarchy->totalLength)
animAssoc->SetCurrentTime(0.0f); animAssoc->SetCurrentTime(0.0f);
@ -304,7 +304,7 @@ CPed::SetAttack(CEntity *victim)
if (m_nPedState != PED_ATTACK) { if (m_nPedState != PED_ATTACK) {
SetPedState(PED_ATTACK); SetPedState(PED_ATTACK);
bIsAttacking = false; 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(); animAssoc->SetRun();
if (animAssoc->currentTime == animAssoc->hierarchy->totalLength) if (animAssoc->currentTime == animAssoc->hierarchy->totalLength)
animAssoc->SetCurrentTime(0.0f); animAssoc->SetCurrentTime(0.0f);
@ -397,7 +397,7 @@ CPed::SetAttack(CEntity *victim)
AnimationId fireAnim; AnimationId fireAnim;
if (curWeapon->IsFlagSet(WEAPONFLAG_THROW)) 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))) { else if (CGame::nastyGame && (curWeapon->IsFlagSet(WEAPONFLAG_GROUND_2ND) || curWeapon->IsFlagSet(WEAPONFLAG_GROUND_3RD))) {
PedOnGroundState pedOnGround = CheckForPedsOnGroundToAttack(this, nil); PedOnGroundState pedOnGround = CheckForPedsOnGroundToAttack(this, nil);
if (pedOnGround > PED_IN_FRONT_OF_ATTACKER || pedOnGround == NO_PED && bIsStanding && m_pCurSurface && m_pCurSurface->IsVehicle()) { 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()) { if ((!ped->IsPlayer() || ((CPlayerPed*)ped)->m_bHaveTargetSelected) && ped->IsPlayer()) {
attackAssoc->blendDelta = -1000.0f; 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 { } else {
attackAssoc->blendDelta = -1000.0; 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); newAnim->SetFinishCallback(FinishedAttackCB, ped);
@ -538,17 +538,17 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
AnimationId groundAnim = GetFireAnimGround(currentWeapon); AnimationId groundAnim = GetFireAnimGround(currentWeapon);
CAnimBlendAssociation *groundAnimAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), groundAnim); CAnimBlendAssociation *groundAnimAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), groundAnim);
if (!(groundAnimAssoc && (groundAnimAssoc->blendAmount > 0.95f || groundAnimAssoc->blendDelta > 0.0f))) { 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( newAnim = CAnimManager::BlendAnimation(
ped->GetClump(), currentWeapon->m_AnimToPlay, GetSecondFireAnim(currentWeapon), 8.0f); ped->GetClump(), currentWeapon->m_AnimToPlay, GetSecondFireAnim(currentWeapon), 8.0f);
} else { } else {
newAnim = CAnimManager::BlendAnimation( 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); newAnim->SetFinishCallback(FinishedAttackCB, ped);
} }
} else { } 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->blendDelta = -8.0f;
attackAssoc->flags |= ASSOC_DELETEFADEDOUT; attackAssoc->flags |= ASSOC_DELETEFADEDOUT;
ped->ClearAttack(); ped->ClearAttack();
@ -556,7 +556,7 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
} }
if (attackAssoc) { if (attackAssoc) {
if (currentWeapon->m_AnimToPlay == ASSOCGRP_THROW) { 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->RemoveWeaponModel(currentWeapon->m_nModelId);
ped->AddWeaponModel(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_AnimToPlay != ASSOCGRP_BASEBALLBAT && ourWeapon->m_AnimToPlay != ASSOCGRP_GOLFCLUB) {
if (ourWeapon->m_eWeaponFire != WEAPON_FIRE_MELEE) { 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 { } else {
firePos = GetMatrix() * firePos; firePos = GetMatrix() * firePos;
} }
} else { } else {
if (weaponAnimAssoc->animId == ANIM_ATTACK_2) if (weaponAnimAssoc->animId == ANIM_MELEE_ATTACK_2ND)
firePos.z = 0.7f * ourWeapon->m_fRadius - 1.0f; firePos.z = 0.7f * ourWeapon->m_fRadius - 1.0f;
firePos = GetMatrix() * firePos; firePos = GetMatrix() * firePos;
@ -859,7 +859,7 @@ CPed::Attack(void)
} }
switch (ourWeapon->m_AnimToPlay) { switch (ourWeapon->m_AnimToPlay) {
case ASSOCGRP_UNARMED: 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))); DMAudio.PlayOneShot(m_audioEntityId, SOUND_FIGHT_46, (damagerType | (GetWeapon()->m_eWeaponType << 8)));
break; break;
case ASSOCGRP_KNIFE: case ASSOCGRP_KNIFE:
@ -882,7 +882,7 @@ CPed::Attack(void)
} else { } else {
CVector firePos = ourWeapon->m_vecFireOffset; 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.z = 0.7f * ourWeapon->m_fRadius - 1.0f;
firePos = GetMatrix() * firePos; firePos = GetMatrix() * firePos;
@ -996,7 +996,7 @@ CPed::Attack(void)
weaponAnimAssoc->SetFinishCallback(FinishedAttackCB, this); weaponAnimAssoc->SetFinishCallback(FinishedAttackCB, this);
} else if (GetSecondFireAnim(ourWeapon)) { } else if (GetSecondFireAnim(ourWeapon)) {
if (weaponAnimAssoc->animId == 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 { } else {
weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, GetSecondFireAnim(ourWeapon), 8.0f); weaponAnimAssoc = CAnimManager::BlendAnimation(GetClump(), ourWeapon->m_AnimToPlay, GetSecondFireAnim(ourWeapon), 8.0f);
} }
@ -1929,7 +1929,7 @@ CPed::EndFight(uint8 endType)
RestorePreviousState(); RestorePreviousState();
CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!animAssoc) if (!animAssoc)
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2); animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (animAssoc) if (animAssoc)
animAssoc->flags |= ASSOC_DELETEFADEDOUT; animAssoc->flags |= ASSOC_DELETEFADEDOUT;
@ -4146,27 +4146,27 @@ CPed::RemoveWeaponAnims(int unused, float animDelta)
CAnimBlendAssociation *weaponAssoc; CAnimBlendAssociation *weaponAssoc;
//CWeaponInfo::GetWeaponInfo(unused); //CWeaponInfo::GetWeaponInfo(unused);
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_1); weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE);
if (weaponAssoc) { if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta; weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT; weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
} }
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_2); weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE_2ND);
if (weaponAssoc) { if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta; weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT; weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
} }
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_3); weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_FIRE_3RD);
if (weaponAssoc) { if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta; weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT; weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
} }
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA1); weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_RELOAD);
if (weaponAssoc) { if (weaponAssoc) {
weaponAssoc->blendDelta = animDelta; weaponAssoc->blendDelta = animDelta;
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT; weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
} }
weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2); weaponAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (weaponAssoc) { if (weaponAssoc) {
weaponAssoc->flags |= ASSOC_DELETEFADEDOUT; weaponAssoc->flags |= ASSOC_DELETEFADEDOUT;
if (weaponAssoc->flags & ASSOC_PARTIAL) if (weaponAssoc->flags & ASSOC_PARTIAL)

View File

@ -333,7 +333,7 @@ CPlayerPed::SetRealMoveAnim(void)
if (!curIdleAssoc) if (!curIdleAssoc)
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!curIdleAssoc) if (!curIdleAssoc)
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2); curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
if (!((curRunStopAssoc && curRunStopAssoc->IsRunning()) || (curRunStopRAssoc && curRunStopRAssoc->IsRunning()))) { if (!((curRunStopAssoc && curRunStopAssoc->IsRunning()) || (curRunStopRAssoc && curRunStopRAssoc->IsRunning()))) {
@ -406,7 +406,7 @@ CPlayerPed::SetRealMoveAnim(void)
delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED); delete RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_IDLE_TIRED);
CAnimBlendAssociation *fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE); CAnimBlendAssociation *fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FIGHT_IDLE);
if (!fightIdleAnim) if (!fightIdleAnim)
fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_ATTACK_EXTRA2); fightIdleAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_MELEE_IDLE_FIGHTMODE);
delete fightIdleAnim; delete fightIdleAnim;
delete curSprintAssoc; delete curSprintAssoc;