]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/powerup.qh
Merge branch 'master' into Mario/killsound
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / powerup.qh
1 #pragma once
2
3 #ifdef SVQC
4     // For FL_POWERUP
5     #include <server/constants.qh>
6 #endif
7
8 #include "pickup.qh"
9 CLASS(Powerup, Pickup)
10 #ifdef SVQC
11     ATTRIB(Powerup, m_mins, vector, '-16 -16 0');
12     ATTRIB(Powerup, m_maxs, vector, '16 16 80');
13     ATTRIB(Powerup, m_botvalue, int, 20000);
14     ATTRIB(Powerup, m_itemflags, int, FL_POWERUP);
15     ATTRIB(Powerup, m_respawntime, float(), GET(g_pickup_respawntime_powerup));
16     ATTRIB(Powerup, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_powerup));
17 #endif
18 ENDCLASS(Powerup)
19
20 #ifdef GAMEQC
21 MODEL(Strength_ITEM, Item_Model("g_strength.md3"));
22 SOUND(Strength, Item_Sound("powerup"));
23 #endif
24
25 #ifdef SVQC
26 float autocvar_g_balance_powerup_strength_time;
27 void powerup_strength_init(entity item)
28 {
29     if(!item.strength_finished)
30         item.strength_finished = autocvar_g_balance_powerup_strength_time;
31 }
32 #endif
33 REGISTER_ITEM(Strength, Powerup) {
34 #ifdef GAMEQC
35     this.m_model            =   MDL_Strength_ITEM;
36     this.m_sound            =   SND_Strength;
37     this.m_glow             =   true;
38     this.m_respawnsound     =   SND_STRENGTH_RESPAWN;
39 #endif
40     this.netname            =   "strength";
41     this.m_name             =   "Strength Powerup";
42     this.m_icon             =   "strength";
43     this.m_color            =   '0 0 1';
44     this.m_waypoint         =   _("Strength");
45     this.m_waypointblink    =   2;
46     this.m_itemid           =   IT_STRENGTH;
47 #ifdef SVQC
48     this.m_iteminit         =   powerup_strength_init;
49 #endif
50 }
51
52 #ifdef GAMEQC
53 MODEL(Shield_ITEM, Item_Model("g_invincible.md3"));
54 SOUND(Shield, Item_Sound("powerup_shield"));
55 #endif
56
57 #ifdef SVQC
58 float autocvar_g_balance_powerup_invincible_time;
59 void powerup_shield_init(entity item)
60 {
61     if(!item.invincible_finished)
62         item.invincible_finished = autocvar_g_balance_powerup_invincible_time;
63 }
64 #endif
65 REGISTER_ITEM(Shield, Powerup) {
66 #ifdef GAMEQC
67     this.m_model            =   MDL_Shield_ITEM;
68     this.m_sound            =   SND_Shield;
69     this.m_glow             =   true;
70     this.m_respawnsound     =   SND_SHIELD_RESPAWN;
71 #endif
72     this.netname            =   "invincible";
73     this.m_name             =   "Shield";
74     this.m_icon             =   "shield";
75     this.m_color            =   '1 0 1';
76     this.m_waypoint         =   _("Shield");
77     this.m_waypointblink    =   2;
78     this.m_itemid           =   IT_INVINCIBLE;
79 #ifdef SVQC
80     this.m_iteminit         =   powerup_shield_init;
81 #endif
82 }