1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-03-28 23:30:44 +01:00

Updated 3d_armor and removed whitespaces

- Solves #218
This commit is contained in:
LeMagnesium 2015-08-16 11:04:11 +02:00
parent 0faa14e2d5
commit e74f3f4aa6
8 changed files with 35 additions and 21 deletions

View File

@ -68,13 +68,11 @@ end
-- override hot nodes so they do not hurt player anywhere but mod -- override hot nodes so they do not hurt player anywhere but mod
if ARMOR_FIRE_PROTECT == true then if ARMOR_FIRE_PROTECT == true then
minetest.after(2, function()
for _, row in ipairs(ARMOR_FIRE_NODES) do for _, row in ipairs(ARMOR_FIRE_NODES) do
if minetest.registered_nodes[row[1]] then if minetest.registered_nodes[row[1]] then
minetest.override_item(row[1], {damage_per_second = 0}) minetest.override_item(row[1], {damage_per_second = 0})
end end
end end
end)
end end
local time = 0 local time = 0
@ -90,7 +88,7 @@ armor = {
.."list[current_player;craftpreview;7,2;1,1;]", .."list[current_player;craftpreview;7,2;1,1;]",
textures = {}, textures = {},
default_skin = "character", default_skin = "character",
version = "0.4.3", version = "0.4.4",
} }
if minetest.get_modpath("inventory_plus") then if minetest.get_modpath("inventory_plus") then
@ -254,13 +252,13 @@ armor.set_player_armor = function(self, player)
self:update_player_visuals(player) self:update_player_visuals(player)
end end
armor.update_armor = function(self, player, dtime) armor.update_armor = function(self, player)
local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[update_armor]") local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[update_armor]")
if not name then if not name then
return return
end end
local hp = player:get_hp() or 0 local hp = player:get_hp() or 0
if ARMOR_FIRE_PROTECT == true and dtime then if ARMOR_FIRE_PROTECT == true then
pos.y = pos.y + 1.4 -- head level pos.y = pos.y + 1.4 -- head level
local node_head = minetest.get_node(pos).name local node_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- feet level pos.y = pos.y - 1.2 -- feet level
@ -270,7 +268,7 @@ armor.update_armor = function(self, player, dtime)
-- check for fire protection, if not enough then get hurt -- check for fire protection, if not enough then get hurt
if row[1] == node_head or row[1] == node_feet then if row[1] == node_head or row[1] == node_feet then
if hp > 0 and armor.def[name].fire < row[2] then if hp > 0 and armor.def[name].fire < row[2] then
hp = hp - row[3] * dtime hp = hp - row[3] * ARMOR_UPDATE_TIME
player:set_hp(hp) player:set_hp(hp)
break break
end end
@ -634,7 +632,7 @@ minetest.register_globalstep(function(dtime)
time = time + dtime time = time + dtime
if time > ARMOR_UPDATE_TIME then if time > ARMOR_UPDATE_TIME then
for _,player in ipairs(minetest.get_connected_players()) do for _,player in ipairs(minetest.get_connected_players()) do
armor:update_armor(player, time) armor:update_armor(player)
end end
time = 0 time = 0
end end

View File

@ -1,3 +1,6 @@
default default
inventory_plus? inventory_plus?
unified_inventory? unified_inventory?
fire?
ethereal?
bakedclay?

View File

@ -251,3 +251,4 @@ for k, v in pairs(ARMOR_MATERIALS) do
}, },
}) })
end end

View File

@ -33,10 +33,18 @@ depends: 3d_armor
Makes hand wielded items visible to other players. Makes hand wielded items visible to other players.
[mod] Shields [shields] [mod] Shields [shields]
------------------------------------- -----------------------
depends: 3d_armor depends: 3d_armor
Originally a part of 3d_armor, shields have been re-included as an optional extra. 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. If you do not want shields then simply remove the shields folder from the modpack.
[mod] Technic Armor [technic_armor]
-----------------------------------
depends: 3d_armor
Adds tin, silver and technic materials to 3d_armor.
Requires technic mod to be installed for craft registration.

View File

@ -132,3 +132,4 @@ end
minetest.after(0, function() minetest.after(0, function()
table.insert(armor.elements, "shield") table.insert(armor.elements, "shield")
end) end)

View File

@ -1,3 +1,6 @@
[mod] Technic Armor [technic_armor]
===================================
Adds tin, silver and technic materials to 3d_armor. Adds tin, silver and technic materials to 3d_armor.
Requires technic mod to be installed for craft registration. Requires technic mod to be installed for craft registration.