]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add bumblebee code frame
authorJakob MG <jakob_mg@hotmail.com>
Tue, 12 Apr 2011 15:36:55 +0000 (17:36 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Tue, 12 Apr 2011 15:36:55 +0000 (17:36 +0200)
qcsrc/client/View.qc
qcsrc/client/vehicles/vehicles.qc
qcsrc/common/constants.qh
qcsrc/server/vehicles/bumblebee.qc [new file with mode: 0644]
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qh
vehicle_bumblebee.cfg [new file with mode: 0644]

index c54b4446543e5b8b81e1051191b522ff4a4b51d9..56b690e7655c701e02ac4dfa78b2a782cc18e404 100644 (file)
@@ -831,6 +831,8 @@ void CSQC_UpdateView(float w, float h)
         CSQC_WAKIZASHI_HUD();
     else if(hud == HUD_RAPTOR)
         CSQC_RAPTOR_HUD();
+    else if(hud == HUD_BUMBLEBEE)
+        CSQC_BUMBLE_HUD();
        else
        {
                if(gametype == GAME_FREEZETAG)
@@ -1311,6 +1313,11 @@ void CSQC_common_hud(void)
                case HUD_WAKIZASHI:
                        CSQC_WAKIZASHI_HUD();
                        break;
+                       
+        case HUD_BUMBLEBEE:
+            CSQC_BUMBLE_HUD();
+            break;
+
        }
 }
 
index 1daefac011639dbd616acd8bd2fb52977834859a..76c65111c7ea477a0aae08f77ee281b79f33a330 100644 (file)
@@ -30,6 +30,7 @@ entity dropmark;
 void CSQC_WAKIZASHI_HUD();
 void CSQC_SPIDER_HUD();
 void CSQC_RAPTOR_HUD();
+void CSQC_BUMBLE_HUD();
 
 #define MAX_AXH 4
 entity AuxiliaryXhair[MAX_AXH];
@@ -193,7 +194,14 @@ void Net_VehicleSetup()
             AuxiliaryXhair[1].axh_scale   = 0.25;
             AuxiliaryXhair[1].alpha       = 0.75;
             AuxiliaryXhair[1].axh_drawflag  = DRAWFLAG_NORMAL;
-
+            break;
+        case HUD_BUMBLEBEE:
+            // Plasma cannons
+            AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-ring.tga";
+            AuxiliaryXhair[0].axh_scale   = 0.25;
+            // Raygun
+            AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-special1.tga";
+            AuxiliaryXhair[1].axh_scale   = 0.25;
             break;
     }
 }
@@ -206,6 +214,69 @@ void Net_VehicleSetup()
        float ammo2     = getstati(STAT_VEHICLESTAT_AMMO2); \
        float reload2   = getstati(STAT_VEHICLESTAT_RELOAD2);
 
+void CSQC_BUMBLE_HUD()
+{
+       vector picsize, hudloc;
+
+    // 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);
+
+    picsize = drawgetimagesize(spider_a2) * 0.5;
+    drawpic(hudloc + '120 96  0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+
+    drawstring(hudloc + '145 19  0',  strcat(ftos(health), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
+    drawstring(hudloc + '175 34  0',  strcat(ftos(shield), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
+    drawstring(hudloc + '136 102  0', strcat(ftos(ammo1), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
+
+    picsize = drawgetimagesize(spider_a1) * 0.85;
+    if(ammo2 == 9)
+    {
+        drawpic(hudloc + '132 54  0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
+        drawstring(hudloc + '179 69 0', strcat(ftos(reload2), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
+    }
+    else
+    {
+        drawpic(hudloc + '132 54  0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+        drawstring(hudloc + '179 69  0', strcat(ftos(9 - ammo2), " / 8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
+    }
+
+    picsize = drawgetimagesize(spider_b) * 0.5;
+    hudloc_y = 10.5;
+    hudloc_x = 10.5;
+    
+    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);
+    drawpic(hudloc, spider_g, picsize, '1 1 1' * ammo1 + '1 0 0' *  (1 - ammo1), 1, DRAWFLAG_NORMAL);
+
+
+       if (scoreboard_showscores)
+       {
+               HUD_DrawScoreboard();
+               HUD_DrawCenterPrint();
+    }
+    else
+    {
+        picsize = drawgetimagesize(SPIDER_CROSS);
+        picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
+        picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
+
+        drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE);
+    }
+}
+
+
 void CSQC_SPIDER_HUD()
 {
        vector picsize, hudloc;
index c56bda74ce6f3c9d6ebf2c1f7b2d881d82984aed..6c4db183668d44dc42f107b2193af78189e95501 100644 (file)
@@ -335,6 +335,8 @@ const float HUD_NORMAL = 0;
 const float HUD_SPIDERBOT = 10;
 const float HUD_WAKIZASHI = 11;
 const float HUD_RAPTOR    = 12;
+const float HUD_BUMBLEBEE = 13;
+
 const vector eX = '1 0 0';
 const vector eY = '0 1 0';
 const vector eZ = '0 0 1';
@@ -357,12 +359,6 @@ const float STAT_PINKALIVE = 103;
 const float STAT_FROZEN = 104;
 const float STAT_REVIVE_PROGRESS = 105;
 
-//const float STAT_SPIDERBOT_AIM     53 // compressShotOrigin
-//const float STAT_SPIDERBOT_TARGET  54 // compressShotOrigin
-
-
-
-
 // moved that here so the client knows the max.
 // # of maps, I'll use arrays for them :P
 #define MAPVOTE_COUNT 10
diff --git a/qcsrc/server/vehicles/bumblebee.qc b/qcsrc/server/vehicles/bumblebee.qc
new file mode 100644 (file)
index 0000000..79ec50b
--- /dev/null
@@ -0,0 +1,133 @@
+// Auto cvars
+float autocvar_g_vehicle_bumblebee_speed_forward;
+float autocvar_g_vehicle_bumblebee_speed_strafe;
+float autocvar_g_vehicle_bumblebee_turnspeed;
+float autocvar_g_vehicle_bumblebee_pitchspeed;
+float autocvar_g_vehicle_bumblebee_friction;
+
+float autocvar_g_vehicle_bumblebee_energy;
+float autocvar_g_vehicle_bumblebee_energy_regen;
+float autocvar_g_vehicle_bumblebee_energy_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_health;
+float autocvar_g_vehicle_bumblebee_health_regen;
+float autocvar_g_vehicle_bumblebee_health_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_shield;
+float autocvar_g_vehicle_bumblebee_shield_regen;
+float autocvar_g_vehicle_bumblebee_shield_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_cannon_cost;
+float autocvar_g_vehicle_bumblebee_cannon_damage;
+float autocvar_g_vehicle_bumblebee_cannon_radius;
+float autocvar_g_vehicle_bumblebee_cannon_refire;
+float autocvar_g_vehicle_bumblebee_cannon_speed;
+float autocvar_g_vehicle_bumblebee_cannon_spread;
+float autocvar_g_vehicle_bumblebee_cannon_force;
+
+float autocvar_g_vehicle_bumblebee_respawntime;
+
+float autocvar_g_vehicle_bumblebee_blowup_radius;
+float autocvar_g_vehicle_bumblebee_blowup_coredamage;
+float autocvar_g_vehicle_bumblebee_blowup_edgedamage;
+float autocvar_g_vehicle_bumblebee_blowup_forceintensity;
+
+
+#define BUMB_MIN '-120 -120 -40'
+#define BUMB_MAX '120 120 40'
+
+.entity gunner1;
+.entity gunner2;
+
+float bumb_frame()
+{
+    entity pilot, gunner, vehic;
+
+
+    return 1;
+}
+
+void bumb_think()
+{
+}
+
+void bumb_enter()
+{
+}
+
+void bumb_exit(float eject)
+{
+}
+
+void bumb_spawn()
+{    
+    self.movetype = MOVETYPE_FLY;
+    setorigin(self, self.origin + '0 0 150');
+}
+
+void bumb_die()
+{
+    self.health       = 0;
+    self.event_damage = SUB_Null;
+    self.iscreature   = FALSE;
+    self.solid        = SOLID_CORPSE;
+    self.takedamage   = DAMAGE_NO;
+    self.deadflag     = DEAD_DYING;
+    self.movetype     = MOVETYPE_BOUNCE;
+
+    pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
+}
+
+void bumb_dinit()
+{
+    if not (vehicle_initialize(
+             "Bumblebee",
+             "models/vehicles/bumblebee_body.dpm",
+             "",
+             "models/vehicles/wakizashi_cockpit.dpm",
+             "", "", "tag_viewport",
+             HUD_WAKIZASHI,
+             BUMB_MIN, BUMB_MAX,
+             FALSE,
+             bumb_spawn, autocvar_g_vehicle_bumblebee_respawntime,
+             bumb_frame,
+             bumb_enter, bumb_exit,
+             bumb_die,   bumb_think))
+    {
+        remove(self);
+        return;
+    }
+    self.gun1 = spawn();
+    self.gun2 = spawn();
+    setmodel(self.gun1, "models/vehicles/bumblebee_plasma_left.dpm");
+    setmodel(self.gun2, "models/vehicles/bumblebee_plasma_right.dpm");
+    setattachment(self.gun1, self, "tag_hardpoint02");
+    setattachment(self.gun2, self, "tag_hardpoint01");
+}
+
+void spawnfunc_vehicle_bumblebee()
+{
+
+    precache_model ("models/vehicles/bumblebee_body.dpm");
+    precache_model ("models/vehicles/bumblebee_plasma_left.dpm");
+    precache_model ("models/vehicles/bumblebee_plasma_right.dpm");
+    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;
+
+    if(autocvar_g_vehicle_bumblebee_shield)
+        self.vehicle_flags |= VHF_HASSHIELD;
+
+    if(autocvar_g_vehicle_bumblebee_shield_regen)
+        self.vehicle_flags |= VHF_SHIELDREGEN;
+
+    if(autocvar_g_vehicle_bumblebee_health_regen)
+        self.vehicle_flags |= VHF_HEALTHREGEN;
+
+    self.think = bumb_dinit;
+    self.nextthink = time + 1;    
+}
\ No newline at end of file
index 531207b1889b5e44e6bbe946281b6c007f0d4b76..f2fb4c06f92508559b765a8484c401ba1dfd9157 100644 (file)
@@ -453,51 +453,6 @@ void spiderbot_exit(float eject)
     self.owner = world;
 }
 
-// Better way of determening whats crushable needed! (fl_crushable?)
-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(
-{
-    //vehicles_touch();
-    if(self.owner)
-    {
-        if(vlen(self.velocity) == 0)
-            return;
-
-        if not (spiderbot_crushable(other))
-            return;
-
-        //todo: add check for velocity/angle here (so we dont cush players runing into us from behind)
-
-        Damage(other, self, self.owner,autocvar_g_vehicle_spiderbot_crush_dmg,DEATH_VHCRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicle_spiderbot_crush_force);
-        return;
-    }
-
-    if(other.classname != "player")
-        return;
-
-    if(other.deadflag != DEAD_NO)
-        return;
-
-    if(other.vehicle != world)
-        return;
-
-    vehicles_enter();
-}*/
-
-
 void spiderbot_spawn()
 {
     self.frame              = 5;
index 83cfa56f0c54fedc6f48ab851fa6536e919ff956..59641407f060b428e4b16ae9933a6edb7e62174f 100644 (file)
@@ -5,4 +5,5 @@
 #include "racer.qc"
 #include "spiderbot.qc"
 #include "raptor.qc"
+#include "bumblebee.qc"
 #endif
diff --git a/vehicle_bumblebee.cfg b/vehicle_bumblebee.cfg
new file mode 100644 (file)
index 0000000..70fa221
--- /dev/null
@@ -0,0 +1,32 @@
+set g_vehicle_bumblebee_speed_forward            400
+set g_vehicle_bumblebee_speed_strafe             200
+set g_vehicle_bumblebee_turnspeed                180
+set g_vehicle_bumblebee_pitchspeed               90
+set g_vehicle_bumblebee_friction                 0.25
+
+set g_vehicle_bumblebee_energy                   500
+set g_vehicle_bumblebee_energy_regen             50
+set g_vehicle_bumblebee_energy_regen_pause       1
+
+set g_vehicle_bumblebee_health                   750
+set g_vehicle_bumblebee_health_regen             25
+set g_vehicle_bumblebee_health_regen_pause       5
+
+set g_vehicle_bumblebee_shield                   250
+set g_vehicle_bumblebee_shield_regen             100
+set g_vehicle_bumblebee_shield_regen_pause       2
+
+set g_vehicle_bumblebee_cannon_cost              10
+set g_vehicle_bumblebee_cannon_damage            75
+set g_vehicle_bumblebee_cannon_radius            150
+set g_vehicle_bumblebee_cannon_refire            1.5
+set g_vehicle_bumblebee_cannon_speed             5000
+set g_vehicle_bumblebee_cannon_spread            0.0125
+set g_vehicle_bumblebee_cannon_force             400
+
+set g_vehicle_bumblebee_respawntime              10
+
+set g_vehicle_bumblebee_blowup_radius            500
+set g_vehicle_bumblebee_blowup_coredamage        500
+set g_vehicle_bumblebee_blowup_edgedamage        100
+set g_vehicle_bumblebee_blowup_forceintensity    600
\ No newline at end of file