diff --git a/Source/Globals.h b/Source/Globals.h index 5a2b5074..58e0f813 100644 --- a/Source/Globals.h +++ b/Source/Globals.h @@ -186,6 +186,7 @@ typedef struct { int iCrosshairMinDistance; // Some weapons just are inaccurate by design... int iCrosshairDeltaDistance; // Scale factor of sorts float fWeaponArmorRatio; // Some weapons seem to do more damage to the kevlar than others I guess + float fAnimType; } weaponinfo_t; typedef struct { @@ -246,6 +247,21 @@ enum { IMPACT_ROCK, }; +// Animation types +enum { + ATYPE_ONEHAND, + ATYPE_DUALPISTOLS, + ATYPE_CARBINE, + ATYPE_RIFLE, + ATYPE_MP5, + ATYPE_SHOTGUN, + ATYPE_PARA, + ATYPE_GRENADE, + ATYPE_C4, + ATYPE_KNIFE, + ATYPE_AK47 +}; + // Actually used by input_button etc. #define INPUT_BUTTON0 1 #define INPUT_BUTTON2 2 diff --git a/Source/Server/Animations.c b/Source/Server/Animations.c index 28a7751c..5e67af52 100644 --- a/Source/Server/Animations.c +++ b/Source/Server/Animations.c @@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ .float baseframe_time; +.float baseframe_old; +.float fWasCrouching; enum { ANIM_DUMMY1, @@ -94,7 +96,7 @@ enum { ANIM_DUPLICATE6, ANIM_DUPLICATE7, ANIM_DUPLICATE8, - ANIM_AIM_KNIFE9, + ANIM_CROUCH_AIM_KNIFE, ANIM_CROUCH_SHOOT_KNIFE, ANIM_AIM_KNIFE, ANIM_SHOOT_KNIFE, @@ -129,8 +131,44 @@ depending on what the player is doing void Animation_PlayerUpdate( void ) { self.basebone = 40; + // TODO: Make this faster if ( self.baseframe_time < time ) { - self.baseframe = ANIM_AIM_SHOTGUN; + switch ( Weapon_GetAnimType( self.weapon ) && self.baseframe != self.baseframe_old ) { + case ATYPE_AK47: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_AK47 : ANIM_AIM_AK47; + break; + case ATYPE_C4: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_C4 : ANIM_AIM_C4; + break; + case ATYPE_CARBINE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_CARBINE : ANIM_AIM_CARBINE; + break; + case ATYPE_DUALPISTOLS: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_DUALPISTOLS : ANIM_AIM_DUALPISTOLS; + break; + case ATYPE_GRENADE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_GRENADE : ANIM_AIM_GRENADE; + break; + case ATYPE_KNIFE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_KNIFE : ANIM_AIM_KNIFE; + break; + case ATYPE_MP5: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_MP5 : ANIM_AIM_MP5; + break; + case ATYPE_ONEHAND: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_ONEHAND : ANIM_AIM_ONEHAND; + break; + case ATYPE_PARA: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_PARA : ANIM_AIM_PARA; + break; + case ATYPE_RIFLE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_RIFLE : ANIM_AIM_RIFLE; + break; + case ATYPE_SHOTGUN: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_SHOTGUN : ANIM_AIM_SHOTGUN; + break; + } + self.baseframe_old = self.baseframe; } if ( vlen( self.velocity ) == 0 ) { @@ -156,6 +194,13 @@ void Animation_PlayerUpdate( void ) { if ( !( self.flags & FL_ONGROUND ) ) { self.frame = ANIM_JUMP; } + + // Force the code above to update if we switched positions + if ( self.fWasCrouching != ( self.flags & FL_CROUCHING ) ) { + self.baseframe_old = 0; + self.baseframe_time = 0; + self.fWasCrouching = ( self.flags & FL_CROUCHING ); + } } /* @@ -165,7 +210,92 @@ Animation_PlayerTop Changes the animation sequence for the upper body part ================= */ -void Animation_PlayerTop( float fFrame, float fTime ) { +void Animation_PlayerTop( float fFrame ) { + self.baseframe = fFrame; + self.baseframe_old = fFrame; +} + +void Animation_PlayerTopTemp( float fFrame, float fTime ) { self.baseframe = fFrame; self.baseframe_time = time + fTime; } + +void Animation_ShootWeapon( void ) { + switch ( Weapon_GetAnimType( self.weapon ) ) { + case ATYPE_AK47: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_AK47 : ANIM_SHOOT_AK47; + break; + case ATYPE_C4: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_C4 : ANIM_SHOOT_C4; + break; + case ATYPE_CARBINE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_CARBINE : ANIM_SHOOT_CARBINE; + break; + case ATYPE_DUALPISTOLS: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_DUALPISTOLS : ANIM_SHOOT_DUALPISTOLS; + break; + case ATYPE_GRENADE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_GRENADE : ANIM_SHOOT_GRENADE; + break; + case ATYPE_KNIFE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_KNIFE : ANIM_SHOOT_KNIFE; + break; + case ATYPE_MP5: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_MP5 : ANIM_SHOOT_MP5; + break; + case ATYPE_ONEHAND: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_ONEHAND : ANIM_SHOOT_ONEHAND; + break; + case ATYPE_PARA: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_PARA : ANIM_SHOOT_PARA; + break; + case ATYPE_RIFLE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_RIFLE : ANIM_SHOOT_RIFLE; + break; + case ATYPE_SHOTGUN: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_SHOOT_SHOTGUN : ANIM_SHOOT_SHOTGUN; + break; + } + + self.baseframe_time = time + Weapon_GetFireRate( self.weapon ); +} + +void Animation_ReloadWeapon( void ) { + switch ( Weapon_GetAnimType( self.weapon ) ) { + case ATYPE_AK47: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_AK47 : ANIM_RELOAD_AK47; + break; + case ATYPE_C4: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_C4 : ANIM_AIM_C4; + break; + case ATYPE_CARBINE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_CARBINE : ANIM_RELOAD_CARBINE; + break; + case ATYPE_DUALPISTOLS: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_DUALPISTOLS : ANIM_RELOAD_DUALPISTOLS; + break; + case ATYPE_GRENADE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_GRENADE : ANIM_AIM_GRENADE; + break; + case ATYPE_KNIFE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_AIM_KNIFE : ANIM_AIM_KNIFE; + break; + case ATYPE_MP5: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_MP5 : ANIM_RELOAD_MP5; + break; + case ATYPE_ONEHAND: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_ONEHAND : ANIM_RELOAD_ONEHAND; + break; + case ATYPE_PARA: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_PARA : ANIM_RELOAD_PARA; + break; + case ATYPE_RIFLE: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_RIFLE : ANIM_RELOAD_RIFLE; + break; + case ATYPE_SHOTGUN: + self.baseframe = self.flags & FL_CROUCHING ? ANIM_CROUCH_RELOAD_SHOTGUN : ANIM_RELOAD_SHOTGUN; + break; + } + + self.baseframe_time = time + Weapon_GetReloadTime( self.weapon ); +} diff --git a/Source/Server/Defs.h b/Source/Server/Defs.h index 9f5dfb8c..a603c0db 100644 --- a/Source/Server/Defs.h +++ b/Source/Server/Defs.h @@ -121,6 +121,9 @@ void Client_SendEvent( entity eClient, float fEVType ); void Client_TriggerCamera( entity eTarget, vector vPos, vector vEndPos, float fResetTime ); void Weapon_SwitchBest( void ); void Weapon_UpdateCurrents( void ); +float Weapon_GetAnimType( float fWeapon ); +float Weapon_GetFireRate( float fWeapon ); +float Weapon_GetReloadTime( float fWeapon ); void OpenCSGunBase_AccuracyCalc( void ); void OpenCSGunBase_Draw( void ); @@ -146,6 +149,9 @@ void Ammo_BuySecondary( float fFree ); void Input_Handle( void ); +void Animation_PlayerTop( float fFrame ); +void Animation_PlayerTopTemp( float fFrame, float fTime ); + // WIP string __fullspawndata; hashtable hashMaterials; diff --git a/Source/Server/Player.c b/Source/Server/Player.c index 487836cd..682aa4ab 100644 --- a/Source/Server/Player.c +++ b/Source/Server/Player.c @@ -53,9 +53,9 @@ Player_Pain */ void Player_Pain( int iHitBody ) { if ( iHitBody == BODY_HEAD ) { - Animation_PlayerTop( ANIM_HEAD_FLINCH, 0.1f ); + Animation_PlayerTopTemp( ANIM_HEAD_FLINCH, 0.1f ); } else { - Animation_PlayerTop( ANIM_GUT_FLINCH, 0.1f ); + Animation_PlayerTopTemp( ANIM_GUT_FLINCH, 0.1f ); } sound( self, CHAN_VOICE, sPainSounds[ floor( random() * 5 ) ], 1, ATTN_IDLE ); diff --git a/Source/Server/Timer.c b/Source/Server/Timer.c index 0d8a002d..14e042b1 100644 --- a/Source/Server/Timer.c +++ b/Source/Server/Timer.c @@ -37,7 +37,6 @@ void Timer_Begin( float fTime, float fMode) { } fGameTime = fTime; - bprint( sprintf( "Setting Timer to Mode %d, Time %d\n", fMode, fTime ) ); } /* diff --git a/Source/Server/progs.src b/Source/Server/progs.src index 17c28d60..de9b0b27 100644 --- a/Source/Server/progs.src +++ b/Source/Server/progs.src @@ -9,6 +9,7 @@ Defs.h Money.c +Animations.c ../Shared/Radio.c ../Shared/WeaponAK47.c @@ -64,7 +65,6 @@ FuncDoor.c FuncDoorRotating.c AmbientSound.c -Animations.c Light.c Main.c Player.c diff --git a/Source/Shared/WeaponAK47.c b/Source/Shared/WeaponAK47.c index 39d30261..d76246e4 100644 --- a/Source/Shared/WeaponAK47.c +++ b/Source/Shared/WeaponAK47.c @@ -43,7 +43,8 @@ weaponinfo_t wptAK47 = { 1.25, // Max Inaccuracy 4, // Minimum Crosshair Distance 4, // Crosshair Movement Delta - 1.55 // Armor penetration ratio + 1.55, // Armor penetration ratio + ATYPE_AK47 // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponAUG.c b/Source/Shared/WeaponAUG.c index 916be914..0f5c6852 100644 --- a/Source/Shared/WeaponAUG.c +++ b/Source/Shared/WeaponAUG.c @@ -43,7 +43,8 @@ weaponinfo_t wptAUG = { 1.0, // Max Inaccuracy 3, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.4 // Armor penetration ratio + 1.4, // Armor penetration ratio + ATYPE_RIFLE // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponAWP.c b/Source/Shared/WeaponAWP.c index 10863b85..b261f5e8 100644 --- a/Source/Shared/WeaponAWP.c +++ b/Source/Shared/WeaponAWP.c @@ -43,7 +43,8 @@ weaponinfo_t wptAWP = { 0, // Max Inaccuracy 8, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.95 // Armor penetration ratio + 1.95, // Armor penetration ratio + ATYPE_CARBINE // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponBase.c b/Source/Shared/WeaponBase.c index 52f99f6c..cf653cc6 100644 --- a/Source/Shared/WeaponBase.c +++ b/Source/Shared/WeaponBase.c @@ -105,6 +105,7 @@ float OpenCSGunBase_PrimaryFire( void ) { OpenCSGunBase_ShotMultiplierHandle( wptTable[ self.weapon ].iBullets ); OpenCSGunBase_AccuracyCalc(); TraceAttack_FireBullets( wptTable[ self.weapon ].iBullets, ( self.origin + self.view_ofs ) ); + Animation_ShootWeapon(); self.(wptTable[ self.weapon ].iMagfld) -= 1; self.fAttackFinished = time + wptTable[ self.weapon ].fAttackFinished; @@ -142,6 +143,7 @@ float OpenCSGunBase_Reload( void ) { self.nextthink = time + wptTable[ self.weapon ].fReloadFinished; self.fAttackFinished = self.nextthink; + Animation_ReloadWeapon(); Client_SendEvent( self, EV_WEAPON_RELOAD ); return TRUE; } diff --git a/Source/Shared/WeaponC4Bomb.c b/Source/Shared/WeaponC4Bomb.c index 46313f48..ad696bb7 100644 --- a/Source/Shared/WeaponC4Bomb.c +++ b/Source/Shared/WeaponC4Bomb.c @@ -45,8 +45,10 @@ weaponinfo_t wptC4BOMB = { 1, // Accuracy Divisor 1, // Accuracy Offset 1, // Max Inaccuracy - 8, - 4 + 8, // Minimum Crosshair Distance + 4, // Crosshair Movement Delta + 1.0, // Armor penetration ratio + ATYPE_C4 // Animation Type }; // Anim Table @@ -198,6 +200,7 @@ void WeaponC4BOMB_PrimaryFire( void ) { // If we aren't aiming at a place or look in the wrong location... stop it if ( trace_fraction == 1 || self.fInBombZone == FALSE ) { + Animation_ReloadWeapon(); WeaponC4BOMB_Release(); self.fAttackFinished = time + 1.0; return; @@ -206,6 +209,7 @@ void WeaponC4BOMB_PrimaryFire( void ) { // Play the sequence at the start if ( self.fBombProgress == 0 ) { Client_SendEvent( self, EV_WEAPON_PRIMARYATTACK ); + Animation_ShootWeapon(); } // Add onto the planting-time thing diff --git a/Source/Shared/WeaponDeagle.c b/Source/Shared/WeaponDeagle.c index 78375053..3fd44d1c 100644 --- a/Source/Shared/WeaponDeagle.c +++ b/Source/Shared/WeaponDeagle.c @@ -43,7 +43,8 @@ weaponinfo_t wptDEAGLE = { 1.4, // Max Inaccuracy 8, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.5 // Armor penetration ratio + 1.5, // Armor penetration ratio + ATYPE_ONEHAND // Animation Type }; // Anim Table @@ -91,7 +92,7 @@ void WeaponDEAGLE_PrimaryFire( void ) { void WeaponDEAGLE_Reload( void ) { #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { - // Play Sound + } #else View_PlayAnimation( ANIM_DEAGLE_RELOAD ); diff --git a/Source/Shared/WeaponElites.c b/Source/Shared/WeaponElites.c index 53d3f2b3..02df8101 100644 --- a/Source/Shared/WeaponElites.c +++ b/Source/Shared/WeaponElites.c @@ -49,7 +49,8 @@ weaponinfo_t wptELITES = { 1.4, // Max Inaccuracy 4, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.05 // Armor penetration ratio + 1.05, // Armor penetration ratio + ATYPE_DUALPISTOLS // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponFiveSeven.c b/Source/Shared/WeaponFiveSeven.c index 5bf02ceb..cc61f7b9 100644 --- a/Source/Shared/WeaponFiveSeven.c +++ b/Source/Shared/WeaponFiveSeven.c @@ -43,7 +43,8 @@ weaponinfo_t wptFIVESEVEN = { 1.4, // Max Inaccuracy 8, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.5 // Armor penetration ratio + 1.5, // Armor penetration ratio + ATYPE_ONEHAND // Animation Type }; // Anim Table @@ -57,21 +58,21 @@ enum { }; void WeaponFIVESEVEN_Draw( void ) { - #ifdef SSQC +#ifdef SSQC OpenCSGunBase_Draw(); - #else +#else View_PlayAnimation( ANIM_FIVESEVEN_DRAW ); Sound_Delayed( "weapons/fiveseven_slidepull.wav", 1.0, 0.5 ); - #endif +#endif } void WeaponFIVESEVEN_PrimaryFire( void ) { - #ifdef SSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound sound( self, CHAN_WEAPON, "weapons/fiveseven-1.wav", 1, ATTN_NORM ); } - #else +#else if ( getstatf( STAT_CURRENT_MAG ) == 0 ) { View_PlayAnimation( ANIM_FIVESEVEN_SHOOT_EMPTY ); } else { @@ -82,19 +83,18 @@ void WeaponFIVESEVEN_PrimaryFire( void ) { } } OpenCSGunBase_ShotMultiplierHandle( 1 ); - #endif +#endif } void WeaponFIVESEVEN_Reload( void ) { - #ifdef SSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { - // Play Sound } - #else +#else View_PlayAnimation( ANIM_FIVESEVEN_RELOAD ); Sound_Delayed( "weapons/p228_clipout.wav", 1.0, 0.5 ); Sound_Delayed( "weapons/p228_clipin.wav", 1.0, 1.5 ); Sound_Delayed( "weapons/p228_sliderelease.wav", 1.0, 2.4 ); - #endif +#endif } diff --git a/Source/Shared/WeaponG3SG1.c b/Source/Shared/WeaponG3SG1.c index e6c939ae..20e5f6ba 100644 --- a/Source/Shared/WeaponG3SG1.c +++ b/Source/Shared/WeaponG3SG1.c @@ -43,7 +43,8 @@ weaponinfo_t wptG3SG1 = { 1.4, // Max Inaccuracy 6, // Minimum Crosshair Distance 4, // Crosshair Movement Delta - 1.65 // Armor penetration ratio + 1.65, // Armor penetration ratio + ATYPE_CARBINE // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponGlock18.c b/Source/Shared/WeaponGlock18.c index 7e78274c..6ef59a63 100644 --- a/Source/Shared/WeaponGlock18.c +++ b/Source/Shared/WeaponGlock18.c @@ -49,7 +49,8 @@ weaponinfo_t wptGLOCK18 = { 1.4, // Max Inaccuracyy 8, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.05 // Armor penetration ratio + 1.05, // Armor penetration ratio + ATYPE_ONEHAND // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponKnife.c b/Source/Shared/WeaponKnife.c index 615e4e57..5f1dc345 100644 --- a/Source/Shared/WeaponKnife.c +++ b/Source/Shared/WeaponKnife.c @@ -41,7 +41,8 @@ weaponinfo_t wptKNIFE = { 1.0, // Max Inaccuracy 7, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.7 // Armor penetration ratio + 1.7, // Armor penetration ratio + ATYPE_KNIFE // Animation Type }; // Anim Table @@ -77,6 +78,7 @@ void WeaponKNIFE_PrimaryFire( void ) { } } + Animation_ShootWeapon(); self.fAttackFinished = time + wptKNIFE.fAttackFinished; #else if ( random() <= 0.5 ) { diff --git a/Source/Shared/WeaponM3.c b/Source/Shared/WeaponM3.c index 75084a7a..d4f11491 100644 --- a/Source/Shared/WeaponM3.c +++ b/Source/Shared/WeaponM3.c @@ -49,7 +49,8 @@ weaponinfo_t wptM3 = { 1.25, // Max Inaccuracy 8, // Minimum Crosshair Distance 6, // Crosshair Movement Delta - 1.0 // Armor penetration ratio + 1.0, // Armor penetration ratio + ATYPE_SHOTGUN // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponM4A1.c b/Source/Shared/WeaponM4A1.c index 2a9d9ccd..14fa38f5 100644 --- a/Source/Shared/WeaponM4A1.c +++ b/Source/Shared/WeaponM4A1.c @@ -49,7 +49,8 @@ weaponinfo_t wptM4A1 = { 1.0, // Max Inaccuracy 4, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.4 // Armor penetration ratio + 1.4, // Armor penetration ratio + ATYPE_RIFLE // Animation Type }; enum { diff --git a/Source/Shared/WeaponMP5.c b/Source/Shared/WeaponMP5.c index f9083c75..6ced15c0 100644 --- a/Source/Shared/WeaponMP5.c +++ b/Source/Shared/WeaponMP5.c @@ -43,7 +43,8 @@ weaponinfo_t wptMP5 = { 0.75, // Max Inaccuracy 6, // Minimum Crosshair Distance 2, // Crosshair Movement Delta - 1.0 // Armor penetration ratio + 1.0, // Armor penetration ratio + ATYPE_MP5 // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponMac10.c b/Source/Shared/WeaponMac10.c index 2d8ee340..dbea4fc9 100644 --- a/Source/Shared/WeaponMac10.c +++ b/Source/Shared/WeaponMac10.c @@ -43,7 +43,8 @@ weaponinfo_t wptMAC10 = { 1.65, // Max Inaccuracy 9, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 0.95 // Armor penetration ratio + 0.95, // Armor penetration ratio + ATYPE_MP5 // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponP228.c b/Source/Shared/WeaponP228.c index e65d2fa7..1f118a36 100644 --- a/Source/Shared/WeaponP228.c +++ b/Source/Shared/WeaponP228.c @@ -42,7 +42,8 @@ weaponinfo_t wptP228 = { 1.4, // Max Inaccuracy 8, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.25 // Armor penetration ratio + 1.25, // Armor penetration ratio + ATYPE_ONEHAND // Animation Type }; // Anim Table @@ -93,7 +94,6 @@ void WeaponP228_PrimaryFire( void ) { void WeaponP228_Reload( void ) { #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { - // Play Sound } #else View_PlayAnimation( ANIM_P228_RELOAD ); diff --git a/Source/Shared/WeaponP90.c b/Source/Shared/WeaponP90.c index 09a40bbe..dfb2ddd8 100644 --- a/Source/Shared/WeaponP90.c +++ b/Source/Shared/WeaponP90.c @@ -43,7 +43,8 @@ weaponinfo_t wptP90 = { 1.0, // Max Inaccuracy 7, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.5 // Armor penetration ratio + 1.5, // Armor penetration ratio + ATYPE_MP5 // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponPara.c b/Source/Shared/WeaponPara.c index 8de47c0f..c36ecca0 100644 --- a/Source/Shared/WeaponPara.c +++ b/Source/Shared/WeaponPara.c @@ -43,7 +43,8 @@ weaponinfo_t wptPARA = { 0.9, // Max Inaccuracy 6, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.6 // Armor penetration ratio + 1.6, // Armor penetration ratio + ATYPE_PARA // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponSG550.c b/Source/Shared/WeaponSG550.c index 77e7998c..da2ffc43 100644 --- a/Source/Shared/WeaponSG550.c +++ b/Source/Shared/WeaponSG550.c @@ -43,7 +43,8 @@ weaponinfo_t wptSG550 = { 1.4, // Max Inaccuracy 5, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.45 // Armor penetration ratio + 1.45, // Armor penetration ratio + ATYPE_RIFLE // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponSG552.c b/Source/Shared/WeaponSG552.c index 41beeacb..06d95890 100644 --- a/Source/Shared/WeaponSG552.c +++ b/Source/Shared/WeaponSG552.c @@ -43,7 +43,8 @@ weaponinfo_t wptSG552 = { 1.0, // Max Inaccuracy 5, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.4 // Armor penetration ratio + 1.4, // Armor penetration ratio + ATYPE_RIFLE // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponScout.c b/Source/Shared/WeaponScout.c index 45829dfd..8e55e0a6 100644 --- a/Source/Shared/WeaponScout.c +++ b/Source/Shared/WeaponScout.c @@ -43,7 +43,8 @@ weaponinfo_t wptSCOUT = { 1.4, // Max Inaccuracy 5, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.7 // Armor penetration ratio + 1.7, // Armor penetration ratio + ATYPE_CARBINE // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponTMP.c b/Source/Shared/WeaponTMP.c index 81445495..bb72cd65 100644 --- a/Source/Shared/WeaponTMP.c +++ b/Source/Shared/WeaponTMP.c @@ -43,7 +43,8 @@ weaponinfo_t wptTMP = { 1.4, // Max Inaccuracy 7, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.0 // Armor penetration ratio + 1.0, // Armor penetration ratio + ATYPE_MP5 // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponUMP45.c b/Source/Shared/WeaponUMP45.c index e811b276..a2e139e7 100644 --- a/Source/Shared/WeaponUMP45.c +++ b/Source/Shared/WeaponUMP45.c @@ -43,7 +43,8 @@ weaponinfo_t wptUMP45 = { 1, // Max Inaccuracy 6, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.0 // Armor penetration ratio + 1.0, // Armor penetration ratio + ATYPE_MP5 // Animation Type }; // Anim Table diff --git a/Source/Shared/WeaponUSP45.c b/Source/Shared/WeaponUSP45.c index 3dad8467..e899d644 100644 --- a/Source/Shared/WeaponUSP45.c +++ b/Source/Shared/WeaponUSP45.c @@ -49,7 +49,8 @@ weaponinfo_t wptUSP45 = { 1.4, // Max Inaccuracy 8, // Minimum Crosshair Distance 3, // Crosshair Movement Delta - 1.0 // Armor penetration ratio + 1.0, // Armor penetration ratio + ATYPE_ONEHAND // Animation Type }; enum { @@ -157,7 +158,7 @@ void WeaponUSP45_Secondary( void ) { void WeaponUSP45_Reload( void ) { #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { - // Play Sound + } #else if ( iWeaponMode_USP45 == TRUE ) { diff --git a/Source/Shared/WeaponXM1014.c b/Source/Shared/WeaponXM1014.c index 1e201951..212163f9 100644 --- a/Source/Shared/WeaponXM1014.c +++ b/Source/Shared/WeaponXM1014.c @@ -49,7 +49,8 @@ weaponinfo_t wptXM1014 = { 1.25, // Max Inaccuracy 9, // Minimum Crosshair Distance 4, // Crosshair Movement Delta - 1.0 // Armor penetration ratio + 1.0, // Armor penetration ratio + ATYPE_SHOTGUN // Animation Type }; // Anim Table diff --git a/Source/Shared/Weapons.c b/Source/Shared/Weapons.c index 878e1bad..8b3df395 100644 --- a/Source/Shared/Weapons.c +++ b/Source/Shared/Weapons.c @@ -208,4 +208,16 @@ void CSEv_PlayerSwitchWeapon_f( float fWeapon ) { self.fAttackFinished = time + 1.0; } + +float Weapon_GetAnimType( float fWeapon ) { + return wptTable[ fWeapon ].fAnimType; +} + +float Weapon_GetFireRate( float fWeapon ) { + return wptTable[ fWeapon ].fAttackFinished; +} + +float Weapon_GetReloadTime( float fWeapon ) { + return wptTable[ fWeapon ].fReloadFinished; +} #endif diff --git a/opencs/csprogs.dat b/opencs/csprogs.dat index 6b7ed9f0..2a159126 100644 Binary files a/opencs/csprogs.dat and b/opencs/csprogs.dat differ diff --git a/opencs/progs.dat b/opencs/progs.dat index c1f78839..173314a0 100644 Binary files a/opencs/progs.dat and b/opencs/progs.dat differ