Primal Reversion Tweaks

-Fixed the inconsistent Primal Reversion activation in double battles.
-Optimized the primal weather checks in attackcanceler a little.
-Fixed the issue with multi-target fire/water moves during primal rain/sun.
This commit is contained in:
LOuroboros 2021-11-04 10:56:14 -03:00
parent b615bc6dcd
commit e0b53f87fc
4 changed files with 22 additions and 23 deletions

View File

@ -7697,8 +7697,10 @@ BattleScript_DesolateLandEvaporatesWaterTypeMoves::
attackstring
pause B_WAIT_TIME_SHORT
ppreduce
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_STRING_PRINTED, BattleScript_MoveEnd
printstring STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_STRING_PRINTED
goto BattleScript_MoveEnd
BattleScript_PrimordialSeaActivates::
@ -7715,8 +7717,10 @@ BattleScript_PrimordialSeaFizzlesOutFireTypeMoves::
attackstring
pause B_WAIT_TIME_SHORT
ppreduce
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_STRING_PRINTED, BattleScript_MoveEnd
printstring STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_STRING_PRINTED
goto BattleScript_MoveEnd
BattleScript_DeltaStreamActivates::

View File

@ -200,6 +200,7 @@
#define HITMARKER_CHARGING (1 << 27)
#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28)
#define HITMARKER_FAINTED2(battler) ((1 << 28) << battler)
#define HITMARKER_STRING_PRINTED (1 << 29)
// Per-side statuses that affect an entire party
#define SIDE_STATUS_REFLECT (1 << 0)

View File

@ -1337,24 +1337,20 @@ static void Cmd_attackcanceler(void)
GET_MOVE_TYPE(gCurrentMove, moveType);
if (moveType == TYPE_FIRE
&& (gBattleWeather & WEATHER_RAIN_PRIMAL)
&& WEATHER_HAS_EFFECT
&& gBattleMoves[gCurrentMove].power)
if (WEATHER_HAS_EFFECT && gBattleMoves[gCurrentMove].power)
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves;
return;
}
if (moveType == TYPE_WATER
&& (gBattleWeather & WEATHER_SUN_PRIMAL)
&& WEATHER_HAS_EFFECT
&& gBattleMoves[gCurrentMove].power)
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves;
return;
if (moveType == TYPE_FIRE && (gBattleWeather & WEATHER_RAIN_PRIMAL))
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves;
return;
}
else if (moveType == TYPE_WATER && (gBattleWeather & WEATHER_SUN_PRIMAL))
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves;
return;
}
}
if (gBattleOutcome != 0)

View File

@ -8884,12 +8884,10 @@ bool32 CanMegaEvolve(u8 battlerId)
// Check if trainer already mega evolved a pokemon.
if (mega->alreadyEvolved[battlerPosition])
return FALSE;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
{
if (IsPartnerMonFromSameTrainer(battlerId)
&& (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)])))
return FALSE;
}
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& IsPartnerMonFromSameTrainer(battlerId)
&& (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)])))
return FALSE;
// Gets mon data.
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)