Patch 3d_armor so armor visuals can be disabled...

Patch: https://github.com/AntumMT/mp-3d_armor/tree/f30a747
This commit is contained in:
Jordan Irwin 2021-05-20 16:13:50 -07:00
parent 9edcc83381
commit 33d93de645
6 changed files with 37 additions and 6 deletions

View File

@ -625,7 +625,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.workbench]: https://github.com/minetest-mods/workbench/tree/bd14f59
[ver.zombie]: https://github.com/AntumMT/mod-cmer/tree/4edb18e
[patch.3d_armor]: https://github.com/AntumMT/mp-3d_armor/tree/269b6ae
[patch.3d_armor]: https://github.com/AntumMT/mp-3d_armor/tree/f30a747
[patch.airtanks]: https://github.com/AntumMT/mod-airtanks/tree/8b7fd12
[patch.amber]: https://github.com/AntumMT/mod-amber/tree/39b852a
[patch.atm]: https://github.com/AntumMT/mod-atm/tree/2ab0e78

View File

@ -2731,6 +2731,11 @@ areas.self_protection_max_areas = 10
# default: true
#armor_migrate_old_inventory = true
## Don't show armor on character model.
# type: bool
# default: false
#armor_transparent = false
# ## shields

View File

@ -61,6 +61,9 @@ armor = {
{"fire:permanent_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"ethereal:fire_flower", 2, 1},
{"default:torch", 1, 1},
{"default:torch_ceiling", 1, 1},
{"default:torch_wall", 1, 1},
},
registered_groups = {["fleshy"]=100},
registered_callbacks = {
@ -197,6 +200,10 @@ armor.update_player_visuals = function(self, player)
self:run_callbacks("on_update", player)
end
-- armor is not visible on player model if enabled
local transparent_armor = core.settings:get_bool("armor_transparent", false)
armor.set_player_armor = function(self, player)
local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
if not name then
@ -255,7 +262,9 @@ armor.set_player_armor = function(self, player)
tex = tex:gsub(".png$", "")
local prev = def.preview or tex.."_preview"
prev = prev:gsub(".png$", "")
if not transparent_armor then
texture = texture.."^"..tex..".png"
end
preview = preview.."^"..prev..".png"
state = state + stack:get_wear()
count = count + 1

View File

@ -58,6 +58,9 @@ armor_punch_damage (Enable damage effects) bool true
# Enable migration of old armor inventories.
armor_migrate_old_inventory (Migrate old armor inventories) bool true
# Don't show armor on character model.
armor_transparent (Transparent armor) bool false
[shields]

View File

@ -1,5 +1,5 @@
if not core.settings:get_bool("armor_enable_technic", true) then
if not minetest.settings:get_bool("armor_enable_technic", true) then
return
end
@ -16,7 +16,9 @@ local stats = {
brass = { name=S("Brass"), material="technic:brass_ingot", armor=1.8, heal=0, use=650, radiation=43 },
cast = { name=S("Cast Iron"), material="technic:cast_iron_ingot", armor=2.5, heal=8, use=200, radiation=40 },
carbon = { name=S("Carbon Steel"), material="technic:carbon_steel_ingot", armor=2.7, heal=10, use=100, radiation=40 },
stainless = { name=S("Stainless Steel"), material="technic:stainless_steel_ingot", armor=2.7, heal=10, use=75, radiation=40 },
stainless = {
name=S("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=S("Tin"), material="moreores:tin_ingot", armor=1.6, heal=0, use=750, radiation=37 }
@ -56,10 +58,19 @@ for key, armor in pairs(stats) do
for partkey, part in pairs(parts) do
local partname = "technic_armor:"..partkey.."_"..key
minetest.register_tool(partname, {
-- Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string)
-- Translators:
-- @1 stands for material and @2 for part of the armor, so that you
-- could use a conjunction if in your language part name comes first
-- then material (e.g. in french 'Silver Boots' is translated in
-- 'Bottes en argent' by using '@2 en @1' as translated string)
description = S("@1 @2", 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)},
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({

View File

@ -883,6 +883,9 @@ armor_punch_damage (Enable damage effects) bool true
# Enable migration of old armor inventories.
armor_migrate_old_inventory (Migrate old armor inventories) bool true
# Don't show armor on character model.
armor_transparent (Transparent armor) bool false
[**shields]