Update 3d_armor and other dependences.
15
.gitmodules
vendored
|
@ -189,3 +189,18 @@
|
|||
[submodule "mods/camera"]
|
||||
path = mods/camera
|
||||
url = https://github.com/sys4-fr/camera.git
|
||||
[submodule "mods/3d_armor"]
|
||||
path = mods/3d_armor
|
||||
url = https://github.com/stujones11/minetest-3d_armor.git
|
||||
[submodule "mods/technic_armor"]
|
||||
path = mods/technic_armor
|
||||
url = https://github.com/stujones11/technic_armor.git
|
||||
[submodule "mods/hbhunger"]
|
||||
path = mods/hbhunger
|
||||
url = http://repo.or.cz/minetest_hbhunger.git
|
||||
[submodule "mods/hudbars"]
|
||||
path = mods/hudbars
|
||||
url = http://repo.or.cz/minetest_hudbars.git
|
||||
[submodule "mods/mana"]
|
||||
path = mods/mana
|
||||
url = git://repo.or.cz/minetest_mana.git
|
||||
|
|
|
@ -50,7 +50,7 @@ server_name = NotreAmiLeCube (Survival & PVP) [FR/EN]
|
|||
server_description = Server hosted by sys4. This server have a class system(Warrior, Hunter, Wizard) and is highly modded, content-rich, good luck to survive and have fun! [This server is a fork from MinetestForFun Classic]
|
||||
motd = Welcome to "NotreAmiLeCube (Survival & PVP) [EN/FR]" server! / Bienvenue sur le serveur "NotreAmiLeCube (Survie & PVP) [FR/EN]" !
|
||||
serverlist_url = servers.minetest.net
|
||||
server_url = http://mff.sys4.fr/
|
||||
server_url = http://nalc.sys4.fr/
|
||||
server_announce = false
|
||||
server_address = 78.210.252.189
|
||||
port = 30002
|
||||
|
@ -149,6 +149,63 @@ creeper:creeper = 25000,2
|
|||
mob_horse:horse = 60000,1
|
||||
mobs_turtles:turtle = 30000,1
|
||||
mobs_turtles:seaturtle = 30000,1
|
||||
|
||||
# Armor Configuration
|
||||
# -------------------
|
||||
|
||||
# Set false to disable individual armor materials.
|
||||
armor_material_wood = true
|
||||
armor_material_cactus = true
|
||||
armor_material_steel = true
|
||||
armor_material_bronze = true
|
||||
armor_material_diamond = true
|
||||
armor_material_gold = true
|
||||
armor_material_mithril = true
|
||||
armor_material_crystal = false
|
||||
armor_material_reinforcedleather = true
|
||||
armor_material_hardenedleather = true
|
||||
armor_material_blackmithril = true
|
||||
|
||||
# Increase this if you get initialization glitches when a player first joins.
|
||||
armor_init_delay = 1
|
||||
|
||||
# Number of initialization attempts.
|
||||
# Use in conjunction with armor_init_delay if initialization problems persist.
|
||||
armor_init_times = 1
|
||||
|
||||
# Increase this if armor is not getting into bones due to server lag.
|
||||
armor_bones_delay = 1
|
||||
|
||||
# How often player armor items are updated.
|
||||
armor_update_time = 1
|
||||
|
||||
# Drop armor when a player dies.
|
||||
# Uses bones mod if present, otherwise items are dropped around the player.
|
||||
armor_drop = true
|
||||
|
||||
# Pulverise armor when a player dies, overrides armor_drop.
|
||||
armor_destroy = false
|
||||
|
||||
# You can use this to increase or decrease overall armor effectiveness,
|
||||
# eg: level_multiplier = 0.5 will reduce armor level by half.
|
||||
armor_level_multiplier = 1
|
||||
|
||||
# You can use this to increase or decrease overall armor healing,
|
||||
# eg: armor_heal_multiplier = 0 will disable healing altogether.
|
||||
armor_heal_multiplier = 1
|
||||
|
||||
# Enable water protection (periodically restores breath when activated)
|
||||
armor_water_protect = true
|
||||
|
||||
# Enable fire protection (defaults true if using ethereal mod)
|
||||
armor_fire_protect = false
|
||||
|
||||
# Enable punch damage effects.
|
||||
armor_punch_damage = true
|
||||
|
||||
# Enable migration of old armor inventories
|
||||
armor_migrate_old_inventory = true
|
||||
|
||||
# DROPONDIE MOD - si false, les sacs des joueurs sont vidées à leurs mort
|
||||
keepInventory = false
|
||||
# RANDOM_MESSAGES MOD - paramétrage de l'interval entre deux messages, 30min actuellement
|
||||
|
@ -194,12 +251,12 @@ secure.trusted_mods = irc, snow, stacktraceplus
|
|||
#irc.send_join_part = true
|
||||
|
||||
## Player Anim ##
|
||||
player_model_version = default_character_v1
|
||||
player_model_version = default_character_v2
|
||||
|
||||
# item_drop
|
||||
enable_item_drop = false
|
||||
enable_item_pickup_key = false
|
||||
enable_item_pickup = true
|
||||
#enable_item_pickup = true
|
||||
item_pickup_radius = 0.75
|
||||
item_pickup_keytype = Sneak
|
||||
#item_pickup_keytype = Sneak
|
||||
|
||||
|
|
1
mods/3d_armor
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 579d245a00fcf5bc4fef438d6d1efe84873339b7
|
8
mods/3d_armor/.gitignore
vendored
|
@ -1,8 +0,0 @@
|
|||
## Generic ignorable patterns and files
|
||||
*~
|
||||
.*.swp
|
||||
*bak*
|
||||
tags
|
||||
*.vim
|
||||
armor.conf
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
[mod] Visible Player Armor [3d_armor]
|
||||
=====================================
|
||||
|
||||
Depends: default
|
||||
|
||||
Recommends: inventory_plus or unified_inventory (use only one)
|
||||
|
||||
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.
|
||||
|
||||
Armor takes damage when a player is hurt but also offers a percentage chance of healing.
|
||||
Overall level is boosted by 10% when wearing a full matching set.
|
||||
|
||||
Fire protection added by TenPlus1 when using crystal armor if Ethereal mod active, level 1
|
||||
protects against torches, level 2 for crystal spike, level 3 for fire, level 5 for lava.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
Armor can be configured by adding a file called armor.conf in 3d_armor mod and/or world directory.
|
||||
see armor.conf.example for all available options.
|
||||
|
||||
Note: worldpath config settings override any settings made in the mod's directory.
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
minetest.register_alias("adminboots","3d_armor:boots_admin")
|
||||
minetest.register_alias("adminhelmet","3d_armor:helmet_admin")
|
||||
minetest.register_alias("adminchestplate","3d_armor:chestplate_admin")
|
||||
minetest.register_alias("adminleggings","3d_armor:leggings_admin")
|
||||
|
||||
minetest.register_tool("3d_armor:helmet_admin", {
|
||||
description = "Admin Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_admin.png",
|
||||
groups = {armor_head=1000, armor_heal=1000, armor_use=0, armor_water=1,},
|
||||
wear = 0,
|
||||
on_drop = function(itemstack, dropper, pos)
|
||||
return
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("3d_armor:chestplate_admin", {
|
||||
description = "Admin Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_admin.png",
|
||||
groups = {armor_torso=1000, armor_heal=1000, armor_use=0},
|
||||
wear = 0,
|
||||
on_drop = function(itemstack, dropper, pos)
|
||||
return
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("3d_armor:leggings_admin", {
|
||||
description = "Admin Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_admin.png",
|
||||
groups = {armor_legs=1000, armor_heal=1000, armor_use=0},
|
||||
wear = 0,
|
||||
on_drop = function(itemstack, dropper, pos)
|
||||
return
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("3d_armor:boots_admin", {
|
||||
description = "Admin Boots",
|
||||
inventory_image = "3d_armor_inv_boots_admin.png",
|
||||
groups = {armor_feet=1000, armor_heal=1000, armor_use=0},
|
||||
wear = 0,
|
||||
on_drop = function(itemstack, dropper, pos)
|
||||
return
|
||||
end,
|
||||
})
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
-- Armor Configuration (defaults)
|
||||
|
||||
-- Increase this if you get initialization glitches when a player first joins.
|
||||
ARMOR_INIT_DELAY = 3
|
||||
|
||||
-- Number of initialization attempts.
|
||||
-- Use in conjunction with ARMOR_INIT_DELAY if initialization problems persist.
|
||||
ARMOR_INIT_TIMES = 3
|
||||
|
||||
-- Increase this if armor is not getting into bones due to server lag.
|
||||
ARMOR_BONES_DELAY = 3
|
||||
|
||||
-- How often player armor/wield items are updated.
|
||||
ARMOR_UPDATE_TIME = 1
|
||||
|
||||
-- Drop armor when a player dies.
|
||||
-- Uses bones mod if present, otherwise items are dropped around the player.
|
||||
ARMOR_DROP = true
|
||||
|
||||
-- Pulverise armor when a player dies, overrides ARMOR_DROP.
|
||||
ARMOR_DESTROY = false
|
||||
|
||||
-- You can use this to increase or decrease overall armor effectiveness,
|
||||
-- eg: ARMOR_LEVEL_MULTIPLIER = 0.5 will reduce armor level by half.
|
||||
ARMOR_LEVEL_MULTIPLIER = 1
|
||||
|
||||
-- You can use this to increase or decrease overall armor healing,
|
||||
-- eg: ARMOR_HEAL_MULTIPLIER = 0 will disable healing altogether.
|
||||
ARMOR_HEAL_MULTIPLIER = 1
|
||||
|
||||
-- You can also use this file to execute arbitary lua code
|
||||
-- eg: Dumb the armor down if using Simple Mobs
|
||||
--if minetest.get_modpath("mobs") then
|
||||
-- ARMOR_LEVEL_MULTIPLIER = 1
|
||||
-- ARMOR_HEAL_MULTIPLIER = 0
|
||||
--end
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
-- Armor Configuration (defaults)
|
||||
|
||||
-- You can remove any unwanted armor materials from this table.
|
||||
-- Note that existing armor that is removed will show up as an unknown item.
|
||||
ARMOR_MATERIALS = {
|
||||
wood = "group:wood",
|
||||
cactus = "default:cactus",
|
||||
steel = "default:steel_ingot",
|
||||
bronze = "default:bronze_ingot",
|
||||
diamond = "default:diamond",
|
||||
gold = "default:gold_ingot",
|
||||
mithril = "default:mithril_ingot",
|
||||
crystal = "ethereal:crystal_ingot",
|
||||
}
|
||||
|
||||
-- Enable fire protection (defaults true if using ethereal mod)
|
||||
ARMOR_FIRE_PROTECT = false
|
||||
|
||||
-- Fire protection nodes, (name, protection level, damage)
|
||||
ARMOR_FIRE_NODES = {
|
||||
{"default:lava_source", 5, 4},
|
||||
{"default:lava_flowing", 5, 4},
|
||||
{"fire:basic_flame", 3, 4},
|
||||
{"fire:permanent_flame", 3, 4},
|
||||
{"ethereal:crystal_spike", 2, 1},
|
||||
{"ethereal:fire_flower", 2, 1},
|
||||
{"default:torch", 1, 1},
|
||||
}
|
||||
|
||||
-- Increase this if you get initialization glitches when a player first joins.
|
||||
ARMOR_INIT_DELAY = 1
|
||||
|
||||
-- Number of initialization attempts.
|
||||
-- Use in conjunction with ARMOR_INIT_DELAY if initialization problems persist.
|
||||
ARMOR_INIT_TIMES = 1
|
||||
|
||||
-- Increase this if armor is not getting into bones due to server lag.
|
||||
ARMOR_BONES_DELAY = 1
|
||||
|
||||
-- How often player armor/wield items are updated.
|
||||
ARMOR_UPDATE_TIME = 1
|
||||
|
||||
-- Drop armor when a player dies.
|
||||
-- Uses bones mod if present, otherwise items are dropped around the player.
|
||||
ARMOR_DROP = true
|
||||
|
||||
-- Pulverise armor when a player dies, overrides ARMOR_DROP.
|
||||
ARMOR_DESTROY = false
|
||||
|
||||
-- You can use this to increase or decrease overall armor effectiveness,
|
||||
-- eg: ARMOR_LEVEL_MULTIPLIER = 0.5 will reduce armor level by half.
|
||||
ARMOR_LEVEL_MULTIPLIER = 1
|
||||
|
||||
-- You can use this to increase or decrease overall armor healing,
|
||||
-- eg: ARMOR_HEAL_MULTIPLIER = 0 will disable healing altogether.
|
||||
ARMOR_HEAL_MULTIPLIER = 1
|
||||
|
|
@ -1,721 +0,0 @@
|
|||
local armors_no_shields = { ["3d_armor:helmet_hardenedleather"] = true,["3d_armor:chestplate_hardenedleather"] = true,
|
||||
["3d_armor:leggings_hardenedleather"] = true,["3d_armor:boots_hardenedleather"] = true,
|
||||
["3d_armor:helmet_reinforcedleather"] = true,["3d_armor:chestplate_reinforcedleather"] = true,
|
||||
["3d_armor:leggings_reinforcedleather"] = true,["3d_armor:boots_reinforcedleather"] = true,
|
||||
} -- modif MFF (crabman/24/06/2015)
|
||||
|
||||
|
||||
ARMOR_INIT_DELAY = 1
|
||||
ARMOR_INIT_TIMES = 1
|
||||
ARMOR_BONES_DELAY = 1
|
||||
ARMOR_UPDATE_TIME = 1
|
||||
ARMOR_DROP = minetest.get_modpath("bones") ~= nil
|
||||
ARMOR_DESTROY = false
|
||||
ARMOR_LEVEL_MULTIPLIER = 1
|
||||
ARMOR_HEAL_MULTIPLIER = 1
|
||||
ARMOR_RADIATION_MULTIPLIER = 1
|
||||
ARMOR_MATERIALS = {
|
||||
wood = "group:wood",
|
||||
cactus = "default:cactus",
|
||||
steel = "default:steel_ingot",
|
||||
bronze = "default:bronze_ingot",
|
||||
diamond = "default:diamond",
|
||||
gold = "default:gold_ingot",
|
||||
mithril = "default:mithril_ingot",
|
||||
crystal = "ethereal:crystal_ingot",
|
||||
-- Hunter armors (A déc-ommenter quand activation de l'armure au total)
|
||||
hardenedleather = "3d_armor:hardenedleather",
|
||||
reinforcedleather = "3d_armor:reinforcedleather",
|
||||
-- Warrior armors
|
||||
blackmithril = "3d_armor:blackmithril_ingot"
|
||||
-- Wizard armors
|
||||
--armor = "xxx",
|
||||
--armor = "xxx",
|
||||
}
|
||||
ARMOR_FIRE_PROTECT = minetest.get_modpath("ethereal") ~= nil
|
||||
ARMOR_FIRE_NODES = {
|
||||
{"default:lava_source", 5, 8},
|
||||
{"default:lava_flowing", 5, 8},
|
||||
{"fire:basic_flame", 3, 4},
|
||||
{"fire:permanent_flame", 3, 4},
|
||||
{"ethereal:crystal_spike", 2, 1},
|
||||
{"ethereal:fire_flower", 2, 1},
|
||||
{"default:torch", 1, 1},
|
||||
}
|
||||
|
||||
local skin_mod = nil
|
||||
local inv_mod = nil
|
||||
|
||||
local modpath = minetest.get_modpath(ARMOR_MOD_NAME)
|
||||
local worldpath = minetest.get_worldpath()
|
||||
local input = io.open(modpath.."/armor.conf", "r")
|
||||
if input then
|
||||
dofile(modpath.."/armor.conf")
|
||||
input:close()
|
||||
input = nil
|
||||
end
|
||||
input = io.open(worldpath.."/armor.conf", "r")
|
||||
if input then
|
||||
dofile(worldpath.."/armor.conf")
|
||||
input:close()
|
||||
input = nil
|
||||
end
|
||||
if not minetest.get_modpath("ethereal") then
|
||||
ARMOR_MATERIALS.crystal = nil
|
||||
end
|
||||
|
||||
armor = {
|
||||
timer = 0,
|
||||
elements = {"head", "torso", "legs", "feet"},
|
||||
physics = {"jump","speed","gravity"},
|
||||
formspec = "size[8,8.5]image[2,0.75;2,4;armor_preview]"
|
||||
.."list[current_player;main;0,4.5;8,4;]"
|
||||
.."list[current_player;craft;4,1;3,3;]"
|
||||
.."list[current_player;craftpreview;7,2;1,1;]"
|
||||
.."listring[current_player;main]"
|
||||
.."listring[current_player;craft]",
|
||||
textures = {},
|
||||
default_skin = "character",
|
||||
version = "0.4.5",
|
||||
}
|
||||
|
||||
if minetest.get_modpath("inventory_plus") then
|
||||
inv_mod = "inventory_plus"
|
||||
armor.formspec = "size[8,8.5]button[0,0;2,0.5;main;Back]"
|
||||
.."image[2.5,0.75;2,4;armor_preview]"
|
||||
.."label[5,1;Level: armor_level]"
|
||||
.."label[5,1.5;Heal: armor_heal]"
|
||||
.."label[5,2;Fire: armor_fire]"
|
||||
.."label[5,2.5;Radiation: armor_radiation]"
|
||||
.."list[current_player;main;0,4.5;8,4;]"
|
||||
if minetest.get_modpath("crafting") then
|
||||
inventory_plus.get_formspec = function(player, page)
|
||||
end
|
||||
end
|
||||
elseif minetest.get_modpath("unified_inventory") then
|
||||
inv_mod = "unified_inventory"
|
||||
unified_inventory.register_button("armor", {
|
||||
type = "image",
|
||||
image = "inventory_plus_armor.png",
|
||||
tooltip = "Armor inventory",
|
||||
show_with = false, --Modif MFF (Crabman 30/06/2015)
|
||||
})
|
||||
unified_inventory.register_page("armor", {
|
||||
get_formspec = function(player, perplayer_formspec)
|
||||
local fy = perplayer_formspec.formspec_y
|
||||
local name = player:get_player_name()
|
||||
local formspec = "background[0.06,"..fy..";7.92,7.52;3d_armor_ui_form.png]"
|
||||
.."label[0,0;Armor]"
|
||||
.."list[detached:"..name.."_armor;armor;0,"..fy..";2,3;]"
|
||||
.."image[2.5,"..(fy - 0.25)..";2,4;"..armor.textures[name].preview.."]"
|
||||
.."label[5.0,"..(fy + 0.0)..";Level: "..armor.def[name].level.."]"
|
||||
.."label[5.0,"..(fy + 0.4)..";Heal: "..armor.def[name].heal.."]"
|
||||
.."label[5.0,"..(fy + 0.8)..";Fire: "..armor.def[name].fire.."]"
|
||||
.."label[5.0,"..(fy + 1.2)..";Radiation: "..armor.def[name].radiation.."]"
|
||||
.."label[5.0,"..(fy + 1.6)..";Speed: "..armor.def[name].speed.."]"
|
||||
.."label[5.0,"..(fy + 2)..";Jump: "..armor.def[name].jump.."]"
|
||||
.."label[5.0,"..(fy + 2.4)..";Gravity: "..armor.def[name].gravity.."]"
|
||||
.."listring[current_player;main]"
|
||||
.."listring[detached:"..name.."_armor;armor]"
|
||||
return {formspec=formspec}
|
||||
end,
|
||||
})
|
||||
elseif minetest.get_modpath("inventory_enhanced") then
|
||||
inv_mod = "inventory_enhanced"
|
||||
end
|
||||
|
||||
if minetest.get_modpath("skins") then
|
||||
skin_mod = "skins"
|
||||
elseif minetest.get_modpath("simple_skins") then
|
||||
skin_mod = "simple_skins"
|
||||
elseif minetest.get_modpath("u_skins") then
|
||||
skin_mod = "u_skins"
|
||||
elseif minetest.get_modpath("wardrobe") then
|
||||
skin_mod = "wardrobe"
|
||||
end
|
||||
|
||||
armor.def = {
|
||||
state = 0,
|
||||
count = 0,
|
||||
}
|
||||
|
||||
armor.update_player_visuals = function(self, player)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local name = player:get_player_name()
|
||||
if self.textures[name] then
|
||||
default.player_set_textures(player, {
|
||||
self.textures[name].skin,
|
||||
self.textures[name].armor,
|
||||
self.textures[name].wielditem,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
armor.set_player_armor = function(self, player)
|
||||
local name, player_inv = armor:get_valid_player(player, "[set_player_armor]")
|
||||
if not name then
|
||||
return
|
||||
end
|
||||
local armor_texture = "3d_armor_trans.png"
|
||||
local armor_level = 0
|
||||
local armor_heal = 0
|
||||
local armor_fire = 0
|
||||
local armor_water = 0
|
||||
local armor_radiation = 0
|
||||
local state = 0
|
||||
local items = 0
|
||||
local elements = {}
|
||||
local textures = {}
|
||||
local physics_o = {speed=1,gravity=1,jump=1}
|
||||
local material = {type=nil, count=1}
|
||||
local preview = ""
|
||||
for _,v in ipairs(self.elements) do
|
||||
elements[v] = false
|
||||
end
|
||||
for i=1, 6 do
|
||||
local stack = player_inv:get_stack("armor", i)
|
||||
local item = stack:get_name()
|
||||
if stack:get_count() == 1 then
|
||||
local def = stack:get_definition()
|
||||
for k, v in pairs(elements) do
|
||||
if v == false then
|
||||
local level = def.groups["armor_"..k]
|
||||
if level then
|
||||
local texture = item:gsub("%:", "_")
|
||||
if texture:find("enchanted") then --MFF xdecor enchanting preview fix
|
||||
texture = texture:gsub("_enchanted", "")
|
||||
texture = texture:gsub("_strong", "")
|
||||
texture = texture:gsub("_speed", "")
|
||||
end
|
||||
table.insert(textures, texture..".png")
|
||||
if preview == "" then
|
||||
preview = texture .. "_preview.png"
|
||||
elseif stack:get_name():find("shield") then -- //MFF(Mg|09/05/15)
|
||||
preview = preview.. "^" .. texture.."_preview.png"
|
||||
else
|
||||
preview = texture .. "_preview.png^" .. preview
|
||||
end
|
||||
armor_level = armor_level + level
|
||||
state = state + stack:get_wear()
|
||||
items = items + 1
|
||||
armor_heal = armor_heal + (def.groups["armor_heal"] or 0)
|
||||
armor_fire = armor_fire + (def.groups["armor_fire"] or 0)
|
||||
armor_water = armor_water + (def.groups["armor_water"] or 0)
|
||||
armor_radiation = armor_radiation + (def.groups["armor_radiation"] or 0)
|
||||
for kk,vv in ipairs(self.physics) do
|
||||
local o_value = def.groups["physics_"..vv]
|
||||
if o_value then
|
||||
physics_o[vv] = physics_o[vv] + o_value
|
||||
end
|
||||
end
|
||||
local mat = string.match(item, "%:.+_(.+)$")
|
||||
if material.type then
|
||||
if material.type == mat then
|
||||
material.count = material.count + 1
|
||||
end
|
||||
else
|
||||
material.type = mat
|
||||
end
|
||||
elements[k] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if preview ~= "" then
|
||||
preview = "^" .. preview
|
||||
end
|
||||
preview = armor:get_preview(name) .. preview -- //MFF(Mg|09/05/15)
|
||||
if minetest.get_modpath("shields") then
|
||||
armor_level = armor_level * 0.9
|
||||
end
|
||||
if material.type and material.count == #self.elements then
|
||||
armor_level = armor_level * 1.1
|
||||
end
|
||||
armor_level = armor_level * ARMOR_LEVEL_MULTIPLIER
|
||||
armor_heal = armor_heal * ARMOR_HEAL_MULTIPLIER
|
||||
armor_radiation = armor_radiation * ARMOR_RADIATION_MULTIPLIER
|
||||
if #textures > 0 then
|
||||
armor_texture = table.concat(textures, "^")
|
||||
end
|
||||
local armor_groups = {fleshy=100}
|
||||
if armor_level > 0 then
|
||||
armor_groups.level = math.floor(armor_level / 20)
|
||||
armor_groups.fleshy = 100 - armor_level
|
||||
armor_groups.radiation = 100 - armor_radiation
|
||||
end
|
||||
player:set_armor_groups(armor_groups)
|
||||
--player:set_physics_override(physics_o)
|
||||
player_physics.set_stats(player, "3d_armor", {speed=physics_o.speed-1, jump=physics_o.jump-1, gravity=physics_o.gravity-1})
|
||||
pclasses.api.util.on_update(name)
|
||||
self.textures[name].armor = armor_texture
|
||||
self.textures[name].preview = preview
|
||||
self.def[name].state = state
|
||||
self.def[name].count = items
|
||||
self.def[name].level = armor_level
|
||||
self.def[name].heal = armor_heal
|
||||
self.def[name].jump = physics_o.jump
|
||||
self.def[name].speed = physics_o.speed
|
||||
self.def[name].gravity = physics_o.gravity
|
||||
self.def[name].fire = armor_fire
|
||||
self.def[name].water = armor_water
|
||||
self.def[name].radiation = armor_radiation
|
||||
self:update_player_visuals(player)
|
||||
end
|
||||
|
||||
armor.update_armor = function(self, player)
|
||||
-- Legacy support: Called when armor levels are changed
|
||||
-- Other mods can hook on to this function, see hud mod for example
|
||||
end
|
||||
|
||||
armor.get_player_skin = function(self, name)
|
||||
local skin = nil
|
||||
if skin_mod == "skins" or skin_mod == "simple_skins" then
|
||||
skin = skins.skins[name]
|
||||
elseif skin_mod == "u_skins" then
|
||||
skin = u_skins.u_skins[name]
|
||||
elseif skin_mod == "wardrobe" then
|
||||
skin = string.gsub(wardrobe.playerSkins[name], "%.png$","")
|
||||
end
|
||||
return skin or armor.default_skin
|
||||
end
|
||||
|
||||
armor.get_preview = function(self, name)
|
||||
if skin_mod == "skins" then
|
||||
return armor:get_player_skin(name).."_preview.png"
|
||||
elseif skin_mod == "u_skins"then
|
||||
return string.gsub(armor.textures[name].skin, ".png", "_preview.png")
|
||||
end
|
||||
return "character_preview.png"
|
||||
end
|
||||
|
||||
armor.get_armor_formspec = function(self, name)
|
||||
if not armor.textures[name] then
|
||||
minetest.log("error", "3d_armor: Player texture["..name.."] is nil [get_armor_formspec]")
|
||||
return ""
|
||||
end
|
||||
if not armor.def[name] then
|
||||
minetest.log("error", "3d_armor: Armor def["..name.."] is nil [get_armor_formspec]")
|
||||
return ""
|
||||
end
|
||||
local formspec = armor.formspec.."list[detached:"..name.."_armor;armor;0,1;2,3;]"
|
||||
formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
|
||||
formspec = formspec:gsub("armor_level", armor.def[name].level)
|
||||
formspec = formspec:gsub("armor_heal", armor.def[name].heal)
|
||||
formspec = formspec:gsub("armor_fire", armor.def[name].fire)
|
||||
formspec = formspec:gsub("armor_radiation", armor.def[name].radiation)
|
||||
formspec = formspec:gsub("armor_speed", armor.def[name].speed)
|
||||
formspec = formspec:gsub("armor_jump", armor.def[name].jump)
|
||||
formspec = formspec:gsub("armor_gravity", armor.def[name].gravity)
|
||||
return formspec
|
||||
end
|
||||
|
||||
armor.update_inventory = function(self, player)
|
||||
local name = armor:get_valid_player(player, "[set_player_armor]")
|
||||
if not name or inv_mod == "inventory_enhanced" then
|
||||
return
|
||||
end
|
||||
if inv_mod == "unified_inventory" then
|
||||
if unified_inventory.current_page[name] == "armor" then
|
||||
unified_inventory.set_inventory_formspec(player, "armor")
|
||||
end
|
||||
else
|
||||
local formspec = armor:get_armor_formspec(name)
|
||||
if inv_mod == "inventory_plus" then
|
||||
formspec = formspec.."listring[current_player;main]"
|
||||
.."listring[detached:"..name.."_armor;armor]"
|
||||
local page = player:get_inventory_formspec()
|
||||
if page:find("detached:"..name.."_armor") then
|
||||
inventory_plus.set_inventory_formspec(player, formspec)
|
||||
end
|
||||
else
|
||||
player:set_inventory_formspec(formspec)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
armor.get_valid_player = function(self, player, msg)
|
||||
msg = msg or ""
|
||||
if not player then
|
||||
minetest.log("error", "3d_armor: Player reference is nil "..msg)
|
||||
return
|
||||
end
|
||||
local name = player:get_player_name()
|
||||
if not name then
|
||||
minetest.log("error", "3d_armor: Player name is nil "..msg)
|
||||
return
|
||||
end
|
||||
local pos = player:getpos()
|
||||
local player_inv = player:get_inventory()
|
||||
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
|
||||
if not pos then
|
||||
minetest.log("error", "3d_armor: Player position is nil "..msg)
|
||||
return
|
||||
elseif not player_inv then
|
||||
minetest.log("error", "3d_armor: Player inventory is nil "..msg)
|
||||
return
|
||||
elseif not armor_inv then
|
||||
minetest.log("error", "3d_armor: Detached armor inventory is nil "..msg)
|
||||
return
|
||||
end
|
||||
return name, player_inv, armor_inv, pos
|
||||
end
|
||||
|
||||
-- Register Player Model
|
||||
|
||||
default.player_register_model("3d_armor_character.b3d", {
|
||||
animation_speed = 30,
|
||||
textures = {
|
||||
armor.default_skin..".png",
|
||||
"3d_armor_trans.png",
|
||||
"3d_armor_trans.png",
|
||||
},
|
||||
animations = {
|
||||
stand = {x=0, y=79},
|
||||
lay = {x=162, y=166},
|
||||
walk = {x=168, y=187},
|
||||
mine = {x=189, y=198},
|
||||
walk_mine = {x=200, y=219},
|
||||
sit = {x=81, y=160},
|
||||
},
|
||||
})
|
||||
|
||||
-- Register Callbacks
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
local name = armor:get_valid_player(player, "[on_player_receive_fields]")
|
||||
if not name or inv_mod == "inventory_enhanced" then
|
||||
return
|
||||
end
|
||||
if inv_mod == "inventory_plus" and fields.armor then
|
||||
local formspec = armor:get_armor_formspec(name)
|
||||
inventory_plus.set_inventory_formspec(player, formspec)
|
||||
return
|
||||
end
|
||||
for field, _ in pairs(fields) do
|
||||
if string.find(field, "skins_set") then
|
||||
minetest.after(0, function(player)
|
||||
local skin = armor:get_player_skin(name)
|
||||
armor.textures[name].skin = skin..".png"
|
||||
armor:set_player_armor(player)
|
||||
end, player)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
default.player_set_model(player, "3d_armor_character.b3d")
|
||||
local name = player:get_player_name()
|
||||
local player_inv = player:get_inventory()
|
||||
local armor_inv = minetest.create_detached_inventory(name.."_armor", {
|
||||
on_put = function(inv, listname, index, stack, player)
|
||||
player:get_inventory():set_stack(listname, index, stack)
|
||||
armor:set_player_armor(player)
|
||||
armor:update_inventory(player)
|
||||
end,
|
||||
on_take = function(inv, listname, index, stack, player)
|
||||
player:get_inventory():set_stack(listname, index, nil)
|
||||
armor:set_player_armor(player)
|
||||
armor:update_inventory(player)
|
||||
end,
|
||||
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||
local plaver_inv = player:get_inventory()
|
||||
local old_stack = inv:get_stack(from_list, from_index)
|
||||
local stack = inv:get_stack(to_list, to_index)
|
||||
player_inv:set_stack(to_list, to_index, stack)
|
||||
player_inv:set_stack(from_list, from_index, old_stack)
|
||||
armor:set_player_armor(player)
|
||||
armor:update_inventory(player)
|
||||
end,
|
||||
allow_put = function(inv, listname, index, stack, player)
|
||||
--DEBUT modif MFF (crabman/24/06/2015)
|
||||
local name = stack:get_name()
|
||||
local player_inv = player:get_inventory()
|
||||
local size = player_inv:get_size(listname)
|
||||
if not ( (name:split(":")[1] == "3d_armor" and stack:get_definition().groups["armor_heal"]) or name:split(":")[1] == "shields" or name:split(":")[1] == "technic_armor") then
|
||||
return 0
|
||||
end
|
||||
|
||||
-- if player class != item class
|
||||
if not pclasses.api.util.can_have_item(player:get_player_name(), name) then
|
||||
return 0
|
||||
end
|
||||
|
||||
--MFF (crabman/27/11/2015) no same item type. *helmet*
|
||||
local ptype = name:split(":")[2]:split("_")[1]
|
||||
if ptype == "enchanted" then
|
||||
ptype = name:split(":")[2]:split("_")[2]
|
||||
end
|
||||
for i=1, size do
|
||||
local stack = player_inv:get_stack(listname, i)
|
||||
if stack:get_count() > 0 then
|
||||
if stack:get_name():find(ptype) then
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if name:find("shield") then
|
||||
for i=1, size do
|
||||
local stack = player_inv:get_stack(listname, i)
|
||||
if stack:get_count() > 0 then
|
||||
if armors_no_shields[stack:get_name()] ~= nil then
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if armors_no_shields[name] ~= nil then
|
||||
for i=1, size do
|
||||
local stack = player_inv:get_stack(listname, i)
|
||||
if stack:get_count() > 0 then
|
||||
if stack:get_name():find("shields:") then
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--FIN modif MFF (crabman/24/06/2015)
|
||||
return 1
|
||||
end,
|
||||
allow_take = function(inv, listname, index, stack, player)
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||
return count
|
||||
end,
|
||||
})
|
||||
if inv_mod == "inventory_plus" then
|
||||
inventory_plus.register_button(player,"armor", "Armor")
|
||||
end
|
||||
armor_inv:set_size("armor", 6)
|
||||
player_inv:set_size("armor", 6)
|
||||
for i=1, 6 do
|
||||
local stack = player_inv:get_stack("armor", i)
|
||||
armor_inv:set_stack("armor", i, stack)
|
||||
end
|
||||
armor.def[name] = {
|
||||
state = 0,
|
||||
count = 0,
|
||||
level = 0,
|
||||
heal = 0,
|
||||
jump = 1,
|
||||
speed = 1,
|
||||
gravity = 1,
|
||||
fire = 0,
|
||||
water = 0,
|
||||
radiation = 0,
|
||||
}
|
||||
armor.textures[name] = {
|
||||
skin = armor.default_skin..".png",
|
||||
armor = "3d_armor_trans.png",
|
||||
wielditem = "3d_armor_trans.png",
|
||||
preview = armor.default_skin.."_preview.png",
|
||||
}
|
||||
if skin_mod == "skins" then
|
||||
local skin = skins.skins[name]
|
||||
if skin and skins.get_type(skin) == skins.type.MODEL then
|
||||
armor.textures[name].skin = skin..".png"
|
||||
end
|
||||
elseif skin_mod == "simple_skins" then
|
||||
local skin = skins.skins[name]
|
||||
if skin then
|
||||
armor.textures[name].skin = skin..".png"
|
||||
end
|
||||
elseif skin_mod == "u_skins" then
|
||||
local skin = u_skins.u_skins[name]
|
||||
if skin and u_skins.get_type(skin) == u_skins.type.MODEL then
|
||||
armor.textures[name].skin = skin..".png"
|
||||
end
|
||||
elseif skin_mod == "wardrobe" then
|
||||
local skin = wardrobe.playerSkins[name]
|
||||
if skin then
|
||||
armor.textures[name].skin = skin
|
||||
end
|
||||
end
|
||||
if minetest.get_modpath("player_textures") then
|
||||
local filename = minetest.get_modpath("player_textures").."/textures/player_"..name
|
||||
local f = io.open(filename..".png")
|
||||
if f then
|
||||
f:close()
|
||||
armor.textures[name].skin = "player_"..name..".png"
|
||||
end
|
||||
end
|
||||
for i=1, ARMOR_INIT_TIMES do
|
||||
minetest.after(ARMOR_INIT_DELAY * i, function(player)
|
||||
armor:set_player_armor(player)
|
||||
if not inv_mod then
|
||||
armor:update_inventory(player)
|
||||
end
|
||||
end, player)
|
||||
end
|
||||
end)
|
||||
--[[
|
||||
if ARMOR_DROP == true or ARMOR_DESTROY == true then
|
||||
armor.drop_armor = function(pos, stack)
|
||||
local obj = minetest.add_item(pos, stack)
|
||||
if obj then
|
||||
obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)})
|
||||
end
|
||||
end
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[on_dieplayer]")
|
||||
if not name then
|
||||
return
|
||||
end
|
||||
local drop = {}
|
||||
for i=1, player_inv:get_size("armor") do
|
||||
local stack = armor_inv:get_stack("armor", i)
|
||||
-- Modification for MFF
|
||||
if stack:get_count() > 0 and (not pclasses.data.reserved_items[armor_inv:get_stack("armor", i):get_name()] or
|
||||
not pclasses.api.util.can_have_item(name, armor_inv:get_stack("armor", i):get_name())) then
|
||||
table.insert(drop, stack)
|
||||
armor_inv:set_stack("armor", i, nil)
|
||||
player_inv:set_stack("armor", i, nil)
|
||||
end
|
||||
end
|
||||
armor:set_player_armor(player)
|
||||
if inv_mod == "unified_inventory" then
|
||||
unified_inventory.set_inventory_formspec(player, "craft")
|
||||
elseif inv_mod == "inventory_plus" then
|
||||
local formspec = inventory_plus.get_formspec(player,"main")
|
||||
inventory_plus.set_inventory_formspec(player, formspec)
|
||||
else
|
||||
armor:update_inventory(player)
|
||||
end
|
||||
if ARMOR_DESTROY == false then
|
||||
minetest.after(ARMOR_BONES_DELAY, function()
|
||||
local node = minetest.get_node(vector.round(pos))
|
||||
-- Modification for MFF
|
||||
if node and node.name == "bones:bones" then
|
||||
local meta = minetest.get_meta(vector.round(pos))
|
||||
local owner = meta:get_string("owner")
|
||||
local inv = meta:get_inventory()
|
||||
for _,stack in ipairs(drop) do
|
||||
if name == owner and inv:room_for_item("main", stack) then
|
||||
inv:add_item("main", stack)
|
||||
else
|
||||
armor.drop_armor(pos, stack)
|
||||
end
|
||||
end
|
||||
else
|
||||
for _,stack in ipairs(drop) do
|
||||
armor.drop_armor(pos, stack)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
--]]
|
||||
|
||||
minetest.register_on_player_hpchange(function(player, hp_change)
|
||||
local name, player_inv, armor_inv = armor:get_valid_player(player, "[on_hpchange]")
|
||||
if name and hp_change < 0 then
|
||||
|
||||
-- used for insta kill tools/commands like /kill (doesnt damage armor)
|
||||
if hp_change < -100 then
|
||||
return hp_change
|
||||
end
|
||||
|
||||
local heal_max = 0
|
||||
local state = 0
|
||||
local items = 0
|
||||
for i=1, 6 do
|
||||
local stack = player_inv:get_stack("armor", i)
|
||||
if stack:get_count() > 0 then
|
||||
local use = stack:get_definition().groups["armor_use"] or 0
|
||||
local heal = stack:get_definition().groups["armor_heal"] or 0
|
||||
local item = stack:get_name()
|
||||
stack:add_wear(use)
|
||||
armor_inv:set_stack("armor", i, stack)
|
||||
player_inv:set_stack("armor", i, stack)
|
||||
state = state + stack:get_wear()
|
||||
items = items + 1
|
||||
if stack:get_count() == 0 then
|
||||
local desc = minetest.registered_items[item].description
|
||||
if desc then
|
||||
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
|
||||
end
|
||||
armor:set_player_armor(player)
|
||||
armor:update_inventory(player)
|
||||
end
|
||||
heal_max = heal_max + heal
|
||||
end
|
||||
end
|
||||
armor.def[name].state = state
|
||||
armor.def[name].count = items
|
||||
heal_max = heal_max * ARMOR_HEAL_MULTIPLIER
|
||||
if heal_max > math.random(100) then
|
||||
hp_change = 0
|
||||
end
|
||||
armor:update_armor(player)
|
||||
end
|
||||
return hp_change
|
||||
end, true)
|
||||
|
||||
-- Fire Protection and water breating, added by TenPlus1
|
||||
|
||||
if ARMOR_FIRE_PROTECT == true then
|
||||
-- override hot nodes so they do not hurt player anywhere but mod
|
||||
for _, row in pairs(ARMOR_FIRE_NODES) do
|
||||
if minetest.registered_nodes[row[1]] then
|
||||
minetest.override_item(row[1], {damage_per_second = 0})
|
||||
end
|
||||
end
|
||||
else
|
||||
minetest.log("info", "[3d_armor] Fire Nodes disabled")
|
||||
end
|
||||
|
||||
function armor_step()
|
||||
for _,player in pairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
local pos = player:getpos()
|
||||
local hp = player:get_hp()
|
||||
-- water breathing
|
||||
if name and armor.def[name].water > 0 then
|
||||
if player:get_breath() < 10 then
|
||||
player:set_breath(10)
|
||||
end
|
||||
end
|
||||
-- fire protection
|
||||
if ARMOR_FIRE_PROTECT == true
|
||||
and name and pos and hp then
|
||||
pos.y = pos.y + 1.4 -- head level
|
||||
local node_head = minetest.get_node(pos).name
|
||||
pos.y = pos.y - 1.2 -- feet level
|
||||
local node_feet = minetest.get_node(pos).name
|
||||
-- is player inside a hot node?
|
||||
for _, row in pairs(ARMOR_FIRE_NODES) do
|
||||
-- check fire protection, if not enough then get hurt
|
||||
if row[1] == node_head or row[1] == node_feet then
|
||||
if hp > 0 and armor.def[name].fire < row[2] then
|
||||
hp = hp - row[3] * ARMOR_UPDATE_TIME
|
||||
player:set_hp(hp)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
minetest.after(ARMOR_UPDATE_TIME, armor_step)
|
||||
end
|
||||
|
||||
-- Launch once started
|
||||
minetest.after(0, armor_step)
|
||||
|
||||
|
||||
-- kill player when command issued
|
||||
minetest.register_chatcommand("kill", {
|
||||
params = "<name>",
|
||||
description = "Kills player instantly",
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
player:set_hp(-1001)
|
||||
end
|
||||
end,
|
||||
})
|
|
@ -1,78 +0,0 @@
|
|||
3d_armor -- Crafting Guide
|
||||
--------------------------
|
||||
|
||||
Helmets:
|
||||
|
||||
+---+---+---+
|
||||
| X | X | X |
|
||||
+---+---+---+
|
||||
| X | | X |
|
||||
+---+---+---+
|
||||
| | | |
|
||||
+---+---+---+
|
||||
|
||||
[3d_armor:helmet_wood] X = [default:wood]
|
||||
[3d_armor:helmet_cactus] X = [default:cactus]
|
||||
[3d_armor:helmet_steel] X = [default:steel_ingot]
|
||||
[3d_armor:helmet_bronze] X = [default:bronze_ingot]
|
||||
[3d_armor:helmet_diamond] X = [default:diamond]
|
||||
[3d_armor:helmet_gold] X = [default:gold_ingot]
|
||||
[3d_armor:helmet_mithril] X = [default:mithril_ingot]
|
||||
[3d_armor:helmet_crystal] X = [ethereal:crystal_ingot] *
|
||||
|
||||
Chestplates:
|
||||
|
||||
+---+---+---+
|
||||
| X | | X |
|
||||
+---+---+---+
|
||||
| X | X | X |
|
||||
+---+---+---+
|
||||
| X | X | X |
|
||||
+---+---+---+
|
||||
|
||||
[3d_armor:chestplate_wood] X = [default:wood]
|
||||
[3d_armor:chestplate_cactus] X = [default:cactus]
|
||||
[3d_armor:chestplate_steel] X = [default:steel_ingot]
|
||||
[3d_armor:chestplate_bronze] X = [default:bronze_ingot]
|
||||
[3d_armor:chestplate_diamond] X = [default:diamond]
|
||||
[3d_armor:chestplate_gold] X = [default:gold_ingot]
|
||||
[3d_armor:chestplate_mithril] X = [default:mithril_ingot]
|
||||
[3d_armor:chestplate_crystal] X = [ethereal:crystal_ingot] *
|
||||
|
||||
Leggings:
|
||||
|
||||
+---+---+---+
|
||||
| X | X | X |
|
||||
+---+---+---+
|
||||
| X | | X |
|
||||
+---+---+---+
|
||||
| X | | X |
|
||||
+---+---+---+
|
||||
|
||||
[3d_armor:leggings_wood] X = [default:wood]
|
||||
[3d_armor:leggings_cactus] X = [default:cactus]
|
||||
[3d_armor:leggings_steel] X = [default:steel_ingot]
|
||||
[3d_armor:leggings_bronze] X = [default:bronze_ingot]
|
||||
[3d_armor:leggings_diamond] X = [default:diamond]
|
||||
[3d_armor:leggings_gold] X = [default:gold_ingot]
|
||||
[3d_armor:leggings_mithril] X = [default:mithril_ingot]
|
||||
[3d_armor:leggings_crystal] X = [ethereal:crystal_ingot] *
|
||||
|
||||
Boots:
|
||||
|
||||
+---+---+---+
|
||||
| X | | X |
|
||||
+---+---+---+
|
||||
| X | | X |
|
||||
+---+---+---+
|
||||
|
||||
[3d_armor:boots_wood] X = [default:wood]
|
||||
[3d_armor:boots_cactus] X = [default:cactus]
|
||||
[3d_armor:boots_steel] X = [default:steel_ingot]
|
||||
[3d_armor:boots_bronze] X = [default:bronze_ingot
|
||||
[3d_armor:boots_diamond] X = [default:diamond]
|
||||
[3d_armor:boots_gold] X = [default:gold_ingot]
|
||||
[3d_armor:boots_mithril] X = [default:mithril_ingot]
|
||||
[3d_armor:boots_crystal] X = [ethereal:crystal_ingot] *
|
||||
|
||||
* Requires ethereal mod by Chinchow & TenPlus1 - https://github.com/tenplus1/ethereal
|
|
@ -1,7 +0,0 @@
|
|||
default
|
||||
player_physics
|
||||
inventory_plus?
|
||||
unified_inventory?
|
||||
fire?
|
||||
ethereal?
|
||||
bakedclay?
|
|
@ -1 +0,0 @@
|
|||
Adds craftable armor that is visible to other players.
|
|
@ -1,254 +0,0 @@
|
|||
ARMOR_MOD_NAME = minetest.get_current_modname()
|
||||
dofile(minetest.get_modpath(ARMOR_MOD_NAME).."/armor.lua")
|
||||
dofile(minetest.get_modpath(ARMOR_MOD_NAME).."/admin.lua")
|
||||
|
||||
if ARMOR_MATERIALS.wood then
|
||||
minetest.register_tool("3d_armor:helmet_wood", {
|
||||
description = "Wood Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_wood.png",
|
||||
groups = {armor_head=1, armor_heal=0, armor_use=2000},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_wood", {
|
||||
description = "Wood Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_wood.png",
|
||||
groups = {armor_torso=3, armor_heal=0, armor_use=2000},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_wood", {
|
||||
description = "Wood Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_wood.png",
|
||||
groups = {armor_legs=3, armor_heal=0, armor_use=2000},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_wood", {
|
||||
description = "Wood Boots",
|
||||
inventory_image = "3d_armor_inv_boots_wood.png",
|
||||
groups = {armor_feet=1, armor_heal=0, armor_use=2000},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
if ARMOR_MATERIALS.cactus then
|
||||
minetest.register_tool("3d_armor:helmet_cactus", {
|
||||
description = "Cactus Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_cactus.png",
|
||||
groups = {armor_head=3, armor_heal=0, armor_use=1000},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_cactus", {
|
||||
description = "Cactus Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_cactus.png",
|
||||
groups = {armor_torso=5, armor_heal=0, armor_use=1000},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_cactus", {
|
||||
description = "Cactus Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_cactus.png",
|
||||
groups = {armor_legs=5, armor_heal=0, armor_use=1000},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_cactus", {
|
||||
description = "Cactus Boots",
|
||||
inventory_image = "3d_armor_inv_boots_cactus.png",
|
||||
groups = {armor_feet=3, armor_heal=0, armor_use=1000},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
if ARMOR_MATERIALS.steel then
|
||||
minetest.register_tool("3d_armor:helmet_steel", {
|
||||
description = "Steel Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_steel.png",
|
||||
groups = {armor_head=4, armor_heal=0, armor_use=500},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_steel", {
|
||||
description = "Steel Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_steel.png",
|
||||
groups = {armor_torso=8, armor_heal=0, armor_use=500},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_steel", {
|
||||
description = "Steel Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_steel.png",
|
||||
groups = {armor_legs=8, armor_heal=0, armor_use=500},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_steel", {
|
||||
description = "Steel Boots",
|
||||
inventory_image = "3d_armor_inv_boots_steel.png",
|
||||
groups = {armor_feet=4, armor_heal=0, armor_use=500},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
if ARMOR_MATERIALS.bronze then
|
||||
minetest.register_tool("3d_armor:helmet_bronze", {
|
||||
description = "Bronze Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_bronze.png",
|
||||
groups = {armor_head=5, armor_heal=0, armor_use=250},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_bronze", {
|
||||
description = "Bronze Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_bronze.png",
|
||||
groups = {armor_torso=9, armor_heal=0, armor_use=250},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_bronze", {
|
||||
description = "Bronze Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_bronze.png",
|
||||
groups = {armor_legs=9, armor_heal=0, armor_use=250},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_bronze", {
|
||||
description = "Bronze Boots",
|
||||
inventory_image = "3d_armor_inv_boots_bronze.png",
|
||||
groups = {armor_feet=5, armor_heal=0, armor_use=250},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
if ARMOR_MATERIALS.diamond then
|
||||
minetest.register_tool("3d_armor:helmet_diamond", {
|
||||
description = "Diamond Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_diamond.png",
|
||||
groups = {armor_head=7, armor_heal=0, armor_use=100},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_diamond", {
|
||||
description = "Diamond Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_diamond.png",
|
||||
groups = {armor_torso=13, armor_heal=0, armor_use=100},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_diamond", {
|
||||
description = "Diamond Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_diamond.png",
|
||||
groups = {armor_legs=13, armor_heal=0, armor_use=100},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_diamond", {
|
||||
description = "Diamond Boots",
|
||||
inventory_image = "3d_armor_inv_boots_diamond.png",
|
||||
groups = {armor_feet=7, armor_heal=0, armor_use=100},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
if ARMOR_MATERIALS.gold then
|
||||
minetest.register_tool("3d_armor:helmet_gold", {
|
||||
description = "Gold Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_gold.png",
|
||||
groups = {armor_head=5, armor_heal=0, armor_use=200},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_gold", {
|
||||
description = "Gold Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_gold.png",
|
||||
groups = {armor_torso=11, armor_heal=0, armor_use=200},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_gold", {
|
||||
description = "Gold Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_gold.png",
|
||||
groups = {armor_legs=11, armor_heal=0, armor_use=200},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_gold", {
|
||||
description = "Gold Boots",
|
||||
inventory_image = "3d_armor_inv_boots_gold.png",
|
||||
groups = {armor_feet=5, armor_heal=0, armor_use=200},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
if ARMOR_MATERIALS.mithril then
|
||||
minetest.register_tool("3d_armor:helmet_mithril", {
|
||||
description = "Mithril Helmet (Warrior)",
|
||||
inventory_image = "3d_armor_inv_helmet_mithril.png",
|
||||
groups = {armor_head=9, armor_heal=0, armor_use=50},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_mithril", {
|
||||
description = "Mithril Chestplate (Warrior)",
|
||||
inventory_image = "3d_armor_inv_chestplate_mithril.png",
|
||||
groups = {armor_torso=15, armor_heal=0, armor_use=50},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_mithril", {
|
||||
description = "Mithril Leggings (Warrior)",
|
||||
inventory_image = "3d_armor_inv_leggings_mithril.png",
|
||||
groups = {armor_legs=15, armor_heal=0, armor_use=50},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_mithril", {
|
||||
description = "Mithril Boots (Warrior)",
|
||||
inventory_image = "3d_armor_inv_boots_mithril.png",
|
||||
groups = {armor_feet=9, armor_heal=0, armor_use=50},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
if ARMOR_MATERIALS.crystal then
|
||||
minetest.register_tool("3d_armor:helmet_crystal", {
|
||||
description = "Crystal Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_crystal.png",
|
||||
groups = {armor_head=15, armor_heal=0, armor_use=50, armor_fire=1},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:chestplate_crystal", {
|
||||
description = "Crystal Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_crystal.png",
|
||||
groups = {armor_torso=20, armor_heal=0, armor_use=50, armor_fire=1},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:leggings_crystal", {
|
||||
description = "Crystal Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_crystal.png",
|
||||
groups = {armor_legs=20, armor_heal=0, armor_use=50, armor_fire=1},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("3d_armor:boots_crystal", {
|
||||
description = "Crystal Boots",
|
||||
inventory_image = "3d_armor_inv_boots_crystal.png",
|
||||
groups = {armor_feet=15, armor_heal=0, armor_use=50, physics_speed=1, physics_jump=0.5, armor_fire=1},
|
||||
wear = 0,
|
||||
})
|
||||
end
|
||||
|
||||
for k, v in pairs(ARMOR_MATERIALS) do
|
||||
minetest.register_craft({
|
||||
output = "3d_armor:helmet_"..k,
|
||||
recipe = {
|
||||
{v, v, v},
|
||||
{v, "", v},
|
||||
{"", "", ""},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "3d_armor:chestplate_"..k,
|
||||
recipe = {
|
||||
{v, "", v},
|
||||
{v, v, v},
|
||||
{v, v, v},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "3d_armor:leggings_"..k,
|
||||
recipe = {
|
||||
{v, v, v},
|
||||
{v, "", v},
|
||||
{v, "", v},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "3d_armor:boots_"..k,
|
||||
recipe = {
|
||||
{v, "", v},
|
||||
{v, "", v},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 548 B |
Before Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 903 B |
Before Width: | Height: | Size: 821 B |
Before Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 872 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 779 B |
Before Width: | Height: | Size: 854 B |
Before Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 501 B |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 869 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 834 B |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 732 B |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 932 B |
Before Width: | Height: | Size: 471 B |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 129 B |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 142 B |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 154 B |