diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2021-07-06 10:27:18 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2021-07-06 10:27:18 -0400 |
commit | c77c50df34b598014e29f889523bbf067a0998f0 (patch) | |
tree | 2c600814d7286011eccdb0e9fb53b43930832a75 /res/scripts | |
parent | 77fad1c341787f11ee3b8aeaa5c58fe6ebbdebb6 (diff) | |
download | tanetane-c77c50df34b598014e29f889523bbf067a0998f0.tar.gz tanetane-c77c50df34b598014e29f889523bbf067a0998f0.tar.bz2 tanetane-c77c50df34b598014e29f889523bbf067a0998f0.zip |
Added beginning of Hinawa event
#28
Diffstat (limited to 'res/scripts')
-rw-r--r-- | res/scripts/hallucination_cliff.lua | 84 |
1 files changed, 84 insertions, 0 deletions
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 @@ | |||
1 | hallucination_cliff = {} | 1 | hallucination_cliff = {} |
2 | 2 | ||
3 | function hallucination_cliff.init() | ||
4 | gamestate.hinawa_can_appear = false | ||
5 | if gamestate.saw_hinawa_first_scene then | ||
6 | if gamestate.saw_hinawa_second_scene then | ||
7 | -- the event can no longer trigger if the player leaves the map after | ||
8 | -- seeing hinawa a second time. | ||
9 | else | ||
10 | -- as long as nothing else prevents the scene from occuring, a player | ||
11 | -- who interrupted the hinawa event by leaving the map before seeing her | ||
12 | -- a second time is allowed to resume the event. | ||
13 | gamestate.hinawa_can_appear = true | ||
14 | MoveSpriteToWarp("hinawa", "hinawa_second_position") | ||
15 | end | ||
16 | else | ||
17 | -- the hinawa event only has a 50% chance of triggering; reloading the map | ||
18 | -- rolls this again. | ||
19 | if randomChance(1.0/2.0) then | ||
20 | gamestate.hinawa_can_appear = true | ||
21 | end | ||
22 | end | ||
23 | -- the hinawa event will not occur if claus ever joined the party. | ||
24 | if gamestate.claus_joined then | ||
25 | gamestate.hinawa_can_appear = false | ||
26 | end | ||
27 | -- if hinawa can't appear, remove her from the map. | ||
28 | if not gamestate.hinawa_can_appear then | ||
29 | DestroyNamedSprite("hinawa") | ||
30 | end | ||
31 | end | ||
32 | |||
3 | function hallucination_cliff.off_bottom() | 33 | function hallucination_cliff.off_bottom() |
4 | ChangeMap("hallucination_interior", "fromTop") | 34 | ChangeMap("hallucination_interior", "fromTop") |
5 | end | 35 | end |
@@ -136,3 +166,57 @@ function hallucination_cliff.claus_fall_event() | |||
136 | -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) | 166 | -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("duster")) |
137 | -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) | 167 | -- character():addSpriteToParty(getPlayerSprite(), getSpriteByAlias("boney")) |
138 | end | 168 | end |
169 | |||
170 | function hallucination_cliff.see_hinawa_first_event() | ||
171 | -- for safety, check if the claus falling event is happening, since it moves | ||
172 | -- the party into this event's trigger. | ||
173 | if gamestate.claus_fall_scene then | ||
174 | return | ||
175 | end | ||
176 | |||
177 | -- the scene only triggers under certain circumstances (see the init function) | ||
178 | if not gamestate.hinawa_can_appear then | ||
179 | return | ||
180 | end | ||
181 | |||
182 | -- do not trigger a second time | ||
183 | if gamestate.saw_hinawa_first_scene then | ||
184 | return | ||
185 | end | ||
186 | |||
187 | gamestate.saw_hinawa_first_scene = true | ||
188 | |||
189 | StartCutscene(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) | ||
190 | Delay(100) | ||
191 | |||
192 | ShowExpression("lucas", "surprise") | ||
193 | ShowExpression("kuma", "surprise") | ||
194 | ShowExpression("duster", "surprise") | ||
195 | Delay(1000) | ||
196 | |||
197 | PanToWarpPoint("first_hinawa_vantage", 2000) | ||
198 | Delay(750) | ||
199 | |||
200 | RemoveExpression("lucas") | ||
201 | RemoveExpression("kuma") | ||
202 | RemoveExpression("duster") | ||
203 | WaitForPan() | ||
204 | Delay(2000) | ||
205 | |||
206 | MakeSpriteNotSolid("hinawa") | ||
207 | UnpauseSprite("hinawa") | ||
208 | DirectSpriteToLocation("hinawa", "hinawa_offscreen_first", PathfindingOptions.CARDINAL_DIRECTIONS_ONLY) | ||
209 | WaitForSpritePath("hinawa") | ||
210 | |||
211 | DisableBehaviour("hinawa") | ||
212 | PauseSprite("hinawa") | ||
213 | MoveSpriteToWarp("hinawa", "hinawa_second_position") | ||
214 | Delay(2000) | ||
215 | ReturnCamera(1000) | ||
216 | Delay(500) | ||
217 | |||
218 | DisplayMessage("* Lucas... Was that...?", "Kumatora", SpeakerType.WOMAN) | ||
219 | WaitForEndOfMessage() | ||
220 | |||
221 | HideCutsceneBars(CutsceneOptions.DO_NOT_CHANGE_ANIMATION) | ||
222 | end | ||