diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-06 23:41:40 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-06 23:41:40 -0500 |
| commit | 6dab458c5fcd97aca871b46a43a2b46c80d1ed3c (patch) | |
| tree | 84513a99b974000e0845ebf0ff43fa5ab6380c89 /res/scripts/hallucination_mirror.lua | |
| parent | 16a515766862eb69dab70e081170da7ce39602a8 (diff) | |
| download | tanetane-6dab458c5fcd97aca871b46a43a2b46c80d1ed3c.tar.gz tanetane-6dab458c5fcd97aca871b46a43a2b46c80d1ed3c.tar.bz2 tanetane-6dab458c5fcd97aca871b46a43a2b46c80d1ed3c.zip | |
Idling in front of the mirror faces you toward it
Diffstat (limited to 'res/scripts/hallucination_mirror.lua')
| -rw-r--r-- | res/scripts/hallucination_mirror.lua | 22 |
1 files changed, 22 insertions, 0 deletions
| diff --git a/res/scripts/hallucination_mirror.lua b/res/scripts/hallucination_mirror.lua index 6e2ef55..bf1faba 100644 --- a/res/scripts/hallucination_mirror.lua +++ b/res/scripts/hallucination_mirror.lua | |||
| @@ -1,5 +1,27 @@ | |||
| 1 | hallucination_mirror = {} | 1 | hallucination_mirror = {} |
| 2 | 2 | ||
| 3 | function hallucination_mirror.init() | ||
| 4 | coroutine.yield() | ||
| 5 | -- This routine makes the player's party face the mirror if they are standing | ||
| 6 | -- in front of it for a few (5) seconds. The fact that this has to run | ||
| 7 | -- continuously makes it a bit complicated, and is why we keep checking that | ||
| 8 | -- we're on the same map. | ||
| 9 | while getMap():getName() == "hallucination_mirror" do | ||
| 10 | if IsSpriteInZone("lucas", "mirror_sight") and IsSpriteInZone("kuma", "mirror_sight") and IsSpriteInZone("duster", "mirror_sight") and IsSpriteInZone("boney", "mirror_sight") then | ||
| 11 | timer = 5000 -- milliseconds | ||
| 12 | while timer > 0 and getSprite(getPlayerSprite()).characterState == CharacterState.STILL and getMap():getName() == "hallucination_mirror" do | ||
| 13 | timer = timer - coroutine.yield() | ||
| 14 | end | ||
| 15 | |||
| 16 | if timer <= 0 and getSprite(getPlayerSprite()).characterState == CharacterState.STILL and getMap():getName() == "hallucination_mirror" then | ||
| 17 | SetPartyDirection(getPlayerSprite(), Direction.UP) | ||
| 18 | end | ||
| 19 | end | ||
| 20 | |||
| 21 | coroutine.yield() | ||
| 22 | end | ||
| 23 | end | ||
| 24 | |||
| 3 | function hallucination_mirror.mailbox() | 25 | function hallucination_mirror.mailbox() |
| 4 | StartCutscene() | 26 | StartCutscene() |
| 5 | DisplayMessage("* The mailbox lid is open...\n* Peek inside?", "", SpeakerType.NONE) | 27 | DisplayMessage("* The mailbox lid is open...\n* Peek inside?", "", SpeakerType.NONE) |
