1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2025-06-28 14:26:18 +02:00

148 Commits

Author SHA1 Message Date
119ea9aee2 Version MFF 2019-05-12 19:20:27 +02:00
cc25d6be13 Merge pull request #66 from diogo-gomes/develop
Add table of contents to README.md
2016-08-21 17:52:03 +01:00
f557c4d69e Add table of contents to README.md 2016-07-25 14:48:52 +01:00
456c84e93e Merge pull request #65 from everamzah/fixbones
Try harder to add armor to bones
2016-07-22 17:51:06 +01:00
0157ebd683 Try harder to add armor to bones
Previously, if bones were on a slab, or some non-buildable_to but walkable
node, then the armor would fail to find the bones node (which is Y+1,
typically) and the armor would disappear.  This is an attempt to address that.
2016-07-22 10:46:05 -04:00
ac414d3df3 Remove admin shield from creative inventory 2016-05-27 19:51:39 +01:00
3cf6887abd Fix undeclared global error in hazmat_suit 2016-05-18 19:42:37 +01:00
b14db3c43c Add missing placer param to locked armor stand, fixes #59 2016-05-11 22:19:13 +01:00
8f8c6c6bfa Merge pull request #56 from Thomas--S/patch-2
Fix typo
2016-05-11 19:46:48 +01:00
54ec4b3cef Fix typo 2016-05-11 19:25:59 +02:00
32e87ee543 More armor stand fixes 2016-05-04 18:27:21 +01:00
d322a0f110 Modify helmet textures, fixes #49 2016-05-01 20:25:46 +01:00
9cc2f3db02 Radiation protection support added 2016-05-01 17:09:07 +01:00
ddd7f3786c Fix disappearing armor stand entities, again... 2016-05-01 16:11:27 +01:00
5c5359de4f Restore armor stand entities when knocked-back by TNT 2016-04-27 18:48:06 +01:00
1aa2b769d7 Rebase armor player model, fixes #54 2016-04-24 21:13:45 +01:00
5421ce46da Make armor stands 'blast-proof', fixes #55 2016-04-22 18:53:25 +01:00
72cffbae17 Restore moved armor stand objects to original position when possible 2016-04-20 20:26:01 +01:00
170ee39aed Auto remove stray armor stand entities 2016-04-20 18:54:34 +01:00
59bbc55b73 Fix armor stand entity duplication bug 2016-04-16 15:36:48 +01:00
1dd904f5be Merge pull request #50 from Thomas--S/patch-1
Add a locked armor stand
2016-04-13 17:41:37 +01:00
9de8cc12bb Fix disappearing entities when placing stands next to each other 2016-04-10 22:17:45 +01:00
4e8cf05436 Add a locked armor stand
This change adds a locked armor stand, so that player can use them savely on multiplayer worlds.
2016-04-10 20:11:53 +02:00
b6a44057a6 Fix some tabulation 2016-04-09 01:19:32 +01:00
ae33659168 Make cactus leggings inventory image more consistent 2016-04-08 21:35:56 +01:00
fb29ce9150 Add a chest-like visible armor stand, closes #48 2016-04-08 20:17:28 +01:00
7408ebcd81 Add support for mod managers 2016-03-25 19:52:00 +00:00
36737441d4 Merge pull request #45 from tenplus1/patch-7
Added insta-kill ability for tools/commands
2016-02-14 19:49:09 +00:00
5a112547e6 Added insta-kill ability for tools/commands
Some armor was too powerful that killing yourself to respawn wouldn't work or instant kill tools for admin didn't have effect, so I've added a check so that if the player is dealt with more than -100 damage points it instantly kills them but doesn't damage armor.  Also added /kill command.
2016-02-08 19:05:32 +00:00
0d5cf6d58a Merge pull request #44 from proller/patch-1
Dont rewrite inventory in creative mode
2016-02-08 03:54:28 +08:00
f17a104ab1 Dont rewrite inventory in creative mode
happens on first press I if no unified inventory installed
2016-02-07 18:46:37 +03:00
f83e7e9984 Merge pull request #43 from tenplus1/patch-6
admin helmet lets you breathe underwater
2016-01-28 01:35:46 +08:00
be1d353ec0 Merge pull request #42 from tenplus1/patch-5
Add ability to breath underwater
2016-01-28 01:34:45 +08:00
241aa663f1 admin helmet lets you breathe underwater
added armor_water=1 group to admin helmet so players can breathe underwater.
2016-01-25 14:48:23 +00:00
921e1ace24 Add ability to breath underwater
Added functionality for armor to have armor_water=1 in groups so that player can breathe underwater.
2016-01-25 14:47:05 +00:00
0ec2dbfb36 Update default fire protection nodes, closes #41 2015-12-19 19:25:43 +00:00
7fc991765c Utilize player_on_hpchange callback 2015-12-09 21:03:45 +00:00
991d2955e0 Simplify previous commit 2015-12-04 20:37:24 +00:00
64ec3dcf93 Allow armor textures to be specified by the tool definition 2015-12-04 18:42:42 +00:00
e1caf0ab0c Bump version to 0.4.5 2015-11-15 22:56:53 +00:00
a44d1a2530 Add 'listring' support for inventory mods, closes #38 2015-11-15 21:50:27 +00:00
16bc6232ca Add support for unified inventory 'ui_full' privilege 2015-11-15 19:18:21 +00:00
6efe3bf116 Merge pull request #40 from CraigyDavi/prevent-admin-drops
Prevent admin armor from being dropped
2015-10-30 01:46:19 +08:00
67867e78ec Prevent admin armor from being dropped 2015-10-29 14:19:59 +00:00
64f6be4d61 Bugfix: invalid capture index with non-english player names, resolves #39 2015-10-17 19:20:28 +01:00
741faf3520 Fix support for crafting modpack 2015-09-09 19:07:31 +01:00
1c56ee4bd6 Merge pull request #31 from tenplus1/patch-2
dtime glitches
2015-08-08 18:05:02 +01:00
40a3c1e0c4 Include Technic Armor in README.md 2015-07-25 19:11:36 +01:00
ae7ad422a5 Belated version string update (oopsie) 2015-07-15 20:52:56 +01:00
bad1452e87 Register fire-node overrides at start-up 2015-07-15 19:00:16 +01:00
7cefc1a7ba dtime glitches
sometimes dtime isn't registering when armor.update_armor is called and so it never checks for fire resistance on armor meaning cactus is fireproof if ethereal mod is found...  we cant have that :)  replaced dtime with ARMOR_UPDATE_TIME and it works fine :)
2015-07-15 16:57:17 +01:00
8f2badeec3 Add support for unified inventory 'lite' mode 2015-07-01 19:21:14 +01:00
734e01e847 Only check for fire damage if valid delta time 2015-05-15 18:39:32 +01:00
4eabd8512a Only round the drop position for bones (deja vu) 2015-05-06 20:59:22 +01:00
14a0eb8cca Fix armor damage when using fire protection (my bad) 2015-05-06 20:06:07 +01:00
e1ffdd6a0d Add technic shields by poet.nohit 2015-05-06 19:03:40 +01:00
306f193db6 Stop dropped armor disappearing into ground
This stops dropped armor disappearing into ground at times...
2015-05-06 18:41:40 +01:00
6704431499 Bump version to 0.4.4 2015-05-04 19:24:34 +01:00
bc0ea6b5bf Add technic armor by poet.nohit 2015-05-04 18:42:46 +01:00
0fc71201b4 Add crystal armor and fire protection by TenPlus1 2015-05-04 17:08:40 +01:00
d107708bec Fix Lua escape sequence, resolves #28 2015-05-01 18:06:43 +01:00
bd2ebac24e Merge pull request #27 from indriApollo/master
add support for inventory_enhanced
2015-04-26 12:23:24 +01:00
ebe159ac2c add support for inventory_enhanced 2015-04-25 18:45:59 +02:00
1d1534b416 Merge pull request #25 from indriApollo/master
Add support for wardrobe mod
2015-04-25 15:53:35 +01:00
91602ed6f2 Add support for wardrobe mod 2015-04-25 14:28:45 +02:00
2b0ce6f63e Check node is not nil before indexing 2015-04-17 19:41:15 +01:00
3badcea0d9 Merge pull request #24 from Pilcrow182/master
drop armor if no bones node is found
2015-04-17 19:38:26 +01:00
d2f32beebb drop armor if no bones node is found 2015-04-16 21:57:07 -05:00
b3f755f7d7 Merge pull request #23 from Pilcrow182/master
Put aromr drops into a single loop, fix #22
2015-04-15 18:57:15 +01:00
dec92749f9 Put aromr drops into a single loop, fix #22 2015-04-14 18:22:22 -05:00
9da2395586 More error logging improvements, fix #21 2015-04-02 20:59:45 +01:00
6942aa37d2 Drop excess armor items when bones are full 2015-03-21 17:48:09 +00:00
7da9d81963 Merge pull request #20 from ExeterDad/master
smaller b3d export
2015-03-20 18:20:27 +00:00
905fc9fcb0 smaller b3d export 2015-03-18 20:50:54 -04:00
b8e5d0adde Fix inverted normal on inner right arm 2015-03-18 18:37:04 +00:00
58337c0404 Better skin mod support and more preview bug fixes 2015-03-08 18:29:17 +00:00
87af6e0c68 Fix missing preview image when using simple_skins mod 2015-03-08 15:21:37 +00:00
70d353bb6c Merge pull request #19 from Calinou/optimize_textures
Optimize textures using OptiPNG
2015-02-22 13:54:28 +00:00
6e0fbc8bb2 Optimize textures using OptiPNG 2015-02-22 10:13:06 +01:00
9c2b9c9b5a Character model improvements. Extruded shields - closes #18 2015-02-21 16:34:49 +00:00
b8be801b94 Bump version to 0.4.3 2015-02-20 21:27:47 +00:00
679888398f Craft wooden armor from any type of wood [group:wood] 2015-02-20 15:09:30 +00:00
c03cefbc87 Don't show admin armor in the creative inventory 2015-02-19 22:11:03 +00:00
d95f494a94 Add some wieldview bug fixes from Carbone game by Calinou 2015-02-19 22:01:09 +00:00
195d138da5 Use b3d armor model export by ExeterDad 2015-02-19 21:08:24 +00:00
dd9c63e4ca Merge pull request #17 from ExeterDad/master
unlinked textures in 3d_amor_character blend file, and created 3d_amor ....
2015-02-19 20:56:26 +00:00
358e4a2467 unlinked textures in 3d_amor_character blend file, and created 3d_amor .b3d export 2015-02-19 14:59:44 -05:00
3dd43c7c6f Update shields to use the ARMOR_MATERIALS table 2015-02-19 19:18:34 +00:00
b17d8ea55a Allow individual armor materials to be disabled via armor.conf 2015-02-19 18:55:58 +00:00
e6979e9409 Update model files for newer versions of blender 2015-02-01 16:53:39 +00:00
466c5e6957 Add missing 'admin boots' texture 2015-01-24 00:18:20 +00:00
a9fcbf29fe Added cactus armor and admin armor 2015-01-09 20:16:22 +00:00
499d5af310 More error logging enhancements 2015-01-07 21:25:40 +00:00
e3c2616328 Improve error logging a little 2015-01-04 21:37:12 +00:00
b5db0f1aa6 Remove undeclared variable warnings on start-up 2015-01-04 19:57:55 +00:00
ad6c464573 More UV fixes 2014-10-09 18:34:21 +01:00
5ab2f73695 Fix UV error on cape 2014-10-08 18:55:01 +01:00
e14af35b95 Add compatibilty for caped skins 2014-10-05 19:05:11 +01:00
c3d37e83c2 Remove old character model 2014-10-05 19:03:40 +01:00
046880a534 Add compatiblity for SmallJoker's u_skins fork 2014-10-02 21:08:18 +01:00
258b1cbf48 Bump version to 0.4.2 2014-09-28 19:51:35 +01:00
c10a606632 Update README.md and fix paste error in crafting_guide.txt 2014-09-28 19:37:16 +01:00
2415d66057 Merge pull request #12 from donat-b/patch-1
Update init.lua
2014-09-28 15:13:09 +01:00
abf445014e Update init.lua
fix typo in condition
2014-09-28 15:39:31 +04:00
4415e2b33b Add support for simple skins by TenPlus1 2014-09-12 18:30:09 +01:00
36688c74a8 Add check for nil player inventory 2014-09-11 20:13:16 +01:00
672dbe1f54 Expose physics overrides in global armor.def 2014-09-11 20:11:08 +01:00
3c98acb9c9 Make ARMOR_DROP default depend on presence of bones mod 2014-08-17 17:07:27 +01:00
5075cc48a4 Allow per world configuration overrides 2014-08-17 17:00:52 +01:00
7eebc378a6 Fix crash if wielditem inventory image is nil 2014-06-25 21:10:35 +01:00
6f7a0ea7fc Merge pull request #9 from Megaf/master
Added Gold Armor and Shield
2014-06-12 22:28:47 +01:00
7ee4126d15 Merge branch 'master' of https://github.com/Megaf/minetest-3d_armor 2014-06-12 12:39:50 -03:00
b67de94223 Added gold recipe. 2014-06-12 12:39:17 -03:00
3604420d9e Added Gold Shield recipe. 2014-06-12 12:10:43 -03:00
0936d6f173 Change gold damage.
Gold is equivalent as bronze now.
2014-06-12 12:06:03 -03:00
e4ab8c02ac Created gold shields
They are as strong as Bronze Shields.
2014-06-12 12:04:08 -03:00
db157c080d Added Gold textures to shields.
new file:   shields/textures/shields_inv_shield_gold.png
	new file:   shields/textures/shields_shield_gold.png
	new file:   shields/textures/shields_shield_gold_preview.png
