Rename minstanex to vaporizer
authorMario <mario.mario@y7mail.com>
Mon, 16 Dec 2013 17:22:43 +0000 (04:22 +1100)
committerMario <mario.mario@y7mail.com>
Mon, 16 Dec 2013 17:22:43 +0000 (04:22 +1100)
18 files changed:
bal-wep-xonotic.cfg
balance-xonotic.cfg
qcsrc/client/View.qc
qcsrc/client/damage.qc
qcsrc/client/hud.qc
qcsrc/client/scoreboard.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/notifications.qh
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/w_minstanex.qc [deleted file]
qcsrc/common/weapons/w_vaporizer.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_minstagib.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/weapons/tracing.qc
qcsrc/warpzonelib/TODO
vehicles.cfg

index 277809b..1db24d7 100644 (file)
@@ -447,28 +447,28 @@ set g_balance_porto_weaponstart 0
 set g_balance_porto_weaponstartoverride -1
 // }}}
 // {{{ #13: Vaporizer
-set g_balance_minstanex_primary_ammo 10
-set g_balance_minstanex_primary_animtime 0.3
-set g_balance_minstanex_primary_refire 1
-set g_balance_minstanex_reload_ammo 0
-set g_balance_minstanex_reload_time 0
-set g_balance_minstanex_secondary_ammo 0
-set g_balance_minstanex_secondary_animtime 0.3
-set g_balance_minstanex_secondary_damage 0
-set g_balance_minstanex_secondary_delay 0
-set g_balance_minstanex_secondary_edgedamage 0
-set g_balance_minstanex_secondary_force 300
-set g_balance_minstanex_secondary_lifetime 5
-set g_balance_minstanex_secondary_radius 70
-set g_balance_minstanex_secondary_refire 0.7
-set g_balance_minstanex_secondary_shotangle 0
-set g_balance_minstanex_secondary_speed 6000
-set g_balance_minstanex_secondary_spread 0
-set g_balance_minstanex_switchdelay_drop 0.2
-set g_balance_minstanex_switchdelay_raise 0.2
-set g_balance_minstanex_weaponreplace ""
-set g_balance_minstanex_weaponstart 0
-set g_balance_minstanex_weaponstartoverride -1
+set g_balance_vaporizer_primary_ammo 10
+set g_balance_vaporizer_primary_animtime 0.3
+set g_balance_vaporizer_primary_refire 1
+set g_balance_vaporizer_reload_ammo 0
+set g_balance_vaporizer_reload_time 0
+set g_balance_vaporizer_secondary_ammo 0
+set g_balance_vaporizer_secondary_animtime 0.3
+set g_balance_vaporizer_secondary_damage 0
+set g_balance_vaporizer_secondary_delay 0
+set g_balance_vaporizer_secondary_edgedamage 0
+set g_balance_vaporizer_secondary_force 300
+set g_balance_vaporizer_secondary_lifetime 5
+set g_balance_vaporizer_secondary_radius 70
+set g_balance_vaporizer_secondary_refire 0.7
+set g_balance_vaporizer_secondary_shotangle 0
+set g_balance_vaporizer_secondary_speed 6000
+set g_balance_vaporizer_secondary_spread 0
+set g_balance_vaporizer_switchdelay_drop 0.2
+set g_balance_vaporizer_switchdelay_raise 0.2
+set g_balance_vaporizer_weaponreplace ""
+set g_balance_vaporizer_weaponstart 0
+set g_balance_vaporizer_weaponstartoverride -1
 // }}}
 // {{{ #14: Grappling Hook
 set g_balance_hook_primary_ammo 5
index b9314fb..296ca67 100644 (file)
@@ -10,7 +10,7 @@ set g_start_weapon_crylink -1 "0 = never provide the weapon, 1 = always provide
 set g_start_weapon_nex -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_weapon_hagar -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_weapon_devastator -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
-set g_start_weapon_minstanex -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
+set g_start_weapon_vaporizer -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
index fbbba4f..cd7a6b3 100644 (file)
@@ -277,7 +277,7 @@ float TrueAimCheck()
                case WEP_MORTAR: // toss curve
                        return SHOTTYPE_HITWORLD;
                case WEP_NEX:
-               case WEP_MINSTANEX:
+               case WEP_VAPORIZER:
                        mv = MOVE_NORMAL;
                        break;
                case WEP_RIFLE:
