aboutsummaryrefslogtreecommitdiff
path: root/internal/combat/types.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-01 22:30:31 -0400
committerhistoria <[not public]>2026-07-01 22:30:31 -0400
commitc14c2e403c75a913e1a6d962fb6fe64f013adae5 (patch)
tree75070293fe2535b594ac72e501cbf08a3f1146e0 /internal/combat/types.go
parent8eec7b75ff9c8c368b252373db45fb891732d2ca (diff)
downloadthehouseoficarus-c14c2e403c75a913e1a6d962fb6fe64f013adae5.tar.gz
fix: combat formulas and mob attack types (mobs switch attack styles if safespotting)
Diffstat (limited to 'internal/combat/types.go')
-rw-r--r--internal/combat/types.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/combat/types.go b/internal/combat/types.go
new file mode 100644
index 0000000..bb2a897
--- /dev/null
+++ b/internal/combat/types.go
@@ -0,0 +1,36 @@
+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
+ }
+}