Class TimbnPotionBuff
The buff a potion applies, and what it does.
public sealed class TimbnPotionBuff
- Inheritance
-
TimbnPotionBuff
- Inherited Members
Properties
ApplyChange
Makes a C# change the save would keep, such as a vendor's money. Core runs it when the buff starts, and RevertChange takes it back just before every save and this puts it back right after, so the save never holds the change and removing the mod mid buff leaves nothing behind. Both run on every save, so keep them to setting state, with no sounds, toasts or drops.
public Action? ApplyChange { get; set; }
Property Value
Description
The buff's description in its tooltip.
public string Description { get; set; }
Property Value
DurationSeconds
How long the buff lasts in real seconds, read each time the potion is drunk so it can follow a setting. 60 by default.
public Func<float> DurationSeconds { get; set; }
Property Value
EndExpressions
The game's script expressions, run once by the game when the buff ends, such as taking back what StartExpressions gave. If the mod is removed while the buff lasts, Core ends the buff the next time the save loads and runs these then.
public List<string> EndExpressions { get; set; }
Property Value
GlowColor
One of the game's buff colors, used for the start burst and the HUD frame. Read each time the potion is drunk so it can follow a setting.
public Func<string> GlowColor { get; set; }
Property Value
IconId
Buff icon sprite name. Any sprite the game has, or one added with the plugin's Sprites.AddPng.
public string IconId { get; set; }
Property Value
Name
The buff's name in the HUD and its tooltip, such as Swift.
public string Name { get; set; }
Property Value
OnEnd
Runs when the buff ends, the player leaves the game, or the potion is unregistered.
public Action? OnEnd { get; set; }
Property Value
OnStart
Runs when the buff starts, and again when a save loads with it active. Use it for effects the save doesn't keep, like walk speed, and ApplyChange for C# changes the save would keep.
public Action? OnStart { get; set; }
Property Value
RevertChange
Takes back what ApplyChange changed. Runs when the buff ends and just before every save.
public Action? RevertChange { get; set; }
Property Value
StartExpressions
The game's script expressions, run once by the game when the buff starts, such as DropItem("stick", 5). Use these for changes the save keeps, like items or unlocks. Each is checked when the potion is registered, and a potion with one that doesn't work is skipped with a warning.
public List<string> StartExpressions { get; set; }
Property Value
WhileActive
Runs every frame while the buff lasts.
public Action? WhileActive { get; set; }