12 #define AS_ROUND_DELAY 5 24 target_objective_decrease_activate(it);
52 if(trigger.assault_sprite)
54 WaypointSprite_Disown(trigger.assault_sprite, waypointsprite_deadlifetime);
55 if(trigger.classname ==
"func_assault_destructible")
56 trigger.sprite =
NULL;
64 if (hlth - this.
dmg > 0.5)
75 if(this.
enemy.message)
87 if(this.enemy == NULL)
90 objerror(this,
"more than one objective as target - fix the map!");
95 objerror(
this,
"no objective as target - fix the map!");
112 if(it.assault_sprite !=
NULL)
114 WaypointSprite_Disown(it.assault_sprite, waypointsprite_deadlifetime);
115 if(it.classname ==
"func_assault_destructible")
119 spr = WaypointSprite_SpawnFixed(WP_AssaultDefend, 0.5 * (it.absmin + it.absmax), it,
assault_sprite, RADARICON_OBJECTIVE);
120 spr.assault_decreaser =
this;
123 if(it.classname ==
"func_assault_destructible")
125 WaypointSprite_UpdateSprites(spr, WP_AssaultDefend, WP_AssaultDestroy, WP_AssaultDestroy);
126 WaypointSprite_UpdateMaxHealth(spr, it.max_health);
127 WaypointSprite_UpdateHealth(spr, GetResource(it, RES_HEALTH));
131 WaypointSprite_UpdateSprites(spr, WP_AssaultDefend, WP_AssaultPush, WP_AssaultPush);
183 this.
model = this.mdl;
213 bprint(
"Starting second round...\n");
221 game_stopped =
false;
264 Send_Notification(NOTIF_ALL,
NULL, MSG_CENTER, CENTER_ASSAULT_OBJ_DESTROYED,
ceil(
time - game_starttime));
272 if(autocvar_timelimit > 0)
273 if(
time + AS_ROUND_DELAY >= game_starttime + autocvar_timelimit * 60)
274 cvar_set(
"timelimit",
ftos(autocvar_timelimit + AS_ROUND_DELAY / 60));
285 if (!
g_assault) {
delete(
this);
return; }
288 spawnfunc_info_player_deathmatch(
this);
293 if (!
g_assault) {
delete(
this);
return; }
296 spawnfunc_info_player_deathmatch(
this);
301 if (!
g_assault) {
delete(
this);
return; }
312 if (!
g_assault) {
delete(
this);
return; }
330 float true_limit = ((limit !=
RES_LIMIT_NONE) ? limit : targ.max_health);
332 if (hlth <= 0 || hlth >= true_limit)
340 func_breakable_colormod(targ);
346 if (!
g_assault) {
delete(
this);
return; }
357 func_breakable_setup(
this);
362 if (!
g_assault) {
delete(
this);
return; }
364 this.mdl = this.
model;
365 _setmodel(
this, this.mdl);
374 if (!
g_assault) {
delete(
this);
return; }
384 if (!
g_assault) {
delete(
this);
return; }
402 IL_EACH(g_assault_objectivedecreasers, it.targetname == destr.target,
404 float hlth = GetResource(it.enemy, RES_HEALTH);
405 if (hlth > 0 && hlth < ASSAULT_VALUE_INACTIVE)
415 vector p = 0.5 * (it.absmin + it.absmax);
426 if(checkpvs(it.origin, des))
429 if(it.cnt < bestvalue)
561 Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ASSAULT_ATTACKING);
563 Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ASSAULT_DEFENDING);
570 if(!turret.team || turret.team ==
FLOAT_MAX)
578 veh.nextthink =
time + 0.5;
593 return (frag_victim.classname ==
"func_assault_destructible");
620 switch(ent.classname)
622 case "info_player_team1":
623 case "info_player_team2":
624 case "info_player_team3":
625 case "info_player_team4":
#define IL_EACH(this, cond, body)
float havocbot_role_timeout
void navigation_goalrating_start(entity this)
void target_assault_roundend_use(entity this, entity actor, entity trigger)
void turret_respawn(entity this)
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
void ReadyRestart_force(bool is_fake_round_start)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
void navigation_goalrating_end(entity this)
void havocbot_goalrating_ast_targets(entity this, float ratingscale)
void havocbot_role_ast_offense(entity this)
void SetWinners(.float field, float value)
float TeamScore_AddToTeam(int t, float scorefield, float score)
Adds a score to the given team.
spawn_evalfunc_t spawn_evalfunc
void assault_roundstart_use(entity this, entity actor, entity trigger)
const int ASSAULT_VALUE_INACTIVE
void assault_objective_decrease_use(entity this, entity actor, entity trigger)
const int ST_ASSAULT_OBJECTIVES
#define FOREACH_CLIENT(cond, body)
float checkpvs(vector viewpos, entity viewee)
void SUB_UseTargets(entity this, entity actor, entity trigger)
ERASEABLE string process_time(float outputtype, int seconds)
bool assault_decreaser_sprite_visible(entity this, entity player, entity view)
spawnfunc(info_player_attacker)
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
IntrusiveList g_assault_objectives
void target_objective_decrease_findtarget(entity this)
void navigation_routerating(entity this, entity e, float f, float rangebias)
float havocbot_attack_time
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#define FOREACH_ENTITY_STRING(fld, match, body)
bool destructible_heal(entity targ, entity inflictor, float amount, float limit)
const int SPRITERULE_TEAMPLAY
const int HAVOCBOT_AST_ROLE_DEFENSE
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
void assault_new_round(entity this)
void assault_roundstart_use_this(entity this)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
bool navigation_goalrating_timeout(entity this)
vector target_objective_spawn_evalfunc(entity this, entity player, entity spot, vector current)
#define GameRules_scoring_add_team(client, fld, value)
void assault_objective_use(entity this, entity actor, entity trigger)
void target_assault_roundend_reset(entity this)
MUTATOR_HOOKFUNCTION(as, PlayerSpawn)
void havocbot_ast_reset_role(entity this)
const int HAVOCBOT_AST_ROLE_OFFENSE
void havocbot_role_ast_setrole(entity this, float role)
void assault_setenemytoobjective(entity this)
void navigation_goalrating_timeout_set(entity this)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void assault_objective_reset(entity this)
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void InitializeEntity(entity e, void(entity this) func, int order)
bool sv_ready_restart_after_countdown
int WinningCondition_Assault()
IntrusiveList g_saved_team
const int WAYPOINTFLAG_GENERATED
IntrusiveList g_assault_destructibles
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings...
void target_objective_decrease_activate(entity this)
void assault_wall_think(entity this)
#define Team_ColoredFullName(teamid)
void havocbot_role_ast_defense(entity this)
float assault_attacker_team
IntrusiveList g_assault_objectivedecreasers
void WinningConditionHelper(entity this)
Sets the following results for the current scores entities.