]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
more csqc-vehicles stuff
authorunknown <jakob@.(none)>
Sun, 17 Apr 2011 23:27:42 +0000 (01:27 +0200)
committerunknown <jakob@.(none)>
Sun, 17 Apr 2011 23:27:42 +0000 (01:27 +0200)
qcsrc/client/vehicles/vehicles.qc
qcsrc/client/vehicles/vehicles.qh
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/network.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles_def.qh

index 9b13086253cdcbeb28ceaf06319d925e7fd1ff07..8441c3a57f70af6bd6b15f0c5c856da142220a9b 100644 (file)
@@ -173,10 +173,10 @@ void CSQC_BUMBLE_HUD()
 
     // Fetch health & ammo stats
        HUD_GETSTATS
-       
+
     hudloc_y = 4;
     hudloc_x = 4;
-    
+
     picsize = drawgetimagesize(spider_h) * 0.5;
     drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
 
@@ -202,12 +202,12 @@ void CSQC_BUMBLE_HUD()
     picsize = drawgetimagesize(spider_b) * 0.5;
     hudloc_y = 10.5;
     hudloc_x = 10.5;
-    
-    ammo1  /= 100; 
+
+    ammo1  /= 100;
     shield /= 100;
     health /= 100;
     reload2 /= 100;
-    
+
     drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
     drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
     drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
@@ -236,10 +236,10 @@ void CSQC_SPIDER_HUD()
 
     // Fetch health & ammo stats
        HUD_GETSTATS
-       
+
     hudloc_y = 4;
     hudloc_x = 4;
-    
+
     picsize = drawgetimagesize(spider_h) * 0.5;
     drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
 
@@ -265,12 +265,12 @@ void CSQC_SPIDER_HUD()
     picsize = drawgetimagesize(spider_b) * 0.5;
     hudloc_y = 10.5;
     hudloc_x = 10.5;
-    
-    ammo1  /= 100; 
+
+    ammo1  /= 100;
     shield /= 100;
     health /= 100;
     reload2 /= 100;
-    
+
     drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
     drawpic(hudloc, spider_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
     drawpic(hudloc, spider_r, picsize, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL);
@@ -297,15 +297,14 @@ void CSQC_RAPTOR_HUD()
 {
        if(autocvar_r_letterbox)
         return;
-       
-       vector picsize, hudloc, vel;
-       float movedt;
+
+       vector picsize, hudloc;
     vector where;
 
 
     // Fetch health & ammo stats
     HUD_GETSTATS
-    
+
     // Draw the crosshairs
     picsize = drawgetimagesize("gfx/vehicles/axh-cross.tga");
     picsize_x *= 0.75;
@@ -428,9 +427,9 @@ void CSQC_WAKIZASHI_HUD()
        energy  = min(getstatf(STAT_VEHICLESTAT_ENERGY),  1);
        rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
        */
-    
+
     HUD_GETSTATS
-    
+
     hudloc_y =  4;
     hudloc_x = 4;
 
@@ -461,12 +460,12 @@ void CSQC_WAKIZASHI_HUD()
     picsize = drawgetimagesize(waki_b) * 0.5;
     hudloc_y = 10.5;
     hudloc_x = 10.5;
-    
+
     health /= 100;
     energy /= 100;
     shield /= 100;
     reload1 /= 100;
-    
+
     drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
     drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0'  * (1 - health), 1, DRAWFLAG_NORMAL);
     drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL);
@@ -489,7 +488,6 @@ void Vehicles_Precache()
        precache_model("models/vehicles/rocket02.md3");
 }
 
-
 void RaptorCBShellfragDraw()
 {
        Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
@@ -505,6 +503,7 @@ void RaptorCBShellfragDraw()
         remove(self);
 
 }
+
 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
 {
     entity sfrag;
@@ -530,6 +529,4 @@ void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
        sfrag.nextthink = time + 3;
        sfrag.cnt = time + 2;
     sfrag.drawmask = MASK_NORMAL;
-
-
 }
