diff options
Diffstat (limited to 'internal/game/cmd_get.go')
| -rw-r--r-- | internal/game/cmd_get.go | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/internal/game/cmd_get.go b/internal/game/cmd_get.go index 9591657..e75c59e 100644 --- a/internal/game/cmd_get.go +++ b/internal/game/cmd_get.go @@ -3,7 +3,6 @@ package game import ( "fmt" - "thirdcollapse/internal/color" "thirdcollapse/internal/net" "thirdcollapse/internal/player" ) @@ -11,7 +10,6 @@ import ( func (g *Game) doGet(sess *net.Session, input string) { p := sess.Player.(*player.Player) g.CancelAction(p) - mode := g.colorMode(sess) ground := g.World.GroundItems(p.RoomID) if len(ground) == 0 { sess.WriteLine("There's nothing on the ground to pick up.") @@ -87,7 +85,7 @@ func (g *Game) doGet(sess *net.Session, input string) { } slot.Quantity += qty g.AccountStore.SaveCharacter(p) - sess.WriteLine(fmt.Sprintf("You pick up %d x %s. (now %d)", qty, color.Wrap(mode, "green", def.Name), slot.Quantity)) + sess.WriteLine(fmt.Sprintf("You pick up %d x %s. (now %d)", qty, g.itemColorize(sess, def, def.Name), slot.Quantity)) return } } @@ -103,9 +101,9 @@ func (g *Game) doGet(sess *net.Session, input string) { p.SetInvSlot(freeSlot, g.newInventorySlot(itemID, qty)) g.AccountStore.SaveCharacter(p) if qty == 1 { - sess.WriteLine(fmt.Sprintf("You pick up a %s.", color.Wrap(mode, "green", def.Name))) - } else { - sess.WriteLine(fmt.Sprintf("You pick up %d x %s.", qty, color.Wrap(mode, "green", def.Name))) + sess.WriteLine(fmt.Sprintf("You pick up a %s.", g.itemColorize(sess, def, def.Name))) + } else { + sess.WriteLine(fmt.Sprintf("You pick up %d x %s.", qty, g.itemColorize(sess, def, def.Name))) } return } @@ -202,6 +200,7 @@ func (g *Game) doGetAllNamed(sess *net.Session, input string) { if def != nil { name = def.Name } + coloredName := g.itemColorize(sess, def, name) if def != nil && def.Stackable { for i := 0; i < 28; i++ { @@ -214,7 +213,7 @@ func (g *Game) doGetAllNamed(sess *net.Session, input string) { } slot.Quantity += removed g.AccountStore.SaveCharacter(p) - sess.WriteLine(fmt.Sprintf("You pick up %d x %s. (now %d)", removed, name, slot.Quantity)) + sess.WriteLine(fmt.Sprintf("You pick up %d x %s. (now %d)", removed, coloredName, slot.Quantity)) return } } @@ -231,9 +230,9 @@ func (g *Game) doGetAllNamed(sess *net.Session, input string) { p.SetInvSlot(freeSlot, &player.InventorySlot{ItemID: itemID, Quantity: removed}) g.AccountStore.SaveCharacter(p) if removed == 1 { - sess.WriteLine(fmt.Sprintf("You pick up a %s.", name)) + sess.WriteLine(fmt.Sprintf("You pick up a %s.", coloredName)) } else { - sess.WriteLine(fmt.Sprintf("You pick up %d x %s.", removed, name)) + sess.WriteLine(fmt.Sprintf("You pick up %d x %s.", removed, coloredName)) } return } @@ -256,12 +255,12 @@ func (g *Game) doGetAllNamed(sess *net.Session, input string) { if picked == 0 { sess.WriteLine("Your inventory is full.") } else if picked == 1 { - sess.WriteLine(fmt.Sprintf("You pick up a %s.", name)) + sess.WriteLine(fmt.Sprintf("You pick up a %s.", coloredName)) } else { - sess.WriteLine(fmt.Sprintf("You pick up %d x %s.", picked, name)) + sess.WriteLine(fmt.Sprintf("You pick up %d x %s.", picked, coloredName)) } if picked < available { - sess.WriteLine(fmt.Sprintf("You're only able to take %d x %s!", picked, name)) + sess.WriteLine(fmt.Sprintf("You're only able to take %d x %s!", picked, coloredName)) } } |
