Skip to content

Commit

Permalink
Slow Start Done
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumbreon committed May 25, 2019
1 parent f2d0f94 commit 34316d8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/battle/battle_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4528,7 +4528,7 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreMovePriorities)
if (heldItemEffect == HOLD_EFFECT_MACHO_BRACE)
bank1AdjustedSpeed /= 2;

if (gBattleMons[bank1].ability == ABILITY_SLOW_START && gDisableStructs[bank1].slowStartTimer <= 5)
if (gBattleMons[bank1].ability == ABILITY_SLOW_START && gDisableStructs[bank1].slowStartTimer != 0)
bank1AdjustedSpeed /= 2;

if (gBattleMons[bank1].status1 & STATUS_PARALYSIS && (gBattleMons[bank1].ability != ABILITY_QUICK_FEET))
Expand Down Expand Up @@ -4568,7 +4568,7 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreMovePriorities)
if (heldItemEffect == HOLD_EFFECT_MACHO_BRACE)
bank2AdjustedSpeed /= 2;

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

if (gBattleMons[bank2].status1 & STATUS_PARALYSIS && (gBattleMons[bank2].ability != ABILITY_QUICK_FEET))
Expand Down
26 changes: 9 additions & 17 deletions src/battle/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,12 +1858,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_SLOW_START:
if (!(gSpecialStatuses[bank].slowStarted))
{
gDisableStructs[bank].slowStartTimer = 5;
BattleScriptPushCursorAndCallback(BattleScript_SlowStarted);
gSpecialStatuses[bank].slowStarted = 1;
}
break; // TODO(?): Investigate why slowStarted is (apparently) being reset
break;
case ABILITY_TRACE:
if (!(gSpecialStatuses[bank].traced))
{
Expand Down Expand Up @@ -1958,19 +1955,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_SLOW_START:
gSpecialStatuses[bank].slowStarted = 1;
if (gSpecialStatuses[bank].slowStarted == 1)
{
if (gDisableStructs[bank].slowStartTimer == 6)
break;
if (gDisableStructs[bank].slowStartTimer <= 5)
gDisableStructs[bank].slowStartTimer++;
if (gDisableStructs[bank].slowStartTimer == 5)
{
if (gDisableStructs[bank].slowStartTimer != 0)
{
gDisableStructs[bank].slowStartTimer--;
if (gDisableStructs[bank].slowStartTimer == 0)
BattleScriptPushCursorAndCallback(BattleScript_SlowStartEnds);
gSpecialStatuses[bank].slowStarted = 0;
}
effect++;
effect++;
}
}
break;
case ABILITY_BAD_DREAMS:
Expand Down
4 changes: 3 additions & 1 deletion src/battle/calculate_base_damage.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
gBattleMovePower = (150 * gBattleMovePower) / 100;
if (defender->ability == ABILITY_DRY_SKIN && (gBattleMoves[gCurrentMove].type == TYPE_FIRE))
gBattleMovePower = (125 * gBattleMovePower) / 100;

// Slow Start
if (attacker->ability == ABILITY_SLOW_START && gDisableStruct[bankAtk].slowStartTimer != 0)
attack /= 2;

// Rivalry
if (GetGenderFromSpeciesAndPersonality(attacker->species, attacker->personality) != MON_GENDERLESS
Expand Down

0 comments on commit 34316d8

Please sign in to comment.