Gain items.
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 19:20:17 +0000 (21:20 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 19:20:17 +0000 (21:20 +0200)
koperkapel/gamelib/items.py

index 9ef2ff61fbb51369f7aeb040a3018021be61f95f..af66dd991e194f5abfa73540c7cf9a02c1b720b4 100644 (file)
@@ -14,7 +14,7 @@ def build_weapon(item):
     return actor
 
 
-ITEM_TYPES = {
+ITEM_BUILDERS = {
     "serum": build_serum,
     "weapon": build_weapon,
 }
@@ -23,7 +23,9 @@ ITEM_TYPES = {
 def get_item(item):
     item_type = item.pop("type")
     game_pos = tuple(item.pop("pos"))
-    actor = ITEM_TYPES[item_type](item)
+    actor = ITEM_BUILDERS[item_type](item)
+    actor.item_type = item_type
+    actor.item_data = item
     actor.game_pos = game_pos
     actor.anchor = (0, 0)
     return actor