1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2025-06-28 22:36:39 +02:00

19 Commits

Author SHA1 Message Date
0b3deea513 Improve player model hanlding and update to version 0.4.0 2013-11-12 21:22:52 +00:00
9dbf76d013 UV mapping fix, edge of boots showing on hat layer 2013-10-15 22:03:43 +01:00
f71204db09 Merge pull request #5 from BlockMen/2nd
Better implementation of support for hud
2013-09-13 10:38:44 -07:00
025c0136b7 Merge pull request #4 from BlockMen/master
Add support for Better HUD mod
2013-09-12 10:15:26 -07:00
cf87528a03 General way to provide read out of armor 2013-09-12 01:29:30 +02:00
9481e548cf Add support for Better HUD mod 2013-09-12 01:08:11 +02:00
02ba28f11b Make wielded item more 3d looking 2013-08-04 22:20:03 +01:00
5e52758216 Add texture transform support 2013-08-04 22:17:08 +01:00
59048743ab Update Textures 2013-07-14 19:20:54 +01:00
cfc6984a36 Update Models 2013-07-14 19:15:11 +01:00
619a52688f Add multiple UV texture support 2013-07-14 18:24:24 +01:00
8f2852c6b3 Rename inventory++ icon 2013-07-06 18:05:10 +01:00
956193b49a Re add support for inventory++ by Zeg9 2013-07-04 19:15:38 +01:00
d7a87a515b Only load formspec when armor inventory selected 2013-06-26 22:55:55 +01:00
eeb69e1280 Update README.md 2013-06-24 20:45:05 +01:00
cf0331a043 Add diamond shield craft registration 2013-06-24 20:34:51 +01:00
61e6052019 Add shields back as a separate mod 2013-06-24 19:06:19 +01:00
0edd6ac9e0 Update README.md 2013-06-22 19:40:54 +01:00
efea71a63e Version update: 0.3.0 2013-06-22 19:31:57 +01:00
80 changed files with 3482 additions and 963 deletions

View File

@ -1,12 +1,13 @@
[mod] Visible Player Armor [3d_armor]
=====================================
depends: default, inventory_plus, unified_skins
depends: default, inventory_plus
Adds craftable armor that is visible to other players. Each armor item worn contibutes to
Adds craftable armor that is visible to other players. Each armor item worn contributes to
a player's armor group level making them less vulnerable to weapons.
Armor takes damage when a player is hurt but also offers a percentage chance of healing.
Overall level is boosted by 10% when wearing a full matching set.
default settings: [minetest.conf]

247
3d_armor/armor.lua Normal file
View File

