From: Jakob MG Date: Mon, 11 Jun 2012 12:11:13 +0000 (+0200) Subject: Kill credits to whoever made a vehicle blow up and killing someone else X-Git-Tag: xonotic-v0.7.0~312^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4989f9f6b084063ba3ad9565a9b3ade9b1033728;p=xonotic%2Fxonotic-data.pk3dir.git Kill credits to whoever made a vehicle blow up and killing someone else --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 27e0a0dc1..8bdd76b75 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1745,7 +1745,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } else if(type == DEATH_SBBLOWUP) { HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC); if(alsoprint) - print (sprintf(_("^1%s^1 got caught in the destruction of %s^1's vehicle\n"), s2, s1)); + print (sprintf(_("^1%s^1 got caught in the blast when %s^1's destroys a vehicle\n"), s2, s1)); } else if(type == DEATH_WAKIGUN) { HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC); if(alsoprint) @@ -1757,7 +1757,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } else if(type == DEATH_WAKIBLOWUP) { HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC); if(alsoprint) - print (sprintf(_("^1%s^1 dies when %s^1's wakizashi dies.\n"), s2, s1)); + print (sprintf(_("^1%s^1 got caught in the blast when %s^1's destroys a vehicle\n"), s2, s1)); } else if(type == DEATH_RAPTOR_CANNON) { HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC); if(alsoprint) @@ -1769,7 +1769,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } else if(type == DEATH_RAPTOR_DEATH) { HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC); if(alsoprint) - print (sprintf(_("^1%s^1 dies when %s^1's raptor dies.\n"), s2, s1)); + print (sprintf(_("^1%s^1 got caught in the blast when %s^1's destroys a vehicle\n"), s2, s1)); } else if(type == DEATH_TURRET) { HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC); if(alsoprint) diff --git a/qcsrc/server/vehicles/racer.qc b/qcsrc/server/vehicles/racer.qc index c6523e4b8..711534fbf 100644 --- a/qcsrc/server/vehicles/racer.qc +++ b/qcsrc/server/vehicles/racer.qc @@ -555,7 +555,7 @@ void racer_blowup() self.deadflag = DEAD_DEAD; self.vehicle_exit(VHEF_NORMAL); - RadiusDamage (self, self, autocvar_g_vehicle_racer_blowup_coredamage, + RadiusDamage (self, self.enemy, autocvar_g_vehicle_racer_blowup_coredamage, autocvar_g_vehicle_racer_blowup_edgedamage, autocvar_g_vehicle_racer_blowup_radius, world, autocvar_g_vehicle_racer_blowup_forceintensity, diff --git a/qcsrc/server/vehicles/raptor.qc b/qcsrc/server/vehicles/raptor.qc index ad5252dfd..4bf674e1b 100644 --- a/qcsrc/server/vehicles/raptor.qc +++ b/qcsrc/server/vehicles/raptor.qc @@ -554,7 +554,7 @@ void raptor_blowup() { self.deadflag = DEAD_DEAD; self.vehicle_exit(VHEF_NORMAL); - RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world); + RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world); self.alpha = -1; self.movetype = MOVETYPE_NONE; diff --git a/qcsrc/server/vehicles/spiderbot.qc b/qcsrc/server/vehicles/spiderbot.qc index 913e3316f..eec621e47 100644 --- a/qcsrc/server/vehicles/spiderbot.qc +++ b/qcsrc/server/vehicles/spiderbot.qc @@ -566,7 +566,7 @@ void spiderbot_blowup() SUB_SetFade(g1, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10)); SUB_SetFade(g2, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10)); - RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world); + RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world); self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1; self.movetype = MOVETYPE_NONE; diff --git a/qcsrc/server/vehicles/vehicles.qc b/qcsrc/server/vehicles/vehicles.qc index b6ca4f943..071ee74ac 100644 --- a/qcsrc/server/vehicles/vehicles.qc +++ b/qcsrc/server/vehicles/vehicles.qc @@ -198,24 +198,24 @@ void targetdrone_think() { self.nextthink = time + 0.1; - if(self.enemy) - if(self.enemy.deadflag != DEAD_NO) - self.enemy = targetdrone_getfear(); + if(self.wp00) + if(self.wp00.deadflag != DEAD_NO) + self.wp00 = targetdrone_getfear(); - if(!self.enemy) - self.enemy = targetdrone_getfear(); + if(!self.wp00) + self.wp00 = targetdrone_getfear(); vector newdir; - if(self.enemy) - newdir = steerlib_push(self.enemy.origin) + randomvec() * 0.75; + if(self.wp00) + newdir = steerlib_push(self.wp00.origin) + randomvec() * 0.75; else newdir = randomvec() * 0.75; newdir = newdir * 0.5 + normalize(self.velocity) * 0.5; - if(self.enemy) - self.velocity = normalize(newdir) * (500 + (1024 / min(vlen(self.enemy.origin - self.origin), 1024)) * 700); + if(self.wp00) + self.velocity = normalize(newdir) * (500 + (1024 / min(vlen(self.wp00.origin - self.origin), 1024)) * 700); else self.velocity = normalize(newdir) * 750; @@ -849,7 +849,9 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, float deat if(DEATH_ISWEAPON(deathtype, WEP_MINSTANEX)) damage *= autocvar_g_vehicles_minstanex_damagerate; - + + self.enemy = attacker; + if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0)) { if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world) @@ -916,7 +918,7 @@ void vehicles_clearrturn() ret = findchain(classname, "vehicle_return"); while(ret) { - if(ret.enemy == self) + if(ret.wp00 == self) { ret.classname = ""; ret.think = SUB_Remove; @@ -933,10 +935,10 @@ void vehicles_clearrturn() void vehicles_return() { - pointparticles(particleeffectnum("teleport"), self.enemy.origin + '0 0 64', '0 0 0', 1); + pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1); - self.enemy.think = vehicles_spawn; - self.enemy.nextthink = time; + self.wp00.think = vehicles_spawn; + self.wp00.nextthink = time; if(self.waypointsprite_attached) WaypointSprite_Kill(self.waypointsprite_attached); @@ -971,9 +973,9 @@ void vehicles_showwp() oldself = self; self = spawn(); setmodel(self, "null"); - self.team = oldself.enemy.team; - self.enemy = oldself.enemy; - setorigin(self, oldself.enemy.pos1); + self.team = oldself.wp00.team; + self.wp00 = oldself.wp00; + setorigin(self, oldself.wp00.pos1); self.nextthink = time + 5; self.think = vehicles_showwp_goaway; @@ -986,7 +988,7 @@ void vehicles_showwp() WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb); if(self.waypointsprite_attached) { - WaypointSprite_UpdateRule(self.waypointsprite_attached, self.enemy.team, SPRITERULE_DEFAULT); + WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT); if(oldself == world) WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink); WaypointSprite_Ping(self.waypointsprite_attached); @@ -1004,7 +1006,7 @@ void vehicles_setreturn() ret = spawn(); ret.classname = "vehicle_return"; - ret.enemy = self; + ret.wp00 = self; ret.team = self.team; ret.think = vehicles_showwp;