diff --git a/components/item/consumable.py b/components/item/consumable.py index 4c0e367..21a09f7 100644 --- a/components/item/consumable.py +++ b/components/item/consumable.py @@ -1,3 +1,3 @@ class ConsumableComponent(): def __init__(self, effects): - self.effects = {} if effects is True else effects # type: a dict of effects \ No newline at end of file + self.effects = {} if effects is None else effects # type: a dict of effects \ No newline at end of file diff --git a/data/consumables.json b/data/consumables.json index d70203f..27c7499 100644 --- a/data/consumables.json +++ b/data/consumables.json @@ -7,7 +7,7 @@ { "archtype": "item", - "consumable": true, + "consumable": null, "name": {"name": "Soul Jar"}, "render": {"char": "!", "color": "con_jar"} } diff --git a/processors/combat.py b/processors/combat.py index 7d4e77d..79c7880 100644 --- a/processors/combat.py +++ b/processors/combat.py @@ -53,6 +53,8 @@ def process(self): if damage > 0: self.world.component_for_entity(defender_ID, StatsComponent).hp -= damage + else: + damage = 0 if def_stats['hp'] <= 0: self.world.get_processor(DeathProcessor).queue.put({'ent': defender_ID})