Init work on decoupling doors

This commit is contained in:
aerinon
2022-05-24 11:29:41 -06:00
parent ac651253fe
commit 14571508ae
13 changed files with 916 additions and 33 deletions

View File

@@ -142,6 +142,7 @@ class World(object):
set_player_attr('collection_rate', False)
set_player_attr('colorizepots', False)
set_player_attr('pot_pool', {})
set_player_attr('decoupledoors', False)
set_player_attr('shopsanity', False)
set_player_attr('mixed_travel', 'prevent')
@@ -2462,6 +2463,7 @@ class Spoiler(object):
'shufflelinks': self.world.shufflelinks,
'door_shuffle': self.world.doorShuffle,
'intensity': self.world.intensity,
'decoupledoors': self.world.decoupledoors,
'item_pool': self.world.difficulty,
'item_functionality': self.world.difficulty_adjustments,
'gt_crystals': self.world.crystals_needed_for_gt,
@@ -2544,6 +2546,7 @@ class Spoiler(object):
outfile.write(f"Link's House Shuffled: {yn(self.metadata['shufflelinks'])}\n")
outfile.write('Door Shuffle: %s\n' % self.metadata['door_shuffle'][player])
outfile.write('Intensity: %s\n' % self.metadata['intensity'][player])
outfile.write(f"Decouple Doors: {yn(self.metadata['decoupledoors'][player])}\n")
outfile.write(f"Drop Shuffle: {yn(self.metadata['dropshuffle'][player])}\n")
outfile.write(f"Pottery Mode: {self.metadata['pottery'][player]}\n")
outfile.write(f"Pot Shuffle (Legacy): {yn(self.metadata['potshuffle'][player])}\n")
@@ -2759,7 +2762,7 @@ goal_mode = {'ganon': 0, 'pedestal': 1, 'dungeons': 2, 'triforcehunt': 3, 'cryst
diff_mode = {"normal": 0, "hard": 1, "expert": 2}
func_mode = {"normal": 0, "hard": 1, "expert": 2}
# byte 3: S?MM PIII (shop, unused, mixed, palettes, intensity)
# byte 3: SDMM PIII (shop, decouple doors, mixed, palettes, intensity)
# keydrop now has it's own byte
mixed_travel_mode = {"prevent": 0, "allow": 1, "force": 2}
# intensity is 3 bits (reserves 4-7 levels)
@@ -2813,7 +2816,8 @@ class Settings(object):
(goal_mode[w.goal[p]] << 5) | (diff_mode[w.difficulty[p]] << 3)
| (func_mode[w.difficulty_adjustments[p]] << 1) | (1 if w.hints[p] else 0),
(0x80 if w.shopsanity[p] else 0) | (mixed_travel_mode[w.mixed_travel[p]] << 4)
(0x80 if w.shopsanity[p] else 0) | (0x40 if w.decoupledoors[p] else 0)
| (mixed_travel_mode[w.mixed_travel[p]] << 4)
| (0x8 if w.standardize_palettes[p] == "original" else 0)
| (0 if w.intensity[p] == "random" else w.intensity[p]),
@@ -2861,7 +2865,7 @@ class Settings(object):
args.retro[p] = True if settings[1] & 0x01 else False
args.hints[p] = True if settings[2] & 0x01 else False
args.shopsanity[p] = True if settings[3] & 0x80 else False
# args.keydropshuffle[p] = True if settings[3] & 0x40 else False
args.decoupledoors[p] = True if settings[3] & 0x40 else False
args.mixed_travel[p] = r(mixed_travel_mode)[(settings[3] & 0x30) >> 4]
args.standardize_palettes[p] = "original" if settings[3] & 0x8 else "standardize"
intensity = settings[3] & 0x7