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

43 Commits

Author SHA1 Message Date
cc25d6be13 Merge pull request #66 from diogo-gomes/develop
Add table of contents to README.md
2016-08-21 17:52:03 +01:00
f557c4d69e Add table of contents to README.md 2016-07-25 14:48:52 +01:00
456c84e93e Merge pull request #65 from everamzah/fixbones
Try harder to add armor to bones
2016-07-22 17:51:06 +01:00
0157ebd683 Try harder to add armor to bones
Previously, if bones were on a slab, or some non-buildable_to but walkable
node, then the armor would fail to find the bones node (which is Y+1,
typically) and the armor would disappear.  This is an attempt to address that.
2016-07-22 10:46:05 -04:00
ac414d3df3 Remove admin shield from creative inventory 2016-05-27 19:51:39 +01:00
3cf6887abd Fix undeclared global error in hazmat_suit 2016-05-18 19:42:37 +01:00
b14db3c43c Add missing placer param to locked armor stand, fixes #59 2016-05-11 22:19:13 +01:00
8f8c6c6bfa Merge pull request #56 from Thomas--S/patch-2
Fix typo
2016-05-11 19:46:48 +01:00
54ec4b3cef Fix typo 2016-05-11 19:25:59 +02:00
32e87ee543 More armor stand fixes 2016-05-04 18:27:21 +01:00
d322a0f110 Modify helmet textures, fixes #49 2016-05-01 20:25:46 +01:00
9cc2f3db02 Radiation protection support added 2016-05-01 17:09:07 +01:00
ddd7f3786c Fix disappearing armor stand entities, again... 2016-05-01 16:11:27 +01:00
5c5359de4f Restore armor stand entities when knocked-back by TNT 2016-04-27 18:48:06 +01:00
1aa2b769d7 Rebase armor player model, fixes #54 2016-04-24 21:13:45 +01:00
5421ce46da Make armor stands 'blast-proof', fixes #55 2016-04-22 18:53:25 +01:00
72cffbae17 Restore moved armor stand objects to original position when possible 2016-04-20 20:26:01 +01:00
170ee39aed Auto remove stray armor stand entities 2016-04-20 18:54:34 +01:00
59bbc55b73 Fix armor stand entity duplication bug 2016-04-16 15:36:48 +01:00
1dd904f5be Merge pull request #50 from Thomas--S/patch-1
Add a locked armor stand
2016-04-13 17:41:37 +01:00
9de8cc12bb Fix disappearing entities when placing stands next to each other 2016-04-10 22:17:45 +01:00
4e8cf05436 Add a locked armor stand
This change adds a locked armor stand, so that player can use them savely on multiplayer worlds.
2016-04-10 20:11:53 +02:00
b6a44057a6 Fix some tabulation 2016-04-09 01:19:32 +01:00
ae33659168 Make cactus leggings inventory image more consistent 2016-04-08 21:35:56 +01:00
fb29ce9150 Add a chest-like visible armor stand, closes #48 2016-04-08 20:17:28 +01:00
7408ebcd81 Add support for mod managers 2016-03-25 19:52:00 +00:00
36737441d4 Merge pull request #45 from tenplus1/patch-7
Added insta-kill ability for tools/commands
2016-02-14 19:49:09 +00:00
5a112547e6 Added insta-kill ability for tools/commands
Some armor was too powerful that killing yourself to respawn wouldn't work or instant kill tools for admin didn't have effect, so I've added a check so that if the player is dealt with more than -100 damage points it instantly kills them but doesn't damage armor.  Also added /kill command.
2016-02-08 19:05:32 +00:00
0d5cf6d58a Merge pull request #44 from proller/patch-1
Dont rewrite inventory in creative mode
2016-02-08 03:54:28 +08:00
f17a104ab1 Dont rewrite inventory in creative mode
happens on first press I if no unified inventory installed
2016-02-07 18:46:37 +03:00
f83e7e9984 Merge pull request #43 from tenplus1/patch-6
admin helmet lets you breathe underwater
2016-01-28 01:35:46 +08:00
be1d353ec0 Merge pull request #42 from tenplus1/patch-5
Add ability to breath underwater
2016-01-28 01:34:45 +08:00
241aa663f1 admin helmet lets you breathe underwater
added armor_water=1 group to admin helmet so players can breathe underwater.
2016-01-25 14:48:23 +00:00
921e1ace24 Add ability to breath underwater
Added functionality for armor to have armor_water=1 in groups so that player can breathe underwater.
2016-01-25 14:47:05 +00:00
0ec2dbfb36 Update default fire protection nodes, closes #41 2015-12-19 19:25:43 +00:00
7fc991765c Utilize player_on_hpchange callback 2015-12-09 21:03:45 +00:00
991d2955e0 Simplify previous commit 2015-12-04 20:37:24 +00:00
64ec3dcf93 Allow armor textures to be specified by the tool definition 2015-12-04 18:42:42 +00:00
e1caf0ab0c Bump version to 0.4.5 2015-11-15 22:56:53 +00:00
a44d1a2530 Add 'listring' support for inventory mods, closes #38 2015-11-15 21:50:27 +00:00
16bc6232ca Add support for unified inventory 'ui_full' privilege 2015-11-15 19:18:21 +00:00
6efe3bf116 Merge pull request #40 from CraigyDavi/prevent-admin-drops
Prevent admin armor from being dropped
2015-10-30 01:46:19 +08:00
67867e78ec Prevent admin armor from being dropped 2015-10-29 14:19:59 +00:00
69 changed files with 1146 additions and 245 deletions

View File

