コード例 #1
0
ファイル: tests.py プロジェクト: wrekklol/soulstruct
def HasItem(item: ItemTyping, condition, negate=False):
    try:
        item_type = item.item_enum
    except AttributeError:
        raise ValueError(
            "Can only use auto-detecting HasItem() on declared item types (Weapon, Armor, Ring, Good)."
        )
    return instr.IfPlayerItemStateNoBox(condition, item_type, item, not negate)
コード例 #2
0
ファイル: tests.py プロジェクト: Tbeck-91/soulstruct
def HasGood(good: Good, condition, negate=False):
    return instr.IfPlayerItemStateNoBox(condition, ItemType.Good, good, not negate)
コード例 #3
0
ファイル: tests.py プロジェクト: Tbeck-91/soulstruct
def HasRing(ring: Ring, condition, negate=False):
    return instr.IfPlayerItemStateNoBox(condition, ItemType.Ring, ring, not negate)
コード例 #4
0
ファイル: tests.py プロジェクト: Tbeck-91/soulstruct
def HasArmor(armor: Armor, condition, negate=False):
    return instr.IfPlayerItemStateNoBox(condition, ItemType.Armor, armor, not negate)
コード例 #5
0
ファイル: tests.py プロジェクト: Tbeck-91/soulstruct
def HasWeapon(weapon: Weapon, condition, negate=False):
    return instr.IfPlayerItemStateNoBox(condition, ItemType.Weapon, weapon, not negate)