[Mod] Armor Monoid [armor_monoid]

Post Reply
Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

[Mod] Armor Monoid [armor_monoid]

by Byakuren » Post

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

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:

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).
Last edited by Byakuren on Sun Mar 12, 2017 23:20, edited 9 times in total.
Every time a mod API is left undocumented, a koala dies.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Armor Monoid [armor_monoid]

by Byakuren » Post

Alert: I have changed this mod to use player_monoids rather than monoidal_effects, which is deprecated. The dependencies have changed accordingly.
Every time a mod API is left undocumented, a koala dies.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Armor Monoid [armor_monoid]

by Byakuren » Post

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.
Every time a mod API is left undocumented, a koala dies.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 19 guests