Merge remote-tracking branch 'pepperpow/triforce_changes' into main
This commit is contained in:
commit
2e275d1f4e
|
@ -29,6 +29,13 @@ def main():
|
||||||
''')
|
''')
|
||||||
parser.add_argument('--quickswap', help='Enable quick item swapping with L and R.', action='store_true')
|
parser.add_argument('--quickswap', help='Enable quick item swapping with L and R.', action='store_true')
|
||||||
parser.add_argument('--disablemusic', help='Disables game music.', action='store_true')
|
parser.add_argument('--disablemusic', help='Disables game music.', action='store_true')
|
||||||
|
parser.add_argument('--triforcehud', default='hide_goal', const='hide_goal', nargs='?', choices=['normal', 'hide_goal', 'hide_required', 'hide_both'],
|
||||||
|
help='''\
|
||||||
|
Hide the triforce hud in certain circumstances.
|
||||||
|
hide_goal will hide the hud until finding a triforce piece, hide_required will hide the total amount needed to win
|
||||||
|
(Both can be revealed when speaking to Murahalda)
|
||||||
|
(default: %(default)s)
|
||||||
|
''')
|
||||||
parser.add_argument('--enableflashing', help='Reenable flashing animations (unfriendly to epilepsy, always disabled in race roms)', action='store_false', dest="reduceflashing")
|
parser.add_argument('--enableflashing', help='Reenable flashing animations (unfriendly to epilepsy, always disabled in race roms)', action='store_false', dest="reduceflashing")
|
||||||
parser.add_argument('--heartbeep', default='normal', const='normal', nargs='?', choices=['double', 'normal', 'half', 'quarter', 'off'],
|
parser.add_argument('--heartbeep', default='normal', const='normal', nargs='?', choices=['double', 'normal', 'half', 'quarter', 'off'],
|
||||||
help='''\
|
help='''\
|
||||||
|
|
|
@ -251,6 +251,13 @@ def parse_arguments(argv, no_defaults=False):
|
||||||
''')
|
''')
|
||||||
parser.add_argument('--quickswap', help='Enable quick item swapping with L and R.', action='store_true')
|
parser.add_argument('--quickswap', help='Enable quick item swapping with L and R.', action='store_true')
|
||||||
parser.add_argument('--disablemusic', help='Disables game music.', action='store_true')
|
parser.add_argument('--disablemusic', help='Disables game music.', action='store_true')
|
||||||
|
parser.add_argument('--triforcehud', default='hide_goal', const='hide_goal', nargs='?', choices=['normal', 'hide_goal', 'hide_required', 'hide_both'],
|
||||||
|
help='''\
|
||||||
|
Hide the triforce hud in certain circumstances.
|
||||||
|
hide_goal will hide the hud until finding a triforce piece, hide_required will hide the total amount needed to win
|
||||||
|
(Both can be revealed when speaking to Murahalda)
|
||||||
|
(default: %(default)s)
|
||||||
|
''')
|
||||||
parser.add_argument('--enableflashing', help='Reenable flashing animations (unfriendly to epilepsy, always disabled in race roms)', action='store_false', dest="reduceflashing")
|
parser.add_argument('--enableflashing', help='Reenable flashing animations (unfriendly to epilepsy, always disabled in race roms)', action='store_false', dest="reduceflashing")
|
||||||
parser.add_argument('--mapshuffle', default=defval(False),
|
parser.add_argument('--mapshuffle', default=defval(False),
|
||||||
help='Maps are no longer restricted to their dungeons, but can be anywhere',
|
help='Maps are no longer restricted to their dungeons, but can be anywhere',
|
||||||
|
@ -413,7 +420,7 @@ def parse_arguments(argv, no_defaults=False):
|
||||||
'remote_items', 'progressive', 'dungeon_counters', 'glitch_boots', 'killable_thieves',
|
'remote_items', 'progressive', 'dungeon_counters', 'glitch_boots', 'killable_thieves',
|
||||||
'tile_shuffle', 'bush_shuffle', 'shuffle_prizes', 'sprite_pool', 'dark_room_logic',
|
'tile_shuffle', 'bush_shuffle', 'shuffle_prizes', 'sprite_pool', 'dark_room_logic',
|
||||||
'restrict_dungeon_item_on_boss', 'reduceflashing',
|
'restrict_dungeon_item_on_boss', 'reduceflashing',
|
||||||
'hud_palettes', 'sword_palettes', 'shield_palettes', 'link_palettes']:
|
'hud_palettes', 'sword_palettes', 'shield_palettes', 'link_palettes', 'triforcehud']:
|
||||||
value = getattr(defaults, name) if getattr(playerargs, name) is None else getattr(playerargs, name)
|
value = getattr(defaults, name) if getattr(playerargs, name) is None else getattr(playerargs, name)
|
||||||
if player == 1:
|
if player == 1:
|
||||||
setattr(ret, name, {1: value})
|
setattr(ret, name, {1: value})
|
||||||
|
|
|
@ -360,7 +360,7 @@ def generate_itempool(world, player: int):
|
||||||
world.clock_mode[player] = clock_mode
|
world.clock_mode[player] = clock_mode
|
||||||
|
|
||||||
if treasure_hunt_count is not None:
|
if treasure_hunt_count is not None:
|
||||||
world.treasure_hunt_count[player] = treasure_hunt_count
|
world.treasure_hunt_count[player] = treasure_hunt_count % 999
|
||||||
if treasure_hunt_icon is not None:
|
if treasure_hunt_icon is not None:
|
||||||
world.treasure_hunt_icon[player] = treasure_hunt_icon
|
world.treasure_hunt_icon[player] = treasure_hunt_icon
|
||||||
|
|
||||||
|
|
2
Main.py
2
Main.py
|
@ -289,7 +289,7 @@ def main(args, seed=None):
|
||||||
palettes_options['link']=args.link_palettes[player]
|
palettes_options['link']=args.link_palettes[player]
|
||||||
|
|
||||||
apply_rom_settings(rom, args.heartbeep[player], args.heartcolor[player], args.quickswap[player],
|
apply_rom_settings(rom, args.heartbeep[player], args.heartcolor[player], args.quickswap[player],
|
||||||
args.fastmenu[player], args.disablemusic[player], args.sprite[player],
|
args.fastmenu[player], args.disablemusic[player], args.triforcehud[player], args.sprite[player],
|
||||||
palettes_options, world, player, True, reduceflashing=args.reduceflashing[player] if not args.race else True)
|
palettes_options, world, player, True, reduceflashing=args.reduceflashing[player] if not args.race else True)
|
||||||
|
|
||||||
mcsb_name = ''
|
mcsb_name = ''
|
||||||
|
|
|
@ -693,6 +693,7 @@ def roll_settings(weights: dict, plando_options: typing.Set[str] = frozenset(("b
|
||||||
ret.sprite_pool += [key] * int(value)
|
ret.sprite_pool += [key] * int(value)
|
||||||
|
|
||||||
ret.disablemusic = get_choice('disablemusic', romweights, False)
|
ret.disablemusic = get_choice('disablemusic', romweights, False)
|
||||||
|
ret.triforcehud = get_choice('triforcehud', romweights, 'hide_goal')
|
||||||
ret.quickswap = get_choice('quickswap', romweights, True)
|
ret.quickswap = get_choice('quickswap', romweights, True)
|
||||||
ret.fastmenu = get_choice('menuspeed', romweights, "normal")
|
ret.fastmenu = get_choice('menuspeed', romweights, "normal")
|
||||||
ret.reduceflashing = get_choice('reduceflashing', romweights, False)
|
ret.reduceflashing = get_choice('reduceflashing', romweights, False)
|
||||||
|
|
10
Rom.py
10
Rom.py
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
JAP10HASH = '03a63945398191337e896e5771f77173'
|
JAP10HASH = '03a63945398191337e896e5771f77173'
|
||||||
RANDOMIZERBASEHASH = '0e845f0296a9011104041e02f58837f7'
|
RANDOMIZERBASEHASH = 'b2201c6fa50ba7a6ac42d73f37d75493'
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
|
@ -1149,8 +1149,8 @@ def patch_rom(world, rom, player, team, enemized):
|
||||||
rom.write_int32(0x18020C, 0) # starting time (in frames, sint32)
|
rom.write_int32(0x18020C, 0) # starting time (in frames, sint32)
|
||||||
|
|
||||||
# set up goals for treasure hunt
|
# set up goals for treasure hunt
|
||||||
|
rom.write_int16(0x180163, world.treasure_hunt_count[player])
|
||||||
rom.write_bytes(0x180165, [0x0E, 0x28] if world.treasure_hunt_icon[player] == 'Triforce Piece' else [0x0D, 0x28])
|
rom.write_bytes(0x180165, [0x0E, 0x28] if world.treasure_hunt_icon[player] == 'Triforce Piece' else [0x0D, 0x28])
|
||||||
rom.write_byte(0x180167, world.treasure_hunt_count[player] % 256)
|
|
||||||
rom.write_byte(0x180194, 1) # Must turn in triforced pieces (instant win not enabled)
|
rom.write_byte(0x180194, 1) # Must turn in triforced pieces (instant win not enabled)
|
||||||
|
|
||||||
rom.write_bytes(0x180213, [0x00, 0x01]) # Not a Tournament Seed
|
rom.write_bytes(0x180213, [0x00, 0x01]) # Not a Tournament Seed
|
||||||
|
@ -1671,7 +1671,7 @@ def hud_format_text(text):
|
||||||
return output[:32]
|
return output[:32]
|
||||||
|
|
||||||
|
|
||||||
def apply_rom_settings(rom, beep, color, quickswap, fastmenu, disable_music, sprite: str, palettes_options,
|
def apply_rom_settings(rom, beep, color, quickswap, fastmenu, disable_music, triforcehud, sprite: str, palettes_options,
|
||||||
world=None, player=1, allow_random_on_event=False, reduceflashing=False):
|
world=None, player=1, allow_random_on_event=False, reduceflashing=False):
|
||||||
local_random = random if not world else world.rom_seeds[player]
|
local_random = random if not world else world.rom_seeds[player]
|
||||||
|
|
||||||
|
@ -1745,6 +1745,10 @@ def apply_rom_settings(rom, beep, color, quickswap, fastmenu, disable_music, spr
|
||||||
rom.write_byte(0x6FA30, {'red': 0x24, 'blue': 0x2C, 'green': 0x3C, 'yellow': 0x28}[color])
|
rom.write_byte(0x6FA30, {'red': 0x24, 'blue': 0x2C, 'green': 0x3C, 'yellow': 0x28}[color])
|
||||||
rom.write_byte(0x65561, {'red': 0x05, 'blue': 0x0D, 'green': 0x19, 'yellow': 0x09}[color])
|
rom.write_byte(0x65561, {'red': 0x05, 'blue': 0x0D, 'green': 0x19, 'yellow': 0x09}[color])
|
||||||
|
|
||||||
|
# set triforcehud
|
||||||
|
triforce_flag = (rom.read_byte(0x180167) & 0x80) | {'normal': 0x00, 'hide_goal': 0x01, 'hide_required': 0x02, 'hide_both': 0x03}[triforcehud]
|
||||||
|
rom.write_byte(0x180167, triforce_flag)
|
||||||
|
|
||||||
if z3pr:
|
if z3pr:
|
||||||
def buildAndRandomize(option_name, mode):
|
def buildAndRandomize(option_name, mode):
|
||||||
options = {
|
options = {
|
||||||
|
|
|
@ -1602,6 +1602,37 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"triforcehud": {
|
||||||
|
"keyString": "rom.triforcehud",
|
||||||
|
"friendlyName": "Triforce Hud Options",
|
||||||
|
"description": "Hide the triforce hud in certain circumstances.",
|
||||||
|
"inputType": "range",
|
||||||
|
"subOptions": {
|
||||||
|
"normal": {
|
||||||
|
"keyString": "rom.triforcehud.normal",
|
||||||
|
"friendlyName": "Normal",
|
||||||
|
"description": "Always displays HUD as usual.",
|
||||||
|
"defaultValue": 0
|
||||||
|
},
|
||||||
|
"hide_goal": {
|
||||||
|
"keyString": "rom.triforcehud.hide_goal",
|
||||||
|
"friendlyName": "Hide Goal",
|
||||||
|
"description": "Hide Triforce Hud elements until a single triforce piece is acquired or spoken to Murahadala",
|
||||||
|
"defaultValue": 50
|
||||||
|
},
|
||||||
|
"hide_total": {
|
||||||
|
"keyString": "rom.triforcehud.hide_required",
|
||||||
|
"friendlyName": "Hide Required Total",
|
||||||
|
"description": "Hide total amount needed to win the game (unless spoken to Murahadala)",
|
||||||
|
"defaultValue": 0
|
||||||
|
},
|
||||||
|
"hide_both": {
|
||||||
|
"keyString": "rom.triforcehud.hide_both",
|
||||||
|
"friendlyName": "Hide Both",
|
||||||
|
"description": "Hide both of the above options",
|
||||||
|
"defaultValue": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
"reduceflashing": {
|
"reduceflashing": {
|
||||||
"keyString": "rom.reduceflashing",
|
"keyString": "rom.reduceflashing",
|
||||||
"friendlyName": "Full-Screen Flashing Effects",
|
"friendlyName": "Full-Screen Flashing Effects",
|
||||||
|
|
Binary file not shown.
|
@ -404,6 +404,11 @@ rom:
|
||||||
quickswap: # Enable switching items by pressing the L+R shoulder buttons
|
quickswap: # Enable switching items by pressing the L+R shoulder buttons
|
||||||
on: 50
|
on: 50
|
||||||
off: 0
|
off: 0
|
||||||
|
triforcehud: # Disable visibility of the triforce hud unless collecting a piece or speaking to Murahalda
|
||||||
|
normal: 0 # original behavior (always visible)
|
||||||
|
hide_goal: 50 # hide counter until a piece is collected or speaking to Murahalda
|
||||||
|
hide_required: 0 # Always visible, but required amount is invisible until determined by Murahalda
|
||||||
|
hide_both: 0 # Hide both under above circumstances
|
||||||
reduceflashing: # Reduces instances of flashing such as lightning attacks, weather, ether and more.
|
reduceflashing: # Reduces instances of flashing such as lightning attacks, weather, ether and more.
|
||||||
on: 50
|
on: 50
|
||||||
off: 0
|
off: 0
|
||||||
|
|
Loading…
Reference in New Issue