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