The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

Player Status Effects API
 This topic has been pinned, so it's probably important
pedroff_1  [developer] 11 May, 2020 @ 7:49pm
Mod Documentation: Custom Functions list
Here is a list of all the functions currently added by the API, alongside with what inputs they take, what values they return and, in general, how you can use them to make the best use of the API!
Notation:
FunctionName (arg1,arg2,arg3)
-- function and its argumetns
description of what the function does, whether (type of variable)arg1,(type of variable)arg2 and (type of variable)arg3 are optional, their default value if arg1 == nil and if they return (type of variable)anything.



_StatusAPI.CheckPlayerEffectList (player)
A function that takes (EntityPlayer) player and makes sure all required tables on player:GetData() are set up properly. Returns true unless the entity was not a player, in which case, it returns false.
_StatusAPI.CheckPlayerEffectIconList (player)
Does a similar job to _StatusAPI.CheckPlayerEffectList() , but sets up the arrays for the icons in (EntityPlayer) player:GetData().
_StatusAPI.CheckPlayerEffectPriorityList (player)
Similarly to _StatusAPI.CheckPlayerEffectList(), takes (EntityPlayer) player and sets up its priority list table on ]player:GetData(). Is already called by _StatusAPI.GiveEffect()
_StatusAPI.GetEffectPriority (player,effect)
A function that takes (EntityPlayer) player and (string) effect and returns an integer (from 1 to infinity) corresponding to the current place on the "priority list" for that effect. returns nil if effect is not being applied.
_StatusAPI.AddEffectToPriorityList (player,effect)
Includes (string) effect to the priority list of (EntityPlayer) player, at its end. It is already called when using _StatusAPI.GiveEffect()
_StatusAPI.RemoveEffectFromPriorityList (player,effect)
Removes (string) effect from (EntityPlayer) player 's priority list. Already called by _StatusAPI.RemoveEffect()
_StatusAPI.UpdateEffectPriorityList (player)
Removes any nil value from the priority list of (EntityPlayer)player


_StatusAPI.GiveEffect (player,effect,amount,params(cumulative,addmaxcharge,setintensity,intesitymixing) )
Applies (string)effect to (EntityPlayer)player for (float)amount. If amount == nil, then 150 will be the default. (table)params accepts the following arguments as named variables inside it: (boolean)cumulative indicates if amount should be added to any pre-existing value of said effect (if cumulative == true), or if the highest of both values should remain (cumulative == false). (boolean) addmaxcharge defines if the value should be added to the previous max charge or the highest of which should be the new one (basically, it's cumulative, but for charge). (float)setintensity Determines if you want to specify the "intensity" attribute of the effect, and has the default value of 1. (boolean)intensitymixing, if false or nil, makes the effect not be applied if its intensity value is lower than the effect's current intensity.
_StatusAPI.RemoveEffect (player,effect,amount)
Removes (float)amount of time from (string)effect on (EntityPlayer)player. If amount == nil, removes the effect entirely from the player. If remaining time would be negative, also removes effect from player
_StatusAPI.SetEffect (player,effect,amount)
Sets (string)effect 's time to (float)amount, on (EntityPlayer)player. If amount <= 0, then it removes the effect entirely.
_StatusAPI.HasEffect(player,effect)
Returns true if (EntityPlayer)player has (string)effect, with a timer higher than 0. Returns false otherwise
_StatusAPI.GetEffectTimer(player,effect)
returns (float) "time"/"timer" value for (string)effect on (EntityPlayer)player


_StatusAPI.SetEffectCharge (player,effect,amount)
Sets the "Charge" value to a given (string)effect to (float)amount, on a (EntityPlayer)player. Returns true if player provided is indeed an EntityPlayer. Effect Charges are used to determine the chargebar values.
_StatusAPI.GiveEffectCharge (player,effect,amount,cumulative)
If (boolean)cumulative == true, it adds (float)amount to (EntityPlayer)player's (string)effect charge. Otherwise, choses the highest value between the current and amount. Effect Charges are used to determine the maximum value for filling the chargebar.



_StatusAPI.GetNumEffects(player)
Returns (integer) number of effects the player has at the current moment. Useful for tracking overlays and such
_StatusAPI.IsEffectActive(effect)
returns true if any player has (string)effect. Useful for when an effect should apply to the entire game, or determine something globally.
Last edited by pedroff_1; 11 Jun, 2020 @ 9:34pm