Download: https://github.com/minetest-mods/armor_ ... .3.0.0.zip (Compatible with 3d_armor 0.4.8 or later)
License: LGPL
Depends: player_monoids
Old Versions:
0.1.0.1 (Works with and depends on monoidal_effects)
0.2.0.0 (Compatible with 3d_armor 0.4.7, might work with earlier versions)
This provides a player_monoids monoid for handling armor groups, and also allows registering new player damage types. For example, you might want to add ice damage and handle it with different armor ratings.
Using the monoid
The values in the monoid are tables mapping armor group names to damage multipliers. For example, if I wanted to apply an effect granting arcane damage resistance but fleshy damage vulnerability, I could do
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local tab = {
arcane = 0.5,
fleshy = 1.5,
}
armor_monoid.monoid:add_change(player, tab, "mymod:arcane_boost")
Registering damage types
To add a new damage type to players, use armor_monoid.register_armor_group. For example:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
armor_monoid.register_armor_group("arcane", 150)
As you can see, the argument is not a multiplier, but the base armor group rating. Calling this would mean players start off with an armor rating in "arcane" of 150 (extra vulnerability).