aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_trigger.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_trigger.go')
-rw-r--r--internal/game/cmd_trigger.go22
1 files changed, 22 insertions, 0 deletions
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