Merge pull request #6794 from abcdefg30/mtmfix

Fixed broken triggers on monster-tank-madness
This commit is contained in:
Paul Chote
2014-10-20 19:19:56 +13:00
2 changed files with 26 additions and 22 deletions

View File

@@ -1530,7 +1530,7 @@ Actors:
Location: 32,56
Owner: BadGuy
Health: 0.6875
Actor479: silo
USSROutpostSilo: silo
Location: 37,61
Owner: BadGuy
Actor480: powr

View File

@@ -76,17 +76,19 @@ SetupAlliedBase = function()
Utils.Do(SuperTanks, function(tnk)
if not tnk.IsDead then
Trigger.ClearAll(tnk)
Trigger.OnIdle(tnk, function()
if SuperTankAttack then
if tnk.Location == SuperTankMoveWaypoints[SuperTankMove].Location then
SuperTankMove = SuperTankMove + 1
if SuperTankMove == 5 then
SuperTankAttack = false
Trigger.AfterDelay(0, function()
Trigger.OnIdle(tnk, function()
if SuperTankAttack then
if tnk.Location == SuperTankMoveWaypoints[SuperTankMove].Location then
SuperTankMove = SuperTankMove + 1
if SuperTankMove == 5 then
SuperTankAttack = false
end
else
tnk.AttackMove(SuperTankMoveWaypoints[SuperTankMove].Location, 2)
end
else
tnk.AttackMove(SuperTankMoveWaypoints[SuperTankMove].Location, 2)
end
end
end)
end)
end
end)
@@ -123,19 +125,21 @@ SuperTankDomeInfiltrated = function()
SuperTankHunt = 4
SuperTankHuntCounter = -1
end
Trigger.OnIdle(tnk, function()
if SuperTankAttack then
if tnk.Location == SuperTankHuntWaypoints[SuperTankHunt].Location then
SuperTankHunt = SuperTankHunt + SuperTankHuntCounter
if SuperTankHunt == 0 or SuperTankHunt == 5 then
SuperTankAttack = false
Trigger.AfterDelay(0, function()
Trigger.OnIdle(tnk, function()
if SuperTankAttack then
if tnk.Location == SuperTankHuntWaypoints[SuperTankHunt].Location then
SuperTankHunt = SuperTankHunt + SuperTankHuntCounter
if SuperTankHunt == 0 or SuperTankHunt == 5 then
SuperTankAttack = false
end
else
tnk.AttackMove(SuperTankHuntWaypoints[SuperTankHunt].Location, 2)
end
else
tnk.AttackMove(SuperTankHuntWaypoints[SuperTankHunt].Location, 2)
tnk.Hunt()
end
else
tnk.Hunt()
end
end)
end)
end
end)
@@ -228,8 +232,8 @@ InitPlayers = function()
player.Cash = 0
ussr.Cash = 2000
--badguy.Resources = badguy.ResourceCapacity -- doesn't work, workaround below
Trigger.OnCapture(Actor479, function()
Trigger.AfterDelay(0, function() badguy.Resources = badguy.ResourceCapacity * 0.75 end)
Trigger.OnCapture(USSROutpostSilo, function() -- getting money through capturing doesn't work
player.Cash = player.Cash + Utils.RandomInteger(1200, 1300)
end)
end