# HG changeset patch # User Wuzzy # Date 1491869341 -7200 # Node ID 6ffb18cf4c578eb42333c2cdbc1ad3df189cb221 # Parent c6034081cac2a0e650cf6fabd1218fe582d1cd5d Add infinite skipping in fruit03 mission diff -r c6034081cac2 -r 6ffb18cf4c57 share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua --- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua Tue Apr 11 00:17:42 2017 +0200 +++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua Tue Apr 11 02:09:01 2017 +0200 @@ -11,8 +11,9 @@ ----------------- VARIABLES -------------------- -- globals local missionName = loc("Precise shooting") -local timeLeft = 10000 -local lastWeaponUsed = amSniperRifle +local timeLeft = 0 +local lastWeaponUsed = amNothing +local firstTurn = true local challengeObjectives = loc("Use your available weapons in order to eliminate the enemies.").."|".. loc("You can only use the sniper rifle or the watermelon bomb.").."|".. loc("You'll have only 2 watermelon bombs during the game.").."|".. @@ -132,9 +133,11 @@ function onNewTurn() if CurrentHedgehog == hero.gear then - if GetAmmoCount(hero.gear, amSkip) == 0 then + if firstTurn then + TurnTimeLeft = 25000 + end + if lastWeaponUsed == amSkip then TurnTimeLeft = TurnTime + timeLeft - AddAmmo(hero.gear, amSkip, 1) end timeLeft = 0 end @@ -287,8 +290,8 @@ AnimSwitchHog(enemiesOdd[table.getn(enemiesOdd)].gear) TurnTimeLeft = 0 -- these 2 are needed in order hero has 10 sec more in the first turn - timeLeft = 10000 - AddAmmo(hero.gear, amSkip, 0) + timeLeft = 0 + AddAmmo(hero.gear, amSkip, 100) end function isHog(gear)