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
velocitymultiplier 15
airfriction -1
rotate 0 360 -180 180
+
+// ---------------vechicles
+
+effect spiderbot_minigun_trail
+notunderwater
+trailspacing 10
+type smoke
+color 0xd0d0a0 0xffffff
+tex 0 8
+size 1 2
+alpha 20 50 100
+sizeincrease 2
+velocityjitter 5 5 5
+gravity -0.03
+airfriction 1
+
+effect spiderbot_minigun_muzzleflash
+count 3
+type spark
+color 0xff9c00 0xff8400
+tex 43 43
+size 5 7
+alpha 256 512 6280
+airfriction 10
+originjitter 2 2 2
+velocityjitter 150 150 150
+velocitymultiplier 0.2
+sizeincrease -100
+stretchfactor 1.3
+rotate -180 180 4000 -4000
+// fire
+effect spiderbot_minigun_muzzleflash
+count 6
+type spark
+color 0xff9c00 0xff8400
+tex 8 15
+size 5 7
+alpha 256 512 6280
+airfriction 12
+originjitter 2 2 2
+velocityjitter 200 200 200
+velocitymultiplier 0.2
+sizeincrease -10
+stretchfactor 0.8
+effect spiderbot_minigun_muzzleflash
+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
+
+effect spiderbot_minigun_impact
+countabsolute 1
+type static
+tex 65 65
+color 0xff9c00 0xf6ff00
+size 52 52
+alpha 50 100 1680
+sizeincrease -100
+stretchfactor 0.1
+rotate -180 180 4000 -4000
+effect spiderbot_minigun_impact
+count 7
+type spark
+color 0xff9c00 0xff8400
+tex 43 43
+size 5 9
+alpha 256 512 6280
+airfriction 10
+originjitter 2 2 2
+velocityjitter 250 250 150
+velocitymultiplier 0.2
+sizeincrease 100
+stretchfactor 1.2
+airfriction 6
+rotate -180 180 4000 -4000
+effect spiderbot_minigun_impact
+count 10
+type smoke
+color 0xd0d0a0 0xffffff
+tex 0 8
+size 10 20
+alpha 20 50 100
+sizeincrease 80
+velocityjitter 50 50 150
+velocitymultiplier 0.15
+gravity 1.1
+airfriction 6
+rotate -180 180 0 0
+// derbis
+effect spiderbot_minigun_impact
+notunderwater
+count 8
+type alphastatic
+tex 66 68
+color 0xffa35b 0xfff2be
+size 2 5
+alpha 644 756 1484
+gravity 1.1
+airfriction 0.4
+sizeincrease -10
+velocitymultiplier 0.1
+originjitter 16 16 16
+velocityjitter 124 124 224
+rotate -180 180 -1000 1000
+
+effect wakizashi_gun_impact
+count 3
+type spark
+color 0xff9c00 0xff8400
+tex 43 43
+size 5 7
+alpha 256 512 6280
+airfriction 10
+originjitter 2 2 2
+velocityjitter 150 150 150
+velocitymultiplier 0.2
+sizeincrease -100
+stretchfactor 1.3
+rotate -180 180 4000 -4000
+
+effect wakizashi_gun_muzzleflash
+count 6
+type spark
+color 0xff9c00 0xff8400
+tex 8 15
+size 5 7
+alpha 256 512 6280
+airfriction 12
+originjitter 2 2 2
+velocityjitter 200 200 200
+velocitymultiplier 0.2
+sizeincrease -10
+stretchfactor 0.8
+
+raptor_cannon_impact
+count 3
+type spark
+color 0xff9c00 0xff8400
+tex 43 43
+size 5 7
+alpha 256 512 6280
+airfriction 10
+originjitter 2 2 2
+velocityjitter 150 150 150
+velocitymultiplier 0.2
+sizeincrease -100
+stretchfactor 1.3
+rotate -180 180 4000 -4000
+
+raptor_cannon_muzzleflash
+count 6
+type spark
+color 0xff9c00 0xff8400
+tex 8 15
+size 5 7
+alpha 256 512 6280
+airfriction 12
+originjitter 2 2 2
+velocityjitter 200 200 200
+velocitymultiplier 0.2
+sizeincrease -10
+stretchfactor 0.8
void CSQC_Init(void)
{
prvm_language = cvar_string("prvm_language");
-
+
#ifdef USE_FTE
#pragma target ID
__engine_check = checkextension("DP_SV_WRITEPICTURE");
weapon_accuracy[w] = -1;
return;
}
-
+
for(w = 0, f = 1; w <= WEP_LAST - WEP_FIRST; ++w, f *= 2)
{
if(sf & f)
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;
default:
error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
break;
-#define spider_rocket_icon "gfx/vehicles/rocket_ico.tga"
-#define spider_rocket_targ "gfx/vehicles/target.tga"
-#define SPIDER_CROSS "textures/spiderbot/cross.tga"
-#define rkt_size 32
-#define rld_size_x 256
-#define rld_size_y 16
-
-void CSQC_WAKIZASHI_HUD();
-
entity porto;
vector polyline[16];
float trace_dphitcontents;
{
float contentalpha_temp, incontent, liquidalpha, contentfadetime;
vector liquidcolor;
-
+
switch(pointcontents(view_origin))
{
case CONTENT_WATER:
liquidcolor = stov(autocvar_hud_contents_water_color);
incontent = 1;
break;
-
+
case CONTENT_LAVA:
liquidalpha = autocvar_hud_contents_lava_alpha;
liquidcolor = stov(autocvar_hud_contents_lava_color);
incontent = 1;
- break;
-
+ break;
+
case CONTENT_SLIME:
liquidalpha = autocvar_hud_contents_slime_alpha;
liquidcolor = stov(autocvar_hud_contents_slime_color);
incontent = 1;
break;
-
+
default:
liquidalpha = 0;
liquidcolor = '0 0 0';
incontent = 0;
break;
}
-
+
if(incontent) // fade in/out at different speeds so you can do e.g. instant fade when entering water and slow when leaving it.
{ // also lets delcare previous values for blending properties, this way it isn't reset until after you have entered a different content
contentfadetime = autocvar_hud_contents_fadeintime;
}
else
contentfadetime = autocvar_hud_contents_fadeouttime;
-
+
contentalpha_temp = bound(0, drawframetime / max(0.0001, contentfadetime), 1);
contentavgalpha = contentavgalpha * (1 - contentalpha_temp) + incontent * contentalpha_temp;
-
+
if(contentavgalpha)
drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL);
}
-
+
if(autocvar_hud_damage)
{
float myhealth_flash_temp;
else if(autocvar_crosshair_color_by_health)
{
local float x = getstati(STAT_HEALTH);
-
+
//x = red
//y = green
//z = blue
-
+
wcross_color_z = 0;
-
+
if(x > 200)
{
wcross_color_x = 0;
{
wcross_color_x = 1;
wcross_color_y = 1;
- wcross_color_z = 0.2 + (x-50)*0.02 * 0.8;
+ wcross_color_z = 0.2 + (x-50)*0.02 * 0.8;
}
else if(x > 20)
{
wcross_scale += sin(pickup_crosshair_size) * autocvar_crosshair_pickup;
}
-
+
vector hitindication_color;
if(autocvar_crosshair_hitindication)
{
float ring_value, ring_scale, ring_alpha, ring_inner_value, ring_inner_alpha;
string ring_image, ring_inner_image;
vector ring_rgb, ring_inner_rgb;
-
+
ring_scale = autocvar_crosshair_ring_size;
float weapon_clipload, weapon_clipsize;
if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
nex_charge_movingavg = nex_charge;
-
+
// handle the values
if (activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex
{
- if (nex_chargepool || use_nex_chargepool) {
- use_nex_chargepool = 1;
+ if (nex_chargepool || use_nex_chargepool) {
+ use_nex_chargepool = 1;
ring_inner_value = nex_chargepool;
- } else {
+ } else {
nex_charge_movingavg = (1 - autocvar_crosshair_ring_nex_currentcharge_movingavg_rate) * nex_charge_movingavg + autocvar_crosshair_ring_nex_currentcharge_movingavg_rate * nex_charge;
- ring_inner_value = bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1);
+ ring_inner_value = bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1);
}
-
+
ring_inner_alpha = wcross_alpha * autocvar_crosshair_ring_nex_inner_alpha;
ring_inner_rgb = eX * autocvar_crosshair_ring_nex_inner_color_red + eY * autocvar_crosshair_ring_nex_inner_color_green + eZ * autocvar_crosshair_ring_nex_inner_color_blue;
ring_inner_image = "gfx/crosshair_ring_inner.tga";
-
+
// draw the outer ring to show the current charge of the weapon
ring_value = nex_charge;
ring_alpha = wcross_alpha * autocvar_crosshair_ring_nex_alpha;
ring_rgb = wcross_color;
ring_image = "gfx/crosshair_ring_nexgun.tga";
}
- else if (activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer)
+ else if (activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer)
{
ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
ring_alpha = wcross_alpha * autocvar_crosshair_ring_minelayer_alpha;
ring_image = "gfx/crosshair_ring.tga";
}
- if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring
+ if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring
{
// if the main ring is already used by another weapon, instead use the inner one for ammo.
// inner ring is secondary anyway and doesn't matter as much as main ring, so overriding it is no issue.
ring_scale = autocvar_crosshair_ring_reload_size;
ring_alpha = autocvar_crosshair_ring_reload_alpha;
ring_rgb = wcross_color;
-
+
// Note: This is to stop Taoki from complaining that the image doesn't match all potential balances.
// if a new image for another weapon is added, add the code (and its respective file/value) here
if ((activeweapon == WEP_SNIPERRIFLE) && (weapon_clipsize == 80))
R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h);
}
-#define spider_h "gfx/vehicles/hud_bg.tga"
-#define spider_b "gfx/vehicles/sbot.tga"
-#define spider_r "gfx/vehicles/sbot_rpods.tga"
-#define spider_g "gfx/vehicles/sbot_mguns.tga"
-#define spider_s "gfx/vehicles/shiled.tga"
-#define spider_a1 "gfx/hud/sb_rocket.tga"
-#define spider_a2 "gfx/sb_bullets.tga"
-
-void CSQC_SPIDER_HUD()
-{
- float rockets, reload, heat, hp, shield;
- vector picsize, hudloc;
-
- // Fetch health & ammo stats
- hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
- shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
- heat = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 2);
- rockets = getstati(STAT_VEHICLESTAT_AMMO2);
- reload = min(getstatf(STAT_VEHICLESTAT_RELOAD2), 1);
-
- // Draw the crosshairs
- 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_NORMAL);
-
- 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(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '136 102 0', strcat(ftos(100 - rint(heat * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
-
- picsize = drawgetimagesize(spider_a1) * 0.85;
- if(rockets == 9)
- {
- drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'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 - rockets), "/8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
- }
-
- picsize = drawgetimagesize(spider_b) * 0.5;
- hudloc_y = 10.5;
- hudloc_x = 10.5;
-
- drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
- drawpic(hudloc, spider_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
- drawpic(hudloc, spider_r, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL);
- drawpic(hudloc, spider_g, picsize, '1 1 1' * (1 - heat) + '1 0 0' * heat, 1, DRAWFLAG_NORMAL);
-
-
- /*
- // Draw health bar
- p = '0.5 0 0' * (vid_conwidth - (rkt_size * 8));
- p = p + '0 1 0' * vid_conheight - '0 32 0';
- //pp = ('0 1 0' * hp) + ('1 0 0' * (1-hp));
- drawfill(p, '256 0 0' * shield + '0 8 0' , '0.5 0.5 1', 0.75, DRAWFLAG_NORMAL);
- p_y += 8;
- drawfill(p, '256 0 0' * hp + '0 8 0' , '0 1 0', 0.75, DRAWFLAG_NORMAL);
- p_x += 256 * hp;
- drawfill(p, '256 0 0' * (1-hp) + '0 8 0' , '0 0 0', 0.75, DRAWFLAG_NORMAL);
-
- // Draw minigun heat indicator
- p = '0.5 0 0' * (vid_conwidth - 256);
- p = p + '0 1 0' * vid_conheight - '0 34 0';
- drawfill(p, '256 0 0' * (1-heat) + '0 2 0' ,'0 0 1', 0.5, DRAWFLAG_NORMAL);
- p_x += 256 * (1-heat);
- drawfill(p, '256 0 0' * heat + '0 2 0' , '1 0 0', 0.5, DRAWFLAG_NORMAL);
-
-
- // Draw rocket icons for loaded/empty tubes.
- pp = '0.5 0 0' * (vid_conwidth - (rkt_size * 8));
- pp += '0 1 0' * vid_conheight - '0 64 0';
- for(i = 0; i < 8; ++i)
- {
- p = pp + '1 0 0' * (rkt_size * i);
- if(rockets == 8)
- {
- if(floor(reload * 8) == i)
- {
- drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '1 0 0' + '0 1 0' * ((reload*8)-i), 0.75 , DRAWFLAG_NORMAL);
- }
- else if(i < reload * 8)
- drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '1 1 0', 0.75 , DRAWFLAG_NORMAL);
- else
- drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '0.5 0.5 0.5', 0.75, DRAWFLAG_NORMAL);
- }
- else
- {
- if(i < rockets)
- drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '0 0 0', 0.25, DRAWFLAG_NORMAL);
- else
- drawpic(p, spider_rocket_icon, '1 1 0' * rkt_size, '0 1 0' * reload, 0.75, DRAWFLAG_NORMAL);
- }
- }
- */
-
- if (scoreboard_showscores)
- {
- HUD_DrawScoreboard();
- HUD_DrawCenterPrint();
- }
-
-}
-
-#define raptor_h "gfx/vehicles/hud_bg.tga"
-#define raptor_b "gfx/vehicles/raptor.tga"
-#define raptor_g1 "gfx/vehicles/raptor_guns.tga"
-#define raptor_g2 "gfx/vehicles/raptor_bombs.tga"
-#define raptor_s "gfx/vehicles/shiled.tga"
-
-void CSQC_RAPTOR_HUD()
-{
- float reload, hp, shield, energy;
- vector picsize, hudloc;
-
- // Fetch health & ammo stats
- hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
- shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
- reload = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
- energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1);
-
- // Draw the crosshairs
- 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_NORMAL);
-
- hudloc_y = 4;
- hudloc_x = 4;
-
- picsize = drawgetimagesize(raptor_h) * 0.5;
- drawpic(hudloc, raptor_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(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL);
-
-
- picsize = drawgetimagesize(spider_a1) * 0.85;
- if(reload == 1)
- {
- drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL);
- }
- else
- {
- drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL);
- }
-
- picsize = drawgetimagesize(raptor_b) * 0.5;
- hudloc_y = 10.5;
- hudloc_x = 10.5;
-
- drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
- drawpic(hudloc, raptor_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
- 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 (scoreboard_showscores)
- {
- HUD_DrawScoreboard();
- HUD_DrawCenterPrint();
- }
-
-}
-
-#define waki_h "gfx/vehicles/hud_bg.tga"
-#define waki_b "gfx/vehicles/waki.tga"
-#define waki_e "gfx/vehicles/waki_e.tga"
-#define waki_g "gfx/vehicles/waki_guns.tga"
-#define waki_r "gfx/vehicles/waki_rockets.tga"
-#define waki_s "gfx/vehicles/shiled.tga"
-
-#define waki_a1 "gfx/hud/sb_rocket.tga"
-#define waki_a2 "gfx/sb_cells.tga"
-
-void CSQC_WAKIZASHI_HUD()
-{
- // 0--1 floats. 1 = 100%, 0.6 = 50%.
- float health, shield, energy, rockets;
- vector picsize, hudloc;
-
- 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_NORMAL);
-
-/*
-const float STAT_VEHICLESTAT_HEALTH = 60;
-const float STAT_VEHICLESTAT_SHIELD = 61;
-const float STAT_VEHICLESTAT_ENERGY = 62;
-const float STAT_VEHICLESTAT_AMMO1 = 63;
-const float STAT_VEHICLESTAT_RELAOD1 = 64;
-const float STAT_VEHICLESTAT_AMMO2 = 65;
-const float STAT_VEHICLESTAT_RELOAD2 = 66;
-*/
- health = min(getstatf(STAT_VEHICLESTAT_HEALTH), 1);
- shield = min(getstatf(STAT_VEHICLESTAT_SHIELD), 1);
- energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1);
- rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
-
- hudloc_y = 4;
- hudloc_x = 4;
-
- picsize = drawgetimagesize(waki_h) * 0.5;
- drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
-
- picsize = drawgetimagesize(waki_a2) * 0.7;
- drawpic(hudloc + '116 92 0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
-
-
- drawstring(hudloc + '145 19 0', strcat(ftos(rint(health * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
-
- drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL);
-
- picsize = drawgetimagesize(waki_a1) * 0.75;
- if(rockets == 1)
- {
- drawpic(hudloc + '140 55 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
- drawpic(hudloc + '144 59 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
- }
- else
- {
- drawpic(hudloc + '140 55 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
- drawpic(hudloc + '144 59 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
- drawstring(hudloc + '165 69 0', strcat(ftos(rint(rockets * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
- }
-
- picsize = drawgetimagesize(waki_b) * 0.5;
- hudloc_y = 10.5;
- hudloc_x = 10.5;
-
- 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' * 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();
- HUD_DrawCenterPrint();
- }
-
-}
-
void CSQC_common_hud(void)
{
HUD_DrawScoreboard();
if (scoreboard_active) // scoreboard/accuracy
- {
+ {
HUD_Reset();
// HUD_DrawScoreboard takes care of centerprint_start
}
{
entity casing;
- casing = RubbleNew("casing");
+ casing = RubbleNew("casing");
casing.state = ReadByte();
casing.silent = (casing.state & 0x80);
casing.state = (casing.state & 0x7F);
tuba.qc
target_music.qc
-//vehicles/spiderbot.qc
+vehicles/vehicles.qc
Main.qc
View.qc
interpolate.qc
--- /dev/null
+#define spider_rocket_icon "gfx/vehicles/rocket_ico.tga"
+#define spider_rocket_targ "gfx/vehicles/target.tga"
+//#define SPIDER_CROSS "textures/spiderbot/cross.tga"
+#define SPIDER_CROSS "gfx/vehicles/sbot-xhair.tga"
+#define SPIDER_CROSS2 "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"
+#define spider_g "gfx/vehicles/sbot_mguns.tga"
+#define spider_s "gfx/vehicles/shiled.tga"
+#define spider_a1 "gfx/vehicles/sb_rocket.tga"
+#define spider_a2 "gfx/vehicles/sb_bullets.tga"
+
+#define raptor_h "gfx/vehicles/hud_bg.tga"
+#define raptor_s "gfx/vehicles/shiled.tga"
+
+#define raptor_b "gfx/vehicles/raptor.tga"
+#define raptor_g1 "gfx/vehicles/raptor_guns.tga"
+#define raptor_g2 "gfx/vehicles/raptor_bombs.tga"
+#define raptor_d "gfx/vehicles/dropcross.tga"
+#define raptor_c "gfx/vehicles/raptor_cross.tga"
+
+entity dropmark;
+vector lastpos;
+
+
+void CSQC_WAKIZASHI_HUD();
+void CSQC_SPIDER_HUD();
+void CSQC_RAPTOR_HUD();
+
+entity AuxiliaryXhair;
+void AuxiliaryXhair_Draw2D()
+{
+ vector loc, psize;
+
+ psize = 0.5 * drawgetimagesize(SPIDER_CROSS2);
+ loc = project_3d_to_2d(self.origin) - 0.5 * psize;
+ loc_z = 0;
+ psize_z = 0;
+ drawpic(loc, SPIDER_CROSS2, psize, '0 1 1', 1, DRAWFLAG_ADDITIVE);
+
+}
+
+void Ent_AuxiliaryXhair(float isNew)
+{
+ entity ax;
+
+ if(isNew)
+ {
+ AuxiliaryXhair = spawn();
+ AuxiliaryXhair.draw2d = AuxiliaryXhair_Draw2D;
+ setmodel(AuxiliaryXhair, "null");
+ setsize(AuxiliaryXhair, '0 0 -1', '0 0 -1');
+ }
+
+ AuxiliaryXhair.origin_x = ReadCoord();
+ AuxiliaryXhair.origin_y = ReadCoord();
+ AuxiliaryXhair.origin_z = ReadCoord();
+ AuxiliaryXhair.drawmask = MASK_NORMAL;
+ //AuxiliaryXhair.solid = SOLID_NOT;
+}
+
+void Vehicles_Precache()
+{
+ //precache_model("models/ax_shell.mdl");
+ //precache_sound("weapons/brass1.wav");
+}
+
+
+void CSQC_SPIDER_HUD()
+{
+ float rockets, reload, heat, hp, shield;
+ vector picsize, hudloc;
+
+ // Fetch health & ammo stats
+ hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
+ shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
+ heat = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 2);
+ rockets = getstati(STAT_VEHICLESTAT_AMMO2);
+ reload = min(getstatf(STAT_VEHICLESTAT_RELOAD2), 1);
+
+
+ hudloc_y = 4;
+ hudloc_x = 4;
+ drawfill('130 28 0', ('115 0 0' * hp) + '0 10 0', hp * '0 1 0' + (1 - hp) * '1 0 0', 0.5, DRAWFLAG_NORMAL);
+ 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(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '136 102 0', strcat(ftos(100 - rint(heat * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
+
+ picsize = drawgetimagesize(spider_a1) * 0.85;
+ if(rockets == 9)
+ {
+ drawpic(hudloc + '132 54 0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'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 - rockets), "/8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
+ }
+
+ picsize = drawgetimagesize(spider_b) * 0.5;
+ hudloc_y = 10.5;
+ hudloc_x = 10.5;
+
+ drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
+ drawpic(hudloc, spider_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
+ drawpic(hudloc, spider_r, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL);
+ drawpic(hudloc, spider_g, picsize, '1 1 1' * (1 - heat) + '1 0 0' * heat, 1, DRAWFLAG_NORMAL);
+
+
+ if (scoreboard_showscores)
+ {
+ HUD_DrawScoreboard();
+ HUD_DrawCenterPrint();
+ }
+ else
+ {
+
+ /*
+ float movedt, vel;
+ movedt = time - self.move_time;
+ self.move_time = time;
+ vel = (view_origin - lastpos) * (1 / movedt);
+ lastpos = view_origin;
+ dprint("vel: ", ftos(vel), " angles: ", vtos(self.angles), "\n");
+ */
+
+ /*
+ dprint("aim1: ", vtos(aim1), " aim2: ", vtos(aim2), "\n");
+ aim2_x *= -1;
+ makevectors(aim2);
+ te_lightning1(self, view_origin, view_origin + v_forward * MAX_SHOT_DISTANCE);
+ traceline(view_origin, view_origin + v_forward * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
+ aim2 = trace_endpos;
+
+
+ aim1 = aim1 + view_origin;
+
+ // Draw the crosshairs
+ aim1 = project_3d_to_2d(aim1);
+ aim2 = project_3d_to_2d(aim2);
+
+ picsize = 0.5 * drawgetimagesize(SPIDER_CROSS2);
+ aim2 = aim2 - 0.5 * picsize;
+ aim2_z = 0;
+ picsize_z = 0;
+ drawpic(aim2, SPIDER_CROSS2, picsize, '0 1 1', 1, DRAWFLAG_ADDITIVE);
+
+ picsize = 0.5 * drawgetimagesize(SPIDER_CROSS2);
+ aim1 = aim1 - 0.5 * picsize;
+ aim1_z = 0;
+ picsize_z = 0;
+ drawpic(aim1, SPIDER_CROSS2, picsize, '1 0 0', 1, DRAWFLAG_ADDITIVE);
+
+ */
+ 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_RAPTOR_HUD()
+{
+ if(autocvar_r_letterbox)
+ return;
+
+ float reload, hp, shield, energy;
+ vector picsize, hudloc, vel;
+ float movedt;
+ vector where;
+
+ if(!dropmark)
+ {
+ dropmark = spawn();
+ dropmark.owner = self;
+ }
+
+ movedt = time - dropmark.move_time;
+ dropmark.move_time = time;
+ vel = (view_origin - lastpos) * (1 / movedt);
+ lastpos = view_origin;
+
+ // Fetch health & ammo stats
+ hp = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
+ shield = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
+ reload = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
+ 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);
+
+ hudloc_y = 4;
+ hudloc_x = 4;
+
+ picsize = drawgetimagesize(raptor_h) * 0.5;
+ drawpic(hudloc, raptor_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(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL);
+
+
+ picsize = drawgetimagesize(spider_a1) * 0.85;
+ if(reload == 1)
+ {
+ drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL);
+ }
+ else
+ {
+ drawpic(hudloc + '132 54 0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL);
+ }
+
+ picsize = drawgetimagesize(raptor_b) * 0.5;
+ hudloc_y = 10.5;
+ hudloc_x = 10.5;
+
+ drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
+ drawpic(hudloc, raptor_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
+ 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(reload == 1)
+ {
+ where = dropmark.origin;
+ setorigin(dropmark, view_origin);
+ dropmark.velocity = vel;
+ tracetoss(dropmark, self);
+
+ // Blend old with new predicted impact to smooth out jumpyness
+ where = project_3d_to_2d(trace_endpos * 0.2 + where * 0.8);
+
+ setorigin(dropmark, trace_endpos);
+ picsize = drawgetimagesize(raptor_d) * 0.2;
+
+ if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
+ {
+ where_x -= picsize_x * 0.5;
+ where_y -= picsize_y * 0.5;
+ where_z = 0;
+ drawpic(where, raptor_d, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
+ }
+ dropmark.cnt = time + 2;
+ }
+ else
+ {
+ if(dropmark.cnt > time)
+ {
+ where = project_3d_to_2d(dropmark.origin);
+ picsize = drawgetimagesize(raptor_d) * 0.25;
+
+ if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
+ {
+ where_x -= picsize_x * 0.5;
+ where_y -= picsize_y * 0.5;
+ where_z = 0;
+ drawpic(where, raptor_d, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
+ }
+ }
+ }
+
+ if (scoreboard_showscores)
+ {
+ HUD_DrawScoreboard();
+ HUD_DrawCenterPrint();
+ }
+
+}
+
+#define waki_h "gfx/vehicles/hud_bg.tga"
+#define waki_b "gfx/vehicles/waki.tga"
+#define waki_e "gfx/vehicles/waki_e.tga"
+#define waki_g "gfx/vehicles/waki_guns.tga"
+#define waki_r "gfx/vehicles/waki_rockets.tga"
+#define waki_s "gfx/vehicles/shiled.tga"
+
+#define waki_a1 "gfx/vehicles/sb_rocket.tga"
+#define waki_a2 "gfx/vehicles/sb_cells.tga"
+
+void CSQC_WAKIZASHI_HUD()
+{
+ // 0--1 floats. 1 = 100%, 0.6 = 50%.
+ float health, shield, energy, rockets;
+ vector picsize, hudloc;
+
+ 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_NORMAL);
+
+/*
+const float STAT_VEHICLESTAT_HEALTH = 60;
+const float STAT_VEHICLESTAT_SHIELD = 61;
+const float STAT_VEHICLESTAT_ENERGY = 62;
+const float STAT_VEHICLESTAT_AMMO1 = 63;
+const float STAT_VEHICLESTAT_RELAOD1 = 64;
+const float STAT_VEHICLESTAT_AMMO2 = 65;
+const float STAT_VEHICLESTAT_RELOAD2 = 66;
+*/
+ health = min(getstatf(STAT_VEHICLESTAT_HEALTH), 1);
+ shield = min(getstatf(STAT_VEHICLESTAT_SHIELD), 1);
+ energy = min(getstatf(STAT_VEHICLESTAT_ENERGY), 1);
+ rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
+
+ hudloc_y = 4;
+ hudloc_x = 4;
+
+ picsize = drawgetimagesize(waki_h) * 0.5;
+ drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+
+ picsize = drawgetimagesize(waki_a2) * 0.7;
+ drawpic(hudloc + '116 92 0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+
+
+ drawstring(hudloc + '145 19 0', strcat(ftos(rint(health * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '175 34 0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
+
+ drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL);
+
+ picsize = drawgetimagesize(waki_a1) * 0.75;
+ if(rockets == 1)
+ {
+ drawpic(hudloc + '140 55 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+ drawpic(hudloc + '144 59 0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
+ }
+ else
+ {
+ drawpic(hudloc + '140 55 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
+ drawpic(hudloc + '144 59 0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
+ drawstring(hudloc + '165 69 0', strcat(ftos(rint(rockets * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
+ }
+
+ picsize = drawgetimagesize(waki_b) * 0.5;
+ hudloc_y = 10.5;
+ hudloc_x = 10.5;
+
+ 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' * 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();
+ HUD_DrawCenterPrint();
+ }
+
+}
const float ENT_CLIENT_ACCURACY = 30;
const float ENT_CLIENT_TURRET = 40;
+const float ENT_CLIENT_AUXILIARYXHAIR = 50;
const float SPRITERULE_DEFAULT = 0;
const float SPRITERULE_TEAMPLAY = 1;
<CompileFile command="" />
<Clean command="" />
<DistClean command="" />
+ <AskRebuildNeeded command="$make -q -f $makefile $target" />
+ <SilentBuild command="$make -s -f $makefile $target" />
</MakeCommands>
</Target>
<Target title="Release">
<CompileFile command="" />
<Clean command="" />
<DistClean command="" />
+ <AskRebuildNeeded command="$make -q -f $makefile $target" />
+ <SilentBuild command="$make -s -f $makefile $target" />
</MakeCommands>
</Target>
</Build>
<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" />
<Unit filename="client\waypointsprites.qh" />
float autocvar_g_turrets_unit_walker_std_rockets_range;
float autocvar_g_turrets_unit_walker_std_rockets_range_min;
float autocvar_g_use_ammunition;
-float autocvar_g_vehicle_racer_afterburn_cost;
-float autocvar_g_vehicle_racer_anglestabilizer;
-float autocvar_g_vehicle_racer_downforce;
-float autocvar_g_vehicle_racer_energy;
-float autocvar_g_vehicle_racer_energy_usepause;
-float autocvar_g_vehicle_racer_health;
-float autocvar_g_vehicle_racer_laser_cost;
-float autocvar_g_vehicle_racer_laser_damage;
-float autocvar_g_vehicle_racer_laser_radius;
-float autocvar_g_vehicle_racer_laser_refire;
-float autocvar_g_vehicle_racer_laser_speed;
-float autocvar_g_vehicle_racer_pitchspeed;
-float autocvar_g_vehicle_racer_power_air;
-float autocvar_g_vehicle_racer_power_min;
-float autocvar_g_vehicle_racer_power_solid;
-float autocvar_g_vehicle_racer_reload;
-float autocvar_g_vehicle_racer_respawntime;
-float autocvar_g_vehicle_racer_rocket_accel;
-float autocvar_g_vehicle_racer_rocket_damage;
-float autocvar_g_vehicle_racer_rocket_radius;
-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_shield;
-float autocvar_g_vehicle_racer_speed_afterburn;
-float autocvar_g_vehicle_racer_speed_forward;
-float autocvar_g_vehicle_racer_speed_strafe;
-float autocvar_g_vehicle_racer_springlength;
-float autocvar_g_vehicle_racer_turnroll;
-float autocvar_g_vehicle_racer_turnspeed;
-float autocvar_g_vehicle_raptor_reload;
-float autocvar_g_vehicle_spiderbot_crush_dmg;
-float autocvar_g_vehicle_spiderbot_crush_force;
-float autocvar_g_vehicle_spiderbot_head_pitchlimit_down;
-float autocvar_g_vehicle_spiderbot_head_pitchlimit_up;
-float autocvar_g_vehicle_spiderbot_head_pitchspeed;
-float autocvar_g_vehicle_spiderbot_head_turnlimit;
-float autocvar_g_vehicle_spiderbot_head_turnspeed;
-float autocvar_g_vehicle_spiderbot_health;
-float autocvar_g_vehicle_spiderbot_minigun_cooldown;
-float autocvar_g_vehicle_spiderbot_minigun_damage;
-float autocvar_g_vehicle_spiderbot_minigun_heat;
-float autocvar_g_vehicle_spiderbot_minigun_refire;
-float autocvar_g_vehicle_spiderbot_minigun_spread;
-float autocvar_g_vehicle_spiderbot_movement_inertia;
-float autocvar_g_vehicle_spiderbot_respawntime;
-float autocvar_g_vehicle_spiderbot_rocket_damage;
-float autocvar_g_vehicle_spiderbot_rocket_edgedamage;
-float autocvar_g_vehicle_spiderbot_rocket_force;
-float autocvar_g_vehicle_spiderbot_rocket_health;
-float autocvar_g_vehicle_spiderbot_rocket_lifetime;
-float autocvar_g_vehicle_spiderbot_rocket_noise;
-float autocvar_g_vehicle_spiderbot_rocket_radius;
-float autocvar_g_vehicle_spiderbot_rocket_refire;
-float autocvar_g_vehicle_spiderbot_rocket_reload;
-float autocvar_g_vehicle_spiderbot_rocket_speed;
-float autocvar_g_vehicle_spiderbot_rocket_turnrate;
-float autocvar_g_vehicle_spiderbot_shield;
-float autocvar_g_vehicle_spiderbot_speed_stop;
-float autocvar_g_vehicle_spiderbot_speed_strafe;
-float autocvar_g_vehicle_spiderbot_speed_walk;
-float autocvar_g_vehicle_spiderbot_turnspeed;
float autocvar_g_waypointeditor;
float autocvar_g_waypoints_for_items;
float autocvar_g_waypointsprite_deadlifetime;
-#define RACER_MIN '-80 -80 -40'
-#define RACER_MAX '80 80 40'
+#define RACER_MIN '-120 -120 -40'
+#define RACER_MAX '120 120 40'
#define RACER_TICRATE 0.05
void racer_exit(float eject);
void racer_enter();
-//void racer_think();
-float racer_power_air;
-float racer_power_solid;
-float racer_power_min;
-float racer_anglestabilizer;
-float racer_springlength;
+// Auto cvars
+float autocvar_g_vehicle_racer_speed_afterburn;
+float autocvar_g_vehicle_racer_afterburn_cost;
-float racer_healthmax;
-float racer_shieldmax;
-float racer_energymax;
+float autocvar_g_vehicle_racer_anglestabilizer;
+float autocvar_g_vehicle_racer_downforce;
-float racer_pitchspeed;
-float racer_turnspeed;
-float racer_turnroll;
-float racer_speed_forward;
-float racer_speed_strafe;
+float autocvar_g_vehicle_racer_speed_forward;
+float autocvar_g_vehicle_racer_speed_strafe;
+float autocvar_g_vehicle_racer_springlength;
+float autocvar_g_vehicle_racer_upforcedamper;
-float racer_afterburn_cost;
+float autocvar_g_vehicle_racer_hovertype;
+float autocvar_g_vehicle_racer_hoverpower;
-float jetfromtag_power;
-float jetfromtag_normpower;
-vector jetfromtag_origin;
-float jetfromtag_groundcontact;
+float autocvar_g_vehicle_racer_turnroll;
+float autocvar_g_vehicle_racer_turnspeed;
+float autocvar_g_vehicle_racer_pitchspeed;
-void racer_loadsettings()
-{
- racer_power_min = autocvar_g_vehicle_racer_power_min * 0.25;
- racer_power_air = autocvar_g_vehicle_racer_power_air * 0.25;
- racer_power_solid = autocvar_g_vehicle_racer_power_solid * 0.25;
-
- racer_springlength = autocvar_g_vehicle_racer_springlength;
- racer_anglestabilizer = autocvar_g_vehicle_racer_anglestabilizer;
- racer_pitchspeed = autocvar_g_vehicle_racer_pitchspeed;
- racer_turnspeed = autocvar_g_vehicle_racer_turnspeed;
- racer_turnroll = autocvar_g_vehicle_racer_turnroll;
- racer_speed_forward = autocvar_g_vehicle_racer_speed_forward;
- racer_speed_strafe = autocvar_g_vehicle_racer_speed_strafe;
+float autocvar_g_vehicle_racer_energy;
+float autocvar_g_vehicle_racer_energy_regen;
+float autocvar_g_vehicle_racer_energy_regen_pause;
- racer_afterburn_cost = autocvar_g_vehicle_racer_afterburn_cost;
+float autocvar_g_vehicle_racer_health;
+float autocvar_g_vehicle_racer_health_regen;
+float autocvar_g_vehicle_racer_health_regen_pause;
- racer_healthmax = autocvar_g_vehicle_racer_health;
- racer_shieldmax = autocvar_g_vehicle_racer_shield;
- racer_energymax = autocvar_g_vehicle_racer_energy;
+float autocvar_g_vehicle_racer_shield;
+float autocvar_g_vehicle_racer_shield_regen;
+float autocvar_g_vehicle_racer_shield_regen_pause;
-}
+float autocvar_g_vehicle_racer_laser_cost;
+float autocvar_g_vehicle_racer_laser_damage;
+float autocvar_g_vehicle_racer_laser_radius;
+float autocvar_g_vehicle_racer_laser_refire;
+float autocvar_g_vehicle_racer_laser_speed;
-vector racer_jetfromtag(string tagname)
-{
- vector force_dir;
- float air_frac, solid_frac, air_pwr, solid_pwr;
+float autocvar_g_vehicle_racer_rocket_accel;
+float autocvar_g_vehicle_racer_rocket_damage;
+float autocvar_g_vehicle_racer_rocket_radius;
+float autocvar_g_vehicle_racer_rocket_refire;
+float autocvar_g_vehicle_racer_rocket_speed;
+float autocvar_g_vehicle_racer_rocket_turnrate;
- jetfromtag_origin = gettaginfo(self,gettagindex(self,tagname));
- v_forward = normalize(v_forward) * -1;
+float autocvar_g_vehicle_racer_respawntime;
+float autocvar_g_vehicle_racer_collision_multiplier;
- force_dir = jetfromtag_origin - (v_forward * racer_springlength);
- traceline(jetfromtag_origin, force_dir, MOVE_NORMAL, self);
- //te_lightning1(world,jetfromtag_origin, force_dir);
+var vector racer_force_from_tag(string tag_name, float spring_length, float max_power);
- //trace_fraction *= trace_fraction;
+void racer_align4point()
+{
+ vector push_vector, v_add;
+ float fl_push, fr_push, bl_push, br_push;
- solid_frac = 1 - trace_fraction;
- air_frac = trace_fraction;
+ push_vector = racer_force_from_tag("tag_engine_fr", autocvar_g_vehicle_racer_springlength, autocvar_g_vehicle_racer_hoverpower);
+ fr_push = force_fromtag_normpower;
+ vehicles_sweap_collision(force_fromtag_origin, self.velocity, frametime, v_add, autocvar_g_vehicle_racer_collision_multiplier);
- if (trace_fraction != 1.0)
- jetfromtag_groundcontact = 1;
+ push_vector += racer_force_from_tag("tag_engine_fl", autocvar_g_vehicle_racer_springlength, autocvar_g_vehicle_racer_hoverpower);
+ fl_push = force_fromtag_normpower;
+ vehicles_sweap_collision(force_fromtag_origin, self.velocity, frametime, v_add, autocvar_g_vehicle_racer_collision_multiplier);
- solid_pwr = solid_frac * racer_power_solid;
- air_pwr = air_frac * racer_power_air;
+ push_vector += racer_force_from_tag("tag_engine_br", autocvar_g_vehicle_racer_springlength, autocvar_g_vehicle_racer_hoverpower);
+ br_push = force_fromtag_normpower;
+ vehicles_sweap_collision(force_fromtag_origin, self.velocity, frametime, v_add, autocvar_g_vehicle_racer_collision_multiplier);
- jetfromtag_power = solid_pwr + air_pwr;
- jetfromtag_normpower = jetfromtag_power / (racer_power_air + racer_power_solid);
+ push_vector += racer_force_from_tag("tag_engine_bl", autocvar_g_vehicle_racer_springlength, autocvar_g_vehicle_racer_hoverpower);
+ bl_push = force_fromtag_normpower;
+ vehicles_sweap_collision(force_fromtag_origin, self.velocity, frametime, v_add, autocvar_g_vehicle_racer_collision_multiplier);
- //te_lightning1(world,jetfromtag_origin,jetfromtag_origin + normalize(self.origin - force_dir) * max(jetfromtag_power, racer_power_min));
- //return normalize(self.origin - force_dir) * max(jetfromtag_power, racer_power_min);
- return v_forward * max(jetfromtag_power, racer_power_min);
-}
+ self.velocity += (push_vector * frametime);
-void racer_align4point()
-{
- vector push_vector;
- float fl_push, fr_push, bl_push, br_push;
+ // Anti ocilation
+ if(self.velocity_z > 0)
+ self.velocity_z *= autocvar_g_vehicle_racer_upforcedamper;
- jetfromtag_groundcontact = 0;
-
- push_vector = racer_jetfromtag("tag_engine_fr");
- fr_push = jetfromtag_normpower;
- traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
- if(trace_fraction != 1)
- self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
-
- push_vector += racer_jetfromtag("tag_engine_fl");
- fl_push = jetfromtag_normpower;
- traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
- if(trace_fraction != 1)
- self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
-
- push_vector += racer_jetfromtag("tag_engine_br");
- br_push = jetfromtag_normpower;
- traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
- if(trace_fraction != 1)
- self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
-
- push_vector += racer_jetfromtag("tag_engine_bl");
- bl_push = jetfromtag_normpower;
- traceline(jetfromtag_origin, jetfromtag_origin + self.velocity * frametime, MOVE_NORMAL,self);
- if(trace_fraction != 1)
- self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
-
- self.velocity = self.velocity + (push_vector * frametime);
+ self.velocity += v_add;
self.velocity_z -= autocvar_sv_gravity * frametime;
- push_vector_x = (fl_push - bl_push);
+
+
+ push_vector_x = (fl_push - bl_push);
push_vector_x += (fr_push - br_push);
push_vector_x *= 360;
//if (push_vector_z != 0)
if(self.angles_z > 0)
- self.angles_z = max(0, self.angles_z - (racer_anglestabilizer * frametime));
+ self.angles_z = max(0, self.angles_z - (autocvar_g_vehicle_racer_anglestabilizer * frametime));
else
- self.angles_z = min(0, self.angles_z + (racer_anglestabilizer * frametime));
+ self.angles_z = min(0, self.angles_z + (autocvar_g_vehicle_racer_anglestabilizer * frametime));
//else
self.angles_z += push_vector_z * frametime;
//if (push_vector_x != 0)
if(self.angles_x > 0)
- self.angles_x = max(0, self.angles_x - (racer_anglestabilizer * frametime));
+ self.angles_x = max(0, self.angles_x - (autocvar_g_vehicle_racer_anglestabilizer * frametime));
else
- self.angles_x = min(0, self.angles_x + (racer_anglestabilizer * frametime));
+ self.angles_x = min(0, self.angles_x + (autocvar_g_vehicle_racer_anglestabilizer * frametime));
//else
self.angles_x += push_vector_x * frametime;
}
-void racer_bolt_explode()
-{
- vector org2;
-
- org2 = findbetterlocation (self.origin, 8);
- pointparticles(particleeffectnum("laser_impact"), org2, trace_plane_normal * 1000, 1);
- RadiusDamage (self, self.realowner, autocvar_g_vehicle_racer_laser_damage, 0, autocvar_g_vehicle_racer_laser_radius, world, 150, DEATH_WAKIGUN, world);
- sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
-
- remove (self);
-}
-
void racer_rocket_explode()
{
- vector org2;
+ PROJECTILE_TOUCH;
+ if(other.owner == self.owner)
+ return;
- //if not(self.owner)
- // self.owner = self.realowner;
+ self.event_damage = SUB_Null;
sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- org2 = findbetterlocation (self.origin, 16);
- pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
+ pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
RadiusDamage (self, self.realowner ,autocvar_g_vehicle_racer_rocket_damage, 0, autocvar_g_vehicle_racer_rocket_radius, world, 150, DEATH_WAKIROCKET, world);
remove (self);
}
-void racer_rocket_touch()
+void racer_bolt_explode()
{
- if(other.owner == self.owner)
- return;
-
- PROJECTILE_TOUCH;
- /*
- if(pointcontents(self.origin) == CONTENT_SKY)
- {
- self.think = SUB_Remove;
- self.nextthink = time;
- return;
- }
- */
-
- racer_rocket_explode();
+ PROJECTILE_TOUCH;
+ pointparticles(particleeffectnum("wakizashi_gun_impact"), findbetterlocation (self.origin, 8), trace_plane_normal * 1000, 1);
+ RadiusDamage (self, self.realowner, autocvar_g_vehicle_racer_laser_damage, 0, autocvar_g_vehicle_racer_laser_radius, world, 150, DEATH_WAKIGUN, world);
+ sound (self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ remove (self);
}
void racer_fire_cannon(string tagname)
{
entity bolt;
+ vector v;
bolt = spawn();
- bolt.solid = SOLID_TRIGGER;
+ sound (self, CHAN_WEAPON, "weapons/lasergun_fire.wav", VOL_BASE, ATTN_NORM);
+
+ setorigin(bolt, gettaginfo(self, gettagindex(self, tagname)));
+ PROJECTILE_MAKETRIGGER(bolt);
+
bolt.movetype = MOVETYPE_FLYMISSILE;
bolt.flags = FL_PROJECTILE | FL_NOTARGET;
bolt.owner = self;
bolt.touch = racer_bolt_explode;
bolt.think = racer_bolt_explode;
bolt.nextthink = time + 9;
+
bolt.bot_dodge = TRUE;
bolt.bot_dodgerating = autocvar_g_vehicle_racer_laser_damage;
- setorigin(bolt, gettaginfo(self,gettagindex(self,tagname)));
- vector v;
- // FIXME this uses prydon cursor
- v = normalize(self.owner.cursor_trace_endpos - bolt.origin);
+ // Fix z-aim (for chase mode)
+ crosshair_trace(self.owner);
+ v = normalize(trace_endpos - bolt.origin);
v_forward_z = v_z * 0.5;
bolt.velocity = v_forward * autocvar_g_vehicle_racer_laser_speed;
+ pointparticles(particleeffectnum("wakizashi_gun_muzzleflash"), bolt.origin, bolt.velocity, 1);
+
CSQCProjectile(bolt, TRUE, PROJECTILE_LASER, TRUE);
}
void racer_rocket_groundhugger()
{
- vector newdir,olddir;
- float oldspeed, newspeed;
-
- self.nextthink = time;
-
- if ((self.owner.deadflag != DEAD_NO) || (self.cnt < time))
- {
- racer_rocket_explode();
- return;
- }
-
- if not (self.realowner.vehicle)
- {
- UpdateCSQCProjectile(self);
- return;
- }
-
- olddir = normalize(self.velocity);
- oldspeed = vlen(self.velocity);
-
- tracebox(self.origin, self.mins, self.maxs, self.origin + olddir * 512, MOVE_WORLDONLY,self);
- if(trace_fraction >= 0.35)
- {
- traceline(trace_endpos, trace_endpos - '0 0 512', MOVE_NORMAL, self);
- if(trace_fraction != 1.0)
- newdir = trace_endpos + '0 0 32';
-
- newdir = normalize(newdir - self.origin);
- }
-
- newspeed = oldspeed + self.lip;
- self.velocity = normalize(olddir + newdir * self.wait) * newspeed;
-
- UpdateCSQCProjectile(self);
-}
-
-void racer_rocket_think()
-{
- vector newdir,olddir, eorg, edir;
- float oldspeed, newspeed, dist;
+ vector olddir;
self.nextthink = time;
}
olddir = normalize(self.velocity);
- oldspeed = vlen(self.velocity);
- fixedmakevectors(olddir);
- eorg = 0.5 * (self.enemy.absmin + self.enemy.absmax);
- edir = normalize(eorg - self.origin);
- dist = vlen(self.origin - self.enemy.origin);
-
- if(dist > 512)
+ tracebox(self.origin, self.mins, self.maxs, self.origin + olddir * 64, MOVE_WORLDONLY,self);
+ if(trace_fraction >= 0.5)
{
- vector ddir;
- float p;
- p = dist / self.delay;
- p = max(0.05, p * 0.25);
- ddir = steerlib_traceavoid(p, oldspeed * 0.25);
- edir += ddir * 0.95;
+ 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;
+ }
}
- newdir = normalize(olddir + edir * self.wait);
- newspeed = oldspeed + self.lip;
- self.velocity = normalize(olddir + newdir * self.wait) * newspeed;
-
+ // Hitting somethign soon.
+ self.velocity = olddir * (vlen(self.velocity) + self.lip);
UpdateCSQCProjectile(self);
}
{
entity rocket;
+ sound (self, CHAN_WEAPON, "weapons/rocket_fire.wav", VOL_BASE, ATTN_NORM);
+
rocket = spawn();
setsize (rocket, '-1 -1 -1', '1 1 1');
- rocket.lip = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
- rocket.wait = autocvar_g_vehicle_racer_rocket_turnrate;
- rocket.solid = SOLID_BBOX;
- rocket.movetype = MOVETYPE_FLYMISSILE;
- rocket.flags = FL_PROJECTILE;
- rocket.owner = self;
- rocket.realowner = self.owner;
- rocket.touch = racer_rocket_touch;
- rocket.bot_dodge = TRUE;
- rocket.bot_dodgerating = autocvar_g_vehicle_racer_rocket_damage;
- setorigin(rocket, gettaginfo(self,gettagindex(self,tagname)));
-
- /*
- if( (self.tur_head.gun1) && (self.tur_head.cnt > time))
- rocket.enemy = self.tur_head.gun1;
-
- if(rocket.enemy)
- {
- rocket.delay = vlen(rocket.enemy.origin - rocket.origin);
- rocket.cnt = time + 9;
- rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
- rocket.think = racer_rocket_think;
- rocket.nextthink = time;
- CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
- }
- else
- {
- */
- rocket.cnt = time + 9;
- rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
- rocket.think = racer_rocket_groundhugger;
- rocket.nextthink = time;
- CSQCProjectile(rocket, TRUE, PROJECTILE_ROCKET, TRUE);
- //}
+ setorigin(rocket, gettaginfo(self, gettagindex(self, tagname)));
+
+ rocket.lip = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
+ rocket.wait = autocvar_g_vehicle_racer_rocket_turnrate;
+ rocket.solid = SOLID_BBOX;
+ rocket.movetype = MOVETYPE_FLYMISSILE;
+ rocket.flags = FL_PROJECTILE;
+ rocket.owner = self;
+ rocket.realowner = self.owner;
+ rocket.touch = racer_rocket_explode;
+ rocket.bot_dodge = TRUE;
+ rocket.bot_dodgerating = autocvar_g_vehicle_racer_rocket_damage;
+ rocket.cnt = time + 9;
+ rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
+ rocket.think = racer_rocket_groundhugger;
+ rocket.nextthink = time;
+
+ CSQCProjectile(rocket, TRUE, PROJECTILE_ROCKET, TRUE);
}
-float racer_customizeentityforclient()
-{
-
- if(self.deadflag == DEAD_DEAD)
- return FALSE;
-
- /*
- if(other == self.owner)
- self.alpha = -1;
- else
- self.alpha = 1;
- */
-
- return TRUE;
-}
-
-float racer_pplug()
+float racer_frame()
{
entity player, racer;
float ftmp, ftmp2;
vector df;
- if(autocvar_g_vehicle_racer_reload)
- {
- racer_loadsettings();
- cvar_set("g_vehicle_racer_reload","0");
- }
-
player = self;
racer = self.vehicle;
- player.BUTTON_ZOOM = 0;
- player.BUTTON_CROUCH = 0;
+ player.BUTTON_ZOOM = player.BUTTON_CROUCH = 0;
self = racer;
if(player.BUTTON_USE)
{
- self = racer;
- racer_exit(0);
+ vehicles_exit(VHEF_NORMAL);
self = player;
return 0;
}
return 1;
}
-
racer_align4point();
racer.angles_x *= -1;
makevectors(racer.angles);
- // Rotate Body
- ftmp = racer_turnspeed * sys_frametime;
+ // Yaw
+ ftmp = autocvar_g_vehicle_racer_turnspeed * sys_frametime;
ftmp2 = ftmp * -1;
ftmp = bound(ftmp2, shortangle_f(player.v_angle_y - racer.angles_y, racer.angles_y), ftmp);
ftmp2 = anglemods(racer.angles_y + ftmp);
// Roll
- ftmp = bound(-45, shortangle_f(player.v_angle_z + ((racer.angles_y - ftmp2) * racer_turnroll), racer.angles_z), 45);
- ftmp = anglemods(racer.angles_z + ftmp);
- racer.angles_z = bound(-85, ftmp, 85);
+ ftmp = bound(-45, shortangle_f(player.v_angle_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 = racer_pitchspeed * sys_frametime;
+ 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);
+ 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;
if(player.movement_x != 0)
{
if(player.movement_x > 0)
- df += v_forward * racer_speed_forward;
+ df += v_forward * autocvar_g_vehicle_racer_speed_forward;
else if(player.movement_x < 0)
- df -= v_forward * racer_speed_forward;
+ df -= v_forward * autocvar_g_vehicle_racer_speed_forward;
}
if(player.movement_y != 0)
{
if(player.movement_y < 0)
- df -= v_right * racer_speed_strafe;
+ df -= v_right * autocvar_g_vehicle_racer_speed_strafe;
else if(player.movement_y > 0)
- df += v_right * racer_speed_strafe;
+ df += v_right * autocvar_g_vehicle_racer_speed_strafe;
}
// limit _z to avoid flying on normal thrust
if(df_z > 0)
- df_z = min(df_z,700);
+ df_z = min(df_z, 700);
// Afterburn
if (player.BUTTON_JUMP)
- if(racer.vehicle_energy >= (racer_afterburn_cost * frametime))
+ if(racer.vehicle_energy >= (autocvar_g_vehicle_racer_afterburn_cost * frametime))
{
- racer.wait = time + autocvar_g_vehicle_racer_energy_usepause;
- racer.vehicle_energy -= racer_afterburn_cost * frametime;
+ racer.wait = time;
+ racer.vehicle_energy -= autocvar_g_vehicle_racer_afterburn_cost * frametime;
df += (v_forward * autocvar_g_vehicle_racer_speed_afterburn);
+ self.owner.vehicle_energy = racer.vehicle_energy / autocvar_g_vehicle_racer_energy;
}
racer.velocity += df * frametime;
racer.velocity = racer.velocity - df;
player.movement = racer.velocity;
- /*
- // for homing rockets
- // FIXME this uses prydon cursor
- if(self.owner.cursor_trace_ent)
- {
- self.tur_head.gun1 = self.owner.cursor_trace_ent;
- self.tur_head.cnt = time + 1;
- }
- */
-
if(player.BUTTON_ATCK)
if(time > racer.attack_finished_single)
if(racer.vehicle_energy >= autocvar_g_vehicle_racer_laser_cost)
{
racer.vehicle_energy -= autocvar_g_vehicle_racer_laser_cost;
- racer.wait = time + autocvar_g_vehicle_racer_energy_usepause;
+ racer.wait = time;
if(racer.cnt)
{
racer.cnt = 1;
}
racer.attack_finished_single = time + autocvar_g_vehicle_racer_laser_refire;
+ self.owner.vehicle_energy = racer.vehicle_energy / autocvar_g_vehicle_racer_energy;
}
if(player.BUTTON_ATCK2)
racer_fire_rocket("tag_rocket_l");
racer.delay = time + autocvar_g_vehicle_racer_rocket_refire;
racer.lip = time;
-
}
- player.vehicle_reload1 = (time - racer.lip) / (racer.delay-racer.lip);
- vehicle_stdproc_shiledregen(racer_shieldmax, frametime);
- vehicle_stdproc_healthregen(racer_healthmax, frametime);
+ player.vehicle_reload1 = (time - racer.lip) / (racer.delay - racer.lip);
- if (racer.wait < time)
- vehicle_stdproc_energyregen(racer_energymax, frametime);
- else
- player.vehicle_energy = (racer.vehicle_energy / racer_energymax);
+ if(self.vehicle_flags & VHF_SHIELDREGEN)
+ vehicles_regen(dmg_time, vehicle_shield, autocvar_g_vehicle_racer_shield, autocvar_g_vehicle_racer_shield_regen_pause, autocvar_g_vehicle_racer_shield_regen, frametime);
- self = player;
+ if(self.vehicle_flags & VHF_HEALTHREGEN)
+ vehicles_regen(dmg_time, vehicle_health, autocvar_g_vehicle_racer_health, autocvar_g_vehicle_racer_health_regen_pause, autocvar_g_vehicle_racer_health_regen, frametime);
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
- setorigin(player,racer.origin + '0 0 32');
- player.velocity = racer.velocity;
+ if(self.vehicle_flags & VHF_ENERGYREGEN)
+ vehicles_regen(wait, vehicle_energy, autocvar_g_vehicle_racer_energy, autocvar_g_vehicle_racer_energy_regen_pause, autocvar_g_vehicle_racer_energy_regen, frametime);
- return 1;
-}
-void racer_exitthink()
-{
- float a, b, c;
-
- self.nextthink = time;
-
- a = racer_anglestabilizer;
- b = racer_springlength;
- c = racer_power_solid;
+ VEHICLE_UPDATE_PLAYER(health, racer);
- racer_anglestabilizer = 36;
- racer_springlength = 96;
- racer_power_solid = 300;
+ if(self.vehicle_flags & VHF_HASSHIELD)
+ VEHICLE_UPDATE_PLAYER(shield, racer);
- racer_align4point();
- if(self.velocity_z < 0)
- self.velocity_z *= 0.95;
-
- racer_anglestabilizer = a;
- racer_springlength = b;
- racer_power_solid = c;
+ player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+ setorigin(player,racer.origin + '0 0 32');
+ player.velocity = racer.velocity;
- self.velocity_x *= 0.95;
- self.velocity_y *= 0.95;
+ self = player;
+ return 1;
}
-void racer_spawnthink()
+void racer_think()
{
float a, b, c;
- vector dorg;
self.nextthink = time;
- a = racer_anglestabilizer;
- b = racer_springlength;
- c = racer_power_solid;
-
- racer_anglestabilizer = 36;
- racer_springlength = 96;
- racer_power_solid = 300;
+ a = autocvar_g_vehicle_racer_anglestabilizer;
+ b = autocvar_g_vehicle_racer_springlength;
+ c = autocvar_g_vehicle_racer_hoverpower;
- // self.velocity_z += sin(time * 128) * 4;
+ autocvar_g_vehicle_racer_anglestabilizer = 36;
+ autocvar_g_vehicle_racer_springlength = 96;
+ autocvar_g_vehicle_racer_hoverpower = 300;
racer_align4point();
if(self.velocity_z < 0)
- self.velocity_z *= 0.98;
+ self.velocity_z *= 0.95;
- racer_anglestabilizer = a;
- racer_springlength = b;
- racer_power_solid = c;
+ autocvar_g_vehicle_racer_anglestabilizer = a;
+ autocvar_g_vehicle_racer_springlength = b;
+ autocvar_g_vehicle_racer_hoverpower = c;
self.velocity_x *= 0.95;
self.velocity_y *= 0.95;
-
- dorg = self.pos1 - self.origin ;
-
- self.velocity_x = bound(-32, self.velocity_x + dorg_x, 32);
- self.velocity_y = bound(-32, self.velocity_y + dorg_y, 32);
}
void racer_enter()
{
- self.owner = other;
-
-
- self.nextthink = 0;
- self.flags = 0;
- self.vehicle_hudmodel.viewmodelforclient = self.owner;
- self.colormap = self.owner.colormap;
-
- self.owner.PlayerPhysplug = racer_pplug;
- self.owner.takedamage = DAMAGE_NO;
- self.owner.event_damage = SUB_Null;
- self.owner.vehicle = self;
- self.owner.angles = self.angles;
- self.owner.solid = SOLID_NOT;
- self.owner.movetype = MOVETYPE_NOCLIP;
- self.owner.alpha = -1;
- self.owner.hud = HUD_WAKIZASHI;
- self.owner.effects |= EF_NODRAW;
- self.owner.view_ofs = '0 0 0';
-
self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health);
self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_racer_shield);
-
- setorigin(other,self.origin + '0 0 32');
- other.velocity = self.velocity;
-
- other.flags &~= FL_ONGROUND;
- msg_entity = other;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity( MSG_ONE, self.vehicle_viewport);
-
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, self.angles_x * -1); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
}
void racer_spawn();
-void racer_return()
-{
- pointparticles(particleeffectnum("teleport"), self.enemy.origin + '0 0 64', '0 0 0', 1);
- self.enemy.think = racer_spawn;
- self.enemy.nextthink = time;
- remove(self);
-}
void racer_exit(float eject)
{
- self.colormap = 1024;
- self.flags = FL_NOTARGET;
+ vehicles_setreturn(autocvar_g_vehicle_racer_respawntime, racer_spawn);
+
+ self.think = racer_think;
+ self.nextthink = time;
if not (self.owner)
return;
- msg_entity = self.owner;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity( MSG_ONE, self.owner);
-
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, 0); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
-
- if (self.deadflag == DEAD_NO)
- {
- self.think = racer_exitthink;
- self.nextthink = time;
- }
-
- self.owner.takedamage = DAMAGE_AIM;
- self.owner.solid = SOLID_SLIDEBOX;
- self.owner.movetype = MOVETYPE_WALK;
-
- setsize(self.owner,PL_MIN,PL_MAX);
-
- self.owner.effects &~= EF_NODRAW;
- self.owner.alpha = 1;
- self.owner.PlayerPhysplug = SUB_Null;
- self.owner.vehicle = world;
- self.owner.view_ofs = PL_VIEW_OFS;
- self.owner.event_damage = PlayerDamage;
- self.owner.hud = HUD_NORMAL;
-
- self.vehicle_hudmodel.viewmodelforclient = self;
-
if(eject)
{
makevectors(self.angles);
}
else
{
- self.owner.velocity = (v_forward) * -150;
- setorigin(self.owner,self.origin - v_forward * 128);
+ self.owner.velocity = v_forward * -150;
+ setorigin(self.owner, self.origin - v_forward * 128);
}
self.owner = world;
-
- if (self.deadflag != DEAD_NO)
- {
- entity ret;
- ret = spawn();
- ret.enemy = self;
- ret.think = racer_return;
- ret.nextthink = time + autocvar_g_vehicle_racer_respawntime;
- }
}
void racer_touch()
if(other.vehicle != world)
return;
- racer_enter();
+ vehicles_enter();
}
void racer_spawn()
{
- self.think = racer_spawnthink;
+ self.think = racer_think;
self.nextthink = time;
self.flags = FL_NOTARGET;
self.effects = 0;
- self.vehicle_health = racer_healthmax;
- self.vehicle_shield = racer_shieldmax;
+ self.vehicle_health = autocvar_g_vehicle_racer_health;
+ self.vehicle_shield = autocvar_g_vehicle_racer_shield;
- self.event_damage = vehicle_stdproc_damage;
+ self.event_damage = vehicles_damage;
self.touch = racer_touch;
self.iscreature = TRUE;
self.scale = 0.5;
- self.movetype = MOVETYPE_FLY;
+ self.movetype = MOVETYPE_BOUNCEMISSILE;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
- self.alpha = 1;
- self.colormap = 1024;
- self.deadflag = DEAD_NO;
+ self.alpha = 1;
+ self.colormap = 1024;
+ self.deadflag = DEAD_NO;
self.bot_attack = TRUE;
self.vehicle_energy = 1;
setorigin(self, self.pos1);
self.angles = self.pos2;
- setsize(self,RACER_MIN * 0.5,RACER_MAX * 0.5);
+ setsize(self, RACER_MIN * 0.5, RACER_MAX * 0.5);
pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
self.delay = time;
}
-
void racer_blowup()
{
self.colormod = '0 0 0';
setorigin(self,self.pos1);
+ self.avelocity = '0 0 0';
+ self.velocity = '0 0 0';
}
-void racer_dietouch()
+void racer_deadtouch()
{
- if(self.wait > time)
- return;
-
- self.wait = time + 0.75;
-
- pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+ self.avelocity_x *= 0.7;
+ self.cnt -= 1;
+ if(self.cnt <= 0)
+ racer_blowup();
}
void racer_die()
self.health = 0;
self.event_damage = SUB_Null;
self.iscreature = FALSE;
- self.solid = SOLID_NOT;
+ self.solid = SOLID_CORPSE;
self.takedamage = DAMAGE_NO;
- self.touch = racer_dietouch;
self.deadflag = DEAD_DYING;
self.movetype = MOVETYPE_BOUNCE;
- self.wait = time;
+ self.wait = time;
+ self.cnt = 1 + random() * 3;
+ self.touch = racer_deadtouch;
pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
- self.velocity += '0 0 128';
+ self.velocity += '0 0 700';
if(random() < 0.5)
self.avelocity_z = 16;
else
self.avelocity_z = -16;
+ self.avelocity_x = -vlen(self.velocity) * 0.2;
+
self.colormod = '-0.5 -0.5 -0.5';
self.think = racer_blowup;
- self.nextthink = time + 3;
+ self.nextthink = 2 + time + random() * 3;
}
void racer_dinit()
{
+ if not (vehicle_initialize(
+ "Wakizashi",
+ "models/vehicles/wakizashi.dpm",
+ "",
+ "models/vehicles/wakizashi_cockpit.dpm",
+ "", "", "tag_viewport",
+ HUD_WAKIZASHI,
+ 0.5 * RACER_MIN, 0.5 * RACER_MAX,
+ FALSE,
+ racer_spawn, racer_frame,
+ racer_enter, racer_exit,
+ racer_die, racer_think))
+ {
+ remove(self);
+ return;
+ }
- tracebox(self.origin + '0 0 100', RACER_MIN * 0.5, RACER_MAX * 0.5, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
- setorigin(self,trace_endpos);
-
- if (self.netname == "")
- self.netname = "Race PoD";
-
- self.cvar_basename = "g_vehicle_racer";
-
- self.vehicle_viewport = spawn();
- self.vehicle_hudmodel = spawn();
- //self.ccamera = spawn();
-
- setorigin(self, self.origin);
-
- setmodel(self,"models/vehicles/wakizashi.dpm");
- setmodel(self.vehicle_hudmodel, "models/vehicles/wakizashi_cockpit.dpm");
- setmodel (self.vehicle_viewport, "null");
+ if(autocvar_g_vehicle_racer_hovertype != 0)
+ racer_force_from_tag = vehicles_force_fromtag_maglev;
+ else
+ racer_force_from_tag = vehicles_force_fromtag_hover;
+ // FIXME: this be hakkz, fix the models insted (scale body, add tag_viewport to the hudmodel).
+ self.scale = 0.5;
setattachment(self.vehicle_hudmodel, self, "");
setattachment(self.vehicle_viewport, self, "tag_viewport");
-
- self.vehicle_hudmodel.viewmodelforclient = self;
- self.customizeentityforclient = racer_customizeentityforclient;
-
- self.tur_head = spawn();
-
- self.pos1 = self.origin;
- self.pos2 = self.angles;
- self.angles = '0 0 0';
- self.angles = self.pos1;
-
- self.vehicle_die = racer_die;
- self.vehicle_exit = racer_exit;
-
- addstat(STAT_HUD, AS_INT, hud);
- addstat(STAT_VEHICLESTAT_HEALTH, AS_FLOAT, vehicle_health);
- addstat(STAT_VEHICLESTAT_SHIELD, AS_FLOAT, vehicle_shield);
- addstat(STAT_VEHICLESTAT_ENERGY, AS_FLOAT, vehicle_energy);
-
- addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
- addstat(STAT_VEHICLESTAT_RELOAD1, AS_FLOAT, vehicle_reload1);
-
- addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
- addstat(STAT_VEHICLESTAT_RELOAD2, AS_FLOAT, vehicle_reload2);
-
- racer_spawn();
}
void spawnfunc_vehicle_racer()
{
- g_turrets_common_precash();
- racer_loadsettings();
-
- self.vehicle_flags = VHF_HASSHIELD | VHF_SHIELDREGEN;
- /*
- traceline(self.origin,self.origin - '0 0 2048',MOVE_WORLDONLY,self);
- if(trace_startsolid)
- {
- dprint("WARNING: vehicle_racer placed in solid\n");
- traceline(self.origin + '0 0 512' ,self.origin - '0 0 2048',MOVE_WORLDONLY,self);
- if(trace_startsolid || trace_fraction == 1.0)
- {
- dprint("ERROR: vehicle_racer placed in more then 512 units into solid\n");
- remove(self);
- return;
- }
- }
- */
-
- if(trace_fraction != 1.0)
- setorigin(self,trace_endpos + '0 0 128');
- else
- dprint("WARNING: vehicle_racer placed more then 2048 units above ground.\n");
+ precache_sound ("weapons/laserimpact.wav");
+ precache_sound ("weapons/lasergun_fire.wav");
+ precache_sound ("weapons/rocket_fire.wav");
+ precache_sound ("weapons/rocket_impact.wav");
+ precache_model ("models/vhshield.md3");
precache_model ("models/vehicles/wakizashi.dpm");
precache_model ("models/vehicles/wakizashi_cockpit.dpm");
- precache_model ("maps/bspmodel.bsp");
+ vehicles_configcheck("vehicle_racer.cfg", autocvar_g_vehicle_racer_health);
+ if(autocvar_g_vehicle_racer_energy)
+ if(autocvar_g_vehicle_racer_energy_regen)
+ self.vehicle_flags |= VHF_ENERGYREGEN;
+
+ if(autocvar_g_vehicle_racer_shield)
+ self.vehicle_flags |= VHF_HASSHIELD;
+
+ if(autocvar_g_vehicle_racer_shield_regen)
+ self.vehicle_flags |= VHF_SHIELDREGEN;
+
+ if(autocvar_g_vehicle_racer_health_regen)
+ self.vehicle_flags |= VHF_HEALTHREGEN;
+
self.think = racer_dinit;
self.nextthink = time + 1;
}
-#define RAPTOR_MIN '-40 -40 0'
-#define RAPTOR_MAX '40 40 40'
-
-float raptor_movestyle;
-float raptor_turnspeed;
-float raptor_turnroll;
-float raptor_pitchspeed;
-float raptor_speed_forward;
-float raptor_speed_strafe;
-float raptor_speed_up;
-float raptor_speed_down;
-
-float raptor_bomblet_waves;
-float raptor_bomblet_wavefirst;
-float raptor_bomblet_wavenext;
-float raptor_bomblet_wawespread;
-float raptor_bomblets;
-float raptor_bomblet_damage;
-float raptor_bomblet_edgedamage;
-float raptor_bomblet_radius;
-float raptor_bomblet_force;
-float raptor_bombs_refire;
-
-float raptor_beam_dps;
-float raptor_beam_fops;
-float raptor_beam_aps;
-float raptor_beam_size;
-float raptor_beam_leangth;
-float raptor_beam_refire;
-
-float raptor_shield_max;
-float raptor_shield_regen;
-
-float raptor_health_max;
-float raptor_health_regen;
-
-float raptor_energy_max;
-float raptor_energy_regen;
+#define RAPTOR_MIN '-80 -80 0'
+#define RAPTOR_MAX '80 80 70'
+
+float autocvar_g_vehicle_raptor_respawntime;
+
+float autocvar_g_vehicle_raptor_movestyle;
+float autocvar_g_vehicle_raptor_turnspeed;
+float autocvar_g_vehicle_raptor_pitchspeed;
+float autocvar_g_vehicle_raptor_pitchlimit;
+
+float autocvar_g_vehicle_raptor_speed_forward;
+float autocvar_g_vehicle_raptor_speed_strafe;
+float autocvar_g_vehicle_raptor_speed_up;
+float autocvar_g_vehicle_raptor_speed_down;
+
+float autocvar_g_vehicle_raptor_bomblets;
+float autocvar_g_vehicle_raptor_bomblet_alt;
+float autocvar_g_vehicle_raptor_bomblet_time;
+float autocvar_g_vehicle_raptor_bomblet_damage;
+float autocvar_g_vehicle_raptor_bomblet_spread;
+float autocvar_g_vehicle_raptor_bomblet_edgedamage;
+float autocvar_g_vehicle_raptor_bomblet_radius;
+float autocvar_g_vehicle_raptor_bomblet_force;
+float autocvar_g_vehicle_raptor_bombs_refire;
+
+float autocvar_g_vehicle_raptor_guns_turnspeed;
+float autocvar_g_vehicle_raptor_guns_turnlimit;
+float autocvar_g_vehicle_raptor_guns_pitchlimit;
+
+float autocvar_g_vehicle_raptor_cannon_cost;
+float autocvar_g_vehicle_raptor_cannon_damage;
+float autocvar_g_vehicle_raptor_cannon_radius;
+float autocvar_g_vehicle_raptor_cannon_refire;
+float autocvar_g_vehicle_raptor_cannon_speed;
+float autocvar_g_vehicle_raptor_cannon_spread;
+
+
+float autocvar_g_vehicle_raptor_energy;
+float autocvar_g_vehicle_raptor_energy_regen;
+float autocvar_g_vehicle_raptor_energy_regen_pause;
+
+float autocvar_g_vehicle_raptor_health;
+float autocvar_g_vehicle_raptor_health_regen;
+float autocvar_g_vehicle_raptor_health_regen_pause;
+
+float autocvar_g_vehicle_raptor_shield;
+float autocvar_g_vehicle_raptor_shield_regen;
+float autocvar_g_vehicle_raptor_shield_regen_pause;
void raptor_spawn();
-void raptor_return();
-float raptor_pplug();
-float raptor_takeoff();
-float raptor_land();
+//void raptor_return();
+float raptor_frame();
+//float raptor_takeoff();
.entity bomb1;
.entity bomb2;
float raptor_altitude(float amax)
{
- tracebox(self.origin, self.mins, self.maxs, '0 0 -1' * amax, TRUE, self);
- if(trace_fraction == 1)
- return amax+1;
- else
- return vlen(self.origin - trace_endpos);
-}
-
-void raptor_loadsettings()
-{
- raptor_movestyle = CCVAR("_movestyle");
- raptor_turnspeed = CCVAR("_turnspeed");
- raptor_turnroll = CCVAR("_turnroll");
- raptor_pitchspeed = CCVAR("_pitchspeed");
- raptor_speed_forward = CCVAR("_speed_forward");
- raptor_speed_strafe = CCVAR("_speed_strafe");
- raptor_speed_up = CCVAR("_speed_up");
- raptor_speed_down = CCVAR("_speed_down");
-
- raptor_bomblet_waves = CCVAR("_bomblet_waves ");
- raptor_bomblet_wavefirst = CCVAR("_bomblet_wavefirst");
- raptor_bomblet_wavenext = CCVAR("_bomblet_wavenext");
- raptor_bomblet_wawespread = CCVAR("_bomblet_wawespread");
- raptor_bomblets = CCVAR("_bomblets");
- raptor_bomblet_damage = CCVAR("_bomblet_damage");
- raptor_bomblet_edgedamage = CCVAR("_bomblet_edgedamage");
- raptor_bomblet_radius = CCVAR("_bomblet_radius");
- raptor_bomblet_force = CCVAR("_bomblet_force ");
- raptor_bombs_refire = CCVAR("_bombs_refire");
-
- raptor_beam_dps = CCVAR("_beam_dps");
- raptor_beam_fops = CCVAR("_beam_fops");
- raptor_beam_aps = CCVAR("_beam_aps");
- raptor_beam_size = CCVAR("_beam_size");
- raptor_beam_leangth = CCVAR("_beam_length");
- raptor_beam_refire = CCVAR("_beam_refire");
-
- raptor_shield_max = CCVAR("_shield");
- raptor_shield_regen = CCVAR("_shield_regen");
-
- raptor_health_max = CCVAR("_health");
- raptor_health_regen = CCVAR("_health_regen");
-
- raptor_energy_max = CCVAR("_energy");
- raptor_energy_regen = CCVAR("_energy_regen");
+ tracebox(self.origin, self.mins, self.maxs, self.origin - ('0 0 1' * amax), TRUE, self);
+ return vlen(self.origin - trace_endpos);
}
void raptor_bombs_return()
void raptor_bomblet_boom()
{
- if(other.enemy == self.enemy)
+ if(other == self.owner || other.owner == self.owner)
return;
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
- RadiusDamage (self, self.enemy, raptor_bomblet_damage, raptor_bomblet_edgedamage, raptor_bomblet_radius, world, raptor_bomblet_force, DEATH_SBROCKET, world);
+ RadiusDamage (self, self.enemy, autocvar_g_vehicle_raptor_bomblet_damage,
+ autocvar_g_vehicle_raptor_bomblet_edgedamage,
+ autocvar_g_vehicle_raptor_bomblet_radius, world,
+ autocvar_g_vehicle_raptor_bomblet_force, DEATH_SBROCKET, world);
remove(self);
}
{
self.angles = vectoangles(self.velocity);
- if(self.cnt < time)
- {
- entity bomblet;
- float i,v;
- vector d;
-
- makevectors(self.angles);
- v = vlen(self.velocity) + random();
- d = normalize(self.velocity);
- pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
- for(i = 0; i < raptor_bomblets; ++i)
- {
+ if(autocvar_g_vehicle_raptor_bomblet_alt)
+ {
+ self.nextthink = time;
+ // FIXME: this can make bombs stic forever if fierd at low altitude and land close to vehicle.
+ traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
+ if(trace_fraction == 1.0)
+ return;
- bomblet = spawn();
- setorigin(bomblet,self.origin);
+ if(vlen(self.origin - self.owner.origin) < autocvar_g_vehicle_raptor_bomblet_radius)
+ return;
+ }
- setmodel(bomblet,"models/vehicles/raptor_bomb.dpm");
- bomblet.scale = 0.5;
+ entity bomblet;
+ float i,v;
+ vector d;
- bomblet.owner = self.owner;
- bomblet.enemy = self.enemy;
+ v = vlen(self.velocity);
+ d = normalize(self.velocity);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
- bomblet.solid = SOLID_TRIGGER;
- bomblet.movetype = MOVETYPE_BOUNCE;
- bomblet.touch = raptor_bomblet_boom;
+ for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
+ {
- bomblet.think = raptor_bomblet_boom;
- bomblet.nextthink = time + 5;
+ bomblet = spawn();
+ setorigin(bomblet,self.origin);
- //bomblet.modelflags = MF_ROCKET;
- bomblet.modelflags = MF_GRENADE;
+ setmodel(bomblet,"models/vehicles/raptor_bomb.dpm");
+ bomblet.scale = 0.5;
- bomblet.velocity = normalize(d + randomvec() * raptor_bomblet_wawespread) * v;
+ 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.angles = vectoangles(bomblet.velocity);
- }
+ bomblet.modelflags = MF_GRENADE;
- self.wait -= 1;
- if(self.wait <= 0)
- {
- remove(self);
- return;
- }
+ bomblet.velocity = normalize(d + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * v;
- self.cnt = time + raptor_bomblet_wavenext;
+ bomblet.angles = vectoangles(bomblet.velocity);
}
- self.nextthink = time;
+ remove(self);
}
void raptor_bomb_touch()
setorigin(bomb_1, gettaginfo(self, gettagindex(self, "bombmount_left")));
setorigin(bomb_2, gettaginfo(self, gettagindex(self, "bombmount_right")));
- bomb_1.movetype = bomb_2.movetype = MOVETYPE_TOSS;
- bomb_1.velocity = bomb_2.velocity = self.velocity;
- bomb_1.touch = bomb_2.touch = raptor_bomb_touch;
- bomb_1.think = bomb_2.think = raptor_bomb_burst;
- bomb_1.nextthink = bomb_2.nextthink = time;
- bomb_1.cnt = bomb_2.cnt = time + raptor_bomblet_wavefirst;
- bomb_1.wait = bomb_2.wait = raptor_bomblet_waves;
-
- 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.movetype = bomb_2.movetype = MOVETYPE_TOSS;
+ bomb_1.velocity = bomb_2.velocity = self.velocity;
+ bomb_1.touch = bomb_2.touch = raptor_bomb_touch;
+ bomb_1.think = bomb_2.think = raptor_bomb_burst;
+
+ if(autocvar_g_vehicle_raptor_bomblet_alt)
+ bomb_1.nextthink = bomb_2.nextthink = time;
+ 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;
bomb_1 = spawn();
bomb_1.owner = self;
bomb_1.think = raptor_bombs_return;
- bomb_1.nextthink = time + raptor_bombs_refire;
-}
-
-void raptor_animator_think()
-{
- self.owner.frame += 1;
- if(self.owner.frame == self.cnt)
- remove(self);
- else
- self.nextthink = time + self.wait;
+ bomb_1.nextthink = time + autocvar_g_vehicle_raptor_bombs_refire;
}
-void raptor_setanim(float start, float end, float length)
+void raptor_bolt_explode()
{
- entity ani;
- if(self.tur_head.enemy)
- ani = self.tur_head.enemy;
- else
- ani = spawn();
-
- self.tur_head.enemy = ani;
- ani.owner = self;
- self.frame = start;
- ani.cnt = end;
- ani.wait = sys_frametime / length;
- ani.think = raptor_animator_think;
- ani.nextthink = time + ani.wait;
+ 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);
+ sound (self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ remove (self);
}
-void raptor_beam (vector start, vector end, vector smin, vector smax, float bforce, float f_dmg, float deathtype)
+void raptor_fire_cannon(entity gun, string tagname)
{
- vector hitloc, force, endpoint, dir;
- entity ent;
-
- dir = normalize(end - start);
- force = dir * bforce;
+ entity bolt;
- // go a little bit into the wall because we need to hit this wall later
- end = end + dir;
+ bolt = spawn();
- // trace multiple times until we hit a wall, each obstacle will be made unsolid.
- // note down which entities were hit so we can damage them later
- while (1)
- {
- tracebox(start, smin, smax, end, FALSE, world);
-
- // if it is world we can't hurt it so stop now
- if (trace_ent == world || trace_fraction == 1)
- break;
+ PROJECTILE_MAKETRIGGER(bolt);
+ sound (gun, CHAN_WEAPON, "weapons/lasergun_fire.wav", VOL_BASE, ATTN_NORM);
+ setorigin(bolt, gettaginfo(gun, gettagindex(gun, tagname)));
- if (trace_ent.solid == SOLID_BSP)
- break;
+ bolt.movetype = MOVETYPE_FLYMISSILE;
+ bolt.flags = FL_PROJECTILE | FL_NOTARGET;
+ bolt.owner = self;
+ bolt.realowner = self.owner;
+ bolt.touch = raptor_bolt_explode;
+ bolt.think = raptor_bolt_explode;
+ bolt.nextthink = time + 9;
+ bolt.bot_dodge = TRUE;
+ bolt.bot_dodgerating = autocvar_g_vehicle_raptor_cannon_damage;
+ bolt.velocity = normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed;
- // make the entity non-solid so we can hit the next one
- trace_ent.railgunhit = TRUE;
- trace_ent.railgunhitloc = end;
- trace_ent.railgunhitsolidbackup = trace_ent.solid;
+ pointparticles(particleeffectnum("raptor_cannon_muzzleflash"), bolt.origin, bolt.velocity, 1);
- // make the entity non-solid
- trace_ent.solid = SOLID_NOT;
- }
-
- endpoint = trace_endpos;
-
- // find all the entities the railgun hit and hurt them
- ent = findchainfloat(railgunhit, TRUE);
- while (ent)
- {
- // get the details we need to call the damage function
- ent.solid = ent.railgunhitsolidbackup;
- hitloc = ent.railgunhitloc;
- ent.railgunhitloc = '0 0 0';
- ent.railgunhitsolidbackup = SOLID_NOT;
- ent.railgunhit = FALSE;
-
- // apply the damage
- if (ent.takedamage)
- Damage (ent, self, self, f_dmg, deathtype, hitloc, force);
-
- ent = ent.chain;
- }
- trace_endpos = endpoint;
+ CSQCProjectile(bolt, TRUE, PROJECTILE_CRYLINK , TRUE);
}
+void raptor_think()
+{
+}
void raptor_enter()
{
- // Remove this when bots know how to use vehicles
- if (clienttype(other) != CLIENTTYPE_REAL)
- return;
-
- if(teams_matter)
- if(self.team)
- if(self.team != other.team)
- return;
-
- self.owner = other;
- self.switchweapon = other.switchweapon;
-
- self.event_damage = vehicle_stdproc_damage;
- self.colormap = self.owner.colormap;
- self.vehicle_hudmodel.viewmodelforclient = self.owner;
- self.nextthink = 0;
- self.owner.angles = self.angles;
- self.owner.takedamage = DAMAGE_NO;
- self.owner.solid = SOLID_NOT;
- self.owner.movetype = MOVETYPE_NOCLIP;
- self.owner.alpha = -1;
- self.owner.PlayerPhysplug = raptor_takeoff;
- self.owner.vehicle = self;
- self.owner.event_damage = SUB_Null;
- self.owner.hud = HUD_RAPTOR;
- self.owner.vehicle_health = self.vehicle_health / raptor_health_max;
- self.owner.vehicle_shield = self.vehicle_shield / raptor_shield_max;
- self.owner.view_ofs = '0 0 1';
- self.owner.vehicle_ammo1 = self.vehicle_ammo1;
- self.owner.vehicle_ammo2 = self.vehicle_ammo2;
- self.owner.vehicle_reload1 = self.vehicle_reload1;
- self.owner.vehicle_reload2 = self.vehicle_reload2;
-
- other.flags &~= FL_ONGROUND;
- self.flags &~= FL_ONGROUND;
+ self.movetype = MOVETYPE_BOUNCEMISSILE;
+ 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;
+}
- self.frame = 0;
- raptor_setanim(0, 25, 1);
+void raptor_land()
+{
+ float hgt;
- self.team = self.owner.team;
- self.flags -= FL_NOTARGET;
+ hgt = raptor_altitude(512);
+ self.velocity = (self.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime);
+ self.angles_x *= 0.95;
+ self.angles_z *= 0.95;
- self.velocity = '0 0 1';
+ if(hgt < 128)
+ if(self.frame != 0)
+ self.frame = max(self.frame - 0.25, 0);
- setorigin(other,self.origin + '0 0 32');
- other.velocity = self.velocity;
+ self.bomb1.gun1.avelocity_y = 90 + ((self.frame / 25) * 2000);
+ self.bomb1.gun2.avelocity_y = -self.bomb1.gun1.avelocity_y;
- other.flags &~= FL_ONGROUND;
- msg_entity = other;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity( MSG_ONE, self.vehicle_viewport);
+ if(hgt < 16)
+ {
+ self.movetype = MOVETYPE_BOUNCE;
+ self.think = raptor_think;
+ }
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, self.angles_x * -1); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
+ self.nextthink = time;
}
void raptor_exit(float eject)
{
- self.colormap = 1024;
- self.flags = FL_NOTARGET;
- if not (self.owner)
- return;
-
- msg_entity = self.owner;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity( MSG_ONE, self.owner);
-
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, 0); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
-
- if (self.deadflag == DEAD_NO)
+ if(self.deadflag == DEAD_NO)
{
- //self.think = racer_exitthink;
- self.nextthink = time;
+ vehicles_setreturn(autocvar_g_vehicle_raptor_respawntime, raptor_spawn);
+ self.think = raptor_land;
+ self.nextthink = time;
}
- self.owner.takedamage = DAMAGE_AIM;
- self.owner.solid = SOLID_SLIDEBOX;
- self.owner.movetype = MOVETYPE_WALK;
-
- setsize(self.owner,PL_MIN,PL_MAX);
-
- self.owner.effects &~= EF_NODRAW;
- self.owner.alpha = 1;
- self.owner.PlayerPhysplug = SUB_Null;
- self.owner.vehicle = world;
- self.owner.view_ofs = PL_VIEW_OFS;
- self.owner.event_damage = PlayerDamage;
- self.owner.hud = HUD_NORMAL;
- //self.exteriormodeltoclient = self;
-
- self.vehicle_hudmodel.viewmodelforclient = self;
+ if not (self.owner)
+ return;
+ makevectors(self.angles);
if(eject)
{
- makevectors(self.angles);
- setorigin(self.owner,self.origin + v_forward * 100);
+ setorigin(self.owner,self.origin + v_forward * 100 + '0 0 64');
self.owner.velocity = (v_up + v_forward * 0.25) * 750;
}
else
- {
- self.owner.velocity = (v_forward) * -150;
- setorigin(self.owner,self.origin - v_forward * 128);
- }
+ setorigin(self.owner,self.origin - v_forward * 200 + '0 0 64');
self.owner = world;
-
- if (self.deadflag != DEAD_NO)
- {
- entity ret;
- ret = spawn();
- ret.enemy = self;
- ret.think = raptor_return;
- ret.nextthink = time + autocvar_g_vehicle_racer_respawntime;
- }
}
-
-float raptor_pplug()
+float raptor_frame()
{
- entity player, vhic;
- float ftmp, ftmp2, energy_used;
+ entity player, raptor;
+ float ftmp, ftmp2;
vector df;
-
- if(autocvar_g_vehicle_raptor_reload)
- {
- raptor_loadsettings();
- cvar_set("g_vehicle_raptor_reload","0");
- }
-
player = self;
- vhic = self.vehicle;
- self = vhic;
+ raptor = self.vehicle;
+ self = raptor;
if(player.BUTTON_USE)
{
- self = vhic;
- raptor_exit(0);
+ self = raptor;
+ vehicles_exit(VHEF_NORMAL);
self = player;
return 0;
}
- if(vhic.deadflag != DEAD_NO)
+ if(raptor.deadflag != DEAD_NO)
{
self = player;
player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
return 1;
}
- vhic.angles_x *= -1;
- // Rotate Body
- ftmp = raptor_turnspeed * sys_frametime;
-
- ftmp = bound(-ftmp, shortangle_f(player.v_angle_y - vhic.angles_y, vhic.angles_y), ftmp);
+ // Takeoff sequense
+ if(raptor.frame < 25)
+ {
+ raptor.frame += 0.25;
+ 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;
+ return 1;
+ }
- // Roll
- //ftmp = bound(-90,shortangle_f(player.v_angle_z + ((vhic.angles_y - ftmp2) * raptor_turnroll), vhic.angles_z),90);
- //ftmp = safeangle(vhic.angles_z + ftmp);
- //vhic.angles_z = ftmp;
+ raptor.angles_x *= -1;
+ // Rotate Body
+ ftmp = autocvar_g_vehicle_raptor_turnspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(player.v_angle_y - raptor.angles_y, raptor.angles_y), ftmp);
// Turn
- vhic.angles_y = anglemods(vhic.angles_y + ftmp);
+ raptor.angles_y = anglemods(raptor.angles_y + ftmp);
// Pitch Body
- ftmp = raptor_pitchspeed * sys_frametime;
-
- ftmp = bound(-ftmp, shortangle_f(player.v_angle_x - vhic.angles_x,vhic.angles_x), ftmp);
+ ftmp = autocvar_g_vehicle_raptor_pitchspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(player.v_angle_x - raptor.angles_x, raptor.angles_x), ftmp);
- vhic.angles_x = bound(-60,anglemods(vhic.angles_x + ftmp),60);
- vhic.angles_x *= -1;
+ raptor.angles_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, anglemods(raptor.angles_x + ftmp), autocvar_g_vehicle_raptor_pitchlimit);
+ raptor.angles_x *= -1;
- if(raptor_movestyle == 1)
+ if(autocvar_g_vehicle_raptor_movestyle == 1)
{
- ftmp = vhic.angles_z;
- vhic.angles_z = 0;
- ftmp2 = vhic.angles_x;
- vhic.angles_x = 0;
- fixedmakevectors(vhic.angles);
- vhic.angles_z = ftmp;
- vhic.angles_x = ftmp2;
+ 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
- fixedmakevectors(vhic.angles);
+ makevectors(player.v_angle);
- df = vhic.velocity * -1;
+ df = raptor.velocity * -1;
if(player.movement_x != 0)
{
if(player.movement_x > 0)
- df += v_forward * raptor_speed_forward;
+ df += v_forward * autocvar_g_vehicle_raptor_speed_forward;
else if(player.movement_x < 0)
- df -= v_forward * raptor_speed_forward;
+ df -= v_forward * autocvar_g_vehicle_raptor_speed_forward;
}
if(player.movement_y != 0)
{
if(player.movement_y < 0)
- df -= v_right * raptor_speed_strafe;
+ df -= v_right * autocvar_g_vehicle_raptor_speed_strafe;
else if(player.movement_y > 0)
- df += v_right * raptor_speed_strafe;
+ df += v_right * autocvar_g_vehicle_raptor_speed_strafe;
- vhic.angles_z = bound(-30,vhic.angles_z + (player.movement_y / raptor_speed_strafe),30);
+ raptor.angles_z = bound(-30,raptor.angles_z + (player.movement_y / autocvar_g_vehicle_raptor_speed_strafe),30);
}
else
{
- vhic.angles_z *= 0.95;
- if(vhic.angles_z >= -1 && vhic.angles_z <= -1)
- vhic.angles_z = 0;
+ raptor.angles_z *= 0.95;
+ if(raptor.angles_z >= -1 && raptor.angles_z <= -1)
+ raptor.angles_z = 0;
}
if(player.BUTTON_CROUCH)
- df -= v_up * raptor_speed_down;
+ df -= v_up * autocvar_g_vehicle_raptor_speed_down;
else if (player.BUTTON_JUMP)
- df += v_up * raptor_speed_up;
- //else
- //df_z = vhic.velocity_z * -1;
+ df += v_up * autocvar_g_vehicle_raptor_speed_up;
- vhic.velocity += df * frametime;
- player.velocity = player.movement = vhic.velocity;
- setorigin(player,vhic.origin + '0 0 32');
+ raptor.velocity += df * frametime;
+ player.velocity = player.movement = raptor.velocity;
+ setorigin(player,raptor.origin + '0 0 32');
// Aim the gunz
- /*
- vector target_angle, move_angle, org1, org2, targ;
-
- makevectors(player.v_angle);
-
- //targ = (vhic.origin + player.view_ofs) + v_forward * MAX_SHOT_DISTANCE;
- targ = player.cursor_trace_endpos;
-
- org1 = gettaginfo(vhic.gun1,gettagindex(vhic.gun1, "fire1"));
- org2 = gettaginfo(vhic.gun2,gettagindex(vhic.gun2, "fire1"));
-
- traceline(vhic.origin + player.view_ofs, targ, FALSE, vhic);
- targ = trace_endpos;
-
- // Find the direction
- target_angle = vectoangles(normalize(targ - org1)); // And make a angle
-
- // Find the diffrence between where we currently aim and where we want to aim
- move_angle = target_angle - (vhic.angles + vhic.gun1.angles);
- move_angle = shortangle_vxy(move_angle,(vhic.angles + vhic.gun1.angles));
- vhic.gun1.angles_x = bound(-10, move_angle_x + vhic.gun1.angles_x, 10);
- vhic.gun1.angles_y = bound(-15, move_angle_y + vhic.gun1.angles_y, 15);
+ crosshair_trace(player);
+ ftmp2 = autocvar_g_vehicle_raptor_guns_turnspeed * frametime;
+ ftmp = -ftmp2;
+
+ // Gun1
+ df = vectoangles(normalize(trace_endpos - gettaginfo(raptor.gun1, gettagindex(raptor.gun1, "fire1")))); // Find the direction & angle
+ df = shortangle_vxy(df - (raptor.angles + raptor.gun1.angles), raptor.angles + raptor.gun1.angles); // Find aim offset
+ // Bind to aimspeed
+ df_x = bound(ftmp, df_x, ftmp2);
+ df_y = bound(ftmp, df_y, ftmp2);
+ // Bind to limts
+ raptor.gun1.angles_x = bound(-(autocvar_g_vehicle_raptor_guns_pitchlimit + 8), df_x + raptor.gun1.angles_x, autocvar_g_vehicle_raptor_guns_pitchlimit);
+ raptor.gun1.angles_y = bound(-autocvar_g_vehicle_raptor_guns_turnlimit, df_y + raptor.gun1.angles_y, autocvar_g_vehicle_raptor_guns_turnlimit);
+
+ //Gun 2
+ df = vectoangles(normalize(trace_endpos - gettaginfo(raptor.gun2, gettagindex(raptor.gun2, "fire1")))); // Find the direction & angle
+ df = shortangle_vxy(df - (raptor.angles + raptor.gun2.angles), raptor.angles + raptor.gun2.angles); // Find aim offset
+ // Bind to aimspeed
+ df_x = bound(ftmp, df_x, ftmp2);
+ df_y = bound(ftmp, df_y, ftmp2);
+ // Bind to limts
+ raptor.gun2.angles_x = bound(-(autocvar_g_vehicle_raptor_guns_pitchlimit + 8), df_x + raptor.gun2.angles_x, autocvar_g_vehicle_raptor_guns_pitchlimit);
+ raptor.gun2.angles_y = bound(-autocvar_g_vehicle_raptor_guns_turnlimit, df_y + raptor.gun2.angles_y, autocvar_g_vehicle_raptor_guns_turnlimit);
- // Find the direction
- target_angle = vectoangles(normalize(targ - org2)); // And make a angle
- move_angle = target_angle - (vhic.angles + vhic.gun2.angles);
- move_angle = shortangle_vxy(move_angle,(vhic.angles + vhic.gun2.angles));
- vhic.gun2.angles_x = bound(-15,move_angle_x + vhic.gun2.angles_x,15);
- vhic.gun2.angles_y = bound(-20,move_angle_y + vhic.gun2.angles_y,20);
- */
if(player.BUTTON_ATCK)
- if(vhic.vehicle_energy > (raptor_beam_aps * sys_frametime))
+ if(raptor.attack_finished_single <= time)
+ if(raptor.vehicle_energy > autocvar_g_vehicle_raptor_cannon_cost)
{
- vector start;
- self = player;
-
- start = gettaginfo(vhic.gun1, gettagindex(vhic.gun1, "fire1"));
- traceline(start, start + v_forward * MAX_SHOT_DISTANCE, TRUE, player);
- te_lightning1(vhic.gun1, start, trace_endpos);
- raptor_beam(start, trace_endpos, '-1 -1 -1' * raptor_beam_size, '1 1 1' * raptor_beam_size, raptor_beam_fops * sys_frametime, raptor_beam_dps * sys_frametime, DEATH_SBROCKET);
-
-
- start = gettaginfo(vhic.gun2, gettagindex(vhic.gun2, "fire1"));
- traceline(start, start + v_forward * MAX_SHOT_DISTANCE, TRUE, player);
- te_lightning1(vhic.gun2, start, trace_endpos);
- raptor_beam(start, trace_endpos, '-1 -1 -1' * raptor_beam_size, '1 1 1' * raptor_beam_size, raptor_beam_fops * sys_frametime, raptor_beam_dps * sys_frametime, DEATH_SBROCKET);
-
- self = vhic;
+ raptor_fire_cannon(self.gun1, "fire1");
+ raptor_fire_cannon(self.gun2, "fire1");
- vhic.vehicle_energy -= raptor_beam_aps * sys_frametime;
- vhic.cnt = time + 1;
+ raptor.vehicle_energy -= autocvar_g_vehicle_raptor_cannon_cost;
+ raptor.attack_finished_single = time + autocvar_g_vehicle_raptor_cannon_refire;
+ self.cnt = time;
}
- if(vhic.cnt < time)
- vhic.vehicle_energy = min(vhic.vehicle_energy += raptor_energy_regen * frametime, raptor_energy_max);
+ if(self.vehicle_flags & VHF_SHIELDREGEN)
+ vehicles_regen(dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, frametime);
- player.vehicle_energy = vhic.vehicle_energy / raptor_energy_max;
+ if(self.vehicle_flags & VHF_HEALTHREGEN)
+ vehicles_regen(dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, frametime);
+ if(self.vehicle_flags & VHF_ENERGYREGEN)
+ vehicles_regen(cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime);
+ player.vehicle_energy = raptor.vehicle_energy / autocvar_g_vehicle_raptor_energy;
+
+ if(time > raptor.delay)
if(player.BUTTON_ATCK2)
- if(time > vhic.delay)
{
raptor_bombdrop();
- vhic.delay = time + raptor_bombs_refire;
+ raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
+ raptor.lip = time;
}
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
- vehicle_stdproc_shiledregen(raptor_shield_max, frametime);
- vehicle_stdproc_healthregen(raptor_health_max, frametime);
-
- self = player;
-
- return 1;
-}
-
-float raptor_takeoff()
-{
- entity player, vhic;
+ player.vehicle_reload1 = (time - raptor.lip) / (raptor.delay - raptor.lip);
+ VEHICLE_UPDATE_PLAYER(health, raptor);
- if(self.vehicle.frame < 25)
- return 1;
+ if(self.vehicle_flags & VHF_HASSHIELD)
+ VEHICLE_UPDATE_PLAYER(shield, raptor);
- player = self;
- vhic = self.vehicle;
- self = vhic;
-
- if(raptor_altitude(512) <= 256)
- {
- vhic.velocity_z = min(vhic.velocity_z * 1.5, 256);
- }
- else
- {
- player.PlayerPhysplug = raptor_pplug;
- }
+ player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
- player.BUTTON_CROUCH = player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
self = player;
-
return 1;
}
-float raptor_land()
-{
- return 0;
-}
-
-void raptor_return()
-{
- pointparticles(particleeffectnum("teleport"), self.enemy.origin + '0 0 64', '0 0 0', 1);
- self.enemy.think = raptor_spawn;
- self.enemy.nextthink = time;
- remove(self);
-}
-
-void raptor_think()
-{
-}
-
void raptor_touch()
{
if(self.owner)
if(other.vehicle != world)
return;
- raptor_enter();
+ vehicles_enter();
+}
+
+void raptor_blowup()
+{
+ sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+
+ self.deadflag = DEAD_DEAD;
+ self.vehicle_exit(VHEF_NORMAL);
+ RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world);
+
+ self.alpha = -1;
+ self.movetype = MOVETYPE_NONE;
+ self.effects = EF_NODRAW;
+ self.colormod = '0 0 0';
+ self.avelocity = '0 0 0';
+ self.velocity = '0 0 0';
+
+ setorigin(self, self.pos1);
+ self.touch = SUB_Null;
}
void raptor_die()
self.health = 0;
self.event_damage = SUB_Null;
self.iscreature = FALSE;
- self.solid = SOLID_NOT;
+ self.solid = SOLID_CORPSE;
self.takedamage = DAMAGE_NO;
- //self.touch = racer_dietouch;
self.deadflag = DEAD_DYING;
self.movetype = MOVETYPE_BOUNCE;
- self.wait = time;
+ //self.wait = time;
pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
- self.velocity += '0 0 128';
+ self.velocity_z += 128;
if(random() < 0.5)
- self.avelocity_z = 45;
+ self.avelocity_z = 45 + random() * 270;
else
- self.avelocity_z = -45;
+ self.avelocity_z = -45 + random() * -270;
self.colormod = '-0.5 -0.5 -0.5';
+ self.touch = raptor_blowup;
self.think = raptor_spawn;
- self.nextthink = time + 5;
+ self.nextthink = time + autocvar_g_vehicle_raptor_respawntime;
}
void raptor_spawn()
self.flags = FL_NOTARGET;
self.effects = 0;
- self.vehicle_health = raptor_health_max;
- self.vehicle_shield = raptor_shield_max;
-
- self.event_damage = vehicle_stdproc_damage;
- self.touch = raptor_touch;
-
- self.iscreature = TRUE;
- 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_health = autocvar_g_vehicle_raptor_health;
+ self.vehicle_shield = autocvar_g_vehicle_raptor_shield;
+ self.event_damage = vehicles_damage;
+ self.touch = raptor_touch;
+ self.iscreature = TRUE;
+ 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;
+ self.bomb1.gun1.avelocity_y = 90;
+ self.bomb1.gun2.avelocity_y = -90;
+ self.frame = 0;
+
setorigin(self, self.pos1);
self.angles = self.pos2;
- setsize(self,RAPTOR_MIN ,RAPTOR_MAX );
+ setsize(self, RAPTOR_MIN, RAPTOR_MAX );
pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
self.delay = time;
}
-float raptor_customizeentityforclient()
-{
- if(self.deadflag == DEAD_DEAD)
- return FALSE;
-
- /*
- if(other == self.owner)
- self.alpha = -1;
- else
- self.alpha = 1;
- */
-
- return TRUE;
-}
-
void raptor_dinit()
{
+ entity spinner;
+ vector ofs;
+
+ if not (vehicle_initialize(
+ "Raptor",
+ "models/vehicles/raptor.dpm",
+ "",
+ "models/vehicles/raptor_cockpit.dpm",
+ "", "tag_hud", "tag_camera",
+ HUD_RAPTOR,
+ RAPTOR_MIN, RAPTOR_MAX,
+ FALSE,
+ raptor_spawn, raptor_frame,
+ raptor_enter, raptor_exit,
+ raptor_die, raptor_think))
+ {
+ remove(self);
+ return;
+ }
- if (self.netname == "")
- self.netname = "Raptor";
-
- setorigin(self, self.origin);
+ //FIXME: Camera is in a bad place in HUD model.
+ setorigin(self.vehicle_viewport, '10 0 3');
self.frame = 0;
- setmodel(self,"models/vehicles/raptor.dpm");
-
self.bomb1 = spawn();
self.bomb2 = spawn();
+ self.gun1 = spawn();
+ self.gun2 = spawn();
setmodel(self.bomb1,"models/vehicles/raptor_bomb.dpm");
setmodel(self.bomb2,"models/vehicles/raptor_bomb.dpm");
+ setmodel(self.gun1, "models/vehicles/raptor_gun.dpm");
+ setmodel(self.gun2, "models/vehicles/raptor_gun.dpm");
setattachment(self.bomb1, self,"bombmount_left");
setattachment(self.bomb2, self,"bombmount_right");
+ // FIXME Guns mounts to angled bones
+ // This messes up gun-aim, so work arround it.
+ //setattachment(self.gun1, self, "gunmount_left");
+ ofs = gettaginfo(self, gettagindex(self, "gunmount_left"));
+ ofs -= self.origin;
+ setattachment(self.gun1, self, "");
+ setorigin(self.gun1, ofs);
- if not (self.vehicle_hudmodel)
- {
- self.vehicle_hudmodel = spawn();
- setmodel(self.vehicle_hudmodel, "models/vehicles/raptor_cockpit.dpm");
- //setattachment(self.vehicle_hudmodel, self, "tag_viewport");
- setattachment(self.vehicle_hudmodel, self, "tag_hud");
- }
-
- if not (self.vehicle_viewport)
- {
- self.vehicle_viewport = spawn();
- setmodel (self.vehicle_viewport, "null");
- setattachment(self.vehicle_viewport, self.vehicle_hudmodel, "tag_camera");
- }
-
- if not (self.gun1)
- {
- self.gun1 = spawn();
- setmodel(self.gun1, "models/vehicles/raptor_gun.dpm");
- setattachment(self.gun1, self, "gunmount_left");
- }
+ //setattachment(self.gun2, self, "gunmount_right");
+ ofs = gettaginfo(self, gettagindex(self, "gunmount_right"));
+ ofs -= self.origin;
+ setattachment(self.gun2, self, "");
+ setorigin(self.gun2, ofs);
- if not (self.gun2)
- {
- self.gun2 = spawn();
- setmodel(self.gun2, "models/vehicles/raptor_gun.dpm");
- setattachment(self.gun2, self, "gunmount_right");
- }
-
- self.tur_head = spawn();
- self.pos1 = self.origin;
- self.pos2 = self.angles;
-
- self.vehicle_hudmodel.viewmodelforclient = self;
- self.customizeentityforclient = raptor_customizeentityforclient;
-
- self.vehicle_die = raptor_die;
- self.vehicle_exit = raptor_exit;
-
-
- entity spinner;
spinner = spawn();
spinner.owner = self;
setmodel(spinner,"models/vehicles/spinner.dpm");
setattachment(spinner, self, "engine_left");
spinner.movetype = MOVETYPE_NOCLIP;
spinner.avelocity = '0 90 0';
+ self.bomb1.gun1 = spinner;
spinner = spawn();
spinner.owner = self;
setattachment(spinner, self, "engine_right");
spinner.movetype = MOVETYPE_NOCLIP;
spinner.avelocity = '0 -90 0';
-
- addstat(STAT_HUD, AS_INT, hud);
- addstat(STAT_VEHICLESTAT_HEALTH, AS_FLOAT, vehicle_health);
- addstat(STAT_VEHICLESTAT_SHIELD, AS_FLOAT, vehicle_shield);
- addstat(STAT_VEHICLESTAT_ENERGY, AS_FLOAT, vehicle_energy);
-
- addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
- addstat(STAT_VEHICLESTAT_RELOAD1, AS_FLOAT, vehicle_reload1);
-
- addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
- addstat(STAT_VEHICLESTAT_RELOAD2, AS_FLOAT, vehicle_reload2);
-
- raptor_spawn();
+ self.bomb1.gun2 = spinner;
}
void spawnfunc_vehicle_raptor()
{
- self.cvar_basename = "g_vehicle_raptor";
- raptor_loadsettings();
+ vehicles_configcheck("vehicle_raptor.cfg", autocvar_g_vehicle_raptor_health);
- self.vehicle_flags = VHF_HASSHIELD | VHF_SHIELDREGEN;
+ if(autocvar_g_vehicle_raptor_shield)
+ self.vehicle_flags |= VHF_HASSHIELD;
- traceline(self.origin, self.origin - '0 0 2048', MOVE_WORLDONLY, self);
- if(trace_startsolid)
- {
- dprint("WARNING: vehicle_raptor placed in solid\n");
- traceline(self.origin + '0 0 512' ,self.origin - '0 0 2048',MOVE_WORLDONLY,self);
- if(trace_startsolid || trace_fraction == 1.0)
- {
- dprint("ERROR: vehicle_raptor placed in more then 512 units into solid\n");
- remove(self);
- return;
- }
- }
+ if(autocvar_g_vehicle_raptor_shield_regen)
+ self.vehicle_flags |= VHF_SHIELDREGEN;
- if(trace_fraction != 1.0)
- setorigin(self,trace_endpos + '0 0 8');
- else
- dprint("WARNING: vehicle_racer placed more then 2048 units above ground.\n");
+ if(autocvar_g_vehicle_raptor_health_regen)
+ self.vehicle_flags |= VHF_HEALTHREGEN;
+
+ if(autocvar_g_vehicle_raptor_energy_regen)
+ self.vehicle_flags |= VHF_ENERGYREGEN;
precache_model ("models/vehicles/raptor.dpm");
precache_model ("models/vehicles/raptor_gun.dpm");
self.think = raptor_dinit;
self.nextthink = time + 1;
}
-
-
-void spawnfunc_vehicle_raptor2()
-{
- entity iqm,dpm,md3;
-
- precache_model ("models/vehicles/test.iqm");
- precache_model ("models/vehicles/test.dpm");
- precache_model ("models/vehicles/test.md3");
-
- iqm = spawn();
- dpm = spawn();
- md3 = spawn();
- iqm.scale = md3.scale = dpm.scale = 10;
-
- //setmodel(iqm,"models/vehicles/test.iqm");
- //setmodel(dpm,"models/vehicles/test.dpm");
- setmodel(md3,"models/vehicles/test.md3");
-
- setorigin(iqm, self.origin + '0 0 16');
- setorigin(dpm, self.origin + '0 20 32');
- setorigin(iqm, self.origin + '0 40 48');
-}
-const vector spiderbot_MIN = '-75 -75 0';
-const vector spiderbot_MAX = '75 75 100';
-
-#define spiderbot_spawnpnt wkr_spawn
+const vector spiderbot_MIN = '-75 -75 10';
+const vector spiderbot_MAX = '75 75 110';
+
+float autocvar_g_vehicle_spiderbot_respawntime;
+
+float autocvar_g_vehicle_spiderbot_crush_dmg;
+float autocvar_g_vehicle_spiderbot_crush_force;
+
+float autocvar_g_vehicle_spiderbot_head_pitchlimit_down;
+float autocvar_g_vehicle_spiderbot_head_pitchlimit_up;
+float autocvar_g_vehicle_spiderbot_head_pitchspeed;
+float autocvar_g_vehicle_spiderbot_head_turnlimit;
+float autocvar_g_vehicle_spiderbot_head_turnspeed;
+
+//float autocvar_g_vehicle_spiderbot_energy;
+//float autocvar_g_vehicle_spiderbot_energy_regen;
+//float autocvar_g_vehicle_spiderbot_energy_regen_pause;
+
+float autocvar_g_vehicle_spiderbot_health;
+float autocvar_g_vehicle_spiderbot_health_regen;
+float autocvar_g_vehicle_spiderbot_health_regen_pause;
+
+float autocvar_g_vehicle_spiderbot_shield;
+float autocvar_g_vehicle_spiderbot_shield_regen;
+float autocvar_g_vehicle_spiderbot_shield_regen_pause;
+
+float autocvar_g_vehicle_spiderbot_minigun_cooldown;
+float autocvar_g_vehicle_spiderbot_minigun_damage;
+float autocvar_g_vehicle_spiderbot_minigun_heat;
+float autocvar_g_vehicle_spiderbot_minigun_refire;
+float autocvar_g_vehicle_spiderbot_minigun_spread;
+float autocvar_g_vehicle_spiderbot_movement_inertia;
+
+float autocvar_g_vehicle_spiderbot_rocket_damage;
+float autocvar_g_vehicle_spiderbot_rocket_edgedamage;
+float autocvar_g_vehicle_spiderbot_rocket_force;
+float autocvar_g_vehicle_spiderbot_rocket_health;
+float autocvar_g_vehicle_spiderbot_rocket_lifetime;
+float autocvar_g_vehicle_spiderbot_rocket_noise;
+float autocvar_g_vehicle_spiderbot_rocket_radius;
+float autocvar_g_vehicle_spiderbot_rocket_refire;
+float autocvar_g_vehicle_spiderbot_rocket_reload;
+float autocvar_g_vehicle_spiderbot_rocket_speed;
+float autocvar_g_vehicle_spiderbot_rocket_turnrate;
+
+float autocvar_g_vehicle_spiderbot_shield;
+float autocvar_g_vehicle_spiderbot_speed_stop;
+float autocvar_g_vehicle_spiderbot_speed_strafe;
+float autocvar_g_vehicle_spiderbot_speed_walk;
+float autocvar_g_vehicle_spiderbot_turnspeed;
+
+
+float autocvar_g_vehicle_spiderbot_springlength;
+float autocvar_g_vehicle_spiderbot_springup;
+float autocvar_g_vehicle_spiderbot_springblend;
void spiderbot_exit(float eject);
void spiderbot_enter();
+void spiderbot_spawn();
void spiderbot_rocket_explode()
{
return;
}
-
self.wait = 1;
}
else
self.gun2.cnt = time + self.attack_finished_single;
}
-/*
-void spiderbot_minigun_fire_Flash_Go() {
- if (self.frame > 10)
- {
- self.alpha = -1;
- setmodel(self,"");
- return;
- }
-
- self.frame = self.frame + 2;
- self.alpha = self.alpha - 0.2;
- self.scale -= 0.01;
- self.nextthink = time + 0.02;
-}
-*/
-
void spiderbot_minigun_fire(entity gun, float trail)
{
vector v;
-
- v = gettaginfo(gun,gettagindex(gun,"barrels"));
- v_forward = normalize(v_forward);
+ entity oldself;
- sound (gun, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
+ v = gettaginfo(gun, gettagindex(gun,"barrels"));
+ v_forward = normalize(v_forward);
+ v += v_forward * 50;
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);
-
- UziFlash();
- setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
-
if(trail)
- trailparticles(self, particleeffectnum("EF_MGTURRETTRAIL"), v, trace_endpos);
+ {
+ 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);
+ pointparticles(particleeffectnum("spiderbot_minigun_impact"), trace_endpos, trace_plane_normal * 2500,1);
+ }
}
void spiderbot_miniguns_do()
if((self.vehicle_reload1 == 1) || (!self.owner.BUTTON_ATCK))
{
-
ftmp = 1 / autocvar_g_vehicle_spiderbot_minigun_cooldown * sys_frametime;
self.owner.vehicle_reload1 = max(self.owner.vehicle_reload1 - ftmp, 0);
if(self.owner.vehicle_reload1 <= 0)
self.vehicle_reload1 = 0;
- return ;
+ return;
}
if (self.owner.BUTTON_ATCK)
spiderbot_minigun_fire(self.vehicle.gun2, 0);
self.misc_bulletcounter += 1;
}
-
self = self.vehicle;
ftmp = autocvar_g_vehicle_spiderbot_minigun_refire / autocvar_g_vehicle_spiderbot_minigun_heat;
}
else
self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_refire + time;
- }
- self = self.owner;
+ }
return;
}
}
-float spiderbot_pplug()
+float spiderbot_frame()
{
vector ad;
- entity player,spider;
+ entity player, spider;
float ftmp;
- if not (self.owner)
- {
- }
-
player = self;
spider = self.vehicle;
- player.BUTTON_ZOOM = 0;
- player.BUTTON_CROUCH = 0;
- player.switchweapon = 0;
+ player.BUTTON_ZOOM = 0;
+ player.BUTTON_CROUCH = 0;
+ player.switchweapon = 0;
if(player.BUTTON_USE)
{
self = spider;
- spiderbot_exit(0);
+ vehicles_exit(VHEF_NORMAL);
self = player;
return 0;
}
+ self = spider;
+
crosshair_trace(player);
ad = vectoangles(normalize(trace_endpos - gettaginfo(spider.tur_head,gettagindex(spider.tur_head,"tag_hud")))) - (spider.tur_head.angles + spider.angles);
-
- fixedmakevectors(spider.angles);
if(ad_x > 180) ad_x -= 360;
if(ad_x < -180) ad_x += 360;
if(ad_y > 180) ad_y -= 360;
ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
- self = spider;
+ //fixedmakevectors(self.angles);
+ // Not sure why this works better, but it does.
+ spider.tur_head.angles_x *= -1;
+ spider.angles_x *= -1;
+ makevectors(spider.angles);
+ spider.tur_head.angles_x *= -1;
+ spider.angles_x *= -1;
+
+ /*
+ vector ofs;
+ ofs = self.origin + v_up * 128;
+ te_lightning1(world, ofs, ofs + v_up * 32);
+ te_lightning1(world, ofs, ofs + v_right * 128);
+ te_lightning1(world, ofs, ofs + v_forward * 256);
+ */
+
+ movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend);
+
if(spider.flags & FL_ONGROUND)
{
if(player.BUTTON_JUMP && self.tur_head.wait < time)
}
movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
}
-
}
}
- movelib_groundalign4point(300,100,0.25);
}
+ self.angles_x = bound(-60, self.angles_x, 60);
+ self.angles_z = bound(-60, self.angles_z, 60);
+
spiderbot_miniguns_do();
spiderbot_rocket_do();
- vehicle_stdproc_shiledregen(CCVAR("_shield"), frametime);
- vehicle_stdproc_healthregen(CCVAR("_health"), frametime);
+
+ if(self.vehicle_flags & VHF_SHIELDREGEN)
+ vehicles_regen(dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime);
+
+ if(self.vehicle_flags & VHF_HEALTHREGEN)
+ vehicles_regen(dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
player.vehicle_ammo2 = spider.tur_head.frame;
else
player.vehicle_reload2 = 1 - ((spider.gun2.cnt - time) / spider.attack_finished_single);
- setorigin(player,spider.origin + '0 0 64');
+ setorigin(player, spider.origin + '0 0 64');
player.velocity = spider.velocity;
- self = player;
+ VEHICLE_UPDATE_PLAYER(health, spiderbot);
+
+ if(self.vehicle_flags & VHF_HASSHIELD)
+ VEHICLE_UPDATE_PLAYER(shield, spiderbot);
+ 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);
+ SpawnOrUpdateAuxiliaryXhair(player, trace_endpos);
+
+ //player.angles_x = 0.01 * spider.angles_x + 0.99 * player.v_angle_x;
+ //player.angles_y = 0.01 * spider.angles_y + 0.99 * player.v_angle_y;
+ player.v_angle_y = spider.angles_y;
+ //player.angles_x = player.v_angle_x;
+ //player.angles_y = player.v_angle_y;
+ //player.fixangle = TRUE;
+
+ self = player;
return 1;
}
void spiderbot_enter()
{
- // Remove this when bots know how to use the spiderbot
- if (clienttype(other) != CLIENTTYPE_REAL)
- return;
-
- self.colormod = self.tur_head.colormod = '0 0 0';
-
- if(teams_matter)
- if(self.team)
- if(self.team != other.team)
- return;
-
- self.owner = other;
- self.switchweapon = other.switchweapon;
-
- self.event_damage = vehicle_stdproc_damage ;
- self.colormap = self.owner.colormap;
- self.tur_head.colormap = self.owner.colormap;
- self.vehicle_hudmodel.viewmodelforclient = self.owner;
- self.nextthink = 0;
- self.owner.angles = self.angles;
- self.owner.takedamage = DAMAGE_NO;
- self.owner.solid = SOLID_NOT;
- self.owner.movetype = MOVETYPE_NOCLIP;
- self.owner.alpha = -1;
- self.owner.PlayerPhysplug = spiderbot_pplug;
- self.owner.vehicle = self;
- self.owner.event_damage = SUB_Null;
- self.owner.hud = HUD_SPIDERBOT;
self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_spiderbot_health);
self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_spiderbot_shield);
- self.owner.view_ofs = '0 0 0';
- self.owner.vehicle_ammo1 = self.vehicle_ammo1;
- self.owner.vehicle_ammo2 = self.vehicle_ammo2;
- self.owner.vehicle_reload1 = self.vehicle_reload1;
- self.owner.vehicle_reload2 = self.vehicle_reload2;
-
- //if(other.flags & FL_ONGROUND)
- other.flags &~= FL_ONGROUND;
-
- //if(self.flags & FL_ONGROUND)
- self.flags &~= FL_ONGROUND;
-
- self.team = self.owner.team;
- self.flags -= FL_NOTARGET;
-
- if(clienttype(other) == CLIENTTYPE_REAL)
- {
- msg_entity = other;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity(MSG_ONE, self.vehicle_viewport);
-
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, self.tur_head.angles_x + self.angles_x); // tilt
- WriteAngle(MSG_ONE, self.tur_head.angles_y + self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
- }
}
void spiderbot_exit(float eject)
{
entity e;
- self.frame = 5;
- self.flags |= FL_NOTARGET;
+ vehicles_setreturn(autocvar_g_vehicle_spiderbot_respawntime, spiderbot_spawn);
e = findchain(classname,"spiderbot_rocket");
while(e)
e = e.chain;
}
- self.owner.switchweapon = self.switchweapon;
-
- self.velocity = '0 0 0';
- if(clienttype(self.owner) == CLIENTTYPE_REAL)
- {
- msg_entity = self.owner;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity( MSG_ONE, self.owner);
-
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, 0); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
- }
-
- self.think = spiderbot_think;
- self.nextthink = time;
- self.owner.takedamage = DAMAGE_AIM;
- self.owner.solid = SOLID_SLIDEBOX;
- self.owner.movetype = MOVETYPE_WALK;
-
- setsize(self.owner,PL_MIN,PL_MAX);
-
- self.owner.alpha = 1;
- self.owner.PlayerPhysplug = SUB_Null;
- self.owner.vehicle = world;
- self.owner.view_ofs = PL_VIEW_OFS;
- self.owner.hud = HUD_NORMAL;
- self.owner.event_damage = PlayerDamage;
-
- self.colormap = 1024;
- self.tur_head.colormap = 1024;
-
- if not (teams_matter)
- self.team = 0;
- else
- {
- self.team = self.spiderbot_spawnpnt.team ;
- if (self.team == COLOR_TEAM1) self.colormod = '1.4 0.8 0.8';
- if (self.team == COLOR_TEAM2) self.colormod = '0.8 0.8 1.4';
- self.tur_head.colormod = self.colormod;
- }
+ self.velocity = '0 0 0';
+ self.think = spiderbot_think;
+ self.nextthink = time;
+ self.frame = 5;
- self.vehicle_hudmodel.viewmodelforclient = self;
- self.tur_head.nodrawtoclient = self;
+ if not (self.owner)
+ return;
- setattachment(self.owner,world,"");
+ Release_AuxiliaryXhair(self.owner);
makevectors(self.angles);
if(eject)
{
- setorigin(self.owner,self.origin + v_forward * 100 + '0 0 64');
+ setorigin(self.owner ,self.origin + v_forward * 100 + '0 0 64');
self.owner.velocity = (v_up + v_forward * 0.25) * 750;
}
else
- setorigin(self.owner,self.origin - v_forward * 200 + '0 0 64');
+ setorigin(self.owner, self.origin - v_forward * 200 + '0 0 64');
self.owner = world;
}
+// Better way of determening whats crushable needed! (fl_crushable?)
float spiderbot_crushable(entity e)
{
if(e.classname == "corpse")
//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_SBCRUSH,'0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicle_spiderbot_crush_force );
+ Damage(other, self, self.owner,autocvar_g_vehicle_spiderbot_crush_dmg,DEATH_SBCRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicle_spiderbot_crush_force);
return;
}
if(other.vehicle != world)
return;
- spiderbot_enter();
+ vehicles_enter();
}
-float spiderbot_customizeentityforclient()
-{
- if(self.deadflag == DEAD_DEAD)
- return FALSE;
-
- return TRUE;
-}
void spiderbot_spawn()
{
- self.frame = 5;
- self.think = spiderbot_think;
- self.nextthink = time;
- setsize(self,spiderbot_MIN,spiderbot_MAX);
-
- self.owner = world;
- self.velocity = '0 0 0';
- self.vehicle_health = CCVAR("_health");
- self.vehicle_shield = CCVAR("_shield");
- self.event_damage = vehicle_stdproc_damage;
- self.iscreature = TRUE;
- self.movetype = MOVETYPE_WALK;
- self.solid = SOLID_SLIDEBOX;
- self.takedamage = DAMAGE_AIM;
- self.touch = spiderbot_touch;
- self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
- self.tur_head.angles = '0 0 0';
- self.colormap = 1024;
- self.tur_head.colormap = 1024;
- self.deadflag = DEAD_NO;
- self.bot_attack = TRUE;
- self.flags |= FL_NOTARGET;
+ setsize(self, spiderbot_MIN, spiderbot_MAX);
+
+ self.frame = 5;
+ self.think = spiderbot_think;
+ self.nextthink = time;
+ self.owner = world;
+ self.velocity = '0 0 0';
+ self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
+ self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
+ self.event_damage = vehicles_damage;
+ self.iscreature = TRUE;
+ self.movetype = MOVETYPE_WALK;
+ self.solid = SOLID_SLIDEBOX;
+ self.takedamage = DAMAGE_AIM;
+ self.touch = spiderbot_touch;
+ self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
+ self.tur_head.angles = '0 0 0';
+ self.colormap = 1024;
+ self.tur_head.colormap = 1024;
+ self.deadflag = DEAD_NO;
+ self.bot_attack = TRUE;
+ self.flags |= FL_NOTARGET;
+ self.tur_head.frame = 1;
self.vehicle_hudmodel.viewmodelforclient = self;
- self.tur_head.frame = 1;
- setorigin(self,self.spiderbot_spawnpnt.origin + '0 0 1.25' * spiderbot_MAX_z);
- self.angles = self.spiderbot_spawnpnt.angles;
+ setorigin(self, self.pos1 + '0 0 128');
+ self.angles = self.pos2;
if (self.team == COLOR_TEAM1)
self.colormod = '1.4 0.8 0.8';
self.tur_head.colormod = self.colormod;
- pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
+}
+
+void spiderbot_headfade()
+{
+ self.think = spiderbot_headfade;
+ self.nextthink = self.fade_time;
+ self.alpha = 1 - (time - self.fade_time) * self.fade_rate;
+
+ if(self.cnt < time || self.alpha < 0.1)
+ {
+ if(self.alpha > 0.1)
+ {
+ sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin + '0 0 100', '0 0 0', 1);
+ }
+ remove(self);
+ }
}
void spiderbot_blowup()
{
+ float i;
sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
+
+ for(i = 0; i < 5; ++i)
+ {
+ pointparticles(particleeffectnum("rocket_explode"), self.origin + (randomvec() * 100) + '0 0 100', '0 0 0', 1);
+ }
+
+ entity h, g1, g2, b;
+ b = spawn();
+ h = spawn();
+ g1 = spawn();
+ g2 = spawn();
+
+ setmodel(b, "models/vehicles/spiderbot.dpm");
+ setmodel(h, "models/vehicles/spiderbot_top.dpm");
+ setmodel(g1, "models/vehicles/spiderbot_barrels.dpm");
+ setmodel(g2, "models/vehicles/spiderbot_barrels.dpm");
+
+ setorigin(b, self.origin);
+ setorigin(h, gettaginfo(self, gettagindex(self, "tag_head")));
+ h.movetype = MOVETYPE_BOUNCE;
+ h.solid = SOLID_BBOX;
+ h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
+ h.modelflags = MF_ROCKET;
+ h.effects = EF_FLAME | EF_LOWPRECISION;
+ h.avelocity = randomvec() * 360;
+
+ h.alpha = 1;
+ h.cnt = time + (3.5 * random());
+ h.fade_rate = 1 / min(autocvar_g_vehicle_spiderbot_respawntime, 10);
+ h.fade_time = time;
+ h.think = spiderbot_headfade;
+ h.nextthink = time;
+
+ setorigin(g1, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint01")));
+ g1.movetype = MOVETYPE_TOSS;
+ g1.solid = SOLID_CORPSE;
+ g1.velocity = v_forward * 700 + (randomvec() * 32);
+ g1.avelocity = randomvec() * 180;
+
+ setorigin(g2, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint02")));
+ g2.movetype = MOVETYPE_TOSS;
+ g2.solid = SOLID_CORPSE;
+ g2.velocity = v_forward * 700 + (randomvec() * 32);
+ g2.avelocity = randomvec() * 180;
+ b.frame = 5;
+
+ h.colormod = b.colormod = g1.colormod = g2.colormod = '-2 -2 -2';
+
+ SUB_SetFade(b, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
+ //SUB_SetFade(h, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
+ SUB_SetFade(g1, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
+ SUB_SetFade(g2, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world);
self.nextthink = time + autocvar_g_vehicle_spiderbot_respawntime;
self.think = spiderbot_spawn;
self.movetype = MOVETYPE_NONE;
+ self.deadflag = DEAD_DEAD;
+ self.solid = SOLID_NOT;
+ self.tur_head.effects &~= EF_FLAME;
+ self.vehicle_hudmodel.viewmodelforclient = self;
- setorigin(self, self.tur_aimpos);
+ //setorigin(self, self.tur_aimpos);
}
void spiderbot_die()
{
-
- self.health = 0;
- self.event_damage = SUB_Null;
- self.iscreature = FALSE;
- self.solid = SOLID_NOT;
- self.takedamage = DAMAGE_NO;
- self.touch = SUB_Null;
- self.nextthink = time + random() * 2;
- self.think = spiderbot_blowup;
- self.deadflag = DEAD_DEAD;
- self.vehicle_hudmodel.viewmodelforclient = self;
- self.frame = 0;
- self.tur_head.frame = 1;
+ sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin + '0 0 100', '0 0 0', 1);
+
+ self.health = 0;
+ self.event_damage = SUB_Null;
+ self.takedamage = DAMAGE_NO;
+ self.touch = SUB_Null;
+ self.nextthink = 1 + time + random() * 2;
+ self.think = spiderbot_blowup;
+ self.deadflag = DEAD_DYING;
+ self.frame = 5;
+ self.tur_head.effects |= EF_FLAME;
+ self.colormod = self.tur_head.colormod = '-1 -1 -1';
}
void vewhicle_spiderbot_dinit()
{
+ if not (vehicle_initialize(
+ "Spiderbot",
+ "models/vehicles/spiderbot.dpm",
+ "models/vehicles/spiderbot_top.dpm",
+ "models/vehicles/spiderbot_cockpit.dpm",
+ "tag_head", "tag_hud", "",
+ HUD_SPIDERBOT,
+ spiderbot_MIN, spiderbot_MAX,
+ FALSE,
+ spiderbot_spawn, spiderbot_frame,
+ spiderbot_enter, spiderbot_exit,
+ spiderbot_die, spiderbot_think))
+ {
+ remove(self);
+ return;
+ }
- self.spiderbot_spawnpnt = spawn();
- self.spiderbot_spawnpnt.angles = self.angles;
-
- setorigin(self,self.origin);
- tracebox(self.origin + '0 0 100', spiderbot_MIN, spiderbot_MAX, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
- setorigin(self.spiderbot_spawnpnt,trace_endpos);
-
- if(self.team && !teams_matter)
- self.team = 0;
- else
- self.spiderbot_spawnpnt.team = self.team;
-
- addstat(STAT_HUD, AS_INT, hud);
- addstat(STAT_VEHICLESTAT_HEALTH, AS_FLOAT, vehicle_health);
- addstat(STAT_VEHICLESTAT_SHIELD, AS_FLOAT, vehicle_shield);
- addstat(STAT_VEHICLESTAT_ENERGY, AS_FLOAT, vehicle_energy);
- addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
- addstat(STAT_VEHICLESTAT_RELOAD1, AS_FLOAT, vehicle_reload1);
- addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
- addstat(STAT_VEHICLESTAT_RELOAD2, AS_FLOAT, vehicle_reload2);
-
- if (self.netname == "")
- self.netname = "spiderbot";
-
- self.tur_head = spawn();
self.gun1 = spawn();
self.gun2 = spawn();
- self.vehicle_viewport = spawn();
- self.vehicle_hudmodel = spawn();
- self.vehicle_flags = VHF_HASSHIELD | VHF_SHIELDREGEN | VHF_HEALTHREGEN | VHF_DEATHEJECT;
- self.cvar_basename = "g_vehicle_spiderbot";
- self.gravity = 2;
- setmodel(self, "models/vehicles/spiderbot.dpm");
- setmodel(self.tur_head, "models/vehicles/spiderbot_top.dpm");
setmodel(self.gun1, "models/vehicles/spiderbot_barrels.dpm");
setmodel(self.gun2, "models/vehicles/spiderbot_barrels.dpm");
- setmodel(self.vehicle_hudmodel, "models/vehicles/spiderbot_cockpit.dpm");
- setmodel(self.vehicle_viewport, "null");
-
- setattachment(self.tur_head, self, "tag_head");
- setattachment(self.vehicle_hudmodel, self.tur_head, "tag_hud");
- setattachment(self.vehicle_viewport, self.vehicle_hudmodel, "");
setattachment(self.gun1, self.tur_head, "tag_hardpoint01");
setattachment(self.gun2, self.tur_head, "tag_hardpoint02");
- self.tur_head.owner = self;
- self.customizeentityforclient = spiderbot_customizeentityforclient;
-
- self.tur_aimpos = self.origin;
-
- spiderbot_spawn();
-
- self.vehicle_die = spiderbot_die;
- self.vehicle_exit = spiderbot_exit;
+ self.gravity = 2;
}
void spawnfunc_vehicle_spiderbot()
precache_model ( "models/uziflash.md3");
precache_sound ( "weapons/rocket_impact.wav" );
+ precache_sound ( "weapons/uzi_fire.wav" );
+ precache_sound ( "weapons/rocket_impact.wav" );
+
+ vehicles_configcheck("vehicle_spiderbot.cfg", autocvar_g_vehicle_spiderbot_health);
+ if(autocvar_g_vehicle_spiderbot_shield)
+ self.vehicle_flags |= VHF_HASSHIELD;
+
+ if(autocvar_g_vehicle_spiderbot_shield_regen)
+ self.vehicle_flags |= VHF_SHIELDREGEN;
+
+ if(autocvar_g_vehicle_spiderbot_health_regen)
+ self.vehicle_flags |= VHF_HEALTHREGEN;
- //self.team = -1;
self.think = vewhicle_spiderbot_dinit;
self.nextthink = time + 0.5;
}
-void vehicle_stdproc_enter()
+void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void vehicles_return();
+void vehicles_clearrturn();
+
+.entity AuxiliaryXhair;
+float AuxiliaryXhair_customizeentityforclient()
+{
+ if(other == self.owner)
+ return TRUE;
+
+ return FALSE;
+}
+float AuxiliaryXhair_SendEntity(entity to, float sf)
{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+ return TRUE;
+}
+
+void SpawnOrUpdateAuxiliaryXhair(entity own, vector loc)
+{
+
+ if(own.AuxiliaryXhair == world || wasfreed(own.AuxiliaryXhair))
+ {
+ own.AuxiliaryXhair = spawn();
+ own.AuxiliaryXhair.owner = own;
+ //own.AuxiliaryXhair.customizeentityforclient = AuxiliaryXhair_customizeentityforclient;
+ own.AuxiliaryXhair.drawonlytoclient = own;
+ setorigin(own.AuxiliaryXhair, loc);
+ Net_LinkEntity(own.AuxiliaryXhair, FALSE, 0, AuxiliaryXhair_SendEntity);
+ return;
+ }
+
+ setorigin(own.AuxiliaryXhair, loc);
+ own.AuxiliaryXhair.SendFlags |= 0x01;
+}
+
+void Release_AuxiliaryXhair(entity from)
+{
+
+ from.AuxiliaryXhair.drawonlytoclient = from.AuxiliaryXhair;
+ from.AuxiliaryXhair = world;
+
+ //if not (from.AuxiliaryXhair == world || wasfreed(from.AuxiliaryXhair))
+ remove(from.AuxiliaryXhair);
}
-void vehicle_stdproc_exit(float eject)
+#define VEHICLE_UPDATE_PLAYER(fld,vhname) \
+self.owner.vehicle_##fld = self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld
+
+#define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
+traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
+if(trace_fraction != 1) \
+ acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
+
+float force_fromtag_power;
+float force_fromtag_normpower;
+vector force_fromtag_origin;
+vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power)
{
+ force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
+ v_forward = normalize(v_forward) * -1;
+ traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
+
+ force_fromtag_power = (1 - trace_fraction) * max_power;
+ force_fromtag_normpower = force_fromtag_power / max_power;
+
+ return v_forward * force_fromtag_power;
}
-void vehicle_stdproc_shiledregen(float rmax, float dt)
+vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power)
{
- if(self.vehicle_shield < rmax)
- if(self.dmg_time + CCVAR("_shield_regen_dmgpause") < time)
+
+ force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
+ v_forward = normalize(v_forward) * -1;
+ traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
+
+ if(trace_fraction == 1.0)
{
- self.vehicle_shield = min(self.vehicle_shield + CCVAR("_shield_regen") * dt, rmax);
+ force_fromtag_normpower = -0.25;
+ return '0 0 -200';
+ }
- if(self.owner)
- self.owner.vehicle_shield = self.vehicle_shield / rmax;
+ force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
+ force_fromtag_normpower = force_fromtag_power / max_power;
+
+ return v_forward * force_fromtag_power;
+}
+
+
+void vehicles_touch()
+{
+ if(other.classname != "player")
+ return;
+
+ if(other.deadflag != DEAD_NO)
+ return;
+
+ if(other.vehicle != world)
+ return;
+
+ // Remove this when bots know how to use vehicles.
+ if (clienttype(other) != CLIENTTYPE_REAL)
+ return;
+
+ self.vehicle_enter();
+}
+
+void vehicles_enter()
+{
+ // Remove this when bots know how to use vehicles
+ if (clienttype(other) != CLIENTTYPE_REAL)
+ return;
+
+ self.colormod = self.tur_head.colormod = '0 0 0';
+
+ if(teams_matter)
+ if(self.team)
+ if(self.team != other.team)
+ return;
+
+ self.owner = other;
+ self.switchweapon = other.switchweapon;
+
+ self.vehicle_hudmodel.viewmodelforclient = self.owner;
+ self.event_damage = vehicles_damage;
+ self.nextthink = 0;
+ self.owner.angles = self.angles;
+ self.owner.takedamage = DAMAGE_NO;
+ self.owner.solid = SOLID_NOT;
+ self.owner.movetype = MOVETYPE_NOCLIP;
+ self.owner.alpha = -1;
+ self.owner.vehicle = self;
+ self.owner.event_damage = SUB_Null;
+ self.owner.view_ofs = '0 0 0';
+ self.colormap = self.owner.colormap;
+ if(self.tur_head)
+ self.tur_head.colormap = self.owner.colormap;
+
+ self.owner.hud = self.hud;
+ self.owner.PlayerPhysplug = self.PlayerPhysplug;
+
+ self.owner.vehicle_ammo1 = self.vehicle_ammo1;
+ self.owner.vehicle_ammo2 = self.vehicle_ammo2;
+ self.owner.vehicle_reload1 = self.vehicle_reload1;
+ self.owner.vehicle_reload2 = self.vehicle_reload2;
+
+ other.flags &~= FL_ONGROUND;
+ self.flags &~= FL_ONGROUND;
+
+ self.team = self.owner.team;
+ self.flags -= FL_NOTARGET;
+
+ msg_entity = other;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity(MSG_ONE, self.vehicle_viewport);
+
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
+ if(self.tur_head)
+ {
+ WriteAngle(MSG_ONE, self.tur_head.angles_x + self.angles_x); // tilt
+ WriteAngle(MSG_ONE, self.tur_head.angles_y + self.angles_y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
}
+ else
+ {
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
+ WriteAngle(MSG_ONE, self.angles_x * -1); // tilt
+ WriteAngle(MSG_ONE, self.angles_y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
+ }
+
+ vehicles_clearrturn();
+
+ if(self.vehicle_enter)
+ self.vehicle_enter();
}
-void vehicle_stdproc_healthregen(float rmax, float dt)
+void vehicles_exit(float eject)
{
+ self.colormap = 1024;
+ self.tur_head.colormap = 1024;
- if(self.dmg_time + CCVAR("_health_regen_dmgpause") < time)
- if(self.vehicle_health < rmax)
+ if (teams_matter)
{
- self.vehicle_health = min(self.vehicle_health + CCVAR("_health_regen") * dt, rmax);
+ if (self.team == COLOR_TEAM1)
+ self.colormod = '1.4 0.8 0.8';
- if(self.owner)
- self.owner.vehicle_health = self.vehicle_health / rmax;
+ if (self.team == COLOR_TEAM2)
+ self.colormod = '0.8 0.8 1.4';
+
+ self.tur_head.colormod = self.colormod;
+ }
+
+
+ self.flags |= FL_NOTARGET;
+
+ if (self.owner)
+ {
+ msg_entity = self.owner;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity( MSG_ONE, self.owner);
+
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
+ WriteAngle(MSG_ONE, 0); // tilt
+ WriteAngle(MSG_ONE, self.angles_y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
+
+ setsize(self.owner,PL_MIN,PL_MAX);
+
+ self.owner.takedamage = DAMAGE_AIM;
+ self.owner.solid = SOLID_SLIDEBOX;
+ self.owner.movetype = MOVETYPE_WALK;
+ self.owner.effects &~= EF_NODRAW;
+ self.owner.alpha = 1;
+ self.owner.PlayerPhysplug = SUB_Null;
+ self.owner.vehicle = world;
+ self.owner.view_ofs = PL_VIEW_OFS;
+ self.owner.event_damage = PlayerDamage;
+ self.owner.hud = HUD_NORMAL;
+ self.owner.switchweapon = self.switchweapon;
}
+
+ self.vehicle_hudmodel.viewmodelforclient = self;
+ self.tur_head.nodrawtoclient = self;
+
+ if(self.vehicle_exit)
+ self.vehicle_exit(eject);
+
+ self.owner = world;
}
-void vehicle_stdproc_energyregen(float rmax, float dt)
+
+void vehicles_regen(.float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time)
{
- if(self.vehicle_energy < rmax)
+ if(self.regen_field < field_max)
+ if(self.timer + rpause < time)
{
- self.vehicle_energy = min(self.vehicle_energy + CCVAR("_energy_regen") * dt, rmax);
+ self.regen_field = min(self.regen_field + regen * delta_time, field_max);
if(self.owner)
- self.owner.vehicle_energy = self.vehicle_energy / rmax;
+ self.owner.regen_field = self.regen_field / field_max;
}
}
void shieldhit_think()
{
- self.alpha = self.alpha - 0.2;
+ self.alpha -= 0.1;
if (self.alpha <= 0)
{
- setmodel(self,"");
+ setmodel(self, "");
self.alpha = -1;
}
else
}
}
-void vehicle_stdproc_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
-
float ddmg_take;
self.dmg_time = time;
if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
{
-
-
if (wasfreed(self.tur_head.enemy) || self.tur_head.enemy == world)
{
self.tur_head.enemy = spawn();
setmodel(self.tur_head.enemy, "models/vhshield.md3");
setattachment(self.tur_head.enemy, self, "");
- self.tur_head.enemy.colormod = '1 1 1';
- self.tur_head.enemy.alpha = 0.45;
- self.tur_head.enemy.scale = (256 / vlen(self.maxs - self.mins));
- self.tur_head.enemy.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
- self.tur_head.enemy.think = shieldhit_think;
- self.tur_head.enemy.nextthink = time;
+ self.tur_head.enemy.colormod = '1 1 1';
+ self.tur_head.enemy.alpha = 0.45;
+ self.tur_head.enemy.scale = (256 / vlen(self.maxs - self.mins));
+ self.tur_head.enemy.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
+ self.tur_head.enemy.think = shieldhit_think;
+ self.tur_head.enemy.nextthink = time;
self.vehicle_shield -= damage;
if(self.vehicle_shield < 0)
{
self.tur_head.enemy.colormod = '10 0 -1';
ddmg_take = fabs(self.vehicle_shield);
- self.vehicle_shield = 0;
- self.tur_head.enemy.alpha = 0.75;
- self.vehicle_health -= ddmg_take;
+ self.vehicle_shield = 0;
+ self.tur_head.enemy.alpha = 0.75;
+ self.vehicle_health -= ddmg_take;
}
}
else
self.vehicle_health -= damage;
- if(self.owner)
+ if(self.vehicle_health <= 0)
{
- self.owner.vehicle_health = self.vehicle_health / CCVAR("_health");
+ if(self.owner)
+ if(self.vehicle_flags & VHF_DEATHEJECT)
+ vehicles_exit(VHEF_EJECT);
+ else
+ vehicles_exit(VHEF_RELESE);
+
+ self.vehicle_die();
+ }
+}
- if(self.vehicle_flags & VHF_HASSHIELD)
- self.owner.vehicle_shield = self.vehicle_shield / cvar(strcat(self.cvar_basename,"_shield"));
+void vehicles_return()
+{
+ pointparticles(particleeffectnum("teleport"), self.enemy.origin + '0 0 64', '0 0 0', 1);
+ self.enemy.think = self.use;
+ self.enemy.nextthink = time;
+ remove(self);
+}
+void vehicles_clearrturn()
+{
+ entity ret;
+ // Remove "return helper", if any.
+ ret = findchain(classname, "vehicle_return");
+ while(ret)
+ {
+ if(ret.enemy == self)
+ {
+ ret.think = SUB_Remove;
+ ret.nextthink = time + 0.1;
+ return;
+ }
+ ret = ret.chain;
}
+}
- if(self.vehicle_health <= 0)
+void vehicles_setreturn(float retime, void() respawn_proc)
+{
+ vehicles_clearrturn();
+
+ if (self.deadflag == DEAD_NO)
{
- if(self.owner)
- if(self.vehicle_flags & VHF_DEATHEJECT)
- self.vehicle_exit(VHEF_EJECT);
+ entity ret;
- self.vehicle_die();
+ ret = spawn();
+ ret.classname = "vehicle_return";
+ ret.enemy = self;
+ ret.think = vehicles_return;
+ ret.nextthink = time + retime;
+ ret.use = respawn_proc;
+ }
+}
+
+float vehicles_customizeentityforclient()
+{
+ if(self.deadflag == DEAD_DEAD)
+ return FALSE;
+
+ return TRUE;
+}
+
+void vehicles_configcheck(string configname, float check_cvar)
+{
+ if(check_cvar == 0)
+ localcmd(strcat("exec ", configname, "\n"));
+}
+
+float vehicle_initialize(string net_name,
+ string bodymodel,
+ string topmodel,
+ string hudmodel,
+ string toptag,
+ string hudtag,
+ string viewtag,
+ float vhud,
+ vector min_s,
+ vector max_s,
+ float nodrop,
+ void() spawnproc,
+ float() physproc,
+ void() enterproc,
+ void(float extflag) exitfunc,
+ void() dieproc,
+ void() thinkproc )
+{
+ addstat(STAT_HUD, AS_INT, hud);
+ addstat(STAT_VEHICLESTAT_HEALTH, AS_FLOAT, vehicle_health);
+ addstat(STAT_VEHICLESTAT_SHIELD, AS_FLOAT, vehicle_shield);
+ addstat(STAT_VEHICLESTAT_ENERGY, AS_FLOAT, vehicle_energy);
+
+ addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
+ addstat(STAT_VEHICLESTAT_RELOAD1, AS_FLOAT, vehicle_reload1);
+
+ addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
+ addstat(STAT_VEHICLESTAT_RELOAD2, AS_FLOAT, vehicle_reload2);
+
+ if(bodymodel == "")
+ error("vehicles: missing bodymodel!");
+
+ if(hudmodel == "")
+ error("vehicles: missing hudmodel!");
+
+ if(net_name == "")
+ self.netname = self.classname;
+ else
+ self.netname = net_name;
+
+ if(self.team && !teams_matter)
+ self.team = 0;
+
+ setmodel(self, bodymodel);
+
+ self.vehicle_viewport = spawn();
+ self.vehicle_hudmodel = spawn();
+ self.tur_head = spawn();
+ self.tur_head.owner = self;
+ self.takedamage = DAMAGE_AIM;
+ self.bot_attack = TRUE;
+ self.iscreature = TRUE;
+ self.hud = vhud;
+
+ self.customizeentityforclient = vehicles_customizeentityforclient;
+ self.vehicle_die = dieproc;
+ self.vehicle_exit = exitfunc;
+ self.vehicle_enter = enterproc;
+ self.PlayerPhysplug = physproc;
+ self.event_damage = vehicles_damage;
+ self.touch = vehicles_touch;
+ self.think = spawnproc;
+ self.nextthink = time;
+
+ setmodel(self.vehicle_hudmodel, hudmodel);
+ setmodel(self.vehicle_viewport, "null");
+
+ if(topmodel != "")
+ {
+ setmodel(self.tur_head, topmodel);
+ setattachment(self.tur_head, self, toptag);
+ setattachment(self.vehicle_hudmodel, self.tur_head, hudtag);
+ setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
+ }
+ else
+ {
+ setattachment(self.tur_head, self, "");
+ setattachment(self.vehicle_hudmodel, self, hudtag);
+ setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
+ }
+
+ setsize(self, min_s, max_s);
+ if not (nodrop)
+ {
+ setorigin(self, self.origin);
+ tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
+ setorigin(self, trace_endpos);
}
+ self.pos1 = self.origin;
+ self.pos2 = self.angles;
+ return TRUE;
}
void bugmenot()
-//#define VEHICLES_ENABLED
+#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
+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))
+//#define CCVAR(part) cvar(strcat(self.cvar_basename,part))
//.string cvar_basename;
.float vehicle_flags;
.entity gun1;
.entity gun2;
-.entity shield;
+//.entity shield;
.float vehicle_health;
.float vehicle_shield;
.entity vehicle_viewport;
.entity vehicle_hudmodel;
-//.float anim_start;
-//.float anim_end;
-
.float dmg_time;
#define VHEF_NORMAL 0
-#define VHEF_EJECT 1
+#define VHEF_EJECT 1
+#define VHEF_RELESE 2
var .void(float exit_flags) vehicle_exit;
var .void() vehicle_enter;
#include "vehicles.qc"
-#include "spiderbot.qc"
#include "racer.qc"
+#include "spiderbot.qc"
#include "raptor.qc"
#endif
if ((trace_fraction != 1.0) && (pointcontents (trace_endpos) != CONTENT_SKY))
{
- pointparticles(particleeffectnum("TE_KNIGHTSPIKE"),end,trace_plane_normal * 2500,1);
if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
Damage_DamageInfo(trace_endpos, damage, 0, 0, dir * max(1, force), dtype, self);
+
Damage (trace_ent, self, self, damage, dtype, trace_endpos, dir * force);
- //void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC
}
trace_endpos = end;
}
-set g_vehicle_racer_reload 1
-
-set g_vehicle_racer_respawntime 10
-set g_vehicle_racer_health 250
-
-set g_vehicle_racer_shield 100
-set g_vehicle_racer_shield_block 1
-set g_vehicle_racer_shield_regen 50
-set g_vehicle_racer_shield_regen_dmgpause 0.25
-set g_vehicle_racer_shield_regen_energyrate 2
-
-set g_vehicle_racer_energy 150
-set g_vehicle_racer_energy_regen 50
-set g_vehicle_racer_energy_usepause 1
-
-set g_vehicle_racer_speed_stop 2000
-set g_vehicle_racer_speed_forward 1600
-set g_vehicle_racer_speed_strafe 750
-
-set g_vehicle_racer_speed_afterburn 3500
-set g_vehicle_racer_speed_afterburn_emin 25
-set g_vehicle_racer_speed_afterburn_cost 50
-
-set g_vehicle_racer_power_min 0
-set g_vehicle_racer_power_air 0
-set g_vehicle_racer_power_solid 8000
-
-set g_vehicle_racer_drag 0.25
-set g_vehicle_racer_dragexp 0.9
-
-set g_vehicle_racer_downforce 0.01
-
-set g_vehicle_racer_springlength 125
-set g_vehicle_racer_anglestabilizer 18
-
-set g_vehicle_racer_turnspeed 180
-set g_vehicle_racer_pitchspeed 360
+set g_vehicle_racer_respawntime 60
+
+set g_vehicle_racer_health 300
+set g_vehicle_racer_health_regen 0
+set g_vehicle_racer_health_regen_pause 0
+
+set g_vehicle_racer_shield 80
+set g_vehicle_racer_shield_regen 25
+set g_vehicle_racer_shield_regen_pause 1
+
+set g_vehicle_racer_energy 150
+set g_vehicle_racer_energy_regen 50
+set g_vehicle_racer_energy_regen 50
+set g_vehicle_racer_energy_regen_pause 1
+
+set g_vehicle_racer_speed_stop 2000
+set g_vehicle_racer_speed_forward 1500
+set g_vehicle_racer_speed_strafe 1000
+set g_vehicle_racer_speed_afterburn 3500
+set g_vehicle_racer_afterburn_cost 50 // energy consumed per second
+
+set g_vehicle_racer_hovertype 0 // 0 = hover, != 0 = maglev
+set g_vehicle_racer_hoverpower 3600 // NOTE!! x 4 (4 engines)
+set g_vehicle_racer_upforcedamper 0.94
+
+set g_vehicle_racer_downforce 0.01
+set g_vehicle_racer_springlength 40
+set g_vehicle_racer_collision_multiplier 0.55
+set g_vehicle_racer_anglestabilizer 18
+
+set g_vehicle_racer_turnspeed 200
+set g_vehicle_racer_pitchspeed 100
set g_vehicle_racer_maxpitch 25
-set g_vehicle_racer_turnroll 0.3
+set g_vehicle_racer_turnroll 32
-set g_vehicle_racer_laser_speed 18000
+set g_vehicle_racer_laser_speed 9000
set g_vehicle_racer_laser_damage 20
set g_vehicle_racer_laser_radius 100
-set g_vehicle_racer_laser_refire 0.05
+set g_vehicle_racer_laser_refire 0.1
set g_vehicle_racer_laser_cost 2
set g_vehicle_racer_rocket_speed 1500
set g_vehicle_racer_rocket_accel 1500
-set g_vehicle_racer_rocket_turnrate 0.5
-set g_vehicle_racer_rocket_damage 200
+set g_vehicle_racer_rocket_turnrate 0.4
+set g_vehicle_racer_rocket_damage 120
set g_vehicle_racer_rocket_radius 100
-set g_vehicle_racer_rocket_refire 5
+set g_vehicle_racer_rocket_refire 3
set g_vehicle_racer_rocket_cost 0
-set g_vehicle_raptor_reload 1
+set g_vehicle_raptor_respawntime 60
+// 0: go where player aims, +forward etc relative to aim angles
+// 1: ignore aim for up/down movement. +forward always moved forward, +jump always moves up
set g_vehicle_raptor_movestyle 1
-set g_vehicle_raptor_turnspeed 90
+
set g_vehicle_raptor_turnroll 0.1
+
+set g_vehicle_raptor_turnspeed 90
set g_vehicle_raptor_pitchspeed 45
+set g_vehicle_raptor_pitchlimit 30
+
set g_vehicle_raptor_speed_forward 1500
set g_vehicle_raptor_speed_strafe 1500
set g_vehicle_raptor_speed_up 1250
set g_vehicle_raptor_speed_down 1400
-set g_vehicle_raptor_bomblet_waves 2
-set g_vehicle_raptor_bomblet_wavefirst 0.5
-set g_vehicle_raptor_bomblet_wavenext 0.3
-set g_vehicle_raptor_bomblet_wawespread 0.3
-set g_vehicle_raptor_bomblets 3
-set g_vehicle_raptor_bomblet_damage 90
-set g_vehicle_raptor_bomblet_edgedamage 40
-set g_vehicle_raptor_bomblet_radius 250
-set g_vehicle_raptor_bomblet_force 300
-set g_vehicle_raptor_bombs_refire 1
-
-set g_vehicle_raptor_beam_dps 200
-set g_vehicle_raptor_beam_fops 150
-set g_vehicle_raptor_beam_aps 100
-set g_vehicle_raptor_beam_size 8
-set g_vehicle_raptor_beam_leangth 1
-set g_vehicle_raptor_beam_refire 2
-
-set g_vehicle_raptor_shield 250
-set g_vehicle_raptor_shield_regen 50
-
-set g_vehicle_raptor_health 250
-set g_vehicle_raptor_health_regen 10
-
-set g_vehicle_raptor_energy 300
-set g_vehicle_raptor_energy_regen 50
\ No newline at end of file
+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_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_pitchlimit 8
+
+set 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_speed 9000
+set g_vehicle_raptor_cannon_spread 0.05
+
+set g_vehicle_raptor_energy 200
+set g_vehicle_raptor_energy_regen 50
+set g_vehicle_raptor_energy_regen_pause 1
+
+set g_vehicle_raptor_health 250
+set g_vehicle_raptor_health_regen 0
+set g_vehicle_raptor_health_regen_pause 0
+
+set g_vehicle_raptor_shield 250
+set g_vehicle_raptor_shield_regen 50
+set g_vehicle_raptor_shield_regen_pause 1.5
+set g_vehicle_spiderbot_isloaded 1
+
set g_vehicle_spiderbot_respawntime 30
+
set g_vehicle_spiderbot_health 875
set g_vehicle_spiderbot_health_regen 10
-set g_vehicle_spiderbot_health_regen_dmgpause 10
+set g_vehicle_spiderbot_health_regen_pause 10
set g_vehicle_spiderbot_shield 125
set g_vehicle_spiderbot_shield_block 1
set g_vehicle_spiderbot_shield_regen 25
-set g_vehicle_spiderbot_shield_regen_dmgpause 0.25
+set g_vehicle_spiderbot_shield_regen_pause 0.25
+
+set g_vehicle_spiderbot_energy 0
+set g_vehicle_spiderbot_energy_regen 0
+set g_vehicle_spiderbot_energy_regen_pause 0
set g_vehicle_spiderbot_turnspeed 90
set g_vehicle_spiderbot_head_turnspeed 120
set g_vehicle_spiderbot_head_turnlimit 120
set g_vehicle_spiderbot_head_pitchspeed 60
-set g_vehicle_spiderbot_head_pitchlimit_up 8
+set g_vehicle_spiderbot_head_pitchlimit_up 16
set g_vehicle_spiderbot_head_pitchlimit_down -24
set g_vehicle_spiderbot_speed_stop 50
set g_vehicle_spiderbot_minigun_heat 10
set g_vehicle_spiderbot_minigun_cooldown 10
+set g_vehicle_spiderbot_springlength 150
+set g_vehicle_spiderbot_springup 5
+set g_vehicle_spiderbot_springblend 0.15
+
set g_vehicle_spiderbot_rocket_health 100
set g_vehicle_spiderbot_rocket_damage 75
set g_vehicle_spiderbot_rocket_edgedamage 15
--- /dev/null
+set g_vehicles 1
+
+exec vehicle_racer.cfg
+exec vehicle_raptor.cfg
+exec vehicle_spiderbot.cfg
+
+