#include "../common/constants.qh"
#include "../common/teams.qh"
-#include "../common/weapons/weapons.qh"
+#include "../common/weapons/all.qh"
#include "../csqcmodellib/interpolate.qh"
R_EndPolygon();
}
-void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float height, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f)
+void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float theheight, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f)
{
vector o, ri, up;
float owidth; // outer width
up = rotate(up, rot);
owidth = width + 2 * border;
- o = o - up * (margin + border + height) + ri * (sz.x - owidth) * 0.5;
+ o = o - up * (margin + border + theheight) + ri * (sz.x - owidth) * 0.5;
drawquad(o - up * border, ri * owidth, up * border, "", rgb, a, f);
- drawquad(o + up * height, ri * owidth, up * border, "", rgb, a, f);
- drawquad(o, ri * border, up * height, "", rgb, a, f);
- drawquad(o + ri * (owidth - border), ri * border, up * height, "", rgb, a, f);
- drawquad(o + ri * (border + align * ((1 - h) * width)), ri * width * h, up * height, "", hrgb, ha, f);
+ drawquad(o + up * theheight, ri * owidth, up * border, "", rgb, a, f);
+ drawquad(o, ri * border, up * theheight, "", rgb, a, f);
+ drawquad(o + ri * (owidth - border), ri * border, up * theheight, "", rgb, a, f);
+ drawquad(o + ri * (border + align * ((1 - h) * width)), ri * width * h, up * theheight, "", hrgb, ha, f);
}
// returns location of sprite text
float spritelookupblinkvalue(string s)
{
+ if(substring(s, 0, 4) == "wpn-")
+ if(get_weaponinfo(stof(substring(s, 4, strlen(s)))).spawnflags & WEP_FLAG_SUPERWEAPON)
+ return 2;
+
switch(s)
{
case "ons-cp-atck-neut": return 2;
case "item-shield": return 2;
case "item-fuelregen": return 2;
case "item-jetpack": return 2;
- case "wpn-fireball": return 2; // superweapon
- case "wpn-minstanex": return 2; // superweapon
- case "wpn-porto": return 2; // superweapon
case "tagged-target": return 2;
default: return 1;
}
string spritelookuptext(string s)
{
if(substring(s, 0, 4) == "wpn-") { return (get_weaponinfo(stof(substring(s, 4, strlen(s)))).message); }
- if(substring(s, 0, 5) == "buff-") { return Buff_PrettyName(Buff_Type_FromSprite(s)); }
+ if (substring(s, 0, 5) == "buff-")
+ {
+ entity buff = BUFF_NULL;
+ FOREACH(BUFFS, it.m_sprite == s, LAMBDA(
+ buff = it;
+ break;
+ ));
+ return buff.m_prettyName;
+ }
switch(s)
{
case "keycarrier-red": return _("Key carrier");
case "keycarrier-yellow": return _("Key carrier");
case "redbase": return _("Red base");
+ case "yellowbase": return _("Yellow base");
+ case "neutralbase": return _("White base");
+ case "pinkbase": return _("Pink base");
case "waypoint": return _("Waypoint");
case "ons-gen-red": return _("Generator");
case "ons-gen-blue": return _("Generator");
{
if(self.helpme && time < self.helpme)
a *= SPRITE_HELPME_BLINK;
- else
+ else if(!self.lifetime) // fading out waypoints don't blink
a *= spritelookupblinkvalue(spriteimage);
}
a = 1;
}
- if(a <= 0)
+ if(a <= 0.003)
return;
rgb = fixrgbexcess(rgb);