]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/armor.qh
Merge branch 'master' into Lyberta/RandomItems
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / armor.qh
1 #pragma once
2
3 #include "pickup.qh"
4 CLASS(Armor, Pickup)
5 #ifdef SVQC
6     ATTRIB(Armor, m_mins, vector, '-16 -16 0');
7     ATTRIB(Armor, m_maxs, vector, '16 16 48');
8     ATTRIB(Armor, m_pickupevalfunc, float(entity player, entity item), healtharmor_pickupevalfunc);
9     ATTRIB(Armor, m_botvalue, int, 5000);
10 #endif
11 ENDCLASS(Armor)
12
13 #ifdef SVQC
14     #include <common/t_items.qh>
15 #endif
16
17 #ifdef GAMEQC
18 MODEL(ArmorSmall_ITEM, Item_Model("item_armor_small.md3"));
19 SOUND(ArmorSmall, Item_Sound("armor1"));
20 #endif
21 #ifdef SVQC
22 PROPERTY(float, g_pickup_armorsmall_anyway);
23 PROPERTY(int, g_pickup_armorsmall);
24 PROPERTY(int, g_pickup_armorsmall_max);
25 void item_armorsmall_init(entity item)
26 {
27     if(!item.max_armorvalue)
28         item.max_armorvalue = g_pickup_armorsmall_max;
29     if(!item.armorvalue)
30         item.armorvalue = g_pickup_armorsmall;
31 }
32 #endif
33
34 REGISTER_ITEM(ArmorSmall, Armor) {
35     this.m_canonical_spawnfunc = "item_armor_small";
36 #ifdef GAMEQC
37     this.m_model                =   MDL_ArmorSmall_ITEM;
38     this.m_sound                =   SND_ArmorSmall;
39 #endif
40     this.netname                =   "armor_small";
41     this.m_name                 =   "5 Armor";
42     this.m_icon                 =   "armor";
43 #ifdef SVQC
44     this.m_itemid               =   IT_ARMOR_SHARD;
45     this.m_respawntime          =   GET(g_pickup_respawntime_short);
46     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_short);
47     this.m_pickupanyway         =   GET(g_pickup_armorsmall_anyway);
48     this.m_iteminit             =   item_armorsmall_init;
49 #endif
50 }
51
52 SPAWNFUNC_ITEM(item_armor_small, ITEM_ArmorSmall)
53
54 #ifdef GAMEQC
55 MODEL(ArmorMedium_ITEM, Item_Model("item_armor_medium.md3"));
56 SOUND(ArmorMedium, Item_Sound("armor10"));
57 #endif
58 #ifdef SVQC
59 PROPERTY(float, g_pickup_armormedium_anyway);
60 PROPERTY(int, g_pickup_armormedium);
61 PROPERTY(int, g_pickup_armormedium_max);
62 void item_armormedium_init(entity item)
63 {
64     if(!item.max_armorvalue)
65         item.max_armorvalue = g_pickup_armormedium_max;
66     if(!item.armorvalue)
67         item.armorvalue = g_pickup_armormedium;
68 }
69 #endif
70
71 REGISTER_ITEM(ArmorMedium, Armor) {
72     this.m_canonical_spawnfunc = "item_armor_medium";
73 #ifdef GAMEQC
74     this.m_model                =   MDL_ArmorMedium_ITEM;
75     this.m_sound                =   SND_ArmorMedium;
76 #endif
77     this.netname                =   "armor_medium";
78     this.m_name                 =   "25 Armor";
79     this.m_icon                 =   "armor";
80 #ifdef SVQC
81     this.m_itemid               =   IT_ARMOR;
82     this.m_respawntime          =   GET(g_pickup_respawntime_medium);
83     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_medium);
84     this.m_pickupanyway         =   GET(g_pickup_armormedium_anyway);
85     this.m_iteminit             =   item_armormedium_init;
86 #endif
87 }
88
89 SPAWNFUNC_ITEM(item_armor_medium, ITEM_ArmorMedium)
90
91 #ifdef GAMEQC
92 MODEL(ArmorBig_ITEM, Item_Model("item_armor_big.md3"));
93 SOUND(ArmorBig, Item_Sound("armor17_5"));
94 #endif
95 #ifdef SVQC
96 PROPERTY(float, g_pickup_armorbig_anyway);
97 PROPERTY(int, g_pickup_armorbig);
98 PROPERTY(int, g_pickup_armorbig_max);
99 void item_armorbig_init(entity item)
100 {
101     if(!item.max_armorvalue)
102         item.max_armorvalue = g_pickup_armorbig_max;
103     if(!item.armorvalue)
104         item.armorvalue = g_pickup_armorbig;
105 }
106 #endif
107
108 REGISTER_ITEM(ArmorBig, Armor) {
109     this.m_canonical_spawnfunc = "item_armor_big";
110 #ifdef GAMEQC
111     this.m_model                =   MDL_ArmorBig_ITEM;
112     this.m_sound                =   SND_ArmorBig;
113 #endif
114     this.netname                =   "armor_big";
115     this.m_name                 =   "50 Armor";
116     this.m_icon                 =   "armor";
117     this.m_color                =   '0 1 0';
118     this.m_waypoint             =   _("Big armor");
119 #ifdef SVQC
120     this.m_itemid               =   IT_ARMOR;
121     this.m_respawntime          =   GET(g_pickup_respawntime_long);
122     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_long);
123     this.m_pickupanyway         =   GET(g_pickup_armorbig_anyway);
124     this.m_iteminit             =   item_armorbig_init;
125 #endif
126 }
127
128 SPAWNFUNC_ITEM(item_armor_big, ITEM_ArmorBig)
129
130 #ifdef GAMEQC
131 MODEL(ArmorMega_ITEM, Item_Model("item_armor_large.md3"));
132 SOUND(ArmorMega, Item_Sound("armor25"));
133 #endif
134 #ifdef SVQC
135 PROPERTY(float, g_pickup_armormega_anyway);
136 PROPERTY(int, g_pickup_armormega);
137 PROPERTY(int, g_pickup_armormega_max);
138 void item_armormega_init(entity item)
139 {
140     if(!item.max_armorvalue)
141         item.max_armorvalue = g_pickup_armormega_max;
142     if(!item.armorvalue)
143         item.armorvalue = g_pickup_armormega;
144 }
145 #endif
146
147 REGISTER_ITEM(ArmorMega, Armor) {
148     this.m_canonical_spawnfunc = "item_armor_mega";
149 #ifdef GAMEQC
150     this.m_model                =   MDL_ArmorMega_ITEM;
151     this.m_sound                =   SND_ArmorMega;
152 #endif
153     this.netname                =   "armor_mega";
154     this.m_name                 =   "100 Armor";
155     this.m_icon                 =   "item_large_armor";
156     this.m_color                =   '0 1 0';
157     this.m_waypoint             =   _("Mega armor");
158     this.m_waypointblink        =   2;
159 #ifdef SVQC
160     this.m_maxs                 =   '16 16 70';
161     this.m_itemid               =   IT_ARMOR;
162     this.m_respawntime          =   GET(g_pickup_respawntime_long);
163     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_long);
164     this.m_pickupanyway         =   GET(g_pickup_armormega_anyway);
165     this.m_iteminit             =   item_armormega_init;
166 #endif
167 }
168
169 SPAWNFUNC_ITEM(item_armor_mega, ITEM_ArmorMega)