index 70e01b2c6fd15212822f187779608eaa64380ca7..66b2af1bf68a42fc008a5075bd8d88f7f119c581 100644 (file)
@@ -1,3 +1,4 @@
 void RaptorCBShellfragDraw();
 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang);
-void Vehicles_Precache();
\ No newline at end of file
+void Vehicles_Precache();
+
index 91f47dbefa62411560742b0b345be99dceb1b52e..80aa8bd4a97f8bd4b489c32631fbcdb728189eda 100644 (file)
@@ -1,3 +1,4 @@
+#ifdef SVQC
 // Auto cvars
 float autocvar_g_vehicle_bumblebee_speed_forward;
 float autocvar_g_vehicle_bumblebee_speed_strafe;
@@ -52,27 +53,27 @@ float bumb_gunner_frame()
     entity vehic, gun, gunner;
     float ftmp, ftmp2;
     vector vtmp;
-    
+
     vehic   = self.vehicle;
     gun     = self.vehicle.gun1;
     gunner  = self;
-    
+
     self    = vehic;
-    vehic.solid = SOLID_NOT;    
+    vehic.solid = SOLID_NOT;
     crosshair_trace(gunner);
-    
+
     //vtmp = gettaginfo(vehic, gettagindexvehic, "tag_hardpoint01"));
     vtmp = gettaginfo(gun, gettagindex(gun, "muzzle"));
     vtmp = vectoangles(normalize(trace_endpos - vtmp)); // Find the direction & angle
     vtmp = shortangle_vxy(vtmp - (vehic.angles + gun.angles), vehic.angles + gun.angles);     // Find aim offset
-    
+
     // Bind to aimspeed
     ftmp2 = autocvar_g_vehicle_bumblebee_cannon_turnspeed * frametime; ftmp = -ftmp2;
     vtmp_x = bound(ftmp, vtmp_x, ftmp2);
     vtmp_y = bound(ftmp, vtmp_y, ftmp2);
     // Bind to limts
     gun.angles_x = bound(-autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down, vtmp_x + gun.angles_x, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up);
-    gun.angles_y = bound(-autocvar_g_vehicle_bumblebee_cannon_turnlimit_in,  vtmp_y + gun.angles_y, autocvar_g_vehicle_bumblebee_cannon_turnlimit_out);    
+    gun.angles_y = bound(-autocvar_g_vehicle_bumblebee_cannon_turnlimit_in,  vtmp_y + gun.angles_y, autocvar_g_vehicle_bumblebee_cannon_turnlimit_out);
 
     if(gunner.BUTTON_ATCK && gun.cnt <= time)
     {
@@ -82,14 +83,14 @@ float bumb_gunner_frame()
 
         fireBullet (vtmp, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
             autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
-        
+
         gun.cnt = time + 0.1;
     }
-    
+
     setorigin(gunner, vehic.origin);
     gunner.velocity = vehic.velocity;
-    
-    vehic.solid = SOLID_BBOX;    
+
+    vehic.solid = SOLID_BBOX;
     gunner.BUTTON_ATCK = gunner.BUTTON_ATCK2 = gunner.BUTTON_CROUCH = 0;
     self = gunner;
     return 1;
@@ -99,7 +100,7 @@ void bumb_gunner_enter()
 {
     if(self.gunner1 != world)
         return;
-    
+
     self.gunner1         = other;
     self.gunner1.vehicle = self;
 
@@ -120,7 +121,7 @@ float bumb_pilot_frame()
 {
     entity pilot, gunner, vehic;
     vector newvel;
-    
+
     pilot = self;
     vehic = self.vehicle;
     self   = vehic;
@@ -141,10 +142,10 @@ float bumb_pilot_frame()
     }
 
     crosshair_trace(pilot);
-    
+
     vector vang;
     float ftmp;
-    
+
     vang = vehic.angles;
     newvel = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
     vang_x *= -1;
@@ -188,7 +189,7 @@ float bumb_pilot_frame()
             newvel -= v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
         else if(pilot.movement_y > 0)
             newvel += v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
-        ftmp = newvel * v_right;        
+        ftmp = newvel * v_right;
         ftmp *= frametime * 0.1;
         vehic.angles_z = bound(-15, vehic.angles_z + ftmp, 15);
     }
@@ -225,7 +226,7 @@ float bumb_pilot_frame()
 
     pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = pilot.BUTTON_CROUCH = 0;
     self = pilot;
-    
+
     return 1;
 }
 
