diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-26 19:12:45 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-26 19:12:45 -0500 |
commit | e644f5c0d769989bd3b0665312c6949d76f5e388 (patch) | |
tree | 7a9c448267e80f73da7b8bf20c228081932618be /res | |
parent | c304defdd7b0c5a8bea83f2540c009ededd450cb (diff) | |
download | tanetane-e644f5c0d769989bd3b0665312c6949d76f5e388.tar.gz tanetane-e644f5c0d769989bd3b0665312c6949d76f5e388.tar.bz2 tanetane-e644f5c0d769989bd3b0665312c6949d76f5e388.zip |
Exposed loadMapScripts to scripting engine
This allows common functions to be stored in not per-map script files. Which is useful for code that we're going to want in a lot of places -- i.e. how every underwater map is going to have a copy of the same exit area function.
Diffstat (limited to 'res')
-rw-r--r-- | res/scripts/underwater.lua | 6 | ||||
-rw-r--r-- | res/scripts/underwater_start.lua | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/res/scripts/underwater.lua b/res/scripts/underwater.lua index 8e1ae1a..0b62ff5 100644 --- a/res/scripts/underwater.lua +++ b/res/scripts/underwater.lua | |||
@@ -1,5 +1,11 @@ | |||
1 | underwater = {} | 1 | underwater = {} |
2 | 2 | ||
3 | function underwater.make_lucas_underwater() | ||
4 | PreventCrouching() | ||
5 | StartBobbing("lucas") | ||
6 | SetAnimationSlowdown("lucas", 2) | ||
7 | end | ||
8 | |||
3 | function underwater.leave() | 9 | function underwater.leave() |
4 | AllowCrouching() | 10 | AllowCrouching() |
5 | StopBobbing("lucas") | 11 | StopBobbing("lucas") |
diff --git a/res/scripts/underwater_start.lua b/res/scripts/underwater_start.lua index 0852885..56b0b5e 100644 --- a/res/scripts/underwater_start.lua +++ b/res/scripts/underwater_start.lua | |||
@@ -1,9 +1,8 @@ | |||
1 | underwater_start = {} | 1 | underwater_start = {} |
2 | 2 | ||
3 | function underwater_start.init() | 3 | function underwater_start.init() |
4 | PreventCrouching() | 4 | loadMapScripts("underwater") |
5 | StartBobbing("lucas") | 5 | underwater.make_lucas_underwater() |
6 | SetAnimationSlowdown("lucas", 2) | ||
7 | end | 6 | end |
8 | 7 | ||
9 | function underwater_start.talk_to_fish1() | 8 | function underwater_start.talk_to_fish1() |