]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Kill credits to whoever made a vehicle blow up and killing someone else
authorJakob MG <jakob_mg@hotmail.com>
Mon, 11 Jun 2012 12:11:13 +0000 (14:11 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Mon, 11 Jun 2012 12:11:13 +0000 (14:11 +0200)
qcsrc/client/hud.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc

index 27e0a0dc12cad21aa76e9c1337b5ca01dd46dfef..8bdd76b75a7bc0b275be6a5a2beeba325457b2fd 100644 (file)
@@ -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)
index c6523e4b83dcd671668bc6afa50db571afb804e7..711534fbfac50979f3f72a05eaf3e6b10e8cfec9 100644 (file)
@@ -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,
index ad5252dfd868c83a4805d1e75fe2b05c4a25eec8..4bf674e1b09defe6448a8d0fff1182a3cdf6cc1c 100644 (file)
@@ -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;
index 913e3316f012ecd2280611c1a2a05c6c6c4b0186..eec621e4767aab1f79bebb3fb4c3e13b5f10074f 100644 (file)
@@ -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;
index b6ca4f943058bdbabe7cfbe2323489f2b82cde2b..071ee74ac767c0d82b4f9745883e72cc34df5d08 100644 (file)
@@ -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;