hallucination_mirror = {} function hallucination_mirror.look_at_mirror() coroutine.yield() -- This routine makes the player's party face the mirror if they are standing -- in front of it for a few (5) seconds. The fact that this has to run -- continuously makes it a bit complicated. while true do if IsSpriteInZone("lucas", "mirror_sight") and IsSpriteInZone("kuma", "mirror_sight") and IsSpriteInZone("duster", "mirror_sight") and IsSpriteInZone("boney", "mirror_sight") then timer = 5000 -- milliseconds while timer > 0 and getSprite(getPlayerSprite()).characterState == CharacterState.STILL and not message().isMessageActive do timer = timer - coroutine.yield() end if timer <= 0 and getSprite(getPlayerSprite()).characterState == CharacterState.STILL and not message().isMessageActive then SetPartyDirection(getPlayerSprite(), Direction.UP) end end coroutine.yield() end end function hallucination_mirror.off_left() ChangeMap("hallucination_interior", "fromRight") end function hallucination_mirror.mailbox() StartCutscene() DisplayMessage("* The mailbox lid is open...\n* Peek inside?", "", SpeakerType.NONE) ShowChoice("Yes", "No") WaitForEndOfMessage() if GetChoiceSelection() == 1 then HideCutsceneBars() return end DisplayMessage("* Inside the mailbox is a poem.\n* Read it?", "", SpeakerType.NONE) ShowChoice("Yes", "No") WaitForEndOfMessage() if GetChoiceSelection() == 1 then HideCutsceneBars() return end if not gamestate.read_mirror_message then animation():initSprite(getSpriteByAlias("double_lucas"), "../res/sprites/claus_anim.txt") animation():initSprite(getSpriteByAlias("double_kuma"), "../res/sprites/ionia_anim.txt") animation():initSprite(getSpriteByAlias("double_duster"), "../res/sprites/wess_anim.txt") --animation():initSprite(getSpriteByAlias("double_boney"), "../res/sprites/claus_anim.txt") end gamestate.read_mirror_message = true DisplayMessage("* \n* \n* \n\f...\n\f* You get the feeling you're being watched.", "", SpeakerType.NONE) WaitForEndOfMessage() HideCutsceneBars() end function hallucination_mirror.examine_mirror() StartCutscene() Halt("double_lucas") Halt("double_kuma") Halt("double_duster") Halt("double_boney") if gamestate.read_mirror_message then DisplayMessage("* Something seems wrong about this.", "", SpeakerType.NONE) else DisplayMessage("* Looking handsome.", "", SpeakerType.NONE) end WaitForEndOfMessage() HideCutsceneBars() end