# HG changeset patch # User Wuzzy # Date 1548097003 -3600 # Node ID 5931aff25837afe71ce7211346293f96f57968db # Parent e7b2542c4d28f5d59665efb52b3c4034c5a4aef5 Portal mission: Delay first speech until turn start diff -r e7b2542c4d28 -r 5931aff25837 share/hedgewars/Data/Missions/Scenario/portal.lua --- a/share/hedgewars/Data/Missions/Scenario/portal.lua Mon Jan 21 19:49:38 2019 +0100 +++ b/share/hedgewars/Data/Missions/Scenario/portal.lua Mon Jan 21 19:56:43 2019 +0100 @@ -3,7 +3,8 @@ local MineArray = {} local player -local adviceGiven = false +local adviceGiven0 = false +local adviceGiven1 = false local adviceGiven2 = false function onGameInit() @@ -166,15 +167,20 @@ loc("In this mission you have infinite time.") .. "|" .. loc("Mines time: 0 seconds"), -amPortalGun, 5000) - HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK) +end +function onNewTurn() + if (adviceGiven0 == false) then + adviceGiven0 = true + HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK) + end end function onGameTick() if (player ~= nil) then - if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven == false)) then - adviceGiven = true + if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven1 == false)) then + adviceGiven1 = true HogSay(player, loc("Hmmm, I’ll have to find some way of moving him off this anti-portal surface."), SAY_THINK) elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then adviceGiven2 = true