#include "pickup.qh"
CLASS(Health, Pickup)
#ifdef SVQC
- ATTRIB(Health, m_mins, vector, '-16 -16 0');
- ATTRIB(Health, m_maxs, vector, '16 16 48');
ATTRIB(Health, m_pickupevalfunc, float(entity player, entity item), healtharmor_pickupevalfunc);
ATTRIB(Health, m_botvalue, int, 5000);
#endif
ENDCLASS(Health)
#ifdef SVQC
- #include <common/t_items.qh>
+ #include <server/items/items.qh>
#endif
#ifdef GAMEQC
if(!item.max_health)
item.max_health = g_pickup_healthsmall_max;
if(!GetResource(item, RES_HEALTH))
- SetResourceExplicit(item, RES_HEALTH, g_pickup_healthsmall);
+ SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthsmall);
}
#endif
REGISTER_ITEM(HealthSmall, Health) {
this.m_canonical_spawnfunc = "item_health_small";
#ifdef GAMEQC
- this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
+ this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
this.m_model = MDL_HealthSmall_ITEM;
this.m_sound = SND_HealthSmall;
#endif
this.netname = "health_small";
this.m_name = _("Small health");
- this.m_icon = "health";
+ this.m_icon = "health_small";
+#ifdef CSQC
+ if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+ this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower
+#endif
#ifdef SVQC
- this.m_itemid = IT_5HP;
- this.m_respawntime = GET(g_pickup_respawntime_short);
- this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short);
+ this.m_mins = ITEM_S_MINS;
+ this.m_maxs = ITEM_S_MAXS;
+ this.m_itemid = IT_RESOURCE;
+ this.m_respawntime = GET(g_pickup_respawntime_health_small);
+ this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_small);
this.m_pickupanyway = GET(g_pickup_healthsmall_anyway);
this.m_iteminit = item_healthsmall_init;
+
#endif
}
if(!item.max_health)
item.max_health = g_pickup_healthmedium_max;
if(!GetResource(item, RES_HEALTH))
- SetResourceExplicit(item, RES_HEALTH, g_pickup_healthmedium);
+ SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthmedium);
}
#endif
REGISTER_ITEM(HealthMedium, Health) {
this.m_canonical_spawnfunc = "item_health_medium";
#ifdef GAMEQC
- this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
+ this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
this.m_model = MDL_HealthMedium_ITEM;
this.m_sound = SND_HealthMedium;
#endif
this.netname = "health_medium";
this.m_name = _("Medium health");
- this.m_icon = "health";
+ this.m_icon = "health_medium";
+#ifdef CSQC
+ if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+ this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower
+#endif
#ifdef SVQC
- this.m_itemid = IT_25HP;
- this.m_respawntime = GET(g_pickup_respawntime_short);
- this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short);
+ this.m_mins = ITEM_S_MINS;
+ this.m_maxs = ITEM_S_MAXS;
+ this.m_itemid = IT_RESOURCE;
+ this.m_respawntime = GET(g_pickup_respawntime_health_medium);
+ this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_medium);
this.m_pickupanyway = GET(g_pickup_healthmedium_anyway);
this.m_iteminit = item_healthmedium_init;
#endif
if(!item.max_health)
item.max_health = g_pickup_healthbig_max;
if(!GetResource(item, RES_HEALTH))
- SetResourceExplicit(item, RES_HEALTH, g_pickup_healthbig);
+ SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthbig);
}
#endif
REGISTER_ITEM(HealthBig, Health) {
this.m_canonical_spawnfunc = "item_health_big";
#ifdef GAMEQC
- this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
+ this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
this.m_model = MDL_HealthBig_ITEM;
this.m_sound = SND_HealthBig;
#endif
this.netname = "health_big";
this.m_name = _("Big health");
- this.m_icon = "health";
+ this.m_icon = "health_big";
this.m_color = '1 0 0';
this.m_waypoint = _("Big health");
+#ifdef CSQC
+ if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+ this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower
+#endif
#ifdef SVQC
- this.m_itemid = IT_25HP;
- this.m_respawntime = GET(g_pickup_respawntime_medium);
- this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium);
+ this.m_itemid = IT_RESOURCE;
+ this.m_respawntime = GET(g_pickup_respawntime_health_big);
+ this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_big);
this.m_pickupanyway = GET(g_pickup_healthbig_anyway);
this.m_iteminit = item_healthbig_init;
#endif
if(!item.max_health)
item.max_health = g_pickup_healthmega_max;
if(!GetResource(item, RES_HEALTH))
- SetResourceExplicit(item, RES_HEALTH, g_pickup_healthmega);
+ SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthmega);
}
#endif
#endif
this.netname = "health_mega";
this.m_name = _("Mega health");
- this.m_icon = "item_mega_health";
+ this.m_icon = "health_mega";
+#ifdef CSQC
+ if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+ this.m_icon = "item_mega_health"; // compatible with Xonotic v0.8.2 or lower
+#endif
this.m_color = '1 0 0';
this.m_waypoint = _("Mega health");
this.m_waypointblink = 2;
#ifdef SVQC
- this.m_maxs = '16 16 70';
- this.m_itemid = IT_HEALTH;
- this.m_respawntime = GET(g_pickup_respawntime_long);
- this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long);
+ this.m_maxs = ITEM_L_MAXS;
+ this.m_itemid = IT_RESOURCE;
+ this.m_respawntime = GET(g_pickup_respawntime_health_mega);
+ this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_mega);
this.m_pickupanyway = GET(g_pickup_healthmega_anyway);
this.m_iteminit = item_healthmega_init;
#endif