]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh
Enable speed and invisibility powerups to spawn, with (temporary) relic models
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / powerups / powerup / invisibility.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(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 float autocvar_g_balance_powerup_invisibility_alpha = 0.15;
20 float autocvar_g_balance_powerup_invisibility_time = 30;
21 void powerup_invisibility_init(Pickup this, entity item)
22 {
23     if(!item.invisibility_finished)
24         item.invisibility_finished = autocvar_g_balance_powerup_invisibility_time;
25 }
26 #endif
27 REGISTER_ITEM(Invisibility, Powerup) {
28     this.m_canonical_spawnfunc = "item_invisibility";
29 #ifdef GAMEQC
30     this.spawnflags = ITEM_FLAG_NORMAL;
31 //    this.m_model            =   MDL_Invisibility_ITEM; // TODO: new model required
32     this.m_model            =   MDL_BUFF;
33     this.m_skin             =   12;
34     this.m_sound            =   SND_Invisibility;
35     this.m_glow             =   true;
36     this.m_respawnsound     =   SND_STRENGTH_RESPAWN;
37 #endif
38     this.netname            =   "invisibility";
39     this.m_name             =   _("Invisibility");
40     this.m_icon             =   "buff_invisible";
41     this.m_color            =   '0.5 0.5 1';
42     this.m_waypoint         =   _("Invisibility");
43     this.m_waypointblink    =   2;
44 #ifdef GAMEQC
45     this.m_itemid           =   IT_INVISIBILITY;
46 #endif
47 #ifdef SVQC
48     this.m_iteminit         =   powerup_invisibility_init;
49 #endif
50 }
51
52 SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility)
53 // compat
54 SPAWNFUNC_ITEM(item_invis, ITEM_Invisibility)
55
56 CLASS(Invisibility, Powerups)
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));