trailspacing 40
type static
color 0xFF0000 0xFF0011
-size 10 10
+size 10 10
sizeincrease -6
alpha 256 256 512
airfriction -4
trailspacing 40
type static
color 0x0000FF 0x1100FF
-size 10 10
+size 10 10
sizeincrease -6
alpha 256 256 512
airfriction -4
//liquidfriction -4
type smoke
-// Yellow
+// Yellow
effect TE_TEI_G3YELLOW
countabsolute 1
type beam
trailspacing 40
type static
color 0xffff00 0xffff11
-size 10 10
+size 10 10
sizeincrease -6
alpha 256 256 512
airfriction -4
trailspacing 40
type static
color 0xFF00FF 0xFF11FF
-size 10 10
+size 10 10
sizeincrease -6
alpha 256 256 512
airfriction -4
velocitymultiplier 2
staincolor 0x808080 0x808080
staintex 16 24
-
+
// effect for removing player model
// "teleport"
-
+
// cl_gentle deathfx
// used in qcsrc/client/gibs.qc: pointparticles(particleeffectnum("damage_dissolve"), org, vel, amount)
// small core blood no decals
count 3
type spark
color 0xff9c00 0xff8400
-tex 43 43
-size 5 7
+tex 48 55
+size 10 15
alpha 256 512 6280
airfriction 10
originjitter 2 2 2
velocityjitter 150 150 150
-velocitymultiplier 0.2
+velocitymultiplier 0.35
sizeincrease -100
stretchfactor 1.3
rotate -180 180 4000 -4000
effect spiderbot_minigun_muzzleflash
countabsolute 2
type static
-tex 43 43
-color 0xff9c00 0xf6ff00
+tex 48 55
+color 0xff9c00 0xff8400
size 32 32
alpha 256 512 6680
sizeincrease -100
stretchfactor 0.1
rotate -180 180 4000 -4000
+lightradius 120
+lightradiusfade 8000
+lightcolor 3 3 0
effect spiderbot_minigun_impact
countabsolute 1
sizeincrease -100
stretchfactor 0.1
rotate -180 180 4000 -4000
+// fire
effect spiderbot_minigun_impact
count 7
type spark
color 0xff9c00 0xff8400
-tex 43 43
-size 5 9
+tex 48 55
+size 9 15
alpha 256 512 6280
airfriction 10
originjitter 2 2 2
velocityjitter 250 250 150
velocitymultiplier 0.2
sizeincrease 100
-stretchfactor 1.2
+stretchfactor 3
airfriction 6
rotate -180 180 4000 -4000
+// smoke
effect spiderbot_minigun_impact
-count 10
+count 6
type smoke
color 0xd0d0a0 0xffffff
tex 0 8
size 10 20
-alpha 20 50 100
+alpha 50 50 140
sizeincrease 80
-velocityjitter 50 50 150
-velocitymultiplier 0.15
-gravity 1.1
-airfriction 6
+velocityjitter 100 100 250
+velocitymultiplier 0.47
+gravity 1.3
+airfriction 10
rotate -180 180 0 0
+// smoke 2
+effect spiderbot_minigun_impact
+count 7
+type spark
+color 0xd0d0a0 0xffffff
+tex 0 8
+size 15 19
+alpha 25 51 128
+airfriction 6
+originjitter 2 2 2
+velocityjitter 250 250 150
+velocitymultiplier 0.2
+sizeincrease 100
+stretchfactor 7.6
// derbis
effect spiderbot_minigun_impact
notunderwater
-count 8
+count 3
type alphastatic
tex 66 68
color 0xffa35b 0xfff2be
-size 2 5
+size 6 8
alpha 644 756 1484
gravity 1.1
airfriction 0.4
sizeincrease -10
-velocitymultiplier 0.1
+velocitymultiplier 0.15
originjitter 16 16 16
velocityjitter 124 124 224
rotate -180 180 -1000 1000
+// decal
+effect spiderbot_minigun_impact
+countabsolute 1
+type decal
+tex 56 59
+size 5 10
+alpha 256 256 0
+originjitter 16 16 16
+rotate -180 180 0 0
+
effect wakizashi_gun_impact
-count 3
+count 15
type spark
-color 0xff9c00 0xff8400
-tex 43 43
+color 0xff0000 0xc03535
+tex 41 41
+size 4 7
+alpha 256 512 1180
+airfriction 4
+gravity 3
+originjitter 40 40 10
+velocityjitter 350 350 550
+velocityoffset 0 0 700
+stretchfactor 0.9
+effect wakizashi_gun_impact
+type smoke
+count 24
+color 0xd0d0a0 0xc03535
+tex 0 8
+size 10 20
+alpha 50 90 150
+sizeincrease 80
+velocityjitter 250 250 450
+velocityoffset 0 0 600
+originjitter 40 40 10
+airfriction 4
+sizeincrease 80
+rotate -180 180 0 0
+effect wakizashi_gun_impact
+countabsolute 1
+type smoke
+tex 65 65
+color 0xff0000 0xc03535
+size 82 82
+alpha 250 300 680
+sizeincrease -180
+effect wakizashi_gun_impact
+countabsolute 1
+type smoke
+tex 33 33
+color 0xff0000 0xc03535
+size 40 40
+alpha 50 100 620
+sizeincrease 900
+rotate -180 180 400 -400
+effect wakizashi_gun_impact
+countabsolute 1
+type decal
+tex 59 59
+size 14 14
+alpha 256 256 0
+originjitter 16 16 16
+rotate -180 180 0 0
+
+effect wakizashi_gun_muzzleflash
+count 16
+type spark
+color 0xff0000 0xc03535
+tex 8 15
size 5 7
alpha 256 512 6280
-airfriction 10
+airfriction 12
originjitter 2 2 2
-velocityjitter 150 150 150
+velocityjitter 200 200 200
velocitymultiplier 0.2
-sizeincrease -100
-stretchfactor 1.3
-rotate -180 180 4000 -4000
+sizeincrease -10
+stretchfactor 0.7
-effect wakizashi_gun_muzzleflash
+// decal
+effect raptor_cannon_impact
+countabsolute 1
+type decal
+tex 47 47
+size 24 24
+alpha 256 256 0
+originjitter 16 16 16
+rotate -180 180 0 0
+//spark
+effect raptor_cannon_impact
+notunderwater
count 6
type spark
-color 0xff9c00 0xff8400
+tex 40 40
+color 0xD400FF 0x571863
+size 1 1
+alpha 644 956 784
+gravity 1
+airfriction 0.2
+velocityoffset 0 0 150
+originjitter 16 16 16
+velocityjitter 124 124 524
+// smoke
+effect raptor_cannon_impact
+count 4
+type alphastatic
+tex 0 7
+size 50 50
+color 0x646364 0x151515
+alpha 428 428 600
+rotate -180 180 0 0
+velocityjitter 200 200 300
+velocityoffset 0 0 340
+gravity 0.7
+airfriction 2
+// fire
+effect raptor_cannon_impact
+notunderwater
+count 10
+type static
+tex 48 55
+color 0xD400FF 0x571863
+size 33 44
+sizeincrease 25
+alpha 200 256 812
+bounce 1.5
+airfriction 8
+liquidfriction 8
+originjitter 8 8 8
+velocityjitter 312 312 312
+
+
+effect raptor_cannon_muzzleflash
+count 16
+type spark
+color 0xD400FF 0x571863
tex 8 15
-size 5 7
-alpha 256 512 6280
+size 10 17
+alpha 1256 1512 56280
airfriction 12
originjitter 2 2 2
velocityjitter 200 200 200
velocitymultiplier 0.2
sizeincrease -10
-stretchfactor 0.8
+stretchfactor 0.6
+effect raptor_cannon_muzzleflash
+countabsolute 1
+type static
+tex 48 55
+color 0xD400FF 0x571863
+size 32 32
+alpha 6056 20112 406280
+sizeincrease -100
+stretchfactor 0.1
+rotate -180 180 4000 -4000
+lightradius 150
+lightradiusfade 6000
+lightcolor 3 0 6
-raptor_cannon_impact
+
+// -----------------DOTC
+// DOTC Scout drone
+// Muzzle flash
+// electricity
+effect dotc_scout_mflash
count 3
type spark
color 0xff9c00 0xff8400
sizeincrease -100
stretchfactor 1.3
rotate -180 180 4000 -4000
-
-raptor_cannon_muzzleflash
+// fire
+effect dotc_scout_mflash
count 6
type spark
color 0xff9c00 0xff8400
velocitymultiplier 0.2
sizeincrease -10
stretchfactor 0.8
+effect dotc_scout_mflash
+countabsolute 2
+type static
+tex 43 43
+color 0xff9c00 0xf6ff00
+size 32 32
+alpha 256 512 6680
+sizeincrease -100
+stretchfactor 0.1
+rotate -180 180 4000 -4000
+
+// Projectile trail
+// effect dotc_scout_ptrail
+
+// Projectile explode
+effect dotc_scout_pexplode
+countabsolute 1
+type static
+tex 38 38
+color 0xff9c00 0xff8400
+size 12 12
+alpha 256 256 512
+// cloud of bouncing sparks
+effect dotc_scout_pexplode
+count 64
+type spark
+tex 41 41
+color 0xff9c00 0xff8400
+size 1 2
+alpha 256 256 1024
+bounce 2
+stretchfactor 0.4
+//airfriction 2
+originjitter 1 1 1
+velocityjitter 112 112 112
+velocitymultiplier 40
+
+// DOTC Light tank drone
+// Muzzle flash
+effect dotc_lighttank_mflash
+count 12
+type spark
+color 0x202020 0x0072ff
+tex 8 15
+size 16 16
+alpha 328 328 4000
+originjitter 4 4 4
+velocityjitter 380 380 380
+velocitymultiplier 0.4
+stretchfactor 2
+sizeincrease -100
+airfriction 9
+effect dotc_lighttank_mflash
+countabsolute 1
+type smoke
+tex 65 65
+color 0x202020 0x0072ff
+size 80 80
+alpha 256 512 3680
+sizeincrease -1000
+rotate -180 180 4000 -4000
+
+
+// Projectile trail
+// effect dotc_lighttank_ptrail
+
+// Projectile explode
+effect dotc_lighttank_pexplode
+countabsolute 1
+type decal
+tex 38 38
+size 32 32
+alpha 256 256 0
+originjitter 17 17 17
+lightradius 150
+lightradiusfade 250
+lightcolor 3.125 4.375 10
+// shockwave
+effect dotc_lighttank_pexplode
+countabsolute 1
+type static
+tex 33 33
+color 0x80C0FF 0x80C0FF
+size 1 1
+alpha 40 40 100
+sizeincrease 500
+// cloud of bouncing sparks
+effect dotc_lighttank_pexplode
+count 64
+type spark
+tex 41 41
+color 0xFDFFD9 0xFDFFD9
+size 4 6
+alpha 256 256 1024
+stretchfactor 0.4
+airfriction 2
+originjitter 1 1 1
+velocityjitter 512 512 512
+// inner cloud of smoke
+effect dotc_lighttank_pexplode
+countabsolute 1
+type static
+tex 65 65
+color 0x80C0FF 0xFFFFFF
+size 65 65
+alpha 64 64 90
+sizeincrease 200
+
+// DOTC Tank drone
+// Muzzle flash
+effect dotc_tank_mflash
+count 12
+type spark
+color 0xff9c00 0xff8400
+tex 8 15
+size 16 16
+alpha 328 328 4000
+originjitter 4 4 4
+velocityjitter 380 380 380
+velocitymultiplier 0.4
+stretchfactor 2
+sizeincrease -100
+airfriction 9
+effect dotc_tank_mflash
+countabsolute 1
+type smoke
+tex 65 65
+color 0xff9c00 0xff8400
+size 80 80
+alpha 256 512 3680
+sizeincrease -1000
+rotate -180 180 4000 -4000
+effect dotc_tank_mflash
+count 18
+type smoke
+tex 0 7
+size 30 50
+color 0x646364 0x151515
+velocitymultiplier 0.1
+alpha 128 128 300
+velocityjitter 164 164 164
+rotate -180 180 0 0
+sizeincrease -100
+effect dotc_tank_mflash
+count 8
+type smoke
+tex 0 7
+size 40 60
+color 0x646364 0x151515
+velocitymultiplier 0.05
+alpha 128 128 300
+velocityjitter 164 164 164
+rotate -180 180 0 0
+sizeincrease -100
+effect dotc_tank_mflash
+countabsolute 3
+type smoke
+tex 0 7
+size 30 50
+color 0x646364 0x151515
+alpha 228 228 400
+rotate -180 180 0 0
+sizeincrease 100
+
+// Projectile trail
+// effect dotc_tank_ptrail
+// Projectile explode
+effect dotc_tank_pexplode
+count 12
+type spark
+color 0xff9c00 0xff3c00
+tex 48 55
+size 10 70
+alpha 328 328 1200
+originjitter 4 4 4
+velocityjitter 330 330 420
+velocitymultiplier 2
+stretchfactor 3
+sizeincrease 120
+// smoke
+effect dotc_tank_pexplode
+count 10
+type alphastatic
+tex 0 7
+size 10 30
+color 0x646364 0x151515
+alpha 428 428 400
+rotate -180 180 0 0
+velocityjitter 1300 1300 0
+sizeincrease 60
+airfriction 6
+effect dotc_tank_pexplode
+count 5
+type alphastatic
+tex 0 7
+size 90 100
+color 0x646364 0x151515
+alpha 428 428 400
+rotate -180 180 0 0
+velocityjitter 300 300 600
+velocityoffset 0 0 180
+sizeincrease -60
+airfriction 2
+// sparks nobounce
+effect dotc_tank_pexplode
+notunderwater
+count 12
+type spark
+tex 40 40
+color 0xffa35b 0xfff2be
+size 3 1
+alpha 644 956 784
+gravity 1
+airfriction 0.2
+liquidfriction 0.8
+velocityoffset 0 0 80
+originjitter 16 16 16
+velocityjitter 424 424 924
+effect dotc_tank_pexplode
+notunderwater
+count 12
+type alphastatic
+tex 66 68
+color 0xffa35b 0xfff2be
+size 3 10
+alpha 644 956 784
+gravity 1
+airfriction 0.2
+liquidfriction 0.8
+velocityoffset 0 0 80
+originjitter 16 16 16
+velocityjitter 324 324 624
+rotate -180 180 -1000 1000
+
+// DOTC Tank drone
+// Muzzle flash
+effect dotc_htank_mflash
+count 24
+type smoke
+tex 0 7
+size 30 50
+color 0x646364 0x151515
+velocitymultiplier 0.1
+alpha 128 128 300
+velocityjitter 164 164 164
+rotate -180 180 0 0
+sizeincrease 100
+// Projectile trail
+// effect dotc_htank_ptrail
+// Projectile explode
+effect dotc_htank_pexplode
+
+// DOTC Rocket artillery drone
+// Muzzle flash
+effect dotc_rart_mflash
+count 6
+type spark
+color 0xff9c00 0xff8400
+tex 8 15
+size 16 16
+alpha 328 328 4000
+originjitter 4 4 4
+velocityjitter 180 180 180
+velocitymultiplier 0.4
+stretchfactor 2
+sizeincrease -100
+airfriction 9
+effect dotc_rart_mflash
+count 18
+type smoke
+tex 0 7
+size 30 50
+color 0x646364 0x151515
+velocitymultiplier 0.1
+alpha 128 128 300
+velocityjitter 164 164 164
+rotate -180 180 0 0
+sizeincrease -50
+effect dotc_rart_mflash
+count 2
+type smoke
+tex 0 7
+size 30 50
+color 0x646364 0x151515
+alpha 128 128 200
+velocityoffset 0 0 20
+velocityjitter 64 64 64
+rotate -180 180 0 0
+sizeincrease 20
+// Projectile trail
+// effect dotc_rart_ptrail
+// Projectile explode
+effect dotc_rart_pexplode
+countabsolute 1
+type decal
+tex 8 16
+size 72 72
+alpha 256 256 0
+originjitter 23 23 23
+lightradius 100
+lightradiusfade 350
+lightcolor 8 4 1
+effect dotc_rart_pexplode
+count 8
+type smoke
+color 0xff9c00 0xff3c00
+tex 48 55
+size 1 2
+alpha 300 300 600
+originjitter 10 10 10
+velocityjitter 90 90 20
+stretchfactor 25
+sizeincrease 3
+// glow
+effect dotc_rart_pexplode
+countabsolute 1
+type static
+tex 65 65
+color 0xff9c00 0xff3c00
+size 1 1
+alpha 200 200 500
+sizeincrease 700
+// smoke
+effect dotc_rart_pexplode
+count 5
+type alphastatic
+tex 0 7
+size 1 20
+color 0x646364 0x151515
+alpha 428 428 400
+rotate -180 180 0 0
+velocityjitter 1000 1000 0
+sizeincrease 60
+airfriction 6
+effect dotc_rart_pexplode
+count 10
+type alphastatic
+tex 0 7
+size 100 120
+color 0x646364 0x151515
+alpha 428 428 400
+rotate -180 180 0 0
+velocityjitter 300 300 600
+velocityoffset 0 0 640
+gravity 0.7
+sizeincrease -40
+airfriction 2
+// sparks nobounce
+effect dotc_rart_pexplode
+notunderwater
+count 6
+type spark
+tex 40 40
+color 0xffa35b 0xfff2be
+size 3 1
+alpha 644 956 784
+gravity 1
+airfriction 0.2
+velocityoffset 0 0 350
+originjitter 16 16 16
+velocityjitter 124 124 524
+// derbis
+effect dotc_rart_pexplode
+notunderwater
+count 8
+type alphastatic
+tex 66 68
+color 0xffa35b 0xfff2be
+size 10 23
+alpha 644 756 984
+gravity 1.1
+airfriction 0.2
+sizeincrease -10
+velocityoffset 0 0 400
+originjitter 16 16 16
+velocityjitter 124 124 324
+rotate -180 180 -1000 1000
+
+// DOTC Gun artillery drone
+// Muzzle flash
+// effect dotc_gart_mflash
+// Projectile trail
+// effect dotc_gart_ptrail
+// Projectile explode
+// effect dotc_gart_pexplode
\ No newline at end of file
case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break;
case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
- case ENT_CLIENT_AUXILIARYXHAIR: Ent_AuxiliaryXhair(bIsNewEntity); break;
+ case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
default:
error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
break;
Net_WeaponComplain();
bHandled = true;
break;
+ case TE_CSQC_AUXILIARYXHAIR:
+ Net_AuXair();
+ bHandled = true;
+ break;
+ case TE_CSQC_VEHICLESETUP:
+ Net_VehicleSetup();
+ bHandled = true;
+ break;
default:
// No special logic for this temporary entity; return 0 so the engine can handle it
bHandled = false;
#define SPIDER_CROSS "gfx/vehicles/sbot-xhair.tga"
#define SPIDER_CROSS2 "gfx/vehicles/sbot-xhair2.tga"
+#define axh1 "gfx/vehicles/sbot-xhair2.tga"
+#define axh2 "gfx/vehicles/sbot-xhair2.tga"
+#define axh3 "gfx/vehicles/sbot-xhair2.tga"
+
#define spider_h "gfx/vehicles/hud_bg.tga"
#define spider_b "gfx/vehicles/sbot.tga"
#define spider_r "gfx/vehicles/sbot_rpods.tga"
void CSQC_SPIDER_HUD();
void CSQC_RAPTOR_HUD();
-entity AuxiliaryXhair;
+#define MAX_AXH 4
+entity AuxiliaryXhair[MAX_AXH];
+const var void Draw_Not();
+
+.string axh_image;
+.float axh_fadetime;
+.float axh_drawflag;
+.float axh_scale;
+
void AuxiliaryXhair_Draw2D()
{
vector loc, psize;
- psize = 0.5 * drawgetimagesize(SPIDER_CROSS2);
+ psize = self.axh_scale * drawgetimagesize(self.axh_image);
loc = project_3d_to_2d(self.origin) - 0.5 * psize;
if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
{
loc_z = 0;
psize_z = 0;
- drawpic(loc, SPIDER_CROSS2, psize, self.colormod, 1, DRAWFLAG_ADDITIVE);
+ drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
}
- if(time - self.cnt > 0.1)
- remove(self);
+ if(time - self.cnt > self.axh_fadetime)
+ self.draw2d = Draw_Not;
}
-void Ent_AuxiliaryXhair(float isNew)
-{
- //entity AuxiliaryXhair;
- if(isNew)
- {
- if(AuxiliaryXhair)
- remove(AuxiliaryXhair);
+void Net_AuXair()
+{
+ float axh_id;
+ entity axh;
- AuxiliaryXhair = spawn();
- AuxiliaryXhair.draw2d = AuxiliaryXhair_Draw2D;
- setmodel(AuxiliaryXhair, "null");
- setsize(AuxiliaryXhair, '0 0 -1', '0 0 -1');
+ axh_id = bound(0, ReadByte(), MAX_AXH);
+ axh = AuxiliaryXhair[axh_id];
+ if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
+ {
+ axh = spawn();
+ axh.draw2d = Draw_Not;
+ axh.drawmask = MASK_NORMAL;
+ axh.axh_drawflag = DRAWFLAG_ADDITIVE;
+ axh.axh_fadetime = 0.1;
+ axh.axh_image = "gfx/vehicles/axh-ring.tga";
+ axh.axh_scale = 1;
+ axh.alpha = 1;
+ AuxiliaryXhair[axh_id] = axh;
}
- AuxiliaryXhair.origin_x = ReadCoord();
- AuxiliaryXhair.origin_y = ReadCoord();
- AuxiliaryXhair.origin_z = ReadCoord();
+ axh.draw2d = AuxiliaryXhair_Draw2D;
+
+ axh.origin_x = ReadCoord();
+ axh.origin_y = ReadCoord();
+ axh.origin_z = ReadCoord();
- AuxiliaryXhair.colormod_x = ReadByte() / 255;
- AuxiliaryXhair.colormod_y = ReadByte() / 255;
- AuxiliaryXhair.colormod_z = ReadByte() / 255;
+ axh.colormod_x = ReadByte() / 255;
+ axh.colormod_y = ReadByte() / 255;
+ axh.colormod_z = ReadByte() / 255;
+ axh.cnt = time;
+}
+void Net_AuXair2(float blah)
+{
+ Net_AuXair();
+}
+void Net_VehicleSetup()
+{
- AuxiliaryXhair.drawmask = MASK_NORMAL;
+ float hud_id, i;
+ hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
- AuxiliaryXhair.cnt = time;
- //AuxiliaryXhair.solid = SOLID_NOT;
+ // Init auxiliary crosshairs
+//#if 1
+ entity axh;
+ for(i = 0; i < MAX_AXH; ++i)
+ {
+ axh = AuxiliaryXhair[i];
+ if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
+ remove(axh);
+
+ axh = spawn();
+ axh.draw2d = Draw_Not;
+ axh.drawmask = MASK_NORMAL;
+ axh.axh_drawflag = DRAWFLAG_ADDITIVE;
+ axh.axh_fadetime = 0.1;
+ axh.axh_image = "gfx/vehicles/axh-ring.tga";
+ axh.axh_scale = 1;
+ axh.alpha = 1;
+ AuxiliaryXhair[i] = axh;
+ }
+/*
+#else
+ for(i = 0; i < MAX_AXH; ++i)
+ {
+ if(AuxiliaryXhair[i] != world && !wasfreed(AuxiliaryXhair[i]))
+ remove(AuxiliaryXhair[i]);
+
+ AuxiliaryXhair[i] = spawn();
+ AuxiliaryXhair[i].draw2d = Draw_Not;
+ AuxiliaryXhair[i].drawmask = MASK_NORMAL;
+ AuxiliaryXhair[i].axh_drawflag = DRAWFLAG_ADDITIVE;
+ AuxiliaryXhair[i].axh_fadetime = 0.1;
+ AuxiliaryXhair[i].axh_image = "gfx/vehicles/axh-ring.tga";
+ AuxiliaryXhair[i].axh_scale = 1;
+ AuxiliaryXhair[i].alpha = 1;
+ }
+#endif
+*/
+ switch(hud_id)
+ {
+ case HUD_SPIDERBOT:
+ // Minigun1
+ AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
+ AuxiliaryXhair[0].axh_scale = 0.25;
+ // Minigun2
+ AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
+ AuxiliaryXhair[1].axh_scale = 0.25;
+ // Rocket
+ AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
+ AuxiliaryXhair[2].axh_scale = 0.5;
+ break;
+ case HUD_WAKIZASHI:
+ AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
+ AuxiliaryXhair[0].axh_scale = 0.5;
+ break;
+ case HUD_RAPTOR:
+ AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-cross.tga";
+ AuxiliaryXhair[0].axh_scale = 0.5;
+ AuxiliaryXhair[1].alpha = 0.25;
+ AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
+ AuxiliaryXhair[1].axh_scale = 0.5;
+ AuxiliaryXhair[1].alpha = 0.5;
+ break;
+ }
}
void Vehicles_Precache()
energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1);
// Draw the crosshairs
- picsize = drawgetimagesize(raptor_c);
- picsize_x *= 0.2;
- picsize_y *= 0.2;
- drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), raptor_c, picsize, '1 0 0' + '0 1 1' * energy, 0.5, DRAWFLAG_ADDITIVE);
+ picsize = drawgetimagesize("gfx/vehicles/axh-cross.tga");
+ picsize_x *= 0.75;
+ picsize_y *= 0.75;
+ drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), "gfx/vehicles/axh-cross.tga", picsize, '1 0 0' + '0 1 1' * energy, 0.5, DRAWFLAG_ADDITIVE);
hudloc_y = 4;
hudloc_x = 4;
const float TE_CSQC_WEAPONCOMPLAIN = 113;
const float TE_CSQC_NEX_SCOPE = 116;
const float TE_CSQC_MINELAYER_MAXMINES = 117;
+const float TE_CSQC_AUXILIARYXHAIR = 118;
+const float TE_CSQC_VEHICLESETUP = 119;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float RACE_NET_CHECKPOINT_CLEAR = 1;
<Option makefile="client" />
<Option makefile_is_custom="1" />
<Option pch_mode="2" />
- <Option compiler="qaukec" />
+ <Option compiler="fteqcc" />
+ <MakeCommands>
+ <Build command="$make -src $makefile" />
+ <CompileFile command="$make -src $makefile" />
+ <Clean command="$make -src $makefile" />
+ <DistClean command="" />
+ <AskRebuildNeeded command="" />
+ <SilentBuild command="$make -src $makefile" />
+ </MakeCommands>
<Build>
<Target title="Debug">
<Option output="bin\Debug\qc-server" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="1" />
- <Option compiler="qaukec" />
+ <Option compiler="fteqcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<MakeCommands>
<Build command="$make -src $makefile" />
- <CompileFile command="" />
- <Clean command="" />
+ <CompileFile command="$make -src $makefile" />
+ <Clean command="$make -src $makefile" />
<DistClean command="" />
- <AskRebuildNeeded command="$make -q -f $makefile $target" />
- <SilentBuild command="$make -s -f $makefile $target" />
+ <AskRebuildNeeded command="" />
+ <SilentBuild command="$make -src $makefile" />
</MakeCommands>
</Target>
<Target title="Release">
<Option output="bin\Release\qc-server" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="1" />
- <Option compiler="qaukec" />
+ <Option compiler="fteqcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Add option="-s" />
</Linker>
<MakeCommands>
- <Build command="$make -src $makefile" />
- <CompileFile command="" />
- <Clean command="" />
+ <Build command="$make -DRELEASE -src $makefile" />
+ <CompileFile command="$make -DRELEASE -src $makefile" />
+ <Clean command="$make -DRELEASE -src $makefile" />
<DistClean command="" />
- <AskRebuildNeeded command="$make -q -f $makefile $target" />
- <SilentBuild command="$make -s -f $makefile $target" />
+ <AskRebuildNeeded command="" />
+ <SilentBuild command="$make -DRELEASE -src $makefile" />
</MakeCommands>
</Target>
</Build>
<Compiler>
- <Add option="-Wall" />
+ <Add option="-g" />
</Compiler>
<Unit filename="client\Defs.qc" />
<Unit filename="client\Main.qc" />
<Unit filename="client\progs.src" />
<Unit filename="client\projectile.qc" />
<Unit filename="client\rubble.qc" />
- <Unit filename="client\sbar.qc" />
<Unit filename="client\sortlist.qc" />
<Unit filename="client\teamplay.qc" />
<Unit filename="client\teamradar.qc" />
<Unit filename="client\teamradar.qh" />
<Unit filename="client\tuba.qc" />
- <Unit filename="client\vehicles\racer.qc" />
- <Unit filename="client\vehicles\raptor.qc" />
- <Unit filename="client\vehicles\spiderbot.qc" />
<Unit filename="client\vehicles\vehicles.qc" />
<Unit filename="client\wall.qc" />
<Unit filename="client\waypointsprites.qc" />
playerdemo_init();
anticheat_init();
-
+
race_PreSpawnObserver();
//if(g_domination)
void ReadyCount();
void ClientDisconnect (void)
{
+ if(self.vehicle)
+ {
+ entity oldself;
+ oldself = self;
+ self = self.vehicle;
+ self.vehicle_exit(VHEF_RELESE);
+ self = oldself;
+ }
+
if not(self.flags & FL_CLIENT)
{
print("Warning: ClientDisconnect without ClientConnect\n");
{
// add a way to see what the items were BEFORE all of these checks for the mutator hook
olditems = self.items;
-
+
if((self.items & IT_USING_JETPACK) && !self.deadflag)
{
SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
if(!self.modelindex || self.deadflag) // don't apply the flags if the player is gibbed
return;
-
+
Fire_ApplyDamage(self);
Fire_ApplyEffect(self);
if (time < self.spawnshieldtime)
self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
}
-
+
MUTATOR_CALLHOOK(PlayerPowerups);
}
if(self.waypointsprite_attachedforcarrier)
WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent));
-
+
if(self.classname == "player" && self.deadflag == DEAD_NO && autocvar_r_showbboxes)
{
if(!self.showheadshotbbox)
awep = DEATH_WEAPONOF(deathtype);
valid_damage_for_weaponstats = 1;
}
-
+
if(valid_damage_for_weaponstats)
{
dh = dh - max(self.health, 0);
// player is in the worse half, if >= half the players are better than him, or consequently, if < half of the players are worse
// use this rule here
-
+
if(players_worseeq >= players_total * captureshield_max_ratio)
return FALSE;
e.playerid = attacker.playerid;
e.ctf_droptime = time;
WaypointSprite_Spawn("flagdropped", 0, 0, e, '0 0 1' * 61, world, COLOR_TEAM1 + COLOR_TEAM2 - e.team, e, waypointsprite_attachedforcarrier, FALSE);
-
+
if(p.waypointsprite_attachedforcarrier)
{
WaypointSprite_Ping(p.waypointsprite_attachedforcarrier);
{
if (other.next_take_time > time)
return;
-
+
if (autocvar_g_ctf_flag_pickup_effects) // pickup effect
pointparticles(particleeffectnum("smoke_ring"), 0.5 * (self.absmin + self.absmax), '0 0 0', 1);
-
+
// pick up
self.flagpickuptime = time; // used for timing runs
self.speedrunning = other.speedrunning; // if speedrunning, flag will self-return and teleport the owner back after the record
if (autocvar_g_ctf_flag_pickup_effects) // field pickup effect
pointparticles(particleeffectnum("smoke_ring"), 0.5 * (self.absmin + self.absmax), '0 0 0', 1);
-
+
// pick up
self.solid = SOLID_NOT;
setorigin(self, self.origin); // relink
if(self.team == COLOR_TEAM2)
// Blue
self.glow_color = 210;
-
+
self.glow_size = 25;
self.glow_trail = 1;
}
entity pl;
if(cteam != COLOR_TEAM1 || cteam != COLOR_TEAM2)
return world;
-
+
FOR_EACH_REALPLAYER(pl) {
if(pl.team == cteam && pl.iscommander) {
return pl;
void(float cteam) ctf_new_commander =
{
entity pl, plmax;
-
+
plmax = world;
FOR_EACH_REALPLAYER(pl) {
if(pl.team == cteam) {
void() ctf_clientconnect =
{
self.iscommander = FALSE;
-
+
if(!self.team || self.classname != "player") {
ctf_setstate(self, -1);
} else
ctf_setstate(self, 0);
self.team_saved = self.team;
-
+
if(self.team != 0 && self.classname == "player" && !ctf_team_has_commander(self.team)) {
ctf_new_commander(self.team);
}
ctf_setstate(self, -1);
ctf_new_commander(self.team_saved);
}
-
+
self.team_saved = self.team;
-
+
ctf_new_commander(self.team);
};
//// tZork Turrets ////
tturrets/include/turrets_early.qh
+vehicles/vehicles_def.qh
campaign.qh
../common/campaign_common.qh
float autocvar_g_vehicle_racer_rocket_refire;
float autocvar_g_vehicle_racer_rocket_speed;
float autocvar_g_vehicle_racer_rocket_turnrate;
+float autocvar_g_vehicle_racer_rocket_locktime;
float autocvar_g_vehicle_racer_respawntime;
float autocvar_g_vehicle_racer_collision_multiplier;
self.velocity += v_add;
self.velocity_z -= autocvar_sv_gravity * frametime;
-
-
push_vector_x = (fl_push - bl_push);
push_vector_x += (fr_push - br_push);
push_vector_x *= 360;
bolt.bot_dodgerating = autocvar_g_vehicle_racer_laser_damage;
// Fix z-aim (for chase mode)
- crosshair_trace(self.owner);
v = normalize(trace_endpos - bolt.origin);
v_forward_z = v_z * 0.5;
void racer_rocket_groundhugger()
{
- vector olddir;
+ vector olddir, newdir;
+ float oldvel, newvel;
self.nextthink = time;
}
olddir = normalize(self.velocity);
+ oldvel = vlen(self.velocity);
+ newvel = oldvel + self.lip;
+
tracebox(self.origin, self.mins, self.maxs, self.origin + olddir * 64, MOVE_WORLDONLY,self);
- if(trace_fraction >= 0.5)
+ if(trace_fraction <= 0.5)
{
- traceline(trace_endpos, trace_endpos - '0 0 64', MOVE_NORMAL, self);
- if(trace_fraction != 1.0)
- {
- // Follow ground
- self.velocity = normalize(olddir + normalize((trace_endpos + '0 0 32') - self.origin) * self.wait) * (vlen(self.velocity) + self.lip);
- UpdateCSQCProjectile(self);
- return;
- }
- else
- {
- // "In air", add gravity.
- self.velocity = olddir * (vlen(self.velocity) + self.lip);
- self.velocity_z -= sys_frametime * 1250;
- UpdateCSQCProjectile(self);
- return;
- }
+ // Hitting somethign soon, just speed ahead
+ self.velocity = olddir * newvel;
+ UpdateCSQCProjectile(self);
+ return;
+ }
+
+ if(self.enemy != world)
+ {
+ newdir = normalize(self.enemy.origin - self.origin);
+ //self.realowner.vehicle.delay = time + 0.1;
}
- // Hitting somethign soon.
- self.velocity = olddir * (vlen(self.velocity) + self.lip);
+
+ traceline(trace_endpos, trace_endpos - '0 0 64', MOVE_NORMAL, self);
+ if(trace_fraction != 1.0)
+ {
+ newdir += normalize(trace_endpos + '0 0 64' - self.origin);
+ self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
+ }
+ else
+ {
+ self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
+ self.velocity_z -= 800 * sys_frametime;
+ }
+
+
UpdateCSQCProjectile(self);
+ return;
+
}
-void racer_fire_rocket(string tagname)
+void racer_fire_rocket(string tagname, entity trg)
{
entity rocket;
rocket.cnt = time + 9;
rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
rocket.think = racer_rocket_groundhugger;
- rocket.nextthink = time;
+ rocket.nextthink = time + 0.5;
+ rocket.enemy = trg;
CSQCProjectile(rocket, TRUE, PROJECTILE_ROCKET, TRUE);
}
+.float fire1_waspressed;
+.float fire2_waspressed;
float racer_frame()
{
entity player, racer;
racer.angles_x = anglemods(racer.angles_x + ftmp);
racer.angles_x *= -1;
+/*
+ crosshair_trace(player);
+ df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
+ if(df_x > 180) df_x -= 360;
+ if(df_x < -180) df_x += 360;
+ if(df_y > 180) df_y -= 360;
+ if(df_y < -180) df_y += 360;
+
+ // Yaw
+ ftmp = autocvar_g_vehicle_racer_turnspeed * sys_frametime;
+ ftmp2 = ftmp * -1;
+
+ ftmp = bound(ftmp2, shortangle_f(df_y - racer.angles_y, racer.angles_y), ftmp);
+ ftmp2 = anglemods(racer.angles_y + ftmp);
+
+ // Roll
+ ftmp = bound(-45, shortangle_f(df_z + ((racer.angles_y - ftmp2) * autocvar_g_vehicle_racer_turnroll), racer.angles_z), 45);
+ ftmp = anglemods(racer.angles_z + ftmp) * frametime;
+ racer.angles_z = bound(-65, racer.angles_z + ftmp, 65);
+
+ // Turn
+ racer.angles_y = ftmp2;
+
+ // Pitch Body
+ ftmp = autocvar_g_vehicle_racer_pitchspeed * sys_frametime;
+ ftmp2 = ftmp * -1;
+
+ ftmp = bound(ftmp2, shortangle_f(player.v_angle_x - racer.angles_x, racer.angles_x), ftmp);
+ racer.angles_x = anglemods(racer.angles_x + ftmp);
+
+ racer.angles_x *= -1;
+ makevectors(racer.angles);
+ racer.angles_x *= -1;
+*/
+
df = racer.velocity * -0.5;
if(player.movement_x != 0)
if(df_z > 0)
df_z = min(df_z, 700);
-
// Afterburn
if (player.BUTTON_JUMP)
if(racer.vehicle_energy >= (autocvar_g_vehicle_racer_afterburn_cost * frametime))
racer.vehicle_energy -= autocvar_g_vehicle_racer_laser_cost;
racer.wait = time;
+ crosshair_trace(player);
if(racer.cnt)
{
racer_fire_cannon("tag_fire1");
self.owner.vehicle_energy = racer.vehicle_energy / autocvar_g_vehicle_racer_energy;
}
- if(player.BUTTON_ATCK2)
if(time > racer.delay)
{
- racer_fire_rocket("tag_rocket_r");
- racer_fire_rocket("tag_rocket_l");
- racer.delay = time + autocvar_g_vehicle_racer_rocket_refire;
- racer.lip = time;
+ if(player.BUTTON_ATCK2)
+ {
+ crosshair_trace(player);
+
+ if(!player.fire2_waspressed)
+ {
+ if not (trace_ent)
+ {
+ player.BUTTON_ATCK2 = 0;
+ player.fire2_waspressed = 1;
+ }
+ }
+ else
+ {
+ if(racer.phase < time)
+ {
+ if(self.lock_target && self.lock_strength == 1)
+ {
+ self.lock_strength = 0;
+ self.lock_target = world;
+ }
+
+ vehicles_locktarget((1 / autocvar_g_vehicle_racer_rocket_locktime) * frametime);
+ if(self.lock_target)
+ {
+ if(self.lock_strength == 1)
+ {
+ UpdateAuxiliaryXhair(player, real_origin(self.lock_target), '1 0 0', 0);
+ racer.phase = time + 5;
+ }
+ else if(self.lock_strength > 0.75)
+ UpdateAuxiliaryXhair(player, real_origin(self.lock_target), '1 0 1', 0);
+ else if(self.lock_strength > 0.5)
+ UpdateAuxiliaryXhair(player, real_origin(self.lock_target), '0 1 0', 0);
+ else if(self.lock_strength < 0.5)
+ UpdateAuxiliaryXhair(player, real_origin(self.lock_target), '0 0 1', 0);
+ }
+ }
+ else
+ {
+ UpdateAuxiliaryXhair(player, real_origin(self.lock_target), '1 0 0', 0);
+ }
+ }
+ }
+
+ if(!player.BUTTON_ATCK2)
+ {
+ if(player.fire2_waspressed)
+ {
+ racer_fire_rocket("tag_rocket_r", ((self.lock_strength == 1 && self.lock_target) ? self.lock_target : world));
+ racer_fire_rocket("tag_rocket_l", ((self.lock_strength == 1 && self.lock_target) ? self.lock_target : world));
+
+ self.lock_strength = 0;
+ self.lock_target = world;
+
+ racer.delay = time + autocvar_g_vehicle_racer_rocket_refire;
+ racer.lip = time;
+ }
+ }
}
+ player.fire2_waspressed = player.BUTTON_ATCK2;
+
player.vehicle_reload1 = (time - racer.lip) / (racer.delay - racer.lip);
if(self.vehicle_flags & VHF_SHIELDREGEN)
self.flags = FL_NOTARGET;
self.effects = 0;
+
self.vehicle_health = autocvar_g_vehicle_racer_health;
self.vehicle_shield = autocvar_g_vehicle_racer_shield;
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;
+
+ vehicles_common_spawn();
}
void racer_blowup()
float autocvar_g_vehicle_raptor_guns_pitchlimit_down;
float autocvar_g_vehicle_raptor_cannon_locktarget;
+float autocvar_g_vehicle_raptor_cannon_locking_time;
+float autocvar_g_vehicle_raptor_cannon_locking_releasetime;
+float autocvar_g_vehicle_raptor_cannon_locked_time;
float autocvar_g_vehicle_raptor_cannon_predicttarget;
+
float autocvar_g_vehicle_raptor_cannon_cost;
float autocvar_g_vehicle_raptor_cannon_damage;
float autocvar_g_vehicle_raptor_cannon_radius;
.entity bomb1;
.entity bomb2;
+.entity camera;
float raptor_altitude(float amax)
{
{
PROJECTILE_TOUCH;
pointparticles(particleeffectnum("raptor_cannon_impact"), findbetterlocation (self.origin, 8), trace_plane_normal * 1000, 1);
- RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_cannon_damage, 0, autocvar_g_vehicle_raptor_cannon_radius, world, 150, DEATH_WAKIGUN, world);
+ RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_cannon_damage, 0, autocvar_g_vehicle_raptor_cannon_radius, world, 25, DEATH_WAKIGUN, world);
sound (self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
remove (self);
}
bolt.velocity = normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed;
pointparticles(particleeffectnum("raptor_cannon_muzzleflash"), bolt.origin, bolt.velocity, 1);
+ //pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), bolt.origin, bolt.velocity, 1);
CSQCProjectile(bolt, TRUE, PROJECTILE_CRYLINK , TRUE);
}
self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_raptor_health);
self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_raptor_shield);
self.velocity_z = 1;
+ //setorigin(self.vehicle_viewport, self.origin);
}
void raptor_land()
if not (self.owner)
return;
- Release_AuxiliaryXhair(self.owner);
makevectors(self.angles);
if(eject)
{
raptor.velocity_z = min(raptor.velocity_z * 1.5, 256);
self.bomb1.gun1.avelocity_y = 90 + ((raptor.frame / 25) * 2000);
self.bomb1.gun2.avelocity_y = -self.bomb1.gun1.avelocity_y;
+ player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
+ self = player;
return 1;
}
+ /*
raptor.angles_x *= -1;
// Rotate Body
ftmp = autocvar_g_vehicle_raptor_turnspeed * sys_frametime;
}
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'));
+ if(df_x > 180) df_x -= 360;
+ if(df_x < -180) df_x += 360;
+ if(df_y > 180) df_y -= 360;
+ if(df_y < -180) df_y += 360;
+
+ //raptor.angles_x *= -1;
+ // Rotate Body
+ ftmp = autocvar_g_vehicle_raptor_turnspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(df_y - raptor.angles_y, raptor.angles_y), ftmp);
+
+ // Turn
+ raptor.angles_y = anglemods(raptor.angles_y + ftmp);
+
+ // Pitch Body
+ ftmp = autocvar_g_vehicle_raptor_pitchspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(df_x - raptor.angles_x, raptor.angles_x), ftmp);
+
+ raptor.angles_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, anglemods(raptor.angles_x + ftmp), autocvar_g_vehicle_raptor_pitchlimit);
+ //raptor.angles_x *= -1;
+
+ if(autocvar_g_vehicle_raptor_movestyle == 1)
+ {
+ ftmp = raptor.angles_z;
+ raptor.angles_z = 0;
+ ftmp2 = raptor.angles_x;
+ raptor.angles_x = 0;
+ fixedmakevectors(raptor.angles);
+ raptor.angles_z = ftmp;
+ raptor.angles_x = ftmp2;
+ }
+ else
+ makevectors(player.v_angle);
+
+
+
+ /*
+ float dist, spd, back, up;
+ //dist = normalize(self.vehicle_viewport.origin - self.origin);
+ spd = vlen(self.velocity) + 0.01;
+ back = spd / autocvar_g_vehicle_raptor_speed_forward;
+ up = 1 - back;
+ back = back;
+ back = back * 1250;
+ back += 150;
+ up = up * 200;
+ up = up + 100;
+
+ setorigin(self.vehicle_viewport, self.origin + (v_up * up) + (v_forward * -back));
+ */
df = raptor.velocity * -1;
player.velocity = player.movement = raptor.velocity;
setorigin(player,raptor.origin + '0 0 32');
- // Aim the gunz
- crosshair_trace(player);
vector vf, ad;
+ // Target lock & predict
if(autocvar_g_vehicle_raptor_cannon_locktarget)
{
- if(trace_ent)
- {
- if(raptor.gun2.enemy != world)
- {
- if(raptor.gun2.enemy == trace_ent)
- raptor.gun2.cnt += 1;
- else
- raptor.gun2.cnt -= 1;
- }
-
- raptor.gun2.enemy = trace_ent;
- if(raptor.gun2.cnt < 0)
- {
- raptor.gun2.enemy = world;
- raptor.gun2.cnt = 0;
- }
-
- if(raptor.gun2.cnt > 50)
- {
- raptor.gun2.enemy = world;
- raptor.gun2.cnt = 0;
-
- raptor.gun1.enemy = trace_ent;
- raptor.gun1.cnt = time + 1;
- }
-
- // Allready have a lock?
- if(raptor.gun1.enemy != world)
- {
- // Add 0.5 secs of tracking for each trace hit
- if(trace_ent == raptor.gun1.enemy)
- raptor.gun1.cnt = min(raptor.gun1.cnt + 0.25, time + 5);
-
- if(raptor.gun1.cnt < time)
- raptor.gun1.enemy = world;
- }
- }
- else
- raptor.gun2.cnt = max(raptor.gun2.cnt - 1, 0);
+ vehicles_locktarget2((1 / autocvar_g_vehicle_raptor_cannon_locking_time) * frametime,
+ (1 / autocvar_g_vehicle_raptor_cannon_locking_releasetime) * frametime,
+ autocvar_g_vehicle_raptor_cannon_locked_time);
- if(raptor.gun1.cnt - time < 0)
- raptor.gun1.enemy = world;
-
- if(autocvar_g_vehicle_raptor_cannon_predicttarget)
+ if(autocvar_g_vehicle_raptor_cannon_predicttarget && self.lock_strength == 1)
{
vector o;
- if(raptor.gun1.enemy != world)
+ if(self.lock_target != world)
{
float i, distance, impact_time;
- vf = real_origin(raptor.gun1.enemy);
+ vf = real_origin(raptor.lock_target);
ad = vf;
o = raptor.origin;
for(i = 0; i < 4; ++i)
distance = vlen(ad - o);
impact_time = distance / autocvar_g_vehicle_raptor_cannon_speed;
- ad = vf + raptor.gun1.enemy.velocity * impact_time;
+ ad = vf + raptor.lock_target.velocity * impact_time;
o = raptor.origin + raptor.velocity * impact_time;
}
trace_endpos = ad;
-
}
}
+
+ if(self.lock_target != world)
+ if(self.lock_strength == 1)
+ UpdateAuxiliaryXhair(player, real_origin(self.lock_target), '0 0 1', 1);
else
- trace_endpos = real_origin(raptor.gun1.enemy);
+ UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * (1 - self.lock_strength)) + '0 1 0' * self.lock_strength, 1);
}
+ // Aim the gunz
ftmp2 = autocvar_g_vehicle_raptor_guns_turnspeed * frametime;
ftmp = -ftmp2;
// Gun1
df = gettaginfo(raptor.gun1, gettagindex(raptor.gun1, "fire1"));
- ad += df;
- vf += v_forward;
+ ad = df;
+ vf = v_forward;
df = vectoangles(normalize(trace_endpos - df)); // Find the direction & angle
df = shortangle_vxy(df - (raptor.angles + raptor.gun1.angles), raptor.angles + raptor.gun1.angles); // Find aim offset
// Bind to aimspeed
raptor.gun2.angles_y = bound(-autocvar_g_vehicle_raptor_guns_turnlimit, df_y + raptor.gun2.angles_y, autocvar_g_vehicle_raptor_guns_turnlimit);
- if(autocvar_g_vehicle_raptor_cannon_locktarget)
- {
-
- if(raptor.gun1.enemy)
- {
- SpawnOrUpdateAuxiliaryXhair(player, trace_endpos, '1 0 0');
- }
- else
- {
- ad = ad * 0.5;
- v_forward = vf * 0.5;
- traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, raptor);
-
- if(raptor.gun2.enemy != world)
- {
- ftmp = raptor.gun2.cnt / 50;
- SpawnOrUpdateAuxiliaryXhair(player, trace_endpos, '1 0 0' * ftmp + '1 1 1' * (1 - ftmp));
- }
- else
- SpawnOrUpdateAuxiliaryXhair(player, trace_endpos, '1 1 1');
-
- }
- }
- else
- SpawnOrUpdateAuxiliaryXhair(player, trace_endpos, '1 1 1');
+ /*
+ ad = ad * 0.5;
+ v_forward = vf * 0.5;
+ traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, raptor);
+ UpdateAuxiliaryXhair(player, trace_endpos, '0 1 0', 0);
+ */
if(player.BUTTON_ATCK)
if(raptor.attack_finished_single <= time)
VEHICLE_UPDATE_PLAYER(shield, raptor);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
-
- self = player;
return 1;
}
setsize(self, RAPTOR_MIN, RAPTOR_MAX );
pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
self.delay = time;
+
+ vehicles_common_spawn();
}
void raptor_dinit()
self.gun1 = spawn();
self.gun2 = spawn();
+ //setattachment(self.vehicle_viewport, world, "");
+
setmodel(self.bomb1,"models/vehicles/raptor_bomb.dpm");
setmodel(self.bomb2,"models/vehicles/raptor_bomb.dpm");
setmodel(self.gun1, "models/vehicles/raptor_gun.dpm");
precache_model ("models/vehicles/raptor_cockpit.dpm");
precache_model ("models/vehicles/raptor_bomb.dpm");
-
self.think = raptor_dinit;
self.nextthink = time + 1;
}
v_forward = normalize(v_forward);
v += v_forward * 50;
+ oldself = self;
+ self = self.owner;
fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
+ self = oldself;
if(trail)
{
}
else
self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_refire + time;
-
}
return;
}
self = spider;
crosshair_trace(player);
+ UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
ad = vectoangles(normalize(trace_endpos - gettaginfo(spider.tur_head,gettagindex(spider.tur_head,"tag_hud")))) - (spider.tur_head.angles + spider.angles);
if(ad_x > 180) ad_x -= 360;
if(ad_x < -180) ad_x += 360;
if(self.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(shield, spiderbot);
+ // Avarage gun impact point's -> aux cross
vector vf;
-
ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
vf = v_forward;
ad += gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
vf += v_forward;
ad = ad * 0.5;
v_forward = vf * 0.5;
+ traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
+ UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
+
+
+ /*
+ ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
+ traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
+ UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
+ ad = gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
- SpawnOrUpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)));
+ UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 1);
+ */
self = player;
return 1;
if not (self.owner)
return;
- Release_AuxiliaryXhair(self.owner);
-
makevectors(self.angles);
if(eject)
{
self.tur_head.colormod = self.colormod;
+ vehicles_common_spawn();
}
void vehicles_return();
void vehicles_clearrturn();
-.entity AuxiliaryXhair;
-float AuxiliaryXhair_customizeentityforclient()
-{
- if(other == self.owner)
- return TRUE;
+#define MAX_AXH 4
+.entity AuxiliaryXhair[MAX_AXH];
- return FALSE;
-}
-float AuxiliaryXhair_SendEntity(entity to, float sf)
+float SendAuxiliaryXhair(entity to, float sf)
{
+
WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
+
+ WriteByte(MSG_ENTITY, self.cnt);
+
WriteCoord(MSG_ENTITY, self.origin_x);
WriteCoord(MSG_ENTITY, self.origin_y);
WriteCoord(MSG_ENTITY, self.origin_z);
WriteByte(MSG_ENTITY, rint(self.colormod_y * 255));
WriteByte(MSG_ENTITY, rint(self.colormod_z * 255));
- return TRUE;
+ return TRUE;
}
-void SpawnOrUpdateAuxiliaryXhair(entity own, vector loc, vector clr)
+void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
{
+ entity axh;
+
+ axh_id = bound(0, axh_id, MAX_AXH);
+ axh = own.AuxiliaryXhair[axh_id];
- if(own.AuxiliaryXhair == world || wasfreed(own.AuxiliaryXhair))
+ if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
{
- own.AuxiliaryXhair = spawn();
- own.AuxiliaryXhair.owner = own;
- own.AuxiliaryXhair.drawonlytoclient = own;
- Net_LinkEntity(own.AuxiliaryXhair, FALSE, 0, AuxiliaryXhair_SendEntity);
+ axh = spawn();
+ axh.cnt = axh_id;
+ axh.drawonlytoclient = own;
+ axh.owner = own;
+ Net_LinkEntity(axh, FALSE, 0, SendAuxiliaryXhair);
}
- own.AuxiliaryXhair.colormod = clr;
- setorigin(own.AuxiliaryXhair, loc);
- own.AuxiliaryXhair.SendFlags |= 0x01;
+ setorigin(axh, loc);
+ axh.colormod = clr;
+ axh.SendFlags = 0x01;
+ own.AuxiliaryXhair[axh_id] = axh;
+}
+
+/*
+// SVC_TEMPENTITY based, horrible with even 50 ping. hm.
+void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
+{
+ msg_entity = own;
+
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ WriteByte(MSG_ONE, TE_CSQC_AUXILIARYXHAIR);
+
+ WriteByte(MSG_ONE, axh_id);
+
+ WriteCoord(MSG_ONE, loc_x);
+ WriteCoord(MSG_ONE, loc_y);
+ WriteCoord(MSG_ONE, loc_z);
+
+ WriteByte(MSG_ONE, rint(clr_x * 255));
+ WriteByte(MSG_ONE, rint(clr_y * 255));
+ WriteByte(MSG_ONE, rint(clr_z * 255));
+
+}
+*/
+
+void CSQCVehicleSetup(entity own, float vehicle_id)
+{
+ msg_entity = own;
+
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP);
+ WriteByte(MSG_ONE, vehicle_id);
}
-void Release_AuxiliaryXhair(entity from)
+.entity lock_target;
+.float lock_strength;
+.float lock_time;
+void vehicles_locktarget(float deltatime)
{
- // from.AuxiliaryXhair.drawonlytoclient = from.AuxiliaryXhair;
- if (from.AuxiliaryXhair != world && !wasfreed(from.AuxiliaryXhair))
- remove(from.AuxiliaryXhair);
+ // no target hit by trace
+ if(trace_ent == world)
+ {
+ self.lock_strength = max(self.lock_strength - deltatime, 0);
+ if(self.lock_strength == 0)
+ self.lock_target = world;
- from.AuxiliaryXhair = world;
+ return;
+ }
+
+ // Current have no target
+ if(self.lock_target == world)
+ {
+ // aquire
+ if(trace_ent != world)
+ {
+ self.lock_target = trace_ent;
+ self.lock_strength = deltatime;
+ }
+ return;
+ }
+
+ // Have a locking target
+ // Trace hit current target
+ if(trace_ent == self.lock_target)
+ {
+ self.lock_strength = min(self.lock_strength + deltatime, 1);
+ }
+ else
+ {
+ self.lock_strength = max(self.lock_strength - deltatime, 0);
+ if(self.lock_strength == 0)
+ self.lock_target = world;
+ }
}
+
+void vehicles_locktarget2(float incr, float decr, float _lock_time)
+{
+ if(self.lock_time > time)
+ return;
+
+
+
+ if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+ self.lock_strength = min(self.lock_strength - decr, 1);
+ else if(trace_ent.deadflag != DEAD_NO)
+ self.lock_strength = min(self.lock_strength - decr, 1);
+
+ if(self.lock_target == world && trace_ent != world)
+ self.lock_target = trace_ent;
+
+ // Have a locking target
+ // Trace hit current target
+ if(trace_ent == self.lock_target && trace_ent != world)
+ {
+ self.lock_strength = min(self.lock_strength + incr, 1);
+ if(self.lock_strength == 1)
+ self.lock_time = time + _lock_time;
+ }
+ else
+ {
+ self.lock_strength = max(self.lock_strength - decr, 0);
+
+ if(self.lock_strength == 0)
+ self.lock_target = world;
+ }
+}
+
+
#define VEHICLE_UPDATE_PLAYER(fld,vhname) \
self.owner.vehicle_##fld = self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld
vehicles_clearrturn();
+ CSQCVehicleSetup(self.owner, self.hud);
+
if(self.vehicle_enter)
self.vehicle_enter();
}
localcmd(strcat("exec ", configname, "\n"));
}
+void vehicles_common_spawn()
+{
+ entity e;
+ float _effects, _colormap;
+ vector _glowmod, _colormod;
+
+ if(autocvar_g_nodepthtestplayers)
+ _effects = EF_NODEPTHTEST;
+
+ if(autocvar_g_fullbrightplayers)
+ _colormap |= EF_FULLBRIGHT;
+
+ if(self.team == COLOR_TEAM1)
+ _colormap = 1;
+ else if (self.team == COLOR_TEAM2)
+ _colormap = 2;
+
+ _glowmod = '0 0 0';
+ _colormod = '0 0 0';
+
+ e = findchainentity(tag_entity, self);
+ while(e)
+ {
+ e.colormap = _colormap;
+ e.effects = _effects;
+ e.colormod = _colormod;
+ e.colormap = _colormap;
+ e = e.chain;
+ }
+
+ self.effects = _effects;
+ self.colormap = _colormap;
+ self.colormod = _colormod;
+ self.colormap = _colormap;
+}
+
float vehicle_initialize(string net_name,
string bodymodel,
string topmodel,
addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
addstat(STAT_VEHICLESTAT_RELOAD2, AS_FLOAT, vehicle_reload2);
+
if(bodymodel == "")
error("vehicles: missing bodymodel!");
if(self.team && !teams_matter)
self.team = 0;
+ self.vehicle_flags |= VHF_ISVEHICLE;
+
setmodel(self, bodymodel);
self.vehicle_viewport = spawn();
self.think = spawnproc;
self.nextthink = time;
+ if(autocvar_g_nodepthtestplayers)
+ self.effects = self.effects | EF_NODEPTHTEST;
+
+ if(autocvar_g_fullbrightplayers)
+ self.effects = self.effects | EF_FULLBRIGHT;
+
setmodel(self.vehicle_hudmodel, hudmodel);
setmodel(self.vehicle_viewport, "null");
-#define VEHICLES_ENABLED
#ifdef VEHICLES_ENABLED
-
-#message "with tZork vehicles (experimental)"
-
-float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
-float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
-float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
-
-//#define CCVAR(part) cvar(strcat(self.cvar_basename,part))
-//.string cvar_basename;
-
-.float vehicle_flags;
-#define VHF_HASSHIELD 2
-#define VHF_SHIELDREGEN 4
-#define VHF_HEALTHREGEN 8
-#define VHF_DEATHEJECT 16
-#define VHF_ENERGYREGEN 32
-
-.float hud;
-
-.entity gun1;
-.entity gun2;
-
-//.entity shield;
-
-.float vehicle_health;
-.float vehicle_shield;
-.float vehicle_energy;
-
-.float vehicle_ammo1;
-.float vehicle_reload1;
-
-.float vehicle_ammo2;
-.float vehicle_reload2;
-
-.entity vehicle;
-.entity vehicle_viewport;
-.entity vehicle_hudmodel;
-
-.float dmg_time;
-
-#define VHEF_NORMAL 0
-#define VHEF_EJECT 1
-#define VHEF_RELESE 2
-
-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 "racer.qc"
#include "spiderbot.qc"
#include "raptor.qc"
-
#endif
set g_vehicle_racer_rocket_radius 100
set g_vehicle_racer_rocket_refire 3
set g_vehicle_racer_rocket_cost 0
+set g_vehicle_racer_rocket_locktime 1
set g_vehicle_raptor_bomblets 10
set g_vehicle_raptor_bomblet_alt 500
set g_vehicle_raptor_bomblet_time 0.5
-set g_vehicle_raptor_bomblet_spread 0.25
-set g_vehicle_raptor_bomblet_damage 40
-set g_vehicle_raptor_bomblet_edgedamage 20
+set g_vehicle_raptor_bomblet_spread 0.65
+set g_vehicle_raptor_bomblet_damage 35
+set g_vehicle_raptor_bomblet_edgedamage 15
set g_vehicle_raptor_bomblet_radius 300
set g_vehicle_raptor_bomblet_force 150
set g_vehicle_raptor_bombs_refire 5
-set g_vehicle_raptor_guns_turnspeed 32
-set g_vehicle_raptor_guns_turnlimit 10
+set g_vehicle_raptor_guns_turnspeed 48
+set g_vehicle_raptor_guns_turnlimit 16
set g_vehicle_raptor_guns_pitchlimit_up 8
-set g_vehicle_raptor_guns_pitchlimit_down 32
+set g_vehicle_raptor_guns_pitchlimit_down 48
set g_vehicle_raptor_cannon_locktarget 1
+set g_vehicle_raptor_cannon_locking_time 0.2
+set g_vehicle_raptor_cannon_locking_releasetime 0.2
+set g_vehicle_raptor_cannon_locked_time 0.5
set g_vehicle_raptor_cannon_predicttarget 1
-g_vehicle_raptor_cannon_cost 1
-set g_vehicle_raptor_cannon_damage 10
-set g_vehicle_raptor_cannon_radius 25
-set g_vehicle_raptor_cannon_refire 0.1
+
+set g_vehicle_raptor_cannon_cost 1
+set g_vehicle_raptor_cannon_damage 20
+set g_vehicle_raptor_cannon_radius 45
+set g_vehicle_raptor_cannon_refire 0.2
set g_vehicle_raptor_cannon_speed 9000
-set g_vehicle_raptor_cannon_spread 0.05
+set g_vehicle_raptor_cannon_spread 0.0125
-set g_vehicle_raptor_energy 200
-set g_vehicle_raptor_energy_regen 25
-set g_vehicle_raptor_energy_regen_pause 1
+set g_vehicle_raptor_energy 80
+set g_vehicle_raptor_energy_regen 40
+set g_vehicle_raptor_energy_regen_pause 0.25
-set g_vehicle_raptor_health 250
+set g_vehicle_raptor_health 200
set g_vehicle_raptor_health_regen 0
set g_vehicle_raptor_health_regen_pause 0
-set g_vehicle_raptor_shield 200
-set g_vehicle_raptor_shield_regen 50
-set g_vehicle_raptor_shield_regen_pause 1.5
+set g_vehicle_raptor_shield 150
+set g_vehicle_raptor_shield_regen 25
+set g_vehicle_raptor_shield_regen_pause 2