Archipelago/worlds/sa2b/Items.py

114 lines
4.3 KiB
Python
Raw Normal View History

import typing
from BaseClasses import Item, ItemClassification
from .Names import ItemName
2022-08-05 22:49:54 +00:00
from worlds.alttp import ALTTPWorld
class ItemData(typing.NamedTuple):
code: typing.Optional[int]
progression: bool
trap: bool = False
quantity: int = 1
event: bool = False
class SA2BItem(Item):
game: str = "Sonic Adventure 2: Battle"
def __init__(self, name, classification: ItemClassification, code: int = None, player: int = None):
super(SA2BItem, self).__init__(name, classification, code, player)
# Separate tables for each type of item.
emblems_table = {
ItemName.emblem: ItemData(0xFF0000, True),
}
upgrades_table = {
ItemName.sonic_gloves: ItemData(0xFF0001, False),
ItemName.sonic_light_shoes: ItemData(0xFF0002, True),
ItemName.sonic_ancient_light: ItemData(0xFF0003, False),
ItemName.sonic_bounce_bracelet: ItemData(0xFF0004, True),
ItemName.sonic_flame_ring: ItemData(0xFF0005, True),
ItemName.sonic_mystic_melody: ItemData(0xFF0006, True),
ItemName.tails_laser_blaster: ItemData(0xFF0007, False),
ItemName.tails_booster: ItemData(0xFF0008, True),
ItemName.tails_mystic_melody: ItemData(0xFF0009, True),
ItemName.tails_bazooka: ItemData(0xFF000A, True),
ItemName.knuckles_mystic_melody: ItemData(0xFF000B, True),
ItemName.knuckles_shovel_claws: ItemData(0xFF000C, True),
ItemName.knuckles_air_necklace: ItemData(0xFF000D, True),
ItemName.knuckles_hammer_gloves: ItemData(0xFF000E, True),
ItemName.knuckles_sunglasses: ItemData(0xFF000F, True),
ItemName.shadow_flame_ring: ItemData(0xFF0010, True),
ItemName.shadow_air_shoes: ItemData(0xFF0011, True),
ItemName.shadow_ancient_light: ItemData(0xFF0012, False),
ItemName.shadow_mystic_melody: ItemData(0xFF0013, True),
ItemName.eggman_laser_blaster: ItemData(0xFF0014, False),
ItemName.eggman_mystic_melody: ItemData(0xFF0015, True),
ItemName.eggman_jet_engine: ItemData(0xFF0016, True),
ItemName.eggman_large_cannon: ItemData(0xFF0017, True),
ItemName.eggman_protective_armor: ItemData(0xFF0018, False),
ItemName.rouge_mystic_melody: ItemData(0xFF0019, True),
ItemName.rouge_pick_nails: ItemData(0xFF001A, True),
ItemName.rouge_treasure_scope: ItemData(0xFF001B, True),
ItemName.rouge_iron_boots: ItemData(0xFF001C, True),
}
junk_table = {
ItemName.five_rings: ItemData(0xFF0020, False),
ItemName.ten_rings: ItemData(0xFF0021, False),
ItemName.twenty_rings: ItemData(0xFF0022, False),
ItemName.extra_life: ItemData(0xFF0023, False),
ItemName.shield: ItemData(0xFF0024, False),
ItemName.magnetic_shield: ItemData(0xFF0025, False),
ItemName.invincibility: ItemData(0xFF0026, False),
}
trap_table = {
SA2B: v2.0 Content Update (#1294) Changelog: Features: - Completely reworked mission progression system - Control of which mission types can be active per-gameplay-style - Control of how many missions are active per-gameplay-style - Mission order shuffle - Two new Chaos Emerald Hunt goals - `Chaos Emerald Hunt` involves finding the seven Chaos Emeralds and beating Green Hill - `FinalHazard Chaos Emerald Hunt` is the same, but with the FinalHazard fight at the end of Green Hill - New optional Location Checks - Keysanity (Chao Containers) - Whistlesanity (Animal Pipes and hidden whistle spots) - Beetlesanity (Destroying Gold Beetles) - Option to require clearing all active Cannon's Core Missions for access to the Biolizard fight in `Biolizard` goal - Hard Logic option - More Music Options - Option to use SADX music - New `Singularity` music shuffle option - Option to choose the Narrator theme - New Traps - Tiny Trap is now permanent within a level - Gravity Trap - Exposition Trap Quality of Life: - Significant revamp to Stage Select screen information conveyance - Icons are displayed for: - Relevant character's upgrades - Which location checks are active/checked - Chaos Emeralds found (if relevant) - Gate and Cannon's Core emblem costs - The above stage-specific info can also be viewed when paused in-level - The current mission is also displayed when paused - Emblem Symbol on Mission Select subscreen now only displays if a high enough rank has been gotten on that mission to send the location check - Hints including SA2B locations will now specify which Gate that level is located in - Save file now stores slot name to help prevent false location checks in the case of one player having multiple SA2B slots in the same seed - Chao Intermediate and Expert race sets are now swapped, per player feedback - Intermediate now includes Beginner + Challenge + Hero + Dark - Expert now includes Beginner + Challenge + Hero + Dark + Jewel - New mod config option for the color of the Message Queue text Bug Fixes: - Fixed bug where game stops properly tracking items after 127 have been received. - Several logic fixes - Game now refers to `Knuckles - Shovel Claws` correctly - Minor AP World code cleanup
2022-12-07 05:20:02 +00:00
ItemName.omochao_trap: ItemData(0xFF0030, False, True),
ItemName.timestop_trap: ItemData(0xFF0031, False, True),
ItemName.confuse_trap: ItemData(0xFF0032, False, True),
ItemName.tiny_trap: ItemData(0xFF0033, False, True),
ItemName.gravity_trap: ItemData(0xFF0034, False, True),
ItemName.exposition_trap: ItemData(0xFF0035, False, True),
#ItemName.darkness_trap: ItemData(0xFF0036, False, True),
}
emeralds_table = {
ItemName.white_emerald: ItemData(0xFF0040, True),
ItemName.red_emerald: ItemData(0xFF0041, True),
ItemName.cyan_emerald: ItemData(0xFF0042, True),
ItemName.purple_emerald: ItemData(0xFF0043, True),
ItemName.green_emerald: ItemData(0xFF0044, True),
ItemName.yellow_emerald: ItemData(0xFF0045, True),
ItemName.blue_emerald: ItemData(0xFF0046, True),
}
event_table = {
ItemName.maria: ItemData(0xFF001D, True),
}
# Complete item table.
item_table = {
**emblems_table,
**upgrades_table,
**junk_table,
**trap_table,
SA2B: v2.0 Content Update (#1294) Changelog: Features: - Completely reworked mission progression system - Control of which mission types can be active per-gameplay-style - Control of how many missions are active per-gameplay-style - Mission order shuffle - Two new Chaos Emerald Hunt goals - `Chaos Emerald Hunt` involves finding the seven Chaos Emeralds and beating Green Hill - `FinalHazard Chaos Emerald Hunt` is the same, but with the FinalHazard fight at the end of Green Hill - New optional Location Checks - Keysanity (Chao Containers) - Whistlesanity (Animal Pipes and hidden whistle spots) - Beetlesanity (Destroying Gold Beetles) - Option to require clearing all active Cannon's Core Missions for access to the Biolizard fight in `Biolizard` goal - Hard Logic option - More Music Options - Option to use SADX music - New `Singularity` music shuffle option - Option to choose the Narrator theme - New Traps - Tiny Trap is now permanent within a level - Gravity Trap - Exposition Trap Quality of Life: - Significant revamp to Stage Select screen information conveyance - Icons are displayed for: - Relevant character's upgrades - Which location checks are active/checked - Chaos Emeralds found (if relevant) - Gate and Cannon's Core emblem costs - The above stage-specific info can also be viewed when paused in-level - The current mission is also displayed when paused - Emblem Symbol on Mission Select subscreen now only displays if a high enough rank has been gotten on that mission to send the location check - Hints including SA2B locations will now specify which Gate that level is located in - Save file now stores slot name to help prevent false location checks in the case of one player having multiple SA2B slots in the same seed - Chao Intermediate and Expert race sets are now swapped, per player feedback - Intermediate now includes Beginner + Challenge + Hero + Dark - Expert now includes Beginner + Challenge + Hero + Dark + Jewel - New mod config option for the color of the Message Queue text Bug Fixes: - Fixed bug where game stops properly tracking items after 127 have been received. - Several logic fixes - Game now refers to `Knuckles - Shovel Claws` correctly - Minor AP World code cleanup
2022-12-07 05:20:02 +00:00
**emeralds_table,
**event_table,
}
lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in item_table.items() if data.code}
2022-08-05 22:49:54 +00:00
SA2B: v2.0 Content Update (#1294) Changelog: Features: - Completely reworked mission progression system - Control of which mission types can be active per-gameplay-style - Control of how many missions are active per-gameplay-style - Mission order shuffle - Two new Chaos Emerald Hunt goals - `Chaos Emerald Hunt` involves finding the seven Chaos Emeralds and beating Green Hill - `FinalHazard Chaos Emerald Hunt` is the same, but with the FinalHazard fight at the end of Green Hill - New optional Location Checks - Keysanity (Chao Containers) - Whistlesanity (Animal Pipes and hidden whistle spots) - Beetlesanity (Destroying Gold Beetles) - Option to require clearing all active Cannon's Core Missions for access to the Biolizard fight in `Biolizard` goal - Hard Logic option - More Music Options - Option to use SADX music - New `Singularity` music shuffle option - Option to choose the Narrator theme - New Traps - Tiny Trap is now permanent within a level - Gravity Trap - Exposition Trap Quality of Life: - Significant revamp to Stage Select screen information conveyance - Icons are displayed for: - Relevant character's upgrades - Which location checks are active/checked - Chaos Emeralds found (if relevant) - Gate and Cannon's Core emblem costs - The above stage-specific info can also be viewed when paused in-level - The current mission is also displayed when paused - Emblem Symbol on Mission Select subscreen now only displays if a high enough rank has been gotten on that mission to send the location check - Hints including SA2B locations will now specify which Gate that level is located in - Save file now stores slot name to help prevent false location checks in the case of one player having multiple SA2B slots in the same seed - Chao Intermediate and Expert race sets are now swapped, per player feedback - Intermediate now includes Beginner + Challenge + Hero + Dark - Expert now includes Beginner + Challenge + Hero + Dark + Jewel - New mod config option for the color of the Message Queue text Bug Fixes: - Fixed bug where game stops properly tracking items after 127 have been received. - Several logic fixes - Game now refers to `Knuckles - Shovel Claws` correctly - Minor AP World code cleanup
2022-12-07 05:20:02 +00:00
item_groups: typing.Dict[str, str] = {"Chaos Emeralds": [item_name for item_name, data in emeralds_table.items()]}
2022-08-05 22:49:54 +00:00
ALTTPWorld.pedestal_credit_texts[item_table[ItemName.sonic_light_shoes].code] = "and the Soap Shoes"
ALTTPWorld.pedestal_credit_texts[item_table[ItemName.shadow_air_shoes].code] = "and the Soap Shoes"