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 | |
| 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')
| -rw-r--r-- | res/scripts/common.lua | 7 | ||||
| -rw-r--r-- | res/scripts/global.lua | 14 | ||||
| -rw-r--r-- | res/scripts/hallucination_cliff.lua | 83 |
3 files changed, 104 insertions, 0 deletions
| 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) | |||
| 166 | transform():moveSprite(spriteId, vec2i.new(x, y)) | 166 | transform():moveSprite(spriteId, vec2i.new(x, y)) |
| 167 | end | 167 | end |
| 168 | 168 | ||
| 169 | --- Moves a sprite to the specified warp point. | ||
| 170 | function MoveSpriteToWarp(spriteName, warp) | ||
| 171 | local spriteId = getSpriteByAlias(spriteName) | ||
| 172 | local warpPos = getMap():getWarpPoint(warp) | ||
| 173 | transform():moveSprite(spriteId, warpPos) | ||
| 174 | end | ||
| 175 | |||
| 169 | function SetDirection(spriteName, dir) | 176 | function SetDirection(spriteName, dir) |
| 170 | local spriteId = getSpriteByAlias(spriteName) | 177 | local spriteId = getSpriteByAlias(spriteName) |
| 171 | animation():setSpriteDirection(spriteId, dir) | 178 | 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() | |||
| 5 | DisplayMessage("* No problem here.", "", SpeakerType.NONE) | 5 | DisplayMessage("* No problem here.", "", SpeakerType.NONE) |
| 6 | HideCutsceneBars() | 6 | HideCutsceneBars() |
| 7 | end | 7 | end |
| 8 | |||
| 9 | -- for testing the claus joined route | ||
| 10 | function global.test_join_claus() | ||
| 11 | CreateAnimatedSpriteAtPosition("join_claus", "claus", 0, 0, "still", Direction.DOWN, SpriteLayer.NORMAL) | ||
| 12 | |||
| 13 | local clausId = getSpriteByAlias("join_claus") | ||
| 14 | character():addSpriteToParty(getPlayerSprite(), clausId) | ||
| 15 | |||
| 16 | local clausSprite = getSprite(clausId) | ||
| 17 | clausSprite.persistent = true | ||
| 18 | |||
| 19 | gamestate.claus_joined = true | ||
| 20 | gamestate.still_has_claus = true | ||
| 21 | 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() | |||
| 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 | ||
