6 ATTRIB(Health, m_mins, vector, '-16 -16 0');
7 ATTRIB(Health, m_maxs, vector, '16 16 48');
8 ATTRIB(Health, m_pickupevalfunc, float(entity player, entity item), healtharmor_pickupevalfunc);
9 ATTRIB(Health, m_botvalue, int, 5000);
14 #include <server/items/items.qh>
18 MODEL(HealthSmall_ITEM, Item_Model("g_h1.md3"));
19 SOUND(HealthSmall, Item_Sound("minihealth"));
22 PROPERTY(float, g_pickup_healthsmall_anyway);
23 PROPERTY(int, g_pickup_healthsmall);
24 PROPERTY(int, g_pickup_healthsmall_max);
25 void item_healthsmall_init(Pickup this, entity item)
28 item.max_health = g_pickup_healthsmall_max;
29 if(!GetResource(item, RES_HEALTH))
30 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthsmall);
34 REGISTER_ITEM(HealthSmall, Health) {
35 this.m_canonical_spawnfunc = "item_health_small";
37 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
38 this.m_model = MDL_HealthSmall_ITEM;
39 this.m_sound = SND_HealthSmall;
41 this.netname = "health_small";
42 this.m_name = _("Small health");
43 this.m_icon = "health_small";
45 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
46 this.m_icon = "health"; // 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_healthsmall_anyway);
53 this.m_iteminit = item_healthsmall_init;
57 SPAWNFUNC_ITEM(item_health_small, ITEM_HealthSmall)
60 MODEL(HealthMedium_ITEM, Item_Model("g_h25.md3"));
61 SOUND(HealthMedium, Item_Sound("mediumhealth"));
64 PROPERTY(float, g_pickup_healthmedium_anyway);
65 PROPERTY(int, g_pickup_healthmedium);
66 PROPERTY(int, g_pickup_healthmedium_max);
67 void item_healthmedium_init(Pickup this, entity item)
70 item.max_health = g_pickup_healthmedium_max;
71 if(!GetResource(item, RES_HEALTH))
72 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthmedium);
76 REGISTER_ITEM(HealthMedium, Health) {
77 this.m_canonical_spawnfunc = "item_health_medium";
79 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
80 this.m_model = MDL_HealthMedium_ITEM;
81 this.m_sound = SND_HealthMedium;
83 this.netname = "health_medium";
84 this.m_name = _("Medium health");
85 this.m_icon = "health_medium";
87 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
88 this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower
91 this.m_itemid = IT_RESOURCE;
92 this.m_respawntime = GET(g_pickup_respawntime_short);
93 this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short);
94 this.m_pickupanyway = GET(g_pickup_healthmedium_anyway);
95 this.m_iteminit = item_healthmedium_init;
99 SPAWNFUNC_ITEM(item_health_medium, ITEM_HealthMedium)
102 MODEL(HealthBig_ITEM, Item_Model("g_h50.md3"));
103 SOUND(HealthBig, Item_Sound("mediumhealth"));
106 PROPERTY(float, g_pickup_healthbig_anyway);
107 PROPERTY(int, g_pickup_healthbig);
108 PROPERTY(int, g_pickup_healthbig_max);
109 void item_healthbig_init(Pickup this, entity item)
112 item.max_health = g_pickup_healthbig_max;
113 if(!GetResource(item, RES_HEALTH))
114 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthbig);
118 REGISTER_ITEM(HealthBig, Health) {
119 this.m_canonical_spawnfunc = "item_health_big";
121 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
122 this.m_model = MDL_HealthBig_ITEM;
123 this.m_sound = SND_HealthBig;
125 this.netname = "health_big";
126 this.m_name = _("Big health");
127 this.m_icon = "health_big";
128 this.m_color = '1 0 0';
129 this.m_waypoint = _("Big health");
131 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
132 this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower
135 this.m_itemid = IT_RESOURCE;
136 this.m_respawntime = GET(g_pickup_respawntime_medium);
137 this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium);
138 this.m_pickupanyway = GET(g_pickup_healthbig_anyway);
139 this.m_iteminit = item_healthbig_init;
143 SPAWNFUNC_ITEM(item_health_big, ITEM_HealthBig)
146 MODEL(HealthMega_ITEM, Item_Model("g_h100.md3"));
147 SOUND(HealthMega, Item_Sound("megahealth"));
150 PROPERTY(float, g_pickup_healthmega_anyway);
151 PROPERTY(int, g_pickup_healthmega);
152 PROPERTY(int, g_pickup_healthmega_max);
153 void item_healthmega_init(Pickup this, entity item)
156 item.max_health = g_pickup_healthmega_max;
157 if(!GetResource(item, RES_HEALTH))
158 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthmega);
162 REGISTER_ITEM(HealthMega, Health) {
163 this.m_canonical_spawnfunc = "item_health_mega";
165 this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
166 this.m_model = MDL_HealthMega_ITEM;
167 this.m_sound = SND_HealthMega;
169 this.netname = "health_mega";
170 this.m_name = _("Mega health");
171 this.m_icon = "health_mega";
173 if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
174 this.m_icon = "item_mega_health"; // compatible with Xonotic v0.8.2 or lower
176 this.m_color = '1 0 0';
177 this.m_waypoint = _("Mega health");
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_healthmega_anyway);
185 this.m_iteminit = item_healthmega_init;
189 SPAWNFUNC_ITEM(item_health_mega, ITEM_HealthMega)