aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_trigger.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-19 21:20:32 -0400
committerhistoria <[not public]>2026-06-19 21:20:32 -0400
commit5ea082ab4e82409aebc889b496f43e52b003d4f7 (patch)
tree942f2c4a18ecbee42ba25726048d09827ea68894 /internal/game/cmd_trigger.go
parent8ee8982b8759bcae116647cc993867f4c8b0a6ce (diff)
downloadthehouseoficarus-5ea082ab4e82409aebc889b496f43e52b003d4f7.tar.gz
feat: science combat/triggers overhauled. decks now use autotrigger attacks.
Diffstat (limited to 'internal/game/cmd_trigger.go')
-rw-r--r--internal/game/cmd_trigger.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/internal/game/cmd_trigger.go b/internal/game/cmd_trigger.go
index 7d637ca..0acbeff 100644
--- a/internal/game/cmd_trigger.go
+++ b/internal/game/cmd_trigger.go
@@ -22,7 +22,7 @@ func (g *Game) doTrigger(sess *net.Session, input string) {
return
}
- mod, targetArg := g.parseTriggerArgs(input)
+ mod, targetArg := g.parseTriggerArgs(input, p.Level(player.Science))
if mod == nil {
sess.WriteLine("Unknown mod. Type 'mods' to see available mods.")
return
@@ -50,12 +50,12 @@ func (g *Game) doTrigger(sess *net.Session, input string) {
}
}
-func (g *Game) parseTriggerArgs(input string) (*ModDef, string) {
+func (g *Game) parseTriggerArgs(input string, sciLevel int) (*ModDef, string) {
lower := strings.ToLower(input)
words := strings.Fields(lower)
for i := len(words); i > 0; i-- {
candidate := strings.Join(words[:i], " ")
- mod := FindMod(candidate)
+ mod := FindModForPlayer(candidate, sciLevel)
if mod != nil {
target := strings.TrimSpace(strings.Join(words[i:], " "))
return mod, target
@@ -66,8 +66,8 @@ func (g *Game) parseTriggerArgs(input string) (*ModDef, string) {
func (g *Game) triggerCombatMod(sess *net.Session, p *player.Player, mod *ModDef, targetArg string) {
if cs := combat.GetCombat(p.Name); cs != nil {
- p.AutotriggerMod = mod.ID
- sess.WriteLine(fmt.Sprintf("You switch to triggering %s.", mod.Name))
+ p.QueuedTrigger = mod.ID
+ sess.WriteLine(fmt.Sprintf("You queue %s for your next attack.", mod.Name))
return
}
@@ -106,6 +106,10 @@ func (g *Game) triggerCombatMod(sess *net.Session, p *player.Player, mod *ModDef
return
}
- p.AutotriggerMod = mod.ID
+ if g.hasDeckEquipped(p) {
+ p.AutotriggerMod = mod.ID
+ } else {
+ p.QueuedTrigger = mod.ID
+ }
g.startCombat(sess, p, mob)
}