1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2024-12-27 11:10:39 +01:00

Split into modpack and fixed armor inventory bug.

This commit is contained in:
stujones11 2013-03-26 20:54:01 +00:00
parent af82ab3233
commit 234d964549
27 changed files with 398 additions and 0 deletions

8
3d_armor/README.txt Normal file
View File

@ -0,0 +1,8 @@
[mod] Visible Player Armor [3d_armor]
=====================================
depends: default, inventory_plus, wieldview
Adds craftable armor that is visible to other players. Armor takes damage when a player is hurt
but also offers a percentage chance of healing.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

6
more_armor/README.txt Normal file
View File

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

View File

@ -0,0 +1,89 @@
3D Armor -- Moreores Armor
--------------------------
Crafting Guide
--------------
B = Bronze Ingot [moreores:bronze_ingot], M = Mithril Ingot [moreores:mithril_ingot]
Bronze Helmet [more_armor:helmet_bronze]
+---+---+---+
| B | B | B |
+---+---+---+
| B | | B |
+---+---+---+
| | | |
+---+---+---+
Bronze Chestplate [more_armor:chestplate_bronze]
+---+---+---+
| B | | B |
+---+---+---+
| B | B | B |
+---+---+---+
| B | B | B |
+---+---+---+
Bronze Leggings [more_armor:leggings_bronze]
+---+---+---+
| B | B | B |
+---+---+---+
| B | | B |
+---+---+---+
| B | | B |
+---+---+---+
Bronze Shield [more_armor:shield_bronze]
+---+---+---+
| B | B | B |
+---+---+---+
| B | B | B |
+---+---+---+
| | B | |
+---+---+---+
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 | |
+---+---+---+

2
more_armor/depends.txt Normal file
View File

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

167
more_armor/init.lua Normal file
View File

@ -0,0 +1,167 @@
-- Override moreores weapons (make them more powerful)
minetest.register_tool(":moreores:sword_bronze", {
description = "Bronze Sword",
inventory_image = "moreores_tool_bronzesword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=1.00, [2]=0.80, [3]=0.40}, uses=25, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.25}, uses=100, maxlevel=1},
choppy={times={[3]=0.65}, uses=50, maxlevel=0}
}
}
})
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_bronze", {
description = "Bronze Helmet",
inventory_image = "more_armor_inv_helmet_bronze.png",
groups = {armor_head=4, armor_heal=15, armor_use=500},
wear = 0,
})
minetest.register_tool("more_armor:helmet_mithril", {
description = "Mithril Helmet",
inventory_image = "more_armor_inv_helmet_mithril.png",
groups = {armor_head=5, armor_heal=20, armor_use=100},
wear = 0,
})
minetest.register_craft({
output = "more_armor:helmet_bronze",
recipe = {
{"moreores:bronze_ingot", "moreores:bronze_ingot", "moreores:bronze_ingot"},
{"moreores:bronze_ingot", "", "moreores:bronze_ingot"},
{"", "", ""},
},
})
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_bronze", {
description = "Bronze Chestplate",
inventory_image = "more_armor_inv_chestplate_bronze.png",
groups = {armor_torso=4, armor_heal=20, armor_use=1000},
wear = 0,
})
minetest.register_tool("more_armor:chestplate_mithril", {
description = "Mithril Chestplate",
inventory_image = "more_armor_inv_chestplate_mithril.png",
groups = {armor_torso=5, armor_heal=25, armor_use=250},
wear = 0,
})
minetest.register_craft({
output = "more_armor:chestplate_bronze",
recipe = {
{"moreores:bronze_ingot", "", "moreores:bronze_ingot"},
{"moreores:bronze_ingot", "moreores:bronze_ingot", "moreores:bronze_ingot"},
{"moreores:bronze_ingot", "moreores:bronze_ingot", "moreores:bronze_ingot"},
},
})
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_bronze", {
description = "Bronze Leggings",
inventory_image = "more_armor_inv_leggings_bronze.png",
groups = {armor_legs=4, armor_heal=15, armor_use=500},
wear = 0,
})
minetest.register_tool("more_armor:leggings_mithril", {
description = "Mithril Leggings",
inventory_image = "more_armor_inv_leggings_mithril.png",
groups = {armor_legs=5, armor_heal=20, armor_use=100},
wear = 0,
})
minetest.register_craft({
output = "more_armor:leggings_bronze",
recipe = {
{"moreores:bronze_ingot", "moreores:bronze_ingot", "moreores:bronze_ingot"},
{"moreores:bronze_ingot", "", "moreores:bronze_ingot"},
{"moreores:bronze_ingot", "", "moreores:bronze_ingot"},
},
})
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_bronze", {
description = "Bronze Shield",
inventory_image = "more_armor_inv_shield_bronze.png",
groups = {armor_shield=4, armor_heal=20, armor_use=500},
wear = 0,
})
minetest.register_tool("more_armor:shield_mithril", {
description = "Mithril Shield",
inventory_image = "more_armor_inv_shield_mithril.png",
groups = {armor_shield=5, armor_heal=25, armor_use=100},
wear = 0,
})
minetest.register_craft({
output = "more_armor:shield_bronze",
recipe = {
{"moreores:bronze_ingot", "moreores:bronze_ingot", "moreores:bronze_ingot"},
{"moreores:bronze_ingot", "moreores:bronze_ingot", "moreores:bronze_ingot"},
{"", "moreores:bronze_ingot", ""},
},
})
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.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