@ -0,0 +1,247 @@
local time = 0
local update_time = tonumber(minetest.setting_get("3d_armor_update_time"))
if not update_time then
update_time = 1
minetest.setting_set("3d_armor_update_time", tostring(update_time))
end
armor = {
player_hp = {},
elements = {"head", "torso", "legs", "feet"},
formspec = "size[8,8.5]button[0,0;2,0.5;main;Back]"
.."list[current_player;main;0,4.5;8,4;]"
.."list[detached:player_name_armor;armor_head;3,0;1,1;]"
.."list[detached:player_name_armor;armor_torso;3,1;1,1;]"
.."list[detached:player_name_armor;armor_legs;3,2;1,1;]"
.."list[detached:player_name_armor;armor_feet;3,3;1,1;]",
textures = {},
default_skin = "character.png",
}
-- armor.def - Added by BlockMen for HUD integration
armor.def = {
state = 0,
count = 0,
}
armor.update_player_visuals = function(self, player)
if not player then
return
end
local name = player:get_player_name()
if self.textures[name] then
default.player_set_textures(player, {
self.textures[name].skin,
self.textures[name].armor,
self.textures[name].wielditem,
})
end
end
armor.set_player_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local player_inv = player:get_inventory()
local armor_texture = "3d_armor_trans.png"
local armor_level = 0
local state = 0
local items = 0
local textures = {}
local elements = {}
for i, v in ipairs(self.elements) do
local stack = player_inv:get_stack("armor_"..v, 1)
local level = stack:get_definition().groups["armor_"..v]
local item = stack:get_name()
elements[i] = string.match(item, "%:.+_(.+)$")
if level then
table.insert(textures, item:gsub("%:", "_")..".png")
armor_level = armor_level + level
state = state + stack:get_wear()
items = items + 1
end
end
if minetest.get_modpath("shields") then
armor_level = armor_level * 0.9
end
if elements[1] == elements[2] and
elements[1] == elements[3] and
elements[1] == elements[4] then
armor_level = armor_level * 1.1
end
if #textures > 0 then
armor_texture = table.concat(textures, "^")
end
local armor_groups = {fleshy=100}
if armor_level > 0 then
armor_groups.level = math.floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
end
player:set_armor_groups(armor_groups)
self.textures[name].armor = armor_texture
self.def[name].state = state
self.def[name].count = items
self:update_player_visuals(player)
end
armor.update_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local hp = player:get_hp() or 0
if hp == 0 or hp == self.player_hp[name] then
return
end
if self.player_hp[name] > hp then
local player_inv = player:get_inventory()
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
if not armor_inv then
return
end
local heal_max = 0
local state = 0
local items = 0
for _,v in ipairs(self.elements) do
local stack = armor_inv:get_stack("armor_"..v, 1)
if stack:get_count() > 0 then
local use = stack:get_definition().groups["armor_use"] or 0
local heal = stack:get_definition().groups["armor_heal"] or 0
local item = stack:get_name()
stack:add_wear(use)
armor_inv:set_stack("armor_"..v, 1, stack)
player_inv:set_stack("armor_"..v, 1, stack)
state = state + stack:get_wear()
items = items + 1
if stack:get_count() == 0 then
local desc = minetest.registered_items[item].description
if desc then
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
end
self:set_player_armor(player)
end
heal_max = heal_max + heal
end
end
self.def[name].state = state
self.def[name].count = items
if heal_max > math.random(100) then
player:set_hp(self.player_hp[name])
return
end
end
self.player_hp[name] = hp
end
-- Register Player Model
default.player_register_model("3d_armor_character.x", {
animation_speed = 30,
textures = {
armor.default_skin,
"3d_armor_trans.png",
"3d_armor_trans.png",
},
animations = {
stand = {x=0, y=79},
lay = {x=162, y=166},
walk = {x=168, y=187},
mine = {x=189, y=198},
walk_mine = {x=200, y=219},
sit = {x=81, y=160},
},
})
-- Register Callbacks
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
if fields.armor then
local formspec = armor.formspec:gsub("player_name", name)
inventory_plus.set_inventory_formspec(player, formspec)
return
end
for field, _ in pairs(fields) do
if string.find(field, "^skins_set_") then
minetest.after(0, function(player)
armor.textures[name].skin = skins.skins[name]..".png"
armor:update_player_visuals(player)
end, player)
end
end
end)
minetest.register_on_joinplayer(function(player)
default.player_set_model(player, "3d_armor_character.x")
inventory_plus.register_button(player,"armor", "Armor")
local player_inv = player:get_inventory()
local name = player:get_player_name()
local armor_inv = minetest.create_detached_inventory(name.."_armor",{
on_put = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, stack)
armor:set_player_armor(player)
end,
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, nil)
armor:set_player_armor(player)
end,
allow_put = function(inv, listname, index, stack, player)
if inv:is_empty(listname) then
return 1
end
return 0
end,
allow_take = function(inv, listname, index, stack, player)
return stack:get_count()
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
for _,v in ipairs(armor.elements) do
local list = "armor_"..v
player_inv:set_size(list, 1)
armor_inv:set_size(list, 1)
armor_inv:set_stack(list, 1, player_inv:get_stack(list, 1))
end
armor.player_hp[name] = 0
armor.def[name] = {
state = 0,
count = 0,
}
armor.textures[name] = {
skin = armor.default_skin,
armor = "3d_armor_trans.png",
wielditem = "3d_armor_trans.png",
}
if minetest.get_modpath("skins") then
local skin = skins.skins[name]
if skin and skins.get_type(skin) == skins.type.MODEL then
armor.textures[name].skin = skin..".png"
end
end
if minetest.get_modpath("player_textures") then
local filename = minetest.get_modpath("player_textures").."/textures/player_"..name
local f = io.open(filename..".png")
if f then
f:close()
armor.textures[name].skin = "player_"..name..".png"
end
end
minetest.after(0, function(player)
armor:set_player_armor(player)
end, player)
end)
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > update_time then
for _,player in ipairs(minetest.get_connected_players()) do
armor:update_armor(player)
end
time = 0
end
end)

View File

