Xonotic
invisibility.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(Invisibility_ITEM, Item_Model("g_strength.md3")); // TODO: new model required
13 SOUND(Invisibility, Item_Sound("powerup"));
14 #endif
15 
16 #ifdef SVQC
17 .float invisibility_finished;
18 
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)
23 {
24  if(!item.invisibility_finished)
25  item.invisibility_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invisibility_time;
26 }
27 #endif
29  this.m_canonical_spawnfunc = "item_invisibility";
30 #ifdef SVQC
31  if(autocvar_g_powerups_invisibility)
33  else
35 
36  this.m_iteminit = powerup_invisibility_init;
37 #endif
38 #ifdef GAMEQC
40  this.m_model = MDL_BUFF; // TODO: MDL_Invisibility_ITEM when new model available
41  this.m_skin = 12;
42  this.m_sound = SND_Invisibility;
43  this.m_glow = true;
44  this.m_respawnsound = SND_STRENGTH_RESPAWN;
45 #endif
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;
52 }
53 
54 SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility)
55 
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));
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
entity() spawn
string netname
Definition: powerups.qc:20
int m_itemid
Definition: jetpack.qh:11
Definition: pickup.qh:22
float spawnflags
Definition: progsdefs.qc:191
string Item_Sound(string it_snd)
Definition: all.qc:18
REGISTER_STATUSEFFECT(Invisibility, NEW(Invisibility))
#define ATTRIB(...)
Definition: oo.qh:136
float IT_INVISIBILITY
Definition: progsdefs.qc:310
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define ENDCLASS(cname)
Definition: oo.qh:269
#define SOUND(name, path)
Definition: all.qh:30
REGISTER_ITEM(Invisibility, Powerup)
Definition: invisibility.qh:28
string m_name
Definition: scores.qh:135