Compare commits
10 Commits
code-quali
...
version-0.
Author | SHA1 | Date | |
---|---|---|---|
073206701a | |||
b4eebf604e | |||
0da0088889 | |||
dbc6ccf089 | |||
acd8b2647d | |||
a6b89e7929 | |||
c3a755518e | |||
4c99049600 | |||
4adc602704 | |||
e248752ee4 |
@ -316,6 +316,8 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
|
|||||||
if not name then
|
if not name then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local set_state
|
||||||
|
local set_count
|
||||||
local state = 0
|
local state = 0
|
||||||
local count = 0
|
local count = 0
|
||||||
local recip = true
|
local recip = true
|
||||||
@ -376,11 +378,17 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
|
|||||||
end
|
end
|
||||||
if damage == true then
|
if damage == true then
|
||||||
self:damage(player, i, stack, use)
|
self:damage(player, i, stack, use)
|
||||||
|
set_state = self.def[name].state
|
||||||
|
set_count = self.def[name].count
|
||||||
end
|
end
|
||||||
state = state + stack:get_wear()
|
state = state + stack:get_wear()
|
||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if set_count and set_count ~= count then
|
||||||
|
state = set_state or state
|
||||||
|
count = set_count or count
|
||||||
|
end
|
||||||
self.def[name].state = state
|
self.def[name].state = state
|
||||||
self.def[name].count = count
|
self.def[name].count = count
|
||||||
end
|
end
|
||||||
@ -470,7 +478,8 @@ end
|
|||||||
armor.load_armor_inventory = function(self, player)
|
armor.load_armor_inventory = function(self, player)
|
||||||
local _, inv = self:get_valid_player(player, "[load_armor_inventory]")
|
local _, inv = self:get_valid_player(player, "[load_armor_inventory]")
|
||||||
if inv then
|
if inv then
|
||||||
local armor_list_string = player:get_attribute("3d_armor_inventory")
|
local meta = player:get_meta()
|
||||||
|
local armor_list_string = meta:get_string("3d_armor_inventory")
|
||||||
if armor_list_string then
|
if armor_list_string then
|
||||||
inv:set_list("armor",
|
inv:set_list("armor",
|
||||||
self:deserialize_inventory_list(armor_list_string))
|
self:deserialize_inventory_list(armor_list_string))
|
||||||
@ -482,7 +491,8 @@ end
|
|||||||
armor.save_armor_inventory = function(self, player)
|
armor.save_armor_inventory = function(self, player)
|
||||||
local _, inv = self:get_valid_player(player, "[save_armor_inventory]")
|
local _, inv = self:get_valid_player(player, "[save_armor_inventory]")
|
||||||
if inv then
|
if inv then
|
||||||
player:set_attribute("3d_armor_inventory",
|
local meta = player:get_meta()
|
||||||
|
meta:set_string("3d_armor_inventory",
|
||||||
self:serialize_inventory_list(inv:get_list("armor")))
|
self:serialize_inventory_list(inv:get_list("armor")))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -523,7 +533,7 @@ armor.drop_armor = function(pos, stack)
|
|||||||
if node then
|
if node then
|
||||||
local obj = minetest.add_item(pos, stack)
|
local obj = minetest.add_item(pos, stack)
|
||||||
if obj then
|
if obj then
|
||||||
obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)})
|
obj:set_velocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -79,6 +79,19 @@ if armor.materials.wood then
|
|||||||
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
|
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
|
||||||
groups = {armor_feet=1, armor_heal=0, armor_use=2000, flammable=1},
|
groups = {armor_feet=1, armor_heal=0, armor_use=2000, flammable=1},
|
||||||
})
|
})
|
||||||
|
local wood_armor_fuel = {
|
||||||
|
helmet = 6,
|
||||||
|
chestplate = 8,
|
||||||
|
leggings = 7,
|
||||||
|
boots = 5
|
||||||
|
}
|
||||||
|
for armor, burn in pairs(wood_armor_fuel) do
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "3d_armor:" .. armor .. "_wood",
|
||||||
|
burntime = burn,
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if armor.materials.cactus then
|
if armor.materials.cactus then
|
||||||
@ -110,6 +123,19 @@ if armor.materials.cactus then
|
|||||||
armor_groups = {fleshy=5},
|
armor_groups = {fleshy=5},
|
||||||
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
|
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
|
||||||
})
|
})
|
||||||
|
local cactus_armor_fuel = {
|
||||||
|
helmet = 14,
|
||||||
|
chestplate = 16,
|
||||||
|
leggings = 15,
|
||||||
|
boots = 13
|
||||||
|
}
|
||||||
|
for armor, burn in pairs(cactus_armor_fuel) do
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "3d_armor:" .. armor .. "_cactus",
|
||||||
|
burntime = burn,
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if armor.materials.steel then
|
if armor.materials.steel then
|
||||||
|
@ -128,7 +128,8 @@ local function validate_armor_inventory(player)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local armor_prev = {}
|
local armor_prev = {}
|
||||||
local armor_list_string = player:get_attribute("3d_armor_inventory")
|
local attribute_meta = player:get_meta() -- I know, the function's name is weird but let it be like that. ;)
|
||||||
|
local armor_list_string = attribute_meta:get_string("3d_armor_inventory")
|
||||||
if armor_list_string then
|
if armor_list_string then
|
||||||
local armor_list = armor:deserialize_inventory_list(armor_list_string)
|
local armor_list = armor:deserialize_inventory_list(armor_list_string)
|
||||||
for i, stack in ipairs(armor_list) do
|
for i, stack in ipairs(armor_list) do
|
||||||
@ -392,8 +393,9 @@ if armor.config.punch_damage == true then
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_player_hpchange(function(player, hp_change)
|
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||||
if player and hp_change < 0 then
|
if player and reason.type ~= "drown" and reason.hunger == nil
|
||||||
|
and hp_change < 0 then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if name then
|
if name then
|
||||||
local heal = armor.def[name].heal
|
local heal = armor.def[name].heal
|
||||||
@ -428,7 +430,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Fire Protection and water breating, added by TenPlus1
|
-- Fire Protection and water breathing, added by TenPlus1.
|
||||||
|
|
||||||
if armor.config.fire_protect == true then
|
if armor.config.fire_protect == true then
|
||||||
-- override hot nodes so they do not hurt player anywhere but mod
|
-- override hot nodes so they do not hurt player anywhere but mod
|
||||||
|
4
3d_armor/mod.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
name = 3d_armor
|
||||||
|
depends = default
|
||||||
|
optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay, intllib
|
||||||
|
description = Adds craftable armor that is visible to other players.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 270 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 385 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 275 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 338 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 237 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 189 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 261 B |