Skip to content

Commit

Permalink
Add gen-peep-decisions so we get some peep preferences in decision-…
Browse files Browse the repository at this point in the history
…making
  • Loading branch information
Folcon committed Feb 10, 2022
1 parent 70ec4e7 commit 185d49f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/fruit_economy/civ.clj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
(when ancestor
{::ancestor ancestor}))))

(defn gen-peep-decisions []
(into []
(comp (map (fn [decision]
(repeat (roll 8) decision)))
cat)
[:claim :develop :gather :grow]))

(defn peep-on-tick [{id :db/id :keys [area decisions planned-decision] :as peep} world-db]
(println :peep-on-tick)
(let [[x y] area dir-x (rand-nth [-1 0 1]) dir-y (rand-nth [-1 0 1])
Expand All @@ -67,7 +74,7 @@
:glyph "🧑"
:area [x y]
:on-tick #'peep-on-tick
:decisions [:claim :develop :gather :grow]})
:decisions (gen-peep-decisions)})

(defn spawn-civ [{::land/keys [name terrain curr-civ-id civ-letters lang] :as land-data} x y {:keys [parent]}]
(if (seq civ-letters)
Expand Down

0 comments on commit 185d49f

Please sign in to comment.