// Special case: volly fire turret that has to fire a full volly if a shot was fired.
if (self.shoot_flags & TFL_SHOOT_VOLLYALWAYS)
- if not (self.volly_counter == self.shot_volly)
- return 1;
+ if (self.volly_counter != self.shot_volly)
+ if(self.ammo >= self.shot_dmg)
+ return 1;
// Lack of zombies makes shooting dead things unnecessary :P
if (self.firecheck_flags & TFL_FIRECHECK_DEAD)
self.use();
}
+ turret_stdproc_respawn();
return 1;
}
}
if (self.tur_head.frame != 0)
- self.tur_head.frame = self.tur_head.frame + 1;
+ self.tur_head.frame += 1;
- if (self.tur_head.frame > 7)
+ if (self.tur_head.frame >= 7)
self.tur_head.frame = 0;
}
void turret_hellion_attack()
{
- local entity missile;
-
+ entity missile;
+
+ if(self.tur_head.frame != 0)
+ self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire"));
+ else
+ self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2"));
+
sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
- // switch tubes
- //self.tur_shotorg_y = self.tur_shotorg_y * -1;
-
missile = spawn ();
setorigin(missile, self.tur_shotorg);
setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
missile.tur_health = time + 9;
missile.tur_aimpos = randomvec() * 128;
te_explosion (missile.origin);
-
CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
- if (self.tur_head.frame == 0)
- self.tur_head.frame = self.tur_head.frame + 1;
-
+ self.tur_head.frame += 1;
}
void turret_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
void turret_mlrs_postthink()
{
-
// 0 = full, 6 = empty
- self.tur_head.frame = rint(6 - (self.ammo / self.shot_dmg));
+ self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
+ if(self.tur_head.frame < 0)
+ {
+ dprint("ammo:",ftos(self.ammo),"\n");
+ dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
+ }
+
}
void turret_mlrs_attack()
set g_turrets_unit_hellion_std_respawntime 90
set g_turrets_unit_hellion_std_shot_dmg 50
-set g_turrets_unit_hellion_std_shot_refire 0.25
+set g_turrets_unit_hellion_std_shot_refire 0.2
set g_turrets_unit_hellion_std_shot_radius 80
set g_turrets_unit_hellion_std_shot_speed 650
set g_turrets_unit_mlrs_std_shot_force 25
set g_turrets_unit_mlrs_std_shot_volly 6
-set g_turrets_unit_mlrs_std_shot_volly_refire 1
+
+// !must be correctly matched with ammo_recharge as this unit use
+// volly_always. (means ammo_recharge * ammo_max must be eaqual to volly_refire)
+set g_turrets_unit_mlrs_std_shot_volly_refire 4
set g_turrets_unit_mlrs_std_target_range 3000
set g_turrets_unit_mlrs_std_target_range_min 500
set g_turrets_unit_mlrs_std_target_select_playerbias 1
set g_turrets_unit_mlrs_std_target_select_missilebias 0
-set g_turrets_unit_mlrs_std_ammo_max 420
-set g_turrets_unit_mlrs_std_ammo 420
-set g_turrets_unit_mlrs_std_ammo_recharge 70
+// !must be shot_dmg * 6 as this unit uses ammo to control the animation
+set g_turrets_unit_mlrs_std_ammo_max 300
+set g_turrets_unit_mlrs_std_ammo 300
+set g_turrets_unit_mlrs_std_ammo_recharge 75
set g_turrets_unit_mlrs_std_aim_firetolerance_dist 120
set g_turrets_unit_mlrs_std_aim_speed 100