aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_use.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-09 19:29:17 -0400
committerhistoria <[not public]>2026-07-09 19:29:17 -0400
commitb3d4c616f59ad2519f3a0b77e3b47d6571cd2486 (patch)
tree6f1f6a314e0550da68264a79381fc269db803312 /internal/game/cmd_use.go
parent18c7af94b30c2767b6633d050324c1db34074ce2 (diff)
downloadthehouseoficarus-b3d4c616f59ad2519f3a0b77e3b47d6571cd2486.tar.gz
feat: message actions are now sequences of messages with settable delays
Diffstat (limited to 'internal/game/cmd_use.go')
-rw-r--r--internal/game/cmd_use.go27
1 files changed, 6 insertions, 21 deletions
diff --git a/internal/game/cmd_use.go b/internal/game/cmd_use.go
index 322e5fc..a2cb135 100644
--- a/internal/game/cmd_use.go
+++ b/internal/game/cmd_use.go
@@ -4,7 +4,6 @@ import (
"fmt"
"strings"
- "thehouseoficarus/internal/behavior"
"thehouseoficarus/internal/item"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
@@ -99,16 +98,9 @@ func (g *Game) useRoomObject(sess *net.Session, p *player.Player, input string)
continue
}
g.cancelAction(p)
- p.Action = &behavior.Action{
- Type: behavior.TypeUseInteraction,
- TargetName: def.Name,
- WaitLeft: 1,
- Data: &behavior.UseInteractionData{
- Message: ui.Message,
- Action: ui.Action,
- ObjName: def.Name,
- },
- }
+ name := def.Name
+ g.broadcastAction(sess, "%s uses the %s.", p.Name, name)
+ g.runInteraction(sess, p, ui.Action, p.RoomID, scopePlayer, nil)
return true
}
if len(def.OnUse) > 0 {
@@ -292,16 +284,9 @@ func (g *Game) doUseItemOnTarget(sess *net.Session, p *player.Player, itemAName,
continue
}
g.cancelAction(p)
- p.Action = &behavior.Action{
- Type: behavior.TypeUseInteraction,
- TargetName: def.Name,
- WaitLeft: 1,
- Data: &behavior.UseInteractionData{
- Message: ui.Message,
- Action: ui.Action,
- ObjName: def.Name,
- },
- }
+ name := def.Name
+ g.broadcastAction(sess, "%s uses the %s.", p.Name, name)
+ g.runInteraction(sess, p, ui.Action, p.RoomID, scopePlayer, nil)
return
}