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(Speed_ITEM, Item_Model("g_invincible.md3")); // TODO: new model required
13 SOUND(Speed, Item_Sound("powerup_shield"));
17 .float speed_finished;
19 bool autocvar_g_powerups_speed;
20 float autocvar_g_balance_powerup_speed_attackrate;
21 float autocvar_g_balance_powerup_speed_highspeed;
22 float autocvar_g_balance_powerup_speed_time;
23 void powerup_speed_init(Pickup def, entity item)
25 if(!autocvar_g_powerups || !autocvar_g_powerups_speed)
26 def.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
28 if(!item.speed_finished)
29 item.speed_finished = (item.count) ? item.count : autocvar_g_balance_powerup_speed_time;
32 REGISTER_ITEM(Speed, Powerup) {
33 this.m_canonical_spawnfunc = "item_speed";
35 this.m_iteminit = powerup_speed_init;
38 this.spawnflags = ITEM_FLAG_NORMAL;
39 this.m_itemid = IT_SPEED;
40 this.m_model = MDL_BUFF; // TODO: MDL_Speed_ITEM when new model available
42 this.m_sound = SND_Speed;
44 this.m_respawnsound = SND_SHIELD_RESPAWN;
46 this.netname = "speed";
47 this.m_name = _("Speed");
48 this.m_icon = "buff_speed";
49 this.m_color = '0.1 1 0.84';
50 this.m_waypoint = _("Speed");
51 this.m_waypointblink = 2;
54 SPAWNFUNC_ITEM(item_speed, ITEM_Speed)
56 CLASS(Speed, Powerups)
57 ATTRIB(Speed, netname, string, "speed");
58 ATTRIB(Speed, m_name, string, _("Speed"));
59 ATTRIB(Speed, m_color, vector, '0.1 1 0.84');
60 ATTRIB(Speed, m_icon, string, "buff_speed");
62 REGISTER_STATUSEFFECT(Speed, NEW(Speed));