]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/vehicles/racer.qc
Also send ent_DamageInfo for hitscan weapons when they hit a player, not only when...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / vehicles / racer.qc
index 9fbd6541fc8e6af51254de34bc4a2eb9e772ff91..fa188bbb1da4e19dabdc535e37335b5a229949d9 100644 (file)
@@ -66,6 +66,10 @@ float autocvar_g_vehicle_racer_blowup_coredamage;
 float autocvar_g_vehicle_racer_blowup_edgedamage;
 float autocvar_g_vehicle_racer_blowup_forceintensity;
 
+float autocvar_g_vehicle_racer_bouncefactor;
+float autocvar_g_vehicle_racer_bouncestop;
+vector autocvar_g_vehicle_racer_bouncepain;
+
 var vector racer_force_from_tag(string tag_name, float spring_length, float max_power);
 
 void racer_align4point()
@@ -491,8 +495,8 @@ void racer_think()
 void racer_enter()
 {
     self.movetype = MOVETYPE_BOUNCE;
-    self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health);
-    self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_racer_shield);
+    self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health)  * 100;
+    self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_racer_shield)  * 100;
     
     if(self.owner.flagcarried)
        setorigin(self.owner.flagcarried, '-190 0 96');
@@ -527,6 +531,11 @@ void racer_exit(float eject)
        
     self.owner = world;
 }
+void racer_impact()
+{
+    if(autocvar_g_vehicle_racer_bouncepain_x)
+        vehilces_impact(autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
+}
 
 void racer_spawn()
 {
@@ -541,6 +550,10 @@ void racer_spawn()
     self.scale          = 0.5;
 
     setsize(self, RACER_MIN * 0.5, RACER_MAX * 0.5);
+    self.bouncefactor = autocvar_g_vehicle_racer_bouncefactor;
+    self.bouncestop = autocvar_g_vehicle_racer_bouncestop;    
+    self.vehicle_impact = racer_impact;
+    //self.destvec = autocvar_g_vehicle_racer_bouncepain;
 }
 
 
@@ -669,6 +682,10 @@ void spawnfunc_vehicle_racer()
         self.vehicle_flags |= VHF_HEALTHREGEN;
 
     self.think = racer_dinit;
-    self.nextthink = time + (autocvar_g_vehicles_delayspawn ? autocvar_g_vehicle_racer_respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter) : 0.5);
+    
+    if(g_assault)
+        self.nextthink = time + 0.5;
+    else
+        self.nextthink = time + (autocvar_g_vehicles_delayspawn ? autocvar_g_vehicle_racer_respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter) : 0.5);
 }
 #endif // SVQC