6 #define RAPTOR_MIN '-80 -80 0'
7 #define RAPTOR_MAX '80 80 70'
10 float autocvar_g_vehicle_raptor_respawntime;
11 float autocvar_g_vehicle_raptor_takeofftime;
13 float autocvar_g_vehicle_raptor_movestyle;
14 float autocvar_g_vehicle_raptor_turnspeed;
15 float autocvar_g_vehicle_raptor_pitchspeed;
16 float autocvar_g_vehicle_raptor_pitchlimit;
18 float autocvar_g_vehicle_raptor_speed_forward;
19 float autocvar_g_vehicle_raptor_speed_strafe;
20 float autocvar_g_vehicle_raptor_speed_up;
21 float autocvar_g_vehicle_raptor_speed_down;
22 float autocvar_g_vehicle_raptor_friction;
24 float autocvar_g_vehicle_raptor_bomblets;
25 float autocvar_g_vehicle_raptor_bomblet_alt;
26 float autocvar_g_vehicle_raptor_bomblet_time;
27 float autocvar_g_vehicle_raptor_bomblet_damage;
28 float autocvar_g_vehicle_raptor_bomblet_spread;
29 float autocvar_g_vehicle_raptor_bomblet_edgedamage;
30 float autocvar_g_vehicle_raptor_bomblet_radius;
31 float autocvar_g_vehicle_raptor_bomblet_force;
32 float autocvar_g_vehicle_raptor_bomblet_explode_delay;
33 float autocvar_g_vehicle_raptor_bombs_refire;
35 float autocvar_g_vehicle_raptor_flare_refire;
36 float autocvar_g_vehicle_raptor_flare_lifetime;
37 float autocvar_g_vehicle_raptor_flare_chase;
38 float autocvar_g_vehicle_raptor_flare_range;
40 float autocvar_g_vehicle_raptor_cannon_turnspeed;
41 float autocvar_g_vehicle_raptor_cannon_turnlimit;
42 float autocvar_g_vehicle_raptor_cannon_pitchlimit_up;
43 float autocvar_g_vehicle_raptor_cannon_pitchlimit_down;
45 float autocvar_g_vehicle_raptor_cannon_locktarget;
46 float autocvar_g_vehicle_raptor_cannon_locking_time;
47 float autocvar_g_vehicle_raptor_cannon_locking_releasetime;
48 float autocvar_g_vehicle_raptor_cannon_locked_time;
49 float autocvar_g_vehicle_raptor_cannon_predicttarget;
51 float autocvar_g_vehicle_raptor_cannon_cost;
52 float autocvar_g_vehicle_raptor_cannon_damage;
53 float autocvar_g_vehicle_raptor_cannon_radius;
54 float autocvar_g_vehicle_raptor_cannon_refire;
55 float autocvar_g_vehicle_raptor_cannon_speed;
56 float autocvar_g_vehicle_raptor_cannon_spread;
57 float autocvar_g_vehicle_raptor_cannon_force;
59 float autocvar_g_vehicle_raptor_energy;
60 float autocvar_g_vehicle_raptor_energy_regen;
61 float autocvar_g_vehicle_raptor_energy_regen_pause;
63 float autocvar_g_vehicle_raptor_health;
64 float autocvar_g_vehicle_raptor_health_regen;
65 float autocvar_g_vehicle_raptor_health_regen_pause;
67 float autocvar_g_vehicle_raptor_shield;
68 float autocvar_g_vehicle_raptor_shield_regen;
69 float autocvar_g_vehicle_raptor_shield_regen_pause;
71 float autocvar_g_vehicle_raptor_bouncefactor;
72 float autocvar_g_vehicle_raptor_bouncestop;
73 vector autocvar_g_vehicle_raptor_bouncepain;
77 float raptor_takeoff();
82 float raptor_altitude(float amax)
84 tracebox(self.origin, self.mins, self.maxs, self.origin - ('0 0 1' * amax), MOVE_WORLDONLY, self);
85 return vlen(self.origin - trace_endpos);
89 void raptor_bomblet_boom()
91 RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
92 autocvar_g_vehicle_raptor_bomblet_edgedamage,
93 autocvar_g_vehicle_raptor_bomblet_radius, world,
94 autocvar_g_vehicle_raptor_bomblet_force, DEATH_RAPTOR_BOMB, world);
98 void raptor_bomblet_touch()
100 if(other == self.owner)
104 self.think = raptor_bomblet_boom;
105 self.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay;
108 void raptor_bomb_burst()
111 if(autocvar_g_vehicle_raptor_bomblet_alt)
113 self.nextthink = time;
114 traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
115 if((trace_fraction == 1.0) || (vlen(self.origin - self.owner.origin) < autocvar_g_vehicle_raptor_bomblet_radius))
117 UpdateCSQCProjectile(self);
125 Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_RAPTOR_BOMB_SPLIT, 0, self);
127 for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
130 setorigin(bomblet, self.origin);
132 bomblet.movetype = MOVETYPE_TOSS;
133 bomblet.touch = raptor_bomblet_touch;
134 bomblet.think = raptor_bomblet_boom;
135 bomblet.nextthink = time + 5;
136 bomblet.owner = self.owner;
137 bomblet.realowner = self.realowner;
138 bomblet.velocity = normalize(normalize(self.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(self.velocity);
140 PROJECTILE_MAKETRIGGER(bomblet);
141 CSQCProjectile(bomblet, TRUE, PROJECTILE_RAPTORBOMBLET, TRUE);
147 void raptor_bombdrop()
149 entity bomb_1, bomb_2;
154 setorigin(bomb_1, gettaginfo(self, gettagindex(self, "bombmount_left")));
155 setorigin(bomb_2, gettaginfo(self, gettagindex(self, "bombmount_right")));
157 bomb_1.movetype = bomb_2.movetype = MOVETYPE_BOUNCE;
158 bomb_1.velocity = bomb_2.velocity = self.velocity;
159 bomb_1.touch = bomb_2.touch = raptor_bomb_burst;
160 bomb_1.think = bomb_2.think = raptor_bomb_burst;
161 bomb_1.cnt = bomb_2.cnt = time + 10;
163 if(autocvar_g_vehicle_raptor_bomblet_alt)
164 bomb_1.nextthink = bomb_2.nextthink = time;
166 bomb_1.nextthink = bomb_2.nextthink = time + autocvar_g_vehicle_raptor_bomblet_time;
168 bomb_1.owner = bomb_2.owner = self;
169 bomb_1.realowner = bomb_2.realowner = self.owner;
170 bomb_1.solid = bomb_2.solid = SOLID_BBOX;
171 bomb_1.gravity = bomb_2.gravity = 1;
173 PROJECTILE_MAKETRIGGER(bomb_1);
174 PROJECTILE_MAKETRIGGER(bomb_2);
176 CSQCProjectile(bomb_1, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
177 CSQCProjectile(bomb_2, TRUE, PROJECTILE_RAPTORBOMB, TRUE);
181 void raptor_fire_cannon(entity gun, string tagname)
183 vehicles_projectile("raptor_cannon_muzzleflash", "weapons/lasergun_fire.wav",
184 gettaginfo(gun, gettagindex(gun, tagname)), normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
185 autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0,
186 DEATH_RAPTOR_CANNON, PROJECTILE_RAPTORCANNON, 0, TRUE, TRUE);
195 self.owner.PlayerPhysplug = raptor_takeoff;
196 self.movetype = MOVETYPE_BOUNCEMISSILE;
197 self.solid = SOLID_SLIDEBOX;
198 self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_raptor_health) * 100;
199 self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_raptor_shield) * 100;
200 self.velocity_z = 1; // Nudge upwards to takeoff sequense can work.
201 self.tur_head.exteriormodeltoclient = self.owner;
203 self.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
206 if(self.owner.flagcarried)
207 setorigin(self.owner.flagcarried, '-20 0 96');
209 CSQCVehicleSetup(self.owner, 0);
216 hgt = raptor_altitude(512);
217 self.velocity = (self.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime);
218 self.angles_x *= 0.95;
219 self.angles_z *= 0.95;
223 self.frame = (hgt / 128) * 25;
225 self.bomb1.gun1.avelocity_y = 90 + ((self.frame / 25) * 2000);
226 self.bomb1.gun2.avelocity_y = -self.bomb1.gun1.avelocity_y;
230 self.movetype = MOVETYPE_TOSS;
231 self.think = raptor_think;
235 self.nextthink = time;
238 void raptor_exit(float eject)
241 self.tur_head.exteriormodeltoclient = world;
243 if(self.deadflag == DEAD_NO)
245 self.think = raptor_land;
246 self.nextthink = time;
252 makevectors(self.angles);
255 spot = self.origin + v_forward * 100 + '0 0 64';
256 spot = vehicles_findgoodexit(spot);
257 setorigin(self.owner , spot);
258 self.owner.velocity = (v_up + v_forward * 0.25) * 750;
259 self.owner.oldvelocity = self.owner.velocity;
263 self.owner.velocity = normalize(self.velocity) * autocvar_sv_maxairspeed;
264 self.owner.oldvelocity = self.owner.velocity;
265 spot = self.origin - v_forward * 200 + '0 0 64';
266 spot = vehicles_findgoodexit(spot);
267 setorigin(self.owner , spot);
269 antilag_clear(self.owner);
273 float raptor_takeoff()
275 entity player, raptor;
278 raptor = self.vehicle;
280 if(self.sound_nexttime < time)
282 self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav");
283 sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTN_NORM);
287 if(raptor.frame < 25)
289 raptor.frame += 25 / (autocvar_g_vehicle_raptor_takeofftime / sys_frametime);
290 raptor.velocity_z = min(raptor.velocity_z * 1.5, 256);
291 self.bomb1.gun1.avelocity_y = 90 + ((raptor.frame / 25) * 25000);
292 self.bomb1.gun2.avelocity_y = -self.bomb1.gun1.avelocity_y;
293 player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
295 setorigin(player, raptor.origin + '0 0 32');
298 player.PlayerPhysplug = raptor_frame;
300 if(self.vehicle_flags & VHF_SHIELDREGEN)
301 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);
303 if(self.vehicle_flags & VHF_HEALTHREGEN)
304 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);
306 if(self.vehicle_flags & VHF_ENERGYREGEN)
307 vehicles_regen(cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime);
310 raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip);
311 player.vehicle_reload2 = bound(0, raptor.bomb1.alpha * 100, 100);
313 VEHICLE_UPDATE_PLAYER(health, raptor);
314 VEHICLE_UPDATE_PLAYER(energy, raptor);
315 if(self.vehicle_flags & VHF_HASSHIELD)
316 VEHICLE_UPDATE_PLAYER(shield, raptor);
318 player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
323 void raptor_flare_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
325 self.health -= damage;
330 void raptor_flare_think()
332 self.nextthink = time + 0.1;
333 entity _missile = findchainentity(enemy, self.owner);
336 if(_missile.flags & FL_PROJECTILE)
337 if(vlen(self.origin - _missile.origin) < autocvar_g_vehicle_raptor_flare_range)
338 if(random() > autocvar_g_vehicle_raptor_flare_chase)
339 _missile.enemy = self;
340 _missile = _missile.chain;
343 if(self.tur_impacttime < time)
349 entity player, raptor;
353 if(intermission_running)
357 raptor = self.vehicle;
359 vehicles_painframe();
361 ftmp = vlen(self.velocity);
362 if(ftmp > autocvar_g_vehicle_raptor_speed_forward)
365 ftmp = ftmp / autocvar_g_vehicle_raptor_speed_forward;
368 if(self.sound_nexttime < time)
370 self.sound_nexttime = time + 7.955812;
371 //sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp, ATTN_NORM );
372 sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTN_NORM);
376 else if(fabs(ftmp - self.wait) > 0.2)
378 sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp, ATTN_NORM );
379 sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTN_NORM);
384 if(raptor.deadflag != DEAD_NO)
387 player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
390 crosshair_trace(player);
393 vang = raptor.angles;
394 df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
397 if(df_x > 180) df_x -= 360;
398 if(df_x < -180) df_x += 360;
399 if(df_y > 180) df_y -= 360;
400 if(df_y < -180) df_y += 360;
402 ftmp = shortangle_f(player.v_angle_y - vang_y, vang_y);
403 if(ftmp > 180) ftmp -= 360; if(ftmp < -180) ftmp += 360;
404 raptor.avelocity_y = bound(-autocvar_g_vehicle_raptor_turnspeed, ftmp + raptor.avelocity_y * 0.9, autocvar_g_vehicle_raptor_turnspeed);
408 if(player.movement_x > 0 && vang_x < autocvar_g_vehicle_raptor_pitchlimit) ftmp = 5;
409 else if(player.movement_x < 0 && vang_x > -autocvar_g_vehicle_raptor_pitchlimit) ftmp = -20;
411 df_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, df_x , autocvar_g_vehicle_raptor_pitchlimit);
412 ftmp = vang_x - bound(-autocvar_g_vehicle_raptor_pitchlimit, df_x + ftmp, autocvar_g_vehicle_raptor_pitchlimit);
413 raptor.avelocity_x = bound(-autocvar_g_vehicle_raptor_pitchspeed, ftmp + raptor.avelocity_x * 0.9, autocvar_g_vehicle_raptor_pitchspeed);
415 raptor.angles_x = anglemods(raptor.angles_x);
416 raptor.angles_y = anglemods(raptor.angles_y);
417 raptor.angles_z = anglemods(raptor.angles_z);
419 if(autocvar_g_vehicle_raptor_movestyle == 1)
420 makevectors('0 1 0' * raptor.angles_y);
422 makevectors(player.v_angle);
424 df = raptor.velocity * -autocvar_g_vehicle_raptor_friction;
426 if(player.movement_x != 0)
428 if(player.movement_x > 0)
429 df += v_forward * autocvar_g_vehicle_raptor_speed_forward;
430 else if(player.movement_x < 0)
431 df -= v_forward * autocvar_g_vehicle_raptor_speed_forward;
434 if(player.movement_y != 0)
436 if(player.movement_y < 0)
437 df -= v_right * autocvar_g_vehicle_raptor_speed_strafe;
438 else if(player.movement_y > 0)
439 df += v_right * autocvar_g_vehicle_raptor_speed_strafe;
441 raptor.angles_z = bound(-30,raptor.angles_z + (player.movement_y / autocvar_g_vehicle_raptor_speed_strafe),30);
445 raptor.angles_z *= 0.95;
446 if(raptor.angles_z >= -1 && raptor.angles_z <= -1)
450 if(player.BUTTON_CROUCH)
451 df -= v_up * autocvar_g_vehicle_raptor_speed_down;
452 else if (player.BUTTON_JUMP)
453 df += v_up * autocvar_g_vehicle_raptor_speed_up;
455 raptor.velocity += df * frametime;
456 player.velocity = player.movement = raptor.velocity;
457 setorigin(player, raptor.origin + '0 0 32');
460 // Target lock & predict
461 if(autocvar_g_vehicle_raptor_cannon_locktarget)
464 vehicles_locktarget((1 / autocvar_g_vehicle_raptor_cannon_locking_time) * frametime,
465 (1 / autocvar_g_vehicle_raptor_cannon_locking_releasetime) * frametime,
466 autocvar_g_vehicle_raptor_cannon_locked_time);
468 if(self.lock_target != world)
469 if(autocvar_g_vehicle_raptor_cannon_predicttarget)
470 if(self.lock_strength == 1)
472 float i, distance, impact_time;
474 vf = real_origin(raptor.lock_target);
476 for(i = 0; i < 4; ++i)
478 distance = vlen(ad - raptor.origin);
479 impact_time = distance / autocvar_g_vehicle_raptor_cannon_speed;
480 ad = vf + raptor.lock_target.velocity * impact_time;
487 if(raptor.lock_strength == 1)
488 UpdateAuxiliaryXhair(player, real_origin(raptor.lock_target), '1 0 0', 1);
489 else if(self.lock_strength > 0.5)
490 UpdateAuxiliaryXhair(player, real_origin(raptor.lock_target), '0 1 0', 1);
491 else if(self.lock_strength < 0.5)
492 UpdateAuxiliaryXhair(player, real_origin(raptor.lock_target), '0 0 1', 1);
497 vehicle_aimturret(raptor, trace_endpos, raptor.gun1, "fire1",
498 autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up,
499 autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed);
501 vehicle_aimturret(raptor, trace_endpos, raptor.gun2, "fire1",
502 autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up,
503 autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed);
507 v_forward = vf * 0.5;
508 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, raptor);
509 UpdateAuxiliaryXhair(player, trace_endpos, '0 1 0', 0);
512 if(player.BUTTON_ATCK)
513 if(raptor.attack_finished_single <= time)
514 if(raptor.vehicle_energy > autocvar_g_vehicle_raptor_cannon_cost)
516 raptor.misc_bulletcounter += 1;
517 raptor.attack_finished_single = time + autocvar_g_vehicle_raptor_cannon_refire;
518 if(raptor.misc_bulletcounter <= 2)
519 raptor_fire_cannon(self.gun1, "fire1");
520 else if(raptor.misc_bulletcounter == 3)
521 raptor_fire_cannon(self.gun2, "fire1");
524 raptor.attack_finished_single = time + autocvar_g_vehicle_raptor_cannon_refire * 2;
525 raptor_fire_cannon(self.gun2, "fire1");
526 raptor.misc_bulletcounter = 0;
528 raptor.vehicle_energy -= autocvar_g_vehicle_raptor_cannon_cost;
532 if(self.vehicle_flags & VHF_SHIELDREGEN)
533 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);
535 if(self.vehicle_flags & VHF_HEALTHREGEN)
536 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);
538 if(self.vehicle_flags & VHF_ENERGYREGEN)
539 vehicles_regen(cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime);
541 if(raptor.vehicle_weapon2mode == RSM_BOMB)
543 if(time > raptor.lip + autocvar_g_vehicle_raptor_bombs_refire)
544 if(player.BUTTON_ATCK2)
547 raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
553 if(time > raptor.lip + autocvar_g_vehicle_raptor_flare_refire)
554 if(player.BUTTON_ATCK2)
559 for(i = 0; i < 3; ++i)
562 setmodel(_flare, "models/runematch/rune.mdl");
563 _flare.effects = EF_LOWPRECISION | EF_FLAME;
565 setorigin(_flare, self.origin - '0 0 16');
566 _flare.movetype = MOVETYPE_TOSS;
567 _flare.gravity = 0.15;
568 _flare.velocity = 0.25 * raptor.velocity + (v_forward + randomvec() * 0.25)* -500;
569 _flare.think = raptor_flare_think;
570 _flare.nextthink = time;
571 _flare.owner = raptor;
572 _flare.solid = SOLID_CORPSE;
573 _flare.takedamage = DAMAGE_YES;
574 _flare.event_damage = raptor_flare_damage;
576 _flare.tur_impacttime = time + autocvar_g_vehicle_raptor_flare_lifetime;
578 raptor.delay = time + autocvar_g_vehicle_raptor_flare_refire;
583 raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip);
584 player.vehicle_reload2 = bound(0, raptor.bomb1.alpha * 100, 100);
586 VEHICLE_UPDATE_PLAYER(health, raptor);
587 VEHICLE_UPDATE_PLAYER(energy, raptor);
588 if(self.vehicle_flags & VHF_HASSHIELD)
589 VEHICLE_UPDATE_PLAYER(shield, raptor);
591 player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
599 self.deadflag = DEAD_DEAD;
600 self.vehicle_exit(VHEF_NORMAL);
601 RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world);
604 self.movetype = MOVETYPE_NONE;
605 self.effects = EF_NODRAW;
606 self.colormod = '0 0 0';
607 self.avelocity = '0 0 0';
608 self.velocity = '0 0 0';
610 setorigin(self, self.pos1);
611 self.touch = SUB_Null;
615 void raptor_diethink()
619 sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
620 pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
622 self.nextthink = time + 0.1;
628 self.event_damage = SUB_Null;
629 self.solid = SOLID_CORPSE;
630 self.takedamage = DAMAGE_NO;
631 self.deadflag = DEAD_DYING;
632 self.movetype = MOVETYPE_BOUNCE;
633 self.think = raptor_diethink;
634 self.nextthink = time;
636 pointparticles(particleeffectnum("explosion_medium"), findbetterlocation (self.origin, 16), '0 0 0', 1);
638 self.velocity_z += 600;
640 self.avelocity = '0 0.5 1' * (random() * 400);
641 self.avelocity -= '0 0.5 1' * (random() * 400);
643 self.colormod = '-0.5 -0.5 -0.5';
644 self.touch = raptor_blowup;
649 if(autocvar_g_vehicle_raptor_bouncepain_x)
650 vehilces_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
656 self.vehicle_health = autocvar_g_vehicle_raptor_health;
657 self.vehicle_shield = autocvar_g_vehicle_raptor_shield;
658 self.movetype = MOVETYPE_TOSS;
659 self.solid = SOLID_SLIDEBOX;
660 self.vehicle_energy = 1;
662 self.bomb1.gun1.avelocity_y = 90;
663 self.bomb1.gun2.avelocity_y = -90;
665 setsize(self, RAPTOR_MIN, RAPTOR_MAX );
668 self.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor;
669 self.bouncestop = autocvar_g_vehicle_raptor_bouncestop;
670 self.vehicle_impact = raptor_impact;
673 // If we dont do this ever now and then, the raptors rotors
674 // stop working, presumably due to angle overflow. cute.
675 void raptor_rotor_anglefix()
677 self.gun1.angles_y = anglemods(self.gun1.angles_y);
678 self.gun2.angles_y = anglemods(self.gun2.angles_y);
679 self.nextthink = time + 15;
681 float raptor_impulse(float _imp)
688 self.vehicle.vehicle_weapon2mode += 1;
689 if(self.vehicle.vehicle_weapon2mode > RSM_LAST)
690 self.vehicle.vehicle_weapon2mode = RSM_FIRST;
692 CSQCVehicleSetup(self, 0);
697 self.vehicle.vehicle_weapon2mode -= 1;
698 if(self.vehicle.vehicle_weapon2mode < RSM_FIRST)
699 self.vehicle.vehicle_weapon2mode = RSM_LAST;
701 CSQCVehicleSetup(self, 0);
705 case 17: // toss gun, could be used to exit?
707 case 20: // Manual minigun reload?
719 if not (vehicle_initialize(
721 "models/vehicles/raptor.dpm",
723 "models/vehicles/raptor_cockpit.dpm",
724 "", "tag_hud", "tag_camera",
726 RAPTOR_MIN, RAPTOR_MAX,
728 raptor_spawn, autocvar_g_vehicle_raptor_respawntime,
730 raptor_enter, raptor_exit,
731 raptor_die, raptor_think,
738 //FIXME: Camera is in a bad place in HUD model.
739 //setorigin(self.vehicle_viewport, '25 0 5');
741 self.vehicles_impusle = raptor_impulse;
745 self.bomb1 = spawn();
746 self.bomb2 = spawn();
750 setmodel(self.bomb1,"models/vehicles/clusterbomb_folded.md3");
751 setmodel(self.bomb2,"models/vehicles/clusterbomb_folded.md3");
752 setmodel(self.gun1, "models/vehicles/raptor_gun.dpm");
753 setmodel(self.gun2, "models/vehicles/raptor_gun.dpm");
754 setmodel(self.tur_head, "models/vehicles/raptor_body.dpm");
756 setattachment(self.bomb1, self,"bombmount_left");
757 setattachment(self.bomb2, self,"bombmount_right");
758 setattachment(self.tur_head, self,"root");
761 // FIXMODEL Guns mounts to angled bones
762 self.bomb1.angles = self.angles;
763 self.angles = '0 0 0';
764 // This messes up gun-aim, so work arround it.
765 //setattachment(self.gun1, self, "gunmount_left");
766 ofs = gettaginfo(self, gettagindex(self, "gunmount_left"));
768 setattachment(self.gun1, self, "");
769 setorigin(self.gun1, ofs);
771 //setattachment(self.gun2, self, "gunmount_right");
772 ofs = gettaginfo(self, gettagindex(self, "gunmount_right"));
774 setattachment(self.gun2, self, "");
775 setorigin(self.gun2, ofs);
777 self.angles = self.bomb1.angles;
778 self.bomb1.angles = '0 0 0';
781 spinner.owner = self;
782 setmodel(spinner,"models/vehicles/spinner.dpm");
783 setattachment(spinner, self, "engine_left");
784 spinner.movetype = MOVETYPE_NOCLIP;
785 spinner.avelocity = '0 90 0';
786 self.bomb1.gun1 = spinner;
789 spinner.owner = self;
790 setmodel(spinner,"models/vehicles/spinner.dpm");
791 setattachment(spinner, self, "engine_right");
792 spinner.movetype = MOVETYPE_NOCLIP;
793 spinner.avelocity = '0 -90 0';
794 self.bomb1.gun2 = spinner;
797 self.bomb1.think = raptor_rotor_anglefix;
798 self.bomb1.nextthink = time;
803 void spawnfunc_vehicle_raptor()
805 vehicles_configcheck("vehicle_raptor.cfg", autocvar_g_vehicle_raptor_health);
807 self.vehicle_flags |= VHF_DMGSHAKE;
808 self.vehicle_flags |= VHF_DMGROLL;
810 if(autocvar_g_vehicle_raptor_shield)
811 self.vehicle_flags |= VHF_HASSHIELD;
813 if(autocvar_g_vehicle_raptor_shield_regen)
814 self.vehicle_flags |= VHF_SHIELDREGEN;
816 if(autocvar_g_vehicle_raptor_health_regen)
817 self.vehicle_flags |= VHF_HEALTHREGEN;
819 if(autocvar_g_vehicle_raptor_energy_regen)
820 self.vehicle_flags |= VHF_ENERGYREGEN;
822 precache_model ("models/vehicles/raptor.dpm");
823 precache_model ("models/vehicles/raptor_gun.dpm");
824 precache_model ("models/vehicles/spinner.dpm");
825 precache_model ("models/vehicles/raptor_cockpit.dpm");
826 //precache_model ("models/vehicles/clusterbomb.md3");
827 precache_model ("models/vehicles/clusterbomb_folded.md3");
828 precache_model ("models/vehicles/raptor_body.dpm");
830 precache_sound ("vehicles/raptor_fly.wav");
831 precache_sound ("vehicles/raptor_speed.wav");
833 self.think = raptor_dinit;
836 self.nextthink = time + 0.5;
838 self.nextthink = time + (autocvar_g_vehicles_delayspawn ? autocvar_g_vehicle_raptor_respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter) : 0.5);