diff options
| author | historia <[not public]> | 2026-06-26 02:52:31 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-26 02:52:31 -0400 |
| commit | 3102525d97aa6f1ad152c74b2ccfbd4b3a9b83f5 (patch) | |
| tree | 65610fa4fb8abe1dc7a46d00658e85e0525d397c /internal/game/act_room.go | |
| parent | e2d5b081f27141bb3dd89dbe595860b8a1345d55 (diff) | |
| download | thehouseoficarus-3102525d97aa6f1ad152c74b2ccfbd4b3a9b83f5.tar.gz | |
feat: simplified conversation trees and output won't overwrite prompts now
Diffstat (limited to 'internal/game/act_room.go')
| -rw-r--r-- | internal/game/act_room.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/internal/game/act_room.go b/internal/game/act_room.go index ff7a780..ddca261 100644 --- a/internal/game/act_room.go +++ b/internal/game/act_room.go @@ -18,7 +18,6 @@ type enterSeq struct { roomID int steps []world.EnterStep wait int - started bool } // runEnterSteps evaluates a room's on_enter script for the player. Steps whose @@ -144,18 +143,13 @@ func (g *Game) fireEnterStep(seq *enterSeq, step world.EnterStep) { if step.Message != "" { msg := expandTemplate(step.Message, p.Name, nil) msg = color.ExpandTagsDefault(mode, seqSpec, msg) - if !seq.started { - seq.sess.WriteLine("\n" + msg) - seq.started = true - } else { - seq.sess.WriteLine(msg) - } + seq.sess.WriteLine(msg) } if step.Broadcast != "" && g.Hub != nil { msg := expandTemplate(step.Broadcast, p.Name, nil) msg = color.ExpandTagsDefault(mode, broadcastSpec, msg) for _, other := range g.Hub.PlayersInRoom(seq.roomID) { - other.WriteLine(g.colorize(other, "broadcast", "\n"+msg)) + other.WriteLine(g.colorize(other, "broadcast", msg)) } } if step.BroadcastGlobal != "" && g.Hub != nil { @@ -163,7 +157,7 @@ func (g *Game) fireEnterStep(seq *enterSeq, step world.EnterStep) { msg = color.ExpandTagsDefault(mode, broadcastSpec, msg) for _, other := range g.Hub.AllSessions() { if other.Player != nil { - other.WriteLine(g.colorize(other, "broadcast", "\n"+msg)) + other.WriteLine(g.colorize(other, "broadcast", msg)) } } } @@ -264,7 +258,7 @@ func (g *Game) BroadcastRespawns() { msg := strings.ReplaceAll(cfg.RespawnBroadcast, "{name}", name) if g.Hub != nil { for _, sess := range g.Hub.PlayersInRoom(st.RoomID) { - sess.WriteLine(g.colorize(sess, "broadcast", fmt.Sprintf("\n%s", msg))) + sess.WriteLine(g.colorize(sess, "broadcast", msg)) } } } |
