add stuff cheeks

This commit is contained in:
ghoulslash 2021-07-27 10:31:48 -06:00
parent 4ca6d76160
commit ab529b4e89
8 changed files with 56 additions and 10 deletions

View File

@ -368,6 +368,30 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectSleepHit .4byte BattleScript_EffectSleepHit
.4byte BattleScript_EffectAttackerDefenseDownHit .4byte BattleScript_EffectAttackerDefenseDownHit
.4byte BattleScript_EffectBodyPress .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: BattleScript_EffectAttackerDefenseDownHit:
setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
@ -5985,6 +6009,10 @@ BattleScript_SelectingNotAllowedMoveGravity::
printselectionstring STRINGID_GRAVITYPREVENTSUSAGE printselectionstring STRINGID_GRAVITYPREVENTSUSAGE
endselectionscript endselectionscript
BattleScript_SelectingNotAllowedStuffCheeks::
printselectionstring STRINGID_STUFFCHEEKSCANTSELECT
endselectionscript
BattleScript_SelectingNotAllowedBelch:: BattleScript_SelectingNotAllowedBelch::
printselectionstring STRINGID_BELCHCANTSELECT printselectionstring STRINGID_BELCHCANTSELECT
endselectionscript endselectionscript

View File

@ -295,6 +295,7 @@ extern const u8 BattleScript_ProteanActivates[];
extern const u8 BattleScript_DazzlingProtected[]; extern const u8 BattleScript_DazzlingProtected[];
extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[]; extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[];
extern const u8 BattleScript_MoveUsedPowder[]; extern const u8 BattleScript_MoveUsedPowder[];
extern const u8 BattleScript_SelectingNotAllowedStuffCheeks[];
extern const u8 BattleScript_SelectingNotAllowedBelch[]; extern const u8 BattleScript_SelectingNotAllowedBelch[];
extern const u8 BattleScript_SelectingNotAllowedBelchInPalace[]; extern const u8 BattleScript_SelectingNotAllowedBelchInPalace[];
extern const u8 BattleScript_PsychicSurgeActivates[]; extern const u8 BattleScript_PsychicSurgeActivates[];

View File

@ -352,6 +352,7 @@
#define EFFECT_SLEEP_HIT 346 #define EFFECT_SLEEP_HIT 346
#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 347 #define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 347
#define EFFECT_BODY_PRESS 348 #define EFFECT_BODY_PRESS 348
#define EFFECT_STUFF_CHEEKS 349
#define NUM_BATTLE_MOVE_EFFECTS 350 #define NUM_BATTLE_MOVE_EFFECTS 350

View File

@ -570,8 +570,9 @@
#define STRINGID_MICLEBERRYACTIVATES 566 #define STRINGID_MICLEBERRYACTIVATES 566
#define STRINGID_PKMNSHOOKOFFTHETAUNT 567 #define STRINGID_PKMNSHOOKOFFTHETAUNT 567
#define STRINGID_PKMNGOTOVERITSINFATUATION 568 #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, // The below IDs are all indexes into battle message tables,
// used to determine which of a set of messages to print. // used to determine which of a set of messages to print.

View File

@ -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)) if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL))
score -= 10; score -= 10;
break; break;
case EFFECT_DEFENSE_UP_2: case EFFECT_STUFF_CHEEKS:
if (move == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battlerAtk].item) != POCKET_BERRIES) if (ItemId_GetPocket(gBattleMons[battlerAtk].item) != POCKET_BERRIES)
score -= 10; return 0; // cannot even select
//fallthrough //fallthrough
case EFFECT_DEFENSE_UP: case EFFECT_DEFENSE_UP:
case EFFECT_DEFENSE_UP_2:
case EFFECT_DEFENSE_UP_3: case EFFECT_DEFENSE_UP_3:
case EFFECT_DEFENSE_CURL: case EFFECT_DEFENSE_CURL:
if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF))
score -= 10; score -= 10;
break; 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:
case EFFECT_SPECIAL_ATTACK_UP_2: case EFFECT_SPECIAL_ATTACK_UP_2:
case EFFECT_SPECIAL_ATTACK_UP_3: case EFFECT_SPECIAL_ATTACK_UP_3:

View File

@ -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_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_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_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] = const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{ {
[STRINGID_STUFFCHEEKSCANTSELECT - 12] = sText_StuffCheeksCantSelect,
[STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation,
[STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt, [STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt,
[STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates, [STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates,

View File

@ -1708,6 +1708,21 @@ u8 TrySetCantSelectMoveBattleScript(void)
limitations++; 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; gPotentialItemEffectBattler = gActiveBattler;
if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != move) 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]; unusableMoves |= gBitTable[i];
else if (gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].flags & FLAG_SOUND) else if (gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].flags & FLAG_SOUND)
unusableMoves |= gBitTable[i]; unusableMoves |= gBitTable[i];
else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
unusableMoves |= gBitTable[i];
} }
return unusableMoves; return unusableMoves;
} }

View File

@ -10771,7 +10771,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_STUFF_CHEEKS] = [MOVE_STUFF_CHEEKS] =
{ {
.effect = EFFECT_DEFENSE_UP_2, .effect = EFFECT_STUFF_CHEEKS,
.power = 0, .power = 0,
.type = TYPE_NORMAL, .type = TYPE_NORMAL,
.accuracy = 0, .accuracy = 0,