From: xangelo Date: Fri, 7 Jul 2023 17:12:42 +0000 (-0400) Subject: fix: give users free healing if they have less than 20g X-Git-Tag: v0.0.2~1 X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=8dbffa63a1c2639031b41de9fcca825e8355e78f;p=risinglegends.git fix: give users free healing if they have less than 20g --- diff --git a/src/events/healer/server.ts b/src/events/healer/server.ts index 4347954..e3f3634 100644 --- a/src/events/healer/server.ts +++ b/src/events/healer/server.ts @@ -110,15 +110,15 @@ export const healer: SocketEvent = { text.push(`

You're already at full health?

`); } else { - if(api.player.level <= 3) { - text.push(`

Since you still seem to be new around here, this one's on the house!

`); + if(api.player.gold <= (healCost * 2)) { + text.push(`

You don't seem to have too much money... I guess I can do it for free this time...

`); text.push(`

`); } else { text.push(`

`); } - } + } api.socket.emit('city:service:healer', { text: text.join("\n") @@ -145,7 +145,7 @@ export const heal: SocketEvent = { text.push(`

${service.name}

`); - const cost = api.player.level <= 3 ? 0 : healCost; + const cost = api.player.gold <= (healCost * 2) ? 0 : healCost; if(api.player.gold < cost) { text.push(`

${getText('insufficient_money', service, city)}

`)