2014-06-12 12:00:52 -03:00
aaf90c2b24 new file: 3d_armor/textures/3d_armor_inv_chestplate_gold.png 2014-06-12 11:56:43 -03:00
4420afb8d1 Added gold textures.
new file:   3d_armor/textures/3d_armor_boots_gold.png
	new file:   3d_armor/textures/3d_armor_boots_gold_preview.png
	new file:   3d_armor/textures/3d_armor_chestplate_gold.png
	new file:   3d_armor/textures/3d_armor_chestplate_gold_preview.png
	new file:   3d_armor/textures/3d_armor_helmet_gold.png
	new file:   3d_armor/textures/3d_armor_helmet_gold_preview.png
	new file:   3d_armor/textures/3d_armor_inv_boots_gold.png
	new file:   3d_armor/textures/3d_armor_inv_helmet_gold.png
	new file:   3d_armor/textures/3d_armor_inv_leggings_gold.png
	new file:   3d_armor/textures/3d_armor_leggings_gold.png
	new file:   3d_armor/textures/3d_armor_leggings_gold_preview.png
2014-06-12 11:44:28 -03:00
3e9ce303e6 Update crafting_guide.txt
Added gold armor recipes.
2014-06-12 11:34:28 -03:00
11887fc73b Added Gold armor 2014-06-12 11:32:58 -03:00
85f56f7ba0 Check for valid player inventory 2014-04-21 19:10:24 +01:00
eedf913638 Set inventory mod to main page on die player 2014-04-18 00:12:38 +01:00
ecfd397d77 Fix error in previous commit 2014-04-15 22:06:47 +01:00
b76508397f Only round the drop position when using bones mod 2014-04-15 21:55:23 +01:00
9aaba7569c Update config example 2014-04-15 21:52:24 +01:00
1886fe6b1a Fix armor wear level being fully restored on item drop 2014-04-14 19:28:23 +01:00
19d45efd12 Fix preview not updating when armor is destroyed 2014-04-14 19:25:10 +01:00
72b612f081 Update armor.conf.example 2014-04-13 20:26:14 +01:00
8a881022e9 Make armor more configurable 2014-04-13 20:17:11 +01:00
8457220413 Add support for unified inventory and skins 2014-04-13 17:41:19 +01:00
cf2786a818 Add support for bones mod 2014-04-08 22:03:01 +01:00
5345c50c7e Bump version to 0.4.1 for minetest 0.4.9 2014-01-03 20:55:32 +00:00
2b8e0c5fd9 Merge pull request #6 from Bremaweb/armor-physics
add physics overrides to armor
2013-12-23 11:24:12 -08:00
55e2b69a08 change delay back to 0 2013-12-22 19:51:46 -06:00
a07a00c117 remove unused variable 2013-12-20 23:56:50 -06:00
681bf25505 add physics overrides to armor 2013-12-20 23:52:15 -06:00
0b3deea513 Improve player model hanlding and update to version 0.4.0 2013-11-12 21:22:52 +00:00
9dbf76d013 UV mapping fix, edge of boots showing on hat layer 2013-10-15 22:03:43 +01:00
f71204db09 Merge pull request #5 from BlockMen/2nd
Better implementation of support for hud
2013-09-13 10:38:44 -07:00
025c0136b7 Merge pull request #4 from BlockMen/master
Add support for Better HUD mod
2013-09-12 10:15:26 -07:00
cf87528a03 General way to provide read out of armor 2013-09-12 01:29:30 +02:00
9481e548cf Add support for Better HUD mod 2013-09-12 01:08:11 +02:00
02ba28f11b Make wielded item more 3d looking 2013-08-04 22:20:03 +01:00
5e52758216 Add texture transform support 2013-08-04 22:17:08 +01:00
59048743ab Update Textures 2013-07-14 19:20:54 +01:00
cfc6984a36 Update Models 2013-07-14 19:15:11 +01:00
619a52688f Add multiple UV texture support 2013-07-14 18:24:24 +01:00
310 changed files with 2172 additions and 8134 deletions

