diff --git a/Source/Globals.h b/Source/Globals.h index 527d0c42..2411e1ce 100644 --- a/Source/Globals.h +++ b/Source/Globals.h @@ -109,6 +109,7 @@ enum { SLOT_GRENADE }; +// These values are taken from CS:S' .ctx script files typedef struct { int iWeaponID; // Identifier int iSlot; @@ -131,6 +132,10 @@ typedef struct { .int iCaliberfld; // Pointer towards the caliberfield of the gun .int iClipfld; // Pointer towards the clip of the gun + + float fAccuracyDivisor; + float fAccuracyOffset; + float fMaxInaccuracy; } weaponinfo_t; typedef struct { diff --git a/Source/Server/Client.c b/Source/Server/Client.c index af6ee2d4..806540d5 100644 --- a/Source/Server/Client.c +++ b/Source/Server/Client.c @@ -34,7 +34,9 @@ void PlayerPreThink( void ) { Input_Handle(); } -void PlayerPostThink( void ) {} +void PlayerPostThink( void ) { + +} void PutClientInServer( void ) { entity eSpawn; diff --git a/Source/Server/Damage.c b/Source/Server/Damage.c new file mode 100644 index 00000000..cedf4de8 --- /dev/null +++ b/Source/Server/Damage.c @@ -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; +} diff --git a/Source/Server/Defs.h b/Source/Server/Defs.h index 50247fe3..88d2f716 100644 --- a/Source/Server/Defs.h +++ b/Source/Server/Defs.h @@ -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_MAX '16 16 36' +// Particle Fields +float EFFECT_GUNSHOT; +float EFFECT_BLOOD; + // Player specific fields .float fInBuyZone; .float fInHostageZone; @@ -41,11 +45,17 @@ float fGameTime; .float fAttackFinished; +.float fAccuracy; // Game specific fields int iHostagesMax; int iHostagesRescued; + +// Generic entity fields .int iUsable; +.int iBleeds; +.void() vPain; +.void() vDeath; // All about +use entity eActivator; @@ -75,3 +85,5 @@ void Client_SendEvent( entity eClient, float fEVType ); void OpenCSGunBase_Draw( void ); float OpenCSGunBase_PrimaryFire( void ); float OpenCSGunBase_Reload( void ); + +void TraceAttack_FireBullets( void ); diff --git a/Source/Server/EntHostage.c b/Source/Server/EntHostage.c index e56e11fc..eb13c4a6 100644 --- a/Source/Server/EntHostage.c +++ b/Source/Server/EntHostage.c @@ -25,6 +25,16 @@ float Client_LerpCamera( float fStart, float fEnd, float 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 ) { if ( self.eUser == world ) { 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_angles = self.angles; - if ( self.eUser != world ) { + if ( ( self.eUser != world ) && ( self.health > 0 ) ) { // This is visible ingame, so this is definitely executed. vector vEndAngle = vectoangles( self.eUser.origin - self.origin ); self.angles_y += Client_LerpCamera( self.angles_y, vEndAngle_y, 0.2 ); @@ -87,7 +97,11 @@ void hostage_entity( void ) { self.eUser = world; self.iUsable = TRUE; + self.iBleeds = TRUE; + self.takedamage = DAMAGE_YES; self.vUse = hostage_use; + self.vPain = hostage_pain; + self.vDeath = hostage_die; self.frame = 13; // Idle frame self.health = 100; diff --git a/Source/Server/Entities.c b/Source/Server/Entities.c index bb2a03af..35f74251 100644 --- a/Source/Server/Entities.c +++ b/Source/Server/Entities.c @@ -22,11 +22,15 @@ void func_wall( void ) { self.angles = '0 0 0'; self.movetype = MOVETYPE_PUSH; self.solid = SOLID_BSP; + setmodel (self, self.model); // GoldSrc-Rendermode support if( self.rendermode == 2 ) { 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 ){ - setmodel( self, self.model ); + func_wall(); self.solid = SOLID_NOT; } void func_water( void ) { - func_illusionary(); + func_wall(); + self.skin = CONTENT_WATER; } void ambient_generic( void ) { 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 ); } diff --git a/Source/Server/Main.c b/Source/Server/Main.c index 9e4cde47..4858dfaa 100644 --- a/Source/Server/Main.c +++ b/Source/Server/Main.c @@ -54,6 +54,9 @@ void worldspawn( void ) { precache_model (sCSPlayers[7]); precache_model (sCSPlayers[8]); + EFFECT_GUNSHOT = particleeffectnum( "te_gunshot" ); + EFFECT_BLOOD = particleeffectnum( "te_blood" ); + precache_sound( "radio/moveout.wav" ); precache_sound( "radio/letsgo.wav" ); precache_sound( "radio/locknload.wav" ); diff --git a/Source/Server/Spawn.c b/Source/Server/Spawn.c index 540759ab..12b321c4 100644 --- a/Source/Server/Spawn.c +++ b/Source/Server/Spawn.c @@ -66,7 +66,7 @@ void Spawn_GameClient( float fTeam ) { setmodel( self, sCSPlayers[ fTeam ] ); 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.frame = 1; // Idle frame diff --git a/Source/Server/TraceAttack.c b/Source/Server/TraceAttack.c new file mode 100644 index 00000000..509098ee --- /dev/null +++ b/Source/Server/TraceAttack.c @@ -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 )); +} diff --git a/Source/Server/progs.src b/Source/Server/progs.src index 7d1e5ef6..6907db19 100644 --- a/Source/Server/progs.src +++ b/Source/Server/progs.src @@ -2,7 +2,7 @@ #pragma progs_dat "../../Main/progs.dat" -#define QWSSQC +#define SSQC #includelist ../Builtins.h @@ -34,6 +34,8 @@ Defs.h ../Shared/WeaponBase.c ../Shared/Weapons.c +Damage.c +TraceAttack.c Timer.c Main.c EntHostage.c diff --git a/Source/Shared/WeaponAK47.c b/Source/Shared/WeaponAK47.c index 0e8b7b27..86f3a742 100644 --- a/Source/Shared/WeaponAK47.c +++ b/Source/Shared/WeaponAK47.c @@ -37,7 +37,10 @@ weaponinfo_t wptAK47 = { 0.1, // Attack-Delay 2.4, // Reload-Delay 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 @@ -51,7 +54,7 @@ enum { }; void WeaponAK47_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/ak47_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponAK47_Draw( void ) { } void WeaponAK47_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( random() <= 0.5 ) { sound( self, CHAN_WEAPON, "weapons/ak47-1.wav", 1, ATTN_NORM ); @@ -81,7 +84,7 @@ void WeaponAK47_PrimaryFire( void ) { } void WeaponAK47_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponAUG.c b/Source/Shared/WeaponAUG.c index 221b8d43..fe59ce5f 100644 --- a/Source/Shared/WeaponAUG.c +++ b/Source/Shared/WeaponAUG.c @@ -37,7 +37,10 @@ weaponinfo_t wptAUG = { 0.09, // Attack-Delay 3.3, // Reload-Delay 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 @@ -51,7 +54,7 @@ enum { }; void WeaponAUG_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/aug_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponAUG_Draw( void ) { } void WeaponAUG_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { sound( self, CHAN_WEAPON, "weapons/aug-1.wav", 1, ATTN_NORM ); } @@ -77,7 +80,7 @@ void WeaponAUG_PrimaryFire( void ) { } void WeaponAUG_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponAWP.c b/Source/Shared/WeaponAWP.c index dc6ed782..512099d8 100644 --- a/Source/Shared/WeaponAWP.c +++ b/Source/Shared/WeaponAWP.c @@ -37,7 +37,10 @@ weaponinfo_t wptAWP = { 1.2, // Attack-Delay 2.9, // Reload-Delay iAmmo_338MAG, // Caliber Pointer - iClip_AWP // Clip Pointer + iClip_AWP, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -51,7 +54,7 @@ enum { }; void WeaponAWP_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/awp_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponAWP_Draw( void ) { } void WeaponAWP_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound sound( self, CHAN_WEAPON, "weapons/awp1.wav", 1, ATTN_NORM ); @@ -78,7 +81,7 @@ void WeaponAWP_PrimaryFire( void ) { } void WeaponAWP_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponBase.c b/Source/Shared/WeaponBase.c index 02881688..f4e404c8 100644 --- a/Source/Shared/WeaponBase.c +++ b/Source/Shared/WeaponBase.c @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // 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 ] = { wptDEFAULT, @@ -48,35 +48,35 @@ weaponinfo_t wptTable[ CS_WEAPON_COUNT ] = { wptPARA }; -#ifdef QWSSQC +#ifdef SSQC void OpenCSGunBase_Draw( void ) { - #ifdef QWSSQC self.iCurrentClip = self.(wptTable[ self.weapon ].iClipfld); self.iCurrentCaliber = self.(wptTable[ self.weapon ].iCaliberfld); 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 float OpenCSGunBase_PrimaryFire( void ) { - #ifdef QWSSQC // Nothing in the clip anymore? Don't even attempt if ( ( self.(wptTable[ self.weapon ].iClipfld) - 1 ) < 0 ) { return FALSE; } - // Take as many bullets away from the clip as it takes + OpenCSGunBase_AccuracyCalc(); + TraceAttack_FireBullets(); + self.(wptTable[ self.weapon ].iClipfld) -= 1; self.fAttackFinished = time + wptTable[ self.weapon ].fAttackFinished; Client_SendEvent( self, EV_WEAPON_PRIMARYATTACK ); return TRUE; - - #endif } float OpenCSGunBase_Reload( void ) { - #ifdef QWSSQC // Don't bother reloading the gun when full if ( self.(wptTable[ self.weapon ].iClipfld) == wptTable[ self.weapon ].iClipSize ) { return FALSE; @@ -99,6 +99,5 @@ float OpenCSGunBase_Reload( void ) { Client_SendEvent( self, EV_WEAPON_RELOAD ); return TRUE; - #endif } #endif diff --git a/Source/Shared/WeaponDeagle.c b/Source/Shared/WeaponDeagle.c index 395f24aa..8b1807fe 100644 --- a/Source/Shared/WeaponDeagle.c +++ b/Source/Shared/WeaponDeagle.c @@ -26,7 +26,7 @@ weaponinfo_t wptDEAGLE = { SLOT_SECONDARY, 650, // Price CALIBER_50AE, // Caliber ID - 650, // Max Player Speed + 240, // Max Player Speed 1, // Bullets Per Shot 7, // Clip/MagSize 54, // Damage Per Bullet @@ -37,7 +37,10 @@ weaponinfo_t wptDEAGLE = { 0.15, // Attack-Delay 2.1, // Reload-Delay iAmmo_50AE, // Caliber Pointer - iClip_DEAGLE // Clip Pointer + iClip_DEAGLE, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -51,7 +54,7 @@ enum { }; void WeaponDEAGLE_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/de_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client.. #else @@ -60,7 +63,7 @@ void WeaponDEAGLE_Draw( void ) { } void WeaponDEAGLE_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( random() <= 0.5 ) { sound( self, CHAN_WEAPON, "weapons/deagle-1.wav", 1, ATTN_NORM ); @@ -83,7 +86,7 @@ void WeaponDEAGLE_PrimaryFire( void ) { } void WeaponDEAGLE_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponElites.c b/Source/Shared/WeaponElites.c index 62cfebb2..98f6c88b 100644 --- a/Source/Shared/WeaponElites.c +++ b/Source/Shared/WeaponElites.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .int iClip_ELITES; -#ifdef QWSSQC +#ifdef SSQC .int iMode_ELITES; #else int iWeaponMode_ELITES; @@ -43,7 +43,10 @@ weaponinfo_t wptELITES = { 0.15, // Attack-Delay 4.6, // Reload-Delay iAmmo_9MM, // Caliber Pointer - iClip_ELITES // Clip Pointer + iClip_ELITES, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -67,7 +70,7 @@ enum { }; void WeaponELITES_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/elite_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -76,7 +79,7 @@ void WeaponELITES_Draw( void ) { } void WeaponELITES_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound sound( self, CHAN_WEAPON, "weapons/elite_fire.wav", 1, ATTN_NORM ); @@ -122,7 +125,7 @@ void WeaponELITES_PrimaryFire( void ) { } void WeaponELITES_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponFiveSeven.c b/Source/Shared/WeaponFiveSeven.c index 9d8030e9..60e1dfe7 100644 --- a/Source/Shared/WeaponFiveSeven.c +++ b/Source/Shared/WeaponFiveSeven.c @@ -37,7 +37,10 @@ weaponinfo_t wptFIVESEVEN = { 0.15, // Attack-Delay 3.1, // Reload-Delay iAmmo_57MM, // Caliber Pointer - iClip_FIVESEVEN // Clip Pointer + iClip_FIVESEVEN, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -51,7 +54,7 @@ enum { }; void WeaponFIVESEVEN_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/fiveseven_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponFIVESEVEN_Draw( void ) { } void WeaponFIVESEVEN_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound sound( self, CHAN_WEAPON, "weapons/fiveseven-1.wav", 1, ATTN_NORM ); @@ -80,7 +83,7 @@ void WeaponFIVESEVEN_PrimaryFire( void ) { } void WeaponFIVESEVEN_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponG3SG1.c b/Source/Shared/WeaponG3SG1.c index 17a0a946..46eb8a04 100644 --- a/Source/Shared/WeaponG3SG1.c +++ b/Source/Shared/WeaponG3SG1.c @@ -37,7 +37,10 @@ weaponinfo_t wptG3SG1 = { 0.25, // Attack-Delay 4.6, // Reload-Delay iAmmo_762MM, // Caliber Pointer - iClip_G3SG1 // Clip Pointer + iClip_G3SG1, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -50,7 +53,7 @@ enum { }; void WeaponG3SG1_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/g3sg1_slide.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -59,7 +62,7 @@ void WeaponG3SG1_Draw( void ) { } void WeaponG3SG1_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound dprint("[DEBUG] FIRE!\n"); @@ -76,7 +79,7 @@ void WeaponG3SG1_PrimaryFire( void ) { } void WeaponG3SG1_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponGlock18.c b/Source/Shared/WeaponGlock18.c index 2201fd3f..962b7863 100644 --- a/Source/Shared/WeaponGlock18.c +++ b/Source/Shared/WeaponGlock18.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .int iClip_GLOCK18; -#ifdef QWSSQC +#ifdef SSQC .int iMode_GLOCK18; #else int iWeaponMode_GLOCK18; @@ -43,7 +43,10 @@ weaponinfo_t wptGLOCK18 = { 0.15, // Attack-Delay 2.0, // Reload-Delay iAmmo_9MM, // Caliber Pointer - iClip_GLOCK18 // Clip Pointer + iClip_GLOCK18, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -64,7 +67,7 @@ enum { }; void WeaponGLOCK18_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/slideback1.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -77,7 +80,7 @@ void WeaponGLOCK18_Draw( void ) { } void WeaponGLOCK18_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound if ( self.iMode_GLOCK18 == FALSE ) { @@ -104,7 +107,7 @@ void WeaponGLOCK18_PrimaryFire( void ) { } void WeaponGLOCK18_Secondary( void ) { -#ifdef QWSSQC +#ifdef SSQC // Just switch the modes quickly self.iMode_GLOCK18 = 1 - self.iMode_GLOCK18; self.fAttackFinished = time + 1.0; @@ -123,7 +126,7 @@ void WeaponGLOCK18_Secondary( void ) { } void WeaponGLOCK18_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponM3.c b/Source/Shared/WeaponM3.c index 7746a489..a907ced4 100644 --- a/Source/Shared/WeaponM3.c +++ b/Source/Shared/WeaponM3.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .int iClip_M3; -#ifdef QWSSQC +#ifdef SSQC .int iMode_M3; #else int iWeaponMode_M3; @@ -43,7 +43,10 @@ weaponinfo_t wptM3 = { 1.0, // Attack-Delay 3.0, // Reload-Delay 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 @@ -58,7 +61,7 @@ enum { }; void WeaponM3_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -69,7 +72,7 @@ void WeaponM3_Draw( void ) { void WeaponM3_ReloadNULL( void ) { } void WeaponM3_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( self.iMode_M3 == TRUE ) { self.iMode_M3 = 0; Client_SendEvent( self, EV_WEAPON_RELOAD ); @@ -92,7 +95,7 @@ void WeaponM3_PrimaryFire( void ) { void WeaponM3_Reload( void); void WeaponM3_Secondary( void ) { -#ifdef QWSSQC +#ifdef SSQC // If it's full or no ammo is left... if ( (self.(wptM3.iClipfld) == wptM3.iClipSize) || ( self.(wptM3.iCaliberfld) <= 0 ) ) { self.iMode_M3 = 0; @@ -115,7 +118,7 @@ void WeaponM3_Secondary( void ) { } void WeaponM3_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC // Can we reload the gun even if we wanted to? if ( ( self.(wptM3.iClipfld) != wptM3.iClipSize ) && ( self.(wptM3.iCaliberfld) > 0 ) ) { self.iMode_M3 = 1 - self.iMode_M3; diff --git a/Source/Shared/WeaponM4A1.c b/Source/Shared/WeaponM4A1.c index b37c30ec..c79444a9 100644 --- a/Source/Shared/WeaponM4A1.c +++ b/Source/Shared/WeaponM4A1.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .int iClip_M4A1; -#ifdef QWSSQC +#ifdef SSQC .int iMode_M4A1; #else int iWeaponMode_M4A1; @@ -43,7 +43,10 @@ weaponinfo_t wptM4A1 = { 0.09, // Attack-Delay 3.1, // Reload-Delay iAmmo_556MM, // Caliber Pointer - iClip_M4A1 // Clip Pointer + iClip_M4A1, // Clip Pointer + 220, // Accuracy Divisor + 0.3, // Accuracy Offset + 1.0 // Max Inaccuracy }; enum { @@ -64,7 +67,7 @@ enum { }; void WeaponM4A1_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); #else if ( iWeaponMode_M4A1 == TRUE ) { @@ -76,7 +79,7 @@ void WeaponM4A1_Draw( void ) { } void WeaponM4A1_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( self.iMode_M4A1 == TRUE ) { sound( self, CHAN_WEAPON, "weapons/m4a1-1.wav", 1, ATTN_NORM ); @@ -114,7 +117,7 @@ void WeaponM4A1_PrimaryFire( void ) { } void WeaponM4A1_Secondary( void ) { -#ifdef QWSSQC +#ifdef SSQC // Just switch the modes quickly self.iMode_M4A1 = 1 - self.iMode_M4A1; self.fAttackFinished = time + 3.0; @@ -140,7 +143,7 @@ void WeaponM4A1_Secondary( void ) { } void WeaponM4A1_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponMP5.c b/Source/Shared/WeaponMP5.c index 19cce8c3..5d0f40e9 100644 --- a/Source/Shared/WeaponMP5.c +++ b/Source/Shared/WeaponMP5.c @@ -37,7 +37,10 @@ weaponinfo_t wptMP5 = { 0.08, // Attack-Delay 2.6, // Reload-Delay 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 @@ -51,7 +54,7 @@ enum { }; void WeaponMP5_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/mp5_slideback.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponMP5_Draw( void ) { } void WeaponMP5_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( random() <= 0.5 ) { sound( self, CHAN_WEAPON, "weapons/mp5-1.wav", 1, ATTN_NORM ); @@ -81,7 +84,7 @@ void WeaponMP5_PrimaryFire( void ) { } void WeaponMP5_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponMac10.c b/Source/Shared/WeaponMac10.c index 1a066ac6..fc1f6af9 100644 --- a/Source/Shared/WeaponMac10.c +++ b/Source/Shared/WeaponMac10.c @@ -37,7 +37,10 @@ weaponinfo_t wptMAC10 = { 0.075, // Attack-Delay 3.2, // Reload-Delay 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 @@ -51,7 +54,7 @@ enum { }; void WeaponMAC10_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/mac10_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponMAC10_Draw( void ) { } void WeaponMAC10_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { sound( self, CHAN_WEAPON, "weapons/mac10-1.wav", 1, ATTN_NORM ); } @@ -78,7 +81,7 @@ void WeaponMAC10_PrimaryFire( void ) { } void WeaponMAC10_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponP228.c b/Source/Shared/WeaponP228.c index eab914a5..69483f39 100644 --- a/Source/Shared/WeaponP228.c +++ b/Source/Shared/WeaponP228.c @@ -37,7 +37,10 @@ weaponinfo_t wptP228 = { 0.15, // Attack-Delay 2.7, // Reload-Delay iAmmo_357SIG, // Caliber Pointer - iClip_P228 // Clip Pointer + iClip_P228, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -52,7 +55,7 @@ enum { }; void WeaponP228_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/p228_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -61,7 +64,7 @@ void WeaponP228_Draw( void ) { } void WeaponP228_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound sound( self, CHAN_WEAPON, "weapons/p228-1.wav", 1, ATTN_NORM ); @@ -85,7 +88,7 @@ void WeaponP228_PrimaryFire( void ) { } void WeaponP228_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponP90.c b/Source/Shared/WeaponP90.c index aa668886..388dfbae 100644 --- a/Source/Shared/WeaponP90.c +++ b/Source/Shared/WeaponP90.c @@ -37,7 +37,10 @@ weaponinfo_t wptP90 = { 0.07, // Attack-Delay 3.3, // Reload-Delay 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 @@ -51,7 +54,7 @@ enum { }; void WeaponP90_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/p90_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponP90_Draw( void ) { } void WeaponP90_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { sound( self, CHAN_WEAPON, "weapons/p90-1.wav", 1, ATTN_NORM ); } @@ -78,7 +81,7 @@ void WeaponP90_PrimaryFire( void ) { } void WeaponP90_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponPara.c b/Source/Shared/WeaponPara.c index ca332175..3f3b64be 100644 --- a/Source/Shared/WeaponPara.c +++ b/Source/Shared/WeaponPara.c @@ -37,7 +37,10 @@ weaponinfo_t wptPARA = { 0.08, // Attack-Delay 3.0, // Reload-Delay 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 @@ -51,7 +54,7 @@ enum { }; void WeaponPARA_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/m249_chain.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponPARA_Draw( void ) { } void WeaponPARA_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( random() <= 0.5 ) { sound( self, CHAN_WEAPON, "weapons/m249-1.wav", 1, ATTN_NORM ); @@ -81,7 +84,7 @@ void WeaponPARA_PrimaryFire( void ) { } void WeaponPARA_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponSG550.c b/Source/Shared/WeaponSG550.c index 48401b8b..7f94a483 100644 --- a/Source/Shared/WeaponSG550.c +++ b/Source/Shared/WeaponSG550.c @@ -37,7 +37,10 @@ weaponinfo_t wptSG550 = { 0.25, // Attack-Delay 3.8, // Reload-Delay iAmmo_556MM, // Caliber Pointer - iClip_SG550 // Clip Pointer + iClip_SG550, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -50,7 +53,7 @@ enum { }; void WeaponSG550_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/sg550_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -59,7 +62,7 @@ void WeaponSG550_Draw( void ) { } void WeaponSG550_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { sound( self, CHAN_WEAPON, "weapons/sg550-1.wav", 1, ATTN_NORM ); } @@ -74,7 +77,7 @@ void WeaponSG550_PrimaryFire( void ) { } void WeaponSG550_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponSG552.c b/Source/Shared/WeaponSG552.c index 367671e3..a7fbaebf 100644 --- a/Source/Shared/WeaponSG552.c +++ b/Source/Shared/WeaponSG552.c @@ -37,7 +37,10 @@ weaponinfo_t wptSG552 = { 0.09, // Attack-Delay 3.2, // Reload-Delay 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 @@ -51,7 +54,7 @@ enum { }; void WeaponSG552_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/sg552_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponSG552_Draw( void ) { } void WeaponSG552_PrimaryFire( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( random() <= 0.5 ) { sound( self, CHAN_WEAPON, "weapons/sg552-1.wav", 1, ATTN_NORM ); @@ -81,7 +84,7 @@ void WeaponSG552_PrimaryFire( void ) { } void WeaponSG552_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponScout.c b/Source/Shared/WeaponScout.c index 1ab10d67..332de7e9 100644 --- a/Source/Shared/WeaponScout.c +++ b/Source/Shared/WeaponScout.c @@ -37,7 +37,10 @@ weaponinfo_t wptSCOUT = { 1.25, // Attack-Delay 2.0, // Reload-Delay iAmmo_762MM, // Caliber Pointer - iClip_SCOUT // Clip Pointer + iClip_SCOUT, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; // Anim Table @@ -50,7 +53,7 @@ enum { }; void WeaponSCOUT_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/scout_bolt.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -59,7 +62,7 @@ void WeaponSCOUT_Draw( void ) { } void WeaponSCOUT_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { // Play Sound sound( self, CHAN_WEAPON, "weapons/scout_fire-1.wav", 1, ATTN_NORM ); @@ -74,7 +77,7 @@ void WeaponSCOUT_PrimaryFire( void ) { } void WeaponSCOUT_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponTMP.c b/Source/Shared/WeaponTMP.c index 68b335fc..b04b8636 100644 --- a/Source/Shared/WeaponTMP.c +++ b/Source/Shared/WeaponTMP.c @@ -36,8 +36,11 @@ weaponinfo_t wptTMP = { TYPE_AUTO, 0.07, // Attack-Delay 2.1, // Reload-Delay - iAmmo_9MM, // Caliber Pointer - iClip_TMP // Clip Pointer + iAmmo_9MM, // Caliber Pointer + iClip_TMP, // Clip Pointer + 200, // Accuracy Divisor + 0.55, // Accuracy Offset + 1.4 // Max Inaccuracy }; // Anim Table @@ -51,7 +54,7 @@ enum { }; void WeaponTMP_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); #else View_PlayAnimation( ANIM_TMP_DRAW ); @@ -59,7 +62,7 @@ void WeaponTMP_Draw( void ) { } void WeaponTMP_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( random() <= 0.5 ) { sound( self, CHAN_WEAPON, "weapons/tmp-1.wav", 1, ATTN_NORM ); @@ -80,7 +83,7 @@ void WeaponTMP_PrimaryFire( void ) { } void WeaponTMP_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponUMP45.c b/Source/Shared/WeaponUMP45.c index 2859a14e..8373639e 100644 --- a/Source/Shared/WeaponUMP45.c +++ b/Source/Shared/WeaponUMP45.c @@ -37,7 +37,10 @@ weaponinfo_t wptUMP45 = { 0.105, // Attack-Delay 3.5, // Reload-Delay iAmmo_45ACP, // Caliber Pointer - iClip_UMP45 // Clip Pointer + iClip_UMP45, // Clip Pointer + 210, // Accuracy Divisor + 0.5, // Accuracy Offset + 1 // Max Inaccuracy }; // Anim Table @@ -51,7 +54,7 @@ enum { }; void WeaponUMP45_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/ump45_boltslap.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -60,7 +63,7 @@ void WeaponUMP45_Draw( void ) { } void WeaponUMP45_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { sound( self, CHAN_WEAPON, "weapons/ump45-1.wav", 1, ATTN_NORM ); } @@ -78,7 +81,7 @@ void WeaponUMP45_PrimaryFire( void ) { } void WeaponUMP45_Reload( void ) { - #ifdef QWSSQC + #ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponUSP45.c b/Source/Shared/WeaponUSP45.c index e31ffab6..63461c44 100644 --- a/Source/Shared/WeaponUSP45.c +++ b/Source/Shared/WeaponUSP45.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .int iClip_USP45; -#ifdef QWSSQC +#ifdef SSQC .int iMode_USP45; #else int iWeaponMode_USP45; @@ -43,7 +43,10 @@ weaponinfo_t wptUSP45 = { 0.15, // Attack-Delay 2.5, // Reload-Delay iAmmo_45ACP, // Caliber Pointer - iClip_USP45 // Clip Pointer + iClip_USP45, // Clip Pointer + -1, // Accuracy Divisor + 0, // Accuracy Offset + 0 // Max Inaccuracy }; enum { @@ -66,7 +69,7 @@ enum { }; void WeaponUSP45_Draw( void ) { -#ifdef QWSSQC +#ifdef SSQC OpenCSGunBase_Draw(); #else if ( iWeaponMode_USP45 == TRUE ) { @@ -78,7 +81,7 @@ void WeaponUSP45_Draw( void ) { } void WeaponUSP45_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_PrimaryFire() == TRUE ) { if ( self.iMode_USP45 == TRUE ) { if ( random() <= 0.5 ) { @@ -124,7 +127,7 @@ void WeaponUSP45_PrimaryFire( void ) { } void WeaponUSP45_Secondary( void ) { -#ifdef QWSSQC +#ifdef SSQC // Just switch the modes quickly self.iMode_USP45 = 1 - self.iMode_USP45; self.fAttackFinished = time + 3.0; @@ -150,7 +153,7 @@ void WeaponUSP45_Secondary( void ) { } void WeaponUSP45_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( OpenCSGunBase_Reload() == TRUE ) { // Play Sound } diff --git a/Source/Shared/WeaponXM1014.c b/Source/Shared/WeaponXM1014.c index 84a89165..48cfbfaf 100644 --- a/Source/Shared/WeaponXM1014.c +++ b/Source/Shared/WeaponXM1014.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .int iClip_XM1014; -#ifdef QWSSQC +#ifdef SSQC .int iMode_XM1014; #else int iWeaponMode_XM1014; @@ -34,7 +34,7 @@ weaponinfo_t wptXM1014 = { CALIBER_BUCKSHOT, // Caliber ID 240, // Max Player Speed 6, // Bullets Per Shot - 7, // Clip/MagSize + 7, // Clip/MagSize 22, // Damage Per Bullet 1, // Penetration Multiplier 3000, // Bullet Range @@ -42,8 +42,11 @@ weaponinfo_t wptXM1014 = { TYPE_AUTO, 0.25, // Attack-Delay 3.0, // Reload-Delay - iAmmo_BUCKSHOT, // Caliber Pointer - iClip_XM1014 // Clip Pointer + iAmmo_BUCKSHOT, // Caliber Pointer + iClip_XM1014, // Clip Pointer + 200, // Accuracy Divisor + 0.35, // Accuracy Offset + 1.25 // Max Inaccuracy }; // Anim Table @@ -58,7 +61,7 @@ enum { }; void WeaponXM1014_Draw( void ) { - #ifdef QWSSQC + #ifdef SSQC OpenCSGunBase_Draw(); sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else @@ -69,7 +72,7 @@ void WeaponXM1014_Draw( void ) { void WeaponXM1014_ReloadNULL( void ) { } void WeaponXM1014_PrimaryFire( void ) { -#ifdef QWSSQC +#ifdef SSQC if ( self.iMode_XM1014 == TRUE ) { self.iMode_XM1014 = 0; Client_SendEvent( self, EV_WEAPON_RELOAD ); @@ -92,7 +95,7 @@ void WeaponXM1014_PrimaryFire( void ) { void WeaponXM1014_Reload( void); void WeaponXM1014_Secondary( void ) { -#ifdef QWSSQC +#ifdef SSQC // If it's full or no ammo is left... if ( (self.(wptXM1014.iClipfld) == wptXM1014.iClipSize) || ( self.(wptXM1014.iCaliberfld) <= 0 ) ) { self.iMode_XM1014 = 0; @@ -115,7 +118,7 @@ void WeaponXM1014_Secondary( void ) { } void WeaponXM1014_Reload( void ) { -#ifdef QWSSQC +#ifdef SSQC // Can we reload the gun even if we wanted to? if ( ( self.(wptXM1014.iClipfld) != wptXM1014.iClipSize ) && ( self.(wptXM1014.iCaliberfld) > 0 ) ) { self.iMode_XM1014 = 1 - self.iMode_XM1014; diff --git a/Source/Shared/Weapons.c b/Source/Shared/Weapons.c index 1daded60..a969af89 100644 --- a/Source/Shared/Weapons.c +++ b/Source/Shared/Weapons.c @@ -29,7 +29,7 @@ weaponfunc_t wpnFuncTable[ CS_WEAPON_COUNT ] = { { WeaponP228_Draw, WeaponP228_PrimaryFire, Temp_Nothing, WeaponP228_Reload }, { WeaponELITES_Draw, WeaponELITES_PrimaryFire, Temp_Nothing, WeaponELITES_Reload }, { WeaponFIVESEVEN_Draw, WeaponFIVESEVEN_PrimaryFire, Temp_Nothing, WeaponFIVESEVEN_Reload }, - #ifdef QWSSQC + #ifdef SSQC { WeaponM3_Draw, WeaponM3_PrimaryFire, Temp_Nothing, WeaponM3_Reload }, { WeaponXM1014_Draw, WeaponXM1014_PrimaryFire, Temp_Nothing, WeaponXM1014_Reload }, #else @@ -55,13 +55,13 @@ weaponfunc_t wpnFuncTable[ CS_WEAPON_COUNT ] = { void Weapon_Draw( float fWeapon ) { wpnFuncTable[ fWeapon ].vDraw(); - #ifdef QWSSQC + #ifdef SSQC self.maxspeed = (float)wptTable[ fWeapon ].iPlayerSpeed; #endif } void Weapon_PrimaryAttack( float fWeapon ) { - #ifdef QWSSQC + #ifdef SSQC if ( self.fAttackFinished > time ) { return; } @@ -71,7 +71,7 @@ void Weapon_PrimaryAttack( float fWeapon ) { } void Weapon_SecondaryAttack( float fWeapon ) { - #ifdef QWSSQC + #ifdef SSQC if ( self.fAttackFinished > time ) { return; } @@ -81,7 +81,7 @@ void Weapon_SecondaryAttack( float fWeapon ) { } void Weapon_Reload( float fWeapon ) { - #ifdef QWSSQC + #ifdef SSQC if ( self.fAttackFinished > time ) { return; } @@ -90,7 +90,7 @@ void Weapon_Reload( float fWeapon ) { wpnFuncTable[ fWeapon ].vReload(); } -#ifdef QWSSQC +#ifdef SSQC void Weapon_UpdateCurrents( void ) { self.iCurrentClip = self.(wptTable[ self.weapon ].iClipfld); self.iCurrentCaliber = self.(wptTable[ self.weapon ].iCaliberfld);