diff options
| author | historia <[not public]> | 2026-06-16 01:59:27 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-16 01:59:27 -0400 |
| commit | 43f21aabae8924f35c12c8485e690aeefe0089fb (patch) | |
| tree | b5fbadb89df3cf4ffec86503bb8e2d7e52b27454 /internal/game/cmd_drop.go | |
| parent | 4cc1ddcd185509080b4b3e15d1646567edd51c9d (diff) | |
| download | thehouseoficarus-43f21aabae8924f35c12c8485e690aeefe0089fb.tar.gz | |
feat: overhauled ansi color, added prompt options
Diffstat (limited to 'internal/game/cmd_drop.go')
| -rw-r--r-- | internal/game/cmd_drop.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/internal/game/cmd_drop.go b/internal/game/cmd_drop.go index 2bf00ce..b08eadf 100644 --- a/internal/game/cmd_drop.go +++ b/internal/game/cmd_drop.go @@ -4,7 +4,6 @@ import ( "fmt" "strings" - "thirdcollapse/internal/color" "thirdcollapse/internal/net" "thirdcollapse/internal/player" ) @@ -54,6 +53,7 @@ func (g *Game) doDropAllNamed(sess *net.Session, input string) { if def != nil { name = def.Name } + coloredName := g.itemColorize(sess, def, name) p.ActionState = &ActionState{Type: ActionDropping, TargetName: name} if def != nil && def.Stackable { @@ -63,9 +63,9 @@ func (g *Game) doDropAllNamed(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.", coloredName)) } else { - sess.WriteLine(fmt.Sprintf("You drop %d x %s.", qty, name)) + sess.WriteLine(fmt.Sprintf("You drop %d x %s.", qty, coloredName)) } return } @@ -82,16 +82,15 @@ func (g *Game) doDropAllNamed(sess *net.Session, input string) { } g.AccountStore.SaveCharacter(p) if total == 1 { - sess.WriteLine(fmt.Sprintf("You drop a %s.", name)) + sess.WriteLine(fmt.Sprintf("You drop a %s.", coloredName)) } else { - sess.WriteLine(fmt.Sprintf("You drop %d x %s.", total, name)) + sess.WriteLine(fmt.Sprintf("You drop %d x %s.", total, coloredName)) } } 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) @@ -151,9 +150,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.", color.Wrap(mode, "green", name))) + sess.WriteLine(fmt.Sprintf("You drop a %s.", g.itemColorize(sess, def, name))) } else { - sess.WriteLine(fmt.Sprintf("You drop %d x %s.", qty, color.Wrap(mode, "green", name))) + sess.WriteLine(fmt.Sprintf("You drop %d x %s.", qty, g.itemColorize(sess, def, name))) } return } |
