From: Mario Date: Tue, 24 Feb 2015 12:02:29 +0000 (+1100) Subject: Remove revolver (seems we reached a weapon breakage limit) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1f6cc2297bee07696c71822640ddbd185ccffc08;p=xonotic%2Fxonotic-data.pk3dir.git Remove revolver (seems we reached a weapon breakage limit) --- diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 2845b3d6a..9298d6e3a 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -599,7 +599,6 @@ void Send_Notification_WOCOVA( MSG_INFO_NOTIF(1, INFO_WEAPON_MORTAR_MURDER_EXPLODE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weapongrenadelauncher", _("^BG%s%s^K1 ate ^BG%s^K1's Mortar grenade%s%s"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_MORTAR_SUICIDE_BOUNCE, 2, 1, "s1 s2loc spree_lost", "s1", "weapongrenadelauncher", _("^BG%s^K1 didn't see their own Mortar grenade%s%s"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_MORTAR_SUICIDE_EXPLODE, 2, 1, "s1 s2loc spree_lost", "s1", "weapongrenadelauncher", _("^BG%s^K1 blew themself up with their own Mortar%s%s"), "") \ - MSG_INFO_NOTIF(1, INFO_WEAPON_REVOLVER_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrevolver", _("^BG%s%s^K1 was put down by ^BG%s^K1's Revolver%s%s"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_RIFLE_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrifle", _("^BG%s%s^K1 was sniped with a Rifle by ^BG%s^K1%s%s"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_RIFLE_MURDER_HAIL, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrifle", _("^BG%s%s^K1 died in ^BG%s^K1's Rifle bullet hail%s%s"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_RIFLE_MURDER_HAIL_PIERCING, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrifle", _("^BG%s%s^K1 failed to hide from ^BG%s^K1's Rifle bullet hail%s%s"), "") \ @@ -1027,7 +1026,6 @@ void Send_Notification_WOCOVA( MSG_MULTI_NOTIF(1, WEAPON_MORTAR_MURDER_EXPLODE, NO_MSG, INFO_WEAPON_MORTAR_MURDER_EXPLODE, NO_MSG) \ MSG_MULTI_NOTIF(1, WEAPON_MORTAR_SUICIDE_BOUNCE, NO_MSG, INFO_WEAPON_MORTAR_SUICIDE_BOUNCE, CENTER_DEATH_SELF_GENERIC) \ MSG_MULTI_NOTIF(1, WEAPON_MORTAR_SUICIDE_EXPLODE, NO_MSG, INFO_WEAPON_MORTAR_SUICIDE_EXPLODE, CENTER_DEATH_SELF_GENERIC) \ - MSG_MULTI_NOTIF(1, WEAPON_REVOLVER_MURDER, NO_MSG, INFO_WEAPON_REVOLVER_MURDER, NO_MSG) \ MSG_MULTI_NOTIF(1, WEAPON_RIFLE_MURDER, NO_MSG, INFO_WEAPON_RIFLE_MURDER, NO_MSG) \ MSG_MULTI_NOTIF(1, WEAPON_RIFLE_MURDER_HAIL, NO_MSG, INFO_WEAPON_RIFLE_MURDER_HAIL, NO_MSG) \ MSG_MULTI_NOTIF(1, WEAPON_RIFLE_MURDER_HAIL_PIERCING, NO_MSG, INFO_WEAPON_RIFLE_MURDER_HAIL_PIERCING, NO_MSG) \ diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 9b9d175bc..86bc8ed8d 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -40,8 +40,7 @@ #include "w_rpc.qc" // more other weapons -#include "w_revolver.qc" -#include "w_lightsabre.qc" #include "w_flak.qc" +#include "w_lightsabre.qc" //#endif diff --git a/qcsrc/common/weapons/w_lightsabre.qc b/qcsrc/common/weapons/w_lightsabre.qc index 9f36daa75..139111123 100644 --- a/qcsrc/common/weapons/w_lightsabre.qc +++ b/qcsrc/common/weapons/w_lightsabre.qc @@ -1,6 +1,4 @@ -#ifndef CHAOS -//const int WEP_LIGHTSABRE = 1337; -#else +#ifdef CHAOS #ifdef REGISTER_WEAPON REGISTER_WEAPON( /* WEP_##id */ LIGHTSABRE, diff --git a/qcsrc/common/weapons/w_revolver.qc b/qcsrc/common/weapons/w_revolver.qc deleted file mode 100644 index 0f117a401..000000000 --- a/qcsrc/common/weapons/w_revolver.qc +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef CHAOS -//const int WEP_REVOLVER = 1337; // abuse -#else -#ifdef REGISTER_WEAPON -REGISTER_WEAPON( -/* WEP_##id */ REVOLVER, -/* function */ W_Revolver, -/* ammotype */ ammo_shells, -/* impulse */ 2, -/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, -/* rating */ BOT_PICKUP_RATING_LOW, -/* color */ '1 1 0.3', -/* modelname */ "revolver", -/* simplemdl */ "foobar", -/* crosshair */ "gfx/crosshairrevolver 0.4", -/* wepimg */ "weaponrevolver", -/* refname */ "revolver", -/* wepname */ _("Revolver") -); - -#define REVOLVER_SETTINGS(w_cvar,w_prop) REVOLVER_SETTINGS_LIST(w_cvar, w_prop, REVOLVER, revolver) -#define REVOLVER_SETTINGS_LIST(w_cvar,w_prop,id,sn) \ - w_cvar(id, sn, NONE, ammo) \ - w_cvar(id, sn, NONE, animtime) \ - w_cvar(id, sn, NONE, refire) \ - w_cvar(id, sn, NONE, damage) \ - w_cvar(id, sn, NONE, force) \ - w_cvar(id, sn, NONE, solidpenetration) \ - w_cvar(id, sn, NONE, spread) \ - w_cvar(id, sn, NONE, load_time) \ - w_cvar(id, sn, NONE, load_refire) \ - w_prop(id, sn, float, reloading_ammo, reload_ammo) \ - w_prop(id, sn, float, reloading_time, reload_time) \ - w_prop(id, sn, float, switchdelay_raise, switchdelay_raise) \ - w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \ - w_prop(id, sn, string, weaponreplace, weaponreplace) \ - w_prop(id, sn, float, weaponstart, weaponstart) \ - w_prop(id, sn, float, weaponstartoverride, weaponstartoverride) \ - w_prop(id, sn, float, weaponthrowable, weaponthrowable) - -#ifdef SVQC -REVOLVER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) -#endif -#else -#ifdef SVQC -#include "../effects.qh" - -void spawnfunc_weapon_revolver(void) { weapon_defaultspawnfunc(WEP_REVOLVER); } - -void W_Revolver_Attack() -{ - entity flash; - - W_DecreaseAmmo(WEP_CVAR(revolver, ammo)); - - W_SetupShot(self, true, 5, W_Sound("revolver_fire"), CH_WEAPON_A, WEP_CVAR(revolver, damage)); - fireBullet(w_shotorg, w_shotdir, WEP_CVAR(revolver, spread), WEP_CVAR(revolver, solidpenetration), WEP_CVAR(revolver, damage), WEP_CVAR(revolver, force), WEP_REVOLVER, 0); - - Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, WEP_CVAR(revolver, ammo)); - - // muzzle flash for 1st person view - flash = spawn(); - setmodel(flash, "models/uziflash.md3"); // precision set below - flash.think = SUB_Remove; - flash.nextthink = time + 0.06; - flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; - W_AttachToShotorg(flash, '5 0 0'); -} - -.float revolver_primarytime; -.float revolver_load; -.float revolver_loadspamtime; - -void W_Revolver_SetLoad(float newload) -{ - if(newload == self.revolver_load) { return; } - - self.revolver_load = newload; - - self.weaponname = ((newload) ? "revolver-cocked" : "revolver"); - - // casing code - if(autocvar_g_casings >= 1) - if(!newload) - SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self); -} - -float W_Revolver_CheckLoad() -{ - if(!self.revolver_load) { return true; } - else if(time >= self.revolver_loadspamtime && IS_REAL_CLIENT(self) && self.BUTTON_ATCK && !self.BUTTON_ATCK2) // TODO - { - self.revolver_loadspamtime = time + WEP_CVAR(revolver, refire) * W_WeaponRateFactor(); - play2(self, W_Sound("dryfire")); - sprint(self, "Please use secondary fire to load the revolver!\n"); - return false; - } - - return false; -} - -float W_Revolver(float req) -{ - float ammo_amount; - switch(req) - { - case WR_AIM: - { - if(!W_Revolver_CheckLoad()) - self.BUTTON_ATCK2 = true; - else - self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); - - return true; - } - case WR_THINK: - { - if(WEP_CVAR(revolver, reload_ammo) && self.clip_load < WEP_CVAR(revolver, ammo)) // forced reload - { - WEP_ACTION(self.weapon, WR_RELOAD); - } - else - { - if(self.BUTTON_ATCK) - if(W_Revolver_CheckLoad()) - if(time >= self.revolver_primarytime) // handle refire separately so the secondary can be fired straight after a primary - { - if(weapon_prepareattack(0, WEP_CVAR(revolver, animtime))) - { - W_Revolver_Attack(); - self.revolver_primarytime = time + WEP_CVAR(revolver, refire) * W_WeaponRateFactor(); - self.revolver_loadspamtime = time + self.revolver_primarytime; // just enough to not spam it this frame - W_Revolver_SetLoad(1); - weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(revolver, animtime), w_ready); - } - } - } - if(self.BUTTON_ATCK2) - if(!W_Revolver_CheckLoad()) - if(weapon_prepareattack(1, WEP_CVAR(revolver, load_refire))) - { - W_Revolver_SetLoad(0); - weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(revolver, load_time), w_ready); - } - - return true; - } - case WR_INIT: - { - precache_model("models/uziflash.md3"); - precache_model(W_Model("g_revolver.md3")); - precache_model(W_Model("v_revolver.md3")); - precache_model(W_Model("h_revolver.iqm")); - precache_model(W_Model("v_revolver-cocked.md3")); - precache_model(W_Model("h_revolver-cocked.iqm")); - precache_sound("misc/itempickup.wav"); - precache_sound(W_Sound("revolver_fire")); - REVOLVER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP) - return true; - } - case WR_SETUP: - { - W_Revolver_SetLoad(0); - return true; - } - case WR_CHECKAMMO1: - { - ammo_amount = self.WEP_AMMO(REVOLVER) >= WEP_CVAR(revolver, ammo); - ammo_amount += self.(weapon_load[WEP_REVOLVER]) >= WEP_CVAR(revolver, ammo); - return ammo_amount; - } - case WR_CHECKAMMO2: - { - ammo_amount = self.WEP_AMMO(REVOLVER) >= WEP_CVAR(revolver, ammo); - ammo_amount += self.(weapon_load[WEP_REVOLVER]) >= WEP_CVAR(revolver, ammo); - if(ammo_amount >= 1) - return !W_Revolver_CheckLoad(); - else - return false; - } - case WR_CONFIG: - { - REVOLVER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS) - return true; - } - case WR_RELOAD: - { - W_Reload(WEP_CVAR(revolver, ammo), W_Sound("reload")); // WEAPONTODO - return true; - } - case WR_SUICIDEMESSAGE: - { - return WEAPON_THINKING_WITH_PORTALS; - } - case WR_KILLMESSAGE: - { - return WEAPON_REVOLVER_MURDER; - } - } - return false; -} -#endif -#ifdef CSQC -.float prevric; -float W_Revolver(float req) -{ - switch(req) - { - case WR_IMPACTEFFECT: - { - vector org2; - org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum("shotgun_impact"), org2, w_backoff * 1000, 1); - if(!w_issilent && time - self.prevric > 0.25) - { - if(w_random < 0.0165) - sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM); - else if(w_random < 0.033) - sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM); - else if(w_random < 0.05) - sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM); - self.prevric = time; - } - - return true; - } - case WR_INIT: - { - precache_sound("weapons/ric1.wav"); - precache_sound("weapons/ric2.wav"); - precache_sound("weapons/ric3.wav"); - return true; - } - case WR_ZOOMRETICLE: - { - // no weapon specific image for this weapon - return false; - } - } - return false; -} -#endif -#endif -#endif diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index fd1d2f4ca..302152e85 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -190,11 +190,7 @@ float Headshot(entity targ, entity ent, vector hitloc, vector start, vector end) { if(!autocvar_sv_headshot) return false; - if(ent.weapon != WEP_RIFLE && ent.weapon != WEP_VAPORIZER && ent.weapon != WEP_VORTEX -#ifdef CHAOS - && ent.weapon != WEP_REVOLVER -#endif - ) + if(ent.weapon != WEP_RIFLE && ent.weapon != WEP_VAPORIZER && ent.weapon != WEP_VORTEX) return false; if(!IS_PLAYER(targ)) return false;