package object import ( "strings" "thehouseoficarus/internal/world" ) type EquipSlot string const ( SlotHead EquipSlot = "head" SlotNeck EquipSlot = "neck" SlotTorso EquipSlot = "torso" SlotLegs EquipSlot = "legs" SlotHands EquipSlot = "hands" SlotFeet EquipSlot = "feet" SlotBack EquipSlot = "back" SlotAmmo EquipSlot = "ammo" SlotMainHand EquipSlot = "main_hand" SlotOffHand EquipSlot = "off_hand" SlotRing EquipSlot = "ring" ) type WeaponType string const ( WeaponMelee WeaponType = "melee" WeaponRanged WeaponType = "ranged" WeaponScience WeaponType = "science" ) type ItemDef struct { ID string `yaml:"id"` Name string `yaml:"name"` Color string `yaml:"color"` Description string `yaml:"description"` Value int `yaml:"value"` Stackable bool `yaml:"stackable"` EquipSlot EquipSlot `yaml:"equip_slot"` WeaponType WeaponType `yaml:"weapon_type"` Stats ItemStats `yaml:"stats"` Speed float64 `yaml:"speed"` ToolType string `yaml:"tool_type"` ToolSpeed float64 `yaml:"tool_speed"` BurnTicks float64 `yaml:"burn_ticks"` FireLevel int `yaml:"fire_level"` FireXP int `yaml:"fire_xp"` Quality int `yaml:"quality"` MaxQuality int `yaml:"max_quality"` SearchTable string `yaml:"search_table"` SearchMiscTable string `yaml:"search_misc_table"` SearchTicks float64 `yaml:"search_ticks"` SearchMessage string `yaml:"search_message"` HealValue int `yaml:"heal_value"` EatMessage string `yaml:"eat_message"` MadeFrom []MadeFromEntry `yaml:"made_from,omitempty"` } type MadeFromEntry struct { Items []string `yaml:"items"` Qty int `yaml:"qty"` } type ItemStats struct { AttackBonus int `yaml:"attack_bonus"` StrengthBonus int `yaml:"strength_bonus"` DefenseBonus int `yaml:"defense_bonus"` ScienceBonus int `yaml:"science_bonus"` TechnologyBonus int `yaml:"technology_bonus"` } func (d *ItemDef) MatchesName(input string) bool { lower := strings.ToLower(strings.TrimSpace(input)) if lower == "" { return false } if strings.ToLower(d.Name) == lower { return true } return world.WordPrefixMatch(lower, d.Name) }