summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/maps/hallucination_interior.tmx12
-rw-r--r--res/scripts/common.lua44
-rw-r--r--res/scripts/hallucination_interior.lua32
3 files changed, 80 insertions, 8 deletions
diff --git a/res/maps/hallucination_interior.tmx b/res/maps/hallucination_interior.tmx index ee7a5cd..55e5506 100644 --- a/res/maps/hallucination_interior.tmx +++ b/res/maps/hallucination_interior.tmx
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="2" nextobjectid="3"> 2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="4">
3 <properties> 3 <properties>
4 <property name="music" value="red_green_yellow_yellow"/> 4 <property name="music" value="red_green_yellow_yellow"/>
5 </properties> 5 </properties>
@@ -40,8 +40,8 @@
402,2,1,1,1,1,2,2,2,2,2,2,2,4,5,12,3221225481,3221225481,3221225481,51,8,3221225481,2147483698,2147483697,13,14,15,16,1,1,37,38,1,37,38,38,2,2,2,59,2147483697,2,2,2,2,2,2,2,2,2,2,2,1073741884,1073741887,1073741886,1073741833,3,4,5,12,2,2,2,2, 402,2,1,1,1,1,2,2,2,2,2,2,2,4,5,12,3221225481,3221225481,3221225481,51,8,3221225481,2147483698,2147483697,13,14,15,16,1,1,37,38,1,37,38,38,2,2,2,59,2147483697,2,2,2,2,2,2,2,2,2,2,2,1073741884,1073741887,1073741886,1073741833,3,4,5,12,2,2,2,2,
412,2,2,2,2,2,2,2,2,2,2,2,3221225481,3221225481,3,4,5,12,56,57,3221225481,9,3221225522,3221225521,66,67,1,37,38,1,1,67,1,66,67,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,4,5,12,2147483705,2147483704,9,9,9,2,2,2,2,2, 412,2,2,2,2,2,2,2,2,2,2,2,3221225481,3221225481,3,4,5,12,56,57,3221225481,9,3221225522,3221225521,66,67,1,37,38,1,1,67,1,66,67,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,4,5,12,2147483705,2147483704,9,9,9,2,2,2,2,2,
4272,72,72,72,2,2,2,2,32,30,31,33,1073741835,3221225483,3221225482,3221225481,3221225481,3221225481,3221225481,3221225481,3221225481,3221225481,3221225481,3221225522,3221225521,2147483715,2147483714,66,67,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,9,9,9,9,9,3,4,5,12,2,2,2,2, 4272,72,72,72,2,2,2,2,32,30,31,33,1073741835,3221225483,3221225482,3221225481,3221225481,3221225481,3221225481,3221225481,3221225481,3221225481,3221225481,3221225522,3221225521,2147483715,2147483714,66,67,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,9,9,9,9,9,3,4,5,12,2,2,2,2,
4372,72,72,72,2,7,32,30,31,33,32,30,31,33,3221225478,3221225482,3221225481,3221225481,1073741833,1073741833,1073741833,1073741833,1073741833,1073741833,3221225522,66,67,2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,14,5,12,9,9,9,9,2,2,2,2,2,2, 4372,72,72,72,2,7,32,35,31,33,32,30,31,33,3221225478,3221225482,3221225481,3221225481,1073741833,1073741833,1073741833,1073741833,1073741833,1073741833,3221225522,66,67,2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,14,5,12,9,9,9,9,2,2,2,2,2,2,
4472,72,72,72,32,30,31,33,43,44,45,7,7,7,7,3221225478,3221225482,9,1073741833,1073741833,1073741833,1073741833,1073741833,1073741833,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,5,9,9,9,3,4,5,12,2,2,2,2, 4472,72,72,72,32,30,31,465,43,44,45,7,7,7,7,3221225478,3221225482,9,1073741833,1073741833,1073741833,1073741833,1073741833,1073741833,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,5,9,9,9,3,4,5,12,2,2,2,2,
4572,72,72,72,2,7,7,46,47,7,7,7,2,2,2,2,2,3221225482,1073741833,1073741833,1073741833,1073741833,3,4,5,12,2,2,2,2,13,14,15,16,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,3,4,5,12,9,9,9,9,2,2,2,2,2,2, 4572,72,72,72,2,7,7,46,47,7,7,7,2,2,2,2,2,3221225482,1073741833,1073741833,1073741833,1073741833,3,4,5,12,2,2,2,2,13,14,15,16,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,3,4,5,12,9,9,9,9,2,2,2,2,2,2,
4672,72,72,72,2,2,2,7,7,3221225508,1073741852,1073741852,2,2,2,2,2,2,2,2147483690,2147483689,2147483657,1073741833,1073741833,1073741834,30,31,33,2,2,1,1,1,1,2,2,13,14,15,16,13,14,15,16,1,14,15,1,3,4,5,12,9,9,9,41,42,2,2,2,2,2,2,2, 4672,72,72,72,2,2,2,7,7,3221225508,1073741852,1073741852,2,2,2,2,2,2,2,2147483690,2147483689,2147483657,1073741833,1073741833,1073741834,30,31,33,2,2,1,1,1,1,2,2,13,14,15,16,13,14,15,16,1,14,15,1,3,4,5,12,9,9,9,41,42,2,2,2,2,2,2,2,
4772,72,72,72,2,2,2,1073741852,1073741852,3221225501,64,2,2,2,2,2,2,2,2,2147483701,2147483700,2147483703,1073741833,1073741834,1073741830,7,2,2,2,2,2,2,2,2,2,2,1,1,1,14,15,16,13,14,15,23,24,14,15,71,60,62,9,9,55,52,53,2,2,2,2,2,2,2, 4772,72,72,72,2,2,2,1073741852,1073741852,3221225501,64,2,2,2,2,2,2,2,2,2147483701,2147483700,2147483703,1073741833,1073741834,1073741830,7,2,2,2,2,2,2,2,2,2,2,1,1,1,14,15,16,13,14,15,23,24,14,15,71,60,62,9,9,55,52,53,2,2,2,2,2,2,2,
@@ -151,6 +151,12 @@
151 <property name="script" value="off_top"/> 151 <property name="script" value="off_top"/>
152 </properties> 152 </properties>
153 </object> 153 </object>
154 <object id="3" name="mailbox_time_passage" type="tileSprite" x="119.75" y="566.5">
155 <properties>
156 <property name="interactionScript" value="mailbox_time_passage"/>
157 </properties>
158 <point/>
159 </object>
154 </objectgroup> 160 </objectgroup>
155 <layer id="1" name="Upper" width="64" height="64"> 161 <layer id="1" name="Upper" width="64" height="64">
156 <properties> 162 <properties>
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 123f2a0..8eb491f 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -35,7 +35,8 @@ CutsceneOptions = {
35} 35}
36 36
37ChangeMapOptions = { 37ChangeMapOptions = {
38 DO_NOT_FADE = 1 -- Prevents fading to and from black 38 DO_NOT_FADE = 1, -- Prevents fading to and from black
39 DO_NOT_CHANGE_MUSIC = 2 -- Prevents stopping or starting music as part of the map change
39} 40}
40 41
41PathfindingOptions = { 42PathfindingOptions = {
@@ -289,10 +290,12 @@ function ChangeMap(map, warp, options)
289 loadMap(map) 290 loadMap(map)
290 character():transplantParty(playerId, getMap():getWarpPoint(warp), direction) 291 character():transplantParty(playerId, getMap():getWarpPoint(warp), direction)
291 292
292 if (mixer():isPlayingMusic() and not getMap():hasMusic()) then 293 if (options & ChangeMapOptions.DO_NOT_CHANGE_MUSIC == 0) then
293 mixer():fadeoutMusic(150) 294 if (mixer():isPlayingMusic() and not getMap():hasMusic()) then
294 elseif (getMap():hasMusic() and (not mixer():isPlayingMusic() or not (mixer():getPlayingTrack() == getMap():getMusic()))) then 295 mixer():fadeoutMusic(150)
295 mixer():playMusic(getMap():getMusic(), 150) 296 elseif (getMap():hasMusic() and (not mixer():isPlayingMusic() or not (mixer():getPlayingTrack() == getMap():getMusic()))) then
297 mixer():playMusic(getMap():getMusic(), 150)
298 end
296 end 299 end
297 300
298 coroutine.yield() 301 coroutine.yield()
@@ -413,3 +416,34 @@ function WaitForSpritePath(spriteName)
413 coroutine.yield() 416 coroutine.yield()
414 end 417 end
415end 418end
419
420--- Fades out the currently playing music.
421-- This does not block. If you want it to block, call Delay for the same amount
422-- of time.
423-- @param length the fadeout time in milliseconds
424function FadeoutMusic(length)
425 mixer():fadeoutMusic(length)
426end
427
428--- Plays the specified track.
429-- @param song the name of the song to play
430-- @param length the time in milliseconds to fade in. if left blank, the track starts immediately
431function PlayMusic(song, length)
432 length = length or 0
433
434 mixer():playMusic(song, length)
435end
436
437--- Makes the player sprite non-controllable.
438function DisablePlayerControl()
439 local playerId = getPlayerSprite()
440 local playerSprite = getSprite(playerId)
441 playerSprite.controllable = false
442end
443
444--- Makes the player sprite controllable again.
445function EnablePlayerControl()
446 local playerId = getPlayerSprite()
447 local playerSprite = getSprite(playerId)
448 playerSprite.controllable = true
449end
diff --git a/res/scripts/hallucination_interior.lua b/res/scripts/hallucination_interior.lua index bd075f1..4fbaa99 100644 --- a/res/scripts/hallucination_interior.lua +++ b/res/scripts/hallucination_interior.lua
@@ -187,3 +187,35 @@ function hallucination_interior.talk_to_ionia()
187 SetAnimation("ionia", "still") 187 SetAnimation("ionia", "still")
188 HideCutsceneBars() 188 HideCutsceneBars()
189end 189end
190
191function hallucination_interior.mailbox_time_passage()
192 StartCutscene()
193 DisplayMessage("* The mailbox lid is open...\n* Peek inside?", "", SpeakerType.NONE)
194 ShowChoice("Yes", "No")
195 WaitForEndOfMessage()
196
197 if GetChoiceSelection() == 1 then
198 HideCutsceneBars()
199 return
200 end
201
202 FadeoutMusic(2000)
203 Delay(4000)
204
205 DisplayMessage("* Inside the mailbox is a long hallway.", "", SpeakerType.NONE)
206 WaitForEndOfMessage()
207
208 Delay(1000)
209
210 FadeToBlack(1000)
211
212 HideCutsceneBars()
213 DisablePlayerControl()
214 ChangeMap("time_passage", "fromMailbox", ChangeMapOptions.DO_NOT_FADE | ChangeMapOptions.DO_NOT_CHANGE_MUSIC)
215 Delay(1000)
216
217 PlayMusic("time_passage", 2000)
218 RemoveFadeout(2000)
219
220 EnablePlayerControl()
221end