Browse Source

Fix toad viewmodel animation in half-secret.

mobile_hacks
Andrey Akhmichin 5 years ago
parent
commit
661e19b6d2
  1. 15
      cl_dll/ev_hldm.cpp
  2. 2
      cl_dll/hud.cpp
  3. 2
      dlls/h_export.cpp
  4. 42
      dlls/squeakgrenade.cpp

15
cl_dll/ev_hldm.cpp

@ -1692,6 +1692,16 @@ enum squeak_e @@ -1692,6 +1692,16 @@ enum squeak_e
SQUEAK_THROW
};
enum toad_e {
TOAD_IDLE1 = 0,
TOAD_IDLE2,
TOAD_FIDGETFIT,
TOAD_FIDGETNIP,
TOAD_DOWN,
TOAD_UP,
TOAD_THROW
};
#define VEC_HULL_MIN Vector( -16, -16, -36 )
#define VEC_DUCK_HULL_MIN Vector( -16, -16, -18 )
@ -1723,7 +1733,12 @@ void EV_SnarkFire( event_args_t *args ) @@ -1723,7 +1733,12 @@ void EV_SnarkFire( event_args_t *args )
//Find space to drop the thing.
if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25f )
{
if( g_iModType == MOD_HALFSECRET )
gEngfuncs.pEventAPI->EV_WeaponAnimation( TOAD_THROW, 0 );
else
gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 );
}
gEngfuncs.pEventAPI->EV_PopPMStates();
}

2
cl_dll/hud.cpp

@ -216,7 +216,7 @@ void CHud::Init( void ) @@ -216,7 +216,7 @@ void CHud::Init( void )
g_iModType = MOD_BSHIFT;
g_iHudColor = RGB_BLUISH;
}
else if( HUD_IsGame( "halfsecret" ) )
else if( HUD_IsGame( "secret" ) )
{
g_iModType = MOD_HALFSECRET;
g_iHudColor = RGB_YELLOWISH;

2
dlls/h_export.cpp

@ -74,7 +74,7 @@ extern "C" void DLLEXPORT EXPORT2 GiveFnptrsToDll( enginefuncs_t *pengfuncsFromE @@ -74,7 +74,7 @@ extern "C" void DLLEXPORT EXPORT2 GiveFnptrsToDll( enginefuncs_t *pengfuncsFromE
{
g_iModType = MOD_BSHIFT;
}
else if( FStrEq( szGameFolder, "halfsecret" ) )
else if( FStrEq( szGameFolder, "secret" ) )
{
g_iModType = MOD_HALFSECRET;
}

42
dlls/squeakgrenade.cpp

@ -42,6 +42,16 @@ enum squeak_e @@ -42,6 +42,16 @@ enum squeak_e
SQUEAK_THROW
};
enum toad_e {
TOAD_IDLE1 = 0,
TOAD_IDLE2,
TOAD_FIDGETFIT,
TOAD_FIDGETNIP,
TOAD_DOWN,
TOAD_UP,
TOAD_THROW
};
#ifndef CLIENT_DLL
class CSqueakGrenade : public CGrenade
{
@ -479,7 +489,10 @@ void CSqueak::Holster( int skiplocal /* = 0 */ ) @@ -479,7 +489,10 @@ void CSqueak::Holster( int skiplocal /* = 0 */ )
return;
}
if( g_iModType == MOD_HALFSECRET )
SendWeaponAnim( SQUEAK_DOWN );
else
SendWeaponAnim( TOAD_DOWN );
EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM );
}
@ -558,6 +571,9 @@ void CSqueak::WeaponIdle( void ) @@ -558,6 +571,9 @@ void CSqueak::WeaponIdle( void )
return;
}
if( g_iModType == MOD_HALFSECRET )
SendWeaponAnim( TOAD_UP );
else
SendWeaponAnim( SQUEAK_UP );
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
return;
@ -565,6 +581,31 @@ void CSqueak::WeaponIdle( void ) @@ -565,6 +581,31 @@ void CSqueak::WeaponIdle( void )
int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if( g_iModType == MOD_HALFSECRET )
{
if( flRand <= 0.625f )
{
iAnim = TOAD_IDLE1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f;
}
else if( flRand <= 0.75f )
{
iAnim = TOAD_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f;
}
else if( flRand <= 0.875f )
{
iAnim = TOAD_FIDGETFIT;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 16.0f;
}
else
{
iAnim = TOAD_FIDGETNIP;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 16.0f;
}
}
else
{
if( flRand <= 0.75f )
{
iAnim = SQUEAK_IDLE1;
@ -580,6 +621,7 @@ void CSqueak::WeaponIdle( void ) @@ -580,6 +621,7 @@ void CSqueak::WeaponIdle( void )
iAnim = SQUEAK_FIDGETNIP;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 16.0f;
}
}
SendWeaponAnim( iAnim );
}
#endif

Loading…
Cancel
Save