Page 1 of 1

[Mod] Armor Monoid [armor_monoid]

PostPosted: Thu Feb 11, 2016 04:27
by Byakuren
Github: https://github.com/minetest-mods/armor_monoid
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).

Re: [Mod] Armor Monoid [armor_monoid]

PostPosted: Fri Aug 05, 2016 20:52
by Byakuren
Alert: I have changed this mod to use player_monoids rather than monoidal_effects, which is deprecated. The dependencies have changed accordingly.

Re: [Mod] Armor Monoid [armor_monoid]

PostPosted: Fri Mar 10, 2017 20:11
by Byakuren
I've released a new version, 0.3.0.0. This release does not include any new features, but no longer overrides 3d_armor's armor-giving function, since armor_monoid compatibility is planned for 3d_armor itself.

EDIT: armor_monoid and player_monoids support was merged into 3d_armor.