Skip to content

Commit

Permalink
Encode difficulties in item IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Sep 2, 2024
1 parent cb001b2 commit be2fde9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,)
Expand Down

0 comments on commit be2fde9

Please sign in to comment.