-
Notifications
You must be signed in to change notification settings - Fork 703
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
Super Mario 64: ItemData class and tables #4321
Open
josephwhite
wants to merge
13
commits into
ArchipelagoMW:main
Choose a base branch
from
josephwhite:sm64-itemdata
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+61
−53
Open
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9525a8b
sm64ex: use item data class
josephwhite 8124094
Merge branch 'ArchipelagoMW:main' into sm64-itemdata
josephwhite abda5e8
rearrange imports
josephwhite 3fd6670
Dict to dict
josephwhite a470d09
Merge branch 'main' into sm64-itemdata
josephwhite c0617f2
remove optional typing
josephwhite 5b1c03d
Merge branch 'main' into sm64-itemdata
josephwhite b075405
bonus item descriptions since we can also add stuff for webworld easily
josephwhite e58d3f8
Merge branch 'main' into sm64-itemdata
josephwhite 85dfc61
remove item descriptions (rip) and decrease verbosity for classificat…
josephwhite 28cb3f7
Merge branch 'main' into sm64-itemdata
josephwhite 8f9afe6
formatting
josephwhite 10b2f85
Merge branch 'ArchipelagoMW:main' into sm64-itemdata
josephwhite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,47 +1,59 @@ | ||||||||
from BaseClasses import Item | ||||||||
from typing import Dict, NamedTuple, Optional | ||||||||
|
||||||||
from BaseClasses import Item, ItemClassification | ||||||||
|
||||||||
sm64ex_base_id: int = 3626000 | ||||||||
|
||||||||
|
||||||||
class SM64Item(Item): | ||||||||
game: str = "Super Mario 64" | ||||||||
|
||||||||
|
||||||||
generic_item_table = { | ||||||||
"Power Star": 3626000, | ||||||||
"Basement Key": 3626178, | ||||||||
"Second Floor Key": 3626179, | ||||||||
"Progressive Key": 3626180, | ||||||||
"Wing Cap": 3626181, | ||||||||
"Metal Cap": 3626182, | ||||||||
"Vanish Cap": 3626183, | ||||||||
"1Up Mushroom": 3626184 | ||||||||
class SM64ItemData(NamedTuple): | ||||||||
code: Optional[int] = None | ||||||||
classification: ItemClassification = ItemClassification.filler | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can do this now too (and remove the Optional import)
Suggested change
|
||||||||
|
||||||||
generic_item_data_table: Dict[str, SM64ItemData] = { | ||||||||
"Power Star": SM64ItemData(sm64ex_base_id + 0, ItemClassification.progression_skip_balancing), | ||||||||
"Basement Key": SM64ItemData(sm64ex_base_id + 178, ItemClassification.progression), | ||||||||
"Second Floor Key": SM64ItemData(sm64ex_base_id + 179, ItemClassification.progression), | ||||||||
"Progressive Key": SM64ItemData(sm64ex_base_id + 180, ItemClassification.progression), | ||||||||
"Wing Cap": SM64ItemData(sm64ex_base_id + 181, ItemClassification.progression), | ||||||||
"Metal Cap": SM64ItemData(sm64ex_base_id + 182, ItemClassification.progression), | ||||||||
"Vanish Cap": SM64ItemData(sm64ex_base_id + 183, ItemClassification.progression), | ||||||||
"1Up Mushroom": SM64ItemData(sm64ex_base_id + 184, ItemClassification.filler), | ||||||||
} | ||||||||
|
||||||||
action_item_table = { | ||||||||
"Double Jump": 3626185, | ||||||||
"Triple Jump": 3626186, | ||||||||
"Long Jump": 3626187, | ||||||||
"Backflip": 3626188, | ||||||||
"Side Flip": 3626189, | ||||||||
"Wall Kick": 3626190, | ||||||||
"Dive": 3626191, | ||||||||
"Ground Pound": 3626192, | ||||||||
"Kick": 3626193, | ||||||||
"Climb": 3626194, | ||||||||
"Ledge Grab": 3626195 | ||||||||
action_item_data_table: Dict[str, SM64ItemData] = { | ||||||||
"Double Jump": SM64ItemData(sm64ex_base_id + 185, ItemClassification.progression), | ||||||||
"Triple Jump": SM64ItemData(sm64ex_base_id + 186, ItemClassification.progression), | ||||||||
"Long Jump": SM64ItemData(sm64ex_base_id + 187, ItemClassification.progression), | ||||||||
"Backflip": SM64ItemData(sm64ex_base_id + 188, ItemClassification.progression), | ||||||||
"Side Flip": SM64ItemData(sm64ex_base_id + 189, ItemClassification.progression), | ||||||||
"Wall Kick": SM64ItemData(sm64ex_base_id + 190, ItemClassification.progression), | ||||||||
"Dive": SM64ItemData(sm64ex_base_id + 191, ItemClassification.progression), | ||||||||
"Ground Pound": SM64ItemData(sm64ex_base_id + 192, ItemClassification.progression), | ||||||||
"Kick": SM64ItemData(sm64ex_base_id + 193, ItemClassification.progression), | ||||||||
"Climb": SM64ItemData(sm64ex_base_id + 194, ItemClassification.progression), | ||||||||
"Ledge Grab": SM64ItemData(sm64ex_base_id + 195, ItemClassification.progression), | ||||||||
} | ||||||||
|
||||||||
cannon_item_data_table: Dict[str, SM64ItemData] = { | ||||||||
"Cannon Unlock BoB": SM64ItemData(sm64ex_base_id + 200, ItemClassification.progression), | ||||||||
"Cannon Unlock WF": SM64ItemData(sm64ex_base_id + 201, ItemClassification.progression), | ||||||||
"Cannon Unlock JRB": SM64ItemData(sm64ex_base_id + 202, ItemClassification.progression), | ||||||||
"Cannon Unlock CCM": SM64ItemData(sm64ex_base_id + 203, ItemClassification.progression), | ||||||||
"Cannon Unlock SSL": SM64ItemData(sm64ex_base_id + 207, ItemClassification.progression), | ||||||||
"Cannon Unlock SL": SM64ItemData(sm64ex_base_id + 209, ItemClassification.progression), | ||||||||
"Cannon Unlock WDW": SM64ItemData(sm64ex_base_id + 210, ItemClassification.progression), | ||||||||
"Cannon Unlock TTM": SM64ItemData(sm64ex_base_id + 211, ItemClassification.progression), | ||||||||
"Cannon Unlock THI": SM64ItemData(sm64ex_base_id + 212, ItemClassification.progression), | ||||||||
"Cannon Unlock RR": SM64ItemData(sm64ex_base_id + 214, ItemClassification.progression), | ||||||||
} | ||||||||
|
||||||||
cannon_item_table = { | ||||||||
"Cannon Unlock BoB": 3626200, | ||||||||
"Cannon Unlock WF": 3626201, | ||||||||
"Cannon Unlock JRB": 3626202, | ||||||||
"Cannon Unlock CCM": 3626203, | ||||||||
"Cannon Unlock SSL": 3626207, | ||||||||
"Cannon Unlock SL": 3626209, | ||||||||
"Cannon Unlock WDW": 3626210, | ||||||||
"Cannon Unlock TTM": 3626211, | ||||||||
"Cannon Unlock THI": 3626212, | ||||||||
"Cannon Unlock RR": 3626214 | ||||||||
item_data_table = { | ||||||||
**generic_item_data_table, | ||||||||
**action_item_data_table, | ||||||||
**cannon_item_data_table | ||||||||
} | ||||||||
|
||||||||
item_table = {**generic_item_table, **action_item_table, **cannon_item_table} | ||||||||
item_table = {name: data.code for name, data in item_data_table.items() if data.code is not None} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might as well add the EoF newline now
Suggested change
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to just use
dict
since 3.8/3.9 was dropped