From: Mircea Kitsune Date: Fri, 21 Jan 2011 00:16:12 +0000 (+0200) Subject: Proper names X-Git-Tag: xonotic-v0.5.0~309^2~7^2~179 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=39756c00086ba6c36d9e080f95fa73489eefeb90;p=xonotic%2Fxonotic-data.pk3dir.git Proper names --- diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index ff3903cba..29c316e83 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -98,7 +98,7 @@ void ImpulseCommands (void) W_PreviousWeapon (1); break; case 20: - W_Reload (); + W_WepReload (); break; } } diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 864dd77fc..b2cb1af02 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -1,4 +1,4 @@ -void W_Reload() +void W_WepReload() { self.wish_reload = 1; } @@ -15,7 +15,7 @@ void W_SwitchWeapon(float imp) } else { - W_Reload(); + W_WepReload(); } }; diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 6576ab2a0..2391f8af0 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1618,7 +1618,7 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) float ammo_amount; -float W_SniperRifle_CheckMaxBullets(float checkammo) +float W_CheckMaxBullets(float checkammo) { float maxbulls; maxbulls = autocvar_g_balance_sniperrifle_magazinecapacity; @@ -1627,37 +1627,37 @@ float W_SniperRifle_CheckMaxBullets(float checkammo) if(checkammo) if not(self.items & IT_UNLIMITED_WEAPON_AMMO) maxbulls = min(maxbulls, floor(ammo_amount / min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo))); - if(self.sniperrifle_bulletcounter > maxbulls || !autocvar_g_balance_sniperrifle_magazinecapacity) - self.sniperrifle_bulletcounter = maxbulls; - return (self.sniperrifle_bulletcounter == maxbulls); + if(self.ammo_counter > maxbulls || !autocvar_g_balance_sniperrifle_magazinecapacity) + self.ammo_counter = maxbulls; + return (self.ammo_counter == maxbulls); } -void W_SniperRifle_ReloadedAndReady() +void W_ReloadedAndReady() { float t; - self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity; - W_SniperRifle_CheckMaxBullets(TRUE); + self.ammo_counter = autocvar_g_balance_sniperrifle_magazinecapacity; + W_CheckMaxBullets(TRUE); t = ATTACK_FINISHED(self) - autocvar_g_balance_sniperrifle_reloadtime - 1; ATTACK_FINISHED(self) = t; w_ready(); } -float W_SniperRifle_Reload(float ammo_value) +float W_Reload(float ammo_value) { float t; - W_SniperRifle_CheckMaxBullets(TRUE); + W_CheckMaxBullets(TRUE); ammo_amount = ammo_value; // save ammo to a global float if(ammo_amount < min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1 { print("cannot reload... not enough bullets\n"); - self.sniperrifle_bulletcounter = -1; // reload later + self.ammo_counter = -1; // reload later W_SwitchToOtherWeapon(self); return 0; } - if (self.sniperrifle_bulletcounter >= autocvar_g_balance_sniperrifle_magazinecapacity) + if (self.ammo_counter >= autocvar_g_balance_sniperrifle_magazinecapacity) return 0; if (self.weaponentity) @@ -1674,9 +1674,9 @@ float W_SniperRifle_Reload(float ammo_value) t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_sniperrifle_reloadtime + 1; ATTACK_FINISHED(self) = t; - weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reloadtime, W_SniperRifle_ReloadedAndReady); + weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reloadtime, W_ReloadedAndReady); - self.sniperrifle_bulletcounter = -1; + self.ammo_counter = -1; return 1; } diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 970c86af4..e835738a0 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -612,7 +612,7 @@ float client_cefc_accumulator; float client_cefc_accumulatortime; #endif -.float sniperrifle_bulletcounter; +.float ammo_counter; .float wish_reload; #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 67fb91fc2..a859d3211 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -818,7 +818,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_FUEL, AS_INT, ammo_fuel); addstat(STAT_SHOTORG, AS_INT, stat_shotorg); addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit); - addstat(STAT_BULLETS_LOADED, AS_INT, sniperrifle_bulletcounter); + addstat(STAT_BULLETS_LOADED, AS_INT, ammo_counter); addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup); addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge); diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index e5519551e..267c75ffb 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -6,7 +6,7 @@ REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HIT void W_Shotgun_DoReload() { w_ready(); - if(W_SniperRifle_Reload(self.ammo_shells)) + if(W_Reload(self.ammo_shells)) return; } @@ -22,9 +22,9 @@ void W_Shotgun_Attack (void) float bulletconstant; local entity flash; - if(self.sniperrifle_bulletcounter <= 0) + if(self.ammo_counter <= 0) W_Shotgun_DoReload(); - if(self.sniperrifle_bulletcounter < 0) + if(self.ammo_counter < 0) return; // reloading, so we are done ammoamount = autocvar_g_balance_shotgun_primary_ammo; @@ -57,7 +57,7 @@ void W_Shotgun_Attack (void) flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; W_AttachToShotorg(flash, '5 0 0'); - self.sniperrifle_bulletcounter = self.sniperrifle_bulletcounter - 1; + self.ammo_counter = self.ammo_counter - 1; } void shotgun_meleethink (void) @@ -123,7 +123,7 @@ float w_shotgun(float req) self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE); else if (req == WR_THINK) { - if(self.sniperrifle_bulletcounter < 0) // forced reload (e.g. because interrupted) + if(self.ammo_counter < 0) // forced reload (e.g. because interrupted) self.wish_reload = 1; else { @@ -153,7 +153,7 @@ float w_shotgun(float req) if(self.weaponentity.state == WS_READY) { self.wish_reload = 0; - W_SniperRifle_Reload(self.ammo_shells); + W_Reload(self.ammo_shells); } } } diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc index 94f61e968..d2e5f775b 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -11,7 +11,7 @@ REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_T void W_SniperRifle_DoReload() { w_ready(); - if(W_SniperRifle_Reload(self.ammo_nails)) + if(W_Reload(self.ammo_nails)) return; } @@ -42,7 +42,7 @@ void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAdded if (autocvar_g_casings >= 2) SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self); - self.sniperrifle_bulletcounter = self.sniperrifle_bulletcounter - 1; + self.ammo_counter = self.ammo_counter - 1; } void W_SniperRifle_Attack() @@ -73,9 +73,9 @@ void spawnfunc_weapon_campingrifle (void) void W_SniperRifle_BulletHail_Continue() { float r, sw, af; - if(self.sniperrifle_bulletcounter <= 0) + if(self.ammo_counter <= 0) W_SniperRifle_DoReload(); - if(self.sniperrifle_bulletcounter < 0) + if(self.ammo_counter < 0) return; // reloading, so we are done sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing af = ATTACK_FINISHED(self); @@ -147,7 +147,7 @@ float w_sniperrifle(float req) } else if (req == WR_THINK) { - if(self.sniperrifle_bulletcounter < 0) // forced reload (e.g. because interrupted) + if(self.ammo_counter < 0) // forced reload (e.g. because interrupted) { self.wish_reload = 1; } @@ -188,7 +188,7 @@ float w_sniperrifle(float req) if(self.weaponentity.state == WS_READY) { self.wish_reload = 0; - W_SniperRifle_Reload(self.ammo_nails); + W_Reload(self.ammo_nails); } } } @@ -206,10 +206,10 @@ float w_sniperrifle(float req) { weapon_setup(WEP_SNIPERRIFLE); - full = W_SniperRifle_CheckMaxBullets(TRUE); + full = W_CheckMaxBullets(TRUE); if(autocvar_g_balance_sniperrifle_auto_reload_on_switch) if(!full) - self.sniperrifle_bulletcounter = -1; + self.ammo_counter = -1; } else if (req == WR_CHECKAMMO1) return self.ammo_nails >= autocvar_g_balance_sniperrifle_primary_ammo; @@ -222,8 +222,8 @@ float w_sniperrifle(float req) else if (req == WR_RESETPLAYER) { self.sniperrifle_accumulator = time - autocvar_g_balance_sniperrifle_bursttime; - self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity; - W_SniperRifle_CheckMaxBullets(FALSE); + self.ammo_counter = autocvar_g_balance_sniperrifle_magazinecapacity; + W_CheckMaxBullets(FALSE); } return TRUE; };