]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/item/armor.qh
165f3ed8c73fa8dce7dce8d6d55739810bdbdce4
[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(Pickup this, 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.spawnflags = ITEM_FLAG_NORMAL;
38     this.m_model                =   MDL_ArmorSmall_ITEM;
39     this.m_sound                =   SND_ArmorSmall;
40 #endif
41     this.netname                =   "armor_small";
42     this.m_name                 =   "5 Armor";
43     this.m_icon                 =   "armor";
44         this.m_waypoint_icon        =   "waypoint_armor";
45 #ifdef SVQC
46     this.m_itemid               =   IT_ARMOR_SHARD;
47     this.m_respawntime          =   GET(g_pickup_respawntime_short);
48     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_short);
49     this.m_pickupanyway         =   GET(g_pickup_armorsmall_anyway);
50     this.m_iteminit             =   item_armorsmall_init;
51 #endif
52 }
53
54 SPAWNFUNC_ITEM(item_armor_small, ITEM_ArmorSmall)
55
56 #ifdef GAMEQC
57 MODEL(ArmorMedium_ITEM, Item_Model("item_armor_medium.md3"));
58 SOUND(ArmorMedium, Item_Sound("armor10"));
59 #endif
60 #ifdef SVQC
61 PROPERTY(float, g_pickup_armormedium_anyway);
62 PROPERTY(int, g_pickup_armormedium);
63 PROPERTY(int, g_pickup_armormedium_max);
64 void item_armormedium_init(Pickup this, entity item)
65 {
66     if(!item.max_armorvalue)
67         item.max_armorvalue = g_pickup_armormedium_max;
68     if(!item.armorvalue)
69         item.armorvalue = g_pickup_armormedium;
70 }
71 #endif
72
73 REGISTER_ITEM(ArmorMedium, Armor) {
74     this.m_canonical_spawnfunc = "item_armor_medium";
75 #ifdef GAMEQC
76     this.spawnflags = ITEM_FLAG_NORMAL;
77     this.m_model                =   MDL_ArmorMedium_ITEM;
78     this.m_sound                =   SND_ArmorMedium;
79 #endif
80     this.netname                =   "armor_medium";
81     this.m_name                 =   "25 Armor";
82     this.m_icon                 =   "armor";
83         this.m_waypoint_icon        =   "waypoint_armor";
84 #ifdef SVQC
85     this.m_itemid               =   IT_ARMOR;
86     this.m_respawntime          =   GET(g_pickup_respawntime_medium);
87     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_medium);
88     this.m_pickupanyway         =   GET(g_pickup_armormedium_anyway);
89     this.m_iteminit             =   item_armormedium_init;
90 #endif
91 }
92
93 SPAWNFUNC_ITEM(item_armor_medium, ITEM_ArmorMedium)
94
95 #ifdef GAMEQC
96 MODEL(ArmorBig_ITEM, Item_Model("item_armor_big.md3"));
97 SOUND(ArmorBig, Item_Sound("armor17_5"));
98 #endif
99 #ifdef SVQC
100 PROPERTY(float, g_pickup_armorbig_anyway);
101 PROPERTY(int, g_pickup_armorbig);
102 PROPERTY(int, g_pickup_armorbig_max);
103 void item_armorbig_init(Pickup this, entity item)
104 {
105     if(!item.max_armorvalue)
106         item.max_armorvalue = g_pickup_armorbig_max;
107     if(!item.armorvalue)
108         item.armorvalue = g_pickup_armorbig;
109 }
110 #endif
111
112 REGISTER_ITEM(ArmorBig, Armor) {
113     this.m_canonical_spawnfunc = "item_armor_big";
114 #ifdef GAMEQC
115     this.spawnflags = ITEM_FLAG_NORMAL;
116     this.m_model                =   MDL_ArmorBig_ITEM;
117     this.m_sound                =   SND_ArmorBig;
118 #endif
119     this.netname                =   "armor_big";
120     this.m_name                 =   "50 Armor";
121     this.m_icon                 =   "armor";
122     this.m_color                =   '0 1 0';
123         this.m_waypoint_text        =   _("Big armor");
124         this.m_waypoint_icon        =   "waypoint_armor";
125 #ifdef SVQC
126     this.m_itemid               =   IT_ARMOR;
127     this.m_respawntime          =   GET(g_pickup_respawntime_long);
128     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_long);
129     this.m_pickupanyway         =   GET(g_pickup_armorbig_anyway);
130     this.m_iteminit             =   item_armorbig_init;
131 #endif
132 }
133
134 SPAWNFUNC_ITEM(item_armor_big, ITEM_ArmorBig)
135
136 #ifdef GAMEQC
137 MODEL(ArmorMega_ITEM, Item_Model("item_armor_large.md3"));
138 SOUND(ArmorMega, Item_Sound("armor25"));
139 #endif
140 #ifdef SVQC
141 PROPERTY(float, g_pickup_armormega_anyway);
142 PROPERTY(int, g_pickup_armormega);
143 PROPERTY(int, g_pickup_armormega_max);
144 void item_armormega_init(Pickup this, entity item)
145 {
146     if(!item.max_armorvalue)
147         item.max_armorvalue = g_pickup_armormega_max;
148     if(!item.armorvalue)
149         item.armorvalue = g_pickup_armormega;
150 }
151 #endif
152
153 REGISTER_ITEM(ArmorMega, Armor) {
154     this.m_canonical_spawnfunc = "item_armor_mega";
155 #ifdef GAMEQC
156     this.spawnflags = ITEM_FLAG_NORMAL;
157     this.m_model                =   MDL_ArmorMega_ITEM;
158     this.m_sound                =   SND_ArmorMega;
159 #endif
160     this.netname                =   "armor_mega";
161     this.m_name                 =   "100 Armor";
162     this.m_icon                 =   "item_large_armor";
163     this.m_color                =   '0 1 0';
164         this.m_waypoint_text        =   _("Mega armor");
165         this.m_waypoint_icon        =   "waypoint_armor_mega";
166     this.m_waypointblink        =   2;
167 #ifdef SVQC
168     this.m_maxs                 =   '16 16 70';
169     this.m_itemid               =   IT_ARMOR;
170     this.m_respawntime          =   GET(g_pickup_respawntime_long);
171     this.m_respawntimejitter    =   GET(g_pickup_respawntimejitter_long);
172     this.m_pickupanyway         =   GET(g_pickup_armormega_anyway);
173     this.m_iteminit             =   item_armormega_init;
174 #endif
175 }
176
177 SPAWNFUNC_ITEM(item_armor_mega, ITEM_ArmorMega)