From c304defdd7b0c5a8bea83f2540c009ededd450cb Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 26 Feb 2021 19:08:49 -0500 Subject: Added animation slowdown effect (for Lucas underwater) --- res/scripts/common.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'res/scripts/common.lua') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 825d2e5..2a51419 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -344,3 +344,12 @@ function StopBobbing(spriteName) local sprite = getSprite(spriteId) sprite.bobsWhenNormal = false end + +--- Sets the animation slowdown for a sprite. +-- @param spriteName the alias of the sprite to modify +-- @param amount the number of animation frames needed to advance the sprite's animation (1 means the effect is disabled) +function SetAnimationSlowdown(spriteName, amount) + local spriteId = getSpriteByAlias(spriteName) + local sprite = getSprite(spriteId) + sprite.animSlowdown = amount +end -- cgit 1.4.1