]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Merge branch 'master' into Mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index c687c4502c33ae7c7ec9c8c69fc95559f6d2a788..70811e6fec603969a4a5f5751dbedfb461d0f273 100644 (file)
@@ -168,6 +168,8 @@ void PutObserverInServer (void)
 
        Portal_ClearAll(self);
        
+       Unfreeze(self);
+       
        if(self.alivetime)
        {
                if(!inWarmupStage)
@@ -532,6 +534,7 @@ void PutClientInServer (void)
                self.event_damage = PlayerDamage;
 
                self.bot_attack = TRUE;
+               self.monster_attack = TRUE;
 
                self.statdraintime = time + 5;
                self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = 0;
@@ -577,6 +580,8 @@ void PutClientInServer (void)
                                self.target = s;
                        activator = world;
                self = oldself;
+               
+               Unfreeze(self);
 
                spawn_spot = spot;
                MUTATOR_CALLHOOK(PlayerSpawn);
@@ -927,7 +932,7 @@ void ClientKill (void)
 {
        if(gameover) return;
        if(self.player_blocked) return;
-       if(self.freezetag_frozen) return;
+       if(self.frozen) return;
        
        ClientKill_TeamChange(0);
 }
@@ -1277,6 +1282,8 @@ void ClientDisconnect (void)
        MUTATOR_CALLHOOK(ClientDisconnect);
 
        Portal_ClearAll(self);
+       
+       Unfreeze(self);
 
        RemoveGrapplingHook(self);
 
@@ -1517,15 +1524,6 @@ void player_powerups (void)
        if(autocvar_g_fullbrightplayers)
                self.effects = self.effects | EF_FULLBRIGHT;
 
-       // midair gamemode: damage only while in the air
-       // if in midair mode, being on ground grants temporary invulnerability
-       // (this is so that multishot weapon don't clear the ground flag on the
-       // first damage in the frame, leaving the player vulnerable to the
-       // remaining hits in the same frame)
-       if (self.flags & FL_ONGROUND)
-       if (g_midair)
-               self.spawnshieldtime = max(self.spawnshieldtime, time + autocvar_g_midair_shieldtime);
-
        if (time >= game_starttime)
        if (time < self.spawnshieldtime)
                self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
@@ -1728,6 +1726,8 @@ void SpectateCopy(entity spectatee) {
        self.dmg_inflictor = spectatee.dmg_inflictor;
        self.v_angle = spectatee.v_angle;
        self.angles = spectatee.v_angle;
+       self.frozen = spectatee.frozen;
+       self.revive_progress = spectatee.revive_progress;
        if(!self.BUTTON_USE)
                self.fixangle = TRUE;
        setorigin(self, spectatee.origin);
@@ -2238,6 +2238,16 @@ void PlayerPreThink (void)
                return;
 #endif
 
+       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);
+               self.iceblock.alpha = 1 - self.revive_progress;
+
+               if(self.revive_progress >= 1)
+                       Unfreeze(self);
+       }
+
        MUTATOR_CALLHOOK(PlayerPreThink);
 
        if(!self.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
@@ -2355,11 +2365,9 @@ void PlayerPreThink (void)
                float do_crouch = self.BUTTON_CROUCH;
                if(self.hook.state)
                        do_crouch = 0;
-               if(self.health <= g_bloodloss)
-                       do_crouch = 1;
                if(self.vehicle)
                        do_crouch = 0;
-               if(self.freezetag_frozen)
+               if(self.frozen)
                        do_crouch = 0;
                if(self.weapon == WEP_SHOTGUN && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
                        do_crouch = 0;
@@ -2388,15 +2396,6 @@ void PlayerPreThink (void)
                        }
                }
 
-               if(self.health <= g_bloodloss && self.deadflag == DEAD_NO)
-               {
-                       if(self.bloodloss_timer < time)
-                       {
-                               self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
-                               self.bloodloss_timer = time + 0.5 + random() * 0.5;
-                       }
-               }
-
                FixPlayermodel();
 
                GrapplingHookFrame();
@@ -2424,13 +2423,13 @@ void PlayerPreThink (void)
 
                if(frametime)
                        player_anim();
-
-               if(g_nexball)
-                       nexball_setstatus();
                
                // secret status
                secrets_setstatus();
                
+               // monsters status
+               monsters_setstatus();
+               
                self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
 
                //self.angles_y=self.v_angle_y + 90;   // temp