share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
changeset 12582 e2b5c6e805e8
parent 12580 0c5ce463949b
child 12583 5b23c42ef150
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Thu Sep 28 18:36:24 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Thu Sep 28 18:39:59 2017 +0200
@@ -27,7 +27,7 @@
 local dialog01 = {}
 -- mission objectives
 local goals = {
-	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 30000},
+	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 35000},
 }
 -- hogs
 local hero = {
@@ -107,12 +107,10 @@
 
 	initCheckpoint("fruit03")
 
-	AnimInit(true)
-	AnimationSetup()
+	AnimInit()
 end
 
 function onGameStart()
-	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
 	ShowMission(unpack(goals["init"]))
 
@@ -123,6 +121,11 @@
 	AddAmmo(hero.gear, amTeleport, 2)
 	AddAmmo(hero.gear, amSniperRifle, 2)
 	AddAmmo(hero.gear, amWatermelon, 2)
+
+	-- these 2 are needed in order hero has 10 sec more in the first turn
+	AddAmmo(hero.gear, amSkip, 100)
+	timeLeft = 0
+
 	--enemies ammo
 	AddAmmo(enemiesOdd[1].gear, amDEagle, 100)
 	AddAmmo(enemiesOdd[1].gear, amSniperRifle, 100)
@@ -134,14 +137,17 @@
 	AddAmmo(enemiesEven[1].gear, amGrenade, 5)
 
 	SendHealthStatsOff()
-	AddAnim(dialog01)
 end
 
 function onNewTurn()
 	if CurrentHedgehog == hero.gear then
 		if firstTurn then
+			-- Unique game rule in this mission
 			TurnTimeLeft = 25000
+			-- Generous ready time on first turn to give more time to read
+			ReadyTimeLeft = 35000
 			battleStarted = true
+			firstTurn = false
 		end
 		if lastWeaponUsed == amSkip then
 			TurnTimeLeft = TurnTime + timeLeft
@@ -188,21 +194,8 @@
 
 onHogAttack = hideMissionOnAction
 onAttack = hideMissionOnAction
-onLeft = hideMissionOnAction
-onRight = hideMissionOnAction
-onUp = hideMissionOnAction
-onDown = hideMissionOnAction
-onLJump = hideMissionOnAction
-onHJump = hideMissionOnAction
 onSlot = hideMissionOnAction
 onSetWeapon = hideMissionOnAction
-onTimer = hideMissionOnAction
-
-function onPrecise()
-	if GameTime > 3000 then
-		SetAnimSkip(true)
-	end
-end
 
 -------------- EVENTS ------------------
 
@@ -259,30 +252,6 @@
 	EndGame()
 end
 
--------------- ANIMATIONS ------------------
-
-function Skipanim(anim)
-	startBattle()
-end
-
-function AnimationSetup()
-	-- DIALOG 01 - Start, game instructions
-	AddSkipFunction(dialog01, Skipanim, {dialog01})
-	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the Fruit Planet Hog Solo got lost ..."), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("... and got ambushed by the Red Strawberries"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Use your available weapons in order to eliminate the enemies"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You can only use the sniper rifle or the watermelon bomb"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only 2 watermelon bombs during the game"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra sniper rifle every time you kill an enemy hog with a limit of max 4 rifles"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra teleport every time you kill an enemy hog with a limit of max 2 teleports"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("The first turn will last 25 sec and every other turn 15 sec"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("If you skip the game your time left will be added to your next turn"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Some parts of the land are indestructible"), 5000}})
-	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
-	table.insert(dialog01, {func = startBattle, args = {hero.gear}})
-end
-
 ------------------ Other Functions -------------------
 
 function turnHogs()
@@ -308,12 +277,9 @@
 	end
 end
 
-function startBattle()
-	AnimSwitchHog(enemiesOdd[table.getn(enemiesOdd)].gear)
-	EndTurn(true)
-	-- these 2 are needed in order hero has 10 sec more in the first turn
-	timeLeft = 0
-	AddAmmo(hero.gear, amSkip, 100)
+function onSwitch()
+	ReadyTimeLeft = ReadyTimeLeft + 2000
+	PlaySound(sndExtraTime)
 end
 
 function isHog(gear)