53 Commits

Author SHA1 Message Date
a019fa6478 romname starts with GK 2026-01-25 13:16:35 -06:00
a51be12a4a More romname fixes 2026-01-25 10:34:37 -06:00
9e5db19c73 Change order of parts in rom name for compatibility with webmulti 2026-01-25 10:11:10 -06:00
640a5bc3a7 Log exception trace on failed generation attempts 2026-01-24 22:16:47 -06:00
c946981c38 isort 2026-01-24 22:09:56 -06:00
9733da9f44 Always include team number in rom name 2026-01-24 21:59:11 -06:00
a3f67a39ab Version/romnaming refactor 2026-01-24 20:51:48 -06:00
1d4c5f1884 .gitattributes 2026-01-24 13:56:09 -06:00
a8dc25e59d Remove unnecessary references to data/base2current.json 2026-01-24 13:47:53 -06:00
0f7253c94e Reduce tier of triforce pieces when goal is high 2026-01-23 21:41:45 -06:00
ddda8aeddf Guarantee a bee for sale 2026-01-23 18:56:20 -06:00
ae1744f0dd Update baserom 2026-01-21 19:47:43 -06:00
f2d07c98b7 Update baserom - kak music bug 2026-01-21 18:26:04 -06:00
67307a872c Bosshunt mode 2026-01-21 08:20:59 -06:00
3255c75828 Update baserom 2026-01-19 13:37:08 -06:00
9db2a3b64b Update baserom 2026-01-18 16:57:23 -06:00
d424505677 Add attempt number to failure messages 2026-01-18 00:39:53 -06:00
2a7141d24e Update baserom 2026-01-17 13:57:09 -06:00
80a64b884e Update baserom 2026-01-17 13:31:10 -06:00
5e0deadf55 showmap option 2026-01-17 12:54:17 -06:00
dd98e55d36 Move dungeon balancing message to debug level 2026-01-16 17:55:45 -06:00
6c8a8e18e0 Add --tries arg 2026-01-16 16:43:12 -06:00
e058fd1961 Update baserom 2026-01-16 14:38:16 -06:00
bfd791fc87 Update baserom 2026-01-16 12:28:40 -06:00
b10c700836 Tweak loot/map values slightly 2026-01-15 19:03:51 -06:00
f5d5860af0 Update baserom 2026-01-15 13:52:41 -06:00
da0cef6dfe Update baserom 2026-01-15 13:47:20 -06:00
36eb171d24 Merge branch 'GwaaKiwi' into DungeonMap 2026-01-15 04:08:13 -06:00
2ce245c430 Update baserom 2026-01-14 18:23:10 -06:00
e8bc0d81c4 Update baserom 2026-01-14 13:10:48 -06:00
5f66483d98 Update baserom 2026-01-14 11:33:53 -06:00
30e85c1256 Update baserom 2026-01-13 19:45:10 -06:00
402c9a5f76 Update baserom 2026-01-13 18:58:30 -06:00
34b5dfb4e8 Update baserom 2026-01-13 11:01:07 -06:00
54e73c0b99 Update baserom 2026-01-13 09:34:46 -06:00
affa210802 Update baserom 2026-01-13 00:34:45 -06:00
ea62a5bcb7 Update baserom, write better doors map flags 2026-01-13 00:27:27 -06:00
bd5fd9ec56 Update baserom, fix freezor chest? 2026-01-10 14:53:58 -06:00
8df39da2bd Add showloot setting 2026-01-08 08:18:27 -06:00
9b98f59292 Update baserom 2026-01-07 20:57:12 -06:00
870d981eab Update baserom 2026-01-06 22:40:41 -06:00
a895fe158b Update baserom (should fix bad floor ids messing things up in doors) 2026-01-06 10:43:30 -06:00
409c6d9a4e Update baserom 2026-01-04 23:04:09 -06:00
42b4374bd3 Initial pass at door shuffle dungeon maps 2026-01-04 14:24:29 -06:00
74739347e7 Update baserom 2026-01-04 12:58:18 -06:00
c94d556c4b Baserom update 2026-01-04 12:26:50 -06:00
2195adca64 Add HC and AT compass if pots or enemies are shuffled 2026-01-04 09:44:29 -06:00
e5ad81861a Update baserom 2026-01-04 09:19:05 -06:00
5418dbfb88 Update baserom, set item loot levels for crystals, pendants, and bomb bag 2026-01-04 07:17:24 -06:00
507f4170c8 Update Baserom and write loot bits 2026-01-03 23:19:51 -06:00
b038ee6cbe Update baserom 2026-01-03 17:33:34 -06:00
2d91647794 Update baserom 2026-01-03 17:28:56 -06:00
7d95405252 Update baserom 2026-01-03 17:17:11 -06:00
4 changed files with 34 additions and 18 deletions

