Vehicle updates.
authortzork <tzork@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 4 Nov 2009 13:06:55 +0000 (13:06 +0000)
committertzork <tzork@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 4 Nov 2009 13:06:55 +0000 (13:06 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8205 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

22 files changed:
Docs/eventlog.txt
data/models/racers/waka.dpm [deleted file]
data/models/spiderbot/cp.md3 [deleted file]
data/models/spiderbot/spiderbot_barrels.dpm [deleted file]
data/models/vehicles/spiderbot.dpm [moved from data/models/spiderbot/spiderbot.dpm with 100% similarity]
data/models/vehicles/spiderbot.dpm.framegroups [moved from data/models/spiderbot/spiderbot.dpm.framegroups with 95% similarity]
data/models/vehicles/spiderbot_barrels.dpm [new file with mode: 0644]
data/models/vehicles/spiderbot_cockpit.dpm [new file with mode: 0644]
data/models/vehicles/spiderbot_top.dpm [moved from data/models/spiderbot/spiderbot_top.dpm with 88% similarity]
data/models/vehicles/wakizashi.dpm [new file with mode: 0644]
data/models/vehicles/wakizashi_cockpit.dpm [new file with mode: 0644]
data/qcsrc/client/View.qc
data/qcsrc/common/constants.qh
data/qcsrc/server/cl_physics.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/movelib.qc
data/qcsrc/server/vehicles/racer.qc
data/qcsrc/server/vehicles/spiderbot.qc
data/qcsrc/server/vehicles/vehicles.qc
data/qcsrc/server/vehicles/vehicles.qh
data/vehicle_racer.cfg
data/vehicle_spiderbot.cfg

index 19a6297..02c7b3e 100644 (file)
@@ -148,6 +148,10 @@ death type:
         10014 = mirror damage\r
         10015 = g_touchexplode\r
         10100 = turret\r
+       10150 = spiderbot miniguns\r
+       10151 = spiderbot rocket\r
+       10152 = spiderbot, cushed by\r
+       10300 = custom deathmessage\r
 \r
    weapon death flags are:\r
        256 = secondary fire\r
diff --git a/data/models/racers/waka.dpm b/data/models/racers/waka.dpm
deleted file mode 100644 (file)
index de860b7..0000000
Binary files a/data/models/racers/waka.dpm and /dev/null differ
diff --git a/data/models/spiderbot/cp.md3 b/data/models/spiderbot/cp.md3
deleted file mode 100644 (file)
index 0cac29d..0000000
Binary files a/data/models/spiderbot/cp.md3 and /dev/null differ
diff --git a/data/models/spiderbot/spiderbot_barrels.dpm b/data/models/spiderbot/spiderbot_barrels.dpm
deleted file mode 100644 (file)
index 3d8149a..0000000
Binary files a/data/models/spiderbot/spiderbot_barrels.dpm and /dev/null differ
@@ -1,6 +1,6 @@
-1   30  20 1 // forward
-32  30  20 1 // backward
-63  30  20 1 // left
-94  30 20 1 // right
-125 30 20 0 // jump
-0   1   20 0 // idle
+1   30  20 1 // forward\r
+32  30  20 1 // backward\r
+63  30  20 1 // left\r
+94  30 20 1 // right\r
+125 30 20 0 // jump\r
+0   1   20 0 // idle\r
diff --git a/data/models/vehicles/spiderbot_barrels.dpm b/data/models/vehicles/spiderbot_barrels.dpm
new file mode 100644 (file)
index 0000000..3202b7f
Binary files /dev/null and b/data/models/vehicles/spiderbot_barrels.dpm differ
diff --git a/data/models/vehicles/spiderbot_cockpit.dpm b/data/models/vehicles/spiderbot_cockpit.dpm
new file mode 100644 (file)
index 0000000..8d64449
Binary files /dev/null and b/data/models/vehicles/spiderbot_cockpit.dpm differ
similarity index 88%
rename from data/models/spiderbot/spiderbot_top.dpm
rename to data/models/vehicles/spiderbot_top.dpm
index ddd79fe..3247a47 100644 (file)
Binary files a/data/models/spiderbot/spiderbot_top.dpm and b/data/models/vehicles/spiderbot_top.dpm differ
diff --git a/data/models/vehicles/wakizashi.dpm b/data/models/vehicles/wakizashi.dpm
new file mode 100644 (file)
index 0000000..a28b682
Binary files /dev/null and b/data/models/vehicles/wakizashi.dpm differ
diff --git a/data/models/vehicles/wakizashi_cockpit.dpm b/data/models/vehicles/wakizashi_cockpit.dpm
new file mode 100644 (file)
index 0000000..8828195
Binary files /dev/null and b/data/models/vehicles/wakizashi_cockpit.dpm differ
index e57d52b..4ea84c6 100644 (file)
@@ -5,6 +5,8 @@
 #define rld_size_x 256
 #define rld_size_y 16
 
+void CSQC_WAKIZASHI_HUD();
+
 entity porto;
 vector polyline[16];
 float trace_dphitcontents;
@@ -588,13 +590,10 @@ void CSQC_UpdateView(float w, float h)
        hud = getstati(STAT_HUD);
        if(hud == HUD_SPIDERBOT)
        {
-               vector sz;
                CSQC_spider_HUD();
-               sz = drawgetimagesize(SPIDER_CROSS);
-               sz_x *= cvar_or("cl_vehicle_spiderbot_cross_size",1);
-               sz_y *= cvar_or("cl_vehicle_spiderbot_cross_size",1);
-               drawpic('0.5 0 0' * (vid_conwidth - sz_x) + '0 0.5 0' * (vid_conheight - sz_y), SPIDER_CROSS, sz, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
        }
+       else if(hud == HUD_WAKIZASHI)
+        CSQC_WAKIZASHI_HUD();
        else
        {
                if(cvar("r_letterbox") == 0)
@@ -850,11 +849,16 @@ void CSQC_spider_HUD()
        float rockets,reload,heat,hp,shield,i;
        vector p,pp;
 
-       rockets = getstati(STAT_SPIDERBOT_ROCKETS);
-       heat    = min(getstatf(STAT_SPIDERBOT_HEAT),1);
-       reload  = min(getstatf(STAT_SPIDERBOT_RELOAD),1);
-       hp      = min(getstatf(STAT_SPIDERBOT_HEALTH),1);
-       shield  = min(getstatf(STAT_SPIDERBOT_SHIELD),1);
+    p = drawgetimagesize(SPIDER_CROSS);
+    p_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
+    p_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
+    drawpic('0.5 0 0' * (vid_conwidth - p_x) + '0 0.5 0' * (vid_conheight - p_y), SPIDER_CROSS, p, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+
+    hp      = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
+       shield  = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
+       heat    = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
+       rockets =     getstati(STAT_VEHICLESTAT_AMMO2);
+       reload  = min(getstatf(STAT_VEHICLESTAT_RELOAD2), 1);
 
        // Draw health bar
        p = '0.5 0 0' * (vid_conwidth - (rkt_size * 8));
@@ -906,6 +910,84 @@ void CSQC_spider_HUD()
        }
 
 }
+
+void CSQC_WAKIZASHI_HUD()
+{
+       // 0--1 floats. 1 = 100%, 0.6 = 50%.
+       float health, shield, energy, rockets;
+
+    float i;
+       vector p, pp;
+
+    p = drawgetimagesize(SPIDER_CROSS);
+    p_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
+    p_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
+    drawpic('0.5 0 0' * (vid_conwidth - p_x) + '0 0.5 0' * (vid_conheight - p_y), SPIDER_CROSS, p, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+
+/*
+const float STAT_VEHICLESTAT_HEALTH  = 60;
+const float STAT_VEHICLESTAT_SHIELD  = 61;
+const float STAT_VEHICLESTAT_ENERGY  = 62;
+const float STAT_VEHICLESTAT_AMMO1   = 63;
+const float STAT_VEHICLESTAT_RELAOD1 = 64;
+const float STAT_VEHICLESTAT_AMMO2   = 65;
+const float STAT_VEHICLESTAT_RELOAD2 = 66;
+*/
+    health  = min(getstatf(STAT_VEHICLESTAT_HEALTH),  1);
+       shield  = min(getstatf(STAT_VEHICLESTAT_SHIELD),  1);
+       energy  = min(getstatf(STAT_VEHICLESTAT_ENERGY),  1);
+       rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
+
+
+       p = '0.5 0 0' * (vid_conwidth - (rkt_size * 8));
+       p = p + '0 1 0' * vid_conheight - '0 32 0';
+
+       // Draw health bar
+       p_y += 8;
+       drawfill(p, '256 0 0' * health + '0 8 0' , '0 0.7 0', 0.75, DRAWFLAG_NORMAL);
+       p_x += 256 * health;
+       drawfill(p, '256 0 0' * (1 - health) + '0 8 0' , '0 0 0', 0.75, DRAWFLAG_NORMAL);
+
+       // Draw shiled bar
+       p_x -= 256 * health;
+       p_y += 4;
+       drawfill(p, '256 0 0' * shield + '0 4 0' , '0.25 0.25 1', 0.5, DRAWFLAG_NORMAL);
+
+       // Draw energy
+       //p_x -= 256 * health;
+       p_y -= 8;
+       drawfill(p, '256 0 0' * energy + '0 4 0' , '1 1 1', 0.75, DRAWFLAG_NORMAL);
+
+       // Draw rockets bar
+       p_y += 12;
+       drawfill(p, '256 0 0' * rockets + '0 4 0' , '1 0 0', 0.75, DRAWFLAG_NORMAL);
+
+
+       /*
+       // Draw energy bar
+       p = '0.5 0 0' * (vid_conwidth - 256);
+       p = p + '0 1 0' * vid_conheight - '0 34  0';
+       drawfill(p, '256 0 0' * (1 - energy) + '0 2 0' ,'0 0 1', 0.5, DRAWFLAG_NORMAL);
+       p_x += 256 * (1 - energy);
+       drawfill(p, '256 0 0' * energy  + '0 2 0' , '1 0 0', 0.5, DRAWFLAG_NORMAL);
+
+       // Draw rockets bar
+       p_y += 8;
+       drawfill(p, '256 0 0' * rockets + '0 8 0' , '1 0 0', 0.75, DRAWFLAG_NORMAL);
+       p_x += 256 * health;
+       drawfill(p, '256 0 0' * (1 - rockets) + '0 8 0' , '0 0 0', 0.75, DRAWFLAG_NORMAL);
+    */
+
+
+       if (sb_showscores)
+       {
+               Sbar_DrawScoreboard();
+               Sbar_DrawCenterPrint();
+       }
+
+}
+
+
 void CSQC_common_hud(void)
 {
        // Sbar_SortFrags(); done in Sbar_Draw
@@ -922,6 +1004,10 @@ void CSQC_common_hud(void)
                case HUD_SPIDERBOT:
                        CSQC_spider_HUD();
                        break;
+
+               case HUD_WAKIZASHI:
+                       CSQC_WAKIZASHI_HUD();
+                       break;
        }
 }
 
index 3fba75e..f4d554c 100644 (file)
@@ -282,13 +282,6 @@ const float STAT_VEHICLESTAT_RELOAD1 = 64;
 const float STAT_VEHICLESTAT_AMMO2   = 65;
 const float STAT_VEHICLESTAT_RELOAD2 = 66;
 
-const float STAT_SPIDERBOT_HEALTH  = 60;
-const float STAT_SPIDERBOT_ROCKETS = 61;
-const float STAT_SPIDERBOT_HEAT    = 62;
-const float STAT_SPIDERBOT_RELOAD  = 63;
-const float STAT_SPIDERBOT_ENERGY  = 64;
-const float STAT_SPIDERBOT_SHIELD  = 65;
-
 //const float STAT_SPIDERBOT_AIM     53 // compressShotOrigin
 //const float STAT_SPIDERBOT_TARGET  54 // compressShotOrigin
 
index e5f7f17..e7ae19d 100644 (file)
@@ -547,7 +547,11 @@ void SV_PlayerPhysics()
        float buttons_prev;
        float not_allowed_to_move;
        string c;
-       
+
+    if(self.PlayerPhysplug)
+        if(self.PlayerPhysplug())
+            return;
+
        if(g_race || g_cts)
        {
                // if record times matter
@@ -631,10 +635,6 @@ void SV_PlayerPhysics()
        }
        else if(self.specialcommand_pos && (c != substring(specialcommand, self.specialcommand_pos - 1, 1)))
                self.specialcommand_pos = 0;
-       
-    if(self.PlayerPhysplug)
-        if(self.PlayerPhysplug())
-            return;
 
        if(!sv_maxidle_spectatorsareidle || self.movetype == MOVETYPE_WALK)
        {
index 4a937a9..e4986a6 100644 (file)
@@ -622,3 +622,5 @@ float client_cefc_accumulatortime;
 
 .entity clientdata;
 .entity personal;
+
+string deathmessage;
index 58f8ddd..e2a6b65 100644 (file)
@@ -2,7 +2,7 @@
 
 /**
     Simulate drag
-    self.velocity = movelib_vdrag(self.velocity,0.02,0.5);
+    self.velocity = movelib_dragvec(self.velocity,0.02,0.5);
 **/
 vector movelib_dragvec(float drag, float exp)
 {
@@ -18,7 +18,7 @@ vector movelib_dragvec(float drag, float exp)
 
 /**
     Simulate drag
-    self.velocity = movelib_vdrag(somespeed,0.01,0.7);
+    self.velocity *= movelib_dragflt(somespeed,0.01,0.7);
 **/
 float movelib_dragflt(float fspeed,float drag,float exp)
 {
@@ -34,7 +34,7 @@ float movelib_dragflt(float fspeed,float drag,float exp)
 /**
     Do a inertia simulation based on velocity.
     Basicaly, this allows you to simulate loss of steering with higher speed.
-    self.velocity = movelib_inertia_fromspeed(self.velocity,newvel,1000,0.1,0.9);
+    self.velocity = movelib_inertmove_byspeed(self.velocity,newvel,1000,0.1,0.9);
 **/
 vector movelib_inertmove_byspeed(vector vel_new, float vel_max,float newmin,float oldmax)
 {
@@ -102,7 +102,7 @@ void movelib_move(vector force,float max_velocity,float drag,float theMass,float
 }
 
 /*
-.float theMass;
+.float mass;
 .float side_friction;
 .float ground_friction;
 .float air_friction;
@@ -137,9 +137,9 @@ void movelib_update(vector dir,float force)
     old_speed    = vlen(self.velocity);
     old_dir      = normalize(self.velocity);
 
-    //ggravity      =  (sv_gravity / self.theMass) * '0 0 100';
-    acceleration =  (force / self.theMass) * dir;
-    //acceleration -= old_dir * (old_speed / self.theMass);
+    //ggravity      =  (sv_gravity / self.mass) * '0 0 100';
+    acceleration =  (force / self.mass) * dir;
+    //acceleration -= old_dir * (old_speed / self.mass);
     acceleration -= ggravity;
 
     if(self.waterlevel > 1)
@@ -165,6 +165,7 @@ void movelib_move_simple(vector newdir,float velo,float blendrate)
 {
     self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo;
 }
+
 void movelib_beak_simple(float force)
 {
     float mspeed;
@@ -178,18 +179,21 @@ void movelib_beak_simple(float force)
     self.velocity_z = vz;
 }
 
-
-void movelib_groundalign4point(float spring_length,float spring_up,float blendrate)
+/**
+Pitches and rolls the entity to match the gound.
+Yed need to set v_up and v_forward (generally by calling makevectors) before calling this.
+**/
+void movelib_groundalign4point(float spring_length, float spring_up, float blendrate)
 {
-    vector a,b,c,d,e,r,push_angle, ahead,side;
+    vector a, b, c, d, e, r, push_angle, ahead, side;
 
     push_angle_y = 0;
     r = (self.absmax + self.absmin) * 0.5 + (v_up * spring_up);
     e = v_up * spring_length;
 
     // Put springs slightly inside bbox
-    ahead = v_forward * (self.maxs_x * 0.85);
-    side  = v_right   * (self.maxs_y * 0.85);
+    ahead = v_forward * (self.maxs_x * 0.8);
+    side  = v_right   * (self.maxs_y * 0.8);
 
     a = r + ahead + side;
     b = r + ahead - side;
index 41bb2eb..13bd999 100644 (file)
-#define RACER_MIN '-40 -40 0'
-#define RACER_MAX '40 40 44'
+#define RACER_MIN '-80 -80 -40'
+#define RACER_MAX '80 80 40'
 
 void racer_exit(float eject);
 void racer_enter();
 
+float racer_power_air;
+float racer_power_solid;
+float racer_power_min;
+float racer_anglestabilizer;
+float racer_springlength;
+
+float racer_healthmax;
+float racer_shieldmax;
+float racer_energymax;
+
 float  jetfromtag_power;
 float  jetfromtag_normpower;
-float  jetfromtag_nosolid;
 vector jetfromtag_origin;
+float  jetfromtag_groundcontact;
 
-vector jetfromtag(string tagname,float jet_length,float air_power,float solid_power)
+.entity ccamera;
+
+void racer_loadsettings()
+{
+    racer_power_min         = cvar("g_vehicle_racer_power_min");
+    racer_power_air         = cvar("g_vehicle_racer_power_air");
+    racer_power_solid       = cvar("g_vehicle_racer_power_solid");
+    racer_springlength      = cvar("g_vehicle_racer_springlength");
+    racer_anglestabilizer   = cvar("g_vehicle_racer_anglestabilizer");
+
+    racer_healthmax = cvar("g_vehicle_racer_health");
+    racer_shieldmax = cvar("g_vehicle_racer_shield");
+    racer_energymax = cvar("g_vehicle_racer_energy_max");
+
+}
+
+vector racer_jetfromtag(string tagname)
 {
     vector force_dir;
     float  air_frac, solid_frac, air_pwr, solid_pwr;
 
     jetfromtag_origin = gettaginfo(self,gettagindex(self,tagname));
-    v_forward = normalize(v_forward);
+    v_forward  = normalize(v_forward) * -1;
 
-    force_dir = jetfromtag_origin - v_forward * jet_length;
+    force_dir = jetfromtag_origin - (v_forward  * racer_springlength);
     traceline(jetfromtag_origin, force_dir, MOVE_NORMAL, self);
+    //te_lightning1(world,jetfromtag_origin, force_dir);
+
+    trace_fraction *= trace_fraction;
 
     solid_frac = 1 - trace_fraction;
-    air_frac   = trace_fraction;
+    air_frac = trace_fraction;
 
-    if(solid_frac < 0.1)
-        jetfromtag_nosolid += 1;
+    if (trace_fraction != 1.0)
+        jetfromtag_groundcontact = 1;
 
-    solid_pwr = solid_frac * solid_power;
-    air_pwr   = air_frac * air_power;
+    solid_pwr = solid_frac * racer_power_solid;
+    air_pwr   = air_frac * racer_power_air;
 
     jetfromtag_power     = solid_pwr + air_pwr;
-    jetfromtag_normpower = jetfromtag_power / (air_power+solid_power);
-    if(trace_fraction == 1)
-        return v_forward;
-    else
-        return v_forward * (jetfromtag_power + cvar("g_vehicle_racer_power_min"));
+    jetfromtag_normpower = jetfromtag_power / (racer_power_air + racer_power_solid);
+
+    return v_forward  * max(jetfromtag_power, racer_power_min);
 }
 
-void racer_align4point(float spring_length,float spring_up,float blendrate)
+void racer_align4point()
 {
-    vector fl_org,fl_force,fr_org,fr_force,bl_org,bl_force,br_org,br_force;
-    vector push_vector,align;
+    vector push_vector;
     float fl_push, fr_push, bl_push, br_push;
 
-    jetfromtag_nosolid = 0;
+    jetfromtag_groundcontact = 0;
 
-    fr_force = jetfromtag("tag_engine_fr",spring_length,cvar("g_vehicle_racer_power_air"), cvar("g_vehicle_racer_power_solid"));
-    fr_org   = jetfromtag_origin; fr_push = jetfromtag_normpower;
+    push_vector = racer_jetfromtag("tag_engine_fr");
+    fr_push = jetfromtag_normpower;
+    traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
+    if(trace_fraction != 1)
+        self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
 
-    fl_force = jetfromtag("tag_engine_fl",spring_length,cvar("g_vehicle_racer_power_air"), cvar("g_vehicle_racer_power_solid"));
-    fl_org   = jetfromtag_origin; fl_push = jetfromtag_normpower;
+    push_vector += racer_jetfromtag("tag_engine_fl");
+    fl_push = jetfromtag_normpower;
+    traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
+    if(trace_fraction != 1)
+        self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
 
-    br_force = jetfromtag("tag_engine_br",spring_length,cvar("g_vehicle_racer_power_air"), cvar("g_vehicle_racer_power_solid"));
-    br_org   = jetfromtag_origin; br_push = jetfromtag_normpower;
+    push_vector += racer_jetfromtag("tag_engine_br");
+    br_push = jetfromtag_normpower;
+    traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
+    if(trace_fraction != 1)
+        self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
 
-    bl_force = jetfromtag("tag_engine_bl",spring_length,cvar("g_vehicle_racer_power_air"), cvar("g_vehicle_racer_power_solid"));
-    bl_org   = jetfromtag_origin; bl_push = jetfromtag_normpower;
+    push_vector += racer_jetfromtag("tag_engine_bl");
+    bl_push = jetfromtag_normpower;
+    traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
+    if(trace_fraction != 1)
+        self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
 
-    push_vector = fr_force + fl_force + br_force + bl_force;
+    self.velocity =  self.velocity + (push_vector * frametime);
+    self.velocity_z -= sv_gravity * frametime;
 
-    align = align;
+    push_vector_x = (fl_push - bl_push);
+    push_vector_x += (fr_push - br_push);
+    push_vector_x *= 360;
 
-    align_x = (fl_push - bl_push);
-    align_x += (fr_push - br_push);
-    align_x *= 360;
+    push_vector_z = (fr_push - fl_push);
+    push_vector_z += (br_push - bl_push);
+    push_vector_z *= 360;
 
-    align_z = (fl_push - fr_push);
-    align_z += (bl_push - br_push);
-    align_z *= 360;
+    if(!push_vector_z)
+        if(self.angles_z > 0)
+            self.angles_z = max(0, self.angles_z - (racer_anglestabilizer * frametime));
+        else
+            self.angles_z = min(0, self.angles_z + (racer_anglestabilizer * frametime));
+    else
+        self.angles_z += push_vector_z * frametime;
 
-    self.angles_x *= 0.96;
-    self.angles_z *= 0.96;
+    if(!push_vector_x)
+        if(self.angles_x > 0)
+            self.angles_x = max(0, self.angles_x - (racer_anglestabilizer * frametime));
+        else
+            self.angles_x = min(0, self.angles_x + (racer_anglestabilizer * frametime));
+    else
+        self.angles_x += push_vector_x * frametime;
+}
 
-    self.angles_x += align_x * frametime;
-    self.angles_z += align_z * frametime;
 
-    self.velocity =  self.velocity + (push_vector * frametime);
-    self.velocity_z -= sv_gravity * frametime;
+void racer_bolt_explode()
+{
+    vector org2;
+
+    org2 = findbetterlocation (self.origin, 8);
+    pointparticles(particleeffectnum("laser_impact"), org2, trace_plane_normal * 1000, 1);
+    RadiusDamage (self, self.realowner, cvar("g_vehicle_racer_laser_damage"), 0, cvar("g_vehicle_racer_laser_radius"), world, 150, DEATH_WAKIGUN, world);
+    sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+
+    remove (self);
+}
+
+void racer_rocket_explode()
+{
+    vector org2;
+
+    //if not(self.owner)
+    //    self.owner = self.realowner;
+
+    sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+    org2 = findbetterlocation (self.origin, 16);
+    pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
+    RadiusDamage (self, self.realowner ,cvar("g_vehicle_racer_rocket_damage"), 0, cvar("g_vehicle_racer_rocket_radius"), world, 150, DEATH_WAKIROCKET, world);
+
+    remove (self);
+}
+
+void racer_fire_cannon(string tagname)
+{
+    entity bolt;
+
+    bolt = spawn();
+    bolt.solid           = SOLID_BBOX;
+    bolt.movetype        = MOVETYPE_FLYMISSILE;
+    bolt.flags           = FL_PROJECTILE | FL_NOTARGET;
+    bolt.owner           = self;
+    bolt.realowner       = self.owner;
+    bolt.touch           = racer_bolt_explode;
+    bolt.think           = racer_bolt_explode;
+    bolt.nextthink       = time + 9;
+    bolt.bot_dodge       = TRUE;
+    bolt.bot_dodgerating = cvar("g_vehicle_racer_laser_damage");
+    setorigin(bolt, gettaginfo(self,gettagindex(self,tagname)));
+    bolt.velocity = v_forward * cvar("g_vehicle_racer_laser_speed");
+
+    CSQCProjectile(bolt, TRUE, PROJECTILE_LASER, TRUE);
+}
+
+void racer_rocket_think()
+{
+    vector newdir,olddir;
+
+    self.nextthink  = time;
+
+    if ((self.owner.deadflag != DEAD_NO) || (self.cnt < time))
+    {
+        racer_rocket_explode();
+        return;
+    }
+
+    if not (self.realowner.vehicle)
+    {
+        UpdateCSQCProjectile(self);
+        return;
+    }
+
+    self.solid      = SOLID_BBOX;
+    self.touch      = racer_rocket_explode;
+
+    olddir = normalize(self.velocity);
+    newdir = normalize((0.5 * (self.enemy.absmin + self.enemy.absmax)) - self.origin);
+
+    self.velocity = normalize(olddir + newdir * cvar("g_vehicle_spiderbot_rocket_turnrate")) * cvar("g_vehicle_racer_rocket_speed");
+
+    UpdateCSQCProjectile(self);
 }
 
-void racer_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void racer_fire_rocket(string tagname)
 {
-    self.velocity += force;
+    entity rocket;
+    dprint("self.owner=",self.owner.netname,"\n");
+
+    rocket = spawn();
+    setsize (rocket, '-1 -1 -1', '1 1 1');
+    rocket.solid           = SOLID_BBOX;
+    rocket.movetype        = MOVETYPE_FLYMISSILE;
+    rocket.flags           = FL_PROJECTILE;
+    rocket.owner           = self;
+    rocket.realowner       = self.owner;
+    rocket.touch           = racer_rocket_explode;
+    rocket.bot_dodge       = TRUE;
+    rocket.bot_dodgerating = cvar("g_vehicle_racer_rocket_damage");
+    setorigin(rocket, gettaginfo(self,gettagindex(self,tagname)));
+
+    if( (self.tur_head.gun1) && (self.tur_head.cnt > time))
+        rocket.enemy = self.tur_head.gun1;
+
+    if(rocket.enemy)
+    {
+        rocket.cnt             = time + 9;
+        rocket.velocity = v_forward * cvar("g_vehicle_racer_rocket_speed");
+        rocket.think = racer_rocket_think;
+        rocket.nextthink = time;
+        CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
+        //dprint("Tracking...", rocket.enemy.netname, " (", rocket.enemy.classname, ")\n");
+    }
+    else
+    {
+        rocket.velocity = v_forward * cvar("g_vehicle_racer_rocket_speed");
+        rocket.think = racer_rocket_explode;
+        rocket.nextthink = time + 9;
+        CSQCProjectile(rocket, TRUE, PROJECTILE_ROCKET, TRUE);
+    }
+}
+
+float racer_customizeentityforclient()
+{
+
+    if(self.deadflag == DEAD_DEAD)
+        return FALSE;
+
+    /*
+    if(other == self.owner)
+        self.alpha = -1;
+    else
+        self.alpha = 1;
+    */
+
+    return TRUE;
 }
 
 float racer_pplug()
 {
-    entity player,racer;
-    float ftmp,ftmp2;
+    entity player, racer;
+    float ftmp, ftmp2;
+    vector df;
 
 
-    player = self;
-    racer = self.vehicle;
-    player.fixangle = FALSE;
+    if(cvar("g_vehicle_racer_reload"))
+    {
+        racer_loadsettings();
+        cvar_set("g_vehicle_racer_reload","0");
+    }
+
+    player          = self;
+    racer           = self.vehicle;
 
     player.BUTTON_ZOOM = 0;
     player.BUTTON_CROUCH = 0;
@@ -107,72 +284,134 @@ float racer_pplug()
         return 0;
     }
 
+    if(racer.deadflag != DEAD_NO)
+    {
+        self = player;
+        player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+        return 1;
+    }
+
+    racer_align4point();
+
     racer.angles_x *= -1;
     makevectors(racer.angles);
-    racer.angles_x *= -1;
 
-    // Turn Body
-    ftmp = cvar("g_vehicle_racer_turnspeed") / server_fps;
+    // Rotate Body
+    ftmp = cvar("g_vehicle_racer_turnspeed") * sys_ticrate;
     ftmp2 = ftmp * -1;
 
     ftmp = bound(ftmp2,shortangle_f(player.v_angle_y - racer.angles_y,racer.angles_y),ftmp);
+    ftmp2 = safeangle(racer.angles_y + ftmp);
+
+    // Roll
+    ftmp = bound(-90,shortangle_f(player.v_angle_z + ((racer.angles_y - ftmp2) * cvar("g_vehicle_racer_turnroll")), racer.angles_z),90);
+    ftmp = safeangle(racer.angles_z + ftmp);
+    racer.angles_z = ftmp;
+
+    // Turn
+    racer.angles_y = ftmp2;
+
+    // Pitch Body
+    ftmp = cvar("g_vehicle_racer_pitchspeed") * sys_ticrate;
+    ftmp2 = ftmp * -1;
+
+    ftmp = bound(ftmp2,shortangle_f(player.v_angle_x - racer.angles_x,racer.angles_x),ftmp);
+    racer.angles_x = safeangle(racer.angles_x + ftmp);
+    racer.angles_x *= -1;
+
+
+    if(player.movement_x != 0)
+    {
+        if(player.movement_x > 0)
+            df += v_forward  * cvar("g_vehicle_racer_speed_forward");
+        else if(player.movement_x < 0)
+            df -= v_forward  * cvar("g_vehicle_racer_speed_forward");
+    }
+
+    if(player.movement_y != 0)
+    {
+        if(player.movement_y < 0)
+            df -= v_right * cvar("g_vehicle_racer_speed_strafe");
+        else if(player.movement_y > 0)
+            df += v_right * cvar("g_vehicle_racer_speed_strafe");
+    }
+
+    // limit _z to avoid flying on normal thrust
+    if(df_z > 0)
+        df_z = min(df_z,700);
+
+    // Afterburn
+
+    //if (jetfromtag_groundcontact)
+    if (player.BUTTON_JUMP)
+    if(racer.vehicle_energy >= (cvar("g_vehicle_racer_speed_afterburn_cost")* frametime))
+    {
+        racer.wait = time + cvar("g_vehicle_racer_energy_usepause");
+        racer.vehicle_energy -= cvar("g_vehicle_racer_speed_afterburn_cost") * frametime;
+        df += (v_forward * cvar("g_vehicle_racer_speed_afterburn"));
+    }
+
+    racer.velocity  += df * frametime;
+
+    df = (vlen(racer.velocity) * cvar("g_vehicle_racer_downforce") * v_up) * frametime;
+    racer.velocity  = racer.velocity - df;
+    player.movement = racer.velocity;
 
+    if(cvar("g_vehicle_racer_drag"))
+        racer.velocity  = movelib_dragvec(cvar("g_vehicle_racer_drag"), cvar("g_vehicle_racer_dragexp"));
+
+    if(self.owner.cursor_trace_ent)
     {
-        racer.angles_y = safeangle(racer.angles_y + ftmp);
-        if(player.BUTTON_JUMP)
+        //dprint("Lock: ", self.owner.cursor_trace_ent.classname, "\n");
+        //if not (self.tur_head.enemy)
+        //    bprint(self.owner,"Locked: ",
+        self.tur_head.gun1 = self.owner.cursor_trace_ent;
+        self.tur_head.cnt = time + 1;
+    }
+
+    if(player.BUTTON_ATCK)
+    if(time > racer.attack_finished_single)
+    if(racer.vehicle_energy >= cvar("g_vehicle_racer_laser_cost"))
+    {
+        racer.vehicle_energy -= cvar("g_vehicle_racer_laser_cost");
+        racer.wait = time + cvar("g_vehicle_racer_energy_usepause");
+
+        if(racer.cnt)
         {
-            player.BUTTON_JUMP = 0;
-            racer.velocity  = racer.velocity  + v_forward * 250 + v_up * 600;
+            racer_fire_cannon("tag_fire1");
+            racer.cnt = 0;
         }
         else
         {
-            if(vlen(player.movement) == 0)
-            {
-                self = racer;
-                ftmp = self.velocity_z;
-                self.velocity = self.velocity - self.velocity * cvar("g_vehicle_racer_speed_stop");
-                self.velocity_z = ftmp;
-            }
-            else
-            {
-
-                if(player.movement_x != 0)
-                {
-                    if(player.movement_x > 0)
-                        player.movement_x = 1;
-                    else if(player.movement_x < 0)
-                        player.movement_x = -1;
-                }
-
-                if(player.movement_y != 0)
-                {
-                    if(player.movement_y < 0)
-                        player.movement_y = -1;
-                    else if(player.movement_y > 0)
-                        player.movement_y = 1;
-                }
-
-                self = racer;
-                self.velocity  = self.velocity + ((v_right * player.movement_y) * cvar("g_vehicle_racer_speed_strafe")) * frametime;
-                self.velocity  = self.velocity + ((v_forward * player.movement_x) * cvar("g_vehicle_racer_speed_forward")) * frametime;
-            }
+            racer_fire_cannon("tag_fire2");
+            racer.cnt = 1;
         }
-        self = racer;
+        racer.attack_finished_single = time + cvar("g_vehicle_racer_laser_refire");
     }
 
-    vector df;
+    if(player.BUTTON_ATCK2)
+    if(time > racer.delay)
+    {
+        racer_fire_rocket("tag_rocket_r");
+        racer_fire_rocket("tag_rocket_l");
+        racer.delay = time + cvar("g_vehicle_racer_rocket_refire");
+        racer.lip = time;
 
-    self = racer;
+    }
 
-    df = vlen(self.velocity) * cvar("g_vehicle_racer_downforce") * v_up;
-    self.velocity = self.velocity - df;
-    player.movement = racer.velocity;
-    racer_align4point(cvar("g_vehicle_racer_springlength"),100,cvar("g_vehicle_racer_inert"));
+    player.vehicle_reload1 = (time - racer.lip) / (racer.delay-racer.lip);
+    //player.vehicle_energy = racer.vehicle_energy;
 
-    if(cvar("g_vehicle_racer_drag"))
-        self.velocity  = movelib_dragvec(cvar("g_vehicle_racer_drag"),cvar("g_vehicle_racer_dragexp"));
+    vehicle_stdproc_shiledregen(CCVAR("_shield"), frametime);
+    vehicle_stdproc_healthregen(CCVAR("_health"), frametime);
+
+    if (racer.wait < time)
+        vehicle_stdproc_energyregen(CCVAR("_energy"), frametime);
+    else
+        player.vehicle_energy = (racer.vehicle_energy / CCVAR("_energy"));
 
     self = player;
+
     player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
     setorigin(player,racer.origin + '0 0 32');
     player.velocity = racer.velocity;
@@ -190,59 +429,65 @@ void racer_think()
 void racer_enter()
 {
     self.owner = other;
-    self.owner.angles = self.angles;
 
-    //setattachment(other,self,"");
+
     self.nextthink = 0;
-    self.think = SUB_Null;
+    self.flags               = 0;
+    self.vehicle_hudmodel.viewmodelforclient = self.owner;
+    self.colormap             = self.owner.colormap;
+
+    self.owner.PlayerPhysplug = racer_pplug;
     self.owner.takedamage     = DAMAGE_NO;
+    self.owner.event_damage   = SUB_Null;
+    self.owner.vehicle        = self;
+    self.owner.angles = self.angles;
     self.owner.solid          = SOLID_NOT;
     self.owner.movetype       = MOVETYPE_NOCLIP;
-    //setsize(self.owner,spiderbot_MIN,spiderbot_MAX);
     self.owner.alpha          = -1;
-    self.owner.PlayerPhysplug = racer_pplug;
-    self.owner.vehicle        = self;
-    self.owner.event_damage   = SUB_Null;
-    //self.event_damage         = vehicle_stdproc_damage ;
-    self.colormap             = self.owner.colormap;
-    //self.tur_head.colormap    = self.owner.colormap;
-    //self.vehicle_hudmodel.viewmodelforclient = self.owner;
-    //self.owner.hud            = HUD_SPIDEBOT;
-    //self.owner.vehicle_health = (self.vehicle_health / cvar("g_vehicle_spiderbot_health"));
-    //self.owner.vehicle_shield = (self.vehicle_shield / cvar("g_vehicle_spiderbot_shield"));
+    self.owner.hud            = HUD_WAKIZASHI;
+    self.owner.effects        |= EF_NODRAW;
+    self.owner.view_ofs = '0 0 0';
 
-    //setorigin(self.owner,self.origin);
-    //setattachment(self.owner,self,"");
-    //setorigin(self.owner,'0 0 0');
+    self.owner.vehicle_health = (self.vehicle_health / cvar("g_vehicle_racer_health"));
+    self.owner.vehicle_shield = (self.vehicle_shield / cvar("g_vehicle_racer_shield"));
 
+    setorigin(other,self.origin + '0 0 32');
+    other.velocity = self.velocity;
+
+    other.flags &~= FL_ONGROUND;
     msg_entity = other;
     WriteByte (MSG_ONE, SVC_SETVIEWPORT);
     WriteEntity( MSG_ONE, self.vehicle_viewport);
 
-    WriteByte (MSG_ONE, SVC_SETVIEWANGLES);  // 10 = SVC_SETVIEWANGLES
-    WriteAngle(MSG_ONE,  self.angles_x);    // tilt
+    WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
+    WriteAngle(MSG_ONE,  self.angles_x * -1);    // tilt
     WriteAngle(MSG_ONE,  self.angles_y);    // yaw
     WriteAngle(MSG_ONE,  0);                // roll
-
-    //self.owner.view_ofs = '0 0 0';
-    //self.tur_head.nodrawtoclient = self.owner;
 }
 
 void racer_exit(float eject)
 {
+       self.colormap   = 1024;
+       self.flags      = FL_NOTARGET;
     self.velocity = '0 0 0';
 
+    if not (self.owner)
+        return;
+
     msg_entity = self.owner;
     WriteByte (MSG_ONE, SVC_SETVIEWPORT);
     WriteEntity( MSG_ONE, self.owner);
 
-    WriteByte (MSG_ONE, SVC_SETVIEWANGLES);  // 10 = SVC_SETVIEWANGLES
-    WriteAngle(MSG_ONE,  0);                // tilt
-    WriteAngle(MSG_ONE,  self.angles_y);    // yaw
-    WriteAngle(MSG_ONE,  0);                // roll
+    WriteByte (MSG_ONE, SVC_SETVIEWANGLES);    // 10 = SVC_SETVIEWANGLES
+    WriteAngle(MSG_ONE,  0);                   // tilt
+    WriteAngle(MSG_ONE,  self.angles_y); // yaw
+    WriteAngle(MSG_ONE,  0);                   // roll
 
-    self.think = racer_think;
-    self.nextthink = time;
+    if (self.deadflag == DEAD_NO)
+    {
+        self.think = racer_think;
+        self.nextthink = time;
+    }
 
     self.owner.takedamage     = DAMAGE_AIM;
     self.owner.solid          = SOLID_SLIDEBOX;
@@ -250,19 +495,17 @@ void racer_exit(float eject)
 
     setsize(self.owner,PL_MIN,PL_MAX);
 
+    self.owner.effects        &~= EF_NODRAW;
     self.owner.alpha          = 1;
     self.owner.PlayerPhysplug = SUB_Null;
     self.owner.vehicle        = world;
        self.owner.view_ofs       = PL_VIEW_OFS;
        self.owner.event_damage   = PlayerDamage;
-       //self.owner.hud            = HUD_NORMAL;
+       self.owner.hud            = HUD_NORMAL;
+       //self.owner.exteriormodeltoclient = self;
 
-       self.colormap            = 1024;
-       //self.tur_head.colormap = 1024;
 
-       //self.vehicle_hudmodel.viewmodelforclient = self;
-       //self.tur_head.nodrawtoclient             = self;
-    setattachment(self.owner,world,"");
+    self.vehicle_hudmodel.viewmodelforclient = self;
 
        if(eject)
        {
@@ -271,11 +514,33 @@ void racer_exit(float eject)
            self.owner.velocity = (v_up + v_forward * 0.25) * 750;
        }
        else
-        setorigin(self.owner,self.origin + '0 0 64' - v_forward * 200);
+       {
+           self.owner.velocity = (v_forward) * -150;
+        setorigin(self.owner,self.origin - v_forward * 128);
+       }
 
     self.owner = world;
 }
 
+void racer_entercap()
+{
+    entity oldself;
+    entity oldother;
+
+    oldself = self;
+    oldother = other;
+
+    other = self.enemy;
+    self = self.owner;
+
+    racer_enter();
+
+    other = oldother;
+    self = oldself;
+
+    self.think = SUB_Remove;
+    self.nextthink = time;
+}
 
 void racer_touch()
 {
@@ -303,6 +568,15 @@ void racer_touch()
     if(other.vehicle != world)
         return;
 
+    /*
+    entity entercap;
+    entercap = spawn();
+    entercap.enemy = other;
+    entercap.owner = self;
+    entercap.think = racer_entercap;
+    entercap.nextthink = time;
+    */
+
     racer_enter();
 }
 
@@ -316,114 +590,160 @@ float racer_customizeentityforclient()
 }
 */
 
-void racer_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
 void racer_spawn()
 {
     self.think = racer_think;
     self.nextthink = time;
 
-    //self.vehicle_health = CCVAR("_health");
-    //self.vehicle_shield = CCVAR("_shield");
-    //self.event_damage = vehicle_stdproc_damage;
-    self.event_damage = racer_damage;
-    //self.iscreature = TRUE;
-    self.scale = 0.5;
+    self.flags      = FL_NOTARGET;
+    self.effects   = 0;
+
+    self.vehicle_health = CCVAR("_health");
+    self.vehicle_shield = CCVAR("_shield");
+
+    self.event_damage = vehicle_stdproc_damage;
+    self.touch      = racer_touch;
+
+    self.iscreature = TRUE;
+    self.scale      = 0.5;
     self.movetype   = MOVETYPE_FLY;
     self.solid      = SOLID_SLIDEBOX;
-    //self.takedamage = DAMAGE_AIM;
-    self.touch      = racer_touch;
-    //self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
+    self.takedamage = DAMAGE_AIM;
+
     self.alpha = 1;
-    //self.tur_head.angles = '0 0 0';
-       //self.colormap = 1024;
-       //self.tur_head.colormap = 1024;
+       self.colormap = 1024;
        self.deadflag    = DEAD_NO;
     self.bot_attack = TRUE;
-    setorigin(self,self.origin + '0 0 128');
-    setsize(self,RACER_MIN*0.5,RACER_MAX*0.5);
-    setorigin(self,self.tur_aimpos);
+
+    self.vehicle_energy = 1;
+    self.vehicle_hudmodel.viewmodelforclient = self;
+
+    setorigin(self, self.pos1);
+    self.angles = self.pos2;
+
+    setsize(self,RACER_MIN * 0.5,RACER_MAX * 0.5);
     pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
+    self.delay = time;
 }
 
+
 void racer_blowup()
 {
-    /*
+
     sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-    pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
+    pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
 
-    //RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
-    RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_TURRET, world);
+    self.deadflag    = DEAD_DEAD;
+    self.vehicle_exit(VHEF_NORMAL);
+    RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world);
 
-    self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
+    self.alpha = -1;
     self.nextthink  = time + 10;
-    self.think      = spiderbot_spawn;
+    self.think      = racer_spawn;
+    self.movetype   = MOVETYPE_NONE;
+    self.effects    = EF_NODRAW;
 
-    setorigin(self,self.tur_aimpos);
-    */
+    self.avelocity_z  = 0;
+    self.colormod = '0 0 0';
+
+    setorigin(self,self.pos1);
 }
 
-void racer_die()
+void racer_dietouch()
 {
+    if(self.wait > time)
+        return;
 
-    /*
-    self.health = 0;
+    self.wait = time + 0.75;
+
+    pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+}
+
+void racer_die()
+{
+    self.health       = 0;
     self.event_damage = SUB_Null;
-    self.iscreature = FALSE;
-    self.solid      = SOLID_NOT;
-    self.takedamage = DAMAGE_NO;
-    self.touch      = SUB_Null;
-    self.nextthink  = time + random() * 2;
-    self.think      = spiderbot_blowup;
-    self.deadflag    = DEAD_DEAD;
-       self.vehicle_hudmodel.viewmodelforclient = self;
-       self.frame = 0;
-       self.tur_head.frame = 0;
-       */
+    self.iscreature   = FALSE;
+    self.solid        = SOLID_NOT;
+    self.takedamage   = DAMAGE_NO;
+    self.touch        = racer_dietouch;
+    self.deadflag     = DEAD_DYING;
+    self.movetype     = MOVETYPE_BOUNCE;
+    self.wait = time;
+
+    pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
+
+    self.velocity     += '0 0 128';
+
+    if(random() < 0.5)
+        self.avelocity_z  = 16;
+    else
+        self.avelocity_z  = -16;
+
+    self.colormod = '-0.5 -0.5 -0.5';
+
+       self.think     = racer_blowup;
+       self.nextthink = time + 3;
 }
 
 void racer_dinit()
 {
 
-    server_fps = (1 / sys_ticrate);
+    if (self.netname == "")
+        self.netname     = "Race PoD";
+
+    self.cvar_basename      = "g_vehicle_racer";
+
+    self.vehicle_viewport   = spawn();
+    self.vehicle_hudmodel   = spawn();
+    //self.ccamera            = spawn();
+
+    setorigin(self, self.origin);
+
+    setmodel(self,"models/vehicles/wakizashi.dpm");
+    setmodel(self.vehicle_hudmodel, "models/vehicles/wakizashi_cockpit.dpm");
+    setmodel (self.vehicle_viewport, "null");
+
+    setattachment(self.vehicle_hudmodel, self, "");
+    setattachment(self.vehicle_viewport, self, "tag_viewport");
+
+    self.vehicle_hudmodel.viewmodelforclient = self;
+    self.customizeentityforclient            = racer_customizeentityforclient;
+
+    self.tur_head     = spawn();
+
+    self.pos1         = self.origin;
+    self.pos2         = self.angles;
+    self.angles       = '0 0 0';
+    self.angles       = self.pos1;
+
+    self.vehicle_die  = racer_die;
+    self.vehicle_exit = racer_exit;
 
-    /*
     addstat(STAT_HUD, AS_INT,  hud);
-       addstat(STAT_SPIDERBOT_ROCKETS, AS_INT,   rockets);
-       addstat(STAT_SPIDERBOT_RELOAD,  AS_FLOAT, rockets_reload);
-       addstat(STAT_SPIDERBOT_HEAT,    AS_FLOAT, vehicle_heat);
-       addstat(STAT_SPIDERBOT_HEALTH,  AS_FLOAT, vehicle_health);
-       addstat(STAT_SPIDERBOT_SHIELD,  AS_FLOAT, vehicle_shield);
-       */
-
-    if (self.netname == "")      self.netname     = "Race PoD";
-
-    self.vehicle_viewport = spawn();
-    self.event_damage = racer_damage;
-    //self.gravity = 2;
-    //self.vehicle_hudmodel = spawn();
-    //self.vehicle_flags = VHF_HASSHIELD | VHF_SHIELDREGEN | VHF_HEALTHREGEN;
-    //self.cvar_basename = "g_vehicle_spiderbot";
-
-    setmodel (self.vehicle_viewport, "models/null.md3");
-    setmodel(self,"models/racers/waka.dpm");
-
-    setattachment(self.vehicle_viewport,self,"");
-    //self.tur_head.customizeentityforclient = spiderbot_customizeentityforclient;
-
-    setorigin(self.vehicle_viewport,'-400 0 40');
-    self.tur_aimpos = self.origin;
-    racer_spawn();
+       addstat(STAT_VEHICLESTAT_HEALTH,  AS_FLOAT, vehicle_health);
+       addstat(STAT_VEHICLESTAT_SHIELD,  AS_FLOAT, vehicle_shield);
+       addstat(STAT_VEHICLESTAT_ENERGY,  AS_FLOAT, vehicle_energy);
 
-    //self.vehicle_die = spiderbot_die;
-    //self.vehicle_exit = spiderbot_exit;
+       addstat(STAT_VEHICLESTAT_AMMO1,   AS_INT,   vehicle_ammo1);
+       addstat(STAT_VEHICLESTAT_RELOAD1, AS_FLOAT, vehicle_reload1);
+
+       addstat(STAT_VEHICLESTAT_AMMO2,   AS_INT,   vehicle_ammo2);
+       addstat(STAT_VEHICLESTAT_RELOAD2, AS_FLOAT, vehicle_reload2);
+
+    racer_spawn();
 }
 
-void spawnfunc_racer()
+void spawnfunc_vehicle_racer()
 {
     g_turrets_common_precash();
+    racer_loadsettings();
 
-    precache_model ( "models/racers/waka.dpm");
+    self.vehicle_flags      = VHF_HASSHIELD | VHF_SHIELDREGEN;
+    precache_model ("models/vehicles/wakizashi.dpm");
+    precache_model ("models/vehicles/wakizashi_cockpit.dpm");
+    precache_model ("models/rocket.md3");
 
     self.think = racer_dinit;
-    self.nextthink = time + 0.5;
+    self.nextthink = time + 1;
 }
index 8c42007..35e9300 100644 (file)
@@ -1,137 +1,7 @@
-#define MODEL_SPIDERBOT_FORWARD_START 1
-#define MODEL_SPIDERBOT_FORWARD_END 31
-#define MODEL_SPIDERBOT_FORWARD_LENGTH 31
-
-#define MODEL_SPIDERBOT_BACKWARDS_START 32
-#define MODEL_SPIDERBOT_BACKWARDS_END 62
-#define MODEL_SPIDERBOT_BACKWARDS_LENGTH 31
-
-#define MODEL_SPIDERBOT_LEFT_START 63
-#define MODEL_SPIDERBOT_LEFT_END 93
-#define MODEL_SPIDERBOT_LEFT_LENGTH 31
-
-#define MODEL_SPIDERBOT_RIGHT_START 94
-#define MODEL_SPIDERBOT_RIGHT_END 124
-#define MODEL_SPIDERBOT_RIGHT_LENGTH 31
-
-#define MODEL_SPIDERBOT_JUMP_START 125
-#define MODEL_SPIDERBOT_JUMP_END 155
-#define MODEL_SPIDERBOT_JUMP_LENGTH 31
-
-#define spiderbot_MIN '-75 -75 5'
-#define spiderbot_MAX '75 75 105'
+#define spiderbot_MIN '-75 -75 0'
+#define spiderbot_MAX '75 75 100'
 #define spiderbot_spawnpnt wkr_spawn
 
-/*
-.void() anim_now;
-.void() anim_next;
-
-void spider_anim_idle()
-{
-    movelib_beak_simple(cvar("g_vehicle_spiderbot_speed_stop"));
-    if(self.anim_next != self.anim_now)
-        self.anim_now = self.anim_next;
-}
-
-void spider_anim_forward()
-{
-    movelib_move_simple(normalize(v_forward),cvar("g_vehicle_spiderbot_speed_walk"),cvar("g_vehicle_spiderbot_movement_inertia"));
-
-    if((self.frame < MODEL_SPIDERBOT_FORWARD_START) || (self.frame > MODEL_SPIDERBOT_FORWARD_END))
-        self.frame = MODEL_SPIDERBOT_FORWARD_START;
-    else
-        self.frame += 0.8;
-
-    if(self.frame > MODEL_SPIDERBOT_FORWARD_END)
-        self.anim_now = self.anim_next;
-}
-
-void spider_anim_backward()
-{
-    movelib_move_simple(normalize(v_forward * -1),cvar("g_vehicle_spiderbot_speed_walk"),cvar("g_vehicle_spiderbot_movement_inertia"));
-
-    if(self.frame < MODEL_SPIDERBOT_BACKWARDS_START)
-        self.frame = MODEL_SPIDERBOT_BACKWARDS_START;
-    else
-        self.frame += 0.8;
-
-    if(self.frame > MODEL_SPIDERBOT_BACKWARDS_END)
-        self.anim_now = self.anim_next;
-}
-
-void spider_anim_strafel()
-{
-    movelib_move_simple(normalize(v_right * -1),cvar("g_vehicle_spiderbot_speed_strafe"),cvar("g_vehicle_spiderbot_movement_inertia"));
-
-    if(self.frame < MODEL_SPIDERBOT_LEFT_START)
-        self.frame = MODEL_SPIDERBOT_LEFT_START;
-    else
-        self.frame += 0.8;
-
-    if(self.frame > MODEL_SPIDERBOT_LEFT_END)
-        self.anim_now = self.anim_next;
-}
-
-void spider_anim_strafer()
-{
-    movelib_move_simple(normalize(v_right),cvar("g_vehicle_spiderbot_speed_strafe"),cvar("g_vehicle_spiderbot_movement_inertia"));
-
-    if(self.frame < MODEL_SPIDERBOT_RIGHT_START)
-        self.frame = MODEL_SPIDERBOT_RIGHT_START;
-    else
-        self.frame += 0.8;
-
-    if(self.frame > MODEL_SPIDERBOT_RIGHT_END)
-        self.anim_now = self.anim_next;
-}
-
-void spider_anim_jump()
-{
-    //movelib_move_simple(normalize(v_forward),cvar("g_vehicle_spiderbot_speed_walk"),cvar("g_vehicle_spiderbot_movement_inertia"));
-
-    if(self.frame < MODEL_SPIDERBOT_JUMP_START)
-        self.frame = MODEL_SPIDERBOT_JUMP_START;
-    else
-        self.frame += 1;
-
-    if(self.frame <= 8)
-        movelib_beak_simple(cvar("g_vehicle_spiderbot_speed_stop"));
-
-    if(self.frame == 9)
-        self.velocity = v_forward * 400 + v_up * 400;
-
-    if(self.frame >= 19)
-        movelib_beak_simple(cvar("g_vehicle_spiderbot_speed_stop"));
-
-    if(self.frame > MODEL_SPIDERBOT_JUMP_END)
-        self.anim_now = self.anim_next;
-}
-
-void anim_do()
-{
-    if not (self.anim_now)
-        self.anim_now = self.anim_next;
-
-    self.anim_now();
-}
-
-*/
-
-/*
-void anim_do()
-{
-    self.frame = self.frame + 0.8;
-    if ((self.frame < self.anim_start) || (self.frame > self.anim_end))
-        if(self.anim_start == 0)
-        {
-            self.frame = 0;
-            self.anim_end = 0;
-        }
-        else
-            self.frame = self.anim_start;
-}
-*/
-
 void spiderbot_exit(float eject);
 void spiderbot_enter();
 
@@ -156,10 +26,10 @@ void spiderbot_rocket_explode()
         self.owner = self.realowner;
 
     RadiusDamage (self, self.owner,
-     cvar("g_vehicle_spiderbot_rocket_damage"),
-     cvar("g_vehicle_spiderbot_rocket_edgedamage"),
-     cvar("g_vehicle_spiderbot_rocket_radius"), world,
-     cvar("g_vehicle_spiderbot_rocket_force"), DEATH_TURRET, world);
+        cvar("g_vehicle_spiderbot_rocket_damage"),
+        cvar("g_vehicle_spiderbot_rocket_edgedamage"),
+        cvar("g_vehicle_spiderbot_rocket_radius"), world,
+        cvar("g_vehicle_spiderbot_rocket_force"), DEATH_SBROCKET, world);
 
     remove (self);
 }
@@ -199,16 +69,26 @@ void spiderbot_rocket_think()
     self.solid      = SOLID_BBOX;
     self.touch      = spiderbot_rocket_touch;
     olddir = normalize(self.velocity);
-    newdir = normalize(self.owner.cursor_trace_endpos - self.origin);
+    //newdir = normalize(self.owner.cursor_trace_endpos - self.origin);
+    newdir = normalize(self.pos1 - self.origin);
     newdir += randomvec() * cvar("g_vehicle_spiderbot_rocket_noise");
     self.velocity = normalize(olddir + newdir * cvar("g_vehicle_spiderbot_rocket_turnrate")) * cvar("g_vehicle_spiderbot_rocket_speed");
 
     UpdateCSQCProjectile(self);
 }
 
+void spiderbot_rocket_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+    self.health -= damage;
+    self.velocity += force;
+    if(self.health < 1)
+        spiderbot_rocket_explode();
+}
+
+
 void spiderbot_rocket_do()
 {
-    entity missile;
+    entity rocket;
 
     if(self.gun2.cnt > time)
         return;
@@ -228,24 +108,29 @@ void spiderbot_rocket_do()
     self.gun2.cnt = time + self.attack_finished_single;
 
     sound (self, CHAN_WEAPON, "weapons/rocket_fire.wav", VOL_BASE, ATTN_NORM);
-    missile                    = spawn ();
-    setsize (missile, '-3 -1 -1', '3 1 1'); // give it some size so it can be shot
-    setorigin(missile,gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire")));
-    te_explosion (missile.origin);
-
-    missile.classname       = "spiderbot_rocket";
-    missile.owner           = self.owner;
-    missile.bot_dodge       = TRUE;
-    missile.bot_dodgerating = 75;
-    missile.nextthink       = time;// + 0.2;
-    missile.movetype        = MOVETYPE_FLYMISSILE;
-    missile.velocity        = normalize(v_forward + (v_up * 0.5) + randomvec() * 0.25) * cvar("g_vehicle_spiderbot_rocket_speed");
-    missile.angles          = vectoangles(missile.velocity);
-    missile.think           = spiderbot_rocket_think;
-    missile.flags           = FL_PROJECTILE;
-    missile.solid           = SOLID_NOT;
-
-       CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
+    rocket                    = spawn ();
+    setsize (rocket, '-1 -1 -1', '1 1 1'); // give it some size so it can be shot
+    setorigin(rocket,gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire")));
+    te_explosion (rocket.origin);
+
+    rocket.classname       = "spiderbot_rocket";
+    rocket.bot_dodge       = TRUE;
+    rocket.bot_dodgerating = cvar("g_vehicle_spiderbot_rocket_damage");
+    rocket.cnt             = time + cvar("g_vehicle_spiderbot_rocket_lifetime");
+    rocket.health          = cvar("g_vehicle_spiderbot_rocket_health");
+    rocket.takedamage      = DAMAGE_AIM;
+    rocket.event_damage    = spiderbot_rocket_damage;
+    rocket.owner           = self.owner;
+    rocket.nextthink       = time;
+    rocket.movetype        = MOVETYPE_FLYMISSILE;
+    rocket.velocity        = normalize(v_forward + (v_up * 0.5) + randomvec() * 0.25) * cvar("g_vehicle_spiderbot_rocket_speed");
+    rocket.angles          = vectoangles(rocket.velocity);
+    rocket.think           = spiderbot_rocket_think;
+    rocket.flags           = FL_PROJECTILE;
+    rocket.solid           = SOLID_NOT;
+    rocket.pos1            = self.owner.cursor_trace_endpos;
+
+       CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
 }
 
 void spiderbot_minigun_fire_Flash_Go() {
@@ -257,6 +142,7 @@ void spiderbot_minigun_fire_Flash_Go() {
 
        self.frame = self.frame + 2;
        self.alpha = self.alpha - 0.2;
+       self.scale -= 0.01;
        self.nextthink = time + 0.02;
 }
 
@@ -271,90 +157,91 @@ void spiderbot_minigun_fire(entity gun,float trail)
     sound (gun, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
 
     fireBullet (v, v_forward, cvar("g_vehicle_spiderbot_minigun_spread"), cvar("g_vehicle_spiderbot_minigun_damage"),
-        cvar("g_vehicle_spiderbot_minigun_spread"), DEATH_TURRET, 0);
+        cvar("g_vehicle_spiderbot_minigun_spread"), DEATH_SBMINIGUN, 0);
 
     if not (gun.enemy)
     {
         gun.enemy = spawn();
         setattachment(gun.enemy , gun, "barrels");
-        setorigin(gun.enemy ,gun.enemy.origin + '48 0 0');
+        setorigin(gun.enemy ,gun.enemy.origin + '52 0 0');
     }
 
-    flash = gun.enemy; //spawn();
-    setmodel(flash, "models/uziflash.md3"); // precision set below
+    flash = gun.enemy;
+    setmodel(flash, "models/uziflash.md3");
     flash.think = spiderbot_minigun_fire_Flash_Go;
     flash.nextthink = time + 0.02;
     flash.frame = 2;
     flash.angles_z = flash.v_angle_z + random() * 180;
     flash.alpha = 1;
     flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+    flash.scale = 1;
+
     if(trail)
         trailparticles(self, particleeffectnum("EF_MGTURRETTRAIL"), v, trace_endpos);
 }
 
 void spiderbot_miniguns_do()
 {
-    if ((self.owner.BUTTON_ATCK) && (self.owner.vehicle_heat < 1) && (self.tur_head.attack_finished_single < time))
+    float ftmp;
+
+    if((self.vehicle_reload1 == 1) || (!self.owner.BUTTON_ATCK))
     {
 
-        self.gun1.angles_z += 36;
-        self.gun2.angles_z -= 36;
+        ftmp = 1 / cvar("g_vehicle_spiderbot_minigun_cooldown") * sys_ticrate;
+        self.owner.vehicle_reload1 = max(self.owner.vehicle_reload1 - ftmp, 0);
+        if(self.owner.vehicle_reload1 <= 0)
+            self.vehicle_reload1 = 0;
+
+        return ;
+    }
+
+    if (self.owner.BUTTON_ATCK)
+    {
+
+        // Animate miniguns
+        self.gun1.angles_z += (1440 * sys_ticrate);
+        self.gun2.angles_z -= (1440 * sys_ticrate);
         if(self.gun1.angles_z >= 360)
         {
             self.gun1.angles_z = 0;
             self.gun2.angles_z = 360;
         }
 
-        self = self.owner;
-        if(self.uzi_bulletcounter == 1)
-        {
-            spiderbot_minigun_fire(self.vehicle.gun1,0);
-            spiderbot_minigun_fire(self.vehicle.gun2,1);
-            self.uzi_bulletcounter = 0;
-        }
-        else
-        {
-            spiderbot_minigun_fire(self.vehicle.gun1,1);
-            spiderbot_minigun_fire(self.vehicle.gun2,0);
-            self.uzi_bulletcounter += 1;
-        }
-
-        self = self.vehicle;
-        self.owner.vehicle_heat += cvar("g_vehicle_spiderbot_minigun_heat");
-        if(self.owner.vehicle_heat >= 1)
+        if (self.tur_head.attack_finished_single < time)
         {
-            self.vehicle_heat = 1;
-            self.owner.vehicle_heat = 1;
-            self.tur_head.attack_finished_single = (1/(cvar("g_vehicle_spiderbot_minigun_cooldown") * server_fps))+time;
-        }
-        else
-            self.tur_head.attack_finished_single = cvar("g_vehicle_spiderbot_minigun_refire") + time;
-
-        return;
-    }
-    else
-        if(self.vehicle_heat != 0)
-        {
-            self.vehicle_heat = max(self.vehicle_heat - cvar("g_vehicle_spiderbot_minigun_cooldown"),0);
-            if(self.tur_head.attack_finished_single < time)
+            // Fire bullets, alternating trails left<->right
+            self = self.owner;
+            if(self.uzi_bulletcounter == 1)
             {
-                self.vehicle_heat = 0;
-                self.owner.vehicle_heat = 0;
+                spiderbot_minigun_fire(self.vehicle.gun1, 0);
+                spiderbot_minigun_fire(self.vehicle.gun2, 1);
+                self.uzi_bulletcounter = 0;
             }
             else
             {
-                if(self.tur_head.uzi_bulletcounter < time)
-                {
-                    self.tur_head.uzi_bulletcounter = time + 0.2;
-                    self.owner.vehicle_heat  = self.vehicle_heat;
-                }
-                else
-                    self.owner.vehicle_heat = 1;
+                spiderbot_minigun_fire(self.vehicle.gun1, 1);
+                spiderbot_minigun_fire(self.vehicle.gun2, 0);
+                self.uzi_bulletcounter += 1;
             }
+
+            self = self.vehicle;
+
+            ftmp = cvar("g_vehicle_spiderbot_minigun_refire") / cvar("g_vehicle_spiderbot_minigun_heat");
+            self.owner.vehicle_reload1 +=  ftmp;
+
+            if(self.owner.vehicle_reload1 >= 1)
+            {
+                self.vehicle_reload1 = 1;
+                self.owner.vehicle_reload1 = 1;
+                self.tur_head.attack_finished_single = cvar("g_vehicle_spiderbot_minigun_cooldown") + time;
+            }
+            else
+                self.tur_head.attack_finished_single = cvar("g_vehicle_spiderbot_minigun_refire") + time;
         }
-        else
-            self.owner.vehicle_heat = max(self.owner.vehicle_heat - cvar("g_vehicle_spiderbot_minigun_cooldown"),0);
 
+        self = self.owner;
+        return;
+    }
 }
 #define SBS_IDLE  0
 #define SBS_JUMP  1
@@ -391,7 +278,6 @@ float spiderbot_pplug()
     player.BUTTON_CROUCH = 0;
     player.switchweapon = 0;
 
-
     if(player.BUTTON_USE)
     {
         self = spider;
@@ -404,20 +290,18 @@ float spiderbot_pplug()
 
     spider.tur_head.angles_x *= -1;
     spider.angles_x *= -1;
-    //player.angles_x *= -1;
     makevectors(spider.angles);
 
-    //ad = player.v_angle - (spider.tur_head.angles + spider.angles);
     ad = player.v_angle -  (spider.tur_head.angles + spider.angles);
 
     // Rotate head
-    ftmp = cvar("g_vehicle_spiderbot_head_turnspeed") / server_fps;
+    ftmp = cvar("g_vehicle_spiderbot_head_turnspeed") * sys_ticrate;
     ftmp2 = ftmp * -1;
     spider.tur_head.angles_y += bound(ftmp2,shortangle_f(ad_y,spider.tur_head.angles_y),ftmp);
     spider.tur_head.angles_y = bound(cvar("g_vehicle_spiderbot_head_turnlimit") * -1,spider.tur_head.angles_y,cvar("g_vehicle_spiderbot_head_turnlimit"));
 
     // Pitch head
-    ftmp = cvar("g_vehicle_spiderbot_head_pitchspeed") / server_fps;
+    ftmp = cvar("g_vehicle_spiderbot_head_pitchspeed") * sys_ticrate;
     ftmp2 = ftmp * -1;
     spider.tur_head.angles_x += bound(ftmp2,shortangle_f(ad_x,spider.tur_head.angles_x),ftmp);
     spider.tur_head.angles_x = bound(cvar("g_vehicle_spiderbot_head_pitchlimit_down"),spider.tur_head.angles_x,cvar("g_vehicle_spiderbot_head_pitchlimit_up"));
@@ -427,7 +311,7 @@ float spiderbot_pplug()
     //player.angles_x *= -1;
 
     // Turn Body
-    ftmp = cvar("g_vehicle_spiderbot_turnspeed") / server_fps;
+    ftmp = cvar("g_vehicle_spiderbot_turnspeed") * sys_ticrate;
     ftmp2 = ftmp * -1;
     ftmp = bound(ftmp2,spider.tur_head.angles_y,ftmp);
 
@@ -438,8 +322,6 @@ float spiderbot_pplug()
         if(player.BUTTON_JUMP)
         {
             player.BUTTON_JUMP = 0;
-            spider.anim_start = MODEL_SPIDERBOT_JUMP_START;
-            spider.anim_end   = MODEL_SPIDERBOT_JUMP_END;
             spider.velocity   = v_forward * 700 + v_up * 600;
             spider.state = SBS_JUMP;
             spider.frame = 4;
@@ -464,16 +346,12 @@ float spiderbot_pplug()
                     if(player.movement_x > 0)
                     {
                         player.movement_x = 1;
-                        spider.anim_start = MODEL_SPIDERBOT_FORWARD_START;
-                        spider.anim_end   = MODEL_SPIDERBOT_FORWARD_END;
                         spider.state = SBS_WALK;
                         spider.frame = 0;
                     }
                     else if(player.movement_x < 0)
                     {
                         player.movement_x = -1;
-                        spider.anim_start = MODEL_SPIDERBOT_BACKWARDS_START;
-                        spider.anim_end   = MODEL_SPIDERBOT_BACKWARDS_END;
                         spider.state = SBS_BACK;
                         spider.frame = 1;
                     }
@@ -485,16 +363,12 @@ float spiderbot_pplug()
                     if(player.movement_y < 0)
                     {
                         player.movement_y = -1;
-                        spider.anim_start = MODEL_SPIDERBOT_LEFT_START;
-                        spider.anim_end   = MODEL_SPIDERBOT_LEFT_END;
                         spider.state = SBS_LEFT;
                         spider.frame = 2;
                     }
                     else if(player.movement_y > 0)
                     {
                         player.movement_y = 1;
-                        spider.anim_start = MODEL_SPIDERBOT_RIGHT_START;
-                        spider.anim_end   = MODEL_SPIDERBOT_RIGHT_END;
                         spider.state = SBS_RIGHT;
                         spider.frame = 3;
                     }
@@ -506,24 +380,25 @@ float spiderbot_pplug()
         movelib_groundalign4point(300,100,0.25);
     }
 
-    //anim_do();
     spiderbot_miniguns_do();
     spiderbot_rocket_do();
-    vehicle_stdproc_regen();
+    vehicle_stdproc_shiledregen(CCVAR("_shield"), frametime);
+    vehicle_stdproc_healthregen(CCVAR("_health"), frametime);
 
     player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
-    player.rockets = spider.tur_head.frame;
+    player.vehicle_ammo2 = spider.tur_head.frame;
 
     if(spider.gun2.cnt <= time)
-        player.rockets_reload = 1;
+        player.vehicle_reload2 = 1;
     else
-        player.rockets_reload = 1 - ((spider.gun2.cnt - time) /spider.attack_finished_single);
-
-    self = player;
+        player.vehicle_reload2 = 1 - ((spider.gun2.cnt - time) / spider.attack_finished_single);
 
+    //setorigin(spider,spider.origin);
     setorigin(player,spider.origin + '0 0 64');
     player.velocity = spider.velocity;
 
+    self = player;
+
     return 1;
 }
 
@@ -541,7 +416,7 @@ void spiderbot_think()
 void spiderbot_enter()
 {
     // Remove this when bots know how to use the spiderbot
-    if not (clienttype(other) == CLIENTTYPE_REAL)
+    if (clienttype(other) != CLIENTTYPE_REAL)
         return;
 
     self.colormod = self.tur_head.colormod = '0 0 0';
@@ -558,7 +433,7 @@ void spiderbot_enter()
     self.colormap             = self.owner.colormap;
     self.tur_head.colormap    = self.owner.colormap;
     self.vehicle_hudmodel.viewmodelforclient = self.owner;
-    self.nextthink = 0;
+    self.nextthink            = 0;
     self.owner.angles         = self.angles;
     self.owner.takedamage     = DAMAGE_NO;
     self.owner.solid          = SOLID_NOT;
@@ -570,11 +445,20 @@ void spiderbot_enter()
     self.owner.hud            = HUD_SPIDERBOT;
     self.owner.vehicle_health = (self.vehicle_health / cvar("g_vehicle_spiderbot_health"));
     self.owner.vehicle_shield = (self.vehicle_shield / cvar("g_vehicle_spiderbot_shield"));
-    self.team                   = self.owner.team;
+    self.owner.view_ofs       = '0 0 0';
+    self.owner.vehicle_ammo1 = self.vehicle_ammo1;
+    self.owner.vehicle_ammo2 = self.vehicle_ammo2;
+    self.owner.vehicle_reload1 = self.vehicle_reload1;
+    self.owner.vehicle_reload2 = self.vehicle_reload2;
+
+    //if(other.flags & FL_ONGROUND)
+        other.flags &~= FL_ONGROUND;
 
-    //setorigin(self.owner,self.origin);
-    //setattachment(self.owner,self,"");
-    //setorigin(self.owner,'0 0 0');
+    //if(self.flags & FL_ONGROUND)
+        self.flags &~= FL_ONGROUND;
+
+    self.team                 = self.owner.team;
+    self.flags               -= FL_NOTARGET;
 
     if(clienttype(other) == CLIENTTYPE_REAL)
     {
@@ -587,16 +471,15 @@ void spiderbot_enter()
         WriteAngle(MSG_ONE, self.tur_head.angles_y + self.angles_y);    // yaw
         WriteAngle(MSG_ONE, 0);    // roll
     }
-
-    //WriteAngle(MSG_ONE, self.tur_head.angles_z + self.angles_z);    // roll
-    //self.owner.view_ofs = '0 0 0';
-    //self.tur_head.nodrawtoclient = self.owner;
 }
 
 void spiderbot_exit(float eject)
 {
     entity e;
     self.frame = 5;
+
+    self.flags      |= FL_NOTARGET;
+
     e = findchain(classname,"spiderbot_rocket");
     while(e)
     {
@@ -604,9 +487,6 @@ void spiderbot_exit(float eject)
         {
             e.realowner = self.owner;
             e.owner = world;
-            //e.solid = SOLID_BBOX;
-            //e.think = SUB_Null;
-            //e.nextthink = -1;
         }
         e = e.chain;
     }
@@ -626,7 +506,6 @@ void spiderbot_exit(float eject)
         WriteAngle(MSG_ONE, 0);    // roll
     }
 
-    //setattachment(self.owner,world,"");
     self.think = spiderbot_think;
     self.nextthink = time;
     self.owner.takedamage     = DAMAGE_AIM;
@@ -672,6 +551,20 @@ void spiderbot_exit(float eject)
     self.owner = world;
 }
 
+float spiderbot_crushable(entity e)
+{
+    if(e.classname == "corpse")
+        return 1;
+
+    if(e.classname == "player")
+        return 1;
+
+    if(e.classname == "monster_zombie")
+        return 1;
+
+    return 0;
+}
+
 void spiderbot_touch()
 {
     if(self.owner)
@@ -679,12 +572,12 @@ void spiderbot_touch()
         if(vlen(self.velocity) == 0)
             return;
 
-        if(other.classname != "player")
+        if not (spiderbot_crushable(other))
             return;
 
-        //todo: add check for velocity here (so we dont cush players runing onto us from behind)
+        //todo: add check for velocity/angle here (so we dont cush players runing onto us from behind)
 
-        Damage(other,self,self.owner,cvar("g_vehicle_spiderbot_crush_dmg"),DEATH_TURRET,'0 0 0', normalize(other.origin - self.origin) * cvar("g_vehicle_spiderbot_crush_force") );
+        Damage(other,self,self.owner,cvar("g_vehicle_spiderbot_crush_dmg"),DEATH_SBCRUSH,'0 0 0', normalize(other.origin - self.origin) * cvar("g_vehicle_spiderbot_crush_force") );
         return;
     }
 
@@ -715,6 +608,7 @@ void spiderbot_spawn()
     self.think = spiderbot_think;
     self.nextthink = time;
 
+    self.velocity = '0 0 -2000';
     self.vehicle_health = CCVAR("_health");
     self.vehicle_shield = CCVAR("_shield");
     self.event_damage = vehicle_stdproc_damage;
@@ -729,7 +623,7 @@ void spiderbot_spawn()
        self.tur_head.colormap = 1024;
        self.deadflag    = DEAD_NO;
     self.bot_attack = TRUE;
-
+    self.flags      |= FL_NOTARGET;
     setsize(self,spiderbot_MIN,spiderbot_MAX);
 
     setorigin(self,self.spiderbot_spawnpnt.origin);
@@ -756,10 +650,11 @@ void spiderbot_blowup()
     RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_TURRET, world);
 
     self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
-    self.nextthink  = time + 10;
+    self.nextthink  = time + cvar("g_vehicle_spiderbot_respawntime");
     self.think      = spiderbot_spawn;
+    self.movetype   = MOVETYPE_NONE;
 
-    setorigin(self,self.tur_aimpos);
+    setorigin(self, self.tur_aimpos);
 }
 
 void spiderbot_die()
