|
|
|
|
@ -613,11 +613,8 @@ func (h *NPCHandler) HealHero(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
h.addLog(hero.ID, "Healed to full HP by a town healer")
|
|
|
|
|
writeJSON(w, http.StatusOK, map[string]any{
|
|
|
|
|
"hero": hero,
|
|
|
|
|
"healed": true,
|
|
|
|
|
"message": "You have been healed to full HP.",
|
|
|
|
|
})
|
|
|
|
|
// Flat hero JSON — matches other /hero/* mutating endpoints (use-potion, quest claim) for the TS client.
|
|
|
|
|
writeJSON(w, http.StatusOK, hero)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BuyPotion handles POST /api/v1/hero/npc-buy-potion.
|
|
|
|
|
@ -666,8 +663,5 @@ func (h *NPCHandler) BuyPotion(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
h.addLog(hero.ID, "Purchased a Healing Potion from a merchant")
|
|
|
|
|
writeJSON(w, http.StatusOK, map[string]any{
|
|
|
|
|
"hero": hero,
|
|
|
|
|
"message": fmt.Sprintf("You purchased a Healing Potion for %d gold.", potionCost),
|
|
|
|
|
})
|
|
|
|
|
writeJSON(w, http.StatusOK, hero)
|
|
|
|
|
}
|
|
|
|
|
|