package combat // Attack type identifiers shared across combat, mobs, weapons, hazards and // validation. These are the canonical string values stored in YAML. const ( AttackStab = "stab" AttackSlash = "slash" AttackCrush = "crush" AttackRanged = "ranged" AttackScience = "science" // DefaultAttackType is the fallback when no attack type is specified. DefaultAttackType = AttackCrush ) // MeleeAttackTypes lists the melee attack types (exactly one of which a mob // must have). var MeleeAttackTypes = []string{AttackStab, AttackSlash, AttackCrush} // AllAttackTypes lists every valid attack type. var AllAttackTypes = []string{AttackStab, AttackSlash, AttackCrush, AttackRanged, AttackScience} // IsMeleeType reports whether t is a melee attack type. func IsMeleeType(t string) bool { return t == AttackStab || t == AttackSlash || t == AttackCrush } // IsValidAttackType reports whether t is any recognized attack type. func IsValidAttackType(t string) bool { switch t { case AttackStab, AttackSlash, AttackCrush, AttackRanged, AttackScience: return true default: return false } }