54 static float prev_missing_teams_mask;
81 it.freezetag_frozen_timeout = 0;
82 it.freezetag_revive_time = 0;
119 else if(winner_team == -1)
126 it.freezetag_frozen_timeout = 0;
127 it.freezetag_revive_time = 0;
191 if (this.
origin != ice_org)
192 setorigin(
this, ice_org);
202 targ.freezetag_frozen_time =
time;
206 STAT(FROZEN, targ) =
true;
207 STAT(REVIVE_PROGRESS, targ) = 0;
209 targ.revive_speed = 0;
212 targ.bot_attack =
false;
213 targ.freeze_time =
time;
217 ice.scale = targ.scale;
220 ice.nextthink =
time;
225 ice.glowmod = ice.colormod;
227 targ.revival_time = 0;
238 if(it.(weaponentity).hook.aiment == targ)
243 WaypointSprite_Spawn(WP_Frozen, 0, 0, targ,
'0 0 64',
NULL, targ.team, targ,
waypointsprite_attached,
true, RADARICON_WAYPOINT);
252 if(!
STAT(FROZEN, targ))
260 STAT(FROZEN, targ) =
false;
261 STAT(REVIVE_PROGRESS, targ) = 0;
262 targ.revival_time =
time;
265 targ.bot_attack =
true;
274 if(it.(weaponentity).hook.aiment == targ)
281 delete(targ.iceblock);
282 targ.iceblock =
NULL;
284 targ.freezetag_frozen_time = 0;
285 targ.freezetag_frozen_timeout = 0;
308 if (
STAT(FROZEN, it))
310 if(
vdist(it.origin -
org, >, sradius))
316 &&
vlen2(it.origin -
org) < best_dist2)
320 best_dist2 =
vlen2(it.origin -
org);
321 if (best_dist2 < 700 ** 2)
406 if (!
STAT(FROZEN,
this))
434 STAT(FROZEN, client) =
STAT(FROZEN, spectatee);
435 STAT(REVIVE_PROGRESS, client) =
STAT(REVIVE_PROGRESS, spectatee);
442 return STAT(FROZEN, player);
456 float frag_deathtype =
M_ARGV(3,
float);
475 if (frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
536 if(player.freezetag_frozen_timeout == -1)
539 if(player.freezetag_frozen_timeout <= -2)
566 if(
STAT(FROZEN, player))
580 CS(it).killcount = 0;
581 it.freezetag_revive_time = 0;
582 it.freezetag_frozen_timeout = -1;
584 it.freezetag_frozen_timeout = 0;
599 return STAT(FROZEN, player);
622 float frag_deathtype =
M_ARGV(3,
float);
641 if (
frag_target.freezetag_frozen_force + t > maxforce)
657 && frag_deathtype != DEATH_TEAMCHANGE.m_id && frag_deathtype != DEATH_AUTOTEAMCHANGE.m_id)
709#ifdef IN_REVIVING_RANGE
710 #undef IN_REVIVING_RANGE
713#define IN_REVIVING_RANGE(player, it, revive_extra_size) \
714 (it != player && !IS_DEAD(it) && SAME_TEAM(it, player) \
715 && boxesoverlap(player.absmin - revive_extra_size, player.absmax + revive_extra_size, it.absmin, it.absmax))
731 player.freezetag_frozen_force = 0;
739 bool player_is_reviving =
false;
744 if (
STAT(FROZEN, it))
746 if ((
STAT(FROZEN, player)))
750 player_is_reviving =
true;
754 if (!(
STAT(FROZEN, player)))
763 while (it.freezetag_revive_time > 1)
766 it.freezetag_revive_time -= 1;
770 revivers_last.chain = it;
777 revivers_last.chain =
NULL;
782 if (!n && player.freezetag_frozen_timeout > 0 &&
time >= player.freezetag_frozen_timeout)
785 float base_progress = 0;
796 if (
STAT(FROZEN, player))
800 if (
STAT(REVIVE_PROGRESS, player) > base_progress)
803 base_progress =
STAT(REVIVE_PROGRESS, player);
808 STAT(REVIVE_PROGRESS, player) = base_progress;
811 STAT(REVIVE_PROGRESS, player) =
bound(base_progress,
STAT(REVIVE_PROGRESS, player) -
frametime * clearspeed * (1 - base_progress), 1);
813 else if (!
STAT(FROZEN, player) && !player_is_reviving)
814 STAT(REVIVE_PROGRESS, player) = base_progress;
816 else if (
STAT(FROZEN, player))
823 if(
STAT(REVIVE_PROGRESS, player) >= 1)
825 float frozen_time =
time - player.freezetag_frozen_time;
835 Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_AUTO_REVIVED, frozen_time);
836 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, player.netname, frozen_time);
841 for(
entity it = revivers_first; it; it = it.chain)
849 Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
850 Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
851 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, revivers_first.netname);
854 string revivers =
"";
855 for(
entity it = revivers_first; it; it = it.chain)
856 revivers =
strcat(revivers,
ftos(it.playerid),
",");
862 for(
entity it = revivers_first; it; it = it.chain)
863 STAT(REVIVE_PROGRESS, it) =
STAT(REVIVE_PROGRESS, player);
866 if (
STAT(FROZEN, player))
868 entity player_wp = player.waypointsprite_attached;
869 if (n > 0 || (n == 0 &&
STAT(REVIVE_PROGRESS, player) > 0.95))
891 return STAT(FROZEN, player);
915 if(!
cvar(
"g_use_ammunition"))
929 M_ARGV(1,
string) =
"You can't spawn monsters while frozen";
937 return !
STAT(FROZEN, targ);
944 if(
STAT(FROZEN, targ))
956 return STAT(FROZEN, targ);
973 bot.havocbot_role_timeout =
time + 10 +
random() * 10;
995 int kill_count_to_attacker =
M_ARGV(3,
int);
996 int kill_count_to_target =
M_ARGV(4,
int);
1031 field(SP_FREEZETAG_REVIVALS,
"revivals", 0);
const int ANIMSTATE_FROZEN
void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
void navigation_goalrating_start(entity this)
void navigation_goalrating_timeout_set(entity this)
bool navigation_goalrating_timeout(entity this)
void navigation_routerating(entity this, entity e, float f, float rangebias)
IntrusiveList g_bot_targets
void navigation_goalrating_end(entity this)
float havocbot_role_timeout
const int CBC_ORDER_FIRST
#define MUTATOR_HOOKFUNCTION(...)
const int CBC_ORDER_EXCLUSIVE
#define MUTATOR_RETURNVALUE
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
const int IT_UNLIMITED_AMMO
const int IT_UNLIMITED_SUPERWEAPONS
#define setmodel(this, m)
const int SFL_SORT_PRIO_PRIMARY
const int EF_TELEPORT_BIT
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
void EliminatedPlayers_Init(float(entity) isEliminated_func)
void GameLogEcho(string s)
bool autocvar_sv_eventlog
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define PutClientInServer
const vector WP_FROZEN_COLOR
const vector WP_REVIVING_COLOR
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
#define APP_TEAM_NUM(num, prefix)
void round_handler_Init(float the_delay, float the_count, float the_round_timelimit)
void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, void() roundStart_func)
#define round_handler_IsActive()
#define round_handler_GetEndTime()
#define round_handler_SetEndDelayTime(t)
#define round_handler_GetEndDelayTime()
#define round_handler_IsRoundStarted()
#define round_handler_ResetEndDelayTime()
#define round_handler_CountdownRunning()
float TeamScore_AddToTeam(int t, float scorefield, float score)
Adds a score to the given team.
void SpectateCopy(entity this, entity spectatee)
void RemoveHook(entity this)
void RemoveGrapplingHooks(entity pl)
#define ITEM_DAMAGE_NEEDKILL(dt)
entity SelectSpawnPoint(entity this, bool anypoint)
ClientState CS(Client this)
bool shuffleteams_on_reset_map
void nades_GiveBonus(entity player, float score)
void havocbot_role_ft_offense(entity this)
#define IN_REVIVING_RANGE(player, it, revive_extra_size)
float autocvar_g_ft_start_ammo_nails
void freezetag_count_alive_players()
void freezetag_Unfreeze(entity targ, bool reset_health)
float autocvar_g_freezetag_round_enddelay
float autocvar_g_ft_start_health
float autocvar_g_ft_start_ammo_fuel
float autocvar_g_freezetag_revive_clearspeed
float autocvar_g_ft_start_ammo_rockets
float autocvar_g_freezetag_frozen_maxtime
float autocvar_g_ft_start_ammo_shells
void freezetag_LastPlayerForTeam_Notify(entity this)
void havocbot_goalrating_ft_freeplayers(entity this, float ratingscale, vector org, float sradius)
void freezetag_Ice_Think(entity this)
void freezetag_Add_Score(entity targ, entity attacker)
void freezetag_Initialize()
int autocvar_g_freezetag_teams_override
void havocbot_role_ft_freeing(entity this)
float autocvar_g_freezetag_warmup
bool freezetag_isEliminated(entity e)
void freezetag_Freeze(entity targ, entity attacker)
bool freezetag_CheckTeams()
float autocvar_g_ft_start_armor
bool freezetag_CheckWinner()
float autocvar_g_freezetag_round_timelimit
float autocvar_g_ft_start_ammo_cells
entity freezetag_LastPlayerForTeam(entity this)
void ft_RemovePlayer(entity this)
bool autocvar_g_frozen_damage_trigger
int autocvar_g_freezetag_revive_auto_reducible
float autocvar_g_freezetag_revive_speed
float autocvar_g_freezetag_revive_spawnshield
float autocvar_g_freezetag_revive_auto_reducible_forcefactor
float autocvar_g_frozen_force
float autocvar_g_freezetag_revive_extra_size
float autocvar_g_freezetag_revive_speed_t2s
int autocvar_g_freezetag_revive_auto_progress
float autocvar_g_frozen_revive_falldamage
string autocvar_g_freezetag_weaponarena
bool autocvar_g_freezetag_revive_auto
float autocvar_g_freezetag_revive_auto_reducible_maxforce
float autocvar_g_freezetag_revive_time_to_score
int autocvar_g_frozen_revive_falldamage_health
void nades_RemovePlayer(entity this)
int autocvar_g_nades_bonus_score_low
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
Header file that describes the resource system.
float autocvar_g_balance_pause_health_regen
#define GameRules_scoring_add(client, fld, value)
#define GameRules_scoring(teams, spprio, stprio, fields)
int Team_GetNumberOfAlivePlayers(entity team_ent)
Returns the number of alive players in a team.
entity Entity_GetTeam(entity this)
Returns the team entity of the given entity.
int Team_GetWinnerAliveTeam()
Returns the winner team.
bool Entity_HasValidTeam(entity this)
Returns whether the given entity belongs to a valid team.
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings.
int Team_GetNumberOfAliveTeams()
Returns the number of alive teams.
void Team_SetNumberOfAlivePlayers(entity team_ent, int number)
Sets the number of alive players in a team.
entity Team_GetTeamFromIndex(int index)
Returns the global team entity at the given index.
vector Team_ColorRGB(int teamid)
const int NUM_TEAMS
Number of teams in the game.
int Team_IndexToBit(int index)
Converts team index into bit value that is used in team bitmasks.
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void WaypointSprite_Kill(entity wp)
void WaypointSprite_UpdateTeamRadar(entity e, entity icon, vector col)
void WaypointSprite_UpdateSprites(entity e, entity _m1, entity _m2, entity _m3)
void WaypointSprite_UpdateMaxHealth(entity e, float f)
entity WaypointSprite_Spawn(entity spr, float _lifetime, float maxdistance, entity ref, vector ofs, entity showto, float t, entity own,.entity ownfield, float hideable, entity icon)
void WaypointSprite_UpdateHealth(entity e, float f)
entity waypointsprite_attached
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
float warmup_start_ammo_cells
float warmup_start_ammo_rockets
float warmup_start_ammo_shells
float warmup_start_ammo_nails
float warmup_start_health
float warmup_start_ammo_fuel
float warmup_start_armorvalue