|
|
|
@ -185,7 +185,14 @@
|
|
|
|
|
(hay . 0)
|
|
|
|
|
(grain . 0)
|
|
|
|
|
(fruit . 0)
|
|
|
|
|
(cows . 0)))
|
|
|
|
|
(cows . 0)
|
|
|
|
|
(tractor . 0)
|
|
|
|
|
(harvester . 0)
|
|
|
|
|
(hay-expenses . 0)
|
|
|
|
|
(grain-expenses . 0)
|
|
|
|
|
(fruit-expenses . 0)
|
|
|
|
|
(cows-expenses . 0)
|
|
|
|
|
(cows-lost . 0)))
|
|
|
|
|
(alist-ref 'ai? args eqv? #f)
|
|
|
|
|
(alist-ref 'processing-turn args eqv? #f))))
|
|
|
|
|
|
|
|
|
@ -568,7 +575,7 @@
|
|
|
|
|
;; (session-set! (sid) 'game *game*)
|
|
|
|
|
;; (set-startup-otbs (session-ref (sid) 'player) 2)
|
|
|
|
|
)
|
|
|
|
|
(send-static-file "index.html")
|
|
|
|
|
(send-static-file "main.html")
|
|
|
|
|
;; (with-headers `((connection close)
|
|
|
|
|
;; (content-type text/html))
|
|
|
|
|
;; (lambda ()
|
|
|
|
@ -577,7 +584,7 @@
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(define (start-game)
|
|
|
|
|
(send-static-file "index.html")
|
|
|
|
|
(send-static-file "main.html")
|
|
|
|
|
""
|
|
|
|
|
;; (with-output-to-string
|
|
|
|
|
;; (lambda ()
|
|
|
|
@ -1038,6 +1045,9 @@
|
|
|
|
|
(grain . ,(alist-ref 'grain stats))
|
|
|
|
|
(fruit . ,(alist-ref 'fruit stats))
|
|
|
|
|
(cows . ,(alist-ref 'cows stats))
|
|
|
|
|
(cowsLost . ,(alist-ref 'cows-lost stats eqv? 0))
|
|
|
|
|
(tractor . ,(alist-ref 'tractor stats))
|
|
|
|
|
(harvester . ,(alist-ref 'harvester stats))
|
|
|
|
|
(harvestAverage . ,(exact->inexact
|
|
|
|
|
(round
|
|
|
|
|
(/ (fold + 0 (map (lambda (c) (alist-ref c stats))
|
|
|
|
@ -2049,9 +2059,11 @@
|
|
|
|
|
(inexact->exact
|
|
|
|
|
(round (/ (exact->inexact amount) num-equipment))))))
|
|
|
|
|
(for-each (lambda (player)
|
|
|
|
|
((make-player-stat equipment amount-per-player) player)
|
|
|
|
|
(safe-set! (player-cash player)
|
|
|
|
|
(+ (player-cash player) amount-per-player)))
|
|
|
|
|
(players-with equipment game)))))
|
|
|
|
|
((make-player-stat equipment (- amount)) player)
|
|
|
|
|
(safe-set! (player-cash player) (- (player-cash player) amount))))
|
|
|
|
|
|
|
|
|
|
(define (make-player-gains amount)
|
|
|
|
@ -2232,6 +2244,8 @@
|
|
|
|
|
(for-each (lambda (from-player)
|
|
|
|
|
(when (not (eq? player from-player))
|
|
|
|
|
(when (not (player-has-asset? 'harvester from-player))
|
|
|
|
|
((make-player-stat equipment -2000) from-player)
|
|
|
|
|
((make-player-stat equipment 2000) player)
|
|
|
|
|
(safe-set! (player-cash from-player)
|
|
|
|
|
(- (player-cash from-player) 2000))
|
|
|
|
|
(safe-set! (player-cash player)
|
|
|
|
@ -2290,6 +2304,7 @@
|
|
|
|
|
(safe-set! (player-assets player)
|
|
|
|
|
(alist-update 'cows (- (alist-ref 'cows (player-assets player)) (- cows ridge-cows))
|
|
|
|
|
(player-assets player)))
|
|
|
|
|
((make-player-stat 'cows-lost slaughtered-cows) player)
|
|
|
|
|
`(((?action . info)
|
|
|
|
|
(?value . ,(conc slaughtered-cows
|
|
|
|
|
" cows slaughtered on your farm.")))))
|
|
|
|
|