diff --git a/biome.lisp b/biome.lisp index 6be8217..469ca2f 100644 --- a/biome.lisp +++ b/biome.lisp @@ -11,9 +11,10 @@ (defstruct biome (name "") - (char #\.) ;map display character - (init-items '()) ;initial items for patches with this biome - (update-fn #'(lambda (patch-pos) NIL))) ;needs a patch position argument + (ground "") + (occupants '()) ;an alist of possible occupants and their probabilities + (char #\.) ;default map display character + (col 'white)) ;default map display colour (let ((biome-list NIL)) @@ -27,46 +28,35 @@ `(register-biome ,name (make-biome ,@body))) -;; Grasslands biome -(defun update-grasslands (patch-pos) - ;;TODO - ) +;; Biome definitions (new-biome 'grassland - :name "grassland" :char #\i - :init-items NIL ;TODO - :update-fn #'update-grasslands) - -;; Forest biome - -(defun update-forest (patch-pos) - ;;TODO - ) + :name "grassland" + :ground "tall elephant grass" + :char #\; :col 'yellow + :occupants '((acacia 5) (boulder 1))) ;TODO (new-biome 'forest - :name "forest" :char #\Y - :init-items NIL ;TODO - :update-fn #'update-forest) - -;; Stream biome - -(defun update-stream (patch-pos) - ;;TODO - ) + :name "forest" + :ground "leaf litter and small shrubs" + :char #\. :col 'green + :occupants '((miombo 20) (acacia 10))) ;TODO (new-biome 'stream - :name "stream" :char #\~ - :init-items NIL ;TODO - :update-fn #'update-stream) + :name "stream" + :ground "shallow flowing water" + :char #\~ :col 'blue + :occupants '()) ;TODO -;; Hill biome - -(defun update-hill (patch-pos) - ;;TODO - ) +(new-biome 'swamp + :name "swamp" + :ground "short sedge grass growing on boggy black soil" + :char #\w :col 'green + :occupants '()) ;TODO (new-biome 'hill - :name "hill" :char #\m - :init-items NIL ;TODO - :update-fn #'update-hill) + :name "hill" + :ground "hard, stony soil" + :char #\m :col 'white + :occupants '((boulder 15))) ;TODO diff --git a/biome.lisp b/biome.lisp index 6be8217..469ca2f 100644 --- a/biome.lisp +++ b/biome.lisp @@ -11,9 +11,10 @@ (defstruct biome (name "") - (char #\.) ;map display character - (init-items '()) ;initial items for patches with this biome - (update-fn #'(lambda (patch-pos) NIL))) ;needs a patch position argument + (ground "") + (occupants '()) ;an alist of possible occupants and their probabilities + (char #\.) ;default map display character + (col 'white)) ;default map display colour (let ((biome-list NIL)) @@ -27,46 +28,35 @@ `(register-biome ,name (make-biome ,@body))) -;; Grasslands biome -(defun update-grasslands (patch-pos) - ;;TODO - ) +;; Biome definitions (new-biome 'grassland - :name "grassland" :char #\i - :init-items NIL ;TODO - :update-fn #'update-grasslands) - -;; Forest biome - -(defun update-forest (patch-pos) - ;;TODO - ) + :name "grassland" + :ground "tall elephant grass" + :char #\; :col 'yellow + :occupants '((acacia 5) (boulder 1))) ;TODO (new-biome 'forest - :name "forest" :char #\Y - :init-items NIL ;TODO - :update-fn #'update-forest) - -;; Stream biome - -(defun update-stream (patch-pos) - ;;TODO - ) + :name "forest" + :ground "leaf litter and small shrubs" + :char #\. :col 'green + :occupants '((miombo 20) (acacia 10))) ;TODO (new-biome 'stream - :name "stream" :char #\~ - :init-items NIL ;TODO - :update-fn #'update-stream) + :name "stream" + :ground "shallow flowing water" + :char #\~ :col 'blue + :occupants '()) ;TODO -;; Hill biome - -(defun update-hill (patch-pos) - ;;TODO - ) +(new-biome 'swamp + :name "swamp" + :ground "short sedge grass growing on boggy black soil" + :char #\w :col 'green + :occupants '()) ;TODO (new-biome 'hill - :name "hill" :char #\m - :init-items NIL ;TODO - :update-fn #'update-hill) + :name "hill" + :ground "hard, stony soil" + :char #\m :col 'white + :occupants '((boulder 15))) ;TODO diff --git a/terranostra.lisp b/terranostra.lisp index 7771626..917698b 100644 --- a/terranostra.lisp +++ b/terranostra.lisp @@ -19,12 +19,11 @@ (pos '(0 0)) ;position (biome (get-biome 'grassland)) (items '()) - (animals '())) + (occupant NIL)) (defun init-matrix (size) "Create a square matrix of empty patches" - (format t "~&Creating a ~Sx~S world matrix." size size) (do ((y 0 (1+ y)) (world NIL) (row NIL NIL)) ((= y size) world) (dotimes (x size)