Rename elixir.
This commit is contained in:
parent
d8dbf6a4af
commit
3de24bde95
2 changed files with 1 additions and 1 deletions
54
elixir.lua
Normal file
54
elixir.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
fun_caves.armor_expire = {}
|
||||
|
||||
local function armor(user, factor)
|
||||
local player_name = user:get_player_name()
|
||||
local armor = user:get_armor_groups()
|
||||
armor.fleshy = armor.fleshy * factor
|
||||
user:set_armor_groups(armor)
|
||||
minetest.chat_send_player(player_name, 'Your skin feels harder...')
|
||||
fun_caves.armor_expire[player_name] = minetest.get_gametime() + 3600
|
||||
end
|
||||
|
||||
local descs = {
|
||||
{'wood', 0.95, 'group:wood'},
|
||||
{'stone', 0.9, 'group:stone'},
|
||||
{'steel', 0.8, 'default:steel_ingot'},
|
||||
{'copper', 0.85, 'default:copper_ingot'},
|
||||
{'bronze', 0.7, 'default:bronze_ingot'},
|
||||
{'gold', 0.6, 'default:gold_ingot'},
|
||||
{'diamond', 0.5, 'default:diamond'},
|
||||
{'silver', 0.4, 'fun_caves:silver_ingot'},
|
||||
{'mese', 0.3, 'default:mese_crystal'},
|
||||
--{'', 0.2, ''},
|
||||
--{'adamant', 0.1, 'fun_caves:adamant'},
|
||||
}
|
||||
|
||||
for _, desc in pairs(descs) do
|
||||
local name = desc[1]
|
||||
local value = desc[2]
|
||||
local cap = name:gsub('^%l', string.upper)
|
||||
minetest.register_craftitem("fun_caves:liquid_"..name, {
|
||||
description = 'Dr Robertson\'s Patented Liquid '..cap..' Elixir',
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {'fun_caves_liquid_'..name..'.png'},
|
||||
inventory_image = 'fun_caves_liquid_'..name..'.png',
|
||||
groups = {dig_immediate = 3, vessel = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
armor(user, value)
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'fun_caves:liquid_'..name,
|
||||
recipe = {
|
||||
"mobs_slimes:green_slimeball",
|
||||
desc[3],
|
||||
"vessels:glass_bottle",
|
||||
},
|
||||
})
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue