Started instantiating NPCs
This commit is contained in:
parent
a6dbe8d1cc
commit
a5b7e8219b
|
@ -27,7 +27,7 @@ Hybrids are in effect chains of quests: do this task in order to get this precon
|
||||||
|
|
||||||
My understanding is that what Wikipedia means by a 'syntax quest' is what one would normally call a puzzle.
|
My understanding is that what Wikipedia means by a 'syntax quest' is what one would normally call a puzzle.
|
||||||
|
|
||||||
An escort quest is typically a request to take a specified non-player character safely through a dangerous area.
|
An escort quest is typically a request to take a specified non-player character safely through a dangerous area. It is thus very similar to a delivery quest, except that you are escorting a character rather than delivering an item.
|
||||||
|
|
||||||
Combo quests are not, in my opinion, particularly relevant to the sorts of game we're discussing here.
|
Combo quests are not, in my opinion, particularly relevant to the sorts of game we're discussing here.
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,7 @@ different top level goals. The following are some plausible top level goals:
|
||||||
4. **Climber**: To climb as high as possible in the social hierarchy, to become Tyrranos or Imperator;
|
4. **Climber**: To climb as high as possible in the social hierarchy, to become Tyrranos or Imperator;
|
||||||
5. **Conqueror**: To build the largest possible realm under your control;
|
5. **Conqueror**: To build the largest possible realm under your control;
|
||||||
6. **Citizen**: To build a secure and comfortable home, able to feed and protect those within it;
|
6. **Citizen**: To build a secure and comfortable home, able to feed and protect those within it;
|
||||||
|
7. **Hoarder**: To accumulate the greatest possible amount of wealth.
|
||||||
|
|
||||||
In this typology, a hero is a master soldier, and a sage a master scholar.
|
In this typology, a hero is a master soldier, and a sage a master scholar.
|
||||||
Each of these types should be capable of being 'scored' by a real function
|
Each of these types should be capable of being 'scored' by a real function
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,5 @@
|
||||||
|
{:blacksmith {:workplace :forge
|
||||||
|
:supplies #{:axe :chisel :plough :knife}
|
||||||
|
:customers #{:farmer :cook}
|
||||||
|
:min-customers
|
||||||
|
:trade :smith}}
|
|
@ -4,7 +4,8 @@
|
||||||
[mw-engine.drainage :refer [run-drainage]]
|
[mw-engine.drainage :refer [run-drainage]]
|
||||||
;;[mw-engine.flow :refer []]
|
;;[mw-engine.flow :refer []]
|
||||||
[mw-engine.heightmap :refer [apply-heightmap]]
|
[mw-engine.heightmap :refer [apply-heightmap]]
|
||||||
[mw-parser.declarative :refer [compile]]))
|
[mw-parser.declarative :refer [compile]]
|
||||||
|
[wherefore-art-thou.core :refer [*genders* generate]]))
|
||||||
|
|
||||||
(defn get-drainage-map
|
(defn get-drainage-map
|
||||||
"Given this `height-map` (a monochrome raster) and optionally this
|
"Given this `height-map` (a monochrome raster) and optionally this
|
||||||
|
@ -27,6 +28,39 @@
|
||||||
([height-map _rainfall-map]
|
([height-map _rainfall-map]
|
||||||
(get-biome-map height-map)))
|
(get-biome-map height-map)))
|
||||||
|
|
||||||
|
(def ^:dynamic *life-goals*
|
||||||
|
"TODO: This definitely doesn't belong here, and will be moved."
|
||||||
|
[:ancestor :citizen :climber :conqueror :explorer :hoarder :master])
|
||||||
|
|
||||||
|
(defn- create-npc
|
||||||
|
;; TODO: this function needs not only to create a fully formed NPC, but
|
||||||
|
;; persist them in the database being built. This is just a sketch.
|
||||||
|
[prototype]
|
||||||
|
(let [g (or (:gender prototype) (rand-nth (keys *genders*)))
|
||||||
|
p (generate g)]
|
||||||
|
(merge {:age (+ 18 (rand-int 18))
|
||||||
|
:disposition (- (rand-int 9) 4) ;; -4: surly to +4 sunny
|
||||||
|
:gender g
|
||||||
|
:goal (rand-nth *life-goals*)
|
||||||
|
:family-name (generate)
|
||||||
|
:occupation :vagrant
|
||||||
|
:personal-name p} prototype)))
|
||||||
|
|
||||||
|
(defn- populate-npcs
|
||||||
|
[prototype]
|
||||||
|
(let [family (generate)]
|
||||||
|
(into [] (map #(create-npc (assoc prototype :family-name family :occupation %))
|
||||||
|
(concat [:settler] (repeat 3 (:occupation prototype)))))))
|
||||||
|
|
||||||
|
(defn populate-cell
|
||||||
|
[world cell]
|
||||||
|
(let [npcs (case (:state cell)
|
||||||
|
:camp (populate-npcs {:world world :cell cell :occupation :nomad})
|
||||||
|
:house (populate-npcs {:world world :cell cell :occupation :farmer})
|
||||||
|
:inn (populate-npcs {:world world :cell cell :occupation :innkeeper}))]
|
||||||
|
(if npcs (assoc cell :npcs npcs)
|
||||||
|
cell)))
|
||||||
|
|
||||||
(defn populate-world
|
(defn populate-world
|
||||||
"Given this `biome-map` (as returned by `get-biome-map`), populate a world
|
"Given this `biome-map` (as returned by `get-biome-map`), populate a world
|
||||||
(probably some form of database) and return a structure which allows that
|
(probably some form of database) and return a structure which allows that
|
||||||
|
@ -47,7 +81,9 @@
|
||||||
;; what I return at the end of this is a structure which contains keys
|
;; what I return at the end of this is a structure which contains keys
|
||||||
;; to a database I've stored all the NPCs in, and a (vector) roadmap of
|
;; to a database I've stored all the NPCs in, and a (vector) roadmap of
|
||||||
;; all the roads that have been created, and a (vector) drainage map.
|
;; all the roads that have been created, and a (vector) drainage map.
|
||||||
{:world world}))
|
|
||||||
|
{:world (map #(populate-cell world %) world)
|
||||||
|
:roadmap []}))
|
||||||
|
|
||||||
(defn get-road-map
|
(defn get-road-map
|
||||||
[populated-world])
|
[populated-world])
|
||||||
|
|
Loading…
Reference in a new issue