summary refs log tree commit diff stats
path: root/res/scripts/common.lua
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/common.lua
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/common.lua')
-rw-r--r--res/scripts/common.lua15
1 files changed, 15 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