+void Monster_Frozen_Think(entity this)
+{
+ if(STAT(FROZEN, this) == 2)
+ {
+ STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + this.ticrate * this.revive_speed, 1);
+ this.health = max(1, STAT(REVIVE_PROGRESS, this) * this.max_health);
+ this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1);
+
+ if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite)
+ WaypointSprite_UpdateHealth(this.sprite, this.health);
+
+ if(STAT(REVIVE_PROGRESS, this) >= 1)
+ Unfreeze(this);
+ }
+ else if(STAT(FROZEN, this) == 3)
+ {
+ STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) - this.ticrate * this.revive_speed, 1);
+ this.health = max(0, autocvar_g_nades_ice_health + (this.max_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this) );
+
+ if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite)
+ WaypointSprite_UpdateHealth(this.sprite, this.health);
+
+ if(this.health < 1)
+ {
+ Unfreeze(this);
+ this.health = 0;
+ if(this.event_damage)
+ this.event_damage(this, this, this.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, DMG_NOWEP, this.origin, '0 0 0');
+ }
+
+ else if ( STAT(REVIVE_PROGRESS, this) <= 0 )
+ Unfreeze(this);
+ }
+ // otherwise, no revival!
+
+ this.enemy = NULL; // TODO: save enemy, and attack when revived?
+}
+
+void Monster_Enemy_Check(entity this)
+{
+ if(!this.enemy)
+ {
+ this.enemy = Monster_FindTarget(this);
+ if(this.enemy)
+ {
+ WarpZone_RefSys_Copy(this.enemy, this);
+ WarpZone_RefSys_AddInverse(this.enemy, this); // wz1^-1 ... wzn^-1 receiver
+ // update move target immediately?
+ this.moveto = WarpZone_RefSys_TransformOrigin(this.enemy, this, (0.5 * (this.enemy.absmin + this.enemy.absmax)));
+ this.monster_moveto = '0 0 0';
+ this.monster_face = '0 0 0';
+
+ //this.pass_distance = vlen((('1 0 0' * this.enemy.origin_x) + ('0 1 0' * this.enemy.origin_y)) - (('1 0 0' * this.origin_x) + ('0 1 0' * this.origin_y)));
+ Monster_Sound(this, monstersound_sight, 0, false, CH_VOICE);
+ }
+ }
+}
+