@@ -247,7 +248,7 @@ void bumb_exit(float eject)
 }
 
 void bumb_spawn()
-{    
+{
     self.vehicle_health = autocvar_g_vehicle_bumblebee_health;
     self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
     self.movetype       = MOVETYPE_TOSS;
@@ -293,16 +294,16 @@ void bumb_dinit()
     self.gun1 = spawn();
     setmodel(self.gun1, "models/vehicles/bumblebee_ray.dpm");
     setattachment(self.gun1, self, "tag_hardpoint03");
-    
+
     self.gun1 = spawn();
     self.gun2 = spawn();
-    
+
     self.gun1.owner = self;
     self.gun2.owner = self;
-    
+
     setmodel(self.gun1, "models/vehicles/bumblebee_plasma_right.dpm");
     setmodel(self.gun2, "models/vehicles/bumblebee_plasma_left.dpm");
-    
+
     setattachment(self.gun1, self, "tag_hardpoint01");
     setattachment(self.gun2, self, "tag_hardpoint02");
 
@@ -311,7 +312,7 @@ void bumb_dinit()
     ofs -= self.origin;
     setattachment(self.gun1, self, "");
     setorigin(self.gun1, ofs);
-    
+
     ofs = gettaginfo(self, gettagindex(self, "tag_hardpoint02"));
     ofs -= self.origin;
     setattachment(self.gun2, self, "");
@@ -329,7 +330,7 @@ void spawnfunc_vehicle_bumblebee()
     precache_model ("models/vehicles/bumblebee_ray.dpm");
 
     //vehicles_configcheck("vehicle_bumblebee.cfg", autocvar_g_vehicle_bumblebee_health);
-    
+
     if(autocvar_g_vehicle_bumblebee_energy)
         if(autocvar_g_vehicle_bumblebee_energy_regen)
             self.vehicle_flags |= VHF_ENERGYREGEN;
@@ -344,5 +345,28 @@ void spawnfunc_vehicle_bumblebee()
         self.vehicle_flags |= VHF_HEALTHREGEN;
 
     self.think = bumb_dinit;
-    self.nextthink = time + 1;    
-}
\ No newline at end of file
+    self.nextthink = time + 1;
+}
+#endif // SVQC
+
+#ifdef CSQC
+void bumblebee_draw()
+{
+
+}
+
+void bumblebee_draw2d()
+{
+
+}
+
+void bumblebee_read_extra()
+{
+
+}
+
+void vehicle_bumblebee_assemble()
+{
+
+}
+#endif //CSQC
index 33bbfeaceb0e22deeceea8df9cb7b49584f0c274..15878f05ce12a3925fe22d810580808f6c63f156 100644 (file)
@@ -5,7 +5,7 @@ float VSF_ORIGIN      = 2;          /// Send location
 float VSF_MOVEMENT    = 4;          /// Send movement update (and angles)
 float VSF_AVEL        = 8;          /// Send Angular velocity
 float VSF_STATS       = 16;         /// Send ammo, health etc
-float VSF_EXTRA       = 32;         /// Send additional data (turret rotations and such). Handeld per vehicle type.
+float VSF_EXTRA       = 32;         /// Send additional data (turret rotations etc). Handeld per vehicle type.
 float VSF_ANIMINFO    = 64;         /// Animation info
 float VSF_FAR         = 128;
 float VSF_FULL_UPDATE = 16777215;    /// Send everything
