diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-21 18:31:43 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-21 18:31:43 -0500 |
commit | f1118738d56d70989a9a131d6b370b73e8e3bc25 (patch) | |
tree | c6fcca0be1f2bb7db35d16f4b1cb38a7de3f632a | |
parent | 5df0d0616ee3996add0b14e0fb0becd6257d04a2 (diff) | |
download | tanetane-f1118738d56d70989a9a131d6b370b73e8e3bc25.tar.gz tanetane-f1118738d56d70989a9a131d6b370b73e8e3bc25.tar.bz2 tanetane-f1118738d56d70989a9a131d6b370b73e8e3bc25.zip |
Added frozen animation for cutscenes
The player's party will be set to "frozen" at the start of a cutscene and "still" at the end. "frozen" doesn't include idle animations, which are weird to show up during tense exchanges. A CutsceneOptions enum was introduced to be able to modify the growing number of things that StartCutscene() and HideCutsceneBars() do. Currently the lightning mailbox event uses it so that Lucas's animation is not reset to still (instead of the collapsed animation) after he's electrocuted.
-rw-r--r-- | res/scripts/common.lua | 35 | ||||
-rw-r--r-- | res/scripts/map2.lua | 4 | ||||
-rw-r--r-- | res/sprites/boney_anim.txt | 8 | ||||
-rw-r--r-- | res/sprites/claus_anim.txt | 8 | ||||
-rw-r--r-- | res/sprites/duster_anim.txt | 8 | ||||
-rw-r--r-- | res/sprites/kuma_anim.txt | 8 | ||||
-rw-r--r-- | res/sprites/lucas_anim.txt | 8 |
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 | ||
33 | CutsceneOptions = { | ||
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 | |||
33 | gamestate = {} | 37 | gamestate = {} |
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. |
46 | function StartCutscene() | 50 | function 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() | |||
91 | end | 102 | end |
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. |
95 | function HideCutsceneBars() | 106 | function 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 |
213 | end | 230 | end |
214 | 231 | ||
232 | function 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 | ||
240 | end | ||
241 | |||
215 | function ChangeMap(map, warp) | 242 | function 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) |
93 | end | 93 | end |
94 | 94 | ||
95 | function map2.approach_doria() | 95 | function 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 | |||
8 | still[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 | 8 | still[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 |
9 | still[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 | 9 | still[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 |
10 | still[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 | 10 | still[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 |
11 | frozen[down]: 0 | ||
12 | frozen[down_left]: 1 | ||
13 | frozen[left]: 2 | ||
14 | frozen[up_left]: 3 | ||
15 | frozen[up]: 4 | ||
16 | frozen[up_right]: 5 | ||
17 | frozen[right]: 6 | ||
18 | frozen[down_right]: 7 | ||
11 | walk[down]: 8,16,24 | 19 | walk[down]: 8,16,24 |
12 | walk[down_left]: 9,17,25 | 20 | walk[down_left]: 9,17,25 |
13 | walk[left]: 10,18,26 | 21 | walk[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 | |||
8 | still[up_right]: 5 | 8 | still[up_right]: 5 |
9 | still[right]: 6 | 9 | still[right]: 6 |
10 | still[down_right]: 7 | 10 | still[down_right]: 7 |
11 | frozen[down]: 0 | ||
12 | frozen[down_left]: 1 | ||
13 | frozen[left]: 2 | ||
14 | frozen[up_left]: 3 | ||
15 | frozen[up]: 4 | ||
16 | frozen[up_right]: 5 | ||
17 | frozen[right]: 6 | ||
18 | frozen[down_right]: 7 | ||
11 | walk[down]: 8,0,16,0 | 19 | walk[down]: 8,0,16,0 |
12 | walk[down_left]: 9,1,17,1 | 20 | walk[down_left]: 9,1,17,1 |
13 | walk[left]: 10,2,18,2 | 21 | walk[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 | |||
8 | still[up_right]: 5 | 8 | still[up_right]: 5 |
9 | still[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 | 9 | still[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 |
10 | still[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 | 10 | still[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 |
11 | frozen[down]: 0 | ||
12 | frozen[down_left]: 1 | ||
13 | frozen[left]: 2 | ||
14 | frozen[up_left]: 3 | ||
15 | frozen[up]: 4 | ||
16 | frozen[up_right]: 5 | ||
17 | frozen[right]: 6 | ||
18 | frozen[down_right]: 7 | ||
11 | walk[down]: 8,16,24,32,40 | 19 | walk[down]: 8,16,24,32,40 |
12 | walk[down_left]: 9,17,25,33,41 | 20 | walk[down_left]: 9,17,25,33,41 |
13 | walk[left]: 10,18,26,34,42 | 21 | walk[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 | |||
8 | still[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 | 8 | still[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 |
9 | still[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 | 9 | still[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 |
10 | still[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 | 10 | still[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 |
11 | frozen[down]: 0 | ||
12 | frozen[down_left]: 1 | ||
13 | frozen[left]: 2 | ||
14 | frozen[up_left]: 3 | ||
15 | frozen[up]: 4 | ||
16 | frozen[up_right]: 5 | ||
17 | frozen[right]: 6 | ||
18 | frozen[down_right]: 7 | ||
11 | walk[down]: 16,0,24,0 | 19 | walk[down]: 16,0,24,0 |
12 | walk[down_left]: 17,1,25,1 | 20 | walk[down_left]: 17,1,25,1 |
13 | walk[left]: 18,2,26,2 | 21 | walk[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 | |||
8 | still[up_right]: 5 | 8 | still[up_right]: 5 |
9 | still[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 | 9 | still[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 |
10 | still[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 | 10 | still[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 |
11 | frozen[down]: 0 | ||
12 | frozen[down_left]: 1 | ||
13 | frozen[left]: 2 | ||
14 | frozen[up_left]: 3 | ||
15 | frozen[up]: 4 | ||
16 | frozen[up_right]: 5 | ||
17 | frozen[right]: 6 | ||
18 | frozen[down_right]: 7 | ||
11 | walk[down]: 40,0,48,0 | 19 | walk[down]: 40,0,48,0 |
12 | walk[down_left]: 41,1,49,1 | 20 | walk[down_left]: 41,1,49,1 |
13 | walk[left]: 42,2,50,2 | 21 | walk[left]: 42,2,50,2 |