@@ -804,7 +804,7 @@ void CSQC_UpdateView(float w, float h)
        // the view to go back to normal, so reticle_type would become 0 as we fade out)
        if(spectatee_status || is_dead || hud != HUD_NORMAL)
                reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
-       else if((activeweapon == WEP_NEX || activeweapon == WEP_RIFLE || activeweapon == WEP_MINSTANEX) && (button_zoom || zoomscript_caught))
+       else if((activeweapon == WEP_NEX || activeweapon == WEP_RIFLE || activeweapon == WEP_VAPORIZER) && (button_zoom || zoomscript_caught))
                reticle_type = 2; // nex zoom
        else if(button_zoom || zoomscript_caught)
                reticle_type = 1; // normal zoom
index 3cb9a8c..4526673 100644 (file)
@@ -344,7 +344,7 @@ void Ent_DamageInfo(float isNew)
                w_random = prandom();
 
                traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
-               if(trace_fraction < 1 && hitwep != WEP_NEX && hitwep != WEP_MINSTANEX)
+               if(trace_fraction < 1 && hitwep != WEP_NEX && hitwep != WEP_VAPORIZER)
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -1 * normalize(force);
index 6520048..129fbe3 100644 (file)
@@ -433,7 +433,7 @@ float GetAmmoTypeForWep(float i) // WEAPONTODO
                case WEP_ELECTRO: return 3;
                case WEP_CRYLINK: return 3;
                case WEP_HLAC: return 3;
-               case WEP_MINSTANEX: return 3;
+               case WEP_VAPORIZER: return 3;
                case WEP_NEX: return 3;
                case WEP_RIFLE: return 1;
                case WEP_HAGAR: return 2;
