text.push(`<p>You're already at full health?</p>`);
}
else {
- if(api.player.level <= 3) {
- text.push(`<p>Since you still seem to be new around here, this one's on the house!</p>`);
+ if(api.player.gold <= (healCost * 2)) {
+ text.push(`<p>You don't seem to have too much money... I guess I can do it for free this time...</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>`);
- const cost = api.player.level <= 3 ? 0 : healCost;
+ const cost = api.player.gold <= (healCost * 2) ? 0 : healCost;
if(api.player.gold < cost) {
text.push(`<p>${getText('insufficient_money', service, city)}</p>`)