]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Refer to item flags from item definitions
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 11 Aug 2015 10:07:55 +0000 (20:07 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 12 Aug 2015 08:38:25 +0000 (18:38 +1000)
19 files changed:
qcsrc/Makefile
qcsrc/client/hud.qc
qcsrc/common/items/item/armor.qc
qcsrc/common/items/item/powerup.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/physics.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/server/cl_client.qc
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/mutator_instagib.qc
qcsrc/server/mutators/mutator_melee_only.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/mutators/mutator_overkill.qc
qcsrc/server/t_items.qc
qcsrc/server/weapons/common.qc

index f53707e829f482c39e0f6dcdee0c54d54d4aa3c1..26797c55a1459fd67fe9599f97158d3707a4f7e4 100644 (file)
@@ -13,7 +13,7 @@ QCCFLAGS ?= \
        -std=gmqcc \
        -O3 -flno \
        -Werror -fno-bail-on-werror -Wall \
-       -fftepp -fftepp-predefs -Wcpp -futf8 \
+       -fftepp -fftepp-predefs -Wcpp -futf8 -frelaxed-switch \
        $(QCCFLAGS_WTFS) \
        $(QCCFLAGS_FEATURES) \
        $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
index c422892ea3cb0baea1593245a19eb9477f9a980b..4a26fdf0ad99ae290dd27b18c7d9e5b498c2cd0f 100644 (file)
@@ -11,6 +11,7 @@
 #include "../common/constants.qh"
 #include "../common/counting.qh"
 #include "../common/deathtypes.qh"
+#include "../common/items/all.qc"
 #include "../common/mapinfo.qh"
 #include "../common/nades.qh"
 
@@ -1358,7 +1359,7 @@ int getPowerupItemAlign(int align, int column, int row, int columns, int rows, b
        return 2;
 }
 
-void HUD_Powerups(void)
+void HUD_Powerups()
 {
        if(intermission == 2) return;
 
@@ -1372,7 +1373,7 @@ void HUD_Powerups(void)
                if(!autocvar_hud_panel_powerups) return;
                if(spectatee_status == -1) return;
                if(getstati(STAT_HEALTH) <= 0) return;
-               if(!(allItems & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) && !allBuffs) return;
+               if(!(allItems & (ITEM_Strength.m_itemid | ITEM_Shield.m_itemid | IT_SUPERWEAPON)) && !allBuffs) return;
 
                strengthTime = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
                shieldTime = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
index 0db9d1f70e8bf0f75344125ca0268512949763f1..e5ade4f4ba91574d4c729bc20d426c01f3f4be0a 100644 (file)
@@ -27,7 +27,7 @@ REGISTER_ITEM(ArmorMedium, Armor) {
 #endif
 }
 
-REGISTER_ITEM(ArmorBig, Armor) {
+REGISTER_ITEM(ArmorLarge, Armor) {
     this.m_model                =   "models/items/item_armor_big.md3";
     this.m_sound                =   "misc/armor17_5.wav";
     this.m_name                 =   "50 Armor";
@@ -39,7 +39,7 @@ REGISTER_ITEM(ArmorBig, Armor) {
 #endif
 }
 
-REGISTER_ITEM(ArmorLarge, Armor) {
+REGISTER_ITEM(ArmorMega, Armor) {
     this.m_model                =   "models/items/item_armor_large.md3";
     this.m_sound                =   "misc/armor25.wav";
     this.m_name                 =   "100 Armor";
index 0f025aed8f5a4ab4ee0282f24343e05077922f3e..c4bfb39361f2efffe7c97064ef6408748a1a713b 100644 (file)
@@ -1,19 +1,18 @@
 #include "powerup.qh"
 #include "../../../server/t_items.qh"
 
+#ifndef SVQC
+.int m_itemid;
+#endif
 REGISTER_ITEM(Strength, Powerup) {
     this.m_model    =   "models/items/g_strength.md3";
     this.m_sound    =   "misc/powerup.wav";
     this.m_name     =   "Strength Powerup";
-#ifdef SVQC
     this.m_itemid   =   IT_STRENGTH;
-#endif
 }
 REGISTER_ITEM(Shield, Powerup) {
     this.m_model    =   "models/items/g_invincible.md3";
     this.m_sound    =   "misc/powerup_shield.wav";
     this.m_name     =   "Shield";
-#ifdef SVQC
     this.m_itemid   =   IT_INVINCIBLE;
-#endif
 }
index 1aab262fd0a9ea28c797cb1504dcd4efeb6acd20..4ac1f3af1fda0e5ae12709da679aa5a012ce023b 100644 (file)
@@ -64,7 +64,7 @@ float friend_needshelp(entity e)
                return false;
        if(!IS_PLAYER(e))
                return ((e.flags & FL_MONSTER) && e.health < e.max_health);
-       if(e.items & IT_INVINCIBLE)
+       if(e.items & ITEM_Shield.m_itemid)
                return false;
 
        switch(self.skin)
index 4143ad3b11a71e651fba7b32e129f132692ea702..8d14f4b4f7843d903954fbe7ca03893478d27ec6 100644 (file)
@@ -709,7 +709,7 @@ void CheckPlayerJump()
                float activate = JETPACK_JUMP(self) && air_jump && PHYS_INPUT_BUTTON_JUMP(self) || PHYS_INPUT_BUTTON_JETPACK(self);
                float has_fuel = !PHYS_JETPACK_FUEL || PHYS_AMMO_FUEL(self) || ITEMS_STAT(self) & IT_UNLIMITED_WEAPON_AMMO;
 
-               if (!(ITEMS_STAT(self) & IT_JETPACK)) { }
+               if (!(ITEMS_STAT(self) & ITEM_Jetpack.m_itemid)) { }
                else if (self.jetpack_stopped) { }
                else if (!has_fuel)
                {
index 82baf07bd1fa46b16d853fa019a13bc838257969..4a6dd7aa1ad3629355cbaa0982d6cdea1b53b125 100644 (file)
@@ -262,7 +262,7 @@ void W_Porto_Attack(float type)
        gren.think = W_Porto_Think;
        gren.touch = W_Porto_Touch;
 
-       if(self.items & IT_STRENGTH)
+       if(self.items & ITEM_Strength.m_itemid)
                W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0);
        else
                W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed), 0);
index 6d3d786aecda1de1a1b2c70c697bcb3c3cc3b7a8..038e6432c3d3626eadb77c9e078621fce28be1b1 100644 (file)
@@ -33,6 +33,8 @@
 #include "../common/net_notice.qh"
 #include "../common/physics.qh"
 
+#include "../common/items/all.qc"
+
 #include "../common/triggers/subs.qh"
 #include "../common/triggers/triggers.qh"
 #include "../common/triggers/trigger/secret.qh"
@@ -1480,13 +1482,13 @@ void player_powerups (void)
 
        if (!g_instagib)
        {
-               if (self.items & IT_STRENGTH)
+               if (self.items & ITEM_Strength.m_itemid)
                {
                        play_countdown(self.strength_finished, "misc/poweroff.wav");
                        self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
                        if (time > self.strength_finished)
                        {
-                               self.items = self.items - (self.items & IT_STRENGTH);
+                               self.items = self.items - (self.items & ITEM_Strength.m_itemid);
                                //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_STRENGTH, self.netname);
                                Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_STRENGTH);
                        }
@@ -1495,18 +1497,18 @@ void player_powerups (void)
                {
                        if (time < self.strength_finished)
                        {
-                               self.items = self.items | IT_STRENGTH;
+                               self.items = self.items | ITEM_Strength.m_itemid;
                                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_STRENGTH, self.netname);
                                Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_STRENGTH);
                        }
                }
-               if (self.items & IT_INVINCIBLE)
+               if (self.items & ITEM_Shield.m_itemid)
                {
                        play_countdown(self.invincible_finished, "misc/poweroff.wav");
                        self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
                        if (time > self.invincible_finished)
                        {
-                               self.items = self.items - (self.items & IT_INVINCIBLE);
+                               self.items = self.items - (self.items & ITEM_Shield.m_itemid);
                                //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_SHIELD, self.netname);
                                Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SHIELD);
                        }
@@ -1515,7 +1517,7 @@ void player_powerups (void)
                {
                        if (time < self.invincible_finished)
                        {
-                               self.items = self.items | IT_INVINCIBLE;
+                               self.items = self.items | ITEM_Shield.m_itemid;
                                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SHIELD, self.netname);
                                Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SHIELD);
                        }
@@ -1669,7 +1671,7 @@ void player_regen (void)
                minf = autocvar_g_balance_fuel_regenstable;
                limitf = autocvar_g_balance_fuel_limit;
 
-               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
+               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
        }
 }
 
