set g_ctf_flag_return_dropped 100
set g_ctf_flag_return_damage 0
set g_ctf_flag_return_when_unreachable 1 "automatically return the flag if it falls into lava/slime/trigger hurt"
-set g_ctf_flagcarrier_auto_helpme_when_damaged 100
+set g_ctf_flagcarrier_auto_helpme_damage 100 "automatically place a helpme notification on flag carrier waypointsprite if they get hit and their health dips below this value"
+set g_ctf_flagcarrier_auto_helpme_time 2 "antispam time for the helpme notification"
set g_ctf_flagcarrier_selfdamagefactor 1
set g_ctf_flagcarrier_selfforcefactor 1
set g_ctf_flagcarrier_damagefactor 1
float autocvar_g_ctf_flag_return_when_unreachable;
float autocvar_g_ctf_flag_return_damage;
float autocvar_g_ctf_flag_return_dropped;
-float autocvar_g_ctf_flagcarrier_auto_helpme_when_damaged;
+float autocvar_g_ctf_flagcarrier_auto_helpme_damage;
+float autocvar_g_ctf_flagcarrier_auto_helpme_time;
float autocvar_g_ctf_flagcarrier_selfdamagefactor;
float autocvar_g_ctf_flagcarrier_selfforcefactor;
float autocvar_g_ctf_flagcarrier_damagefactor;
}
else if(frag_target.flagcarried && (frag_target.deadflag == DEAD_NO) && IsDifferentTeam(frag_target, frag_attacker)) // if the target is a flagcarrier
{
- if(autocvar_g_ctf_flagcarrier_auto_helpme_when_damaged > ('1 0 0' * healtharmor_maxdamage(frag_target.health, frag_target.armorvalue, autocvar_g_balance_armor_blockpercent)))
+ if(autocvar_g_ctf_flagcarrier_auto_helpme_damage > ('1 0 0' * healtharmor_maxdamage(frag_target.health, frag_target.armorvalue, autocvar_g_balance_armor_blockpercent)))
+ if(time > frag_target.wps_helpme_time + autocvar_g_ctf_flagcarrier_auto_helpme_time)
+ {
+ frag_target.wps_helpme_time = time;
WaypointSprite_HelpMePing(frag_target.wps_flagcarrier);
+ }
}
return FALSE;
}
{
if(self.wps_flagcarrier) // update the flagcarrier waypointsprite with "NEEDING HELP" notification
{
+ self.wps_helpme_time = time;
WaypointSprite_HelpMePing(self.wps_flagcarrier);
}
else // create a normal help me waypointsprite
.entity wps_flagcarrier;
.entity wps_flagdropped;
.entity wps_enemyflagcarrier;
+.float wps_helpme_time;
float wpforenemy_announced;
float wpforenemy_nextthink;