3 #include <common/items/all.qh>
4 #include <common/mutators/mutator/powerups/powerups.qh>
7 #include <common/constants.qh>
8 #include <server/items/items.qh>
12 MODEL(Shield_ITEM, Item_Model("g_invincible.md3"));
13 SOUND(Shield, Item_Sound("powerup_shield"));
17 float autocvar_g_balance_powerup_invincible_takedamage;
18 float autocvar_g_balance_powerup_invincible_takeforce = 0.33;
19 float autocvar_g_balance_powerup_invincible_time;
20 void powerup_shield_init(Pickup this, entity item)
22 if(!item.invincible_finished)
23 item.invincible_finished = autocvar_g_balance_powerup_invincible_time;
26 REGISTER_ITEM(Shield, Powerup) {
27 this.m_canonical_spawnfunc = "item_shield";
29 this.spawnflags = ITEM_FLAG_NORMAL;
30 this.m_model = MDL_Shield_ITEM;
31 this.m_sound = SND_Shield;
33 this.m_respawnsound = SND_SHIELD_RESPAWN;
35 this.netname = "invincible";
36 this.m_name = _("Shield");
37 this.m_icon = "shield";
38 this.m_color = '1 0 1';
39 this.m_waypoint = _("Shield");
40 this.m_waypointblink = 2;
42 this.m_itemid = IT_INVINCIBLE;
45 this.m_iteminit = powerup_shield_init;
49 SPAWNFUNC_ITEM(item_shield, ITEM_Shield)
50 SPAWNFUNC_ITEM(item_invincible, ITEM_Shield)
52 CLASS(Shield, Powerups)
53 ATTRIB(Shield, netname, string, "shield");
54 ATTRIB(Shield, m_name, string, _("Shield"));
55 ATTRIB(Shield, m_icon, string, "shield");
57 REGISTER_STATUSEFFECT(Shield, NEW(Shield));