Skip to content
Andrew Xue edited this page Sep 9, 2017 · 6 revisions

Overview

Buffs are persistent effects that stay on a character.

Making your own Buff

Buffs go into BuffList.cs. You extend the Buff class. Not specifying a duration will make your buff have infinite duration.

Basic methods

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.

Reacting to spells cast in battle

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.)

How can I get my buff in game?

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.

Clone this wiki locally