9
wieldview/README.txt Normal file
View File

@ -0,0 +1,9 @@
[mod] visible wielded items [wieldview]
=======================================
depends: default
Makes hand wielded items visible to other players. Compatible with player skins mod [skins].
note: currently only supports 16x16px texture packs and 64x32px player skins, sorry!

2
wieldview/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default

115
wieldview/init.lua Normal file
View File

@ -0,0 +1,115 @@
local time = 0
local update_time = tonumber(minetest.setting_get("wieldview_update_time"))
if update_time == nil then
update_time = 2
minetest.setting_set("wieldview_update_time", tostring(update_time))
end
wieldview = {
default_character_skin = "character.png",
wielded_items = {},
}
wieldview.get_player_skin = function(self, name)
local mod_path = minetest.get_modpath("skins")
if mod_path then
local skin = skins.skins[name]
if skin then
if skins.get_type(skin) == skins.type.MODEL then
return skin..".png"
end
end
end
return self.default_character_skin
end
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
end
texture = minetest.registered_items[item].tiles[1]
end
return texture
end
wieldview.update_player_visuals = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local texture = "wieldview_character_bg.png^[combine:64x64:0,32="..self:get_player_skin(name)
local player_inv = player:get_inventory()
local wielded_item_texture = self:get_wielded_item_texture(player)
if wielded_item_texture then
texture = texture.."^[combine:64x64:0,0="..wielded_item_texture
end
local mod_path = minetest.get_modpath("3d_armor")
if mod_path then
texture = texture..armor_api:get_player_armor(player)
end
player:set_properties({
visual = "mesh",
textures = {texture},
visual_size = {x=1, y=1},
})
end
wieldview.update_wielded_item = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local stack = player:get_wielded_item()
local item = stack:get_name()
if not item then
return
end
if self.wielded_items[name] then
if self.wielded_items[name] == item then
return
end
self:update_player_visuals(player)
end
self.wielded_items[name] = item
end
minetest.register_on_joinplayer(function(player)
local texture = wieldview:get_player_skin(name)
player:set_properties({
visual = "mesh",
mesh = "wieldview_character.x",
textures = {texture},
visual_size = {x=1, y=1},
})
minetest.after(1, function(player)
wieldview:update_player_visuals(player)
end, player)
end)
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > update_time then
local mod_path = minetest.get_modpath("3d_armor")
for _,player in ipairs(minetest.get_connected_players()) do
wieldview:update_wielded_item(player)
if mod_path then
armor_api:update_armor(player)
end
end
time = 0
end
end)

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B