Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTTP: Add "Silver Star" to differentiate progression/non-progression on non-ALTTP items #2858

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified data/basepatch.bsdiff4
Binary file not shown.
3 changes: 2 additions & 1 deletion worlds/alttp/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ def as_init_dict(self) -> typing.Dict[str, typing.Any]:
'Green Pendant': ItemData(IC.progression, 'Crystal', (0x04, 0x38, 0x62, 0x00, 0x69, 0x01), None, None, None, None, None, None, "the green pendant"),
'Blue Pendant': ItemData(IC.progression, 'Crystal', (0x02, 0x34, 0x60, 0x00, 0x69, 0x02), None, None, None, None, None, None, "the blue pendant"),
'Red Pendant': ItemData(IC.progression, 'Crystal', (0x01, 0x32, 0x60, 0x00, 0x69, 0x03), None, None, None, None, None, None, "the red pendant"),
'Silver Power Star': ItemData(IC.filler, None, 0x69, 'a piece of junk', 'and the weird junk', 'star-struck kid', 'star for sale', 'see stars with shroom', 'mario powers up again', 'a bit of junk'),
'Triforce': ItemData(IC.progression, None, 0x6A, '\n YOU WIN!', 'and the triforce', 'victorious kid', 'victory for sale', 'fungus for the win', 'greedy boy wins game again', 'the Triforce'),
'Power Star': ItemData(IC.progression, None, 0x6B, 'a small victory', 'and the power star', 'star-struck kid', 'star for sale', 'see stars with shroom', 'mario powers up again', 'a Power Star'),
'Gold Power Star': ItemData(IC.progression, None, 0x6B, 'a useful item', 'and the power star', 'star-struck kid', 'star for sale', 'see stars with shroom', 'mario powers up again', 'a useful item'),
'Triforce Piece': ItemData(IC.progression_skip_balancing, None, 0x6C, 'a small victory', 'and the thirdforce', 'triangular kid', 'triangle for sale', 'fungus for triangle', 'wise boy has triangle again', 'a Triforce Piece'),
'Crystal 1': ItemData(IC.progression, 'Crystal', (0x02, 0x34, 0x64, 0x40, 0x7F, 0x06), None, None, None, None, None, None, "a blue crystal"),
'Crystal 2': ItemData(IC.progression, 'Crystal', (0x10, 0x34, 0x64, 0x40, 0x79, 0x06), None, None, None, None, None, None, "a blue crystal"),
Expand Down
17 changes: 11 additions & 6 deletions worlds/alttp/Rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import worlds.Files

LTTPJPN10HASH: str = "03a63945398191337e896e5771f77173"
RANDOMIZERBASEHASH: str = "35d010bc148e0ea0ee68e81e330223f1"
RANDOMIZERBASEHASH: str = "275a50c9fabdbcd1952182f22a758370"
ROM_PLAYER_LIMIT: int = 255

import io
Expand Down Expand Up @@ -774,11 +774,15 @@ def write_to_rom(self, rom: LocalRom):
0x4D504, 0x4D507, 0x4D55E, 0x4D56A]


def get_nonnative_item_sprite(code: int) -> int:
def get_nonnative_item_sprite(code: int, advancement: bool) -> int:
if 84173 >= code >= 84007: # LttP item in SMZ3
return code - 84000
return 0x6B # set all non-native sprites to Power Star as per 13 to 2 vote at
if advancement: # Progression item
return 0x6B
return 0x69 # set all non-native sprites to Power Star as per 13 to 2 vote at
# https://discord.com/channels/731205301247803413/827141303330406408/852102450822905886
# Further distinguish Progression from non-Progression using Power Stars with
# two different palettes: Gold for Progression, Silver for Useful/Filler


def patch_rom(world: MultiWorld, rom: LocalRom, player: int, enemized: bool):
Expand All @@ -800,8 +804,8 @@ def patch_rom(world: MultiWorld, rom: LocalRom, player: int, enemized: bool):
if location.item.trap:
itemid = 0x5A # Nothing, which disguises
else:
itemid = get_nonnative_item_sprite(location.item.code)
# Keys in their native dungeon should use the orignal item code for keys
itemid = get_nonnative_item_sprite(location.item.code, location.item.advancement)
# Keys in their native dungeon should use the original item code for keys
elif location.parent_region.dungeon:
if location.parent_region.dungeon.is_dungeon_item(location.item):
if location.item.bigkey:
Expand Down Expand Up @@ -1775,7 +1779,8 @@ def write_custom_shops(rom, world, player):
replacement_price_data = get_price_data(item['replacement_price'], item['replacement_price_type'])
slot = 0 if shop.type == ShopType.TakeAny else index
if item['player'] and world.game[item['player']] != "A Link to the Past": # item not native to ALTTP
item_code = get_nonnative_item_sprite(world.worlds[item['player']].item_name_to_id[item['item']])
item_code = get_nonnative_item_sprite(world.worlds[item['player']].item_name_to_id[item['item']],
shop.region.locations[index].item.advancement)
else:
item_code = ItemFactory(item['item'], player).code
if item['item'] == 'Single Arrow' and item['player'] == 0 and world.retro_bow[player]:
Expand Down