]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_minstagib.qc
Rename minstanex to vaporizer
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_minstagib.qc
index 4df4e8bf56b6ad8a5b1d521047eba6e2bc6dfa2a..1f230db11c84e728f6ea5ee01598a8909a247011 100644 (file)
@@ -1,9 +1,9 @@
-void spawnfunc_item_minst_cells (void) 
+void spawnfunc_item_minst_cells (void)
 {
-       if not(g_minstagib) { remove(self); return; }
-       if not(self.ammo_cells)
+       if (!g_minstagib) { remove(self); return; }
+       if (!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);
@@ -28,7 +28,7 @@ void minstagib_stop_countdown(entity e)
 }
 void minstagib_ammocheck()
 {
-       if not(IS_PLAYER(self))
+       if (!IS_PLAYER(self))
                return; // not a player
        if (time < self.minstagib_nextthink)
                return;
@@ -105,7 +105,7 @@ MUTATOR_HOOKFUNCTION(minstagib_MatchEnd)
        entity head;
        FOR_EACH_PLAYER(head)
                minstagib_stop_countdown(head);
-               
+
        return FALSE;
 }
 
@@ -113,7 +113,7 @@ MUTATOR_HOOKFUNCTION(minstagib_BotShouldAttack)
 {
        if(checkentity.items & IT_STRENGTH)
                return TRUE;
-               
+
        return FALSE;
 }
 
@@ -137,7 +137,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPreThink)
 
 MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
 {
-       if not(self.effects & EF_FULLBRIGHT)
+       if (!(self.effects & EF_FULLBRIGHT))
                self.effects |= EF_FULLBRIGHT;
 
        if (self.items & IT_STRENGTH)
@@ -147,7 +147,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                {
                        self.alpha = default_player_alpha;
                        self.exteriorweaponentity.alpha = default_weapon_alpha;
-                       self.items &~= IT_STRENGTH;
+                       self.items &= ~IT_STRENGTH;
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
                }
        }
@@ -168,7 +168,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                play_countdown(self.invincible_finished, "misc/poweroff.wav");
                if (time > self.invincible_finished)
                {
-                       self.items &~= IT_INVINCIBLE;
+                       self.items &= ~IT_INVINCIBLE;
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
                }
        }
@@ -188,7 +188,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPhysics)
 {
        if(self.items & IT_INVINCIBLE)
                self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_minstagib_speed_highspeed;
-               
+
        return FALSE;
 }
 
@@ -196,7 +196,7 @@ MUTATOR_HOOKFUNCTION(minstagib_SplitHealthArmor)
 {
        damage_save = 0;
        damage_take = frag_damage;
-       
+
        return FALSE;
 }
 
@@ -210,9 +210,9 @@ MUTATOR_HOOKFUNCTION(minstagib_ForbidThrowing)
 
 MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
 {
-       if(autocvar_g_friendlyfire == 0 && !IsDifferentTeam(frag_target, frag_attacker) && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker))
+       if(autocvar_g_friendlyfire == 0 && SAME_TEAM(frag_target, frag_attacker) && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker))
                frag_damage = 0;
-               
+
        if(IS_PLAYER(frag_target))
        {
                if ((frag_deathtype == DEATH_FALL)  ||
@@ -222,9 +222,9 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                {
                        frag_damage = 0;
                }
-               
+
                if(IS_PLAYER(frag_attacker))
-               if(DEATH_ISWEAPON(frag_deathtype, WEP_MINSTANEX))
+               if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
                if(frag_target.armorvalue)
                {
                        frag_target.armorvalue -= 1;
@@ -233,9 +233,9 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                        frag_target.hitsound += 1;
                        frag_attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit
                }
-               
+
                if(IS_PLAYER(frag_attacker))
-               if (DEATH_ISWEAPON(frag_deathtype, WEP_LASER))
+               if(DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER))
                {
                        frag_damage = 0;
                        frag_mirrordamage = 0;
@@ -249,7 +249,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                        }
                }
        }
-       
+
        if(IS_PLAYER(frag_attacker))
        if(frag_mirrordamage > 0)
        {
@@ -262,23 +262,23 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                }
                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);
-       WEPSET_COPY_AW(warmup_start_weapons, WEP_MINSTANEX);
+       start_weapons = WEPSET_VAPORIZER;
+       warmup_start_weapons = WEPSET_VAPORIZER;
        start_items |= IT_UNLIMITED_SUPERWEAPONS;
-               
+
        return FALSE;
 }
 
@@ -286,13 +286,13 @@ MUTATOR_HOOKFUNCTION(minstagib_FilterItem)
 {
        if(self.classname == "item_cells")
                return TRUE; // no normal cells?
-               
-       if(self.weapon == WEP_MINSTANEX && self.classname == "droppedweapon")
+
+       if(self.weapon == WEP_VAPORIZER && self.classname == "droppedweapon")
        {
                self.ammo_cells = autocvar_g_minstagib_ammo_drop;
                return FALSE;
        }
-       
+
        if(self.weapon == WEP_DEVASTATOR || self.weapon == WEP_NEX)
        {
                entity e = spawn();
@@ -304,29 +304,29 @@ MUTATOR_HOOKFUNCTION(minstagib_FilterItem)
                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))
+       if(DIFF_TEAM(self.owner, e))
                return TRUE;
-       
+
        return FALSE;
 }
 
@@ -359,37 +359,37 @@ MUTATOR_HOOKFUNCTION(minstagib_ItemTouch)
 
                return MUT_ITEMTOUCH_CONTINUE;
        }
-       
+
        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 MUT_ITEMTOUCH_PICKUP;
        }
-               
+
        return MUT_ITEMTOUCH_CONTINUE;
 }
 
 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")
+       if (!autocvar_g_powerups) { return FALSE; }
+       if (!(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;
 }
 
@@ -405,6 +405,12 @@ MUTATOR_HOOKFUNCTION(minstagib_BuildMutatorsPrettyString)
        return FALSE;
 }
 
+MUTATOR_HOOKFUNCTION(minstagib_SetModname)
+{
+       modname = "MinstaGib";
+       return TRUE;
+}
+
 MUTATOR_DEFINITION(mutator_minstagib)
 {
        MUTATOR_HOOK(MatchEnd, minstagib_MatchEnd, CBC_ORDER_ANY);
@@ -425,6 +431,7 @@ MUTATOR_DEFINITION(mutator_minstagib)
        MUTATOR_HOOK(OnEntityPreSpawn, minstagib_OnEntityPreSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(BuildMutatorsString, minstagib_BuildMutatorsString, CBC_ORDER_ANY);
        MUTATOR_HOOK(BuildMutatorsPrettyString, minstagib_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(SetModname, minstagib_SetModname, CBC_ORDER_ANY);
 
        return FALSE;
 }