@ -1,91 +0,0 @@
armor_api = {
player_hp = {},
}
armor_api.get_armor_textures = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local textures = {}
local player_inv = player:get_inventory()
for _,v in ipairs({"head", "torso", "legs"}) do
local stack = player_inv:get_stack("armor_"..v, 1)
if stack:get_definition().groups["armor_"..v] then
local item = stack:get_name()
textures[v] = item:gsub("%:", "_")..".png"
end
end
local stack = player_inv:get_stack("armor_shield", 1)
if stack:get_definition().groups["armor_shield"] then
local item = stack:get_name()
textures["shield"] = minetest.registered_items[item].inventory_image
end
return textures
end
armor_api.set_player_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local player_inv = player:get_inventory()
local armor_level = 0
for _,v in ipairs({"head", "torso", "legs", "shield"}) do
local stack = player_inv:get_stack("armor_"..v, 1)
local armor = stack:get_definition().groups["armor_"..v] or 0
armor_level = armor_level + armor
end
local armor_groups = {fleshy=100}
if armor_level > 0 then
armor_groups.level = math.floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
end
player:set_armor_groups(armor_groups)
uniskins:update_player_visuals(player)
end
armor_api.update_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local hp = player:get_hp()
if hp == nil or hp == 0 or hp == self.player_hp[name] then
return
end
if self.player_hp[name] > hp then
local player_inv = player:get_inventory()
local armor_inv = minetest.get_inventory({type="detached", name=name.."_outfit"})
if armor_inv == nil then
return
end
local heal_max = 0
for _,v in ipairs({"head", "torso", "legs", "shield"}) do
local stack = armor_inv:get_stack("armor_"..v, 1)
if stack:get_count() > 0 then
local use = stack:get_definition().groups["armor_use"] or 0
local heal = stack:get_definition().groups["armor_heal"] or 0
local item = stack:get_name()
stack:add_wear(use)
armor_inv:set_stack("armor_"..v, 1, stack)
player_inv:set_stack("armor_"..v, 1, stack)
if stack:get_count() == 0 then
local desc = minetest.registered_items[item].description
if desc then
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
end
self:set_player_armor(player)
end
heal_max = heal_max + heal
end
end
if heal_max > math.random(100) then
player:set_hp(self.player_hp[name])
return
end
end
self.player_hp[name] = hp
end

View File