@@ -16,56 +16,57 @@ float send_vehile(entity to, float sf)
 {
        float dist;
     var void WriteFunc(float, float);
-    
+
     dist = vlen(self.origin - to.origin);
     if(dist > VSF_FARDISTANCE && to != self.owner)
         sf |= VSF_FAR;
-       
+
        // Always send a movement and origin to owner
        if(to == self.owner)
            sf |= VSF_ORIGIN | VSF_MOVEMENT;
-                
+
        WriteByte(MSG_ENTITY, ENT_CLIENT_VEHICLE);
-       
+
        // We need to know client-side what was sent
        WriteByte(MSG_ENTITY, sf);
-       
+
        if(sf & VSF_SETUP)
        {
-        WriteByte(MSG_ENTITY,   self.hud);        //vehicle type = hud
-        WriteByte(MSG_ENTITY,   self.team);
-        WriteShort(MSG_ENTITY,  self.colormap);
+        WriteByte(MSG_ENTITY,  self.hud);        //vehicle type = hud
+        WriteByte(MSG_ENTITY,  self.team);
+        WriteShort(MSG_ENTITY, self.colormap);
+        WriteShort(MSG_ENTITY, self.vehicle_flags);
        }
-    
+
     if(sf & VSF_ORIGIN)
-    {        
-        WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteCoord); 
+    {
+        WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteCoord);
         WriteFunc(MSG_ENTITY, self.origin_x);
         WriteFunc(MSG_ENTITY, self.origin_y);
-        WriteFunc(MSG_ENTITY, self.origin_z);        
+        WriteFunc(MSG_ENTITY, self.origin_z);
     }
-    
+
     if(sf & VSF_MOVEMENT)
-    {   
+    {
         WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteCoord);
-        WriteCoord(MSG_ENTITY, self.velocity_x);
-        WriteCoord(MSG_ENTITY, self.velocity_y);
-        WriteCoord(MSG_ENTITY, self.velocity_z);
+        WriteFunc(MSG_ENTITY, self.velocity_x);
+        WriteFunc(MSG_ENTITY, self.velocity_y);
+        WriteFunc(MSG_ENTITY, self.velocity_z);
 
         WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteAngle);
-        WriteAngle(MSG_ENTITY, self.angles_x);
-        WriteAngle(MSG_ENTITY, self.angles_y);
-        WriteAngle(MSG_ENTITY, self.angles_z);
+        WriteFunc(MSG_ENTITY, self.angles_x);
+        WriteFunc(MSG_ENTITY, self.angles_y);
+        WriteFunc(MSG_ENTITY, self.angles_z);
     }
-    
+
     if(sf & VSF_AVEL)
     {
         WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteCoord);
-        WriteCoord(MSG_ENTITY, self.avelocity_x);
-        WriteCoord(MSG_ENTITY, self.avelocity_y);
-        WriteCoord(MSG_ENTITY, self.avelocity_z);        
+        WriteFunc(MSG_ENTITY, self.avelocity_x);
+        WriteFunc(MSG_ENTITY, self.avelocity_y);
+        WriteFunc(MSG_ENTITY, self.avelocity_z);
     }
-    
+
     if(sf & VSF_STATS)
     {
         if(to == self.owner)
@@ -73,82 +74,107 @@ float send_vehile(entity to, float sf)
             WriteByte(MSG_ENTITY, 1);
             WriteByte(MSG_ENTITY, self.vehicle_shield);
             WriteByte(MSG_ENTITY, self.vehicle_energy);
-            
+
             WriteByte(MSG_ENTITY, self.vehicle_ammo1);
             WriteByte(MSG_ENTITY, self.vehicle_reload1);
-            
+
             WriteByte(MSG_ENTITY, self.vehicle_ammo2);
             WriteByte(MSG_ENTITY, self.vehicle_reload2);
-            
+
         }
         else
             WriteByte(MSG_ENTITY, 0);
