|
|
@ -172,7 +172,12 @@
|
|
|
|
(tax-person . 0)
|
|
|
|
(tax-person . 0)
|
|
|
|
(emergency . 0)
|
|
|
|
(emergency . 0)
|
|
|
|
(num-harvests . 0)
|
|
|
|
(num-harvests . 0)
|
|
|
|
(harvest-rolls . 0)))
|
|
|
|
(harvest-rolls . 0)
|
|
|
|
|
|
|
|
(operating-expenses . 0)
|
|
|
|
|
|
|
|
(hay . 0)
|
|
|
|
|
|
|
|
(grain . 0)
|
|
|
|
|
|
|
|
(fruit . 0)
|
|
|
|
|
|
|
|
(cows . 0)))
|
|
|
|
(alist-ref 'ai? args eqv? #f)
|
|
|
|
(alist-ref 'ai? args eqv? #f)
|
|
|
|
(alist-ref 'processing-turn args eqv? #f))))
|
|
|
|
(alist-ref 'processing-turn args eqv? #f))))
|
|
|
|
|
|
|
|
|
|
|
@ -555,7 +560,7 @@
|
|
|
|
;; (session-set! (sid) 'game *game*)
|
|
|
|
;; (session-set! (sid) 'game *game*)
|
|
|
|
;; (set-startup-otbs (session-ref (sid) 'player) 2)
|
|
|
|
;; (set-startup-otbs (session-ref (sid) 'player) 2)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(send-static-file "main.html")
|
|
|
|
(send-static-file "index.html")
|
|
|
|
;; (with-headers `((connection close)
|
|
|
|
;; (with-headers `((connection close)
|
|
|
|
;; (content-type text/html))
|
|
|
|
;; (content-type text/html))
|
|
|
|
;; (lambda ()
|
|
|
|
;; (lambda ()
|
|
|
@ -1015,7 +1020,31 @@
|
|
|
|
(* (/ (alist-ref 'harvest-rolls (player-stats p))
|
|
|
|
(* (/ (alist-ref 'harvest-rolls (player-stats p))
|
|
|
|
(max (alist-ref 'num-harvests (player-stats p)) 1))
|
|
|
|
(max (alist-ref 'num-harvests (player-stats p)) 1))
|
|
|
|
10))
|
|
|
|
10))
|
|
|
|
10)) ")"))))))
|
|
|
|
10)) ")")))
|
|
|
|
|
|
|
|
(players . ,(list->vector
|
|
|
|
|
|
|
|
(map (lambda (p)
|
|
|
|
|
|
|
|
(let ((stats (player-stats p)))
|
|
|
|
|
|
|
|
`((name . ,(player-name p))
|
|
|
|
|
|
|
|
(numHarvests . ,(alist-ref 'num-harvests stats))
|
|
|
|
|
|
|
|
(hay . ,(alist-ref 'hay stats))
|
|
|
|
|
|
|
|
(grain . ,(alist-ref 'grain stats))
|
|
|
|
|
|
|
|
(fruit . ,(alist-ref 'fruit stats))
|
|
|
|
|
|
|
|
(cows . ,(alist-ref 'cows stats))
|
|
|
|
|
|
|
|
(harvestAverage . ,(exact->inexact
|
|
|
|
|
|
|
|
(round
|
|
|
|
|
|
|
|
(/ (fold + 0 (map (lambda (c) (alist-ref c stats))
|
|
|
|
|
|
|
|
'(hay grain fruit cows)))
|
|
|
|
|
|
|
|
(alist-ref 'num-harvests stats)))))
|
|
|
|
|
|
|
|
(harvestTotal . ,(fold + 0 (map (lambda (c) (alist-ref c stats))
|
|
|
|
|
|
|
|
'(hay grain fruit cows))))
|
|
|
|
|
|
|
|
(operatingExpenses . ,(alist-ref 'operating-expenses stats))
|
|
|
|
|
|
|
|
(harvestRoll . ,(exact->inexact
|
|
|
|
|
|
|
|
(/ (round
|
|
|
|
|
|
|
|
(* (/ (alist-ref 'harvest-rolls stats)
|
|
|
|
|
|
|
|
(max (alist-ref 'num-harvests stats) 1))
|
|
|
|
|
|
|
|
10))
|
|
|
|
|
|
|
|
10))))))
|
|
|
|
|
|
|
|
(game-players game)))))))
|
|
|
|
type: "end-of-game")))
|
|
|
|
type: "end-of-game")))
|
|
|
|
|
|
|
|
|
|
|
|
(define (create-ws-response player event misc)
|
|
|
|
(define (create-ws-response player event misc)
|
|
|
@ -2299,7 +2328,7 @@
|
|
|
|
(define (make-player-stat stat amount)
|
|
|
|
(define (make-player-stat stat amount)
|
|
|
|
(lambda (p)
|
|
|
|
(lambda (p)
|
|
|
|
(safe-set! (player-stats p)
|
|
|
|
(safe-set! (player-stats p)
|
|
|
|
(alist-update stat (+ (alist-ref stat (player-stats p)) amount)
|
|
|
|
(alist-update stat (+ (alist-ref stat (player-stats p) eqv? 0) amount)
|
|
|
|
(player-stats p)))))
|
|
|
|
(player-stats p)))))
|
|
|
|
|
|
|
|
|
|
|
|
(define (get-actions player space)
|
|
|
|
(define (get-actions player space)
|
|
|
@ -2522,6 +2551,7 @@
|
|
|
|
(begin
|
|
|
|
(begin
|
|
|
|
((make-player-stat 'num-harvests 1) player)
|
|
|
|
((make-player-stat 'num-harvests 1) player)
|
|
|
|
((make-player-stat 'harvest-rolls rolled) player)
|
|
|
|
((make-player-stat 'harvest-rolls rolled) player)
|
|
|
|
|
|
|
|
((make-player-stat crop income) player)
|
|
|
|
(safe-set! (player-cash player)
|
|
|
|
(safe-set! (player-cash player)
|
|
|
|
(+ (player-cash player) income))
|
|
|
|
(+ (player-cash player) income))
|
|
|
|
(safe-set! (player-harvest-mult player) 1)
|
|
|
|
(safe-set! (player-harvest-mult player) 1)
|
|
|
@ -2535,6 +2565,9 @@
|
|
|
|
(player-name player))))
|
|
|
|
(player-name player))))
|
|
|
|
(game-players game)))))
|
|
|
|
(game-players game)))))
|
|
|
|
((alist-ref 'action operating-expense) player)
|
|
|
|
((alist-ref 'action operating-expense) player)
|
|
|
|
|
|
|
|
((make-player-stat 'operating-expenses
|
|
|
|
|
|
|
|
(- (player-cash player) previous-cash))
|
|
|
|
|
|
|
|
player)
|
|
|
|
`((rolled . ,rolled)
|
|
|
|
`((rolled . ,rolled)
|
|
|
|
(rolls . ,(list->vector (make-rolls 22)))
|
|
|
|
(rolls . ,(list->vector (make-rolls 22)))
|
|
|
|
(income . ,income)
|
|
|
|
(income . ,income)
|
|
|
|