aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_use.go
diff options
context:
space:
mode:
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
}