Additive rendermodes for brushents, basic damage system & hostage deaths

This commit is contained in:
Marco Hladik 2016-12-03 00:12:10 +01:00
parent bb4a790f62
commit 6378be9043
34 changed files with 337 additions and 126 deletions

View file

@ -109,6 +109,7 @@ enum {
SLOT_GRENADE SLOT_GRENADE
}; };
// These values are taken from CS:S' .ctx script files
typedef struct { typedef struct {
int iWeaponID; // Identifier int iWeaponID; // Identifier
int iSlot; int iSlot;
@ -131,6 +132,10 @@ typedef struct {
.int iCaliberfld; // Pointer towards the caliberfield of the gun .int iCaliberfld; // Pointer towards the caliberfield of the gun
.int iClipfld; // Pointer towards the clip of the gun .int iClipfld; // Pointer towards the clip of the gun
float fAccuracyDivisor;
float fAccuracyOffset;
float fMaxInaccuracy;
} weaponinfo_t; } weaponinfo_t;
typedef struct { typedef struct {

View file

@ -34,7 +34,9 @@ void PlayerPreThink( void ) {
Input_Handle(); Input_Handle();
} }
void PlayerPostThink( void ) {} void PlayerPostThink( void ) {
}
void PutClientInServer( void ) { void PutClientInServer( void ) {
entity eSpawn; entity eSpawn;

41
Source/Server/Damage.c Normal file
View file

@ -0,0 +1,41 @@
/*
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.
*/
void Damage_Apply( entity eTarget, entity eAttacker, float fWeapon, vector vHitPos ) {
eTarget.health = eTarget.health - wptTable[ self.weapon ].iDamage; // TODO: Body part multipliers
if ( eTarget.iBleeds == TRUE ) {
makevectors( eAttacker.angles );
pointparticles( EFFECT_BLOOD, vHitPos, v_forward * -1, 1 );
}
entity eOld = self;
self = eTarget;
if ( eTarget.health <= 0 ) {
eTarget.health = 0;
eTarget.vDeath();
} else {
eTarget.vPain();
}
self = eOld;
}

View file

@ -21,6 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define VEC_HULL_MIN '-16 -16 -36' #define VEC_HULL_MIN '-16 -16 -36'
#define VEC_HULL_MAX '16 16 36' #define VEC_HULL_MAX '16 16 36'
// Particle Fields
float EFFECT_GUNSHOT;
float EFFECT_BLOOD;
// Player specific fields // Player specific fields
.float fInBuyZone; .float fInBuyZone;
.float fInHostageZone; .float fInHostageZone;
@ -41,11 +45,17 @@ float fGameTime;
.float fAttackFinished; .float fAttackFinished;
.float fAccuracy;
// Game specific fields // Game specific fields
int iHostagesMax; int iHostagesMax;
int iHostagesRescued; int iHostagesRescued;
// Generic entity fields
.int iUsable; .int iUsable;
.int iBleeds;
.void() vPain;
.void() vDeath;
// All about +use // All about +use
entity eActivator; entity eActivator;
@ -75,3 +85,5 @@ void Client_SendEvent( entity eClient, float fEVType );
void OpenCSGunBase_Draw( void ); void OpenCSGunBase_Draw( void );
float OpenCSGunBase_PrimaryFire( void ); float OpenCSGunBase_PrimaryFire( void );
float OpenCSGunBase_Reload( void ); float OpenCSGunBase_Reload( void );
void TraceAttack_FireBullets( void );

View file

@ -25,6 +25,16 @@ float Client_LerpCamera( float fStart, float fEnd, float fAmount ) {
return shortest_angle * fAmount; return shortest_angle * fAmount;
} }
void hostage_pain( void ) {
self.frame = 13 - ceil( random() * 5);
}
void hostage_die( void ) {
self.frame = 30 + ceil( random() * 5);
self.solid = SOLID_NOT;
self.takedamage = DAMAGE_NO;
}
void hostage_use( void ) { void hostage_use( void ) {
if ( self.eUser == world ) { if ( self.eUser == world ) {
sound( self, CHAN_VOICE, sprintf( "hostage/hos%d.wav", ceil( random() * 5 ) ), 1.0, ATTN_IDLE ); sound( self, CHAN_VOICE, sprintf( "hostage/hos%d.wav", ceil( random() * 5 ) ), 1.0, ATTN_IDLE );
@ -40,7 +50,7 @@ void hostage_physics( void ) {
input_buttons = 0; input_buttons = 0;
input_angles = self.angles; input_angles = self.angles;
if ( self.eUser != world ) { if ( ( self.eUser != world ) && ( self.health > 0 ) ) {
// This is visible ingame, so this is definitely executed. // This is visible ingame, so this is definitely executed.
vector vEndAngle = vectoangles( self.eUser.origin - self.origin ); vector vEndAngle = vectoangles( self.eUser.origin - self.origin );
self.angles_y += Client_LerpCamera( self.angles_y, vEndAngle_y, 0.2 ); self.angles_y += Client_LerpCamera( self.angles_y, vEndAngle_y, 0.2 );
@ -87,7 +97,11 @@ void hostage_entity( void ) {
self.eUser = world; self.eUser = world;
self.iUsable = TRUE; self.iUsable = TRUE;
self.iBleeds = TRUE;
self.takedamage = DAMAGE_YES;
self.vUse = hostage_use; self.vUse = hostage_use;
self.vPain = hostage_pain;
self.vDeath = hostage_die;
self.frame = 13; // Idle frame self.frame = 13; // Idle frame
self.health = 100; self.health = 100;

View file

@ -22,11 +22,15 @@ void func_wall( void ) {
self.angles = '0 0 0'; self.angles = '0 0 0';
self.movetype = MOVETYPE_PUSH; self.movetype = MOVETYPE_PUSH;
self.solid = SOLID_BSP; self.solid = SOLID_BSP;
setmodel (self, self.model); setmodel (self, self.model);
// GoldSrc-Rendermode support // GoldSrc-Rendermode support
if( self.rendermode == 2 ) { if( self.rendermode == 2 ) {
self.alpha = ( self.renderamt / 255 ); self.alpha = ( self.renderamt / 255 );
} else if ( self.rendermode == 5 ) {
self.effects = EF_ADDITIVE;
self.alpha = ( self.renderamt / 255 );
} }
} }
@ -43,15 +47,29 @@ void func_button( void ) {
} }
void func_illusionary( void ){ void func_illusionary( void ){
setmodel( self, self.model ); func_wall();
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
} }
void func_water( void ) { void func_water( void ) {
func_illusionary(); func_wall();
self.skin = CONTENT_WATER;
} }
void ambient_generic( void ) { void ambient_generic( void ) {
precache_sound( self.message ); precache_sound( self.message );
ambientsound( self.origin, self.message, 1, ATTN_NORM );
if ( self.spawnflags & 1 ) {
self.style = ATTN_NONE;
} else if ( self.spawnflags & 2 ) {
self.style = ATTN_IDLE;
} else if ( self.spawnflags & 4 ) {
self.style = ATTN_STATIC;
} else if ( self.spawnflags & 8 ) {
self.style = ATTN_NORM;
} else {
self.style = ATTN_STATIC;
}
ambientsound( self.origin, self.message, 1, self.style );
} }

View file

@ -54,6 +54,9 @@ void worldspawn( void ) {
precache_model (sCSPlayers[7]); precache_model (sCSPlayers[7]);
precache_model (sCSPlayers[8]); precache_model (sCSPlayers[8]);
EFFECT_GUNSHOT = particleeffectnum( "te_gunshot" );
EFFECT_BLOOD = particleeffectnum( "te_blood" );
precache_sound( "radio/moveout.wav" ); precache_sound( "radio/moveout.wav" );
precache_sound( "radio/letsgo.wav" ); precache_sound( "radio/letsgo.wav" );
precache_sound( "radio/locknload.wav" ); precache_sound( "radio/locknload.wav" );

View file

@ -66,7 +66,7 @@ void Spawn_GameClient( float fTeam ) {
setmodel( self, sCSPlayers[ fTeam ] ); setmodel( self, sCSPlayers[ fTeam ] );
setsize( self, VEC_HULL_MIN, VEC_HULL_MAX ); setsize( self, VEC_HULL_MIN, VEC_HULL_MAX );
self.view_ofs = '0 0 28'; self.view_ofs = '0 0 24';
self.velocity = '0 0 0'; self.velocity = '0 0 0';
self.frame = 1; // Idle frame self.frame = 1; // Idle frame

View file

@ -0,0 +1,49 @@
/*
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.
*/
float Math_CRandom( void ) {
return 2 * ( random() - 0.5 );
}
void TraceAttack_FireBullets( void ) {
vector vSrc, vDir;
makevectors(self.v_angle);
vSrc = self.origin + self.view_ofs;
int iShots = wptTable[ self.weapon ].iBullets;
while ( iShots > 0) {
vDir = aim( self, 100000 ) + Math_CRandom()*self.fAccuracy*v_right + Math_CRandom()*self.fAccuracy*v_up;
traceline( vSrc, vSrc + ( vDir * 2048 ), FALSE, self);
if (trace_fraction != 1.0) {
if ( trace_ent.takedamage == DAMAGE_YES ) {
Damage_Apply( trace_ent, self, self.weapon, trace_endpos );
} else {
pointparticles( EFFECT_GUNSHOT, trace_endpos, '0 0 0', 1 );
}
}
iShots--;
}
dprint( sprintf( "[DEBUG] ACCURACY: %f, %d %d %d\n", self.fAccuracy, vDir_x, vDir_y, vDir_z ));
}

View file

@ -2,7 +2,7 @@
#pragma progs_dat "../../Main/progs.dat" #pragma progs_dat "../../Main/progs.dat"
#define QWSSQC #define SSQC
#includelist #includelist
../Builtins.h ../Builtins.h
@ -34,6 +34,8 @@ Defs.h
../Shared/WeaponBase.c ../Shared/WeaponBase.c
../Shared/Weapons.c ../Shared/Weapons.c
Damage.c
TraceAttack.c
Timer.c Timer.c
Main.c Main.c
EntHostage.c EntHostage.c

View file

@ -37,7 +37,10 @@ weaponinfo_t wptAK47 = {
0.1, // Attack-Delay 0.1, // Attack-Delay
2.4, // Reload-Delay 2.4, // Reload-Delay
iAmmo_762MM, // Caliber Pointer iAmmo_762MM, // Caliber Pointer
iClip_AK47 // Clip Pointer iClip_AK47, // Clip Pointer
200, // Accuracy Divisor
0.35, // Accuracy Offset
1.25 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponAK47_Draw( void ) { void WeaponAK47_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/ak47_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/ak47_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponAK47_Draw( void ) {
} }
void WeaponAK47_PrimaryFire( void ) { void WeaponAK47_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( random() <= 0.5 ) { if ( random() <= 0.5 ) {
sound( self, CHAN_WEAPON, "weapons/ak47-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/ak47-1.wav", 1, ATTN_NORM );
@ -81,7 +84,7 @@ void WeaponAK47_PrimaryFire( void ) {
} }
void WeaponAK47_Reload( void ) { void WeaponAK47_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptAUG = {
0.09, // Attack-Delay 0.09, // Attack-Delay
3.3, // Reload-Delay 3.3, // Reload-Delay
iAmmo_762MM, // Caliber Pointer iAmmo_762MM, // Caliber Pointer
iClip_AUG // Clip Pointer iClip_AUG, // Clip Pointer
215, // Accuracy Divisor
0.3, // Accuracy Offset
1.0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponAUG_Draw( void ) { void WeaponAUG_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/aug_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/aug_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponAUG_Draw( void ) {
} }
void WeaponAUG_PrimaryFire( void ) { void WeaponAUG_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
sound( self, CHAN_WEAPON, "weapons/aug-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/aug-1.wav", 1, ATTN_NORM );
} }
@ -77,7 +80,7 @@ void WeaponAUG_PrimaryFire( void ) {
} }
void WeaponAUG_Reload( void ) { void WeaponAUG_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptAWP = {
1.2, // Attack-Delay 1.2, // Attack-Delay
2.9, // Reload-Delay 2.9, // Reload-Delay
iAmmo_338MAG, // Caliber Pointer iAmmo_338MAG, // Caliber Pointer
iClip_AWP // Clip Pointer iClip_AWP, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponAWP_Draw( void ) { void WeaponAWP_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/awp_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/awp_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponAWP_Draw( void ) {
} }
void WeaponAWP_PrimaryFire( void ) { void WeaponAWP_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
// Play Sound // Play Sound
sound( self, CHAN_WEAPON, "weapons/awp1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/awp1.wav", 1, ATTN_NORM );
@ -78,7 +81,7 @@ void WeaponAWP_PrimaryFire( void ) {
} }
void WeaponAWP_Reload( void ) { void WeaponAWP_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
// Because padding... // Because padding...
weaponinfo_t wptDEFAULT = { 0, 0, 0, 0, 240, 0, 0, 0, 0, 0.0, 0.0, 0, 0.0, 0.0, iAmmo_9MM, iAmmo_9MM }; weaponinfo_t wptDEFAULT = { 0, 0, 0, 0, 240, 0, 0, 0, 0, 0.0, 0.0, 0, 0.0, 0.0, iAmmo_9MM, iAmmo_9MM, 0.0, 0.0, 0.0 };
weaponinfo_t wptTable[ CS_WEAPON_COUNT ] = { weaponinfo_t wptTable[ CS_WEAPON_COUNT ] = {
wptDEFAULT, wptDEFAULT,
@ -48,35 +48,35 @@ weaponinfo_t wptTable[ CS_WEAPON_COUNT ] = {
wptPARA wptPARA
}; };
#ifdef QWSSQC #ifdef SSQC
void OpenCSGunBase_Draw( void ) { void OpenCSGunBase_Draw( void ) {
#ifdef QWSSQC
self.iCurrentClip = self.(wptTable[ self.weapon ].iClipfld); self.iCurrentClip = self.(wptTable[ self.weapon ].iClipfld);
self.iCurrentCaliber = self.(wptTable[ self.weapon ].iCaliberfld); self.iCurrentCaliber = self.(wptTable[ self.weapon ].iCaliberfld);
Client_SendEvent( self, EV_WEAPON_DRAW ); Client_SendEvent( self, EV_WEAPON_DRAW );
#endif }
void OpenCSGunBase_AccuracyCalc( void ) {
self.fAccuracy = 3 / wptTable[ self.weapon ].fAccuracyDivisor;
} }
// Returns whether or not to play an animation // Returns whether or not to play an animation
float OpenCSGunBase_PrimaryFire( void ) { float OpenCSGunBase_PrimaryFire( void ) {
#ifdef QWSSQC
// Nothing in the clip anymore? Don't even attempt // Nothing in the clip anymore? Don't even attempt
if ( ( self.(wptTable[ self.weapon ].iClipfld) - 1 ) < 0 ) { if ( ( self.(wptTable[ self.weapon ].iClipfld) - 1 ) < 0 ) {
return FALSE; return FALSE;
} }
// Take as many bullets away from the clip as it takes OpenCSGunBase_AccuracyCalc();
TraceAttack_FireBullets();
self.(wptTable[ self.weapon ].iClipfld) -= 1; self.(wptTable[ self.weapon ].iClipfld) -= 1;
self.fAttackFinished = time + wptTable[ self.weapon ].fAttackFinished; self.fAttackFinished = time + wptTable[ self.weapon ].fAttackFinished;
Client_SendEvent( self, EV_WEAPON_PRIMARYATTACK ); Client_SendEvent( self, EV_WEAPON_PRIMARYATTACK );
return TRUE; return TRUE;
#endif
} }
float OpenCSGunBase_Reload( void ) { float OpenCSGunBase_Reload( void ) {
#ifdef QWSSQC
// Don't bother reloading the gun when full // Don't bother reloading the gun when full
if ( self.(wptTable[ self.weapon ].iClipfld) == wptTable[ self.weapon ].iClipSize ) { if ( self.(wptTable[ self.weapon ].iClipfld) == wptTable[ self.weapon ].iClipSize ) {
return FALSE; return FALSE;
@ -99,6 +99,5 @@ float OpenCSGunBase_Reload( void ) {
Client_SendEvent( self, EV_WEAPON_RELOAD ); Client_SendEvent( self, EV_WEAPON_RELOAD );
return TRUE; return TRUE;
#endif
} }
#endif #endif

View file

@ -26,7 +26,7 @@ weaponinfo_t wptDEAGLE = {
SLOT_SECONDARY, SLOT_SECONDARY,
650, // Price 650, // Price
CALIBER_50AE, // Caliber ID CALIBER_50AE, // Caliber ID
650, // Max Player Speed 240, // Max Player Speed
1, // Bullets Per Shot 1, // Bullets Per Shot
7, // Clip/MagSize 7, // Clip/MagSize
54, // Damage Per Bullet 54, // Damage Per Bullet
@ -37,7 +37,10 @@ weaponinfo_t wptDEAGLE = {
0.15, // Attack-Delay 0.15, // Attack-Delay
2.1, // Reload-Delay 2.1, // Reload-Delay
iAmmo_50AE, // Caliber Pointer iAmmo_50AE, // Caliber Pointer
iClip_DEAGLE // Clip Pointer iClip_DEAGLE, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponDEAGLE_Draw( void ) { void WeaponDEAGLE_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/de_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client.. sound( self, CHAN_WEAPON, "weapons/de_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client..
#else #else
@ -60,7 +63,7 @@ void WeaponDEAGLE_Draw( void ) {
} }
void WeaponDEAGLE_PrimaryFire( void ) { void WeaponDEAGLE_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( random() <= 0.5 ) { if ( random() <= 0.5 ) {
sound( self, CHAN_WEAPON, "weapons/deagle-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/deagle-1.wav", 1, ATTN_NORM );
@ -83,7 +86,7 @@ void WeaponDEAGLE_PrimaryFire( void ) {
} }
void WeaponDEAGLE_Reload( void ) { void WeaponDEAGLE_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.int iClip_ELITES; .int iClip_ELITES;
#ifdef QWSSQC #ifdef SSQC
.int iMode_ELITES; .int iMode_ELITES;
#else #else
int iWeaponMode_ELITES; int iWeaponMode_ELITES;
@ -43,7 +43,10 @@ weaponinfo_t wptELITES = {
0.15, // Attack-Delay 0.15, // Attack-Delay
4.6, // Reload-Delay 4.6, // Reload-Delay
iAmmo_9MM, // Caliber Pointer iAmmo_9MM, // Caliber Pointer
iClip_ELITES // Clip Pointer iClip_ELITES, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -67,7 +70,7 @@ enum {
}; };
void WeaponELITES_Draw( void ) { void WeaponELITES_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/elite_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/elite_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -76,7 +79,7 @@ void WeaponELITES_Draw( void ) {
} }
void WeaponELITES_PrimaryFire( void ) { void WeaponELITES_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
// Play Sound // Play Sound
sound( self, CHAN_WEAPON, "weapons/elite_fire.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/elite_fire.wav", 1, ATTN_NORM );
@ -122,7 +125,7 @@ void WeaponELITES_PrimaryFire( void ) {
} }
void WeaponELITES_Reload( void ) { void WeaponELITES_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptFIVESEVEN = {
0.15, // Attack-Delay 0.15, // Attack-Delay
3.1, // Reload-Delay 3.1, // Reload-Delay
iAmmo_57MM, // Caliber Pointer iAmmo_57MM, // Caliber Pointer
iClip_FIVESEVEN // Clip Pointer iClip_FIVESEVEN, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponFIVESEVEN_Draw( void ) { void WeaponFIVESEVEN_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/fiveseven_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/fiveseven_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponFIVESEVEN_Draw( void ) {
} }
void WeaponFIVESEVEN_PrimaryFire( void ) { void WeaponFIVESEVEN_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
// Play Sound // Play Sound
sound( self, CHAN_WEAPON, "weapons/fiveseven-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/fiveseven-1.wav", 1, ATTN_NORM );
@ -80,7 +83,7 @@ void WeaponFIVESEVEN_PrimaryFire( void ) {
} }
void WeaponFIVESEVEN_Reload( void ) { void WeaponFIVESEVEN_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptG3SG1 = {
0.25, // Attack-Delay 0.25, // Attack-Delay
4.6, // Reload-Delay 4.6, // Reload-Delay
iAmmo_762MM, // Caliber Pointer iAmmo_762MM, // Caliber Pointer
iClip_G3SG1 // Clip Pointer iClip_G3SG1, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -50,7 +53,7 @@ enum {
}; };
void WeaponG3SG1_Draw( void ) { void WeaponG3SG1_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/g3sg1_slide.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/g3sg1_slide.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -59,7 +62,7 @@ void WeaponG3SG1_Draw( void ) {
} }
void WeaponG3SG1_PrimaryFire( void ) { void WeaponG3SG1_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
// Play Sound // Play Sound
dprint("[DEBUG] FIRE!\n"); dprint("[DEBUG] FIRE!\n");
@ -76,7 +79,7 @@ void WeaponG3SG1_PrimaryFire( void ) {
} }
void WeaponG3SG1_Reload( void ) { void WeaponG3SG1_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.int iClip_GLOCK18; .int iClip_GLOCK18;
#ifdef QWSSQC #ifdef SSQC
.int iMode_GLOCK18; .int iMode_GLOCK18;
#else #else
int iWeaponMode_GLOCK18; int iWeaponMode_GLOCK18;
@ -43,7 +43,10 @@ weaponinfo_t wptGLOCK18 = {
0.15, // Attack-Delay 0.15, // Attack-Delay
2.0, // Reload-Delay 2.0, // Reload-Delay
iAmmo_9MM, // Caliber Pointer iAmmo_9MM, // Caliber Pointer
iClip_GLOCK18 // Clip Pointer iClip_GLOCK18, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -64,7 +67,7 @@ enum {
}; };
void WeaponGLOCK18_Draw( void ) { void WeaponGLOCK18_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/slideback1.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/slideback1.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -77,7 +80,7 @@ void WeaponGLOCK18_Draw( void ) {
} }
void WeaponGLOCK18_PrimaryFire( void ) { void WeaponGLOCK18_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
// Play Sound // Play Sound
if ( self.iMode_GLOCK18 == FALSE ) { if ( self.iMode_GLOCK18 == FALSE ) {
@ -104,7 +107,7 @@ void WeaponGLOCK18_PrimaryFire( void ) {
} }
void WeaponGLOCK18_Secondary( void ) { void WeaponGLOCK18_Secondary( void ) {
#ifdef QWSSQC #ifdef SSQC
// Just switch the modes quickly // Just switch the modes quickly
self.iMode_GLOCK18 = 1 - self.iMode_GLOCK18; self.iMode_GLOCK18 = 1 - self.iMode_GLOCK18;
self.fAttackFinished = time + 1.0; self.fAttackFinished = time + 1.0;
@ -123,7 +126,7 @@ void WeaponGLOCK18_Secondary( void ) {
} }
void WeaponGLOCK18_Reload( void ) { void WeaponGLOCK18_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.int iClip_M3; .int iClip_M3;
#ifdef QWSSQC #ifdef SSQC
.int iMode_M3; .int iMode_M3;
#else #else
int iWeaponMode_M3; int iWeaponMode_M3;
@ -43,7 +43,10 @@ weaponinfo_t wptM3 = {
1.0, // Attack-Delay 1.0, // Attack-Delay
3.0, // Reload-Delay 3.0, // Reload-Delay
iAmmo_BUCKSHOT, // Caliber Pointer iAmmo_BUCKSHOT, // Caliber Pointer
iClip_M3 // Clip Pointer iClip_M3, // Clip Pointer
200, // Accuracy Divisor
0.35, // Accuracy Offset
1.25 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -58,7 +61,7 @@ enum {
}; };
void WeaponM3_Draw( void ) { void WeaponM3_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -69,7 +72,7 @@ void WeaponM3_Draw( void ) {
void WeaponM3_ReloadNULL( void ) { } void WeaponM3_ReloadNULL( void ) { }
void WeaponM3_PrimaryFire( void ) { void WeaponM3_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( self.iMode_M3 == TRUE ) { if ( self.iMode_M3 == TRUE ) {
self.iMode_M3 = 0; self.iMode_M3 = 0;
Client_SendEvent( self, EV_WEAPON_RELOAD ); Client_SendEvent( self, EV_WEAPON_RELOAD );
@ -92,7 +95,7 @@ void WeaponM3_PrimaryFire( void ) {
void WeaponM3_Reload( void); void WeaponM3_Reload( void);
void WeaponM3_Secondary( void ) { void WeaponM3_Secondary( void ) {
#ifdef QWSSQC #ifdef SSQC
// If it's full or no ammo is left... // If it's full or no ammo is left...
if ( (self.(wptM3.iClipfld) == wptM3.iClipSize) || ( self.(wptM3.iCaliberfld) <= 0 ) ) { if ( (self.(wptM3.iClipfld) == wptM3.iClipSize) || ( self.(wptM3.iCaliberfld) <= 0 ) ) {
self.iMode_M3 = 0; self.iMode_M3 = 0;
@ -115,7 +118,7 @@ void WeaponM3_Secondary( void ) {
} }
void WeaponM3_Reload( void ) { void WeaponM3_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
// Can we reload the gun even if we wanted to? // Can we reload the gun even if we wanted to?
if ( ( self.(wptM3.iClipfld) != wptM3.iClipSize ) && ( self.(wptM3.iCaliberfld) > 0 ) ) { if ( ( self.(wptM3.iClipfld) != wptM3.iClipSize ) && ( self.(wptM3.iCaliberfld) > 0 ) ) {
self.iMode_M3 = 1 - self.iMode_M3; self.iMode_M3 = 1 - self.iMode_M3;

View file

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.int iClip_M4A1; .int iClip_M4A1;
#ifdef QWSSQC #ifdef SSQC
.int iMode_M4A1; .int iMode_M4A1;
#else #else
int iWeaponMode_M4A1; int iWeaponMode_M4A1;
@ -43,7 +43,10 @@ weaponinfo_t wptM4A1 = {
0.09, // Attack-Delay 0.09, // Attack-Delay
3.1, // Reload-Delay 3.1, // Reload-Delay
iAmmo_556MM, // Caliber Pointer iAmmo_556MM, // Caliber Pointer
iClip_M4A1 // Clip Pointer iClip_M4A1, // Clip Pointer
220, // Accuracy Divisor
0.3, // Accuracy Offset
1.0 // Max Inaccuracy
}; };
enum { enum {
@ -64,7 +67,7 @@ enum {
}; };
void WeaponM4A1_Draw( void ) { void WeaponM4A1_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
#else #else
if ( iWeaponMode_M4A1 == TRUE ) { if ( iWeaponMode_M4A1 == TRUE ) {
@ -76,7 +79,7 @@ void WeaponM4A1_Draw( void ) {
} }
void WeaponM4A1_PrimaryFire( void ) { void WeaponM4A1_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( self.iMode_M4A1 == TRUE ) { if ( self.iMode_M4A1 == TRUE ) {
sound( self, CHAN_WEAPON, "weapons/m4a1-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/m4a1-1.wav", 1, ATTN_NORM );
@ -114,7 +117,7 @@ void WeaponM4A1_PrimaryFire( void ) {
} }
void WeaponM4A1_Secondary( void ) { void WeaponM4A1_Secondary( void ) {
#ifdef QWSSQC #ifdef SSQC
// Just switch the modes quickly // Just switch the modes quickly
self.iMode_M4A1 = 1 - self.iMode_M4A1; self.iMode_M4A1 = 1 - self.iMode_M4A1;
self.fAttackFinished = time + 3.0; self.fAttackFinished = time + 3.0;
@ -140,7 +143,7 @@ void WeaponM4A1_Secondary( void ) {
} }
void WeaponM4A1_Reload( void ) { void WeaponM4A1_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptMP5 = {
0.08, // Attack-Delay 0.08, // Attack-Delay
2.6, // Reload-Delay 2.6, // Reload-Delay
iAmmo_9MM, // Caliber Pointer iAmmo_9MM, // Caliber Pointer
iClip_MP5 // Clip Pointer iClip_MP5, // Clip Pointer
220, // Accuracy Divisor
0.45, // Accuracy Offset
0.75 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponMP5_Draw( void ) { void WeaponMP5_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/mp5_slideback.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/mp5_slideback.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponMP5_Draw( void ) {
} }
void WeaponMP5_PrimaryFire( void ) { void WeaponMP5_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( random() <= 0.5 ) { if ( random() <= 0.5 ) {
sound( self, CHAN_WEAPON, "weapons/mp5-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/mp5-1.wav", 1, ATTN_NORM );
@ -81,7 +84,7 @@ void WeaponMP5_PrimaryFire( void ) {
} }
void WeaponMP5_Reload( void ) { void WeaponMP5_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptMAC10 = {
0.075, // Attack-Delay 0.075, // Attack-Delay
3.2, // Reload-Delay 3.2, // Reload-Delay
iAmmo_45ACP, // Caliber Pointer iAmmo_45ACP, // Caliber Pointer
iClip_MAC10 // Clip Pointer iClip_MAC10, // Clip Pointer
200, // Accuracy Divisor
0.6, // Accuracy Offset
1.65 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponMAC10_Draw( void ) { void WeaponMAC10_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/mac10_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/mac10_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponMAC10_Draw( void ) {
} }
void WeaponMAC10_PrimaryFire( void ) { void WeaponMAC10_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
sound( self, CHAN_WEAPON, "weapons/mac10-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/mac10-1.wav", 1, ATTN_NORM );
} }
@ -78,7 +81,7 @@ void WeaponMAC10_PrimaryFire( void ) {
} }
void WeaponMAC10_Reload( void ) { void WeaponMAC10_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptP228 = {
0.15, // Attack-Delay 0.15, // Attack-Delay
2.7, // Reload-Delay 2.7, // Reload-Delay
iAmmo_357SIG, // Caliber Pointer iAmmo_357SIG, // Caliber Pointer
iClip_P228 // Clip Pointer iClip_P228, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -52,7 +55,7 @@ enum {
}; };
void WeaponP228_Draw( void ) { void WeaponP228_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/p228_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/p228_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -61,7 +64,7 @@ void WeaponP228_Draw( void ) {
} }
void WeaponP228_PrimaryFire( void ) { void WeaponP228_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
// Play Sound // Play Sound
sound( self, CHAN_WEAPON, "weapons/p228-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/p228-1.wav", 1, ATTN_NORM );
@ -85,7 +88,7 @@ void WeaponP228_PrimaryFire( void ) {
} }
void WeaponP228_Reload( void ) { void WeaponP228_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptP90 = {
0.07, // Attack-Delay 0.07, // Attack-Delay
3.3, // Reload-Delay 3.3, // Reload-Delay
iAmmo_57MM, // Caliber Pointer iAmmo_57MM, // Caliber Pointer
iClip_P90 // Clip Pointer iClip_P90, // Clip Pointer
175, // Accuracy Divisor
0.45, // Accuracy Offset
1.0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponP90_Draw( void ) { void WeaponP90_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/p90_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/p90_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponP90_Draw( void ) {
} }
void WeaponP90_PrimaryFire( void ) { void WeaponP90_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
sound( self, CHAN_WEAPON, "weapons/p90-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/p90-1.wav", 1, ATTN_NORM );
} }
@ -78,7 +81,7 @@ void WeaponP90_PrimaryFire( void ) {
} }
void WeaponP90_Reload( void ) { void WeaponP90_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptPARA = {
0.08, // Attack-Delay 0.08, // Attack-Delay
3.0, // Reload-Delay 3.0, // Reload-Delay
iAmmo_556MM, // Caliber Pointer iAmmo_556MM, // Caliber Pointer
iClip_PARA // Clip Pointer iClip_PARA, // Clip Pointer
175, // Accuracy Divisor
0.4, // Accuracy Offset
0.9 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponPARA_Draw( void ) { void WeaponPARA_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/m249_chain.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/m249_chain.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponPARA_Draw( void ) {
} }
void WeaponPARA_PrimaryFire( void ) { void WeaponPARA_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( random() <= 0.5 ) { if ( random() <= 0.5 ) {
sound( self, CHAN_WEAPON, "weapons/m249-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/m249-1.wav", 1, ATTN_NORM );
@ -81,7 +84,7 @@ void WeaponPARA_PrimaryFire( void ) {
} }
void WeaponPARA_Reload( void ) { void WeaponPARA_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptSG550 = {
0.25, // Attack-Delay 0.25, // Attack-Delay
3.8, // Reload-Delay 3.8, // Reload-Delay
iAmmo_556MM, // Caliber Pointer iAmmo_556MM, // Caliber Pointer
iClip_SG550 // Clip Pointer iClip_SG550, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -50,7 +53,7 @@ enum {
}; };
void WeaponSG550_Draw( void ) { void WeaponSG550_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/sg550_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/sg550_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -59,7 +62,7 @@ void WeaponSG550_Draw( void ) {
} }
void WeaponSG550_PrimaryFire( void ) { void WeaponSG550_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
sound( self, CHAN_WEAPON, "weapons/sg550-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/sg550-1.wav", 1, ATTN_NORM );
} }
@ -74,7 +77,7 @@ void WeaponSG550_PrimaryFire( void ) {
} }
void WeaponSG550_Reload( void ) { void WeaponSG550_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptSG552 = {
0.09, // Attack-Delay 0.09, // Attack-Delay
3.2, // Reload-Delay 3.2, // Reload-Delay
iAmmo_556MM, // Caliber Pointer iAmmo_556MM, // Caliber Pointer
iClip_SG552 // Clip Pointer iClip_SG552, // Clip Pointer
220, // Accuracy Divisor
0.3, // Accuracy Offset
1.0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponSG552_Draw( void ) { void WeaponSG552_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/sg552_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/sg552_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponSG552_Draw( void ) {
} }
void WeaponSG552_PrimaryFire( void ) { void WeaponSG552_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( random() <= 0.5 ) { if ( random() <= 0.5 ) {
sound( self, CHAN_WEAPON, "weapons/sg552-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/sg552-1.wav", 1, ATTN_NORM );
@ -81,7 +84,7 @@ void WeaponSG552_PrimaryFire( void ) {
} }
void WeaponSG552_Reload( void ) { void WeaponSG552_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptSCOUT = {
1.25, // Attack-Delay 1.25, // Attack-Delay
2.0, // Reload-Delay 2.0, // Reload-Delay
iAmmo_762MM, // Caliber Pointer iAmmo_762MM, // Caliber Pointer
iClip_SCOUT // Clip Pointer iClip_SCOUT, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -50,7 +53,7 @@ enum {
}; };
void WeaponSCOUT_Draw( void ) { void WeaponSCOUT_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/scout_bolt.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/scout_bolt.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -59,7 +62,7 @@ void WeaponSCOUT_Draw( void ) {
} }
void WeaponSCOUT_PrimaryFire( void ) { void WeaponSCOUT_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
// Play Sound // Play Sound
sound( self, CHAN_WEAPON, "weapons/scout_fire-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/scout_fire-1.wav", 1, ATTN_NORM );
@ -74,7 +77,7 @@ void WeaponSCOUT_PrimaryFire( void ) {
} }
void WeaponSCOUT_Reload( void ) { void WeaponSCOUT_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -36,8 +36,11 @@ weaponinfo_t wptTMP = {
TYPE_AUTO, TYPE_AUTO,
0.07, // Attack-Delay 0.07, // Attack-Delay
2.1, // Reload-Delay 2.1, // Reload-Delay
iAmmo_9MM, // Caliber Pointer iAmmo_9MM, // Caliber Pointer
iClip_TMP // Clip Pointer iClip_TMP, // Clip Pointer
200, // Accuracy Divisor
0.55, // Accuracy Offset
1.4 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponTMP_Draw( void ) { void WeaponTMP_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
#else #else
View_PlayAnimation( ANIM_TMP_DRAW ); View_PlayAnimation( ANIM_TMP_DRAW );
@ -59,7 +62,7 @@ void WeaponTMP_Draw( void ) {
} }
void WeaponTMP_PrimaryFire( void ) { void WeaponTMP_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( random() <= 0.5 ) { if ( random() <= 0.5 ) {
sound( self, CHAN_WEAPON, "weapons/tmp-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/tmp-1.wav", 1, ATTN_NORM );
@ -80,7 +83,7 @@ void WeaponTMP_PrimaryFire( void ) {
} }
void WeaponTMP_Reload( void ) { void WeaponTMP_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -37,7 +37,10 @@ weaponinfo_t wptUMP45 = {
0.105, // Attack-Delay 0.105, // Attack-Delay
3.5, // Reload-Delay 3.5, // Reload-Delay
iAmmo_45ACP, // Caliber Pointer iAmmo_45ACP, // Caliber Pointer
iClip_UMP45 // Clip Pointer iClip_UMP45, // Clip Pointer
210, // Accuracy Divisor
0.5, // Accuracy Offset
1 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -51,7 +54,7 @@ enum {
}; };
void WeaponUMP45_Draw( void ) { void WeaponUMP45_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/ump45_boltslap.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/ump45_boltslap.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -60,7 +63,7 @@ void WeaponUMP45_Draw( void ) {
} }
void WeaponUMP45_PrimaryFire( void ) { void WeaponUMP45_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
sound( self, CHAN_WEAPON, "weapons/ump45-1.wav", 1, ATTN_NORM ); sound( self, CHAN_WEAPON, "weapons/ump45-1.wav", 1, ATTN_NORM );
} }
@ -78,7 +81,7 @@ void WeaponUMP45_PrimaryFire( void ) {
} }
void WeaponUMP45_Reload( void ) { void WeaponUMP45_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.int iClip_USP45; .int iClip_USP45;
#ifdef QWSSQC #ifdef SSQC
.int iMode_USP45; .int iMode_USP45;
#else #else
int iWeaponMode_USP45; int iWeaponMode_USP45;
@ -43,7 +43,10 @@ weaponinfo_t wptUSP45 = {
0.15, // Attack-Delay 0.15, // Attack-Delay
2.5, // Reload-Delay 2.5, // Reload-Delay
iAmmo_45ACP, // Caliber Pointer iAmmo_45ACP, // Caliber Pointer
iClip_USP45 // Clip Pointer iClip_USP45, // Clip Pointer
-1, // Accuracy Divisor
0, // Accuracy Offset
0 // Max Inaccuracy
}; };
enum { enum {
@ -66,7 +69,7 @@ enum {
}; };
void WeaponUSP45_Draw( void ) { void WeaponUSP45_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
#else #else
if ( iWeaponMode_USP45 == TRUE ) { if ( iWeaponMode_USP45 == TRUE ) {
@ -78,7 +81,7 @@ void WeaponUSP45_Draw( void ) {
} }
void WeaponUSP45_PrimaryFire( void ) { void WeaponUSP45_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( self.iMode_USP45 == TRUE ) { if ( self.iMode_USP45 == TRUE ) {
if ( random() <= 0.5 ) { if ( random() <= 0.5 ) {
@ -124,7 +127,7 @@ void WeaponUSP45_PrimaryFire( void ) {
} }
void WeaponUSP45_Secondary( void ) { void WeaponUSP45_Secondary( void ) {
#ifdef QWSSQC #ifdef SSQC
// Just switch the modes quickly // Just switch the modes quickly
self.iMode_USP45 = 1 - self.iMode_USP45; self.iMode_USP45 = 1 - self.iMode_USP45;
self.fAttackFinished = time + 3.0; self.fAttackFinished = time + 3.0;
@ -150,7 +153,7 @@ void WeaponUSP45_Secondary( void ) {
} }
void WeaponUSP45_Reload( void ) { void WeaponUSP45_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) { if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound // Play Sound
} }

View file

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.int iClip_XM1014; .int iClip_XM1014;
#ifdef QWSSQC #ifdef SSQC
.int iMode_XM1014; .int iMode_XM1014;
#else #else
int iWeaponMode_XM1014; int iWeaponMode_XM1014;
@ -34,7 +34,7 @@ weaponinfo_t wptXM1014 = {
CALIBER_BUCKSHOT, // Caliber ID CALIBER_BUCKSHOT, // Caliber ID
240, // Max Player Speed 240, // Max Player Speed
6, // Bullets Per Shot 6, // Bullets Per Shot
7, // Clip/MagSize 7, // Clip/MagSize
22, // Damage Per Bullet 22, // Damage Per Bullet
1, // Penetration Multiplier 1, // Penetration Multiplier
3000, // Bullet Range 3000, // Bullet Range
@ -42,8 +42,11 @@ weaponinfo_t wptXM1014 = {
TYPE_AUTO, TYPE_AUTO,
0.25, // Attack-Delay 0.25, // Attack-Delay
3.0, // Reload-Delay 3.0, // Reload-Delay
iAmmo_BUCKSHOT, // Caliber Pointer iAmmo_BUCKSHOT, // Caliber Pointer
iClip_XM1014 // Clip Pointer iClip_XM1014, // Clip Pointer
200, // Accuracy Divisor
0.35, // Accuracy Offset
1.25 // Max Inaccuracy
}; };
// Anim Table // Anim Table
@ -58,7 +61,7 @@ enum {
}; };
void WeaponXM1014_Draw( void ) { void WeaponXM1014_Draw( void ) {
#ifdef QWSSQC #ifdef SSQC
OpenCSGunBase_Draw(); OpenCSGunBase_Draw();
sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
#else #else
@ -69,7 +72,7 @@ void WeaponXM1014_Draw( void ) {
void WeaponXM1014_ReloadNULL( void ) { } void WeaponXM1014_ReloadNULL( void ) { }
void WeaponXM1014_PrimaryFire( void ) { void WeaponXM1014_PrimaryFire( void ) {
#ifdef QWSSQC #ifdef SSQC
if ( self.iMode_XM1014 == TRUE ) { if ( self.iMode_XM1014 == TRUE ) {
self.iMode_XM1014 = 0; self.iMode_XM1014 = 0;
Client_SendEvent( self, EV_WEAPON_RELOAD ); Client_SendEvent( self, EV_WEAPON_RELOAD );
@ -92,7 +95,7 @@ void WeaponXM1014_PrimaryFire( void ) {
void WeaponXM1014_Reload( void); void WeaponXM1014_Reload( void);
void WeaponXM1014_Secondary( void ) { void WeaponXM1014_Secondary( void ) {
#ifdef QWSSQC #ifdef SSQC
// If it's full or no ammo is left... // If it's full or no ammo is left...
if ( (self.(wptXM1014.iClipfld) == wptXM1014.iClipSize) || ( self.(wptXM1014.iCaliberfld) <= 0 ) ) { if ( (self.(wptXM1014.iClipfld) == wptXM1014.iClipSize) || ( self.(wptXM1014.iCaliberfld) <= 0 ) ) {
self.iMode_XM1014 = 0; self.iMode_XM1014 = 0;
@ -115,7 +118,7 @@ void WeaponXM1014_Secondary( void ) {
} }
void WeaponXM1014_Reload( void ) { void WeaponXM1014_Reload( void ) {
#ifdef QWSSQC #ifdef SSQC
// Can we reload the gun even if we wanted to? // Can we reload the gun even if we wanted to?
if ( ( self.(wptXM1014.iClipfld) != wptXM1014.iClipSize ) && ( self.(wptXM1014.iCaliberfld) > 0 ) ) { if ( ( self.(wptXM1014.iClipfld) != wptXM1014.iClipSize ) && ( self.(wptXM1014.iCaliberfld) > 0 ) ) {
self.iMode_XM1014 = 1 - self.iMode_XM1014; self.iMode_XM1014 = 1 - self.iMode_XM1014;

View file

@ -29,7 +29,7 @@ weaponfunc_t wpnFuncTable[ CS_WEAPON_COUNT ] = {
{ WeaponP228_Draw, WeaponP228_PrimaryFire, Temp_Nothing, WeaponP228_Reload }, { WeaponP228_Draw, WeaponP228_PrimaryFire, Temp_Nothing, WeaponP228_Reload },
{ WeaponELITES_Draw, WeaponELITES_PrimaryFire, Temp_Nothing, WeaponELITES_Reload }, { WeaponELITES_Draw, WeaponELITES_PrimaryFire, Temp_Nothing, WeaponELITES_Reload },
{ WeaponFIVESEVEN_Draw, WeaponFIVESEVEN_PrimaryFire, Temp_Nothing, WeaponFIVESEVEN_Reload }, { WeaponFIVESEVEN_Draw, WeaponFIVESEVEN_PrimaryFire, Temp_Nothing, WeaponFIVESEVEN_Reload },
#ifdef QWSSQC #ifdef SSQC
{ WeaponM3_Draw, WeaponM3_PrimaryFire, Temp_Nothing, WeaponM3_Reload }, { WeaponM3_Draw, WeaponM3_PrimaryFire, Temp_Nothing, WeaponM3_Reload },
{ WeaponXM1014_Draw, WeaponXM1014_PrimaryFire, Temp_Nothing, WeaponXM1014_Reload }, { WeaponXM1014_Draw, WeaponXM1014_PrimaryFire, Temp_Nothing, WeaponXM1014_Reload },
#else #else
@ -55,13 +55,13 @@ weaponfunc_t wpnFuncTable[ CS_WEAPON_COUNT ] = {
void Weapon_Draw( float fWeapon ) { void Weapon_Draw( float fWeapon ) {
wpnFuncTable[ fWeapon ].vDraw(); wpnFuncTable[ fWeapon ].vDraw();
#ifdef QWSSQC #ifdef SSQC
self.maxspeed = (float)wptTable[ fWeapon ].iPlayerSpeed; self.maxspeed = (float)wptTable[ fWeapon ].iPlayerSpeed;
#endif #endif
} }
void Weapon_PrimaryAttack( float fWeapon ) { void Weapon_PrimaryAttack( float fWeapon ) {
#ifdef QWSSQC #ifdef SSQC
if ( self.fAttackFinished > time ) { if ( self.fAttackFinished > time ) {
return; return;
} }
@ -71,7 +71,7 @@ void Weapon_PrimaryAttack( float fWeapon ) {
} }
void Weapon_SecondaryAttack( float fWeapon ) { void Weapon_SecondaryAttack( float fWeapon ) {
#ifdef QWSSQC #ifdef SSQC
if ( self.fAttackFinished > time ) { if ( self.fAttackFinished > time ) {
return; return;
} }
@ -81,7 +81,7 @@ void Weapon_SecondaryAttack( float fWeapon ) {
} }
void Weapon_Reload( float fWeapon ) { void Weapon_Reload( float fWeapon ) {
#ifdef QWSSQC #ifdef SSQC
if ( self.fAttackFinished > time ) { if ( self.fAttackFinished > time ) {
return; return;
} }
@ -90,7 +90,7 @@ void Weapon_Reload( float fWeapon ) {
wpnFuncTable[ fWeapon ].vReload(); wpnFuncTable[ fWeapon ].vReload();
} }
#ifdef QWSSQC #ifdef SSQC
void Weapon_UpdateCurrents( void ) { void Weapon_UpdateCurrents( void ) {
self.iCurrentClip = self.(wptTable[ self.weapon ].iClipfld); self.iCurrentClip = self.(wptTable[ self.weapon ].iClipfld);
self.iCurrentCaliber = self.(wptTable[ self.weapon ].iCaliberfld); self.iCurrentCaliber = self.(wptTable[ self.weapon ].iCaliberfld);