Files
agame/scripts/inventory/item.gd
T
2026-09-12 22:18:23 +08:00

28 lines
626 B
GDScript

class_name Item
extends Resource
enum ItemType { WEAPON, CONSUMABLE, TOOL, MISC, HAT, BACKPACK }
enum ItemRarity { COMMON, UNCOMMON, RARE, EPIC, LEGENDARY }
enum ContextOptions {
DROP,
EQUIP,
UNEQUIP,
}
@export var id: String = ""
@export var name: String = ""
@export var description: String = ""
@export var icon: Texture2D
@export var stackable: bool = true
@export var max_stack: int = 99
@export var item_type: ItemType = ItemType.MISC
@export var rarity: ItemRarity = ItemRarity.COMMON
@export var value: int = 0
@export var context_options: Array[Item.ContextOptions] = []
@export var scene_path: String = ""