set g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
set g_freezetag_revive_nade 1 "Enable reviving from own nade explosion"
set g_freezetag_revive_nade_health 40 "Amount of health player has if they revived from their own nade explosion"
+set g_freezetag_revive_time_to_score 1.5 "every this amount of seconds give players reviving a frozen teammate 1 point"
set g_freezetag_round_timelimit 360 "round time limit in seconds"
set g_freezetag_revive_auto 1 "automatically revive frozen players after some time (g_freezetag_frozen_maxtime)"
set g_freezetag_revive_auto_progress 1 "start the automatic reviving progress as soon as the player gets frozen"
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
FOREACH_CLIENT(IS_PLAYER(it), {
it.freezetag_frozen_timeout = 0;
+ it.freezetag_revive_time = 0;
nades_Clear(it);
});
game_stopped = true;
FOREACH_CLIENT(IS_PLAYER(it), {
it.freezetag_frozen_timeout = 0;
+ it.freezetag_revive_time = 0;
nades_Clear(it);
});
{
if(attacker == targ)
{
- // you froze your own dumb targ
+ // you froze your own dumb self
// counted as "suicide" already
GameRules_scoring_add(targ, SCORE, -1);
}
{
FOREACH_CLIENT(IS_PLAYER(it), {
CS(it).killcount = 0;
+ it.freezetag_revive_time = 0;
it.freezetag_frozen_timeout = -1;
PutClientInServer(it);
it.freezetag_frozen_timeout = 0;
int n = 0;
vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
FOREACH_CLIENT(IS_PLAYER(it) && IS_REVIVING(player, it, revive_extra_size), {
+ if (autocvar_g_freezetag_revive_time_to_score > 0 && STAT(FROZEN, player) == FROZEN_NORMAL)
+ {
+ it.freezetag_revive_time += frametime / autocvar_g_freezetag_revive_time_to_score;
+ while (it.freezetag_revive_time > 1)
+ {
+ GameRules_scoring_add(it, SCORE, +1);
+ it.freezetag_revive_time -= 1;
+ }
+ }
if (reviving_players_last)
reviving_players_last.chain = it;
reviving_players_last = it;
if (!n) // no teammate nearby
{
+ float clearspeed = autocvar_g_freezetag_revive_clearspeed;
+ if (autocvar_g_freezetag_revive_time_to_score > 0)
+ clearspeed = 0; // prevent stacking points by entering and exiting the revival zone many times
if (STAT(FROZEN, player) == FROZEN_NORMAL)
- STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) - frametime * autocvar_g_freezetag_revive_clearspeed * (1 - base_progress), 1);
+ STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) - frametime * clearspeed * (1 - base_progress), 1);
else if (!STAT(FROZEN, player))
STAT(REVIVE_PROGRESS, player) = base_progress; // thawing nobody
}
return 0;
}
+.float freezetag_revive_time;
.float freezetag_frozen_time;
.float freezetag_frozen_timeout;
const float ICE_MAX_ALPHA = 1;
float autocvar_g_freezetag_revive_auto_reducible_forcefactor;
float autocvar_g_freezetag_revive_extra_size;
float autocvar_g_freezetag_revive_speed;
+float autocvar_g_freezetag_revive_time_to_score = 1.5;
bool autocvar_g_freezetag_revive_nade;
float autocvar_g_freezetag_revive_nade_health;