summary refs log tree commit diff stats
path: root/res/scripts
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2021-03-12 16:41:25 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2021-03-12 16:41:25 -0500
commit065d5dbac17664666d6a83583141d4cdf0bb691c (patch)
treedcca0a1495968897d1810eeb04eda968e90ad204 /res/scripts
parent680b7b1c8b0f04bcc10d80106819f73501177b48 (diff)
downloadtanetane-065d5dbac17664666d6a83583141d4cdf0bb691c.tar.gz
tanetane-065d5dbac17664666d6a83583141d4cdf0bb691c.tar.bz2
tanetane-065d5dbac17664666d6a83583141d4cdf0bb691c.zip
Interacting with Kuma and Duster in the finale
The hot spring is also a little bigger now, because I'm using an enclosure to keep Lucas in, instead of setting the tiles to being solid or not.

#20
Diffstat (limited to 'res/scripts')
-rw-r--r--res/scripts/common.lua15
-rw-r--r--res/scripts/finale.lua22
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
415end 415end
416 416
417--- Sets the enclosure zone for a sprite.
418-- The sprite will be prevented from exiting the area defined by that zone.
419function AddEnclosureZone(spriteName, zone)
420 local spriteId = getSpriteByAlias(spriteName)
421 local sprite = getSprite(spriteId)
422 sprite.enclosureZone = zone
423end
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.
419function RemoveEnclosureZone(spriteName) 427function 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())
609end 617end
618
619--- Sets the name of the script on the current map that will be executed when the player interacts with this sprite.
620function SetInteractionScript(spriteName, scriptName)
621 local spriteId = getSpriteByAlias(spriteName)
622 local sprite = getSprite(spriteId)
623 sprite.interactionScript = scriptName
624end
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 = {}
3function finale.init() 3function 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")
17end 23end
24
25function 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()
31end
32
33function 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()
39end