Add equip_wear mod v0.1...
ContentDB: https://content.minetest.net/packages/AntumDeluge/equip_wear/ Release: https://github.com/AntumMT/mod-equip_wear/releases/tag/v0.1
This commit is contained in:
parent
f8dc6df748
commit
cd88b76256
@ -36,6 +36,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
* equipment/
|
||||
* [3d_armor_gloves][] ([LGPL][lic.lgpl2.1]) -- version: [f099d76 Git][ver.3d_armor_gloves] *2021-02-27*
|
||||
* [airtanks][] ([MIT][lic.airtanks]) -- version: [b686694 Git][ver.airtanks] *2021-03-13* ([patched][patch.airtanks])
|
||||
* [equip_wear][] ([MIT][lic.equip_wear]) -- version: [0.1][ver.equip_wear] *2021-07-14*
|
||||
* [slingshot][] ([MIT][lic.slingshot] / [CC0][lic.cc0]) -- version [0.3][ver.slingshot] *2021-06-10*
|
||||
* [throwing][] ([WTFPL][lic.wtfpl]) -- version: [90bcf43 Git][ver.throwing] *2013-09-27* ([patched][patch.throwing])
|
||||
* [xtraarmor][] ([CC BY-SA][lic.ccbysa3.0]) -- version: 0.3
|
||||
@ -335,6 +336,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
[elevator]: https://forum.minetest.net/viewtopic.php?t=12944
|
||||
[enchanting]: https://forum.minetest.net/viewtopic.php?t=7354
|
||||
[equip_exam]: https://forum.minetest.net/viewtopic.php?t=26618
|
||||
[equip_wear]: https://content.minetest.net/packages/AntumDeluge/equip_wear/
|
||||
[ethereal]: https://forum.minetest.net/viewtopic.php?t=14638
|
||||
[farlands]: https://forum.minetest.net/viewtopic.php?t=16921
|
||||
[farming]: https://forum.minetest.net/viewtopic.php?t=9019
|
||||
@ -460,6 +462,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
[lic.elevator]: mods/buildings/elevator/readme.txt
|
||||
[lic.enchanting]: mods/enchanting/LICENSE
|
||||
[lic.equip_exam]: mods/tools/equip_exam/LICENSE.txt
|
||||
[lic.equip_wear]: mods/equipment/equip_wear/LICENSE.txt
|
||||
[lic.ethereal]: mods/world/ethereal/license.txt
|
||||
[lic.farming]: mods/horticulture/farming/license.txt
|
||||
[lic.formspecs]: mods/libs/formspecs/README.txt
|
||||
@ -592,6 +595,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
||||
[ver.dungeon_master]: https://github.com/AntumMT/mod-mob_dungeon_master/tree/00c890f
|
||||
[ver.enchanting]: https://github.com/AntumMT/mod-enchanting/tree/dee7dde
|
||||
[ver.equip_exam]: https://github.com/AntumMT/mod-equip_exam/releases/tag/v1.5
|
||||
[ver.equip_wear]: https://github.com/AntumMT/mod-equip_wear/releases/tag/v0.1
|
||||
[ver.ethereal]: https://notabug.org/TenPlus1/ethereal/src/90cdf94ea6c54cd5e3fcc7f77d3b6121f963c379
|
||||
[ver.farming]: https://notabug.org/TenPlus1/farming/commit/dedc33cc46ec65782a5b8ab573d1fb6bb6915b63
|
||||
[ver.folks]: https://gitlab.com/SonoMichele/folks/tags/v0.2.0
|
||||
|
21
mods/equipment/equip_wear/LICENSE.txt
Normal file
21
mods/equipment/equip_wear/LICENSE.txt
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright © 2021 Jordan Irwin (AntumDeluge)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
44
mods/equipment/equip_wear/README.md
Normal file
44
mods/equipment/equip_wear/README.md
Normal file
@ -0,0 +1,44 @@
|
||||
## Equipment Wear
|
||||
|
||||
### Description:
|
||||
|
||||
A [Minetest](https://www.minetest.net/) mod that allows tool & equipment wear to be disabled. Supports tools (pick, axe, shovel, etc.), weapons, & armor.
|
||||
|
||||
Armor mods supported:
|
||||
- [![3d_armor](https://img.shields.io/static/v1?label=ContentDB&message=3d_armor&color=%23375a7f&logo=minetest)](https://content.minetest.net/packages/stu/3d_armor/)
|
||||
|
||||
![icon](screenshot.png)
|
||||
|
||||
### Licensing:
|
||||
|
||||
- Code: [MIT](LICENSE.txt)
|
||||
- Icon: [CC0](https://openclipart.org/detail/169233)
|
||||
|
||||
### Usage:
|
||||
|
||||
#### Settings:
|
||||
|
||||
```
|
||||
tool_wear
|
||||
- Enables/Disables wear for tools such as picks, axes, shovels, etc.
|
||||
- type: bool
|
||||
- default: true
|
||||
|
||||
weapon_wear
|
||||
- Enables/Disables wear for weapons.
|
||||
- type: bool
|
||||
- default: true
|
||||
|
||||
armor_wear
|
||||
- Enables/Disables wear for armor.
|
||||
- type: bool
|
||||
- default: true
|
||||
```
|
||||
|
||||
### Links:
|
||||
|
||||
- [![ContentDB](https://img.shields.io/static/v1?label=ContentDB&message=equip_wear&color=%23375a7f&logo=minetest)](https://content.minetest.net/packages/AntumDeluge/equip_wear/)
|
||||
- [Forum](https://forum.minetest.net/viewtopic.php?t=27019)
|
||||
- [Git repo](https://github.com/AntumMT/mod-equip_wear)
|
||||
- [Changelog](changelog.txt)
|
||||
- [TODO](TODO.txt)
|
2
mods/equipment/equip_wear/TODO.txt
Normal file
2
mods/equipment/equip_wear/TODO.txt
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
TODO:
|
7
mods/equipment/equip_wear/changelog.txt
Normal file
7
mods/equipment/equip_wear/changelog.txt
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
v0.1
|
||||
----
|
||||
- initial release
|
||||
- added disable tool wear
|
||||
- added disable weapon wear
|
||||
- added disable armor wear
|
89
mods/equipment/equip_wear/init.lua
Normal file
89
mods/equipment/equip_wear/init.lua
Normal file
@ -0,0 +1,89 @@
|
||||
|
||||
local tool_wear = core.settings:get_bool("tool_wear", true)
|
||||
local weapon_wear = core.settings:get_bool("weapon_wear", true)
|
||||
local armor_wear = core.settings:get_bool("armor_wear", true)
|
||||
|
||||
core.register_on_mods_loaded(function()
|
||||
-- hook into ItemStack meta table method
|
||||
if not weapon_wear then
|
||||
local mt = getmetatable(ItemStack(""))
|
||||
local add_wear_old = mt.add_wear
|
||||
mt.add_wear = function(self, ...)
|
||||
local r_item = core.registered_items[self:get_name()]
|
||||
if r_item and r_item.subtype == "weapon" then
|
||||
return true
|
||||
end
|
||||
|
||||
return add_wear_old(self, ...)
|
||||
end
|
||||
end
|
||||
|
||||
-- hook into 3d_armor API
|
||||
--[[ doesn't seem to be necessary if "armor_use" set to "0" or "nil"
|
||||
if not armor_wear and core.global_exists("armor") then
|
||||
local armor_damage_old, armor_punch_old = armor.damage, armor.punch
|
||||
|
||||
armor.damage = function(self, player, index, stack, use)
|
||||
return armor_damage_old(self, player, index, stack, 0)
|
||||
end
|
||||
|
||||
armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabilities)
|
||||
return armor_punch_old(self, player, hitter, time_from_last_punch, tool_capabilities)
|
||||
end
|
||||
end
|
||||
]]
|
||||
|
||||
-- override items
|
||||
for tname, tdef in pairs(core.registered_tools) do
|
||||
local new_def = table.copy(tdef)
|
||||
local override = false
|
||||
|
||||
if new_def.tool_capabilities then
|
||||
if new_def.tool_capabilities.punch_attack_uses then
|
||||
new_def.subtype = "weapon"
|
||||
override = true
|
||||
end
|
||||
|
||||
if not weapon_wear then
|
||||
new_def.tool_capabilities.punch_attack_uses = nil
|
||||
override = true
|
||||
end
|
||||
|
||||
if new_def.tool_capabilities.groupcaps then
|
||||
for k, v in pairs(new_def.tool_capabilities.groupcaps) do
|
||||
-- FIXME: should "fleshy" only be modified for weapon wear?
|
||||
if not tool_wear then
|
||||
new_def.tool_capabilities.groupcaps[k].uses = 0
|
||||
override = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[ NOTE: anything useful here?
|
||||
for t, tc in pairs(new_def.tool_capabilities) do
|
||||
end
|
||||
]]
|
||||
|
||||
--[[ NOTE: should we check for "fleshy" here to set "weapon" sub-type?
|
||||
if new_def.tool_capabilities.damage_groups then
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
if new_def.groups then
|
||||
if new_def.groups.armor_use then
|
||||
new_def.subtype = "armor"
|
||||
override = true
|
||||
|
||||
if not armor_wear then
|
||||
new_def.groups.armor_use = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if override then
|
||||
core.unregister_item(tname)
|
||||
core.register_tool(":" .. tname, new_def)
|
||||
end
|
||||
end
|
||||
end)
|
7
mods/equipment/equip_wear/mod.conf
Normal file
7
mods/equipment/equip_wear/mod.conf
Normal file
@ -0,0 +1,7 @@
|
||||
name = equip_wear
|
||||
title = Equipment Wear
|
||||
description = Enable or disable equipment wear.
|
||||
author = Jordan Irwin (AntumDeluge)
|
||||
license = MIT
|
||||
version = 0.1
|
||||
min_minetest_version = 0.4.16
|
BIN
mods/equipment/equip_wear/screenshot.png
Normal file
BIN
mods/equipment/equip_wear/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
10
mods/equipment/equip_wear/settingtypes.txt
Normal file
10
mods/equipment/equip_wear/settingtypes.txt
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Enables/Disables wear for tools such as picks, axes,
|
||||
# shovels, etc.
|
||||
tool_wear (Enable tool wear) bool true
|
||||
|
||||
# Enables/Disables wear for weapons.
|
||||
weapon_wear (Enable weapon wear) bool true
|
||||
|
||||
# Enables/Disables wear for armor.
|
||||
armor_wear (Enable armor wear) bool true
|
@ -1710,6 +1710,19 @@ ethereal.tundra (Tundra biome, 1 = Enable / 0 = Disable) int 1
|
||||
ethereal.mediterranean (Mediterranean biome, 1 = Enable / 0 = Disable) int 1
|
||||
|
||||
|
||||
[*equip_wear]
|
||||
|
||||
# Enables/Disables wear for tools such as picks, axes,
|
||||
# shovels, etc.
|
||||
tool_wear (Enable tool wear) bool true
|
||||
|
||||
# Enables/Disables wear for weapons.
|
||||
weapon_wear (Enable weapon wear) bool true
|
||||
|
||||
# Enables/Disables wear for armor.
|
||||
armor_wear (Enable armor wear) bool true
|
||||
|
||||
|
||||
[*hbarmor]
|
||||
|
||||
#If true, automatically hides the armor HUD bar when the player wears no
|
||||
|
Loading…
x
Reference in New Issue
Block a user