index b037d03..980a8ab 100644 (file)
@@ -969,7 +969,7 @@ float average_accuracy;
 vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
 {
        float i;
-       float weapon_cnt = WEP_COUNT - 3; // either minstanex/nex are hidden, no port-o-launch, no tuba
+       float weapon_cnt = WEP_COUNT - 3; // either vaporizer/nex are hidden, no port-o-launch, no tuba
        float rows;
        if(autocvar_scoreboard_accuracy_doublerows)
                rows = 2;
@@ -1012,7 +1012,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        if(rows == 2)
                pos_x += weapon_width / 2;
 
-       if(switchweapon == WEP_MINSTANEX)
+       if(switchweapon == WEP_VAPORIZER)
                g_minstagib = 1; // TODO: real detection for minstagib?
 
        float weapon_stats;
@@ -1026,7 +1026,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                self = get_weaponinfo(i);
                if (!self.weapon)
                        continue;
-               if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba
+               if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_VAPORIZER && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || vaporizer and tuba
                        continue;
                weapon_stats = weapon_accuracy[i-WEP_FIRST];
 
index a3e856d..dcf1656 100644 (file)
@@ -238,7 +238,7 @@ vector spritelookupcolor(string s, vector def)
                case "wpn-hagar":         return '1 1 0.5';
                case "wpn-rl":            return '1 1 0';
                case "wpn-porto":         return '0.5 0.5 0.5';
-               case "wpn-minstanex":     return '0.5 1 1';
+               case "wpn-vaporizer":     return '0.5 1 1';
                case "wpn-hookgun":       return '0 0.5 0';
                case "wpn-fireball":      return '1 0.5 0';
                case "wpn-hlac":          return '0 1 0';
@@ -298,7 +298,7 @@ string spritelookuptext(string s)
                case "wpn-hagar": return _("Hagar");
                case "wpn-rl": return _("Rocket Launcher");
                case "wpn-porto": return _("Port-O-Launch");
-               case "wpn-minstanex": return _("Minstanex");
+               case "wpn-vaporizer": return _("Vaporizer");
                case "wpn-hookgun": return _("Hook");
                case "wpn-fireball": return _("Fireball");
                case "wpn-hlac": return _("HLAC");
index a1ee8d0..b911fac 100644 (file)
@@ -493,7 +493,7 @@ void Send_Notification_WOCOVA(
        MSG_INFO_NOTIF(1, INFO_WEAPON_LASER_SUICIDE,                 2, 1, "s1 s2loc spree_lost", "s1",                 "weaponlaser",            _("^BG%s^K1 shot themself to hell with their Laser%s%s"), "") \
        MSG_INFO_NOTIF(1, INFO_WEAPON_MINELAYER_MURDER,              3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weaponminelayer",        _("^BG%s%s^K1 got too close to ^BG%s^K1's mine%s%s"), "") \
        MSG_INFO_NOTIF(1, INFO_WEAPON_MINELAYER_SUICIDE,             2, 1, "s1 s2loc spree_lost", "s1",                 "weaponminelayer",        _("^BG%s^K1 forgot about their mine%s%s"), "") \
-       MSG_INFO_NOTIF(1, INFO_WEAPON_MINSTANEX_MURDER,              3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weaponminstanex",        _("^BG%s%s^K1 has been vaporized by ^BG%s^K1's Minstanex%s%s"), "") \
+       MSG_INFO_NOTIF(1, INFO_WEAPON_VAPORIZER_MURDER,              3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weaponminstanex",        _("^BG%s%s^K1 has been sublimated by ^BG%s^K1's Vaporizer%s%s"), "") \
        MSG_INFO_NOTIF(1, INFO_WEAPON_MORTAR_MURDER_BOUNCE,          3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weapongrenadelauncher",  _("^BG%s%s^K1 got too close to ^BG%s^K1's Mortar grenade%s%s"), "") \
        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"), "") \
@@ -778,7 +778,7 @@ void Send_Notification_WOCOVA(
        MSG_MULTI_NOTIF(1, WEAPON_LASER_SUICIDE,                 NO_MSG,        INFO_WEAPON_LASER_SUICIDE,                 CENTER_DEATH_SELF_GENERIC) \
        MSG_MULTI_NOTIF(1, WEAPON_MINELAYER_MURDER,              NO_MSG,        INFO_WEAPON_MINELAYER_MURDER,              NO_MSG) \
        MSG_MULTI_NOTIF(1, WEAPON_MINELAYER_SUICIDE,             NO_MSG,        INFO_WEAPON_MINELAYER_SUICIDE,             CENTER_DEATH_SELF_GENERIC) \
-       MSG_MULTI_NOTIF(1, WEAPON_MINSTANEX_MURDER,              NO_MSG,        INFO_WEAPON_MINSTANEX_MURDER,              NO_MSG) \
+       MSG_MULTI_NOTIF(1, WEAPON_VAPORIZER_MURDER,              NO_MSG,        INFO_WEAPON_VAPORIZER_MURDER,              NO_MSG) \
        MSG_MULTI_NOTIF(1, WEAPON_MORTAR_MURDER_BOUNCE,          NO_MSG,        INFO_WEAPON_MORTAR_MURDER_BOUNCE,          NO_MSG) \
        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) \
index 9429a26..bbf2a59 100644 (file)
@@ -17,7 +17,7 @@
 
 // other weapons
 #include "w_porto.qc"
-#include "w_minstanex.qc"
+#include "w_vaporizer.qc"
 #include "w_hook.qc"
 #include "w_hlac.qc"
 #include "w_tuba.qc"
diff --git a/qcsrc/common/weapons/w_minstanex.qc b/qcsrc/common/weapons/w_minstanex.qc
deleted file mode 100644 (file)
index 47ed37d..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(
-/* WEP_##id */ MINSTANEX,
-/* function */ w_minstanex,
-/* ammotype */ ammo_cells,
-/* impulse  */ 7,
-/* flags    */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
-/* rating   */ BOT_PICKUP_RATING_HIGH,
-/* model    */ "minstanex",
-/* netname  */ "minstanex",
-/* fullname */ _("Vaporizer")
-);
-
-#define MINSTANEX_SETTINGS(w_cvar,w_prop) MINSTANEX_SETTINGS_LIST(w_cvar, w_prop, MINSTANEX, minstanex)
-#define MINSTANEX_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
-       w_cvar(id, sn, PRI, ammo) \
-       w_cvar(id, sn, PRI, animtime) \
-       w_cvar(id, sn, PRI, refire) \
-       w_cvar(id, sn, SEC, ammo) \
-       w_cvar(id, sn, SEC, animtime) \
-       w_cvar(id, sn, SEC, damage) \
-       w_cvar(id, sn, SEC, delay) \
-       w_cvar(id, sn, SEC, edgedamage) \
-       w_cvar(id, sn, SEC, force) \
-       w_cvar(id, sn, SEC, lifetime) \
-       w_cvar(id, sn, SEC, radius) \
-       w_cvar(id, sn, SEC, refire) \
-       w_cvar(id, sn, SEC, shotangle) \
-       w_cvar(id, sn, SEC, speed) \
-       w_cvar(id, sn, SEC, spread) \
-       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)
-
-#ifdef SVQC
-MINSTANEX_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
-.float minstanex_lasthit;
-.float jump_interval;
-#endif
-#else
-#ifdef SVQC
-void spawnfunc_weapon_minstanex (void) { weapon_defaultspawnfunc(WEP_MINSTANEX); }
-
-void W_MinstaNex_Attack (void)
-{
-       float flying;
-       flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
-
-       W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000);
-
-       yoda = 0;
-       damage_goodhits = 0;
-       FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
-
-       if(yoda && flying)
-               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
-       if(damage_goodhits && self.minstanex_lasthit)
-       {
-               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
-               damage_goodhits = 0; // only every second time
-       }
-
-       self.minstanex_lasthit = damage_goodhits;
-
-       pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
-
-       // teamcolor / hit beam effect
-       vector v;
-       v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-       switch(self.team)
-       {
-               case NUM_TEAM_1:   // Red
-                       if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, v);
-                       else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, v);
-                       break;
-               case NUM_TEAM_2:   // Blue
-                       if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, v);
-                       else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, v);
-                       break;
-               case NUM_TEAM_3:   // Yellow
-                       if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, v);
-                       else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, v);
-                       break;
-               case NUM_TEAM_4:   // Pink
-                       if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, v);
-                       else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, v);
-                       break;
-               default:
-                       if(damage_goodhits)
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3_HIT"), w_shotorg, v);
-                       else
-                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
-                       break;
-       }
-       
-       W_DecreaseAmmo(((g_minstagib) ? 1 : WEP_CVAR_PRI(minstanex, ammo)));
-}
-
-float w_minstanex(float req)
-{
-       float ammo_amount;
-       float minstanex_ammo;
-
-       // now multiple WR_s use this
-       minstanex_ammo = ((g_minstagib) ? 1 : WEP_CVAR_PRI(minstanex, ammo));
-
-       switch(req)
-       {
-               case WR_AIM:
-               {
-                       if(self.AMMO_VAL(WEP_MINSTANEX) > 0)
-                               self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
-                       else
-                               self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(minstanex, speed), 0, WEP_CVAR_SEC(minstanex, lifetime), FALSE); // WEAPONTODO: replace with proper minstanex cvars
-                               
-                       return TRUE;
-               }
-               case WR_THINK:
-               {
-                       // if the laser uses load, we also consider its ammo for reloading
-                       if(WEP_CVAR(minstanex, reload_ammo) && WEP_CVAR_SEC(minstanex, ammo) && self.clip_load < min(minstanex_ammo, WEP_CVAR_SEC(minstanex, ammo))) // forced reload
-                               WEP_ACTION(self.weapon, WR_RELOAD);
-                       else if(WEP_CVAR(minstanex, reload_ammo) && self.clip_load < minstanex_ammo) // forced reload
-                               WEP_ACTION(self.weapon, WR_RELOAD);
-                       else if (self.BUTTON_ATCK)
-                       {
-                               if (weapon_prepareattack(0, WEP_CVAR_PRI(minstanex, refire)))
-                               {
-                                       W_MinstaNex_Attack();
-                                       weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(minstanex, animtime), w_ready);
-                               }
-                       }
-                       else if (self.BUTTON_ATCK2)
-                       {
-                               if (self.jump_interval <= time)
-                               if (weapon_prepareattack(1, -1))
-                               {
-                                       // handle refire manually, so that primary and secondary can be fired without conflictions (important for minstagib)
-                                       self.jump_interval = time + WEP_CVAR_SEC(minstanex, refire) * W_WeaponRateFactor();
-                                       
-                                       // decrease ammo for the laser?
-                                       if(WEP_CVAR_SEC(minstanex, ammo))
-                                               W_DecreaseAmmo(WEP_CVAR_SEC(minstanex, ammo));
-
-                                       // ugly minstagib hack to reuse the fire mode of the laser
-                                       float w;
-                                       w = self.weapon;
-                                       self.weapon = WEP_BLASTER;
-                                       W_Blaster_Attack(
-                                               WEP_CVAR_SEC(minstanex, shotangle),
-                                               WEP_CVAR_SEC(minstanex, damage),
-                                               WEP_CVAR_SEC(minstanex, edgedamage),
-                                               WEP_CVAR_SEC(minstanex, radius),
-                                               WEP_CVAR_SEC(minstanex, force),
-                                               WEP_CVAR_SEC(minstanex, speed),
-                                               WEP_CVAR_SEC(minstanex, spread),
-                                               WEP_CVAR_SEC(minstanex, delay),
-                                               WEP_CVAR_SEC(minstanex, lifetime)
-                                       );
-                                       self.weapon = w;
-                                       
-                                       // now do normal refire
-                                       weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(minstanex, animtime), w_ready);
-                               }
-                       }
-                       
-                       return TRUE;
-               }
-               case WR_INIT:
-               {
-                       precache_model("models/nexflash.md3");
-                       precache_model("models/weapons/g_minstanex.md3");
-                       precache_model("models/weapons/v_minstanex.md3");
-                       precache_model("models/weapons/h_minstanex.iqm");
-                       precache_sound("weapons/minstanexfire.wav");
-                       precache_sound("weapons/nexwhoosh1.wav");
-                       precache_sound("weapons/nexwhoosh2.wav");
-                       precache_sound("weapons/nexwhoosh3.wav");
-                       //W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously?
-                       MINSTANEX_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
-                       return TRUE;
-               }
-               case WR_SETUP:
-               {
-                       self.current_ammo = AMMO_VAL(WEP_MINSTANEX);
-                       self.minstanex_lasthit = 0;
-                       return TRUE;
-               }
-               case WR_CHECKAMMO1:
-               {
-                       ammo_amount = self.AMMO_VAL(WEP_MINSTANEX) >= minstanex_ammo;
-                       ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= minstanex_ammo;
-                       return ammo_amount;
-               }
-               case WR_CHECKAMMO2:
-               {
-                       if(!WEP_CVAR_SEC(minstanex, ammo))
-                               return TRUE;
-                       ammo_amount = self.AMMO_VAL(WEP_MINSTANEX) >= WEP_CVAR_SEC(minstanex, ammo);
-                       ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= WEP_CVAR_SEC(minstanex, ammo);
-                       return ammo_amount;
-               }
-               case WR_CONFIG:
-               {
-                       MINSTANEX_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
-                       return TRUE;
-               }
-               case WR_RESETPLAYER:
-               {
-                       self.minstanex_lasthit = 0;
-                       return TRUE;
-               }
-               case WR_RELOAD:
-               {
-                       float used_ammo;
-                       if(WEP_CVAR_SEC(minstanex, ammo))
-                               used_ammo = min(minstanex_ammo, WEP_CVAR_SEC(minstanex, ammo));
-                       else
-                               used_ammo = minstanex_ammo;
-
-                       W_Reload(used_ammo, "weapons/reload.wav");
-                       return TRUE;
-               }
-               case WR_SUICIDEMESSAGE:
-               {
-                       return WEAPON_THINKING_WITH_PORTALS;
-               }
-               case WR_KILLMESSAGE:
-               {
-                       return WEAPON_MINSTANEX_MURDER;
-               }
-       }
-       return TRUE;
-}
-#endif
-#ifdef CSQC
-float w_minstanex(float req)
-{
-       switch(req)
-       {
-               case WR_IMPACTEFFECT:
-               {
-                       vector org2;
-                       org2 = w_org + w_backoff * 6;
-                       pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
-                       if(!w_issilent)
-                               sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
-                               
-                       return TRUE;
-               }
-               case WR_INIT:
-               {
-                       precache_sound("weapons/neximpact.wav");
-                       return TRUE;
-               }
-       }
-       return TRUE;
-}
-#endif
-#endif
diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc
new file mode 100644 (file)
index 0000000..f0fc11f
--- /dev/null
@@ -0,0 +1,272 @@
+#ifdef REGISTER_WEAPON
+REGISTER_WEAPON(
+/* WEP_##id */ VAPORIZER,
+/* function */ w_vaporizer,
+/* ammotype */ ammo_cells,
+/* impulse  */ 7,
+/* flags    */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
+/* rating   */ BOT_PICKUP_RATING_HIGH,
+/* model    */ "minstanex",
+/* netname  */ "minstanex",
+/* fullname */ _("Vaporizer")
+);
+
+#define VAPORIZER_SETTINGS(w_cvar,w_prop) VAPORIZER_SETTINGS_LIST(w_cvar, w_prop, VAPORIZER, vaporizer)
+#define VAPORIZER_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
+       w_cvar(id, sn, PRI, ammo) \
+       w_cvar(id, sn, PRI, animtime) \
+       w_cvar(id, sn, PRI, refire) \
+       w_cvar(id, sn, SEC, ammo) \
+       w_cvar(id, sn, SEC, animtime) \
+       w_cvar(id, sn, SEC, damage) \
+       w_cvar(id, sn, SEC, delay) \
+       w_cvar(id, sn, SEC, edgedamage) \
+       w_cvar(id, sn, SEC, force) \
+       w_cvar(id, sn, SEC, lifetime) \
+       w_cvar(id, sn, SEC, radius) \
+       w_cvar(id, sn, SEC, refire) \
+       w_cvar(id, sn, SEC, shotangle) \
+       w_cvar(id, sn, SEC, speed) \
+       w_cvar(id, sn, SEC, spread) \
+       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)
+
+#ifdef SVQC
+VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
+.float vaporizer_lasthit;
+.float jump_interval;
+#endif
+#else
+#ifdef SVQC
+void spawnfunc_weapon_vaporizer (void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
+
+void W_Vaporizer_Attack (void)
+{
+       float flying;
+       flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
+
+       W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000);
+
+       yoda = 0;
+       damage_goodhits = 0;
+       FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER);
+
+       if(yoda && flying)
+               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+       if(damage_goodhits && self.vaporizer_lasthit)
+       {
+               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+               damage_goodhits = 0; // only every second time
+       }
+
+       self.vaporizer_lasthit = damage_goodhits;
+
+       pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+
+       // teamcolor / hit beam effect
+       vector v;
+       v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+       switch(self.team)
+       {
+               case NUM_TEAM_1:   // Red
+                       if(damage_goodhits)
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, v);
+                       else
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, v);
+                       break;
+               case NUM_TEAM_2:   // Blue
+                       if(damage_goodhits)
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, v);
+                       else
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, v);
+                       break;
+               case NUM_TEAM_3:   // Yellow
+                       if(damage_goodhits)
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, v);
+                       else
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, v);
+                       break;
+               case NUM_TEAM_4:   // Pink
+                       if(damage_goodhits)
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, v);
+                       else
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), w_shotorg, v);
+                       break;
+               default:
+                       if(damage_goodhits)
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3_HIT"), w_shotorg, v);
+                       else
+                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
+                       break;
+       }
+       
+       W_DecreaseAmmo(((g_minstagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
+}
+
+float w_vaporizer(float req)
+{
+       float ammo_amount;
+       float vaporizer_ammo;
+
+       // now multiple WR_s use this
+       vaporizer_ammo = ((g_minstagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
+
+       switch(req)
+       {
+               case WR_AIM:
+               {
+                       if(self.AMMO_VAL(WEP_VAPORIZER) > 0)
+                               self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
+                       else
+                               self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), FALSE); // WEAPONTODO: replace with proper vaporizer cvars
+                               
+                       return TRUE;
+               }
+               case WR_THINK:
+               {
+                       // if the laser uses load, we also consider its ammo for reloading
+                       if(WEP_CVAR(vaporizer, reload_ammo) && WEP_CVAR_SEC(vaporizer, ammo) && self.clip_load < min(vaporizer_ammo, WEP_CVAR_SEC(vaporizer, ammo))) // forced reload
+                               WEP_ACTION(self.weapon, WR_RELOAD);
+                       else if(WEP_CVAR(vaporizer, reload_ammo) && self.clip_load < vaporizer_ammo) // forced reload
+                               WEP_ACTION(self.weapon, WR_RELOAD);
+                       else if (self.BUTTON_ATCK)
+                       {
+                               if (weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire)))
+                               {
+                                       W_Vaporizer_Attack();
+                                       weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready);
+                               }
+                       }
+                       else if (self.BUTTON_ATCK2)
+                       {
+                               if (self.jump_interval <= time)
+                               if (weapon_prepareattack(1, -1))
+                               {
+                                       // handle refire manually, so that primary and secondary can be fired without conflictions (important for minstagib)
+                                       self.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor();
+                                       
+                                       // decrease ammo for the laser?
+                                       if(WEP_CVAR_SEC(vaporizer, ammo))
+                                               W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo));
+
+                                       // ugly minstagib hack to reuse the fire mode of the laser
+                                       float w;
+                                       w = self.weapon;
+                                       self.weapon = WEP_BLASTER;
+                                       W_Blaster_Attack(
+                                               WEP_CVAR_SEC(vaporizer, shotangle),
+                                               WEP_CVAR_SEC(vaporizer, damage),
+                                               WEP_CVAR_SEC(vaporizer, edgedamage),
+                                               WEP_CVAR_SEC(vaporizer, radius),
+                                               WEP_CVAR_SEC(vaporizer, force),
+                                               WEP_CVAR_SEC(vaporizer, speed),
+                                               WEP_CVAR_SEC(vaporizer, spread),
+                                               WEP_CVAR_SEC(vaporizer, delay),
+                                               WEP_CVAR_SEC(vaporizer, lifetime)
+                                       );
+                                       self.weapon = w;
+                                       
+                                       // now do normal refire
+                                       weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);
+                               }
+                       }
+                       
+                       return TRUE;
+               }
+               case WR_INIT:
+               {
+                       precache_model("models/nexflash.md3");
+                       precache_model("models/weapons/g_minstanex.md3");
+                       precache_model("models/weapons/v_minstanex.md3");
+                       precache_model("models/weapons/h_minstanex.iqm");
+                       precache_sound("weapons/minstanexfire.wav");
+                       precache_sound("weapons/nexwhoosh1.wav");
+                       precache_sound("weapons/nexwhoosh2.wav");
+                       precache_sound("weapons/nexwhoosh3.wav");
+                       //W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously?
+                       VAPORIZER_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
+                       return TRUE;
+               }
+               case WR_SETUP:
+               {
+                       self.current_ammo = AMMO_VAL(WEP_VAPORIZER);
+                       self.vaporizer_lasthit = 0;
+                       return TRUE;
+               }
+               case WR_CHECKAMMO1:
+               {
+                       ammo_amount = self.AMMO_VAL(WEP_VAPORIZER) >= vaporizer_ammo;
+                       ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= vaporizer_ammo;
+                       return ammo_amount;
+               }
+               case WR_CHECKAMMO2:
+               {
+                       if(!WEP_CVAR_SEC(vaporizer, ammo))
+                               return TRUE;
+                       ammo_amount = self.AMMO_VAL(WEP_VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo);
+                       ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo);
+                       return ammo_amount;
+               }
+               case WR_CONFIG:
+               {
+                       VAPORIZER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
+                       return TRUE;
+               }
+               case WR_RESETPLAYER:
+               {
+                       self.vaporizer_lasthit = 0;
+                       return TRUE;
+               }
+               case WR_RELOAD:
+               {
+                       float used_ammo;
+                       if(WEP_CVAR_SEC(vaporizer, ammo))
+                               used_ammo = min(vaporizer_ammo, WEP_CVAR_SEC(vaporizer, ammo));
+                       else
+                               used_ammo = vaporizer_ammo;
+
+                       W_Reload(used_ammo, "weapons/reload.wav");
+                       return TRUE;
+               }
+               case WR_SUICIDEMESSAGE:
+               {
+                       return WEAPON_THINKING_WITH_PORTALS;
+               }
+               case WR_KILLMESSAGE:
+               {
+                       return WEAPON_VAPORIZER_MURDER;
+               }
+       }
+       return TRUE;
+}
+#endif
+#ifdef CSQC
+float w_vaporizer(float req)
+{
+       switch(req)
+       {
+               case WR_IMPACTEFFECT:
+               {
+                       vector org2;
+                       org2 = w_org + w_backoff * 6;
+                       pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
+                       if(!w_issilent)
+                               sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+                               
+                       return TRUE;
+               }
+               case WR_INIT:
+               {
+                       precache_sound("weapons/neximpact.wav");
+                       return TRUE;
+               }
+       }
+       return TRUE;
+}
+#endif
+#endif
index aee89ab..1f230db 100644 (file)
@@ -224,7 +224,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                }
 
                if(IS_PLAYER(frag_attacker))
