diff options
| author | historia <[not public]> | 2026-07-01 03:21:52 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 03:21:52 -0400 |
| commit | fbe5090ac3325ff8ea6989cdf4515c7f077c975b (patch) | |
| tree | 1811ad9c6a596e7177bb2c42944c389c0a120066 /internal/game/act_use_interaction.go | |
| parent | 5f37dc9b6f6b79da04da70ae0c33ec8d02998587 (diff) | |
| download | thehouseoficarus-fbe5090ac3325ff8ea6989cdf4515c7f077c975b.tar.gz | |
feat: item messaging standardized, custom messages for production paths implemented
Diffstat (limited to 'internal/game/act_use_interaction.go')
| -rw-r--r-- | internal/game/act_use_interaction.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/game/act_use_interaction.go b/internal/game/act_use_interaction.go new file mode 100644 index 0000000..b96aaa3 --- /dev/null +++ b/internal/game/act_use_interaction.go @@ -0,0 +1,23 @@ +package game + +import ( + "thehouseoficarus/internal/behavior" + "thehouseoficarus/internal/net" + "thehouseoficarus/internal/player" +) + +func (g *Game) advanceUseInteraction(sess *net.Session, p *player.Player) { + d, ok := p.Action.Data.(*behavior.UseInteractionData) + if !ok { + g.cancelAction(p) + return + } + if d.Message != "" { + sess.WriteLine(d.Message) + } + if d.Action != nil { + g.applyNodeAction(sess, d.Action) + } + g.broadcastAction(sess, "%s uses the %s.", p.Name, d.ObjName) + g.cancelAction(p) +} |