1
.gitignore vendored
View File

@ -4,4 +4,5 @@
*bak*
tags
*.vim
armor.conf

View File

@ -1,15 +1,24 @@
[mod] Visible Player Armor [3d_armor]
=====================================
depends: default, inventory_plus, unified_skins
Depends: default
Adds craftable armor that is visible to other players. Each armor item worn contibutes to
Recommends: inventory_plus or unified_inventory (use only one)
Adds craftable armor that is visible to other players. Each armor item worn contributes to
a player's armor group level making them less vulnerable to weapons.
Armor takes damage when a player is hurt but also offers a percentage chance of healing.
Overall level is boosted by 10% when wearing a full matching set.
default settings: [minetest.conf]
Fire protection added by TenPlus1 when using crystal armor if Ethereal mod active, level 1
protects against torches, level 2 for crystal spike, level 3 for fire, level 5 for lava.
# Set number of seconds between armor updates.
3d_armor_update_time = 1
Configuration
-------------
Armor can be configured by adding a file called armor.conf in 3d_armor mod and/or world directory.
see armor.conf.example for all available options.
Note: worldpath config settings override any settings made in the mod's directory.

45
3d_armor/admin.lua Normal file
View File

@ -0,0 +1,45 @@
minetest.register_alias("adminboots","3d_armor:boots_admin")
minetest.register_alias("adminhelmet","3d_armor:helmet_admin")
minetest.register_alias("adminchestplate","3d_armor:chestplate_admin")
minetest.register_alias("adminleggings","3d_armor:leggings_admin")
minetest.register_tool("3d_armor:helmet_admin", {
description = "Admin Helmet",
inventory_image = "3d_armor_inv_helmet_admin.png",
groups = {armor_head=1000, armor_heal=1000, armor_use=0, armor_water=1,},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})
minetest.register_tool("3d_armor:chestplate_admin", {
description = "Admin Chestplate",
inventory_image = "3d_armor_inv_chestplate_admin.png",
groups = {armor_torso=1000, armor_heal=1000, armor_use=0},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})
minetest.register_tool("3d_armor:leggings_admin", {
description = "Admin Leggings",
inventory_image = "3d_armor_inv_leggings_admin.png",
groups = {armor_legs=1000, armor_heal=1000, armor_use=0},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})
minetest.register_tool("3d_armor:boots_admin", {
description = "Admin Boots",
inventory_image = "3d_armor_inv_boots_admin.png",
groups = {armor_feet=1000, armor_heal=1000, armor_use=0},
wear = 0,
on_drop = function(itemstack, dropper, pos)
return
end,
})

View File

