def OwnsItem(item: ItemTyping, condition, negate=False): try: item_type = item.type except AttributeError: raise ValueError( "Can only use OwnsItem() on declared item types (Weapon, Armor, Ring, Good)." ) return instr.IfPlayerItemStateBox(condition, item_type, item, not negate)
def OwnsGood(good: Good, condition, negate=False): return instr.IfPlayerItemStateBox(condition, ItemType.Good, good, not negate)
def OwnsRing(ring: Ring, condition, negate=False): return instr.IfPlayerItemStateBox(condition, ItemType.Ring, ring, not negate)
def OwnsArmor(armor: Armor, condition, negate=False): return instr.IfPlayerItemStateBox(condition, ItemType.Armor, armor, not negate)
def OwnsWeapon(weapon: Weapon, condition, negate=False): return instr.IfPlayerItemStateBox(condition, ItemType.Weapon, weapon, not negate)