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/cmd_drop.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/cmd_drop.go')
| -rw-r--r-- | internal/game/cmd_drop.go | 14 |
1 files changed, 8 insertions, 6 deletions
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) } |
