From be2fde98b86f7e15f3199cc9f8151ba90c61e4c7 Mon Sep 17 00:00:00 2001 From: lil David <1337lilDavid@gmail.com> Date: Sun, 1 Sep 2024 22:00:28 -0500 Subject: [PATCH] Encode difficulties in item IDs --- locations.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locations.py b/locations.py index b003fa291b3e..c64c98a7cf35 100644 --- a/locations.py +++ b/locations.py @@ -27,7 +27,10 @@ def level_id(self): def to_ap_id(self): passage, level, flag = self.status_bit - return ap_id_offset + ((passage * 6 + level) << 5) + flag.bit_length() + return (ap_id_offset + + ((passage * 6 + level) << 8) + + sum(1 << difficulty << 5 for difficulty in self.difficulties) + + flag.bit_length()) _NORMAL = (Difficulty.option_normal,)