Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion area_reader/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class FORMS(enum.IntFlag):
EDIBLE = BITFLAGS['A']
POISON = BITFLAGS['B']
MAGICAL = BITFLAGS['C']
INSTANT_DECAY = BITFLAGS['D']
OTHER = BITFLAGS['E'] # defined by material bit
UNUSED1 = enum.auto()
# actual form
Expand Down Expand Up @@ -284,7 +285,8 @@ class WEAR_LOCATIONS(enum.Enum):
SHIELD = 11
ABOUT = 12
WAIST = 13
RIST_L = 14
WRIST_L = 14
RIST_L = 14 # deprecated alias for WRIST_L (historical typo)
WRIST_R = 15
WIELD = 16
HOLD = 17
Expand Down
16 changes: 16 additions & 0 deletions test_area_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ def test_dice_roll_negative_sides_rolls_one_per_die():
assert area_reader.Dice(number=3, sides=-4, bonus=2).roll() == 5


def test_forms_instant_decay_is_bit_d():
from area_reader.constants import FORMS

assert FORMS.INSTANT_DECAY.value == 8
assert FORMS(8) is FORMS.INSTANT_DECAY
assert FORMS(12) == FORMS.MAGICAL | FORMS.INSTANT_DECAY
assert FORMS.OTHER.value == 16


def test_wear_location_wrist_l_named_with_alias():
from area_reader.constants import WEAR_LOCATIONS

assert WEAR_LOCATIONS(14) is WEAR_LOCATIONS.WRIST_L
assert WEAR_LOCATIONS.RIST_L is WEAR_LOCATIONS.WRIST_L


reset_command = st.sampled_from(["M", "O", "P", "G", "E", "D", "R"])
small_int = st.integers(min_value=0, max_value=9999)
rom_source_dir = Path(r"C:\Users\Q\src\Rom24b6\area")
Expand Down