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(Invisibility_ITEM, Item_Model("g_strength.md3")); // TODO: new model required
13 SOUND(Invisibility, Item_Sound("powerup"));
17 .float invisibility_finished;
19 bool autocvar_g_powerups_invisibility = 1;
20 float autocvar_g_balance_powerup_invisibility_alpha = 0.15;
21 float autocvar_g_balance_powerup_invisibility_time = 30;
22 void powerup_invisibility_init(Pickup this, entity item)
24 if(autocvar_g_powerups_invisibility)
25 this.spawnflags = ITEM_FLAG_NORMAL;
27 this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
29 if(!item.invisibility_finished)
30 item.invisibility_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invisibility_time;
33 REGISTER_ITEM(Invisibility, Powerup) {
34 this.m_canonical_spawnfunc = "item_invisibility";
36 this.m_iteminit = powerup_invisibility_init;
39 this.m_itemid = IT_INVISIBILITY;
40 this.m_model = MDL_BUFF; // TODO: MDL_Invisibility_ITEM when new model available
42 this.m_sound = SND_Invisibility;
44 this.m_respawnsound = SND_STRENGTH_RESPAWN;
46 this.netname = "invisibility";
47 this.m_name = _("Invisibility");
48 this.m_icon = "buff_invisible";
49 this.m_color = '0.5 0.5 1';
50 this.m_waypoint = _("Invisibility");
51 this.m_waypointblink = 2;
54 SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility)
56 CLASS(Invisibility, Powerups)
57 ATTRIB(Invisibility, netname, string, "invisibility");
58 ATTRIB(Invisibility, m_name, string, _("Invisibility"));
59 ATTRIB(Invisibility, m_color, vector, '0.5 0.5 1');
60 ATTRIB(Invisibility, m_icon, string, "buff_invisible");
61 ENDCLASS(Invisibility)
62 REGISTER_STATUSEFFECT(Invisibility, NEW(Invisibility));