From: Simon Cross Date: Sat, 5 Mar 2016 19:20:17 +0000 (+0200) Subject: Gain items. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=685bc607ffc97579ab5522e9c799ee0eef334777;p=koperkapel.git Gain items. --- diff --git a/koperkapel/gamelib/items.py b/koperkapel/gamelib/items.py index 9ef2ff6..af66dd9 100644 --- a/koperkapel/gamelib/items.py +++ b/koperkapel/gamelib/items.py @@ -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