Skip to content

Commit

Permalink
Implemented Steadfast.
Browse files Browse the repository at this point in the history
  • Loading branch information
LOuroboros committed May 26, 2019
1 parent 096d3a3 commit 380ab88
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions data/text/ability_descriptions.inc
Expand Up @@ -349,8 +349,8 @@ gAbilityDescription_SolidRock: @ Placeholder
gAbilityDescription_Stall: @ Placeholder
.string "Placeholder text.$"

gAbilityDescription_Steadfast: @ Placeholder
.string "Placeholder text.$"
gAbilityDescription_Steadfast:
.string "Ups SPEED if flinched.$"

gAbilityDescription_StormDrain: @ Placeholder
.string "Placeholder text.$"
Expand Down Expand Up @@ -492,7 +492,7 @@ gAbilityDescriptions:: @ 81FA110
.4byte gAbilityDescription_SolarPower
.4byte gAbilityDescription_SolidRock
.4byte gAbilityDescription_Stall @ Placeholder
.4byte gAbilityDescription_Steadfast @ Placeholder
.4byte gAbilityDescription_Steadfast
.4byte gAbilityDescription_StormDrain @ Placeholder
.4byte gAbilityDescription_SuperLuck
.4byte gAbilityDescription_TangledFeet
Expand Down
2 changes: 1 addition & 1 deletion data/text/ability_names.inc
Expand Up @@ -116,7 +116,7 @@ gAbilityNames:: @ 81FA248
.string "SOLAR POWER$", 13
.string "SOLID ROCK$", 13
.string "STALL$", 13 @ Placeholder
.string "STEADFAST$", 13 @ Placeholder
.string "STEADFAST$", 13
.string "STORM DRAIN$", 13 @ Placeholder
.string "SUPER LUCK$", 13
.string "TANGLED FEET$", 13
Expand Down
2 changes: 1 addition & 1 deletion include/constants/abilities.h
Expand Up @@ -120,7 +120,7 @@
#define ABILITY_SOLAR_POWER 114
#define ABILITY_SOLID_ROCK 115
#define ABILITY_STALL 116 // Placeholder
#define ABILITY_STEADFAST 117 // Placeholder
#define ABILITY_STEADFAST 117
#define ABILITY_STORM_DRAIN 118 // Placeholder
#define ABILITY_SUPER_LUCK 119
#define ABILITY_TANGLED_FEET 120
Expand Down
9 changes: 9 additions & 0 deletions src/battle/battle_2.c
Expand Up @@ -4541,6 +4541,9 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreMovePriorities)
heldItemEffectParam = ItemId_GetHoldEffectParam(gBattleMons[bank1].item);
}

if (gBattleMons[bank1].ability == ABILITY_STEADFAST && gProtectStructs[bank1].flinchImmobility == 1)
gBattleMons[bank1].statStages[STAT_STAGE_SPEED]++;

// Only give badge speed boost to the player's mon.
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && FlagGet(FLAG_BADGE03_GET) && GetBattlerSide(bank1) == 0)
bank1AdjustedSpeed = (bank1AdjustedSpeed * 110) / 100;
Expand Down Expand Up @@ -4579,6 +4582,9 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreMovePriorities)
heldItemEffectParam = ItemId_GetHoldEffectParam(gBattleMons[bank2].item);
}

if (gBattleMons[bank2].ability == ABILITY_STEADFAST && gProtectStructs[bank2].flinchImmobility == 1)
gBattleMons[bank2].statStages[STAT_STAGE_SPEED]++;

// Only give badge speed boost to the player's mon.
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && FlagGet(FLAG_BADGE03_GET) && GetBattlerSide(bank2) == 0)
{
Expand All @@ -4592,6 +4598,9 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreMovePriorities)
if (heldItemEffect == HOLD_EFFECT_MACHO_BRACE)
bank2AdjustedSpeed /= 2;

if (gBattleMons[bank2].ability == ABILITY_STEADFAST && gProtectStructs[bank2].flinchImmobility == 1)
gBattleMons[bank2].statStages[STAT_STAGE_SPEED]++;

if (gBattleMons[bank2].ability == ABILITY_SLOW_START && gDisableStructs[bank2].slowStartTimer <= 4)
bank2AdjustedSpeed /= 2;

Expand Down
10 changes: 5 additions & 5 deletions src/data/pokemon/base_stats.h
Expand Up @@ -7823,7 +7823,7 @@ const struct BaseStats gBaseStats[] =
.eggGroup1 = EGG_GROUP_UNDISCOVERED,
.eggGroup2 = EGG_GROUP_UNDISCOVERED,
.ability1 = ABILITY_GUTS,
.ability2 = ABILITY_NONE,
.ability2 = ABILITY_STEADFAST,
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_PURPLE,
.noFlip = FALSE,
Expand Down Expand Up @@ -14836,7 +14836,7 @@ const struct BaseStats gBaseStats[] =
.growthRate = GROWTH_MEDIUM_SLOW,
.eggGroup1 = EGG_GROUP_UNDISCOVERED,
.eggGroup2 = EGG_GROUP_UNDISCOVERED,
.ability1 = ABILITY_INNER_FOCUS,
.ability1 = ABILITY_STEADFAST,
.ability2 = ABILITY_INNER_FOCUS,
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
Expand Down Expand Up @@ -14869,7 +14869,7 @@ const struct BaseStats gBaseStats[] =
.growthRate = GROWTH_MEDIUM_SLOW,
.eggGroup1 = EGG_GROUP_HUMAN_LIKE,
.eggGroup2 = EGG_GROUP_FIELD,
.ability1 = ABILITY_INNER_FOCUS,
.ability1 = ABILITY_STEADFAST,
.ability2 = ABILITY_INNER_FOCUS,
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
Expand Down Expand Up @@ -15760,8 +15760,8 @@ const struct BaseStats gBaseStats[] =
.growthRate = GROWTH_SLOW,
.eggGroup1 = EGG_GROUP_AMORPHOUS,
.eggGroup2 = EGG_GROUP_AMORPHOUS,
.ability1 = ABILITY_TRACE,
.ability2 = ABILITY_BATTLE_ARMOR,
.ability1 = ABILITY_STEADFAST,
.ability2 = ABILITY_NONE,
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_WHITE,
.noFlip = FALSE,
Expand Down

0 comments on commit 380ab88

Please sign in to comment.