diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-11 18:16:16 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-11 19:27:32 +0100 |
commit | 5ff34fd2458dff28d664c90fb93f455231f8633c (patch) | |
tree | 533151e5f3002c1e24ce4d44e5cd32c66c026b51 /example/scripts/status/jump.lua | |
parent | b822dcee52d15d41c4186a250e73b85b16c9dc39 (diff) | |
download | manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.tar.gz manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.tar.bz2 manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.tar.xz manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.zip |
Register Lua script API functions into the global namespace
Scripts mostly execute the Mana script API, and it seems like just
unnecessary verbosity to refer to the 'mana' table all the time. This table
no longer exists now.
Reviewed-by: Erik Schilling
Diffstat (limited to 'example/scripts/status/jump.lua')
-rw-r--r-- | example/scripts/status/jump.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/example/scripts/status/jump.lua b/example/scripts/status/jump.lua index 166c90d1..9dc01951 100644 --- a/example/scripts/status/jump.lua +++ b/example/scripts/status/jump.lua @@ -14,16 +14,16 @@ local function tick(target, ticknumber) if (ticknumber % 10 == 0) then - mana.being_say(target, "I have the jumping bug!") + being_say(target, "I have the jumping bug!") end - if (mana.being_get_status_time(target, 2) < 2000) then - mana.being_set_status_time(target, 2, 6000) + if (being_get_status_time(target, 2) < 2000) then + being_set_status_time(target, 2, 6000) end if (ticknumber % 50 ~= 0) then return end - local victims = mana.get_beings_in_circle(mana.posX(target), mana.posY(target), 64) + local victims = get_beings_in_circle(posX(target), posY(target), 64) local count = #victims if i == 0 then return end @@ -40,16 +40,16 @@ local function tick(target, ticknumber) victim = nil i = -1 else - i = mana.being_type(victim) + i = being_type(victim) end until (i == TYPE_MONSTER or i == TYPE_CHARACTER or remaining == 0) if (victim == nil) then return end - mana.being_remove_status(target, 2) + being_remove_status(target, 2) - mana.being_apply_status(victim, 2, 6000) - mana.being_say(victim, "Now I have the jumping bug") + being_apply_status(victim, 2, 6000) + being_say(victim, "Now I have the jumping bug") end -mana.get_status_effect("jumping status"):on_tick(tick) +get_status_effect("jumping status"):on_tick(tick) |