text.push(`<p><b>${service.name}</b></p>`);
text.push(`<p>"${getText('intro', service, city)}"</p>`);
+
if(api.player.hp === maxHp(api.player.constitution, api.player.level)) {
text.push(`<p>You're already at full health?</p>`);
}
else {
- text.push(`<p><button type="button" class="city-emit-event" data-event="city:services:healer:heal" data-args="${service.id}">Heal for ${healCost}g!</button></p>`);
+ if(api.player.level <= 3) {
+ text.push(`<p>Since you still seem to be new around here, this one's on the house!</p>`);
+ text.push(`<p><button type="button" class="city-emit-event" data-event="city:services:healer:heal" data-args="${service.id}">Heal for free!</button></p>`);
+ }
+ else {
+ text.push(`<p><button type="button" class="city-emit-event" data-event="city:services:healer:heal" data-args="${service.id}">Heal for ${healCost}g!</button></p>`);
+ }
}
-
api.socket.emit('city:service:healer', {
text: text.join("\n")
});
text.push(`<p><b>${service.name}</b></p>`);
- if(api.player.gold < healCost) {
+ const cost = api.player.level <= 3 ? 0 : healCost;
+
+ if(api.player.gold < cost) {
text.push(`<p>${getText('insufficient_money', service, city)}</p>`)
api.socket.emit('city:service:healer', {
text: text.join("\n")
}
api.player.hp = maxHp(api.player.constitution, api.player.level);
- api.player.gold -= healCost;
+ api.player.gold -= cost;
await updatePlayer(api.player);
api.socket.emit('updatePlayer', api.player);