Compare commits
	
		
			20 Commits
		
	
	
		
			2d280a5a1e
			...
			1869d4b0c3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1869d4b0c3 | |||
| 
						 | 
					e1a262ba20 | ||
| 
						 | 
					ac445a6cd0 | ||
| c95eb77a4e | |||
| 
						 | 
					a9b8bc4ddd | ||
| 6757013da2 | |||
| 
						 | 
					b6651fd396 | ||
| 
						 | 
					16e2648416 | ||
| 
						 | 
					44778d7861 | ||
| 5845d3682d | |||
| 
						 | 
					8dcbc42525 | ||
| 
						 | 
					c0f303abc1 | ||
| 
						 | 
					46c599333e | ||
| 
						 | 
					da78601a77 | ||
| 
						 | 
					c790b20169 | ||
| 
						 | 
					a897f7e72f | ||
| e8f938bd2c | |||
| 
						 | 
					ac7615212b | ||
| 3bc7ed06e2 | |||
| 
						 | 
					38fc2cff2b | 
							
								
								
									
										5
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					.* export-ignore
 | 
				
			||||||
 | 
					gendoc.sh export-ignore
 | 
				
			||||||
 | 
					integration-test.sh export-ignore
 | 
				
			||||||
 | 
					preview_gen.py export-ignore
 | 
				
			||||||
 | 
					screenshot.xcf export-ignore
 | 
				
			||||||
							
								
								
									
										31
									
								
								.github/workflows/reference.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					name: Build Reference
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  push:
 | 
				
			||||||
 | 
					    branches:
 | 
				
			||||||
 | 
					    - master
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  build:
 | 
				
			||||||
 | 
					    name: Build
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: Checkout
 | 
				
			||||||
 | 
					      uses: actions/checkout@v2
 | 
				
			||||||
 | 
					    - name: Setup Lua
 | 
				
			||||||
 | 
					      uses: leafo/gh-actions-lua@v8
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        luaVersion: 5.4
 | 
				
			||||||
 | 
					    - name: Setup Lua Rocks
 | 
				
			||||||
 | 
					      uses: leafo/gh-actions-luarocks@v4
 | 
				
			||||||
 | 
					    - name: Setup LDoc dependencies
 | 
				
			||||||
 | 
					      run: luarocks install --only-deps https://raw.githubusercontent.com/lunarmodules/LDoc/master/ldoc-scm-3.rockspec
 | 
				
			||||||
 | 
					    - name: Setup LDoc
 | 
				
			||||||
 | 
					      run: git clone --single-branch --branch=custom https://github.com/AntumDeluge/ldoc.git .ldoc/ldoc && chmod +x .ldoc/ldoc/ldoc.lua
 | 
				
			||||||
 | 
					    - name: Generate docs
 | 
				
			||||||
 | 
					      run: chmod +x .ldoc/gendoc.sh && ./.ldoc/gendoc.sh
 | 
				
			||||||
 | 
					    - name: Deploy
 | 
				
			||||||
 | 
					      uses: peaceiris/actions-gh-pages@v3
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        github_token: ${{ secrets.GITHUB_TOKEN }}
 | 
				
			||||||
 | 
					        publish_dir: ./3d_armor/docs
 | 
				
			||||||
							
								
								
									
										335
									
								
								.ldoc/config.ld
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,335 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					-- place this file in mod ".ldoc" directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local print, type, string, table, tostring, tonumber, error, pairs, ipairs
 | 
				
			||||||
 | 
					if import then
 | 
				
			||||||
 | 
						print = import("print")
 | 
				
			||||||
 | 
						type = import("type")
 | 
				
			||||||
 | 
						string = import("string")
 | 
				
			||||||
 | 
						table = import("table")
 | 
				
			||||||
 | 
						tostring = import("tostring")
 | 
				
			||||||
 | 
						tonumber = import("tonumber")
 | 
				
			||||||
 | 
						error = import("error")
 | 
				
			||||||
 | 
						pairs = import("pairs")
 | 
				
			||||||
 | 
						ipairs = import("ipairs")
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					project = "3d_armor"
 | 
				
			||||||
 | 
					title = "3D Armor"
 | 
				
			||||||
 | 
					format = "markdown"
 | 
				
			||||||
 | 
					not_luadoc = true
 | 
				
			||||||
 | 
					boilerplate = false
 | 
				
			||||||
 | 
					wrap = false
 | 
				
			||||||
 | 
					style = true
 | 
				
			||||||
 | 
					favicon = "https://www.minetest.net/media/icon.svg"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					file = {
 | 
				
			||||||
 | 
						"3d_armor/api.lua",
 | 
				
			||||||
 | 
						".ldoc/settings.luadoc",
 | 
				
			||||||
 | 
						--".ldoc/armors.luadoc",
 | 
				
			||||||
 | 
						".ldoc/helmets.luadoc",
 | 
				
			||||||
 | 
						".ldoc/chestplates.luadoc",
 | 
				
			||||||
 | 
						".ldoc/leggings.luadoc",
 | 
				
			||||||
 | 
						".ldoc/boots.luadoc",
 | 
				
			||||||
 | 
						--".ldoc/shields.luadoc",
 | 
				
			||||||
 | 
						"shields/init.lua",
 | 
				
			||||||
 | 
						".ldoc/crafting.luadoc",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					new_type("setting", "Settings")
 | 
				
			||||||
 | 
					new_type("armor", "Armors")
 | 
				
			||||||
 | 
					new_type("craft", "Craft Recipes")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					alias("helmet", "armor")
 | 
				
			||||||
 | 
					alias("chestplate", "armor")
 | 
				
			||||||
 | 
					alias("leggings", "armor")
 | 
				
			||||||
 | 
					alias("boots", "armor")
 | 
				
			||||||
 | 
					alias("shield", "armor")
 | 
				
			||||||
 | 
					alias("grp", "group")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- function declarations
 | 
				
			||||||
 | 
					local format_text
 | 
				
			||||||
 | 
					local format_group
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_tags = {
 | 
				
			||||||
 | 
						-- settings
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"settype",
 | 
				
			||||||
 | 
							title = "Type",
 | 
				
			||||||
 | 
							hidden = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"min",
 | 
				
			||||||
 | 
							title = "Minimum Value",
 | 
				
			||||||
 | 
							hidden = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"max",
 | 
				
			||||||
 | 
							title = "Maximum Value",
 | 
				
			||||||
 | 
							hidden = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"default",
 | 
				
			||||||
 | 
							title = "Default Value",
 | 
				
			||||||
 | 
							hidden = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						-- craft items/tools
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							-- specify image basename only
 | 
				
			||||||
 | 
							"img",
 | 
				
			||||||
 | 
							title = "Inventory Image",
 | 
				
			||||||
 | 
							format = function(value)
 | 
				
			||||||
 | 
								return "<img src=\"../data/" .. value .. "\" style=\"width:32px; height:32px;\" />"
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							-- specify full (relative or absolute) image path
 | 
				
			||||||
 | 
							"image",
 | 
				
			||||||
 | 
							title = "Image",
 | 
				
			||||||
 | 
							format = function(value)
 | 
				
			||||||
 | 
								return "<img src=\"" .. value .. "\" style=\"width:32px; height:32px;\" />"
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"group",
 | 
				
			||||||
 | 
							title = "Groups",
 | 
				
			||||||
 | 
							format = function(value)
 | 
				
			||||||
 | 
								return format_group(value)
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"armorgrp",
 | 
				
			||||||
 | 
							title = "Armor Groups",
 | 
				
			||||||
 | 
							format = function(value)
 | 
				
			||||||
 | 
								return format_group(value)
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"damagegrp",
 | 
				
			||||||
 | 
							title = "Damage Groups",
 | 
				
			||||||
 | 
							format = function(value)
 | 
				
			||||||
 | 
								return format_group(value)
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if string then
 | 
				
			||||||
 | 
						string.trim = function(st, delim)
 | 
				
			||||||
 | 
							if not delim then
 | 
				
			||||||
 | 
								delim = " "
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							while string.find(st, delim) == 1 do
 | 
				
			||||||
 | 
								st = st:sub(2)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							while string.sub(st, string.len(st)) == delim do
 | 
				
			||||||
 | 
								st = st:sub(1, string.len(st)-1)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return st
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						string.split = function(st, delim)
 | 
				
			||||||
 | 
							local list = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							local idx = string.find(st, delim)
 | 
				
			||||||
 | 
							while idx do
 | 
				
			||||||
 | 
								table.insert(list, st:sub(1, idx-1))
 | 
				
			||||||
 | 
								st = st:sub(idx+1)
 | 
				
			||||||
 | 
								idx = string.find(st, delim)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							-- add remaining item
 | 
				
			||||||
 | 
							table.insert(list, st)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return list
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if table then
 | 
				
			||||||
 | 
						if not table.copy then
 | 
				
			||||||
 | 
							table.copy = function(orig_table)
 | 
				
			||||||
 | 
								local new_table = {}
 | 
				
			||||||
 | 
								for k, v in pairs(orig_table) do
 | 
				
			||||||
 | 
									new_table[k] = v
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								return new_table
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					format_text = function(text, flags)
 | 
				
			||||||
 | 
						local ret = "<"
 | 
				
			||||||
 | 
						local ttype = "span"
 | 
				
			||||||
 | 
						if flags.code then
 | 
				
			||||||
 | 
							ttype = "code"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ret = ret .. ttype .. " style=\""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if flags.size then
 | 
				
			||||||
 | 
							ret = ret .. "font-size:" .. flags.size .. ";"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if flags.mono then
 | 
				
			||||||
 | 
							ret = ret .. "font-family:monospace;"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if flags.italic then
 | 
				
			||||||
 | 
							ret = ret .. "font-style:italic;"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if flags.bold then
 | 
				
			||||||
 | 
							ret = ret .. "font-weight:bold;"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if flags.color then
 | 
				
			||||||
 | 
							ret = ret .. "color:" .. flags.color .. ";"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if flags.bgcolor then
 | 
				
			||||||
 | 
							ret = ret .. "background-color:" .. flags.bgcolor .. ";"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ret = ret .. "\">" .. text .. "</" .. ttype .. ">"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return ret
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					format_group = function(text)
 | 
				
			||||||
 | 
						if string then
 | 
				
			||||||
 | 
							local idx, k, v = string.find(text, " ")
 | 
				
			||||||
 | 
							if idx then
 | 
				
			||||||
 | 
								text = format_text(string.sub(text, 1, idx-1) .. ": ", {mono=true, color="darkgreen"})
 | 
				
			||||||
 | 
									.. string.sub(text, idx)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return text
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function format_setting_tag(desc, value)
 | 
				
			||||||
 | 
						return "\n- <span style=\"font-size:80%;\">`" .. desc .. ":`</span> `" .. value .. "`"
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local registered = {
 | 
				
			||||||
 | 
						settings = {},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function setting_handler(item)
 | 
				
			||||||
 | 
						-- avoid parsing again
 | 
				
			||||||
 | 
						if registered.settings[item.name] then
 | 
				
			||||||
 | 
							return item
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if not ipairs or not type then
 | 
				
			||||||
 | 
							return item
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local tags = {
 | 
				
			||||||
 | 
							{"settype", "type"},
 | 
				
			||||||
 | 
							{"default"},
 | 
				
			||||||
 | 
							{"min", "minimum value"},
 | 
				
			||||||
 | 
							{"max", "maximum value"},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local def = {
 | 
				
			||||||
 | 
							["settype"] = format_setting_tag("type", "string"),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for _, t in ipairs(tags) do
 | 
				
			||||||
 | 
							local name = t[1]
 | 
				
			||||||
 | 
							local desc = t[2]
 | 
				
			||||||
 | 
							if not desc then desc = name end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							local value = item.tags[name]
 | 
				
			||||||
 | 
							if type(value) == "table" then
 | 
				
			||||||
 | 
								if #value > 1 then
 | 
				
			||||||
 | 
									local msg = item.file.filename .. " (line " .. item.lineno
 | 
				
			||||||
 | 
										.. "): multiple instances of tag \"" .. name .. "\" found"
 | 
				
			||||||
 | 
									if error then
 | 
				
			||||||
 | 
										error(msg)
 | 
				
			||||||
 | 
									elseif print then
 | 
				
			||||||
 | 
										print("WARNING: " .. msg)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if value[1] then
 | 
				
			||||||
 | 
									def[name] = format_setting_tag(desc, value[1])
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						item.description = item.description .. "\n\n**Definition:**\n" .. def.settype
 | 
				
			||||||
 | 
						for _, t in ipairs({def.default, def.min, def.max}) do
 | 
				
			||||||
 | 
							if t then
 | 
				
			||||||
 | 
								item.description = item.description .. t
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						registered.settings[item.name] = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return item
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function custom_display_name_handler(item, default_handler)
 | 
				
			||||||
 | 
						if item.type == "setting" then
 | 
				
			||||||
 | 
							item = setting_handler(item)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if item then
 | 
				
			||||||
 | 
							return default_handler(item)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local custom_see_links = {
 | 
				
			||||||
 | 
						["ObjectRef"] = "https://minetest.gitlab.io/minetest/class-reference/#objectref",
 | 
				
			||||||
 | 
						["PlayerMetaRef"] = "https://minetest.gitlab.io/minetest/class-reference/#playermetaref",
 | 
				
			||||||
 | 
						["ItemDef"] = "https://minetest.gitlab.io/minetest/definition-tables/#item-definition",
 | 
				
			||||||
 | 
						["ItemStack"] = "https://minetest.gitlab.io/minetest/class-reference/#itemstack",
 | 
				
			||||||
 | 
						["groups"] = "https://minetest.gitlab.io/minetest/groups/",
 | 
				
			||||||
 | 
						["entity_damage_mechanism"] = "https://minetest.gitlab.io/minetest/entity-damage-mechanism/",
 | 
				
			||||||
 | 
						["vector"] = "https://minetest.gitlab.io/minetest/representations-of-simple-things/#positionvector",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local function format_custom_see(name, section)
 | 
				
			||||||
 | 
						local url = custom_see_links[name]
 | 
				
			||||||
 | 
						if not url then
 | 
				
			||||||
 | 
							url = ""
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if not name then
 | 
				
			||||||
 | 
							name = ""
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return name, url
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_see_handler("^(ObjectRef)$", function(name, section)
 | 
				
			||||||
 | 
						return format_custom_see(name, section)
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_see_handler("^(PlayerMetaRef)$", function(name, section)
 | 
				
			||||||
 | 
						return format_custom_see(name, section)
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_see_handler("^(ItemDef)$", function(name, section)
 | 
				
			||||||
 | 
						return format_custom_see(name, section)
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_see_handler("^(groups)$", function(name, section)
 | 
				
			||||||
 | 
						return format_custom_see(name, section)
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_see_handler("^(entity_damage_mechanism)$", function(name, section)
 | 
				
			||||||
 | 
						return format_custom_see(name, section)
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_see_handler("^(ItemStack)$", function(name, section)
 | 
				
			||||||
 | 
						return format_custom_see(name, section)
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					custom_see_handler("^(vector)$", function(name, section)
 | 
				
			||||||
 | 
						return name, "https://minetest.gitlab.io/minetest/representations-of-simple-things/#positionvector"
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
							
								
								
									
										88
									
								
								.ldoc/gendoc.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						@@ -0,0 +1,88 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Place this file in mod ".ldoc" directory.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# To change output directory set the `d_export` environment variable.
 | 
				
			||||||
 | 
					# Example:
 | 
				
			||||||
 | 
					#   $ d_export=/custom/path ./gendoc.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					d_ldoc="$(dirname $(readlink -f $0))"
 | 
				
			||||||
 | 
					f_config="${d_ldoc}/config.ld"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cd "${d_ldoc}/.."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					d_root="$(pwd)"
 | 
				
			||||||
 | 
					d_export="${d_export:-${d_root}/3d_armor/docs/reference}"
 | 
				
			||||||
 | 
					d_data="${d_export}/data"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cmd_ldoc="${d_ldoc}/ldoc/ldoc.lua"
 | 
				
			||||||
 | 
					if test -f "${cmd_ldoc}"; then
 | 
				
			||||||
 | 
						if test ! -x "${cmd_ldoc}"; then
 | 
				
			||||||
 | 
							chmod +x "${cmd_ldoc}"
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						cmd_ldoc="ldoc"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# clean old files
 | 
				
			||||||
 | 
					rm -rf "${d_export}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# generate items, settings, & crafts topics temp files
 | 
				
			||||||
 | 
					echo -e "\ngenerating temp files ..."
 | 
				
			||||||
 | 
					for script in "src" "settings" "crafts"; do
 | 
				
			||||||
 | 
						script="${d_ldoc}/parse_${script}.py"
 | 
				
			||||||
 | 
						if test ! -f "${script}"; then
 | 
				
			||||||
 | 
							echo "ERROR: script doesn't exist: ${script}"
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							# check script's executable bit
 | 
				
			||||||
 | 
							if test ! -x "${script}"; then
 | 
				
			||||||
 | 
								chmod +x "${script}"
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
							# execute script
 | 
				
			||||||
 | 
							"${script}"
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# generate new doc files
 | 
				
			||||||
 | 
					"${cmd_ldoc}" --UNSAFE_NO_SANDBOX -c "${f_config}" -d "${d_export}" "${d_root}"; retval=$?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# check exit status
 | 
				
			||||||
 | 
					if test ${retval} -ne 0; then
 | 
				
			||||||
 | 
						echo -e "\nan error occurred (ldoc return code: ${retval})"
 | 
				
			||||||
 | 
						exit ${retval}
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -e "\ncleaning temp files ..."
 | 
				
			||||||
 | 
					rm -vf "${d_ldoc}/"*.luadoc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# HACK: ldoc does not seem to like the "shields:" prefix
 | 
				
			||||||
 | 
					echo -e "\ncompensating for LDoc's issue with \"shields:\" prefix ..."
 | 
				
			||||||
 | 
					sed -i \
 | 
				
			||||||
 | 
						-e 's/<strong>shield_/<strong>shields:shield_/' \
 | 
				
			||||||
 | 
						-e 's/<td class="name\(.*\)>shield_/<td class="name\1>shields:shield_/' \
 | 
				
			||||||
 | 
						-e 's/<a href="#shield_/<a href="#shields:shield_/' \
 | 
				
			||||||
 | 
						-e 's/<a name.*"shield_/<a name="shields:shield_/' \
 | 
				
			||||||
 | 
						"${d_export}/topics/shields.html"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# copy textures to data directory
 | 
				
			||||||
 | 
					printf "\ncopying textures ..."
 | 
				
			||||||
 | 
					mkdir -p "${d_data}"
 | 
				
			||||||
 | 
					texture_count=0
 | 
				
			||||||
 | 
					for d_mod in "3d_armor" "shields"; do
 | 
				
			||||||
 | 
						printf "\rcopying textures from ${d_mod} ...\n"
 | 
				
			||||||
 | 
						for png in $(find "${d_root}/${d_mod}/textures" -maxdepth 1 -type f -name "*.png"); do
 | 
				
			||||||
 | 
							if test -f "${d_data}/$(basename ${png})"; then
 | 
				
			||||||
 | 
								echo "WARNING: not overwriting existing file: ${png}"
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								cp "${png}" "${d_data}"
 | 
				
			||||||
 | 
								texture_count=$((texture_count + 1))
 | 
				
			||||||
 | 
								printf "\rcopied ${texture_count} textures"
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
						done
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -e "\n\nDone!"
 | 
				
			||||||
							
								
								
									
										305
									
								
								.ldoc/ldoc.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,305 @@
 | 
				
			|||||||
 | 
					/* BEGIN RESET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Copyright (c) 2010, Yahoo! Inc. All rights reserved.
 | 
				
			||||||
 | 
					Code licensed under the BSD License:
 | 
				
			||||||
 | 
					http://developer.yahoo.com/yui/license.html
 | 
				
			||||||
 | 
					version: 2.8.2r1
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					html {
 | 
				
			||||||
 | 
					    color: #000;
 | 
				
			||||||
 | 
					    background: #FFF;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
 | 
				
			||||||
 | 
					    margin: 0;
 | 
				
			||||||
 | 
					    padding: 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					table {
 | 
				
			||||||
 | 
					    border-collapse: collapse;
 | 
				
			||||||
 | 
					    border-spacing: 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					fieldset,img {
 | 
				
			||||||
 | 
					    border: 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					address,caption,cite,code,dfn,em,strong,th,var,optgroup {
 | 
				
			||||||
 | 
					    font-style: inherit;
 | 
				
			||||||
 | 
					    font-weight: inherit;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					del,ins {
 | 
				
			||||||
 | 
					    text-decoration: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					li {
 | 
				
			||||||
 | 
					    margin-left: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					caption,th {
 | 
				
			||||||
 | 
					    text-align: left;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					h1,h2,h3,h4,h5,h6 {
 | 
				
			||||||
 | 
					    font-size: 100%;
 | 
				
			||||||
 | 
					    font-weight: bold;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					q:before,q:after {
 | 
				
			||||||
 | 
					    content: '';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					abbr,acronym {
 | 
				
			||||||
 | 
					    border: 0;
 | 
				
			||||||
 | 
					    font-variant: normal;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					sup {
 | 
				
			||||||
 | 
					    vertical-align: baseline;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					sub {
 | 
				
			||||||
 | 
					    vertical-align: baseline;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					legend {
 | 
				
			||||||
 | 
					    color: #000;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					input,button,textarea,select,optgroup,option {
 | 
				
			||||||
 | 
					    font-family: inherit;
 | 
				
			||||||
 | 
					    font-size: inherit;
 | 
				
			||||||
 | 
					    font-style: inherit;
 | 
				
			||||||
 | 
					    font-weight: inherit;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					input,button,textarea,select {*font-size:100%;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					/* END RESET */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					body {
 | 
				
			||||||
 | 
					    margin-left: 1em;
 | 
				
			||||||
 | 
					    margin-right: 1em;
 | 
				
			||||||
 | 
					    font-family: arial, helvetica, geneva, sans-serif;
 | 
				
			||||||
 | 
					    background-color: #ffffff; margin: 0px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					code, tt { font-family: monospace; font-size: 1.1em; }
 | 
				
			||||||
 | 
					span.parameter { font-family:monospace; }
 | 
				
			||||||
 | 
					span.parameter:after { content:":"; }
 | 
				
			||||||
 | 
					span.types:before { content:"("; }
 | 
				
			||||||
 | 
					span.types:after { content:")"; }
 | 
				
			||||||
 | 
					.type { font-weight: bold; font-style:italic }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					body, p, td, th { font-size: .95em; line-height: 1.2em;}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					p, ul { margin: 10px 0 0 0px;}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					strong { font-weight: bold;}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					em { font-style: italic;}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					h1 {
 | 
				
			||||||
 | 
					    font-size: 1.5em;
 | 
				
			||||||
 | 
					    margin: 20px 0 20px 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					h2, h3, h4 { margin: 15px 0 10px 0; }
 | 
				
			||||||
 | 
					h2 { font-size: 1.25em; }
 | 
				
			||||||
 | 
					h3 { font-size: 1.15em; }
 | 
				
			||||||
 | 
					h4 { font-size: 1.06em; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					a:link { font-weight: bold; color: #004080; text-decoration: none; }
 | 
				
			||||||
 | 
					a:visited { font-weight: bold; color: #006699; text-decoration: none; }
 | 
				
			||||||
 | 
					a:link:hover { text-decoration: underline; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					hr {
 | 
				
			||||||
 | 
					    color:#cccccc;
 | 
				
			||||||
 | 
					    background: #00007f;
 | 
				
			||||||
 | 
					    height: 1px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blockquote { margin-left: 3em; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ul { list-style-type: disc; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					p.name {
 | 
				
			||||||
 | 
					    font-family: "Andale Mono", monospace;
 | 
				
			||||||
 | 
					    padding-top: 1em;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pre {
 | 
				
			||||||
 | 
					    background-color: rgb(245, 245, 245);
 | 
				
			||||||
 | 
					    border: 1px solid #C0C0C0; /* silver */
 | 
				
			||||||
 | 
					    padding: 10px;
 | 
				
			||||||
 | 
					    margin: 10px 0 10px 0;
 | 
				
			||||||
 | 
					    overflow: auto;
 | 
				
			||||||
 | 
					    font-family: "Andale Mono", monospace;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pre.example {
 | 
				
			||||||
 | 
					    font-size: .85em;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.index { border: 1px #00007f; }
 | 
				
			||||||
 | 
					table.index td { text-align: left; vertical-align: top; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#container {
 | 
				
			||||||
 | 
					    margin-left: 1em;
 | 
				
			||||||
 | 
					    margin-right: 1em;
 | 
				
			||||||
 | 
					    background-color: #f0f0f0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#product {
 | 
				
			||||||
 | 
					    text-align: center;
 | 
				
			||||||
 | 
					    border-bottom: 1px solid #cccccc;
 | 
				
			||||||
 | 
					    background-color: #ffffff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#product big {
 | 
				
			||||||
 | 
					    font-size: 2em;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#main {
 | 
				
			||||||
 | 
					    background-color: #f0f0f0;
 | 
				
			||||||
 | 
					    border-left: 2px solid #cccccc;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#navigation {
 | 
				
			||||||
 | 
					    float: left;
 | 
				
			||||||
 | 
					    width: 14em;
 | 
				
			||||||
 | 
					    vertical-align: top;
 | 
				
			||||||
 | 
					    background-color: #f0f0f0;
 | 
				
			||||||
 | 
					    overflow: visible;
 | 
				
			||||||
 | 
					    position: fixed;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#navigation h2 {
 | 
				
			||||||
 | 
					    background-color:#e7e7e7;
 | 
				
			||||||
 | 
					    font-size:1.1em;
 | 
				
			||||||
 | 
					    color:#000000;
 | 
				
			||||||
 | 
					    text-align: left;
 | 
				
			||||||
 | 
					    padding:0.2em;
 | 
				
			||||||
 | 
					    border-top:1px solid #dddddd;
 | 
				
			||||||
 | 
					    border-bottom:1px solid #dddddd;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#navigation ul
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    font-size:1em;
 | 
				
			||||||
 | 
					    list-style-type: none;
 | 
				
			||||||
 | 
					    margin: 1px 1px 10px 1px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#navigation li {
 | 
				
			||||||
 | 
					    text-indent: -1em;
 | 
				
			||||||
 | 
					    display: block;
 | 
				
			||||||
 | 
					    margin: 3px 0px 0px 22px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#navigation li li a {
 | 
				
			||||||
 | 
					    margin: 0px 3px 0px -1em;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#content {
 | 
				
			||||||
 | 
					    margin-left: 14em;
 | 
				
			||||||
 | 
					    padding: 1em;
 | 
				
			||||||
 | 
					    width: 700px;
 | 
				
			||||||
 | 
					    border-left: 2px solid #cccccc;
 | 
				
			||||||
 | 
					    border-right: 2px solid #cccccc;
 | 
				
			||||||
 | 
					    background-color: #ffffff;
 | 
				
			||||||
 | 
					    min-height: 425px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#about {
 | 
				
			||||||
 | 
					    clear: both;
 | 
				
			||||||
 | 
					    padding: 5px;
 | 
				
			||||||
 | 
					    border-top: 2px solid #cccccc;
 | 
				
			||||||
 | 
					    background-color: #ffffff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@media print {
 | 
				
			||||||
 | 
					    body {
 | 
				
			||||||
 | 
					        font: 12pt "Times New Roman", "TimeNR", Times, serif;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    a { font-weight: bold; color: #004080; text-decoration: underline; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    #main {
 | 
				
			||||||
 | 
					        background-color: #ffffff;
 | 
				
			||||||
 | 
					        border-left: 0px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    #container {
 | 
				
			||||||
 | 
					        margin-left: 2%;
 | 
				
			||||||
 | 
					        margin-right: 2%;
 | 
				
			||||||
 | 
					        background-color: #ffffff;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    #content {
 | 
				
			||||||
 | 
					        padding: 1em;
 | 
				
			||||||
 | 
					        background-color: #ffffff;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    #navigation {
 | 
				
			||||||
 | 
					        display: none;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    pre.example {
 | 
				
			||||||
 | 
					        font-family: "Andale Mono", monospace;
 | 
				
			||||||
 | 
					        font-size: 10pt;
 | 
				
			||||||
 | 
					        page-break-inside: avoid;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.module_list {
 | 
				
			||||||
 | 
					    border-width: 1px;
 | 
				
			||||||
 | 
					    border-style: solid;
 | 
				
			||||||
 | 
					    border-color: #cccccc;
 | 
				
			||||||
 | 
					    border-collapse: collapse;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					table.module_list td {
 | 
				
			||||||
 | 
					    border-width: 1px;
 | 
				
			||||||
 | 
					    padding: 3px;
 | 
				
			||||||
 | 
					    border-style: solid;
 | 
				
			||||||
 | 
					    border-color: #cccccc;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					table.module_list td.name { background-color: #f0f0f0; min-width: 200px; }
 | 
				
			||||||
 | 
					table.module_list td.summary { width: 100%; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.function_list {
 | 
				
			||||||
 | 
					    border-width: 1px;
 | 
				
			||||||
 | 
					    border-style: solid;
 | 
				
			||||||
 | 
					    border-color: #cccccc;
 | 
				
			||||||
 | 
					    border-collapse: collapse;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					table.function_list td {
 | 
				
			||||||
 | 
					    border-width: 1px;
 | 
				
			||||||
 | 
					    padding: 3px;
 | 
				
			||||||
 | 
					    border-style: solid;
 | 
				
			||||||
 | 
					    border-color: #cccccc;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					table.function_list td.name { background-color: #f0f0f0; min-width: 200px; }
 | 
				
			||||||
 | 
					table.function_list td.summary { width: 100%; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ul.nowrap {
 | 
				
			||||||
 | 
					    overflow:auto;
 | 
				
			||||||
 | 
					    white-space:nowrap;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
 | 
				
			||||||
 | 
					dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
 | 
				
			||||||
 | 
					dl.table h3, dl.function h3 {font-size: .95em;}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* stop sublists from having initial vertical space */
 | 
				
			||||||
 | 
					ul ul { margin-top: 0px; }
 | 
				
			||||||
 | 
					ol ul { margin-top: 0px; }
 | 
				
			||||||
 | 
					ol ol { margin-top: 0px; }
 | 
				
			||||||
 | 
					ul ol { margin-top: 0px; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* make the target distinct; helps when we're navigating to a function */
 | 
				
			||||||
 | 
					a:target + * {
 | 
				
			||||||
 | 
					  background-color: #FF9;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* styles for prettification of source */
 | 
				
			||||||
 | 
					pre .comment { color: #558817; }
 | 
				
			||||||
 | 
					pre .constant { color: #a8660d; }
 | 
				
			||||||
 | 
					pre .escape { color: #844631; }
 | 
				
			||||||
 | 
					pre .keyword { color: #aa5050; font-weight: bold; }
 | 
				
			||||||
 | 
					pre .library { color: #0e7c6b; }
 | 
				
			||||||
 | 
					pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
 | 
				
			||||||
 | 
					pre .string { color: #8080ff; }
 | 
				
			||||||
 | 
					pre .number { color: #f8660d; }
 | 
				
			||||||
 | 
					pre .operator { color: #2239a8; font-weight: bold; }
 | 
				
			||||||
 | 
					pre .preprocessor, pre .prepro { color: #a33243; }
 | 
				
			||||||
 | 
					pre .global { color: #800080; }
 | 
				
			||||||
 | 
					pre .user-keyword { color: #800080; }
 | 
				
			||||||
 | 
					pre .prompt { color: #558817; }
 | 
				
			||||||
 | 
					pre .url { color: #272fc2; text-decoration: underline; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										46
									
								
								.ldoc/parse_crafts.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This script will parse source files for craft recipes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import sys, os, codecs, errno
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					path = os.path.realpath(__file__)
 | 
				
			||||||
 | 
					script = os.path.basename(path)
 | 
				
			||||||
 | 
					d_root = os.path.dirname(os.path.dirname(path))
 | 
				
			||||||
 | 
					d_ldoc = os.path.join(d_root, ".ldoc")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					craftfile = os.path.realpath(os.path.join(d_root, "3d_armor/armor.lua"))
 | 
				
			||||||
 | 
					if not os.path.isfile(craftfile):
 | 
				
			||||||
 | 
						print("ERROR: craft file does not exist for parsing: {}".format(craftfile))
 | 
				
			||||||
 | 
						sys.exit(errnor.ENOENT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					buffer = codecs.open(craftfile, "r", "utf-8")
 | 
				
			||||||
 | 
					if not buffer:
 | 
				
			||||||
 | 
						print("ERROR: could not open file for reading: {}".format(craftfile))
 | 
				
			||||||
 | 
						sys.exit(errno.EIO)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					data_in = buffer.read()
 | 
				
			||||||
 | 
					buffer.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					craft = ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					data_in = data_in.replace("\r\n", "\n").replace("\r", "\n")
 | 
				
			||||||
 | 
					for sect in data_in.split("\n---"):
 | 
				
			||||||
 | 
						if "@craft armor" in sect:
 | 
				
			||||||
 | 
							sect = "---{}".format(sect)
 | 
				
			||||||
 | 
							for li in sect.split("\n"):
 | 
				
			||||||
 | 
								if li.startswith("--"):
 | 
				
			||||||
 | 
									craft = "{}\n{}".format(craft, li)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					outfile = os.path.join(d_ldoc, "crafting.luadoc")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					buffer = codecs.open(outfile, "w", "utf-8")
 | 
				
			||||||
 | 
					if not buffer:
 | 
				
			||||||
 | 
						print("ERROR: could not open file for writing: {}".format(outfile))
 | 
				
			||||||
 | 
						sys.exit(errno.EIO)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					buffer.write("\n--- 3D Armor Crafting\n--\n--  @topic crafting\n\n{}\n".format(craft))
 | 
				
			||||||
 | 
					buffer.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					print("crafts exported to\t{}".format(outfile))
 | 
				
			||||||
							
								
								
									
										118
									
								
								.ldoc/parse_settings.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						@@ -0,0 +1,118 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This script will format "settingtypes.txt" file found at the root
 | 
				
			||||||
 | 
					# of 3d_armor modpack into a format readable by LDoc.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import sys, os, errno, codecs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					path = os.path.realpath(__file__)
 | 
				
			||||||
 | 
					script = os.path.basename(path)
 | 
				
			||||||
 | 
					d_root = os.path.dirname(os.path.dirname(path))
 | 
				
			||||||
 | 
					d_ldoc = os.path.join(d_root, ".ldoc")
 | 
				
			||||||
 | 
					f_settings = os.path.join(d_root, "settingtypes.txt")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if not os.path.isfile(f_settings):
 | 
				
			||||||
 | 
						print("settingtypes.txt does not exist")
 | 
				
			||||||
 | 
						sys.exit(errno.ENOENT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					i_stream = codecs.open(f_settings, "r", "utf-8")
 | 
				
			||||||
 | 
					data_in = i_stream.read()
 | 
				
			||||||
 | 
					i_stream.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					data_in = data_in.replace("\r", "")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sets = data_in.split("\n\n")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for idx in reversed(range(len(sets))):
 | 
				
			||||||
 | 
						set = sets[idx]
 | 
				
			||||||
 | 
						lines = set.split("\n")
 | 
				
			||||||
 | 
						for idx2 in reversed(range(len(lines))):
 | 
				
			||||||
 | 
							li = lines[idx2].strip(" \t")
 | 
				
			||||||
 | 
							if li == "" or li[0] == "[":
 | 
				
			||||||
 | 
								lines.pop(idx2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(lines) == 0:
 | 
				
			||||||
 | 
							sets.pop(idx)
 | 
				
			||||||
 | 
						else:
 | 
				
			||||||
 | 
							sets[idx] = "\n".join(lines)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					filtered = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for set in sets:
 | 
				
			||||||
 | 
						comment = False
 | 
				
			||||||
 | 
						lines = set.split("\n")
 | 
				
			||||||
 | 
						new_lines = []
 | 
				
			||||||
 | 
						for li in lines:
 | 
				
			||||||
 | 
							if li[0] == "#":
 | 
				
			||||||
 | 
								new_lines.append(li)
 | 
				
			||||||
 | 
							else:
 | 
				
			||||||
 | 
								new_lines.append(li)
 | 
				
			||||||
 | 
								filtered.append("\n".join(new_lines))
 | 
				
			||||||
 | 
								new_lines = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					settings = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def parse_setting(set):
 | 
				
			||||||
 | 
						desc = []
 | 
				
			||||||
 | 
						setting = summary = stype = sdefault = soptions = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for li in set.split("\n"):
 | 
				
			||||||
 | 
							if li[0] == "#":
 | 
				
			||||||
 | 
								desc.append("--  {}".format(li.lstrip(" #")))
 | 
				
			||||||
 | 
							else:
 | 
				
			||||||
 | 
								setting = li.split(" ")[0]
 | 
				
			||||||
 | 
								summary = li.split(")")[0].split("(")[-1]
 | 
				
			||||||
 | 
								li = li.split(")")[-1].strip()
 | 
				
			||||||
 | 
								rem = li.split(" ")
 | 
				
			||||||
 | 
								stype = rem[0]
 | 
				
			||||||
 | 
								rem.pop(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if len(rem) > 0:
 | 
				
			||||||
 | 
									sdefault = rem[0]
 | 
				
			||||||
 | 
									rem.pop(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if len(rem) > 0:
 | 
				
			||||||
 | 
									soptions = " ".join(rem)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if not setting:
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						st = "---"
 | 
				
			||||||
 | 
						if summary:
 | 
				
			||||||
 | 
							if summary[-1] != ".":
 | 
				
			||||||
 | 
								summary = "{}.".format(summary)
 | 
				
			||||||
 | 
							st = "{} {}".format(st, summary)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						st = "{}\n--".format(st)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(desc) > 0:
 | 
				
			||||||
 | 
							st = "{}\n{}\n--".format(st, "\n".join(desc))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						st = "{}\n--  @setting {}".format(st, setting)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if stype:
 | 
				
			||||||
 | 
							st = "{}\n--  @settype {}".format(st, stype)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if sdefault:
 | 
				
			||||||
 | 
							st = "{}\n--  @default {}".format(st, sdefault)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# TODO: add options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						settings.append(st)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for f in filtered:
 | 
				
			||||||
 | 
						parse_setting(f)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					outfile = os.path.join(d_ldoc, "settings.luadoc")
 | 
				
			||||||
 | 
					data_out = "\n--- 3D Armor Settings\n--\n--  @topic settings\n\n\n{}\n".format("\n\n".join(settings))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					o_stream = codecs.open(outfile, "w", "utf-8")
 | 
				
			||||||
 | 
					if not o_stream:
 | 
				
			||||||
 | 
						print("ERROR: could not open file for writing: {}".format(outfile))
 | 
				
			||||||
 | 
						sys.exit(errno.EIO)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					o_stream.write(data_out)
 | 
				
			||||||
 | 
					o_stream.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					print("settings exported to\t{}".format(outfile))
 | 
				
			||||||
							
								
								
									
										90
									
								
								.ldoc/parse_src.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						@@ -0,0 +1,90 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This script will parse source files for docstring.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import os, codecs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					path = os.path.realpath(__file__)
 | 
				
			||||||
 | 
					script = os.path.basename(path)
 | 
				
			||||||
 | 
					d_root = os.path.dirname(os.path.dirname(path))
 | 
				
			||||||
 | 
					d_ldoc = os.path.join(d_root, ".ldoc")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					armor_types = {
 | 
				
			||||||
 | 
						"armor": {"topic": "Armors", "values": []},
 | 
				
			||||||
 | 
						"helmet": {"topic": "Helmets", "values": []},
 | 
				
			||||||
 | 
						"chestplate": {"topic": "Chestplates", "values": []},
 | 
				
			||||||
 | 
						"leggings": {"topic": "Leggings", "values": []},
 | 
				
			||||||
 | 
						"boots": {"topic": "Boots", "values": []},
 | 
				
			||||||
 | 
						#"shield": {"topic": "Shields", "values": []},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def parse_file(f):
 | 
				
			||||||
 | 
						buffer = codecs.open(f, "r", "utf-8")
 | 
				
			||||||
 | 
						if not buffer:
 | 
				
			||||||
 | 
							print("ERROR: could not open file for reading: {}".format(f))
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						data_in = buffer.read()
 | 
				
			||||||
 | 
						buffer.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# format to LF (Unix)
 | 
				
			||||||
 | 
						data_in = data_in.replace("\r\n", "\n").replace("\r", "\n")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						current_item = []
 | 
				
			||||||
 | 
						item_type = None
 | 
				
			||||||
 | 
						new_item = False
 | 
				
			||||||
 | 
						for li in data_in.split("\n"):
 | 
				
			||||||
 | 
							li = li.strip()
 | 
				
			||||||
 | 
							if li.startswith("---"):
 | 
				
			||||||
 | 
								new_item = True
 | 
				
			||||||
 | 
							elif not li.startswith("--"):
 | 
				
			||||||
 | 
								new_item = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if new_item:
 | 
				
			||||||
 | 
								current_item.append(li)
 | 
				
			||||||
 | 
								if not item_type:
 | 
				
			||||||
 | 
									for a_type in armor_types:
 | 
				
			||||||
 | 
										if "@{} ".format(a_type) in li:
 | 
				
			||||||
 | 
											item_type = a_type
 | 
				
			||||||
 | 
											break
 | 
				
			||||||
 | 
							elif item_type and len(current_item):
 | 
				
			||||||
 | 
								armor_types[item_type]["values"].append("\n".join(current_item))
 | 
				
			||||||
 | 
								item_type = None
 | 
				
			||||||
 | 
								current_item = []
 | 
				
			||||||
 | 
							else:
 | 
				
			||||||
 | 
								current_item = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					to_parse = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for obj in os.listdir(d_root):
 | 
				
			||||||
 | 
						fullpath = os.path.join(d_root, obj)
 | 
				
			||||||
 | 
						if not obj.startswith(".") and os.path.isdir(fullpath):
 | 
				
			||||||
 | 
							for root, dirs, files in os.walk(fullpath):
 | 
				
			||||||
 | 
								for f in files:
 | 
				
			||||||
 | 
									if f.endswith(".lua"):
 | 
				
			||||||
 | 
										to_parse.append(os.path.join(root, f))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for p in to_parse:
 | 
				
			||||||
 | 
						if not os.path.isfile(p):
 | 
				
			||||||
 | 
							print("ERROR: {} is not a file".format(p))
 | 
				
			||||||
 | 
						else:
 | 
				
			||||||
 | 
							parse_file(p)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for t in armor_types:
 | 
				
			||||||
 | 
						topic = armor_types[t]["topic"]
 | 
				
			||||||
 | 
						items = armor_types[t]["values"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(items):
 | 
				
			||||||
 | 
							outfile = os.path.join(d_ldoc, "{}.luadoc".format(topic.lower()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							buffer = codecs.open(outfile, "w", "utf-8")
 | 
				
			||||||
 | 
							if not buffer:
 | 
				
			||||||
 | 
								print("ERROR: could not open file for writing: {}".format(outfile))
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							buffer.write("\n--- 3D Armor {}\n--\n--  @topic {}\n\n\n{}\n".format(topic, topic.lower(), "\n\n".join(items)))
 | 
				
			||||||
 | 
							buffer.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							print("{} exported to\t{}".format(topic.lower(), outfile))
 | 
				
			||||||
@@ -18,6 +18,7 @@ read_globals = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	-- deps
 | 
						-- deps
 | 
				
			||||||
	"default",
 | 
						"default",
 | 
				
			||||||
 | 
						"player_api",
 | 
				
			||||||
	"minetest",
 | 
						"minetest",
 | 
				
			||||||
	"unified_inventory",
 | 
						"unified_inventory",
 | 
				
			||||||
	"wardrobe",
 | 
						"wardrobe",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,6 +53,7 @@ Change the following default settings by going to Main Menu>>Settings(Tab)>>All
 | 
				
			|||||||
    armor_material_gold = true
 | 
					    armor_material_gold = true
 | 
				
			||||||
    armor_material_mithril = true
 | 
					    armor_material_mithril = true
 | 
				
			||||||
    armor_material_crystal = true
 | 
					    armor_material_crystal = true
 | 
				
			||||||
 | 
					    armor_material_nether = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Initialization glitches when a player first joins
 | 
					### Initialization glitches when a player first joins
 | 
				
			||||||
 **Increase to prevent glitches**
 | 
					 **Increase to prevent glitches**
 | 
				
			||||||
@@ -253,7 +254,7 @@ The above allows armor to block/prevent new damage types but you also need to as
 | 
				
			|||||||
## Groups used by 3d_Armor
 | 
					## Groups used by 3d_Armor
 | 
				
			||||||
3d_armor has many default groups already registered, these are categorized under 4 main headings
 | 
					3d_armor has many default groups already registered, these are categorized under 4 main headings
 | 
				
			||||||
 - **Elements:** armor_head, armor_torso, armor_legs, armor_feet
 | 
					 - **Elements:** armor_head, armor_torso, armor_legs, armor_feet
 | 
				
			||||||
 - **Attributes:** armor_heal, armor_fire, armor_water
 | 
					 - **Attributes:** armor_heal, armor_fire, armor_water, armor_feather
 | 
				
			||||||
 - **Physics:** physics_jump, physics_speed, physics_gravity
 | 
					 - **Physics:** physics_jump, physics_speed, physics_gravity
 | 
				
			||||||
 - **Durability:** armor_use, flammable
 | 
					 - **Durability:** armor_use, flammable
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -333,6 +334,9 @@ The below Diamond chestplate has a 12% chance to completely block all damage (ar
 | 
				
			|||||||
		damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Armor_feather
 | 
				
			||||||
 | 
					***"Armor_feather"*** will slow a player when falling. This only has one level or state, which is armor_feather=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Physics
 | 
					### Physics
 | 
				
			||||||
The physics attributes supported by 3d_armor are ***physics_jump, physics_speed and physics_gravity***. Although 3d_armor supports the use of this with no other mods it is recommended that the mod [player_monoids](https://forum.minetest.net/viewtopic.php?t=14895) is used to help with intermod compatability. 
 | 
					The physics attributes supported by 3d_armor are ***physics_jump, physics_speed and physics_gravity***. Although 3d_armor supports the use of this with no other mods it is recommended that the mod [player_monoids](https://forum.minetest.net/viewtopic.php?t=14895) is used to help with intermod compatability. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -396,6 +400,8 @@ If all of the above were made of material "wood" the player would recieve an ***
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Armor Functions
 | 
					## Armor Functions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See also: [API Reference](https://minetest-mods.github.io/3d_armor/reference/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### armor set_player_armor
 | 
					### armor set_player_armor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	armor:set_player_armor(player)
 | 
						armor:set_player_armor(player)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										341
									
								
								3d_armor/api.lua
									
									
									
									
									
								
							
							
						
						@@ -1,3 +1,82 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					--- 3D Armor API
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @topic api
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local transparent_armor = minetest.settings:get_bool("armor_transparent", false)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Tables
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section tables
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Armor definition table used for registering armor.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @table ArmorDef
 | 
				
			||||||
 | 
					--  @tfield string description Human-readable name/description.
 | 
				
			||||||
 | 
					--  @tfield string inventory_image Image filename used for icon.
 | 
				
			||||||
 | 
					--  @tfield table groups See: `ArmorDef.groups`
 | 
				
			||||||
 | 
					--  @tfield table armor_groups See: `ArmorDef.armor_groups`
 | 
				
			||||||
 | 
					--  @tfield table damage_groups See: `ArmorDef.damage_groups`
 | 
				
			||||||
 | 
					--  @see ItemDef
 | 
				
			||||||
 | 
					--  @usage local def = {
 | 
				
			||||||
 | 
					--    description = "Wood Helmet",
 | 
				
			||||||
 | 
					--    inventory_image = "3d_armor_inv_helmet_wood.png",
 | 
				
			||||||
 | 
					--    groups = {armor_head=1, armor_heal=0, armor_use=2000, flammable=1},
 | 
				
			||||||
 | 
					--    armor_groups = {fleshy=5},
 | 
				
			||||||
 | 
					--    damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
				
			||||||
 | 
					--  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Groups table.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  General groups defining item behavior.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Some commonly used groups: ***armor\_<type>***, ***armor\_heal***, ***armor\_use***
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @table ArmorDef.groups
 | 
				
			||||||
 | 
					--  @tfield int armor_type The armor type. "head", "torso", "hands", "shield", etc.
 | 
				
			||||||
 | 
					--  (**Note:** replace "type" with actual type).
 | 
				
			||||||
 | 
					--  @tfield int armor_heal Healing value of armor when equipped.
 | 
				
			||||||
 | 
					--  @tfield int armor_use Amount of uses/damage before armor "breaks".
 | 
				
			||||||
 | 
					--  @see groups
 | 
				
			||||||
 | 
					--  @usage groups = {
 | 
				
			||||||
 | 
					--    armor_head = 1,
 | 
				
			||||||
 | 
					--    armor_heal = 5,
 | 
				
			||||||
 | 
					--    armor_use = 2000,
 | 
				
			||||||
 | 
					--    flammable = 1,
 | 
				
			||||||
 | 
					--  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Armor groups table.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Groups that this item is effective against when taking damage.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Some commonly used groups: ***fleshy***
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @table ArmorDef.armor_groups
 | 
				
			||||||
 | 
					--  @usage armor_groups = {
 | 
				
			||||||
 | 
					--    fleshy = 5,
 | 
				
			||||||
 | 
					--  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Damage groups table.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Groups that this item is effective on when used as a weapon/tool.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Some commonly used groups: ***cracky***, ***snappy***, ***choppy***, ***crumbly***, ***level***
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @table ArmorDef.damage_groups
 | 
				
			||||||
 | 
					--  @see entity_damage_mechanism
 | 
				
			||||||
 | 
					--  @usage damage_groups = {
 | 
				
			||||||
 | 
					--    cracky = 3,
 | 
				
			||||||
 | 
					--    snappy = 2,
 | 
				
			||||||
 | 
					--    choppy = 3,
 | 
				
			||||||
 | 
					--    crumbly = 2,
 | 
				
			||||||
 | 
					--    level = 1,
 | 
				
			||||||
 | 
					--  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- @section end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- support for i18n
 | 
					-- support for i18n
 | 
				
			||||||
local S = minetest.get_translator(minetest.get_current_modname())
 | 
					local S = minetest.get_translator(minetest.get_current_modname())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -33,7 +112,7 @@ armor = {
 | 
				
			|||||||
	timer = 0,
 | 
						timer = 0,
 | 
				
			||||||
	elements = {"head", "torso", "legs", "feet"},
 | 
						elements = {"head", "torso", "legs", "feet"},
 | 
				
			||||||
	physics = {"jump", "speed", "gravity"},
 | 
						physics = {"jump", "speed", "gravity"},
 | 
				
			||||||
	attributes = {"heal", "fire", "water"},
 | 
						attributes = {"heal", "fire", "water", "feather"},
 | 
				
			||||||
	formspec = "image[2.5,0;2,4;armor_preview]"..
 | 
						formspec = "image[2.5,0;2,4;armor_preview]"..
 | 
				
			||||||
		default.gui_bg..
 | 
							default.gui_bg..
 | 
				
			||||||
		default.gui_bg_img..
 | 
							default.gui_bg_img..
 | 
				
			||||||
@@ -53,6 +132,7 @@ armor = {
 | 
				
			|||||||
		gold = "default:gold_ingot",
 | 
							gold = "default:gold_ingot",
 | 
				
			||||||
		mithril = "moreores:mithril_ingot",
 | 
							mithril = "moreores:mithril_ingot",
 | 
				
			||||||
		crystal = "ethereal:crystal_ingot",
 | 
							crystal = "ethereal:crystal_ingot",
 | 
				
			||||||
 | 
							nether = "nether:nether_ingot",
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	fire_nodes = {
 | 
						fire_nodes = {
 | 
				
			||||||
		{"nether:lava_source",      5, 8},
 | 
							{"nether:lava_source",      5, 8},
 | 
				
			||||||
@@ -97,16 +177,33 @@ armor.config = {
 | 
				
			|||||||
	material_gold = true,
 | 
						material_gold = true,
 | 
				
			||||||
	material_mithril = true,
 | 
						material_mithril = true,
 | 
				
			||||||
	material_crystal = true,
 | 
						material_crystal = true,
 | 
				
			||||||
 | 
						material_nether = true,
 | 
				
			||||||
	set_elements = "head torso legs feet shield",
 | 
						set_elements = "head torso legs feet shield",
 | 
				
			||||||
	set_multiplier = 1.1,
 | 
						set_multiplier = 1.1,
 | 
				
			||||||
	water_protect = true,
 | 
						water_protect = true,
 | 
				
			||||||
	fire_protect = minetest.get_modpath("ethereal") ~= nil,
 | 
						fire_protect = minetest.get_modpath("ethereal") ~= nil,
 | 
				
			||||||
	fire_protect_torch = minetest.get_modpath("ethereal") ~= nil,
 | 
						fire_protect_torch = minetest.get_modpath("ethereal") ~= nil,
 | 
				
			||||||
 | 
						feather_fall = true,
 | 
				
			||||||
	punch_damage = true,
 | 
						punch_damage = true,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Armor Registration
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Methods
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section methods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registers a new armor item.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:register_armor
 | 
				
			||||||
 | 
					--  @tparam string name Armor item technical name (ex: "3d\_armor:helmet\_gold").
 | 
				
			||||||
 | 
					--  @tparam ArmorDef def Armor definition table.
 | 
				
			||||||
 | 
					--  @usage armor:register_armor("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, flammable=1},
 | 
				
			||||||
 | 
					--    armor_groups = {fleshy=5},
 | 
				
			||||||
 | 
					--    damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
				
			||||||
 | 
					--  })
 | 
				
			||||||
armor.register_armor = function(self, name, def)
 | 
					armor.register_armor = function(self, name, def)
 | 
				
			||||||
	def.on_secondary_use = function(itemstack, player)
 | 
						def.on_secondary_use = function(itemstack, player)
 | 
				
			||||||
		return armor:equip(player, itemstack)
 | 
							return armor:equip(player, itemstack)
 | 
				
			||||||
@@ -132,6 +229,11 @@ armor.register_armor = function(self, name, def)
 | 
				
			|||||||
	minetest.register_tool(name, def)
 | 
						minetest.register_tool(name, def)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registers a new armor group.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:register_armor_group
 | 
				
			||||||
 | 
					--  @tparam string group Group ID.
 | 
				
			||||||
 | 
					--  @tparam int base Base armor value.
 | 
				
			||||||
armor.register_armor_group = function(self, group, base)
 | 
					armor.register_armor_group = function(self, group, base)
 | 
				
			||||||
	base = base or 100
 | 
						base = base or 100
 | 
				
			||||||
	self.registered_groups[group] = base
 | 
						self.registered_groups[group] = base
 | 
				
			||||||
@@ -140,38 +242,92 @@ armor.register_armor_group = function(self, group, base)
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Armor callbacks
 | 
					--- Armor Callbacks Registration
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section callbacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registers a callback for when player visuals are update.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:register_on_update
 | 
				
			||||||
 | 
					--  @tparam function func Function to be executed.
 | 
				
			||||||
 | 
					--  @see armor:update_player_visuals
 | 
				
			||||||
 | 
					--  @usage armor:register_on_update(function(player, index, stack)
 | 
				
			||||||
 | 
					--    -- code to execute
 | 
				
			||||||
 | 
					--  end)
 | 
				
			||||||
armor.register_on_update = function(self, func)
 | 
					armor.register_on_update = function(self, func)
 | 
				
			||||||
	if type(func) == "function" then
 | 
						if type(func) == "function" then
 | 
				
			||||||
		table.insert(self.registered_callbacks.on_update, func)
 | 
							table.insert(self.registered_callbacks.on_update, func)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registers a callback for when armor is equipped.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:register_on_equip
 | 
				
			||||||
 | 
					--  @tparam function func Function to be executed.
 | 
				
			||||||
 | 
					--  @usage armor:register_on_equip(function(player, index, stack)
 | 
				
			||||||
 | 
					--    -- code to execute
 | 
				
			||||||
 | 
					--  end)
 | 
				
			||||||
armor.register_on_equip = function(self, func)
 | 
					armor.register_on_equip = function(self, func)
 | 
				
			||||||
	if type(func) == "function" then
 | 
						if type(func) == "function" then
 | 
				
			||||||
		table.insert(self.registered_callbacks.on_equip, func)
 | 
							table.insert(self.registered_callbacks.on_equip, func)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registers a callback for when armor is unequipped.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:register_on_unequip
 | 
				
			||||||
 | 
					--  @tparam function func Function to be executed.
 | 
				
			||||||
 | 
					--  @usage armor:register_on_unequip(function(player, index, stack)
 | 
				
			||||||
 | 
					--    -- code to execute
 | 
				
			||||||
 | 
					--  end)
 | 
				
			||||||
armor.register_on_unequip = function(self, func)
 | 
					armor.register_on_unequip = function(self, func)
 | 
				
			||||||
	if type(func) == "function" then
 | 
						if type(func) == "function" then
 | 
				
			||||||
		table.insert(self.registered_callbacks.on_unequip, func)
 | 
							table.insert(self.registered_callbacks.on_unequip, func)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registers a callback for when armor is damaged.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:register_on_damage
 | 
				
			||||||
 | 
					--  @tparam function func Function to be executed.
 | 
				
			||||||
 | 
					--  @see armor:damage
 | 
				
			||||||
 | 
					--  @usage armor:register_on_damage(function(player, index, stack)
 | 
				
			||||||
 | 
					--    -- code to execute
 | 
				
			||||||
 | 
					--  end)
 | 
				
			||||||
armor.register_on_damage = function(self, func)
 | 
					armor.register_on_damage = function(self, func)
 | 
				
			||||||
	if type(func) == "function" then
 | 
						if type(func) == "function" then
 | 
				
			||||||
		table.insert(self.registered_callbacks.on_damage, func)
 | 
							table.insert(self.registered_callbacks.on_damage, func)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registers a callback for when armor is destroyed.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:register_on_destroy
 | 
				
			||||||
 | 
					--  @tparam function func Function to be executed.
 | 
				
			||||||
 | 
					--  @see armor:damage
 | 
				
			||||||
 | 
					--  @usage armor:register_on_destroy(function(player, index, stack)
 | 
				
			||||||
 | 
					--    -- code to execute
 | 
				
			||||||
 | 
					--  end)
 | 
				
			||||||
armor.register_on_destroy = function(self, func)
 | 
					armor.register_on_destroy = function(self, func)
 | 
				
			||||||
	if type(func) == "function" then
 | 
						if type(func) == "function" then
 | 
				
			||||||
		table.insert(self.registered_callbacks.on_destroy, func)
 | 
							table.insert(self.registered_callbacks.on_destroy, func)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- @section end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Methods
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section methods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Runs callbacks.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:run_callbacks
 | 
				
			||||||
 | 
					--  @tparam function callback Function to execute.
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player First parameter passed to callback.
 | 
				
			||||||
 | 
					--  @tparam int index Second parameter passed to callback.
 | 
				
			||||||
 | 
					--  @tparam ItemStack stack Callback owner.
 | 
				
			||||||
armor.run_callbacks = function(self, callback, player, index, stack)
 | 
					armor.run_callbacks = function(self, callback, player, index, stack)
 | 
				
			||||||
	if stack then
 | 
						if stack then
 | 
				
			||||||
		local def = stack:get_definition() or {}
 | 
							local def = stack:get_definition() or {}
 | 
				
			||||||
@@ -187,6 +343,10 @@ armor.run_callbacks = function(self, callback, player, index, stack)
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Updates visuals.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:update_player_visuals
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
armor.update_player_visuals = function(self, player)
 | 
					armor.update_player_visuals = function(self, player)
 | 
				
			||||||
	if not player then
 | 
						if not player then
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
@@ -202,10 +362,10 @@ armor.update_player_visuals = function(self, player)
 | 
				
			|||||||
	self:run_callbacks("on_update", player)
 | 
						self:run_callbacks("on_update", player)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Sets player's armor attributes.
 | 
				
			||||||
-- armor is not visible on player model if enabled
 | 
					--
 | 
				
			||||||
local transparent_armor = minetest.settings:get_bool("armor_transparent", false)
 | 
					--  @function armor:set_player_armor
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
armor.set_player_armor = function(self, player)
 | 
					armor.set_player_armor = function(self, player)
 | 
				
			||||||
	local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
 | 
						local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
 | 
				
			||||||
	if not name then
 | 
						if not name then
 | 
				
			||||||
@@ -366,6 +526,13 @@ armor.set_player_armor = function(self, player)
 | 
				
			|||||||
	self:update_player_visuals(player)
 | 
						self:update_player_visuals(player)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Action when armor is punched.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:punch
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player Player wearing the armor.
 | 
				
			||||||
 | 
					--  @tparam ObjectRef hitter Entity attacking player.
 | 
				
			||||||
 | 
					--  @tparam[opt] int time_from_last_punch Time in seconds since last punch action.
 | 
				
			||||||
 | 
					--  @tparam[opt] table tool_capabilities See `entity_damage_mechanism`.
 | 
				
			||||||
armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabilities)
 | 
					armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabilities)
 | 
				
			||||||
	local name, armor_inv = self:get_valid_player(player, "[punch]")
 | 
						local name, armor_inv = self:get_valid_player(player, "[punch]")
 | 
				
			||||||
	if not name then
 | 
						if not name then
 | 
				
			||||||
@@ -451,6 +618,13 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili
 | 
				
			|||||||
	self.def[name].count = count
 | 
						self.def[name].count = count
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Action when armor is damaged.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:damage
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
 | 
					--  @tparam int index Inventory index where armor is equipped.
 | 
				
			||||||
 | 
					--  @tparam ItemStack stack Armor item receiving damaged.
 | 
				
			||||||
 | 
					--  @tparam int use Amount of wear to add to armor item.
 | 
				
			||||||
armor.damage = function(self, player, index, stack, use)
 | 
					armor.damage = function(self, player, index, stack, use)
 | 
				
			||||||
	local old_stack = ItemStack(stack)
 | 
						local old_stack = ItemStack(stack)
 | 
				
			||||||
	local worn_armor = armor:get_weared_armor_elements(player)
 | 
						local worn_armor = armor:get_weared_armor_elements(player)
 | 
				
			||||||
@@ -469,6 +643,11 @@ armor.damage = function(self, player, index, stack, use)
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Get elements of equipped armor.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:get_weared_armor_elements
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
 | 
					--  @treturn table List of equipped armors.
 | 
				
			||||||
armor.get_weared_armor_elements = function(self, player)
 | 
					armor.get_weared_armor_elements = function(self, player)
 | 
				
			||||||
    local name, inv = self:get_valid_player(player, "[get_weared_armor]")
 | 
					    local name, inv = self:get_valid_player(player, "[get_weared_armor]")
 | 
				
			||||||
	local weared_armor = {}
 | 
						local weared_armor = {}
 | 
				
			||||||
@@ -485,40 +664,71 @@ armor.get_weared_armor_elements = function(self, player)
 | 
				
			|||||||
	return weared_armor
 | 
						return weared_armor
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Equips a piece of armor to a player.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:equip
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player Player to whom item is equipped.
 | 
				
			||||||
 | 
					--  @tparam ItemStack itemstack Armor item to be equipped.
 | 
				
			||||||
 | 
					--  @treturn ItemStack Leftover item stack.
 | 
				
			||||||
armor.equip = function(self, player, itemstack)
 | 
					armor.equip = function(self, player, itemstack)
 | 
				
			||||||
    local name, armor_inv = self:get_valid_player(player, "[equip]")
 | 
					    local name, armor_inv = self:get_valid_player(player, "[equip]")
 | 
				
			||||||
    local weared_armor = self:get_weared_armor_elements(player)
 | 
					 | 
				
			||||||
    local armor_element = self:get_element(itemstack:get_name())
 | 
					    local armor_element = self:get_element(itemstack:get_name())
 | 
				
			||||||
	if name and armor_element then
 | 
						if name and armor_element then
 | 
				
			||||||
		if weared_armor[armor_element] ~= nil then
 | 
							local index
 | 
				
			||||||
			self:unequip(player, armor_element)
 | 
							for i=1, armor_inv:get_size("armor") do
 | 
				
			||||||
 | 
								local stack = armor_inv:get_stack("armor", i)
 | 
				
			||||||
 | 
								if self:get_element(stack:get_name()) == armor_element then
 | 
				
			||||||
 | 
									index = i
 | 
				
			||||||
 | 
									self:unequip(player, armor_element)
 | 
				
			||||||
 | 
									break
 | 
				
			||||||
 | 
								elseif not index and stack:is_empty() then
 | 
				
			||||||
 | 
									index = i
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		armor_inv:add_item("armor", itemstack:take_item())
 | 
							local stack = itemstack:take_item()
 | 
				
			||||||
 | 
							armor_inv:set_stack("armor", index, stack)
 | 
				
			||||||
 | 
							self:run_callbacks("on_equip", player, index, stack)
 | 
				
			||||||
		self:set_player_armor(player)
 | 
							self:set_player_armor(player)
 | 
				
			||||||
		self:save_armor_inventory(player)
 | 
							self:save_armor_inventory(player)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	return itemstack
 | 
						return itemstack
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Unequips a piece of armor from a player.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:unequip
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player Player from whom item is removed.
 | 
				
			||||||
 | 
					--  @tparam string armor_element Armor type identifier associated with the item
 | 
				
			||||||
 | 
					--  to be removed ("head", "torso", "hands", "shield", "legs", "feet", etc.).
 | 
				
			||||||
armor.unequip = function(self, player, armor_element)
 | 
					armor.unequip = function(self, player, armor_element)
 | 
				
			||||||
    local name, armor_inv = self:get_valid_player(player, "[unequip]")
 | 
					    local name, armor_inv = self:get_valid_player(player, "[unequip]")
 | 
				
			||||||
	local weared_armor = self:get_weared_armor_elements(player)
 | 
						if not name then
 | 
				
			||||||
	if not name or not weared_armor[armor_element] then
 | 
					 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	local itemstack = armor_inv:remove_item("armor", ItemStack(weared_armor[armor_element]))
 | 
						for i=1, armor_inv:get_size("armor") do
 | 
				
			||||||
	minetest.after(0, function()
 | 
							local stack = armor_inv:get_stack("armor", i)
 | 
				
			||||||
		local inv = player:get_inventory()
 | 
							if self:get_element(stack:get_name()) == armor_element then
 | 
				
			||||||
		if inv:room_for_item("main", itemstack) then
 | 
								armor_inv:set_stack("armor", i, "")
 | 
				
			||||||
			inv:add_item("main", itemstack)
 | 
								minetest.after(0, function()
 | 
				
			||||||
		else
 | 
									local inv = player:get_inventory()
 | 
				
			||||||
			minetest.add_item(player:get_pos(), itemstack)
 | 
									if inv:room_for_item("main", stack) then
 | 
				
			||||||
 | 
										inv:add_item("main", stack)
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										minetest.add_item(player:get_pos(), stack)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end)
 | 
				
			||||||
 | 
								self:run_callbacks("on_unequip", player, i, stack)
 | 
				
			||||||
 | 
								self:set_player_armor(player)
 | 
				
			||||||
 | 
								self:save_armor_inventory(player)
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end)
 | 
						end
 | 
				
			||||||
    self:set_player_armor(player)
 | 
					 | 
				
			||||||
	self:save_armor_inventory(player)
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Removes all armor worn by player.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:remove_all
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
armor.remove_all = function(self, player)
 | 
					armor.remove_all = function(self, player)
 | 
				
			||||||
    local name, inv = self:get_valid_player(player, "[remove_all]")
 | 
					    local name, inv = self:get_valid_player(player, "[remove_all]")
 | 
				
			||||||
	if not name then
 | 
						if not name then
 | 
				
			||||||
@@ -529,17 +739,28 @@ armor.remove_all = function(self, player)
 | 
				
			|||||||
	self:save_armor_inventory(player)
 | 
						self:save_armor_inventory(player)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local skin_mod
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Retrieves player's current skin.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:get_player_skin
 | 
				
			||||||
 | 
					--  @tparam string name Player name.
 | 
				
			||||||
 | 
					--  @treturn string Skin filename.
 | 
				
			||||||
armor.get_player_skin = function(self, name)
 | 
					armor.get_player_skin = function(self, name)
 | 
				
			||||||
	if (self.skin_mod == "skins" or self.skin_mod == "simple_skins") and skins.skins[name] then
 | 
						if (skin_mod == "skins" or skin_mod == "simple_skins") and skins.skins[name] then
 | 
				
			||||||
		return skins.skins[name]..".png"
 | 
							return skins.skins[name]..".png"
 | 
				
			||||||
	elseif self.skin_mod == "u_skins" and u_skins.u_skins[name] then
 | 
						elseif skin_mod == "u_skins" and u_skins.u_skins[name] then
 | 
				
			||||||
		return u_skins.u_skins[name]..".png"
 | 
							return u_skins.u_skins[name]..".png"
 | 
				
			||||||
	elseif self.skin_mod == "wardrobe" and wardrobe.playerSkins and wardrobe.playerSkins[name] then
 | 
						elseif skin_mod == "wardrobe" and wardrobe.playerSkins and wardrobe.playerSkins[name] then
 | 
				
			||||||
		return wardrobe.playerSkins[name]
 | 
							return wardrobe.playerSkins[name]
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	return armor.default_skin..".png"
 | 
						return armor.default_skin..".png"
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Updates skin.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:update_skin
 | 
				
			||||||
 | 
					--  @tparam string name Player name.
 | 
				
			||||||
armor.update_skin = function(self, name)
 | 
					armor.update_skin = function(self, name)
 | 
				
			||||||
	minetest.after(0, function()
 | 
						minetest.after(0, function()
 | 
				
			||||||
		local pplayer = minetest.get_player_by_name(name)
 | 
							local pplayer = minetest.get_player_by_name(name)
 | 
				
			||||||
@@ -550,10 +771,19 @@ armor.update_skin = function(self, name)
 | 
				
			|||||||
	end)
 | 
						end)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Adds preview for armor inventory.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:add_preview
 | 
				
			||||||
 | 
					--  @tparam string preview Preview image filename.
 | 
				
			||||||
armor.add_preview = function(self, preview)
 | 
					armor.add_preview = function(self, preview)
 | 
				
			||||||
	skin_previews[preview] = true
 | 
						skin_previews[preview] = true
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Retrieves preview for armor inventory.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:get_preview
 | 
				
			||||||
 | 
					--  @tparam string name Player name.
 | 
				
			||||||
 | 
					--  @treturn string Preview image filename.
 | 
				
			||||||
armor.get_preview = function(self, name)
 | 
					armor.get_preview = function(self, name)
 | 
				
			||||||
	local preview = string.gsub(armor:get_player_skin(name), ".png", "_preview.png")
 | 
						local preview = string.gsub(armor:get_player_skin(name), ".png", "_preview.png")
 | 
				
			||||||
	if skin_previews[preview] then
 | 
						if skin_previews[preview] then
 | 
				
			||||||
@@ -562,6 +792,12 @@ armor.get_preview = function(self, name)
 | 
				
			|||||||
	return "character_preview.png"
 | 
						return "character_preview.png"
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Retrieves armor formspec.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:get_armor_formspec
 | 
				
			||||||
 | 
					--  @tparam string name Player name.
 | 
				
			||||||
 | 
					--  @tparam[opt] bool listring Use `listring` formspec element (default: `false`).
 | 
				
			||||||
 | 
					--  @treturn string Formspec formatted string.
 | 
				
			||||||
armor.get_armor_formspec = function(self, name, listring)
 | 
					armor.get_armor_formspec = function(self, name, listring)
 | 
				
			||||||
	if armor.def[name].init_time == 0 then
 | 
						if armor.def[name].init_time == 0 then
 | 
				
			||||||
		return "label[0,0;Armor not initialized!]"
 | 
							return "label[0,0;Armor not initialized!]"
 | 
				
			||||||
@@ -584,6 +820,11 @@ armor.get_armor_formspec = function(self, name, listring)
 | 
				
			|||||||
	return formspec
 | 
						return formspec
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Retrieves element.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:get_element
 | 
				
			||||||
 | 
					--  @tparam string item_name
 | 
				
			||||||
 | 
					--  @return Armor element.
 | 
				
			||||||
armor.get_element = function(self, item_name)
 | 
					armor.get_element = function(self, item_name)
 | 
				
			||||||
	for _, element in pairs(armor.elements) do
 | 
						for _, element in pairs(armor.elements) do
 | 
				
			||||||
		if minetest.get_item_group(item_name, "armor_"..element) > 0 then
 | 
							if minetest.get_item_group(item_name, "armor_"..element) > 0 then
 | 
				
			||||||
@@ -592,6 +833,11 @@ armor.get_element = function(self, item_name)
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Serializes armor inventory.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:serialize_inventory_list
 | 
				
			||||||
 | 
					--  @tparam table list Inventory contents.
 | 
				
			||||||
 | 
					--  @treturn string
 | 
				
			||||||
armor.serialize_inventory_list = function(self, list)
 | 
					armor.serialize_inventory_list = function(self, list)
 | 
				
			||||||
	local list_table = {}
 | 
						local list_table = {}
 | 
				
			||||||
	for _, stack in ipairs(list) do
 | 
						for _, stack in ipairs(list) do
 | 
				
			||||||
@@ -600,6 +846,11 @@ armor.serialize_inventory_list = function(self, list)
 | 
				
			|||||||
	return minetest.serialize(list_table)
 | 
						return minetest.serialize(list_table)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Deserializes armor inventory.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:deserialize_inventory_list
 | 
				
			||||||
 | 
					--  @tparam string list_string Serialized inventory contents.
 | 
				
			||||||
 | 
					--  @treturn table
 | 
				
			||||||
armor.deserialize_inventory_list = function(self, list_string)
 | 
					armor.deserialize_inventory_list = function(self, list_string)
 | 
				
			||||||
	local list_table = minetest.deserialize(list_string)
 | 
						local list_table = minetest.deserialize(list_string)
 | 
				
			||||||
	local list = {}
 | 
						local list = {}
 | 
				
			||||||
@@ -609,6 +860,11 @@ armor.deserialize_inventory_list = function(self, list_string)
 | 
				
			|||||||
	return list
 | 
						return list
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Loads armor inventory.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:load_armor_inventory
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
 | 
					--  @treturn bool
 | 
				
			||||||
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
 | 
				
			||||||
@@ -622,6 +878,12 @@ armor.load_armor_inventory = function(self, player)
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Saves armor inventory.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Inventory is stored in `PlayerMetaRef` string "3d\_armor\_inventory".
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:save_armor_inventory
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
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
 | 
				
			||||||
@@ -631,10 +893,22 @@ armor.save_armor_inventory = function(self, player)
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Updates inventory.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  DEPRECATED: Legacy inventory support.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:update_inventory
 | 
				
			||||||
 | 
					--  @param player
 | 
				
			||||||
armor.update_inventory = function(self, player)
 | 
					armor.update_inventory = function(self, player)
 | 
				
			||||||
	-- DEPRECATED: Legacy inventory support
 | 
						-- DEPRECATED: Legacy inventory support
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Sets inventory stack.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:set_inventory_stack
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
 | 
					--  @tparam int i Armor inventory index.
 | 
				
			||||||
 | 
					--  @tparam ItemStack stack Armor item.
 | 
				
			||||||
armor.set_inventory_stack = function(self, player, i, stack)
 | 
					armor.set_inventory_stack = function(self, player, i, stack)
 | 
				
			||||||
	local _, inv = self:get_valid_player(player, "[set_inventory_stack]")
 | 
						local _, inv = self:get_valid_player(player, "[set_inventory_stack]")
 | 
				
			||||||
	if inv then
 | 
						if inv then
 | 
				
			||||||
@@ -643,6 +917,13 @@ armor.set_inventory_stack = function(self, player, i, stack)
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Checks for a player that can use armor.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @function armor:get_valid_player
 | 
				
			||||||
 | 
					--  @tparam ObjectRef player
 | 
				
			||||||
 | 
					--  @tparam string msg Additional info for log messages.
 | 
				
			||||||
 | 
					--  @treturn list Player name & armor inventory.
 | 
				
			||||||
 | 
					--  @usage local name, inv = armor:get_valid_player(player, "[equip]")
 | 
				
			||||||
armor.get_valid_player = function(self, player, msg)
 | 
					armor.get_valid_player = function(self, player, msg)
 | 
				
			||||||
	msg = msg or ""
 | 
						msg = msg or ""
 | 
				
			||||||
	if not player then
 | 
						if not player then
 | 
				
			||||||
@@ -664,6 +945,10 @@ armor.get_valid_player = function(self, player, msg)
 | 
				
			|||||||
	return name, inv
 | 
						return name, inv
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Drops armor item at given position.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @tparam vector pos
 | 
				
			||||||
 | 
					--  @tparam ItemStack stack Armor item to be dropped.
 | 
				
			||||||
armor.drop_armor = function(pos, stack)
 | 
					armor.drop_armor = function(pos, stack)
 | 
				
			||||||
	local node = minetest.get_node_or_nil(pos)
 | 
						local node = minetest.get_node_or_nil(pos)
 | 
				
			||||||
	if node then
 | 
						if node then
 | 
				
			||||||
@@ -677,6 +962,8 @@ end
 | 
				
			|||||||
--- Allows skin mod to be set manually.
 | 
					--- Allows skin mod to be set manually.
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
--  Useful for skin mod forks that do not use the same name.
 | 
					--  Useful for skin mod forks that do not use the same name.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @tparam string mod Name of skin mod. Recognized names are "simple\_skins", "u\_skins", & "wardrobe".
 | 
				
			||||||
armor.set_skin_mod = function(mod)
 | 
					armor.set_skin_mod = function(mod)
 | 
				
			||||||
	armor.skin_mod = mod
 | 
						skin_mod = mod
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@ ARMOR_MATERIALS = {
 | 
				
			|||||||
	gold = "default:gold_ingot",
 | 
						gold = "default:gold_ingot",
 | 
				
			||||||
	mithril = "moreores:mithril_ingot",
 | 
						mithril = "moreores:mithril_ingot",
 | 
				
			||||||
	crystal = "ethereal:crystal_ingot",
 | 
						crystal = "ethereal:crystal_ingot",
 | 
				
			||||||
 | 
						nether = "nether:nether_ingot",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Enable fire protection (defaults true if using ethereal mod)
 | 
					-- Enable fire protection (defaults true if using ethereal mod)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,23 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					--- Registered armors.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @topic armor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- support for i18n
 | 
					-- support for i18n
 | 
				
			||||||
local S = armor.get_translator
 | 
					local S = armor.get_translator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Admin Helmet
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @helmet 3d_armor:helmet_admin
 | 
				
			||||||
 | 
					--  @img 3d_armor_inv_helmet_admin.png
 | 
				
			||||||
 | 
					--  @grp armor_head 1
 | 
				
			||||||
 | 
					--  @grp armor_heal 100
 | 
				
			||||||
 | 
					--  @grp armor_use 0
 | 
				
			||||||
 | 
					--  @grp armor_water 1
 | 
				
			||||||
 | 
					--  @grp not_in_creative_inventory 1
 | 
				
			||||||
 | 
					--  @armorgrp fleshy 100
 | 
				
			||||||
armor:register_armor("3d_armor:helmet_admin", {
 | 
					armor:register_armor("3d_armor:helmet_admin", {
 | 
				
			||||||
	description = S("Admin Helmet"),
 | 
						description = S("Admin Helmet"),
 | 
				
			||||||
	inventory_image = "3d_armor_inv_helmet_admin.png",
 | 
						inventory_image = "3d_armor_inv_helmet_admin.png",
 | 
				
			||||||
@@ -12,6 +29,15 @@ armor:register_armor("3d_armor:helmet_admin", {
 | 
				
			|||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Admin Chestplate
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @chestplate 3d_armor:chestplate_admin
 | 
				
			||||||
 | 
					--  @img 3d_armor_inv_chestplate_admin.png
 | 
				
			||||||
 | 
					--  @grp armor_torso 1
 | 
				
			||||||
 | 
					--  @grp armor_heal 100
 | 
				
			||||||
 | 
					--  @grp armor_use 0
 | 
				
			||||||
 | 
					--  @grp not_in_creative_inventory 1
 | 
				
			||||||
 | 
					--  @armorgrp fleshy 100
 | 
				
			||||||
armor:register_armor("3d_armor:chestplate_admin", {
 | 
					armor:register_armor("3d_armor:chestplate_admin", {
 | 
				
			||||||
	description = S("Admin Chestplate"),
 | 
						description = S("Admin Chestplate"),
 | 
				
			||||||
	inventory_image = "3d_armor_inv_chestplate_admin.png",
 | 
						inventory_image = "3d_armor_inv_chestplate_admin.png",
 | 
				
			||||||
@@ -23,6 +49,15 @@ armor:register_armor("3d_armor:chestplate_admin", {
 | 
				
			|||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Admin Leggings
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @leggings 3d_armor:leggings_admin
 | 
				
			||||||
 | 
					--  @img 3d_armor_inv_leggings_admin.png
 | 
				
			||||||
 | 
					--  @grp armor_legs 1
 | 
				
			||||||
 | 
					--  @grp armor_heal 100
 | 
				
			||||||
 | 
					--  @grp armor_use 0
 | 
				
			||||||
 | 
					--  @grp not_in_creative_inventory 1
 | 
				
			||||||
 | 
					--  @armorgrp fleshy 100
 | 
				
			||||||
armor:register_armor("3d_armor:leggings_admin", {
 | 
					armor:register_armor("3d_armor:leggings_admin", {
 | 
				
			||||||
	description = S("Admin Leggings"),
 | 
						description = S("Admin Leggings"),
 | 
				
			||||||
	inventory_image = "3d_armor_inv_leggings_admin.png",
 | 
						inventory_image = "3d_armor_inv_leggings_admin.png",
 | 
				
			||||||
@@ -34,6 +69,15 @@ armor:register_armor("3d_armor:leggings_admin", {
 | 
				
			|||||||
	end,
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Admin Boots
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @boots 3d_armor:boots_admin
 | 
				
			||||||
 | 
					--  @img 3d_armor_inv_boots_admin.png
 | 
				
			||||||
 | 
					--  @grp armor_feet 1
 | 
				
			||||||
 | 
					--  @grp armor_heal 100
 | 
				
			||||||
 | 
					--  @grp armor_use 0
 | 
				
			||||||
 | 
					--  @grp not_in_creative_inventory 1
 | 
				
			||||||
 | 
					--  @armorgrp fleshy 100
 | 
				
			||||||
armor:register_armor("3d_armor:boots_admin", {
 | 
					armor:register_armor("3d_armor:boots_admin", {
 | 
				
			||||||
	description = S("Admin Boots"),
 | 
						description = S("Admin Boots"),
 | 
				
			||||||
	inventory_image = "3d_armor_inv_boots_admin.png",
 | 
						inventory_image = "3d_armor_inv_boots_admin.png",
 | 
				
			||||||
@@ -50,7 +94,28 @@ minetest.register_alias("adminhelmet", "3d_armor:helmet_admin")
 | 
				
			|||||||
minetest.register_alias("adminchestplate", "3d_armor:chestplate_admin")
 | 
					minetest.register_alias("adminchestplate", "3d_armor:chestplate_admin")
 | 
				
			||||||
minetest.register_alias("adminleggings", "3d_armor:leggings_admin")
 | 
					minetest.register_alias("adminleggings", "3d_armor:leggings_admin")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Wood
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires setting `armor_material_wood`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section wood
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.wood then
 | 
					if armor.materials.wood then
 | 
				
			||||||
 | 
						--- Wood Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_wood
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_wood.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 2000
 | 
				
			||||||
 | 
						--  @grp flammable 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 5
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 3
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_wood", {
 | 
						armor:register_armor("3d_armor:helmet_wood", {
 | 
				
			||||||
		description = S("Wood Helmet"),
 | 
							description = S("Wood Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_wood.png",
 | 
							inventory_image = "3d_armor_inv_helmet_wood.png",
 | 
				
			||||||
@@ -58,6 +123,20 @@ if armor.materials.wood then
 | 
				
			|||||||
		armor_groups = {fleshy=5},
 | 
							armor_groups = {fleshy=5},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
							damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Wood Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_wood
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_wood.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 2000
 | 
				
			||||||
 | 
						--  @grp flammable 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 3
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_wood", {
 | 
						armor:register_armor("3d_armor:chestplate_wood", {
 | 
				
			||||||
		description = S("Wood Chestplate"),
 | 
							description = S("Wood Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_wood.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_wood.png",
 | 
				
			||||||
@@ -65,6 +144,20 @@ if armor.materials.wood then
 | 
				
			|||||||
		armor_groups = {fleshy=10},
 | 
							armor_groups = {fleshy=10},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
							damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Wood Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_wood
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_wood.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 1000
 | 
				
			||||||
 | 
						--  @grp flammable 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 3
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_wood", {
 | 
						armor:register_armor("3d_armor:leggings_wood", {
 | 
				
			||||||
		description = S("Wood Leggings"),
 | 
							description = S("Wood Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_wood.png",
 | 
							inventory_image = "3d_armor_inv_leggings_wood.png",
 | 
				
			||||||
@@ -72,6 +165,20 @@ if armor.materials.wood then
 | 
				
			|||||||
		armor_groups = {fleshy=10},
 | 
							armor_groups = {fleshy=10},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
							damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Wood Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_wood
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_wood.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 2000
 | 
				
			||||||
 | 
						--  @grp flammable 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 5
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 3
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_wood", {
 | 
						armor:register_armor("3d_armor:boots_wood", {
 | 
				
			||||||
		description = S("Wood Boots"),
 | 
							description = S("Wood Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_wood.png",
 | 
							inventory_image = "3d_armor_inv_boots_wood.png",
 | 
				
			||||||
@@ -94,7 +201,27 @@ if armor.materials.wood then
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Cactus
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires setting `armor_material_cactus`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section cactus
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.cactus then
 | 
					if armor.materials.cactus then
 | 
				
			||||||
 | 
						--- Cactus Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_cactus
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_cactus.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 1000
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 5
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_cactus", {
 | 
						armor:register_armor("3d_armor:helmet_cactus", {
 | 
				
			||||||
		description = S("Cactus Helmet"),
 | 
							description = S("Cactus Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_cactus.png",
 | 
							inventory_image = "3d_armor_inv_helmet_cactus.png",
 | 
				
			||||||
@@ -102,6 +229,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},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Cactus Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_cactus
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_cactus.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 1000
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_cactus", {
 | 
						armor:register_armor("3d_armor:chestplate_cactus", {
 | 
				
			||||||
		description = S("Cactus Chestplate"),
 | 
							description = S("Cactus Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_cactus.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_cactus.png",
 | 
				
			||||||
@@ -109,6 +249,19 @@ if armor.materials.cactus then
 | 
				
			|||||||
		armor_groups = {fleshy=10},
 | 
							armor_groups = {fleshy=10},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
 | 
							damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Cactus Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_cactus
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_cactus.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 1000
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_cactus", {
 | 
						armor:register_armor("3d_armor:leggings_cactus", {
 | 
				
			||||||
		description = S("Cactus Leggings"),
 | 
							description = S("Cactus Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_cactus.png",
 | 
							inventory_image = "3d_armor_inv_leggings_cactus.png",
 | 
				
			||||||
@@ -116,6 +269,19 @@ if armor.materials.cactus then
 | 
				
			|||||||
		armor_groups = {fleshy=10},
 | 
							armor_groups = {fleshy=10},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
 | 
							damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Cactus Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_cactus
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_cactus.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 1000
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 5
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_cactus", {
 | 
						armor:register_armor("3d_armor:boots_cactus", {
 | 
				
			||||||
		description = S("Cactus Boots"),
 | 
							description = S("Cactus Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_cactus.png",
 | 
							inventory_image = "3d_armor_inv_boots_cactus.png",
 | 
				
			||||||
@@ -138,7 +304,29 @@ if armor.materials.cactus then
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Steel
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires setting `armor_material_steel`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section steel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.steel then
 | 
					if armor.materials.steel then
 | 
				
			||||||
 | 
						--- Steel Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_steel
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_steel.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 800
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.01
 | 
				
			||||||
 | 
						--  @grp physica_gravity 0.01
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_steel", {
 | 
						armor:register_armor("3d_armor:helmet_steel", {
 | 
				
			||||||
		description = S("Steel Helmet"),
 | 
							description = S("Steel Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_steel.png",
 | 
							inventory_image = "3d_armor_inv_helmet_steel.png",
 | 
				
			||||||
@@ -147,6 +335,21 @@ if armor.materials.steel then
 | 
				
			|||||||
		armor_groups = {fleshy=10},
 | 
							armor_groups = {fleshy=10},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
 | 
							damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Steel Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_steel
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_steel.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 800
 | 
				
			||||||
 | 
						--  @grp physics_speed
 | 
				
			||||||
 | 
						--  @grp physics_gravity
 | 
				
			||||||
 | 
						--  @armorgrp fleshy
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_steel", {
 | 
						armor:register_armor("3d_armor:chestplate_steel", {
 | 
				
			||||||
		description = S("Steel Chestplate"),
 | 
							description = S("Steel Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_steel.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_steel.png",
 | 
				
			||||||
@@ -155,6 +358,21 @@ if armor.materials.steel then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
 | 
							damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Steel Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_steel
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_steel.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 800
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.03
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.03
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_steel", {
 | 
						armor:register_armor("3d_armor:leggings_steel", {
 | 
				
			||||||
		description = S("Steel Leggings"),
 | 
							description = S("Steel Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_steel.png",
 | 
							inventory_image = "3d_armor_inv_leggings_steel.png",
 | 
				
			||||||
@@ -163,6 +381,21 @@ if armor.materials.steel then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
 | 
							damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Steel Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_steel
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_steel.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 800
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.01
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.01
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_steel", {
 | 
						armor:register_armor("3d_armor:boots_steel", {
 | 
				
			||||||
		description = S("Steel Boots"),
 | 
							description = S("Steel Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_steel.png",
 | 
							inventory_image = "3d_armor_inv_boots_steel.png",
 | 
				
			||||||
@@ -173,7 +406,29 @@ if armor.materials.steel then
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Bronze
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires setting `armor_material_bronze`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section bronze
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.bronze then
 | 
					if armor.materials.bronze then
 | 
				
			||||||
 | 
						--- Bronze Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_bronze
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_bronze.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 400
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.01
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.01
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_bronze", {
 | 
						armor:register_armor("3d_armor:helmet_bronze", {
 | 
				
			||||||
		description = S("Bronze Helmet"),
 | 
							description = S("Bronze Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_bronze.png",
 | 
							inventory_image = "3d_armor_inv_helmet_bronze.png",
 | 
				
			||||||
@@ -182,6 +437,21 @@ if armor.materials.bronze then
 | 
				
			|||||||
		armor_groups = {fleshy=10},
 | 
							armor_groups = {fleshy=10},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
 | 
							damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Bronze Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_bronze
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_bronze.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 400
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.04
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.04
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_bronze", {
 | 
						armor:register_armor("3d_armor:chestplate_bronze", {
 | 
				
			||||||
		description = S("Bronze Chestplate"),
 | 
							description = S("Bronze Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_bronze.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_bronze.png",
 | 
				
			||||||
@@ -190,6 +460,21 @@ if armor.materials.bronze then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
 | 
							damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Bronze Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_bronze
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_bronze.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 400
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.03
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.03
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_bronze", {
 | 
						armor:register_armor("3d_armor:leggings_bronze", {
 | 
				
			||||||
		description = S("Bronze Leggings"),
 | 
							description = S("Bronze Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_bronze.png",
 | 
							inventory_image = "3d_armor_inv_leggings_bronze.png",
 | 
				
			||||||
@@ -198,6 +483,21 @@ if armor.materials.bronze then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
 | 
							damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Bronze Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_bronze
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_bronze.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 400
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.01
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.01
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_bronze", {
 | 
						armor:register_armor("3d_armor:boots_bronze", {
 | 
				
			||||||
		description = S("Bronze Boots"),
 | 
							description = S("Bronze Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_bronze.png",
 | 
							inventory_image = "3d_armor_inv_boots_bronze.png",
 | 
				
			||||||
@@ -208,7 +508,26 @@ if armor.materials.bronze then
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Diamond
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires setting `armor_material_diamond`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section diamond
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.diamond then
 | 
					if armor.materials.diamond then
 | 
				
			||||||
 | 
						--- Diamond Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_diamond
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_diamond.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp choppy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_diamond", {
 | 
						armor:register_armor("3d_armor:helmet_diamond", {
 | 
				
			||||||
		description = S("Diamond Helmet"),
 | 
							description = S("Diamond Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_diamond.png",
 | 
							inventory_image = "3d_armor_inv_helmet_diamond.png",
 | 
				
			||||||
@@ -216,6 +535,18 @@ if armor.materials.diamond then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Diamond Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_diamond
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_diamond.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 20
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp choppy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_diamond", {
 | 
						armor:register_armor("3d_armor:chestplate_diamond", {
 | 
				
			||||||
		description = S("Diamond Chestplate"),
 | 
							description = S("Diamond Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_diamond.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_diamond.png",
 | 
				
			||||||
@@ -223,6 +554,18 @@ if armor.materials.diamond then
 | 
				
			|||||||
		armor_groups = {fleshy=20},
 | 
							armor_groups = {fleshy=20},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Diamond Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_diamond
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_diamond.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 20
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp choppy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_diamond", {
 | 
						armor:register_armor("3d_armor:leggings_diamond", {
 | 
				
			||||||
		description = S("Diamond Leggings"),
 | 
							description = S("Diamond Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_diamond.png",
 | 
							inventory_image = "3d_armor_inv_leggings_diamond.png",
 | 
				
			||||||
@@ -230,6 +573,18 @@ if armor.materials.diamond then
 | 
				
			|||||||
		armor_groups = {fleshy=20},
 | 
							armor_groups = {fleshy=20},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Diamond Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_diamond
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_diamond.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp choppy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_diamond", {
 | 
						armor:register_armor("3d_armor:boots_diamond", {
 | 
				
			||||||
		description = S("Diamond Boots"),
 | 
							description = S("Diamond Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_diamond.png",
 | 
							inventory_image = "3d_armor_inv_boots_diamond.png",
 | 
				
			||||||
@@ -239,7 +594,29 @@ if armor.materials.diamond then
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Gold
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires `armor_material_gold`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section gold
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.gold then
 | 
					if armor.materials.gold then
 | 
				
			||||||
 | 
						--- Gold Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_gold
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_gold.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 300
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.02
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.02
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 1
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 3
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_gold", {
 | 
						armor:register_armor("3d_armor:helmet_gold", {
 | 
				
			||||||
		description = S("Gold Helmet"),
 | 
							description = S("Gold Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_gold.png",
 | 
							inventory_image = "3d_armor_inv_helmet_gold.png",
 | 
				
			||||||
@@ -248,6 +625,21 @@ if armor.materials.gold then
 | 
				
			|||||||
		armor_groups = {fleshy=10},
 | 
							armor_groups = {fleshy=10},
 | 
				
			||||||
		damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
 | 
							damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Gold Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_gold
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_gold.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 300
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.05
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.05
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 1
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 3
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_gold", {
 | 
						armor:register_armor("3d_armor:chestplate_gold", {
 | 
				
			||||||
		description = S("Gold Chestplate"),
 | 
							description = S("Gold Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_gold.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_gold.png",
 | 
				
			||||||
@@ -256,6 +648,21 @@ if armor.materials.gold then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
 | 
							damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Gold Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_gold
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_gold.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 300
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.04
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.04
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 1
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 3
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_gold", {
 | 
						armor:register_armor("3d_armor:leggings_gold", {
 | 
				
			||||||
		description = S("Gold Leggings"),
 | 
							description = S("Gold Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_gold.png",
 | 
							inventory_image = "3d_armor_inv_leggings_gold.png",
 | 
				
			||||||
@@ -264,6 +671,21 @@ if armor.materials.gold then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
 | 
							damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Gold Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_gold
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_gold.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 300
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.02
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.02
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 1
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 3
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_gold", {
 | 
						armor:register_armor("3d_armor:boots_gold", {
 | 
				
			||||||
		description = S("Gold Boots"),
 | 
							description = S("Gold Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_gold.png",
 | 
							inventory_image = "3d_armor_inv_boots_gold.png",
 | 
				
			||||||
@@ -274,38 +696,108 @@ if armor.materials.gold then
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Mithril
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires `armor_material_mithril`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section mithril
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.mithril then
 | 
					if armor.materials.mithril then
 | 
				
			||||||
 | 
						--- Mithril Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_mithril
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_mithril.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_mithril", {
 | 
						armor:register_armor("3d_armor:helmet_mithril", {
 | 
				
			||||||
		description = S("Mithril Helmet"),
 | 
							description = S("Mithril Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_mithril.png",
 | 
							inventory_image = "3d_armor_inv_helmet_mithril.png",
 | 
				
			||||||
		groups = {armor_head=1, armor_heal=12, armor_use=100},
 | 
							groups = {armor_head=1, armor_heal=13, armor_use=66},
 | 
				
			||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=16},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Mithril Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_mithril
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_mithril.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 20
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_mithril", {
 | 
						armor:register_armor("3d_armor:chestplate_mithril", {
 | 
				
			||||||
		description = S("Mithril Chestplate"),
 | 
							description = S("Mithril Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_mithril.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_mithril.png",
 | 
				
			||||||
		groups = {armor_torso=1, armor_heal=12, armor_use=100},
 | 
							groups = {armor_torso=1, armor_heal=13, armor_use=66},
 | 
				
			||||||
		armor_groups = {fleshy=20},
 | 
							armor_groups = {fleshy=21},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Mithril Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_mithril
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_mithril.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 20
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_mithril", {
 | 
						armor:register_armor("3d_armor:leggings_mithril", {
 | 
				
			||||||
		description = S("Mithril Leggings"),
 | 
							description = S("Mithril Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_mithril.png",
 | 
							inventory_image = "3d_armor_inv_leggings_mithril.png",
 | 
				
			||||||
		groups = {armor_legs=1, armor_heal=12, armor_use=100},
 | 
							groups = {armor_legs=1, armor_heal=13, armor_use=66},
 | 
				
			||||||
		armor_groups = {fleshy=20},
 | 
							armor_groups = {fleshy=21},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Mithril Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_mithril
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_mithril.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_mithril", {
 | 
						armor:register_armor("3d_armor:boots_mithril", {
 | 
				
			||||||
		description = S("Mithril Boots"),
 | 
							description = S("Mithril Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_mithril.png",
 | 
							inventory_image = "3d_armor_inv_boots_mithril.png",
 | 
				
			||||||
		groups = {armor_feet=1, armor_heal=12, armor_use=100},
 | 
							groups = {armor_feet=1, armor_heal=13, armor_use=66},
 | 
				
			||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=16},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Crystal
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires `armor_material_crystal`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section crystal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.crystal then
 | 
					if armor.materials.crystal then
 | 
				
			||||||
 | 
						--- Crystal Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_crystal
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_crystal.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:helmet_crystal", {
 | 
						armor:register_armor("3d_armor:helmet_crystal", {
 | 
				
			||||||
		description = S("Crystal Helmet"),
 | 
							description = S("Crystal Helmet"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_helmet_crystal.png",
 | 
							inventory_image = "3d_armor_inv_helmet_crystal.png",
 | 
				
			||||||
@@ -313,6 +805,18 @@ if armor.materials.crystal then
 | 
				
			|||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=15},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Crystal Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_crystal
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_crystal.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 20
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:chestplate_crystal", {
 | 
						armor:register_armor("3d_armor:chestplate_crystal", {
 | 
				
			||||||
		description = S("Crystal Chestplate"),
 | 
							description = S("Crystal Chestplate"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_chestplate_crystal.png",
 | 
							inventory_image = "3d_armor_inv_chestplate_crystal.png",
 | 
				
			||||||
@@ -320,6 +824,18 @@ if armor.materials.crystal then
 | 
				
			|||||||
		armor_groups = {fleshy=20},
 | 
							armor_groups = {fleshy=20},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Crystal Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_crystal
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_crystal.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 20
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:leggings_crystal", {
 | 
						armor:register_armor("3d_armor:leggings_crystal", {
 | 
				
			||||||
		description = S("Crystal Leggings"),
 | 
							description = S("Crystal Leggings"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_leggings_crystal.png",
 | 
							inventory_image = "3d_armor_inv_leggings_crystal.png",
 | 
				
			||||||
@@ -327,6 +843,20 @@ if armor.materials.crystal then
 | 
				
			|||||||
		armor_groups = {fleshy=20},
 | 
							armor_groups = {fleshy=20},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Crystal Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_crystal
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_crystal.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @grp physics_speed 1
 | 
				
			||||||
 | 
						--  @grp physics_jump 0.5
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("3d_armor:boots_crystal", {
 | 
						armor:register_armor("3d_armor:boots_crystal", {
 | 
				
			||||||
		description = S("Crystal Boots"),
 | 
							description = S("Crystal Boots"),
 | 
				
			||||||
		inventory_image = "3d_armor_inv_boots_crystal.png",
 | 
							inventory_image = "3d_armor_inv_boots_crystal.png",
 | 
				
			||||||
@@ -337,6 +867,131 @@ if armor.materials.crystal then
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Nether
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  Requires `armor_material_nether`.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section nether
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if armor.materials.nether then
 | 
				
			||||||
 | 
						--- Nether Helmet
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @helmet 3d_armor:helmet_nether
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_helmet_nether.png
 | 
				
			||||||
 | 
						--  @grp armor_head 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 14
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 18
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
 | 
						armor:register_armor("3d_armor:helmet_nether", {
 | 
				
			||||||
 | 
							description = S("Nether Helmet"),
 | 
				
			||||||
 | 
							inventory_image = "3d_armor_inv_helmet_nether.png",
 | 
				
			||||||
 | 
							groups = {armor_head=1, armor_heal=14, armor_use=100, armor_fire=1},
 | 
				
			||||||
 | 
							armor_groups = {fleshy=18},
 | 
				
			||||||
 | 
							damage_groups = {cracky=3, snappy=2, level=3},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						--- Nether Chestplate
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @chestplate 3d_armor:chestplate_nether
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_chestplate_nether.png
 | 
				
			||||||
 | 
						--  @grp armor_torso 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 14
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 25
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
 | 
						armor:register_armor("3d_armor:chestplate_nether", {
 | 
				
			||||||
 | 
							description = S("Nether Chestplate"),
 | 
				
			||||||
 | 
							inventory_image = "3d_armor_inv_chestplate_nether.png",
 | 
				
			||||||
 | 
							groups = {armor_torso=1, armor_heal=14, armor_use=200, armor_fire=1},
 | 
				
			||||||
 | 
							armor_groups = {fleshy=25},
 | 
				
			||||||
 | 
							damage_groups = {cracky=3, snappy=2, level=3},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						--- Nether Leggings
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @leggings 3d_armor:leggings_nether
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_leggings_nether.png
 | 
				
			||||||
 | 
						--  @grp armor_legs 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 14
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 25
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
 | 
						armor:register_armor("3d_armor:leggings_nether", {
 | 
				
			||||||
 | 
							description = S("Nether Leggings"),
 | 
				
			||||||
 | 
							inventory_image = "3d_armor_inv_leggings_nether.png",
 | 
				
			||||||
 | 
							groups = {armor_legs=1, armor_heal=14, armor_use=200, armor_fire=1},
 | 
				
			||||||
 | 
							armor_groups = {fleshy=25},
 | 
				
			||||||
 | 
							damage_groups = {cracky=3, snappy=2, level=3},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						--- Nether Boots
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @boots 3d_armor:boots_nether
 | 
				
			||||||
 | 
						--  @img 3d_armor_inv_boots_nether.png
 | 
				
			||||||
 | 
						--  @grp armor_feet 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 14
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 18
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
 | 
						armor:register_armor("3d_armor:boots_nether", {
 | 
				
			||||||
 | 
							description = S("Nether Boots"),
 | 
				
			||||||
 | 
							inventory_image = "3d_armor_inv_boots_nether.png",
 | 
				
			||||||
 | 
							groups = {armor_feet=1, armor_heal=14, armor_use=200, armor_fire=1},
 | 
				
			||||||
 | 
							armor_groups = {fleshy=18},
 | 
				
			||||||
 | 
							damage_groups = {cracky=3, snappy=2, level=3},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Crafting
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @section craft
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Craft recipes for helmets, chestplates, leggings, boots, & shields.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @craft armor
 | 
				
			||||||
 | 
					--  @usage
 | 
				
			||||||
 | 
					--  Key:
 | 
				
			||||||
 | 
					--  - m: material
 | 
				
			||||||
 | 
					--    - wood:    group:wood
 | 
				
			||||||
 | 
					--    - cactus:  default:cactus
 | 
				
			||||||
 | 
					--    - steel:   default:steel_ingot
 | 
				
			||||||
 | 
					--    - bronze:  default:bronze_ingot
 | 
				
			||||||
 | 
					--    - diamond: default:diamond
 | 
				
			||||||
 | 
					--    - gold:    default:gold_ingot
 | 
				
			||||||
 | 
					--    - mithril: moreores:mithril_ingot
 | 
				
			||||||
 | 
					--    - crystal: ethereal:crystal_ingot
 | 
				
			||||||
 | 
					--    - nether:  nether:nether_ingot
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  helmet:        chestplate:    leggings:
 | 
				
			||||||
 | 
					--  ┌───┬───┬───┐  ┌───┬───┬───┐  ┌───┬───┬───┐
 | 
				
			||||||
 | 
					--  │ m │ m │ m │  │ m │   │ m │  │ m │ m │ m │
 | 
				
			||||||
 | 
					--  ├───┼───┼───┤  ├───┼───┼───┤  ├───┼───┼───┤
 | 
				
			||||||
 | 
					--  │ m │   │ m │  │ m │ m │ m │  │ m │   │ m │
 | 
				
			||||||
 | 
					--  ├───┼───┼───┤  ├───┼───┼───┤  ├───┼───┼───┤
 | 
				
			||||||
 | 
					--  │   │   │   │  │ m │ m │ m │  │ m │   │ m │
 | 
				
			||||||
 | 
					--  └───┴───┴───┘  └───┴───┴───┘  └───┴───┴───┘
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  boots:         shield:
 | 
				
			||||||
 | 
					--  ┌───┬───┬───┐  ┌───┬───┬───┐
 | 
				
			||||||
 | 
					--  │   │   │   │  │ m │ m │ m │
 | 
				
			||||||
 | 
					--  ├───┼───┼───┤  ├───┼───┼───┤
 | 
				
			||||||
 | 
					--  │ m │   │ m │  │ m │ m │ m │
 | 
				
			||||||
 | 
					--  ├───┼───┼───┤  ├───┼───┼───┤
 | 
				
			||||||
 | 
					--  │ m │   │ m │  │   │ m │   │
 | 
				
			||||||
 | 
					--  └───┴───┴───┘  └───┴───┴───┘
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for k, v in pairs(armor.materials) do
 | 
					for k, v in pairs(armor.materials) do
 | 
				
			||||||
	minetest.register_craft({
 | 
						minetest.register_craft({
 | 
				
			||||||
		output = "3d_armor:helmet_"..k,
 | 
							output = "3d_armor:helmet_"..k,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,7 @@ Helmets:
 | 
				
			|||||||
[3d_armor:helmet_gold] X = [default:gold_ingot]
 | 
					[3d_armor:helmet_gold] X = [default:gold_ingot]
 | 
				
			||||||
[3d_armor:helmet_mithril] X = [moreores:mithril_ingot] *
 | 
					[3d_armor:helmet_mithril] X = [moreores:mithril_ingot] *
 | 
				
			||||||
[3d_armor:helmet_crystal] X = [ethereal:crystal_ingot] **
 | 
					[3d_armor:helmet_crystal] X = [ethereal:crystal_ingot] **
 | 
				
			||||||
 | 
					[3d_armor:helmet_nether] X = [ethereal:nether_ingot] **
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Chestplates:
 | 
					Chestplates:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -38,6 +39,7 @@ Chestplates:
 | 
				
			|||||||
[3d_armor:chestplate_gold] X = [default:gold_ingot]
 | 
					[3d_armor:chestplate_gold] X = [default:gold_ingot]
 | 
				
			||||||
[3d_armor:chestplate_mithril] X = [moreores:mithril_ingot] *
 | 
					[3d_armor:chestplate_mithril] X = [moreores:mithril_ingot] *
 | 
				
			||||||
[3d_armor:chestplate_crystal] X = [ethereal:crystal_ingot] **
 | 
					[3d_armor:chestplate_crystal] X = [ethereal:crystal_ingot] **
 | 
				
			||||||
 | 
					[3d_armor:chestplate_nether] X = [ethereal:nether_ingot] **
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Leggings:
 | 
					Leggings:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -57,6 +59,7 @@ Leggings:
 | 
				
			|||||||
[3d_armor:leggings_gold] X = [default:gold_ingot]
 | 
					[3d_armor:leggings_gold] X = [default:gold_ingot]
 | 
				
			||||||
[3d_armor:leggings_mithril] X = [moreores:mithril_ingot] *
 | 
					[3d_armor:leggings_mithril] X = [moreores:mithril_ingot] *
 | 
				
			||||||
[3d_armor:leggings_crystal] X = [ethereal:crystal_ingot] **
 | 
					[3d_armor:leggings_crystal] X = [ethereal:crystal_ingot] **
 | 
				
			||||||
 | 
					[3d_armor:leggings_nether] X = [ethereal:nether_ingot] **
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Boots:
 | 
					Boots:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -74,6 +77,8 @@ Boots:
 | 
				
			|||||||
[3d_armor:boots_gold] X = [default:gold_ingot]
 | 
					[3d_armor:boots_gold] X = [default:gold_ingot]
 | 
				
			||||||
[3d_armor:boots_mithril] X = [moreores:mithril_ingot] *
 | 
					[3d_armor:boots_mithril] X = [moreores:mithril_ingot] *
 | 
				
			||||||
[3d_armor:boots_crystal] X = [ethereal:crystal_ingot] **
 | 
					[3d_armor:boots_crystal] X = [ethereal:crystal_ingot] **
 | 
				
			||||||
 | 
					[3d_armor:boots_nether] X = [ethereal:nether_ingot] **
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 * Requires moreores mod by Calinou - https://forum.minetest.net/viewtopic.php?id=549
 | 
					 * Requires moreores mod by Calinou - https://forum.minetest.net/viewtopic.php?id=549
 | 
				
			||||||
** Requires ethereal mod by Chinchow & TenPlus1 - https://github.com/tenplus1/ethereal
 | 
					** Requires ethereal mod by Chinchow & TenPlus1 - https://github.com/tenplus1/ethereal
 | 
				
			||||||
 | 
					** Requires nether mod - https://github.com/minetest-mods/nether.git
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,3 +6,4 @@ fire?
 | 
				
			|||||||
ethereal?
 | 
					ethereal?
 | 
				
			||||||
bakedclay?
 | 
					bakedclay?
 | 
				
			||||||
moreores?
 | 
					moreores?
 | 
				
			||||||
 | 
					nether?
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,7 +96,7 @@ for _, mod in pairs(skin_mods) do
 | 
				
			|||||||
				armor:add_preview(fn)
 | 
									armor:add_preview(fn)
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		armor.skin_mod = mod
 | 
							armor.set_skin_mod(mod)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
if not minetest.get_modpath("moreores") then
 | 
					if not minetest.get_modpath("moreores") then
 | 
				
			||||||
@@ -105,6 +105,9 @@ end
 | 
				
			|||||||
if not minetest.get_modpath("ethereal") then
 | 
					if not minetest.get_modpath("ethereal") then
 | 
				
			||||||
	armor.materials.crystal = nil
 | 
						armor.materials.crystal = nil
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					if not minetest.get_modpath("nether") then
 | 
				
			||||||
 | 
						armor.materials.nether = nil
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dofile(modpath.."/armor.lua")
 | 
					dofile(modpath.."/armor.lua")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -296,7 +299,7 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
-- Armor Player Model
 | 
					-- Armor Player Model
 | 
				
			||||||
 | 
					
 | 
				
			||||||
default.player_register_model("3d_armor_character.b3d", {
 | 
					player_api.register_model("3d_armor_character.b3d", {
 | 
				
			||||||
	animation_speed = 30,
 | 
						animation_speed = 30,
 | 
				
			||||||
	textures = {
 | 
						textures = {
 | 
				
			||||||
		armor.default_skin..".png",
 | 
							armor.default_skin..".png",
 | 
				
			||||||
@@ -437,6 +440,20 @@ end, true)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_globalstep(function(dtime)
 | 
					minetest.register_globalstep(function(dtime)
 | 
				
			||||||
	timer = timer + dtime
 | 
						timer = timer + dtime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if armor.config.feather_fall == true then
 | 
				
			||||||
 | 
							for _,player in pairs(minetest.get_connected_players()) do
 | 
				
			||||||
 | 
								local name = player:get_player_name()
 | 
				
			||||||
 | 
								if armor.def[name].feather > 0 then
 | 
				
			||||||
 | 
									local vel_y = player:get_velocity().y
 | 
				
			||||||
 | 
									if vel_y < 0 and vel_y < 3 then
 | 
				
			||||||
 | 
										vel_y = -(vel_y * 0.05)
 | 
				
			||||||
 | 
										player:add_velocity({x = 0, y = vel_y, z = 0})
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if timer <= armor.config.init_delay then
 | 
						if timer <= armor.config.init_delay then
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										62
									
								
								3d_armor/locale/3d_armor.de.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					# textdomain: 3d_armor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### api.lua ###
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					3d_armor: Detached armor inventory is nil @1=3d_armor : Abgetrennter Rüstungsbestand ist nicht gesetzt: @1
 | 
				
			||||||
 | 
					3d_armor: Player name is nil @1=3d_armor : Spielername ist nicht gesetzt: @1
 | 
				
			||||||
 | 
					3d_armor: Player reference is nil @1=3d_armor : Spielerreferenz ist nicht gesetzt: @1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### armor.lua ###
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Admin Boots=Adminstiefel
 | 
				
			||||||
 | 
					Admin Chestplate=Adminbrustplatte
 | 
				
			||||||
 | 
					Admin Helmet=Adminhelm
 | 
				
			||||||
 | 
					Admin Leggings=Adminhose
 | 
				
			||||||
 | 
					Bronze Boots=Bronzestiefel
 | 
				
			||||||
 | 
					Bronze Chestplate=Bronzebrustplatte
 | 
				
			||||||
 | 
					Bronze Helmet=Bronzehelm
 | 
				
			||||||
 | 
					Bronze Leggings=Bronzehose
 | 
				
			||||||
 | 
					Cactus Boots=Kaktusstiefel
 | 
				
			||||||
 | 
					Cactus Chestplate=Kaktusbrustplatte
 | 
				
			||||||
 | 
					Cactus Helmet=Kaktushelm
 | 
				
			||||||
 | 
					Cactus Leggings=Kaktushose
 | 
				
			||||||
 | 
					Crystal Boots=Kristallstiefel
 | 
				
			||||||
 | 
					Crystal Chestplate=Kristallbrustplatte
 | 
				
			||||||
 | 
					Crystal Helmet=Kristallhelm
 | 
				
			||||||
 | 
					Crystal Leggings=Kristallhose
 | 
				
			||||||
 | 
					Nether Boots=Netherstiefel
 | 
				
			||||||
 | 
					Nether Chestplate=Netherbrustplatte
 | 
				
			||||||
 | 
					Nether Helmet=Netherhelm
 | 
				
			||||||
 | 
					Nether Leggings=Netherhose
 | 
				
			||||||
 | 
					Diamond Boots=Diamantstiefel
 | 
				
			||||||
 | 
					Diamond Chestplate=Diamantbrustplatte
 | 
				
			||||||
 | 
					Diamond Helmet=Diamanthelm
 | 
				
			||||||
 | 
					Diamond Leggings=Diamanthose
 | 
				
			||||||
 | 
					Gold Boots=Goldstiefel
 | 
				
			||||||
 | 
					Gold Chestplate=Goldbrustplatte
 | 
				
			||||||
 | 
					Gold Helmet=Goldhelm
 | 
				
			||||||
 | 
					Gold Leggings=Goldhose
 | 
				
			||||||
 | 
					Mithril Boots=Mithrilstiefel
 | 
				
			||||||
 | 
					Mithril Chestplate=Mithrilbrustplatte
 | 
				
			||||||
 | 
					Mithril Helmet=Mithrilhelm
 | 
				
			||||||
 | 
					Mithril Leggings=Mithrilhose
 | 
				
			||||||
 | 
					Steel Boots=Stahlstiefel
 | 
				
			||||||
 | 
					Steel Chestplate=Stahlbrustplatte
 | 
				
			||||||
 | 
					Steel Helmet=Stahlhelm
 | 
				
			||||||
 | 
					Steel Leggings=Stahlhose
 | 
				
			||||||
 | 
					Wood Boots=Holzstiefel
 | 
				
			||||||
 | 
					Wood Chestplate=Holzbrustplatte
 | 
				
			||||||
 | 
					Wood Helmet=Holzhelm
 | 
				
			||||||
 | 
					Wood Leggings=Holzhose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### init.lua ###
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					3d_armor: Failed to initialize player=3d_armor : Initialisierung des Spielers fehlgeschlagen
 | 
				
			||||||
 | 
					Fire=Feuer
 | 
				
			||||||
 | 
					Heal=Heilen
 | 
				
			||||||
 | 
					Level=Stufe
 | 
				
			||||||
 | 
					Radiation=Strahlen
 | 
				
			||||||
 | 
					Your @1 got destroyed!=Deine @1 wurde zerstört!
 | 
				
			||||||
 | 
					Your @1 is almost broken!=Deine @1 ist fast kaputt!
 | 
				
			||||||
 | 
					[3d_armor] Fire Nodes disabled=[3d_armor] Feuer-Knoten deaktiviert
 | 
				
			||||||
@@ -25,6 +25,10 @@ Crystal Boots=Botas de cristal
 | 
				
			|||||||
Crystal Chestplate=Peto de cristal
 | 
					Crystal Chestplate=Peto de cristal
 | 
				
			||||||
Crystal Helmet=Casco de cristal
 | 
					Crystal Helmet=Casco de cristal
 | 
				
			||||||
Crystal Leggings=Grebas de cristal
 | 
					Crystal Leggings=Grebas de cristal
 | 
				
			||||||
 | 
					Nether Boots=Botas de nether
 | 
				
			||||||
 | 
					Nether Chestplate=Peto de nether
 | 
				
			||||||
 | 
					Nether Helmet=Casco de nether
 | 
				
			||||||
 | 
					Nether Leggings=Grebas de nether
 | 
				
			||||||
Diamond Boots=Botas de diamante
 | 
					Diamond Boots=Botas de diamante
 | 
				
			||||||
Diamond Chestplate=Peto de diamante
 | 
					Diamond Chestplate=Peto de diamante
 | 
				
			||||||
Diamond Helmet=Casco de diamante
 | 
					Diamond Helmet=Casco de diamante
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,6 +25,10 @@ Crystal Boots=Bottes en cristal
 | 
				
			|||||||
Crystal Chestplate=Cuirasse en cristal
 | 
					Crystal Chestplate=Cuirasse en cristal
 | 
				
			||||||
Crystal Helmet=Casque en cristal
 | 
					Crystal Helmet=Casque en cristal
 | 
				
			||||||
Crystal Leggings=Jambières en cristal
 | 
					Crystal Leggings=Jambières en cristal
 | 
				
			||||||
 | 
					Nether Boots=Bottes en nether
 | 
				
			||||||
 | 
					Nether Chestplate=Cuirasse en nether
 | 
				
			||||||
 | 
					Nether Helmet=Casque en nether
 | 
				
			||||||
 | 
					Nether Leggings=Jambières en nether
 | 
				
			||||||
Diamond Boots=Bottes en diamant
 | 
					Diamond Boots=Bottes en diamant
 | 
				
			||||||
Diamond Chestplate=Cuirasse en diamant
 | 
					Diamond Chestplate=Cuirasse en diamant
 | 
				
			||||||
Diamond Helmet=Casque en diamant
 | 
					Diamond Helmet=Casque en diamant
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,6 +25,10 @@ Crystal Boots=Stivali di cristallo
 | 
				
			|||||||
Crystal Chestplate=Corazza di cristallo
 | 
					Crystal Chestplate=Corazza di cristallo
 | 
				
			||||||
Crystal Helmet=Elmo di cristallo
 | 
					Crystal Helmet=Elmo di cristallo
 | 
				
			||||||
Crystal Leggings=Gambali di cristallo
 | 
					Crystal Leggings=Gambali di cristallo
 | 
				
			||||||
 | 
					Nether Boots=Stivali di nether
 | 
				
			||||||
 | 
					Nether Chestplate=Corazza di nether
 | 
				
			||||||
 | 
					Nether Helmet=Elmo di nether
 | 
				
			||||||
 | 
					Nether Leggings=Gambali di nether
 | 
				
			||||||
Diamond Boots=Stivali di diamante
 | 
					Diamond Boots=Stivali di diamante
 | 
				
			||||||
Diamond Chestplate=Corazza di diamante
 | 
					Diamond Chestplate=Corazza di diamante
 | 
				
			||||||
Diamond Helmet=Elmo di diamante
 | 
					Diamond Helmet=Elmo di diamante
 | 
				
			||||||
@@ -83,3 +87,4 @@ Diamond Shield=Scudo di diamante
 | 
				
			|||||||
Gold Shield=Scudo d'oro
 | 
					Gold Shield=Scudo d'oro
 | 
				
			||||||
Mithril Shield=Scudo di mithril
 | 
					Mithril Shield=Scudo di mithril
 | 
				
			||||||
Crystal Shield=Scudo di cristallo
 | 
					Crystal Shield=Scudo di cristallo
 | 
				
			||||||
 | 
					Nether Shield=Scudo di nether
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,6 +25,10 @@ Crystal Boots=But Kristal
 | 
				
			|||||||
Crystal Chestplate=Perisai Dada Kristal
 | 
					Crystal Chestplate=Perisai Dada Kristal
 | 
				
			||||||
Crystal Helmet=Helmet Kristal
 | 
					Crystal Helmet=Helmet Kristal
 | 
				
			||||||
Crystal Leggings=Perisai Kaki Kristal
 | 
					Crystal Leggings=Perisai Kaki Kristal
 | 
				
			||||||
 | 
					Nether Boots=But Nether
 | 
				
			||||||
 | 
					Nether Chestplate=Perisai Dada Nether
 | 
				
			||||||
 | 
					Nether Helmet=Helmet Nether
 | 
				
			||||||
 | 
					Nether Leggings=Perisai Kaki Nether
 | 
				
			||||||
Diamond Boots=But Intan
 | 
					Diamond Boots=But Intan
 | 
				
			||||||
Diamond Chestplate=Perisai Dada Intan
 | 
					Diamond Chestplate=Perisai Dada Intan
 | 
				
			||||||
Diamond Helmet=Helmet Intan
 | 
					Diamond Helmet=Helmet Intan
 | 
				
			||||||
@@ -83,3 +87,4 @@ Diamond Shield=Perisai Pegang Intan
 | 
				
			|||||||
Gold Shield=Perisai Pegang Emas
 | 
					Gold Shield=Perisai Pegang Emas
 | 
				
			||||||
Mithril Shield=Perisai Pegang Mithril
 | 
					Mithril Shield=Perisai Pegang Mithril
 | 
				
			||||||
Crystal Shield=Perisai Pegang Kristal
 | 
					Crystal Shield=Perisai Pegang Kristal
 | 
				
			||||||
 | 
					Nether Shield=Perisai Pegang Nether
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,6 +25,10 @@ Crystal Boots=Botas de Cristal
 | 
				
			|||||||
Crystal Chestplate=Peitoral de Cristal
 | 
					Crystal Chestplate=Peitoral de Cristal
 | 
				
			||||||
Crystal Helmet=Capacete de Cristal
 | 
					Crystal Helmet=Capacete de Cristal
 | 
				
			||||||
Crystal Leggings=Calças de Cristal
 | 
					Crystal Leggings=Calças de Cristal
 | 
				
			||||||
 | 
					Nether Boots=Botas de Nether
 | 
				
			||||||
 | 
					Nether Chestplate=Peitoral de Nether
 | 
				
			||||||
 | 
					Nether Helmet=Capacete de Nether
 | 
				
			||||||
 | 
					Nether Leggings=Calças de Nether
 | 
				
			||||||
Diamond Boots=Botas de Diamante
 | 
					Diamond Boots=Botas de Diamante
 | 
				
			||||||
Diamond Chestplate=Peitoral de Diamante
 | 
					Diamond Chestplate=Peitoral de Diamante
 | 
				
			||||||
Diamond Helmet=Capacete de Diamante
 | 
					Diamond Helmet=Capacete de Diamante
 | 
				
			||||||
@@ -83,3 +87,4 @@ Diamond Shield=Escudo de Diamante
 | 
				
			|||||||
Gold Shield=Escudo de Ouro
 | 
					Gold Shield=Escudo de Ouro
 | 
				
			||||||
Mithril Shield=Escudo de Mithril
 | 
					Mithril Shield=Escudo de Mithril
 | 
				
			||||||
Crystal Shield=Escudo de Cristal
 | 
					Crystal Shield=Escudo de Cristal
 | 
				
			||||||
 | 
					Nether Shield=Escudo de Nether
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,6 +25,10 @@ Crystal Boots=Botas de Cristal
 | 
				
			|||||||
Crystal Chestplate=Peitoral de Cristal
 | 
					Crystal Chestplate=Peitoral de Cristal
 | 
				
			||||||
Crystal Helmet=Capacete de Cristal
 | 
					Crystal Helmet=Capacete de Cristal
 | 
				
			||||||
Crystal Leggings=Calças de Cristal
 | 
					Crystal Leggings=Calças de Cristal
 | 
				
			||||||
 | 
					Nether Boots=Botas de Nether
 | 
				
			||||||
 | 
					Nether Chestplate=Peitoral de Nether
 | 
				
			||||||
 | 
					Nether Helmet=Capacete de Nether
 | 
				
			||||||
 | 
					Nether Leggings=Calças de Nether
 | 
				
			||||||
Diamond Boots=Botas de Diamante
 | 
					Diamond Boots=Botas de Diamante
 | 
				
			||||||
Diamond Chestplate=Peitoral de Diamante
 | 
					Diamond Chestplate=Peitoral de Diamante
 | 
				
			||||||
Diamond Helmet=Capacete de Diamante
 | 
					Diamond Helmet=Capacete de Diamante
 | 
				
			||||||
@@ -83,3 +87,4 @@ Diamond Shield=Escudo de Diamante
 | 
				
			|||||||
Gold Shield=Escudo de Ouro
 | 
					Gold Shield=Escudo de Ouro
 | 
				
			||||||
Mithril Shield=Escudo de Mithril
 | 
					Mithril Shield=Escudo de Mithril
 | 
				
			||||||
Crystal Shield=Escudo de Cristal
 | 
					Crystal Shield=Escudo de Cristal
 | 
				
			||||||
 | 
					Nether Shield=Escudo de Nether
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,6 +25,10 @@ Crystal Boots=
 | 
				
			|||||||
Crystal Chestplate=
 | 
					Crystal Chestplate=
 | 
				
			||||||
Crystal Helmet=
 | 
					Crystal Helmet=
 | 
				
			||||||
Crystal Leggings=
 | 
					Crystal Leggings=
 | 
				
			||||||
 | 
					Nether Boots=
 | 
				
			||||||
 | 
					Nether Chestplate=
 | 
				
			||||||
 | 
					Nether Helmet=
 | 
				
			||||||
 | 
					Nether Leggings=
 | 
				
			||||||
Diamond Boots=
 | 
					Diamond Boots=
 | 
				
			||||||
Diamond Chestplate=
 | 
					Diamond Chestplate=
 | 
				
			||||||
Diamond Helmet=
 | 
					Diamond Helmet=
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
name = 3d_armor
 | 
					name = 3d_armor
 | 
				
			||||||
depends = default
 | 
					depends = default, player_api
 | 
				
			||||||
optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay, moreores
 | 
					optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay, moreores, nether
 | 
				
			||||||
description = Adds craftable armor that is visible to other players.
 | 
					description = Adds craftable armor that is visible to other players.
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_boots_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 324 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_boots_nether_preview.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 264 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_chestplate_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 581 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_chestplate_nether_preview.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 384 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_helmet_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 525 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_helmet_nether_preview.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 267 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_inv_boots_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 322 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_inv_chestplate_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 386 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_inv_helmet_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 267 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_inv_leggings_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 297 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_leggings_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 406 B  | 
							
								
								
									
										
											BIN
										
									
								
								3d_armor/textures/3d_armor_leggings_nether_preview.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 255 B  | 
@@ -38,6 +38,11 @@
 | 
				
			|||||||
3d_armor/textures/3d_armor_leggings_crystal.png:legs
 | 
					3d_armor/textures/3d_armor_leggings_crystal.png:legs
 | 
				
			||||||
3d_armor/textures/3d_armor_boots_crystal.png:feet
 | 
					3d_armor/textures/3d_armor_boots_crystal.png:feet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					3d_armor/textures/3d_armor_helmet_nether.png:head
 | 
				
			||||||
 | 
					3d_armor/textures/3d_armor_chestplate_nether.png:torso
 | 
				
			||||||
 | 
					3d_armor/textures/3d_armor_leggings_nether.png:legs
 | 
				
			||||||
 | 
					3d_armor/textures/3d_armor_boots_nether.png:feet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
3d_armor/textures/3d_armor_helmet_admin.png:head
 | 
					3d_armor/textures/3d_armor_helmet_admin.png:head
 | 
				
			||||||
3d_armor/textures/3d_armor_chestplate_admin.png:torso
 | 
					3d_armor/textures/3d_armor_chestplate_admin.png:torso
 | 
				
			||||||
3d_armor/textures/3d_armor_leggings_admin.png:legs
 | 
					3d_armor/textures/3d_armor_leggings_admin.png:legs
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -51,6 +51,8 @@ see armor.conf.example for all available options.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
For mod installation instructions, please visit: http://wiki.minetest.com/wiki/Installing_Mods
 | 
					For mod installation instructions, please visit: http://wiki.minetest.com/wiki/Installing_Mods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[API Reference](https://minetest-mods.github.io/3d_armor/reference/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[mod] Visible Wielded Items [wieldview]
 | 
					[mod] Visible Wielded Items [wieldview]
 | 
				
			||||||
---------------------------------------
 | 
					---------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1 @@
 | 
				
			|||||||
name = minetest-3d_armor
 | 
					 | 
				
			||||||
description = Visible player armor & wielded items.
 | 
					description = Visible player armor & wielded items.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@ armor_material_diamond (Enable diamond armor) bool true
 | 
				
			|||||||
armor_material_gold (Enable gold armor) bool true
 | 
					armor_material_gold (Enable gold armor) bool true
 | 
				
			||||||
armor_material_mithril (Enable mithril armor) bool true
 | 
					armor_material_mithril (Enable mithril armor) bool true
 | 
				
			||||||
armor_material_crystal (Enable crystal armor) bool true
 | 
					armor_material_crystal (Enable crystal armor) bool true
 | 
				
			||||||
 | 
					armor_material_nether (Enable nether armor) bool true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Increase this if you get initialization glitches when a player first joins.
 | 
					# Increase this if you get initialization glitches when a player first joins.
 | 
				
			||||||
armor_init_delay (Initialization delay) int 2
 | 
					armor_init_delay (Initialization delay) int 2
 | 
				
			||||||
@@ -58,7 +59,7 @@ armor_punch_damage (Enable damage effects) bool true
 | 
				
			|||||||
# Enable migration of old armor inventories.
 | 
					# Enable migration of old armor inventories.
 | 
				
			||||||
armor_migrate_old_inventory (Migrate old armor inventories) bool true
 | 
					armor_migrate_old_inventory (Migrate old armor inventories) bool true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Don't show armor on character model.
 | 
					# Armor is not visible on player model when enabled.
 | 
				
			||||||
armor_transparent (Transparent armor) bool false
 | 
					armor_transparent (Transparent armor) bool false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ Shields -- Crafting Guide
 | 
				
			|||||||
[shields:shield_gold] X = [default:gold_ingot]
 | 
					[shields:shield_gold] X = [default:gold_ingot]
 | 
				
			||||||
[shields:shield_mithril] X = [moreores:mithril_ingot]
 | 
					[shields:shield_mithril] X = [moreores:mithril_ingot]
 | 
				
			||||||
[shields:shield_crystal] X = [ethereal:crystal_ingot]
 | 
					[shields:shield_crystal] X = [ethereal:crystal_ingot]
 | 
				
			||||||
 | 
					[shields:shield_nether] X = [ethereal:nether_ingot]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Enhanced Shields
 | 
					Enhanced Shields
 | 
				
			||||||
----------------
 | 
					----------------
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										181
									
								
								shields/init.lua
									
									
									
									
									
								
							
							
						
						@@ -1,3 +1,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					--- 3D Armor Shields
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @topic shields
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- support for i18n
 | 
					-- support for i18n
 | 
				
			||||||
local S = minetest.get_translator(minetest.get_current_modname())
 | 
					local S = minetest.get_translator(minetest.get_current_modname())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -21,6 +27,14 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
-- Regisiter Shields
 | 
					-- Regisiter Shields
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--- Admin Shield
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--  @shield shields:shield_admin
 | 
				
			||||||
 | 
					--  @img shields_inv_shield_admin.png
 | 
				
			||||||
 | 
					--  @grp armor_shield 1000
 | 
				
			||||||
 | 
					--  @grp armor_heal 100
 | 
				
			||||||
 | 
					--  @grp armor_use 0
 | 
				
			||||||
 | 
					--  @grp not_int_creative_inventory 1
 | 
				
			||||||
armor:register_armor("shields:shield_admin", {
 | 
					armor:register_armor("shields:shield_admin", {
 | 
				
			||||||
	description = S("Admin Shield"),
 | 
						description = S("Admin Shield"),
 | 
				
			||||||
	inventory_image = "shields_inv_shield_admin.png",
 | 
						inventory_image = "shields_inv_shield_admin.png",
 | 
				
			||||||
@@ -29,7 +43,22 @@ armor:register_armor("shields:shield_admin", {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
minetest.register_alias("adminshield", "shields:shield_admin")
 | 
					minetest.register_alias("adminshield", "shields:shield_admin")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.wood then
 | 
					if armor.materials.wood then
 | 
				
			||||||
 | 
						--- Wood Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_wood
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_wood.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 2000
 | 
				
			||||||
 | 
						--  @grp flammable 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 5
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 3
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("shields:shield_wood", {
 | 
						armor:register_armor("shields:shield_wood", {
 | 
				
			||||||
		description = S("Wooden Shield"),
 | 
							description = S("Wooden Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_wood.png",
 | 
							inventory_image = "shields_inv_shield_wood.png",
 | 
				
			||||||
@@ -44,6 +73,19 @@ if armor.materials.wood then
 | 
				
			|||||||
			play_sound_effect(player, "default_wood_footstep")
 | 
								play_sound_effect(player, "default_wood_footstep")
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Enhanced Wood Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_enhanced_wood
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_enhanced_wood.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 2000
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 8
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 3
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("shields:shield_enhanced_wood", {
 | 
						armor:register_armor("shields:shield_enhanced_wood", {
 | 
				
			||||||
		description = S("Enhanced Wood Shield"),
 | 
							description = S("Enhanced Wood Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_enhanced_wood.png",
 | 
							inventory_image = "shields_inv_shield_enhanced_wood.png",
 | 
				
			||||||
@@ -74,6 +116,19 @@ if armor.materials.wood then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.cactus then
 | 
					if armor.materials.cactus then
 | 
				
			||||||
 | 
						--- Cactus Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_cactus
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_cactus.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 1000
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 5
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 1
 | 
				
			||||||
	armor:register_armor("shields:shield_cactus", {
 | 
						armor:register_armor("shields:shield_cactus", {
 | 
				
			||||||
		description = S("Cactus Shield"),
 | 
							description = S("Cactus Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_cactus.png",
 | 
							inventory_image = "shields_inv_shield_cactus.png",
 | 
				
			||||||
@@ -88,6 +143,19 @@ if armor.materials.cactus then
 | 
				
			|||||||
			play_sound_effect(player, "default_wood_footstep")
 | 
								play_sound_effect(player, "default_wood_footstep")
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
						--- Enhanced Cactus Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_enhanced_cactus
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_enhanced_cactus.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 1000
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 8
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 2
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("shields:shield_enhanced_cactus", {
 | 
						armor:register_armor("shields:shield_enhanced_cactus", {
 | 
				
			||||||
		description = S("Enhanced Cactus Shield"),
 | 
							description = S("Enhanced Cactus Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_enhanced_cactus.png",
 | 
							inventory_image = "shields_inv_shield_enhanced_cactus.png",
 | 
				
			||||||
@@ -118,6 +186,21 @@ if armor.materials.cactus then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.steel then
 | 
					if armor.materials.steel then
 | 
				
			||||||
 | 
						--- Steel Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_steel
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_steel.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 0
 | 
				
			||||||
 | 
						--  @grp armor_use 800
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.03
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.03
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("shields:shield_steel", {
 | 
						armor:register_armor("shields:shield_steel", {
 | 
				
			||||||
		description = S("Steel Shield"),
 | 
							description = S("Steel Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_steel.png",
 | 
							inventory_image = "shields_inv_shield_steel.png",
 | 
				
			||||||
@@ -136,6 +219,21 @@ if armor.materials.steel then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.bronze then
 | 
					if armor.materials.bronze then
 | 
				
			||||||
 | 
						--- Bronze Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_bronze
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_bronze.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 400
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.03
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.03
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 3
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 1
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("shields:shield_bronze", {
 | 
						armor:register_armor("shields:shield_bronze", {
 | 
				
			||||||
		description = S("Bronze Shield"),
 | 
							description = S("Bronze Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_bronze.png",
 | 
							inventory_image = "shields_inv_shield_bronze.png",
 | 
				
			||||||
@@ -154,6 +252,18 @@ if armor.materials.bronze then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.diamond then
 | 
					if armor.materials.diamond then
 | 
				
			||||||
 | 
						--- Diamond Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_diamond
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_diamond.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp choppy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("shields:shield_diamond", {
 | 
						armor:register_armor("shields:shield_diamond", {
 | 
				
			||||||
		description = S("Diamond Shield"),
 | 
							description = S("Diamond Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_diamond.png",
 | 
							inventory_image = "shields_inv_shield_diamond.png",
 | 
				
			||||||
@@ -171,6 +281,21 @@ if armor.materials.diamond then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.gold then
 | 
					if armor.materials.gold then
 | 
				
			||||||
 | 
						--- Gold Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_gold
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_gold.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 6
 | 
				
			||||||
 | 
						--  @grp armor_use 300
 | 
				
			||||||
 | 
						--  @grp physics_speed -0.04
 | 
				
			||||||
 | 
						--  @grp physics_gravity 0.04
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 10
 | 
				
			||||||
 | 
						--  @damagegrp cracky 1
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp choppy 2
 | 
				
			||||||
 | 
						--  @damagegrp crumbly 3
 | 
				
			||||||
 | 
						--  @damagegrp level 2
 | 
				
			||||||
	armor:register_armor("shields:shield_gold", {
 | 
						armor:register_armor("shields:shield_gold", {
 | 
				
			||||||
		description = S("Gold Shield"),
 | 
							description = S("Gold Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_gold.png",
 | 
							inventory_image = "shields_inv_shield_gold.png",
 | 
				
			||||||
@@ -189,11 +314,22 @@ if armor.materials.gold then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.mithril then
 | 
					if armor.materials.mithril then
 | 
				
			||||||
 | 
						--- Mithril Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_mithril
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_mithril.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("shields:shield_mithril", {
 | 
						armor:register_armor("shields:shield_mithril", {
 | 
				
			||||||
		description = S("Mithril Shield"),
 | 
							description = S("Mithril Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_mithril.png",
 | 
							inventory_image = "shields_inv_shield_mithril.png",
 | 
				
			||||||
		groups = {armor_shield=1, armor_heal=12, armor_use=100},
 | 
							groups = {armor_shield=1, armor_heal=13, armor_use=66},
 | 
				
			||||||
		armor_groups = {fleshy=15},
 | 
							armor_groups = {fleshy=16},
 | 
				
			||||||
		damage_groups = {cracky=2, snappy=1, level=3},
 | 
							damage_groups = {cracky=2, snappy=1, level=3},
 | 
				
			||||||
		reciprocate_damage = true,
 | 
							reciprocate_damage = true,
 | 
				
			||||||
		on_damage = function(player, index, stack)
 | 
							on_damage = function(player, index, stack)
 | 
				
			||||||
@@ -206,6 +342,18 @@ if armor.materials.mithril then
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if armor.materials.crystal then
 | 
					if armor.materials.crystal then
 | 
				
			||||||
 | 
						--- Crystal Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_crystal
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_crystal.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 12
 | 
				
			||||||
 | 
						--  @grp armor_use 100
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 15
 | 
				
			||||||
 | 
						--  @damagegrp cracky 2
 | 
				
			||||||
 | 
						--  @damagegrp snappy 1
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
	armor:register_armor("shields:shield_crystal", {
 | 
						armor:register_armor("shields:shield_crystal", {
 | 
				
			||||||
		description = S("Crystal Shield"),
 | 
							description = S("Crystal Shield"),
 | 
				
			||||||
		inventory_image = "shields_inv_shield_crystal.png",
 | 
							inventory_image = "shields_inv_shield_crystal.png",
 | 
				
			||||||
@@ -222,6 +370,35 @@ if armor.materials.crystal then
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if armor.materials.nether then
 | 
				
			||||||
 | 
						--- Nether Shield
 | 
				
			||||||
 | 
						--
 | 
				
			||||||
 | 
						--  @shield shields:shield_nether
 | 
				
			||||||
 | 
						--  @img shields_inv_shield_nether.png
 | 
				
			||||||
 | 
						--  @grp armor_shield 1
 | 
				
			||||||
 | 
						--  @grp armor_heal 17
 | 
				
			||||||
 | 
						--  @grp armor_use 200
 | 
				
			||||||
 | 
						--  @grp armor_fire 1
 | 
				
			||||||
 | 
						--  @armorgrp fleshy 20
 | 
				
			||||||
 | 
						--  @damagegrp cracky 3
 | 
				
			||||||
 | 
						--  @damagegrp snappy 2
 | 
				
			||||||
 | 
						--  @damagegrp level 3
 | 
				
			||||||
 | 
						armor:register_armor("shields:shield_nether", {
 | 
				
			||||||
 | 
							description = S("Nether Shield"),
 | 
				
			||||||
 | 
							inventory_image = "shields_inv_shield_nether.png",
 | 
				
			||||||
 | 
							groups = {armor_shield=1, armor_heal=17, armor_use=200, armor_fire=1},
 | 
				
			||||||
 | 
							armor_groups = {fleshy=20},
 | 
				
			||||||
 | 
							damage_groups = {cracky=3, snappy=2, level=3},
 | 
				
			||||||
 | 
							reciprocate_damage = true,
 | 
				
			||||||
 | 
							on_damage = function(player, index, stack)
 | 
				
			||||||
 | 
								play_sound_effect(player, "default_glass_footstep")
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
							on_destroy = function(player, index, stack)
 | 
				
			||||||
 | 
								play_sound_effect(player, "default_break_glass")
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for k, v in pairs(armor.materials) do
 | 
					for k, v in pairs(armor.materials) do
 | 
				
			||||||
	minetest.register_craft({
 | 
						minetest.register_craft({
 | 
				
			||||||
		output = "shields:shield_"..k,
 | 
							output = "shields:shield_"..k,
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										17
									
								
								shields/locale/shields.de.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					# textdomain: shields
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### init.lua ###
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Admin Shield=Adminschild
 | 
				
			||||||
 | 
					Bronze Shield=Bronzeschild
 | 
				
			||||||
 | 
					Cactus Shield=Kaktusschild
 | 
				
			||||||
 | 
					Crystal Shield=Kristallschild
 | 
				
			||||||
 | 
					Nether Shield=Netherschild
 | 
				
			||||||
 | 
					Diamond Shield=Diamantschild
 | 
				
			||||||
 | 
					Enhanced Cactus Shield=verbessert Kaktusschild
 | 
				
			||||||
 | 
					Enhanced Wood Shield=verbessert Holzschild
 | 
				
			||||||
 | 
					Gold Shield=Goldschild
 | 
				
			||||||
 | 
					Mithril Shield=Mithrilschild
 | 
				
			||||||
 | 
					Steel Shield=Stahlschild
 | 
				
			||||||
 | 
					Wooden Shield=Holzschild
 | 
				
			||||||
@@ -7,6 +7,7 @@ Admin Shield=Bouclier d'admin
 | 
				
			|||||||
Bronze Shield=Bouclier en bronze
 | 
					Bronze Shield=Bouclier en bronze
 | 
				
			||||||
Cactus Shield=Bouclier en cactus
 | 
					Cactus Shield=Bouclier en cactus
 | 
				
			||||||
Crystal Shield=Bouclier en cristal
 | 
					Crystal Shield=Bouclier en cristal
 | 
				
			||||||
 | 
					Nether Shield=Bouclier en nether
 | 
				
			||||||
Diamond Shield=Bouclier en diamant
 | 
					Diamond Shield=Bouclier en diamant
 | 
				
			||||||
Enhanced Cactus Shield=Bouclier en cactus amélioré
 | 
					Enhanced Cactus Shield=Bouclier en cactus amélioré
 | 
				
			||||||
Enhanced Wood Shield=Bouclier en bois amélioré
 | 
					Enhanced Wood Shield=Bouclier en bois amélioré
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ Admin Shield=
 | 
				
			|||||||
Bronze Shield=
 | 
					Bronze Shield=
 | 
				
			||||||
Cactus Shield=
 | 
					Cactus Shield=
 | 
				
			||||||
Crystal Shield=
 | 
					Crystal Shield=
 | 
				
			||||||
 | 
					Nether Shield=
 | 
				
			||||||
Diamond Shield=
 | 
					Diamond Shield=
 | 
				
			||||||
Enhanced Cactus Shield=
 | 
					Enhanced Cactus Shield=
 | 
				
			||||||
Enhanced Wood Shield=
 | 
					Enhanced Wood Shield=
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,4 +8,5 @@ shields/textures/shields_shield_gold.png:shield
 | 
				
			|||||||
shields/textures/shields_shield_diamond.png:shield
 | 
					shields/textures/shields_shield_diamond.png:shield
 | 
				
			||||||
shields/textures/shields_shield_mithril.png:shield
 | 
					shields/textures/shields_shield_mithril.png:shield
 | 
				
			||||||
shields/textures/shields_shield_crystal.png:shield
 | 
					shields/textures/shields_shield_crystal.png:shield
 | 
				
			||||||
 | 
					shields/textures/shields_shield_nether.png:shield
 | 
				
			||||||
shields/textures/shields_shield_admin.png:shield
 | 
					shields/textures/shields_shield_admin.png:shield
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								shields/textures/shields_inv_shield_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 468 B  | 
							
								
								
									
										
											BIN
										
									
								
								shields/textures/shields_shield_nether.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 518 B  | 
							
								
								
									
										
											BIN
										
									
								
								shields/textures/shields_shield_nether_preview.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 517 B  | 
@@ -69,12 +69,12 @@ end
 | 
				
			|||||||
minetest.register_on_joinplayer(function(player)
 | 
					minetest.register_on_joinplayer(function(player)
 | 
				
			||||||
	local name = player:get_player_name()
 | 
						local name = player:get_player_name()
 | 
				
			||||||
	wieldview.wielded_item[name] = ""
 | 
						wieldview.wielded_item[name] = ""
 | 
				
			||||||
	minetest.after(0, function()
 | 
						minetest.after(0, function(pname)
 | 
				
			||||||
		local pplayer = minetest.get_player_by_name(name)
 | 
							local pplayer = minetest.get_player_by_name(pname)
 | 
				
			||||||
		if player then
 | 
							if pplayer then
 | 
				
			||||||
			wieldview:update_wielded_item(pplayer)
 | 
								wieldview:update_wielded_item(pplayer)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end)
 | 
						end, name)
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_globalstep(function(dtime)
 | 
					minetest.register_globalstep(function(dtime)
 | 
				
			||||||
 
 | 
				
			|||||||