@@ -795,44 +690,46 @@ void vewhicle_spiderbot_dinit()
     else
         self.spiderbot_spawnpnt.team = self.team;
 
-    server_fps = (1 / sys_ticrate);
-
     addstat(STAT_HUD, AS_INT,  hud);
-       addstat(STAT_SPIDERBOT_ROCKETS, AS_INT,   rockets);
-       addstat(STAT_SPIDERBOT_RELOAD,  AS_FLOAT, rockets_reload);
-       addstat(STAT_SPIDERBOT_HEAT,    AS_FLOAT, vehicle_heat);
-       addstat(STAT_SPIDERBOT_HEALTH,  AS_FLOAT, vehicle_health);
-       addstat(STAT_SPIDERBOT_SHIELD,  AS_FLOAT, vehicle_shield);
-
-    if (self.netname == "")      self.netname     = "spiderbot";
-
-    self.tur_head = spawn();
-    self.gun1 = spawn();
-    self.gun2 = spawn();
-    self.vehicle_viewport = spawn();
-    self.gravity = 2;
-    self.vehicle_hudmodel = spawn();
-    self.vehicle_flags = VHF_HASSHIELD | VHF_SHIELDREGEN | VHF_HEALTHREGEN;
-    self.cvar_basename = "g_vehicle_spiderbot";
-
-    setmodel (self.vehicle_hudmodel, "models/spiderbot/cp.md3");
-    setmodel (self.vehicle_viewport, "null");
-    setmodel(self,"models/spiderbot/spiderbot.dpm");
-    setmodel(self.tur_head,"models/spiderbot/spiderbot_top.dpm");
-    setmodel(self.gun1,"models/spiderbot/spiderbot_barrels.dpm");
-    setmodel(self.gun2,"models/spiderbot/spiderbot_barrels.dpm");
-
-    setattachment(self.tur_head,self,"tag_head");
-    setattachment(self.vehicle_hudmodel,self.tur_head,"");
-    setattachment(self.vehicle_viewport,self.vehicle_hudmodel,"");
-    setattachment(self.gun1,self.tur_head,"tag_hardpoint01");
-    setattachment(self.gun2,self.tur_head,"tag_hardpoint02");
+       addstat(STAT_VEHICLESTAT_HEALTH,  AS_FLOAT, vehicle_health);
+       addstat(STAT_VEHICLESTAT_SHIELD,  AS_FLOAT, vehicle_shield);
+       addstat(STAT_VEHICLESTAT_ENERGY,  AS_FLOAT, vehicle_energy);
+       addstat(STAT_VEHICLESTAT_AMMO1,   AS_INT,   vehicle_ammo1);
+       addstat(STAT_VEHICLESTAT_RELOAD1, AS_FLOAT, vehicle_reload1);
+       addstat(STAT_VEHICLESTAT_AMMO2,   AS_INT,   vehicle_ammo2);
+       addstat(STAT_VEHICLESTAT_RELOAD2, AS_FLOAT, vehicle_reload2);
+
+    if (self.netname == "")
+        self.netname     = "spiderbot";
+
+    self.tur_head           = spawn();
+    self.gun1               = spawn();
+    self.gun2               = spawn();
+    self.vehicle_viewport   = spawn();
+    self.vehicle_hudmodel   = spawn();
+    self.vehicle_flags      = VHF_HASSHIELD | VHF_SHIELDREGEN | VHF_HEALTHREGEN | VHF_DEATHEJECT;
+    self.cvar_basename      = "g_vehicle_spiderbot";
+    self.gravity            = 2;
+
+    setmodel(self, "models/vehicles/spiderbot.dpm");
+    setmodel(self.tur_head, "models/vehicles/spiderbot_top.dpm");
+    setmodel(self.gun1, "models/vehicles/spiderbot_barrels.dpm");
+    setmodel(self.gun2, "models/vehicles/spiderbot_barrels.dpm");
+    setmodel(self.vehicle_hudmodel, "models/vehicles/spiderbot_cockpit.dpm");
+    setmodel(self.vehicle_viewport, "null");
+
+    setattachment(self.tur_head, self, "tag_head");
+    setattachment(self.vehicle_hudmodel, self.tur_head, "tag_hud");
+    setattachment(self.vehicle_viewport, self.vehicle_hudmodel, "");
+
+    setattachment(self.gun1,self.tur_head, "tag_hardpoint01");
+    setattachment(self.gun2,self.tur_head, "tag_hardpoint02");
 
     self.tur_head.owner = self;
     self.customizeentityforclient          = spiderbot_customizeentityforclient;
 
