From 5ecd0f428dd8292a17c5013c525a4f5d3967acb8 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 12 Feb 2021 00:33:19 -0500 Subject: Scripts are organised per-map now --- res/scripts/common.lua | 2 +- res/scripts/default.lua | 5 ----- res/scripts/global.lua | 7 +++++++ res/scripts/map1.lua | 38 ++++++++++++++++++++++++++++++++++++++ res/scripts/map1_off_right.lua | 3 --- res/scripts/map2.lua | 5 +++++ res/scripts/map2_off_left.lua | 3 --- res/scripts/script0001.lua | 24 ------------------------ res/scripts/test_trigger.lua | 7 ------- 9 files changed, 51 insertions(+), 43 deletions(-) delete mode 100644 res/scripts/default.lua create mode 100644 res/scripts/global.lua create mode 100644 res/scripts/map1.lua delete mode 100644 res/scripts/map1_off_right.lua create mode 100644 res/scripts/map2.lua delete mode 100644 res/scripts/map2_off_left.lua delete mode 100644 res/scripts/script0001.lua delete mode 100644 res/scripts/test_trigger.lua (limited to 'res/scripts') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 2023e63..3c412c6 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -112,7 +112,7 @@ function ChangeMap(map, warp) playerSprite.controllable = false FadeToBlack(150) - loadMap("../res/maps/" .. map .. ".tmx", warp, direction) + loadMap(map, warp, direction) local newPlayerId = getPlayerSprite() local newPlayerSprite = getSprite(newPlayerId) diff --git a/res/scripts/default.lua b/res/scripts/default.lua deleted file mode 100644 index b8f7768..0000000 --- a/res/scripts/default.lua +++ /dev/null @@ -1,5 +0,0 @@ -function default() - StartCutscene() - DisplayMessage("* No problem here.", "", SpeakerType.NONE) - HideCutsceneBars() -end diff --git a/res/scripts/global.lua b/res/scripts/global.lua new file mode 100644 index 0000000..48084c8 --- /dev/null +++ b/res/scripts/global.lua @@ -0,0 +1,7 @@ +global = {} + +function global.no_problem_here() + StartCutscene() + DisplayMessage("* No problem here.", "", SpeakerType.NONE) + HideCutsceneBars() +end diff --git a/res/scripts/map1.lua b/res/scripts/map1.lua new file mode 100644 index 0000000..7d6014a --- /dev/null +++ b/res/scripts/map1.lua @@ -0,0 +1,38 @@ +map1 = {} + +function map1.script0001() + StartCutscene() + SetAnimation("boney", "barking") + local barkingNoise = LoopSound("barking_at_hallucination.wav") + + SetAnimation("flint", "talk") + DisplayMessage("* Lucas. It's me, Flint. Your father.\n\f* I found Claus. He's here. After three years I've finally found your brother.\n\fAre you ready to see him again?", "Flint", SpeakerType.MAN) + ShowChoice("Yes", "No") + WaitForEndOfMessage() + + SetAnimation("boney", "crouch") + StopSound(barkingNoise) + PlaySound("boney_growl.wav") + + if GetChoiceSelection() == 0 then + DisplayMessage("* I can hear the tremor in your voice, Lucas.\n\fLies are little games a mouth plays while the person attached withers away slowly.\n\fClaus is coming, whether you like it or not.\nWill you be able to look him in the eye?", "Flint", SpeakerType.MAN) + else + DisplayMessage("* Look at me when I'm talking to you, Lucas.\n\f* When Claus gets home, we won't need you anymore.\nYou're nothing compared to him.", "Flint", SpeakerType.MAN) + end + + WaitForEndOfMessage() + SetAnimation("flint", "still") + HideCutsceneBars() +end + +function map1.off_right() + ChangeMap("map2", "fromLeft") +end + +function map1.test_trigger() + StartCutscene() + PlaySound("boney_growl.wav") + DisplayMessage("* Hi! Welcome to the funky zone.", "", SpeakerType.NONE) + WaitForEndOfMessage() + HideCutsceneBars() +end diff --git a/res/scripts/map1_off_right.lua b/res/scripts/map1_off_right.lua deleted file mode 100644 index 7dd0113..0000000 --- a/res/scripts/map1_off_right.lua +++ /dev/null @@ -1,3 +0,0 @@ -function map1_off_right() - ChangeMap("map2", "fromLeft") -end diff --git a/res/scripts/map2.lua b/res/scripts/map2.lua new file mode 100644 index 0000000..1f14b31 --- /dev/null +++ b/res/scripts/map2.lua @@ -0,0 +1,5 @@ +map2 = {} + +function map2.off_left() + ChangeMap("map1", "fromRight") +end diff --git a/res/scripts/map2_off_left.lua b/res/scripts/map2_off_left.lua deleted file mode 100644 index d4d9ce4..0000000 --- a/res/scripts/map2_off_left.lua +++ /dev/null @@ -1,3 +0,0 @@ -function map2_off_left() - ChangeMap("map1", "fromRight") -end diff --git a/res/scripts/script0001.lua b/res/scripts/script0001.lua deleted file mode 100644 index bf6a0c2..0000000 --- a/res/scripts/script0001.lua +++ /dev/null @@ -1,24 +0,0 @@ -function script0001() - StartCutscene() - SetAnimation("boney", "barking") - local barkingNoise = LoopSound("barking_at_hallucination.wav") - - SetAnimation("flint", "talk") - DisplayMessage("* Lucas. It's me, Flint. Your father.\n\f* I found Claus. He's here. After three years I've finally found your brother.\n\fAre you ready to see him again?", "Flint", SpeakerType.MAN) - ShowChoice("Yes", "No") - WaitForEndOfMessage() - - SetAnimation("boney", "crouch") - StopSound(barkingNoise) - PlaySound("boney_growl.wav") - - if GetChoiceSelection() == 0 then - DisplayMessage("* I can hear the tremor in your voice, Lucas.\n\fLies are little games a mouth plays while the person attached withers away slowly.\n\fClaus is coming, whether you like it or not.\nWill you be able to look him in the eye?", "Flint", SpeakerType.MAN) - else - DisplayMessage("* Look at me when I'm talking to you, Lucas.\n\f* When Claus gets home, we won't need you anymore.\nYou're nothing compared to him.", "Flint", SpeakerType.MAN) - end - - WaitForEndOfMessage() - SetAnimation("flint", "still") - HideCutsceneBars() -end diff --git a/res/scripts/test_trigger.lua b/res/scripts/test_trigger.lua deleted file mode 100644 index 4d9d06c..0000000 --- a/res/scripts/test_trigger.lua +++ /dev/null @@ -1,7 +0,0 @@ -function test_trigger() - StartCutscene() - PlaySound("boney_growl.wav") - DisplayMessage("* Hi! Welcome to the funky zone.", "", SpeakerType.NONE) - WaitForEndOfMessage() - HideCutsceneBars() -end -- cgit 1.4.1