SA2B Style Improvements (#525)

This commit is contained in:
PoryGone 2022-05-18 08:56:43 -04:00 committed by GitHub
parent 48a7587c5a
commit 05efbe0af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 39 deletions

View File

@ -255,16 +255,16 @@ location_table = {}
def setup_locations(world, player: int):
location_table = {**first_mission_location_table}
if world.IncludeMissions[player].value >= 2:
if world.include_missions[player].value >= 2:
location_table.update({**second_mission_location_table})
if world.IncludeMissions[player].value >= 3:
if world.include_missions[player].value >= 3:
location_table.update({**third_mission_location_table})
if world.IncludeMissions[player].value >= 4:
if world.include_missions[player].value >= 4:
location_table.update({**fourth_mission_location_table})
if world.IncludeMissions[player].value >= 5:
if world.include_missions[player].value >= 5:
location_table.update({**fifth_mission_location_table})
location_table.update({**upgrade_location_table})

View File

@ -68,10 +68,10 @@ class MusicShuffle(Choice):
sa2b_options: typing.Dict[str, type(Option)] = {
"DeathLink": DeathLink,
"MusicShuffle": MusicShuffle,
"IncludeMissions": IncludeMissions,
"EmblemPercentageForCannonsCore": EmblemPercentageForCannonsCore,
"NumberOfLevelGates": NumberOfLevelGates,
"LevelGateDistribution": LevelGateDistribution,
"death_link": DeathLink,
"music_shuffle": MusicShuffle,
"include_missions": IncludeMissions,
"emblem_percentage_for_cannons_core": EmblemPercentageForCannonsCore,
"number_of_level_gates": NumberOfLevelGates,
"level_gate_distribution": LevelGateDistribution,
}

View File

@ -15,16 +15,16 @@ def set_mission_progress_rules(world: MultiWorld, player: int):
sorted(fourth_mission_location_table.items()),
sorted(fifth_mission_location_table.items())):
if world.IncludeMissions[player].value >= 2:
if world.include_missions[player].value >= 2:
set_rule(world.get_location(k2, player), lambda state, k1=k1: state.can_reach(k1, "Location", player))
if world.IncludeMissions[player].value >= 3:
if world.include_missions[player].value >= 3:
set_rule(world.get_location(k3, player), lambda state, k2=k2: state.can_reach(k2, "Location", player))
if world.IncludeMissions[player].value >= 4:
if world.include_missions[player].value >= 4:
set_rule(world.get_location(k4, player), lambda state, k3=k3: state.can_reach(k3, "Location", player))
if world.IncludeMissions[player].value >= 5:
if world.include_missions[player].value >= 5:
set_rule(world.get_location(k5, player), lambda state, k4=k4: state.can_reach(k4, "Location", player))
@ -83,7 +83,7 @@ def set_mission_upgrade_rules(world: MultiWorld, player: int):
state.has(ItemName.sonic_bounce_bracelet, player))
# Mission 2 Upgrade Requirements
if world.IncludeMissions[player].value >= 2:
if world.include_missions[player].value >= 2:
add_rule(world.get_location(LocationName.metal_harbor_2, player),
lambda state: state.has(ItemName.sonic_light_shoes, player))
add_rule(world.get_location(LocationName.mission_street_2, player),
@ -116,7 +116,7 @@ def set_mission_upgrade_rules(world: MultiWorld, player: int):
state.has(ItemName.eggman_jet_engine, player))
# Mission 3 Upgrade Requirements
if world.IncludeMissions[player].value >= 3:
if world.include_missions[player].value >= 3:
add_rule(world.get_location(LocationName.city_escape_3, player),
lambda state: state.has(ItemName.sonic_mystic_melody, player))
add_rule(world.get_location(LocationName.wild_canyon_3, player),
@ -220,7 +220,7 @@ def set_mission_upgrade_rules(world: MultiWorld, player: int):
state.has(ItemName.sonic_light_shoes, player))
# Mission 4 Upgrade Requirements
if world.IncludeMissions[player].value >= 4:
if world.include_missions[player].value >= 4:
add_rule(world.get_location(LocationName.metal_harbor_4, player),
lambda state: state.has(ItemName.sonic_light_shoes, player))
add_rule(world.get_location(LocationName.pumpkin_hill_4, player),
@ -274,7 +274,7 @@ def set_mission_upgrade_rules(world: MultiWorld, player: int):
state.has(ItemName.sonic_bounce_bracelet, player))
# Mission 5 Upgrade Requirements
if world.IncludeMissions[player].value >= 5:
if world.include_missions[player].value >= 5:
add_rule(world.get_location(LocationName.city_escape_5, player),
lambda state: state.has(ItemName.sonic_flame_ring, player))
add_rule(world.get_location(LocationName.wild_canyon_5, player),
@ -341,6 +341,7 @@ def set_mission_upgrade_rules(world: MultiWorld, player: int):
add_rule(world.get_location(LocationName.cannon_core_5, player),
lambda state: state.has(ItemName.tails_booster, player) and
state.has(ItemName.eggman_jet_engine, player) and
state.has(ItemName.knuckles_mystic_melody, player) and
state.has(ItemName.knuckles_hammer_gloves, player) and
state.has(ItemName.knuckles_air_necklace, player) and
state.has(ItemName.sonic_bounce_bracelet, player))

View File

@ -65,12 +65,12 @@ class SA2BWorld(World):
return {
"ModVersion": 100,
"MusicMap": self.music_map,
"MusicShuffle": self.world.MusicShuffle[self.player],
"DeathLink": self.world.DeathLink[self.player],
"IncludeMissions": self.world.IncludeMissions[self.player].value,
"EmblemPercentageForCannonsCore": self.world.EmblemPercentageForCannonsCore[self.player].value,
"NumberOfLevelGates": self.world.NumberOfLevelGates[self.player].value,
"LevelGateDistribution": self.world.LevelGateDistribution[self.player],
"MusicShuffle": self.world.music_shuffle[self.player].value,
"DeathLink": self.world.death_link[self.player].value,
"IncludeMissions": self.world.include_missions[self.player].value,
"EmblemPercentageForCannonsCore": self.world.emblem_percentage_for_cannons_core[self.player].value,
"NumberOfLevelGates": self.world.number_of_level_gates[self.player].value,
"LevelGateDistribution": self.world.level_gate_distribution[self.player].value,
"EmblemsForCannonsCore": self.emblems_for_cannons_core,
"RegionEmblemMap": self.region_emblem_map,
}
@ -90,7 +90,7 @@ class SA2BWorld(World):
def get_levels_per_gate(self) -> list:
levels_per_gate = list()
max_gate_index = self.world.NumberOfLevelGates[self.player]
max_gate_index = self.world.number_of_level_gates[self.player]
average_level_count = 30 / (max_gate_index + 1)
levels_added = 0
@ -103,8 +103,8 @@ class SA2BWorld(World):
levels_added += 1
additional_count_iterator += 1 if additional_count_iterator < max_gate_index else -max_gate_index
if self.world.LevelGateDistribution[self.player] == 0 or self.world.LevelGateDistribution[self.player] == 2:
early_distribution = self.world.LevelGateDistribution[self.player] == 0
if self.world.level_gate_distribution[self.player] == 0 or self.world.level_gate_distribution[self.player] == 2:
early_distribution = self.world.level_gate_distribution[self.player] == 0
levels_to_distribute = 5
gate_index_offset = 0
while levels_to_distribute > 0:
@ -133,7 +133,7 @@ class SA2BWorld(World):
total_required_locations = 31
# Mission Locations
total_required_locations *= self.world.IncludeMissions[self.player].value
total_required_locations *= self.world.include_missions[self.player].value
# Upgrades
total_required_locations += 28
@ -147,7 +147,7 @@ class SA2BWorld(World):
# itempool += [self.create_item(ItemName.emblem)] * total_emblem_count
self.emblems_for_cannons_core = math.floor(
total_emblem_count * (self.world.EmblemPercentageForCannonsCore[self.player].value / 100.0))
total_emblem_count * (self.world.emblem_percentage_for_cannons_core[self.player].value / 100.0))
shuffled_region_list = list(range(30))
emblem_requirement_list = list()
@ -168,8 +168,8 @@ class SA2BWorld(World):
total_levels_added += 1
if levels_added_to_gate >= levels_per_gate[current_gate]:
current_gate += 1
if current_gate > self.world.NumberOfLevelGates[self.player].value:
current_gate = self.world.NumberOfLevelGates[self.player].value
if current_gate > self.world.number_of_level_gates[self.player].value:
current_gate = self.world.number_of_level_gates[self.player].value
else:
current_gate_emblems = max(
math.floor(total_emblem_count * math.pow(total_levels_added / 30.0, 2.0)), current_gate)
@ -186,12 +186,12 @@ class SA2BWorld(World):
self.world.itempool += itempool
if self.world.MusicShuffle[self.player] == "levels":
if self.world.music_shuffle[self.player] == "levels":
musiclist_o = list(range(0, 47))
musiclist_s = musiclist_o.copy()
self.world.random.shuffle(musiclist_s)
self.music_map = dict(zip(musiclist_o, musiclist_s))
elif self.world.MusicShuffle[self.player] == "full":
elif self.world.music_shuffle[self.player] == "full":
musiclist_o = list(range(0, 78))
musiclist_s = musiclist_o.copy()
self.world.random.shuffle(musiclist_s)

