diff options
author | root <root@linuxworks.belug.de> | 2018-04-02 10:26:01 +0200 |
---|---|---|
committer | root <root@linuxworks.belug.de> | 2018-04-02 10:26:01 +0200 |
commit | af8767dd8631a3774988305b01315a772e72fce4 (patch) | |
tree | c0dbdc47580617d25f97e9413ed9c3c542c209e9 /extranodes/aspirin.lua | |
parent | 44e544f507a8eea038cda3d64994b4aaa144f669 (diff) | |
parent | 083c0a0befee5a770d9c8724cedaa770939be040 (diff) |
Merge https://github.com/h-v-smacker/technic
Diffstat (limited to 'extranodes/aspirin.lua')
-rw-r--r-- | extranodes/aspirin.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/extranodes/aspirin.lua b/extranodes/aspirin.lua new file mode 100644 index 0000000..a9ddad8 --- /dev/null +++ b/extranodes/aspirin.lua @@ -0,0 +1,41 @@ +-- aspirin + +-- makes any sence only when there is hunger as a separate status of the player +-- also it uses willow twigs - ethereal dependency +-- A bottle of aspirin pills heals the player immediately. + +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + +if minetest.get_modpath("hunger") and minetest.get_modpath("ethereal") then + + minetest.register_craftitem(":technic:aspirin_pill", { + description = S("Aspirin pill"), + inventory_image = "technic_aspirin_pill.png", + on_use = function(itemstack, user, pointed_thing) + user:set_hp(user:get_hp() + 2) + itemstack:take_item() + return itemstack + end + }) + + minetest.register_craftitem(":technic:aspirin_bottle", { + description = S("Aspirin pills"), + inventory_image = "technic_aspirin_bottle.png", + on_use = function(itemstack, user, pointed_thing) + user:set_hp(20) + itemstack:take_item() + return itemstack + end + }) + + minetest.register_craft({ + type = "shapeless", + output = "technic:aspirin_bottle", + recipe = {"technic:aspirin_pill", "technic:aspirin_pill", + "technic:aspirin_pill", "technic:aspirin_pill", + "technic:aspirin_pill", "technic:aspirin_pill", + "technic:aspirin_pill", "vessels:glass_bottle"} + }) + +end + |