d61f3224d0dc

Moar flavor
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 08 Jan 2017 14:14:28 +0000
parents ea80c30bf217
children 15a44ba697c4
branches/tags (none)
files data/animals.lisp data/vegetables.lisp src/entities/food.lisp src/flavor.lisp

Changes

--- a/data/animals.lisp	Sun Jan 08 14:00:57 2017 +0000
+++ b/data/animals.lisp	Sun Jan 08 14:14:28 2017 +0000
@@ -38,7 +38,6 @@
  "an ewe"
  "a ferret"
  "a finch"
- "a fish"
  "a fox"
  "a frog"
  "a gazelle"
--- a/data/vegetables.lisp	Sun Jan 08 14:00:57 2017 +0000
+++ b/data/vegetables.lisp	Sun Jan 08 14:14:28 2017 +0000
@@ -36,7 +36,7 @@
   "green peppers"
   "horseradish"
   "hubbard squash"
-  "pickled jalapenos"
+  "jalapenos"
   "kale"
   "kidney beans"
   "kohlrabi"
--- a/src/entities/food.lisp	Sun Jan 08 14:00:57 2017 +0000
+++ b/src/entities/food.lisp	Sun Jan 08 14:14:28 2017 +0000
@@ -5,6 +5,29 @@
                (read-file-into-form "data/vegetables.lisp")
                (read-file-into-form "data/meat.lisp")))
 
+(defparameter *containers*
+  #(("can"                "")
+    ("can"                "preserved ")
+    ("can"                "old ")
+    ("can"                "pickled ")
+    ("tin"                "")
+    ("package"            "")
+    ("shrink-wrapped bag" "")
+    ("vacuum-sealed bag"  "")
+    ("jar"                "")
+    ("jar"                "preserved ")
+    ("jar"                "pickled ")
+    ("ration"             "")
+    ("box"                "dried ")
+    ("box"                "dehydrated ")
+    ("bag"                "dried ")
+    ("bag"                "dehydrated ")
+    ("carton"             "dried ")
+    ("carton"             "dehydrated ")
+    ("bottle"             "slurried ")
+    ("jug"                "slurried ")
+    ))
+
 (defparameter *tastes*
   #("a bit rotten"
     "a bit strange"
@@ -42,9 +65,12 @@
   (random-range 30.0 80.0))
 
 (defun random-food-description ()
-  (format nil "a ~A of ~A"
-          (random-elt #("can" "tin" "package"))
-          (random-elt *foods*)))
+  (destructuring-bind (container prefix)
+      (random-elt *containers*)
+    (format nil "a ~A of ~A~A"
+            container
+            prefix
+            (random-elt *foods*))))
 
 (defun random-food-taste ()
   (format nil "It tastes ~A."
--- a/src/flavor.lisp	Sun Jan 08 14:00:57 2017 +0000
+++ b/src/flavor.lisp	Sun Jan 08 14:14:28 2017 +0000
@@ -16,7 +16,7 @@
           (random-elt *animals*)
           (random-elt #("in the distance"
                         "out of the corner of your eye"
-                        "running north"))
+                        "heading north"))
           (random-elt #("A fellow traveler."
                         "It eyes you warily."
                         "She seems tired."