diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-06-09 21:34:30 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-06-09 22:02:48 +0200 |
commit | abd9ab4c46bab7ccd3475a31b542873130682b81 (patch) | |
tree | 50f8644cd46f8e009cedd9275fa80a15f0476221 /lib/mods/theme | |
parent | a0107d942872735f1faa0e857174a6c467180d75 (diff) |
Lua: Move "Drunk takes wine" code to C
Diffstat (limited to 'lib/mods/theme')
-rw-r--r-- | lib/mods/theme/scpt/drunk.lua | 21 | ||||
-rw-r--r-- | lib/mods/theme/scpt/init.lua | 1 | ||||
-rw-r--r-- | lib/mods/theme/scpt/misc.lua | 26 |
3 files changed, 0 insertions, 48 deletions
diff --git a/lib/mods/theme/scpt/drunk.lua b/lib/mods/theme/scpt/drunk.lua deleted file mode 100644 index 7d90af8d..00000000 --- a/lib/mods/theme/scpt/drunk.lua +++ /dev/null @@ -1,21 +0,0 @@ --- silly function that allows a drunk to take a bottle of wine/ale from the player - -function drunk_takes_wine(m_idx, item) - - m_ptr = monster(m_idx) - o_ptr = get_object(item) - - if (m_ptr.r_idx == test_monster_name("Singing, happy drunk")) - and (o_ptr.tval == TV_FOOD) and ((o_ptr.sval == 38) or (o_ptr.sval == 39)) then - - cmsg_print(TERM_YELLOW, "'Hic!'") - - inven_item_increase(item, -1) - inven_item_optimize(item) - return TRUE - else - return FALSE - end -end - -add_hook_script(HOOK_GIVE, "drunk_takes_wine", "drunk_takes_wine") diff --git a/lib/mods/theme/scpt/init.lua b/lib/mods/theme/scpt/init.lua index 0d59bfd2..8cd2094a 100644 --- a/lib/mods/theme/scpt/init.lua +++ b/lib/mods/theme/scpt/init.lua @@ -14,7 +14,6 @@ init_school_books() initialize_bookable_spells() -- Add joke stuff -tome_dofile("drunk.lua") tome_dofile("joke.lua") -- Some tests, if the file is not present, this is fine diff --git a/lib/mods/theme/scpt/misc.lua b/lib/mods/theme/scpt/misc.lua index 726574d2..21a81f83 100644 --- a/lib/mods/theme/scpt/misc.lua +++ b/lib/mods/theme/scpt/misc.lua @@ -1,29 +1,3 @@ --- silly function that allows a drunk to take a bottle of wine/ale from the player - -function drunk_takes_wine(m_idx, item) - - m_ptr = monster(m_idx) - o_ptr = get_object(item) - - if (m_ptr.r_idx == test_monster_name("Singing, happy drunk")) - and (o_ptr.tval == TV_FOOD) and ((o_ptr.sval == 38) or (o_ptr.sval == 39)) then - - cmsg_print(TERM_YELLOW, "'Hic!'") - - inven_item_increase(item, -1) - inven_item_optimize(item) - --- HackSmurf: the drunk may drop an empty bottle - bottle = create_object(TV_BOTTLE,1) - drop_near(bottle, 50, player.py, player.px) - return TRUE - else - return FALSE - end -end - -add_hook_script(HOOK_GIVE, "drunk_takes_wine", "drunk_takes_wine") - -- A not-too-scummy way of generating junk for ammo function food_vessel(object) if ((object.tval == 80) and (object.sval == 43)) or |