Merge branch 'master' into Mario/mute_bot_warnings
authorMario <mario.mario@y7mail.com>
Fri, 10 May 2013 04:56:09 +0000 (14:56 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 10 May 2013 04:56:09 +0000 (14:56 +1000)
38 files changed:
defaultXonotic.cfg
gfx/hud/default/weaponlaser.tga
gfx/hud/default/weaponminstanex.tga
gfx/hud/luminos/weaponlaser.tga
gfx/hud/luminos/weaponminstanex.tga
qcsrc/client/scoreboard.qc
qcsrc/common/deathtypes.qh
qcsrc/common/notifications.qh
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/menu/xonotic/dialog_settings_user.c
qcsrc/server/autocvars.qh
qcsrc/server/bot/aim.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/gamemode_lms.qh
qcsrc/server/mutators/mutator_minstagib.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_vampire.qc
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/t_items.qc
qcsrc/server/teamplay.qc
qcsrc/server/w_common.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/waypointsprites.qc
vehicles.cfg

index de83c9ae57901fc412fcbc804a1a5eae42de5be0..0a66a907846e277ca75aca6bccdbe8e2ef322375 100644 (file)
@@ -374,7 +374,7 @@ set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not
 set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
 set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
 set g_minstagib 0      "enable minstagib"
-set g_minstagib_extralives 2   "how many extra lives you will get per powerup"
+set g_minstagib_extralives 1   "how many extra lives you will get per powerup"
 set g_minstagib_ammo_start 10  "starting ammo"
 set g_minstagib_ammo_drop 5    "how much ammo you'll get for weapons or cells"
 set g_minstagib_invis_alpha 0.15
@@ -959,7 +959,7 @@ seta scoreboard_border_thickness 1 "scoreboard border thickness"
 seta scoreboard_accuracy_border_thickness 1 "accuracy stats border thickness"
 seta scoreboard_accuracy_doublerows 0 "use two rows instead of one"
 seta scoreboard_accuracy_nocolors 0 "don't use colors displaying accuracy stats"
-seta scoreboard_accuracy 1 "show weapon accuracy stats panel on scoreboard; colors can be configured with accuracy_color* cvars"
+seta scoreboard_accuracy 0 "show weapon accuracy stats panel on scoreboard; colors can be configured with accuracy_color* cvars"
 seta scoreboard_color_bg_r 0 "red color component of the scoreboard background"
 seta scoreboard_color_bg_g 0.4 "green color component of the scoreboard background"
 seta scoreboard_color_bg_b 0.6 "blue color component of the scoreboard background"
index 0afbb37d48124bb6f9b9a4f82998c45a1dcb43d4..f384a2c3000c27fbea425f23165e662c0f301bb5 100644 (file)
Binary files a/gfx/hud/default/weaponlaser.tga and b/gfx/hud/default/weaponlaser.tga differ
index 3618778729fc6918db40260e421f6cbf86ab842e..3bd2ae2d7aabe4270483aa1ac0c5016df50d6ccc 100644 (file)
Binary files a/gfx/hud/default/weaponminstanex.tga and b/gfx/hud/default/weaponminstanex.tga differ
index 0afbb37d48124bb6f9b9a4f82998c45a1dcb43d4..f384a2c3000c27fbea425f23165e662c0f301bb5 100644 (file)
Binary files a/gfx/hud/luminos/weaponlaser.tga and b/gfx/hud/luminos/weaponlaser.tga differ
index 3618778729fc6918db40260e421f6cbf86ab842e..3bd2ae2d7aabe4270483aa1ac0c5016df50d6ccc 100644 (file)
Binary files a/gfx/hud/luminos/weaponminstanex.tga and b/gfx/hud/luminos/weaponminstanex.tga differ
index 2ec7db0623025d7bc813afae95a299956a0fd63c..69d9a3c948e5b1bd851d21fbb7570d39c8f2d7cd 100644 (file)
@@ -947,7 +947,6 @@ float HUD_WouldDrawScoreboard() {
        return 0;
 }
 
-float g_minstagib;
 float average_accuracy;
 vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
 {
@@ -962,6 +961,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        float fontsize = height * 1/3;
        float weapon_height = height * 2/3;
        float weapon_width = sbwidth / weapon_cnt;
+       float g_minstagib = 0;
 
        drawstring(pos, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
        pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness;
index ca13f15a063e2fc674465312ebe1b600a1e88bd3..f9a9ceba25b1e0df2da7e77db433f5982e644b99 100644 (file)
@@ -69,7 +69,7 @@ entity deathtypes[DT_MAX];
                CHECK_MAX_COUNT(name, DT_MAX, DT_COUNT, "deathtypes") \
                \
                entity deathent = spawn(); \
-               deathtypes[(name - DT_FIRST) - 1] = deathent; \
+               deathtypes[(name - DT_FIRST)] = deathent; \
                deathent.classname = "deathtype"; \
                deathent.nent_name = #name; \
                #if (msg_death != NO_MSG) \
@@ -96,7 +96,7 @@ string Deathtype_Name(float deathtype)
 {
        if(DEATH_ISSPECIAL(deathtype))
        {
-               entity deathent = deathtypes[(deathtype - DT_FIRST) - 1];
+               entity deathent = deathtypes[(deathtype - DT_FIRST)];
                if not(deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; }
                return deathent.nent_name;
        }
index d1aeba001e5e2f6a4c36c5d03a8c1f2f8117febd..42f1b9b162fb2bc665ad6775ecbdbe767158573a 100644 (file)
@@ -529,6 +529,8 @@ void Send_Notification_WOVA(
        MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK,               0, 0, "",              CPID_LMS_CAMP,         "0 0", _("^F2Don't camp!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO,             0, 0, "",              CPID_MINSTA_FINDAMMO,  "1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST,       0, 0, "",              CPID_MINSTA_FINDAMMO,  "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!")) \
+       MSG_CENTER_NOTIF(1, CENTER_MINSTA_LIVES_REMAINING,      0, 1, "f1",            NO_CPID,                           "0 0", _("^F2Extra lives remaining: ^K1%s"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_MINSTA_SECONDARY,            0, 0, "",              NO_CPID,                           "0 0", _("^BGSecondary fire inflicts no damage!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_MOTD,                        1, 0, "s1",            CPID_MOTD,             "-1 0", _("^BG%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN,               0, 2, "item_wepname",  CPID_NIX,              "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON,               0, 1, "item_wepname",  CPID_NIX,              "0 0", _("^F2Active weapon: ^F1%s"), "") \
index 40fb4cca5e8786ef45a64e6a3cbe6b80c723598c..d0a8f6bc76a199ca49e1091fd1a4351b0f38f2e2 100644 (file)
@@ -172,6 +172,7 @@ void XonoticMutatorsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "g_vampire", _("Vampire")));
+                       setDependent(e, "g_minstagib", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticSlider(10, 50, 1, "g_bloodloss");
@@ -201,6 +202,7 @@ void XonoticMutatorsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "g_invincible_projectiles", _("Invincible Projectiles")));
+                       setDependent(e, "g_minstagib", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "g_new_toys", _("New Toys")));
@@ -208,6 +210,7 @@ void XonoticMutatorsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "g_rocket_flying", _("Rocket Flying")));
+                       setDependent(e, "g_minstagib", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "g_pinata", _("PiƱata")));
index 9a1710a9f5bbe8635bcf665281dcd9cdafc621d8..a3b89744b9fbc30b6ef44cb3489c386e6ce9c460 100644 (file)
@@ -61,17 +61,17 @@ void XonoticUserSettingsTab_fill(entity me)
                        e.onClick = SetLanguage_Click;
                        e.onClickEntity = sk;*/
                        
-       me.gotoRC(me, 0, 3.1); me.setFirstColumn(me, me.currentColumn);
+       me.gotoRC(me, 0, 2.85); me.setFirstColumn(me, me.currentColumn);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Text language:")));
        me.TR(me);
-               me.TD(me, 6, 1, sk = makeXonoticLanguageList());
+               me.TD(me, 6, 1.5, sk = makeXonoticLanguageList());
        me.TR(me);
        me.TR(me);
        me.TR(me);
        me.TR(me);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticButton(_("Set language"), '0 0 0'));
+               me.TD(me, 1, 1.5, e = makeXonoticButton(_("Set language"), '0 0 0'));
                        e.onClick = SetLanguage_Click;
                        e.onClickEntity = sk;
                
index efb9f8c17a240cfdd5869f6a074a7cb15fd2383b..0cc8c8697a9a963b9223e3c540bae084a049d378 100644 (file)
@@ -898,6 +898,7 @@ float autocvar_g_midair_shieldtime;
 float autocvar_g_minstagib_ammo_drop;
 float autocvar_g_minstagib_extralives;
 float autocvar_g_minstagib_speed_highspeed;
+float autocvar_g_minstagib_invis_alpha;
 #define autocvar_g_mirrordamage cvar("g_mirrordamage")
 #define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
 
index cb42aa5c2c4b0b158697b4122a51c27e88543d7d..c85ebd81ca52d52a1960ba0b3986a1f3f4916e64 100644 (file)
@@ -135,11 +135,13 @@ float bot_shouldattack(entity e)
                return FALSE;
        if (e.BUTTON_CHAT)
                return FALSE;
-       if(g_minstagib)
-       if(e.items & IT_STRENGTH)
-               return FALSE;
        if(e.flags & FL_NOTARGET)
                return FALSE;
+               
+       checkentity = e;
+       if(MUTATOR_CALLHOOK(BotShouldAttack))
+               return FALSE;
+               
        return TRUE;
 }
 
