Improved crouching by a ton, changed speed handling (via multipliers) and fixed the timer so that we can do cool things which will come in later.
This commit is contained in:
parent
f3553f5938
commit
ba88b9e818
38 changed files with 255 additions and 106 deletions
|
@ -42,7 +42,8 @@ string sViewModels[ CS_WEAPON_COUNT ] = {
|
|||
"models/v_awp.mdl",
|
||||
"models/v_g3sg1.mdl",
|
||||
"models/v_sg550.mdl",
|
||||
"models/v_m249.mdl"
|
||||
"models/v_m249.mdl",
|
||||
"models/v_c4.mdl"
|
||||
};
|
||||
|
||||
entity eViewModel;
|
||||
|
|
|
@ -12,6 +12,7 @@ Defs.h
|
|||
../Shared/WeaponAK47.c
|
||||
../Shared/WeaponAUG.c
|
||||
../Shared/WeaponAWP.c
|
||||
../Shared/WeaponC4Bomb.c
|
||||
../Shared/WeaponDeagle.c
|
||||
../Shared/WeaponElites.c
|
||||
../Shared/WeaponFiveSeven.c
|
||||
|
|
|
@ -44,12 +44,13 @@ enum {
|
|||
|
||||
enum {
|
||||
GAME_INACTIVE,
|
||||
GAME_COMMENCING,
|
||||
GAME_FREEZE,
|
||||
GAME_ACTIVE,
|
||||
GAME_END
|
||||
};
|
||||
|
||||
#define CS_WEAPON_COUNT 24
|
||||
#define CS_WEAPON_COUNT 25
|
||||
enum {
|
||||
WEAPON_NONE = 0,
|
||||
WEAPON_KNIFE,
|
||||
|
@ -74,7 +75,8 @@ enum {
|
|||
WEAPON_AWP,
|
||||
WEAPON_G3SG1,
|
||||
WEAPON_SG550,
|
||||
WEAPON_PARA
|
||||
WEAPON_PARA,
|
||||
WEAPON_C4BOMB
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -121,7 +123,7 @@ typedef struct {
|
|||
int iSlot;
|
||||
int iPrice;
|
||||
int iCaliber;
|
||||
int iPlayerSpeed;
|
||||
float fSpeedM;
|
||||
|
||||
int iBullets; // How many bullets does it shoot?
|
||||
int iClipSize; // How big is the clip/magazine?
|
||||
|
|
|
@ -27,9 +27,13 @@ void ClientDisconnect( void ) {
|
|||
// We were part of the session
|
||||
if( self.iInGame == TRUE ) {
|
||||
if ( self.team == TEAM_T ) {
|
||||
iInGamePlayers_T--;
|
||||
if ( self.health > 0 ) {
|
||||
iAlivePlayers_T--;
|
||||
}
|
||||
} else if ( self.team == TEAM_CT ) {
|
||||
iInGamePlayers_CT--;
|
||||
if ( self.health > 0 ) {
|
||||
iAlivePlayers_CT--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,12 +41,14 @@ float EFFECT_BLOOD;
|
|||
.float fCharModel;
|
||||
.int iCrouching;
|
||||
.int iCrouchAttempt;
|
||||
.int iHasBomb;
|
||||
|
||||
// Match specific fields
|
||||
int iWon_T;
|
||||
int iWon_CT;
|
||||
int iInGamePlayers_T;
|
||||
int iInGamePlayers_CT;
|
||||
|
||||
int iAlivePlayers_T;
|
||||
int iAlivePlayers_CT;
|
||||
int fOldInGamePlayers;
|
||||
|
||||
float fGameState;
|
||||
|
@ -103,11 +105,13 @@ void Spawn_RespawnClient( float fTeam );
|
|||
void Spawn_CreateClient( float fTeam );
|
||||
void Spawn_MakeSpectator( void );
|
||||
void Client_SendEvent( entity eClient, float fEVType );
|
||||
void Weapon_SwitchBest( void );
|
||||
|
||||
void OpenCSGunBase_AccuracyCalc( void );
|
||||
void OpenCSGunBase_Draw( void );
|
||||
float OpenCSGunBase_PrimaryFire( void );
|
||||
float OpenCSGunBase_Reload( void );
|
||||
float Player_GetMaxSpeed( float fWeapon );
|
||||
|
||||
void TraceAttack_FireBullets( int iShots );
|
||||
|
||||
|
|
|
@ -49,6 +49,4 @@ void func_escapezone( void ) {
|
|||
|
||||
self.model = 0;
|
||||
self.touch = func_escapezone_touch;
|
||||
|
||||
iRescueZones++;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ void func_hostage_rescue_touch( void ) {
|
|||
remove( other );
|
||||
|
||||
if ( iHostagesRescued >= iHostagesMax ) {
|
||||
// TODO: Broadcast_Print: All Hostages have been rescued!
|
||||
Rules_RoundOver( TEAM_CT );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,13 +30,18 @@ void StartFrame( void ) {
|
|||
Game_CreateRescueZones();
|
||||
}
|
||||
|
||||
// Global amount of players etc.
|
||||
int iInGamePlayers = ( iInGamePlayers_T + iInGamePlayers_CT );
|
||||
int iInGamePlayers;
|
||||
// Sigh, check if clients are in the game
|
||||
if ( find( world, classname , "player" ) != world ) {
|
||||
iInGamePlayers = 100;
|
||||
} else {
|
||||
iInGamePlayers = 0;
|
||||
}
|
||||
|
||||
// See if the player count has changed
|
||||
if ( iInGamePlayers > fOldInGamePlayers && fGameState == GAME_INACTIVE ) {
|
||||
bprint( "Starting Match...\n" );
|
||||
Timer_Begin( cvar( "mp_freezetime" ), GAME_FREEZE );
|
||||
if ( iInGamePlayers > fOldInGamePlayers ) {
|
||||
bprint( "Game commencing...\n" );
|
||||
Timer_Begin( 2, GAME_COMMENCING );
|
||||
fOldInGamePlayers = iInGamePlayers;
|
||||
} else {
|
||||
// No players? Don't bother updating the Timer
|
||||
|
@ -51,14 +56,15 @@ void StartFrame( void ) {
|
|||
|
||||
// The map... entity.
|
||||
void worldspawn( void ) {
|
||||
precache_model (sCSPlayers[1]);
|
||||
precache_model (sCSPlayers[2]);
|
||||
precache_model (sCSPlayers[3]);
|
||||
precache_model (sCSPlayers[4]);
|
||||
precache_model (sCSPlayers[5]);
|
||||
precache_model (sCSPlayers[6]);
|
||||
precache_model (sCSPlayers[7]);
|
||||
precache_model (sCSPlayers[8]);
|
||||
precache_model( sCSPlayers[1] );
|
||||
precache_model( sCSPlayers[2] );
|
||||
precache_model( sCSPlayers[3] );
|
||||
precache_model( sCSPlayers[4] );
|
||||
precache_model( sCSPlayers[5] );
|
||||
precache_model( sCSPlayers[6] );
|
||||
precache_model( sCSPlayers[7] );
|
||||
precache_model( sCSPlayers[8] );
|
||||
precache_model( "models/w_c4.mdl" );
|
||||
|
||||
EFFECT_GUNSHOT = particleeffectnum( "te_gunshot" );
|
||||
EFFECT_BLOOD = particleeffectnum( "te_blood" );
|
||||
|
@ -71,6 +77,7 @@ void worldspawn( void ) {
|
|||
precache_sound( "radio/terwin.wav" );
|
||||
precache_sound( "radio/ctwin.wav" );
|
||||
precache_sound( "radio/rounddraw.wav" );
|
||||
precache_sound( "radio/bombpl.wav" );
|
||||
|
||||
precache_sound( "hostage/hos1.wav" );
|
||||
precache_sound( "hostage/hos2.wav" );
|
||||
|
|
|
@ -34,15 +34,15 @@ void Player_Death( void ) {
|
|||
Spawn_MakeSpectator();
|
||||
|
||||
if ( self.team == TEAM_T ) {
|
||||
iInGamePlayers_T--;
|
||||
iAlivePlayers_T--;
|
||||
|
||||
if ( iInGamePlayers_T == 0 ) {
|
||||
if ( iAlivePlayers_T == 0 ) {
|
||||
Rules_RoundOver( TEAM_CT );
|
||||
}
|
||||
} else if ( self.team == TEAM_CT ) {
|
||||
iInGamePlayers_CT--;
|
||||
iAlivePlayers_CT--;
|
||||
|
||||
if ( iInGamePlayers_CT == 0 ) {
|
||||
if ( iAlivePlayers_T == 0 ) {
|
||||
Rules_RoundOver( TEAM_T );
|
||||
}
|
||||
} else if ( self.team == TEAM_VIP ) {
|
||||
|
@ -50,39 +50,27 @@ void Player_Death( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
float Player_GetMaxSpeed( float fWeapon ) {
|
||||
if ( self.iCrouching == TRUE ) {
|
||||
return (cvar( "cl_forwardspeed" ) * wptTable[ fWeapon ].fSpeedM) * 0.5;
|
||||
} else {
|
||||
return cvar( "cl_forwardspeed" ) * wptTable[ fWeapon ].fSpeedM;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Player_CrouchCheck
|
||||
|
||||
TODO: Tracebox implementation sucks, BUT SHOULD BE USED HERE.
|
||||
This is just a hack because for some reason traceboxes hate HLBSP
|
||||
=================
|
||||
*/
|
||||
float Player_CrouchCheck( entity targ ) {
|
||||
float fCheck = TRUE;
|
||||
float fCheck = FALSE;
|
||||
vector vTrace = self.origin + '0 0 20';
|
||||
|
||||
traceline( vTrace + '0 0 -36', vTrace + '0 0 36', FALSE, self );
|
||||
if ( trace_fraction != 1 ) {
|
||||
fCheck = FALSE;
|
||||
}
|
||||
|
||||
// Now the 4 edges
|
||||
traceline( vTrace + '-16 0 -36', vTrace + '-16 0 36', FALSE, self );
|
||||
if ( trace_fraction != 1 ) {
|
||||
fCheck = FALSE;
|
||||
}
|
||||
traceline( vTrace + '0 -16 -36', vTrace + '0 -16 36', FALSE, self );
|
||||
if ( trace_fraction != 1 ) {
|
||||
fCheck = FALSE;
|
||||
}
|
||||
traceline( vTrace + '16 0 -36', vTrace + '16 0 36', FALSE, self );
|
||||
if ( trace_fraction != 1 ) {
|
||||
fCheck = FALSE;
|
||||
}
|
||||
traceline( vTrace + '0 16 -36', vTrace + '0 16 36', FALSE, self );
|
||||
if ( trace_fraction != 1 ) {
|
||||
fCheck = FALSE;
|
||||
tracebox( vTrace, VEC_HULL_MIN, VEC_HULL_MAX, vTrace, FALSE, self );
|
||||
|
||||
if ( trace_startsolid == FALSE ) {
|
||||
fCheck = TRUE;
|
||||
}
|
||||
|
||||
return fCheck;
|
||||
|
@ -103,6 +91,7 @@ void Player_CrouchDown( void ) {
|
|||
self.iCrouching = TRUE;
|
||||
self.view_ofs = VEC_PLAYER_CVIEWPOS;
|
||||
self.velocity_z = self.velocity_z + 50;
|
||||
self.maxspeed = Player_GetMaxSpeed( self.weapon );
|
||||
self.iCrouchAttempt = 1;
|
||||
return;
|
||||
}
|
||||
|
@ -128,7 +117,7 @@ void Player_CrouchUp( void ) {
|
|||
self.view_ofs = VEC_PLAYER_VIEWPOS;
|
||||
self.iCrouching = FALSE;
|
||||
self.iCrouchAttempt = FALSE;
|
||||
|
||||
self.maxspeed = Player_GetMaxSpeed( self.weapon );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ void Rules_TimeOver( void ) {
|
|||
if ( iBombZones > 0 ) {
|
||||
Rules_RoundOver( TEAM_CT );
|
||||
} else if ( iHostagesMax > 0 ) {
|
||||
// TODO: Broadcast_Print: Hostages have not been rescued!
|
||||
Rules_RoundOver( TEAM_T );
|
||||
} else {
|
||||
Rules_RoundOver( 0 );
|
||||
|
|
|
@ -83,6 +83,7 @@ void Spawn_RespawnClient( float fTeam ) {
|
|||
self.velocity = '0 0 0';
|
||||
|
||||
self.frame = 1; // Idle frame
|
||||
self.fBombProgress = 0;
|
||||
}
|
||||
|
||||
void Spawn_CreateClient( float fCharModel ) {
|
||||
|
@ -92,13 +93,14 @@ void Spawn_CreateClient( float fCharModel ) {
|
|||
return;
|
||||
} else if( fCharModel < 5 ) {
|
||||
self.team = TEAM_T;
|
||||
iInGamePlayers_T++;
|
||||
iAlivePlayers_T++;
|
||||
|
||||
Weapon_AddItem( WEAPON_GLOCK18 );
|
||||
Weapon_GiveAmmo( WEAPON_GLOCK18, 40 );
|
||||
//Weapon_AddItem( WEAPON_C4BOMB );
|
||||
} else {
|
||||
self.team = TEAM_CT;
|
||||
iInGamePlayers_CT++;
|
||||
iAlivePlayers_CT++;
|
||||
|
||||
Weapon_AddItem( WEAPON_USP45 );
|
||||
Weapon_GiveAmmo( WEAPON_USP45, 24 );
|
||||
|
@ -140,27 +142,32 @@ void Spawn_MakeSpectator( void ) {
|
|||
|
||||
// Event Handling, called by the Client codebase via 'sendevent'
|
||||
void CSEv_GamePlayerSpawn_f( float fChar ) {
|
||||
// Only allow to spawn directly into the game if we are still freezed/inactive
|
||||
if ( fGameState == GAME_ACTIVE || fGameState == GAME_END ) {
|
||||
// Yeah, set the future player model and stuff but let's act dead
|
||||
if( fChar == 0 ) {
|
||||
PutClientInServer();
|
||||
return;
|
||||
} else if( fChar < 5 ) {
|
||||
self.team = TEAM_T;
|
||||
} else {
|
||||
self.team = TEAM_CT;
|
||||
}
|
||||
|
||||
self.classname = "player";
|
||||
self.fCharModel = fChar;
|
||||
self.health = 0;
|
||||
Spawn_MakeSpectator();
|
||||
} else {
|
||||
self.fCharModel = fChar;
|
||||
Spawn_CreateClient( fChar );
|
||||
}
|
||||
|
||||
switch ( fGameState ) {
|
||||
case GAME_INACTIVE:
|
||||
case GAME_COMMENCING:
|
||||
case GAME_ACTIVE:
|
||||
case GAME_END:
|
||||
if( fChar == 0 ) {
|
||||
PutClientInServer();
|
||||
return;
|
||||
} else if( fChar < 5 ) {
|
||||
self.team = TEAM_T;
|
||||
} else {
|
||||
self.team = TEAM_CT;
|
||||
}
|
||||
|
||||
self.classname = "player";
|
||||
self.fCharModel = fChar;
|
||||
self.health = 0;
|
||||
Spawn_MakeSpectator();
|
||||
break;
|
||||
default:
|
||||
self.fCharModel = fChar;
|
||||
Spawn_CreateClient( fChar );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Counter-Terrorist Spawnpoints
|
||||
|
|
|
@ -24,23 +24,33 @@ void Timer_Begin( float fTime, float fMode) {
|
|||
dprint( "[DEBUG] Game Freezetime\n" );
|
||||
fGameState = GAME_FREEZE;
|
||||
} else if ( fMode == GAME_ACTIVE ) {
|
||||
dprint( "[DEBUG] Game Started\n" );
|
||||
dprint( "[DEBUG] Game Active\n" );
|
||||
fGameState = GAME_ACTIVE;
|
||||
} else if ( fMode == GAME_END ) {
|
||||
dprint( "[DEBUG] Game Ended\n" );
|
||||
fGameState = GAME_END;
|
||||
} else if ( fMode == GAME_COMMENCING ) {
|
||||
dprint( "[DEBUG] Game Commencing\n" );
|
||||
fGameState = GAME_COMMENCING;
|
||||
}
|
||||
|
||||
fGameTime = fTime;
|
||||
}
|
||||
|
||||
void Timer_Update( void ) {
|
||||
if ( fGameTime <= 0 || fGameState == GAME_INACTIVE ) {
|
||||
if ( fGameState == GAME_INACTIVE ) {
|
||||
return;
|
||||
}
|
||||
|
||||
fGameTime -= frametime;
|
||||
|
||||
if ( fGameState == GAME_COMMENCING || fGameState == GAME_END ) {
|
||||
if ( fGameTime <= 0 ) {
|
||||
Rules_Restart();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ( fGameState == GAME_ACTIVE ) || ( fGameState == GAME_FREEZE ) ) {
|
||||
if ( fGameTime <= 0 ) {
|
||||
if ( fGameState == GAME_ACTIVE ) {
|
||||
|
@ -59,9 +69,5 @@ void Timer_Update( void ) {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if ( fGameState == GAME_END ) {
|
||||
if ( fGameTime <= 0 ) {
|
||||
Rules_Restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ Defs.h
|
|||
../Shared/WeaponAK47.c
|
||||
../Shared/WeaponAUG.c
|
||||
../Shared/WeaponAWP.c
|
||||
../Shared/WeaponC4Bomb.c
|
||||
../Shared/WeaponDeagle.c
|
||||
../Shared/WeaponElites.c
|
||||
../Shared/WeaponFiveSeven.c
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptAK47 = {
|
|||
SLOT_PRIMARY,
|
||||
2500, // Price
|
||||
CALIBER_762MM, // Caliber ID
|
||||
221, // Max Player Speed
|
||||
0.88, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
36, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptAUG = {
|
|||
SLOT_PRIMARY,
|
||||
3500, // Price
|
||||
CALIBER_762MM, // Caliber ID
|
||||
221, // Max Player Speed
|
||||
0.96, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
32, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptAWP = {
|
|||
SLOT_PRIMARY,
|
||||
4750, // Price
|
||||
CALIBER_338MAG, // Caliber ID
|
||||
210, // Max Player Speed
|
||||
0.84, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
10, // Clip/MagSize
|
||||
115, // Damage Per Bullet
|
||||
|
|
|
@ -45,7 +45,8 @@ weaponinfo_t wptTable[ CS_WEAPON_COUNT ] = {
|
|||
wptAWP,
|
||||
wptG3SG1,
|
||||
wptSG550,
|
||||
wptPARA
|
||||
wptPARA,
|
||||
wptC4BOMB
|
||||
};
|
||||
|
||||
#ifdef SSQC
|
||||
|
|
115
Source/Shared/WeaponC4Bomb.c
Normal file
115
Source/Shared/WeaponC4Bomb.c
Normal file
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
OpenCS Project
|
||||
Copyright (C) 2015 Marco "eukara" Hladik
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef SSQC
|
||||
.float fBombProgress;
|
||||
#else
|
||||
int iBombProgress;
|
||||
#endif
|
||||
|
||||
// Weapon Info
|
||||
weaponinfo_t wptC4BOMB = {
|
||||
WEAPON_C4BOMB, // Identifier
|
||||
SLOT_GRENADE,
|
||||
650, // Price
|
||||
CALIBER_50AE, // Caliber ID
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
1, // Clip/MagSize
|
||||
54, // Damage
|
||||
1, // Penetration Multiplier
|
||||
64, // Bullet Range
|
||||
0.81, // Range Modifier
|
||||
TYPE_AUTO,
|
||||
0.0, // Attack-Delay
|
||||
0.0, // Reload-Delay
|
||||
iAmmo_9MM, // Caliber Pointer
|
||||
iAmmo_9MM, // Clip Pointer
|
||||
1, // Accuracy Divisor
|
||||
1, // Accuracy Offset
|
||||
1 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
enum {
|
||||
ANIM_C4_IDLE,
|
||||
ANIM_C4_DRAW,
|
||||
ANIM_C4_DROP,
|
||||
ANIM_C4_ENTERCODE
|
||||
};
|
||||
|
||||
#ifdef SSQC
|
||||
void WeaponC4BOMB_Drop( vector vBombPos ) {
|
||||
entity eBomb = spawn();
|
||||
setorigin( eBomb, vBombPos );
|
||||
setmodel( eBomb, "models/w_c4.mdl" );
|
||||
|
||||
sound( world, CHAN_VOICE, "radio/bombpl.wav", 1.0, ATTN_NONE );
|
||||
|
||||
Weapon_SwitchBest();
|
||||
}
|
||||
#endif
|
||||
|
||||
void WeaponC4BOMB_Draw( void ) {
|
||||
#ifdef SSQC
|
||||
self.iCurrentClip = 0;
|
||||
self.iCurrentCaliber = 0;
|
||||
Client_SendEvent( self, EV_WEAPON_DRAW );
|
||||
#else
|
||||
View_PlayAnimation( ANIM_C4_DRAW );
|
||||
#endif
|
||||
}
|
||||
|
||||
void WeaponC4BOMB_Release( void ) {
|
||||
#ifdef SSQC
|
||||
self.fBombProgress = 0;
|
||||
#else
|
||||
View_PlayAnimation( ANIM_C4_IDLE );
|
||||
iBombProgress = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void WeaponC4BOMB_PrimaryFire( void ) {
|
||||
#ifdef SSQC
|
||||
makevectors( self.v_angle );
|
||||
traceline( self.origin + self.view_ofs, self.origin + self.view_ofs + ( v_forward * 64 ), FALSE, self );
|
||||
|
||||
if ( trace_fraction == 1 || self.fInBombZone == FALSE ) {
|
||||
WeaponC4BOMB_Release();
|
||||
self.fAttackFinished = time + 1.0;
|
||||
}
|
||||
|
||||
// Play the sequence at the start
|
||||
if ( self.fBombProgress == 0 ) {
|
||||
Client_SendEvent( self, EV_WEAPON_PRIMARYATTACK );
|
||||
}
|
||||
|
||||
// Add onto the planting-time thing
|
||||
self.fBombProgress += frametime;
|
||||
|
||||
// 3 seconds have passed, plant the bomb
|
||||
if ( self.fBombProgress >= 3.0 ) {
|
||||
Client_SendEvent( self, EV_WEAPON_SECONDARYATTACK ); // This means we'll drop the bomb on CSQC
|
||||
WeaponC4BOMB_Drop( trace_endpos );
|
||||
}
|
||||
#else
|
||||
View_PlayAnimation( ANIM_C4_ENTERCODE );
|
||||
#endif
|
||||
}
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptDEAGLE = {
|
|||
SLOT_SECONDARY,
|
||||
650, // Price
|
||||
CALIBER_50AE, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
7, // Clip/MagSize
|
||||
54, // Damage Per Bullet
|
||||
|
|
|
@ -32,7 +32,7 @@ weaponinfo_t wptELITES = {
|
|||
SLOT_SECONDARY,
|
||||
800, // Price
|
||||
CALIBER_9MM, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
45, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptFIVESEVEN = {
|
|||
SLOT_SECONDARY,
|
||||
750, // Price
|
||||
CALIBER_57MM, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
20, // Clip/MagSize
|
||||
25, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptG3SG1 = {
|
|||
SLOT_PRIMARY,
|
||||
5000, // Price
|
||||
CALIBER_762MM, // Caliber ID
|
||||
210, // Max Player Speed
|
||||
0.84, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
20, // Clip/MagSize
|
||||
80, // Damage Per Bullet
|
||||
|
|
|
@ -32,7 +32,7 @@ weaponinfo_t wptGLOCK18 = {
|
|||
SLOT_SECONDARY,
|
||||
400, // Price
|
||||
CALIBER_9MM, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
20, // Clip/MagSize
|
||||
25, // Damage Per Bullet
|
||||
|
|
|
@ -32,7 +32,7 @@ weaponinfo_t wptM3 = {
|
|||
SLOT_PRIMARY,
|
||||
1700, // Price
|
||||
CALIBER_BUCKSHOT, // Caliber ID
|
||||
220, // Max Player Speed
|
||||
0.92, // Max Player Speed
|
||||
9, // Bullets Per Shot
|
||||
8, // Clip/MagSize
|
||||
26, // Damage Per Bullet
|
||||
|
|
|
@ -32,7 +32,7 @@ weaponinfo_t wptM4A1 = {
|
|||
SLOT_PRIMARY,
|
||||
3100, // Price
|
||||
CALIBER_556MM, // Caliber ID
|
||||
230, // Max Player Speed
|
||||
0.92, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
33, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptMP5 = {
|
|||
SLOT_PRIMARY,
|
||||
1500, // Price
|
||||
CALIBER_9MM, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
26, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptMAC10 = {
|
|||
SLOT_PRIMARY,
|
||||
1400, // Price
|
||||
CALIBER_45ACP, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
29, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptP228 = {
|
|||
SLOT_SECONDARY,
|
||||
600, // Price
|
||||
CALIBER_357SIG, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
13, // Clip/MagSize
|
||||
40, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptP90 = {
|
|||
SLOT_PRIMARY,
|
||||
2350, // Price
|
||||
CALIBER_57MM, // Caliber ID
|
||||
235, // Max Player Speed
|
||||
0.98, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
50, // Clip/MagSize
|
||||
26, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptPARA = {
|
|||
SLOT_PRIMARY,
|
||||
5750, // Price
|
||||
CALIBER_556MMBOX, // Caliber ID
|
||||
220, // Max Player Speed
|
||||
0.88, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
100, // Clip/MagSize
|
||||
35, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptSG550 = {
|
|||
SLOT_PRIMARY,
|
||||
4200, // Price
|
||||
CALIBER_556MM, // Caliber ID
|
||||
210, // Max Player Speed
|
||||
0.84, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
70, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptSG552 = {
|
|||
SLOT_PRIMARY,
|
||||
3500, // Price
|
||||
CALIBER_556MM, // Caliber ID
|
||||
235, // Max Player Speed
|
||||
0.94, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
33, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptSCOUT = {
|
|||
SLOT_PRIMARY,
|
||||
2750, // Price
|
||||
CALIBER_762MM, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.04, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
10, // Clip/MagSize
|
||||
75, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptTMP = {
|
|||
SLOT_PRIMARY,
|
||||
1250, // Price
|
||||
CALIBER_9MM, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
30, // Clip/MagSize
|
||||
26, // Damage Per Bullet
|
||||
|
|
|
@ -26,7 +26,7 @@ weaponinfo_t wptUMP45 = {
|
|||
SLOT_PRIMARY,
|
||||
1700, // Price
|
||||
CALIBER_45ACP, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
25, // Clip/MagSize
|
||||
30, // Damage Per Bullet
|
||||
|
|
|
@ -32,7 +32,7 @@ weaponinfo_t wptUSP45 = {
|
|||
SLOT_SECONDARY,
|
||||
500, // Price
|
||||
CALIBER_45ACP, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
1.0, // Max Player Speed
|
||||
1, // Bullets Per Shot
|
||||
12, // Clip/MagSize
|
||||
34, // Damage Per Bullet
|
||||
|
|
|
@ -32,7 +32,7 @@ weaponinfo_t wptXM1014 = {
|
|||
SLOT_PRIMARY,
|
||||
3000, // Price
|
||||
CALIBER_BUCKSHOT, // Caliber ID
|
||||
240, // Max Player Speed
|
||||
0.96, // Max Player Speed
|
||||
6, // Bullets Per Shot
|
||||
7, // Clip/MagSize
|
||||
22, // Damage Per Bullet
|
||||
|
|
|
@ -49,7 +49,8 @@ weaponfunc_t wpnFuncTable[ CS_WEAPON_COUNT ] = {
|
|||
{ WeaponAWP_Draw, WeaponAWP_PrimaryFire, Temp_Nothing, WeaponAWP_Reload },
|
||||
{ WeaponG3SG1_Draw, WeaponG3SG1_PrimaryFire, Temp_Nothing, WeaponG3SG1_Reload },
|
||||
{ WeaponSG550_Draw, WeaponSG550_PrimaryFire, Temp_Nothing, WeaponSG550_Reload },
|
||||
{ WeaponPARA_Draw, WeaponPARA_PrimaryFire, Temp_Nothing, WeaponPARA_Reload }
|
||||
{ WeaponPARA_Draw, WeaponPARA_PrimaryFire, Temp_Nothing, WeaponPARA_Reload },
|
||||
{ WeaponC4BOMB_Draw, WeaponC4BOMB_PrimaryFire, Temp_Nothing, Temp_Nothing }
|
||||
};
|
||||
|
||||
void Weapon_Draw( float fWeapon ) {
|
||||
|
@ -60,7 +61,7 @@ void Weapon_Draw( float fWeapon ) {
|
|||
wpnFuncTable[ fWeapon ].vDraw();
|
||||
|
||||
#ifdef SSQC
|
||||
self.maxspeed = (float)wptTable[ fWeapon ].iPlayerSpeed;
|
||||
self.maxspeed = Player_GetMaxSpeed( fWeapon );
|
||||
self.fAttackFinished = time + 1.0;
|
||||
#endif
|
||||
}
|
||||
|
@ -157,6 +158,16 @@ void Weapon_GiveAmmo( float fWeapon, float fAmount ) {
|
|||
Weapon_UpdateCurrents();
|
||||
}
|
||||
|
||||
void Weapon_SwitchBest( void ) {
|
||||
if ( self.iSlotSecondary ) {
|
||||
Weapon_Switch( SLOT_SECONDARY );
|
||||
} else if ( self.iSlotPrimary ) {
|
||||
Weapon_Switch( SLOT_PRIMARY );
|
||||
} else {
|
||||
Weapon_Switch( SLOT_MELEE );
|
||||
}
|
||||
}
|
||||
|
||||
void CSEv_GamePlayerBuy_f( float fWeapon ) {
|
||||
if ( Rules_BuyingPossible() == FALSE ) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue