Fix MLRS and Hellion (animations and logic)
authorJakob MG <jakob_mg@hotmail.com>
Sun, 17 Oct 2010 10:02:36 +0000 (12:02 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Sun, 17 Oct 2010 10:02:36 +0000 (12:02 +0200)
models/turrets/hellion.md3
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/units/unit_hellion.qc
qcsrc/server/tturrets/units/unit_mlrs.qc
unit_hellion.cfg
unit_mlrs.cfg

index 0afeae40364d19df69c2f5aadfb4bd9ee3d38c17..02ab1eed3023fd8afa26d10225bff345ae0b9bf4 100644 (file)
Binary files a/models/turrets/hellion.md3 and b/models/turrets/hellion.md3 differ
index 1b2fcd7723b8089c7fb5102dbb44f424eb4c7e66..af53db7c62c234f258cfb46919f1dfe29e820960 100644 (file)
@@ -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)
 
     // 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)
 
     // 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();
     }
 
         self.use();
     }
 
+       turret_stdproc_respawn();
     return 1;
 }
 
     return 1;
 }
 
index 1e42e5e1ada3251fa3707a2e53d7b6883e5d7998..b6408ed4f32b1f3aa936caad9234a1452fc4930e 100644 (file)
@@ -17,21 +17,23 @@ void turret_hellion_postthink()
     }
 
     if (self.tur_head.frame != 0)
     }
 
     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()
 {
         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);
 
     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 = 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);
     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
 
        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_hellion_missile_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
index 48e2b007680061c295c91fc696d5377d0ef3ab91..499d6de2352c15c55d591d762cca0d40eb1f32f1 100644 (file)
@@ -6,9 +6,14 @@ void turret_mlrs_rocket_touch();
 
 void turret_mlrs_postthink()
 {
 
 void turret_mlrs_postthink()
 {
-
     // 0 = full, 6 = empty
     // 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()
 }
 
 void turret_mlrs_attack()
index f90d7fb599508a30b7758fdc154f746497e6d461..cdf7546b8c93234b8a4cf5604c54c24f2d9b0429 100644 (file)
@@ -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_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_hellion_std_shot_radius 80
 
 set g_turrets_unit_hellion_std_shot_speed 650
index d63c1335e7e5bcec58219e623772761fa344311e..c3f3f7859d437f9d09bc2aade560a001433b5857 100644 (file)
@@ -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_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_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_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
 
 set g_turrets_unit_mlrs_std_aim_firetolerance_dist 120
 set g_turrets_unit_mlrs_std_aim_speed 100