if(get_weaponinfo(stof(substring(s, 4, strlen(s)))).spawnflags & WEP_FLAG_SUPERWEAPON)
return 2;
+ FOREACH(ITEMS, it.m_waypoint == s, LAMBDA(
+ return it.m_waypointblink;
+ ));
+
switch(s)
{
case "ons-cp-atck": return 2;
case "ons-cp-dfnd": return 0.5;
- case "item_health_mega": return 2;
- case "item_armor_large": return 2;
case "item-invis": return 2;
case "item-extralife": return 2;
case "item-speed": return 2;
- case "item-strength": return 2;
- case "item-shield": return 2;
- case "item-fuelregen": return 2;
- case "item-jetpack": return 2;
case "tagged-target": return 2;
default: return 1;
}
case "dom-blue": return _("Control point");
case "dom-yellow": return _("Control point");
case "dom-pink": return _("Control point");
- case "item_health_mega": return _("Mega health");
- case "item_armor_large": return _("Large armor");
case "item-invis": return _("Invisibility");
case "item-extralife": return _("Extra life");
case "item-speed": return _("Speed");
- case "item-strength": return _("Strength");
- case "item-shield": return _("Shield");
- case "item-fuelregen": return _("Fuel regen");
- case "item-jetpack": return _("Jet Pack");
case "frozen": return _("Frozen!");
case "tagged-target": return _("Tagged");
case "vehicle": return _("Vehicle");
ATTRIB(GameItem, m_id, int, 0)
ATTRIB(GameItem, m_name, string, string_null)
ATTRIB(GameItem, m_icon, string, string_null)
+ ATTRIB(GameItem, m_color, vector, '1 1 1')
+ ATTRIB(GameItem, m_waypoint, string, string_null)
+ ATTRIB(GameItem, m_waypointblink, int, 1)
METHOD(GameItem, display, void(entity this, void(string name, string icon) returns)) {
returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
}
this.m_sound = "misc/armor17_5.wav";
this.m_name = "50 Armor";
this.m_icon = "armor";
+ this.m_color = '0 1 0';
+ this.m_waypoint = _("Large armor");
#ifdef SVQC
this.m_botvalue = 20000; // FIXME: higher than BOT_PICKUP_RATING_HIGH?
this.m_itemid = IT_ARMOR;
this.m_sound = "misc/armor25.wav";
this.m_name = "100 Armor";
this.m_icon = "item_large_armor";
+ this.m_color = '0 1 0';
+ this.m_waypoint = _("Mega armor");
+ this.m_waypointblink = 2;
#ifdef SVQC
this.m_botvalue = BOT_PICKUP_RATING_HIGH;
this.m_itemid = IT_ARMOR;
this.m_sound = "misc/mediumhealth.wav";
this.m_name = "50 Health";
this.m_icon = "health";
+ this.m_color = '1 0 0';
+ this.m_waypoint = _("Large health");
#ifdef SVQC
this.m_botvalue = BOT_PICKUP_RATING_MID;
this.m_itemid = IT_25HP;
this.m_sound = "misc/megahealth.wav";
this.m_name = "100 Health";
this.m_icon = "item_mega_health";
+ this.m_color = '1 0 0';
+ this.m_waypoint = _("Mega health");
+ this.m_waypointblink = 2;
#ifdef SVQC
this.m_botvalue = BOT_PICKUP_RATING_HIGH;
this.m_itemid = IT_HEALTH;
this.m_model = "models/items/g_jetpack.md3";
this.m_name = "Jet pack";
this.m_icon = "jetpack";
+ this.m_color = '0.5 0.5 0.5';
+ this.m_waypoint = _("Jet Pack");
+ this.m_waypointblink = 2;
#ifdef SVQC
this.m_botvalue = BOT_PICKUP_RATING_LOW;
this.m_itemid = IT_JETPACK;
this.m_model = "models/items/g_fuelregen.md3";
this.m_name = "Fuel regenerator";
this.m_icon = "fuelregen";
+ this.m_color = '1 0.5 0';
+ this.m_waypoint = _("Fuel regen");
+ this.m_waypointblink = 2;
#ifdef SVQC
this.m_botvalue = BOT_PICKUP_RATING_LOW;
this.m_itemflags = FL_POWERUP;
.int m_itemid;
#endif
REGISTER_ITEM(Strength, Powerup) {
- this.m_model = "models/items/g_strength.md3";
- this.m_sound = "misc/powerup.wav";
- this.m_name = "Strength Powerup";
- this.m_icon = "strength";
- this.m_itemid = IT_STRENGTH;
+ this.m_model = "models/items/g_strength.md3";
+ this.m_sound = "misc/powerup.wav";
+ this.m_name = "Strength Powerup";
+ this.m_icon = "strength";
+ this.m_color = '0 0 1';
+ this.m_waypoint = _("Strength");
+ this.m_waypointblink = 2;
+ this.m_itemid = IT_STRENGTH;
}
REGISTER_ITEM(Shield, Powerup) {
- this.m_model = "models/items/g_invincible.md3";
- this.m_sound = "misc/powerup_shield.wav";
- this.m_name = "Shield";
- this.m_icon = "shield";
- this.m_itemid = IT_INVINCIBLE;
+ this.m_model = "models/items/g_invincible.md3";
+ this.m_sound = "misc/powerup_shield.wav";
+ this.m_name = "Shield";
+ this.m_icon = "shield";
+ this.m_color = '1 0 1';
+ this.m_waypoint = _("Shield");
+ this.m_waypointblink = 2;
+ this.m_itemid = IT_INVINCIBLE;
}
self.count += 1;
if(self.count == 1)
{
- string name;
+ string name = string_null;
vector rgb = '1 0 1';
- name = string_null;
- switch (self.items)
- {
- case ITEM_JetpackRegen.m_itemid: name = "item-fuelregen"; rgb = '1 0.5 0'; break;
- case ITEM_Jetpack.m_itemid: name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
- case ITEM_Strength.m_itemid: name = "item-strength"; rgb = '0 0 1'; break;
- case ITEM_Shield.m_itemid: name = "item-shield"; rgb = '1 0 1'; break;
- case ITEM_HealthMega.m_itemid:
- //if (self.classname == "item_health_mega")
- {name = "item_health_mega"; rgb = '1 0 0';}
- break;
- case ITEM_ArmorMega.m_itemid:
- if (self.itemdef == ITEM_ArmorMega)
- {name = "item_armor_large"; rgb = '0 1 0';}
- break;
- }
+ entity e = self.itemdef;
+ if (e) {
+ name = e.m_waypoint;
+ rgb = e.m_color;
+ }
MUTATOR_CALLHOOK(Item_RespawnCountdown, name, rgb);
name = item_name;
rgb = item_color;