diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/README.txt b/mods/ITEMS/minetest-3d_armor/3d_armor/README.txt
index 8f44f3750..92ff6d147 100644
--- a/mods/ITEMS/minetest-3d_armor/3d_armor/README.txt
+++ b/mods/ITEMS/minetest-3d_armor/3d_armor/README.txt
@@ -9,3 +9,20 @@ a player's armor group level making them less vulnerable to some forms of damage
Armor takes damage when a player is hurt.
This mod is based on 3D Armor mod by stu.
+
+Media credits
+-------------
+* 3d_armor_equip_diamond.ogg
+* 3d_armor_unequip_diamond.ogg
+Licensed CC0, by Freesound.org user juryduty.
+Source:
+
+* 3d_armor_equip_iron.ogg
+* 3d_armor_unequip_iron.ogg
+Licensed CC0, by Freesound.org user mtchanary.
+Source:
+
+All other sounds licensed CC0 by OpenGameArt.org user artisticdude.
+Source:
+
+Other media files: See MineClone 2 license.
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua b/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua
index 11f6441d2..8661f641b 100644
--- a/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua
+++ b/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua
@@ -265,6 +265,22 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end)
+local function play_equip_sound(player, stack, unequip)
+ local def = stack:get_definition()
+ local estr = "equip"
+ if unequip then
+ estr = "unequip"
+ end
+ local snd = def.sounds and def.sounds["_mcl_armor_"..estr]
+ if not snd then
+ -- Fallback sound
+ snd = { name = "3d_armor_"..estr.."_iron" }
+ end
+ if snd then
+ minetest.sound_play(snd, {object=player, gain=0.5, max_hear_distance=8})
+ end
+end
+
minetest.register_on_joinplayer(function(player)
mcl_player.player_set_model(player, "3d_armor_character.b3d")
local name = player:get_player_name()
@@ -274,11 +290,13 @@ minetest.register_on_joinplayer(function(player)
player:get_inventory():set_stack(listname, index, stack)
armor:set_player_armor(player)
armor:update_inventory(player)
+ play_equip_sound(player, stack)
end,
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, nil)
armor:set_player_armor(player)
armor:update_inventory(player)
+ play_equip_sound(player, stack, true)
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
local plaver_inv = player:get_inventory()
@@ -287,6 +305,7 @@ minetest.register_on_joinplayer(function(player)
player_inv:set_stack(from_list, from_index, nil)
armor:set_player_armor(player)
armor:update_inventory(player)
+ play_equip_sound(player, stack)
end,
allow_put = function(inv, listname, index, stack, player)
local iname = stack:get_name()
@@ -435,4 +454,3 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
end
return hp_change
end, true)
-
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/init.lua b/mods/ITEMS/minetest-3d_armor/3d_armor/init.lua
index f3b28177c..774bd07a3 100644
--- a/mods/ITEMS/minetest-3d_armor/3d_armor/init.lua
+++ b/mods/ITEMS/minetest-3d_armor/3d_armor/init.lua
@@ -14,6 +14,10 @@ minetest.register_tool("3d_armor:helmet_leather", {
inventory_image = "3d_armor_inv_helmet_leather.png",
groups = {armor_head=1, mcl_armor_points=1, mcl_armor_uses=56},
_repair_material = "mcl_mobitems:leather",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_leather",
+ _mcl_armor_unequip = "3d_armor_unequip_leather",
+ },
})
minetest.register_tool("3d_armor:helmet_iron", {
@@ -23,6 +27,10 @@ minetest.register_tool("3d_armor:helmet_iron", {
inventory_image = "3d_armor_inv_helmet_iron.png",
groups = {armor_head=1, mcl_armor_points=2, mcl_armor_uses=166},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_iron",
+ _mcl_armor_unequip = "3d_armor_unequip_iron",
+ },
})
minetest.register_tool("3d_armor:helmet_gold", {
@@ -41,6 +49,10 @@ minetest.register_tool("3d_armor:helmet_diamond",{
inventory_image = "3d_armor_inv_helmet_diamond.png",
groups = {armor_head=1, mcl_armor_points=3, mcl_armor_uses=364, mcl_armor_toughness=2},
_repair_material = "mcl_core:diamond",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_diamond",
+ _mcl_armor_unequip = "3d_armor_unequip_diamond",
+ },
})
minetest.register_tool("3d_armor:helmet_chain", {
@@ -50,6 +62,10 @@ minetest.register_tool("3d_armor:helmet_chain", {
inventory_image = "3d_armor_inv_helmet_chain.png",
groups = {armor_head=1, mcl_armor_points=2, mcl_armor_uses=166},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_chainmail",
+ _mcl_armor_unequip = "3d_armor_unequip_chainmail",
+ },
})
-- Regisiter Torso Armor
@@ -61,6 +77,10 @@ minetest.register_tool("3d_armor:chestplate_leather", {
inventory_image = "3d_armor_inv_chestplate_leather.png",
groups = {armor_torso=1, mcl_armor_points=3, mcl_armor_uses=81},
_repair_material = "mcl_mobitems:leather",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_leather",
+ _mcl_armor_unequip = "3d_armor_unequip_leather",
+ },
})
minetest.register_tool("3d_armor:chestplate_iron", {
@@ -70,6 +90,10 @@ minetest.register_tool("3d_armor:chestplate_iron", {
inventory_image = "3d_armor_inv_chestplate_iron.png",
groups = {armor_torso=1, mcl_armor_points=6, mcl_armor_uses=241},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_iron",
+ _mcl_armor_unequip = "3d_armor_unequip_iron",
+ },
})
minetest.register_tool("3d_armor:chestplate_gold", {
@@ -88,6 +112,10 @@ minetest.register_tool("3d_armor:chestplate_diamond",{
inventory_image = "3d_armor_inv_chestplate_diamond.png",
groups = {armor_torso=1, mcl_armor_points=8, mcl_armor_uses=529, mcl_armor_toughness=2},
_repair_material = "mcl_core:diamond",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_diamond",
+ _mcl_armor_unequip = "3d_armor_unequip_diamond",
+ },
})
minetest.register_tool("3d_armor:chestplate_chain", {
@@ -97,6 +125,10 @@ minetest.register_tool("3d_armor:chestplate_chain", {
inventory_image = "3d_armor_inv_chestplate_chain.png",
groups = {armor_torso=1, mcl_armor_points=5, mcl_armor_uses=241},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_chainmail",
+ _mcl_armor_unequip = "3d_armor_unequip_chainmail",
+ },
})
-- Regisiter Leg Armor
@@ -108,6 +140,10 @@ minetest.register_tool("3d_armor:leggings_leather", {
inventory_image = "3d_armor_inv_leggings_leather.png",
groups = {armor_legs=1, mcl_armor_points=2, mcl_armor_uses=76},
_repair_material = "mcl_mobitems:leather",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_leather",
+ _mcl_armor_unequip = "3d_armor_unequip_leather",
+ },
})
minetest.register_tool("3d_armor:leggings_iron", {
@@ -117,6 +153,10 @@ minetest.register_tool("3d_armor:leggings_iron", {
inventory_image = "3d_armor_inv_leggings_iron.png",
groups = {armor_legs=1, mcl_armor_points=5, mcl_armor_uses=226},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_iron",
+ _mcl_armor_unequip = "3d_armor_unequip_iron",
+ },
})
minetest.register_tool("3d_armor:leggings_gold", {
@@ -135,6 +175,10 @@ minetest.register_tool("3d_armor:leggings_diamond",{
inventory_image = "3d_armor_inv_leggings_diamond.png",
groups = {armor_legs=1, mcl_armor_points=6, mcl_armor_uses=496, mcl_armor_toughness=2},
_repair_material = "mcl_core:diamond",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_diamond",
+ _mcl_armor_unequip = "3d_armor_unequip_diamond",
+ },
})
minetest.register_tool("3d_armor:leggings_chain", {
@@ -144,6 +188,10 @@ minetest.register_tool("3d_armor:leggings_chain", {
inventory_image = "3d_armor_inv_leggings_chain.png",
groups = {armor_legs=1, mcl_armor_points=4, mcl_armor_uses=226},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_chainmail",
+ _mcl_armor_unequip = "3d_armor_unequip_chainmail",
+ },
})
-- Regisiter Boots
@@ -154,6 +202,10 @@ minetest.register_tool("3d_armor:boots_leather", {
inventory_image = "3d_armor_inv_boots_leather.png",
groups = {armor_feet=1, mcl_armor_points=1, mcl_armor_uses=66},
_repair_material = "mcl_mobitems:leather",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_leather",
+ _mcl_armor_unequip = "3d_armor_unequip_leather",
+ },
})
minetest.register_tool("3d_armor:boots_iron", {
@@ -163,6 +215,10 @@ minetest.register_tool("3d_armor:boots_iron", {
inventory_image = "3d_armor_inv_boots_iron.png",
groups = {armor_feet=1, mcl_armor_points=2, mcl_armor_uses=196},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_iron",
+ _mcl_armor_unequip = "3d_armor_unequip_iron",
+ },
})
minetest.register_tool("3d_armor:boots_gold", {
@@ -181,6 +237,10 @@ minetest.register_tool("3d_armor:boots_diamond",{
inventory_image = "3d_armor_inv_boots_diamond.png",
groups = {armor_feet=1, mcl_armor_points=3, mcl_armor_uses=430, mcl_armor_toughness=2},
_repair_material = "mcl_core:diamond",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_diamond",
+ _mcl_armor_unequip = "3d_armor_unequip_diamond",
+ },
})
minetest.register_tool("3d_armor:boots_chain", {
@@ -190,6 +250,10 @@ minetest.register_tool("3d_armor:boots_chain", {
inventory_image = "3d_armor_inv_boots_chain.png",
groups = {armor_feet=1, mcl_armor_points=1, mcl_armor_uses=196},
_repair_material = "mcl_core:iron_ingot",
+ sounds = {
+ _mcl_armor_equip = "3d_armor_equip_chainmail",
+ _mcl_armor_unequip = "3d_armor_unequip_chainmail",
+ },
})
-- Register Craft Recipies
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_chainmail.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_chainmail.ogg
new file mode 100644
index 000000000..3e98e0e05
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_chainmail.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_diamond.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_diamond.ogg
new file mode 100644
index 000000000..9fd655ab7
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_diamond.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_generic.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_generic.ogg
new file mode 100644
index 000000000..29b4bcd5f
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_generic.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_iron.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_iron.ogg
new file mode 100644
index 000000000..7001c4460
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_iron.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_leather.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_leather.ogg
new file mode 100644
index 000000000..378ec3165
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_equip_leather.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_chainmail.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_chainmail.ogg
new file mode 100644
index 000000000..01692b5d2
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_chainmail.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_diamond.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_diamond.ogg
new file mode 100644
index 000000000..bdfdf8037
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_diamond.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_iron.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_iron.ogg
new file mode 100644
index 000000000..969ac030f
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_iron.ogg differ
diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_leather.ogg b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_leather.ogg
new file mode 100644
index 000000000..e634b89df
Binary files /dev/null and b/mods/ITEMS/minetest-3d_armor/3d_armor/sounds/3d_armor_unequip_leather.ogg differ