summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--res/scripts/common.lua35
-rw-r--r--res/scripts/map2.lua4
-rw-r--r--res/sprites/boney_anim.txt8
-rw-r--r--res/sprites/claus_anim.txt8
-rw-r--r--res/sprites/duster_anim.txt8
-rw-r--r--res/sprites/kuma_anim.txt8
-rw-r--r--res/sprites/lucas_anim.txt8
7 files changed, 73 insertions, 6 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 494ace9..45b596d 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -30,6 +30,10 @@ SpriteLayer = {
30 ABOVE = 1 30 ABOVE = 1
31} 31}
32 32
33CutsceneOptions = {
34 DO_NOT_CHANGE_ANIMATION = 1 -- Prevents player party animation being set to "frozen" at the start of a cutscene or "still" at the end
35}
36
33gamestate = {} 37gamestate = {}
34 38
35--- Yields until the specified amount of time has passed. 39--- Yields until the specified amount of time has passed.
@@ -42,12 +46,19 @@ end
42 46
43--- Starts a cutscene. 47--- Starts a cutscene.
44-- This takes care of showing the cutscene bars, as well as halting character 48-- This takes care of showing the cutscene bars, as well as halting character
45-- movement. It does not block. 49-- movement. It does not block. See CutsceneOptions for modifiers.
46function StartCutscene() 50function StartCutscene(options)
51 options = options or 0
52
47 local playerId = getPlayerSprite() 53 local playerId = getPlayerSprite()
48 local playerSprite = getSprite(playerId) 54 local playerSprite = getSprite(playerId)
49 playerSprite.controllable = false 55 playerSprite.controllable = false
50 character():halt(playerId) 56 character():halt(playerId)
57
58 if (options & CutsceneOptions.DO_NOT_CHANGE_ANIMATION == 0) then
59 SetPartyAnimation(playerId, "frozen")
60 end
61
51 message():displayCutsceneBars() 62 message():displayCutsceneBars()
52 63
53 local allSprites = getAllSprites() 64 local allSprites = getAllSprites()
@@ -91,8 +102,10 @@ function WaitForEndOfMessage()
91end 102end
92 103
93--- Hides the cutscene bars. 104--- Hides the cutscene bars.
94-- This also re-enables player movement. 105-- This also re-enables player movement. See CutsceneOptions for modifiers.
95function HideCutsceneBars() 106function HideCutsceneBars(options)
107 options = options or 0
108
96 WaitForEndOfMessage() 109 WaitForEndOfMessage()
97 message():hideCutsceneBars() 110 message():hideCutsceneBars()
98 111
@@ -100,6 +113,10 @@ function HideCutsceneBars()
100 local playerSprite = getSprite(playerId) 113 local playerSprite = getSprite(playerId)
101 playerSprite.controllable = true 114 playerSprite.controllable = true
102 115
116 if (options & CutsceneOptions.DO_NOT_CHANGE_ANIMATION == 0) then
117 SetPartyAnimation(playerId, "still")
118 end
119
103 local allSprites = getAllSprites() 120 local allSprites = getAllSprites()
104 for k,v in pairs(allSprites) do 121 for k,v in pairs(allSprites) do
105 getSprite(v).paused = false 122 getSprite(v).paused = false
@@ -212,6 +229,16 @@ function SetPartyDirection(spriteId, direction)
212 end 229 end
213end 230end
214 231
232function SetPartyAnimation(spriteId, animName)
233 animation():setSpriteAnimation(spriteId, animName)
234
235 local sprite = getSprite(spriteId)
236
237 for i=1,#sprite.followers do
238 animation():setSpriteAnimation(sprite.followers[i], animName)
239 end
240end
241
215function ChangeMap(map, warp) 242function ChangeMap(map, warp)
216 local playerId = getPlayerSprite() 243 local playerId = getPlayerSprite()
217 local playerSprite = getSprite(playerId) 244 local playerSprite = getSprite(playerId)
diff --git a/res/scripts/map2.lua b/res/scripts/map2.lua index cb373b4..31b9e00 100644 --- a/res/scripts/map2.lua +++ b/res/scripts/map2.lua
@@ -89,7 +89,7 @@ function map2.mailbox_lightning()
89 89
90 DisplayMessage("* It was lightning.\n\fAh.", "", SpeakerType.NONE) 90 DisplayMessage("* It was lightning.\n\fAh.", "", SpeakerType.NONE)
91 WaitForEndOfMessage() 91 WaitForEndOfMessage()
92 HideCutsceneBars() 92 HideCutsceneBars(CutsceneOptions.DO_NOT_CHANGE_ANIMATION)
93end 93end
94 94
95function map2.approach_doria() 95function map2.approach_doria()
@@ -142,7 +142,7 @@ function map2.approach_doria()
142 SetAnimation("boney", "crouch") 142 SetAnimation("boney", "crouch")
143 StopSound(barkingNoise) 143 StopSound(barkingNoise)
144 PlaySound("boney_growl.wav") 144 PlaySound("boney_growl.wav")
145 SetAnimation("kuma", "still") 145 SetAnimation("kuma", "frozen")
146 Delay(1000) 146 Delay(1000)
147 147
148 SetAnimation("doria", "talk") 148 SetAnimation("doria", "talk")
diff --git a/res/sprites/boney_anim.txt b/res/sprites/boney_anim.txt index ffbb4fa..a8b036c 100644 --- a/res/sprites/boney_anim.txt +++ b/res/sprites/boney_anim.txt
@@ -8,6 +8,14 @@ still[up]: 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
8still[up_right]: 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,101,109,101,109 8still[up_right]: 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,101,109,101,109
9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,102,110,102,110 9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,102,110,102,110
10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,103,111,103,111 10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,103,111,103,111
11frozen[down]: 0
12frozen[down_left]: 1
13frozen[left]: 2
14frozen[up_left]: 3
15frozen[up]: 4
16frozen[up_right]: 5
17frozen[right]: 6
18frozen[down_right]: 7
11walk[down]: 8,16,24 19walk[down]: 8,16,24
12walk[down_left]: 9,17,25 20walk[down_left]: 9,17,25
13walk[left]: 10,18,26 21walk[left]: 10,18,26
diff --git a/res/sprites/claus_anim.txt b/res/sprites/claus_anim.txt index 79cb64b..14154e6 100644 --- a/res/sprites/claus_anim.txt +++ b/res/sprites/claus_anim.txt
@@ -8,6 +8,14 @@ still[up]: 4
8still[up_right]: 5 8still[up_right]: 5
9still[right]: 6 9still[right]: 6
10still[down_right]: 7 10still[down_right]: 7
11frozen[down]: 0
12frozen[down_left]: 1
13frozen[left]: 2
14frozen[up_left]: 3
15frozen[up]: 4
16frozen[up_right]: 5
17frozen[right]: 6
18frozen[down_right]: 7
11walk[down]: 8,0,16,0 19walk[down]: 8,0,16,0
12walk[down_left]: 9,1,17,1 20walk[down_left]: 9,1,17,1
13walk[left]: 10,2,18,2 21walk[left]: 10,2,18,2
diff --git a/res/sprites/duster_anim.txt b/res/sprites/duster_anim.txt index 06e70d0..57c470c 100644 --- a/res/sprites/duster_anim.txt +++ b/res/sprites/duster_anim.txt
@@ -8,6 +8,14 @@ still[up]: 4
8still[up_right]: 5 8still[up_right]: 5
9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,215,6,215 9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,215,6,215
10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,216,7,216 10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,216,7,216
11frozen[down]: 0
12frozen[down_left]: 1
13frozen[left]: 2
14frozen[up_left]: 3
15frozen[up]: 4
16frozen[up_right]: 5
17frozen[right]: 6
18frozen[down_right]: 7
11walk[down]: 8,16,24,32,40 19walk[down]: 8,16,24,32,40
12walk[down_left]: 9,17,25,33,41 20walk[down_left]: 9,17,25,33,41
13walk[left]: 10,18,26,34,42 21walk[left]: 10,18,26,34,42
diff --git a/res/sprites/kuma_anim.txt b/res/sprites/kuma_anim.txt index a6a5b72..01ca970 100644 --- a/res/sprites/kuma_anim.txt +++ b/res/sprites/kuma_anim.txt
@@ -8,6 +8,14 @@ still[up]: 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
8still[up_right]: 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,133,141,149,157,149,157,149,157,149,141 8still[up_right]: 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,133,141,149,157,149,157,149,157,149,141
9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,134,142,150,158,150,158,150,158,150,142 9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,134,142,150,158,150,158,150,158,150,142
10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,135,143,151,159,151,159,151,159,151,143 10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,135,143,151,159,151,159,151,159,151,143
11frozen[down]: 0
12frozen[down_left]: 1
13frozen[left]: 2
14frozen[up_left]: 3
15frozen[up]: 4
16frozen[up_right]: 5
17frozen[right]: 6
18frozen[down_right]: 7
11walk[down]: 16,0,24,0 19walk[down]: 16,0,24,0
12walk[down_left]: 17,1,25,1 20walk[down_left]: 17,1,25,1
13walk[left]: 18,2,26,2 21walk[left]: 18,2,26,2
diff --git a/res/sprites/lucas_anim.txt b/res/sprites/lucas_anim.txt index 98a9f5b..1a8b62b 100644 --- a/res/sprites/lucas_anim.txt +++ b/res/sprites/lucas_anim.txt
@@ -8,6 +8,14 @@ still[up]: 4
8still[up_right]: 5 8still[up_right]: 5
9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,193,6,193 9still[right]: 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,193,6,193
10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,192,7,192 10still[down_right]: 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,192,7,192
11frozen[down]: 0
12frozen[down_left]: 1
13frozen[left]: 2
14frozen[up_left]: 3
15frozen[up]: 4
16frozen[up_right]: 5
17frozen[right]: 6
18frozen[down_right]: 7
11walk[down]: 40,0,48,0 19walk[down]: 40,0,48,0
12walk[down_left]: 41,1,49,1 20walk[down_left]: 41,1,49,1
13walk[left]: 42,2,50,2 21walk[left]: 42,2,50,2