@ -1,13 +1,16 @@
minetest.register_alias("adminboots","3d_armor:boots_admin")
minetest.register_alias("adminhelmet","3d_armor:helmet_admin")
minetest.register_alias("adminchestplate","3d_armor:chestplate_admin")
minetest.register_alias("adminlegginss","3d_armor:leggings_admin")
minetest.register_alias("adminleggings","3d_armor:leggings_admin")
minetest.register_tool("3d_armor:helmet_admin", {
description = "Admin Helmet",
inventory_image = "3d_armor_inv_helmet_admin.png",
groups = {armor_head=1000, armor_heal=1000, armor_use=0, not_in_creative_inventory=1},
groups = {armor_head=1000, armor_heal=1000, armor_use=0, armor_water=1, not_in_creative_inventory=1},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})
minetest.register_tool("3d_armor:chestplate_admin", {
@ -15,6 +18,9 @@ minetest.register_tool("3d_armor:chestplate_admin", {
inventory_image = "3d_armor_inv_chestplate_admin.png",
groups = {armor_torso=1000, armor_heal=1000, armor_use=0, not_in_creative_inventory=1},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})
minetest.register_tool("3d_armor:leggings_admin", {
@ -22,6 +28,9 @@ minetest.register_tool("3d_armor:leggings_admin", {
inventory_image = "3d_armor_inv_leggings_admin.png",
groups = {armor_legs=1000, armor_heal=1000, armor_use=0, not_in_creative_inventory=1},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})
minetest.register_tool("3d_armor:boots_admin", {
@ -29,5 +38,8 @@ minetest.register_tool("3d_armor:boots_admin", {
inventory_image = "3d_armor_inv_boots_admin.png",
groups = {armor_feet=1000, armor_heal=1000, armor_use=0, not_in_creative_inventory=1},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})

View File

@ -18,12 +18,13 @@ ARMOR_FIRE_PROTECT = false
-- Fire protection nodes, (name, protection level, damage)
ARMOR_FIRE_NODES = {
{"default:lava_source", 5, 4},
{"default:lava_flowing", 5, 4},
{"fire:basic_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"bakedclay:safe_fire", 2, 1},
{"default:torch", 1, 1},
{"default:lava_source", 5, 4},
{"default:lava_flowing", 5, 4},
{"fire:basic_flame", 3, 4},
{"fire:permanent_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"ethereal:fire_flower", 2, 1},
{"default:torch", 1, 1},
}
-- Increase this if you get initialization glitches when a player first joins.
@ -54,3 +55,7 @@ ARMOR_LEVEL_MULTIPLIER = 1
-- eg: ARMOR_HEAL_MULTIPLIER = 0 will disable healing altogether.
ARMOR_HEAL_MULTIPLIER = 1
-- You can use this to increase or decrease overall armor radiation protection,
-- eg: ARMOR_RADIATION_MULTIPLIER = 0 will completely disable radiation protection.
-- Note: patched technic mod is required
ARMOR_RADIATION_MULTIPLIER = 1

View File

@ -6,6 +6,7 @@ ARMOR_DROP = minetest.get_modpath("bones") ~= nil
ARMOR_DESTROY = false
ARMOR_LEVEL_MULTIPLIER = 1
ARMOR_HEAL_MULTIPLIER = 1
ARMOR_RADIATION_MULTIPLIER = 1
ARMOR_MATERIALS = {
wood = "group:wood",
cactus = "default:cactus",
@ -18,11 +19,12 @@ ARMOR_MATERIALS = {
}
ARMOR_FIRE_PROTECT = minetest.get_modpath("ethereal") ~= nil
ARMOR_FIRE_NODES = {
{"default:lava_source", 5, 4},
{"default:lava_flowing", 5, 4},
{"default:lava_source", 5, 8},
{"default:lava_flowing", 5, 8},
{"fire:basic_flame", 3, 4},
{"fire:permanent_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"bakedclay:safe_fire", 2, 1},
{"ethereal:fire_flower", 2, 1},
{"default:torch", 1, 1},
}
@ -50,28 +52,19 @@ if not minetest.get_modpath("ethereal") then
ARMOR_MATERIALS.crystal = nil
end
-- override hot nodes so they do not hurt player anywhere but mod
if ARMOR_FIRE_PROTECT == true then
for _, row in ipairs(ARMOR_FIRE_NODES) do
if minetest.registered_nodes[row[1]] then
minetest.override_item(row[1], {damage_per_second = 0})
end
end
end
local time = 0
armor = {
player_hp = {},
timer = 0,
elements = {"head", "torso", "legs", "feet"},
physics = {"jump","speed","gravity"},
formspec = "size[8,8.5]image[2,0.75;2,4;armor_preview]"
.."list[current_player;main;0,4.5;8,4;]"
.."list[current_player;craft;4,1;3,3;]"
.."list[current_player;craftpreview;7,2;1,1;]",
.."list[current_player;craftpreview;7,2;1,1;]"
.."listring[current_player;main]"
.."listring[current_player;craft]",
textures = {},
default_skin = "character",
version = "0.4.4",
version = "0.4.5",
}
if minetest.get_modpath("inventory_plus") then
@ -81,6 +74,7 @@ if minetest.get_modpath("inventory_plus") then
.."label[5,1;Level: armor_level]"
.."label[5,1.5;Heal: armor_heal]"
.."label[5,2;Fire: armor_fire]"
.."label[5,2.5;Radiation: armor_radiation]"
.."list[current_player;main;0,4.5;8,4;]"
if minetest.get_modpath("crafting") then
inventory_plus.get_formspec = function(player, page)
@ -93,24 +87,19 @@ elseif minetest.get_modpath("unified_inventory") then
image = "inventory_plus_armor.png",
})
unified_inventory.register_page("armor", {
get_formspec = function(player)
get_formspec = function(player, perplayer_formspec)
local fy = perplayer_formspec.formspec_y
local name = player:get_player_name()
local formspec = "background[0.06,0.99;7.92,7.52;3d_armor_ui_form.png]"
local formspec = "background[0.06,"..fy..";7.92,7.52;3d_armor_ui_form.png]"
.."label[0,0;Armor]"
.."list[detached:"..name.."_armor;armor;0,1;2,3;]"
.."image[2.5,0.75;2,4;"..armor.textures[name].preview.."]"
.."label[5,1;Level: "..armor.def[name].level.."]"
.."label[5,1.5;Heal: "..armor.def[name].heal.."]"
.."label[5,2;Fire: "..armor.def[name].fire.."]"
if minetest.setting_getbool("unified_inventory_lite") then
formspec = "background[0.06,0.49;7.92,7.52;3d_armor_ui_form.png]"
.."label[0,0;Armor]"
.."list[detached:"..name.."_armor;armor;0,0.5;2,3;]"
.."image[2.5,0.25;2,4;"..armor.textures[name].preview.."]"
.."label[5,0.5;Level: "..armor.def[name].level.."]"
.."label[5,1;Heal: "..armor.def[name].heal.."]"
.."label[5,1.5;Fire: "..armor.def[name].fire.."]"
end
.."list[detached:"..name.."_armor;armor;0,"..fy..";2,3;]"
.."image[2.5,"..(fy - 0.25)..";2,4;"..armor.textures[name].preview.."]"
.."label[5.0,"..(fy + 0.0)..";Level: "..armor.def[name].level.."]"
.."label[5.0,"..(fy + 0.5)..";Heal: "..armor.def[name].heal.."]"
.."label[5.0,"..(fy + 1.0)..";Fire: "..armor.def[name].fire.."]"
.."label[5.0,"..(fy + 1.5)..";Radiation: "..armor.def[name].radiation.."]"
.."listring[current_player;main]"
.."listring[detached:"..name.."_armor;armor]"
return {formspec=formspec}
end,
})
@ -156,6 +145,8 @@ armor.set_player_armor = function(self, player)
local armor_level = 0
local armor_heal = 0
local armor_fire = 0
local armor_water = 0
local armor_radiation = 0
local state = 0
local items = 0
local elements = {}
@ -175,16 +166,16 @@ armor.set_player_armor = function(self, player)
if v == false then
local level = def.groups["armor_"..k]
if level then
local texture = item:gsub("%:", "_")
local texture = def.texture or item:gsub("%:", "_")
table.insert(textures, texture..".png")
preview = preview.."^"..texture.."_preview.png"
armor_level = armor_level + level
state = state + stack:get_wear()
items = items + 1
local heal = def.groups["armor_heal"] or 0
armor_heal = armor_heal + heal
local fire = def.groups["armor_fire"] or 0
armor_fire = armor_fire + fire
armor_heal = armor_heal + (def.groups["armor_heal"] or 0)
armor_fire = armor_fire + (def.groups["armor_fire"] or 0)
armor_water = armor_water + (def.groups["armor_water"] or 0)
armor_radiation = armor_radiation + (def.groups["armor_radiation"] or 0)
for kk,vv in ipairs(self.physics) do
local o_value = def.groups["physics_"..vv]
if o_value then
@ -213,6 +204,7 @@ armor.set_player_armor = function(self, player)
end
armor_level = armor_level * ARMOR_LEVEL_MULTIPLIER
armor_heal = armor_heal * ARMOR_HEAL_MULTIPLIER
armor_radiation = armor_radiation * ARMOR_RADIATION_MULTIPLIER
if #textures > 0 then
armor_texture = table.concat(textures, "^")
end
@ -220,6 +212,7 @@ armor.set_player_armor = function(self, player)
if armor_level > 0 then
armor_groups.level = math.floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
armor_groups.radiation = 100 - armor_radiation
end
player:set_armor_groups(armor_groups)
player:set_physics_override(physics_o)
@ -233,70 +226,14 @@ armor.set_player_armor = function(self, player)
self.def[name].speed = physics_o.speed
self.def[name].gravity = physics_o.gravity
self.def[name].fire = armor_fire
self.def[name].water = armor_water
self.def[name].radiation = armor_radiation
self:update_player_visuals(player)
end
armor.update_armor = function(self, player)
local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[update_armor]")
if not name then
return
end
local hp = player:get_hp() or 0
if ARMOR_FIRE_PROTECT == true then
pos.y = pos.y + 1.4 -- head level
local node_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- feet level
local node_feet = minetest.get_node(pos).name
-- is player inside a hot node?
for _, row in ipairs(ARMOR_FIRE_NODES) do
-- check for fire protection, if not enough then get hurt
if row[1] == node_head or row[1] == node_feet then
if hp > 0 and armor.def[name].fire < row[2] then
hp = hp - row[3] * ARMOR_UPDATE_TIME
player:set_hp(hp)
break
end
end
end
end
if hp <= 0 or hp == self.player_hp[name] then
return
end
if self.player_hp[name] > hp then
local heal_max = 0
local state = 0
local items = 0
for i=1, 6 do
local stack = player_inv:get_stack("armor", i)
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", i, stack)
player_inv:set_stack("armor", i, 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)
armor:update_inventory(player)
end
heal_max = heal_max + heal
end
end
self.def[name].state = state
self.def[name].count = items
heal_max = heal_max * ARMOR_HEAL_MULTIPLIER
if heal_max > math.random(100) then
player:set_hp(self.player_hp[name])
return
end
end
self.player_hp[name] = hp
-- Legacy support: Called when armor levels are changed
-- Other mods can hook on to this function, see hud mod for example
end
armor.get_player_skin = function(self, name)
@ -331,6 +268,7 @@ armor.get_armor_formspec = function(self, name)
formspec = formspec:gsub("armor_level", armor.def[name].level)
formspec = formspec:gsub("armor_heal", armor.def[name].heal)
formspec = formspec:gsub("armor_fire", armor.def[name].fire)
formspec = formspec:gsub("armor_radiation", armor.def[name].radiation)
return formspec
end
@ -346,11 +284,13 @@ armor.update_inventory = function(self, player)
else
local formspec = armor:get_armor_formspec(name)
if inv_mod == "inventory_plus" then
formspec = formspec.."listring[current_player;main]"
.."listring[detached:"..name.."_armor;armor]"
local page = player:get_inventory_formspec()
if page:find("detached:"..name.."_armor") then
inventory_plus.set_inventory_formspec(player, formspec)
end
else
elseif not core.setting_getbool("creative_mode") then
player:set_inventory_formspec(formspec)
end
end
@ -467,16 +407,6 @@ minetest.register_on_joinplayer(function(player)
local stack = player_inv:get_stack("armor", i)
armor_inv:set_stack("armor", i, stack)
end
-- Legacy support, import player's armor from old inventory format
for _,v in pairs(armor.elements) do
local list = "armor_"..v
armor_inv:add_item("armor", player_inv:get_stack(list, 1))
player_inv:set_stack(list, 1, nil)
end
-- TODO Remove this on the next version upate
armor.player_hp[name] = 0
armor.def[name] = {
state = 0,
count = 0,
@ -486,6 +416,8 @@ minetest.register_on_joinplayer(function(player)
speed = 1,
gravity = 1,
fire = 0,
water = 0,
radiation = 0,
}
armor.textures[name] = {
skin = armor.default_skin..".png",
@ -501,7 +433,7 @@ minetest.register_on_joinplayer(function(player)
elseif skin_mod == "simple_skins" then
local skin = skins.skins[name]
if skin then
armor.textures[name].skin = skin..".png"
armor.textures[name].skin = skin..".png"
end
elseif skin_mod == "u_skins" then
local skin = u_skins.u_skins[name]
@ -566,16 +498,22 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
minetest.after(ARMOR_BONES_DELAY, function()
local node = minetest.get_node(vector.round(pos))
if node then
if node.name == "bones:bones" then
local meta = minetest.get_meta(vector.round(pos))
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
for _,stack in ipairs(drop) do
if name == owner and inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
armor.drop_armor(pos, stack)
end
if node.name ~= "bones:bones" then
pos.y = pos.y+1
node = minetest.get_node(vector.round(pos))
if node.name ~= "bones:bones" then
minetest.log("warning", "Failed to add armor to bones node.")
return
end
end
local meta = minetest.get_meta(vector.round(pos))
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
for _,stack in ipairs(drop) do
if name == owner and inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
armor.drop_armor(pos, stack)
end
end
else
@ -588,13 +526,110 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
end)
end
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > ARMOR_UPDATE_TIME then
for _,player in ipairs(minetest.get_connected_players()) do
armor:update_armor(player)
minetest.register_on_player_hpchange(function(player, hp_change)
local name, player_inv, armor_inv = armor:get_valid_player(player, "[on_hpchange]")
if name and hp_change < 0 then
-- used for insta kill tools/commands like /kill (doesnt damage armor)
if hp_change < -100 then
return hp_change
end
time = 0
local heal_max = 0
local state = 0
local items = 0
for i=1, 6 do
local stack = player_inv:get_stack("armor", i)
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", i, stack)
player_inv:set_stack("armor", i, 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
armor:set_player_armor(player)
armor:update_inventory(player)
end
heal_max = heal_max + heal
end
end
armor.def[name].state = state
armor.def[name].count = items
heal_max = heal_max * ARMOR_HEAL_MULTIPLIER
if heal_max > math.random(100) then
hp_change = 0
end
armor:update_armor(player)
end
return hp_change
end, true)
-- Fire Protection and water breating, added by TenPlus1
if ARMOR_FIRE_PROTECT == true then
-- override hot nodes so they do not hurt player anywhere but mod
for _, row in pairs(ARMOR_FIRE_NODES) do
if minetest.registered_nodes[row[1]] then
minetest.override_item(row[1], {damage_per_second = 0})
end
end
else
print ("[3d_armor] Fire Nodes disabled")
end
minetest.register_globalstep(function(dtime)
armor.timer = armor.timer + dtime
if armor.timer < ARMOR_UPDATE_TIME then
return
end
for _,player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local pos = player:getpos()
local hp = player:get_hp()
-- water breathing
if name and armor.def[name].water > 0 then
if player:get_breath() < 10 then
player:set_breath(10)
end
end
-- fire protection
if ARMOR_FIRE_PROTECT == true
and name and pos and hp then
pos.y = pos.y + 1.4 -- head level
local node_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- feet level
local node_feet = minetest.get_node(pos).name
-- is player inside a hot node?
for _, row in pairs(ARMOR_FIRE_NODES) do
-- check fire protection, if not enough then get hurt
if row[1] == node_head or row[1] == node_feet then
if hp > 0 and armor.def[name].fire < row[2] then
hp = hp - row[3] * ARMOR_UPDATE_TIME
player:set_hp(hp)
break
end
end
end
end
end
armor.timer = 0
end)
-- kill player when command issued
minetest.register_chatcommand("kill", {
params = "<name>",
description = "Kills player instantly",
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
player:set_hp(-1001)
end
end,
})

1
3d_armor/description.txt Normal file
View File

@ -0,0 +1 @@
Adds craftable armor that is visible to other players.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 184 B

View File

@ -0,0 +1,7 @@
[mod] 3d Armor Stand [3d_armor_stand]
=====================================
License Source Code: LGPL v2.1
Lecense Media: CC BY-SA 3.0

21
3d_armor_stand/README.txt Normal file
View File

@ -0,0 +1,21 @@
[mod] 3d Armor Stand [3d_armor_stand]
=====================================
Depends: 3d_armor
Adds a chest-like armor stand for armor storage and display.
Crafting
--------
F = Wooden Fence [default:fence_wood]
S = Steel Ingot [default:steel_ingot]
+---+---+---+
| | F | |
+---+---+---+
| | F | |
+---+---+---+
| S | S | S |
+---+---+---+

View File

@ -0,0 +1,2 @@
3d_armor

301
3d_armor_stand/init.lua Normal file
View File

@ -0,0 +1,301 @@
local armor_stand_formspec = "size[8,7]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
default.get_hotbar_bg(0,3) ..
"list[current_name;armor_head;3,0.5;1,1;]" ..
"list[current_name;armor_torso;4,0.5;1,1;]" ..
"list[current_name;armor_legs;3,1.5;1,1;]" ..
"list[current_name;armor_feet;4,1.5;1,1;]" ..
"image[3,0.5;1,1;3d_armor_stand_head.png]" ..
"image[4,0.5;1,1;3d_armor_stand_torso.png]" ..
"image[3,1.5;1,1;3d_armor_stand_legs.png]" ..
"image[4,1.5;1,1;3d_armor_stand_feet.png]" ..
"list[current_player;main;0,3;8,1;]" ..
"list[current_player;main;0,4.25;8,3;8]"
local elements = {"head", "torso", "legs", "feet"}
local function get_stand_object(pos)
local object = nil
local objects = minetest.get_objects_inside_radius(pos, 0.5) or {}
for _, obj in pairs(objects) do
local ent = obj:get_luaentity()
if ent then
if ent.name == "3d_armor_stand:armor_entity" then
-- Remove duplicates
if object then
obj:remove()
else
object = obj
end
end
end
end
return object
end
local function update_entity(pos)
local node = minetest.get_node(pos)
local object = get_stand_object(pos)
if object then
if not string.find(node.name, "3d_armor_stand:") then
object:remove()
return
end
else
object = minetest.add_entity(pos, "3d_armor_stand:armor_entity")
end
if object then
local texture = "3d_armor_trans.png"
local textures = {}
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local yaw = 0
if inv then
for _, element in pairs(elements) do
local stack = inv:get_stack("armor_"..element, 1)
if stack:get_count() == 1 then
local item = stack:get_name() or ""
local def = stack:get_definition() or {}
local groups = def.groups or {}
if groups["armor_"..element] then
local texture = def.texture or item:gsub("%:", "_")
table.insert(textures, texture..".png")
end
end
end
end
if #textures > 0 then
texture = table.concat(textures, "^")
end
if node.param2 then
local rot = node.param2 % 4
if rot == 1 then
yaw = 3 * math.pi / 2
elseif rot == 2 then
yaw = math.pi
elseif rot == 3 then
yaw = math.pi / 2
end
end
object:setyaw(yaw)
object:set_properties({textures={texture}})
end
end
local function has_locked_armor_stand_privilege(meta, player)
local name = ""
if player then
if minetest.check_player_privs(player, "protection_bypass") then
return true
end
name = player:get_player_name()
end
if name ~= meta:get_string("owner") then
return false
end
return true
end
minetest.register_node("3d_armor_stand:armor_stand", {
description = "Armor stand",
drawtype = "mesh",
mesh = "3d_armor_stand.obj",
tiles = {"default_wood.png", "default_steel_block.png"},
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5, 0.5,1.4,0.5}
},
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", armor_stand_formspec)
meta:set_string("infotext", "Armor Stand")
local inv = meta:get_inventory()
for _, element in pairs(elements) do
inv:set_size("armor_"..element, 1)
end
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for _, element in pairs(elements) do
if not inv:is_empty("armor_"..element) then
return false
end
end
return true
end,
after_place_node = function(pos)
minetest.add_entity(pos, "3d_armor_stand:armor_entity")
end,
allow_metadata_inventory_put = function(pos, listname, index, stack)
local def = stack:get_definition() or {}
local groups = def.groups or {}
if groups[listname] then
return 1
end
return 0
end,
allow_metadata_inventory_move = function(pos)
return 0
end,
on_metadata_inventory_put = function(pos)
update_entity(pos)
end,
on_metadata_inventory_take = function(pos)
update_entity(pos)
end,
after_destruct = function(pos)
update_entity(pos)
end,
on_blast = function(pos)
local object = get_stand_object(pos)
if object then
object:remove()
end
minetest.after(1, function(pos)
update_entity(pos)
end, pos)
end,
})
minetest.register_node("3d_armor_stand:locked_armor_stand", {
description = "Locked Armor stand",
drawtype = "mesh",
mesh = "3d_armor_stand.obj",
tiles = {"default_wood.png", "default_steel_block.png"},
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5, 0.5,1.4,0.5}
},
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", armor_stand_formspec)
meta:set_string("infotext", "Armor Stand")
meta:set_string("owner", "")
local inv = meta:get_inventory()
for _, element in pairs(elements) do
inv:set_size("armor_"..element, 1)
end
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for _, element in pairs(elements) do
if not inv:is_empty("armor_"..element) then
return false
end
end
return true
end,
after_place_node = function(pos, placer)
minetest.add_entity(pos, "3d_armor_stand:armor_entity")
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Armor Stand (owned by " ..
meta:get_string("owner") .. ")")
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_locked_armor_stand_privilege(meta, player) then
return 0
end
local def = stack:get_definition() or {}
local groups = def.groups or {}
if groups[listname] then
return 1
end
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_locked_armor_stand_privilege(meta, player) then
return 0
end
return stack:get_count()
end,
allow_metadata_inventory_move = function(pos)
return 0
end,
on_metadata_inventory_put = function(pos)
update_entity(pos)
end,
on_metadata_inventory_take = function(pos)
update_entity(pos)
end,
after_destruct = function(pos)
update_entity(pos)
end,
on_blast = function(pos)
local object = get_stand_object(pos)
if object then
object:remove()
end
minetest.after(1, function(pos)
update_entity(pos)
end, pos)
end,
})
minetest.register_entity("3d_armor_stand:armor_entity", {
physical = true,
visual = "mesh",
mesh = "3d_armor_entity.obj",
visual_size = {x=1, y=1},
collisionbox = {-0.1,-0.4,-0.1, 0.1,1.3,0.1},
textures = {"3d_armor_trans.png"},
pos = nil,
timer = 0,
on_activate = function(self)
local pos = self.object:getpos()
if pos then
self.pos = vector.round(pos)
update_entity(pos)
end
end,
on_step = function(self, dtime)
if not self.pos then
return
end
self.timer = self.timer + dtime
if self.timer > 1 then
self.timer = 0
local pos = self.object:getpos()
if pos then
if vector.equals(vector.round(pos), self.pos) then
return
end
end
update_entity(self.pos)
self.object:remove()
end
end,
})
minetest.register_craft({
output = "3d_armor_stand:armor_stand",
recipe = {
{"", "default:fence_wood", ""},
{"", "default:fence_wood", ""},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
}
})
minetest.register_craft({
output = "3d_armor_stand:locked_armor_stand",
recipe = {
{"3d_armor_stand:armor_stand", "default:steel_ingot"},
}
})

View File

@ -0,0 +1,193 @@
# Blender v2.73 (sub 0) OBJ File: '3d_armor_entity_3.blend'
# www.blender.org
mtllib 3d_armor_entity.mtl
o Player_Cube
v 2.200000 9.763893 1.200000
v 2.200000 9.763893 -1.200000
v 2.200000 2.663871 1.200000
v 2.200000 2.663871 -1.200000
v -2.200000 9.763893 -1.200000
v -2.200000 9.763893 1.200000
v -2.200000 2.663871 -1.200000
v -2.200000 2.663871 1.200000
v 2.300000 13.863962 2.300000
v 2.300000 13.863962 -2.300000
v 2.300000 9.263885 2.300000
v 2.300000 9.263885 -2.300000
v -2.300000 13.863962 -2.300000
v -2.300000 13.863962 2.300000
v -2.300000 9.263885 -2.300000
v -2.300000 9.263885 2.300000
v -2.322686 2.473175 -1.300000
v -2.322686 2.473175 1.300000
v -4.713554 2.682348 1.300000
v -4.713554 2.682348 -1.300000
v -1.686446 9.745432 -1.300000
v -1.686446 9.745432 1.300000
v -4.077313 9.954605 1.300000
v -4.077313 9.954605 -1.300000
v 4.077313 9.954605 -1.300000
v 4.077313 9.954605 1.300000
v 1.686446 9.745432 1.300000
v 1.686446 9.745432 -1.300000
v 4.713554 2.682348 -1.300000
v 4.713554 2.682348 1.300000
v 2.322686 2.473175 1.300000
v 2.322686 2.473175 -1.300000
v 0.139099 2.938947 -1.200000
v 0.139099 2.938947 1.200000
v 0.261266 -4.059988 1.200000
v 0.261266 -4.059988 -1.200000
v 2.660901 -4.018101 1.190000
v 2.660901 -4.018101 -1.210000
v 2.538733 2.980834 1.190000
v 2.538733 2.980834 -1.210000
v -0.139099 2.938947 -1.200000
v -0.139099 2.938947 1.200000
v -0.261266 -4.059988 1.200000
v -0.261266 -4.059988 -1.200000
v -2.538734 2.980834 -1.210000
v -2.538734 2.980834 1.190000
v -2.660901 -4.018101 -1.210000
v -2.660901 -4.018101 1.190000
v -2.799999 -4.387500 1.390000
v -2.799999 -4.387500 -1.410000
v -2.800000 -0.812499 1.390000
v -2.800000 -0.812499 -1.410000
v -0.000000 -4.387500 -1.400000
v -0.000000 -4.387500 1.400000
v -0.000000 -0.812499 1.400000
v -0.000000 -0.812499 -1.400000
v 2.800000 -0.812499 -1.410000
v 2.800000 -0.812499 1.390000
v 2.799999 -4.387500 -1.410000
v 2.799999 -4.387500 1.390000
v 0.000000 -4.387500 -1.400000
v 0.000000 -4.387500 1.400000
v 0.000000 -0.812499 1.400000
v 0.000000 -0.812499 -1.400000
v 2.267006 13.830965 2.267006
v 2.267006 13.830965 -2.267006
v 2.267006 9.296881 2.267006
v 2.267006 9.296881 -2.267006
v -2.267006 13.830965 -2.267006
v -2.267006 13.830965 2.267006
v -2.267006 9.296881 -2.267006
v -2.267006 9.296881 2.267006
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.312500 0.000000
vt 0.312500 0.375000
vt 0.437500 0.375000
vt 0.437500 0.500000
vt 0.312500 0.500000
vt 0.562500 0.375000
vt 0.562500 0.500000
vt 0.437500 0.000000
vt 0.500000 0.000000
vt 0.500000 0.375000
vt 0.625000 0.000000
vt 0.625000 0.375000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 0.625000 0.500000
vt 0.625000 0.750000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 0.500000
vt 0.875000 0.500000
vt 1.000000 0.750000
vt 1.000000 0.500000
vt 0.750000 0.375000
vt 0.812500 0.500000
vt 0.812500 0.375000
vt 0.687500 0.375000
vt 0.687500 0.500000
vt 0.687500 0.000000
vt 0.750000 0.000000
vt 0.812500 0.000000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 0.125000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.500000
vt 0.125000 0.500000
vt 0.187500 0.375000
vt 0.187500 0.500000
vt 0.000000 0.375000
vt 0.000000 0.000000
vt 0.062500 0.000000
vt 0.187500 0.000000
vt 0.125000 0.000000
vt 0.437500 0.875000
vt 0.437500 1.000000
vt 0.375000 1.000000
vt 0.375000 0.875000
vt 0.250000 0.875000
vt 0.312500 0.875000
vt 0.312500 0.656250
vt 0.250000 0.656250
vt 0.500000 0.875000
vt 0.437500 0.656250
vt 0.500000 0.656250
vt 0.375000 0.656250
vt 0.312500 1.000000
usemtl Armor
s off
f 1/1 3/2 4/3 2/4
f 5/5 6/6 1/7 2/4
f 8/6 7/5 4/8 3/9
f 5/5 2/4 4/3 7/10
f 7/10 8/11 6/12 5/5
f 8/11 3/13 1/14 6/12
f 9/15 11/16 12/17 10/18
f 13/19 14/20 9/21 10/18
f 12/22 11/23 16/20 15/19
f 13/19 10/18 12/17 15/24
f 14/22 13/19 15/24 16/25
f 9/26 14/22 16/25 11/27
f 17/28 18/24 19/29 20/30
f 24/31 23/32 22/24 21/28
f 23/31 24/14 20/13 19/33
f 24/31 21/28 17/34 20/33
f 21/28 22/30 18/35 17/34
f 22/30 23/36 19/37 18/35
f 27/30 31/35 30/37 26/36
f 28/28 32/34 31/35 27/30
f 25/31 29/33 32/34 28/28
f 26/31 30/33 29/13 25/14
f 25/31 28/28 27/24 26/32
f 32/28 29/30 30/29 31/24
f 40/38 33/39 34/40 39/41
f 36/42 38/38 37/41 35/43
f 39/44 37/45 38/46 40/39
f 34/1 35/2 37/47 39/42
f 40/38 38/48 36/46 33/39
f 33/42 36/47 35/48 34/38
f 45/38 46/41 42/40 41/39
f 41/42 42/38 43/48 44/47
f 45/38 41/39 44/46 47/48
f 42/1 46/42 48/47 43/2
f 46/44 45/39 47/46 48/45
f 44/42 43/43 48/41 47/38
f 53/49 54/50 49/51 50/52
f 51/53 52/54 50/55 49/56
f 55/57 51/49 49/58 54/59
f 52/52 56/54 53/55 50/60
f 56/49 55/52 54/60 53/58
f 52/52 51/51 55/61 56/54
f 64/49 61/58 62/60 63/52
f 57/52 59/60 61/55 64/54
f 63/57 62/59 60/58 58/49
f 58/53 60/56 59/55 57/54
f 61/49 59/52 60/51 62/50
f 57/52 64/54 63/61 58/51
f 65/15 66/18 68/17 67/16
f 69/19 66/18 65/21 70/20
f 68/22 71/19 72/20 67/23
f 69/19 71/24 68/17 66/18
f 70/22 72/25 71/24 69/19
f 65/26 67/27 72/25 70/22

View File

@ -0,0 +1,191 @@
# Blender v2.73 (sub 0) OBJ File: '3d_armor_stand.blend'
# www.blender.org
mtllib 3d_armor_stand.mtl
o Player_Cube
v 0.062500 1.312500 -0.062500
v 0.062500 1.312500 0.062500
v -0.062500 1.312500 -0.062500
v -0.062500 1.312500 0.062500
v -0.187500 -0.437504 0.062500
v -0.187500 -0.437504 -0.062500
v -0.187500 0.937500 0.062500
v -0.187500 0.937500 -0.062500
v -0.250000 0.250000 0.062500
v -0.250000 0.250000 -0.062500
v -0.250000 0.125003 0.062500
v -0.250000 0.125003 -0.062500
v 0.250000 0.250000 0.062500
v 0.250000 0.250000 -0.062500
v 0.250000 0.125003 0.062500
v 0.250000 0.125003 -0.062500
v -0.062500 -0.437504 -0.062500
v -0.062500 -0.437504 0.062500
v -0.062500 0.937500 0.062500
v -0.062500 0.937500 -0.062500
v 0.062500 0.250000 0.062500
v 0.062500 0.250000 -0.062500
v 0.187500 0.250000 -0.062500
v 0.187500 0.250000 0.062500
v 0.187500 0.937500 -0.062500
v 0.187500 0.937500 0.062500
v 0.187500 -0.437504 -0.062500
v 0.187500 -0.437504 0.062500
v 0.062500 -0.437504 -0.062500
v 0.062500 -0.437504 0.062500
v 0.062500 0.937500 0.062500
v 0.062500 0.937500 -0.062500
v -0.062500 0.812500 -0.062500
v -0.187500 0.812500 -0.062500
v -0.062500 0.812500 0.062500
v -0.187500 0.812500 0.062500
v 0.062500 0.812500 -0.062500
v 0.187500 0.812500 -0.062500
v 0.187500 0.812500 0.062500
v 0.062500 0.812500 0.062500
v 0.375000 0.812500 0.062500
v 0.375000 0.812500 -0.062500
v 0.375000 0.937500 0.062500
v 0.375000 0.937500 -0.062500
v 0.500000 -0.437500 -0.500000
v 0.500000 -0.437500 0.500000
v -0.500000 -0.437500 -0.500000
v -0.500000 -0.437500 0.500000
v -0.062500 0.250000 -0.062500
v -0.187500 0.250000 -0.062500
v -0.062500 0.250000 0.062500
v -0.187500 0.250000 0.062500
v -0.375000 0.937500 0.062500
v -0.375000 0.937500 -0.062500
v -0.375000 0.812500 -0.062500
v -0.375000 0.812500 0.062500
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 0.500000
v 0.187500 0.124998 0.062500
v 0.187500 0.124998 -0.062500
v 0.062500 0.124998 0.062500
v 0.062500 0.124998 -0.062500
v -0.062500 0.124998 -0.062500
v -0.187500 0.124998 -0.062500
v -0.062500 0.124998 0.062500
v -0.187500 0.124998 0.062500
vt 0.000000 0.000000
vt 0.875000 0.000000
vt 0.875000 0.250000
vt 0.000000 0.250000
vt 0.125000 0.500000
vt 0.125000 0.750000
vt -0.000000 0.750000
vt -0.000000 0.500000
vt 0.750000 0.000000
vt 1.000000 0.000000
vt 1.000000 0.250000
vt 0.750000 0.250000
vt 0.375000 0.500000
vt 0.375000 0.750000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.000000 1.000000
vt 0.875000 0.500000
vt 0.750000 0.500000
vt 1.000000 0.500000
vt 1.000000 0.750000
vt 0.750000 0.750000
vt 0.625000 1.000000
vt 0.375000 1.000000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.250000 0.500000
vt 0.250000 0.750000
vt 0.625000 0.250000
vt 0.625000 -0.000000
vt 0.250000 0.250000
vt 0.250000 0.000000
vt 0.375000 0.250000
vt 0.250000 1.000000
vt 1.000000 1.000000
vt 0.750000 1.000000
vt 0.375000 -0.000000
vt 0.125000 0.250000
vt 0.125000 1.000000
vt 0.125000 0.000000
vt -0.000000 0.937500
vt 1.000000 0.937500
vt 0.937500 0.000000
vt 0.937500 1.000000
vt 1.000000 0.062500
vt 0.000000 0.062500
vt 0.062500 0.000000
vt 0.062500 1.000000
g Player_Cube_Stand
usemtl Stand
s off
f 64/1 29/2 30/3 63/4
f 52/5 50/6 10/7 9/8
f 17/9 18/10 5/11 6/12
f 68/3 66/2 6/1 5/4
f 7/13 8/14 54/7 53/8
f 67/15 68/16 5/17 18/7
f 62/4 27/3 29/18 64/8
f 66/3 65/18 17/8 6/4
f 9/19 10/20 12/21 11/22
f 63/7 30/15 28/16 61/17
f 65/18 67/15 18/7 17/8
f 61/8 28/18 27/15 62/7
f 19/23 7/24 36/14 35/25
f 8/14 7/13 19/26 20/25
f 23/15 24/18 13/20 14/21
f 13/8 15/27 16/28 14/7
f 39/29 38/30 42/10 41/11
f 29/31 27/4 28/1 30/32
f 25/28 26/27 43/26 44/25
f 38/12 25/19 44/13 42/33
f 25/28 32/7 31/8 26/27
f 8/26 20/13 33/33 34/29
f 25/19 38/12 37/11 32/20
f 31/17 40/7 39/28 26/34
f 26/34 39/28 41/25 43/23
f 43/7 41/28 42/34 44/17
f 53/22 54/21 55/35 56/36
f 36/14 7/24 53/17 56/7
f 8/26 34/29 55/11 54/20
f 34/37 36/33 56/4 55/1
f 51/13 21/26 22/25 49/14
f 20/4 3/12 1/19 32/8
f 40/15 31/16 19/23 35/25
f 35/29 33/30 37/2 40/3
f 33/33 20/13 32/5 37/38
f 3/14 4/24 2/23 1/25
f 19/12 4/4 3/1 20/9
f 31/36 2/17 4/7 19/22
f 32/22 1/7 2/8 31/19
f 23/5 62/38 64/33 22/13
f 21/14 63/24 61/39 24/6
f 61/3 62/2 16/10 15/11
f 62/38 23/5 14/8 16/4
f 24/6 61/39 15/17 13/7
f 50/18 66/3 12/11 10/20
f 66/40 68/38 11/4 12/1
f 50/18 49/26 65/29 66/3
f 51/25 52/15 68/16 67/23
f 68/16 52/15 9/21 11/35
f 49/26 22/13 64/33 65/29
f 51/25 67/23 63/24 21/14
f 67/33 65/37 64/30 63/29
f 37/1 22/2 21/3 40/4
f 38/4 23/3 22/18 37/8
f 40/7 21/15 24/16 39/17
f 39/8 24/18 23/15 38/7
f 36/2 34/3 50/4 52/1
f 35/15 36/16 52/17 51/7
f 34/3 33/18 49/8 50/4
f 33/18 35/15 51/7 49/8
g Player_Cube_Base
usemtl Base
f 47/17 48/1 46/10 45/35
f 59/1 57/10 58/35 60/17
f 48/17 60/41 58/42 46/35
f 46/43 58/10 57/35 45/44
f 47/1 45/10 57/45 59/46
f 48/47 47/48 59/17 60/1

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

View File

@ -1,15 +1,34 @@
Modpack - 3d Armor [0.4.4]
Modpack - 3d Armor [0.4.5]
==========================
### Table of Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
- [[mod] Visible Player Armor [3d_armor]](#mod-visible-player-armor-3d_armor)
- [[mod] Visible Wielded Items [wieldview]](#mod-visible-wielded-items-wieldview)
- [[mod] Shields [shields]](#mod-shields-shields)
- [[mod] Technic Armor [technic_armor]](#mod-technic-armor-technic_armor)
- [[mod] Hazmat Suit [hazmat_suit]](#mod-hazmat-suit-hazmat_suit)
- [[mod] 3d Armor Stand [3d_armor_stand]](#mod-3d-armor-stand-3d_armor_stand)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
[mod] Visible Player Armor [3d_armor]
-------------------------------------
depends: default
Minetest Version: 0.4.13
recommends: inventory_plus or unified_inventory (use only one)
Game: minetest_game and many derivatives
Depends: default
Recommends: inventory_plus or unified_inventory (use only one)
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.
a player's armor group level making them less vulnerable to attack.
Armor takes damage when a player is hurt, however, many armor items offer a 'stackable'
percentage chance of restoring the lost health points. Overall armor level is boosted by 10%
@ -28,14 +47,14 @@ see armor.conf.example for all available options.
[mod] Visible Wielded Items [wieldview]
---------------------------------------
depends: 3d_armor
Depends: 3d_armor
Makes hand wielded items visible to other players.
[mod] Shields [shields]
-----------------------
depends: 3d_armor
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.
@ -43,8 +62,22 @@ If you do not want shields then simply remove the shields folder from the modpac
[mod] Technic Armor [technic_armor]
-----------------------------------
depends: 3d_armor
Depends: 3d_armor, technic_worldgen
Adds tin, silver and technic materials to 3d_armor.
Requires technic mod to be installed for craft registration.
Requires technic (technic_worldgen at least) mod.
[mod] Hazmat Suit [hazmat_suit]
-------------------------------
Depends: 3d_armor, technic
Adds hazmat suit to 3d_armor. It protects rather well from fire (if enabled in configuration) and radiation, and it has built-in oxygen supply.
Requires technic mod.
[mod] 3d Armor Stand [3d_armor_stand]
-------------------------------------
Depends: 3d_armor
Adds a chest-like armor stand for armor storage and display.

1
description.txt Normal file
View File

@ -0,0 +1 @@
Visible player armor & wielded items.

10
hazmat_suit/README.txt Normal file
View File

@ -0,0 +1,10 @@
[mod] Hazmat Suit [hazmat_suit]
===================================
Adds hazmat suit to 3d_armor. It protects rather well from fire (if enabled in configuration) and radiation, and it has built-in oxygen supply.
Requires technic mod.
Depends: 3d_armor, technic
Source code by numZero
Textures by HybridDog and numZero

2
hazmat_suit/depends.txt Normal file
View File

@ -0,0 +1,2 @@
3d_armor
technic

View File

@ -0,0 +1 @@
Adds hazmat suit (protects from water, fire and radiation) to 3d_armor.

126
hazmat_suit/init.lua Normal file
View File

@ -0,0 +1,126 @@
local part_count = 4
local level = 35
local heal = 20
local use = 1000
local fire = 4
local water = 1
local radiation = 50
if minetest.get_modpath("shields") then
level = level / 0.9
end
if part_count == #armor.elements then
level = level / 1.1
end
level = math.floor(level / part_count)
heal = math.floor(heal / part_count)
fire = math.floor(fire / part_count)
radiation = math.floor(radiation / part_count)
minetest.register_craftitem("hazmat_suit:helmet_hazmat", {
description = "Hazmat Helmet",
inventory_image = "hazmat_suit_inv_helmet_hazmat.png",
stack_max = 1,
})
minetest.register_craftitem("hazmat_suit:chestplate_hazmat", {
description = "Hazmat Chestplate",
inventory_image = "hazmat_suit_inv_chestplate_hazmat.png",
stack_max = 1,
})
minetest.register_craftitem("hazmat_suit:sleeve_hazmat", {
description = "Hazmat Sleeve",
inventory_image = "hazmat_suit_inv_sleeve_hazmat.png",
stack_max = 1,
})
minetest.register_craftitem("hazmat_suit:leggings_hazmat", {
description = "Hazmat Leggins",
inventory_image = "hazmat_suit_inv_leggings_hazmat.png",
stack_max = 1,
})
minetest.register_craftitem("hazmat_suit:boots_hazmat", {
description = "Hazmat Boots",
inventory_image = "hazmat_suit_inv_boots_hazmat.png",
stack_max = 1,
})
minetest.register_tool("hazmat_suit:suit_hazmat", {
description = "Hazmat Suit",
inventory_image = "hazmat_suit_inv_suit_hazmat.png",
groups = {
armor_head = level,
armor_torso = level,
armor_legs = level,
armor_feet = level,
armor_heal = heal,
armor_use = use,
armor_fire = fire,
armor_water = water,
armor_radiation = radiation,
},
wear = 0,
})
minetest.register_craft({
output = "hazmat_suit:helmet_hazmat",
recipe = {
{"", "technic:stainless_steel_ingot", ""},
{"technic:stainless_steel_ingot", "default:glass", "technic:stainless_steel_ingot"},
{"technic:rubber", "technic:rubber", "technic:rubber"},
},
})
minetest.register_craft({
output = "hazmat_suit:chestplate_hazmat",
recipe = {
{"technic:lead_ingot", "dye:yellow", "technic:lead_ingot"},
{"technic:stainless_steel_ingot", "technic:lead_ingot", "technic:stainless_steel_ingot"},
{"technic:lead_ingot", "technic:stainless_steel_ingot", "technic:lead_ingot"},
},
})
minetest.register_craft({
output = "hazmat_suit:sleeve_hazmat",
recipe = {
{"technic:rubber", "dye:yellow"},
{"", "technic:stainless_steel_ingot"},
{"", "technic:rubber"},
},
})
minetest.register_craft({
output = "hazmat_suit:leggings_hazmat",
recipe = {
{"technic:rubber", "technic:lead_ingot", "technic:rubber"},
{"technic:stainless_steel_ingot", "technic:rubber", "technic:stainless_steel_ingot"},
{"technic:lead_ingot", "", "technic:lead_ingot"},
},
})
minetest.register_craft({
output = "hazmat_suit:boots_hazmat",
recipe = {
{"", "", ""},
{"technic:rubber", "", "technic:rubber"},
{"technic:stainless_steel_ingot", "", "technic:stainless_steel_ingot"},
},
})
minetest.register_craft({
output = "hazmat_suit:suit_hazmat",
type = "shapeless",
recipe = {
"hazmat_suit:helmet_hazmat",
"hazmat_suit:chestplate_hazmat",
"hazmat_suit:leggings_hazmat",
"hazmat_suit:boots_hazmat",
"hazmat_suit:sleeve_hazmat",
"hazmat_suit:sleeve_hazmat",
},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

1
shields/description.txt Normal file
View File

@ -0,0 +1 @@
Adds visible shields to 3d armor.

View File

@ -5,7 +5,7 @@ local use_moreores = minetest.get_modpath("moreores")
minetest.register_tool("shields:shield_admin", {
description = "Admin Shield",
inventory_image = "shields_inv_shield_admin.png",
groups = {armor_shield=1000, armor_heal=100, armor_use=0},
groups = {armor_shield=1000, armor_heal=100, armor_use=0, not_in_creative_inventory=1},
wear = 0,
})

View File

@ -2,8 +2,8 @@
===================================
Adds tin, silver and technic materials to 3d_armor.
Requires technic mod to be installed for craft registration.
Requires technic (technic_worldgen at least) mod.
Depends: 3d_armor
Depends: 3d_armor, technic_worldgen
Source code and textures by poet.nohit
Source code and textures by poet.nohit and numzero

View File

@ -1 +1,3 @@
3d_armor
technic_worldgen
moreores?

View File

@ -0,0 +1 @@
Adds tin, silver and technic materials to 3d_armor.

View File

@ -1,101 +1,56 @@
if minetest.get_modpath("technic") then
local stats = {
brass = { name="Brass", armor=1.8, heal=0, use=650 },
cast = { name="Cast Iron", armor=2.5, heal=8, use=200 },
carbon = { name="Carbon Steel", armor=2.7, heal=10, use=100 },
stainless = { name="Stainless Steel", armor=2.7, heal=10, use=75 },
}
local mats = {
brass="technic:brass_ingot",
cast="technic:cast_iron_ingot",
carbon="technic:carbon_steel_ingot",
stainless="technic:stainless_steel_ingot",
}
if minetest.get_modpath("moreores") then
stats.tin = { name="Tin", armor=1.6, heal=0, use=750 }
stats.silver = { name="Silver", armor=1.8, heal=6, use=650 }
mats.tin = "moreores:tin_ingot"
mats.silver = "moreores:silver_ingot"
end
for k, v in pairs(stats) do
minetest.register_tool("technic_armor:helmet_"..k, {
description = v.name.." Helmet",
inventory_image = "technic_armor_inv_helmet_"..k..".png",
groups = {armor_head=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
minetest.register_tool("technic_armor:chestplate_"..k, {
description = v.name.." Chestplate",
inventory_image = "technic_armor_inv_chestplate_"..k..".png",
groups = {armor_torso=math.floor(8*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
minetest.register_tool("technic_armor:leggings_"..k, {
description = v.name.." Leggings",
inventory_image = "technic_armor_inv_leggings_"..k..".png",
groups = {armor_legs=math.floor(7*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
minetest.register_tool("technic_armor:boots_"..k, {
description = v.name.." Boots",
inventory_image = "technic_armor_inv_boots_"..k..".png",
groups = {armor_feet=math.floor(4*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
end
for k, v in pairs(mats) do
minetest.register_craft({
output = "technic_armor:helmet_"..k,
recipe = {
{v, v, v},
{v, "", v},
{"", "", ""},
},
})
minetest.register_craft({
output = "technic_armor:chestplate_"..k,
recipe = {
{v, "", v},
{v, v, v},
{v, v, v},
},
})
minetest.register_craft({
output = "technic_armor:leggings_"..k,
recipe = {
{v, v, v},
{v, "", v},
{v, "", v},
},
})
minetest.register_craft({
output = "technic_armor:boots_"..k,
recipe = {
{v, "", v},
{v, "", v},
},
})
end
if minetest.get_modpath("shields") then
for k, v in pairs(stats) do
minetest.register_tool("technic_armor:shield_"..k, {
description = v.name.." Shield",
inventory_image = "technic_armor_inv_shield_"..k..".png",
groups = {armor_shield=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
local m = mats[k]
minetest.register_craft({
output = "technic_armor:shield_"..k,
recipe = {
{m, m, m},
{m, m, m},
{"", m, ""},
},
})
end
end
local stats = {
lead = { name="Lead", material="technic:lead_ingot", armor=1.6, heal=0, use=500, radiation=80*1.1 },
brass = { name="Brass", material="technic:brass_ingot", armor=1.8, heal=0, use=650, radiation=43 },
cast = { name="Cast Iron", material="technic:cast_iron_ingot", armor=2.5, heal=8, use=200, radiation=40 },
carbon = { name="Carbon Steel", material="technic:carbon_steel_ingot", armor=2.7, heal=10, use=100, radiation=40 },
stainless = { name="Stainless Steel", material="technic:stainless_steel_ingot", armor=2.7, heal=10, use=75, radiation=40 },
}
if minetest.get_modpath("moreores") then
stats.tin = { name="Tin", material="moreores:tin_ingot", armor=1.6, heal=0, use=750, radiation=37 }
stats.silver = { name="Silver", material="moreores:silver_ingot", armor=1.8, heal=6, use=650, radiation=53 }
end
local parts = {
helmet = { place="head", name="Helmet", level=5, radlevel = 0.10, craft={{1,1,1},{1,0,1}} },
chestplate = { place="torso", name="Chestplate", level=8, radlevel = 0.35, craft={{1,0,1},{1,1,1},{1,1,1}} },
leggings = { place="legs", name="Leggings", level=7, radlevel = 0.15, craft={{1,1,1},{1,0,1},{1,0,1}} },
boots = { place="feet", name="Boots", level=4, radlevel = 0.10, craft={{1,0,1},{1,0,1}} },
}
if minetest.get_modpath("shields") then
parts.shield = { place="shield", name="Shield", level=5, radlevel=0.00, craft={{1,1,1},{1,1,1},{0,1,0}} }
end
-- Makes a craft recipe based on a template
-- template is a recipe-like table but indices are used instead of actual item names:
-- 0 means nothing, everything else is treated as an index in the materials table
local function make_recipe(template, materials)
local recipe = {}
for j, trow in ipairs(template) do
local rrow = {}
for i, tcell in ipairs(trow) do
if tcell == 0 then
rrow[i] = ""
else
rrow[i] = materials[tcell]
end
end
recipe[j] = rrow
end
return recipe
end
for key, armor in pairs(stats) do
for partkey, part in pairs(parts) do
local partname = "technic_armor:"..partkey.."_"..key
minetest.register_tool(partname, {
description = armor.name.." "..part.name,
inventory_image = "technic_armor_inv_"..partkey.."_"..key..".png",
groups = {["armor_"..part.place]=math.floor(part.level*armor.armor), armor_heal=armor.heal, armor_use=armor.use, armor_radiation=math.floor(part.radlevel*armor.radiation)},
wear = 0,
})
minetest.register_craft({
output = partname,
recipe = make_recipe(part.craft, {armor.material}),
})
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 B

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
Makes hand wielded items visible to other players.