mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Implemented Quark Drive's effect
Also tweaked STRINGID_SUNLIGHTACTIVATEDABILITY and STRINGID_STATWASHEIGHTENED.
This commit is contained in:
parent
a328088122
commit
e25f843db3
@ -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
|
||||
|
@ -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[];
|
||||
|
@ -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,
|
||||
|
@ -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];
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user