diff options
Diffstat (limited to 'res/scripts')
| -rw-r--r-- | res/scripts/common.lua | 9 | ||||
| -rw-r--r-- | res/scripts/underwater.lua | 1 | ||||
| -rw-r--r-- | res/scripts/underwater_start.lua | 1 |
3 files changed, 11 insertions, 0 deletions
| 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) | |||
| 344 | local sprite = getSprite(spriteId) | 344 | local sprite = getSprite(spriteId) |
| 345 | sprite.bobsWhenNormal = false | 345 | sprite.bobsWhenNormal = false |
| 346 | end | 346 | end |
| 347 | |||
| 348 | --- Sets the animation slowdown for a sprite. | ||
| 349 | -- @param spriteName the alias of the sprite to modify | ||
| 350 | -- @param amount the number of animation frames needed to advance the sprite's animation (1 means the effect is disabled) | ||
| 351 | function SetAnimationSlowdown(spriteName, amount) | ||
| 352 | local spriteId = getSpriteByAlias(spriteName) | ||
| 353 | local sprite = getSprite(spriteId) | ||
| 354 | sprite.animSlowdown = amount | ||
| 355 | end | ||
| diff --git a/res/scripts/underwater.lua b/res/scripts/underwater.lua index 3500079..8e1ae1a 100644 --- a/res/scripts/underwater.lua +++ b/res/scripts/underwater.lua | |||
| @@ -3,6 +3,7 @@ underwater = {} | |||
| 3 | function underwater.leave() | 3 | function underwater.leave() |
| 4 | AllowCrouching() | 4 | AllowCrouching() |
| 5 | StopBobbing("lucas") | 5 | StopBobbing("lucas") |
| 6 | SetAnimationSlowdown("lucas", 1) | ||
| 6 | end | 7 | end |
| 7 | 8 | ||
| 8 | function underwater.fish2() | 9 | function underwater.fish2() |
| diff --git a/res/scripts/underwater_start.lua b/res/scripts/underwater_start.lua index c14f4b8..0852885 100644 --- a/res/scripts/underwater_start.lua +++ b/res/scripts/underwater_start.lua | |||
| @@ -3,6 +3,7 @@ underwater_start = {} | |||
| 3 | function underwater_start.init() | 3 | function underwater_start.init() |
| 4 | PreventCrouching() | 4 | PreventCrouching() |
| 5 | StartBobbing("lucas") | 5 | StartBobbing("lucas") |
| 6 | SetAnimationSlowdown("lucas", 2) | ||
| 6 | end | 7 | end |
| 7 | 8 | ||
| 8 | function underwater_start.talk_to_fish1() | 9 | function underwater_start.talk_to_fish1() |
