2021-07-30 16:12:29 +02:00
|
|
|
|
2021-07-31 14:03:20 +02:00
|
|
|
--- 3D Armor Shields
|
2021-07-30 16:12:29 +02:00
|
|
|
--
|
|
|
|
-- @topic shields
|
|
|
|
|
|
|
|
|
2017-08-06 18:43:41 +02:00
|
|
|
-- support for i18n
|
2020-08-31 05:47:57 +02:00
|
|
|
local S = minetest.get_translator(minetest.get_current_modname())
|
2017-08-06 18:43:41 +02:00
|
|
|
|
2018-02-18 21:35:49 +01:00
|
|
|
local disable_sounds = minetest.settings:get_bool("shields_disable_sounds")
|
2017-04-05 18:46:09 +02:00
|
|
|
local function play_sound_effect(player, name)
|
2018-02-18 21:35:49 +01:00
|
|
|
if not disable_sounds and player then
|
2019-03-05 20:40:54 +01:00
|
|
|
local pos = player:get_pos()
|
2017-04-05 18:46:09 +02:00
|
|
|
if pos then
|
2018-05-13 17:31:51 +02:00
|
|
|
minetest.sound_play(name, {
|
2017-04-05 18:46:09 +02:00
|
|
|
pos = pos,
|
|
|
|
max_hear_distance = 10,
|
|
|
|
gain = 0.5,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2013-11-12 22:22:52 +01:00
|
|
|
|
2017-03-10 19:05:16 +01:00
|
|
|
if minetest.global_exists("armor") and armor.elements then
|
|
|
|
table.insert(armor.elements, "shield")
|
|
|
|
end
|
|
|
|
|
2013-06-24 20:06:19 +02:00
|
|
|
-- Regisiter Shields
|
|
|
|
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Admin Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_admin
|
|
|
|
-- @img shields_inv_shield_admin.png
|
|
|
|
-- @grp armor_shield 1000
|
|
|
|
-- @grp armor_heal 100
|
|
|
|
-- @grp armor_use 0
|
|
|
|
-- @grp not_int_creative_inventory 1
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_admin", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Admin Shield"),
|
2014-11-10 01:53:54 +01:00
|
|
|
inventory_image = "shields_inv_shield_admin.png",
|
2016-05-27 20:51:04 +02:00
|
|
|
groups = {armor_shield=1000, armor_heal=100, armor_use=0, not_in_creative_inventory=1},
|
2014-11-10 01:53:54 +01:00
|
|
|
})
|
|
|
|
|
2017-04-14 21:18:08 +02:00
|
|
|
minetest.register_alias("adminshield", "shields:shield_admin")
|
|
|
|
|
2021-07-30 16:12:29 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.wood then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Wood Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_wood
|
|
|
|
-- @img shields_inv_shield_wood.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 0
|
|
|
|
-- @grp armor_use 2000
|
|
|
|
-- @grp flammable 1
|
|
|
|
-- @armorgrp fleshy 5
|
|
|
|
-- @damagegrp cracky 3
|
|
|
|
-- @damagegrp snappy 2
|
|
|
|
-- @damagegrp choppy 3
|
|
|
|
-- @damagegrp crumbly 2
|
|
|
|
-- @damagegrp level 1
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_wood", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Wooden Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_wood.png",
|
2017-04-09 18:34:22 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=0, armor_use=2000, flammable=1},
|
2017-04-05 18:46:09 +02:00
|
|
|
armor_groups = {fleshy=5},
|
|
|
|
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_wood_footstep")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_wood_footstep")
|
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Enhanced Wood Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_enhanced_wood
|
|
|
|
-- @img shields_inv_shield_enhanced_wood.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 0
|
|
|
|
-- @grp armor_use 2000
|
|
|
|
-- @armorgrp fleshy 8
|
|
|
|
-- @damagegrp cracky 3
|
|
|
|
-- @damagegrp snappy 2
|
|
|
|
-- @damagegrp choppy 3
|
|
|
|
-- @damagegrp crumbly 2
|
|
|
|
-- @damagegrp level 2
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_enhanced_wood", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Enhanced Wood Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_enhanced_wood.png",
|
2017-04-05 18:46:09 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=0, armor_use=2000},
|
|
|
|
armor_groups = {fleshy=8},
|
|
|
|
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=2},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-09 16:43:35 +02:00
|
|
|
play_sound_effect(player, "default_dig_metal")
|
2017-04-05 18:46:09 +02:00
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-09 16:43:35 +02:00
|
|
|
play_sound_effect(player, "default_dug_metal")
|
2017-04-05 18:46:09 +02:00
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "shields:shield_enhanced_wood",
|
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
{"shields:shield_wood"},
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
},
|
|
|
|
})
|
2020-04-30 05:04:16 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "shields:shield_wood",
|
|
|
|
burntime = 8,
|
|
|
|
})
|
2015-02-19 20:18:34 +01:00
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.cactus then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Cactus Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_cactus
|
|
|
|
-- @img shields_inv_shield_cactus.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 0
|
|
|
|
-- @grp armor_use 1000
|
|
|
|
-- @armorgrp fleshy 5
|
|
|
|
-- @damagegrp cracky 3
|
|
|
|
-- @damagegrp snappy 3
|
|
|
|
-- @damagegrp choppy 2
|
|
|
|
-- @damagegrp crumbly 2
|
|
|
|
-- @damagegrp level 1
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_cactus", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Cactus Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_cactus.png",
|
2017-04-05 18:46:09 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=0, armor_use=1000},
|
|
|
|
armor_groups = {fleshy=5},
|
|
|
|
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_wood_footstep")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_wood_footstep")
|
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Enhanced Cactus Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_enhanced_cactus
|
|
|
|
-- @img shields_inv_shield_enhanced_cactus.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 0
|
|
|
|
-- @grp armor_use 1000
|
|
|
|
-- @armorgrp fleshy 8
|
|
|
|
-- @damagegrp cracky 3
|
|
|
|
-- @damagegrp snappy 3
|
|
|
|
-- @damagegrp choppy 2
|
|
|
|
-- @damagegrp crumbly 2
|
|
|
|
-- @damagegrp level 2
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_enhanced_cactus", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Enhanced Cactus Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_enhanced_cactus.png",
|
2017-04-05 18:46:09 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=0, armor_use=1000},
|
|
|
|
armor_groups = {fleshy=8},
|
|
|
|
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=2},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-09 16:43:35 +02:00
|
|
|
play_sound_effect(player, "default_dig_metal")
|
2017-04-05 18:46:09 +02:00
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-09 16:43:35 +02:00
|
|
|
play_sound_effect(player, "default_dug_metal")
|
2017-04-05 18:46:09 +02:00
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "shields:shield_enhanced_cactus",
|
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
{"shields:shield_cactus"},
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
},
|
|
|
|
})
|
2020-04-30 05:04:16 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "shields:shield_cactus",
|
|
|
|
burntime = 16,
|
|
|
|
})
|
2015-02-19 20:18:34 +01:00
|
|
|
end
|
2014-11-10 01:53:54 +01:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.steel then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Steel Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_steel
|
|
|
|
-- @img shields_inv_shield_steel.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 0
|
|
|
|
-- @grp armor_use 800
|
|
|
|
-- @grp physics_speed -0.03
|
|
|
|
-- @grp physics_gravity 0.03
|
|
|
|
-- @armorgrp fleshy 10
|
|
|
|
-- @damagegrp cracky 2
|
|
|
|
-- @damagegrp snappy 3
|
|
|
|
-- @damagegrp choppy 2
|
|
|
|
-- @damagegrp crumbly 1
|
|
|
|
-- @damagegrp level 2
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_steel", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Steel Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_steel.png",
|
2017-04-09 19:37:55 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=0, armor_use=800,
|
2017-04-09 19:49:44 +02:00
|
|
|
physics_speed=-0.03, physics_gravity=0.03},
|
2017-04-05 18:46:09 +02:00
|
|
|
armor_groups = {fleshy=10},
|
|
|
|
damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_dig_metal")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_dug_metal")
|
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.bronze then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Bronze Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_bronze
|
|
|
|
-- @img shields_inv_shield_bronze.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 6
|
|
|
|
-- @grp armor_use 400
|
|
|
|
-- @grp physics_speed -0.03
|
|
|
|
-- @grp physics_gravity 0.03
|
|
|
|
-- @armorgrp fleshy 10
|
|
|
|
-- @damagegrp cracky 2
|
|
|
|
-- @damagegrp snappy 3
|
|
|
|
-- @damagegrp choppy 2
|
|
|
|
-- @damagegrp crumbly 1
|
|
|
|
-- @damagegrp level 2
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_bronze", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Bronze Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_bronze.png",
|
2017-04-09 19:37:55 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=6, armor_use=400,
|
2017-04-09 19:49:44 +02:00
|
|
|
physics_speed=-0.03, physics_gravity=0.03},
|
2017-04-05 18:46:09 +02:00
|
|
|
armor_groups = {fleshy=10},
|
|
|
|
damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_dig_metal")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_dug_metal")
|
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.diamond then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Diamond Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_diamond
|
|
|
|
-- @img shields_inv_shield_diamond.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 12
|
|
|
|
-- @grp armor_use 200
|
|
|
|
-- @armorgrp fleshy 15
|
|
|
|
-- @damagegrp cracky 2
|
|
|
|
-- @damagegrp snappy 1
|
|
|
|
-- @damagegrp choppy 1
|
|
|
|
-- @damagegrp level 3
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_diamond", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Diamond Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_diamond.png",
|
2017-04-05 18:46:09 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=12, armor_use=200},
|
|
|
|
armor_groups = {fleshy=15},
|
|
|
|
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_glass_footstep")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_break_glass")
|
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.gold then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Gold Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_gold
|
|
|
|
-- @img shields_inv_shield_gold.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 6
|
|
|
|
-- @grp armor_use 300
|
|
|
|
-- @grp physics_speed -0.04
|
|
|
|
-- @grp physics_gravity 0.04
|
|
|
|
-- @armorgrp fleshy 10
|
|
|
|
-- @damagegrp cracky 1
|
|
|
|
-- @damagegrp snappy 2
|
|
|
|
-- @damagegrp choppy 2
|
|
|
|
-- @damagegrp crumbly 3
|
|
|
|
-- @damagegrp level 2
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_gold", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Gold Shield"),
|
2015-02-19 20:18:34 +01:00
|
|
|
inventory_image = "shields_inv_shield_gold.png",
|
2017-04-09 19:37:55 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=6, armor_use=300,
|
2017-04-09 19:49:44 +02:00
|
|
|
physics_speed=-0.04, physics_gravity=0.04},
|
2017-04-05 18:46:09 +02:00
|
|
|
armor_groups = {fleshy=10},
|
|
|
|
damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_dig_metal")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_dug_metal")
|
|
|
|
end,
|
2015-02-19 20:18:34 +01:00
|
|
|
})
|
|
|
|
end
|
2014-06-12 17:04:08 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.mithril then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Mithril Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_mithril
|
|
|
|
-- @img shields_inv_shield_mithril.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 12
|
|
|
|
-- @grp armor_use 100
|
|
|
|
-- @armorgrp fleshy 15
|
|
|
|
-- @damagegrp cracky 2
|
|
|
|
-- @damagegrp snappy 1
|
|
|
|
-- @damagegrp level 3
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_mithril", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Mithril Shield"),
|
2013-11-12 22:22:52 +01:00
|
|
|
inventory_image = "shields_inv_shield_mithril.png",
|
2022-02-05 13:33:41 +01:00
|
|
|
groups = {armor_shield=1, armor_heal=13, armor_use=66},
|
|
|
|
armor_groups = {fleshy=16},
|
2017-04-05 18:46:09 +02:00
|
|
|
damage_groups = {cracky=2, snappy=1, level=3},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_glass_footstep")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_break_glass")
|
|
|
|
end,
|
2013-11-12 22:22:52 +01:00
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.crystal then
|
2021-07-30 16:12:29 +02:00
|
|
|
--- Crystal Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_crystal
|
|
|
|
-- @img shields_inv_shield_crystal.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 12
|
|
|
|
-- @grp armor_use 100
|
|
|
|
-- @grp armor_fire 1
|
|
|
|
-- @armorgrp fleshy 15
|
|
|
|
-- @damagegrp cracky 2
|
|
|
|
-- @damagegrp snappy 1
|
|
|
|
-- @damagegrp level 3
|
2017-04-05 18:46:09 +02:00
|
|
|
armor:register_armor("shields:shield_crystal", {
|
2017-03-31 20:54:12 +02:00
|
|
|
description = S("Crystal Shield"),
|
2015-05-04 18:08:40 +02:00
|
|
|
inventory_image = "shields_inv_shield_crystal.png",
|
2017-04-05 18:46:09 +02:00
|
|
|
groups = {armor_shield=1, armor_heal=12, armor_use=100, armor_fire=1},
|
|
|
|
armor_groups = {fleshy=15},
|
|
|
|
damage_groups = {cracky=2, snappy=1, level=3},
|
|
|
|
reciprocate_damage = true,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_damage = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_glass_footstep")
|
|
|
|
end,
|
2017-04-15 21:37:32 +02:00
|
|
|
on_destroy = function(player, index, stack)
|
2017-04-05 18:46:09 +02:00
|
|
|
play_sound_effect(player, "default_break_glass")
|
|
|
|
end,
|
2015-05-04 18:08:40 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2021-11-10 10:15:55 +01:00
|
|
|
if armor.materials.nether then
|
|
|
|
--- Nether Shield
|
|
|
|
--
|
|
|
|
-- @shield shields:shield_nether
|
|
|
|
-- @img shields_inv_shield_nether.png
|
|
|
|
-- @grp armor_shield 1
|
|
|
|
-- @grp armor_heal 17
|
|
|
|
-- @grp armor_use 200
|
2021-11-13 11:00:49 +01:00
|
|
|
-- @grp armor_fire 1
|
2021-11-10 10:15:55 +01:00
|
|
|
-- @armorgrp fleshy 20
|
|
|
|
-- @damagegrp cracky 3
|
|
|
|
-- @damagegrp snappy 2
|
|
|
|
-- @damagegrp level 3
|
|
|
|
armor:register_armor("shields:shield_nether", {
|
|
|
|
description = S("Nether Shield"),
|
|
|
|
inventory_image = "shields_inv_shield_nether.png",
|
2021-11-13 11:00:49 +01:00
|
|
|
groups = {armor_shield=1, armor_heal=17, armor_use=200, armor_fire=1},
|
2021-11-10 10:15:55 +01:00
|
|
|
armor_groups = {fleshy=20},
|
|
|
|
damage_groups = {cracky=3, snappy=2, level=3},
|
|
|
|
reciprocate_damage = true,
|
|
|
|
on_damage = function(player, index, stack)
|
|
|
|
play_sound_effect(player, "default_glass_footstep")
|
|
|
|
end,
|
|
|
|
on_destroy = function(player, index, stack)
|
|
|
|
play_sound_effect(player, "default_break_glass")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
for k, v in pairs(armor.materials) do
|
2013-06-24 20:06:19 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "shields:shield_"..k,
|
|
|
|
recipe = {
|
|
|
|
{v, v, v},
|
|
|
|
{v, v, v},
|
|
|
|
{"", v, ""},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|