Xonotic
strength.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(Strength_ITEM, Item_Model("g_strength.md3"));
13 SOUND(Strength, Item_Sound("powerup"));
14 #endif
15 
16 #ifdef SVQC
17 bool autocvar_g_powerups_strength = 1;
18 float autocvar_g_balance_powerup_strength_damage;
19 float autocvar_g_balance_powerup_strength_force;
20 float autocvar_g_balance_powerup_strength_selfdamage;
21 float autocvar_g_balance_powerup_strength_selfforce;
22 float autocvar_g_balance_powerup_strength_time;
23 void powerup_strength_init(Pickup this, entity item)
24 {
25  if(!item.strength_finished)
26  item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time;
27 }
28 #endif
30  this.m_canonical_spawnfunc = "item_strength";
31 #ifdef SVQC
32  if(autocvar_g_powerups_strength)
34  else
36 
37  this.m_iteminit = powerup_strength_init;
38 #endif
39 #ifdef GAMEQC
40  this.m_itemid = IT_STRENGTH;
41  this.m_model = MDL_Strength_ITEM;
42  this.m_sound = SND_Strength;
43  this.m_glow = true;
44  this.m_respawnsound = SND_STRENGTH_RESPAWN;
45 #endif
46  this.netname = "strength";
47  this.m_name = _("Strength");
48  this.m_icon = "strength";
49  this.m_color = '0 0 1';
50  this.m_waypoint = _("Strength");
51  this.m_waypointblink = 2;
52 }
53 
54 SPAWNFUNC_ITEM(item_strength, ITEM_Strength)
55 
57  ATTRIB(Strength, netname, string, "strength");
58  ATTRIB(Strength, m_name, string, _("Strength"));
59  ATTRIB(Strength, m_icon, string, "strength");
60 ENDCLASS(Strength)
61 REGISTER_STATUSEFFECT(Strength, NEW(Strength));
Item is usable during normal gameplay.
Definition: item.qh:98
#define NEW(cname,...)
Definition: oo.qh:105
CLASS(Object) Object
Definition: oo.qh:318
SPAWNFUNC_ITEM(item_armor_green, ITEM_ArmorMedium) .float wait
float strength
Definition: impulse.qh:13
entity() spawn
string netname
Definition: powerups.qc:20
int m_itemid
Definition: jetpack.qh:11
Definition: pickup.qh:22
REGISTER_ITEM(Strength, Powerup)
Definition: strength.qh:29
float spawnflags
Definition: progsdefs.qc:191
string Item_Sound(string it_snd)
Definition: all.qc:18
#define ATTRIB(...)
Definition: oo.qh:136
REGISTER_STATUSEFFECT(Strength, NEW(Strength))
#define MODEL(name, path)
Definition: all.qh:8
#define ENDCLASS(cname)
Definition: oo.qh:269
string Item_Model(string item_mdl)
Definition: all.qc:8
#define SOUND(name, path)
Definition: all.qh:30
string m_name
Definition: scores.qh:135