aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_eat.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_eat.go')
-rw-r--r--internal/game/cmd_eat.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/game/cmd_eat.go b/internal/game/cmd_eat.go
index 6a74979..e6a0386 100644
--- a/internal/game/cmd_eat.go
+++ b/internal/game/cmd_eat.go
@@ -111,6 +111,22 @@ func (g *Game) processConsumeQueue(p *player.Player, sess *net.Session) bool {
itemID := qc.Args
def, err := g.ItemStore.Load(itemID)
+
+ if qc.Command == "drink" {
+ if err != nil || (def.PotionEffect == "" && def.HealValue <= 0) {
+ return false
+ }
+ if p.ConsumeCooldown > 0 {
+ return false
+ }
+ if !p.HasItem(itemID) {
+ sess.WriteLine("You no longer have that to drink.")
+ return false
+ }
+ g.applyPotion(sess, p, itemID, def)
+ return true
+ }
+
if err != nil || def.EatMessage == "" {
return false
}