-
Notifications
You must be signed in to change notification settings - Fork 9
Blitzball Prize IDs #110
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
Merged
Merged
Blitzball Prize IDs #110
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2fc365d
Create initial file & typedef
Andrewki44 7c9d27d
BlitzPrizeId mapping + SaveData update
Andrewki44 1bc7546
Remove invalid comment
Andrewki44 a671d66
prize_index_for + Enums
Andrewki44 717adaf
review updates
Andrewki44 f860f77
Update savedata array name
Andrewki44 cd3a78a
blitz_tech.cs
Andrewki44 84991e8
Removed optional trailing semicolons
Andrewki44 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| /* | ||
| * [Andrewki44 16/03/26] | ||
| * BlitzPrizeID 0x00 -> 0x64 == Takara.bin 220 -> 320 | ||
| * BlitzPrizeID 0x65 -> 0xA0 == Techs | ||
| * BlitzPrizeID 0xBB -> 0xBD == Wakka Overdrives | ||
| * | ||
| * Tech & Limit ID's mapped manually in-game via cheat engine manipulation | ||
| * Tech's enumerated in blitz_tech.cs | ||
| * | ||
| * Takara reference confirmed via 'blitzballOutput' script parse | ||
| * * call Common.obtainTreasure [015Bh](msgWindow=0 [00h], treasure=BlitzballLeaguePrizeIndex[priv10AAD4 - 1 [01h]] + 220 [DCh]) | ||
| */ | ||
|
|
||
| namespace Fahrenheit.FFX.Ids; | ||
|
|
||
| public static class BlitzPrizeId { | ||
| public const T_XBlitzPrizeId BLTZ_TREASURE_BASE = 0x0000; | ||
| public const T_XBlitzPrizeId BLTZ_TECH_BASE = 0x0065; | ||
| public const T_XBlitzPrizeId BLTZ_LIMIT_BASE = 0x00BB; | ||
|
|
||
| public enum BlitzLimitPrizes : T_XBlitzPrizeId { | ||
| ATTACK_REELS = 0x0000, | ||
| STATUS_REELS = 0x0001, | ||
| AUROCHS_REELS = 0x0002, | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Calculates the prize index corresponding to the specified treasure index for blitzball prizes. | ||
| /// Treasure indexes come from takara.bin | ||
| /// </summary> | ||
|
Andrewki44 marked this conversation as resolved.
|
||
| /// <param name="treasure_idx">The treasure index to convert to a prize index. Must be between 220 and 320, inclusive.</param> | ||
| /// <returns>The prize index associated with the specified treasure index.</returns> | ||
| /// <exception cref="IndexOutOfRangeException">Thrown when the value of treasure_idx is less than 220 or greater than 320.</exception> | ||
| public static T_XBlitzPrizeId prize_index_for(int treasure_idx) { | ||
| if (treasure_idx < 220 || treasure_idx > 320) { | ||
| throw new IndexOutOfRangeException("Out of bounds index for blitzball prizes"); | ||
| } | ||
| return T_XBlitzPrizeId.CreateChecked(treasure_idx - 220); | ||
|
EvelynTSMG marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /// <summary> | ||
| /// Calculates the prize index corresponding to the specified Blitz tech. | ||
| /// </summary> | ||
| /// <param name="tech">The Blitz tech for which to determine the associated prize index.</param> | ||
| /// <returns>The prize index that corresponds to the specified Blitz tech.</returns> | ||
| public static T_XBlitzPrizeId prize_index_for(BlitzTechs tech) { | ||
| if (tech < BlitzTechs.JECHT_SHOT || tech > BlitzTechs.AUROCHS_SPIRIT) { | ||
| throw new IndexOutOfRangeException("Out of bounds index for blitzball techs"); | ||
| } | ||
| return T_XBlitzPrizeId.CreateChecked(BLTZ_TECH_BASE + (ushort)tech); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Calculates the prize identifier corresponding to the specified Blitz limit. | ||
| /// </summary> | ||
| /// <param name="limit">The Blitz limit for which to retrieve the associated prize identifier.</param> | ||
| /// <returns>The prize identifier associated with the specified Blitz limit.</returns> | ||
| public static T_XBlitzPrizeId prize_index_for(BlitzLimitPrizes limit) { | ||
| if (limit < BlitzLimitPrizes.ATTACK_REELS || limit > BlitzLimitPrizes.AUROCHS_REELS) { | ||
| throw new IndexOutOfRangeException("Out of bounds index for blitzball limits"); | ||
| } | ||
| return T_XBlitzPrizeId.CreateChecked(BLTZ_LIMIT_BASE + (ushort)limit); | ||
| } | ||
|
Andrewki44 marked this conversation as resolved.
|
||
| } | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| /* | ||
| * [Andrewki44 16/03/26] | ||
| * Used in blitz_prize.cs | ||
| */ | ||
|
|
||
| namespace Fahrenheit.FFX.Ids; | ||
|
|
||
| public enum BlitzTechs : T_XBlitzPrizeId { | ||
| JECHT_SHOT = 0x0000, | ||
| JECHT_SHOT_2 = 0x0001, | ||
| SPHERE_SHOT = 0x0002, | ||
| INVISIBLE_SHOT = 0x0003, | ||
| VENOM_SHOT = 0x0004, | ||
| VENOM_SHOT_2 = 0x0005, | ||
| VENOM_SHOT_3 = 0x0006, | ||
| NAP_SHOT = 0x0007, | ||
| NAP_SHOT_2 = 0x0008, | ||
| NAP_SHOT_3 = 0x0009, | ||
| WITHER_SHOT = 0x000A, | ||
| WITHER_SHOT_2 = 0x000B, | ||
| WITHER_SHOT_3 = 0x000C, | ||
| VENOM_PASS = 0x000D, | ||
| VENOM_PASS_2 = 0x000E, | ||
| VENOM_PASS_3 = 0x000F, | ||
| NAP_PASS = 0x0010, | ||
| NAP_PASS_2 = 0x0011, | ||
| NAP_PASS_3 = 0x0012, | ||
| WITHER_PASS = 0x0013, | ||
| WITHER_PASS_2 = 0x0014, | ||
| WITHER_PASS_3 = 0x0015, | ||
| VOLLEY_SHOT = 0x0016, | ||
| VOLLEY_SHOT_2 = 0x0017, | ||
| VOLLEY_SHOT_3 = 0x0018, | ||
| VENOM_TACKLE = 0x0019, | ||
| VENOM_TACKLE_2 = 0x001A, | ||
| VENOM_TACKLE_3 = 0x001B, | ||
| NAP_TACKLE = 0x001C, | ||
| NAP_TACKLE_2 = 0x001D, | ||
| NAP_TACKLE_3 = 0x001E, | ||
| WITHER_TACKLE = 0x001F, | ||
| WITHER_TACKLE_2 = 0x0020, | ||
| WITHER_TACKLE_3 = 0x0021, | ||
| DRAIN_TACKLE = 0x0022, | ||
| DRAIN_TACKLE_2 = 0x0023, | ||
| DRAIN_TACKLE_3 = 0x0024, | ||
| TACKLE_SLIP = 0x0025, | ||
| TACKLE_SLIP_2 = 0x0026, | ||
| ANTI_VENOM = 0x0027, | ||
| ANTI_VENOM_2 = 0x0028, | ||
| ANTI_NAP = 0x0029, | ||
| ANTI_NAP_2 = 0x002A, | ||
| ANTI_WITHER = 0x002B, | ||
| ANTI_WITHER_2 = 0x002C, | ||
| ANTI_DRAIN = 0x002D, | ||
| ANTI_DRAIN_2 = 0x002E, | ||
| SPIN_BALL = 0x002F, | ||
| GRIP_GLOVES = 0x0030, | ||
| ELITE_DEFENSE = 0x0031, | ||
| BRAWLER = 0x0032, | ||
| PILE_VENOM = 0x0033, | ||
| PILE_WITHER = 0x0034, | ||
| REGEN = 0x0035, | ||
| GOOD_MORNING = 0x0036, | ||
| HI_RISK = 0x0037, | ||
| GOLDEN_ARM = 0x0038, | ||
| GAMBLE = 0x0039, | ||
| SUPER_GOALIE = 0x003A, | ||
| AUROCHS_SPIRIT = 0x003B, | ||
| } |
This file contains hidden or 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 hidden or 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
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.
Doesn't
0 -> 100look nicer?101 -> 160isn't too bad and Wakka's overdrives are arbitrary either way.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.
If this is the case, would you prefer the enums to be changed to decimal instead of hex as well?
I used hex here because I was also using that throughout the rest of the file/s, for consistency
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.
Sure. I'm frankly not sure you even need to specify the values for every variant, but continue to do so