]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Better death effects
authorJakob MG <jakob_mg@hotmail.com>
Mon, 6 Jun 2011 20:06:05 +0000 (22:06 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Mon, 6 Jun 2011 20:06:05 +0000 (22:06 +0200)
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
vehicles.cfg

index 2378b3f57238e3edf948238b93967099b1624009..2d74316af5028ee3ed29d75c66578b25bd288539 100644 (file)
@@ -595,7 +595,7 @@ void racer_spawn()
 void racer_blowup()
 {
     sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-    pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+    pointparticles(particleeffectnum("explosion_big"), self.origin, '0 0 0', 1);
 
     self.deadflag    = DEAD_DEAD;
     self.vehicle_exit(VHEF_NORMAL);
@@ -623,6 +623,7 @@ void racer_blowup()
 
 void racer_deadtouch()
 {
+    dprint("Boink!\n");
     self.avelocity_x *= 0.7;
     self.cnt -= 1;
     if(self.cnt <= 0)
@@ -639,15 +640,15 @@ void racer_die()
     self.deadflag     = DEAD_DYING;
     self.movetype     = MOVETYPE_BOUNCE;
     self.wait         = time;
-    self.cnt          = 1 + random() * 3;
+    self.cnt          = 1 + random() * 2;
     self.touch        = racer_deadtouch;
-
-    pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
+    
+    pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);    
 
     if(random() < 0.5)
-        self.avelocity_z  = 16;
+        self.avelocity_z  = 32;
     else
-        self.avelocity_z  = -16;
+        self.avelocity_z  = -32;
 
     self.avelocity_x = -vlen(self.velocity) * 0.2;
     self.velocity   += '0 0 700';
index 1a9a33633332787864e7da5e69ee4903ac0a7341..c700050ca5f98017a4642cad46f0517c438138fb 100644 (file)
@@ -361,7 +361,7 @@ float raptor_frame()
 #if VEHICLES_VIEWROTATE_CROSSHAIR
     df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
     if(df_x > 180)  df_x -= 360;
-    if(df_x < -180) df_x += 360;--
+    if(df_x < -180) df_x += 360;
     if(df_y > 180)  df_y -= 360;
     if(df_y < -180) df_y += 360;
 
@@ -596,7 +596,7 @@ float raptor_frame()
 void raptor_blowup()
 {
     sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-    pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+    pointparticles(particleeffectnum("explosion_big"), self.origin, '0 0 0', 1);
 
     self.deadflag    = DEAD_DEAD;
     self.vehicle_exit(VHEF_NORMAL);
@@ -611,6 +611,20 @@ void raptor_blowup()
 
     setorigin(self, self.pos1);
     self.touch = SUB_Null;
+    self.nextthink = 0;
+}
+
+void raptor_diethink()
+{
+    //self.avelocity += '0 0.5 1' * (random() * 5);
+    //self.avelocity -= '0 0.5 1' * (random() * 5);
+
+    if(random() < 0.1)
+    {
+        sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+        pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+    }
+    self.nextthink = time + 0.1;
 }
 
 void raptor_die()
@@ -622,15 +636,15 @@ void raptor_die()
     self.takedamage   = DAMAGE_NO;
     self.deadflag     = DEAD_DYING;
     self.movetype     = MOVETYPE_BOUNCE;
+    self.think        = raptor_diethink;
+    self.nextthink    = time;
+    
+    pointparticles(particleeffectnum("explosion_medium"), findbetterlocation (self.origin, 16), '0 0 0', 1);
 
-    pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
-
-    self.velocity_z += 128;
+    self.velocity_z += 600;
 
-    if(random() < 0.5)
-        self.avelocity_z  = 45 + random() * 270;
-    else
-        self.avelocity_z  = -45 + random() * -270;
+    self.avelocity = '0 0.5 1' * (random() * 400);
+    self.avelocity -= '0 0.5 1' * (random() * 400);
 
     self.colormod = '-0.5 -0.5 -0.5';
        self.touch     = raptor_blowup;
index 19cc720dbbcbb9a4f6d27aa0a9ce33f55d538e97..f7910f7c78de7de3ce90ef0cfbcac75140133318 100644 (file)
@@ -517,7 +517,7 @@ void spiderbot_headfade()
         if(self.alpha > 0.1)
         {
             sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-            pointparticles(particleeffectnum("rocket_explode"), self.origin + '0 0 100', '0 0 0', 1);
+            pointparticles(particleeffectnum("explosion_big"), self.origin + '0 0 100', '0 0 0', 1);
         }
         remove(self);
     }
@@ -525,12 +525,17 @@ void spiderbot_headfade()
 
 void spiderbot_blowup()
 {
-    float i;
-    sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-
-    for(i = 0; i < 5; ++i)
-        pointparticles(particleeffectnum("rocket_explode"), self.origin + (randomvec() * 100) + '0 0 100', '0 0 0', 1);
-
+    if(self.cnt > time)
+    {
+        if(random() < 0.1)
+        {
+            sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+            pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+        }
+        self.nextthink = time + 0.1;
+        return;
+    }
+    
     entity h, g1, g2, b;
     b = spawn();
     h = spawn();
@@ -589,25 +594,21 @@ void spiderbot_blowup()
     self.solid      = SOLID_NOT;
     self.tur_head.effects  &~=  EF_FLAME;
        self.vehicle_hudmodel.viewmodelforclient = self;
-
-    //self.nextthink  = time + autocvar_g_vehicle_spiderbot_respawntime;
-    //self.think      = spiderbot_spawn;
-
-    //setorigin(self, self.tur_aimpos);
 }
 
 void spiderbot_die()
 {
     sound (self, CHAN_VOICE, "vehicles/spiderbot_die.wav", VOL_BASE, ATTN_NORM);
     //sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-    pointparticles(particleeffectnum("rocket_explode"), self.origin + '0 0 100', '0 0 0', 1);
+    pointparticles(particleeffectnum("explosion_medium"), self.origin + '0 0 100', '0 0 0', 1);
 
     self.health         = 0;
     self.event_damage   = SUB_Null;
     self.takedamage     = DAMAGE_NO;
     self.touch          = SUB_Null;
-    self.nextthink      = 3.4 + time + random() * 2;
+    self.cnt            = 3.4 + time + random() * 2;
     self.think          = spiderbot_blowup;
+    self.nextthink      = time;
     self.deadflag       = DEAD_DYING;
        self.frame          = 5;
        self.tur_head.effects        |= EF_FLAME;
index b0dd05e7929a08db5df7a9402ec0c9d98349d10d..ffac64b9c2b5d8ceaa5323a7787ece270eb92f8a 100644 (file)
@@ -1,5 +1,6 @@
 float autocvar_g_vehicles_crush_dmg;
 float autocvar_g_vehicles_crush_force;
+float autocvar_g_vehicles_delayspawn;
 
 void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
 void vehicles_return();
@@ -544,7 +545,7 @@ vector vehicles_findgoodexit(vector prefer_spot)
 }
 
 void vehicles_exit(float eject)
-{
+{      
        self.flags |= FL_NOTARGET;
 
     if (self.owner)
@@ -836,7 +837,12 @@ float vehicle_initialize(string  net_name,
     self.event_damage        = vehicles_damage;
     self.touch               = vehicles_touch;
     self.think               = vehicles_spawn;
-    self.nextthink           = time;
+    
+    if(autocvar_g_vehicles_delayspawn)
+        self.nextthink           = time + _respawntime;
+    else
+        self.nextthink           = time;
+        
     self.vehicle_respawntime = _respawntime;
     self.vehicle_spawn       = spawnproc;
 
index 8c38d92d467f7f6f1fb0fa15f9987166af5b3952..3dca4bd70617cd6c8abe4a7efc0d813ffca63e40 100644 (file)
@@ -13,3 +13,5 @@ set g_vehicles_crush_dmg 70
 set g_vehicles_crush_force 50
 
 set cl_vehicles_hudscale 0.5
+
+set g_vehicles_delayspawn 0