@@ -2502,8 +2504,8 @@ void PlayerPreThink (void)
                        W_WeaponFrame();
 
                        self.items_added = 0;
-                       if(self.items & IT_JETPACK)
-                               if(self.items & IT_FUEL_REGEN || self.ammo_fuel >= 0.01)
+                       if(self.items & ITEM_Jetpack.m_itemid)
+                               if(self.items & ITEM_JetpackRegen.m_itemid || self.ammo_fuel >= 0.01)
                                        self.items_added |= IT_FUEL;
 
                        self.items |= self.items_added;
index c5bbfcab55ed0f132ece9d8e55d517afac328338..e9ec417412ce9355d8ef2280880547251517a47d 100644 (file)
@@ -819,7 +819,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                if(!g_instagib)
                {
                        // apply strength multiplier
-                       if (attacker.items & IT_STRENGTH)
+                       if (attacker.items & ITEM_Strength.m_itemid)
                        {
                                if(targ == attacker)
                                {
@@ -834,7 +834,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        }
 
                        // apply invincibility multiplier
-                       if (targ.items & IT_INVINCIBLE)
+                       if (targ.items & ITEM_Shield.m_itemid)
                                damage = damage * autocvar_g_balance_powerup_invincible_takedamage;
                }
 
index 2354e128e30bd9d1874e1ca0e57c16ec2f8c07d2..0970d68e6ea4aeded3c781c974bb60d2c5d1b784 100644 (file)
@@ -303,11 +303,11 @@ string formatmessage(string msg)
                                wep = self.cnt;
                        replacement = WEP_NAME(wep);
                } else if (escape == "W") {
-                       if (self.items & IT_SHELLS) replacement = "shells";
-                       else if (self.items & IT_NAILS) replacement = "bullets";
-                       else if (self.items & IT_ROCKETS) replacement = "rockets";
-                       else if (self.items & IT_CELLS) replacement = "cells";
-                       else if (self.items & IT_PLASMA) replacement = "plasma";
+                       if (self.items & ITEM_Shells.m_itemid) replacement = "shells";
+                       else if (self.items & ITEM_Bullets.m_itemid) replacement = "bullets";
+                       else if (self.items & ITEM_Rockets.m_itemid) replacement = "rockets";
+                       else if (self.items & ITEM_Cells.m_itemid) replacement = "cells";
+                       else if (self.items & ITEM_Plasma.m_itemid) replacement = "plasma";
                        else replacement = "batteries"; // ;)
                } else if (escape == "x") {
                        replacement = cursor_ent.netname;
@@ -725,13 +725,13 @@ void readplayerstartcvars()
        }
 
        if (g_jetpack)
