-
Notifications
You must be signed in to change notification settings - Fork 12
Buff
Buffs are persistent effects that stay on a character.
Buffs go into BuffList.cs. You extend the Buff class. Not specifying a duration will make your buff have infinite duration.
For buffs, you have many choices over what methods to override. Most of the method names should be self-explanatory. A poison effect would require you to override OnEndOfTurnHelper() and return a list with a AddToModStat effect.
if IsReact() is overridden and returns true, React() will be called. Keep in mind that any spell cast in a battle can be reacted to, meaning that if A attacks B, C's buff may activate if it does not check the target of the spell.
To check if a spell is targeting the character with the buff, do a == with the spell's caster's stats and the buff's afflicted Character's stats.
To modify a spell, Spell.Result.Effects allows one to modify, or even completely clear the Spell. One can add a effect that causes the caster to get damaged as well from their attack, or find a particular SpellEffect (with type checking) and modify it (with a cast.)
An enemy could spawn with the buff on them initially. A spell or item could inflict it. A weapon could inflict it on its wearer.