diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-04 22:11:34 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-04 22:11:34 -0500 |
| commit | dbc28c87fefbceb4eaec522b535f9034b05fe3f2 (patch) | |
| tree | 80592868e36e76ddf37eb7827eb9b0d1093693fe /res/scripts/hallucination_cliff.lua | |
| parent | 60f55603a8a880712a99ace377c09aed4f83c8f6 (diff) | |
| download | tanetane-dbc28c87fefbceb4eaec522b535f9034b05fe3f2.tar.gz tanetane-dbc28c87fefbceb4eaec522b535f9034b05fe3f2.tar.bz2 tanetane-dbc28c87fefbceb4eaec522b535f9034b05fe3f2.zip | |
Started "Claus falls off ladder" scene
Diffstat (limited to 'res/scripts/hallucination_cliff.lua')
| -rw-r--r-- | res/scripts/hallucination_cliff.lua | 83 |
1 files changed, 83 insertions, 0 deletions
| 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() | |||
| 13 | PlaySound("door_open.wav") | 13 | PlaySound("door_open.wav") |
| 14 | ChangeMap("pink_shell", "fromOutside") | 14 | ChangeMap("pink_shell", "fromOutside") |
| 15 | end | 15 | end |
| 16 | |||
| 17 | function hallucination_cliff.claus_fall_event() | ||
| 18 | -- do not trigger if we don't have claus | ||
| 19 | if not gamestate.still_has_claus then | ||
| 20 | return | ||
| 21 | end | ||
| 22 | |||
| 23 | -- do not trigger a second time | ||
| 24 | if gamestate.claus_fall_scene then | ||
| 25 | return | ||
| 26 | end | ||
| 27 | |||
| 28 | gamestate.claus_fall_scene = true | ||
| 29 | |||
| 30 | -- have the player automatically climb most of the ladder. this is to ensure | ||
| 31 | -- that Claus is off screen when the event triggers. | ||
| 32 | DisablePlayerControl() | ||
| 33 | Halt("lucas") | ||
| 34 | DirectSpriteToLocation("lucas", "near_top_first_ladder", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY) | ||
| 35 | WaitForSpritePath("lucas") | ||
| 36 | DisableBehaviour("lucas") | ||
| 37 | |||
| 38 | StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) | ||
| 39 | DisplayMessage("* Aiee!", "Claus", SpeakerType.MAN) | ||
| 40 | PlaySound("wobble_and_fall.wav") | ||
| 41 | WaitForEndOfMessage() | ||
| 42 | |||
| 43 | Delay(1000) | ||
| 44 | |||
| 45 | PlaySound("thud.wav") | ||
| 46 | ShakeCamera(100) | ||
| 47 | Delay(50) | ||
| 48 | |||
| 49 | ShowExpression("lucas", "surprise") | ||
| 50 | Delay(50) | ||
| 51 | |||
| 52 | ShowExpression("kuma", "surprise") | ||
| 53 | ShowExpression("duster", "surprise") | ||
| 54 | Delay(100) | ||
| 55 | |||
| 56 | StopShakingCamera() | ||
| 57 | Delay(1000) | ||
| 58 | |||
| 59 | MoveSpriteToWarp("join_claus", "claus_fall_location") | ||
| 60 | SetDirection("join_claus", Direction.LEFT) | ||
| 61 | SetAnimation("join_claus", "collapsed") | ||
| 62 | PanToSprite("join_claus", 4000) | ||
| 63 | Delay(1000) | ||
| 64 | |||
| 65 | RemoveExpression("lucas") | ||
| 66 | RemoveExpression("kuma") | ||
| 67 | RemoveExpression("duster") | ||
| 68 | WaitForPan() | ||
| 69 | |||
| 70 | Delay(1000) | ||
| 71 | |||
| 72 | -- we need to break up the party to detach Claus anyway, and while we're there | ||
| 73 | -- we should turn down the movement speed because the pathfinding algorithm | ||
| 74 | -- doesn't take media into consideration, and if we don't change the speed | ||
| 75 | -- before adding the other characters back, they'll bunch up as they move down | ||
| 76 | BreakUpParty("lucas") | ||
| 77 | SetMovementSpeed("lucas", 1) | ||
| 78 | character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("kuma")) | ||
| 79 | character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) | ||
| 80 | character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) | ||
| 81 | |||
| 82 | UnpauseSprite("lucas") | ||
| 83 | DirectSpriteToLocation("lucas", "near_bottom_first_ladder", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY) | ||
| 84 | WaitForSpritePath("lucas") | ||
| 85 | DisableBehaviour("lucas") | ||
| 86 | PauseSprite("lucas") | ||
| 87 | SetAnimation("lucas", "frozen") -- so he doesn't blink | ||
| 88 | |||
| 89 | -- TODO: rest of scene | ||
| 90 | |||
| 91 | -- same as before but less justifiable because the only reason we're doing | ||
| 92 | -- this is to fix the movement trails | ||
| 93 | -- BreakUpParty("lucas") | ||
| 94 | -- SetMovementSpeed("lucas", 2) | ||
| 95 | -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("kuma")) | ||
| 96 | -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) | ||
| 97 | -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) | ||
| 98 | end | ||