4
Rom.py
View File

@@ -2788,7 +2788,7 @@ def write_strings(rom, world, player, team):
tt['sign_ganon'] = 'Three ways to victory! %s Get to it!' % trinity_crystal_text tt['sign_ganon'] = 'Three ways to victory! %s Get to it!' % trinity_crystal_text
tt['murahdahla'] = "Hello @. I\nam Murahdahla, brother of\nSahasrahla and Aginah. Behold the power of\ninvisibility.\n\n\n\n… … …\n\nWait! You can see me? I knew I should have\nhidden in a hollow tree. If you bring\n%d triforce pieces, I can reassemble it." % int(world.treasure_hunt_count[player]) tt['murahdahla'] = "Hello @. I\nam Murahdahla, brother of\nSahasrahla and Aginah. Behold the power of\ninvisibility.\n\n\n\n… … …\n\nWait! You can see me? I knew I should have\nhidden in a hollow tree. If you bring\n%d triforce pieces, I can reassemble it." % int(world.treasure_hunt_count[player])
elif world.goal[player] == 'ganonhunt': elif world.goal[player] == 'ganonhunt':
tt['sign_ganon'] = 'Go find the Triforce pieces to beat Ganon.' tt['sign_ganon'] = 'Go find the Triforce pieces to beat Ganon'
elif world.goal[player] == 'bosshunt': elif world.goal[player] == 'bosshunt':
bosshunt_count = '%d guardian%s of %sdungeons' % \ bosshunt_count = '%d guardian%s of %sdungeons' % \
(world.bosses_ganon[player], (world.bosses_ganon[player],
@@ -2796,7 +2796,7 @@ def write_strings(rom, world, player, team):
'' if world.bosshunt_include_agas[player] else 'prize ') '' if world.bosshunt_include_agas[player] else 'prize ')
tt['sign_ganon'] = 'To beat Ganon you must defeat %s.' % bosshunt_count tt['sign_ganon'] = 'To beat Ganon you must defeat %s.' % bosshunt_count
elif world.goal[player] == 'completionist': elif world.goal[player] == 'completionist':
tt['sign_ganon'] = 'Ganon only respects those who have done everything.' tt['sign_ganon'] = 'Ganon only respects those who have done everything'
tt['ganon_fall_in'] = Ganon1_texts[random.randint(0, len(Ganon1_texts) - 1)] tt['ganon_fall_in'] = Ganon1_texts[random.randint(0, len(Ganon1_texts) - 1)]
tt['ganon_fall_in_alt'] = 'You cannot defeat me until you finish your goal!' tt['ganon_fall_in_alt'] = 'You cannot defeat me until you finish your goal!'
tt['ganon_phase_3_alt'] = 'Got wax in\nyour ears?\nI can not die!' tt['ganon_phase_3_alt'] = 'Got wax in\nyour ears?\nI can not die!'

View File

