From: Jakob MG Date: Sun, 17 Oct 2010 10:02:36 +0000 (+0200) Subject: Fix MLRS and Hellion (animations and logic) X-Git-Tag: xonotic-v0.1.0preview~281^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6ac6997bf385c44ef9294db2f375342c87b81982;p=xonotic%2Fxonotic-data.pk3dir.git Fix MLRS and Hellion (animations and logic) --- diff --git a/models/turrets/hellion.md3 b/models/turrets/hellion.md3 index 0afeae403..02ab1eed3 100644 Binary files a/models/turrets/hellion.md3 and b/models/turrets/hellion.md3 differ diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index 1b2fcd772..af53db7c6 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -340,8 +340,9 @@ float turret_stdproc_firecheck() // 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) @@ -1234,6 +1235,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base self.use(); } + turret_stdproc_respawn(); return 1; } diff --git a/qcsrc/server/tturrets/units/unit_hellion.qc b/qcsrc/server/tturrets/units/unit_hellion.qc index 1e42e5e1a..b6408ed4f 100644 --- a/qcsrc/server/tturrets/units/unit_hellion.qc +++ b/qcsrc/server/tturrets/units/unit_hellion.qc @@ -17,21 +17,23 @@ void turret_hellion_postthink() } 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 @@ -57,12 +59,9 @@ void turret_hellion_attack() 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) diff --git a/qcsrc/server/tturrets/units/unit_mlrs.qc b/qcsrc/server/tturrets/units/unit_mlrs.qc index 48e2b0076..499d6de23 100644 --- a/qcsrc/server/tturrets/units/unit_mlrs.qc +++ b/qcsrc/server/tturrets/units/unit_mlrs.qc @@ -6,9 +6,14 @@ void turret_mlrs_rocket_touch(); 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() diff --git a/unit_hellion.cfg b/unit_hellion.cfg index f90d7fb59..cdf7546b8 100644 --- a/unit_hellion.cfg +++ b/unit_hellion.cfg @@ -2,7 +2,7 @@ set g_turrets_unit_hellion_std_health 500 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 diff --git a/unit_mlrs.cfg b/unit_mlrs.cfg index d63c1335e..c3f3f7859 100644 --- a/unit_mlrs.cfg +++ b/unit_mlrs.cfg @@ -9,7 +9,10 @@ set g_turrets_unit_mlrs_std_shot_spread 0.05 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 @@ -21,9 +24,10 @@ set g_turrets_unit_mlrs_std_target_select_anglebias 0.5 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