def testitem(): e = Entity( x=0, y=0, name="fleepgork", item=ItemComponent(), stackable=StackableComponent(), ) e.item.size = 10 return e
def test_rm_item__twin__qty_gt_source__raises_ValueError(em): e = Entity(name="fleeb", stackable=StackableComponent(10)) em.add_entity(e) with pytest.raises(ValueError): em.rm_item(e, 11)
def test_rm_item__no_twin__returns_None(em): e = Entity(name="fleeb", stackable=StackableComponent(10)) assert em.rm_item(e) is None
def test_rm_item__qty_lt_0_raises_ValueError(em): e = Entity(name="fleeb", stackable=StackableComponent(5)) em.add_entity(e) with pytest.raises(ValueError): em.rm_item(e, -1)
def floob5(): return Entity(item=True, x=-1, y=-1, name="floob", stackable=StackableComponent(5))
def fleeb2(): return Entity(item=True, x=-1, y=-1, name="fleeb", stackable=StackableComponent(2))
"storm drone": { "char": "x", "color": (0, 127, 0), "ai": HostileAI(), "fighter": Fighter(max_hp=1, base_ac=-20), "offense": OffenseComponent(Attack('zap', [5])), "level": Level(current_level=4, xp_given=55, difficulty=20), "energy": EnergyComponent(refill=18) }, } item_dict = { "healing vial": { "item": ItemComponent(), "stackable": StackableComponent(), "char": "!", "color": (127, 0, 255), "consumable": consumable.HealConsumable(amount=5), }, "extra healing vial": { "item": ItemComponent(), "stackable": StackableComponent(), "char": "!", "color": (127, 0, 200), "consumable": consumable.HealConsumable(amount=15), }, "poison vial": { "item": ItemComponent(),