diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d48076e489..37ae9b7301 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -368,6 +368,30 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectSleepHit .4byte BattleScript_EffectAttackerDefenseDownHit .4byte BattleScript_EffectBodyPress + .4byte BattleScript_EffectStuffCheeks + +BattleScript_EffectStuffCheeks:: + attackcanceler + attackstring + ppreduce + jumpifnotberry BS_ATTACKER, BattleScript_ButItFailed + attackanimation + waitanimation +BattleScript_StuffCheeksEatBerry: + setbyte sBERRY_OVERRIDE, TRUE + orword gHitMarker, HITMARKER_NO_ANIMATIONS + consumeberry BS_ATTACKER + bicword gHitMarker, HITMARKER_NO_ANIMATIONS + setbyte sBERRY_OVERRIDE, FALSE + setstatchanger STAT_DEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StuffCheeksEnd + setgraphicalstatchangevalues + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StuffCheeksEnd @ cant raise def + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_StuffCheeksEnd: + goto BattleScript_MoveEnd BattleScript_EffectAttackerDefenseDownHit: setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN @@ -5985,6 +6009,10 @@ BattleScript_SelectingNotAllowedMoveGravity:: printselectionstring STRINGID_GRAVITYPREVENTSUSAGE endselectionscript +BattleScript_SelectingNotAllowedStuffCheeks:: + printselectionstring STRINGID_STUFFCHEEKSCANTSELECT + endselectionscript + BattleScript_SelectingNotAllowedBelch:: printselectionstring STRINGID_BELCHCANTSELECT endselectionscript diff --git a/include/battle_scripts.h b/include/battle_scripts.h index f0712fc435..0b81fc6755 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -295,6 +295,7 @@ extern const u8 BattleScript_ProteanActivates[]; extern const u8 BattleScript_DazzlingProtected[]; extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[]; extern const u8 BattleScript_MoveUsedPowder[]; +extern const u8 BattleScript_SelectingNotAllowedStuffCheeks[]; extern const u8 BattleScript_SelectingNotAllowedBelch[]; extern const u8 BattleScript_SelectingNotAllowedBelchInPalace[]; extern const u8 BattleScript_PsychicSurgeActivates[]; diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index cbab68b661..2e54e9ef3a 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -352,6 +352,7 @@ #define EFFECT_SLEEP_HIT 346 #define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 347 #define EFFECT_BODY_PRESS 348 +#define EFFECT_STUFF_CHEEKS 349 #define NUM_BATTLE_MOVE_EFFECTS 350 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index cda8856948..e2b97d4438 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -570,8 +570,9 @@ #define STRINGID_MICLEBERRYACTIVATES 566 #define STRINGID_PKMNSHOOKOFFTHETAUNT 567 #define STRINGID_PKMNGOTOVERITSINFATUATION 568 +#define STRINGID_STUFFCHEEKSCANTSELECT 569 -#define BATTLESTRINGS_COUNT 569 +#define BATTLESTRINGS_COUNT 570 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 81d97fcab6..da978b4271 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -792,21 +792,17 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; break; - case EFFECT_DEFENSE_UP_2: - if (move == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battlerAtk].item) != POCKET_BERRIES) - score -= 10; + case EFFECT_STUFF_CHEEKS: + if (ItemId_GetPocket(gBattleMons[battlerAtk].item) != POCKET_BERRIES) + return 0; // cannot even select //fallthrough case EFFECT_DEFENSE_UP: + case EFFECT_DEFENSE_UP_2: case EFFECT_DEFENSE_UP_3: case EFFECT_DEFENSE_CURL: if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) score -= 10; break; - case EFFECT_SPEED_UP: - case EFFECT_SPEED_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) - score -= 10; - break; case EFFECT_SPECIAL_ATTACK_UP: case EFFECT_SPECIAL_ATTACK_UP_2: case EFFECT_SPECIAL_ATTACK_UP_3: diff --git a/src/battle_message.c b/src/battle_message.c index c4f043e150..439f88e29c 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -696,9 +696,11 @@ static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faste static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!"); static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!"); static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); +static const u8 sText_StuffCheeksCantSelect[] = _("Stuff Cheeks cannot be\nselected without a Berry!\p"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_STUFFCHEEKSCANTSELECT - 12] = sText_StuffCheeksCantSelect, [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, [STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt, [STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates, diff --git a/src/battle_util.c b/src/battle_util.c index 6c9e141875..99217ce6fe 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1708,6 +1708,21 @@ u8 TrySetCantSelectMoveBattleScript(void) limitations++; } } + + if (move == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES) + { + gCurrentMove = move; + if (gBattleTypeFlags & BATTLE_TYPE_PALACE) + { + gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedBelchInPalace; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + } + else + { + gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedStuffCheeks; + limitations++; + } + } gPotentialItemEffectBattler = gActiveBattler; if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != move) @@ -1791,6 +1806,8 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) unusableMoves |= gBitTable[i]; else if (gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].flags & FLAG_SOUND) unusableMoves |= gBitTable[i]; + else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES) + unusableMoves |= gBitTable[i]; } return unusableMoves; } diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 9fc79581f5..416c5b850c 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10771,7 +10771,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_STUFF_CHEEKS] = { - .effect = EFFECT_DEFENSE_UP_2, + .effect = EFFECT_STUFF_CHEEKS, .power = 0, .type = TYPE_NORMAL, .accuracy = 0,