Scripting / Inventory
Effect
Serializable data class embedded in Item assets — not a separate ScriptableObject. Describes a single stat modification applied when the item is used via Instruction_Use. Add effects in the Item Inspector under the Effects list.
| Property | Type | Description |
|---|---|---|
displayName | string | Short label shown in the HUD when this effect is active. |
description | string | Detailed description shown in tooltips. |
icon | Sprite | Icon shown in the active effects HUD. |
targetStat | Stat | The Stat this effect modifies. |
value | int | Amount added to the stat. Negative values reduce it. |
duration | int | Number of turns the effect lasts. 0 means the modification is instant and permanent for the current run. |
applyPerTurn | bool | When true, applies value once per turn for the duration instead of once upfront. Use for regeneration or damage-over-time. Ignored when duration is 0. |
Add an Effect to an Item
Effects are not standalone assets — they are embedded directly inside an Item.
- Select an Item asset in the Project window.
- In the Inspector click + in the Effects list to add a new entry.
- Fill in
displayName,description, andicon— these appear in the active-effects HUD while the effect is running. - Assign a Stat asset to
targetStat. - Set
value(positive to increase the stat, negative to reduce it). - Leave
durationat0for an instant modification that lasts the rest of the run. Set a positive integer to create a timed effect that expires after that many turns. - Enable
applyPerTurnif the effect should applyvalueonce per turn (e.g. regeneration or damage-over-time) rather than once upfront. Ignored whendurationis0.