case 33:
if(self.deadflag == DEAD_NO && teamplay)
{
- wp = WaypointSprite_Attach("helpme", TRUE);
- if(wp)
- WaypointSprite_UpdateTeamRadar(wp, RADARICON_HELPME, '1 0.5 0'); // TODO choose better color
+ wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
if(!wp)
wp = self.waypointsprite_attachedforcarrier; // flag sprite?
if(wp)
self.movetype = MOVETYPE_NONE;
setorigin(self, FLAG_CARRY_POS);
setattachment(self, other, "");
- WaypointSprite_AttachCarrier("flagcarrier", other);
- WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');
+ WaypointSprite_AttachCarrier("flagcarrier", other, RADARICON_FLAGCARRIER, '1 1 0');
WaypointSprite_Ping(self.sprite);
return;
setattachment(self, other, "");
self.damageforcescale = 0;
self.takedamage = DAMAGE_NO;
- WaypointSprite_AttachCarrier("flagcarrier", other);
- WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');
+ WaypointSprite_AttachCarrier("flagcarrier", other, RADARICON_FLAGCARRIER, '1 1 0');
}
}
};
PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
// waypoints
- WaypointSprite_AttachCarrier("ka-ballcarrier", other);
+ WaypointSprite_AttachCarrier("ka-ballcarrier", other, RADARICON_FLAGCARRIER, '1 0 0');
other.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = ka_ballcarrier_waypointsprite_visible_for_player;
WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
- WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 0 0');
WaypointSprite_Ping(other.waypointsprite_attachedforcarrier);
WaypointSprite_Kill(self.waypointsprite_attachedforcarrier);
}
if(key.kh_next == world)
{
// player is now a key carrier
- WaypointSprite_AttachCarrier("", player);
+ WaypointSprite_AttachCarrier("", player, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));
player.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_KeyCarrier_waypointsprite_visible_for_player;
WaypointSprite_UpdateRule(player.waypointsprite_attachedforcarrier, player.team, SPRITERULE_TEAMPLAY);
if(player.team == COLOR_TEAM1)
WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-yellow", "keycarrier-friend", "keycarrier-yellow");
else if(player.team == COLOR_TEAM4)
WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-pink", "keycarrier-friend", "keycarrier-pink");
- WaypointSprite_UpdateTeamRadar(player.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));
if(!kh_no_radar_circles)
WaypointSprite_Ping(player.waypointsprite_attachedforcarrier);
}
ball.effects |= EF_NOSHADOW;
ball.scale = 1; // scale down.
- WaypointSprite_AttachCarrier("nb-ball", plyr);
+ WaypointSprite_AttachCarrier("nb-ball", plyr, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR);
WaypointSprite_UpdateRule(plyr.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
- WaypointSprite_UpdateTeamRadar(plyr.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR);
if (g_nexball_basketball_delay_hold)
{
}
WaypointSprite_Kill(ball.owner.waypointsprite_attachedforcarrier);
- //WaypointSprite_AttachCarrier("nb-ball", ball);
WaypointSprite_Spawn("nb-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR); // no health bar please
WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
precache_sound (self.noise1);
precache_sound (self.noise2);
- WaypointSprite_AttachCarrier("nb-ball", self); // the ball's team is not set yet, no rule update needed
- WaypointSprite_UpdateTeamRadar(self.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR);
+ WaypointSprite_AttachCarrier("nb-ball", self, RADARICON_FLAGCARRIER, BALL_SPRITECOLOR); // the ball's team is not set yet, no rule update needed
self.reset = ball_restart;
self.think = InitBall;
.entity waypointsprite_attachedforcarrier;
entity WaypointSprite_Attach(
string spr,
- float limited_range
+ float limited_range,
+ float icon, vector rgb // initial icon and color
)
{
float t, maxdistance;
maxdistance = waypointsprite_limitedrange;
else
maxdistance = 0;
- return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, FALSE, RADARICON_NONE, '0 0 0');
+ return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, FALSE, icon, rgb);
}
entity WaypointSprite_AttachCarrier(
string spr,
- entity carrier
+ entity carrier,
+ float icon, vector rgb // initial icon and color
)
{
entity e;
WaypointSprite_Kill(carrier.waypointsprite_attached); // FC overrides attached
- e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE, RADARICON_NONE, '0 0 0');
+ e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE, icon, rgb);
if(e)
{
WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);