Death improvements.
authorNeil Moore <neil@s-z.org>
Sat, 31 May 2008 11:47:11 +0000 (07:47 -0400)
committerNeil Moore <neil@s-z.org>
Sat, 31 May 2008 11:47:11 +0000 (07:47 -0400)
New material: flesh.

New item: corpse.

When a creature dies, drop its inventory and a corpse.

creature.py
items/items.itm
materials/materials.mtl

index d8378cb..4370b7a 100644 (file)
@@ -97,7 +97,11 @@ class Creature(thing.Thing):
 
     def die(self, cause):
         self.dead = cause
+        loc = self.location
         self.place(None)
+        for item in self.inv:
+            item.place(loc)
+        thing.ItemClass("corpse")().place(loc)
 
     def can_swim(self):
         return False
index 2d38872..0e2c42c 100644 (file)
@@ -3,6 +3,11 @@ gem {
        material: glass,
 },
 
+corpse {
+       ascii: "%",
+       material: flesh,
+},
+
 money {
        ascii: "$",
 },
index 3e531c1..09bd4a1 100644 (file)
@@ -11,3 +11,5 @@ gold (golden): color=Yellow
 stone: color=Gray
 
 lapis: color=BrightBlue
+
+flesh: color=Red