Add get_values

This commit is contained in:
raymoo 2016-02-02 16:26:15 -08:00
parent 6bb120c07d
commit c34b7fac18
2 changed files with 9 additions and 2 deletions

View File

@ -118,5 +118,8 @@ Gets the remaining time of an effect, in seconds, or "perm".
monoidal_effects.get_player_effects("player_name") monoidal_effects.get_player_effects("player_name")
Gets a set of effects applied to the given player Gets a set of effects applied to the given player
monoidal_effects.get_values(uid)
Returns the value table associated with an effect, if it exists
monoidal_effects.get_monoid_value("monoid_name", "player_name") monoidal_effects.get_monoid_value("monoid_name", "player_name")
Gets the current combined value for a monoid and player. Gets the current combined value for a monoid and player.

View File

@ -556,12 +556,16 @@ monoidal_effects.get_remaining_time = function(uid)
end end
monoidal_effects.get_player_effects = function(p_name) monoidal_effects.get_player_effects = function(p_name)
return effects:with_index("player", p_name) return effects:with_index("player", p_name)
end end
monoidal_effects.get_monoid_value = get_monoid_value monoidal_effects.get_values = function(uid)
local eff = effects:get(uid)
return eff.values
end
monoidal_effects.get_monoid_value = get_monoid_value
local function apply_effects(player) local function apply_effects(player)
local p_name = player:get_player_name() local p_name = player:get_player_name()