diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 3ef687f81b..06899045c5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -55,7 +55,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectOHKO @ EFFECT_OHKO .4byte BattleScript_EffectHit @ EFFECT_FUSION_COMBO .4byte BattleScript_EffectSuperFang @ EFFECT_SUPER_FANG - .4byte BattleScript_EffectArgFixedDamage @ EFFECT_ARG_FIXED_DAMAGE + .4byte BattleScript_EffectFixedDamageArg @ EFFECT_FIXED_DAMAGE_ARG .4byte BattleScript_EffectHealBlock @ EFFECT_HEAL_BLOCK .4byte BattleScript_EffectRecoilIfMiss @ EFFECT_RECOIL_IF_MISS .4byte BattleScript_EffectMist @ EFFECT_MIST @@ -1430,17 +1430,20 @@ BattleScript_FailIfNotArgType: goto BattleScript_HitFromCritCalc BattleScript_RemoveFireType:: - losetype BS_ATTACKER, TYPE_FIRE printstring STRINGID_ATTACKERLOSTFIRETYPE waitmessage B_WAIT_TIME_LONG return BattleScript_RemoveElectricType:: - losetype BS_ATTACKER, TYPE_ELECTRIC printstring STRINGID_ATTACKERLOSTELECTRICTYPE waitmessage B_WAIT_TIME_LONG return +BattleScript_RemoveGenericType:: + printstring STRINGID_ATTACKERLOSTITSTYPE + waitmessage B_WAIT_TIME_LONG + return + BattleScript_DefDown:: modifybattlerstatstage BS_TARGET, STAT_DEF, DECREASE, 1, BattleScript_DefDown_Ret, ANIM_ON BattleScript_DefDown_Ret: @@ -4816,7 +4819,7 @@ BattleScript_EffectBatonPass:: switchineffects BS_ATTACKER goto BattleScript_MoveEnd -BattleScript_EffectArgFixedDamage:: +BattleScript_EffectFixedDamageArg:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 720e3d34f9..c1da89443b 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -523,6 +523,7 @@ extern const u8 BattleScript_EffectRaiseCritAlliesAnim[]; extern const u8 BattleScript_EffectHealOneSixthAllies[]; extern const u8 BattleScript_EffectCureStatusAllies[]; extern const u8 BattleScript_EffectRecycleBerriesAllies[]; +extern const u8 BattleScript_RemoveGenericType[]; // dynamax and max raids extern const u8 BattleScript_DynamaxBegins[]; diff --git a/include/battle_util.h b/include/battle_util.h index da55c1291b..e9b0c6f472 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -247,5 +247,6 @@ bool32 MoveEffectIsGuaranteed(u32 battler, u32 battlerAbility, const struct Addi u8 GetBattlerType(u32 battler, u8 typeIndex); bool8 CanMonParticipateInSkyBattle(struct Pokemon *mon); bool8 IsMonBannedFromSkyBattles(u16 species); +void RemoveBattlerType(u32 battler, u8 type); #endif // GUARD_BATTLE_UTIL_H diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 2641e02e4f..41c8b37470 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -34,7 +34,7 @@ #define EFFECT_OHKO 30 #define EFFECT_FUSION_COMBO 31 #define EFFECT_SUPER_FANG 32 -#define EFFECT_ARG_FIXED_DAMAGE 33 +#define EFFECT_FIXED_DAMAGE_ARG 33 #define EFFECT_HEAL_BLOCK 34 #define EFFECT_RECOIL_IF_MISS 35 #define EFFECT_MIST 36 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index e854e9f5e5..de6117e822 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -699,8 +699,9 @@ #define STRINGID_HOSPITALITYRESTORATION 697 #define STRINGID_ELECTROSHOCKCHARGING 698 #define STRINGID_ITEMWASUSEDUP 699 +#define STRINGID_ATTACKERLOSTITSTYPE 700 -#define BATTLESTRINGS_COUNT 700 +#define BATTLESTRINGS_COUNT 701 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/include/pokemon.h b/include/pokemon.h index 6b31bc5b4a..5bca3505cf 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -451,8 +451,9 @@ struct BattleMove u16 accuracy:7; u16 recoil:7; u16 criticalHitStage:2; + u8 padding:6; // coming soon... + u8 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy u8 pp; - u8 secondaryEffectChance; u16 target; s8 priority; @@ -507,9 +508,8 @@ struct BattleMove u32 parentalBondBanned:1; u32 skyBattleBanned:1; u32 sketchBanned:1; - u32 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy - u16 argument; + u32 argument; // also coming soon // primary/secondary effects const struct AdditionalEffect *additionalEffects; diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index bb1b7728e9..f33041bbdf 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -1639,7 +1639,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) } break; case EFFECT_PRESENT: - case EFFECT_ARG_FIXED_DAMAGE: + case EFFECT_FIXED_DAMAGE_ARG: case EFFECT_FOCUS_PUNCH: // AI_CBM_HighRiskForDamage if (aiData->abilities[battlerDef] == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index da625034f1..4bd807dad8 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -511,7 +511,7 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes case EFFECT_PSYWAVE: dmg = gBattleMons[battlerAtk].level * (aiData->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); break; - case EFFECT_ARG_FIXED_DAMAGE: + case EFFECT_FIXED_DAMAGE_ARG: dmg = gBattleMoves[move].argument * (aiData->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_MULTI_HIT: diff --git a/src/battle_dynamax.c b/src/battle_dynamax.c index e84e0162a4..cae33e82ab 100644 --- a/src/battle_dynamax.c +++ b/src/battle_dynamax.c @@ -436,7 +436,7 @@ static u8 GetMaxPowerTier(u16 move) case EFFECT_TERRAIN_PULSE: case EFFECT_PUNISHMENT: case EFFECT_TRUMP_CARD: - case EFFECT_ARG_FIXED_DAMAGE: + case EFFECT_FIXED_DAMAGE_ARG: case EFFECT_SPIT_UP: case EFFECT_NATURAL_GIFT: case EFFECT_MIRROR_COAT: diff --git a/src/battle_message.c b/src/battle_message.c index cc9c98b436..5279aa5337 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -836,6 +836,7 @@ static const u8 sText_TheSwampDisappeared[] = _("The swamp around {B_ATK_TEAM2}\ static const u8 sText_HospitalityRestoration[] = _("The {B_ATK_PARTNER_NAME} drank down all\nthe matcha that Sinistcha made!"); static const u8 sText_ElectroShockCharging[] = _("{B_ATK_NAME_WITH_PREFIX} absorbed\nelectricity!"); static const u8 sText_ItemWasUsedUp[] = _("The {B_LAST_ITEM}\nwas used up..."); +static const u8 sText_AttackerLostItsType[] = _("{B_ATK_NAME_WITH_PREFIX} lost\nits {B_BUFF1} type!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { @@ -1527,6 +1528,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_TEAMGAINEDEXP - BATTLESTRINGS_TABLE_START] = sText_TeamGainedEXP, [STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP - BATTLESTRINGS_TABLE_START] = sText_TargetCoveredInStickyCandySyrup, [STRINGID_ITEMWASUSEDUP - BATTLESTRINGS_TABLE_START] = sText_ItemWasUsedUp, + [STRINGID_ATTACKERLOSTITSTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostItsType, }; const u16 gTrainerUsedItemStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0f17b07461..960a6db293 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2753,6 +2753,17 @@ void StealTargetItem(u8 battlerStealer, u8 battlerItem) return; \ } +// For a future update... +// #define INCREMENT_RETURN_ON_PARENTAL_BOND_1ST_HIT \ +// { \ +// if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT \ +// && gBattleMons[gEffectBattler].hp != 0) \ +// { \ +// gBattlescriptCurrInstr++; \ +// return; \ +// } \ +// } + void SetMoveEffect(bool32 primary, bool32 certain) { s32 i, affectsUser = 0; @@ -3652,15 +3663,17 @@ void SetMoveEffect(bool32 primary, bool32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); switch (gBattleMoves[gCurrentMove].argument) { - case TYPE_FIRE: + case TYPE_FIRE: // Burn Up gBattlescriptCurrInstr = BattleScript_RemoveFireType; break; - case TYPE_ELECTRIC: + case TYPE_ELECTRIC: // Electro Shot gBattlescriptCurrInstr = BattleScript_RemoveElectricType; break; - default: // to do - add a generic case + default: + gBattlescriptCurrInstr = BattleScript_RemoveGenericType; break; } + RemoveBattlerType(gEffectBattler, gBattleMoves[gCurrentMove].argument); break; case MOVE_EFFECT_ROUND: TryUpdateRoundTurnOrder(); // If another Pokémon uses Round before the user this turn, the user will use Round directly after it @@ -9694,11 +9707,7 @@ static void Cmd_various(void) case VARIOUS_LOSE_TYPE: { VARIOUS_ARGS(u8 type); - for (i = 0; i < 3; i++) - { - if (*(u8 *)(&gBattleMons[battler].type1 + i) == cmd->type) - *(u8 *)(&gBattleMons[battler].type1 + i) = TYPE_MYSTERY; - } + RemoveBattlerType(battler, cmd->type); gBattlescriptCurrInstr = cmd->nextInstr; return; } diff --git a/src/battle_tv.c b/src/battle_tv.c index 1e494294e6..d76dbe5541 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -190,7 +190,7 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] = [EFFECT_MAGNITUDE] = 1, [EFFECT_BATON_PASS] = 7, [EFFECT_PURSUIT] = 2, - [EFFECT_ARG_FIXED_DAMAGE] = 1, + [EFFECT_FIXED_DAMAGE_ARG] = 1, [EFFECT_MORNING_SUN] = 4, [EFFECT_SYNTHESIS] = 4, [EFFECT_MOONLIGHT] = 4, diff --git a/src/battle_util.c b/src/battle_util.c index 545f8372b4..3692f674c7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -11073,3 +11073,13 @@ u8 GetBattlerType(u32 battler, u8 typeIndex) return types[typeIndex]; } + +void RemoveBattlerType(u32 battler, u8 type) +{ + u32 i; + for (i = 0; i < 3; i++) + { + if (*(u8 *)(&gBattleMons[battler].type1 + i) == type) + *(u8 *)(&gBattleMons[battler].type1 + i) = TYPE_MYSTERY; + } +} \ No newline at end of file diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 4747804af9..42d891824e 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -810,7 +810,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_SONIC_BOOM] = { - .effect = EFFECT_ARG_FIXED_DAMAGE, + .effect = EFFECT_FIXED_DAMAGE_ARG, .power = 1, .type = TYPE_NORMAL, .accuracy = 90, @@ -1382,7 +1382,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_DRAGON_RAGE] = { - .effect = EFFECT_ARG_FIXED_DAMAGE, + .effect = EFFECT_FIXED_DAMAGE_ARG, .power = 1, .type = TYPE_DRAGON, .accuracy = 100, diff --git a/test/battle/ai_check_viability.c b/test/battle/ai_check_viability.c index 1b25432f66..a82e93eae1 100644 --- a/test/battle/ai_check_viability.c +++ b/test/battle/ai_check_viability.c @@ -55,7 +55,6 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Wake Up Slap") PARAMETRIZE { status1 = STATUS1_NONE; expectedMove = MOVE_BODY_SLAM; } PARAMETRIZE { status1 = STATUS1_SLEEP; expectedMove = MOVE_WAKE_UP_SLAP; } - PARAMETRIZE { status1 = STATUS1_SLEEP; expectedMove = MOVE_WAKE_UP_SLAP; } GIVEN { ASSUME(B_UPDATED_MOVE_DATA >= GEN_6); @@ -82,6 +81,7 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Grav Apple") GIVEN { ASSUME(gBattleMoves[MOVE_GRAV_APPLE].effect == EFFECT_GRAV_APPLE); + ASSUME(gBattleMoves[MOVE_GRAV_APPLE].power == gBattleMoves[MOVE_DRUM_BEATING].power); ASSUME(MoveHasMoveEffect(MOVE_DRUM_BEATING, MOVE_EFFECT_SPD_MINUS_1) == TRUE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(81); Speed(20); } diff --git a/test/battle/hold_effect/attack_up.c b/test/battle/hold_effect/attack_up.c index b1a1bef481..afdee8adf8 100644 --- a/test/battle/hold_effect/attack_up.c +++ b/test/battle/hold_effect/attack_up.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItems[ITEM_LIECHI_BERRY].holdEffect == HOLD_EFFECT_ATTACK_UP); - ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE); + ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40); } diff --git a/test/battle/hold_effect/critical_hit_up.c b/test/battle/hold_effect/critical_hit_up.c index 57bc1e7b3b..c302311de5 100644 --- a/test/battle/hold_effect/critical_hit_up.c +++ b/test/battle/hold_effect/critical_hit_up.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItems[ITEM_LANSAT_BERRY].holdEffect == HOLD_EFFECT_CRITICAL_UP); - ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE); + ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40); } diff --git a/test/battle/hold_effect/defense_up.c b/test/battle/hold_effect/defense_up.c index 61ca1dc91e..030c1ba999 100644 --- a/test/battle/hold_effect/defense_up.c +++ b/test/battle/hold_effect/defense_up.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItems[ITEM_GANLON_BERRY].holdEffect == HOLD_EFFECT_DEFENSE_UP); - ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE); + ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40); } diff --git a/test/battle/hold_effect/micle_berry.c b/test/battle/hold_effect/micle_berry.c index 05f846dca3..e81b3de655 100644 --- a/test/battle/hold_effect/micle_berry.c +++ b/test/battle/hold_effect/micle_berry.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItems[ITEM_MICLE_BERRY].holdEffect == HOLD_EFFECT_MICLE_BERRY); - ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE); + ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40); } diff --git a/test/battle/hold_effect/special_attack_up.c b/test/battle/hold_effect/special_attack_up.c index 48953abf47..9a7ebfe705 100644 --- a/test/battle/hold_effect/special_attack_up.c +++ b/test/battle/hold_effect/special_attack_up.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItems[ITEM_PETAYA_BERRY].holdEffect == HOLD_EFFECT_SP_ATTACK_UP); - ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE); + ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40); } diff --git a/test/battle/hold_effect/special_defense_up.c b/test/battle/hold_effect/special_defense_up.c index bdcfd31fdf..0225588dca 100644 --- a/test/battle/hold_effect/special_defense_up.c +++ b/test/battle/hold_effect/special_defense_up.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItems[ITEM_APICOT_BERRY].holdEffect == HOLD_EFFECT_SP_DEFENSE_UP); - ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE); + ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40); } diff --git a/test/battle/hold_effect/speed_up.c b/test/battle/hold_effect/speed_up.c index 2b64f3fe3d..a11ad43444 100644 --- a/test/battle/hold_effect/speed_up.c +++ b/test/battle/hold_effect/speed_up.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItems[ITEM_SALAC_BERRY].holdEffect == HOLD_EFFECT_SPEED_UP); - ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE); + ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40); } diff --git a/test/battle/move_effect/aura_wheel.c b/test/battle/move_effect/aura_wheel.c index 35a36699f5..7052cf9e7c 100644 --- a/test/battle/move_effect/aura_wheel.c +++ b/test/battle/move_effect/aura_wheel.c @@ -48,4 +48,4 @@ SINGLE_BATTLE_TEST("Aura Wheel changes type depending on Morpeko's form") HP_BAR(opponent); MESSAGE("It's super effective!"); } -} \ No newline at end of file +} diff --git a/test/battle/move_effect/fling.c b/test/battle/move_effect/fling.c index 60c2341ced..d4348b95cc 100644 --- a/test/battle/move_effect/fling.c +++ b/test/battle/move_effect/fling.c @@ -201,26 +201,20 @@ SINGLE_BATTLE_TEST("Fling doesn't consume the item if pokemon is asleep/frozen/p } } -SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items - but is blocked by Shield Dust") +SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items") { - u16 item, ability; + u16 item; - PARAMETRIZE {item = ITEM_FLAME_ORB; ability = ABILITY_TELEPATHY; } - PARAMETRIZE {item = ITEM_FLAME_ORB; ability = ABILITY_SHIELD_DUST; } - PARAMETRIZE {item = ITEM_LIGHT_BALL; ability = ABILITY_TELEPATHY; } - PARAMETRIZE {item = ITEM_LIGHT_BALL; ability = ABILITY_SHIELD_DUST; } - PARAMETRIZE {item = ITEM_POISON_BARB; ability = ABILITY_TELEPATHY; } - PARAMETRIZE {item = ITEM_POISON_BARB; ability = ABILITY_SHIELD_DUST; } - PARAMETRIZE {item = ITEM_TOXIC_ORB; ability = ABILITY_TELEPATHY; } - PARAMETRIZE {item = ITEM_TOXIC_ORB; ability = ABILITY_SHIELD_DUST; } - PARAMETRIZE {item = ITEM_RAZOR_FANG; ability = ABILITY_TELEPATHY; } - PARAMETRIZE {item = ITEM_RAZOR_FANG; ability = ABILITY_SHIELD_DUST; } - PARAMETRIZE {item = ITEM_KINGS_ROCK; ability = ABILITY_TELEPATHY; } - PARAMETRIZE {item = ITEM_KINGS_ROCK; ability = ABILITY_SHIELD_DUST; } + PARAMETRIZE {item = ITEM_FLAME_ORB; } + PARAMETRIZE {item = ITEM_LIGHT_BALL; } + PARAMETRIZE {item = ITEM_POISON_BARB; } + PARAMETRIZE {item = ITEM_TOXIC_ORB; } + PARAMETRIZE {item = ITEM_RAZOR_FANG; } + PARAMETRIZE {item = ITEM_KINGS_ROCK; } GIVEN { PLAYER(SPECIES_WOBBUFFET) { Item(item); } - OPPONENT(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_FLING); } } SCENE { @@ -230,12 +224,62 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items - switch (item) { case ITEM_FLAME_ORB: - if (ability != ABILITY_SHIELD_DUST) { MESSAGE("Foe Wobbuffet was burned!"); STATUS_ICON(opponent, STATUS1_BURN); } - else + break; + case ITEM_LIGHT_BALL: + { + MESSAGE("Foe Wobbuffet is paralyzed! It may be unable to move!"); + STATUS_ICON(opponent, STATUS1_PARALYSIS); + } + break; + case ITEM_POISON_BARB: + { + MESSAGE("Foe Wobbuffet was poisoned!"); + STATUS_ICON(opponent, STATUS1_POISON); + } + break; + case ITEM_TOXIC_ORB: + { + MESSAGE("Foe Wobbuffet is badly poisoned!"); + STATUS_ICON(opponent, STATUS1_TOXIC_POISON); + } + break; + case ITEM_RAZOR_FANG: + case ITEM_KINGS_ROCK: + { + MESSAGE("Foe Wobbuffet flinched!"); + } + break; + } + } +} + +SINGLE_BATTLE_TEST("Fling's effects are blocked by Shield Dust") +{ + u16 item; + + PARAMETRIZE {item = ITEM_FLAME_ORB; } + PARAMETRIZE {item = ITEM_LIGHT_BALL; } + PARAMETRIZE {item = ITEM_POISON_BARB; } + PARAMETRIZE {item = ITEM_TOXIC_ORB; } + PARAMETRIZE {item = ITEM_RAZOR_FANG; } + PARAMETRIZE {item = ITEM_KINGS_ROCK; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(item); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_SHIELD_DUST); } + } WHEN { + TURN { MOVE(player, MOVE_FLING); } + } SCENE { + MESSAGE("Wobbuffet used Fling!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FLING, player); + HP_BAR(opponent); + switch (item) + { + case ITEM_FLAME_ORB: { NONE_OF { MESSAGE("Foe Wobbuffet was burned!"); @@ -245,12 +289,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items - } break; case ITEM_LIGHT_BALL: - if (ability != ABILITY_SHIELD_DUST) - { - MESSAGE("Foe Wobbuffet is paralyzed! It may be unable to move!"); - STATUS_ICON(opponent, STATUS1_PARALYSIS); - } - else { NONE_OF { MESSAGE("Foe Wobbuffet is paralyzed! It may be unable to move!"); @@ -260,12 +298,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items - } break; case ITEM_POISON_BARB: - if (ability != ABILITY_SHIELD_DUST) - { - MESSAGE("Foe Wobbuffet was poisoned!"); - STATUS_ICON(opponent, STATUS1_POISON); - } - else { NONE_OF { MESSAGE("Foe Wobbuffet was poisoned!"); @@ -275,12 +307,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items - } break; case ITEM_TOXIC_ORB: - if (ability != ABILITY_SHIELD_DUST) - { - MESSAGE("Foe Wobbuffet is badly poisoned!"); - STATUS_ICON(opponent, STATUS1_TOXIC_POISON); - } - else { NONE_OF { MESSAGE("Foe Wobbuffet is badly poisoned!"); @@ -291,11 +317,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items - break; case ITEM_RAZOR_FANG: case ITEM_KINGS_ROCK: - if (ability != ABILITY_SHIELD_DUST) - { - MESSAGE("Foe Wobbuffet flinched!"); - } - else { NONE_OF { MESSAGE("Foe Wobbuffet flinched!");