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/monster/testmonster.lua | |
parent | b822dcee52d15d41c4186a250e73b85b16c9dc39 (diff) | |
download | manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.tar.gz 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/monster/testmonster.lua')
-rw-r--r-- | example/scripts/monster/testmonster.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/example/scripts/monster/testmonster.lua b/example/scripts/monster/testmonster.lua index 63b2917..6ef11fa 100644 --- a/example/scripts/monster/testmonster.lua +++ b/example/scripts/monster/testmonster.lua @@ -10,20 +10,20 @@ local function update(mob) local r = math.random(0, 200); if r == 0 then - mana.being_say(mob, "Roar! I am a boss") + being_say(mob, "Roar! I am a boss") end end local function strike(mob, victim, hit) if hit > 0 then - mana.being_say(mob, "Take this! "..hit.." damage!") - mana.being_say(victim, "Oh Noez!") + being_say(mob, "Take this! "..hit.." damage!") + being_say(victim, "Oh Noez!") else - mana.being_say(mob, "Oh no, my attack missed!") - mana.being_say(victim, "Whew...") + being_say(mob, "Oh no, my attack missed!") + being_say(victim, "Whew...") end end -local maggot = mana.get_monster_class("maggot") +local maggot = get_monster_class("maggot") maggot:on_update(update) maggot:on("strike", strike) |