index 3d89301844c248c20f59dd3003e2f3dd434a337e..ea3cdfb191eed5e11f5254e491dc37d02eeb3312 100644 (file)
@@ -385,15 +385,7 @@ void PutObserverInServer (void)
                WriteEntity(MSG_ONE, self);
        }
 
-       if(g_lms)
-       {
-               // Only if the player cannot play at all
-               if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
-                       self.frags = FRAGS_SPECTATOR;
-               else
-                       self.frags = FRAGS_LMS_LOSER;
-       }
-       else if((g_race && g_race_qualifying) || g_cts)
+       if((g_race && g_race_qualifying) || g_cts)
        {
                if(PlayerScore_Add(self, SP_RACE_FASTEST, 0))
                        self.frags = FRAGS_LMS_LOSER;
@@ -405,8 +397,6 @@ void PutObserverInServer (void)
 
        MUTATOR_CALLHOOK(MakePlayerObserver);
 
-       minstagib_stop_countdown(self);
-
        Portal_ClearAll(self);
        
        if(self.alivetime)
@@ -610,14 +600,6 @@ void PutClientInServer (void)
        // reset player keys
        self.itemkeys = 0;
 
-       // player is dead and becomes observer
-       // FIXME fix LMS scoring for new system
-       if(g_lms)
-       {
-               if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
-                       self.classname = "observer";
-       }
-
        MUTATOR_CALLHOOK(PutClientInServer);
 
        if(gameover)
@@ -662,10 +644,7 @@ void PutClientInServer (void)
                if(autocvar__notarget)
                        self.flags |= FL_NOTARGET;
                self.takedamage = DAMAGE_AIM;
-               if(g_minstagib)
-                       self.effects = EF_FULLBRIGHT;
-               else
-                       self.effects = 0;
+               self.effects = 0;
                self.effects |= EF_TELEPORT_BIT | EF_RESTARTANIM_BIT;
                self.air_finished = time + 12;
                self.dmg = 2;
@@ -800,8 +779,6 @@ void PutClientInServer (void)
                self.colormod = '1 1 1' * autocvar_g_player_brightness;
                self.exteriorweaponentity.alpha = default_weapon_alpha;
 
-               self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
-               self.lms_traveled_distance = 0;
                self.speedrunning = FALSE;
 
                race_PostSpawn(spot);
@@ -1687,55 +1664,7 @@ void player_powerups (void)
        Fire_ApplyDamage(self);
        Fire_ApplyEffect(self);
 
-       if (g_minstagib)
-       {
-               self.effects |= EF_FULLBRIGHT;
-
-               if (self.items & IT_STRENGTH)
-               {
-                       play_countdown(self.strength_finished, "misc/poweroff.wav");
-                       if (time > self.strength_finished)
-                       {
-                               self.alpha = default_player_alpha;
-                               self.exteriorweaponentity.alpha = default_weapon_alpha;
-                               self.items &~= IT_STRENGTH;
-                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_INVISIBILITY, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
-                       }
-               }
-               else
-               {
-                       if (time < self.strength_finished)
-                       {
-                               self.alpha = g_minstagib_invis_alpha;
-                               self.exteriorweaponentity.alpha = g_minstagib_invis_alpha;
-                               self.items |= IT_STRENGTH;
-                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_INVISIBILITY, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);
-                       }
-               }
-
-               if (self.items & IT_INVINCIBLE)
-               {
-                       play_countdown(self.invincible_finished, "misc/poweroff.wav");
-                       if (time > self.invincible_finished)
-                       {
-                               self.items = self.items - (self.items & IT_INVINCIBLE);
-                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_SPEED, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
-                       }
-               }
-               else
-               {
-                       if (time < self.invincible_finished)
-                       {
-                               self.items = self.items | IT_INVINCIBLE;
-                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SPEED);
-                       }
-               }
-       }
-       else // if we're not in minstagib, continue. I added this else to replace the "return" which was here that broke the callhook for this function -- This code is nasty.
+       if not(g_minstagib)
        {
                if (self.items & IT_STRENGTH)
                {
@@ -2600,9 +2529,6 @@ void PlayerPreThink (void)
                        player_powerups();
                }
 
-               if (g_minstagib)
-                       minstagib_ammocheck();
-
                if (self.deadflag != DEAD_NO)
                {
                        if(self.personal && g_race_qualifying)
index d09c0704fe56dbc2536a52a74df8a93381318560..3288bbc72a9af3b52cfcc56c64e44ddd8df4b4cd 100644 (file)
@@ -98,8 +98,7 @@ void ImpulseCommands (void)
                                        W_PreviousWeapon (2);
                                        break;
                                case 17:
-                                       if (!g_minstagib)
-                                               W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, FALSE), '0 0 0', TRUE);
+                                       W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, FALSE), '0 0 0', TRUE);
                                        break;
                                case 18:
                                        W_NextWeapon (1);
index a318b8e3a4ad10c950a1adacc807a5da8b15e241..4a873e2d0eb70bc6310703903b0bcc04f28fad43 100644 (file)
@@ -698,8 +698,6 @@ void SV_PlayerPhysics()
        WarpZone_PlayerPhysics_FixVAngle();
        
        maxspd_mod = 1;
-       if(g_minstagib && (self.items & IT_INVINCIBLE))
-               maxspd_mod *= autocvar_g_minstagib_speed_highspeed;
        if(self.ballcarried)
                if(g_nexball)
                        maxspd_mod *= autocvar_g_nexball_basketball_carrier_highspeed;
