diff options
author | Nipun Garg | 2019-07-01 09:06:02 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:06 +0200 |
commit | 50d297637f5b887a96d52543de73349bdaae3cf1 (patch) | |
tree | 6bca86312b9adc0fdf6684732349d64f369443c9 /engines | |
parent | a5ba855dd2718f971ef71402588fe11441564e44 (diff) | |
download | scummvm-rg350-50d297637f5b887a96d52543de73349bdaae3cf1.tar.gz scummvm-rg350-50d297637f5b887a96d52543de73349bdaae3cf1.tar.bz2 scummvm-rg350-50d297637f5b887a96d52543de73349bdaae3cf1.zip |
HDB: Add Lua function for animation()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/lua-script.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index ea77a04499..a9256d4c7e 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -666,7 +666,50 @@ static int message(lua_State *L) { } static int animation(lua_State *L) { - warning("STUB: ANIMATION"); + double x = lua_tonumber(L, 1); + double y = lua_tonumber(L, 2); + double which = lua_tonumber(L, 3); + double playsnd = lua_tonumber(L, 4); + + g_hdb->_lua->checkParameters("animation", 4); + + x *= kTileWidth; + y *= kTileHeight; + + switch ((int)which) { + case 0: + g_hdb->_ai->addAnimateTarget((int)x, (int)y, 0, 3, ANIM_NORMAL, false, false, GROUP_WATER_SPLASH_SIT); + if (playsnd) + warning("STUB: Play SND_SPLASH"); + break; + case 1: + g_hdb->_ai->addAnimateTarget((int)x, (int)y, 0, 3, ANIM_NORMAL, false, false, GROUP_EXPLOSION_BOOM_SIT); + if (playsnd) + warning("STUB: Play SND_BARREL_EXPLODE"); + break; + case 2: + g_hdb->_ai->addAnimateTarget((int)x, (int)y, 0, 3, ANIM_FAST, false, false, GROUP_STEAM_PUFF_SIT); + if (playsnd) + warning("STUB: Play SND_BARREL_MELTING"); + break; + case 3: + g_hdb->_ai->addAnimateTarget((int)x, (int)y, 0, 7, ANIM_NORMAL, false, false, TELEPORT_FLASH); + if (playsnd) + warning("STUB: Play SND_TELEPORT"); + break; + case 4: + g_hdb->_ai->addAnimateTarget((int)x, (int)y, 0, 3, ANIM_NORMAL, false, false, GEM_FLASH); + if (playsnd) + warning("STUB: Play SND_GET_GEM"); + break; + case 5: + g_hdb->_ai->addAnimateTarget((int)x, (int)y, 0, 2, ANIM_NORMAL, false, false, GROUP_ENT_CHICKEN_DIE); + if (playsnd) + warning("STUB: Play SND_CHICKEN_DEATH"); + break; + } + + lua_pop(L, 3); return 0; } |