summaryrefslogtreecommitdiffstats
path: root/net/ricketyspace
diff options
context:
space:
mode:
Diffstat (limited to 'net/ricketyspace')
-rw-r--r--net/ricketyspace/ror/ten/source.rkt13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/ricketyspace/ror/ten/source.rkt b/net/ricketyspace/ror/ten/source.rkt
index b4fb6f2..8cb98dc 100644
--- a/net/ricketyspace/ror/ten/source.rkt
+++ b/net/ricketyspace/ror/ten/source.rkt
@@ -547,6 +547,19 @@
(define dst-defend (sum (roll-dice (territory-dice dst-t))))
(if (> src-attack dst-defend) #t #f))
+;; DiceWorld Territory -> DiceWorld
+;; generate dice world for the case where player
+;; loses the dice attack
+(define (dice-world-attack-lost w src-t)
+ (define src (territory-index src-t))
+ (define player (territory-player src-t))
+ (define newb (for/list ([t (dice-world-board w)])
+ (define idx (territory-index t))
+ (cond [(= idx src) (territory-set-dice t 1)]
+ [else t])))
+ (define new-gt (game-tree newb player 0))
+ (dice-world #f newb new-gt))
+
;
;
;