index 95aeced31b308b5db10fa4ab9da332baab5151aa..89627481ac2af9e6f9dba9066c20800a6d851477 100644 (file)
@@ -262,10 +262,6 @@ void player_anim (void)
 
 void SpawnThrownWeapon (vector org, float w)
 {
-       if(g_minstagib)
-       if(self.ammo_cells <= 0)
-               return;
-
        if(g_pinata)
        {
                float j;
@@ -387,17 +383,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        else
                Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
 
-       if (!g_minstagib)
-       {
-               v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
-               take = v_x;
-               save = v_y;
-       }
-       else
-       {
-               save = 0;
-               take = damage;
-       }
+
+       v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
+       take = v_x;
+       save = v_y;
 
        if(attacker == self)
        {
@@ -664,7 +653,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                else
                        self.respawn_countdown = -1; // do not count down
 
-               if(g_lms || g_cts || autocvar_g_forced_respawn)
+               if(g_cts || autocvar_g_forced_respawn)
                        self.respawn_flags = self.respawn_flags | RESPAWN_FORCE;
 
                self.death_time = time;
index afabe1820284522acf4d4dc0211d610d277de559..e961e29415ff16f26a0c53c9b915a2a99a58f930 100644 (file)
@@ -117,10 +117,9 @@ vector w_shotend;
 .float prevstrengthsoundattempt;
 void W_PlayStrengthSound(entity player) // void W_PlayStrengthSound
 {
-               if((!g_minstagib)
-                       && (player.items & IT_STRENGTH)
-                       && ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
-                       || (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
+       if((player.items & IT_STRENGTH)
+               && ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
+               || (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
                {
                        sound(player, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
                        player.prevstrengthsound = time;
index 3e564e39ae93f055226d64ad8e3caf5b40e13fe0..e34464f16cbc84a102bfc9de9367ec8fb1a5c967 100644 (file)
@@ -332,9 +332,6 @@ void reset_map(float dorespawn)
                race_ReadyRestart();
        else MUTATOR_CALLHOOK(reset_map_global);
 
-       lms_lowest_lives = 999;
-       lms_next_place = player_count;
-
        for(self = world; (self = nextent(self)); )
        if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
        {
@@ -379,8 +376,6 @@ void reset_map(float dorespawn)
                        //NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
                        if (IS_PLAYER(self)) {
                                //PlayerScore_Clear(self);
-                               if(g_lms)
-                                       PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
                                self.killcount = 0;
                                //stop the player from moving so that he stands still once he gets respawned
                                self.velocity = '0 0 0';
index fb93b7c7876b3d133d4f5b30b2daa872b56e4aa8..7d3585725d2544ecd4dab000d907c51cbab6354e 100644 (file)
@@ -16,7 +16,7 @@ noref float require_spawnfunc_prefix; // if this float exists, only functions wi
 
 // Globals
 
-float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_pinata, g_norecoil, g_minstagib_invis_alpha, g_bloodloss;
+float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_pinata, g_norecoil, g_bloodloss;
 float g_warmup_limit;
 float g_warmup_allguns;
 float g_warmup_allow_timeout;
@@ -243,9 +243,6 @@ float nJoinAllowed(entity ignore);
 
 .float spawnshieldtime;
 
-.float lms_nextcheck;
-.float lms_traveled_distance;
-
 .entity flagcarried;
 
 .float playerid;
index 6687f18ebc24064cf023faaa1c9a6b766cdb9396..8425308ac7fe32af1c0f6604cb8617569be1030a 100644 (file)
@@ -240,7 +240,7 @@ void Obituary_SpecialDeath(
 {
        if(DEATH_ISSPECIAL(deathtype))
        {
-               entity deathent = deathtypes[(deathtype - DT_FIRST) - 1];
+               entity deathent = deathtypes[(deathtype - DT_FIRST)];
                if not(deathent) { backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n"); return; }
 
                if(murder)
@@ -638,12 +638,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                        if(complainteamdamage > 0 && !g_ca) // FIXME why is g_ca ruled out here? Why not just g_mirrordamage 0 on CA servers?
                                                                mirrordamage = autocvar_g_mirrordamage * complainteamdamage;
                                                        mirrorforce = autocvar_g_mirrordamage * vlen(force);
-                                                       if(g_minstagib)
-                                                       {
-                                                               if(autocvar_g_friendlyfire == 0)
-                                                                       damage = 0;
-                                                       }
-                                                       else if(g_ca)
+                                                       if(g_ca)
                                                                damage = 0;
                                                        else
                                                                damage = autocvar_g_friendlyfire * damage;
@@ -677,44 +672,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        }
                }
 
-               if(targ.classname == "player")
-               if (g_minstagib)
-               {
-                       if ((deathtype == DEATH_FALL)  ||
-                               (deathtype == DEATH_DROWN) ||
-                               (deathtype == DEATH_SLIME) ||
-                               (deathtype == DEATH_LAVA)  ||
-                               (!DEATH_ISWEAPON(deathtype, WEP_LASER) && damage > 0 && damage < 100))
-                       {
-                               self = oldself;
-                               return;
-                       }
-                       if(damage > 0)
-                           damage = 10000;
-                       if (targ.armorvalue && (deathtype == WEP_MINSTANEX) && damage)
-                       {
-                               targ.armorvalue -= 1;
-                               centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.armorvalue)));
-                               damage = 0;
-                               targ.hitsound += 1;
-                               attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit
-                       }
-                       if (DEATH_ISWEAPON(deathtype, WEP_LASER))
-                       {
-                               damage = 0;
-                               mirrordamage = 0;
-                               complainteamdamage = 0;
-                               if (targ != attacker)
-                               {
-                                       if ((targ.health >= 1) && (targ.classname == "player"))
-                                               centerprint(attacker, "Secondary fire inflicts no damage!");
-                                       force = '0 0 0';
-                                       // keep mirrorforce
-                                       attacker = targ;
-                               }
-                       }
-               }
-
                if not(DEATH_ISSPECIAL(deathtype))
                {
                        damage *= g_weapondamagefactor;
@@ -730,28 +687,33 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                frag_damage = damage;
                frag_force = force;
         frag_deathtype = deathtype;
+               frag_mirrordamage = mirrordamage;
                MUTATOR_CALLHOOK(PlayerDamage_Calculate);
                damage = frag_damage;
+               mirrordamage = frag_mirrordamage;
                force = frag_force;
                
-               // apply strength multiplier
-               if ((attacker.items & IT_STRENGTH) && !g_minstagib)
+               if not(g_minstagib)
                {
-                       if(targ == attacker)
+                       // apply strength multiplier
+                       if (attacker.items & IT_STRENGTH)
                        {
-                               damage = damage * autocvar_g_balance_powerup_strength_selfdamage;
-                               force = force * autocvar_g_balance_powerup_strength_selfforce;
-                       }
-                       else
-                       {
-                               damage = damage * autocvar_g_balance_powerup_strength_damage;
-                               force = force * autocvar_g_balance_powerup_strength_force;
+                               if(targ == attacker)
+                               {
+                                       damage = damage * autocvar_g_balance_powerup_strength_selfdamage;
+                                       force = force * autocvar_g_balance_powerup_strength_selfforce;
+                               }
+                               else
+                               {
+                                       damage = damage * autocvar_g_balance_powerup_strength_damage;
+                                       force = force * autocvar_g_balance_powerup_strength_force;
+                               }
                        }
-               }
 
-               // apply invincibility multiplier
-               if (targ.items & IT_INVINCIBLE && !g_minstagib)
-                       damage = damage * autocvar_g_balance_powerup_invincible_takedamage;
+                       // apply invincibility multiplier
+                       if (targ.items & IT_INVINCIBLE)
+                               damage = damage * autocvar_g_balance_powerup_invincible_takedamage;
+               }
 
                if (targ == attacker)
                {
@@ -793,13 +755,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                if not(DEATH_ISSPECIAL(deathtype))
                                                {
                                                        if(targ.classname == "player") // don't do this for vehicles
-                                                       if(!g_minstagib)
                                                        if(IsFlying(victim))
                                                                yoda = 1;
-
-                                                       if(g_minstagib)
-                                                       if(victim.items & IT_STRENGTH)
-                                                               yoda = 1;
                                                }
                                        }
                                }
@@ -856,18 +813,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        if(mirrordamage > 0 || mirrorforce > 0)
        {
                attacker = attacker_save;
-               if(g_minstagib)
-               if(mirrordamage > 0)
-               {
-                       // just lose extra LIVES, don't kill the player for mirror damage
-                       if(attacker.armorvalue > 0)
-                       {
-                               attacker.armorvalue = attacker.armorvalue - 1;
-                               centerprint(attacker, strcat("^3Remaining extra lives: ",ftos(attacker.armorvalue)));
-                               attacker.hitsound += 1;
-                       }
-                       mirrordamage = 0;
-               }
 
                force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
                Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);
index 1af52b13209eea54f3d915f1a1992a1c0b12cc6f..651174cb6237991e15d47b67f623d4619dd5e793 100644 (file)
@@ -428,12 +428,9 @@ void cvar_changes_init()
                BADCVAR("g_minstagib");
                BADCVAR("g_new_toys");
                BADCVAR("g_nix");
-
-               if(autocvar_g_minstagib)
-               {
-                       BADCVAR("g_grappling_hook");
-                       BADCVAR("g_jetpack");
-               }
+               BADCVAR("g_grappling_hook");
+               BADCVAR("g_jetpack");
+               
 #undef BADPREFIX
 #undef BADCVAR
 
@@ -713,10 +710,6 @@ void spawnfunc_worldspawn (void)
                if(autocvar_g_midair)
                        s = strcat(s, ":midair");
 
-               // TODO to mutator system
-               if(autocvar_g_minstagib)
-                       s = strcat(s, ":minstagib");
-
                // TODO to mutator system
                if(autocvar_g_powerups == 0)
                        s = strcat(s, ":no_powerups");
@@ -925,9 +918,6 @@ void spawnfunc_worldspawn (void)
                modname = cvar_string("g_mod_balance");
        if(cvar_string("g_mod_config") != cvar_defstring("g_mod_config"))
                modname = cvar_string("g_mod_config");
-       // weird mutators that deserve to count as mod
-       if(autocvar_g_minstagib)
-               modname = "MinstaGib";
        // extra mutators that deserve to count as mod
        MUTATOR_CALLHOOK(SetModname);
 
@@ -1544,7 +1534,6 @@ void FixIntermissionClient(entity e)
        }
 }
 
-void minstagib_stop_countdown(entity e);
 /*
 go to the next level for deathmatch
 only called if a time or frag limit has expired
@@ -1590,7 +1579,6 @@ void NextLevel()
        GameLogClose();
 
        FOR_EACH_PLAYER(other) {
-               minstagib_stop_countdown(other);
                FixIntermissionClient(other);
                if(other.winning)
                        bprint(other.netname, " ^7wins.\n");
index 13eb647dbdeb36d83aeebb371d88a44e4bcef1f4..0838d7c671e2c9f71e82786421efd7f7d46131d7 100644 (file)
@@ -824,26 +824,10 @@ void readplayerstartcvars()
 
        if (g_weaponarena)
        {
-               g_minstagib = 0; // incompatible
                g_pinata = 0; // incompatible
                g_weapon_stay = 0; // incompatible
                WEPSET_COPY_AA(start_weapons, g_weaponarena_weapons);
-               if(!g_ca)
-                       start_items |= IT_UNLIMITED_AMMO;
-       }
-       else if (g_minstagib)
-       {
-               g_pinata = 0; // incompatible
-               g_weapon_stay = 0; // incompatible
-               g_bloodloss = 0; // incompatible
-               start_health = 100;
-               start_armorvalue = 0;
-               WEPSET_COPY_AW(start_weapons, WEP_MINSTANEX);
-               g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
-               start_items |= IT_UNLIMITED_SUPERWEAPONS;
-
-               if (g_minstagib_invis_alpha <= 0)
-                       g_minstagib_invis_alpha = -1;
+               start_items |= IT_UNLIMITED_AMMO;
        }
        else
        {
@@ -866,12 +850,7 @@ void readplayerstartcvars()
        if(cvar("g_nexball"))
                start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
 
-       if(g_minstagib)
-       {
-               start_ammo_cells = cvar("g_minstagib_ammo_start");
-               start_ammo_fuel = cvar("g_start_ammo_fuel");
-       }
-       else if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+       if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
                start_ammo_rockets = 999;
                start_ammo_shells = 999;
@@ -881,28 +860,11 @@ void readplayerstartcvars()
        }
        else
        {
-               if(g_ca)
-               {
-                       start_ammo_shells = cvar("g_lms_start_ammo_shells");
-                       start_ammo_nails = cvar("g_lms_start_ammo_nails");
-                       start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
-                       start_ammo_cells = cvar("g_lms_start_ammo_cells");
-                       start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
-               }
-               else
-               {
-                       start_ammo_shells = cvar("g_start_ammo_shells");
-                       start_ammo_nails = cvar("g_start_ammo_nails");
-                       start_ammo_rockets = cvar("g_start_ammo_rockets");
-                       start_ammo_cells = cvar("g_start_ammo_cells");
-                       start_ammo_fuel = cvar("g_start_ammo_fuel");
-               }
-       }
-
-       if (g_ca)
-       {
-               start_health = cvar("g_lms_start_health");
-               start_armorvalue = cvar("g_lms_start_armor");
+               start_ammo_shells = cvar("g_start_ammo_shells");
+               start_ammo_nails = cvar("g_start_ammo_nails");
+               start_ammo_rockets = cvar("g_start_ammo_rockets");
+               start_ammo_cells = cvar("g_start_ammo_cells");
+               start_ammo_fuel = cvar("g_start_ammo_fuel");
        }
 
        if (inWarmupStage)
@@ -918,7 +880,7 @@ void readplayerstartcvars()
                WEPSET_COPY_AA(warmup_start_weapons_default, start_weapons_default);
                WEPSET_COPY_AA(warmup_start_weapons_defaultmask, start_weapons_defaultmask);
 
-               if (!g_weaponarena && !g_minstagib && !g_ca)
+               if (!g_weaponarena && !g_ca)
                {
                        warmup_start_ammo_shells = cvar("g_warmup_start_ammo_shells");
                        warmup_start_ammo_cells = cvar("g_warmup_start_ammo_cells");
@@ -999,37 +961,25 @@ float sv_taunt;
 string GetGametype(); // g_world.qc
 void readlevelcvars(void)
 {
-       g_minstagib = cvar("g_minstagib");
-
-       // load ALL the mutators
-       if(cvar("g_dodging"))
-               MUTATOR_ADD(mutator_dodging);
-       if(cvar("g_spawn_near_teammate"))
-               MUTATOR_ADD(mutator_spawn_near_teammate);
-       if(cvar("g_physical_items"))
-               MUTATOR_ADD(mutator_physical_items);
-       if(cvar("g_touchexplode"))
-               MUTATOR_ADD(mutator_touchexplode);
-       if(!g_minstagib)
-       {
-               if(cvar("g_invincible_projectiles"))
-                       MUTATOR_ADD(mutator_invincibleprojectiles);
-               if(cvar("g_new_toys"))
-                       MUTATOR_ADD(mutator_new_toys);
-               if(cvar("g_nix"))
-                       MUTATOR_ADD(mutator_nix);
-               if(cvar("g_rocket_flying"))
-                       MUTATOR_ADD(mutator_rocketflying);
-               if(cvar("g_vampire"))
-                       MUTATOR_ADD(mutator_vampire);           
-               if(cvar("g_superspectate"))
-                       MUTATOR_ADD(mutator_superspec);
-       }
-
-       // is this a mutator? is this a mode?
-       if(cvar("g_sandbox"))
-               MUTATOR_ADD(sandbox);
-
+       // load mutators
+       #define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \
+               { if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
+               
+       CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
+       CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, 1);
+       CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
+       CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1);
+       CHECK_MUTATOR_ADD("g_minstagib", mutator_minstagib, 1);
+       CHECK_MUTATOR_ADD("g_invincible_projectiles", mutator_invincibleprojectiles, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_new_toys", mutator_new_toys, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_nix", mutator_nix, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_rocket_flying", mutator_rocketflying, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_vampire", mutator_vampire, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_superspectate", mutator_superspec, 1);
+       CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
+       
+       #undef CHECK_MUTATOR_ADD
+       
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
 
@@ -1048,6 +998,8 @@ void readlevelcvars(void)
     g_bugrigs_speed_ref = cvar("g_bugrigs_speed_ref");
     g_bugrigs_speed_pow = cvar("g_bugrigs_speed_pow");
     g_bugrigs_steer = cvar("g_bugrigs_steer");
+       
+       g_minstagib = cvar("g_minstagib");
 
        sv_clones = cvar("sv_clones");
        sv_foginterval = cvar("sv_foginterval");
@@ -1071,7 +1023,7 @@ void readlevelcvars(void)
        g_warmup_allguns = cvar("g_warmup_allguns");
        g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
 
-       if ((g_race && g_race_qualifying == 2) || g_arena || g_assault || cvar("g_campaign"))
+       if ((g_race && g_race_qualifying == 2) || g_arena || g_minstagib || g_assault || cvar("g_campaign"))
                inWarmupStage = 0; // these modes cannot work together, sorry
 
        g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
index 311d156304c9dbd0c99835d8ab928515e8ddc6aa..b2f9b29fda64b36d1df56e15536b2b3ad45168d2 100644 (file)
@@ -109,6 +109,11 @@ MUTATOR_HOOKABLE(BuildMutatorsPrettyString);
        // appends ", Mutator name" to ret_string for display
        // INPUT, OUTPUT:
                string ret_string;
+               
+MUTATOR_HOOKABLE(CustomizeWaypoint);
+       // called every frame
+       // customizes the waypoint for spectators
+       // INPUT: self = waypoint, other = player, other.enemy = spectator
 
 MUTATOR_HOOKABLE(FilterItem);
        // checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
@@ -163,6 +168,7 @@ MUTATOR_HOOKABLE(PlayerDamage_Calculate);
                float frag_deathtype;
        // INPUT, OUTPUT:
                float frag_damage;
+               float frag_mirrordamage;
                vector frag_force;
 
 MUTATOR_HOOKABLE(PlayerPowerups);
@@ -233,6 +239,17 @@ MUTATOR_HOOKABLE(SetWeaponreplace);
                entity other; // weapon info
        // IN+OUT
                string ret_string;
+               
+MUTATOR_HOOKABLE(Item_RespawnCountdown);
+       // called when an item is about to respawn
+       // INPUT+OUTPUT:
+       string item_name;
+       vector item_color;
+               
+MUTATOR_HOOKABLE(BotShouldAttack);
+       // called when a bot checks a target to attack
+       // INPUT
+       entity checkentity;
 
 MUTATOR_HOOKABLE(PortalTeleport);
        // called whenever a player goes through a portal gun teleport
index 11330fbd7d6b370f851aa8425bd11d0dfab4322d..22bfc981c34c6cff8013f384f73641c698343f90 100644 (file)
@@ -222,6 +222,22 @@ MUTATOR_HOOKFUNCTION(ca_GiveFragsForKill)
        return 1;
 }
 
+MUTATOR_HOOKFUNCTION(ca_SetStartItems)
+{
+       start_health = cvar("g_lms_start_health");
+       start_armorvalue = cvar("g_lms_start_armor");
+       
+       start_ammo_shells = cvar("g_lms_start_ammo_shells");
+       start_ammo_nails = cvar("g_lms_start_ammo_nails");
+       start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
+       start_ammo_cells = cvar("g_lms_start_ammo_cells");
+       start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
+       
+       start_items &~= IT_UNLIMITED_AMMO;
+
+       return 0;
+}
+
 void ca_Initialize()
 {
        allowed_to_spawn = TRUE;
@@ -248,6 +264,7 @@ MUTATOR_DEFINITION(gamemode_ca)
        MUTATOR_HOOK(ForbidPlayerScore_Clear, ca_ForbidPlayerScore_Clear, CBC_ORDER_ANY);
        MUTATOR_HOOK(ForbidThrowCurrentWeapon, ca_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
        MUTATOR_HOOK(GiveFragsForKill, ca_GiveFragsForKill, CBC_ORDER_FIRST);
+       MUTATOR_HOOK(SetStartItems, ca_SetStartItems, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {
index 681a1d433a1f62dbc0cfe4b60b7d05b71850b704..82258ac77c115e33d144c7dc280526c0c3aa729c 100644 (file)
@@ -18,15 +18,49 @@ float LMS_NewPlayerLives()
 }
 
 // mutator hooks
-MUTATOR_HOOKFUNCTION(lms_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(lms_ResetMap)
+{
+       lms_lowest_lives = 999;
+       lms_next_place = player_count;
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(lms_ResetPlayers)
 {
-       if(IS_PLAYER(self))
        if(restart_mapalreadyrestarted || (time < game_starttime))
+       FOR_EACH_CLIENT(self)
+       if(IS_PLAYER(self))
                PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(lms_PlayerPreSpawn)
+{
+       // player is dead and becomes observer
+       // FIXME fix LMS scoring for new system
+       if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
+               self.classname = "observer";
+
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(lms_PlayerSpawn)
+{
+       self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
+       self.lms_traveled_distance = 0;
                
        return FALSE;
 }
 
+MUTATOR_HOOKFUNCTION(lms_PlayerDies)
+{
+       self.respawn_flags |= RESPAWN_FORCE;
+       
+       return FALSE;
+}
+
 MUTATOR_HOOKFUNCTION(lms_RemovePlayer)
 {
        // Only if the player cannot play at all
@@ -181,18 +215,6 @@ MUTATOR_HOOKFUNCTION(lms_ItemTouch)
        return FALSE;
 }
 
-MUTATOR_HOOKFUNCTION(lms_BotSpawn)
-{
-       // temporary hack to give bots lives
-       if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
-       {
-               PlayerScore_Add(self, SP_LMS_RANK, 666);
-               self.frags = FRAGS_SPECTATOR;
-       }
-       
-       return FALSE;
-}
-
 // scoreboard stuff
 void lms_ScoreRules()
 {
@@ -212,7 +234,11 @@ void lms_Initialize()
 
 MUTATOR_DEFINITION(gamemode_lms)
 {
+       MUTATOR_HOOK(reset_map_global, lms_ResetMap, CBC_ORDER_ANY);
+       MUTATOR_HOOK(reset_map_players, lms_ResetPlayers, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PutClientInServer, lms_PlayerPreSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerSpawn, lms_PlayerSpawn, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerDies, lms_PlayerDies, CBC_ORDER_ANY);
        MUTATOR_HOOK(MakePlayerObserver, lms_RemovePlayer, CBC_ORDER_ANY);
        MUTATOR_HOOK(ClientConnect, lms_ClientConnect, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPreThink, lms_PlayerThink, CBC_ORDER_ANY);
@@ -223,7 +249,6 @@ MUTATOR_DEFINITION(gamemode_lms)
        MUTATOR_HOOK(ForbidPlayerScore_Clear, lms_KeepScore, CBC_ORDER_ANY);
        MUTATOR_HOOK(FilterItem, lms_FilterItem, CBC_ORDER_ANY);
        MUTATOR_HOOK(ItemTouch, lms_ItemTouch, CBC_ORDER_ANY);
-       MUTATOR_HOOK(HavocBot_ChooseRule, lms_BotSpawn, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {
index 16fda61550823e6a098e27a2f47e1cfe2506550d..508bf8c6cd12b98af08be540322c31a346adea79 100644 (file)
@@ -5,4 +5,8 @@
 // lives related defs
 float lms_lowest_lives;
 float lms_next_place;
-float LMS_NewPlayerLives();
\ No newline at end of file
+float LMS_NewPlayerLives();
+
+// camp check
+.float lms_nextcheck;
+.float lms_traveled_distance;
\ No newline at end of file
diff --git a/qcsrc/server/mutators/mutator_minstagib.qc b/qcsrc/server/mutators/mutator_minstagib.qc
new file mode 100644 (file)
index 0000000..05354a2
--- /dev/null
@@ -0,0 +1,421 @@
+void spawnfunc_item_minst_cells (void) 
+{
+       if not(g_minstagib) { remove(self); return; }
+       if not(self.ammo_cells)
+               self.ammo_cells = autocvar_g_minstagib_ammo_drop;
+               
+       StartItem ("models/items/a_cells.md3",
+                          "misc/itempickup.wav", 45, 0,
+                          "MinstaNex Ammo", IT_CELLS, 0, 0, generic_pickupevalfunc, 100);
+}
+
+void minstagib_health_mega()
+{
+       self.max_health = 1;
+       StartItem ("models/items/g_h100.md3",
+                          "misc/megahealth.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
+                          "Extralife", IT_NAILS, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
+}
+
+.float minstagib_nextthink;
+.float minstagib_needammo;
+void minstagib_stop_countdown(entity e)
+{
+       if (!e.minstagib_needammo)
+               return;
+       Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_MINSTA_FINDAMMO);
+       e.minstagib_needammo = FALSE;
+}
+void minstagib_ammocheck(void)
+{
+       if not(IS_PLAYER(self))
+               return; // not a player
+       if (time < self.minstagib_nextthink)
+               return;
+
+       if (self.deadflag || gameover)
+               minstagib_stop_countdown(self);
+       else if (self.ammo_cells > 0 || (self.items & IT_UNLIMITED_WEAPON_AMMO))
+               minstagib_stop_countdown(self);
+       else
+       {
+               self.minstagib_needammo = TRUE;
+               if (self.health == 5)
+               {
+                       Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_MINSTAGIB_TERMINATED);
+               }
+               else if (self.health == 10)
+               {
+                       Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_1);
+               }
+               else if (self.health == 20)
+               {
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_2);
+               }
+               else if (self.health == 30)
+               {
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_3);
+               }
+               else if (self.health == 40)
+               {
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_4);
+               }
+               else if (self.health == 50)
+               {
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_5);
+               }
+               else if (self.health == 60)
+               {
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_6);
+               }
+               else if (self.health == 70)
+               {
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_7);
+               }
+               else if (self.health == 80)
+               {
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_8);
+               }
+               else if (self.health == 90)
+               {
+                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MINSTA_FINDAMMO);
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_9);
+               }
+               else if (self.health == 100)
+               {
+                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_MULTI, MULTI_MINSTA_FINDAMMO);
+                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+               }
+       }
+       self.minstagib_nextthink = time + 1;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_MatchEnd)
+{
+       entity head;
+       FOR_EACH_PLAYER(head)
+               minstagib_stop_countdown(head);
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_BotShouldAttack)
+{
+       if(checkentity.items & IT_STRENGTH)
+               return TRUE;
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_MakePlayerObserver)
+{
+       minstagib_stop_countdown(self);
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_PlayerSpawn)
+{
+       self.effects |= EF_FULLBRIGHT;
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_PlayerPreThink)
+{
+       minstagib_ammocheck();
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
+{
+       if not(self.effects & EF_FULLBRIGHT)
+               self.effects |= EF_FULLBRIGHT;
+
+       if (self.items & IT_STRENGTH)
+       {
+               play_countdown(self.strength_finished, "misc/poweroff.wav");
+               if (time > self.strength_finished)
+               {
+                       self.alpha = default_player_alpha;
+                       self.exteriorweaponentity.alpha = default_weapon_alpha;
+                       self.items &~= IT_STRENGTH;
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
+               }
+       }
+       else
+       {
+               if (time < self.strength_finished)
+               {
+                       self.alpha = autocvar_g_minstagib_invis_alpha;
+                       self.exteriorweaponentity.alpha = autocvar_g_minstagib_invis_alpha;
+                       self.items |= IT_STRENGTH;
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_INVISIBILITY, self.netname);
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);
+               }
+       }
+
+       if (self.items & IT_INVINCIBLE)
+       {
+               play_countdown(self.invincible_finished, "misc/poweroff.wav");
+               if (time > self.invincible_finished)
+               {
+                       self.items &~= IT_INVINCIBLE;
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
+               }
+       }
+       else
+       {
+               if (time < self.invincible_finished)
+               {
+                       self.items |= IT_INVINCIBLE;
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, self.netname);
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SPEED);
+               }
+       }
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_PlayerPhysics)
+{
+       if(self.items & IT_INVINCIBLE)
+               self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_minstagib_speed_highspeed;
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_SplitHealthArmor)
+{
+       damage_save = 0;
+       //damage_take = frag_damage; // frag_damage isn't even set here?!
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_ForbidThrowing)
+{
+       if (self.health < 1)
+               return FALSE;
+               
+       return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
+{
+       if(autocvar_g_friendlyfire == 0 && !IsDifferentTeam(frag_target, frag_attacker) && IS_PLAYER(frag_target))
+               frag_damage = 0;
+               
+       if(IS_PLAYER(frag_target))
+       {
+               if ((frag_deathtype == DEATH_FALL)  ||
+                       (frag_deathtype == DEATH_DROWN) ||
+                       (frag_deathtype == DEATH_SLIME) ||
+                       (frag_deathtype == DEATH_LAVA))
+               {
+                       frag_damage = 0;
+               }
+               
+               if (frag_target.armorvalue && (frag_deathtype == WEP_MINSTANEX) && frag_damage)
+               {
+                       frag_target.armorvalue -= 1;
+                       Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_MINSTA_LIVES_REMAINING, frag_target.armorvalue);
+                       frag_damage = 0;
+                       frag_target.hitsound += 1;
+                       frag_attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit
+               }
+               if (DEATH_ISWEAPON(frag_deathtype, WEP_LASER))
+               {
+                       frag_damage = 0;
+                       frag_mirrordamage = 0;
+                       if (frag_target != frag_attacker)
+                       {
+                               if ((frag_target.health >= 1) && IS_PLAYER(frag_target))
+                                       Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_MINSTA_SECONDARY);
+                               frag_force = '0 0 0';
+                               // keep mirrorfrag_force
+                               frag_attacker = frag_target;
+                       }
+               }
+       }
+       
+       if(frag_mirrordamage > 0)
+       {
+               // just lose extra LIVES, don't kill the player for mirror damage
+               if(frag_attacker.armorvalue > 0)
+               {
+                       frag_attacker.armorvalue = frag_attacker.armorvalue - 1;
+                       Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_MINSTA_LIVES_REMAINING, frag_attacker.armorvalue);
+                       frag_attacker.hitsound += 1;
+               }
+               frag_mirrordamage = 0;
+       }
+       
+       if(frag_target.items & IT_STRENGTH)
+               yoda = 1;
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_SetStartItems)
+{
+       start_ammo_cells = cvar("g_minstagib_ammo_start");
+       
+       start_health = 100;
+       start_armorvalue = 0;
+       WEPSET_COPY_AW(start_weapons, WEP_MINSTANEX);
+       start_items |= IT_UNLIMITED_SUPERWEAPONS;
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_FilterItem)
+{
+       if(self.classname == "item_cells")
+               return TRUE; // no normal cells?
+               
+       if(self.weapon == WEP_MINSTANEX && self.classname == "droppedweapon")
+       {
+               self.ammo_cells = autocvar_g_minstagib_ammo_drop;
+               return FALSE;
+       }
+       
+       if(self.weapon == WEP_ROCKET_LAUNCHER || self.weapon == WEP_NEX)
+       {
+               entity e = spawn();
+               setorigin(e, self.origin);
+               entity oldself;
+               oldself = self;
+               self = e;
+               spawnfunc_item_minst_cells();
+               self = oldself;
+               return TRUE;
+       }
+               
+       if(self.flags & FL_POWERUP)
+               return FALSE;
+               
+       if(self.ammo_cells > autocvar_g_minstagib_ammo_drop && self.classname != "item_minst_cells")
+               self.ammo_cells = autocvar_g_minstagib_ammo_drop;
+               
+       if(self.ammo_cells && !self.weapon)
+               return FALSE;
+               
+       return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_CustomizeWaypoint)
+{
+       entity e = WaypointSprite_getviewentity(other);
+       
+       // if you have the invisibility powerup, sprites ALWAYS are restricted to your team
+       // but only apply this to real players, not to spectators
+       if((self.owner.flags & FL_CLIENT) && (self.owner.items & IT_STRENGTH) && (e == other))
+       if(IsDifferentTeam(self.owner, e))
+               return TRUE;
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_ItemCountdown)
+{
+       switch(self.items)
+       {
+               case IT_STRENGTH:   item_name = "item-invis"; item_color = '0 0 1'; break;
+               case IT_NAILS:      item_name = "item-extralife"; item_color = '1 0 0'; break;
+               case IT_INVINCIBLE: item_name = "item-speed"; item_color = '1 0 1'; break;
+       }
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_ItemTouch)
+{
+       if(self.ammo_cells)
+       {
+               // play some cool sounds ;)
+               if (IS_CLIENT(other))
+               {
+                       if(other.health <= 5)
+                               Send_Notification(NOTIF_ONE, other, MSG_ANNCE, ANNCE_MINSTAGIB_LASTSECOND);
+                       else if(other.health < 50)
+                               Send_Notification(NOTIF_ONE, other, MSG_ANNCE, ANNCE_MINSTAGIB_NARROWLY);
+               }
+
+               if(other.health < 100)
+                       other.health = 100;
+       }
+       
+       if(self.max_health)
+       {
+               other.armorvalue = bound(other.armorvalue, 999, other.armorvalue + autocvar_g_minstagib_extralives);
+               Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
+       }
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_OnEntityPreSpawn)
+{
+       if not(autocvar_g_powerups) { return FALSE; }
+       if not(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega")
+               return FALSE;
+       
+       entity e = spawn();
+       
+       if(random() < 0.3)
+               e.think = spawnfunc_item_strength;
+       else if(random() < 0.6)
+               e.think = minstagib_health_mega;
+       else
+               e.think = spawnfunc_item_invincible;
+               
+       e.nextthink = time + 0.1;
+       e.spawnflags = self.spawnflags;
+       e.noalign = self.noalign;
+       setorigin(e, self.origin);
+       
+       return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":MinstaGib");
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(minstagib_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", MinstaGib");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_minstagib)
+{
+       MUTATOR_HOOK(MatchEnd, minstagib_MatchEnd, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BotShouldAttack, minstagib_BotShouldAttack, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerPhysics, minstagib_PlayerPhysics, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerSpawn, minstagib_PlayerSpawn, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerDamage_Calculate, minstagib_PlayerDamage, CBC_ORDER_ANY);
+       MUTATOR_HOOK(MakePlayerObserver, minstagib_MakePlayerObserver, CBC_ORDER_ANY);
+       MUTATOR_HOOK(SetStartItems, minstagib_SetStartItems, CBC_ORDER_ANY);
+       MUTATOR_HOOK(ItemTouch, minstagib_ItemTouch, CBC_ORDER_ANY);
+       MUTATOR_HOOK(FilterItem, minstagib_FilterItem, CBC_ORDER_ANY);
+       MUTATOR_HOOK(CustomizeWaypoint, minstagib_CustomizeWaypoint, CBC_ORDER_ANY);
+       MUTATOR_HOOK(Item_RespawnCountdown, minstagib_ItemCountdown, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, minstagib_SplitHealthArmor, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerPowerups, minstagib_PlayerPowerups, CBC_ORDER_ANY);
+       MUTATOR_HOOK(ForbidThrowCurrentWeapon, minstagib_ForbidThrowing, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerPreThink, minstagib_PlayerPreThink, CBC_ORDER_ANY);
+       MUTATOR_HOOK(OnEntityPreSpawn, minstagib_OnEntityPreSpawn, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, minstagib_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, minstagib_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
index 40a925b3ce835fbc24c9b64f424d9022690dd0bc..1aa293b39ea260efd53f3c7a80cf1325ea749d32 100644 (file)
@@ -5,7 +5,8 @@ MUTATOR_HOOKFUNCTION(vampire_PlayerDamage)
        if(g_minstagib)
        {
                // minstagib: each hit means +1 ammo
-               frag_attacker.ammo_cells += 2; // note: 1 cell was deducted for the shot
+               if(frag_attacker != frag_target)
+                       frag_attacker.ammo_cells += 2; // note: 1 cell was deducted for the shot
        }
        else
        {
index dab42bd65d8c39287701a4c3cffb3daf808f9609..3f9f020affc086c1968fbe80a2bfc64bd9a3d5e3 100644 (file)
@@ -19,6 +19,7 @@ MUTATOR_DECLARATION(mutator_spawn_near_teammate);
 MUTATOR_DECLARATION(mutator_physical_items);
 MUTATOR_DECLARATION(mutator_vampire);
 MUTATOR_DECLARATION(mutator_superspec);
+MUTATOR_DECLARATION(mutator_minstagib);
 MUTATOR_DECLARATION(mutator_touchexplode);
 
 MUTATOR_DECLARATION(sandbox);
index b3cc22ddaa7a785c9a44472025a74e1b0cde3cb3..957710c3f86edcb4369691d478f0fa79785e6791 100644 (file)
@@ -242,6 +242,7 @@ mutators/mutator_spawn_near_teammate.qc
 mutators/mutator_physical_items.qc
 mutators/sandbox.qc
 mutators/mutator_superspec.qc
+mutators/mutator_minstagib.qc
 mutators/mutator_touchexplode.qc
 
 ../warpzonelib/anglestransform.qc
index 40abd18b135fe920265d197357927a458308f990..3471ce1b046fd54dc00a8b12dad110e22115360c 100644 (file)
@@ -271,11 +271,6 @@ float ItemSend(entity to, float sf)
 
 float have_pickup_item(void)
 {
-       // minstagib: only allow filtered items
-       if(g_minstagib)
-               if(self.classname != "minstagib")
-                       return FALSE;
-
        if(self.flags & FL_POWERUP)
        {
                if(autocvar_g_powerups > 0)
@@ -440,9 +435,10 @@ void Item_Show (entity e, float mode)
 void Item_Respawn (void)
 {
        Item_Show(self, 1);
-       if(!g_minstagib && self.items == IT_STRENGTH)
+       // this is ugly...
+       if(self.items == IT_STRENGTH)
                sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);     // play respawn sound
-       else if(!g_minstagib && self.items == IT_INVINCIBLE)
+       else if(self.items == IT_INVINCIBLE)
                sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);       // play respawn sound
        else
                sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM);  // play respawn sound
@@ -469,28 +465,18 @@ void Item_RespawnCountdown (void)
                        string name;
                        vector rgb = '1 0 1';
                        name = string_null;
-                       if(g_minstagib)
-                       {
-                               switch(self.items)
-                               {
-                                       case IT_STRENGTH:   name = "item-invis"; rgb = '0 0 1'; break;
-                                       case IT_NAILS:      name = "item-extralife"; rgb = '1 0 0'; break;
-                                       case IT_INVINCIBLE: name = "item-speed"; rgb = '1 0 1'; break;
-                               }
-                       }
-                       else
-                       {
-                               switch(self.items)
-                               {
-                                       case IT_STRENGTH:   name = "item-strength"; rgb = '0 0 1'; break;
-                                       case IT_INVINCIBLE: name = "item-shield"; rgb = '1 0 1'; break;
-                               }
-                       }
                        switch(self.items)
                        {
-                               case IT_FUEL_REGEN:     name = "item-fuelregen"; rgb = '1 0.5 0'; break;
-                               case IT_JETPACK:        name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
+                               case IT_FUEL_REGEN: name = "item-fuelregen"; rgb = '1 0.5 0'; break;
+                               case IT_JETPACK:    name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
+                               case IT_STRENGTH:   name = "item-strength"; rgb = '0 0 1'; break;
+                               case IT_INVINCIBLE: name = "item-shield"; rgb = '1 0 1'; break;
                        }
+                       item_name = name;
+                       item_color = rgb;
+                       MUTATOR_CALLHOOK(Item_RespawnCountdown);
+                       name = item_name;
+                       rgb = item_color;
                        if(self.flags & FL_WEAPON)
                        {
                                entity wi = get_weaponinfo(self.weapon);
@@ -610,130 +596,64 @@ float Item_GiveTo(entity item, entity player)
        // if nothing happens to player, just return without taking the item
        pickedup = FALSE;
        _switchweapon = FALSE;
+       // in case the player has autoswitch enabled do the following:
+       // if the player is using their best weapon before items are given, they
+       // probably want to switch to an even better weapon after items are given
+       if (player.autoswitch)
+       if (player.switchweapon == w_getbestweapon(player))
+               _switchweapon = TRUE;
 
-       if (g_minstagib)
-       {
-               float prevcells = player.ammo_cells;
-
-               pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
-               pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, 999, ITEM_MODE_NONE);
-
-               if(player.ammo_cells > prevcells)
-               {
-                       _switchweapon = TRUE;
-
-                       // play some cool sounds ;)
-                       if (clienttype(player) == CLIENTTYPE_REAL)
-                       {
-                               if(player.health <= 5)
-                                       Send_Notification(NOTIF_ONE, player, MSG_ANNCE, ANNCE_MINSTAGIB_LASTSECOND);
-                               else if(player.health < 50)
-                                       Send_Notification(NOTIF_ONE, player, MSG_ANNCE, ANNCE_MINSTAGIB_NARROWLY);
-                       }
-                       // sound not available
-                       // else if(item.items == IT_CELLS)
-                       //      AnnounceTo(player, "ammo");
+       if not(WEPSET_CONTAINS_EW(player, player.switchweapon))
+               _switchweapon = TRUE;
 
-                       if (WEPSET_CONTAINS_EW(item, WEP_MINSTANEX))
-                               W_GiveWeapon (player, WEP_MINSTANEX);
-                       player.health = 100;
-               }
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_shells, g_pickup_shells_max, ITEM_MODE_NONE);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max, ITEM_MODE_NONE);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max, ITEM_MODE_NONE);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max, ITEM_MODE_NONE);
+       pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health, ITEM_MODE_HEALTH);
+       pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue, ITEM_MODE_ARMOR);
 
-               if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
-               {
-                       pickedup = TRUE;
-                       player.items |= it;
-                       sprint (player, strcat("You got the ^2", item.netname, "\n"));
-               }
+       if (item.flags & FL_WEAPON)
+       {
+               WEPSET_DECLARE_A(it);
+               WEPSET_COPY_AE(it, item);
+               WEPSET_ANDNOT_AE(it, player);
 
-               // extralife powerup
-               if (item.max_health)
+               if (!WEPSET_EMPTY_A(it) || (item.spawnshieldtime && item.pickup_anyway))
                {
                        pickedup = TRUE;
-                       // sound not available
-                       // AnnounceTo(player, "_lives");
-                       player.armorvalue = bound(player.armorvalue, 999, player.armorvalue + autocvar_g_minstagib_extralives);
-                       Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_EXTRALIVES);
+                       for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+                       if(WEPSET_CONTAINS_AW(it, i))
+                               W_GiveWeapon(player, i);
                }
+       }
 
-               // invis powerup
-               if (item.strength_finished)
-               {
-                       pickedup = TRUE;
-                       // sound not available
-                       // AnnounceTo(player, "invisible");
-                       player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
-               }
+       if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
+       {
+               pickedup = TRUE;
+               player.items |= it;
+               sprint (player, strcat("You got the ^2", item.netname, "\n"));
+       }
 
-               // speed powerup
-               if (item.invincible_finished)
-               {
-                       pickedup = TRUE;
-                       // sound not available
-                       // AnnounceTo(player, "speed");
-                       player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
-               }
+       if (item.strength_finished)
+       {
+               pickedup = TRUE;
+               player.strength_finished = max(player.strength_finished, time) + item.strength_finished;
        }
-       else
+       if (item.invincible_finished)
        {
-               // in case the player has autoswitch enabled do the following:
-               // if the player is using their best weapon before items are given, they
-               // probably want to switch to an even better weapon after items are given
-               if (player.autoswitch)
-               if (player.switchweapon == w_getbestweapon(player))
-                       _switchweapon = TRUE;
-
-               if not(WEPSET_CONTAINS_EW(player, player.switchweapon))
-                       _switchweapon = TRUE;
-
-               pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
-               pickedup |= Item_GiveAmmoTo(item, player, ammo_shells, g_pickup_shells_max, ITEM_MODE_NONE);
-               pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max, ITEM_MODE_NONE);
-               pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max, ITEM_MODE_NONE);
-               pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max, ITEM_MODE_NONE);
-               pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health, ITEM_MODE_HEALTH);
-               pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue, ITEM_MODE_ARMOR);
-
-               if (item.flags & FL_WEAPON)
-               {
-                       WEPSET_DECLARE_A(it);
-                       WEPSET_COPY_AE(it, item);
-                       WEPSET_ANDNOT_AE(it, player);
-
-                       if (!WEPSET_EMPTY_A(it) || (item.spawnshieldtime && self.pickup_anyway))
-                       {
-                               pickedup = TRUE;
-                               for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-                                       if(WEPSET_CONTAINS_AW(it, i))
-                                               W_GiveWeapon(player, i);
-                       }
-               }
-
-               if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
-               {
-                       pickedup = TRUE;
-                       player.items |= it;
-                       sprint (player, strcat("You got the ^2", item.netname, "\n"));
-               }
-
-               if (item.strength_finished)
-               {
-                       pickedup = TRUE;
-                       player.strength_finished = max(player.strength_finished, time) + item.strength_finished;
-               }
-               if (item.invincible_finished)
-               {
-                       pickedup = TRUE;
-                       player.invincible_finished = max(player.invincible_finished, time) + item.invincible_finished;
-               }
-               if (item.superweapons_finished)
-               {
-                       pickedup = TRUE;
-                       player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
-               }
+               pickedup = TRUE;
+               player.invincible_finished = max(player.invincible_finished, time) + item.invincible_finished;
+       }
+       if (item.superweapons_finished)
+       {
+               pickedup = TRUE;
+               player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
        }
 
 :skip
+       
        // always eat teamed entities
        if(item.team)
                pickedup = TRUE;
@@ -1148,9 +1068,9 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                precache_sound (self.item_pickupsound);
 
                precache_sound ("misc/itemrespawncountdown.wav");
-               if(!g_minstagib && itemid == IT_STRENGTH)
+               if(itemid == IT_STRENGTH)
                        precache_sound ("misc/strength_respawn.wav");
-               else if(!g_minstagib && itemid == IT_INVINCIBLE)
+               else if(itemid == IT_INVINCIBLE)
                        precache_sound ("misc/shield_respawn.wav");
                else
                        precache_sound ("misc/itemrespawn.wav");
@@ -1220,69 +1140,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
        }
 }
 
-/* replace items in minstagib
- * IT_STRENGTH  = invisibility
- * IT_NAILS     = extra lives
- * IT_INVINCIBLE = speed
- */
-void minstagib_items (float itemid) // will be deleted soon.
-{
-       float rnd;
-       self.classname = "minstagib"; // ...?
-
-       // replace rocket launchers and nex guns with ammo cells
-       if (itemid == IT_CELLS)
-       {
-               self.ammo_cells = autocvar_g_minstagib_ammo_drop;
-               StartItem ("models/items/a_cells.md3",
-                       "misc/itempickup.wav", 45, 0,
-                       "MinstaNex Ammo", IT_CELLS, 0, 0, generic_pickupevalfunc, 100);
-               return;
-       }
-
-       // randomize
-       rnd = random() * 3;
-       if (rnd <= 1)
-               itemid = IT_STRENGTH;
-       else if (rnd <= 2)
-               itemid = IT_NAILS;
-       else
-               itemid = IT_INVINCIBLE;
-
-       // replace with invis
-       if (itemid == IT_STRENGTH)
-       {
-               if(!self.strength_finished)
-                       self.strength_finished = autocvar_g_balance_powerup_strength_time;
-               StartItem ("models/items/g_strength.md3",
-                       "misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
-                       "Invisibility", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
-       }
-       // replace with extra lives
-       if (itemid == IT_NAILS)
-       {
-               self.max_health = 1;
-               StartItem ("models/items/g_h100.md3",
-                       "misc/megahealth.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
-                       "Extralife", IT_NAILS, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
-       }
-       // replace with speed
-       if (itemid == IT_INVINCIBLE)
-       {
-               if(!self.invincible_finished)
-                       self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
-               StartItem ("models/items/g_invincible.md3",
-                       "misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
-                       "Speed", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
-       }
-}
-
-float minst_no_auto_cells;
-void minst_remove_item (void) {
-       if(minst_no_auto_cells)
-               remove(self);
-}
-
 float weaponswapping;
 float internalteam;
 
@@ -1421,11 +1278,6 @@ void weapon_defaultspawnfunc(float wpn)
        if(self.team)
                f |= FL_NO_WEAPON_STAY;
 
-       // stupid minstagib hack, don't ask
-       if(g_minstagib)
-               if(self.ammo_cells)
-                       self.ammo_cells = autocvar_g_minstagib_ammo_drop;
-
        StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
        if (self.modelindex) // don't precache if self was removed
                weapon_action(e.weapon, WR_PRECACHE);
@@ -1454,37 +1306,16 @@ void spawnfunc_weapon_shotgun (void) {
 
 void spawnfunc_weapon_nex (void)
 {
-       if (g_minstagib)
-       {
-               minstagib_items(IT_CELLS);
-               self.think = minst_remove_item;
-               self.nextthink = time;
-               return;
-       }
        weapon_defaultspawnfunc(WEP_NEX);
 }
 
 void spawnfunc_weapon_minstanex (void)
 {
-       if (g_minstagib)
-       {
-               minstagib_items(IT_CELLS);
-               self.think = minst_remove_item;
-               self.nextthink = time;
-               return;
-       }
        weapon_defaultspawnfunc(WEP_MINSTANEX);
 }
 
 void spawnfunc_weapon_rocketlauncher (void)
 {
-       if (g_minstagib)
-       {
-               minstagib_items(IT_CELLS); // replace rocketlauncher with cells
-               self.think = minst_remove_item;
-               self.nextthink = time;
-               return;
-       }
        weapon_defaultspawnfunc(WEP_ROCKET_LAUNCHER);
 }
 
@@ -1612,9 +1443,6 @@ void spawnfunc_item_health_large (void) {
 }
 
 void spawnfunc_item_health_mega (void) {
-       if(g_minstagib) {
-               minstagib_items(IT_NAILS);
-       } else {
                if(!self.max_health)
                        self.max_health = g_pickup_healthmega_max;
                if(!self.health)
@@ -1622,7 +1450,6 @@ void spawnfunc_item_health_mega (void) {
                if(!self.pickup_anyway)
                        self.pickup_anyway = g_pickup_healthmega_anyway;
                StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Health", IT_HEALTH, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
-       }
 }
 
 // support old misnamed entities
@@ -1633,34 +1460,16 @@ void spawnfunc_item_health25() { spawnfunc_item_health_medium(); }
 void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
 
 void spawnfunc_item_strength (void) {
-       if(g_minstagib) {
-               minstagib_items(IT_STRENGTH);
-       } else {
                precache_sound("weapons/strength_fire.wav");
                if(!self.strength_finished)
                        self.strength_finished = autocvar_g_balance_powerup_strength_time;
                StartItem ("models/items/g_strength.md3", "misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Strength Powerup", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
-       }
 }
 
 void spawnfunc_item_invincible (void) {
-       if(g_minstagib) {
-               minstagib_items(IT_INVINCIBLE);
-       } else {
                if(!self.invincible_finished)
                        self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
                StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Shield", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
-       }
-}
-
-void spawnfunc_item_minst_cells (void) {
-       if (g_minstagib)
-       {
-               minst_no_auto_cells = TRUE;
-               minstagib_items(IT_CELLS);
-       }
-       else
-               remove(self);
 }
 
 // compatibility:
@@ -2152,12 +1961,6 @@ float GiveItems(entity e, float beginarg, float endarg)
                if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
                        e.superweapons_finished = autocvar_g_balance_superweapons_time;
 
-       if (g_minstagib)
-       {
-               e.health = bound(0, e.health, 100);
-               e.armorvalue = bound(0, e.armorvalue, 999);
-       }
-
        if(e.strength_finished <= 0)
                e.strength_finished = 0;
        else
index 16236dd16ba7d93fb52210553efe8d0ca89a5078..900d4e99e3e8a0d01c64ae712fec3edaadc914dd 100644 (file)
@@ -270,9 +270,7 @@ string getwelcomemessage(void)
        ret_string = "";
        MUTATOR_CALLHOOK(BuildMutatorsPrettyString);
        modifications = ret_string;
-       
-       if(g_minstagib)
-               modifications = strcat(modifications, ", MinstaGib");
+
        if(g_weaponarena)
        {
                if(g_weaponarena_random)
index 2e0c1e8f02bbcd466773894e43e3da4df52104f5..ad7cef81b7da2155104a723b5dd44b4f89e51fa6 100644 (file)
@@ -11,7 +11,6 @@ void W_GiveWeapon (entity e, float wep)
        oldself = self;
        self = e;
 
-       if not(g_minstagib)
        if(other.classname == "player")
                { Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_WEAPON_GOT, wep); }
 
index 69dcb17aa5c292d4328b539668c8dac674f76935..f2a4ba281509d6ff7df6a9f17a3d613e684a1b46 100644 (file)
@@ -34,19 +34,11 @@ void W_Laser_Attack (float issecondary)
        entity missile;
        vector s_forward;
        float a;
-       float nodamage;
-
-       if(issecondary == 2) // minstanex shot
-               nodamage = g_minstagib;
-       else
-               nodamage = FALSE;
 
        a = autocvar_g_balance_laser_primary_shotangle;
        s_forward = v_forward * cos(a * DEG2RAD) + v_up * sin(a * DEG2RAD);
 
-       if(nodamage)
-               W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, 0);
-       else if(issecondary == 1)
+       if(issecondary == 1)
                W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, autocvar_g_balance_laser_secondary_damage);
        else
                W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, autocvar_g_balance_laser_primary_damage);
@@ -56,11 +48,8 @@ void W_Laser_Attack (float issecondary)
        missile.owner = missile.realowner = self;
        missile.classname = "laserbolt";
        missile.dmg = 0;
-       if(!nodamage)
-       {
-               missile.bot_dodge = TRUE;
-               missile.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
-       }
+       missile.bot_dodge = TRUE;
+       missile.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
 
        PROJECTILE_MAKETRIGGER(missile);
        missile.projectiledeathtype = WEP_LASER;
index 611319a16cd94f4794e5606ed55fb35205f4a54b..2ad71ce798667a92a5fa6d63e0f0b6fc8adca963 100644 (file)
@@ -16,20 +16,12 @@ void W_MinstaNex_Attack (void)
        damage_goodhits = 0;
        FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
 
-       if(g_minstagib)
+       if(yoda && flying)
+               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+       if(damage_goodhits && self.minstanex_lasthit)
        {
-               if(yoda)
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
-       }
-       else
-       {
-               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
-               }
+               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+               damage_goodhits = 0; // only every second time
        }
 
        self.minstanex_lasthit = damage_goodhits;
@@ -39,129 +31,41 @@ void W_MinstaNex_Attack (void)
        // teamcolor / hit beam effect
        vector v;
        v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-       if(teamplay)
-       {
-           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;
-           }
-       }
-       else
-        WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v);
-
-       if (g_minstagib)
-               W_DecreaseAmmo(ammo_cells, 1, autocvar_g_balance_minstanex_reload_ammo);
-       else
-               W_DecreaseAmmo(ammo_cells, autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_reload_ammo);
-}
-
-
-.float minstagib_nextthink;
-.float minstagib_needammo;
-void minstagib_stop_countdown(entity e)
-{
-       if (!e.minstagib_needammo)
-               return;
-       Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_MINSTA_FINDAMMO);
-       e.minstagib_needammo = FALSE;
-}
-void minstagib_ammocheck(void)
-{
-       if (time < self.minstagib_nextthink)
-               return;
-
-       if (self.deadflag || gameover || (self.flags & FL_GODMODE))
-               minstagib_stop_countdown(self);
-       else if (self.ammo_cells > 0 || (self.items & IT_UNLIMITED_WEAPON_AMMO))
-       {
-               if (self.minstagib_needammo)
-                       self.health = 100;
-               minstagib_stop_countdown(self);
-       }
-       else
-       {
-               self.minstagib_needammo = TRUE;
-               if (self.health == 5)
-               {
-                       Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_MINSTAGIB_TERMINATED);
-               }
-               else if (self.health == 10)
-               {
-                       Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_1);
-               }
-               else if (self.health == 20)
-               {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_2);
-               }
-               else if (self.health == 30)
-               {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_3);
-               }
-               else if (self.health == 40)
-               {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_4);
-               }
-               else if (self.health == 50)
-               {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_5);
-               }
-               else if (self.health == 60)
-               {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_6);
-               }
-               else if (self.health == 70)
-               {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_7);
-               }
-               else if (self.health == 80)
-               {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_8);
-               }
-               else if (self.health == 90)
-               {
-                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MINSTA_FINDAMMO);
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_9);
-               }
-               else if (self.health == 100)
-               {
-                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_MULTI, MULTI_MINSTA_FINDAMMO);
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
-               }
-       }
-       self.minstagib_nextthink = time + 1;
+       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(ammo_cells, ((g_minstagib) ? 1 : autocvar_g_balance_minstanex_ammo), autocvar_g_balance_minstanex_reload_ammo);
 }
 
 void spawnfunc_weapon_minstanex (void); // defined in t_items.qc