-            
+
         WriteByte(MSG_ENTITY, self.vehicle_health);
     }
-    
+
     if(sf & VSF_EXTRA)
         self.vehile_send_exta(to, sf);
-    
+
     return TRUE;
 }
 
 void net_link_vehile()
-{    
+{
     self.SendFlags = 0xFFFFFF;
-    Net_LinkEntity(self, FALSE, 0, send_vehile);    
+    Net_LinkEntity(self, FALSE, 0, send_vehile);
 }
 #endif // SVQC
 
 #ifdef CSQC
+void vehicle_spiderbot_assemble()
+{
+
+}
+
+void vehicle_racer_assemble()
+{
+
+}
+
+void vehicle_raptor_assemble()
+{
+
+}
+
+void vehicle_bumblebee_assemble()
+{
+
+}
+
 void Net_ReadVehicle(float bIsNew)
 {
     float sf;
     var float ReadFunc();
-    
+
     if(bIsNew)
     {
         /*setmodel(self, "models/vehicles/wakizashi.dpm");
-        self.move_movetype = MOVETYPE_BOUNCE;        
+        self.move_movetype = MOVETYPE_BOUNCE;
         self.entremove = VehicleRacerRemove;
-        setsize(self,  '-60 -60 -20', '60 60 20');        
+        setsize(self,  '-60 -60 -20', '60 60 20');
         self.draw = VehicleRacerDraw;
         self.scale = 0.5;*/
     }
 
-    sf = ReadByte();    
+    sf = ReadByte();
        if(sf & VSF_SETUP)
        {
-        self.vehicle_hud      = ReadByte();
-        self.team     = ReadByte();
-        self.colormap = ReadShort();
-        
+        self.vehicle_hud   = ReadByte();
+        self.team          = ReadByte();
+        self.colormap      = ReadShort();
+        self.vehicle_flags = ReadShort();
+
         switch(self.vehicle_hud)
         {
             case HUD_WAKIZASHI:
+                vehicle_racer_assemble();
                 break;
             case HUD_SPIDERBOT:
+                vehicle_spiderbot_assemble();
                 break;
             case HUD_RAPTOR:
+                vehicle_raptor_assemble();
                 break;
             case HUD_BUMBLEBEE:
+                vehicle_bumblebee_assemble();
                 break;
             default:
                 break;
         }
-       }        
-    
+       }
+
     if(sf & VSF_ORIGIN)
-    {    
+    {
         ReadFunc = ((sf & VSF_FAR) ? ReadShort : ReadCoord);
         self.origin_x       = ReadCoord();
         self.origin_y       = ReadCoord();
         self.origin_z       = ReadCoord();
         self.move_origin    = self.origin;
     }
-    
+
     if(sf & VSF_MOVEMENT)
-    {    
+    {
         ReadFunc = ((sf & VSF_FAR) ? ReadShort : ReadCoord);
         self.velocity_x     = ReadFunc();
         self.velocity_y     = ReadFunc();
@@ -158,19 +184,33 @@ void Net_ReadVehicle(float bIsNew)
         self.angles_x       = ReadFunc();
         self.angles_y       = ReadFunc();
         self.angles_z       = ReadFunc();
-        
+
         self.move_velocity  = self.velocity;
         self.move_angles    = self.angles;
     }
 
     if(sf & VSF_AVEL)
-    {    
+    {
         ReadFunc = ((sf & VSF_FAR) ? ReadShort : ReadCoord);
         self.avelocity_x     = ReadFunc();
         self.avelocity_y     = ReadFunc();
         self.avelocity_z     = ReadFunc();
     }
-    
+
+    if(sf & VSF_STATS)
+    {
+        if(ReadByte() == 1)
+        {
+            self.vehicle_shield  = ReadByte();
+            self.vehicle_energy  = ReadByte();
+            self.vehicle_ammo1   = ReadByte();
+            self.vehicle_reload1 = ReadByte();
+            self.vehicle_ammo2   = ReadByte();
+            self.vehicle_reload2 = ReadByte();
+        }
+        self.vehicle_health = ReadByte();
+    }
+
     if(sf & VSF_EXTRA)
         self.vehile_read_exta(sf);
 
index 1799c26a922fc6d95ac202b05ed807436059609b..7ab8ef119373b34a82bd7fb7202fdd57b3d0b50d 100644 (file)
@@ -336,7 +336,7 @@ float racer_frame()
     ftmp = racer.velocity_z;
     df = racer.velocity * -autocvar_g_vehicle_racer_friction;
     racer.velocity_z = ftmp;
-    
+
     if(player.movement_x != 0)
     {
         if(player.movement_x > 0)
@@ -352,7 +352,7 @@ float racer_frame()
         else if(player.movement_y > 0)
             df += v_right * autocvar_g_vehicle_racer_speed_strafe;
     }
-    
+
     // Afterburn
     if (player.BUTTON_JUMP)
     if(racer.vehicle_energy >= (autocvar_g_vehicle_racer_afterburn_cost * frametime))
@@ -597,7 +597,7 @@ void racer_die()
 #ifdef VEHICLES_CSQC
 void racer_send_exta(entity to)
 {
-    
+
 }
 #endif
 
@@ -615,7 +615,7 @@ void racer_dinit()
              racer_spawn, autocvar_g_vehicle_racer_respawntime,
              racer_frame,
              racer_enter, racer_exit,
-             racer_die,   racer_think, 
+             racer_die,   racer_think,
              FALSE))
     {
         remove(self);
@@ -668,8 +668,23 @@ void spawnfunc_vehicle_racer()
 #endif // SVQC
 
 #ifdef CSQC
+void racer_draw()
+{
+
+}
+
+void racer_draw2d()
+{
+
+}
+
 void racer_read_extra()
 {
-    
+
+}
+
+void vehicle_racer_assemble()
+{
+
 }
-#endif //CSQC
\ No newline at end of file
+#endif //CSQC
index ac9428561ff1c436a3ad2fa8839cc8506d8309d4..cde9656ecf63b4ed6b08f88c722e152acc676c1b 100644 (file)
@@ -1,3 +1,4 @@
+#fdef SVQC
 #define RAPTOR_MIN '-80 -80 0'
 #define RAPTOR_MAX '80 80 70'
 
@@ -95,7 +96,7 @@ void raptor_bomb_burst()
 {
     if(self.cnt > time)
     if(autocvar_g_vehicle_raptor_bomblet_alt)
-    {        
+    {
         self.nextthink = time;
         traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
         if((trace_fraction == 1.0) || (vlen(self.origin - self.owner.origin) < autocvar_g_vehicle_raptor_bomblet_radius))
@@ -110,9 +111,9 @@ void raptor_bomb_burst()
 
     //sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
     //pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, self.velocity, 1);
-    
+
     Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_RAPTOR_BOMB_SPLIT, self);
-    
+
     for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
     {
         bomblet = spawn();
@@ -125,7 +126,7 @@ void raptor_bomb_burst()
         bomblet.owner       = self.owner;
         bomblet.realowner   = self.realowner;
         bomblet.velocity    = normalize(normalize(self.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(self.velocity);
-        
+
         PROJECTILE_MAKETRIGGER(bomblet);
         CSQCProjectile(bomblet, TRUE, PROJECTILE_RAPTORBOMBLET, TRUE);
     }
@@ -179,7 +180,7 @@ void raptor_bombdrop()
 void raptor_fire_cannon(entity gun, string tagname)
 {
     entity bolt;
-    vector b_org;    
+    vector b_org;
     b_org = gettaginfo(gun, gettagindex(gun, tagname));
     bolt = vehicles_projectile("raptor_cannon_muzzleflash", "weapons/lasergun_fire.wav",
                            b_org, normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
@@ -234,7 +235,7 @@ void raptor_land()
 void raptor_exit(float eject)
 {
     self.tur_head.exteriormodeltoclient = world;
-    
+
     if(self.deadflag == DEAD_NO)
     {
         self.think      = raptor_land;
@@ -529,7 +530,7 @@ float raptor_frame()
         raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
         raptor.lip   = time;
     }
-    
+
     raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip);
     player.vehicle_reload2 = bound(0, raptor.bomb1.alpha * 100, 100);
 
@@ -629,7 +630,7 @@ void raptor_dinit()
              raptor_spawn, autocvar_g_vehicle_raptor_respawntime,
              raptor_frame,
              raptor_enter, raptor_exit,
-             raptor_die,   raptor_think, 
+             raptor_die,   raptor_think,
              FALSE))
     {
         remove(self);
@@ -645,7 +646,7 @@ void raptor_dinit()
     self.bomb2 = spawn();
     self.gun1  = spawn();
     self.gun2  = spawn();
-            
+
 #ifdef RAPTOR_RETARDCAMERA
     setattachment(self.vehicle_viewport, world, "");
 #endif
@@ -695,11 +696,11 @@ void raptor_dinit()
     spinner.movetype = MOVETYPE_NOCLIP;
     spinner.avelocity = '0 -90 0';
     self.bomb1.gun2 = spinner;
-    
+
     // Sigh.
     self.bomb1.think = raptor_rotor_anglefix;
     self.bomb1.nextthink = time;
-    
+
     self.mass               = 1 ;
 }
 
@@ -730,3 +731,26 @@ void spawnfunc_vehicle_raptor()
     self.think = raptor_dinit;
     self.nextthink = time + 1;
 }
+#endif // SVQC
+
+#ifdef CSQC
+void raptor_draw()
+{
+
+}
+
+void raptor_draw2d()
+{
+
+}
+
+void raptor_read_extra()
+{
+
+}
+
+void vehicle_raptor_assemble()
+{
+
+}
+#endif //CSQC
index 9d920201ca681427fa70fd0e4418d1235eda92cb..cc1283aa9ceb5fde08cd536ee3e719a8b2026d5d 100644 (file)
@@ -1,6 +1,7 @@
 const vector SPIDERBOT_MIN = '-75 -75 10';
 const vector SPIDERBOT_MAX  = '75 75 125';
 
+#ifdef SVQC
 float autocvar_g_vehicle_spiderbot_respawntime;
 
 float autocvar_g_vehicle_spiderbot_speed_stop;
@@ -312,7 +313,7 @@ float spiderbot_frame()
 
     self.angles_x = bound(-45, self.angles_x, 45);
     self.angles_z = bound(-45, self.angles_z, 45);
-    
+
     if(player.BUTTON_ATCK)
     {
         spider.cnt = time;
@@ -321,9 +322,9 @@ float spiderbot_frame()
             entity gun;
             vector v;
             spider.misc_bulletcounter += 1;
-            
+
             self = player;
-            
+
             mod(spider.misc_bulletcounter, 2) ? gun = spider.gun1 : gun = spider.gun2;
             v = gettaginfo(gun, gettagindex(gun, "barrels"));
             v_forward = normalize(v_forward);
@@ -335,9 +336,9 @@ float spiderbot_frame()
             sound (gun, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
             trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
             pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), v, v_forward * 2500, 1);
-            
+
             self = spider;
-            
+
             spider.vehicle_ammo1 -= autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
             spider.tur_head.attack_finished_single = time + autocvar_g_vehicle_spiderbot_minigun_refire;
             player.vehicle_ammo1 = (spider.vehicle_ammo1 / autocvar_g_vehicle_spiderbot_minigun_ammo_max) * 100;
@@ -347,7 +348,7 @@ float spiderbot_frame()
         vehicles_regen(cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max,
                                            autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause,
                                            autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime);
-    
+
     spiderbot_rocket_do();
 
     if(self.vehicle_flags  & VHF_SHIELDREGEN)
@@ -590,7 +591,7 @@ void vewhicle_spiderbot_dinit()
              spiderbot_spawn, autocvar_g_vehicle_spiderbot_respawntime,
              spiderbot_frame,
              spiderbot_enter, spiderbot_exit,
-             spiderbot_die,   spiderbot_think, 
+             spiderbot_die,   spiderbot_think,
              FALSE))
     {
         remove(self);
@@ -636,3 +637,26 @@ void spawnfunc_vehicle_spiderbot()
     self.think = vewhicle_spiderbot_dinit;
     self.nextthink = time + 0.5;
 }
+#endif // SVQC
+
+#ifdef CSQC
+void spiderbot_draw()
+{
+
+}
+
+void spiderbot_draw2d()
+{
+
+}
+
+void spiderbot_read_extra()
+{
+
+}
+
+void vehicle_spiderbot_assemble()
+{
+
+}
+#endif //CSQC
index 31e3aefa9ef6399a4c3331db1f52258ee23f2e41..beab79272037844959ed029fa39d41f755b56a2b 100644 (file)
@@ -1,4 +1,4 @@
-// #define VEHICLES_CSQC
+#define VEHICLES_CSQC
 // #define VEHICLES_USE_ODE
 #define VEHICLES_ENABLED
 #ifdef VEHICLES_ENABLED
@@ -14,15 +14,15 @@ float VHF_HEALTHREGEN   = 16;   /// Vehicles health regenerates
 float VHF_ENERGYREGEN   = 32;   /// Vehicles energy regenerates
 float VHF_DEATHEJECT    = 64;   /// Vehicle ejects pilot upon fatal damage
 float VHF_MOVE_GROUND   = 128;  /// Vehicle moves on gound
-float VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound 
+float VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound
 float VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
 
 .entity gun1;
 .entity gun2;
 
-.float vehicle_health;      /// If self is player this is 0..1 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
-.float vehicle_energy;      /// If self is player this is 0..1 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
-.float vehicle_shield;      /// If self is player this is 0..1 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
+.float vehicle_health;      /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
+.float vehicle_energy;      /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
+.float vehicle_shield;      /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
 .entity vehicle_shieldent;  /// Entity to disply the shild effect on damage
 
 .float vehicle_ammo1;   /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo1 value.
@@ -54,7 +54,7 @@ var .void() vehicle_die;    /// Vehicles custom function to be executed when veh
 var .void() vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
 
 #ifdef VEHICLES_CSQC
-var .void(entity to, float sflags) vehile_send_exta;  /// Vehicles custom send code (for extra bits, stats and whatnot)
+var .void(entity to, float sflags) vehile_send_exta;  /// Vehicles custom send func
 void net_link_vehile();                 /// Initiates csqc networking for vehicle
 #endif //VEHICLES_CSQC
 #endif //SVQC
@@ -62,10 +62,10 @@ void net_link_vehile();                 /// Initiates csqc networking for vehicl
 #ifdef CSQC
 #ifdef VEHICLES_CSQC
 .float vehicle_hud;
-void vehicle_spiderbot_assemble() {};
-void vehicle_racer_assemble() {};
-void vehicle_raptor_assemble() {};
-void vehicle_bumblebee_assemble() {};
+void vehicle_spiderbot_assemble();
+void vehicle_racer_assemble();
+void vehicle_raptor_assemble();
+void vehicle_bumblebee_assemble();
 void Net_ReadVehicle(float bIsNew);
 var .void (float sf)vehile_read_exta;
 #endif //VEHICLES_CSQC
@@ -76,4 +76,4 @@ void(entity e, float physics_enabled) physics_enable = #540; // enable or disabl
 void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
 void(entity e, vector torque) physics_addtorque = #542; // add relative torque
 #endif  // VEHICLES_USE_ODE
-#endif  // VEHICLES_ENABLED
\ No newline at end of file
+#endif  // VEHICLES_ENABLED