-               start_items |= IT_JETPACK;
+               start_items |= ITEM_Jetpack.m_itemid;
 
        MUTATOR_CALLHOOK(SetStartItems);
 
-       if ((start_items & IT_JETPACK) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
+       if ((start_items & ITEM_Jetpack.m_itemid) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
        {
-               start_items |= IT_FUEL_REGEN;
+               start_items |= ITEM_JetpackRegen.m_itemid;
                start_ammo_fuel = max(start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
                warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
        }
index d17dc86a19817e172ce37c554184a9a8a608af01..1cd01be7ecc8aea6f5acd93645f618708422cd0e 100644 (file)
@@ -372,7 +372,7 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype)
                {
                        makevectors((player.v_angle.y * '0 1 0') + (bound(autocvar_g_ctf_throw_angle_min, player.v_angle.x, autocvar_g_ctf_throw_angle_max) * '1 0 0'));
 
-                       flag_velocity = (('0 0 1' * autocvar_g_ctf_throw_velocity_up) + ((v_forward * autocvar_g_ctf_throw_velocity_forward) * ((player.items & IT_STRENGTH) ? autocvar_g_ctf_throw_strengthmultiplier : 1)));
+                       flag_velocity = (('0 0 1' * autocvar_g_ctf_throw_velocity_up) + ((v_forward * autocvar_g_ctf_throw_velocity_forward) * ((player.items & ITEM_Strength.m_itemid) ? autocvar_g_ctf_throw_strengthmultiplier : 1)));
                        flag.velocity = W_CalculateProjectileVelocity(player.velocity, flag_velocity, false);
                        ctf_Handle_Drop(flag, player, droptype);
                        break;
index 61e51451fbaf9d354407568d20706a92b857fa5a..31207be300eb3695a3ed930c990e3dca4d8ec0b7 100644 (file)
@@ -170,7 +170,7 @@ MUTATOR_HOOKFUNCTION(lms_FilterItem)
 MUTATOR_HOOKFUNCTION(lms_ItemTouch)
 {
        // give extra lives for mega health
-       if(self.items & IT_HEALTH)
+       if (self.items & ITEM_HealthMega.m_itemid)
        {
                Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
                PlayerScore_Add(other, SP_LMS_LIVES, autocvar_g_lms_extra_lives);
index 17381d34aba82e5151b09c7d9e4fed29d03f24f7..000eaa5880882aabc61fd7725fb644264b21ddda 100644 (file)
@@ -132,7 +132,7 @@ MUTATOR_HOOKFUNCTION(instagib_MonsterSpawn)
 
 MUTATOR_HOOKFUNCTION(instagib_BotShouldAttack)
 {
-       if(checkentity.items & IT_STRENGTH)
+       if(checkentity.items & ITEM_Strength.m_itemid)
                return true;
 
        return false;
@@ -167,14 +167,14 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups)
        if (!(self.effects & EF_FULLBRIGHT))
                self.effects |= EF_FULLBRIGHT;
 
-       if (self.items & IT_STRENGTH)
+       if (self.items & ITEM_Strength.m_itemid)
        {
                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;
+                       self.items &= ~ITEM_Strength.m_itemid;
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
                }
        }
@@ -184,18 +184,18 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups)
                {
                        self.alpha = autocvar_g_instagib_invis_alpha;
                        self.exteriorweaponentity.alpha = autocvar_g_instagib_invis_alpha;
-                       self.items |= IT_STRENGTH;
+                       self.items |= ITEM_Strength.m_itemid;
                        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)
+       if (self.items & ITEM_Shield.m_itemid)
        {
                play_countdown(self.invincible_finished, "misc/poweroff.wav");
                if (time > self.invincible_finished)
                {
-                       self.items &= ~IT_INVINCIBLE;
+                       self.items &= ~ITEM_Shield.m_itemid;
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
                }
        }
@@ -203,7 +203,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups)
        {
                if (time < self.invincible_finished)
                {
-                       self.items |= IT_INVINCIBLE;
+                       self.items |= ITEM_Shield.m_itemid;
                        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, self.netname);
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SPEED);
                }
@@ -213,7 +213,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerPowerups)
 
 MUTATOR_HOOKFUNCTION(instagib_PlayerPhysics)
 {
-       if(self.items & IT_INVINCIBLE)
+       if(self.items & ITEM_Shield.m_itemid)
                self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_instagib_speed_highspeed;
 
        return false;
@@ -290,7 +290,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
                frag_mirrordamage = 0;
        }
 
-       if((frag_target.buffs & BUFF_INVISIBLE) || (frag_target.items & IT_STRENGTH))
+       if((frag_target.buffs & BUFF_INVISIBLE) || (frag_target.items & ITEM_Strength.m_itemid))
                yoda = 1;
 
        return false;
@@ -355,7 +355,7 @@ MUTATOR_HOOKFUNCTION(instagib_CustomizeWaypoint)
 
        // 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((self.owner.flags & FL_CLIENT) && (self.owner.items & ITEM_Strength.m_itemid) && (e == other))
        if(DIFF_TEAM(self.owner, e))
                return true;
 
@@ -364,11 +364,11 @@ MUTATOR_HOOKFUNCTION(instagib_CustomizeWaypoint)
 
 MUTATOR_HOOKFUNCTION(instagib_ItemCountdown)
 {
-       switch(self.items)
+       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;
+               case ITEM_Strength.m_itemid:  item_name = "item-invis";     item_color = '0 0 1'; break;
+               case ITEM_ExtraLife.m_itemid: item_name = "item-extralife"; item_color = '1 0 0'; break;
+               case ITEM_Shield.m_itemid:    item_name = "item-speed";     item_color = '1 0 1'; break;
        }
        return false;
 }
index ed7cd2074620616546212f546090a41c7d1fd685..c77bba51630a59378bbfe02a0714d7ce32413391 100644 (file)
@@ -19,8 +19,8 @@ MUTATOR_HOOKFUNCTION(melee_FilterItem)
 {
        switch (self.items)
        {
-               case IT_5HP:
-               case IT_ARMOR_SHARD:
+               case ITEM_HealthSmall.m_itemid:
+               case ITEM_ArmorSmall.m_itemid:
                        return false;
        }
 
index 292bba261aad86083993bc4b699209d9e7f04db5..7362abaeba8b90625a1a60b3e392e7ce7cfe1778 100644 (file)
@@ -803,7 +803,7 @@ void nade_prime()
        n.classname = "nade";
        fn.classname = "fake_nade";
 
-       if(self.items & IT_STRENGTH && autocvar_g_nades_bonus_onstrength)
+       if(self.items & ITEM_Strength.m_itemid && autocvar_g_nades_bonus_onstrength)
                n.nade_type = self.nade_type;
        else if (self.bonus_nades >= 1)
        {
index 42a490b00e8befbf5bc4542200ecc86358155ec1..ecf07cb7875ee53582e34cd478608abe664284a1 100644 (file)
@@ -180,16 +180,19 @@ MUTATOR_HOOKFUNCTION(nix_FilterItem)
 {
        switch (self.items)
        {
-               case IT_HEALTH:
-               case IT_5HP:
-               case IT_25HP:
-               case IT_ARMOR:
-               case IT_ARMOR_SHARD:
+               case ITEM_HealthSmall.m_itemid:
+               case ITEM_HealthMedium.m_itemid:
+               case ITEM_HealthLarge.m_itemid:
+               case ITEM_HealthMega.m_itemid:
+               case ITEM_ArmorSmall.m_itemid:
+               case ITEM_ArmorMedium.m_itemid:
+               case ITEM_ArmorLarge.m_itemid:
+               case ITEM_ArmorMega.m_itemid:
                        if (autocvar_g_nix_with_healtharmor)
                                return 0;
                        break;
-               case IT_STRENGTH:
-               case IT_INVINCIBLE:
+               case ITEM_Strength.m_itemid:
+               case ITEM_Shield.m_itemid:
                        if (autocvar_g_nix_with_powerups)
                                return 0;
                        break;
index 39b244a724ef97116cf988d0d186730cd72ae497..75c7b41c480a85427c4fb0767a9ca3c041c39483 100644 (file)
@@ -114,7 +114,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerRegen)
                minf = autocvar_g_balance_fuel_regenstable;
                limitf = autocvar_g_balance_fuel_limit;
 
-               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
+               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
        }
        return true; // return true anyway, as frozen uses no regen
 }
@@ -256,8 +256,8 @@ MUTATOR_HOOKFUNCTION(ok_ItemRemove)
 
        switch(self.items)
        {
-               case IT_HEALTH: return !(autocvar_g_overkill_100h_anyway);
-               case IT_ARMOR: return !(autocvar_g_overkill_100a_anyway);
+               case ITEM_HealthMega.m_itemid: return !(autocvar_g_overkill_100h_anyway);
+               case ITEM_ArmorMega.m_itemid: return !(autocvar_g_overkill_100a_anyway);
        }
 
        return true;
index 873f7a53c1f89159e32534626b6609221d15bd23..459e68a93a72224fe2748631ee1dadde33a89a59 100644 (file)
@@ -384,7 +384,7 @@ void Item_Show (entity e, float mode)
                e.ItemStatus &= ~ITS_AVAILABLE;
        }
 
-       if (e.items & IT_STRENGTH || e.items & IT_INVINCIBLE)
+       if (e.items & ITEM_Strength.m_itemid || e.items & ITEM_Shield.m_itemid)
            e.ItemStatus |= ITS_POWERUP;
 
        if (autocvar_g_nodepthtestitems)
@@ -590,9 +590,9 @@ void Item_Respawn (void)
 {
        Item_Show(self, 1);
        // this is ugly...
-       if(self.items == IT_STRENGTH)
+       if(self.items == ITEM_Strength.m_itemid)
                sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTEN_NORM);    // play respawn sound
-       else if(self.items == IT_INVINCIBLE)
+       else if(self.items == ITEM_Shield.m_itemid)
                sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTEN_NORM);      // play respawn sound
        else
                sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
@@ -629,17 +629,17 @@ void Item_RespawnCountdown (void)
                        string name;
                        vector rgb = '1 0 1';
                        name = string_null;
-                       switch(self.items)
+                       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_STRENGTH:   name = "item-strength"; rgb = '0 0 1'; break;
-                               case IT_INVINCIBLE: name = "item-shield"; rgb = '1 0 1'; break;
-                               case IT_HEALTH:
+                               case ITEM_JetpackRegen.m_itemid: name = "item-fuelregen"; rgb = '1 0.5 0'; break;
+                               case ITEM_Jetpack.m_itemid:    name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
+                               case ITEM_Strength.m_itemid:   name = "item-strength"; rgb = '0 0 1'; break;
+                               case ITEM_Shield.m_itemid: name = "item-shield"; rgb = '1 0 1'; break;
+                               case ITEM_HealthMega.m_itemid:
                                        //if (self.classname == "item_health_mega")
                                                {name = "item_health_mega"; rgb = '1 0 0';}
                                        break;
-                               case IT_ARMOR:
+                               case ITEM_ArmorMega.m_itemid:
                                        if (self.classname == "item_armor_large")
                                                {name = "item_armor_large"; rgb = '0 1 0';}
                                        break;
@@ -1085,17 +1085,17 @@ float commodity_pickupevalfunc(entity player, entity item)
                if (!(player.weapons & WepSet_FromWeapon(i)))
                        continue;
 
-               if(wi.items & IT_SHELLS)
+               if(wi.items & ITEM_Shells.m_itemid)
                        need_shells = true;
-               else if(wi.items & IT_NAILS)
+               else if(wi.items & ITEM_Bullets.m_itemid)
                        need_nails = true;
-               else if(wi.items & IT_ROCKETS)
+               else if(wi.items & ITEM_Rockets.m_itemid)
                        need_rockets = true;
-               else if(wi.items & IT_CELLS)
+               else if(wi.items & ITEM_Cells.m_itemid)
                        need_cells = true;
-               else if(wi.items & IT_PLASMA)
+               else if(wi.items & ITEM_Plasma.m_itemid)
                        need_plasma = true;
-               else if(wi.items & IT_FUEL)
+               else if(wi.items & ITEM_JetpackFuel.m_itemid)
                        need_fuel = true;
        }
 
@@ -1288,9 +1288,9 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                precache_sound (self.item_pickupsound);
 
                precache_sound ("misc/itemrespawncountdown.wav");
-               if(itemid == IT_STRENGTH)
+               if(itemid == ITEM_Strength.m_itemid)
                        precache_sound ("misc/strength_respawn.wav");
-               else if(itemid == IT_INVINCIBLE)
+               else if(itemid == ITEM_Shield.m_itemid)
                        precache_sound ("misc/shield_respawn.wav");
                else
                        precache_sound ("misc/itemrespawn.wav");
@@ -1460,7 +1460,7 @@ void spawnfunc_item_armor_big (void) {
                self.max_armorvalue = g_pickup_armorbig_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorbig_anyway;
-       StartItemA (ITEM_ArmorBig);
+       StartItemA (ITEM_ArmorLarge);
 }
 
 void spawnfunc_item_armor_large (void) {
@@ -1470,7 +1470,7 @@ void spawnfunc_item_armor_large (void) {
                self.max_armorvalue = g_pickup_armorlarge_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorlarge_anyway;
-       StartItemA (ITEM_ArmorLarge);
+       StartItemA (ITEM_ArmorMega);
 }
 
 void spawnfunc_item_health_small (void) {
@@ -1593,11 +1593,11 @@ void spawnfunc_target_items (void)
                        if     (argv(i) == "unlimited_ammo")         self.items |= IT_UNLIMITED_AMMO;
                        else if(argv(i) == "unlimited_weapon_ammo")  self.items |= IT_UNLIMITED_WEAPON_AMMO;
                        else if(argv(i) == "unlimited_superweapons") self.items |= IT_UNLIMITED_SUPERWEAPONS;
-                       else if(argv(i) == "strength")               self.items |= IT_STRENGTH;
-                       else if(argv(i) == "invincible")             self.items |= IT_INVINCIBLE;
+                       else if(argv(i) == "strength")               self.items |= ITEM_Strength.m_itemid;
+                       else if(argv(i) == "invincible")             self.items |= ITEM_Shield.m_itemid;
                        else if(argv(i) == "superweapons")           self.items |= IT_SUPERWEAPON;
-                       else if(argv(i) == "jetpack")                self.items |= IT_JETPACK;
-                       else if(argv(i) == "fuel_regen")             self.items |= IT_FUEL_REGEN;
+                       else if(argv(i) == "jetpack")                self.items |= ITEM_Jetpack.m_itemid;
+                       else if(argv(i) == "fuel_regen")             self.items |= ITEM_JetpackRegen.m_itemid;
                        else
                        {
                                for(j = WEP_FIRST; j <= WEP_LAST; ++j)
@@ -1647,11 +1647,11 @@ void spawnfunc_target_items (void)
                self.netname = "";
                self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_UNLIMITED_WEAPON_AMMO), "unlimited_weapon_ammo");
                self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
-               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.strength_finished * !!(self.items & IT_STRENGTH), "strength");
-               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.invincible_finished * !!(self.items & IT_INVINCIBLE), "invincible");
+               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.strength_finished * !!(self.items & ITEM_Strength.m_itemid), "strength");
+               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.invincible_finished * !!(self.items & ITEM_Shield.m_itemid), "invincible");
                self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.superweapons_finished * !!(self.items & IT_SUPERWEAPON), "superweapons");
-               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_JETPACK), "jetpack");
-               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_FUEL_REGEN), "fuel_regen");
+               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & ITEM_Jetpack.m_itemid), "jetpack");
+               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & ITEM_JetpackRegen.m_itemid), "fuel_regen");
                if(self.ammo_shells != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_shells), "shells");
                if(self.ammo_nails != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_nails), "nails");
                if(self.ammo_rockets != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_rockets), "rockets");
