Browse Source

Fix toad viewmodel animation in half-secret.

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

17
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 )
gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 );
{
if( g_iModType == MOD_HALFSECRET )
gEngfuncs.pEventAPI->EV_WeaponAnimation( TOAD_THROW, 0 );
else
gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 );
}
gEngfuncs.pEventAPI->EV_PopPMStates();
}

10
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;
@ -227,10 +227,10 @@ void CHud::Init( void ) @@ -227,10 +227,10 @@ void CHud::Init( void )
g_iHudColor = RGB_WHITISH;
}
else if( HUD_IsGame( "induction" ) )
{
g_iModType = MOD_INDUCTION;
g_iHudColor = RGB_YELLOWISH;
}
{
g_iModType = MOD_INDUCTION;
g_iHudColor = RGB_YELLOWISH;
}
else
{
g_iModType = MOD_VALVE;

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;
}

66
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;
}
SendWeaponAnim( SQUEAK_DOWN );
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,27 +571,56 @@ void CSqueak::WeaponIdle( void ) @@ -558,27 +571,56 @@ void CSqueak::WeaponIdle( void )
return;
}
SendWeaponAnim( SQUEAK_UP );
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;
}
int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if( flRand <= 0.75f )
{
iAnim = SQUEAK_IDLE1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f;
}
else if( flRand <= 0.875f )
if( g_iModType == MOD_HALFSECRET )
{
iAnim = SQUEAK_FIDGETFIT;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 16.0f;
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
{
iAnim = SQUEAK_FIDGETNIP;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 16.0f;
if( flRand <= 0.75f )
{
iAnim = SQUEAK_IDLE1;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f;
}
else if( flRand <= 0.875f )
{
iAnim = SQUEAK_FIDGETFIT;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 16.0f;
}
else
{
iAnim = SQUEAK_FIDGETNIP;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 16.0f;
}
}
SendWeaponAnim( iAnim );
}

Loading…
Cancel
Save