diff options
Diffstat (limited to 'res/scripts/common.lua')
-rw-r--r-- | res/scripts/common.lua | 15 |
1 files changed, 15 insertions, 0 deletions
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) | |||
518 | SetDirection(spriteName, dir) | 518 | SetDirection(spriteName, dir) |
519 | end | 519 | end |
520 | 520 | ||
521 | --- Makes the specified sprite's entire party face toward the †arget sprite. | ||
522 | -- This version of the function uses any of the eight directions. | ||
523 | -- @param spriteName the name of the sprite to change the direction of | ||
524 | -- @param targetName the name of the sprite to face toward | ||
525 | function FacePartyTowardSprite(spriteName, targetName) | ||
526 | FaceTowardSprite(spriteName, targetName) | ||
527 | |||
528 | local sprite = getSprite(getSpriteByAlias(spriteName)) | ||
529 | |||
530 | for i=1,#sprite.followers do | ||
531 | local follower = getSprite(sprite.followers[i]) | ||
532 | FaceTowardSprite(follower.alias, targetName) | ||
533 | end | ||
534 | end | ||
535 | |||
521 | --- Makes the specified sprite face toward the †arget sprite. | 536 | --- Makes the specified sprite face toward the †arget sprite. |
522 | -- This version of the function uses the closest cardinal direction. | 537 | -- This version of the function uses the closest cardinal direction. |
523 | -- @param spriteName the name of the sprite to change the direction of | 538 | -- @param spriteName the name of the sprite to change the direction of |