diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 3b8f69d7b..2f2e6f1a8 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8418,6 +8418,14 @@ BattleScript_ProtosynthesisActivates:: waitmessage B_WAIT_TIME_MED end3 +BattleScript_QuarkDriveActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_ELECTRICTERRAINACTIVATEDABILITY + waitmessage B_WAIT_TIME_MED + printstring STRINGID_STATWASHEIGHTENED + waitmessage B_WAIT_TIME_MED + end3 + BattleScript_AttackWeakenedByStrongWinds:: pause B_WAIT_TIME_SHORT printstring STRINGID_ATTACKWEAKENEDBSTRONGWINDS diff --git a/include/battle_scripts.h b/include/battle_scripts.h index c614e4b67..519c72fc4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -441,6 +441,7 @@ extern const u8 BattleScript_WindRiderActivatesMoveEnd[]; extern const u8 BattleScript_WindPowerActivates[]; extern const u8 BattleScript_WindPowerActivatesEnd2[]; extern const u8 BattleScript_ProtosynthesisActivates[]; +extern const u8 BattleScript_QuarkDriveActivates[]; // zmoves extern const u8 BattleScript_ZMoveActivateDamaging[]; diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index d4525572f..9606c5f59 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -633,8 +633,9 @@ #define STRINGID_BEINGHITCHARGEDPKMNWITHPOWER 631 #define STRINGID_SUNLIGHTACTIVATEDABILITY 632 #define STRINGID_STATWASHEIGHTENED 633 +#define STRINGID_ELECTRICTERRAINACTIVATEDABILITY 634 -#define BATTLESTRINGS_COUNT 634 +#define BATTLESTRINGS_COUNT 635 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/src/battle_main.c b/src/battle_main.c index f78822247..42de8ac3a 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4506,6 +4506,8 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId) speed /= 2; else if (ability == ABILITY_PROTOSYNTHESIS && gBattleWeather & B_WEATHER_SUN && highestStat == STAT_SPEED) speed = (speed * 150) / 100; + else if (ability == ABILITY_QUARK_DRIVE && gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && highestStat == STAT_SPEED) + speed = (speed * 150) / 100; // stat stages speed *= gStatStageRatios[gBattleMons[battlerId].statStages[STAT_SPEED]][0]; diff --git a/src/battle_message.c b/src/battle_message.c index e8af7d625..00275fa45 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -760,11 +760,13 @@ static const u8 sText_AttackerHealedItsBurn[] = _("{B_ATK_NAME_WITH_PREFIX} heal static const u8 sText_AttackerMeltedTheIce[] = _("{B_ATK_NAME_WITH_PREFIX} melted the ice with\nits fiery determination!"); static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!"); static const u8 sText_BeingHitChargedPkmnWithPower[] = _("Being hit by {B_CURRENT_MOVE}\ncharged {B_ATK_NAME_WITH_PREFIX} with power!"); -static const u8 sText_SunlightActivatedAbility[] = _("The harsh sunlight activated\n{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}!"); -static const u8 sText_StatWasHeightened[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1} was heightened!"); +static const u8 sText_SunlightActivatedAbility[] = _("The harsh sunlight activated\n{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}!"); +static const u8 sText_StatWasHeightened[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1} was heightened!"); +static const u8 sText_ElectricTerrainActivatedAbility[] = _("The Electric Terrain activated\n{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_ELECTRICTERRAINACTIVATEDABILITY - BATTLESTRINGS_TABLE_START] = sText_ElectricTerrainActivatedAbility, [STRINGID_STATWASHEIGHTENED - BATTLESTRINGS_TABLE_START] = sText_StatWasHeightened, [STRINGID_SUNLIGHTACTIVATEDABILITY - BATTLESTRINGS_TABLE_START] = sText_SunlightActivatedAbility, [STRINGID_BEINGHITCHARGEDPKMNWITHPOWER - BATTLESTRINGS_TABLE_START] = sText_BeingHitChargedPkmnWithPower, diff --git a/src/battle_util.c b/src/battle_util.c index 13c581730..aa00f1df7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4892,6 +4892,15 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_QUARK_DRIVE: + if (!gSpecialStatuses[battler].switchInAbilityDone && gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + { + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler)); + BattleScriptPushCursorAndCallback(BattleScript_QuarkDriveActivates); + effect++; + } + break; #if B_WEATHER_FORMS < GEN_5 default: if (gBattleMons[battler].species == SPECIES_CHERRIM) @@ -8767,6 +8776,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe if (gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT && (atkHighestStat == STAT_ATK || atkHighestStat == STAT_SPATK)) MulModifier(&modifier, UQ_4_12(1.3)); break; + case ABILITY_QUARK_DRIVE: + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && (atkHighestStat == STAT_ATK || atkHighestStat == STAT_SPATK)) + MulModifier(&modifier, UQ_4_12(1.3)); + break; } // field abilities @@ -8828,6 +8841,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe if (gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT && (defHighestStat == STAT_DEF || defHighestStat == STAT_SPDEF)) MulModifier(&modifier, UQ_4_12(0.3)); break; + case ABILITY_QUARK_DRIVE: + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && (defHighestStat == STAT_DEF || defHighestStat == STAT_SPDEF)) + MulModifier(&modifier, UQ_4_12(0.3)); + break; } holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE);