From 4cc1ddcd185509080b4b3e15d1646567edd51c9d Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 15 Jun 2026 02:57:35 -0400 Subject: removed game speed for being broken and an antifeature anyway. added color support. --- internal/game/cmd_drop.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'internal/game/cmd_drop.go') diff --git a/internal/game/cmd_drop.go b/internal/game/cmd_drop.go index dc506f0..2bf00ce 100644 --- a/internal/game/cmd_drop.go +++ b/internal/game/cmd_drop.go @@ -4,6 +4,7 @@ import ( "fmt" "strings" + "thirdcollapse/internal/color" "thirdcollapse/internal/net" "thirdcollapse/internal/player" ) @@ -90,6 +91,7 @@ func (g *Game) doDropAllNamed(sess *net.Session, input string) { func (g *Game) doDrop(sess *net.Session, input string) { p := sess.Player.(*player.Player) g.CancelAction(p) + mode := g.colorMode(sess) qty, itemName := parseQty(input) @@ -149,9 +151,9 @@ func (g *Game) doDrop(sess *net.Session, input string) { g.World.AddGroundItem(p.RoomID, itemID, qty) g.AccountStore.SaveCharacter(p) if qty == 1 { - sess.WriteLine(fmt.Sprintf("You drop a %s.", name)) + sess.WriteLine(fmt.Sprintf("You drop a %s.", color.Wrap(mode, "green", name))) } else { - sess.WriteLine(fmt.Sprintf("You drop %d x %s.", qty, name)) + sess.WriteLine(fmt.Sprintf("You drop %d x %s.", qty, color.Wrap(mode, "green", name))) } return } @@ -190,15 +192,15 @@ func (g *Game) handleDropAllConfirm(sess *net.Session, input string) { p, ok := sess.Player.(*player.Player) if !ok { sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } - g.CancelAction(p) + g.CancelAction(p) input = strings.TrimSpace(strings.ToLower(input)) if input != "y" && input != "yes" { sess.State = net.StateGame - sess.Write("\r\n> ") + g.writePrompt(sess) return } @@ -227,5 +229,5 @@ func (g *Game) handleDropAllConfirm(sess *net.Session, input string) { sess.Write(fmt.Sprintf("\nYou drop your ")) formatPickupList(sess, dropped) } - sess.Write("\r\n> ") + g.writePrompt(sess) } -- cgit v1.2.3