@@ -8,7 +8,6 @@ import urllib.parse
import urllib.request import urllib.request
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from collections import defaultdict from collections import defaultdict
from hashlib import md5
from itertools import count from itertools import count
from math import factorial from math import factorial
from pathlib import Path from pathlib import Path
@@ -103,13 +102,31 @@ def close_console():
pass pass
def get_new_romhash(new_rom='working.sfc'): def make_new_base2current(old_rom='Zelda no Densetsu - Kamigami no Triforce (Japan).sfc', new_rom='working.sfc'):
import hashlib
import json
from collections import OrderedDict
with open(old_rom, 'rb') as stream:
old_rom_data = bytearray(stream.read())
with open(new_rom, 'rb') as stream: with open(new_rom, 'rb') as stream:
new_rom_data = bytearray(stream.read()) new_rom_data = bytearray(stream.read())
# extend to 2 mb
old_rom_data.extend(bytearray([0x00] * (2097152 - len(old_rom_data))))
basemd5 = md5() out_data = OrderedDict()
for idx, old in enumerate(old_rom_data):
new = new_rom_data[idx]
if old != new:
out_data[idx] = [int(new)]
for offset in reversed(list(out_data.keys())):
if offset - 1 in out_data:
out_data[offset-1].extend(out_data.pop(offset))
with open('data/base2current.json', 'wt') as outfile:
json.dump([{key: value} for key, value in out_data.items()], outfile, separators=(",", ":"))
basemd5 = hashlib.md5()
basemd5.update(new_rom_data) basemd5.update(new_rom_data)
return basemd5.hexdigest() return "New Rom Hash: " + basemd5.hexdigest()
def kth_combination(k, l, r): def kth_combination(k, l, r):
@@ -751,18 +768,18 @@ class bidict(dict):
super(bidict, self).__init__(*args, **kwargs) super(bidict, self).__init__(*args, **kwargs)
self.inverse = {} self.inverse = {}
for key, value in self.items(): for key, value in self.items():
self.inverse.setdefault(value,[]).append(key) self.inverse.setdefault(value,[]).append(key)
def __setitem__(self, key, value): def __setitem__(self, key, value):
if key in self: if key in self:
self.inverse[self[key]].remove(key) self.inverse[self[key]].remove(key)
super(bidict, self).__setitem__(key, value) super(bidict, self).__setitem__(key, value)
self.inverse.setdefault(value,[]).append(key) self.inverse.setdefault(value,[]).append(key)
def __delitem__(self, key): def __delitem__(self, key):
value = self[key] value = self[key]
self.inverse.setdefault(value,[]).remove(key) self.inverse.setdefault(value,[]).remove(key)
if value in self.inverse and not self.inverse[value]: if value in self.inverse and not self.inverse[value]:
del self.inverse[value] del self.inverse[value]
super(bidict, self).__delitem__(key) super(bidict, self).__delitem__(key)
@@ -770,11 +787,12 @@ class bidict(dict):
class HexInt(int): pass class HexInt(int): pass
def hex_representer(dumper, data): def hex_representer(dumper, data):
import yaml
return yaml.ScalarNode('tag:yaml.org,2002:int', f"{data:#0{4}x}") return yaml.ScalarNode('tag:yaml.org,2002:int', f"{data:#0{4}x}")
if __name__ == '__main__': if __name__ == '__main__':
print("New Rom Hash:", get_new_romhash()) print(make_new_base2current())
# read_entrance_data(old_rom=sys.argv[1]) # read_entrance_data(old_rom=sys.argv[1])
# room_palette_data(old_rom=sys.argv[1]) # room_palette_data(old_rom=sys.argv[1])
# extract_data_from_us_rom(sys.argv[1]) # extract_data_from_us_rom(sys.argv[1])

View File

@@ -1,12 +1,6 @@
"""Setlist class definitions.""" """Setlist class definitions."""
import random as random_ import random as random_
from collections import ( from collections import Hashable, MutableSequence, MutableSet, Sequence, Set
Hashable,
MutableSequence,
MutableSet,
Sequence,
Set,
)
from . import _util from . import _util

View File

@@ -471,6 +471,10 @@ vanilla_sheets = [
(0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00),
(0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x00),
(0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x08), (0x5D, 0x49, 0x00, 0x52), (0x55, 0x49, 0x42, 0x43), (0x00, 0x00, 0x00, 0x00), (0x00, 0x00, 0x00, 0x08), (0x5D, 0x49, 0x00, 0x52), (0x55, 0x49, 0x42, 0x43),
# (0x61, 0x62, 0x63, 0x50), (0x61, 0x62, 0x63, 0x50), (0x61, 0x62, 0x63, 0x50), (0x61, 0x62, 0x63, 0x50),
# (0x61, 0x62, 0x63, 0x50), (0x61, 0x62, 0x63, 0x50), (0x61, 0x56, 0x57, 0x50), (0x61, 0x62, 0x63, 0x50),
# (0x61, 0x62, 0x63, 0x50), (0x61, 0x56, 0x57, 0x50), (0x61, 0x56, 0x63, 0x50), (0x61, 0x56, 0x57, 0x50),
# (0x61, 0x56, 0x33, 0x50), (0x61, 0x56, 0x57, 0x50), (0x61, 0x62, 0x63, 0x50), (0x61, 0x62, 0x63, 0x50)
] ]
required_boss_sheets = {EnemySprite.ArmosKnight: 9, EnemySprite.Lanmolas: 11, EnemySprite.Moldorm: 12, required_boss_sheets = {EnemySprite.ArmosKnight: 9, EnemySprite.Lanmolas: 11, EnemySprite.Moldorm: 12,