Add fur cloak.
This commit is contained in:
parent
7afe4f6002
commit
0f2f3983df
44
init.lua
44
init.lua
@ -3,8 +3,8 @@
|
||||
-- Distributed under the LGPLv2.1 (https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)
|
||||
|
||||
|
||||
mapgen = {}
|
||||
local mod = mapgen
|
||||
dinv = {}
|
||||
local mod = dinv
|
||||
local mod_name = 'dinv'
|
||||
|
||||
mod.version = '20190720'
|
||||
@ -95,6 +95,14 @@ minetest.register_tool(mod_name..':diamond_plate_armor', {
|
||||
_dinv_location = 'body',
|
||||
})
|
||||
|
||||
minetest.register_tool(mod_name..':fur_cloak', {
|
||||
inventory_image = 'dinv_fur_cloak.png',
|
||||
description = 'Fur Cloak',
|
||||
_dinv_armor = 0.98,
|
||||
_dinv_warmth = 2,
|
||||
_dinv_location = 'back',
|
||||
})
|
||||
|
||||
--print(dump(minetest.registered_tools[mod_name..':plate_armor']))
|
||||
|
||||
minetest.register_craft({
|
||||
@ -127,17 +135,26 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = mod_name..':leather_armor',
|
||||
recipe = {
|
||||
{'', 'mobs:leather', ''},
|
||||
{'', 'mobs:leather', 'mobs:wax'},
|
||||
{'mobs:leather', 'farming:string', 'mobs:leather'},
|
||||
{'mobs:leather', 'farming:string', 'mobs:leather'},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = mod_name..':fur_cloak',
|
||||
recipe = {
|
||||
{'', 'mobs:fur', ''},
|
||||
{'mobs:fur', 'farming:string', 'mobs:fur'},
|
||||
{'mobs:fur', '', 'mobs:fur'},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = mod_name..':leather_cap',
|
||||
recipe = {
|
||||
{'', 'mobs:leather', ''},
|
||||
{'', 'mobs:leather', ''},
|
||||
{'', 'mobs:leather', 'mobs:wax'},
|
||||
{'', 'farming:string', ''},
|
||||
},
|
||||
})
|
||||
@ -793,6 +810,25 @@ function mod.wearing_on_location(player, loc)
|
||||
end
|
||||
|
||||
|
||||
function mod.get_warmth(player)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
|
||||
local warmth = 0
|
||||
|
||||
for k, v in worn_items(player) do
|
||||
local vs = v:get_name()
|
||||
local it = minetest.registered_items[vs]
|
||||
if it._dinv_warmth then
|
||||
warmth = warmth + it._dinv_warmth
|
||||
end
|
||||
end
|
||||
|
||||
return warmth
|
||||
end
|
||||
|
||||
|
||||
function mod.set_armor(player)
|
||||
if not player then
|
||||
return
|
||||
|
BIN
textures/dinv_fur_cloak.png
Normal file
BIN
textures/dinv_fur_cloak.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 418 B |
Loading…
x
Reference in New Issue
Block a user