Shop-sanity shops now marked as counting towards end-game credits.
Retro single arrow now marks itself as purchased from every single shop location on initial purchase. (Nothing prevents you from buying your 'first' quiver if you already have one, however, its 6 hint points for the price of one in shop sanity.)
This commit is contained in:
		
							parent
							
								
									ca4758d1c2
								
							
						
					
					
						commit
						96e12088d7
					
				
							
								
								
									
										28
									
								
								Rom.py
								
								
								
								
							
							
						
						
									
										28
									
								
								Rom.py
								
								
								
								
							| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
from __future__ import annotations
 | 
			
		||||
 | 
			
		||||
JAP10HASH = '03a63945398191337e896e5771f77173'
 | 
			
		||||
RANDOMIZERBASEHASH = '93538d51eb018955a90181600e3384ba'
 | 
			
		||||
RANDOMIZERBASEHASH = '5d109c62f73966de1fe65751fc876778'
 | 
			
		||||
 | 
			
		||||
import io
 | 
			
		||||
import json
 | 
			
		||||
| 
						 | 
				
			
			@ -1560,6 +1560,7 @@ def write_custom_shops(rom, world, player):
 | 
			
		|||
 | 
			
		||||
    shop_data = bytearray()
 | 
			
		||||
    items_data = bytearray()
 | 
			
		||||
    retro_shop_slots = bytearray()
 | 
			
		||||
 | 
			
		||||
    for shop_id, shop in enumerate(shops):
 | 
			
		||||
        if shop_id == len(shops) - 1:
 | 
			
		||||
| 
						 | 
				
			
			@ -1568,10 +1569,27 @@ def write_custom_shops(rom, world, player):
 | 
			
		|||
        bytes[0] = shop_id
 | 
			
		||||
        bytes[-1] = shop.sram_offset
 | 
			
		||||
        shop_data.extend(bytes)
 | 
			
		||||
        # [id][item][price-low][price-high][max][repl_id][repl_price-low][repl_price-high][player]
 | 
			
		||||
        for item in shop.inventory:
 | 
			
		||||
 | 
			
		||||
        arrow_mask = 0x00
 | 
			
		||||
        for index, item in enumerate(shop.inventory):
 | 
			
		||||
            slot = 0 if shop.type == ShopType.TakeAny else index
 | 
			
		||||
            if item is None:
 | 
			
		||||
                break
 | 
			
		||||
            if world.shop_shuffle_slots[player]:
 | 
			
		||||
                count_shop = (shop.region.name != 'Potion Shop' or 'w' in world.shop_shuffle[player]) and \
 | 
			
		||||
                             shop.region.name != 'Capacity Upgrade'
 | 
			
		||||
                rom.write_byte(0x186560 + shop.sram_offset + slot, 1 if count_shop else 0)
 | 
			
		||||
            if item['item'] == 'Single Arrow' and item['player'] == 0:
 | 
			
		||||
                arrow_mask |= 1 << index
 | 
			
		||||
                retro_shop_slots.append(shop.sram_offset + slot)
 | 
			
		||||
 | 
			
		||||
        # [id][item][price-low][price-high][max][repl_id][repl_price-low][repl_price-high][player]
 | 
			
		||||
        for index, item in enumerate(shop.inventory):
 | 
			
		||||
            slot = 0 if shop.type == ShopType.TakeAny else index
 | 
			
		||||
            if item is None:
 | 
			
		||||
                break
 | 
			
		||||
            if item['item'] == 'Single Arrow' and item['player'] == 0 and world.retro[player]:
 | 
			
		||||
                rom.write_byte(0x186500 + shop.sram_offset + slot, arrow_mask)
 | 
			
		||||
            item_data = [shop_id, ItemFactory(item['item'], player).code] + int16_as_bytes(item['price']) + \
 | 
			
		||||
                        [item['max'], ItemFactory(item['replacement'], player).code if item['replacement'] else 0xFF] + \
 | 
			
		||||
                        int16_as_bytes(item['replacement_price']) + [0 if item['player'] == player else item['player']]
 | 
			
		||||
| 
						 | 
				
			
			@ -1582,6 +1600,10 @@ def write_custom_shops(rom, world, player):
 | 
			
		|||
    items_data.extend([0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])
 | 
			
		||||
    rom.write_bytes(0x184900, items_data)
 | 
			
		||||
 | 
			
		||||
    if world.retro[player]:
 | 
			
		||||
        retro_shop_slots.append(0xFF)
 | 
			
		||||
        rom.write_bytes(0x186540, retro_shop_slots)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def hud_format_text(text):
 | 
			
		||||
    output = bytes()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue