From 032f60bc2686364f4df5bfb6c9faf86b84de31a6 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 9 Mar 2021 13:31:26 -0500 Subject: Added text for "yes" path of "let's switch places" #10 --- res/scripts/common.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'res/scripts/common.lua') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index f984667..dbc021c 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -518,6 +518,21 @@ function FaceTowardSprite(spriteName, targetName) SetDirection(spriteName, dir) end +--- Makes the specified sprite's entire party face toward the †arget sprite. +-- This version of the function uses any of the eight directions. +-- @param spriteName the name of the sprite to change the direction of +-- @param targetName the name of the sprite to face toward +function FacePartyTowardSprite(spriteName, targetName) + FaceTowardSprite(spriteName, targetName) + + local sprite = getSprite(getSpriteByAlias(spriteName)) + + for i=1,#sprite.followers do + local follower = getSprite(sprite.followers[i]) + FaceTowardSprite(follower.alias, targetName) + end +end + --- Makes the specified sprite face toward the †arget sprite. -- This version of the function uses the closest cardinal direction. -- @param spriteName the name of the sprite to change the direction of -- cgit 1.4.1