@@ -172,10 +76,7 @@ float w_minstanex(float req)
        float minstanex_ammo;
 
        // now multiple WR_s use this
-       if(g_minstagib)
-               minstanex_ammo = 1;
-       else
-               minstanex_ammo = autocvar_g_balance_minstanex_ammo;
+       minstanex_ammo = ((g_minstagib) ? 1 : autocvar_g_balance_minstanex_ammo);
 
        if (req == WR_AIM)
        {
index 75f6a087d14256ef0b32ee3525809e847b47cf41..1b612057fe431f33dc78f08b3038112d2d205960 100644 (file)
@@ -85,7 +85,7 @@ void shotgun_meleethink (void)
                        + (v_up * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_up)
                        + (v_right * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_side));
 
-               WarpZone_traceline_antilag(self.realowner, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self.realowner, ANTILAG_LATENCY(self.realowner));
+               WarpZone_traceline_antilag(self, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self, ANTILAG_LATENCY(self.realowner));
                
                // draw lightning beams for debugging
                //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5); 
@@ -151,7 +151,7 @@ void W_Shotgun_Attack2 (void)
 
        entity meleetemp;
        meleetemp = spawn();
-       meleetemp.owner = meleetemp.realowner = self;
+       meleetemp.realowner = self;
        meleetemp.think = shotgun_meleethink;
        meleetemp.nextthink = time + autocvar_g_balance_shotgun_secondary_melee_delay * W_WeaponRateFactor();
        W_SetupShot_Range(self, TRUE, 0, "", 0, autocvar_g_balance_shotgun_secondary_damage, autocvar_g_balance_shotgun_secondary_melee_range);
