From dbc28c87fefbceb4eaec522b535f9034b05fe3f2 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 4 Mar 2021 22:11:34 -0500 Subject: Started "Claus falls off ladder" scene --- res/maps/hallucination_cliff.tmx | 16 ++++++- res/scripts/common.lua | 7 +++ res/scripts/global.lua | 14 ++++++ res/scripts/hallucination_cliff.lua | 83 ++++++++++++++++++++++++++++++++++++ res/sfx/thud.wav | Bin 0 -> 96234 bytes res/sfx/wobble_and_fall.wav | Bin 0 -> 399090 bytes 6 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 res/sfx/thud.wav create mode 100644 res/sfx/wobble_and_fall.wav (limited to 'res') diff --git a/res/maps/hallucination_cliff.tmx b/res/maps/hallucination_cliff.tmx index 7ec3d99..ae4656d 100644 --- a/res/maps/hallucination_cliff.tmx +++ b/res/maps/hallucination_cliff.tmx @@ -1,5 +1,5 @@ - + @@ -136,6 +136,20 @@ + + + + + + + + + + + + + + diff --git a/res/scripts/common.lua b/res/scripts/common.lua index dad9c5d..eb3817e 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -166,6 +166,13 @@ function SetPosition(spriteName, x, y) transform():moveSprite(spriteId, vec2i.new(x, y)) end +--- Moves a sprite to the specified warp point. +function MoveSpriteToWarp(spriteName, warp) + local spriteId = getSpriteByAlias(spriteName) + local warpPos = getMap():getWarpPoint(warp) + transform():moveSprite(spriteId, warpPos) +end + function SetDirection(spriteName, dir) local spriteId = getSpriteByAlias(spriteName) animation():setSpriteDirection(spriteId, dir) diff --git a/res/scripts/global.lua b/res/scripts/global.lua index 48084c8..8eddf55 100644 --- a/res/scripts/global.lua +++ b/res/scripts/global.lua @@ -5,3 +5,17 @@ function global.no_problem_here() DisplayMessage("* No problem here.", "", SpeakerType.NONE) HideCutsceneBars() end + +-- for testing the claus joined route +function global.test_join_claus() + CreateAnimatedSpriteAtPosition("join_claus", "claus", 0, 0, "still", Direction.DOWN, SpriteLayer.NORMAL) + + local clausId = getSpriteByAlias("join_claus") + character():addSpriteToParty(getPlayerSprite(), clausId) + + local clausSprite = getSprite(clausId) + clausSprite.persistent = true + + gamestate.claus_joined = true + gamestate.still_has_claus = true +end diff --git a/res/scripts/hallucination_cliff.lua b/res/scripts/hallucination_cliff.lua index 250c0cf..d4ba921 100644 --- a/res/scripts/hallucination_cliff.lua +++ b/res/scripts/hallucination_cliff.lua @@ -13,3 +13,86 @@ function hallucination_cliff.enter_door() PlaySound("door_open.wav") ChangeMap("pink_shell", "fromOutside") end + +function hallucination_cliff.claus_fall_event() + -- do not trigger if we don't have claus + if not gamestate.still_has_claus then + return + end + + -- do not trigger a second time + if gamestate.claus_fall_scene then + return + end + + gamestate.claus_fall_scene = true + + -- have the player automatically climb most of the ladder. this is to ensure + -- that Claus is off screen when the event triggers. + DisablePlayerControl() + Halt("lucas") + DirectSpriteToLocation("lucas", "near_top_first_ladder", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY) + WaitForSpritePath("lucas") + DisableBehaviour("lucas") + + StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) + DisplayMessage("* Aiee!", "Claus", SpeakerType.MAN) + PlaySound("wobble_and_fall.wav") + WaitForEndOfMessage() + + Delay(1000) + + PlaySound("thud.wav") + ShakeCamera(100) + Delay(50) + + ShowExpression("lucas", "surprise") + Delay(50) + + ShowExpression("kuma", "surprise") + ShowExpression("duster", "surprise") + Delay(100) + + StopShakingCamera() + Delay(1000) + + MoveSpriteToWarp("join_claus", "claus_fall_location") + SetDirection("join_claus", Direction.LEFT) + SetAnimation("join_claus", "collapsed") + PanToSprite("join_claus", 4000) + Delay(1000) + + RemoveExpression("lucas") + RemoveExpression("kuma") + RemoveExpression("duster") + WaitForPan() + + Delay(1000) + + -- we need to break up the party to detach Claus anyway, and while we're there + -- we should turn down the movement speed because the pathfinding algorithm + -- doesn't take media into consideration, and if we don't change the speed + -- before adding the other characters back, they'll bunch up as they move down + BreakUpParty("lucas") + SetMovementSpeed("lucas", 1) + character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("kuma")) + character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) + character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) + + UnpauseSprite("lucas") + DirectSpriteToLocation("lucas", "near_bottom_first_ladder", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY) + WaitForSpritePath("lucas") + DisableBehaviour("lucas") + PauseSprite("lucas") + SetAnimation("lucas", "frozen") -- so he doesn't blink + + -- TODO: rest of scene + + -- same as before but less justifiable because the only reason we're doing + -- this is to fix the movement trails + -- BreakUpParty("lucas") + -- SetMovementSpeed("lucas", 2) + -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("kuma")) + -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) + -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) +end diff --git a/res/sfx/thud.wav b/res/sfx/thud.wav new file mode 100644 index 0000000..489d318 Binary files /dev/null and b/res/sfx/thud.wav differ diff --git a/res/sfx/wobble_and_fall.wav b/res/sfx/wobble_and_fall.wav new file mode 100644 index 0000000..2925f33 Binary files /dev/null and b/res/sfx/wobble_and_fall.wav differ -- cgit 1.4.1