X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fgamemode_onslaught.qc;fp=qcsrc%2Fserver%2Fmutators%2Fgamemode_onslaught.qc;h=e47999e7407647d0c800d715e4175d6f52fbc6fe;hb=e80962600618cee1bb882cf785a2f3011466e12c;hp=ecf2194006a2e34dcce37fae1f0782ca91d695eb;hpb=5091a7dc144aa6a2c50573d9e84d4af16101b2d2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index ecf219400..e47999e74 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -389,7 +389,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag if(self.owner.iscaptured) WaypointSprite_UpdateHealth(self.owner.sprite, self.health); else - WaypointSprite_UpdateBuildFinished(self.owner.sprite, time + (self.max_health - self.health) / (self.count / CP_THINKRATE)); + WaypointSprite_UpdateBuildFinished(self.owner.sprite, time + (self.max_health - self.health) / (self.count / ONS_CP_THINKRATE)); self.pain_finished = time + 1; // particles on every hit pointparticles(particleeffectnum("sparks"), hitloc, force*-1, 1); @@ -439,7 +439,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag void ons_ControlPoint_Icon_Think() { entity oself; - self.nextthink = time + CP_THINKRATE; + self.nextthink = time + ONS_CP_THINKRATE; if(autocvar_g_onslaught_cp_proxydecap) { @@ -463,8 +463,8 @@ void ons_ControlPoint_Icon_Think() } } - _friendly_count = _friendly_count * (autocvar_g_onslaught_cp_proxydecap_dps * CP_THINKRATE); - _enemy_count = _enemy_count * (autocvar_g_onslaught_cp_proxydecap_dps * CP_THINKRATE); + _friendly_count = _friendly_count * (autocvar_g_onslaught_cp_proxydecap_dps * ONS_CP_THINKRATE); + _enemy_count = _enemy_count * (autocvar_g_onslaught_cp_proxydecap_dps * ONS_CP_THINKRATE); self.health = bound(0, self.health + (_friendly_count - _enemy_count), self.max_health); self.SendFlags |= CPSF_STATUS; @@ -522,7 +522,7 @@ void ons_ControlPoint_Icon_BuildThink() entity oself; float a; - self.nextthink = time + CP_THINKRATE; + self.nextthink = time + ONS_CP_THINKRATE; // only do this if there is power a = ons_ControlPoint_CanBeLinked(self.owner, self.owner.team); @@ -536,7 +536,7 @@ void ons_ControlPoint_Icon_BuildThink() if (self.health >= self.max_health) { self.health = self.max_health; - self.count = autocvar_g_onslaught_cp_regen * CP_THINKRATE; // slow repair rate from now on + self.count = autocvar_g_onslaught_cp_regen * ONS_CP_THINKRATE; // slow repair rate from now on self.think = ons_ControlPoint_Icon_Think; sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTEN_NORM); self.owner.iscaptured = TRUE; @@ -593,7 +593,7 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player) e.event_damage = ons_ControlPoint_Icon_Damage; e.team = player.team; e.colormap = 1024 + (e.team - 1) * 17; - e.count = (e.max_health - e.health) * CP_THINKRATE / autocvar_g_onslaught_cp_buildtime; // how long it takes to build + e.count = (e.max_health - e.health) * ONS_CP_THINKRATE / autocvar_g_onslaught_cp_buildtime; // how long it takes to build sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTEN_NORM); @@ -603,7 +603,7 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player) pointparticles(particleeffectnum(sprintf("%sflag_touch", Static_Team_ColorName_Lower(player.team))), e.origin, '0 0 0', 1); - WaypointSprite_UpdateBuildFinished(cp.sprite, time + (e.max_health - e.health) / (e.count / CP_THINKRATE)); + WaypointSprite_UpdateBuildFinished(cp.sprite, time + (e.max_health - e.health) / (e.count / ONS_CP_THINKRATE)); WaypointSprite_UpdateRule(cp.sprite,cp.team,SPRITERULE_TEAMPLAY); cp.sprite.SendFlags |= 16; @@ -684,6 +684,7 @@ void ons_ControlPoint_Touch() return; if(!IS_PLAYER(toucher)) { return; } + if(toucher.frozen) { return; } if(toucher.deadflag != DEAD_NO) { return; } if ( SAME_TEAM(self,toucher) ) @@ -710,7 +711,7 @@ void ons_ControlPoint_Touch() void ons_ControlPoint_Think() { - self.nextthink = time + CP_THINKRATE; + self.nextthink = time + ONS_CP_THINKRATE; CSQCMODEL_AUTOUPDATE(); } @@ -727,7 +728,7 @@ void ons_ControlPoint_Reset() self.isshielded = TRUE; self.think = ons_ControlPoint_Think; self.ons_toucher = world; - self.nextthink = time + CP_THINKRATE; + self.nextthink = time + ONS_CP_THINKRATE; setmodel_fixsize(self, "models/onslaught/controlpoint_pad.md3"); WaypointSprite_UpdateMaxHealth(self.sprite, 0); @@ -766,7 +767,7 @@ void ons_ControlPoint_Setup(entity cp) cp.movetype = MOVETYPE_NONE; cp.touch = ons_ControlPoint_Touch; cp.think = ons_ControlPoint_Think; - cp.nextthink = time + CP_THINKRATE; + cp.nextthink = time + ONS_CP_THINKRATE; cp.reset = ons_ControlPoint_Reset; cp.colormap = 1024; cp.iscaptured = FALSE; @@ -1196,8 +1197,10 @@ float Onslaught_CheckWinner() { e.ons_roundlost = TRUE; e.player_blocked = TRUE; + + nades_Clear(e); } - + return 1; } @@ -1992,42 +1995,46 @@ MUTATOR_HOOKFUNCTION(ons_SV_ParseClientCommand) if ( IS_PLAYER(self) ) { - entity source_point = ons_Nearest_ControlPoint(self.origin, autocvar_g_onslaught_teleport_radius); - - if ( !source_point && self.health > 0 ) - { - sprint(self, "\nYou need to be next to a control point\n"); - return 1; - } - - entity closest_target = ons_Nearest_ControlPoint_2D(pos, autocvar_g_onslaught_click_radius); - - if ( closest_target == world ) - { - sprint(self, "\nNo control point found\n"); - return 1; - } - - if ( self.health <= 0 ) - { - self.ons_spawn_by = closest_target; - self.respawn_flags = self.respawn_flags | RESPAWN_FORCE; - } - else + if ( !self.frozen ) { - if ( source_point == closest_target ) + entity source_point = ons_Nearest_ControlPoint(self.origin, autocvar_g_onslaught_teleport_radius); + + if ( !source_point && self.health > 0 ) { - sprint(self, "\nTeleporting to the same point\n"); + sprint(self, "\nYou need to be next to a control point\n"); return 1; } - - if ( !ons_Teleport(self,closest_target,autocvar_g_onslaught_teleport_radius,TRUE) ) - sprint(self, "\nUnable to teleport there\n"); + + + entity closest_target = ons_Nearest_ControlPoint_2D(pos, autocvar_g_onslaught_click_radius); + + if ( closest_target == world ) + { + sprint(self, "\nNo control point found\n"); + return 1; + } + + if ( self.health <= 0 ) + { + self.ons_spawn_by = closest_target; + self.respawn_flags = self.respawn_flags | RESPAWN_FORCE; + } + else + { + if ( source_point == closest_target ) + { + sprint(self, "\nTeleporting to the same point\n"); + return 1; + } + + if ( !ons_Teleport(self,closest_target,autocvar_g_onslaught_teleport_radius,TRUE) ) + sprint(self, "\nUnable to teleport there\n"); + } + + return 1; } - //sprint(self, "\nNo teleportation for you\n"); - - return 1; + sprint(self, "\nNo teleportation for you\n"); } return 1;