diff --git a/TODO b/TODO index ace5df9..ddd7afa 100644 --- a/TODO +++ b/TODO @@ -14,3 +14,9 @@ * splash screen with game logo * (I am legion...) + + +Bugs + +* occasionally, scrolling the map will lag, causing an "inertia" effect + (reloading resolves this, but what's the cause?) diff --git a/TODO b/TODO index ace5df9..ddd7afa 100644 --- a/TODO +++ b/TODO @@ -14,3 +14,9 @@ * splash screen with game logo * (I am legion...) + + +Bugs + +* occasionally, scrolling the map will lag, causing an "inertia" effect + (reloading resolves this, but what's the cause?) diff --git a/biomes.lisp b/biomes.lisp index 293d199..7894167 100644 --- a/biomes.lisp +++ b/biomes.lisp @@ -28,40 +28,42 @@ (cassoc symbol-name biome-list))) (defmacro new-biome (name &body body) - `(register-biome ,name - (make-biome ,@body))) + `(register-biome ',name + (make-biome + :name ,(symbol-to-string name) + ,@body))) ;; Biome definitions -(new-biome 'grassland - :name "grassland" +(new-biome grassland :ground "tall elephant grass" :char #\; :col ':yellow :features '((acacia 40) (boulder 150))) ;TODO -(new-biome 'forest - :name "forest" +(new-biome forest :ground "leaf litter and small shrubs" :char #\. :col ':green :features '((miombo 10) (acacia 15))) ;TODO -(new-biome 'stream - :name "stream" +(new-biome stream :ground "shallow flowing water" :char #\~ :col ':blue :features '()) ;TODO -(new-biome 'swamp - :name "swamp" +(new-biome swamp :ground "short sedge grass growing on boggy black soil" :char #\w :col ':green :features '()) ;TODO -(new-biome 'hill - :name "hill" +(new-biome hill :ground "hard, stony soil" - :char #\m :col ':white - :features '((boulder 10))) ;TODO + :char #\m :col ':cyan ;XXX white might be better + :features '((boulder 10) (miombo 80))) ;TODO + +(new-biome desert + :ground "deep, drifting sand" + :char #\~ :col ':white ;XXX yellow would be better, but shows up brown + :features '((cactus 100) (bolder 200))) ;;TODO desert diff --git a/TODO b/TODO index ace5df9..ddd7afa 100644 --- a/TODO +++ b/TODO @@ -14,3 +14,9 @@ * splash screen with game logo * (I am legion...) + + +Bugs + +* occasionally, scrolling the map will lag, causing an "inertia" effect + (reloading resolves this, but what's the cause?) diff --git a/biomes.lisp b/biomes.lisp index 293d199..7894167 100644 --- a/biomes.lisp +++ b/biomes.lisp @@ -28,40 +28,42 @@ (cassoc symbol-name biome-list))) (defmacro new-biome (name &body body) - `(register-biome ,name - (make-biome ,@body))) + `(register-biome ',name + (make-biome + :name ,(symbol-to-string name) + ,@body))) ;; Biome definitions -(new-biome 'grassland - :name "grassland" +(new-biome grassland :ground "tall elephant grass" :char #\; :col ':yellow :features '((acacia 40) (boulder 150))) ;TODO -(new-biome 'forest - :name "forest" +(new-biome forest :ground "leaf litter and small shrubs" :char #\. :col ':green :features '((miombo 10) (acacia 15))) ;TODO -(new-biome 'stream - :name "stream" +(new-biome stream :ground "shallow flowing water" :char #\~ :col ':blue :features '()) ;TODO -(new-biome 'swamp - :name "swamp" +(new-biome swamp :ground "short sedge grass growing on boggy black soil" :char #\w :col ':green :features '()) ;TODO -(new-biome 'hill - :name "hill" +(new-biome hill :ground "hard, stony soil" - :char #\m :col ':white - :features '((boulder 10))) ;TODO + :char #\m :col ':cyan ;XXX white might be better + :features '((boulder 10) (miombo 80))) ;TODO + +(new-biome desert + :ground "deep, drifting sand" + :char #\~ :col ':white ;XXX yellow would be better, but shows up brown + :features '((cactus 100) (bolder 200))) ;;TODO desert diff --git a/items.lisp b/items.lisp index 69fcfc8..70e8acb 100644 --- a/items.lisp +++ b/items.lisp @@ -20,85 +20,83 @@ (copy-item (get-item-type symbol-name)))) (defmacro new-item (type name &body body) - `(register-item ,name - (make-instance ,type ,@body))) + `(register-item ',name + (make-instance ',type + :name ,(symbol-to-string name) + ,@body))) ;;; RESOURCE ITEMS ;;TODO sand, glass, clay, bricks -(new-item 'resource 'wood - :name "wood" :weight 1 +(new-item resource wood :description "A block of wood, just right for working with" - :burning-product 'charcoal) + :weight 1 :burning-product 'charcoal) -(new-item 'resource 'charcoal - :name "charcoal" :weight 1 - :description "A black lump of charcoal. Burns better than wood.") +(new-item resource charcoal + :description "A black lump of charcoal. Burns better than wood." + :weight 1) -(new-item 'resource 'stone - :name "stone" :weight 2 - :description "A fist-sized stone. What are you going to do with it?") +(new-item resource stone + :description "A fist-sized stone. What are you going to do with it?" + :weight 2) -(new-item 'resource 'iron-ore - :name "iron ore" :weight 4 +(new-item resource iron-ore :description "A lump of iron ore - still needs to be smelted." - :burning-product 'iron) + :weight 4 :burning-product 'iron) -(new-item 'resource 'iron - :name "iron" :weight 3 - :description "An iron ingot, ready for further crafting.") +(new-item resource iron + :description "An iron ingot, ready for further crafting." + :weight 3) ;;; LANDSCAPE FEATURES -(new-item 'feature 'acacia - :name "acacia" +(new-item feature acacia :description "A tall acacia tree, spreading its branches wide." :destroy-with '(wood) :drops '(wood) :weight 2000 :char #\T :color :green) -(new-item 'feature 'miombo - :name "miombo" +(new-item feature miombo :description "A small, crooked miombo tree." :destroy-with '(wood) :drops '(wood) :weight 500 :char #\Y :color :green) -(new-item 'feature 'boulder - :name "boulder" +(new-item feature boulder :description "A huge lump of grey basalt, sticking out of the ground." :destroy-with '(stone) :drops '(stone) :weight 5000 - :char #\8 :color :gray) + :char #\8 :color :white) ;XXX colour :gray is not supported on Arch :-( -;;TODO termite hill, palm, baobab, cactus, pond +(new-item feature cactus + :description "A prickly eupharbacae sticks out of the ground here - don't touch!" + :destroy-with '(axe) ;does it drop anything? + :char #\+ :color :green) + +;;TODO termite hill, palm, baobab, pond ;;; TOOL ITEMS ;;TODO bronze tools, weapons -(new-item 'tool 'stone-axe - :name "stone axe" +(new-item tool stone-axe :description "An axe, crudely but effectively fashioned out of stone." :type 'wood :level 1 :weight 2 :craft-with '(stone wood)) -(new-item 'tool 'iron-axe - :name "iron axe" +(new-item tool iron-axe :description "A finely honed iron axe, just right for chopping wood." :type 'wood :level 3 :weight 3 :craft-with '(iron wood)) -(new-item 'tool 'stone-pickaxe - :name "stone pickaxe" +(new-item tool stone-pickaxe :description "A pickaxe, somewhat helplessly made from stone." :type 'stone :level 1 :weight 3 :craft-with '(stone stone wood)) -(new-item 'tool 'iron-pickaxe - :name "iron pickaxe" +(new-item tool iron-pickaxe :description "A solid iron pickaxe. Prepare to split rock!" :type 'stone :level 3 :weight 4 :craft-with '(iron iron wood)) diff --git a/TODO b/TODO index ace5df9..ddd7afa 100644 --- a/TODO +++ b/TODO @@ -14,3 +14,9 @@ * splash screen with game logo * (I am legion...) + + +Bugs + +* occasionally, scrolling the map will lag, causing an "inertia" effect + (reloading resolves this, but what's the cause?) diff --git a/biomes.lisp b/biomes.lisp index 293d199..7894167 100644 --- a/biomes.lisp +++ b/biomes.lisp @@ -28,40 +28,42 @@ (cassoc symbol-name biome-list))) (defmacro new-biome (name &body body) - `(register-biome ,name - (make-biome ,@body))) + `(register-biome ',name + (make-biome + :name ,(symbol-to-string name) + ,@body))) ;; Biome definitions -(new-biome 'grassland - :name "grassland" +(new-biome grassland :ground "tall elephant grass" :char #\; :col ':yellow :features '((acacia 40) (boulder 150))) ;TODO -(new-biome 'forest - :name "forest" +(new-biome forest :ground "leaf litter and small shrubs" :char #\. :col ':green :features '((miombo 10) (acacia 15))) ;TODO -(new-biome 'stream - :name "stream" +(new-biome stream :ground "shallow flowing water" :char #\~ :col ':blue :features '()) ;TODO -(new-biome 'swamp - :name "swamp" +(new-biome swamp :ground "short sedge grass growing on boggy black soil" :char #\w :col ':green :features '()) ;TODO -(new-biome 'hill - :name "hill" +(new-biome hill :ground "hard, stony soil" - :char #\m :col ':white - :features '((boulder 10))) ;TODO + :char #\m :col ':cyan ;XXX white might be better + :features '((boulder 10) (miombo 80))) ;TODO + +(new-biome desert + :ground "deep, drifting sand" + :char #\~ :col ':white ;XXX yellow would be better, but shows up brown + :features '((cactus 100) (bolder 200))) ;;TODO desert diff --git a/items.lisp b/items.lisp index 69fcfc8..70e8acb 100644 --- a/items.lisp +++ b/items.lisp @@ -20,85 +20,83 @@ (copy-item (get-item-type symbol-name)))) (defmacro new-item (type name &body body) - `(register-item ,name - (make-instance ,type ,@body))) + `(register-item ',name + (make-instance ',type + :name ,(symbol-to-string name) + ,@body))) ;;; RESOURCE ITEMS ;;TODO sand, glass, clay, bricks -(new-item 'resource 'wood - :name "wood" :weight 1 +(new-item resource wood :description "A block of wood, just right for working with" - :burning-product 'charcoal) + :weight 1 :burning-product 'charcoal) -(new-item 'resource 'charcoal - :name "charcoal" :weight 1 - :description "A black lump of charcoal. Burns better than wood.") +(new-item resource charcoal + :description "A black lump of charcoal. Burns better than wood." + :weight 1) -(new-item 'resource 'stone - :name "stone" :weight 2 - :description "A fist-sized stone. What are you going to do with it?") +(new-item resource stone + :description "A fist-sized stone. What are you going to do with it?" + :weight 2) -(new-item 'resource 'iron-ore - :name "iron ore" :weight 4 +(new-item resource iron-ore :description "A lump of iron ore - still needs to be smelted." - :burning-product 'iron) + :weight 4 :burning-product 'iron) -(new-item 'resource 'iron - :name "iron" :weight 3 - :description "An iron ingot, ready for further crafting.") +(new-item resource iron + :description "An iron ingot, ready for further crafting." + :weight 3) ;;; LANDSCAPE FEATURES -(new-item 'feature 'acacia - :name "acacia" +(new-item feature acacia :description "A tall acacia tree, spreading its branches wide." :destroy-with '(wood) :drops '(wood) :weight 2000 :char #\T :color :green) -(new-item 'feature 'miombo - :name "miombo" +(new-item feature miombo :description "A small, crooked miombo tree." :destroy-with '(wood) :drops '(wood) :weight 500 :char #\Y :color :green) -(new-item 'feature 'boulder - :name "boulder" +(new-item feature boulder :description "A huge lump of grey basalt, sticking out of the ground." :destroy-with '(stone) :drops '(stone) :weight 5000 - :char #\8 :color :gray) + :char #\8 :color :white) ;XXX colour :gray is not supported on Arch :-( -;;TODO termite hill, palm, baobab, cactus, pond +(new-item feature cactus + :description "A prickly eupharbacae sticks out of the ground here - don't touch!" + :destroy-with '(axe) ;does it drop anything? + :char #\+ :color :green) + +;;TODO termite hill, palm, baobab, pond ;;; TOOL ITEMS ;;TODO bronze tools, weapons -(new-item 'tool 'stone-axe - :name "stone axe" +(new-item tool stone-axe :description "An axe, crudely but effectively fashioned out of stone." :type 'wood :level 1 :weight 2 :craft-with '(stone wood)) -(new-item 'tool 'iron-axe - :name "iron axe" +(new-item tool iron-axe :description "A finely honed iron axe, just right for chopping wood." :type 'wood :level 3 :weight 3 :craft-with '(iron wood)) -(new-item 'tool 'stone-pickaxe - :name "stone pickaxe" +(new-item tool stone-pickaxe :description "A pickaxe, somewhat helplessly made from stone." :type 'stone :level 1 :weight 3 :craft-with '(stone stone wood)) -(new-item 'tool 'iron-pickaxe - :name "iron pickaxe" +(new-item tool iron-pickaxe :description "A solid iron pickaxe. Prepare to split rock!" :type 'stone :level 3 :weight 4 :craft-with '(iron iron wood)) diff --git a/naledi.lisp b/naledi.lisp index 54ad9ea..4227b4e 100644 --- a/naledi.lisp +++ b/naledi.lisp @@ -64,7 +64,6 @@ (defun draw-map (win me) "Draw a portion of the game map in an ncurses window" - ;;FIXME (setf (.color-pair win) '(:white :black)) (box win) (setf (.cursor-position win) '(1 1)) diff --git a/TODO b/TODO index ace5df9..ddd7afa 100644 --- a/TODO +++ b/TODO @@ -14,3 +14,9 @@ * splash screen with game logo * (I am legion...) + + +Bugs + +* occasionally, scrolling the map will lag, causing an "inertia" effect + (reloading resolves this, but what's the cause?) diff --git a/biomes.lisp b/biomes.lisp index 293d199..7894167 100644 --- a/biomes.lisp +++ b/biomes.lisp @@ -28,40 +28,42 @@ (cassoc symbol-name biome-list))) (defmacro new-biome (name &body body) - `(register-biome ,name - (make-biome ,@body))) + `(register-biome ',name + (make-biome + :name ,(symbol-to-string name) + ,@body))) ;; Biome definitions -(new-biome 'grassland - :name "grassland" +(new-biome grassland :ground "tall elephant grass" :char #\; :col ':yellow :features '((acacia 40) (boulder 150))) ;TODO -(new-biome 'forest - :name "forest" +(new-biome forest :ground "leaf litter and small shrubs" :char #\. :col ':green :features '((miombo 10) (acacia 15))) ;TODO -(new-biome 'stream - :name "stream" +(new-biome stream :ground "shallow flowing water" :char #\~ :col ':blue :features '()) ;TODO -(new-biome 'swamp - :name "swamp" +(new-biome swamp :ground "short sedge grass growing on boggy black soil" :char #\w :col ':green :features '()) ;TODO -(new-biome 'hill - :name "hill" +(new-biome hill :ground "hard, stony soil" - :char #\m :col ':white - :features '((boulder 10))) ;TODO + :char #\m :col ':cyan ;XXX white might be better + :features '((boulder 10) (miombo 80))) ;TODO + +(new-biome desert + :ground "deep, drifting sand" + :char #\~ :col ':white ;XXX yellow would be better, but shows up brown + :features '((cactus 100) (bolder 200))) ;;TODO desert diff --git a/items.lisp b/items.lisp index 69fcfc8..70e8acb 100644 --- a/items.lisp +++ b/items.lisp @@ -20,85 +20,83 @@ (copy-item (get-item-type symbol-name)))) (defmacro new-item (type name &body body) - `(register-item ,name - (make-instance ,type ,@body))) + `(register-item ',name + (make-instance ',type + :name ,(symbol-to-string name) + ,@body))) ;;; RESOURCE ITEMS ;;TODO sand, glass, clay, bricks -(new-item 'resource 'wood - :name "wood" :weight 1 +(new-item resource wood :description "A block of wood, just right for working with" - :burning-product 'charcoal) + :weight 1 :burning-product 'charcoal) -(new-item 'resource 'charcoal - :name "charcoal" :weight 1 - :description "A black lump of charcoal. Burns better than wood.") +(new-item resource charcoal + :description "A black lump of charcoal. Burns better than wood." + :weight 1) -(new-item 'resource 'stone - :name "stone" :weight 2 - :description "A fist-sized stone. What are you going to do with it?") +(new-item resource stone + :description "A fist-sized stone. What are you going to do with it?" + :weight 2) -(new-item 'resource 'iron-ore - :name "iron ore" :weight 4 +(new-item resource iron-ore :description "A lump of iron ore - still needs to be smelted." - :burning-product 'iron) + :weight 4 :burning-product 'iron) -(new-item 'resource 'iron - :name "iron" :weight 3 - :description "An iron ingot, ready for further crafting.") +(new-item resource iron + :description "An iron ingot, ready for further crafting." + :weight 3) ;;; LANDSCAPE FEATURES -(new-item 'feature 'acacia - :name "acacia" +(new-item feature acacia :description "A tall acacia tree, spreading its branches wide." :destroy-with '(wood) :drops '(wood) :weight 2000 :char #\T :color :green) -(new-item 'feature 'miombo - :name "miombo" +(new-item feature miombo :description "A small, crooked miombo tree." :destroy-with '(wood) :drops '(wood) :weight 500 :char #\Y :color :green) -(new-item 'feature 'boulder - :name "boulder" +(new-item feature boulder :description "A huge lump of grey basalt, sticking out of the ground." :destroy-with '(stone) :drops '(stone) :weight 5000 - :char #\8 :color :gray) + :char #\8 :color :white) ;XXX colour :gray is not supported on Arch :-( -;;TODO termite hill, palm, baobab, cactus, pond +(new-item feature cactus + :description "A prickly eupharbacae sticks out of the ground here - don't touch!" + :destroy-with '(axe) ;does it drop anything? + :char #\+ :color :green) + +;;TODO termite hill, palm, baobab, pond ;;; TOOL ITEMS ;;TODO bronze tools, weapons -(new-item 'tool 'stone-axe - :name "stone axe" +(new-item tool stone-axe :description "An axe, crudely but effectively fashioned out of stone." :type 'wood :level 1 :weight 2 :craft-with '(stone wood)) -(new-item 'tool 'iron-axe - :name "iron axe" +(new-item tool iron-axe :description "A finely honed iron axe, just right for chopping wood." :type 'wood :level 3 :weight 3 :craft-with '(iron wood)) -(new-item 'tool 'stone-pickaxe - :name "stone pickaxe" +(new-item tool stone-pickaxe :description "A pickaxe, somewhat helplessly made from stone." :type 'stone :level 1 :weight 3 :craft-with '(stone stone wood)) -(new-item 'tool 'iron-pickaxe - :name "iron pickaxe" +(new-item tool iron-pickaxe :description "A solid iron pickaxe. Prepare to split rock!" :type 'stone :level 3 :weight 4 :craft-with '(iron iron wood)) diff --git a/naledi.lisp b/naledi.lisp index 54ad9ea..4227b4e 100644 --- a/naledi.lisp +++ b/naledi.lisp @@ -64,7 +64,6 @@ (defun draw-map (win me) "Draw a portion of the game map in an ncurses window" - ;;FIXME (setf (.color-pair win) '(:white :black)) (box win) (setf (.cursor-position win) '(1 1)) diff --git a/util.lisp b/util.lisp index f4b4398..68b0d29 100644 --- a/util.lisp +++ b/util.lisp @@ -96,6 +96,11 @@ (if (null assoc-list) NIL (cons (car (car assoc-list)) (keys (cdr assoc-list))))) +(defun symbol-to-string (sym) + "Convert a symbol to a string, exchanging dashes for spaces" + (string-from-list + (split-string (string-downcase (string sym)) #\-) #\space)) + (defun letter-in-string (letter str) "Is this letter in this string?" (dotimes (i (length str) NIL)