A Space Adventure: Remove or shorten intro sequences of side missions
authorWuzzy <almikes@aol.com>
Thu, 28 Sep 2017 18:39:59 +0200
changeset 12582 e2b5c6e805e8
parent 12581 1fb961480b3c
child 12583 5b23c42ef150
A Space Adventure: Remove or shorten intro sequences of side missions Also increase initial ready time in death02 and fruit03
ChangeLog.txt
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death02.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua
--- a/ChangeLog.txt	Thu Sep 28 18:36:24 2017 +0200
+++ b/ChangeLog.txt	Thu Sep 28 18:39:59 2017 +0200
@@ -205,6 +205,8 @@
  + All missions: Clarify mine timers
  + All missions: Improve displaying behaviour of mission panel
  + All missions: Change team colors
+ + Side missions: Remove or shorten intro sequences
+ + Side missions: Generous ready time to give more time to read the mission panel
  * Spacetrip: Fix various bugs and logic flaws in the initial mission
  * A frozen adventure: Fix bazooka and excess freezers (>6) not retained over checkpoints
  * A frozen adventure: Fix and improve poorly written messages
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death02.lua	Thu Sep 28 18:36:24 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death02.lua	Thu Sep 28 18:39:59 2017 +0200
@@ -18,8 +18,6 @@
 	loc("If you injure a hedgehog you'll get 35% of the damage dealt.").."|"..
 	loc("Every time you kill an enemy hog your ammo will get reset next turn.").."|"..
 	loc("The rope won't get reset.")
--- dialogs
-local dialog01 = {}
 -- mission objectives
 local goals = {
 	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 35000},
@@ -54,6 +52,7 @@
 -- After hero killed an enemy, his weapons will be reset in the next round
 local heroWeaponResetPending = false
 local battleStarted = false
+local firstTurn = true
 
 -------------- LuaAPI EVENT HANDLERS ------------------
 
@@ -84,8 +83,7 @@
 
 	initCheckpoint("death02")
 
-	AnimInit(true)
-	AnimationSetup()
+	AnimInit()
 end
 
 function onGameStart()
@@ -102,10 +100,15 @@
 	refreshHeroAmmo()
 
 	SendHealthStatsOff()
-	AddAnim(dialog01)
 end
 
 function onNewTurn()
+	battleStarted = true
+	if firstTurn then
+		-- Generous ready time in first turn to more time to read the mission panel
+		ReadyTimeLeft = 35000
+		firstTurn = false
+	end
 	if CurrentHedgehog ~= hero.gear then
 		enemyWeapons()
 	elseif heroWeaponResetPending then
@@ -164,21 +167,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 ------------------
 
@@ -231,37 +221,8 @@
 	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 on the Planet of Death ..."), 3000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("... Hog Solo fights for his life"), 3000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Each time you play this missions enemy hogs will play in a random order"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("At the start of the game each enemy hog has only the weapon that he is named after"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("A random hedgehog will inherit the weapons of his deceased team-mates"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("If you kill a hedgehog with the respective weapon your health points will be set to 100"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("If you injure a hedgehog you'll get 35% of the damage dealt"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Every time you kill an enemy hog your ammo will get reset next turn"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Rope won't get reset"), 2000}})
-	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
-	table.insert(dialog01, {func = startBattle, args = {hero.gear}})
-end
-
 ------------ Other Functions -------------------
 
-function startBattle()
-	battleStarted = true
-	AnimSwitchHog(hero.gear)
-	TurnTimeLeft = TurnTime
-end
-
 function shuffleHogs(hogs)
     local hogsNumber = table.getn(hogs)
     for i=1,hogsNumber do
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua	Thu Sep 28 18:36:24 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua	Thu Sep 28 18:39:59 2017 +0200
@@ -18,7 +18,7 @@
 local dialog01 = {}
 -- mission objectives
 local goals = {
-	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 60000},
+	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 30000},
 }
 -- hogs
 local hero = {
@@ -62,6 +62,7 @@
 	GameFlags = gfOneClanMode
 	Seed = 1
 	TurnTime = -1
+	Ready = 30000
 	CaseFreq = 0
 	MinesNum = 0
 	MinesTime = 1
@@ -79,12 +80,10 @@
 
 	initCheckpoint("desert03")
 
-	AnimInit(true)
-	AnimationSetup()
+	AnimInit()
 end
 
 function onGameStart()
-	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
 	ShowMission(unpack(goals["init"]))
 
@@ -175,18 +174,6 @@
 	gameOver()
 end
 
--------------- ANIMATIONS ------------------
-
-function AnimationSetup()
-	-- DIALOG 01 - Start, game instructions
-	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the Desert Planet, Hog Solo found some time to play with his RC plane"), 3000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Each time you destroy all the targets on your current level you'll get teleported to the next level"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only one RC plane at the start of the mission"), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("During the game you can get new RC planes by collecting the weapon crates"), 5000}})
-	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
-end
-
 ----------------- Other Functions -----------------
 
 function checkTargetsDestroyed()
--- 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)
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Thu Sep 28 18:36:24 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Thu Sep 28 18:39:59 2017 +0200
@@ -27,7 +27,7 @@
 local dialog01 = {}
 -- mission objectives
 local goals = {
-	["init"] = {missionName, loc("Getting ready"), challengeObjectives, 1, 30000},
+	["init"] = {missionName, loc("Getting ready"), challengeObjectives, 1, 25000},
 }
 -- hogs
 local hero = {}
@@ -73,6 +73,7 @@
 	GameFlags = gfInvulnerable + gfOneClanMode
 	Seed = 1
 	TurnTime = 15000
+	Ready = 25000
 	CaseFreq = 0
 	MinesNum = 0
 	MinesTime = 1
@@ -103,6 +104,7 @@
 	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
 	ShowMission(unpack(goals["init"]))
+	HideMission()
 
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 
@@ -205,6 +207,7 @@
 -------------- ANIMATIONS ------------------
 
 function Skipanim(anim)
+	ShowMission(unpack(goals["init"]))
 	startFlying()
 end
 
@@ -216,10 +219,9 @@
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("This is the Olympic stadium of saucer flying."), SAY_SAY, 4000}})
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("All the saucer pilots dream to come here one day in order to compete with the best!"), SAY_SAY, 5000}})
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now you have the chance to try and claim the place that you deserve among the best."), SAY_SAY, 6000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Use the saucer and pass through the rings."), 5000}})
-	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Pause the game by pressing the pause key (default \"P\") for more details"), 5000}})
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Can you do it?"), SAY_SAY, 2000}})
 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
+	table.insert(dialog01, {func = ShowMission, args = goals["init"]})
 	table.insert(dialog01, {func = startFlying, args = {hero.gear}})
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Thu Sep 28 18:36:24 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Thu Sep 28 18:39:59 2017 +0200
@@ -92,12 +92,20 @@
 	AddAnim(dialog01)
 end
 
+-- Hide mission panel when jumping or shooting rope
 function onGearAdd(gear)
 	if GetGearType(gear) == gtRope then
 		HideMission()
 	end
 end
 
+function onLJump()
+	if startChallenge then
+		HideMission()
+	end
+end
+onHJump = onLJump
+
 function onNewTurn()
 	if startChallenge and currentPosition < 5 then
 		if CurrentHedgehog ~= hero.gear then