Reverted Intrepid Sword and Dauntless Shield field unification (#4171)
* Reverts back Intrepid Sword and Dauntless Shield field unification * fixes
This commit is contained in:
parent
fed5c6fa7a
commit
97e4aa514a
5 changed files with 90 additions and 9 deletions
|
@ -7833,6 +7833,7 @@ BattleScript_IntimidateInReverse:
|
||||||
|
|
||||||
BattleScript_SupersweetSyrupActivates::
|
BattleScript_SupersweetSyrupActivates::
|
||||||
showabilitypopup BS_ATTACKER
|
showabilitypopup BS_ATTACKER
|
||||||
|
copybyte sSAVED_BATTLER, gBattlerTarget
|
||||||
pause B_WAIT_TIME_LONG
|
pause B_WAIT_TIME_LONG
|
||||||
destroyabilitypopup
|
destroyabilitypopup
|
||||||
printstring STRINGID_SUPERSWEETAROMAWAFTS
|
printstring STRINGID_SUPERSWEETAROMAWAFTS
|
||||||
|
@ -7861,6 +7862,7 @@ BattleScript_SupersweetSyrupLoopIncrement:
|
||||||
BattleScript_SupersweetSyrupEnd:
|
BattleScript_SupersweetSyrupEnd:
|
||||||
copybyte sBATTLER, gBattlerAttacker
|
copybyte sBATTLER, gBattlerAttacker
|
||||||
destroyabilitypopup
|
destroyabilitypopup
|
||||||
|
copybyte gBattlerTarget, sSAVED_BATTLER
|
||||||
pause B_WAIT_TIME_MED
|
pause B_WAIT_TIME_MED
|
||||||
end3
|
end3
|
||||||
|
|
||||||
|
|
|
@ -767,7 +767,9 @@ struct BattleStruct
|
||||||
u8 enduredDamage;
|
u8 enduredDamage;
|
||||||
u8 transformZeroToHero[NUM_BATTLE_SIDES];
|
u8 transformZeroToHero[NUM_BATTLE_SIDES];
|
||||||
u8 stickySyrupdBy[MAX_BATTLERS_COUNT];
|
u8 stickySyrupdBy[MAX_BATTLERS_COUNT];
|
||||||
u8 abilityActivated[NUM_BATTLE_SIDES];
|
u8 intrepidSwordBoost[NUM_BATTLE_SIDES];
|
||||||
|
u8 dauntlessShieldBoost[NUM_BATTLE_SIDES];
|
||||||
|
u8 supersweetSyrup[NUM_BATTLE_SIDES];
|
||||||
u8 supremeOverlordCounter[MAX_BATTLERS_COUNT];
|
u8 supremeOverlordCounter[MAX_BATTLERS_COUNT];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4453,8 +4453,8 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
case ABILITY_INTIMIDATE:
|
case ABILITY_INTIMIDATE:
|
||||||
if (!gSpecialStatuses[battler].switchInAbilityDone)
|
if (!gSpecialStatuses[battler].switchInAbilityDone)
|
||||||
{
|
{
|
||||||
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
|
||||||
gBattlerAttacker = battler;
|
gBattlerAttacker = battler;
|
||||||
|
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
||||||
SET_STATCHANGER(STAT_ATK, 1, TRUE);
|
SET_STATCHANGER(STAT_ATK, 1, TRUE);
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivates);
|
||||||
effect++;
|
effect++;
|
||||||
|
@ -4462,11 +4462,11 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
break;
|
break;
|
||||||
case ABILITY_SUPERSWEET_SYRUP:
|
case ABILITY_SUPERSWEET_SYRUP:
|
||||||
if (!gSpecialStatuses[battler].switchInAbilityDone
|
if (!gSpecialStatuses[battler].switchInAbilityDone
|
||||||
&& !(gBattleStruct->abilityActivated[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]))
|
&& !(gBattleStruct->supersweetSyrup[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]))
|
||||||
{
|
{
|
||||||
gBattleStruct->abilityActivated[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]];
|
|
||||||
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
|
||||||
gBattlerAttacker = battler;
|
gBattlerAttacker = battler;
|
||||||
|
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
||||||
|
gBattleStruct->supersweetSyrup[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]];
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_SupersweetSyrupActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_SupersweetSyrupActivates);
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
@ -4502,12 +4502,12 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
break;
|
break;
|
||||||
case ABILITY_INTREPID_SWORD:
|
case ABILITY_INTREPID_SWORD:
|
||||||
if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)
|
if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)
|
||||||
&& !(gBattleStruct->abilityActivated[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]))
|
&& !(gBattleStruct->intrepidSwordBoost[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]))
|
||||||
{
|
{
|
||||||
gBattleScripting.savedBattler = gBattlerAttacker;
|
gBattleScripting.savedBattler = gBattlerAttacker;
|
||||||
gBattlerAttacker = battler;
|
gBattlerAttacker = battler;
|
||||||
if (B_INTREPID_SWORD == GEN_9)
|
if (B_INTREPID_SWORD == GEN_9)
|
||||||
gBattleStruct->abilityActivated[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]];
|
gBattleStruct->intrepidSwordBoost[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]];
|
||||||
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
||||||
SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn);
|
BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn);
|
||||||
|
@ -4516,12 +4516,12 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
break;
|
break;
|
||||||
case ABILITY_DAUNTLESS_SHIELD:
|
case ABILITY_DAUNTLESS_SHIELD:
|
||||||
if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)
|
if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)
|
||||||
&& !(gBattleStruct->abilityActivated[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]))
|
&& !(gBattleStruct->dauntlessShieldBoost[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]))
|
||||||
{
|
{
|
||||||
gBattleScripting.savedBattler = gBattlerAttacker;
|
gBattleScripting.savedBattler = gBattlerAttacker;
|
||||||
gBattlerAttacker = battler;
|
gBattlerAttacker = battler;
|
||||||
if (B_DAUNTLESS_SHIELD == GEN_9)
|
if (B_DAUNTLESS_SHIELD == GEN_9)
|
||||||
gBattleStruct->abilityActivated[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]];
|
gBattleStruct->dauntlessShieldBoost[GetBattlerSide(battler)] |= gBitTable[gBattlerPartyIndexes[battler]];
|
||||||
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
||||||
SET_STATCHANGER(STAT_DEF, 1, FALSE);
|
SET_STATCHANGER(STAT_DEF, 1, FALSE);
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn);
|
BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn);
|
||||||
|
|
|
@ -64,3 +64,33 @@ SINGLE_BATTLE_TEST("Intrepid Sword activates when it's no longer effected by Neu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Intrepid Sword and Dauntless Shield both can be Skill Swapped and active their effects on the Skill Swap user")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_ZACIAN) { Ability(ABILITY_INTREPID_SWORD); }
|
||||||
|
OPPONENT(SPECIES_ZAMAZENTA) { Ability(ABILITY_DAUNTLESS_SHIELD); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_SKILL_SWAP); }
|
||||||
|
TURN { SWITCH(opponent, 1); MOVE(player, MOVE_SKILL_SWAP); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_INTREPID_SWORD);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
|
||||||
|
MESSAGE("Foe Zacian's Intrepid Sword raised its Attack!");
|
||||||
|
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, player);
|
||||||
|
ABILITY_POPUP(player, ABILITY_INTREPID_SWORD);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
||||||
|
MESSAGE("Wobbuffet's Intrepid Sword raised its Attack!");
|
||||||
|
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_DAUNTLESS_SHIELD);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
|
||||||
|
MESSAGE("Foe Zamazenta's Dauntless Shield raised its Defense!");
|
||||||
|
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, player);
|
||||||
|
ABILITY_POPUP(player, ABILITY_DAUNTLESS_SHIELD);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
||||||
|
MESSAGE("Wobbuffet's Dauntless Shield raised its Defense!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
47
test/battle/ability/supersweet_syrup.c
Normal file
47
test/battle/ability/supersweet_syrup.c
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "test/battle.h"
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Supersweet Syrup lowers evasion once per battle by one stage")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_DIPPLIN) { Ability(ABILITY_SUPERSWEET_SYRUP); }
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { SWITCH(opponent, 1); }
|
||||||
|
TURN { SWITCH(opponent, 0); }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_SUPERSWEET_SYRUP);
|
||||||
|
MESSAGE("A supersweet aroma is wafting from the syrup covering Foe Dipplin!");
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
||||||
|
MESSAGE("2 withdrew Dipplin!");
|
||||||
|
MESSAGE("2 withdrew Wobbuffet!");
|
||||||
|
NONE_OF {
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_SUPERSWEET_SYRUP);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
||||||
|
MESSAGE("A supersweet aroma is wafting from the syrup covering Foes Dipplin!");
|
||||||
|
}
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(player->statStages[STAT_EVASION], DEFAULT_STAT_STAGE - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DOUBLE_BATTLE_TEST("Supersweet Syrup lowers evasion of both opposing mon's in battle")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_DIPPLIN) { Ability(ABILITY_SUPERSWEET_SYRUP); }
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
ABILITY_POPUP(opponentLeft, ABILITY_SUPERSWEET_SYRUP);
|
||||||
|
MESSAGE("A supersweet aroma is wafting from the syrup covering Foe Dipplin!");
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight);
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(playerLeft->statStages[STAT_EVASION], DEFAULT_STAT_STAGE - 1);
|
||||||
|
EXPECT_EQ(playerRight->statStages[STAT_EVASION], DEFAULT_STAT_STAGE - 1);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue