Xonotic
speed.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/items/all.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")); // TODO: new model required
13 SOUND(Speed, Item_Sound("powerup_shield"));
14 #endif
15 
16 #ifdef SVQC
17 .float speed_finished;
18 
19 bool autocvar_g_powerups_speed = 1;
20 float autocvar_g_balance_powerup_speed_attackrate = 0.8;
21 float autocvar_g_balance_powerup_speed_highspeed = 1.5;
22 float autocvar_g_balance_powerup_speed_time = 30;
23 void powerup_speed_init(Pickup this, entity item)
24 {
25  if(!item.speed_finished)
26  item.speed_finished = (item.count) ? item.count : autocvar_g_balance_powerup_speed_time;
27 }
28 #endif
30  this.m_canonical_spawnfunc = "item_speed";
31 #ifdef SVQC
32  if(autocvar_g_powerups_speed)
34  else
36 
37  this.m_iteminit = powerup_speed_init;
38 #endif
39 #ifdef GAMEQC
40  this.m_itemid = IT_SPEED;
41  this.m_model = MDL_BUFF; // TODO: MDL_Speed_ITEM when new model available
42  this.m_skin = 9;
43  this.m_sound = SND_Speed;
44  this.m_glow = true;
45  this.m_respawnsound = SND_SHIELD_RESPAWN;
46 #endif
47  this.netname = "speed";
48  this.m_name = _("Speed");
49  this.m_icon = "buff_speed";
50  this.m_color = '0.1 1 0.84';
51  this.m_waypoint = _("Speed");
52  this.m_waypointblink = 2;
53 }
54 
55 SPAWNFUNC_ITEM(item_speed, ITEM_Speed)
56 
58  ATTRIB(Speed, netname, string, "speed");
59  ATTRIB(Speed, m_name, string, _("Speed"));
60  ATTRIB(Speed, m_color, vector, '0.1 1 0.84');
61  ATTRIB(Speed, m_icon, string, "buff_speed");
62 ENDCLASS(Speed)
63 REGISTER_STATUSEFFECT(Speed, NEW(Speed));
Item is usable during normal gameplay.
Definition: item.qh:98
float speed
Definition: subs.qh:41
#define NEW(cname,...)
Definition: oo.qh:105
CLASS(Object) Object
Definition: oo.qh:318
SPAWNFUNC_ITEM(item_armor_green, ITEM_ArmorMedium) .float wait
entity() spawn
string netname
Definition: powerups.qc:20
int m_itemid
Definition: jetpack.qh:11
REGISTER_STATUSEFFECT(Speed, NEW(Speed))
Definition: pickup.qh:22
Definition: speed.qh:57
float spawnflags
Definition: progsdefs.qc:191
string Item_Sound(string it_snd)
Definition: all.qc:18
#define ATTRIB(...)
Definition: oo.qh:136
REGISTER_ITEM(Speed, Powerup)
Definition: speed.qh:29
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define ENDCLASS(cname)
Definition: oo.qh:269
#define SOUND(name, path)
Definition: all.qh:30
string m_name
Definition: scores.qh:135