Add shields back as a separate mod

This commit is contained in:
stujones11 2013-06-24 19:06:19 +01:00
parent 0edd6ac9e0
commit 61e6052019
20 changed files with 902 additions and 756 deletions

@ -7,6 +7,13 @@ 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;]",
}
armor.set_player_armor = function(self, player)
@ -18,7 +25,7 @@ armor.set_player_armor = function(self, player)
local armor_texture = uniskins.default_texture
local armor_level = 0
local textures = {}
for _,v in ipairs({"head", "torso", "legs", "feet"}) do
for _,v in ipairs(self.elements) do
local stack = player_inv:get_stack("armor_"..v, 1)
local level = stack:get_definition().groups["armor_"..v]
if level then
@ -56,7 +63,7 @@ armor.update_armor = function(self, player)
return
end
local heal_max = 0
for _,v in ipairs({"head", "torso", "legs", "feet"}) do
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
@ -87,14 +94,9 @@ end
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
local formspec = armor.formspec:gsub("player_name", name)
if fields.armor then
inventory_plus.set_inventory_formspec(player, "size[8,8.5]"
.."button[0,0;2,0.5;main;Back]"
.."list[current_player;main;0,4.5;8,4;]"
.."list[detached:"..name.."_armor;armor_head;3,0;1,1;]"
.."list[detached:"..name.."_armor;armor_torso;3,1;1,1;]"
.."list[detached:"..name.."_armor;armor_legs;3,2;1,1;]"
.."list[detached:"..name.."_armor;armor_feet;3,3;1,1;]")
inventory_plus.set_inventory_formspec(player, formspec)
return
end
for field, _ in pairs(fields) do
@ -133,7 +135,7 @@ minetest.register_on_joinplayer(function(player)
return 0
end,
})
for _,v in ipairs({"head", "torso", "legs", "feet"}) do
for _,v in ipairs(armor.elements) do
local list = "armor_"..v
player_inv:set_size(list, 1)
armor_inv:set_size(list, 1)

@ -14,6 +14,7 @@ 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]
Chestplates:
@ -28,6 +29,7 @@ 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]
Leggings:
@ -42,6 +44,7 @@ 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]
Boots:
@ -54,5 +57,5 @@ Boots:
[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]

@ -4,16 +4,18 @@ Modpack - 3d Armor
[mod] Unified Skins [unified_skins]
-----------------------------------
depends: default
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.
Note: Currently only supports 64x32px player skins.
[mod] Visible Wielded Items [wieldview]
---------------------------------------
depends: default, unified_skins
depends: unified_skins
Makes hand wielded items visible to other players.
@ -22,7 +24,7 @@ Note: Currently only supports 16x16px texture packs, sorry!
[mod] Visible Player Armor [3d_armor]
-------------------------------------
depends: default, unified_skins, inventory_plus
depends: unified_skins, 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.
@ -30,3 +32,10 @@ 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.
[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 what shields then simply remove the shields folder from the modpack.

6
shields/README.txt Normal 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.

@ -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]

3
shields/depends.txt Normal file

@ -0,0 +1,3 @@
default
inventory_plus
3d_armor

60
shields/init.lua Normal file

@ -0,0 +1,60 @@
-- 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,
})
local craft_ingreds = {
wood = "default:wood",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
}
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

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: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

@ -4,7 +4,7 @@ uniskins = {
armor = {},
wielditem = {},
default_skin = "character.png",
default_texture = nil
default_texture = nil,
}
uniskins.update_player_visuals = function(self, player)
@ -14,13 +14,13 @@ uniskins.update_player_visuals = function(self, player)
local name = player:get_player_name()
local texture = "uniskins_trans.png"
if self.wielditem[name] then
texture = texture.."^[combine:64x64:0,0="..self.wielditem[name]
texture = texture.."^[combine:64x80:48,64="..self.wielditem[name]
end
if self.skin[name] then
texture = texture.."^[combine:64x64:0,32="..self.skin[name]
texture = texture.."^[combine:64x80:0,32="..self.skin[name]
end
if self.armor[name] then
texture = texture.."^[combine:64x64:0,0="..self.armor[name]
texture = texture.."^[combine:64x80:0,0="..self.armor[name]
end
player:set_properties({
visual = "mesh",

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 171 B