activator = world;
self = oldself;
- Unfreeze(self, revive_progress);
+ Unfreeze(self);
spawn_spot = spot;
MUTATOR_CALLHOOK(PlayerSpawn);
return;
#endif
- if(self.frozen)
+ if(self.frozen == 2)
{
self.revive_progress = bound(0, self.revive_progress + frametime * self.revive_speed, 1);
self.health = max(1, self.revive_progress * autocvar_g_balance_health_start);
if(self.revive_progress >= 1)
- Unfreeze(self, revive_progress);
+ Unfreeze(self);
}
MUTATOR_CALLHOOK(PlayerPreThink);
.float player_blocked;
-.float freezetag_revive_progress;
-
.float frozen; // for freeze attacks
.float revive_progress;
.float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
self.nextthink = time;
}
-void Freeze (entity targ, float freeze_time, float frozen_type, .float revive_flag)
+void Freeze (entity targ, float freeze_time, float frozen_type)
{
float monster = (targ.flags & FL_MONSTER);
float player = (targ.flags & FL_CLIENT);
return;
targ.frozen = frozen_type;
- targ.revive_flag = 0;
+ targ.revive_progress = 0;
targ.health = 1;
targ.revive_speed = freeze_time;
RemoveGrapplingHook(targ);
}
-void Unfreeze (entity targ, .float revive_flag)
+void Unfreeze (entity targ)
{
targ.frozen = 0;
- targ.revive_flag = 0;
+ targ.revive_progress = 0;
targ.health = ((targ.classname == STR_PLAYER) ? autocvar_g_balance_health_start : targ.max_health);
// remove the ice block
mirrorforce *= g_weaponforcefactor;
}
- if(targ.frozen && attacker.monsterid != MONSTER_SPIDER && deathtype != DEATH_HURTTRIGGER)
+ if(((targ.frozen == 2 && attacker.monsterid != MONSTER_SPIDER) || (targ.frozen == 1)) && deathtype != DEATH_HURTTRIGGER)
{
damage = 0;
force *= 0.2;
addstat(STAT_YELLOWALIVE, AS_INT, yellowalive_stat);
addstat(STAT_PINKALIVE, AS_INT, pinkalive_stat);
}
- if(g_freezetag)
- addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, freezetag_revive_progress);
if(g_td)
{
self.angles = self.pos2;
self.health = self.max_health; // TODO: check if resetting to max_health is wise here
- if(vlen(self.velocity) > 0)
- self.SendFlags |= MSF_MOVE;
+ self.SendFlags |= MSF_MOVE;
return;
}
self.nextthink = time + 0.1;
if(self.revive_progress >= 1)
- Unfreeze(self, revive_progress); // wait for next think before attacking
+ Unfreeze(self); // wait for next think before attacking
self.SendFlags |= MSF_MOVE;
self.checkattack();
self.SendFlags |= MSF_ANG;
-
- if(vlen(self.velocity) > 0)
- self.SendFlags |= MSF_MOVE;
+ self.SendFlags |= MSF_MOVE;
}
void monster_dead_think()
return;
}
- if(vlen(self.velocity) > 0)
- self.SendFlags |= MSF_MOVE; // keep up to date on the monster's location
+ self.SendFlags |= MSF_MOVE; // keep up to date on the monster's location
}
void monsters_setstatus()
if not(self.flags & FL_FLY)
self.velocity = '0 0 0';
- if(vlen(self.velocity) > 0)
- self.SendFlags |= MSF_MOVE;
+ self.SendFlags |= MSF_MOVE;
totalspawned -= 1;
}
switch(self.realowner.spider_type)
{
case SPIDER_TYPE_ICE:
- Freeze(other, 0.3, 2, revive_progress);
+ Freeze(other, 0.3, 2);
break;
case SPIDER_TYPE_FIRE:
Fire_AddDamage(other, self.realowner, 5 * monster_skill, autocvar_g_monster_spider_attack_fire_time, DEATH_MONSTER_SPIDER_FIRE);
self.health = 1;
- Freeze(self, 0, 1, freezetag_revive_progress);
+ Freeze(self, 0, 1);
// add waypoint
WaypointSprite_Spawn("freezetag_frozen", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attached, TRUE, RADARICON_WAYPOINT, '0.25 0.90 1');
void freezetag_Unfreeze(entity attacker)
{
- Unfreeze(self, freezetag_revive_progress);
+ Unfreeze(self);
// remove waypoint
if(self.waypointsprite_attached)
if(n && self.frozen == 1) // OK, there is at least one teammate reviving us
{
- self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress + frametime * autocvar_g_freezetag_revive_speed, 1);
- self.health = max(1, self.freezetag_revive_progress * autocvar_g_balance_health_start);
+ self.revive_progress = bound(0, self.revive_progress + frametime * autocvar_g_freezetag_revive_speed, 1);
+ self.health = max(1, self.revive_progress * autocvar_g_balance_health_start);
- if(self.freezetag_revive_progress >= 1)
+ if(self.revive_progress >= 1)
{
freezetag_Unfreeze(self);
// now find EVERY teammate within reviving radius, set their revive_progress values correct
FOR_EACH_PLAYER(other) if(self != other)
{
- if(other.frozen != 1)
+ if(!other.frozen)
{
if(other.team == self.team)
{
if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
- other.freezetag_revive_progress = self.freezetag_revive_progress;
+ other.revive_progress = self.revive_progress;
}
}
}
}
else if(!n && self.frozen == 1) // only if no teammate is nearby will we reset
{
- self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
- self.health = max(1, self.freezetag_revive_progress * autocvar_g_balance_health_start);
+ self.revive_progress = bound(0, self.revive_progress - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
+ self.health = max(1, self.revive_progress * autocvar_g_balance_health_start);
}
- else if(!n)
+ else if(!n && !self.frozen)
{
- self.freezetag_revive_progress = 0; // thawing nobody
+ self.revive_progress = 0; // thawing nobody
}
return 1;