Skip to content

Commit

Permalink
tachi, milso and zr68l improvements(zr68l still not ideal) plus faste…
Browse files Browse the repository at this point in the history
…r srs firing (#731)

* use idleTime, allow srs weapon pullback after weapon has finished primary attack activity

* SequenceDuration gives too long a time between shots. Use these values from video test

* delete temp file

* a bit more next

* 2 seconds seems like such a long time, but it seems to be about the same time as the original
  • Loading branch information
AdamTadeusz authored Oct 31, 2024
1 parent d25a5b9 commit ebd39a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions mp/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,12 @@ void CNEOBaseCombatWeapon::ProcessAnimationEvents()
return;
}

const auto next = [this](const int activity) {
const auto next = [this](const int activity, const float nextAttackDelay = 0.2) {
SendWeaponAnim(activity);
if (GetNeoWepBits() & NEO_WEP_THROWABLE)
{
return;
}
constexpr auto nextAttackDelay = 0.2;
m_flNextPrimaryAttack = max(gpGlobals->curtime + nextAttackDelay, m_flNextPrimaryAttack);
m_flNextSecondaryAttack = m_flNextPrimaryAttack;
};
Expand All @@ -506,12 +505,14 @@ void CNEOBaseCombatWeapon::ProcessAnimationEvents()
else if (m_bLowered && m_bRoundBeingChambered)
{ // For bolt action weapons
m_bLowered = false;
next(ACT_VM_PULLBACK);
next(ACT_VM_PULLBACK, 1.2f);
}

if (m_bLowered && gpGlobals->curtime > m_flNextPrimaryAttack)
else if (m_bLowered && gpGlobals->curtime > m_flNextPrimaryAttack)
{
next(ACT_VM_IDLE_LOWERED);
SetWeaponIdleTime(gpGlobals->curtime + 0.2);
m_flNextPrimaryAttack = max(gpGlobals->curtime + 0.2, m_flNextPrimaryAttack);
m_flNextSecondaryAttack = m_flNextPrimaryAttack;
}
}

Expand Down Expand Up @@ -818,6 +819,7 @@ void CNEOBaseCombatWeapon::PrimaryAttack(void)
pPlayer->DoMuzzleFlash();

SendWeaponAnim(GetPrimaryAttackActivity());
SetWeaponIdleTime(gpGlobals->curtime + 2.0);

// player "shoot" animation
pPlayer->DoAnimationEvent(PLAYERANIMEVENT_ATTACK_PRIMARY);
Expand Down
8 changes: 4 additions & 4 deletions mp/src/game/shared/neo/weapons/weapon_srs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void CWeaponSRS::ItemPreFrame()
m_bRoundChambered = true;
}

if (m_flNextPrimaryAttack <= gpGlobals->curtime && !m_bRoundChambered && !m_bRoundBeingChambered && m_iClip1 > 0)
if (m_flLastAttackTime + 0.08f <= gpGlobals->curtime && !m_bRoundChambered && !m_bRoundBeingChambered && m_iClip1 > 0)
{ // Primary attack animation finished, begin chambering a round
if (CNEO_Player* pOwner = static_cast<CNEO_Player*>(ToBasePlayer(GetOwner()))) {
if (pOwner->m_nButtons & IN_ATTACK)
Expand All @@ -66,10 +66,10 @@ void CWeaponSRS::ItemPreFrame()
}
pOwner->Weapon_SetZoom(false);
}
m_bRoundBeingChambered = true;
m_flChamberFinishTime = gpGlobals->curtime + GetFireRate();
WeaponSound(SPECIAL1);
SendWeaponAnim(ACT_VM_PULLBACK);
WeaponSound(SPECIAL1);
m_bRoundBeingChambered = true;
m_flChamberFinishTime = gpGlobals->curtime + 1.2f;
}

BaseClass::ItemPreFrame();
Expand Down

0 comments on commit ebd39a8

Please sign in to comment.