Permalink
Browse files

Entity names.

  • Loading branch information...
1 parent e8f3577 commit 8607f685e44dc884f2a965f4edefcf9f7fe1e805 @sjl committed Jul 18, 2012
@@ -14,9 +14,9 @@
(->> world
(take-damage target damage)
(send-message this "You strike the %s for %d damage!"
- [(:glyph target) damage])
+ [(:name target) damage])
(send-message target "The %s strikes you for %d damage!"
- [(:glyph target) damage]))))
+ [(:name target) damage]))))
(attack-value [this world]
(get this :attack 1)))
@@ -5,10 +5,11 @@
[caves.world :only [find-empty-neighbor]]))
-(defrecord Bunny [id glyph color location hp max-hp])
+(defrecord Bunny [id glyph color location hp max-hp name])
(defn make-bunny [location]
(map->Bunny {:id (get-id)
+ :name "bunny"
:glyph "v"
:color :yellow
:location location
@@ -5,10 +5,11 @@
[caves.world :only [find-empty-neighbor]]))
-(defrecord Lichen [id glyph color location hp max-hp])
+(defrecord Lichen [id glyph color location hp max-hp name])
(defn make-lichen [location]
(map->Lichen {:id (get-id)
+ :name "lichen"
:glyph "F"
:color :green
:location location
@@ -9,7 +9,7 @@
[caves.world :only [get-entity-at]]))
-(defrecord Player [id glyph color location hp max-hp attack])
+(defrecord Player [id glyph color location hp max-hp attack name])
(extend-type Player Entity
(tick [this world]
@@ -23,6 +23,7 @@
(defn make-player [location]
(map->Player {:id :player
+ :name "player"
:glyph "@"
:color :white
:location location
@@ -6,10 +6,11 @@
[caves.coords :only [neighbors]]))
-(defrecord Silverfish [id glyph color location hp max-hp])
+(defrecord Silverfish [id glyph color location hp max-hp name])
(defn make-silverfish [location]
(map->Silverfish {:id (get-id)
+ :name "silverfish"
:glyph "~"
:color :white
:location location

0 comments on commit 8607f68

Please sign in to comment.