diff options
| author | historia <[not public]> | 2026-06-15 02:57:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-15 02:58:50 -0400 |
| commit | 4cc1ddcd185509080b4b3e15d1646567edd51c9d (patch) | |
| tree | 2a564846ad4fd159a2d7e55451bfa9569fe8c0b8 /internal/game/action_talk.go | |
| parent | 445c4612cc5cf2c226f85894b6ad1e2419a374e2 (diff) | |
| download | thehouseoficarus-4cc1ddcd185509080b4b3e15d1646567edd51c9d.tar.gz | |
removed game speed for being broken and an antifeature anyway. added color support.
Diffstat (limited to 'internal/game/action_talk.go')
| -rw-r--r-- | internal/game/action_talk.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/game/action_talk.go b/internal/game/action_talk.go index 8aa95be..4102841 100644 --- a/internal/game/action_talk.go +++ b/internal/game/action_talk.go @@ -54,7 +54,7 @@ func (g *Game) startTalk(sess *net.Session, p *player.Player, obj *object.Object } func (g *Game) showTalkNode(sess *net.Session, node action.TalkNode) { - sess.WriteLine(fmt.Sprintf("\n%s", node.Message)) + sess.WriteLine(fmt.Sprintf("\n%s", g.colorTag(sess, node.Message))) if node.Action != nil { g.applyNodeAction(sess, node.Action) @@ -62,7 +62,7 @@ func (g *Game) showTalkNode(sess *net.Session, node action.TalkNode) { if len(node.Options) == 0 { sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -82,7 +82,7 @@ func (g *Game) handleTalkInput(sess *net.Session, input string) { p, ok := sess.Player.(*player.Player) if !ok || p.Action == nil || p.Action.Type != "talk" { sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -91,7 +91,7 @@ func (g *Game) handleTalkInput(sess *net.Session, input string) { if lower == "bye" || lower == "exit" || lower == "end" || lower == "quit" { g.CancelAction(p) sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -100,7 +100,7 @@ func (g *Game) handleTalkInput(sess *net.Session, input string) { if err != nil { g.CancelAction(p) sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -109,7 +109,7 @@ func (g *Game) handleTalkInput(sess *net.Session, input string) { if !ok { g.CancelAction(p) sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -117,7 +117,7 @@ func (g *Game) handleTalkInput(sess *net.Session, input string) { if err != nil || idx <= 0 { g.CancelAction(p) sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -138,14 +138,14 @@ func (g *Game) handleTalkInput(sess *net.Session, input string) { if chosen == nil { g.CancelAction(p) sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } if chosen.End { g.CancelAction(p) sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -159,7 +159,7 @@ func (g *Game) handleTalkInput(sess *net.Session, input string) { g.CancelAction(p) sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) } func (g *Game) applyNodeAction(sess *net.Session, na *action.NodeAction) { |
