diff --git a/biome.lisp b/biome.lisp index 469ca2f..fde3c3e 100644 --- a/biome.lisp +++ b/biome.lisp @@ -21,6 +21,9 @@ (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))) diff --git a/biome.lisp b/biome.lisp index 469ca2f..fde3c3e 100644 --- a/biome.lisp +++ b/biome.lisp @@ -21,6 +21,9 @@ (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))) diff --git a/items.lisp b/items.lisp index f220c83..e0b1769 100644 --- a/items.lisp +++ b/items.lisp @@ -11,6 +11,7 @@ (description "") (weight 0) (movable T) + (occupant NIL) (destroy-with '()) (drops '()) (craft-with '())) @@ -45,19 +46,28 @@ :name "iron" :weight 3 :description "An iron ingot, ready for further crafting.") -;;; NATURE ITEMS +;;; LANDSCAPE FEATURES -(new-item 'oak - :name "oak" - :description "An old, majestic oak, gnarled with age." +(new-item 'acacia + :name "acacia" + :description "A tall acacia tree, spreading its branches wide." :destroy-with '(stone-axe iron-axe) - :drops '(wood) :movable NIL :weight 2000) + :drops '(wood) :weight 2000 + :movable NIL :occupant T) -(new-item 'rock - :name "rock" +(new-item 'miombo + :name "miombo" + :description "A small, crooked miombo tree." + :destroy-with '(stone-axe iron-axe) + :drops '(wood) :weight 500 + :movable NIL :occupant T) + +(new-item 'boulder + :name "boulder" :description "A huge lump of grey basalt, sticking out of the ground." :destroy-with '(stone-pickaxe iron-pickaxe) - :drops '(stone) :movable NIL :weight 5000) + :drops '(stone) :weight 5000 + :movable NIL :occupant T) ;;; TOOL ITEMS diff --git a/biome.lisp b/biome.lisp index 469ca2f..fde3c3e 100644 --- a/biome.lisp +++ b/biome.lisp @@ -21,6 +21,9 @@ (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))) diff --git a/items.lisp b/items.lisp index f220c83..e0b1769 100644 --- a/items.lisp +++ b/items.lisp @@ -11,6 +11,7 @@ (description "") (weight 0) (movable T) + (occupant NIL) (destroy-with '()) (drops '()) (craft-with '())) @@ -45,19 +46,28 @@ :name "iron" :weight 3 :description "An iron ingot, ready for further crafting.") -;;; NATURE ITEMS +;;; LANDSCAPE FEATURES -(new-item 'oak - :name "oak" - :description "An old, majestic oak, gnarled with age." +(new-item 'acacia + :name "acacia" + :description "A tall acacia tree, spreading its branches wide." :destroy-with '(stone-axe iron-axe) - :drops '(wood) :movable NIL :weight 2000) + :drops '(wood) :weight 2000 + :movable NIL :occupant T) -(new-item 'rock - :name "rock" +(new-item 'miombo + :name "miombo" + :description "A small, crooked miombo tree." + :destroy-with '(stone-axe iron-axe) + :drops '(wood) :weight 500 + :movable NIL :occupant T) + +(new-item 'boulder + :name "boulder" :description "A huge lump of grey basalt, sticking out of the ground." :destroy-with '(stone-pickaxe iron-pickaxe) - :drops '(stone) :movable NIL :weight 5000) + :drops '(stone) :weight 5000 + :movable NIL :occupant T) ;;; TOOL ITEMS diff --git a/util.lisp b/util.lisp index baa2885..a363df0 100644 --- a/util.lisp +++ b/util.lisp @@ -198,9 +198,14 @@ "Return a random element of this sequence" (elt seq (random (length seq)))) +(defun random-offset (n max-offset) + "Return n plus a random offset" + (+ n (- (random (* 2 max-offset)) max-offset))) + (defun chancep (percent) "Do a random test, with the percentage giving the success probability" - (> percent (random 100))) + ;;Accuracy: 0.1 + (> percent (/ (random 1000) 10))) (defun load-text-file (file-name) "Load a text file into a list of strings (representing the lines)"