1 void spawnfunc_turret_mlrs();
2 void turret_mlrs_dinit();
3 void turret_mlrs_attack();
4 void turret_mlrs_rocket_explode();
5 void turret_mlrs_rocket_touch();
7 void turret_mlrs_postthink()
10 self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
11 if(self.tur_head.frame < 0)
13 dprint("ammo:",ftos(self.ammo),"\n");
14 dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
19 void turret_mlrs_attack()
23 turret_tag_fire_update();
25 sound (self, CH_WEAPON_A, "weapons/rocket_fire.wav", VOL_BASE, ATTN_NORM);
28 setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
29 setorigin(missile, self.tur_shotorg);
30 missile.classname = "mlrs_missile";
32 missile.bot_dodge = TRUE;
33 missile.bot_dodgerating = self.shot_dmg;
34 missile.takedamage = DAMAGE_NO;
35 missile.damageforcescale = 4;
36 missile.think = turret_mlrs_rocket_explode;
37 missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
38 missile.solid = SOLID_BBOX;
39 missile.movetype = MOVETYPE_FLYMISSILE;
40 missile.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed;
41 missile.angles = vectoangles(missile.velocity);
42 missile.touch = turret_mlrs_rocket_touch;
43 missile.flags = FL_PROJECTILE;
44 missile.solid = SOLID_BBOX;
45 missile.enemy = self.enemy;
47 CSQCProjectile(missile, TRUE, PROJECTILE_ROCKET, FALSE); // no cull, fly sound
49 te_explosion (missile.origin);
52 void turret_mlrs_rocket_touch()
54 if( (other == self.owner) || (other == self.owner.tur_head) )
59 turret_mlrs_rocket_explode();
62 void turret_mlrs_rocket_explode()
65 if(self.event_damage != SUB_Null)
67 self.event_damage = SUB_Null;
68 self.think = turret_mlrs_rocket_explode;
69 self.nextthink = time;
76 d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_MLRS, world);
77 self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
78 self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
80 RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_MLRS, world);
83 // Target dead, Tell turret.
84 if ((self.enemy.deadflag != DEAD_NO) && (self.enemy == self.owner.enemy))
85 self.owner.enemy = world;
90 void turret_mlrs_dinit()
92 if (self.netname == "") self.netname = "MLRS turret";
94 self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
95 self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
96 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;// | TFL_AIM_GROUND2;
98 if (turret_stdproc_init("mlrs_std", "models/turrets/base.md3", "models/turrets/mlrs.md3", TID_MLRS) == 0)
104 self.damage_flags |= TFL_DMG_HEADSHAKE;
105 self.shoot_flags |= TFL_SHOOT_VOLLYALWAYS;
106 self.volly_counter = self.shot_volly;
109 self.turret_firefunc = turret_mlrs_attack;
110 self.turret_postthink = turret_mlrs_postthink;
114 /*QUAKED turret_mlrs (0 .5 .8) ?
117 void spawnfunc_turret_mlrs()
119 precache_model ("models/turrets/mlrs.md3");
120 precache_model ("models/turrets/base.md3");
122 self.think = turret_mlrs_dinit;
123 self.nextthink = time + 0.5;