Go to file
raymoo c7988a3dae fix example 2016-08-05 13:53:33 -07:00
COPYING change to LGPL 2016-02-10 20:23:13 -08:00
LICENSE.3d_armor 3d_armor license 2016-02-10 20:22:41 -08:00
README.md fix example 2016-08-05 13:53:33 -07:00
depends.txt Use player_monoids 2016-08-05 13:48:35 -07:00
description.txt Use player_monoids 2016-08-05 13:48:35 -07:00
init.lua fix example 2016-08-05 13:53:33 -07:00
mod.conf Everything 2016-02-10 20:09:46 -08:00

README.md

#The Armor Monoid

This mod provides a player_monoids monoid for handling armor groups. It provides a monoid for damage resistance, and a way to register new damage types for players. It is also compatible with 3d_armor.

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

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:

armor_monoid.register_armor_group("arcane", 100)

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 100 (no protection).