-               if(DEATH_ISWEAPON(frag_deathtype, WEP_MINSTANEX))
+               if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
                if(frag_target.armorvalue)
                {
                        frag_target.armorvalue -= 1;
@@ -275,8 +275,8 @@ MUTATOR_HOOKFUNCTION(minstagib_SetStartItems)
 
        start_health = 100;
        start_armorvalue = 0;
-       start_weapons = WEPSET_MINSTANEX;
-       warmup_start_weapons = WEPSET_MINSTANEX;
+       start_weapons = WEPSET_VAPORIZER;
+       warmup_start_weapons = WEPSET_VAPORIZER;
        start_items |= IT_UNLIMITED_SUPERWEAPONS;
 
        return FALSE;
@@ -287,7 +287,7 @@ MUTATOR_HOOKFUNCTION(minstagib_FilterItem)
        if(self.classname == "item_cells")
                return TRUE; // no normal cells?
 
-       if(self.weapon == WEP_MINSTANEX && self.classname == "droppedweapon")
+       if(self.weapon == WEP_VAPORIZER && self.classname == "droppedweapon")
        {
                self.ammo_cells = autocvar_g_minstagib_ammo_drop;
                return FALSE;
index fcccac7..84911bb 100644 (file)
@@ -104,7 +104,7 @@ void nade_damage(entity inflictor, entity attacker, float damage, float deathtyp
        if(DEATH_ISWEAPON(deathtype, WEP_BLASTER))
                return;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_NEX) || DEATH_ISWEAPON(deathtype, WEP_MINSTANEX))
+       if(DEATH_ISWEAPON(deathtype, WEP_NEX) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
        {
                force *= 6;
                damage = self.max_health * 0.55;
index db00165..4a891e5 100644 (file)
@@ -1,7 +1,7 @@
 /*
 
 CORE    laser   nex     lg      rl      cry     gl      elec    hagar   fireb   hook
-                                                                       minsta  porto
+                                                                       vaporizer  porto
                                                                        tuba
 
 NEW             rifle   hlac    minel                           seeker
index 829c0ce..c333153 100644 (file)
@@ -6,7 +6,7 @@ float autocvar_g_vehicles_delayspawn_jitter;
 var float autocvar_g_vehicles_nex_damagerate = 0.5;
 var float autocvar_g_vehicles_uzi_damagerate = 0.5;
 var float autocvar_g_vehicles_rifle_damagerate = 0.75;
-var float autocvar_g_vehicles_minstanex_damagerate = 0.001;
+var float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
 var float autocvar_g_vehicles_tag_damagerate = 5;
 
 float autocvar_g_vehicles;
@@ -890,8 +890,8 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, float deat
     if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
         damage *= autocvar_g_vehicles_rifle_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_MINSTANEX))
-        damage *= autocvar_g_vehicles_minstanex_damagerate;
+    if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
+        damage *= autocvar_g_vehicles_vaporizer_damagerate;
 
     if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
         damage *= autocvar_g_vehicles_tag_damagerate;
index 961335d..cf6aa9c 100644 (file)
@@ -256,7 +256,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
        //explosion = spawn();
 
        // Find all non-hit players the beam passed close by
-       if(deathtype == WEP_MINSTANEX || deathtype == WEP_NEX)
+       if(deathtype == WEP_VAPORIZER || deathtype == WEP_NEX)
        {
                FOR_EACH_REALCLIENT(msg_entity)
                if(msg_entity != self)
index 5c9a55f..a6baa62 100644 (file)
@@ -15,7 +15,7 @@ Weapon support:
 - rocketlauncher: YES (except for trail bug)
 - porto: YES (bwahahahaha)
 - hlac: YES
-- minstanex: YES
+- vaporizer: YES
 - rifle: YES
 - fireball: YES (BFG effect cannot work through warpzones by design, so it's not available through warpzones)
 - hook: YES
index d28aa4c..0b76d4d 100644 (file)
@@ -21,6 +21,6 @@ set g_vehicles_delayspawn_jitter 10
 set g_vehicles_nex_damagerate 0.5
 set g_vehicles_uzi_damagerate 0.65
 set g_vehicles_rifle_damagerate 1
-set g_vehicles_minstanex_damagerate 0.007
+set g_vehicles_vaporizer_damagerate 0.007
 set g_vehicles_tag_damagerate 2