Files
flame/examples/assets/yarn/advanced.yarn
Lim Chee Keen 0028b5cb15 docs: Jenny example (#3086)
Replace this text.

---------

Co-authored-by: xjyribro <limcheekee.63@gmail.com>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2024-03-23 13:21:09 +01:00

21 lines
675 B
Plaintext

<<character Jenny>>
<<declare $winnings = 0>>
title: gamble
---
Jenny: Hello {$playerName}. This is a game of chance.
Jenny: You can win or lose up to 10 coins. Do you want to play?
-> No
Jenny: No bids made.
-> Yes
<<set $winnings = dice(21) - 11>> // returns a random value from -10 to 10
<<if $winnings == 0 >>
Jenny: Too bad, you did not win anything.
<<elseif $winnings < 0 >>
Jenny: Bad luck. You lost {$winnings} coins.
Jenny: Play again to change your fortunes.
<<else>>
Jenny: Congratulations! You won {$winnings} coins.
Jenny: Play again to win even more.
<<endif>>
<<updateCoins {$winnings}>>
===