-    setorigin(self.vehicle_viewport,'35 0 -14');
     self.tur_aimpos = self.origin;
+
     spiderbot_spawn();
 
     self.vehicle_die = spiderbot_die;
@@ -841,13 +738,12 @@ void vewhicle_spiderbot_dinit()
 
 void spawnfunc_vehicle_spiderbot()
 {
-    // g_turrets_common_precash();
-
     precache_model ( "models/vhshield.md3");
-    precache_model ( "models/spiderbot/cp.md3");
-    precache_model ( "models/spiderbot/spiderbot.dpm");
-    precache_model ( "models/spiderbot/spiderbot_top.dpm");
-    precache_model ( "models/spiderbot/spiderbot_barrels.dpm");
+    precache_model ( "models/vehicles/spiderbot.dpm");
+    precache_model ( "models/vehicles/spiderbot_top.dpm");
+    precache_model ( "models/vehicles/spiderbot_barrels.dpm");
+    precache_model ( "models/vehicles/spiderbot_cockpit.dpm");
+    precache_model ( "models/uziflash.md3");
 
     precache_model ( "models/turrets/rocket.md3");
     precache_sound ( "weapons/rocket_impact.wav" );
index dba8851..5aac0f0 100644 (file)
@@ -6,48 +6,54 @@ void vehicle_stdproc_exit(float eject)
 {
 }
 
-void vehicle_stdproc_regen()
+void vehicle_stdproc_shiledregen(float rmax, float dt)
 {
-    float smax,hmax;
-
-    smax = CCVAR("_shield");
-    hmax = CCVAR("_health");
-
-    if(self.vehicle_flags & VHF_HASSHIELD)
-    if(self.vehicle_flags & VHF_SHIELDREGEN)
-    if(self.vehicle_shield < smax)
+    if(self.vehicle_shield < rmax)
     if(self.dmg_time + CCVAR("_shield_regen_dmgpause") < time)
     {
-        self.vehicle_shield = min(self.vehicle_shield + CCVAR("_shield_regen") / server_fps,smax);
+        self.vehicle_shield = min(self.vehicle_shield + CCVAR("_shield_regen") * dt, rmax);
 
         if(self.owner)
-            self.owner.vehicle_shield = self.vehicle_shield / cvar(strcat(self.cvar_basename,"_shield"));
+            self.owner.vehicle_shield = self.vehicle_shield / rmax;
     }
+}
+
+void vehicle_stdproc_healthregen(float rmax, float dt)
+{
 
-    if(self.vehicle_flags & VHF_HEALTHREGEN)
     if(self.dmg_time + CCVAR("_health_regen_dmgpause") < time)
-    if(self.vehicle_health < hmax)
+    if(self.vehicle_health < rmax)
     {
-        self.vehicle_health = min(self.vehicle_health + CCVAR("_health_regen") / server_fps,hmax);
+        self.vehicle_health = min(self.vehicle_health + CCVAR("_health_regen") * dt, rmax);
 
         if(self.owner)
-            self.owner.vehicle_health = self.vehicle_health / CCVAR("_health");
+            self.owner.vehicle_health = self.vehicle_health / rmax;
     }
 }
 
-void shieldhit_think()
+void vehicle_stdproc_energyregen(float rmax, float dt)
 {
-    self.alpha = self.alpha - 0.125;
-    if not(self.alpha <= 0)
+    if(self.vehicle_energy < rmax)
     {
-        self.nextthink = time;
+        self.vehicle_energy = min(self.vehicle_energy + CCVAR("_energy_regen") * dt, rmax);
+
+        if(self.owner)
+            self.owner.vehicle_energy = self.vehicle_energy / rmax;
     }
-    else
+}
+
+void shieldhit_think()
+{
+    self.alpha = self.alpha - 0.2;
+    if (self.alpha <= 0)
     {
         setmodel(self,"");
         self.alpha = -1;
     }
-    //self.think = SUB_Remove;
+    else
+    {
+        self.nextthink = time + 0.1;
+    }
 }
 
 void vehicle_stdproc_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
@@ -59,40 +65,36 @@ void vehicle_stdproc_damage(entity inflictor, entity attacker, float damage, flo
 
     if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
     {
+
         if not (self.tur_head.enemy)
+        {
             self.tur_head.enemy = spawn();
+            self.tur_head.enemy.effects = EF_LOWPRECISION;
+        }
 
-        entity sh;
-
-        sh = self.tur_head.enemy;
-        sh.colormod = '1 1 1';
-        sh.alpha = 0.5;
-        sh.scale  = (128 / vlen(self.maxs - self.mins))*2;
-        //sh.scale = 1.25;
-
-        sh.effects = EF_LOWPRECISION;
-        sh.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
-
-        setmodel(sh,"models/vhshield.md3");
-        setattachment(sh,self,"");
-        sh.think = shieldhit_think;
-        sh.nextthink = time;
+        setmodel(self.tur_head.enemy,"models/vhshield.md3");
+        setattachment(self.tur_head.enemy,self,"");
 
+        self.tur_head.enemy.colormod = '1 1 1';
+        self.tur_head.enemy.alpha = 0.45;
+        self.tur_head.enemy.scale  = (256 / vlen(self.maxs - self.mins));
+        self.tur_head.enemy.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
+        self.tur_head.enemy.think = shieldhit_think;
+        self.tur_head.enemy.nextthink = time;
 
         self.vehicle_shield -= damage;
         if(self.vehicle_shield < 0)
         {
-            sh.colormod = '10 0 -1';
+            self.tur_head.enemy.colormod = '10 0 -1';
             ddmg_take = fabs(self.vehicle_shield);
             self.vehicle_shield = 0;
-
+            self.tur_head.enemy.alpha = 0.75;
             self.vehicle_health -= ddmg_take;
         }
     }
     else
         self.vehicle_health -= damage;
 
-
     if(self.owner)
     {
         self.owner.vehicle_health = self.vehicle_health / CCVAR("_health");
@@ -105,7 +107,8 @@ void vehicle_stdproc_damage(entity inflictor, entity attacker, float damage, flo
     if(self.vehicle_health <= 0)
     {
         if(self.owner)
-            self.vehicle_exit(VHEF_EJECT);
+            if(self.vehicle_flags & VHF_DEATHEJECT)
+                self.vehicle_exit(VHEF_EJECT);
 
         self.vehicle_die();
     }
@@ -119,5 +122,5 @@ void bugmenot()
     self.vehicle_enter      = self.vehicle_exit;
     self.vehicle_die        = self.vehicle_exit;
     self.vehicle_spawn      = self.vehicle_exit;
-    self.vehicle_message    = self.vehicle_exit;
+    //self.vehicle_message    = self.vehicle_exit;
 }
index aa8e730..6da19da 100644 (file)
@@ -1,4 +1,4 @@
-//#define VEHICLES_ENABLED
+#define VEHICLES_ENABLED
 #ifdef VEHICLES_ENABLED
 
 #message "with tZork vehicles (experimental)"
@@ -11,19 +11,26 @@ float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
 //.string cvar_basename;
 
 .float vehicle_flags;
-#define VHF_HASSHIELD 2
+#define VHF_HASSHIELD   2
 #define VHF_SHIELDREGEN 4
 #define VHF_HEALTHREGEN 8
+#define VHF_DEATHEJECT  16
+#define VHF_ENERGYREGEN 32
 
 .float hud;
-.float rockets;
-.float rockets_reload;
+
 .entity gun1;
 .entity gun2;
 
 .float vehicle_health;
 .float vehicle_shield;
-.float vehicle_heat;
+.float vehicle_energy;
+
+.float vehicle_ammo1;
+.float vehicle_reload1;
+
+.float vehicle_ammo2;
+.float vehicle_reload2;
 
 .entity vehicle;
 .entity vehicle_viewport;
@@ -34,16 +41,14 @@ float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
 
 .float dmg_time;
 
-float server_fps;
-
 #define VHEF_NORMAL 0
 #define VHEF_EJECT 1
 
-.void(float exit_flags) vehicle_exit;
-.void() vehicle_enter;
-.void() vehicle_die;
-.void() vehicle_spawn;
-.float(float message) vehicle_message;
+var .void(float exit_flags) vehicle_exit;
+var .void() vehicle_enter;
+var .void() vehicle_die;
+var .void() vehicle_spawn;
+//var .float(float message) vehicle_message;
 
 #include "vehicles.qc"
 #include "spiderbot.qc"
index 77ca49a..d31c5f5 100644 (file)
@@ -1,15 +1,50 @@
-set g_vehicle_racer_health             250
-set g_vehicle_racer_turnspeed          360
-set g_vehicle_racer_speed_stop         0.1     
-set g_vehicle_racer_speed_forward      2000
-set g_vehicle_racer_speed_strafe       1000
-set g_vehicle_racer_movement_inertia   0.15
+set g_vehicle_racer_reload             1
+
+set g_vehicle_racer_health                250
+
+set g_vehicle_racer_shield                  100
+set g_vehicle_racer_shield_block            1
+set g_vehicle_racer_shield_regen            50
+set g_vehicle_racer_shield_regen_dmgpause   0.25
+set g_vehicle_racer_shield_regen_energyrate 2
+
+set g_vehicle_racer_energy          150
+set g_vehicle_racer_energy_regen    50
+set g_vehicle_racer_energy_usepause 1
+
+set g_vehicle_racer_speed_stop           2000
+set g_vehicle_racer_speed_forward        1600
+set g_vehicle_racer_speed_strafe         750
+
+set g_vehicle_racer_speed_afterburn      3500
+set g_vehicle_racer_speed_afterburn_emin 25
+set g_vehicle_racer_speed_afterburn_cost 100
+
 set g_vehicle_racer_power_air          0
-set g_vehicle_racer_power_solid        5000
+set g_vehicle_racer_power_solid        1000
+
 set g_vehicle_racer_drag               0.25
-set g_vehicle_racer_dragexp            0.75
-set g_vehicle_racer_downforce          0.05
-set g_vehicle_racer_springlength       200
-set g_vehicle_racer_inert              0.25
-set g_vehicle_racer_drag2              0.01
-set g_vehicle_racer_drag2exp           0.85
+set g_vehicle_racer_dragexp            0.9
+
+set g_vehicle_racer_downforce          0.01
+
+set g_vehicle_racer_springlength       150
+set g_vehicle_racer_anglestabilizer    18
+
+set g_vehicle_racer_turnspeed          180
+set g_vehicle_racer_pitchspeed         360
+set g_vehicle_racer_maxpitch           25
+set g_vehicle_racer_turnroll           0.3
+
+set g_vehicle_racer_laser_speed        18000
+set g_vehicle_racer_laser_damage       20
+set g_vehicle_racer_laser_radius       100
+set g_vehicle_racer_laser_refire       0.05
+set g_vehicle_racer_laser_cost         2
+
+set g_vehicle_racer_rocket_speed       1500
+set g_vehicle_racer_rocket_damage      200
+set g_vehicle_racer_rocket_radius      100
+set g_vehicle_racer_rocket_refire      5
+set g_vehicle_racer_rocket_cost        0
+
index 11d4ad3..d25ce20 100644 (file)
@@ -1,17 +1,17 @@
-set g_vehicle_spiderbot_respawntime                    30
-set g_vehicle_spiderbot_health                  875
-set g_vehicle_spiderbot_health_regen           10
-set g_vehicle_spiderbot_health_regen_dmgpause   10
-
-set g_vehicle_spiderbot_shield          125
-set g_vehicle_spiderbot_shield_block    1
-set g_vehicle_spiderbot_shield_regen    25
+set g_vehicle_spiderbot_respawntime                      30
+set g_vehicle_spiderbot_health                875
+set g_vehicle_spiderbot_health_regen             10
+set g_vehicle_spiderbot_health_regen_dmgpause 10
+
+set g_vehicle_spiderbot_shield                125
+set g_vehicle_spiderbot_shield_block          1
+set g_vehicle_spiderbot_shield_regen          25
 set g_vehicle_spiderbot_shield_regen_dmgpause 0.25
 
-set g_vehicle_spiderbot_turnspeed       90
-set g_vehicle_spiderbot_head_turnspeed  120
-set g_vehicle_spiderbot_head_turnlimit  120
-set g_vehicle_spiderbot_head_pitchspeed 60
+set g_vehicle_spiderbot_turnspeed            90
+set g_vehicle_spiderbot_head_turnspeed       120
+set g_vehicle_spiderbot_head_turnlimit       120
+set g_vehicle_spiderbot_head_pitchspeed      60
 set g_vehicle_spiderbot_head_pitchlimit_up   8
 set g_vehicle_spiderbot_head_pitchlimit_down -24
 
@@ -20,13 +20,13 @@ set g_vehicle_spiderbot_speed_walk         400
 set g_vehicle_spiderbot_speed_strafe       300
 set g_vehicle_spiderbot_movement_inertia   0.25
 
-set g_vehicle_spiderbot_minigun_bulletconstant 200
-set g_vehicle_spiderbot_minigun_damage         20
+set g_vehicle_spiderbot_minigun_damage         25
 set g_vehicle_spiderbot_minigun_spread         0.015
 set g_vehicle_spiderbot_minigun_speed          50000
-set g_vehicle_spiderbot_minigun_refire         0.025
-set g_vehicle_spiderbot_minigun_heat           0.015
-set g_vehicle_spiderbot_minigun_cooldown       0.015
+set g_vehicle_spiderbot_minigun_refire         0.05
+
+set g_vehicle_spiderbot_minigun_heat           10
+set g_vehicle_spiderbot_minigun_cooldown       10
 
 set g_vehicle_spiderbot_rocket_health     100
 set g_vehicle_spiderbot_rocket_damage     75
@@ -44,4 +44,4 @@ set g_vehicle_spiderbot_crush_dmg         50
 set g_vehicle_spiderbot_crush_force       50
 
 set cl_vehicle_spiderbot_cross_alpha 0.4
-set cl_vehicle_spiderbot_cross_size 1
+set cl_vehicle_spiderbot_cross_size  1