@ -0,0 +1,57 @@
-- Armor Configuration (defaults)
-- You can remove any unwanted armor materials from this table.
-- Note that existing armor that is removed will show up as an unknown item.
ARMOR_MATERIALS = {
wood = "group:wood",
cactus = "default:cactus",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
diamond = "default:diamond",
gold = "default:gold_ingot",
mithril = "default:mithril_ingot",
crystal = "ethereal:crystal_ingot",
}
-- Enable fire protection (defaults true if using ethereal mod)
ARMOR_FIRE_PROTECT = false
-- Fire protection nodes, (name, protection level, damage)
ARMOR_FIRE_NODES = {
{"default:lava_source", 5, 4},
{"default:lava_flowing", 5, 4},
{"fire:basic_flame", 3, 4},
{"fire:permanent_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"ethereal:fire_flower", 2, 1},
{"default:torch", 1, 1},
}
-- Increase this if you get initialization glitches when a player first joins.
ARMOR_INIT_DELAY = 1
-- Number of initialization attempts.
-- Use in conjunction with ARMOR_INIT_DELAY if initialization problems persist.
ARMOR_INIT_TIMES = 1
-- Increase this if armor is not getting into bones due to server lag.
ARMOR_BONES_DELAY = 1
-- How often player armor/wield items are updated.
ARMOR_UPDATE_TIME = 1
-- Drop armor when a player dies.
-- Uses bones mod if present, otherwise items are dropped around the player.
ARMOR_DROP = true
-- Pulverise armor when a player dies, overrides ARMOR_DROP.
ARMOR_DESTROY = false
-- You can use this to increase or decrease overall armor effectiveness,
-- eg: ARMOR_LEVEL_MULTIPLIER = 0.5 will reduce armor level by half.
ARMOR_LEVEL_MULTIPLIER = 1
-- You can use this to increase or decrease overall armor healing,
-- eg: ARMOR_HEAL_MULTIPLIER = 0 will disable healing altogether.
ARMOR_HEAL_MULTIPLIER = 1

View File

@ -1,159 +1,721 @@
local time = 0
local update_time = tonumber(minetest.setting_get("3d_armor_update_time"))
if not update_time then
update_time = 1
minetest.setting_set("3d_armor_update_time", tostring(update_time))
local armors_no_shields = { ["3d_armor:helmet_hardenedleather"] = true,["3d_armor:chestplate_hardenedleather"] = true,
["3d_armor:leggings_hardenedleather"] = true,["3d_armor:boots_hardenedleather"] = true,
["3d_armor:helmet_reinforcedleather"] = true,["3d_armor:chestplate_reinforcedleather"] = true,
["3d_armor:leggings_reinforcedleather"] = true,["3d_armor:boots_reinforcedleather"] = true,
} -- modif MFF (crabman/24/06/2015)
ARMOR_INIT_DELAY = 1
ARMOR_INIT_TIMES = 1
ARMOR_BONES_DELAY = 1
ARMOR_UPDATE_TIME = 1
ARMOR_DROP = minetest.get_modpath("bones") ~= nil
ARMOR_DESTROY = false
ARMOR_LEVEL_MULTIPLIER = 1
ARMOR_HEAL_MULTIPLIER = 1
ARMOR_RADIATION_MULTIPLIER = 1
ARMOR_MATERIALS = {
wood = "group:wood",
cactus = "default:cactus",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
diamond = "default:diamond",
gold = "default:gold_ingot",
mithril = "default:mithril_ingot",
crystal = "ethereal:crystal_ingot",
-- Hunter armors (A déc-ommenter quand activation de l'armure au total)
hardenedleather = "3d_armor:hardenedleather",
reinforcedleather = "3d_armor:reinforcedleather",
-- Warrior armors
blackmithril = "3d_armor:blackmithril_ingot"
-- Wizard armors
--armor = "xxx",
--armor = "xxx",
}
ARMOR_FIRE_PROTECT = minetest.get_modpath("ethereal") ~= nil
ARMOR_FIRE_NODES = {
{"default:lava_source", 5, 8},
{"default:lava_flowing", 5, 8},
{"fire:basic_flame", 3, 4},
{"fire:permanent_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"ethereal:fire_flower", 2, 1},
{"default:torch", 1, 1},
}
local skin_mod = nil
local inv_mod = nil
local modpath = minetest.get_modpath(ARMOR_MOD_NAME)
local worldpath = minetest.get_worldpath()
local input = io.open(modpath.."/armor.conf", "r")
if input then
dofile(modpath.."/armor.conf")
input:close()
input = nil
end
input = io.open(worldpath.."/armor.conf", "r")
if input then
dofile(worldpath.."/armor.conf")
input:close()
input = nil
end
if not minetest.get_modpath("ethereal") then
ARMOR_MATERIALS.crystal = nil
end
armor = {
player_hp = {},
timer = 0,
elements = {"head", "torso", "legs", "feet"},
formspec = "size[8,8.5]button[0,0;2,0.5;main;Back]"
physics = {"jump","speed","gravity"},
formspec = "size[8,8.5]image[2,0.75;2,4;armor_preview]"
.."list[current_player;main;0,4.5;8,4;]"
.."list[detached:player_name_armor;armor_head;3,0;1,1;]"
.."list[detached:player_name_armor;armor_torso;3,1;1,1;]"
.."list[detached:player_name_armor;armor_legs;3,2;1,1;]"
.."list[detached:player_name_armor;armor_feet;3,3;1,1;]",
.."list[current_player;craft;4,1;3,3;]"
.."list[current_player;craftpreview;7,2;1,1;]"
.."listring[current_player;main]"
.."listring[current_player;craft]",
textures = {},
default_skin = "character",
version = "0.4.5",
}
armor.set_player_armor = function(self, player)
if minetest.get_modpath("inventory_plus") then
inv_mod = "inventory_plus"
armor.formspec = "size[8,8.5]button[0,0;2,0.5;main;Back]"
.."image[2.5,0.75;2,4;armor_preview]"
.."label[5,1;Level: armor_level]"
.."label[5,1.5;Heal: armor_heal]"
.."label[5,2;Fire: armor_fire]"
.."label[5,2.5;Radiation: armor_radiation]"
.."list[current_player;main;0,4.5;8,4;]"
if minetest.get_modpath("crafting") then
inventory_plus.get_formspec = function(player, page)
end
end
elseif minetest.get_modpath("unified_inventory") then
inv_mod = "unified_inventory"
unified_inventory.register_button("armor", {
type = "image",
image = "inventory_plus_armor.png",
tooltip = "Armor inventory",
show_with = false, --Modif MFF (Crabman 30/06/2015)
})
unified_inventory.register_page("armor", {
get_formspec = function(player, perplayer_formspec)
local fy = perplayer_formspec.formspec_y
local name = player:get_player_name()
local formspec = "background[0.06,"..fy..";7.92,7.52;3d_armor_ui_form.png]"
.."label[0,0;Armor]"
.."list[detached:"..name.."_armor;armor;0,"..fy..";2,3;]"
.."image[2.5,"..(fy - 0.25)..";2,4;"..armor.textures[name].preview.."]"
.."label[5.0,"..(fy + 0.0)..";Level: "..armor.def[name].level.."]"
.."label[5.0,"..(fy + 0.4)..";Heal: "..armor.def[name].heal.."]"
.."label[5.0,"..(fy + 0.8)..";Fire: "..armor.def[name].fire.."]"
.."label[5.0,"..(fy + 1.2)..";Radiation: "..armor.def[name].radiation.."]"
.."label[5.0,"..(fy + 1.6)..";Speed: "..armor.def[name].speed.."]"
.."label[5.0,"..(fy + 2)..";Jump: "..armor.def[name].jump.."]"
.."label[5.0,"..(fy + 2.4)..";Gravity: "..armor.def[name].gravity.."]"
.."listring[current_player;main]"
.."listring[detached:"..name.."_armor;armor]"
return {formspec=formspec}
end,
})
elseif minetest.get_modpath("inventory_enhanced") then
inv_mod = "inventory_enhanced"
end
if minetest.get_modpath("skins") then
skin_mod = "skins"
elseif minetest.get_modpath("simple_skins") then
skin_mod = "simple_skins"
elseif minetest.get_modpath("u_skins") then
skin_mod = "u_skins"
elseif minetest.get_modpath("wardrobe") then
skin_mod = "wardrobe"
end
armor.def = {
state = 0,
count = 0,
}
armor.update_player_visuals = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local player_inv = player:get_inventory()
local armor_texture = uniskins.default_texture
local armor_level = 0
local textures = {}
for _,v in ipairs(self.elements) do
local stack = player_inv:get_stack("armor_"..v, 1)
local level = stack:get_definition().groups["armor_"..v]
if level then
local item = stack:get_name()
table.insert(textures, item:gsub("%:", "_")..".png")
armor_level = armor_level + level
end
if self.textures[name] then
default.player_set_textures(player, {
self.textures[name].skin,
self.textures[name].armor,
self.textures[name].wielditem,
})
end
if table.getn(textures) > 0 then
end
armor.set_player_armor = function(self, player)
local name, player_inv = armor:get_valid_player(player, "[set_player_armor]")
if not name then
return
end
local armor_texture = "3d_armor_trans.png"
local armor_level = 0
local armor_heal = 0
local armor_fire = 0
local armor_water = 0
local armor_radiation = 0
local state = 0
local items = 0
local elements = {}
local textures = {}
local physics_o = {speed=1,gravity=1,jump=1}
local material = {type=nil, count=1}
local preview = ""
for _,v in ipairs(self.elements) do
elements[v] = false
end
for i=1, 6 do
local stack = player_inv:get_stack("armor", i)
local item = stack:get_name()
if stack:get_count() == 1 then
local def = stack:get_definition()
for k, v in pairs(elements) do
if v == false then
local level = def.groups["armor_"..k]
if level then
local texture = item:gsub("%:", "_")
if texture:find("enchanted") then --MFF xdecor enchanting preview fix
texture = texture:gsub("_enchanted", "")
texture = texture:gsub("_strong", "")
texture = texture:gsub("_speed", "")
end
table.insert(textures, texture..".png")
if preview == "" then
preview = texture .. "_preview.png"
elseif stack:get_name():find("shield") then -- //MFF(Mg|09/05/15)
preview = preview.. "^" .. texture.."_preview.png"
else
preview = texture .. "_preview.png^" .. preview
end
armor_level = armor_level + level
state = state + stack:get_wear()
items = items + 1
armor_heal = armor_heal + (def.groups["armor_heal"] or 0)
armor_fire = armor_fire + (def.groups["armor_fire"] or 0)
armor_water = armor_water + (def.groups["armor_water"] or 0)
armor_radiation = armor_radiation + (def.groups["armor_radiation"] or 0)
for kk,vv in ipairs(self.physics) do
local o_value = def.groups["physics_"..vv]
if o_value then
physics_o[vv] = physics_o[vv] + o_value
end
end
local mat = string.match(item, "%:.+_(.+)$")
if material.type then
if material.type == mat then
material.count = material.count + 1
end
else
material.type = mat
end
elements[k] = true
end
end
end
end
end
if preview ~= "" then
preview = "^" .. preview
end
preview = armor:get_preview(name) .. preview -- //MFF(Mg|09/05/15)
if minetest.get_modpath("shields") then
armor_level = armor_level * 0.9
end
if material.type and material.count == #self.elements then
armor_level = armor_level * 1.1
end
armor_level = armor_level * ARMOR_LEVEL_MULTIPLIER
armor_heal = armor_heal * ARMOR_HEAL_MULTIPLIER
armor_radiation = armor_radiation * ARMOR_RADIATION_MULTIPLIER
if #textures > 0 then
armor_texture = table.concat(textures, "^")
end
local armor_groups = {fleshy=100}
if armor_level > 0 then
armor_groups.level = math.floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
armor_groups.radiation = 100 - armor_radiation
end
player:set_armor_groups(armor_groups)
uniskins.armor[name] = armor_texture
uniskins:update_player_visuals(player)
--player:set_physics_override(physics_o)
player_physics.set_stats(player, "3d_armor", {speed=physics_o.speed-1, jump=physics_o.jump-1, gravity=physics_o.gravity-1})
pclasses.api.util.on_update(name)
self.textures[name].armor = armor_texture
self.textures[name].preview = preview
self.def[name].state = state
self.def[name].count = items
self.def[name].level = armor_level
self.def[name].heal = armor_heal
self.def[name].jump = physics_o.jump
self.def[name].speed = physics_o.speed
self.def[name].gravity = physics_o.gravity
self.def[name].fire = armor_fire
self.def[name].water = armor_water
self.def[name].radiation = armor_radiation
self:update_player_visuals(player)
end
armor.update_armor = function(self, player)
-- Legacy support: Called when armor levels are changed
-- Other mods can hook on to this function, see hud mod for example
end
armor.get_player_skin = function(self, name)
local skin = nil
if skin_mod == "skins" or skin_mod == "simple_skins" then
skin = skins.skins[name]
elseif skin_mod == "u_skins" then
skin = u_skins.u_skins[name]
elseif skin_mod == "wardrobe" then
skin = string.gsub(wardrobe.playerSkins[name], "%.png$","")
end
return skin or armor.default_skin
end
armor.get_preview = function(self, name)
if skin_mod == "skins" then
return armor:get_player_skin(name).."_preview.png"
elseif skin_mod == "u_skins"then
return string.gsub(armor.textures[name].skin, ".png", "_preview.png")
end
return "character_preview.png"
end
armor.get_armor_formspec = function(self, name)
if not armor.textures[name] then
minetest.log("error", "3d_armor: Player texture["..name.."] is nil [get_armor_formspec]")
return ""
end
if not armor.def[name] then
minetest.log("error", "3d_armor: Armor def["..name.."] is nil [get_armor_formspec]")
return ""
end
local formspec = armor.formspec.."list[detached:"..name.."_armor;armor;0,1;2,3;]"
formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
formspec = formspec:gsub("armor_level", armor.def[name].level)
formspec = formspec:gsub("armor_heal", armor.def[name].heal)
formspec = formspec:gsub("armor_fire", armor.def[name].fire)
formspec = formspec:gsub("armor_radiation", armor.def[name].radiation)
formspec = formspec:gsub("armor_speed", armor.def[name].speed)
formspec = formspec:gsub("armor_jump", armor.def[name].jump)
formspec = formspec:gsub("armor_gravity", armor.def[name].gravity)
return formspec
end
armor.update_inventory = function(self, player)
local name = armor:get_valid_player(player, "[set_player_armor]")
if not name or inv_mod == "inventory_enhanced" then
return
end
if inv_mod == "unified_inventory" then
if unified_inventory.current_page[name] == "armor" then
unified_inventory.set_inventory_formspec(player, "armor")
end
else
local formspec = armor:get_armor_formspec(name)
if inv_mod == "inventory_plus" then
formspec = formspec.."listring[current_player;main]"
.."listring[detached:"..name.."_armor;armor]"
local page = player:get_inventory_formspec()
if page:find("detached:"..name.."_armor") then
inventory_plus.set_inventory_formspec(player, formspec)
end
else
player:set_inventory_formspec(formspec)
end
end
end
armor.get_valid_player = function(self, player, msg)
msg = msg or ""
if not player then
minetest.log("error", "3d_armor: Player reference is nil "..msg)
return
end
local name = player:get_player_name()
local hp = player:get_hp() or 0
if hp == 0 or hp == self.player_hp[name] then
if not name then
minetest.log("error", "3d_armor: Player name is nil "..msg)
return
end
if self.player_hp[name] > hp then
local player_inv = player:get_inventory()
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
if not armor_inv then
return
end
local heal_max = 0
for _,v in ipairs(self.elements) do
local stack = armor_inv:get_stack("armor_"..v, 1)
if stack:get_count() > 0 then
local use = stack:get_definition().groups["armor_use"] or 0
local heal = stack:get_definition().groups["armor_heal"] or 0
local item = stack:get_name()
stack:add_wear(use)
armor_inv:set_stack("armor_"..v, 1, stack)
player_inv:set_stack("armor_"..v, 1, stack)
if stack:get_count() == 0 then
local desc = minetest.registered_items[item].description
if desc then
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
end
self:set_player_armor(player)
end
heal_max = heal_max + heal
end
end
if heal_max > math.random(100) then
player:set_hp(self.player_hp[name])
return
end
local pos = player:getpos()
local player_inv = player:get_inventory()
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
if not pos then
minetest.log("error", "3d_armor: Player position is nil "..msg)
return
elseif not player_inv then
minetest.log("error", "3d_armor: Player inventory is nil "..msg)
return
elseif not armor_inv then
minetest.log("error", "3d_armor: Detached armor inventory is nil "..msg)
return
end
self.player_hp[name] = hp
return name, player_inv, armor_inv, pos
end
-- Register Player Model
default.player_register_model("3d_armor_character.b3d", {
animation_speed = 30,
textures = {
armor.default_skin..".png",
"3d_armor_trans.png",
"3d_armor_trans.png",
},
animations = {
stand = {x=0, y=79},
lay = {x=162, y=166},
walk = {x=168, y=187},
mine = {x=189, y=198},
walk_mine = {x=200, y=219},
sit = {x=81, y=160},
},
})
-- Register Callbacks
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
if fields.armor then
local formspec = armor.formspec:gsub("player_name", name)
local name = armor:get_valid_player(player, "[on_player_receive_fields]")
if not name or inv_mod == "inventory_enhanced" then
return
end
if inv_mod == "inventory_plus" and fields.armor then
local formspec = armor:get_armor_formspec(name)
inventory_plus.set_inventory_formspec(player, formspec)
return
end
for field, _ in pairs(fields) do
if string.sub(field,0,string.len("skins_set_")) == "skins_set_" then
if string.find(field, "skins_set") then
minetest.after(0, function(player)
uniskins.skin[name] = skins.skins[name]..".png"
uniskins:update_player_visuals(player)
local skin = armor:get_player_skin(name)
armor.textures[name].skin = skin..".png"
armor:set_player_armor(player)
end, player)
end
end
end)
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player,"armor", "Armor")
local player_inv = player:get_inventory()
default.player_set_model(player, "3d_armor_character.b3d")
local name = player:get_player_name()
local armor_inv = minetest.create_detached_inventory(name.."_armor",{
local player_inv = player:get_inventory()
local armor_inv = minetest.create_detached_inventory(name.."_armor", {
on_put = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, stack)
armor:set_player_armor(player)
armor:update_inventory(player)
end,
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, nil)
armor:set_player_armor(player)
armor:update_inventory(player)
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
local plaver_inv = player:get_inventory()
local old_stack = inv:get_stack(from_list, from_index)
local stack = inv:get_stack(to_list, to_index)
player_inv:set_stack(to_list, to_index, stack)
player_inv:set_stack(from_list, from_index, old_stack)
armor:set_player_armor(player)
armor:update_inventory(player)
end,
allow_put = function(inv, listname, index, stack, player)
if inv:is_empty(listname) then
return 1
--DEBUT modif MFF (crabman/24/06/2015)
local name = stack:get_name()
local player_inv = player:get_inventory()
local size = player_inv:get_size(listname)
if not ( (name:split(":")[1] == "3d_armor" and stack:get_definition().groups["armor_heal"]) or name:split(":")[1] == "shields") then
return 0
end
return 0
-- if player class != item class
if not pclasses.api.util.can_have_item(player:get_player_name(), name) then
return 0
end
--MFF (crabman/27/11/2015) no same item type. *helmet*
local ptype = name:split(":")[2]:split("_")[1]
if ptype == "enchanted" then
ptype = name:split(":")[2]:split("_")[2]
end
for i=1, size do
local stack = player_inv:get_stack(listname, i)
if stack:get_count() > 0 then
if stack:get_name():find(ptype) then
return 0
end
end
end
if name:find("shield") then
for i=1, size do
local stack = player_inv:get_stack(listname, i)
if stack:get_count() > 0 then
if armors_no_shields[stack:get_name()] ~= nil then
return 0
end
end
end
else
if armors_no_shields[name] ~= nil then
for i=1, size do
local stack = player_inv:get_stack(listname, i)
if stack:get_count() > 0 then
if stack:get_name():find("shields:") then
return 0
end
end
end
end
end
--FIN modif MFF (crabman/24/06/2015)
return 1
end,
allow_take = function(inv, listname, index, stack, player)
return stack:get_count()
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
return count
end,
})
for _,v in ipairs(armor.elements) do
local list = "armor_"..v
player_inv:set_size(list, 1)
armor_inv:set_size(list, 1)
armor_inv:set_stack(list, 1, player_inv:get_stack(list, 1))
if inv_mod == "inventory_plus" then
inventory_plus.register_button(player,"armor", "Armor")
end
armor.player_hp[name] = 0
minetest.after(0, function(player)
armor:set_player_armor(player)
end, player)
end)
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > update_time then
for _,player in ipairs(minetest.get_connected_players()) do
armor:update_armor(player)
armor_inv:set_size("armor", 6)
player_inv:set_size("armor", 6)
for i=1, 6 do
local stack = player_inv:get_stack("armor", i)
armor_inv:set_stack("armor", i, stack)
end
armor.def[name] = {
state = 0,
count = 0,
level = 0,
heal = 0,
jump = 1,
speed = 1,
gravity = 1,
fire = 0,
water = 0,
radiation = 0,
}
armor.textures[name] = {
skin = armor.default_skin..".png",
armor = "3d_armor_trans.png",
wielditem = "3d_armor_trans.png",
preview = armor.default_skin.."_preview.png",
}
if skin_mod == "skins" then
local skin = skins.skins[name]
if skin and skins.get_type(skin) == skins.type.MODEL then
armor.textures[name].skin = skin..".png"
end
time = 0
elseif skin_mod == "simple_skins" then
local skin = skins.skins[name]
if skin then
armor.textures[name].skin = skin..".png"
end
elseif skin_mod == "u_skins" then
local skin = u_skins.u_skins[name]
if skin and u_skins.get_type(skin) == u_skins.type.MODEL then
armor.textures[name].skin = skin..".png"
end
elseif skin_mod == "wardrobe" then
local skin = wardrobe.playerSkins[name]
if skin then
armor.textures[name].skin = skin
end
end
if minetest.get_modpath("player_textures") then
local filename = minetest.get_modpath("player_textures").."/textures/player_"..name
local f = io.open(filename..".png")
if f then
f:close()
armor.textures[name].skin = "player_"..name..".png"
end
end
for i=1, ARMOR_INIT_TIMES do
minetest.after(ARMOR_INIT_DELAY * i, function(player)
armor:set_player_armor(player)
if not inv_mod then
armor:update_inventory(player)
end
end, player)
end
end)
--[[
if ARMOR_DROP == true or ARMOR_DESTROY == true then
armor.drop_armor = function(pos, stack)
local obj = minetest.add_item(pos, stack)
if obj then
obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)})
end
end
minetest.register_on_dieplayer(function(player)
local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[on_dieplayer]")
if not name then
return
end
local drop = {}
for i=1, player_inv:get_size("armor") do
local stack = armor_inv:get_stack("armor", i)
-- Modification for MFF
if stack:get_count() > 0 and (not pclasses.data.reserved_items[armor_inv:get_stack("armor", i):get_name()] or
not pclasses.api.util.can_have_item(name, armor_inv:get_stack("armor", i):get_name())) then
table.insert(drop, stack)
armor_inv:set_stack("armor", i, nil)
player_inv:set_stack("armor", i, nil)
end
end
armor:set_player_armor(player)
if inv_mod == "unified_inventory" then
unified_inventory.set_inventory_formspec(player, "craft")
elseif inv_mod == "inventory_plus" then
local formspec = inventory_plus.get_formspec(player,"main")
inventory_plus.set_inventory_formspec(player, formspec)
else
armor:update_inventory(player)
end
if ARMOR_DESTROY == false then
minetest.after(ARMOR_BONES_DELAY, function()
local node = minetest.get_node(vector.round(pos))
-- Modification for MFF
if node and node.name == "bones:bones" then
local meta = minetest.get_meta(vector.round(pos))
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
for _,stack in ipairs(drop) do
if name == owner and inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
armor.drop_armor(pos, stack)
end
end
else
for _,stack in ipairs(drop) do
armor.drop_armor(pos, stack)
end
end
end)
end
end)
end
--]]
minetest.register_on_player_hpchange(function(player, hp_change)
local name, player_inv, armor_inv = armor:get_valid_player(player, "[on_hpchange]")
if name and hp_change < 0 then
-- used for insta kill tools/commands like /kill (doesnt damage armor)
if hp_change < -100 then
return hp_change
end
local heal_max = 0
local state = 0
local items = 0
for i=1, 6 do
local stack = player_inv:get_stack("armor", i)
if stack:get_count() > 0 then
local use = stack:get_definition().groups["armor_use"] or 0
local heal = stack:get_definition().groups["armor_heal"] or 0
local item = stack:get_name()
stack:add_wear(use)
armor_inv:set_stack("armor", i, stack)
player_inv:set_stack("armor", i, stack)
state = state + stack:get_wear()
items = items + 1
if stack:get_count() == 0 then
local desc = minetest.registered_items[item].description
if desc then
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
end
armor:set_player_armor(player)
armor:update_inventory(player)
end
heal_max = heal_max + heal
end
end
armor.def[name].state = state
armor.def[name].count = items
heal_max = heal_max * ARMOR_HEAL_MULTIPLIER
if heal_max > math.random(100) then
hp_change = 0
end
armor:update_armor(player)
end
return hp_change
end, true)
-- Fire Protection and water breating, added by TenPlus1
if ARMOR_FIRE_PROTECT == true then
-- override hot nodes so they do not hurt player anywhere but mod
for _, row in pairs(ARMOR_FIRE_NODES) do
if minetest.registered_nodes[row[1]] then
minetest.override_item(row[1], {damage_per_second = 0})
end
end
else
minetest.log("info", "[3d_armor] Fire Nodes disabled")
end
function armor_step()
for _,player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local pos = player:getpos()
local hp = player:get_hp()
-- water breathing
if name and armor.def[name].water > 0 then
if player:get_breath() < 10 then
player:set_breath(10)
end
end
-- fire protection
if ARMOR_FIRE_PROTECT == true
and name and pos and hp then
pos.y = pos.y + 1.4 -- head level
local node_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- feet level
local node_feet = minetest.get_node(pos).name
-- is player inside a hot node?
for _, row in pairs(ARMOR_FIRE_NODES) do
-- check fire protection, if not enough then get hurt
if row[1] == node_head or row[1] == node_feet then
if hp > 0 and armor.def[name].fire < row[2] then
hp = hp - row[3] * ARMOR_UPDATE_TIME
player:set_hp(hp)
break
end
end
end
end
end
minetest.after(ARMOR_UPDATE_TIME, armor_step)
end
-- Launch once started
minetest.after(0, armor_step)
-- kill player when command issued
minetest.register_chatcommand("kill", {
params = "<name>",
description = "Kills player instantly",
func = function(name, param)
local player = minetest.get_player_by_name(name)
if player then
player:set_hp(-1001)
end
end,
})

