From c77c50df34b598014e29f889523bbf067a0998f0 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 6 Jul 2021 10:27:18 -0400 Subject: Added beginning of Hinawa event #28 --- res/scripts/hallucination_cliff.lua | 84 +++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) (limited to 'res/scripts') diff --git a/res/scripts/hallucination_cliff.lua b/res/scripts/hallucination_cliff.lua index 020a743..d539e62 100644 --- a/res/scripts/hallucination_cliff.lua +++ b/res/scripts/hallucination_cliff.lua @@ -1,5 +1,35 @@ hallucination_cliff = {} +function hallucination_cliff.init() + gamestate.hinawa_can_appear = false + if gamestate.saw_hinawa_first_scene then + if gamestate.saw_hinawa_second_scene then + -- the event can no longer trigger if the player leaves the map after + -- seeing hinawa a second time. + else + -- as long as nothing else prevents the scene from occuring, a player + -- who interrupted the hinawa event by leaving the map before seeing her + -- a second time is allowed to resume the event. + gamestate.hinawa_can_appear = true + MoveSpriteToWarp("hinawa", "hinawa_second_position") + end + else + -- the hinawa event only has a 50% chance of triggering; reloading the map + -- rolls this again. + if randomChance(1.0/2.0) then + gamestate.hinawa_can_appear = true + end + end + -- the hinawa event will not occur if claus ever joined the party. + if gamestate.claus_joined then + gamestate.hinawa_can_appear = false + end + -- if hinawa can't appear, remove her from the map. + if not gamestate.hinawa_can_appear then + DestroyNamedSprite("hinawa") + end +end + function hallucination_cliff.off_bottom() ChangeMap("hallucination_interior", "fromTop") end @@ -136,3 +166,57 @@ function hallucination_cliff.claus_fall_event() -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) end + +function hallucination_cliff.see_hinawa_first_event() + -- for safety, check if the claus falling event is happening, since it moves + -- the party into this event's trigger. + if gamestate.claus_fall_scene then + return + end + + -- the scene only triggers under certain circumstances (see the init function) + if not gamestate.hinawa_can_appear then + return + end + + -- do not trigger a second time + if gamestate.saw_hinawa_first_scene then + return + end + + gamestate.saw_hinawa_first_scene = true + + StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) + Delay(100) + + ShowExpression("lucas", "surprise") + ShowExpression("kuma", "surprise") + ShowExpression("duster", "surprise") + Delay(1000) + + PanToWarpPoint("first_hinawa_vantage", 2000) + Delay(750) + + RemoveExpression("lucas") + RemoveExpression("kuma") + RemoveExpression("duster") + WaitForPan() + Delay(2000) + + MakeSpriteNotSolid("hinawa") + UnpauseSprite("hinawa") + DirectSpriteToLocation("hinawa", "hinawa_offscreen_first", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY) + WaitForSpritePath("hinawa") + + DisableBehaviour("hinawa") + PauseSprite("hinawa") + MoveSpriteToWarp("hinawa", "hinawa_second_position") + Delay(2000) + ReturnCamera(1000) + Delay(500) + + DisplayMessage("* Lucas... Was that...?", "Kumatora", SpeakerType.WOMAN) + WaitForEndOfMessage() + + HideCutsceneBars(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) +end -- cgit 1.4.1