diff options
Diffstat (limited to 'res/scripts')
-rw-r--r-- | res/scripts/common.lua | 15 | ||||
-rw-r--r-- | res/scripts/finale.lua | 22 |
2 files changed, 37 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index dbc021c..1d4879f 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
@@ -414,6 +414,14 @@ function SetAnimationSlowdown(spriteName, amount) | |||
414 | sprite.animSlowdown = amount | 414 | sprite.animSlowdown = amount |
415 | end | 415 | end |
416 | 416 | ||
417 | --- Sets the enclosure zone for a sprite. | ||
418 | -- The sprite will be prevented from exiting the area defined by that zone. | ||
419 | function AddEnclosureZone(spriteName, zone) | ||
420 | local spriteId = getSpriteByAlias(spriteName) | ||
421 | local sprite = getSprite(spriteId) | ||
422 | sprite.enclosureZone = zone | ||
423 | end | ||
424 | |||
417 | --- Removes the enclosure zone for the specified sprite. | 425 | --- Removes the enclosure zone for the specified sprite. |
418 | -- This allows the sprite to move outside of the confines of the zone. | 426 | -- This allows the sprite to move outside of the confines of the zone. |
419 | function RemoveEnclosureZone(spriteName) | 427 | function RemoveEnclosureZone(spriteName) |
@@ -607,3 +615,10 @@ function IsSpriteInZone(spriteName, zoneName) | |||
607 | 615 | ||
608 | return (pos:x() >= zone.ul:x()) and (pos:x() <= zone.dr:x()) and (pos:y() >= zone.ul:y()) and (pos:y() <= zone.dr:y()) | 616 | return (pos:x() >= zone.ul:x()) and (pos:x() <= zone.dr:x()) and (pos:y() >= zone.ul:y()) and (pos:y() <= zone.dr:y()) |
609 | end | 617 | end |
618 | |||
619 | --- Sets the name of the script on the current map that will be executed when the player interacts with this sprite. | ||
620 | function SetInteractionScript(spriteName, scriptName) | ||
621 | local spriteId = getSpriteByAlias(spriteName) | ||
622 | local sprite = getSprite(spriteId) | ||
623 | sprite.interactionScript = scriptName | ||
624 | end | ||
diff --git a/res/scripts/finale.lua b/res/scripts/finale.lua index 2493473..7e23336 100644 --- a/res/scripts/finale.lua +++ b/res/scripts/finale.lua | |||
@@ -3,15 +3,37 @@ finale = {} | |||
3 | function finale.init() | 3 | function finale.init() |
4 | character():breakUpParty(getPlayerSprite()) | 4 | character():breakUpParty(getPlayerSprite()) |
5 | 5 | ||
6 | AddEnclosureZone("lucas", "hotspring_enclosure") | ||
7 | |||
6 | MoveSpriteToWarp("kuma", "kumatora_start") | 8 | MoveSpriteToWarp("kuma", "kumatora_start") |
7 | SetDirection("kuma", Direction.UP) | 9 | SetDirection("kuma", Direction.UP) |
8 | SetAnimation("kuma", "swim_still") | 10 | SetAnimation("kuma", "swim_still") |
11 | MakeSpriteSolid("kuma") | ||
12 | SetInteractionScript("kuma", "talk_to_kuma") | ||
9 | 13 | ||
10 | MoveSpriteToWarp("duster", "duster_start") | 14 | MoveSpriteToWarp("duster", "duster_start") |
11 | SetDirection("duster", Direction.RIGHT) | 15 | SetDirection("duster", Direction.RIGHT) |
12 | SetAnimation("duster", "swim_still") | 16 | SetAnimation("duster", "swim_still") |
17 | MakeSpriteSolid("duster") | ||
18 | SetInteractionScript("duster", "talk_to_duster") | ||
13 | 19 | ||
14 | MoveSpriteToWarp("boney", "boney_start") | 20 | MoveSpriteToWarp("boney", "boney_start") |
15 | SetDirection("boney", Direction.DOWN) | 21 | SetDirection("boney", Direction.DOWN) |
16 | SetAnimation("boney", "asleep") | 22 | SetAnimation("boney", "asleep") |
17 | end | 23 | end |
24 | |||
25 | function finale.talk_to_kuma() | ||
26 | SetDirection("kuma", Direction.UP) | ||
27 | StartCutscene() | ||
28 | DisplayMessage("* Kumatora doesn't respond.\n\f* She is grumbling to herself, and picking at the grass growing over the wall.", "", SpeakerType.NONE) | ||
29 | WaitForEndOfMessage() | ||
30 | HideCutsceneBars() | ||
31 | end | ||
32 | |||
33 | function finale.talk_to_duster() | ||
34 | SetDirection("duster", Direction.RIGHT) | ||
35 | StartCutscene() | ||
36 | DisplayMessage("* Duster doesn't respond.\n\f* He is simply staring at his own reflection in the water.", "", SpeakerType.NONE) | ||
37 | WaitForEndOfMessage() | ||
38 | HideCutsceneBars() | ||
39 | end | ||