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);
14 #include <server/items/items.qh>
18 MODEL(ArmorSmall_ITEM, Item_Model("item_armor_small.md3"));
19 SOUND(ArmorSmall, Item_Sound("armor1"));
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)
27 if(!item.max_armorvalue)
28 item.max_armorvalue = g_pickup_armorsmall_max;
29 if(!GetResource(item, RES_ARMOR))
30 SetResourceExplicit(item, RES_ARMOR, g_pickup_armorsmall);
34 REGISTER_ITEM(ArmorSmall, Armor) {
35 this.m_canonical_spawnfunc = "item_armor_small";
37 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
38 this.m_model = MDL_ArmorSmall_ITEM;
39 this.m_sound = SND_ArmorSmall;
41 this.netname = "armor_small";
42 this.m_name = _("Small armor");
43 this.m_icon = "armor_small";
45 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
46 this.m_icon = "armor"; // compatible with Xonotic v0.8.2 or lower
49 this.m_itemid = IT_RESOURCE;
50 this.m_respawntime = GET(g_pickup_respawntime_short);
51 this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short);
52 this.m_pickupanyway = GET(g_pickup_armorsmall_anyway);
53 this.m_iteminit = item_armorsmall_init;
57 SPAWNFUNC_ITEM(item_armor_small, ITEM_ArmorSmall)
60 MODEL(ArmorMedium_ITEM, Item_Model("item_armor_medium.md3"));
61 SOUND(ArmorMedium, Item_Sound("armor10"));
64 PROPERTY(float, g_pickup_armormedium_anyway);
65 PROPERTY(int, g_pickup_armormedium);
66 PROPERTY(int, g_pickup_armormedium_max);
67 void item_armormedium_init(Pickup this, entity item)
69 if(!item.max_armorvalue)
70 item.max_armorvalue = g_pickup_armormedium_max;
71 if(!GetResource(item, RES_ARMOR))
72 SetResourceExplicit(item, RES_ARMOR, g_pickup_armormedium);
76 REGISTER_ITEM(ArmorMedium, Armor) {
77 this.m_canonical_spawnfunc = "item_armor_medium";
79 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
80 this.m_model = MDL_ArmorMedium_ITEM;
81 this.m_sound = SND_ArmorMedium;
83 this.netname = "armor_medium";
84 this.m_name = _("Medium armor");
85 this.m_icon = "armor_medium";
87 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
88 this.m_icon = "armor"; // compatible with Xonotic v0.8.2 or lower
91 this.m_itemid = IT_RESOURCE;
92 this.m_respawntime = GET(g_pickup_respawntime_medium);
93 this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium);
94 this.m_pickupanyway = GET(g_pickup_armormedium_anyway);
95 this.m_iteminit = item_armormedium_init;
99 SPAWNFUNC_ITEM(item_armor_medium, ITEM_ArmorMedium)
102 MODEL(ArmorBig_ITEM, Item_Model("item_armor_big.md3"));
103 SOUND(ArmorBig, Item_Sound("armor17_5"));
106 PROPERTY(float, g_pickup_armorbig_anyway);
107 PROPERTY(int, g_pickup_armorbig);
108 PROPERTY(int, g_pickup_armorbig_max);
109 void item_armorbig_init(Pickup this, entity item)
111 if(!item.max_armorvalue)
112 item.max_armorvalue = g_pickup_armorbig_max;
113 if(!GetResource(item, RES_ARMOR))
114 SetResourceExplicit(item, RES_ARMOR, g_pickup_armorbig);
118 REGISTER_ITEM(ArmorBig, Armor) {
119 this.m_canonical_spawnfunc = "item_armor_big";
121 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
122 this.m_model = MDL_ArmorBig_ITEM;
123 this.m_sound = SND_ArmorBig;
125 this.netname = "armor_big";
126 this.m_name = _("Big armor");
127 this.m_icon = "armor_big";
129 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
130 this.m_icon = "armor"; // compatible with Xonotic v0.8.2 or lower
132 this.m_color = '0 1 0';
133 this.m_waypoint = _("Big armor");
135 this.m_itemid = IT_RESOURCE;
136 this.m_respawntime = GET(g_pickup_respawntime_long);
137 this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long);
138 this.m_pickupanyway = GET(g_pickup_armorbig_anyway);
139 this.m_iteminit = item_armorbig_init;
143 SPAWNFUNC_ITEM(item_armor_big, ITEM_ArmorBig)
146 MODEL(ArmorMega_ITEM, Item_Model("item_armor_large.md3"));
147 SOUND(ArmorMega, Item_Sound("armor25"));
150 PROPERTY(float, g_pickup_armormega_anyway);
151 PROPERTY(int, g_pickup_armormega);
152 PROPERTY(int, g_pickup_armormega_max);
153 void item_armormega_init(Pickup this, entity item)
155 if(!item.max_armorvalue)
156 item.max_armorvalue = g_pickup_armormega_max;
157 if(!GetResource(item, RES_ARMOR))
158 SetResourceExplicit(item, RES_ARMOR, g_pickup_armormega);
162 REGISTER_ITEM(ArmorMega, Armor) {
163 this.m_canonical_spawnfunc = "item_armor_mega";
165 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
166 this.m_model = MDL_ArmorMega_ITEM;
167 this.m_sound = SND_ArmorMega;
169 this.netname = "armor_mega";
170 this.m_name = _("Mega armor");
171 this.m_icon = "armor_mega";
173 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
174 this.m_icon = "item_large_armor"; // compatible with Xonotic v0.8.2 or lower
176 this.m_color = '0 1 0';
177 this.m_waypoint = _("Mega armor");
178 this.m_waypointblink = 2;
180 this.m_maxs = '16 16 70';
181 this.m_itemid = IT_RESOURCE;
182 this.m_respawntime = GET(g_pickup_respawntime_long);
183 this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long);
184 this.m_pickupanyway = GET(g_pickup_armormega_anyway);
185 this.m_iteminit = item_armormega_init;
189 SPAWNFUNC_ITEM(item_armor_mega, ITEM_ArmorMega)