mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-19 01:44:20 +01:00
Fixed Forecast and Flower Gift (#2978)
This commit is contained in:
commit
5061927cfa
@ -1346,6 +1346,10 @@
|
|||||||
callnative BS_ItemRestorePP
|
callnative BS_ItemRestorePP
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro tryrevertweatherform
|
||||||
|
callnative BS_TryRevertWeatherForm
|
||||||
|
.endm
|
||||||
|
|
||||||
.macro setsnow
|
.macro setsnow
|
||||||
callnative BS_SetSnow
|
callnative BS_SetSnow
|
||||||
.endm
|
.endm
|
||||||
|
@ -1581,6 +1581,7 @@ BattleScript_MoveEffectCoreEnforcer::
|
|||||||
printstring STRINGID_PKMNSABILITYSUPPRESSED
|
printstring STRINGID_PKMNSABILITYSUPPRESSED
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
trytoclearprimalweather
|
trytoclearprimalweather
|
||||||
|
tryrevertweatherform
|
||||||
printstring STRINGID_EMPTYSTRING3
|
printstring STRINGID_EMPTYSTRING3
|
||||||
waitmessage 1
|
waitmessage 1
|
||||||
BattleScript_CoreEnforcerRet:
|
BattleScript_CoreEnforcerRet:
|
||||||
@ -2729,6 +2730,7 @@ BattleScript_EffectSimpleBeam:
|
|||||||
printstring STRINGID_PKMNACQUIREDSIMPLE
|
printstring STRINGID_PKMNACQUIREDSIMPLE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
trytoclearprimalweather
|
trytoclearprimalweather
|
||||||
|
tryrevertweatherform
|
||||||
printstring STRINGID_EMPTYSTRING3
|
printstring STRINGID_EMPTYSTRING3
|
||||||
waitmessage 1
|
waitmessage 1
|
||||||
tryendneutralizinggas BS_TARGET
|
tryendneutralizinggas BS_TARGET
|
||||||
@ -2828,6 +2830,7 @@ BattleScript_EffectWorrySeed:
|
|||||||
printstring STRINGID_PKMNACQUIREDABILITY
|
printstring STRINGID_PKMNACQUIREDABILITY
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
trytoclearprimalweather
|
trytoclearprimalweather
|
||||||
|
tryrevertweatherform
|
||||||
printstring STRINGID_EMPTYSTRING3
|
printstring STRINGID_EMPTYSTRING3
|
||||||
waitmessage 1
|
waitmessage 1
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
@ -2959,6 +2962,7 @@ BattleScript_EffectGastroAcid:
|
|||||||
printstring STRINGID_PKMNSABILITYSUPPRESSED
|
printstring STRINGID_PKMNSABILITYSUPPRESSED
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
trytoclearprimalweather
|
trytoclearprimalweather
|
||||||
|
tryrevertweatherform
|
||||||
printstring STRINGID_EMPTYSTRING3
|
printstring STRINGID_EMPTYSTRING3
|
||||||
waitmessage 1
|
waitmessage 1
|
||||||
tryendneutralizinggas BS_TARGET
|
tryendneutralizinggas BS_TARGET
|
||||||
@ -6848,6 +6852,7 @@ BattleScript_RainContinuesOrEnds::
|
|||||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd
|
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd
|
||||||
playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES
|
playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES
|
||||||
BattleScript_RainContinuesOrEndsEnd::
|
BattleScript_RainContinuesOrEndsEnd::
|
||||||
|
call BattleScript_ActivateWeatherAbilities
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_DamagingWeatherContinues::
|
BattleScript_DamagingWeatherContinues::
|
||||||
@ -6881,22 +6886,26 @@ BattleScript_DamagingWeatherLoopIncrement::
|
|||||||
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
||||||
BattleScript_DamagingWeatherContinuesEnd::
|
BattleScript_DamagingWeatherContinuesEnd::
|
||||||
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||||
|
call BattleScript_ActivateWeatherAbilities
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_SandStormHailSnowEnds::
|
BattleScript_SandStormHailSnowEnds::
|
||||||
printfromtable gSandStormHailSnowEndStringIds
|
printfromtable gSandStormHailSnowEndStringIds
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
|
call BattleScript_ActivateWeatherAbilities
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_SunlightContinues::
|
BattleScript_SunlightContinues::
|
||||||
printstring STRINGID_SUNLIGHTSTRONG
|
printstring STRINGID_SUNLIGHTSTRONG
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
playanimation BS_ATTACKER, B_ANIM_SUN_CONTINUES
|
playanimation BS_ATTACKER, B_ANIM_SUN_CONTINUES
|
||||||
|
call BattleScript_ActivateWeatherAbilities
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_SunlightFaded::
|
BattleScript_SunlightFaded::
|
||||||
printstring STRINGID_SUNLIGHTFADED
|
printstring STRINGID_SUNLIGHTFADED
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
|
call BattleScript_ActivateWeatherAbilities
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_OverworldWeatherStarts::
|
BattleScript_OverworldWeatherStarts::
|
||||||
@ -7995,9 +8004,7 @@ BattleScript_CudChewActivates::
|
|||||||
setbyte sBERRY_OVERRIDE, 0
|
setbyte sBERRY_OVERRIDE, 0
|
||||||
end3
|
end3
|
||||||
|
|
||||||
BattleScript_TargetFormChange::
|
BattleScript_TargetFormChangeNoPopup:
|
||||||
pause 5
|
|
||||||
call BattleScript_AbilityPopUpTarget
|
|
||||||
printstring STRINGID_EMPTYSTRING3
|
printstring STRINGID_EMPTYSTRING3
|
||||||
waitmessage 1
|
waitmessage 1
|
||||||
handleformchange BS_TARGET, 0
|
handleformchange BS_TARGET, 0
|
||||||
@ -8007,16 +8014,22 @@ BattleScript_TargetFormChange::
|
|||||||
handleformchange BS_TARGET, 2
|
handleformchange BS_TARGET, 2
|
||||||
return
|
return
|
||||||
|
|
||||||
|
BattleScript_TargetFormChange::
|
||||||
|
pause 5
|
||||||
|
call BattleScript_AbilityPopUpTarget
|
||||||
|
call BattleScript_TargetFormChangeNoPopup
|
||||||
|
return
|
||||||
|
|
||||||
BattleScript_TargetFormChangeWithString::
|
BattleScript_TargetFormChangeWithString::
|
||||||
pause 5
|
pause 5
|
||||||
call BattleScript_AbilityPopUpTarget
|
call BattleScript_AbilityPopUpTarget
|
||||||
printstring STRINGID_EMPTYSTRING3
|
call BattleScript_TargetFormChangeNoPopup
|
||||||
waitmessage 1
|
printstring STRINGID_PKMNTRANSFORMED
|
||||||
handleformchange BS_TARGET, 0
|
waitmessage B_WAIT_TIME_LONG
|
||||||
handleformchange BS_TARGET, 1
|
return
|
||||||
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
|
|
||||||
waitanimation
|
BattleScript_TargetFormChangeWithStringNoPopup::
|
||||||
handleformchange BS_TARGET, 2
|
call BattleScript_TargetFormChangeNoPopup
|
||||||
printstring STRINGID_PKMNTRANSFORMED
|
printstring STRINGID_PKMNTRANSFORMED
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
return
|
return
|
||||||
@ -8666,14 +8679,15 @@ BattleScript_ShedSkinActivates::
|
|||||||
end3
|
end3
|
||||||
|
|
||||||
BattleScript_ActivateWeatherAbilities:
|
BattleScript_ActivateWeatherAbilities:
|
||||||
copybyte sBATTLER, gBattlerAttacker
|
savetarget
|
||||||
setbyte gBattlerAttacker, 0
|
setbyte gBattlerTarget, 0
|
||||||
BattleScript_ActivateWeatherAbilities_Loop:
|
BattleScript_ActivateWeatherAbilities_Loop:
|
||||||
activateweatherchangeabilities BS_ATTACKER
|
copybyte sBATTLER, gBattlerTarget
|
||||||
|
activateweatherchangeabilities BS_TARGET
|
||||||
BattleScript_ActivateWeatherAbilities_Increment:
|
BattleScript_ActivateWeatherAbilities_Increment:
|
||||||
addbyte gBattlerAttacker, 1
|
addbyte gBattlerTarget, 1
|
||||||
jumpifbytenotequal gBattlerAttacker, gBattlersCount, BattleScript_ActivateWeatherAbilities_Loop
|
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_ActivateWeatherAbilities_Loop
|
||||||
copybyte gBattlerAttacker, sBATTLER
|
restoretarget
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_TryAdrenalineOrb:
|
BattleScript_TryAdrenalineOrb:
|
||||||
|
@ -469,6 +469,7 @@ extern const u8 BattleScript_MoveEffectStockpileWoreOff[];
|
|||||||
extern const u8 BattleScript_StealthRockActivates[];
|
extern const u8 BattleScript_StealthRockActivates[];
|
||||||
extern const u8 BattleScript_SpikesActivates[];
|
extern const u8 BattleScript_SpikesActivates[];
|
||||||
extern const u8 BattleScript_BerserkGeneRet[];
|
extern const u8 BattleScript_BerserkGeneRet[];
|
||||||
|
extern const u8 BattleScript_TargetFormChangeWithStringNoPopup[];
|
||||||
|
|
||||||
// zmoves
|
// zmoves
|
||||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||||
|
@ -139,7 +139,6 @@ void TryClearRageAndFuryCutter(void);
|
|||||||
u8 AtkCanceller_UnableToUseMove(void);
|
u8 AtkCanceller_UnableToUseMove(void);
|
||||||
u8 AtkCanceller_UnableToUseMove2(void);
|
u8 AtkCanceller_UnableToUseMove2(void);
|
||||||
bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2);
|
bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2);
|
||||||
u8 TryWeatherFormChange(u8 battlerId);
|
|
||||||
bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility);
|
bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility);
|
||||||
u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u16 ability, u8 special, u16 moveArg);
|
u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u16 ability, u8 special, u16 moveArg);
|
||||||
bool32 IsNeutralizingGasOnField(void);
|
bool32 IsNeutralizingGasOnField(void);
|
||||||
|
@ -89,6 +89,7 @@
|
|||||||
|
|
||||||
// Form change that activates when a specific weather is set during battle.
|
// Form change that activates when a specific weather is set during battle.
|
||||||
// param1: weather to check
|
// param1: weather to check
|
||||||
|
// param2: (optional) revert if specified ability is lost
|
||||||
#define FORM_CHANGE_BATTLE_WEATHER 14
|
#define FORM_CHANGE_BATTLE_WEATHER 14
|
||||||
|
|
||||||
// Form change that activates automatically when the turn ends.
|
// Form change that activates automatically when the turn ends.
|
||||||
|
@ -16444,7 +16444,8 @@ u8 GetFirstFaintedPartyIndex(u8 battlerId)
|
|||||||
return PARTY_SIZE;
|
return PARTY_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BS_ItemRestoreHP(void) {
|
void BS_ItemRestoreHP(void)
|
||||||
|
{
|
||||||
NATIVE_ARGS();
|
NATIVE_ARGS();
|
||||||
u16 healAmount;
|
u16 healAmount;
|
||||||
u32 battlerId = MAX_BATTLERS_COUNT;
|
u32 battlerId = MAX_BATTLERS_COUNT;
|
||||||
@ -16506,7 +16507,8 @@ void BS_ItemRestoreHP(void) {
|
|||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BS_ItemCureStatus(void) {
|
void BS_ItemCureStatus(void)
|
||||||
|
{
|
||||||
NATIVE_ARGS();
|
NATIVE_ARGS();
|
||||||
struct Pokemon *party = GetBattlerParty(gBattlerAttacker);
|
struct Pokemon *party = GetBattlerParty(gBattlerAttacker);
|
||||||
|
|
||||||
@ -16534,7 +16536,8 @@ void BS_ItemCureStatus(void) {
|
|||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BS_ItemIncreaseStat(void) {
|
void BS_ItemIncreaseStat(void)
|
||||||
|
{
|
||||||
NATIVE_ARGS();
|
NATIVE_ARGS();
|
||||||
u16 statId = GetItemEffect(gLastUsedItem)[1];
|
u16 statId = GetItemEffect(gLastUsedItem)[1];
|
||||||
u16 stages = ItemId_GetHoldEffectParam(gLastUsedItem);
|
u16 stages = ItemId_GetHoldEffectParam(gLastUsedItem);
|
||||||
@ -16542,7 +16545,8 @@ void BS_ItemIncreaseStat(void) {
|
|||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BS_ItemRestorePP(void) {
|
void BS_ItemRestorePP(void)
|
||||||
|
{
|
||||||
NATIVE_ARGS();
|
NATIVE_ARGS();
|
||||||
const u8 *effect = GetItemEffect(gLastUsedItem);
|
const u8 *effect = GetItemEffect(gLastUsedItem);
|
||||||
u32 i, pp, maxPP, moveId, loopEnd;
|
u32 i, pp, maxPP, moveId, loopEnd;
|
||||||
@ -16594,6 +16598,19 @@ void BS_ItemRestorePP(void) {
|
|||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BS_TryRevertWeatherForm(void)
|
||||||
|
{
|
||||||
|
NATIVE_ARGS();
|
||||||
|
if (TryBattleFormChange(gBattlerTarget, FORM_CHANGE_BATTLE_WEATHER))
|
||||||
|
{
|
||||||
|
gBattleScripting.battler = gBattlerTarget;
|
||||||
|
BattleScriptPush(cmd->nextInstr);
|
||||||
|
gBattlescriptCurrInstr = BattleScript_TargetFormChangeWithStringNoPopup;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
|
}
|
||||||
|
|
||||||
void BS_SetSnow(void)
|
void BS_SetSnow(void)
|
||||||
{
|
{
|
||||||
NATIVE_ARGS();
|
NATIVE_ARGS();
|
||||||
|
@ -4003,96 +4003,6 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 TryWeatherFormChange(u8 battler)
|
|
||||||
{
|
|
||||||
u8 ret = 0;
|
|
||||||
bool32 weatherEffect = WEATHER_HAS_EFFECT;
|
|
||||||
u16 holdEffect = GetBattlerHoldEffect(battler, TRUE);
|
|
||||||
|
|
||||||
switch (gBattleMons[battler].species)
|
|
||||||
{
|
|
||||||
case SPECIES_CASTFORM:
|
|
||||||
/* Placeholder
|
|
||||||
case SPECIES_CASTFORM_RAINY:
|
|
||||||
case SPECIES_CASTFORM_SNOWY:
|
|
||||||
case SPECIES_CASTFORM_SUNNY:*/
|
|
||||||
#if B_WEATHER_FORMS >= GEN_5
|
|
||||||
if (gBattleMons[battler].hp == 0)
|
|
||||||
{
|
|
||||||
ret = 0; // No change
|
|
||||||
}
|
|
||||||
else if (GetBattlerAbility(battler) != ABILITY_FORECAST || !weatherEffect)
|
|
||||||
{
|
|
||||||
if (!IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL))
|
|
||||||
{
|
|
||||||
SET_BATTLER_TYPE(battler, TYPE_NORMAL);
|
|
||||||
ret = CASTFORM_NORMAL + 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ret = 0; // No change
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (GetBattlerAbility(battler) != ABILITY_FORECAST || gBattleMons[battler].hp == 0)
|
|
||||||
{
|
|
||||||
ret = 0; // No change
|
|
||||||
}
|
|
||||||
else if (!weatherEffect)
|
|
||||||
{
|
|
||||||
if (!IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL))
|
|
||||||
{
|
|
||||||
SET_BATTLER_TYPE(battler, TYPE_NORMAL);
|
|
||||||
ret = CASTFORM_NORMAL + 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ret = 0; // No change
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA || (!(gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_SUN | B_WEATHER_HAIL | B_WEATHER_SNOW)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)))
|
|
||||||
{
|
|
||||||
SET_BATTLER_TYPE(battler, TYPE_NORMAL);
|
|
||||||
ret = CASTFORM_NORMAL + 1;
|
|
||||||
}
|
|
||||||
else if (gBattleWeather & B_WEATHER_SUN && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE))
|
|
||||||
{
|
|
||||||
SET_BATTLER_TYPE(battler, TYPE_FIRE);
|
|
||||||
ret = CASTFORM_FIRE + 1;
|
|
||||||
}
|
|
||||||
else if (gBattleWeather & B_WEATHER_RAIN && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER))
|
|
||||||
{
|
|
||||||
SET_BATTLER_TYPE(battler, TYPE_WATER);
|
|
||||||
ret = CASTFORM_WATER + 1;
|
|
||||||
}
|
|
||||||
else if (gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW) && !IS_BATTLER_OF_TYPE(battler, TYPE_ICE))
|
|
||||||
{
|
|
||||||
SET_BATTLER_TYPE(battler, TYPE_ICE);
|
|
||||||
ret = CASTFORM_ICE + 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SPECIES_CHERRIM:
|
|
||||||
// case SPECIES_CHERRIM_SUNSHINE:
|
|
||||||
if (gBattleMons[battler].hp == 0)
|
|
||||||
ret = 0; // No change
|
|
||||||
#if B_WEATHER_FORMS >= GEN_5
|
|
||||||
if (GetBattlerAbility(battler) != ABILITY_FLOWER_GIFT)
|
|
||||||
if (gBattleMonForms[battler] != 0)
|
|
||||||
ret = CHERRIM_OVERCAST + 1;
|
|
||||||
else
|
|
||||||
ret = 0; // No change
|
|
||||||
#endif
|
|
||||||
else if (gBattleMonForms[battler] == 0 && weatherEffect && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & B_WEATHER_SUN)
|
|
||||||
ret = CHERRIM_SUNSHINE + 1;
|
|
||||||
else if (gBattleMonForms[battler] != 0 && (!weatherEffect || holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA || !(gBattleWeather & B_WEATHER_SUN)))
|
|
||||||
ret = CHERRIM_OVERCAST + 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const u16 sWeatherFlagsInfo[][3] =
|
static const u16 sWeatherFlagsInfo[][3] =
|
||||||
{
|
{
|
||||||
[ENUM_WEATHER_RAIN] = {B_WEATHER_RAIN_TEMPORARY, B_WEATHER_RAIN_PERMANENT, HOLD_EFFECT_DAMP_ROCK},
|
[ENUM_WEATHER_RAIN] = {B_WEATHER_RAIN_TEMPORARY, B_WEATHER_RAIN_PERMANENT, HOLD_EFFECT_DAMP_ROCK},
|
||||||
@ -4845,12 +4755,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if B_WEATHER_FORMS < GEN_5
|
|
||||||
default:
|
|
||||||
if (gBattleMons[battler].species == SPECIES_CHERRIM)
|
|
||||||
goto TRY_WEATHER_FORM;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITYEFFECT_ENDTURN: // 1
|
case ABILITYEFFECT_ENDTURN: // 1
|
||||||
@ -6120,12 +6024,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||||||
switch (gLastUsedAbility)
|
switch (gLastUsedAbility)
|
||||||
{
|
{
|
||||||
case ABILITY_FORECAST:
|
case ABILITY_FORECAST:
|
||||||
#if B_WEATHER_FORMS >= GEN_5
|
|
||||||
case ABILITY_FLOWER_GIFT:
|
case ABILITY_FLOWER_GIFT:
|
||||||
#else
|
if ((IsBattlerWeatherAffected(battler, gBattleWeather)
|
||||||
TRY_WEATHER_FORM:
|
|| gBattleWeather == B_WEATHER_NONE
|
||||||
#endif
|
|| !WEATHER_HAS_EFFECT) // Air Lock active
|
||||||
if ((IsBattlerWeatherAffected(battler, gBattleWeather) || gBattleWeather == B_WEATHER_NONE)
|
|
||||||
&& TryBattleFormChange(battler, FORM_CHANGE_BATTLE_WEATHER))
|
&& TryBattleFormChange(battler, FORM_CHANGE_BATTLE_WEATHER))
|
||||||
{
|
{
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);
|
BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);
|
||||||
@ -9318,7 +9220,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case ABILITY_FLOWER_GIFT:
|
case ABILITY_FLOWER_GIFT:
|
||||||
if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move))
|
if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move))
|
||||||
MulModifier(&modifier, UQ_4_12(1.5));
|
MulModifier(&modifier, UQ_4_12(1.5));
|
||||||
break;
|
break;
|
||||||
case ABILITY_HUSTLE:
|
case ABILITY_HUSTLE:
|
||||||
@ -9358,7 +9260,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
|
|||||||
switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk)))
|
switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk)))
|
||||||
{
|
{
|
||||||
case ABILITY_FLOWER_GIFT:
|
case ABILITY_FLOWER_GIFT:
|
||||||
if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move))
|
if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move))
|
||||||
MulModifier(&modifier, UQ_4_12(1.5));
|
MulModifier(&modifier, UQ_4_12(1.5));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -9492,7 +9394,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_FLOWER_GIFT:
|
case ABILITY_FLOWER_GIFT:
|
||||||
if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN) && !usesDefStat)
|
if (gBattleMons[battlerDef].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN) && !usesDefStat)
|
||||||
MulModifier(&modifier, UQ_4_12(1.5));
|
MulModifier(&modifier, UQ_4_12(1.5));
|
||||||
break;
|
break;
|
||||||
case ABILITY_PUNK_ROCK:
|
case ABILITY_PUNK_ROCK:
|
||||||
@ -9511,7 +9413,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
|
|||||||
switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef)))
|
switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef)))
|
||||||
{
|
{
|
||||||
case ABILITY_FLOWER_GIFT:
|
case ABILITY_FLOWER_GIFT:
|
||||||
if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerDef), B_WEATHER_SUN) && !usesDefStat)
|
if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerDef), B_WEATHER_SUN) && !usesDefStat)
|
||||||
MulModifier(&modifier, UQ_4_12(1.5));
|
MulModifier(&modifier, UQ_4_12(1.5));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -10239,9 +10141,25 @@ u16 GetBattleFormChangeTargetSpecies(u8 battlerId, u16 method)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FORM_CHANGE_BATTLE_WEATHER:
|
case FORM_CHANGE_BATTLE_WEATHER:
|
||||||
if (gBattleWeather & formChanges[i].param1
|
// Check if there is a required ability and if the battler's ability does not match it
|
||||||
|| (gBattleWeather == B_WEATHER_NONE && formChanges[i].param1 == B_WEATHER_NONE))
|
// or is suppressed. If so, revert to the no weather form.
|
||||||
|
if (formChanges[i].param2
|
||||||
|
&& GetBattlerAbility(battlerId) != formChanges[i].param2
|
||||||
|
&& formChanges[i].param1 == B_WEATHER_NONE)
|
||||||
|
{
|
||||||
targetSpecies = formChanges[i].targetSpecies;
|
targetSpecies = formChanges[i].targetSpecies;
|
||||||
|
}
|
||||||
|
// We need to revert the weather form if the field is under Air Lock, too.
|
||||||
|
else if (!WEATHER_HAS_EFFECT && formChanges[i].param1 == B_WEATHER_NONE)
|
||||||
|
{
|
||||||
|
targetSpecies = formChanges[i].targetSpecies;
|
||||||
|
}
|
||||||
|
// Otherwise, just check for a match between the weather and the form change table.
|
||||||
|
else if (gBattleWeather & formChanges[i].param1
|
||||||
|
|| (gBattleWeather == B_WEATHER_NONE && formChanges[i].param1 == B_WEATHER_NONE))
|
||||||
|
{
|
||||||
|
targetSpecies = formChanges[i].targetSpecies;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case FORM_CHANGE_BATTLE_TURN_END:
|
case FORM_CHANGE_BATTLE_TURN_END:
|
||||||
if (formChanges[i].param1 == GetBattlerAbility(battlerId))
|
if (formChanges[i].param1 == GetBattlerAbility(battlerId))
|
||||||
|
@ -92,6 +92,8 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] =
|
|||||||
[SPECIES_BURMY] = sBurmyFormChangeTable,
|
[SPECIES_BURMY] = sBurmyFormChangeTable,
|
||||||
[SPECIES_BURMY_SANDY_CLOAK] = sBurmyFormChangeTable,
|
[SPECIES_BURMY_SANDY_CLOAK] = sBurmyFormChangeTable,
|
||||||
[SPECIES_BURMY_TRASH_CLOAK] = sBurmyFormChangeTable,
|
[SPECIES_BURMY_TRASH_CLOAK] = sBurmyFormChangeTable,
|
||||||
|
[SPECIES_CHERRIM] = sCherrimFormChangeTable,
|
||||||
|
[SPECIES_CHERRIM_SUNSHINE] = sCherrimFormChangeTable,
|
||||||
[SPECIES_LOPUNNY] = sLopunnyFormChangeTable,
|
[SPECIES_LOPUNNY] = sLopunnyFormChangeTable,
|
||||||
[SPECIES_LOPUNNY_MEGA] = sLopunnyFormChangeTable,
|
[SPECIES_LOPUNNY_MEGA] = sLopunnyFormChangeTable,
|
||||||
[SPECIES_GARCHOMP] = sGarchompFormChangeTable,
|
[SPECIES_GARCHOMP] = sGarchompFormChangeTable,
|
||||||
|
@ -156,11 +156,19 @@ static const struct FormChange sAbsolFormChangeTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct FormChange sCastformFormChangeTable[] = {
|
static const struct FormChange sCastformFormChangeTable[] = {
|
||||||
|
#if B_WEATHER_FORMS >= GEN_5
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SUNNY, B_WEATHER_SUN, ABILITY_FORECAST},
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_RAINY, B_WEATHER_RAIN, ABILITY_FORECAST},
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SNOWY, B_WEATHER_HAIL | B_WEATHER_SNOW, ABILITY_FORECAST},
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, ~(B_WEATHER_SUN | B_WEATHER_RAIN | B_WEATHER_HAIL | B_WEATHER_SNOW), ABILITY_FORECAST},
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, B_WEATHER_NONE, ABILITY_FORECAST},
|
||||||
|
#else
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SUNNY, B_WEATHER_SUN},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SUNNY, B_WEATHER_SUN},
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_RAINY, B_WEATHER_RAIN},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_RAINY, B_WEATHER_RAIN},
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SNOWY, B_WEATHER_HAIL},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SNOWY, B_WEATHER_HAIL | B_WEATHER_SNOW},
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, ~(B_WEATHER_SUN | B_WEATHER_RAIN | B_WEATHER_HAIL)},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, ~(B_WEATHER_SUN | B_WEATHER_RAIN | B_WEATHER_HAIL | B_WEATHER_SNOW)},
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, B_WEATHER_NONE},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, B_WEATHER_NONE},
|
||||||
|
#endif
|
||||||
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CASTFORM},
|
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CASTFORM},
|
||||||
{FORM_CHANGE_FAINT, SPECIES_CASTFORM},
|
{FORM_CHANGE_FAINT, SPECIES_CASTFORM},
|
||||||
{FORM_CHANGE_END_BATTLE, SPECIES_CASTFORM},
|
{FORM_CHANGE_END_BATTLE, SPECIES_CASTFORM},
|
||||||
@ -231,9 +239,15 @@ static const struct FormChange sBurmyFormChangeTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct FormChange sCherrimFormChangeTable[] = {
|
static const struct FormChange sCherrimFormChangeTable[] = {
|
||||||
|
#if B_WEATHER_FORMS >= GEN_5
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_SUNSHINE, B_WEATHER_SUN, ABILITY_FLOWER_GIFT},
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM, ~B_WEATHER_SUN, ABILITY_FLOWER_GIFT},
|
||||||
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM, B_WEATHER_NONE, ABILITY_FLOWER_GIFT},
|
||||||
|
#else
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_SUNSHINE, B_WEATHER_SUN},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM_SUNSHINE, B_WEATHER_SUN},
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM, ~B_WEATHER_SUN},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM, ~B_WEATHER_SUN},
|
||||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM, B_WEATHER_NONE},
|
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CHERRIM, B_WEATHER_NONE},
|
||||||
|
#endif
|
||||||
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CHERRIM},
|
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CHERRIM},
|
||||||
{FORM_CHANGE_FAINT, SPECIES_CHERRIM},
|
{FORM_CHANGE_FAINT, SPECIES_CHERRIM},
|
||||||
{FORM_CHANGE_END_BATTLE, SPECIES_CHERRIM},
|
{FORM_CHANGE_END_BATTLE, SPECIES_CHERRIM},
|
||||||
|
123
test/ability_flower_gift.c
Normal file
123
test/ability_flower_gift.c
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "test_battle.h"
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim in harsh sunlight")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CHERRIM) { Ability(ABILITY_FLOWER_GIFT); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Cherrim transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when weather changes")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CHERRIM) { Ability(ABILITY_FLOWER_GIFT); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||||
|
TURN { MOVE(opponent, MOVE_RAIN_DANCE); }
|
||||||
|
} SCENE {
|
||||||
|
// transforms in sun
|
||||||
|
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Cherrim transformed!");
|
||||||
|
// back to normal
|
||||||
|
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Cherrim transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when its ability is suppressed")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(B_WEATHER_FORMS >= GEN_5);
|
||||||
|
PLAYER(SPECIES_CHERRIM) { Ability(ABILITY_FLOWER_GIFT); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||||
|
TURN { MOVE(opponent, MOVE_GASTRO_ACID); }
|
||||||
|
} SCENE {
|
||||||
|
// transforms in sun
|
||||||
|
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Cherrim transformed!");
|
||||||
|
// back to normal
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Cherrim transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DOUBLE_BATTLE_TEST("Flower Gift increases the attack of Cherrim and its allies by 1.5x", s16 damageL, s16 damageR)
|
||||||
|
{
|
||||||
|
bool32 sunny;
|
||||||
|
PARAMETRIZE { sunny = FALSE; }
|
||||||
|
PARAMETRIZE { sunny = TRUE; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CHERRIM) { Ability(ABILITY_FLOWER_GIFT); };
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
if (sunny)
|
||||||
|
TURN { MOVE(playerLeft, MOVE_SUNNY_DAY); }
|
||||||
|
TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft);
|
||||||
|
MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); }
|
||||||
|
} SCENE {
|
||||||
|
// sun activates
|
||||||
|
if (sunny) {
|
||||||
|
ABILITY_POPUP(playerLeft, ABILITY_FLOWER_GIFT);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft);
|
||||||
|
MESSAGE("Cherrim transformed!");
|
||||||
|
}
|
||||||
|
// player uses Tackle
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerLeft);
|
||||||
|
HP_BAR(opponentLeft, captureDamage: &results[i].damageL);
|
||||||
|
// partner uses Tackle
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerRight);
|
||||||
|
HP_BAR(opponentLeft, captureDamage: &results[i].damageR);
|
||||||
|
} FINALLY {
|
||||||
|
EXPECT_MUL_EQ(results[0].damageL, UQ_4_12(1.5), results[1].damageL);
|
||||||
|
EXPECT_MUL_EQ(results[0].damageR, UQ_4_12(1.5), results[1].damageR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DOUBLE_BATTLE_TEST("Flower Gift increases the Sp. Def of Cherrim and its allies by 1.5x", s16 damageL, s16 damageR)
|
||||||
|
{
|
||||||
|
bool32 sunny;
|
||||||
|
PARAMETRIZE { sunny = FALSE; }
|
||||||
|
PARAMETRIZE { sunny = TRUE; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CHERRIM) { Ability(ABILITY_FLOWER_GIFT); };
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
if (sunny)
|
||||||
|
TURN { MOVE(playerLeft, MOVE_SUNNY_DAY); }
|
||||||
|
TURN { MOVE(opponentLeft, MOVE_HYPER_VOICE, target: playerLeft); }
|
||||||
|
} SCENE {
|
||||||
|
// sun activates
|
||||||
|
if (sunny) {
|
||||||
|
ABILITY_POPUP(playerLeft, ABILITY_FLOWER_GIFT);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft);
|
||||||
|
MESSAGE("Cherrim transformed!");
|
||||||
|
}
|
||||||
|
// opponentLeft uses Hyper Voice
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, opponentLeft);
|
||||||
|
HP_BAR(playerLeft, captureDamage: &results[i].damageL);
|
||||||
|
HP_BAR(playerRight, captureDamage: &results[i].damageR);
|
||||||
|
} FINALLY {
|
||||||
|
EXPECT_MUL_EQ(results[1].damageL, UQ_4_12(1.5), results[0].damageL);
|
||||||
|
EXPECT_MUL_EQ(results[1].damageR, UQ_4_12(1.5), results[0].damageR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TO_DO_BATTLE_TEST("Flower Gift does not transform Cherrim back to normal when suppressed if Cherrim is Dynamaxed");
|
255
test/ability_forecast.c
Normal file
255
test/ability_forecast.c
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "test_battle.h"
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an opponent's move")
|
||||||
|
{
|
||||||
|
u32 move;
|
||||||
|
PARAMETRIZE { move = MOVE_SUNNY_DAY; }
|
||||||
|
PARAMETRIZE { move = MOVE_RAIN_DANCE; }
|
||||||
|
PARAMETRIZE { move = MOVE_HAIL; }
|
||||||
|
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, move); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from its own move")
|
||||||
|
{
|
||||||
|
u32 move;
|
||||||
|
PARAMETRIZE { move = MOVE_SUNNY_DAY; }
|
||||||
|
PARAMETRIZE { move = MOVE_RAIN_DANCE; }
|
||||||
|
PARAMETRIZE { move = MOVE_HAIL; }
|
||||||
|
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, move); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DOUBLE_BATTLE_TEST("Forecast transforms Castform in weather from a partner's move")
|
||||||
|
{
|
||||||
|
u32 move;
|
||||||
|
PARAMETRIZE { move = MOVE_SUNNY_DAY; }
|
||||||
|
PARAMETRIZE { move = MOVE_RAIN_DANCE; }
|
||||||
|
PARAMETRIZE { move = MOVE_HAIL; }
|
||||||
|
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(playerRight, move); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(playerLeft, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DOUBLE_BATTLE_TEST("Forecast transforms all Castforms present in weather")
|
||||||
|
{
|
||||||
|
u32 move;
|
||||||
|
PARAMETRIZE { move = MOVE_SUNNY_DAY; }
|
||||||
|
PARAMETRIZE { move = MOVE_RAIN_DANCE; }
|
||||||
|
PARAMETRIZE { move = MOVE_HAIL; }
|
||||||
|
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(playerRight, move); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(playerLeft, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
ABILITY_POPUP(opponentLeft, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponentLeft);
|
||||||
|
MESSAGE("Foe Castform transformed!");
|
||||||
|
ABILITY_POPUP(playerRight, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerRight);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
ABILITY_POPUP(opponentRight, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponentRight);
|
||||||
|
MESSAGE("Foe Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an ability")
|
||||||
|
{
|
||||||
|
u32 species, ability;
|
||||||
|
PARAMETRIZE { species = SPECIES_KYOGRE; ability = ABILITY_DRIZZLE; }
|
||||||
|
PARAMETRIZE { species = SPECIES_GROUDON; ability = ABILITY_DROUGHT; }
|
||||||
|
PARAMETRIZE { species = SPECIES_ABOMASNOW; ability = ABILITY_SNOW_WARNING; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(species) { Ability(ability); };
|
||||||
|
} WHEN {
|
||||||
|
TURN { SWITCH(opponent, 1); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform in primal weather")
|
||||||
|
{
|
||||||
|
u32 species, item, ability;
|
||||||
|
PARAMETRIZE { species = SPECIES_KYOGRE; ability = ABILITY_PRIMORDIAL_SEA; item = ITEM_BLUE_ORB; }
|
||||||
|
PARAMETRIZE { species = SPECIES_GROUDON; ability = ABILITY_DESOLATE_LAND; item = ITEM_RED_ORB; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(species) { Item(item); };
|
||||||
|
} WHEN {
|
||||||
|
TURN { SWITCH(opponent, 1); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ability);
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when weather expires")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_RAIN_DANCE); }
|
||||||
|
TURN { }
|
||||||
|
TURN { }
|
||||||
|
TURN { }
|
||||||
|
TURN { }
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
// transforms
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
// back to normal
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when Sandstorm is active")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_RAIN_DANCE); }
|
||||||
|
TURN { MOVE(player, MOVE_SANDSTORM); }
|
||||||
|
} SCENE {
|
||||||
|
// transforms
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
// back to normal
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_RAYQUAZA);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_RAIN_DANCE); }
|
||||||
|
TURN { SWITCH(opponent, 1); }
|
||||||
|
TURN { MOVE(opponent, MOVE_CELEBRATE, megaEvolve: TRUE); }
|
||||||
|
} SCENE {
|
||||||
|
// transforms
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
// back to normal
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_AIR_LOCK);
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform on switch-in")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_RAIN_DANCE); }
|
||||||
|
TURN { SWITCH(player, 1); }
|
||||||
|
} SCENE {
|
||||||
|
// turn 1
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_RAIN_DANCE, player);
|
||||||
|
// turn 2
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform when weather changes")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_RAIN_DANCE); }
|
||||||
|
TURN { MOVE(player, MOVE_SUNNY_DAY); }
|
||||||
|
} SCENE {
|
||||||
|
// transforms
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
// transforms again
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when its ability is suppressed")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(B_WEATHER_FORMS >= GEN_5);
|
||||||
|
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||||
|
TURN { MOVE(opponent, MOVE_GASTRO_ACID); }
|
||||||
|
} SCENE {
|
||||||
|
// transforms in sun
|
||||||
|
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
// back to normal
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||||
|
MESSAGE("Castform transformed!");
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user