]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make colormap & fullbright work (uses g_fullbrightplayers), fix raptor shirt/pants...
authorJakob MG <jakob_mg@hotmail.com>
Sat, 26 Mar 2011 17:00:25 +0000 (18:00 +0100)
committerJakob MG <jakob_mg@hotmail.com>
Sat, 26 Mar 2011 17:00:25 +0000 (18:00 +0100)
qcsrc/client/projectile.qc
qcsrc/client/vehicles/vehicles.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/vehicles.qc
textures/raptor.jpg [deleted file]
textures/raptor.tga [new file with mode: 0644]
textures/raptor_cockpit.jpg [deleted file]

index 7d459f754ffda66d588431ff695d7385bfd03a7a..9c4ccbe37a2709fc54ccd1a5153e773ecbd4fe66 100644 (file)
@@ -294,7 +294,7 @@ void Ent_Projectile()
                        case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum("TR_ROCKET"); break;
                        case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_ROCKET"); break;
                        case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.scale = 2; self.traileffect = particleeffectnum("TR_ROCKET"); break;
-                       case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/raptor_bomb.dpm"); self.gravity = 1; self.traileffect = particleeffectnum("TR_GRENADE"); break;
+                       case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/raptor_bomb.dpm"); self.gravity = 1; self.avelocity  = '0 0 180'; self.traileffect = particleeffectnum("TR_GRENADE"); break;
                        default:
                                error("Received invalid CSQC projectile, can't work with this!");
                                break;
index b15f843a2c321061bedb30491280bd8d40bf258f..917b0e96a5e74ca4afebbef3b94e83de32823cfb 100644 (file)
@@ -246,13 +246,6 @@ void CSQC_RAPTOR_HUD()
        float movedt;
     vector where;
 
-
-    if(!dropmark)
-    {
-        dropmark = spawn();
-        dropmark.owner = self;
-    }
-
     // Fetch health & ammo stats
     hp      = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
        shield  = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
@@ -300,6 +293,12 @@ void CSQC_RAPTOR_HUD()
     drawpic(hudloc, raptor_g1, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
     drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload + '1 0 0' *  (1 - reload), 1, DRAWFLAG_NORMAL);
 
+    if(!dropmark)
+    {
+        dropmark = spawn();
+        dropmark.owner = self;
+    }
+
     if(reload == 1)
     {
         where = dropmark.origin;
@@ -367,15 +366,6 @@ void CSQC_WAKIZASHI_HUD()
     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_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);
@@ -418,36 +408,6 @@ const float STAT_VEHICLESTAT_RELOAD2 = 66;
     drawpic(hudloc, waki_r, picsize, '1 1 1' * rockets + '1 0 0' * (1 - rockets), 1, DRAWFLAG_NORMAL);
     drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' *  (1 - energy), 1, DRAWFLAG_NORMAL);
 
-
-
-       /*
-       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);
-       */
-
-
-
-
        if (scoreboard_showscores)
        {
                HUD_DrawScoreboard();
index d4fb02ea8d77a52202c67d263f62e435423fb359..abf7c9554d7235424b82391533fd0b394aa05f16 100644 (file)
@@ -69,13 +69,6 @@ float raptor_altitude(float amax)
     return vlen(self.origin - trace_endpos);
 }
 
-void raptor_bombs_return()
-{
-    self.owner.bomb1.alpha = 1;
-    self.owner.bomb2.alpha = 1;
-    remove(self);
-}
-
 void raptor_bomblet_boom()
 {
     if(other == self.owner || other.owner == self.owner)
@@ -91,9 +84,6 @@ void raptor_bomblet_boom()
 
 void raptor_bomb_burst()
 {
-    self.angles = vectoangles(self.velocity);
-
-
     if(autocvar_g_vehicle_raptor_bomblet_alt)
     {
         self.nextthink = time;
@@ -107,34 +97,24 @@ void raptor_bomb_burst()
     }
 
     entity bomblet;
-    float i,v;
-    vector d;
+    float i;
 
-    v = vlen(self.velocity);
-    d = normalize(self.velocity);
     pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
 
     for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
     {
-
         bomblet = spawn();
-        setorigin(bomblet,self.origin);
-
-        //setmodel(bomblet,"models/vehicles/raptor_bomb.dpm");
-        bomblet.scale = 0.5;
+        setorigin(bomblet, self.origin);
 
+        bomblet.scale       = 0.5;
         bomblet.solid       = SOLID_TRIGGER;
         bomblet.movetype    = MOVETYPE_BOUNCE;
         bomblet.touch       = raptor_bomblet_boom;
         bomblet.think       = raptor_bomblet_boom;
         bomblet.nextthink   = time + 5;
         bomblet.owner       = self.owner;
+        bomblet.velocity    = normalize(normalize(self.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(self.velocity);
 
-        //bomblet.modelflags = MF_GRENADE;
-
-        bomblet.velocity = normalize(d + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * v;
-
-        //bomblet.angles = vectoangles(bomblet.velocity);
         CSQCProjectile(bomblet, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
     }
 
@@ -150,8 +130,8 @@ void raptor_bombdrop()
 {
     entity bomb_1, bomb_2;
 
-    self.bomb1.alpha = 0.25;
-    self.bomb2.alpha = 0.25;
+    //self.bomb1.alpha = 0;
+    //self.bomb2.alpha = 0;
 
     bomb_1 = spawn();
     bomb_2 = spawn();
@@ -169,19 +149,13 @@ void raptor_bombdrop()
     else
         bomb_1.nextthink = bomb_2.nextthink  = time + autocvar_g_vehicle_raptor_bomblet_time;
 
-    //bomb_1.avelocity = bomb_2.avelocity  = '0 0 180';
     bomb_1.owner     = bomb_2.owner      = self;
     bomb_1.enemy     = bomb_2.enemy      = self.owner;
-    //bomb_1.angles    = bomb_2.angles     = self.angles;
     bomb_1.solid     = bomb_2.solid      = SOLID_BBOX;
 
     CSQCProjectile(bomb_1, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
     CSQCProjectile(bomb_2, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
 
-    bomb_1 = spawn();
-    bomb_1.owner = self;
-    bomb_1.think = raptor_bombs_return;
-    bomb_1.nextthink = time + autocvar_g_vehicle_raptor_bombs_refire;
 }
 
 void raptor_bolt_explode()
@@ -349,6 +323,7 @@ float raptor_frame()
     else
         makevectors(player.v_angle);
     */
+
     crosshair_trace(player);
     //df = vectoangles(normalize(trace_endpos - gettaginfo(raptor ,gettagindex(raptor, "tag_hud"))) - raptor.angles);
     df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
@@ -536,15 +511,24 @@ float raptor_frame()
 
     player.vehicle_energy = raptor.vehicle_energy / autocvar_g_vehicle_raptor_energy;
 
+
     if(time > raptor.delay)
-    if(player.BUTTON_ATCK2)
     {
-        raptor_bombdrop();
-        raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
-        raptor.lip = time;
+        if(player.BUTTON_ATCK2)
+        {
+            raptor_bombdrop();
+            raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
+        }
+        player.vehicle_reload1 = 1;
+    }
+    else
+    {
+        player.vehicle_reload1 = min(time / raptor.delay, 1);
+        raptor.bomb1.alpha = raptor.bomb2.alpha = player.vehicle_reload1; //(player.vehicle_reload1 == 1 ? 1 : player.vehicle_reload1 * 0.25);
     }
 
-    player.vehicle_reload1 = (time - raptor.lip) / (raptor.delay - raptor.lip);
+
+
     VEHICLE_UPDATE_PLAYER(health, raptor);
 
     if(self.vehicle_flags & VHF_HASSHIELD)
@@ -639,13 +623,8 @@ void raptor_spawn()
     self.movetype       = MOVETYPE_FLY;
     self.solid          = SOLID_SLIDEBOX;
     self.takedamage     = DAMAGE_AIM;
-    self.alpha          = 1;
-       self.colormap       = 1024;
        self.deadflag       = DEAD_NO;
     self.bot_attack     = TRUE;
-    self.colormod       = '1 1 1';
-    self.avelocity      = '0 0 0';
-    self.velocity       = '0 0 0';
     self.vehicle_energy = 1;
     self.vehicle_hudmodel.viewmodelforclient = self;
 
@@ -705,7 +684,10 @@ void raptor_dinit()
     setattachment(self.bomb1, self,"bombmount_left");
     setattachment(self.bomb2, self,"bombmount_right");
 
+
     // FIXME Guns mounts to angled bones
+    self.bomb1.angles = self.angles;
+    self.angles = '0 0 0';
     // This messes up gun-aim, so work arround it.
     //setattachment(self.gun1, self, "gunmount_left");
     ofs = gettaginfo(self, gettagindex(self, "gunmount_left"));
@@ -719,6 +701,10 @@ void raptor_dinit()
     setattachment(self.gun2, self, "");
     setorigin(self.gun2, ofs);
 
+    self.angles = self.bomb1.angles;
+    self.bomb1.angles = '0 0 0';
+
+
     spinner = spawn();
     spinner.owner = self;
     setmodel(spinner,"models/vehicles/spinner.dpm");
index ace756ddb40145b77ccbd95f0960b227fbc02948..82b845f1d841deb755affe1a91be097e4c1f0341 100644 (file)
@@ -480,30 +480,36 @@ void vehicles_common_spawn()
         _effects = EF_NODEPTHTEST;
 
     if(autocvar_g_fullbrightplayers)
-        _colormap |= EF_FULLBRIGHT;
+        _effects |= EF_FULLBRIGHT;
 
     if(self.team)
         _colormap = 1024 + (self.team - 1) * 17;
     else
         _colormap = 1024;
 
-    _glowmod = '0 0 0';
-    _colormod = '0 0 0';
+    _glowmod    = '0 0 0';
+    _colormod   = '0 0 0';
 
+    // Find all ents attacked to main model and setup effects, colormod etc.
     e = findchainentity(tag_entity, self);
     while(e)
     {
-        e.colormap = _colormap;
-        e.effects = _effects;
-        e.colormod = _colormod;
-        e.colormap = _colormap;
+        e.effects   = _effects;
+        e.colormod  = _colormod;
+        e.colormap  = _colormap;
+        e.alpha     = 1;
+
         e = e.chain;
     }
 
     self.effects  = _effects;
-    self.colormap = _colormap;
     self.colormod = _colormod;
     self.colormap = _colormap;
+
+    self.alpha          = 1;
+    self.avelocity      = '0 0 0';
+    self.velocity       = '0 0 0';
+
 }
 
 float vehicle_initialize(string  net_name,
diff --git a/textures/raptor.jpg b/textures/raptor.jpg
deleted file mode 100644 (file)
index 8a1cdce..0000000
Binary files a/textures/raptor.jpg and /dev/null differ
diff --git a/textures/raptor.tga b/textures/raptor.tga
new file mode 100644 (file)
index 0000000..2037f7b
Binary files /dev/null and b/textures/raptor.tga differ
diff --git a/textures/raptor_cockpit.jpg b/textures/raptor_cockpit.jpg
deleted file mode 100644 (file)
index fd999b5..0000000
Binary files a/textures/raptor_cockpit.jpg and /dev/null differ