Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions core/fh/FFX/Ids/blitz_prize.cs
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
Comment on lines +5 to +7
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't 0 -> 100 look nicer? 101 -> 160 isn't too bad and Wakka's overdrives are arbitrary either way.

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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

*
* 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>
Comment thread
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);
Comment thread
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);
}
Comment thread
Andrewki44 marked this conversation as resolved.
}
71 changes: 71 additions & 0 deletions core/fh/FFX/Ids/blitz_tech.cs
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,
}
12 changes: 6 additions & 6 deletions core/fh/FFX/savedata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public struct PlayerCostPerGame {
}

[InlineArray(3)]
public struct PrizePerGame {
private ushort _data;
public struct PrizeIds {
private T_XBlitzPrizeId prize;
}

[InlineArray(240)]
Expand All @@ -184,10 +184,10 @@ public struct UncoveredTechPage {
}

public PlayerCostPerGame player_cost_per_game;
public PrizePerGame league_prize_index;
public PrizePerGame tournament_prize_index;
public ushort league_top_scorer_prize_index;
public ushort tournament_top_scorer_prize_index;
public PrizeIds league_prize_index;
public PrizeIds tournament_prize_index;
public T_XBlitzPrizeId league_top_scorer_prize_index;
public T_XBlitzPrizeId tournament_top_scorer_prize_index;
public UncoveredTechPage player_uncovered_techs_page_1;
public UncoveredTechPage player_uncovered_techs_page_2;
}
Expand Down
1 change: 1 addition & 0 deletions core/fh/FFX/typedefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@
global using T_XMesWinPosId = System.Byte; // ids/meswin
global using T_XDeathAnimationId = System.Byte; // ids/anim_death
global using T_XSubModelId = System.Int32; // ids/mdl_sub
global using T_XBlitzPrizeId = System.UInt16; // ids/blitz_prize