minetest-mod-nssm/nssm_armor.lua

228 lines
5.6 KiB
Lua
Raw Permalink Normal View History

2022-09-28 11:01:53 -07:00
-- Armors
2018-08-09 03:36:34 -07:00
local stats = {
2022-09-27 11:26:58 -07:00
wolf = {name = "Werewolf", armor = 2.8, heal = 0, use = 800},
whitewolf = {name = "White Werewolf", armor = 2.8, heal = 0, use = 800},
bloco = {name = "Bloco", armor = 3.2, heal = 0, use = 500},
croco = {name = "Crocodile", armor = 3, heal = 0, use = 450},
ant = {name = "Ant", armor = 3, heal = 0, use = 400},
ice = {name = "Ice Teeth", armor = 3.2, heal = 0, use = 410},
felucco = {name = "Felucco", armor = 2.8, heal = 0, use = 800},
manticore = {name = "Manticore", armor = 3.4, heal = 0, use = 440},
duck = {name = "Duck", armor = 1.5, heal = 0, use = 1000},
black_duck = {name = "Black Duck", armor = 1.5, heal = 0, use = 900},
mor = {name = "Morlu", armor = 5.3, heal = 0, use = 30},
sky = {name = "Sky", armor = 4.2, heal = 0, use = 100},
sandworm = {name = "Sandworm", armor = 3.4, heal = 0, use = 400},
sandbloco = {name = "Sand Bloco", armor = 3.2, heal = 0, use = 500},
web = {name = "Cobweb String", armor = 2.4, heal = 0, use = 900},
denseweb = {name = "Dense Cobweb String", armor = 3.5, heal = 0, use = 400}
2018-08-09 03:36:34 -07:00
}
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
local materials = {
2022-09-27 11:26:58 -07:00
wolf = "nssm:wolf_fur",
whitewolf = "nssm:white_wolf_fur",
bloco = "nssm:bloco_skin",
croco = "nssm:crocodile_skin",
ant = "nssm:ant_hard_skin",
ice = "nssm:little_ice_tooth",
felucco = "nssm:felucco_fur",
manticore = "nssm:manticore_fur",
duck = "nssm:duck_feather",
black_duck = "nssm:black_duck_feather",
mor = "nssm:lustful_moranga",
sandbloco = "nssm:sand_bloco_skin",
sandworm = "nssm:sandworm_skin",
sky = "nssm:sky_iron",
web = "nssm:web_string",
denseweb = "nssm:dense_web_string"
2018-08-09 03:36:34 -07:00
}
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
for k, v in pairs(stats) do
2022-09-27 11:26:58 -07:00
minetest.register_tool("nssm:helmet_" .. k, {
description = v.name .. " Helmet",
inventory_image = "inv_helmet_" .. k .. ".png",
groups = {
armor_head = math.floor(4 * v.armor),
armor_heal = v.heal,
armor_use = v.use
},
wear = 0
2018-08-09 03:36:34 -07:00
})
2022-09-27 11:26:58 -07:00
minetest.register_tool("nssm:chestplate_" .. k, {
description = v.name .. " Chestplate",
inventory_image = "inv_chestplate_" .. k .. ".png",
groups = {
armor_torso = math.floor(6 * v.armor),
armor_heal = v.heal,
armor_use = v.use
},
wear = 0
2018-08-09 03:36:34 -07:00
})
2022-09-27 11:26:58 -07:00
minetest.register_tool("nssm:leggings_" .. k, {
description = v.name .. " Leggings",
inventory_image = "inv_leggings_" .. k .. ".png",
groups = {
armor_legs = math.floor(5 * v.armor),
armor_heal = v.heal,
armor_use = v.use
},
wear = 0
2018-08-09 03:36:34 -07:00
})
2022-09-27 11:26:58 -07:00
minetest.register_tool("nssm:boots_" .. k, {
description = v.name .. " Boots",
inventory_image = "inv_boots_" .. k .. ".png",
groups = {
armor_feet = math.floor(3 * v.armor),
armor_heal = v.heal,
armor_use = v.use
},
wear = 0
2018-08-09 03:36:34 -07:00
})
end
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
for k, v in pairs(materials) do
2018-08-09 03:36:34 -07:00
minetest.register_craft({
2022-09-27 11:26:58 -07:00
output = "nssm:helmet_" .. k,
2018-08-09 03:36:34 -07:00
recipe = {
{v, v, v},
{v, "", v},
2022-09-27 11:26:58 -07:00
{"", "", ""}
}
2018-08-09 03:36:34 -07:00
})
2018-08-09 03:36:34 -07:00
minetest.register_craft({
2022-09-27 11:26:58 -07:00
output = "nssm:chestplate_" .. k,
2018-08-09 03:36:34 -07:00
recipe = {
{v, "", v},
{v, v, v},
2022-09-27 11:26:58 -07:00
{v, v, v}
}
2018-08-09 03:36:34 -07:00
})
2018-08-09 03:36:34 -07:00
minetest.register_craft({
2022-09-27 11:26:58 -07:00
output = "nssm:leggings_" .. k,
2018-08-09 03:36:34 -07:00
recipe = {
{v, v, v},
{v, "", v},
2022-09-27 11:26:58 -07:00
{v, "", v}
}
2018-08-09 03:36:34 -07:00
})
2018-08-09 03:36:34 -07:00
minetest.register_craft({
2022-09-27 11:26:58 -07:00
output = "nssm:boots_" .. k,
2018-08-09 03:36:34 -07:00
recipe = {
{v, "", v},
2022-09-27 11:26:58 -07:00
{v, "", v}
}
2018-08-09 03:36:34 -07:00
})
2018-08-08 02:56:14 -07:00
end
2018-08-09 03:36:34 -07:00
--shields
if minetest.get_modpath("shields") then
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
local stats = {
2022-09-27 11:26:58 -07:00
crab = {name = "Crab", armor = 4, heal = 0, use = 500},
ice = {name = "Ice Teeth", armor = 3.5, heal = 0, use = 600},
mor = {name = "Morlu", armor = 5, use = 100},
masticone = {name = "Masticone", armor = 4.5, use = 300},
mantis = {name = "Mantis", armor = 3, use = 500}
2018-08-09 03:36:34 -07:00
}
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
local materials = {
2022-09-27 11:26:58 -07:00
crab = "nssm:crab_carapace_fragment",
ice = "nssm:little_ice_tooth",
mor = "nssm:lustful_moranga",
masticone = "nssm:masticone_skull_fragments",
mantis = "nssm:mantis_skin"
2018-08-09 03:36:34 -07:00
}
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
for k, v in pairs(stats) do
2022-09-27 11:26:58 -07:00
minetest.register_tool("nssm:shield_" .. k, {
description = v.name .. " Shield",
inventory_image = "inv_shield_" .. k .. ".png",
groups = {
armor_shield = math.floor(5 * v.armor),
2022-09-27 11:26:58 -07:00
armor_heal = v.heal,
armor_use = v.use
},
wear = 0
2018-08-09 03:36:34 -07:00
})
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
local m = materials[k]
2018-08-09 03:36:34 -07:00
minetest.register_craft({
2022-09-27 11:26:58 -07:00
output = "nssm:shield_" .. k,
2018-08-09 03:36:34 -07:00
recipe = {
{m, m, m},
{m, m, m},
2022-09-27 11:26:58 -07:00
{"", m, ""}
}
2018-08-09 03:36:34 -07:00
})
end
end
2018-08-08 02:56:14 -07:00
2022-09-27 11:26:58 -07:00
2022-09-28 11:01:53 -07:00
--Special objects (pumpking helmet, masticone helmet, crowned masticone helmet, crown)
2018-08-09 03:36:34 -07:00
local stats = {
2022-09-27 11:26:58 -07:00
pumpking = {name = "Pumpking Head", armor = 4, heal = 0, use = 100},
masticone = {name = "Masticone Head", armor = 4, heal = 0, use = 100},
crown = {name = "Dukking Crown", armor = 2, heal = 0, use = 50},
2022-09-28 11:01:53 -07:00
masticone_crowned = {name = "Masticone Crowned Head", armor = 6, heal = 0, use = 20}
2018-08-09 03:36:34 -07:00
}
2018-08-08 02:56:14 -07:00
2018-08-09 03:36:34 -07:00
for k, v in pairs(stats) do
2022-09-27 11:26:58 -07:00
minetest.register_tool("nssm:helmet_" .. k, {
description = v.name .. " ",
inventory_image ="inv_helmet_" .. k .. ".png",
groups = {
armor_head = math.floor(5 * v.armor),
2022-09-27 11:26:58 -07:00
armor_heal = v.heal,
armor_use = v.use
},
wear = 0
2018-08-09 03:36:34 -07:00
})
2022-09-27 11:26:58 -07:00
end
2018-08-08 02:56:14 -07:00
2022-09-27 11:26:58 -07:00
minetest.register_tool("nssm:chestplate_snake", {
2018-08-09 03:36:34 -07:00
description = "Snake Scute Chestplate",
inventory_image ="inv_chestplate_snake.png",
2022-09-27 11:26:58 -07:00
groups = {armor_torso = 40, armor_heal = 0, armor_use = 100},
wear = 0
})
2018-08-09 03:36:34 -07:00
minetest.register_craft({
output = "nssm:chestplate_snake",
recipe = {
{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", "nssm:snake_scute", "default:steel_ingot"},
2022-09-27 11:26:58 -07:00
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
}
2018-08-09 03:36:34 -07:00
})
2022-09-28 11:01:53 -07:00
local tmp = "nssm:masticone_skull_fragments"
2018-08-09 03:36:34 -07:00
minetest.register_craft({
output = "nssm:helmet_masticone",
recipe = {
2022-09-28 11:01:53 -07:00
{tmp, tmp, tmp},
{tmp, tmp, tmp},
{tmp, tmp, tmp}
2022-09-27 11:26:58 -07:00
}
2018-08-09 03:36:34 -07:00
})
2018-08-09 03:36:34 -07:00
minetest.register_craft({
output = "nssm:helmet_masticone_crowned",
recipe = {
{"", "nssm:helmet_crown", ""},
{"", "nssm:helmet_masticone", ""},
2022-09-27 11:26:58 -07:00
{"", "", ""}
}
2018-08-09 03:36:34 -07:00
})