From d5e3bc615b300eb985d59b91ebd1f2f1a4d4e107 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 26 Feb 2021 16:47:24 -0500 Subject: Added first underwater map Also spruced up the event that takes you there. Also fixed an issue where transplantParty wouldn't take the medium of the new position into consideration. Also added a constructor to the lua version of vec2i. --- res/scripts/common.lua | 21 ++++++++++++++++++--- res/scripts/hallucination_hot_spring.lua | 26 +++++++++++++++++++++++--- res/scripts/underwater.lua | 21 +++++++-------------- res/scripts/underwater_start.lua | 8 ++++++++ 4 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 res/scripts/underwater_start.lua (limited to 'res/scripts') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index af25333..e95f6f1 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -34,6 +34,10 @@ CutsceneOptions = { DO_NOT_CHANGE_ANIMATION = 1 -- Prevents player party animation being set to "frozen" at the start of a cutscene or "still" at the end } +ChangeMapOptions = { + DO_NOT_FADE = 1 -- Prevents fading to and from black +} + gamestate = {} --- Yields until the specified amount of time has passed. @@ -129,6 +133,11 @@ function GetPosition(spriteName) return sprite.loc end +function SetPosition(spriteName, x, y) + local spriteId = getSpriteByAlias(spriteName) + transform():moveSprite(spriteId, vec2i.new(x, y)) +end + function SetDirection(spriteName, dir) local spriteId = getSpriteByAlias(spriteName) animation():setSpriteDirection(spriteId, dir) @@ -239,18 +248,24 @@ function SetPartyAnimation(spriteId, animName) end end -function ChangeMap(map, warp) +function ChangeMap(map, warp, options) + options = options or 0 + local playerId = getPlayerSprite() local playerSprite = getSprite(playerId) local direction = playerSprite.dir playerSprite.controllable = false - FadeToBlack(150) + if (options & ChangeMapOptions.DO_NOT_FADE == 0) then + FadeToBlack(150) + end loadMap(map) character():transplantParty(playerId, getWarpPoint(warp), direction) coroutine.yield() - RemoveFadeout(150) + if (options & ChangeMapOptions.DO_NOT_FADE == 0) then + RemoveFadeout(150) + end playerSprite.controllable = true end diff --git a/res/scripts/hallucination_hot_spring.lua b/res/scripts/hallucination_hot_spring.lua index df4084c..4e3ca44 100644 --- a/res/scripts/hallucination_hot_spring.lua +++ b/res/scripts/hallucination_hot_spring.lua @@ -15,15 +15,20 @@ end function hallucination_hot_spring.enter_hot_spring() if gamestate.ionia_in_water then - StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) + -- Soft cutscene start; don't show bars but do take away control + getSprite(getPlayerSprite()).controllable = false + character():halt(getPlayerSprite()) + + -- Leave the rest of the party behind and have Lucas wade into the hot spring character():breakUpParty(getPlayerSprite()) - getSprite(getPlayerSprite()).paused = false character():moveInDirection(getPlayerSprite(), Direction.UP) Delay(500) character():stopDirecting(getPlayerSprite()) - getSprite(getPlayerSprite()).paused = true SetDirection("lucas", Direction.DOWN) Delay(1000) + + -- Show the cutscene bars when he gets surprised + StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) ShowExpression("lucas", "surprise") Delay(1000) RemoveExpression("lucas") @@ -32,6 +37,21 @@ function hallucination_hot_spring.enter_hot_spring() Delay(200) PlaySound("splash_submerge.wav") WaitForAnimation("lucas") + Delay(1000) + + -- After we fade to black, move the rest of the party offscreen. + -- We need to remove control again right after the map change because + -- ChangeMap automatically gives it back. + FadeToBlack(1000) + HideCutsceneBars() + SetPosition("kuma", -100, -100) + SetPosition("duster", -100, -100) + SetPosition("boney", -100, -100) + ChangeMap("underwater_start", "spawn", ChangeMapOptions.DO_NOT_FADE) + getSprite(getPlayerSprite()).controllable = false + Delay(500) + RemoveFadeout(1000) + getSprite(getPlayerSprite()).controllable = true end end diff --git a/res/scripts/underwater.lua b/res/scripts/underwater.lua index cc6d085..602c8d4 100644 --- a/res/scripts/underwater.lua +++ b/res/scripts/underwater.lua @@ -1,57 +1,50 @@ underwater = {} -function underwater.fish1() - StartCutscene() - DisplayMessage("* You deserved what she did to you.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() - HideCutsceneBars() -end - function underwater.fish2() StartCutscene() DisplayMessage("* What are you complaining about?\nYou're so powerful now...\n\fYou owe it all to her.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() + WaitForEndOfMessage() HideCutsceneBars() end function underwater.fish3() StartCutscene() DisplayMessage("* You wanted to become stronger, and now you're stronger. Quit crying.\n\f* Oh wait, that wasn't you.\n\fThat was Claus.\n\fYou were totally willing to stay at home and cry.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() + WaitForEndOfMessage() HideCutsceneBars() end function underwater.fish4() StartCutscene() DisplayMessage("* You think it hurt when your PSI unlocked?\n\fJust picture what it was like for Claus.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() + WaitForEndOfMessage() HideCutsceneBars() end function underwater.fish5() StartCutscene() DisplayMessage("* What did Aeolia do to your brother?\n\fStrangle him?\n\fPush him down a flight of stairs?\n\fMaybe it was in the hot spring just like you.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() + WaitForEndOfMessage() HideCutsceneBars() end function underwater.fish6() StartCutscene() DisplayMessage("* Still, you're probably eager to get your revenge. You don't fool me.\n\f* You have everyone else fooled but you can't fool yourself.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() + WaitForEndOfMessage() HideCutsceneBars() end function underwater.fish7() StartCutscene() DisplayMessage("* There's only three left.\nAnd after Mixolydia, it'll be her.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() + WaitForEndOfMessage() HideCutsceneBars() end function underwater.fish8() StartCutscene() DisplayMessage("* I bet you can't wait to wrap your hands around her needle,\n\fand\n\fpull\n\fas\n\fhard\n\fas\n\fyou\n\fcan.", "Fish", SpeakerType.BOY) - WaitForEndOfMessages() + WaitForEndOfMessage() HideCutsceneBars() end diff --git a/res/scripts/underwater_start.lua b/res/scripts/underwater_start.lua new file mode 100644 index 0000000..fe582ab --- /dev/null +++ b/res/scripts/underwater_start.lua @@ -0,0 +1,8 @@ +underwater_start = {} + +function underwater_start.talk_to_fish1() + StartCutscene() + DisplayMessage("* You deserved what she did to you.", "Fish", SpeakerType.BOY) + WaitForEndOfMessage() + HideCutsceneBars() +end \ No newline at end of file -- cgit 1.4.1