X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_client.qc;h=718518231fb6bb9d95d4bc8f471102b35637efcb;hp=93ee2a6a7edd2b99dd1911bd355f850bd251ec84;hb=49e5f5d2c7423c3c4536a57e6740d79d9b8eec94;hpb=1d5e1547c9a4df43a3baf1df9d035ea480092f43 diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 93ee2a6a7e..718518231f 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -186,6 +186,8 @@ void PutObserverInServer (void) if(self.killcount != -666) { Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_SPECTATE, self.netname); + if(autocvar_g_chat_nospectators == 1 || (cvar("g_warmup") && !(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2)) + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_CHAT_NOSPECTATORS); if(self.just_joined == FALSE) { LogTeamchange(self.playerid, -1, 4); @@ -263,6 +265,7 @@ void PutObserverInServer (void) self.punchvector = '0 0 0'; self.oldvelocity = self.velocity; self.fire_endtime = -1; + self.event_damage = func_null; } .float model_randomizer; @@ -281,7 +284,7 @@ void FixPlayermodel() if(teamplay) { string s; - s = Team_ColorName_Lower(self.team); + s = Static_Team_ColorName_Lower(self.team); if(s != "neutral") { defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s)); @@ -541,6 +544,9 @@ void PutClientInServer (void) self.event_damage = PlayerDamage; self.bot_attack = TRUE; + self.monster_attack = TRUE; + + self.spider_slowness = 0; self.statdraintime = time + 5; self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = 0; @@ -781,8 +787,8 @@ void ClientKill_Now() if(self.killindicator_teamchange) ClientKill_Now_TeamChange(); - // in any case: - Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0'); + if(IS_PLAYER(self)) + Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0'); // now I am sure the player IS dead } @@ -1420,7 +1426,7 @@ void player_powerups (void) // add a way to see what the items were BEFORE all of these checks for the mutator hook olditems = self.items; - if((self.items & IT_USING_JETPACK) && !self.deadflag) + if((self.items & IT_USING_JETPACK) && !self.deadflag && !gameover) self.modelflags |= MF_ROCKET; else self.modelflags &= ~MF_ROCKET; @@ -1580,44 +1586,42 @@ float CalcRotRegen(float current, float regenstable, float regenfactor, float re void player_regen (void) { - float minh, mina, minf, maxh, maxa, maxf, limith, limita, limitf, max_mod, regen_mod, rot_mod, limit_mod; - maxh = autocvar_g_balance_health_rotstable; - maxa = autocvar_g_balance_armor_rotstable; - maxf = autocvar_g_balance_fuel_rotstable; - minh = autocvar_g_balance_health_regenstable; - mina = autocvar_g_balance_armor_regenstable; - minf = autocvar_g_balance_fuel_regenstable; - limith = autocvar_g_balance_health_limit; - limita = autocvar_g_balance_armor_limit; - limitf = autocvar_g_balance_fuel_limit; - - max_mod = regen_mod = rot_mod = limit_mod = 1; - - maxh = maxh * max_mod; - //maxa = maxa * max_mod; - //maxf = maxf * max_mod; - minh = minh * max_mod; - //mina = mina * max_mod; - //minf = minf * max_mod; - limith = limith * limit_mod; - limita = limita * limit_mod; - //limitf = limitf * limit_mod; - - if(g_ca) - rot_mod = 0; - - if (!g_minstagib && !g_ca && (!g_lms || autocvar_g_lms_regenerate)) + if(!MUTATOR_CALLHOOK(PlayerRegen)) { + float minh, mina, maxh, maxa, limith, limita, max_mod, regen_mod, rot_mod, limit_mod; + maxh = autocvar_g_balance_health_rotstable; + maxa = autocvar_g_balance_armor_rotstable; + minh = autocvar_g_balance_health_regenstable; + mina = autocvar_g_balance_armor_regenstable; + limith = autocvar_g_balance_health_limit; + limita = autocvar_g_balance_armor_limit; + + max_mod = regen_mod = rot_mod = limit_mod = 1; + + maxh = maxh * max_mod; + minh = minh * max_mod; + limith = limith * limit_mod; + limita = limita * limit_mod; + self.armorvalue = CalcRotRegen(self.armorvalue, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear, rot_mod * frametime * (time > self.pauserotarmor_finished), limita); self.health = CalcRotRegen(self.health, minh, autocvar_g_balance_health_regen, autocvar_g_balance_health_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxh, autocvar_g_balance_health_rot, autocvar_g_balance_health_rotlinear, rot_mod * frametime * (time > self.pauserothealth_finished), limith); - - // if player rotted to death... die! - if(self.health < 1) - self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0'); } + // if player rotted to death... die! + // check this outside above checks, as player may still be able to rot to death + if(self.health < 1) + self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0'); + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) - self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf); + { + float minf, maxf, limitf; + + maxf = autocvar_g_balance_fuel_rotstable; + minf = autocvar_g_balance_fuel_regenstable; + limitf = autocvar_g_balance_fuel_limit; + + self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf); + } } float zoomstate_set; @@ -1988,7 +1992,7 @@ float nJoinAllowed(entity ignore) { float currentlyPlaying = 0; FOR_EACH_REALCLIENT(e) - if(IS_PLAYER(e) || e.caplayer == 1) + if(IS_PLAYER(e) || e.caplayer) currentlyPlaying += 1; if(currentlyPlaying < autocvar_g_maxplayers) @@ -2002,7 +2006,10 @@ float nJoinAllowed(entity ignore) { * g_maxplayers_spectator_blocktime seconds */ void checkSpectatorBlock() { - if(IS_SPEC(self) || IS_OBSERVER(self)) { + if(IS_SPEC(self) || IS_OBSERVER(self)) + if(!self.caplayer) + if(IS_REAL_CLIENT(self)) + { if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) { Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_QUIT_KICK_SPECTATING); dropclient(self); @@ -2422,6 +2429,9 @@ void PlayerPreThink (void) // 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