summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'data/examples/blackjack/play.fate')
-rw-r--r--data/examples/blackjack/play.fate52
1 files changed, 36 insertions, 16 deletions
diff --git a/data/examples/blackjack/play.fate b/data/examples/blackjack/play.fate
index 4c2913f..8504afa 100644
--- a/data/examples/blackjack/play.fate
+++ b/data/examples/blackjack/play.fate
@@ -16,9 +16,12 @@
(local card new_card)
(if (not (var has_played))
- (text_effect action_description
- Sitting yourself at a table, you see someone rushing to set up the
- cards and manage the game.
+ (
+ (text_effect action_description
+ Sitting yourself at a table, you see someone rushing to set up the
+ cards and manage the game.
+ )
+ (set has_played (true))
)
)
(if (= (var player.money) 0)
@@ -74,6 +77,7 @@
(visit initial_draw)
(clear dealer_hand)
+ (clear player.hand)
(newline)
Interesting. Would you like to go again?
@@ -102,23 +106,39 @@
(visit compute_score (ptr player.hand) (ptr player_score))
(if (= (var dealer_score) 21)
- (ifelse (= (var player_score) 21)
- (
+ (
+ (text_effect action_description
+ The dealer reveals their full hand:
+ )
+ (foreach dealer_hand card
(text_effect action_description
- The dealer looks very surprised.
+ (newline)
+ * The (var card.name), worth
+ (if_else (= (var card.number) 1)
+ (text 1 or 11 points. )
+ (text (var card.score) points. )
+ )
)
- (newline)
- Double Blackjack! A tie, then.
- (done)
)
- (
- (text_effect action_description
- The dealer looks surprised, but happy.
+ (newline)
+ (ifelse (= (var player_score) 21)
+ (
+ (text_effect action_description
+ The dealer looks very surprised.
+ )
+ (newline)
+ Double Blackjack! A tie, then.
+ (done)
+ )
+ (
+ (text_effect action_description
+ The dealer looks surprised, but happy.
+ )
+ (newline)
+ Blackjack! Looks like I win, this time.
+ (visit money_loss (var bet))
+ (done)
)
- (newline)
- Blackjack! Looks like I win, this time.
- (visit money_loss (var bet))
- (done)
)
)
)