f57db9d7ccff

Entity names.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 18 Jul 2012 17:42:43 -0400
parents ae4e6a9fa906
children 6e92c8d8ddac
branches/tags (none)
files src/caves/entities/aspects/attacker.clj src/caves/entities/bunny.clj src/caves/entities/lichen.clj src/caves/entities/player.clj src/caves/entities/silverfish.clj

Changes

--- a/src/caves/entities/aspects/attacker.clj	Wed Jul 18 17:37:46 2012 -0400
+++ b/src/caves/entities/aspects/attacker.clj	Wed Jul 18 17:42:43 2012 -0400
@@ -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)))
 
--- a/src/caves/entities/bunny.clj	Wed Jul 18 17:37:46 2012 -0400
+++ b/src/caves/entities/bunny.clj	Wed Jul 18 17:42:43 2012 -0400
@@ -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
--- a/src/caves/entities/lichen.clj	Wed Jul 18 17:37:46 2012 -0400
+++ b/src/caves/entities/lichen.clj	Wed Jul 18 17:42:43 2012 -0400
@@ -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
--- a/src/caves/entities/player.clj	Wed Jul 18 17:37:46 2012 -0400
+++ b/src/caves/entities/player.clj	Wed Jul 18 17:42:43 2012 -0400
@@ -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
--- a/src/caves/entities/silverfish.clj	Wed Jul 18 17:37:46 2012 -0400
+++ b/src/caves/entities/silverfish.clj	Wed Jul 18 17:42:43 2012 -0400
@@ -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