View File

@ -12,9 +12,13 @@ Helmets:
+---+---+---+
[3d_armor:helmet_wood] X = [default:wood]
[3d_armor:helmet_cactus] X = [default:cactus]
[3d_armor:helmet_steel] X = [default:steel_ingot]
[3d_armor:helmet_bronze] X = [default:bronze_ingot]
[3d_armor:helmet_diamond] X = [default:diamond]
[3d_armor:helmet_gold] X = [default:gold_ingot]
[3d_armor:helmet_mithril] X = [default:mithril_ingot]
[3d_armor:helmet_crystal] X = [ethereal:crystal_ingot] *
Chestplates:
@ -27,9 +31,13 @@ Chestplates:
+---+---+---+
[3d_armor:chestplate_wood] X = [default:wood]
[3d_armor:chestplate_cactus] X = [default:cactus]
[3d_armor:chestplate_steel] X = [default:steel_ingot]
[3d_armor:chestplate_bronze] X = [default:bronze_ingot]
[3d_armor:chestplate_diamond] X = [default:diamond]
[3d_armor:chestplate_gold] X = [default:gold_ingot]
[3d_armor:chestplate_mithril] X = [default:mithril_ingot]
[3d_armor:chestplate_crystal] X = [ethereal:crystal_ingot] *
Leggings:
@ -42,9 +50,13 @@ Leggings:
+---+---+---+
[3d_armor:leggings_wood] X = [default:wood]
[3d_armor:leggings_cactus] X = [default:cactus]
[3d_armor:leggings_steel] X = [default:steel_ingot]
[3d_armor:leggings_bronze] X = [default:bronze_ingot]
[3d_armor:leggings_diamond] X = [default:diamond]
[3d_armor:leggings_gold] X = [default:gold_ingot]
[3d_armor:leggings_mithril] X = [default:mithril_ingot]
[3d_armor:leggings_crystal] X = [ethereal:crystal_ingot] *
Boots:
@ -55,7 +67,12 @@ Boots:
+---+---+---+
[3d_armor:boots_wood] X = [default:wood]
[3d_armor:boots_cactus] X = [default:cactus]
[3d_armor:boots_steel] X = [default:steel_ingot]
[3d_armor:boots_bronze] X = [default:bronze_ingot
[3d_armor:boots_diamond] X = [default:diamond]
[3d_armor:boots_gold] X = [default:gold_ingot]
[3d_armor:boots_mithril] X = [default:mithril_ingot]
[3d_armor:boots_crystal] X = [ethereal:crystal_ingot] *
* Requires ethereal mod by Chinchow & TenPlus1 - https://github.com/tenplus1/ethereal

View File

@ -1,3 +1,7 @@
default
inventory_plus
unified_skins
player_physics
inventory_plus?
unified_inventory?
fire?
ethereal?
bakedclay?

1
3d_armor/description.txt Normal file
View File

@ -0,0 +1 @@
Adds craftable armor that is visible to other players.

View File

@ -1,137 +1,224 @@
dofile(minetest.get_modpath(minetest.get_current_modname()).."/armor.lua")
ARMOR_MOD_NAME = minetest.get_current_modname()
dofile(minetest.get_modpath(ARMOR_MOD_NAME).."/armor.lua")
dofile(minetest.get_modpath(ARMOR_MOD_NAME).."/admin.lua")
-- Regisiter Head Armor
if ARMOR_MATERIALS.wood then
minetest.register_tool("3d_armor:helmet_wood", {
description = "Wood Helmet",
inventory_image = "3d_armor_inv_helmet_wood.png",
groups = {armor_head=1, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_wood", {
description = "Wood Chestplate",
inventory_image = "3d_armor_inv_chestplate_wood.png",
groups = {armor_torso=3, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_wood", {
description = "Wood Leggings",
inventory_image = "3d_armor_inv_leggings_wood.png",
groups = {armor_legs=3, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:boots_wood", {
description = "Wood Boots",
inventory_image = "3d_armor_inv_boots_wood.png",
groups = {armor_feet=1, armor_heal=0, armor_use=2000},
wear = 0,
})
end
minetest.register_tool("3d_armor:helmet_wood", {
description = "Wood Helmet",
inventory_image = "3d_armor_inv_helmet_wood.png",
groups = {armor_head=5, armor_heal=0, armor_use=2000},
wear = 0,
})
if ARMOR_MATERIALS.cactus then
minetest.register_tool("3d_armor:helmet_cactus", {
description = "Cactus Helmet",
inventory_image = "3d_armor_inv_helmet_cactus.png",
groups = {armor_head=3, armor_heal=0, armor_use=1000},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_cactus", {
description = "Cactus Chestplate",
inventory_image = "3d_armor_inv_chestplate_cactus.png",
groups = {armor_torso=5, armor_heal=0, armor_use=1000},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_cactus", {
description = "Cactus Leggings",
inventory_image = "3d_armor_inv_leggings_cactus.png",
groups = {armor_legs=5, armor_heal=0, armor_use=1000},
wear = 0,
})
minetest.register_tool("3d_armor:boots_cactus", {
description = "Cactus Boots",
inventory_image = "3d_armor_inv_boots_cactus.png",
groups = {armor_feet=3, armor_heal=0, armor_use=1000},
wear = 0,
})
end
minetest.register_tool("3d_armor:helmet_steel", {
description = "Steel Helmet",
inventory_image = "3d_armor_inv_helmet_steel.png",
groups = {armor_head=10, armor_heal=0, armor_use=500},
wear = 0,
})
if ARMOR_MATERIALS.steel then
minetest.register_tool("3d_armor:helmet_steel", {
description = "Steel Helmet",
inventory_image = "3d_armor_inv_helmet_steel.png",
groups = {armor_head=4, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_steel", {
description = "Steel Chestplate",
inventory_image = "3d_armor_inv_chestplate_steel.png",
groups = {armor_torso=8, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_steel", {
description = "Steel Leggings",
inventory_image = "3d_armor_inv_leggings_steel.png",
groups = {armor_legs=8, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:boots_steel", {
description = "Steel Boots",
inventory_image = "3d_armor_inv_boots_steel.png",
groups = {armor_feet=4, armor_heal=0, armor_use=500},
wear = 0,
})
end
minetest.register_tool("3d_armor:helmet_bronze", {
description = "Bronze Helmet",
inventory_image = "3d_armor_inv_helmet_bronze.png",
groups = {armor_head=10, armor_heal=6, armor_use=250},
wear = 0,
})
if ARMOR_MATERIALS.bronze then
minetest.register_tool("3d_armor:helmet_bronze", {
description = "Bronze Helmet",
inventory_image = "3d_armor_inv_helmet_bronze.png",
groups = {armor_head=5, armor_heal=0, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_bronze", {
description = "Bronze Chestplate",
inventory_image = "3d_armor_inv_chestplate_bronze.png",
groups = {armor_torso=9, armor_heal=0, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_bronze", {
description = "Bronze Leggings",
inventory_image = "3d_armor_inv_leggings_bronze.png",
groups = {armor_legs=9, armor_heal=0, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:boots_bronze", {
description = "Bronze Boots",
inventory_image = "3d_armor_inv_boots_bronze.png",
groups = {armor_feet=5, armor_heal=0, armor_use=250},
wear = 0,
})
end
minetest.register_tool("3d_armor:helmet_diamond", {
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_helmet_diamond.png",
groups = {armor_head=15, armor_heal=12, armor_use=100},
wear = 0,
})
if ARMOR_MATERIALS.diamond then
minetest.register_tool("3d_armor:helmet_diamond", {
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_helmet_diamond.png",
groups = {armor_head=7, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_diamond", {
description = "Diamond Chestplate",
inventory_image = "3d_armor_inv_chestplate_diamond.png",
groups = {armor_torso=13, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_diamond", {
description = "Diamond Leggings",
inventory_image = "3d_armor_inv_leggings_diamond.png",
groups = {armor_legs=13, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:boots_diamond", {
description = "Diamond Boots",
inventory_image = "3d_armor_inv_boots_diamond.png",
groups = {armor_feet=7, armor_heal=0, armor_use=100},
wear = 0,
})
end
if ARMOR_MATERIALS.gold then
minetest.register_tool("3d_armor:helmet_gold", {
description = "Gold Helmet",
inventory_image = "3d_armor_inv_helmet_gold.png",
groups = {armor_head=5, armor_heal=0, armor_use=200},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_gold", {
description = "Gold Chestplate",
inventory_image = "3d_armor_inv_chestplate_gold.png",
groups = {armor_torso=11, armor_heal=0, armor_use=200},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_gold", {
description = "Gold Leggings",
inventory_image = "3d_armor_inv_leggings_gold.png",
groups = {armor_legs=11, armor_heal=0, armor_use=200},
wear = 0,
})
minetest.register_tool("3d_armor:boots_gold", {
description = "Gold Boots",
inventory_image = "3d_armor_inv_boots_gold.png",
groups = {armor_feet=5, armor_heal=0, armor_use=200},
wear = 0,
})
end
-- Regisiter Torso Armor
if ARMOR_MATERIALS.mithril then
minetest.register_tool("3d_armor:helmet_mithril", {
description = "Mithril Helmet (Warrior)",
inventory_image = "3d_armor_inv_helmet_mithril.png",
groups = {armor_head=9, armor_heal=0, armor_use=50},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_mithril", {
description = "Mithril Chestplate (Warrior)",
inventory_image = "3d_armor_inv_chestplate_mithril.png",
groups = {armor_torso=15, armor_heal=0, armor_use=50},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_mithril", {
description = "Mithril Leggings (Warrior)",
inventory_image = "3d_armor_inv_leggings_mithril.png",
groups = {armor_legs=15, armor_heal=0, armor_use=50},
wear = 0,
})
minetest.register_tool("3d_armor:boots_mithril", {
description = "Mithril Boots (Warrior)",
inventory_image = "3d_armor_inv_boots_mithril.png",
groups = {armor_feet=9, armor_heal=0, armor_use=50},
wear = 0,
})
end
minetest.register_tool("3d_armor:chestplate_wood", {
description = "Wood Chestplate",
inventory_image = "3d_armor_inv_chestplate_wood.png",
groups = {armor_torso=10, armor_heal=0, armor_use=2000},
wear = 0,
})
if ARMOR_MATERIALS.crystal then
minetest.register_tool("3d_armor:helmet_crystal", {
description = "Crystal Helmet",
inventory_image = "3d_armor_inv_helmet_crystal.png",
groups = {armor_head=15, armor_heal=0, armor_use=50, armor_fire=1},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_crystal", {
description = "Crystal Chestplate",
inventory_image = "3d_armor_inv_chestplate_crystal.png",
groups = {armor_torso=20, armor_heal=0, armor_use=50, armor_fire=1},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_crystal", {
description = "Crystal Leggings",
inventory_image = "3d_armor_inv_leggings_crystal.png",
groups = {armor_legs=20, armor_heal=0, armor_use=50, armor_fire=1},
wear = 0,
})
minetest.register_tool("3d_armor:boots_crystal", {
description = "Crystal Boots",
inventory_image = "3d_armor_inv_boots_crystal.png",
groups = {armor_feet=15, armor_heal=0, armor_use=50, physics_speed=1, physics_jump=0.5, armor_fire=1},
wear = 0,
})
end
minetest.register_tool("3d_armor:chestplate_steel", {
description = "Steel Chestplate",
inventory_image = "3d_armor_inv_chestplate_steel.png",
groups = {armor_torso=15, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_bronze", {
description = "Bronze Chestplate",
inventory_image = "3d_armor_inv_chestplate_bronze.png",
groups = {armor_torso=15, armor_heal=6, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_diamond", {
description = "Diamond Chestplate",
inventory_image = "3d_armor_inv_chestplate_diamond.png",
groups = {armor_torso=20, armor_heal=12, armor_use=100},
wear = 0,
})
-- Regisiter Leg Armor
minetest.register_tool("3d_armor:leggings_wood", {
description = "Wood Leggings",
inventory_image = "3d_armor_inv_leggings_wood.png",
groups = {armor_legs=5, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_steel", {
description = "Steel Leggings",
inventory_image = "3d_armor_inv_leggings_steel.png",
groups = {armor_legs=15, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_bronze", {
description = "Bronze Leggings",
inventory_image = "3d_armor_inv_leggings_bronze.png",
groups = {armor_legs=15, armor_heal=6, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_diamond", {
description = "Diamond Leggings",
inventory_image = "3d_armor_inv_leggings_diamond.png",
groups = {armor_legs=20, armor_heal=12, armor_use=100},
wear = 0,
})
-- Regisiter Boots
minetest.register_tool("3d_armor:boots_wood", {
description = "Wood Boots",
inventory_image = "3d_armor_inv_boots_wood.png",
groups = {armor_feet=5, armor_heal=0, armor_use=2000},
wear = 0,
})
minetest.register_tool("3d_armor:boots_steel", {
description = "Steel Boots",
inventory_image = "3d_armor_inv_boots_steel.png",
groups = {armor_feet=10, armor_heal=0, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:boots_bronze", {
description = "Bronze Boots",
inventory_image = "3d_armor_inv_boots_bronze.png",
groups = {armor_feet=10, armor_heal=6, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:boots_diamond", {
description = "Diamond Boots",
inventory_image = "3d_armor_inv_boots_diamond.png",
groups = {armor_feet=15, armor_heal=12, armor_use=100},
wear = 0,
})
-- Register Craft Recipies
local craft_ingreds = {
wood = "default:wood",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
diamond = "default:diamond",
}
for k, v in pairs(craft_ingreds) do
for k, v in pairs(ARMOR_MATERIALS) do
minetest.register_craft({
output = "3d_armor:helmet_"..k,
recipe = {
@ -165,4 +252,3 @@ for k, v in pairs(craft_ingreds) do
})
end

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 878 B

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Some files were not shown because too many files have changed in this diff Show More