View File

@ -4,13 +4,15 @@
- Sonic Adventure 2: Battle from: [Sonic Adventure 2: Battle Steam Store Page](https://store.steampowered.com/app/213610/Sonic_Adventure_2/)
- Currently the DLC is not required for this mod, but it will be required in a future release.
- Sonic Adventure 2 Mod Loader from: [Sonic Retro Mod Loader Page](http://info.sonicretro.org/SA2_Mod_Loader )
- Microsoft Visual C++ 2013 from: [Microsoft Visual C++ 2013 Redistributable Page](https://www.microsoft.com/en-us/download/details.aspx?id=40784 )
- Sonic Adventure 2 Mod Loader from: [Sonic Retro Mod Loader Page](http://info.sonicretro.org/SA2_Mod_Loader)
- Microsoft Visual C++ 2013 from: [Microsoft Visual C++ 2013 Redistributable Page](https://www.microsoft.com/en-us/download/details.aspx?id=40784)
- Archipelago Mod for Sonic Adventure 2: Battle
from: [Sonic Adventure 2: Battle Archipelago Randomizer Mod Releases Page](https://github.com/PoryGone/SA2B_Archipelago/releases/)
Optional:
- Sonic Adventure 2: Battle Archipelago PopTracker pack from: [SA2B_AP_Tracker Releases Page](https://github.com/PoryGone/SA2B_AP_Tracker/releases/)
## Optional Software
- Sonic Adventure 2 Tracker
- PopTracker from: [PopTracker Releases Page](https://github.com/black-sliver/PopTracker/releases/)
- Sonic Adventure 2: Battle Archipelago PopTracker pack from: [SA2B AP Tracker Releases Page](https://github.com/PoryGone/SA2B_AP_Tracker/releases/)
## Installation Procedures
@ -47,9 +49,7 @@ Optional:
Some additional settings related to the Archipelago messages in game can be adjusted in the SA2ModManager if you select `Configure...` on the SA2B_Archipelago mod. This settings will be under a `General Settings` tab.
- Message Display Count: This is the maximum number of Archipelago messages that can be displayed on screen at any given time.
- Message Display Duration: This dictates how long Archipelago messages are displayed on screen (in seconds).
- Message Font Size: The is the size of the font used to display the messages from Archipelago.
## Troubleshooting