aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_talk.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/action_talk.go')
-rw-r--r--internal/game/action_talk.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/game/action_talk.go b/internal/game/action_talk.go
index 30bf206..2d4a814 100644
--- a/internal/game/action_talk.go
+++ b/internal/game/action_talk.go
@@ -210,4 +210,10 @@ func (g *Game) applyNodeAction(sess *net.Session, na *action.NodeAction) {
g.AccountStore.SaveCharacter(p)
sess.WriteLine(fmt.Sprintf("You regain %d hitpoints.", na.Heal))
}
+ if na.Cost > 0 {
+ if p.Credits >= na.Cost {
+ p.Credits -= na.Cost
+ g.AccountStore.SaveCharacter(p)
+ }
+ }
}