From 6f3d21d6e7f01155ce0c461857a053b43d329392 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 27 Jun 2026 02:29:55 -0400 Subject: feat: recall/home cmd, line break option --- internal/game/cmd_trigger.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'internal/game/cmd_trigger.go') diff --git a/internal/game/cmd_trigger.go b/internal/game/cmd_trigger.go index 34e438a..f74efec 100644 --- a/internal/game/cmd_trigger.go +++ b/internal/game/cmd_trigger.go @@ -4,6 +4,7 @@ import ( "fmt" "strings" + "thehouseoficarus/internal/behavior" "thehouseoficarus/internal/net" "thehouseoficarus/internal/player" ) @@ -37,6 +38,24 @@ func (g *Game) doTrigger(sess *net.Session, input string) { return } + if mod.Category == ModTransport { + room, err := g.World.LoadRoom(p.RoomID) + if err == nil && room.BlockTransport { + sess.WriteLine("You can't imagine transport would pick you up here") + return + } + } + + if mod.ID == "transport_home" && p.HomeTransportCooldown > 0 { + sess.WriteLine(fmt.Sprintf("The transport service won't shuttle you that frequently! Wait %d ticks!", p.HomeTransportCooldown)) + return + } + + if len(mod.Sequence) > 0 { + g.startTriggerModule(sess, p, mod) + return + } + switch mod.Category { case ModCombat: g.triggerCombatMod(sess, p, mod, targetArg) @@ -65,6 +84,9 @@ func (g *Game) parseTriggerArgs(input string, sciLevel int) (*ModDef, string) { func (g *Game) triggerCombatMod(sess *net.Session, p *player.Player, mod *ModDef, targetArg string) { if cs := g.Combat.Get(p.Name); cs != nil { + if p.Action != nil && p.Action.Type == behavior.TypeTriggerModule { + g.cancelAction(p) + } p.QueuedTrigger = mod.ID sess.WriteLine(fmt.Sprintf("You queue %s for your next attack.", mod.Name)) return -- cgit v1.2.3