]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/powerups/powerup/speed.qh
Remove weapon projectile speed modifications from the speed powerup to improve the...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / powerups / powerup / speed.qh
1 #pragma once
2
3 #include <common/items/all.qh>
4 #include <common/mutators/mutator/powerups/powerups.qh>
5 #ifdef SVQC
6     // For FL_POWERUP
7     #include <common/constants.qh>
8     #include <server/items/items.qh>
9 #endif
10
11 #ifdef GAMEQC
12 MODEL(Speed_ITEM, Item_Model("g_invincible.md3"));
13 SOUND(Speed, Item_Sound("powerup_shield"));
14 #endif
15
16 #ifdef SVQC
17 .float speed_finished;
18
19 float autocvar_g_balance_powerup_speed_attackrate = 0.8;
20 float autocvar_g_balance_powerup_speed_highspeed = 1.5;
21 float autocvar_g_balance_powerup_speed_time = 30;
22 void powerup_speed_init(Pickup this, entity item)
23 {
24     if(!item.speed_finished)
25         item.speed_finished = autocvar_g_balance_powerup_speed_time;
26 }
27 #endif
28 REGISTER_ITEM(Speed, Powerup) {
29     this.m_canonical_spawnfunc = "item_speed";
30 #ifdef GAMEQC
31         this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; // TODO: ITEM_FLAG_NORMAL (once it has a model!)
32     this.m_model            =   MDL_Speed_ITEM;
33     this.m_sound            =   SND_Speed;
34     this.m_glow             =   true;
35     this.m_respawnsound     =   SND_SHIELD_RESPAWN;
36 #endif
37     this.netname            =   "speed";
38     this.m_name             =   _("Speed");
39     this.m_icon             =   "buff_speed";
40     this.m_color            =   '0.1 1 0.84';
41     this.m_waypoint         =   _("Speed");
42     this.m_waypointblink    =   2;
43 #ifdef GAMEQC
44     this.m_itemid           =   IT_SPEED;
45 #endif
46 #ifdef SVQC
47     this.m_iteminit         =   powerup_speed_init;
48 #endif
49 }
50
51 SPAWNFUNC_ITEM(item_speed, ITEM_Speed)
52 // compat
53 SPAWNFUNC_ITEM(item_haste, ITEM_Speed)
54 SPAWNFUNC_ITEM(item_scout, ITEM_Speed)
55
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");
61 ENDCLASS(Speed)
62 REGISTER_STATUSEFFECT(Speed, NEW(Speed));