Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / powerup.qh
1 #pragma once
2
3 #ifdef SVQC
4     // For FL_POWERUP
5     #include <common/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, 11000);
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(Pickup this, 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     this.m_canonical_spawnfunc = "item_strength";
35 #ifdef GAMEQC
36         this.spawnflags = ITEM_FLAG_NORMAL;
37     this.m_model            =   MDL_Strength_ITEM;
38     this.m_sound            =   SND_Strength;
39     this.m_glow             =   true;
40     this.m_respawnsound     =   SND_STRENGTH_RESPAWN;
41 #endif
42     this.netname            =   "strength";
43     this.m_name             =   _("Strength");
44     this.m_icon             =   "strength";
45     this.m_color            =   '0 0 1';
46     this.m_waypoint         =   _("Strength");
47     this.m_waypointblink    =   2;
48 #ifdef GAMEQC
49     this.m_itemid           =   IT_STRENGTH;
50 #endif
51 #ifdef SVQC
52     this.m_iteminit         =   powerup_strength_init;
53 #endif
54 }
55
56 SPAWNFUNC_ITEM(item_strength, ITEM_Strength)
57
58 #ifdef GAMEQC
59 MODEL(Shield_ITEM, Item_Model("g_invincible.md3"));
60 SOUND(Shield, Item_Sound("powerup_shield"));
61 #endif
62
63 #ifdef SVQC
64 float autocvar_g_balance_powerup_invincible_time;
65 void powerup_shield_init(Pickup this, entity item)
66 {
67     if(!item.invincible_finished)
68         item.invincible_finished = autocvar_g_balance_powerup_invincible_time;
69 }
70 #endif
71 REGISTER_ITEM(Shield, Powerup) {
72     this.m_canonical_spawnfunc = "item_shield";
73 #ifdef GAMEQC
74         this.spawnflags = ITEM_FLAG_NORMAL;
75     this.m_model            =   MDL_Shield_ITEM;
76     this.m_sound            =   SND_Shield;
77     this.m_glow             =   true;
78     this.m_respawnsound     =   SND_SHIELD_RESPAWN;
79 #endif
80     this.netname            =   "invincible";
81     this.m_name             =   _("Shield");
82     this.m_icon             =   "shield";
83     this.m_color            =   '1 0 1';
84     this.m_waypoint         =   _("Shield");
85     this.m_waypointblink    =   2;
86 #ifdef GAMEQC
87     this.m_itemid           =   IT_INVINCIBLE;
88 #endif
89 #ifdef SVQC
90     this.m_iteminit         =   powerup_shield_init;
91 #endif
92 }
93
94 SPAWNFUNC_ITEM(item_shield, ITEM_Shield)
95 SPAWNFUNC_ITEM(item_invincible, ITEM_Shield)