From a2813e63deec4abe2aac11254466276c3b95214d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 18 Apr 2020 12:52:15 +0200 Subject: [PATCH] Slow Start --- data/battle_scripts_1.s | 8 ++++++++ include/battle_scripts.h | 1 + src/battle_main.c | 2 ++ src/battle_message.c | 2 +- src/battle_util.c | 12 ++++++++++++ src/data/pokemon/base_stats.h | 2 +- 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0f085feda..e8811d382 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5741,6 +5741,14 @@ BattleScript_ThroatChopEndTurn:: printstring STRINGID_THROATCHOPENDS waitmessage 0x40 end2 + +BattleScript_SlowStartEnds:: + pause 0x5 + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + printstring STRINGID_SLOWSTARTEND + waitmessage 0x40 + end2 BattleScript_SelectingNotAllowedMoveGravity:: printselectionstring STRINGID_GRAVITYPREVENTSUSAGE diff --git a/include/battle_scripts.h b/include/battle_scripts.h index f30cec025..8d6769b00 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -331,5 +331,6 @@ extern const u8 BattleScript_AftermathDmg[]; extern const u8 BattleScript_StanceChangeActivates[]; extern const u8 BattleScript_DisguiseBustedActivates[]; extern const u8 BattleScript_AnticipationActivates[]; +extern const u8 BattleScript_SlowStartEnds[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/src/battle_main.c b/src/battle_main.c index f5eaaaec7..626f91062 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4254,6 +4254,8 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId) speed = (speed * 150) / 100; else if (ability == ABILITY_SURGE_SURFER && gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) speed *= 2; + else if (ability == ABILITY_SLOW_START && gDisableStructs[battlerId].slowStartTimer != 0) + speed /= 2; // stat stages speed *= gStatStageRatios[gBattleMons[battlerId].statStages[STAT_SPEED]][0]; diff --git a/src/battle_message.c b/src/battle_message.c index 3bc2999b3..9508f4421 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -584,7 +584,7 @@ static const u8 sText_MoldBreakerEnters[] = _("{B_ATK_NAME_WITH_PREFIX} breaks t static const u8 sText_TeravoltEnters[] = _("{B_ATK_NAME_WITH_PREFIX} is radiating a bursting aura!"); static const u8 sText_TurboblazeEnters[] = _("{B_ATK_NAME_WITH_PREFIX} is radiating\na blazing aura!"); static const u8 sText_SlowStartEnters[] = _("{B_ATK_NAME_WITH_PREFIX} can't get it going!"); -static const u8 sText_SlowStartEnd[] = _("{B_ATK_NAME_WITH_PREFIX} finally got its act together!"); +static const u8 sText_SlowStartEnd[] = _("{B_ATK_NAME_WITH_PREFIX} finally got\nits act together!"); static const u8 sText_SolarPowerHpDrop[] = _("The {B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\ntakes its toll!"); static const u8 sText_AftermathDmg[] = _("{B_ATK_NAME_WITH_PREFIX} is hurt!"); static const u8 sText_AnticipationActivates[] = _("{B_ATK_NAME_WITH_PREFIX} shuddered\nin anticipation!"); diff --git a/src/battle_util.c b/src/battle_util.c index 96a870d91..c40692575 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1392,6 +1392,7 @@ enum ENDTURN_ELECTRIFY, ENDTURN_POWDER, ENDTURN_THROAT_CHOP, + ENDTURN_SLOW_START, ENDTURN_BATTLER_COUNT }; @@ -1856,6 +1857,16 @@ u8 DoBattlerEndTurnEffects(void) } gBattleStruct->turnEffectsTracker++; break; + case ENDTURN_SLOW_START: + if (gDisableStructs[gActiveBattler].slowStartTimer + && --gDisableStructs[gActiveBattler].slowStartTimer == 0 + && ability == ABILITY_SLOW_START) + { + BattleScriptExecute(BattleScript_SlowStartEnds); + effect++; + } + gBattleStruct->turnEffectsTracker++; + break; case ENDTURN_BATTLER_COUNT: // done gBattleStruct->turnEffectsTracker = 0; gBattleStruct->turnEffectsBattlerId++; @@ -2854,6 +2865,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA case ABILITY_SLOW_START: if (!gSpecialStatuses[battler].switchInAbilityDone) { + gDisableStructs[battler].slowStartTimer = 5; gBattleCommunication[MULTISTRING_CHOOSER] = 3; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index c191da816..7e2ac6650 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -7296,7 +7296,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - .abilities = {ABILITY_KEEN_EYE, ABILITY_STURDY}, + .abilities = {ABILITY_SLOW_START, ABILITY_SLOW_START}, .safariZoneFleeRate = 0, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE,