.entity conveyor;
string modname;
+
+.float missile_flags;
+#define MIF_SPLASH 2
+#define MIF_ARC 4
+#define MIF_PROXY 8
+#define MIF_GUIDED_MANUAL 16
+#define MIF_GUIDED_HEAT 32
+#define MIF_GUIDED_LASER 64
+#define MIF_GUIDED_AI 128
+#define MIF_GUIDED_TAG 128
+#define MIF_GUIDED_ALL (MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
+#define MIF_GUIDED_TRACKING (MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
+#define MIF_GUIDED_CONFUSABLE (MIF_GUIDED_HEAT | MIF_GUIDED_AI)
+
+#define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? TRUE : FALSE)
+#define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? TRUE : FALSE)
+#define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? TRUE : FALSE)
\ No newline at end of file
void ewheel_attack()
{
float i;
-
+ entity _mis;
+
for (i = 0; i < 1; ++i)
{
turret_do_updates(self);
- turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE);
+ _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE);
+ _mis.missile_flags = MIF_SPLASH;
+
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
self.tur_head.frame += 2;
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
proj.think = turret_flac_projectile_think_explode;
proj.nextthink = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01);
-
+ proj.missile_flags = MIF_SPLASH | MIF_PROXY;
+
self.tur_head.frame = self.tur_head.frame + 1;
if (self.tur_head.frame >= 4)
self.tur_head.frame = 0;
missile.flags = FL_PROJECTILE;
missile.tur_health = time + 9;
missile.tur_aimpos = randomvec() * 128;
+ missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
self.tur_head.frame += 1;
}
missile.angles = vectoangles(missile.velocity);
missile.cnt = time + 30;
missile.ticrate = max(autocvar_sys_ticrate, 0.05);
-
+ missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_AI;
+
if (self.tur_head.frame == 0)
self.tur_head.frame = self.tur_head.frame + 1;
turret_tag_fire_update();
missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
+ missile.missile_flags = MIF_SPLASH;
te_explosion (missile.origin);
}
void turret_plasma_attack()
{
- turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+ entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+ missile.missile_flags = MIF_SPLASH;
+
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
if (self.tur_head.frame == 0)
self.tur_head.frame = 1;
void turret_plasma_dual_attack()
{
- turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+ entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
+ missile.missile_flags = MIF_SPLASH;
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
self.tur_head.frame += 1;
}
rocket.tur_shotorg = randomvec() * 512;
rocket.cnt = time + 1;
rocket.enemy = self.enemy;
-
+
if (random() < 0.01)
rocket.think = walker_rocket_loop;
else
rocket.flags = FL_PROJECTILE;
rocket.solid = SOLID_BBOX;
rocket.tur_health = time + 9;
-
+ rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
+
CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
}
return 1;
}
+void raptor_flare_touch()
+{
+ remove(self);
+}
+
void raptor_flare_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
self.health -= damage;
_flare.event_damage = raptor_flare_damage;
_flare.health = 20;
_flare.tur_impacttime = time + autocvar_g_vehicle_raptor_flare_lifetime;
+ _flare.touch = raptor_flare_touch;
}
raptor.delay = time + autocvar_g_vehicle_raptor_flare_refire;
raptor.lip = time;
raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip);
player.vehicle_reload2 = bound(0, raptor.bomb1.alpha * 100, 100);
+ if(self.bomb1.cnt < time)
+ {
+ entity _missile = findchainentity(enemy, raptor);
+ float _incomming = 0;
+ while(_missile)
+ {
+ if(_missile.flags & FL_PROJECTILE)
+ if(MISSILE_IS_TRACKING(_missile))
+ if(vlen(self.origin - _missile.origin) < 2 * autocvar_g_vehicle_raptor_flare_range)
+ ++_incomming;
+
+ _missile = _missile.chain;
+ }
+
+ if(_incomming)
+ sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTN_NONE);
+
+ self.bomb1.cnt = time + 1;
+ }
+
+
VEHICLE_UPDATE_PLAYER(health, raptor);
VEHICLE_UPDATE_PLAYER(energy, raptor);
if(self.vehicle_flags & VHF_HASSHIELD)
precache_sound ("vehicles/raptor_fly.wav");
precache_sound ("vehicles/raptor_speed.wav");
+ precache_sound ("vehicles/missile_alarm.wav");
self.think = raptor_dinit;
//proj.glow_size = 20;
proj.flags = FL_PROJECTILE;
-
+ proj.missile_flags = MIF_SPLASH;
+
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
//proj.glow_size = 20;
proj.flags = FL_PROJECTILE;
-
+ proj.missile_flags = MIF_SPLASH;
+
CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
proj.touch = W_Plasma_TouchExplode;
setsize(proj, '0 0 -3', '0 0 -3');
proj.flags = FL_PROJECTILE;
+ proj.missile_flags = MIF_SPLASH;
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
proj.bouncefactor = autocvar_g_balance_electro_secondary_bouncefactor;
proj.bouncestop = autocvar_g_balance_electro_secondary_bouncestop;
+ proj.missile_flags = MIF_SPLASH | MIF_ARC;
#if 0
entity p2;
proj.touch = W_Fireball_TouchExplode;
setsize(proj, '-16 -16 -16', '16 16 16');
proj.flags = FL_PROJECTILE;
-
+ proj.missile_flags = MIF_SPLASH | MIF_PROXY;
+
CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
proj.angles = vectoangles(proj.velocity);
proj.flags = FL_PROJECTILE;
-
+ proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
+
CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
gren.damageforcescale = autocvar_g_balance_grenadelauncher_primary_damageforcescale;
gren.event_damage = W_Grenade_Damage;
gren.damagedbycontents = TRUE;
+ gren.missile_flags = MIF_SPLASH | MIF_ARC;
W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
gren.angles = vectoangles (gren.velocity);
gren.damageforcescale = autocvar_g_balance_grenadelauncher_secondary_damageforcescale;
gren.event_damage = W_Grenade_Damage;
gren.damagedbycontents = TRUE;
+ gren.missile_flags = MIF_SPLASH | MIF_ARC;
W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_secondary);
gren.angles = vectoangles (gren.velocity);
missile.angles = vectoangles (missile.velocity);
missile.flags = FL_PROJECTILE;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
missile.angles = vectoangles (missile.velocity);
missile.flags = FL_PROJECTILE;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE);
setorigin (missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
missile.movetype = MOVETYPE_FLY;
+ missile.missile_flags = MIF_SPLASH;
// per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
spread_pershot = ((shots - 1) / (autocvar_g_balance_hagar_secondary_load_max - 1));
missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
missile.flags = FL_PROJECTILE;
+ missile.missile_flags = MIF_SPLASH;
missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
gren.damageforcescale = autocvar_g_balance_hook_secondary_damageforcescale;
gren.event_damage = W_Hook_Damage;
gren.damagedbycontents = TRUE;
+ gren.missile_flags = MIF_SPLASH | MIF_ARC;
gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed;
if(autocvar_g_projectiles_newton_style)
missile.touch = W_Laser_Touch;
missile.flags = FL_PROJECTILE;
+ missile.missile_flags = MIF_SPLASH;
missile.think = W_Laser_Think;
missile.nextthink = time + autocvar_g_balance_laser_primary_delay;
mine.nextthink = time;
mine.cnt = time + (autocvar_g_balance_minelayer_lifetime - autocvar_g_balance_minelayer_lifetime_countdown);
mine.flags = FL_PROJECTILE;
+ mine.missile_flags = MIF_SPLASH | MIF_ARC | MIF_PROXY;
CSQCProjectile(mine, TRUE, PROJECTILE_MINE, TRUE);
missile.nextthink = time;
missile.cnt = time + autocvar_g_balance_rocketlauncher_lifetime;
missile.flags = FL_PROJECTILE;
+ missile.missile_flags = MIF_SPLASH;
CSQCProjectile(missile, autocvar_g_balance_rocketlauncher_guiderate == 0 && autocvar_g_balance_rocketlauncher_speedaccel == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
setsize (missile, '-4 -4 -4', '4 4 4');
missile.movetype = MOVETYPE_FLYMISSILE;
missile.flags = FL_PROJECTILE;
+ missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
+
W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
missile.angles = vectoangles (missile.velocity);
missile.projectiledeathtype = WEP_SEEKER;
missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
missile.flags = FL_PROJECTILE;
+ missile.missile_flags = MIF_SPLASH;
// csqc projectiles
//missile.angles = vectoangles (missile.velocity);
setsize (missile, '-2 -2 -2', '2 2 2');
missile.flags = FL_PROJECTILE;
+ //missile.missile_flags = MIF_..?;
missile.movetype = MOVETYPE_FLY;
W_SETUPPROJECTILEVELOCITY(missile, g_balance_seeker_tag);
-set g_vehicle_raptor_respawntime 35
+set g_vehicle_raptor_respawntime 40
// 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_turnroll 0.2
+set g_vehicle_raptor_turnroll 0.4
set g_vehicle_raptor_takeofftime 1.5
set g_vehicle_raptor_pitchspeed 60
set g_vehicle_raptor_pitchlimit 45
-set g_vehicle_raptor_speed_forward 1500
-set g_vehicle_raptor_speed_strafe 1000
+set g_vehicle_raptor_speed_forward 1000
+set g_vehicle_raptor_speed_strafe 700
set g_vehicle_raptor_speed_up 900
set g_vehicle_raptor_speed_down 1200
-set g_vehicle_raptor_friction 0.8
+set g_vehicle_raptor_friction 0.7
set g_vehicle_raptor_bomblets 8
set g_vehicle_raptor_bomblet_alt 750
set g_vehicle_raptor_bomblet_explode_delay 0.4
set g_vehicle_raptor_bombs_refire 5
-set g_vehicle_raptor_cannon_turnspeed 45
+set g_vehicle_raptor_cannon_turnspeed 40
set g_vehicle_raptor_cannon_turnlimit 20
set g_vehicle_raptor_cannon_pitchlimit_up 12
set g_vehicle_raptor_cannon_pitchlimit_down 32
set g_vehicle_raptor_cannon_predicttarget 1
set g_vehicle_raptor_cannon_cost 1
-set g_vehicle_raptor_cannon_damage 20
+set g_vehicle_raptor_cannon_damage 10
set g_vehicle_raptor_cannon_radius 60
set g_vehicle_raptor_cannon_refire 0.05
set g_vehicle_raptor_cannon_speed 12000
set g_vehicle_raptor_flare_refire 5
set g_vehicle_raptor_flare_lifetime 10
set g_vehicle_raptor_flare_chase 0.9
-set g_vehicle_raptor_flare_range 1500
+set g_vehicle_raptor_flare_range 1750
-set g_vehicle_raptor_energy 30
-set g_vehicle_raptor_energy_regen 15
-set g_vehicle_raptor_energy_regen_pause 0.8
+set g_vehicle_raptor_energy 60
+set g_vehicle_raptor_energy_regen 20
+set g_vehicle_raptor_energy_regen_pause 1
-set g_vehicle_raptor_health 200
+set g_vehicle_raptor_health 160
set g_vehicle_raptor_health_regen 0
set g_vehicle_raptor_health_regen_pause 0
-set g_vehicle_raptor_shield 150
+set g_vehicle_raptor_shield 90
set g_vehicle_raptor_shield_regen 25
set g_vehicle_raptor_shield_regen_pause 1.5
set g_vehicle_raptor_bouncefactor 0.2
set g_vehicle_raptor_bouncestop 0
-set g_vehicle_raptor_bouncepain "1 1.5 500"
+set g_vehicle_raptor_bouncepain "1 1 500"
set g_vehicle_raptor_mass 2200