Individual settings: logic

This commit is contained in:
Bonta-kun 2019-12-16 13:26:07 +01:00
parent b695d3573e
commit 79786c7c9e
6 changed files with 9 additions and 7 deletions

View File

@ -11,7 +11,7 @@ class World(object):
def __init__(self, players, shuffle, logic, mode, swords, difficulty, difficulty_adjustments, timer, progressive, goal, algorithm, accessibility, shuffle_ganon, quickswap, fastmenu, disable_music, retro, custom, customitemarray, boss_shuffle, hints):
self.players = players
self.shuffle = shuffle
self.logic = logic
self.logic = logic.copy()
self.mode = mode
self.swords = swords
self.difficulty = difficulty

View File

@ -285,6 +285,8 @@ def parse_arguments(argv, no_defaults=False):
else:
getattr(ret, name)[player] = value
set_player_arg("logic")
return ret
def start():

View File

@ -188,7 +188,7 @@ def main(args, seed=None):
apply_rom_settings(rom, args.heartbeep, args.heartcolor, world.quickswap, world.fastmenu, world.disable_music, sprite, player_names)
outfilesuffix = ('%s%s_%s_%s-%s-%s-%s%s_%s-%s%s%s%s%s' % (f'_P{player}' if world.players > 1 else '',
f'_{player_names[player]}' if player in player_names else '',
world.logic, world.difficulty, world.difficulty_adjustments,
world.logic[player], world.difficulty, world.difficulty_adjustments,
world.mode, world.goal,
"" if world.timer in ['none', 'display'] else "-" + world.timer,
world.shuffle, world.algorithm, mcsb_name,

View File

@ -119,7 +119,7 @@ def fill_world(world, plando, text_patches):
world.mode = modestr.strip()
elif line.startswith('!logic'):
_, logicstr = line.split(':', 1)
world.logic = logicstr.strip()
world.logic = {1: logicstr.strip()}
elif line.startswith('!goal'):
_, goalstr = line.split(':', 1)
world.goal = goalstr.strip()

2
Rom.py
View File

@ -1014,7 +1014,7 @@ def patch_rom(world, player, rom, enemized):
rom.write_byte(0x180020, digging_game_rng)
rom.write_byte(0xEFD95, digging_game_rng)
rom.write_byte(0x1800A3, 0x01) # enable correct world setting behaviour after agahnim kills
rom.write_byte(0x1800A4, 0x01 if world.logic != 'nologic' else 0x00) # enable POD EG fix
rom.write_byte(0x1800A4, 0x01 if world.logic[player] != 'nologic' else 0x00) # enable POD EG fix
rom.write_byte(0x180042, 0x01 if world.save_and_quit_from_boss else 0x00) # Allow Save and Quit after boss kill
# remove shield from uncle

View File

@ -5,7 +5,7 @@ from BaseClasses import CollectionState
def set_rules(world, player):
if world.logic == 'nologic':
if world.logic[player] == 'nologic':
logging.getLogger('').info('WARNING! Seeds generated under this logic often require major glitches and may be impossible!')
if world.mode != 'inverted':
world.get_region('Links House', player).can_reach_private = lambda state: True
@ -35,9 +35,9 @@ def set_rules(world, player):
else:
raise NotImplementedError('Not implemented yet')
if world.logic == 'noglitches':
if world.logic[player] == 'noglitches':
no_glitches_rules(world, player)
elif world.logic == 'minorglitches':
elif world.logic[player] == 'minorglitches':
logging.getLogger('').info('Minor Glitches may be buggy still. No guarantee for proper logic checks.')
else:
raise NotImplementedError('Not implemented yet')