;;;; ;;;; Naledi ya Africa ("Star of Africa") is a rogue-like survival game ;;;; set in Africa. ;;;; ;;;; Biomes are habitat types, that provide default functions for patches. ;;;; This file defines the biome struct and the inbuilt biomes. ;;;; ;;;; (c) 2018 Daniel Vedder, MIT license ;;;; ;; Biome struct and register (defstruct biome (name "") (ground "") (features '()) ;an alist of possible features and their 1/p probabilities (char #\.) ;default map display character (col ':white)) ;default map display colour (let ((biome-list NIL)) (defun register-biome (symbol-name biome-object) (setf biome-list (cons (list symbol-name biome-object) biome-list))) (defun available-biomes () (keys biome-list)) (defun get-biome (symbol-name) (cassoc symbol-name biome-list))) (defmacro new-biome (name &body body) `(register-biome ,name (make-biome ,@body))) ;; Biome definitions (new-biome 'grassland :name "grassland" :ground "tall elephant grass" :char #\; :col ':yellow :features '((acacia 20) (boulder 100))) ;TODO (new-biome 'forest :name "forest" :ground "leaf litter and small shrubs" :char #\. :col ':green :features '((miombo 5) (acacia 10))) ;TODO (new-biome 'stream :name "stream" :ground "shallow flowing water" :char #\~ :col ':blue :features '()) ;TODO (new-biome 'swamp :name "swamp" :ground "short sedge grass growing on boggy black soil" :char #\w :col ':green :features '()) ;TODO (new-biome 'hill :name "hill" :ground "hard, stony soil" :char #\m :col ':white :features '((boulder 7))) ;TODO ;;TODO desert