Fixes to Protosynthesis, Quark Drive, Beast Boost, Orichalcum Pulse, Hadron Engine (#5447)
* Protosynthesis & Quark Drive interactions; Fixes to Beast Boost/Protosynthesis/Quark Drive stat tie priority, Orichalcum Pulse and Hadron Engine stat boost * Protosynthesis + Quark Drive tests * Update src/battle_util.c * Update src/battle_util.c * Update src/battle_util.c * Update src/battle_util.c * Update src/battle_util.c * Update src/battle_util.c --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
parent
be5f2e095e
commit
91325e83c1
5 changed files with 260 additions and 20 deletions
|
@ -4743,9 +4743,9 @@ u32 GetBattlerTotalSpeedStatArgs(u32 battler, u32 ability, u32 holdEffect)
|
||||||
speed *= 2;
|
speed *= 2;
|
||||||
else if (ability == ABILITY_SLOW_START && gDisableStructs[battler].slowStartTimer != 0)
|
else if (ability == ABILITY_SLOW_START && gDisableStructs[battler].slowStartTimer != 0)
|
||||||
speed /= 2;
|
speed /= 2;
|
||||||
else if (ability == ABILITY_PROTOSYNTHESIS && (gBattleWeather & B_WEATHER_SUN || gBattleStruct->boosterEnergyActivates & gBitTable[battler]))
|
else if (ability == ABILITY_PROTOSYNTHESIS && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) && ((gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT) || gBattleStruct->boosterEnergyActivates & (1u << battler)))
|
||||||
speed = (GetHighestStatId(battler) == STAT_SPEED) ? (speed * 150) / 100 : speed;
|
speed = (GetHighestStatId(battler) == STAT_SPEED) ? (speed * 150) / 100 : speed;
|
||||||
else if (ability == ABILITY_QUARK_DRIVE && (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & gBitTable[battler]))
|
else if (ability == ABILITY_QUARK_DRIVE && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) && (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & (1u << battler)))
|
||||||
speed = (GetHighestStatId(battler) == STAT_SPEED) ? (speed * 150) / 100 : speed;
|
speed = (GetHighestStatId(battler) == STAT_SPEED) ? (speed * 150) / 100 : speed;
|
||||||
|
|
||||||
// stat stages
|
// stat stages
|
||||||
|
|
|
@ -8777,12 +8777,15 @@ u32 GetHighestStatId(u32 battler)
|
||||||
for (i = STAT_DEF; i < NUM_STATS; i++)
|
for (i = STAT_DEF; i < NUM_STATS; i++)
|
||||||
{
|
{
|
||||||
u16 *statVal = &gBattleMons[battler].attack + (i - 1);
|
u16 *statVal = &gBattleMons[battler].attack + (i - 1);
|
||||||
if (*statVal > highestStat)
|
if (*statVal > highestStat && i != STAT_SPEED)
|
||||||
{
|
{
|
||||||
highestStat = *statVal;
|
highestStat = *statVal;
|
||||||
highestId = i;
|
highestId = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (gBattleMons[battler].speed > highestStat)
|
||||||
|
highestId = STAT_SPEED;
|
||||||
|
|
||||||
return highestId;
|
return highestId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6329,7 +6329,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_PROTOSYNTHESIS:
|
case ABILITY_PROTOSYNTHESIS:
|
||||||
if (!gDisableStructs[battler].weatherAbilityDone && IsBattlerWeatherAffected(battler, B_WEATHER_SUN))
|
if (!gDisableStructs[battler].weatherAbilityDone
|
||||||
|
&& (gBattleWeather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT
|
||||||
|
&& !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)
|
||||||
|
&& !(gBattleStruct->boosterEnergyActivates & (1u << battler)))
|
||||||
{
|
{
|
||||||
gDisableStructs[battler].weatherAbilityDone = TRUE;
|
gDisableStructs[battler].weatherAbilityDone = TRUE;
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
||||||
|
@ -6355,7 +6358,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_QUARK_DRIVE:
|
case ABILITY_QUARK_DRIVE:
|
||||||
if (!gDisableStructs[battler].terrainAbilityDone && IsBattlerTerrainAffected(battler, STATUS_FIELD_ELECTRIC_TERRAIN))
|
if (!gDisableStructs[battler].terrainAbilityDone
|
||||||
|
&& gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN
|
||||||
|
&& !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)
|
||||||
|
&& !(gBattleStruct->boosterEnergyActivates & (1u << battler)))
|
||||||
{
|
{
|
||||||
gDisableStructs[battler].terrainAbilityDone = TRUE;
|
gDisableStructs[battler].terrainAbilityDone = TRUE;
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
||||||
|
@ -7594,7 +7600,8 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
||||||
break;
|
break;
|
||||||
case HOLD_EFFECT_BOOSTER_ENERGY:
|
case HOLD_EFFECT_BOOSTER_ENERGY:
|
||||||
if (!(gBattleStruct->boosterEnergyActivates & gBitTable[battler])
|
if (!(gBattleStruct->boosterEnergyActivates & gBitTable[battler])
|
||||||
&& (((GetBattlerAbility(battler) == ABILITY_PROTOSYNTHESIS) && !(gBattleWeather & B_WEATHER_SUN))
|
&& !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)
|
||||||
|
&& (((GetBattlerAbility(battler) == ABILITY_PROTOSYNTHESIS) && !((gBattleWeather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT))
|
||||||
|| ((GetBattlerAbility(battler) == ABILITY_QUARK_DRIVE) && !(gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN))))
|
|| ((GetBattlerAbility(battler) == ABILITY_QUARK_DRIVE) && !(gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN))))
|
||||||
{
|
{
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
||||||
|
@ -7861,7 +7868,8 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
||||||
break;
|
break;
|
||||||
case HOLD_EFFECT_BOOSTER_ENERGY:
|
case HOLD_EFFECT_BOOSTER_ENERGY:
|
||||||
if (!(gBattleStruct->boosterEnergyActivates & gBitTable[battler])
|
if (!(gBattleStruct->boosterEnergyActivates & gBitTable[battler])
|
||||||
&& (((GetBattlerAbility(battler) == ABILITY_PROTOSYNTHESIS) && !(gBattleWeather & B_WEATHER_SUN))
|
&& !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)
|
||||||
|
&& (((GetBattlerAbility(battler) == ABILITY_PROTOSYNTHESIS) && !((gBattleWeather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT))
|
||||||
|| ((GetBattlerAbility(battler) == ABILITY_QUARK_DRIVE) && !(gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN))))
|
|| ((GetBattlerAbility(battler) == ABILITY_QUARK_DRIVE) && !(gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN))))
|
||||||
{
|
{
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
|
||||||
|
@ -9285,25 +9293,27 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32
|
||||||
case ABILITY_PROTOSYNTHESIS:
|
case ABILITY_PROTOSYNTHESIS:
|
||||||
{
|
{
|
||||||
u8 atkHighestStat = GetHighestStatId(battlerAtk);
|
u8 atkHighestStat = GetHighestStatId(battlerAtk);
|
||||||
if ((weather & B_WEATHER_SUN || gBattleStruct->boosterEnergyActivates & gBitTable[battlerAtk])
|
if (((weather & B_WEATHER_SUN && WEATHER_HAS_EFFECT) || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk))
|
||||||
&& ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK)))
|
&& ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))
|
||||||
|
&& !(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED))
|
||||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_QUARK_DRIVE:
|
case ABILITY_QUARK_DRIVE:
|
||||||
{
|
{
|
||||||
u8 atkHighestStat = GetHighestStatId(battlerAtk);
|
u8 atkHighestStat = GetHighestStatId(battlerAtk);
|
||||||
if ((gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & gBitTable[battlerAtk])
|
if ((gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk))
|
||||||
&& ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK)))
|
&& ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))
|
||||||
|
&& !(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED))
|
||||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_ORICHALCUM_PULSE:
|
case ABILITY_ORICHALCUM_PULSE:
|
||||||
if (weather & B_WEATHER_SUN)
|
if (weather & B_WEATHER_SUN && WEATHER_HAS_EFFECT && IS_MOVE_PHYSICAL(move))
|
||||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
||||||
break;
|
break;
|
||||||
case ABILITY_HADRON_ENGINE:
|
case ABILITY_HADRON_ENGINE:
|
||||||
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN)
|
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && IS_MOVE_SPECIAL(move))
|
||||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
||||||
break;
|
break;
|
||||||
case ABILITY_SHARPNESS:
|
case ABILITY_SHARPNESS:
|
||||||
|
@ -9363,16 +9373,18 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32
|
||||||
case ABILITY_PROTOSYNTHESIS:
|
case ABILITY_PROTOSYNTHESIS:
|
||||||
{
|
{
|
||||||
u8 defHighestStat = GetHighestStatId(battlerDef);
|
u8 defHighestStat = GetHighestStatId(battlerDef);
|
||||||
if ((weather & B_WEATHER_SUN || gBattleStruct->boosterEnergyActivates & gBitTable[battlerDef])
|
if (((weather & B_WEATHER_SUN && WEATHER_HAS_EFFECT) || gBattleStruct->boosterEnergyActivates & (1u << battlerDef))
|
||||||
&& ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF)))
|
&& ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF))
|
||||||
|
&& !(gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED))
|
||||||
modifier = uq4_12_multiply(modifier, UQ_4_12(0.7));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(0.7));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_QUARK_DRIVE:
|
case ABILITY_QUARK_DRIVE:
|
||||||
{
|
{
|
||||||
u8 defHighestStat = GetHighestStatId(battlerDef);
|
u8 defHighestStat = GetHighestStatId(battlerDef);
|
||||||
if ((gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & gBitTable[battlerDef])
|
if ((gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & (1u << battlerDef))
|
||||||
&& ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF)))
|
&& ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF))
|
||||||
|
&& !(gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED))
|
||||||
modifier = uq4_12_multiply(modifier, UQ_4_12(0.7));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(0.7));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -100,6 +100,125 @@ SINGLE_BATTLE_TEST("Protosynthesis activates on switch-in")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TO_DO_BATTLE_TEST("Protosynthesis activates in sun before Booster Energy");
|
SINGLE_BATTLE_TEST("Protosynthesis boosts Attack 1st in case of a stat tie")
|
||||||
TO_DO_BATTLE_TEST("Protosynthesis activates even if the Pokémon is holding an Utility Umbrella");
|
{
|
||||||
TO_DO_BATTLE_TEST("Protosynthesis doesn't activate if Cloud Nine/Air Lock is on the field");
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); Attack(5); Defense(5); SpAttack(5); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_GROUDON) { Ability(ABILITY_DROUGHT); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
|
||||||
|
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
MESSAGE("Great Tusk's Attack was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Protosynthesis boosts Defense 2nd in case of a stat tie")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); Attack(4); Defense(5); SpAttack(5); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_GROUDON) { Ability(ABILITY_DROUGHT); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
|
||||||
|
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
MESSAGE("Great Tusk's Defense was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Protosynthesis boosts Special Attack 3rd in case of a stat tie")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); Attack(4); Defense(4); SpAttack(5); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_GROUDON) { Ability(ABILITY_DROUGHT); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
|
||||||
|
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
MESSAGE("Great Tusk's Sp. Atk was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Protosynthesis boosts Special Defense 4th in case of a stat tie")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); Attack(4); Defense(4); SpAttack(4); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_GROUDON) { Ability(ABILITY_DROUGHT); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
|
||||||
|
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
MESSAGE("Great Tusk's Sp. Def was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Protosynthesis activates in Sun before Booster Energy")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); Item(ITEM_BOOSTER_ENERGY); }
|
||||||
|
OPPONENT(SPECIES_NINETALES) { Ability(ABILITY_DROUGHT); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { SWITCH(player, 1); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
|
||||||
|
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(player->item, ITEM_BOOSTER_ENERGY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Protosynthesis doesn't activate for a transformed battler")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); Item(ITEM_BOOSTER_ENERGY); }
|
||||||
|
OPPONENT(SPECIES_NINETALES) { Ability(ABILITY_DROUGHT); Item(ITEM_BOOSTER_ENERGY); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TRANSFORM); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
|
||||||
|
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRANSFORM, opponent);
|
||||||
|
NOT ABILITY_POPUP(opponent, ABILITY_PROTOSYNTHESIS);
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(player->item, ITEM_BOOSTER_ENERGY);
|
||||||
|
EXPECT_EQ(opponent->item, ITEM_BOOSTER_ENERGY);
|
||||||
|
EXPECT_EQ(opponent->ability, ABILITY_PROTOSYNTHESIS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Protosynthesis activates even if the Pokémon is holding an Utility Umbrella")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); Item(ITEM_UTILITY_UMBRELLA); }
|
||||||
|
OPPONENT(SPECIES_NINETALES) { Ability(ABILITY_DROUGHT); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
|
||||||
|
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Protosynthesis doesn't activate if Cloud Nine/Air Lock is on the field")
|
||||||
|
{
|
||||||
|
u32 species, ability;
|
||||||
|
PARAMETRIZE { species = SPECIES_RAYQUAZA; ability = ABILITY_AIR_LOCK; }
|
||||||
|
PARAMETRIZE { species = SPECIES_GOLDUCK; ability = ABILITY_CLOUD_NINE; }
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_GREAT_TUSK) { Ability(ABILITY_PROTOSYNTHESIS); }
|
||||||
|
OPPONENT(species) { Ability(ability); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ability);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUNNY_DAY, opponent);
|
||||||
|
NOT ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -100,3 +100,109 @@ SINGLE_BATTLE_TEST("Quark Drive activates on switch-in")
|
||||||
MESSAGE("Iron Moth's Sp. Atk was heightened!");
|
MESSAGE("Iron Moth's Sp. Atk was heightened!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Quark Drive activates on Electric Terrain even if not grounded")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gSpeciesInfo[SPECIES_IRON_JUGULIS].types[0] == TYPE_FLYING || gSpeciesInfo[SPECIES_IRON_JUGULIS].types[1] == TYPE_FLYING);
|
||||||
|
PLAYER(SPECIES_IRON_JUGULIS) { Ability(ABILITY_QUARK_DRIVE); }
|
||||||
|
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); };
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
|
||||||
|
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Quark Drive boosts Attack 1st in case of a stat tie")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_IRON_TREADS) { Ability(ABILITY_QUARK_DRIVE); Attack(5); Defense(5); SpAttack(5); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
|
||||||
|
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
|
||||||
|
MESSAGE("Iron Treads's Attack was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Quark Drive boosts Defense 2nd in case of a stat tie")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_IRON_TREADS) { Ability(ABILITY_QUARK_DRIVE); Attack(4); Defense(5); SpAttack(5); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
|
||||||
|
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
|
||||||
|
MESSAGE("Iron Treads's Defense was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Quark Drive boosts Special Attack 3rd in case of a stat tie")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_IRON_TREADS) { Ability(ABILITY_QUARK_DRIVE); Attack(4); Defense(4); SpAttack(5); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
|
||||||
|
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
|
||||||
|
MESSAGE("Iron Treads's Sp. Atk was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Quark Drive boosts Special Defense 4th in case of a stat tie")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_IRON_TREADS) { Ability(ABILITY_QUARK_DRIVE); Attack(4); Defense(4); SpAttack(4); SpDefense(5); Speed(5); }
|
||||||
|
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); Speed(5); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
|
||||||
|
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
|
||||||
|
MESSAGE("Iron Treads's Sp. Def was heightened!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Quark Drive activates in Electric Terrain before Booster Energy")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_IRON_TREADS) { Ability(ABILITY_QUARK_DRIVE); Item(ITEM_BOOSTER_ENERGY); }
|
||||||
|
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { SWITCH(player, 1); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
|
||||||
|
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(player->item, ITEM_BOOSTER_ENERGY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Quark Drive doesn't activate for a transformed battler")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_IRON_TREADS) { Ability(ABILITY_QUARK_DRIVE); Item(ITEM_BOOSTER_ENERGY); }
|
||||||
|
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); Item(ITEM_BOOSTER_ENERGY); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TRANSFORM); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
|
||||||
|
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRANSFORM, opponent);
|
||||||
|
NOT ABILITY_POPUP(opponent, ABILITY_QUARK_DRIVE);
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(player->item, ITEM_BOOSTER_ENERGY);
|
||||||
|
EXPECT_EQ(opponent->item, ITEM_BOOSTER_ENERGY);
|
||||||
|
EXPECT_EQ(opponent->ability, ABILITY_QUARK_DRIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue