]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
GetResourceAmount --> GetResource, SetResourceAmount --> SetResource
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / sv_instagib.qc
index d518665d2d3a1e72079c42e0458ec09a6a24f06c..fc571678b2c7f22ea1032f2f4a3d6e580cc83a02 100644 (file)
@@ -82,7 +82,7 @@ void instagib_ammocheck(entity this)
 
        if(IS_DEAD(this) || game_stopped)
                instagib_stop_countdown(this);
-       else if (GetResourceAmount(this, RES_CELLS) > 0 || (this.items & IT_UNLIMITED_WEAPON_AMMO) || (this.flags & FL_GODMODE))
+       else if (GetResource(this, RES_CELLS) > 0 || (this.items & IT_UNLIMITED_WEAPON_AMMO) || (this.flags & FL_GODMODE))
                instagib_stop_countdown(this);
        else if(autocvar_g_rm && autocvar_g_rm_laser)
        {
@@ -94,7 +94,7 @@ void instagib_ammocheck(entity this)
        }
        else
        {
-               float hp = GetResourceAmount(this, RES_HEALTH);
+               float hp = GetResource(this, RES_HEALTH);
                this.instagib_needammo = true;
                if (hp <= 5)
                {
@@ -328,11 +328,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, Damage_Calculate)
                        if(!autocvar_g_instagib_friendlypush && SAME_TEAM(frag_target, frag_attacker))
                                frag_force = '0 0 0';
 
-                       float armor = GetResourceAmount(frag_target, RES_ARMOR);
+                       float armor = GetResource(frag_target, RES_ARMOR);
                        if(armor)
                        {
                                armor -= 1;
-                               SetResourceAmount(frag_target, RES_ARMOR, armor);
+                               SetResource(frag_target, RES_ARMOR, armor);
                                frag_damage = 0;
                                frag_target.damage_dealt += 1;
                                frag_attacker.damage_dealt += 1;
@@ -353,7 +353,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, Damage_Calculate)
 
                                if(frag_target != frag_attacker)
                                {
-                                       if(frag_damage <= 0 && GetResourceAmount(frag_target, RES_HEALTH) > 0) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); }
+                                       if(frag_damage <= 0 && GetResource(frag_target, RES_HEALTH) > 0) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); }
                                        if(!autocvar_g_instagib_blaster_keepforce)
                                                frag_force = '0 0 0';
                                }
@@ -366,11 +366,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, Damage_Calculate)
        if(frag_mirrordamage > 0)
        {
                // just lose extra LIVES, don't kill the player for mirror damage
-               float armor = GetResourceAmount(frag_attacker, RES_ARMOR);
+               float armor = GetResource(frag_attacker, RES_ARMOR);
                if(armor > 0)
                {
                        armor -= 1;
-                       SetResourceAmount(frag_attacker, RES_ARMOR, armor);
+                       SetResource(frag_attacker, RES_ARMOR, armor);
                        Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, armor);
                        frag_attacker.damage_dealt += frag_mirrordamage;
                }
@@ -458,7 +458,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem)
 
        if(item.weapon == WEP_VAPORIZER.m_id && Item_IsLoot(item))
        {
-               SetResourceAmount(item, RES_CELLS, autocvar_g_instagib_ammo_drop);
+               SetResource(item, RES_CELLS, autocvar_g_instagib_ammo_drop);
                return false;
        }
 
@@ -471,9 +471,9 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem)
        if(item.flags & FL_POWERUP)
                return false;
 
-       float cells = GetResourceAmount(item, RES_CELLS);
+       float cells = GetResource(item, RES_CELLS);
        if(cells > autocvar_g_instagib_ammo_drop && item.classname != "item_vaporizer_cells")
-               SetResourceAmount(item, RES_CELLS, autocvar_g_instagib_ammo_drop);
+               SetResource(item, RES_CELLS, autocvar_g_instagib_ammo_drop);
 
        if(cells && !item.weapon)
                return false;
@@ -508,10 +508,10 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch)
        entity item = M_ARGV(0, entity);
        entity toucher = M_ARGV(1, entity);
 
-       if(GetResourceAmount(item, RES_CELLS))
+       if(GetResource(item, RES_CELLS))
        {
                // play some cool sounds ;)
-               float hp = GetResourceAmount(toucher, RES_HEALTH);
+               float hp = GetResource(toucher, RES_HEALTH);
                if (IS_CLIENT(toucher))
                {
                        if(hp <= 5)
@@ -521,7 +521,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch)
                }
 
                if(hp < 100)
-                       SetResourceAmount(toucher, RES_HEALTH, 100);
+                       SetResource(toucher, RES_HEALTH, 100);
 
                return MUT_ITEMTOUCH_CONTINUE;
        }