class_name ItemDef extends Resource ## Data-only description of an item, in the same spirit as [EnemyDef]: adding an ## item is a table entry in [Items], never a branch in the simulation. ## ## Items are deliberately thin. A slot holds an id and nothing else -- no ## charges, no durability, no stack count -- because everything the game ## currently needs is expressible as "one id per slot", and the wire format, ## the persistence record and the UI all get simpler for it. When something ## needs a count, add it here rather than teaching four layers about it. enum Effect { ## Consumed and does nothing. Not a placeholder: the boss ration exists to ## prove the player-instanced loot path works end to end, and it can only ## do that if using it is a real, observable transaction. NONE, ## Restores [member effect_value] percent of MAXIMUM health, so a potion ## keeps its value at level 15 instead of becoming a rounding error. HEAL, } @export var id: StringName = &"item" @export var display_name: String = "Item" @export var effect: Effect = Effect.NONE @export var effect_value: float = 0.0 ## Index into the renderer's item icon table. Same idea as [member ## EnemyDef.visual]: the simulation never learns that art exists. @export var visual: int = 0 ## HUD tint. View-only, kept here so one table describes the whole item. @export var tint := Color(0.85, 0.85, 0.9)