index 0e6f2168b863b50c94a7c49dd20659a9315ed879..c692b6e4ad53d26174c1686f0bb9f35c7cbcae05 100644 (file)
@@ -237,15 +237,9 @@ float WaypointSprite_Customize()
        // make spectators see what the player would see
        entity e;
        e = WaypointSprite_getviewentity(other);
-
-       // as a GENERAL rule:
-       // if you have the invisibility powerup, sprites ALWAYS are restricted to your team
-       // but only apply this to real players, not to spectators
-       if(g_minstagib && (self.owner.flags & FL_CLIENT) && (self.owner.items & IT_STRENGTH) && (e == other))
-       {
-               if(!WaypointSprite_isteammate(self.owner, e))
-                       return FALSE;
-       }
+       
+       if(MUTATOR_CALLHOOK(CustomizeWaypoint))
+               return FALSE;
 
        return self.waypointsprite_visible_for_player(e);
 }
index 4030c64885d7945d728e9608a309c2b742e8e063..d28aa4cad6f258d4b058aa7b468e5ebc7fc63e61 100644 (file)
@@ -13,7 +13,7 @@ set g_vehicle_bumblebee 1
 set g_vehicles_crush_dmg 70
 set g_vehicles_crush_force 50
 
-set cl_vehicles_hudscale 0.5way
+set cl_vehicles_hudscale 0.5
 
 set g_vehicles_delayspawn 1
 set g_vehicles_delayspawn_jitter 10
@@ -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.001
+set g_vehicles_minstanex_damagerate 0.007
 set g_vehicles_tag_damagerate 2