@@ -1696,7 +1696,7 @@ void spawnfunc_item_fuel(void)
 
 void spawnfunc_item_fuel_regen(void)
 {
-       if(start_items & IT_FUEL_REGEN)
+       if(start_items & ITEM_JetpackRegen.m_itemid)
        {
                spawnfunc_item_fuel();
                return;
@@ -1708,7 +1708,7 @@ void spawnfunc_item_jetpack(void)
 {
        if(!self.ammo_fuel)
                self.ammo_fuel = g_pickup_fuel_jetpack;
-       if(start_items & IT_JETPACK)
+       if(start_items & ITEM_Jetpack.m_itemid)
        {
                spawnfunc_item_fuel();
                return;
@@ -1888,13 +1888,13 @@ float GiveItems(entity e, float beginarg, float endarg)
                                op = OP_MINUS;
                                continue;
                        case "ALL":
-                               got += GiveBit(e, items, IT_FUEL_REGEN, op, val);
+                               got += GiveBit(e, items, ITEM_JetpackRegen.m_itemid, op, val);
                                got += GiveValue(e, strength_finished, op, val);
                                got += GiveValue(e, invincible_finished, op, val);
                                got += GiveValue(e, superweapons_finished, op, val);
                                got += GiveBit(e, items, IT_UNLIMITED_AMMO, op, val);
                        case "all":
-                               got += GiveBit(e, items, IT_JETPACK, op, val);
+                               got += GiveBit(e, items, ITEM_Jetpack.m_itemid, op, val);
                                got += GiveValue(e, health, op, val);
                                got += GiveValue(e, armorvalue, op, val);
                        case "allweapons":
@@ -1923,10 +1923,10 @@ float GiveItems(entity e, float beginarg, float endarg)
                                got += GiveBit(e, items, IT_UNLIMITED_SUPERWEAPONS, op, val);
                                break;
                        case "jetpack":
-                               got += GiveBit(e, items, IT_JETPACK, op, val);
+                               got += GiveBit(e, items, ITEM_Jetpack.m_itemid, op, val);
                                break;
                        case "fuel_regen":
-                               got += GiveBit(e, items, IT_FUEL_REGEN, op, val);
+                               got += GiveBit(e, items, ITEM_JetpackRegen.m_itemid, op, val);
                                break;
                        case "strength":
                                got += GiveValue(e, strength_finished, op, val);
@@ -1980,10 +1980,10 @@ float GiveItems(entity e, float beginarg, float endarg)
                op = OP_SET;
        }
 
-       POSTGIVE_BIT(e, items, IT_FUEL_REGEN, "misc/itempickup.wav", string_null);
+       POSTGIVE_BIT(e, items, ITEM_JetpackRegen.m_itemid, "misc/itempickup.wav", string_null);
        POSTGIVE_BIT(e, items, IT_UNLIMITED_SUPERWEAPONS, "misc/powerup.wav", "misc/poweroff.wav");
        POSTGIVE_BIT(e, items, IT_UNLIMITED_WEAPON_AMMO, "misc/powerup.wav", "misc/poweroff.wav");
-       POSTGIVE_BIT(e, items, IT_JETPACK, "misc/itempickup.wav", string_null);
+       POSTGIVE_BIT(e, items, ITEM_Jetpack.m_itemid, "misc/itempickup.wav", string_null);
        for(j = WEP_FIRST; j <= WEP_LAST; ++j)
        {
                wi = get_weaponinfo(j);
index cf49b54f8b0b169e5702d4e0a010a64af51e6fc5..8e19fb53df96d98cb53e5e7268d35df714669239 100644 (file)
@@ -28,7 +28,7 @@ void W_GiveWeapon (entity e, float wep)
 
 void W_PlayStrengthSound(entity player) // void W_PlayStrengthSound
 {
-       if((player.items & IT_STRENGTH)
+       if((player.items & ITEM_Strength.m_itemid)
                && ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
                || (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
                {