From cd72ba5481705072b893d728e2f80931b5cca580 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 5 Mar 2021 09:58:45 -0500 Subject: Wrote exit area scripts for underwater and time passage --- res/maps/hallucination_hot_spring.tmx | 5 ++++- res/maps/hallucination_interior.tmx | 5 ++++- res/scripts/common.lua | 19 +++++++++++++++++++ res/scripts/time_passage.lua | 7 +++++++ res/scripts/time_passage_antechamber.lua | 5 +++++ res/scripts/underwater.lua | 14 ++++++++++++++ res/scripts/underwater_start.lua | 5 +++++ res/sfx/exit_area.wav | Bin 0 -> 15116 bytes 8 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 res/sfx/exit_area.wav (limited to 'res') diff --git a/res/maps/hallucination_hot_spring.tmx b/res/maps/hallucination_hot_spring.tmx index d750a2b..7a8adf9 100644 --- a/res/maps/hallucination_hot_spring.tmx +++ b/res/maps/hallucination_hot_spring.tmx @@ -1,5 +1,5 @@ - + @@ -45,6 +45,9 @@ + + + diff --git a/res/maps/hallucination_interior.tmx b/res/maps/hallucination_interior.tmx index 734b113..6d3b88a 100644 --- a/res/maps/hallucination_interior.tmx +++ b/res/maps/hallucination_interior.tmx @@ -1,5 +1,5 @@ - + @@ -145,6 +145,9 @@ + + + diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 36ccc46..b0e555b 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -522,3 +522,22 @@ function SetMovementSpeed(spriteName, speed) local sprite = getSprite(spriteId) sprite.movementSpeed = speed end + +--- Performs the beginning of the exit area transition. +-- This does the circle effect and plays the sound effect. The circle effect +-- then gets removed and replaced with a screen fade. +function ExitAreaTransition() + DisablePlayerControl() + --character():halt(getPlayerSprite()) + coroutine.yield() + PlaySound("exit_area.wav") + FadeoutMusic(679) + effect():circleTransition(679, 1.0) + while not effect():isCircleTransitionComplete() do + coroutine.yield() + end + character():halt(getPlayerSprite()) + FadeToBlack(1) + effect():circleTransition(1, 0.0) + Delay(1000) +end diff --git a/res/scripts/time_passage.lua b/res/scripts/time_passage.lua index 11d51a8..e91a1cc 100644 --- a/res/scripts/time_passage.lua +++ b/res/scripts/time_passage.lua @@ -1,5 +1,12 @@ time_passage = {} +function time_passage.exit_area() + ExitAreaTransition() + ChangeMap("hallucination_interior", "exit_area_from_time_passage", ChangeMapOptions.DO_NOT_FADE) + RemoveFadeout(1000) + EnablePlayerControl() +end + function time_passage.off_bottom() ChangeMap("time_passage_antechamber", "fromTop") end diff --git a/res/scripts/time_passage_antechamber.lua b/res/scripts/time_passage_antechamber.lua index 5ccc3d4..73f4b0f 100644 --- a/res/scripts/time_passage_antechamber.lua +++ b/res/scripts/time_passage_antechamber.lua @@ -1,5 +1,10 @@ time_passage_antechamber = {} +function time_passage_antechamber.exit_area() + loadMapScripts("time_passage") + time_passage.exit_area() +end + function time_passage_antechamber.enter_door() CreateAnimatedSpriteAtWarpPoint("entryway", "entryway", "entryway_appear", "time_passage", Direction.DOWN, SpriteLayer.NORMAL) PlaySound("door_open.wav") diff --git a/res/scripts/underwater.lua b/res/scripts/underwater.lua index 0b62ff5..f0dd29f 100644 --- a/res/scripts/underwater.lua +++ b/res/scripts/underwater.lua @@ -12,6 +12,20 @@ function underwater.leave() SetAnimationSlowdown("lucas", 1) end +function underwater.exit_area() + ExitAreaTransition() + underwater.leave() + ChangeMap("hallucination_hot_spring", "exit_area_from_underwater", ChangeMapOptions.DO_NOT_FADE) + MoveSpriteToWarp("kuma", "exit_area_from_underwater") + MoveSpriteToWarp("duster", "exit_area_from_underwater") + MoveSpriteToWarp("boney", "exit_area_from_underwater") + character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("kuma")) + character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) + character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) + RemoveFadeout(1000) + EnablePlayerControl() +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) diff --git a/res/scripts/underwater_start.lua b/res/scripts/underwater_start.lua index 7259d05..7f8ab62 100644 --- a/res/scripts/underwater_start.lua +++ b/res/scripts/underwater_start.lua @@ -5,6 +5,11 @@ function underwater_start.init() underwater.make_lucas_underwater() end +function underwater_start.exit_area() + loadMapScripts("underwater") + underwater.exit_area() +end + function underwater_start.talk_to_fish1() StartCutscene() DisplayMessage("* You deserved what she did to you.", "Fish", SpeakerType.BOY) diff --git a/res/sfx/exit_area.wav b/res/sfx/exit_area.wav new file mode 100644 index 0000000..6de3b80 Binary files /dev/null and b/res/sfx/exit_area.wav differ -- cgit 1.4.1