953716e02c5d ldjam

Fix the fuckin bugs
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 14 Dec 2015 21:44:48 +0000
parents eadab01ee37f
children b626cfde428a
branches/tags ldjam
files project.clj src/silt/core.clj

Changes

--- a/project.clj	Mon Dec 14 21:18:33 2015 +0000
+++ b/project.clj	Mon Dec 14 21:44:48 2015 +0000
@@ -1,4 +1,4 @@
-(defproject silt "0.4.0"
+(defproject silt "0.5.0"
   :description "You are the god of a toroidal world."
   :url "http://bitbucket.org/sjl/silt"
   :license {:name "MIT/X11"}
--- a/src/silt/core.clj	Mon Dec 14 21:18:33 2015 +0000
+++ b/src/silt/core.clj	Mon Dec 14 21:44:48 2015 +0000
@@ -221,37 +221,37 @@
                 (let [dest (normalize-world-coords [(inc x) y])]
                   (alter landmarks dissoc loc)
                   (alter landmarks assoc dest (assoc self :loc dest)))))}
+           {:name :sunstone :loc (random-coord)
+            :glyph "O" :styles {:fg :yellow :bg :white}
+            :description "A glowing stone embedded in a rock pulses gently."
+            :action
+            (fn [{[x y :as self-loc] :loc :as self}]
+              (when (= 10000 (rem @day 50000))
+                (when-let [{:keys [loc]} (rand-nth (vals @animals))]
+                  (alter animals assoc-in [loc :directions]
+                         [[[-1 -1] 1] [[0 -1] 1] [[1 -1] 30]
+                          [[-1  0] 1] [[0  0] 0] [[1  0] 30]
+                          [[-1  1] 1] [[0  1] 1] [[1  1] 30]])
+                  (alter landmarks update-in [self-loc :styles] flip-colors))))}
            {:name :amunet :loc (random-coord)
             :glyph "ß" :styles {:fg :yellow :bg :white}
             :description "A sandstone monument to Amunet."
             :action
             (fn [{[x y :as self-loc] :loc :as self}]
-              (when (= 4000 (rem @day 5000))
-                (let [{:keys [loc]} (rand-nth (vals @animals))]
+              (when (= 20000 (rem @day 50000))
+                (when-let [{:keys [loc]} (rand-nth (vals @animals))]
                   (alter animals assoc-in [loc :directions]
                          [[[-1 -1] 30] [[0 -1] 1] [[1 -1] 1]
                           [[-1  0] 30] [[0  0] 0] [[1  0] 1]
                           [[-1  1] 30] [[0  1] 1] [[1  1] 1]])
                   (alter landmarks update-in [self-loc :styles] flip-colors))))}
-           {:name :sunstone :loc (random-coord)
-            :glyph "O" :styles {:fg :yellow :bg :white}
-            :description "A glowing stone embedded in a rock pulses gently."
-            :action
-            (fn [{[x y :as self-loc] :loc :as self}]
-              (when (= 1000 (rem @day 5000))
-                (let [{:keys [loc]} (rand-nth (vals @animals))]
-                  (alter animals assoc-in [loc :directions]
-                         [[[-1 -1] 1] [[0 -1] 1] [[1 -1] 30]
-                          [[-1  0] 1] [[0  0] 0] [[1  0] 30]
-                          [[-1  1] 1] [[0  1] 1] [[1  1] 30]])
-                  (alter landmarks update-in [self-loc :styles] flip-colors))))}
            {:name :magnet :loc (random-coord)
             :glyph "M" :styles {:fg :red :bg :white}
             :description "A strange force tugs your blood to the north."
             :action
             (fn [{[x y :as self-loc] :loc :as self}]
-              (when (= 2000 (rem @day 5000))
-                (let [{:keys [loc]} (rand-nth (vals @animals))]
+              (when (= 30000 (rem @day 50000))
+                (when-let [{:keys [loc]} (rand-nth (vals @animals))]
                   (alter animals assoc-in [loc :directions]
                          [[[-1 -1] 30] [[0 -1] 30] [[1 -1] 30]
                           [[-1  0] 1] [[0  0] 0] [[1  0] 1]
@@ -262,8 +262,8 @@
             :description "A single feather lies peacefully on the ground."
             :action
             (fn [{[x y :as self-loc] :loc :as self}]
-              (when (= 3000 (rem @day 5000))
-                (let [{:keys [loc]} (rand-nth (vals @animals))]
+              (when (= 40000 (rem @day 50000))
+                (when-let [{:keys [loc]} (rand-nth (vals @animals))]
                   (alter animals assoc-in [loc :directions]
                          [[[-1 -1] 1] [[0 -1] 1] [[1 -1] 1]
                           [[-1  0] 1] [[0  0] 0] [[1  0] 1]