summary refs log tree commit diff stats
path: root/res/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'res/scripts')
-rw-r--r--res/scripts/common.lua29
-rw-r--r--res/scripts/map2.lua6
2 files changed, 24 insertions, 11 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 75b86a8..2197417 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -41,6 +41,7 @@ function StartCutscene()
41 local playerSprite = getSprite(playerId) 41 local playerSprite = getSprite(playerId)
42 playerSprite.controllable = false 42 playerSprite.controllable = false
43 character():halt(playerId) 43 character():halt(playerId)
44 message():displayCutsceneBars()
44end 45end
45 46
46function DisplayMessage(msg, name, type) 47function DisplayMessage(msg, name, type)
@@ -107,21 +108,27 @@ function StopSound(soundId)
107end 108end
108 109
109function FadeToBlack(length) 110function FadeToBlack(length)
110 local progress = 0.0 111 effect():fadeScreen(length, 1.0)
111 while progress < length do 112 repeat
112 progress = progress + coroutine.yield() 113 coroutine.yield()
113 setFadeoutProgress(progress / length) 114 until effect():isScreenFadeComplete()
114 end
115 setFadeoutProgress(1.0)
116end 115end
117 116
118function RemoveFadeout(length) 117function RemoveFadeout(length)
119 local progress = length 118 effect():fadeScreen(length, 0.0)
120 while progress > 0 do 119 repeat
121 progress = progress - coroutine.yield() 120 coroutine.yield()
122 setFadeoutProgress(progress / length) 121 until effect():isScreenFadeComplete()
122end
123
124function FadeMap(length, amount)
125 effect():fadeMap(length, amount)
126end
127
128function WaitForMapFade()
129 while not effect():isMapFadeComplete() do
130 coroutine.yield()
123 end 131 end
124 setFadeoutProgress(0.0)
125end 132end
126 133
127function SetPartyDirection(spriteId, direction) 134function SetPartyDirection(spriteId, direction)
diff --git a/res/scripts/map2.lua b/res/scripts/map2.lua index 8058aa2..12a5df0 100644 --- a/res/scripts/map2.lua +++ b/res/scripts/map2.lua
@@ -26,6 +26,9 @@ end
26 26
27function map2.mailbox_lightning() 27function map2.mailbox_lightning()
28 StartCutscene() 28 StartCutscene()
29 FadeMap(500, 0.5)
30 WaitForMapFade()
31
29 DisplayMessage("* ...?", "", SpeakerType.NONE) 32 DisplayMessage("* ...?", "", SpeakerType.NONE)
30 WaitForEndOfMessage() 33 WaitForEndOfMessage()
31 34
@@ -44,6 +47,9 @@ function map2.mailbox_lightning()
44 SetAnimation("lucas", "lightning_collapse!") 47 SetAnimation("lucas", "lightning_collapse!")
45 WaitForAnimation("lucas") 48 WaitForAnimation("lucas")
46 49
50 FadeMap(500, 0.0)
51 WaitForMapFade()
52
47 DisplayMessage("* It was lightning.\n\fAh.", "", SpeakerType.NONE) 53 DisplayMessage("* It was lightning.\n\fAh.", "", SpeakerType.NONE)
48 WaitForEndOfMessage() 54 WaitForEndOfMessage()
49 HideCutsceneBars() 55 HideCutsceneBars()