@ -14,6 +14,8 @@ Helmets:
[3d_armor:helmet_wood] X = [default:wood]
[3d_armor:helmet_steel] X = [default:steel_ingot]
[3d_armor:helmet_bronze] X = [default:bronze_ingot]
[3d_armor:helmet_diamond] X = [default:diamond]
[3d_armor:helmet_mithril] X = [moreores:mithril_ingot] *
Chestplates:
@ -28,6 +30,8 @@ Chestplates:
[3d_armor:chestplate_wood] X = [default:wood]
[3d_armor:chestplate_steel] X = [default:steel_ingot]
[3d_armor:chestplate_bronze] X = [default:bronze_ingot]
[3d_armor:chestplate_diamond] X = [default:diamond]
[3d_armor:chestplate_mithril] X = [moreores:mithril_ingot] *
Leggings:
@ -42,33 +46,22 @@ Leggings:
[3d_armor:leggings_wood] X = [default:wood]
[3d_armor:leggings_steel] X = [default:steel_ingot]
[3d_armor:leggings_bronze] X = [default:bronze_ingot]
[3d_armor:leggings_diamond] X = [default:diamond]
[3d_armor:leggings_mithril] X = [moreores:mithril_ingot] *
Shields:
Boots:
+---+---+---+
| X | X | X |
| X | | X |
+---+---+---+
| X | X | X |
+---+---+---+
| | X | |
| X | | X |
+---+---+---+
[3d_armor:shield_wood] X = [default:wood]
[3d_armor:shield_steel] X = [default:steel_ingot]
[3d_armor:shield_bronze] X = [default:bronze_ingot
[3d_armor:boots_wood] X = [default:wood]
[3d_armor:boots_steel] X = [default:steel_ingot]
[3d_armor:boots_bronze] X = [default:bronze_ingot
[3d_armor:boots_diamond] X = [default:diamond]
[3d_armor:boots_mithril] X = [moreores:mithril_ingot] *
Enhanced Wooden Shield:
SI = [default:steel_ingot]
WS = [3d_armor:shield_wood]
+----+
| SI |
+----+
| WS |
+----+
| SI |
+----+
[3d_armor:shield_enhanced_wood]
* Requires moreores mod by Calinou - https://forum.minetest.net/viewtopic.php?id=549

View File

@ -1,3 +1,3 @@
default
inventory_plus
unified_skins

View File

@ -1,118 +1,174 @@
dofile(minetest.get_modpath(minetest.get_current_modname()).."/armor_api.lua")
local time = 0
local update_time = tonumber(minetest.setting_get("3d_armor_update_time"))
if not update_time then
update_time = 1
minetest.setting_set("3d_armor_update_time", tostring(update_time))
end
dofile(minetest.get_modpath(minetest.get_current_modname()).."/armor.lua")
local use_moreores = minetest.get_modpath("moreores")
-- Regisiter Head Armor
minetest.register_tool("3d_armor:helmet_wood", {
description = "Wood Helmet",
inventory_image = "3d_armor_inv_helmet_wood.png",
groups = {armor_head=5, armor_heal=0, armor_use=1000},
groups = {armor_head=5, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_steel", {
description = "Steel Helmet",
inventory_image = "3d_armor_inv_helmet_steel.png",
groups = {armor_head=10, armor_heal=5, armor_use=250},
groups = {armor_head=10, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_bronze", {
description = "Bronze Helmet",
inventory_image = "3d_armor_inv_helmet_bronze.png",
groups = {armor_head=15, armor_heal=10, armor_use=100},
groups = {armor_head=10, armor_heal=6, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_diamond", {
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_helmet_diamond.png",
groups = {armor_head=15, armor_heal=12, armor_use=100},
wear = 0,
})
if use_moreores then
minetest.register_tool("3d_armor:helmet_mithril", {
description = "Mithril Helmet",
inventory_image = "3d_armor_inv_helmet_mithril.png",
groups = {armor_head=15, armor_heal=12, armor_use=50},
wear = 0,
})
end
-- Regisiter Torso Armor
minetest.register_tool("3d_armor:chestplate_wood", {
description = "Wood Chestplate",
inventory_image = "3d_armor_inv_chestplate_wood.png",
groups = {armor_torso=10, armor_heal=0, armor_use=1000},
groups = {armor_torso=10, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_steel", {
description = "Steel Chestplate",
inventory_image = "3d_armor_inv_chestplate_steel.png",
groups = {armor_torso=15, armor_heal=5, armor_use=250},
groups = {armor_torso=15, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_bronze", {
description = "Bronze Chestplate",
inventory_image = "3d_armor_inv_chestplate_bronze.png",
groups = {armor_torso=25, armor_heal=10, armor_use=100},
groups = {armor_torso=15, armor_heal=6, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_diamond", {
description = "Diamond Chestplate",
inventory_image = "3d_armor_inv_chestplate_diamond.png",
groups = {armor_torso=20, armor_heal=12, armor_use=100},
wear = 0,
})
if use_moreores then
minetest.register_tool("3d_armor:chestplate_mithril", {
description = "Mithril Chestplate",
inventory_image = "3d_armor_inv_chestplate_mithril.png",
groups = {armor_torso=20, armor_heal=12, armor_use=50},
wear = 0,
})
end
-- Regisiter Leg Armor
minetest.register_tool("3d_armor:leggings_wood", {
description = "Wood Leggings",
inventory_image = "3d_armor_inv_leggings_wood.png",
groups = {armor_legs=5, armor_heal=0, armor_use=1000},
groups = {armor_legs=5, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_steel", {
description = "Steel Leggings",
inventory_image = "3d_armor_inv_leggings_steel.png",
groups = {armor_legs=10, armor_heal=5, armor_use=250},
groups = {armor_legs=15, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_bronze", {
description = "Bronze Leggings",
inventory_image = "3d_armor_inv_leggings_bronze.png",
groups = {armor_legs=15, armor_heal=10, armor_use=100},
groups = {armor_legs=15, armor_heal=6, armor_use=250},
wear = 0,
})
-- Regisiter Shields
minetest.register_tool("3d_armor:shield_wood", {
description = "Wooden Shield",
inventory_image = "3d_armor_inv_shield_wood.png",
groups = {armor_shield=10, armor_heal=0, armor_use=1000},
minetest.register_tool("3d_armor:leggings_diamond", {
description = "Diamond Leggings",
inventory_image = "3d_armor_inv_leggings_diamond.png",
groups = {armor_legs=20, armor_heal=12, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:shield_enhanced_wood", {
description = "Enhanced Wooden Shield",
inventory_image = "3d_armor_inv_shield_enhanced_wood.png",
groups = {armor_shield=15, armor_heal=5, armor_use=500},
if use_moreores then
minetest.register_tool("3d_armor:leggings_mithril", {
description = "Mithril Leggings",
inventory_image = "3d_armor_inv_leggings_mithril.png",
groups = {armor_legs=20, armor_heal=12, armor_use=50},
wear = 0,
})
end
-- Regisiter Boots
minetest.register_tool("3d_armor:boots_wood", {
description = "Wood Boots",
inventory_image = "3d_armor_inv_boots_wood.png",
groups = {armor_feet=5, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:shield_steel", {
description = "Steel Shield",
inventory_image = "3d_armor_inv_shield_steel.png",
groups = {armor_shield=20, armor_heal=5, armor_use=250},
minetest.register_tool("3d_armor:boots_steel", {
description = "Steel Boots",
inventory_image = "3d_armor_inv_boots_steel.png",
groups = {armor_feet=10, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:shield_bronze", {
description = "Bronze Shield",
inventory_image = "3d_armor_inv_shield_bronze.png",
groups = {armor_shield=25, armor_heal=10, armor_use=100},
minetest.register_tool("3d_armor:boots_bronze", {
description = "Bronze Boots",
inventory_image = "3d_armor_inv_boots_bronze.png",
groups = {armor_feet=10, armor_heal=6, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:boots_diamond", {
description = "Diamond Boots",
inventory_image = "3d_armor_inv_boots_diamond.png",
groups = {armor_feet=15, armor_heal=12, armor_use=100},
wear = 0,
})
if use_moreores then
minetest.register_tool("3d_armor:boots_mithril", {
description = "Mithril Boots",
inventory_image = "3d_armor_inv_boots_mithril.png",
groups = {armor_feet=15, armor_heal=12, armor_use=50},
wear = 0,
})
end
-- Register Craft Recipies
local craft_ingreds = {
wood = "default:wood",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
}
diamond = "default:diamond",
}
if use_moreores then
craft_ingreds.mithril = "moreores:mithril_ingot"
end
for k, v in pairs(craft_ingreds) do
minetest.register_craft({
@ -140,92 +196,11 @@ for k, v in pairs(craft_ingreds) do
},
})
minetest.register_craft({
output = "3d_armor:shield_"..k,
output = "3d_armor:boots_"..k,
recipe = {
{v, v, v},
{v, v, v},
{"", v, ""},
{v, "", v},
{v, "", v},
},
})
end
minetest.register_craft({
output = "3d_armor:shield_enhanced_wood",
recipe = {
{"default:steel_ingot"},
{"3d_armor:shield_wood"},
{"default:steel_ingot"},
},
})
-- Register Callbacks
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
if fields.outfit then
inventory_plus.set_inventory_formspec(player, "size[8,7.5]"
.."button[0,0;2,0.5;main;Back]"
.."list[current_player;main;0,3.5;8,4;]"
.."list[detached:"..name.."_outfit;armor_head;3,0;1,1;]"
.."list[detached:"..name.."_outfit;armor_torso;3,1;1,1;]"
.."list[detached:"..name.."_outfit;armor_legs;3,2;1,1;]"
.."list[detached:"..name.."_outfit;armor_shield;4,1;1,1;]")
return
end
for field, _ in pairs(fields) do
if string.sub(field,0,string.len("skins_set_")) == "skins_set_" then
minetest.after(0, function(player)
armor_api:set_player_armor(player)
end, player)
end
end
end)
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player,"outfit", "Outfit")
local player_inv = player:get_inventory()
local name = player:get_player_name()
local armor_inv = minetest.create_detached_inventory(name.."_outfit",{
on_put = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, stack)
armor_api:set_player_armor(player)
end,
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, nil)
armor_api:set_player_armor(player)
end,
allow_put = function(inv, listname, index, stack, player)
if inv:is_empty(listname) then
return 1
end
return 0
end,
allow_take = function(inv, listname, index, stack, player)
return stack:get_count()
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
for _,v in ipairs({"head", "torso", "legs", "shield"}) do
local armor = "armor_"..v
player_inv:set_size(armor, 1)
armor_inv:set_size(armor, 1)
armor_inv:set_stack(armor, 1, player_inv:get_stack(armor, 1))
end
armor_api.player_hp[name] = 0
minetest.after(0, function(player)
armor_api:set_player_armor(player)
end, player)
end)
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > update_time then
for _,player in ipairs(minetest.get_connected_players()) do
armor_api:update_armor(player)
end
time = 0
end
end)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

View File

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 885 B

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 737 B

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

View File

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

View File

@ -1,41 +1,32 @@
Modpack - 3d Armor
==================
[mod] Unified Skins [unified_skins]
-----------------------------------
A 3d character model re-texturing api used as the framework for this modpack.
Compatible with player skins mod [skins] by Zeg9 and Player Textures [player_textures] by sdzen.
Note: Currently only 64x32px player skins.
[mod] Visible Wielded Items [wieldview]
---------------------------------------
depends: default, unified_skins
Makes hand wielded items visible to other players.
Note: Currently only supports 16x16px texture packs, sorry!
Modpack - 3d Armor [0.4.0]
==========================
[mod] Visible Player Armor [3d_armor]
-------------------------------------
depends: default, unified_skins, inventory_plus
depends: default, inventory_plus
Adds craftable armor that is visible to other players. Each armor item worn contributes to
a player's armor group level making them less vulnerable to weapons.
Armor takes damage when a player is hurt, however, many armor items offer a 'stackable'
percentage chance of restoring the lost health points.
percentage chance of restoring the lost health points. Overall armor level is boosted by 10%
when wearing a full matching set (helmet, chestplate, leggings and boots of the same material)
[mod] Moreores Armor [more_armor]
---------------------------------
Compatible with player skins [skins] by Zeg9 and Player Textures [player_textures] by PilzAdam.
Now included for legacy support only! Unless you are using a customized ore system, this
mod is not really recommended and will most likely be removed from future versions.
[mod] Visible Wielded Items [wieldview]
---------------------------------------
depends: default, moreores, 3d_armor
depends: 3d_armor
Makes hand wielded items visible to other players.
[mod] Shields [shields]
-------------------------------------
depends: 3d_armor
Originally a part of 3d_armor, shields have been re-included as an optional extra.
If you do not want shields then simply remove the shields folder from the modpack.
Adds Mithril armor and upgrades moreores Mithril Sword.

View File

@ -1,6 +0,0 @@
[mod] Moreores Armor [more_armor]
========================================
depends: default, 3d_armor
Adds Bronze and Mithril armor sets, upgrades moreores weapons.

View File

@ -1,46 +0,0 @@
more_armor -- Crafting Guide
----------------------------
M = Mithril Ingot [moreores:mithril_ingot]
Mithril Helmet: [more_armor:helmet_mithril]
+---+---+---+
| M | M | M |
+---+---+---+
| M | | M |
+---+---+---+
| | | |
+---+---+---+
Mithril Chestplate: [more_armor:chestplate_mithril]
+---+---+---+
| M | | M |
+---+---+---+
| M | M | M |
+---+---+---+
| M | M | M |
+---+---+---+
Mithril Leggings: [more_armor:leggings_mithril]
+---+---+---+
| M | M | M |
+---+---+---+
| M | | M |
+---+---+---+
| M | | M |
+---+---+---+
Mithril Shield: [more_armor:shield_mithril]
+---+---+---+
| M | M | M |
+---+---+---+
| M | M | M |
+---+---+---+
| | M | |
+---+---+---+

View File

@ -1,89 +0,0 @@
-- Override moreores weapons (make them more powerful)
minetest.register_tool(":moreores:sword_mithril", {
description = "Mithril Sword",
inventory_image = "moreores_tool_mithrilsword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
fleshy={times={[0]=0.65, [1]=0.50, [2]=0.40, [3]=0.30}, uses=50, maxlevel=3},
snappy={times={[2]=0.80, [3]=0.40}, uses=100, maxlevel=1},
choppy={times={[3]=0.90}, uses=50, maxlevel=0}
}
}
})
-- Regisiter Head Armor
minetest.register_tool("more_armor:helmet_mithril", {
description = "Mithril Helmet",
inventory_image = "more_armor_inv_helmet_mithril.png",
groups = {armor_head=15, armor_heal=15, armor_use=50},
wear = 0,
})
minetest.register_craft({
output = "more_armor:helmet_mithril",
recipe = {
{"moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot"},
{"moreores:mithril_ingot", "", "moreores:mithril_ingot"},
{"", "", ""},
},
})
-- Regisiter Torso Armor
minetest.register_tool("more_armor:chestplate_mithril", {
description = "Mithril Chestplate",
inventory_image = "more_armor_inv_chestplate_mithril.png",
groups = {armor_torso=25, armor_heal=15, armor_use=50},
wear = 0,
})
minetest.register_craft({
output = "more_armor:chestplate_mithril",
recipe = {
{"moreores:mithril_ingot", "", "moreores:mithril_ingot"},
{"moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot"},
{"moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot"},
},
})
-- Regisiter Leg Armor
minetest.register_tool("more_armor:leggings_mithril", {
description = "Mithril Leggings",
inventory_image = "more_armor_inv_leggings_mithril.png",
groups = {armor_legs=20, armor_heal=15, armor_use=50},
wear = 0,
})
minetest.register_craft({
output = "more_armor:leggings_mithril",
recipe = {
{"moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot"},
{"moreores:mithril_ingot", "", "moreores:mithril_ingot"},
{"moreores:mithril_ingot", "", "moreores:mithril_ingot"},
},
})
-- Regisiter Shields
minetest.register_tool("more_armor:shield_mithril", {
description = "Mithril Shield",
inventory_image = "more_armor_inv_shield_mithril.png",
groups = {armor_shield=25, armor_heal=15, armor_use=50},
wear = 0,
})
minetest.register_craft({
output = "more_armor:shield_mithril",
recipe = {
{"moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot"},
{"moreores:mithril_ingot", "moreores:mithril_ingot", "moreores:mithril_ingot"},
{"", "moreores:mithril_ingot", ""},
},
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

6
shields/README.txt Normal file
View File

@ -0,0 +1,6 @@
A 3d character model re-texturing api used as the framework for this modpack.
depends: 3d_armor
Originally a part of 3d_armor, shields have been re-included as an optional extra.
If you do not what shields then simply remove the shields folder from the modpack.

View File

@ -0,0 +1,17 @@
Shields -- Crafting Guide
--------------------------
+---+---+---+
| X | X | X |
+---+---+---+
| X | X | X |
+---+---+---+
| | X | |
+---+---+---+
[shields:shield_wood] X = [default:wood]
[shields:shield_steel] X = [default:steel_ingot]
[shields:shield_bronze] X = [default:bronze_ingot]
[shields:shield_diamond] X = [default:diamond]

74
shields/init.lua Normal file
View File

@ -0,0 +1,74 @@
local use_moreores = minetest.get_modpath("moreores")
-- Regisiter Shields
minetest.register_tool("shields:shield_wood", {
description = "Wooden Shield",
inventory_image = "shields_inv_shield_wood.png",
groups = {armor_shield=5, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("shields:shield_steel", {
description = "Steel Shield",
inventory_image = "shields_inv_shield_steel.png",
groups = {armor_shield=10, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("shields:shield_bronze", {
description = "Bronze Shield",
inventory_image = "shields_inv_shield_bronze.png",
groups = {armor_shield=10, armor_heal=6, armor_use=250},
wear = 0,
})
minetest.register_tool("shields:shield_diamond", {
description = "Diamond Shield",
inventory_image = "shields_inv_shield_diamond.png",
groups = {armor_shield=15, armor_heal=12, armor_use=100},
wear = 0,
})
if use_moreores then
minetest.register_tool("shields:shield_mithril", {
description = "Mithril Shield",
inventory_image = "shields_inv_shield_mithril.png",
groups = {armor_shield=15, armor_heal=12, armor_use=50},
wear = 0,
})
end
local craft_ingreds = {
wood = "default:wood",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
diamond = "default:diamond",
}
if has_moreores then
craft_ingreds.mithril = "moreores:mithril_ingot"
end
for k, v in pairs(craft_ingreds) do
minetest.register_craft({
output = "shields:shield_"..k,
recipe = {
{v, v, v},
{v, v, v},
{"", v, ""},
},
})
end
minetest.after(0, function()
table.insert(armor.elements, "shield")
armor.formspec = "size[8,8.5]button[0,0;2,0.5;main;Back]"
.."list[current_player;main;0,4.5;8,4;]"
.."list[detached:player_name_armor;armor_head;3,0;1,1;]"
.."list[detached:player_name_armor;armor_torso;3,1;1,1;]"
.."list[detached:player_name_armor;armor_legs;3,2;1,1;]"
.."list[detached:player_name_armor;armor_feet;3,3;1,1;]"
.."list[detached:player_name_armor;armor_shield;4,1;1,1;]"
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

View File

Before

Width:  |  Height:  |  Size: 647 B

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

View File

@ -1,7 +0,0 @@
A 3d character model re-texturing api used as the framework for this modpack.
depends: default
Compatible with player skins mod [skins] by Zeg9 and Player Textures [player_textures] by sdzen.
Note: Currently only 64x32px player skins.

View File

@ -1 +0,0 @@
default

View File

@ -1,70 +0,0 @@
uniskins = {
skins = {},
default_character_skin = "character.png",
}
uniskins.get_player_skin = function(self, name)
if minetest.get_modpath("skins") then
local skin = skins.skins[name]
if skin then
if skins.get_type(skin) == skins.type.MODEL then
return skin..".png"
end
end
end
if self.skins[name] then
return self.skins[name]
end
return self.default_character_skin
end
uniskins.update_player_visuals = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local texture = self:get_player_skin(name)
local has_wieldview = minetest.get_modpath("wieldview")
if has_wieldview then
texture = "wieldview_character_bg.png^[combine:64x64:0,32="..texture
local wielded_item_texture = wieldview:get_wielded_item_texture(player)
if wielded_item_texture then
texture = texture.."^[combine:64x64:0,0="..wielded_item_texture
end
end
if minetest.get_modpath("3d_armor") then
local textures = armor_api:get_armor_textures(player)
for _,v in ipairs({"head", "torso", "legs"}) do
if textures[v] then
texture = texture.."^"
if has_wieldview then
texture = texture.."[combine:64x64:0,32="
end
texture = texture..textures[v]
end
end
if has_wieldview and textures["shield"] then
texture = texture.."^[combine:64x64:16,0="..textures["shield"]
end
end
player:set_properties({
visual = "mesh",
textures = {texture},
visual_size = {x=1, y=1},
})
end
minetest.register_on_joinplayer(function(player)
if not minetest.get_modpath("player_textures") then
return
end
local name = player:get_player_name()
local filename = minetest.get_modpath("player_textures").."/textures/player_"..name
local f = io.open(filename..".png")
if f then
f:close()
uniskins.skins[name] = "player_"..player:get_player_name()..".png"
end
end)

View File

@ -1,15 +1,15 @@
[mod] visible wielded items [wieldview]
=======================================
depends: default, unified_skins
depends: default, 3d_armor
Makes hand wielded items visible to other players. Compatible with player skins mod [skins].
Note: Currently only supports 16x16px texture packs, sorry!
Makes hand wielded items visible to other players.
default settings: [minetest.conf]
# Set number of seconds between visible wielded item updates.
wieldview_update_time = 2
# Show nodes as tiles, disabled by default
wieldview_node_tiles = false

View File

@ -1,2 +1,2 @@
default
unified_skins
3d_armor

View File

@ -4,29 +4,32 @@ if not update_time then
update_time = 2
minetest.setting_set("wieldview_update_time", tostring(update_time))
end
local node_tiles = minetest.setting_getbool("wieldview_node_tiles")
if not node_tiles then
node_tiles = false
minetest.setting_set("wieldview_node_tiles", "false")
end
wieldview = {
wielded_items = {},
wielded_item = {},
transform = {},
}
wieldview.get_wielded_item_texture = function(self, player)
if not player then
return nil
end
local stack = player:get_wielded_item()
local item = stack:get_name()
if not item then
return nil
end
if not minetest.registered_items[item] then
return nil
end
local texture = minetest.registered_items[item].inventory_image
if texture == "" then
if not minetest.registered_items[item].tiles then
return nil
dofile(minetest.get_modpath(minetest.get_current_modname()).."/transform.lua")
wieldview.get_item_texture = function(self, item)
local texture = "3d_armor_trans.png"
if item ~= "" then
if minetest.registered_items[item] then
if minetest.registered_items[item].inventory_image ~= "" then
texture = minetest.registered_items[item].inventory_image
elseif node_tiles == true and minetest.registered_items[item].tiles then
texture = minetest.registered_items[item].tiles[1]
end
end
if wieldview.transform[item] then
texture = texture.."^[transform"..wieldview.transform[item]
end
texture = minetest.registered_items[item].tiles[1]
end
return texture
end
@ -41,25 +44,21 @@ wieldview.update_wielded_item = function(self, player)
if not item then
return
end
if self.wielded_items[name] then
if self.wielded_items[name] == item then
if self.wielded_item[name] then
if self.wielded_item[name] == item then
return
end
uniskins:update_player_visuals(player)
armor.textures[name].wielditem = self:get_item_texture(item)
armor:update_player_visuals(player)
end
self.wielded_items[name] = item
self.wielded_item[name] = item
end
minetest.register_on_joinplayer(function(player)
local texture = uniskins:get_player_skin(name)
player:set_properties({
visual = "mesh",
mesh = "wieldview_character.x",
textures = {texture},
visual_size = {x=1, y=1},
})
local name = player:get_player_name()
wieldview.wielded_item[name] = ""
minetest.after(0, function(player)
uniskins:update_player_visuals(player)
wieldview:update_wielded_item(player)
end, player)
end)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

24
wieldview/transform.lua Normal file
View File

@ -0,0 +1,24 @@
-- Wielded Item Transformations - http://dev.minetest.net/texture
wieldview.transform = {
["default:torch"]="R270",
["default:sapling"]="R270",
["flowers:dandelion_white"]="R270",
["flowers:dandelion_yellow"]="R270",
["flowers:geranium"]="R270",
["flowers:rose"]="R270",
["flowers:tulip"]="R270",
["flowers:viola"]="R270",
["bucket:bucket_empty"]="R270",
["bucket:bucket_water"]="R270",
["bucket:bucket_lava"]="R270",
["screwdriver:screwdriver"]="R270",
["screwdriver:screwdriver1"]="R270",
["screwdriver:screwdriver2"]="R270",
["screwdriver:screwdriver3"]="R270",
["screwdriver:screwdriver4"]="R270",
["vessels:glass_bottle"]="R270",
["vessels:drinking_glass"]="R270",
["vessels:steel_bottle"]="R270",
}