]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/powerups/powerup/strength.qh
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / powerups / powerup / strength.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(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;
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 def, entity item)
24 {
25     if(!autocvar_g_powerups || !autocvar_g_powerups_strength)
26         def.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
27
28     if(!item.strength_finished)
29         item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time;
30 }
31 #endif
32 REGISTER_ITEM(Strength, Powerup) {
33     this.m_canonical_spawnfunc = "item_strength";
34 #ifdef SVQC
35     this.m_iteminit         =   powerup_strength_init;
36 #endif
37 #ifdef GAMEQC
38     this.spawnflags         =   ITEM_FLAG_NORMAL;
39     this.m_itemid           =   IT_STRENGTH;
40     this.m_model            =   MDL_Strength_ITEM;
41     this.m_sound            =   SND_Strength;
42     this.m_glow             =   true;
43     this.m_respawnsound     =   SND_STRENGTH_RESPAWN;
44 #endif
45     this.netname            =   "strength";
46     this.m_name             =   _("Strength");
47     this.m_icon             =   "strength";
48     this.m_color            =   '0 0 1';
49     this.m_waypoint         =   _("Strength");
50     this.m_waypointblink    =   2;
51 }
52
53 SPAWNFUNC_ITEM(item_strength, ITEM_Strength)
54
55 CLASS(Strength, Powerups)
56     ATTRIB(Strength, netname, string, "strength");
57     ATTRIB(Strength, m_name, string, _("Strength"));
58     ATTRIB(Strength, m_icon, string, "strength");
59 ENDCLASS(Strength)
60 REGISTER_STATUSEFFECT(Strength, NEW(Strength));