Update code to not start with bombs in bomb-only mode

This commit is contained in:
2021-07-12 16:36:45 -07:00
parent d1f6558f34
commit ac14675461
6 changed files with 38 additions and 28 deletions

View File

@@ -350,8 +350,10 @@ class World(object):
ret.prog_items['L4 Bombs', item.player] += 1 ret.prog_items['L4 Bombs', item.player] += 1
elif ret.has('L2 Bombs', item.player): elif ret.has('L2 Bombs', item.player):
ret.prog_items['L3 Bombs', item.player] += 1 ret.prog_items['L3 Bombs', item.player] += 1
else: elif ret.has('L1 Bombs', item.player):
ret.prog_items['L2 Bombs', item.player] += 1 ret.prog_items['L2 Bombs', item.player] += 1
else:
ret.prog_items['L1 Bombs', item.player] += 1
elif 'Glove' in item.name: elif 'Glove' in item.name:
if ret.has('Titans Mitts', item.player): if ret.has('Titans Mitts', item.player):
pass pass
@@ -741,10 +743,10 @@ class CollectionState(object):
or self.can_shoot_arrows(player) or self.can_shoot_arrows(player)
or self.has('Fire Rod', player))) or self.has('Fire Rod', player)))
# In the future, this can be used to check if the player starts without bombs # Check if the player starts without bombs
def can_use_bombs(self, player): def can_use_bombs(self, player):
StartingBombs = True StartingBombs = True
return StartingBombs or self.has('Bomb Upgrade (+10)', player) return (self.bomb_mode_check(player, 1) and (StartingBombs or self.has('Bomb Upgrade (+10)', player)))
def can_hit_crystal(self, player): def can_hit_crystal(self, player):
return (self.can_use_bombs(player) return (self.can_use_bombs(player)
@@ -800,6 +802,8 @@ class CollectionState(object):
return self.has('L5 Bombs', player) or self.has('L4 Bombs', player) or self.has('L3 Bombs', player) return self.has('L5 Bombs', player) or self.has('L4 Bombs', player) or self.has('L3 Bombs', player)
elif level == 2: elif level == 2:
return self.has('L5 Bombs', player) or self.has('L4 Bombs', player) or self.has('L3 Bombs', player) or self.has('L2 Bombs', player) return self.has('L5 Bombs', player) or self.has('L4 Bombs', player) or self.has('L3 Bombs', player) or self.has('L2 Bombs', player)
elif level == 1:
return self.has('L5 Bombs', player) or self.has('L4 Bombs', player) or self.has('L3 Bombs', player) or self.has('L2 Bombs', player) or self.has('L1 Bombs', player)
return True return True
def bomb_mode_check(self, player, level): def bomb_mode_check(self, player, level):
@@ -952,9 +956,12 @@ class CollectionState(object):
elif self.has('L2 Bombs', item.player): elif self.has('L2 Bombs', item.player):
self.prog_items['L3 Bombs', item.player] += 1 self.prog_items['L3 Bombs', item.player] += 1
changed = True changed = True
else: elif self.has('L1 Bombs', item.player):
self.prog_items['L2 Bombs', item.player] += 1 self.prog_items['L2 Bombs', item.player] += 1
changed = True changed = True
else:
self.prog_items['L1 Bombs', item.player] += 1
changed = True
elif 'Glove' in item.name: elif 'Glove' in item.name:
if self.has('Titans Mitts', item.player): if self.has('Titans Mitts', item.player):
pass pass
@@ -1036,6 +1043,8 @@ class CollectionState(object):
to_remove = 'L3 Bombs' to_remove = 'L3 Bombs'
elif self.has('L2 Bombs', item.player): elif self.has('L2 Bombs', item.player):
to_remove = 'L2 Bombs' to_remove = 'L2 Bombs'
elif self.has('L1 Bombs', item.player):
to_remove = 'L1 Bombs'
else: else:
to_remove = None to_remove = None
elif 'Glove' in item.name: elif 'Glove' in item.name:

View File

@@ -905,7 +905,7 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, s
itemtotal = itemtotal + customitemarray["generickeys"] itemtotal = itemtotal + customitemarray["generickeys"]
customitems = [ customitems = [
"Bow", "Silver Arrows", "Blue Boomerang", "Red Boomerang", "Hookshot", "Mushroom", "Magic Powder", "Fire Rod", "Ice Rod", "Bombos", "Ether", "Quake", "Lamp", "Hammer", "Shovel", "Ocarina", "Bug Catching Net", "Book of Mudora", "Cane of Somaria", "Cane of Byrna", "Cape", "Pegasus Boots", "Power Glove", "Titans Mitts", "Progressive Glove", "Flippers", "Piece of Heart", "Boss Heart Container", "Sanctuary Heart Container", "Master Sword", "Tempered Sword", "Golden Sword", "L2 Bombs", "L3 Bombs", "L4 Bombs", "L5 Bombs", "Progressive Bombs", "Blue Shield", "Red Shield", "Mirror Shield", "Progressive Shield", "Blue Mail", "Red Mail", "Progressive Armor", "Magic Upgrade (1/2)", "Magic Upgrade (1/4)", "Bomb Upgrade (+5)", "Bomb Upgrade (+10)", "Arrow Upgrade (+5)", "Arrow Upgrade (+10)", "Single Arrow", "Arrows (10)", "Single Bomb", "Bombs (3)", "Rupee (1)", "Rupees (5)", "Rupees (20)", "Rupees (50)", "Rupees (100)", "Rupees (300)", "Rupoor", "Blue Clock", "Green Clock", "Red Clock", "Progressive Bow", "Bombs (10)", "Triforce Piece", "Triforce" "Bow", "Silver Arrows", "Blue Boomerang", "Red Boomerang", "Hookshot", "Mushroom", "Magic Powder", "Fire Rod", "Ice Rod", "Bombos", "Ether", "Quake", "Lamp", "Hammer", "Shovel", "Ocarina", "Bug Catching Net", "Book of Mudora", "Cane of Somaria", "Cane of Byrna", "Cape", "Pegasus Boots", "Power Glove", "Titans Mitts", "Progressive Glove", "Flippers", "Piece of Heart", "Boss Heart Container", "Sanctuary Heart Container", "Master Sword", "Tempered Sword", "Golden Sword", "L1 Bombs", "L2 Bombs", "L3 Bombs", "L4 Bombs", "L5 Bombs", "Progressive Bombs", "Blue Shield", "Red Shield", "Mirror Shield", "Progressive Shield", "Blue Mail", "Red Mail", "Progressive Armor", "Magic Upgrade (1/2)", "Magic Upgrade (1/4)", "Bomb Upgrade (+5)", "Bomb Upgrade (+10)", "Arrow Upgrade (+5)", "Arrow Upgrade (+10)", "Single Arrow", "Arrows (10)", "Single Bomb", "Bombs (3)", "Rupee (1)", "Rupees (5)", "Rupees (20)", "Rupees (50)", "Rupees (100)", "Rupees (300)", "Rupoor", "Blue Clock", "Green Clock", "Red Clock", "Progressive Bow", "Bombs (10)", "Triforce Piece", "Triforce"
] ]
for customitem in customitems: for customitem in customitems:
pool.extend([customitem] * customitemarray[get_custom_array_key(customitem)]) pool.extend([customitem] * customitemarray[get_custom_array_key(customitem)])

View File

@@ -166,11 +166,12 @@ item_table = {'Bow': (True, False, None, 0x0B, 200, 'You have\nchosen the\narche
'Small Key (Universal)': (False, True, None, 0xAF, 100, 'A small key for any door', 'and the key', 'the unlocking kid', 'keys for sale', 'unlock the fungus', 'key boy opens door again', 'a small key'), 'Small Key (Universal)': (False, True, None, 0xAF, 100, 'A small key for any door', 'and the key', 'the unlocking kid', 'keys for sale', 'unlock the fungus', 'key boy opens door again', 'a small key'),
'Nothing': (False, False, None, 0x5A, 1, 'Some Hot Air', 'and the Nothing', 'the zen kid', 'outright theft', 'shroom theft', 'empty boy is bored again', 'nothing'), 'Nothing': (False, False, None, 0x5A, 1, 'Some Hot Air', 'and the Nothing', 'the zen kid', 'outright theft', 'shroom theft', 'empty boy is bored again', 'nothing'),
'Bee Trap': (False, False, None, 0xB0, 50, 'We will sting your face a whole lot!', 'and the sting buddies', 'the beekeeper kid', 'insects for sale', 'shroom pollenation', 'bottle boy has mad bees again', 'friendship'), 'Bee Trap': (False, False, None, 0xB0, 50, 'We will sting your face a whole lot!', 'and the sting buddies', 'the beekeeper kid', 'insects for sale', 'shroom pollenation', 'bottle boy has mad bees again', 'friendship'),
'L2 Bombs': (True, False, 'SwordBomb', 0xB1, 100, 'Some decent\nexplosives\nrest here!', 'the decent grenades', 'the bomb-holding kid', 'better booms for sale', 'blend fungus into bombs', '\'splosion boy explodes againsword boy fights again', 'fancy bombs'), 'L1 Bombs': (True, False, 'SwordBomb', 0xB1, 50, 'Some basic\nexplosives\nrest here!', 'the basic grenades', 'the bomb-holding kid', 'booms for sale', 'blend fungus into bombs', '\'splosion boy explodes again', 'basic bombs'),
'L3 Bombs': (True, False, 'SwordBomb', 0xB2, 150, 'Some good\nexplosives\nrest here!', 'the good grenades sword', 'the bomb-holding kid', 'better booms for sale', 'blend fungus into bombs', '\'splosion boy explodes againsword boy fights again', 'fancy bombs'), 'L2 Bombs': (True, False, 'SwordBomb', 0xB2, 100, 'Some decent\nexplosives\nrest here!', 'the decent grenades', 'the bomb-holding kid', 'better booms for sale', 'blend fungus into bombs', '\'splosion boy explodes again', 'fancy bombs'),
'L4 Bombs': (True, False, 'SwordBomb', 0xB3, 200, 'The golden\nexplosives\nrest here!', 'the golden grenades', 'the bomb-holding kid', 'better booms for sale', 'blend fungus into bombs', '\'splosion boy explodes againsword boy fights again', 'fancy bombs'), 'L3 Bombs': (True, False, 'SwordBomb', 0xB3, 150, 'Some good\nexplosives\nrest here!', 'the good grenades sword', 'the bomb-holding kid', 'better booms for sale', 'blend fungus into bombs', '\'splosion boy explodes again', 'fancy bombs'),
'L5 Bombs': (True, False, 'SwordBomb', 0xB4, 200, 'The golden\nexplosives\nrest here!', 'the golden grenades', 'the bomb-holding kid', 'better booms sale', 'blend fungus into bombs', '\'splosion boy explodes againsword boy fights again', 'fancy bombs'), 'L4 Bombs': (True, False, 'SwordBomb', 0xB4, 200, 'The golden\nexplosives\nrest here!', 'the golden grenades', 'the bomb-holding kid', 'better booms for sale', 'blend fungus into bombs', '\'splosion boy explodes again', 'fancy bombs'),
'Progressive Bombs': (True, False, 'SwordBomb', 0xB5, 200, 'throw more\npowerful\nexplosives', 'the unknown grenades', 'the bomb-holding kid', 'better booms sale', 'blend fungus into bombs', '\'splosion boy explodes again', 'fancy bombs'), 'L5 Bombs': (True, False, 'SwordBomb', 0xB5, 200, 'The golden\nexplosives\nrest here!', 'the golden grenades', 'the bomb-holding kid', 'better booms sale', 'blend fungus into bombs', '\'splosion boy explodes again', 'fancy bombs'),
'Progressive Bombs': (True, False, 'SwordBomb', 0xB6, 200, 'throw more\npowerful\nexplosives', 'the unknown grenades', 'the bomb-holding kid', 'better booms sale', 'blend fungus into bombs', '\'splosion boy explodes again', 'fancy bombs'),
'Red Potion': (False, False, None, 0x2E, 150, 'Hearty red goop!', 'and the red goo', 'the liquid kid', 'potion for sale', 'free samples', 'bottle boy has red goo again', 'a red potion'), 'Red Potion': (False, False, None, 0x2E, 150, 'Hearty red goop!', 'and the red goo', 'the liquid kid', 'potion for sale', 'free samples', 'bottle boy has red goo again', 'a red potion'),
'Green Potion': (False, False, None, 0x2F, 60, 'Refreshing green goop!', 'and the green goo', 'the liquid kid', 'potion for sale', 'free samples', 'bottle boy has green goo again', 'a green potion'), 'Green Potion': (False, False, None, 0x2F, 60, 'Refreshing green goop!', 'and the green goo', 'the liquid kid', 'potion for sale', 'free samples', 'bottle boy has green goo again', 'a green potion'),
'Blue Potion': (False, False, None, 0x30, 160, 'Delicious blue goop!', 'and the blue goo', 'the liquid kid', 'potion for sale', 'free samples', 'bottle boy has blue goo again', 'a blue potion'), 'Blue Potion': (False, False, None, 0x30, 160, 'Delicious blue goop!', 'and the blue goo', 'the liquid kid', 'potion for sale', 'free samples', 'bottle boy has blue goo again', 'a blue potion'),

4
Rom.py
View File

@@ -31,7 +31,7 @@ from OverworldShuffle import default_flute_connections, flute_data
JAP10HASH = '03a63945398191337e896e5771f77173' JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'b6c98e872be23f268ff6678aa3eeaee4' RANDOMIZERBASEHASH = '5a85c6c90ed1e6a66236fd10e96d496b'
class JsonRom(object): class JsonRom(object):
@@ -894,7 +894,7 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
write_int16(rom, 0x187010, credits_total) # dynamic credits write_int16(rom, 0x187010, credits_total) # dynamic credits
if credits_total != 216: if credits_total != 216:
# collection rate address: # collection rate address:
cr_address = 0x2391E0 cr_address = 0x2391DE
cr_pc = cr_address - 0x120000 # convert to pc cr_pc = cr_address - 0x120000 # convert to pc
mid_top, mid_bot = credits_digit((credits_total // 10) % 10) mid_top, mid_bot = credits_digit((credits_total // 10) % 10)
last_top, last_bot = credits_digit(credits_total % 10) last_top, last_bot = credits_digit(credits_total % 10)

Binary file not shown.