mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-04 02:10:01 +01:00
Merge pull request #2243 from AsparagusEduardo/RHH_placeholderMoves
Moves with EFFECT_PLACEHOLDER can't be used.
This commit is contained in:
commit
591bac25c4
@ -7257,6 +7257,10 @@ BattleScript_SelectingNotAllowedStuffCheeks::
|
||||
printselectionstring STRINGID_STUFFCHEEKSCANTSELECT
|
||||
endselectionscript
|
||||
|
||||
BattleScript_SelectingNotAllowedStuffCheeksInPalace::
|
||||
printstring STRINGID_STUFFCHEEKSCANTSELECT
|
||||
goto BattleScript_SelectingUnusableMoveInPalace
|
||||
|
||||
BattleScript_SelectingNotAllowedBelch::
|
||||
printselectionstring STRINGID_BELCHCANTSELECT
|
||||
endselectionscript
|
||||
@ -9197,14 +9201,34 @@ BattleScript_SelectingNotAllowedMoveChoiceItem::
|
||||
printselectionstring STRINGID_ITEMALLOWSONLYYMOVE
|
||||
endselectionscript
|
||||
|
||||
BattleScript_SelectingNotAllowedMoveChoiceItemInPalace::
|
||||
printstring STRINGID_ITEMALLOWSONLYYMOVE
|
||||
goto BattleScript_SelectingUnusableMoveInPalace
|
||||
|
||||
BattleScript_SelectingNotAllowedMoveGorillaTactics::
|
||||
printselectionstring STRINGID_ABILITYALLOWSONLYMOVE
|
||||
endselectionscript
|
||||
|
||||
BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace::
|
||||
printstring STRINGID_ABILITYALLOWSONLYMOVE
|
||||
goto BattleScript_SelectingUnusableMoveInPalace
|
||||
|
||||
BattleScript_SelectingNotAllowedMoveAssaultVest::
|
||||
printselectionstring STRINGID_ASSAULTVESTDOESNTALLOW
|
||||
endselectionscript
|
||||
|
||||
BattleScript_SelectingNotAllowedMoveAssaultVestInPalace::
|
||||
printstring STRINGID_ASSAULTVESTDOESNTALLOW
|
||||
goto BattleScript_SelectingUnusableMoveInPalace
|
||||
|
||||
BattleScript_SelectingNotAllowedPlaceholder::
|
||||
printselectionstring STRINGID_NOTDONEYET
|
||||
endselectionscript
|
||||
|
||||
BattleScript_SelectingNotAllowedPlaceholderInPalace::
|
||||
printstring STRINGID_NOTDONEYET
|
||||
goto BattleScript_SelectingUnusableMoveInPalace
|
||||
|
||||
BattleScript_HangedOnMsg::
|
||||
playanimation BS_TARGET, B_ANIM_HANGED_ON
|
||||
printstring STRINGID_PKMNHUNGONWITHX
|
||||
|
@ -210,6 +210,7 @@ extern const u8 BattleScript_BerryPPHealEnd2[];
|
||||
extern const u8 BattleScript_ItemHealHP_End2[];
|
||||
extern const u8 BattleScript_ItemHealHP_Ret[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveChoiceItem[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveChoiceItemInPalace[];
|
||||
extern const u8 BattleScript_HangedOnMsg[];
|
||||
extern const u8 BattleScript_BerryConfuseHealEnd2[];
|
||||
extern const u8 BattleScript_BerryConfuseHealRet[];
|
||||
@ -275,6 +276,9 @@ extern const u8 BattleScript_SnowWarningActivates[];
|
||||
extern const u8 BattleScript_HarvestActivates[];
|
||||
extern const u8 BattleScript_ImposterActivates[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVest[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVestInPalace[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedPlaceholder[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedPlaceholderInPalace[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveGravity[];
|
||||
extern const u8 BattleScript_MoveUsedGravityPrevents[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveGravityInPalace[];
|
||||
@ -301,6 +305,7 @@ extern const u8 BattleScript_DazzlingProtected[];
|
||||
extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[];
|
||||
extern const u8 BattleScript_MoveUsedPowder[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedStuffCheeks[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedStuffCheeksInPalace[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedBelch[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedBelchInPalace[];
|
||||
extern const u8 BattleScript_PsychicSurgeActivates[];
|
||||
@ -405,6 +410,7 @@ extern const u8 BattleScript_BlockedByPrimalWeatherRet[];
|
||||
extern const u8 BattleScript_PrimalReversion[];
|
||||
extern const u8 BattleScript_HyperspaceFuryRemoveProtect[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace[];
|
||||
extern const u8 BattleScript_WanderingSpiritActivates[];
|
||||
extern const u8 BattleScript_MirrorArmorReflect[];
|
||||
extern const u8 BattleScript_GooeyActivates[];
|
||||
|
@ -7,7 +7,17 @@
|
||||
#define MOVE_LIMITATION_TORMENTED (1 << 3)
|
||||
#define MOVE_LIMITATION_TAUNT (1 << 4)
|
||||
#define MOVE_LIMITATION_IMPRISON (1 << 5)
|
||||
#define MOVE_LIMITATIONS_ALL 0xFF
|
||||
#define MOVE_LIMITATION_ENCORE (1 << 6)
|
||||
#define MOVE_LIMITATION_CHOICE_ITEM (1 << 7)
|
||||
#define MOVE_LIMITATION_ASSAULT_VEST (1 << 8)
|
||||
#define MOVE_LIMITATION_GRAVITY (1 << 9)
|
||||
#define MOVE_LIMITATION_HEAL_BLOCK (1 << 10)
|
||||
#define MOVE_LIMITATION_BELCH (1 << 11)
|
||||
#define MOVE_LIMITATION_THROAT_CHOP (1 << 12)
|
||||
#define MOVE_LIMITATION_STUFF_CHEEKS (1 << 13)
|
||||
|
||||
#define MOVE_LIMITATION_PLACEHOLDER (1 << 15)
|
||||
#define MOVE_LIMITATIONS_ALL 0xFFFF
|
||||
|
||||
#define ABILITYEFFECT_ON_SWITCHIN 0
|
||||
#define ABILITYEFFECT_ENDTURN 1
|
||||
@ -89,7 +99,7 @@ void BattleScriptPush(const u8 *bsPtr);
|
||||
void BattleScriptPushCursor(void);
|
||||
void BattleScriptPop(void);
|
||||
u8 TrySetCantSelectMoveBattleScript(void);
|
||||
u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check);
|
||||
u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u16 check);
|
||||
bool8 AreAllMovesUnusable(void);
|
||||
u8 GetImprisonedMovesCount(u8 battlerId, u16 move);
|
||||
u8 DoFieldEndTurnEffects(void);
|
||||
|
@ -6,6 +6,7 @@
|
||||
extern u8 gLastViewedMonIndex;
|
||||
|
||||
extern const u8 *const gMoveDescriptionPointers[];
|
||||
extern const u8 gNotDoneYetDescription[];
|
||||
extern const u8 *const gNatureNamePointers[];
|
||||
|
||||
void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void));
|
||||
|
@ -245,7 +245,7 @@ static void SetBattlerAiData(u8 battlerId)
|
||||
AI_DATA->holdEffectParams[battlerId] = GetBattlerHoldEffectParam(battlerId);
|
||||
AI_DATA->predictedMoves[battlerId] = gLastMoves[battlerId];
|
||||
AI_DATA->hpPercents[battlerId] = GetHealthPercentage(battlerId);
|
||||
AI_DATA->moveLimitations[battlerId] = CheckMoveLimitations(battlerId, 0, 0xFF);
|
||||
AI_DATA->moveLimitations[battlerId] = CheckMoveLimitations(battlerId, 0, MOVE_LIMITATIONS_ALL);
|
||||
}
|
||||
|
||||
void GetAiLogicData(void)
|
||||
@ -2512,6 +2512,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
if (gBattleMons[battlerAtk].hp <= gBattleMons[battlerAtk].maxHP / 3)
|
||||
score -= 10;
|
||||
break;*/
|
||||
case EFFECT_PLACEHOLDER:
|
||||
return 0; // cannot even select
|
||||
} // move effect checks
|
||||
|
||||
if (score < 0)
|
||||
|
@ -154,7 +154,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
|
||||
return FALSE;
|
||||
if (gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE)
|
||||
return FALSE;
|
||||
if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0)
|
||||
if (IS_MOVE_STATUS(gLastLandedMoves[gActiveBattler]))
|
||||
return FALSE;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
@ -245,8 +245,7 @@ static bool8 ShouldSwitchIfNaturalCure(void)
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0);
|
||||
return TRUE;
|
||||
}
|
||||
else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0
|
||||
&& Random() & 1)
|
||||
else if (IS_MOVE_STATUS(gLastLandedMoves[gActiveBattler]) && Random() & 1)
|
||||
{
|
||||
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0);
|
||||
@ -350,7 +349,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent)
|
||||
return FALSE;
|
||||
if (gLastHitBy[gActiveBattler] == 0xFF)
|
||||
return FALSE;
|
||||
if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0)
|
||||
if (IS_MOVE_STATUS(gLastLandedMoves[gActiveBattler]))
|
||||
return FALSE;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
|
@ -2747,7 +2747,7 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode)
|
||||
int i = 0;
|
||||
int typePower = TYPE_x1;
|
||||
|
||||
if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || gBattleMoves[move].power == 0)
|
||||
if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || IS_MOVE_STATUS(move))
|
||||
return 0;
|
||||
|
||||
defType1 = gBaseStats[targetSpecies].type1;
|
||||
|
@ -282,7 +282,7 @@ static u8 GetBattlePalaceMoveGroup(u8 battlerId, u16 move)
|
||||
case MOVE_TARGET_RANDOM:
|
||||
case MOVE_TARGET_BOTH:
|
||||
case MOVE_TARGET_FOES_AND_ALLY:
|
||||
if (gBattleMoves[move].power == 0)
|
||||
if (IS_MOVE_STATUS(move))
|
||||
return PALACE_MOVE_GROUP_SUPPORT;
|
||||
else
|
||||
return PALACE_MOVE_GROUP_ATTACK;
|
||||
|
@ -1345,7 +1345,7 @@ static bool32 TryAegiFormChange(void)
|
||||
default:
|
||||
return FALSE;
|
||||
case SPECIES_AEGISLASH: // Shield -> Blade
|
||||
if (gBattleMoves[gCurrentMove].power == 0)
|
||||
if (IS_MOVE_STATUS(gCurrentMove))
|
||||
return FALSE;
|
||||
gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_BLADE;
|
||||
break;
|
||||
@ -1687,7 +1687,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u
|
||||
&& (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE))
|
||||
moveAcc = 50;
|
||||
// Check Wonder Skin.
|
||||
if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0)
|
||||
if (defAbility == ABILITY_WONDER_SKIN && IS_MOVE_STATUS(move) && moveAcc > 50)
|
||||
moveAcc = 50;
|
||||
|
||||
calc = gAccuracyStageRatios[buff].dividend * moveAcc;
|
||||
@ -8395,7 +8395,7 @@ static void Cmd_various(void)
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget))
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else if (gBattleMoves[gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]].power == 0)
|
||||
else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]))
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else
|
||||
gBattlescriptCurrInstr += 7;
|
||||
@ -8493,7 +8493,7 @@ static void Cmd_various(void)
|
||||
case VARIOUS_TRY_ME_FIRST:
|
||||
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget))
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else if (gBattleMoves[gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]].power == 0)
|
||||
else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]))
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else
|
||||
{
|
||||
@ -13452,11 +13452,11 @@ bool32 DoesSubstituteBlockMove(u8 battlerAtk, u8 battlerDef, u32 move)
|
||||
|
||||
bool32 DoesDisguiseBlockMove(u8 battlerAtk, u8 battlerDef, u32 move)
|
||||
{
|
||||
if (GetBattlerAbility(battlerDef) != ABILITY_DISGUISE
|
||||
|| gBattleMons[battlerDef].species != SPECIES_MIMIKYU
|
||||
if (gBattleMons[battlerDef].species != SPECIES_MIMIKYU
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED
|
||||
|| gBattleMoves[move].power == 0
|
||||
|| gHitMarker & HITMARKER_IGNORE_DISGUISE)
|
||||
|| IS_MOVE_STATUS(move)
|
||||
|| gHitMarker & HITMARKER_IGNORE_DISGUISE
|
||||
|| GetBattlerAbility(battlerDef) != ABILITY_DISGUISE)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
|
@ -1435,7 +1435,7 @@ static void TrySetBattleSeminarShow(void)
|
||||
return;
|
||||
else if (gBattleTypeFlags & (BATTLE_TYPE_PALACE | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID))
|
||||
return;
|
||||
else if (gBattleMoves[gBattleMons[gBattlerAttacker].moves[gMoveSelectionCursor[gBattlerAttacker]]].power == 0)
|
||||
else if (IS_MOVE_STATUS(gBattleMons[gBattlerAttacker].moves[gMoveSelectionCursor[gBattlerAttacker]]))
|
||||
return;
|
||||
|
||||
i = 0;
|
||||
@ -1496,7 +1496,7 @@ static void TrySetBattleSeminarShow(void)
|
||||
|
||||
static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride)
|
||||
{
|
||||
if (gBattleMoves[moveId].power == 0)
|
||||
if (IS_MOVE_STATUS(moveId))
|
||||
{
|
||||
*dmg = 0;
|
||||
return FALSE;
|
||||
|
@ -1764,7 +1764,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!gBattleStruct->zmove.active && gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0)
|
||||
if (!gBattleStruct->zmove.active && gDisableStructs[gActiveBattler].tauntTimer != 0 && IS_MOVE_STATUS(move))
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@ -1859,7 +1859,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedBelchInPalace;
|
||||
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedStuffCheeksInPalace;
|
||||
gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
|
||||
}
|
||||
else
|
||||
@ -1876,6 +1876,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveChoiceItemInPalace;
|
||||
gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
|
||||
}
|
||||
else
|
||||
@ -1884,12 +1885,13 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
limitations++;
|
||||
}
|
||||
}
|
||||
else if (holdEffect == HOLD_EFFECT_ASSAULT_VEST && gBattleMoves[move].power == 0 && move != MOVE_ME_FIRST)
|
||||
else if (holdEffect == HOLD_EFFECT_ASSAULT_VEST && IS_MOVE_STATUS(move) && move != MOVE_ME_FIRST)
|
||||
{
|
||||
gCurrentMove = move;
|
||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveAssaultVestInPalace;
|
||||
gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
|
||||
}
|
||||
else
|
||||
@ -1905,6 +1907,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace;
|
||||
gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
|
||||
}
|
||||
else
|
||||
@ -1927,10 +1930,24 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (gBattleMoves[move].effect == EFFECT_PLACEHOLDER)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedPlaceholderInPalace;
|
||||
gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedPlaceholder;
|
||||
limitations++;
|
||||
}
|
||||
}
|
||||
|
||||
return limitations;
|
||||
}
|
||||
|
||||
u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u16 check)
|
||||
{
|
||||
u8 holdEffect = GetBattlerHoldEffect(battlerId, TRUE);
|
||||
u16 *choicedMove = &gBattleStruct->choicedMove[battlerId];
|
||||
@ -1941,49 +1958,52 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
// No move
|
||||
if (gBattleMons[battlerId].moves[i] == MOVE_NONE && check & MOVE_LIMITATION_ZEROMOVE)
|
||||
if (check & MOVE_LIMITATION_ZEROMOVE && gBattleMons[battlerId].moves[i] == MOVE_NONE)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// No PP
|
||||
else if (gBattleMons[battlerId].pp[i] == 0 && check & MOVE_LIMITATION_PP)
|
||||
else if (check & MOVE_LIMITATION_PP && gBattleMons[battlerId].pp[i] == 0)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Placeholder
|
||||
else if (check & MOVE_LIMITATION_PLACEHOLDER && gBattleMoves[gBattleMons[battlerId].moves[i]].effect == EFFECT_PLACEHOLDER)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Disable
|
||||
else if (gBattleMons[battlerId].moves[i] == gDisableStructs[battlerId].disabledMove && check & MOVE_LIMITATION_DISABLED)
|
||||
else if (check & MOVE_LIMITATION_DISABLED && gBattleMons[battlerId].moves[i] == gDisableStructs[battlerId].disabledMove)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Torment
|
||||
else if (gBattleMons[battlerId].moves[i] == gLastMoves[battlerId] && check & MOVE_LIMITATION_TORMENTED && gBattleMons[battlerId].status2 & STATUS2_TORMENT)
|
||||
else if (check & MOVE_LIMITATION_TORMENTED && gBattleMons[battlerId].moves[i] == gLastMoves[battlerId] && gBattleMons[battlerId].status2 & STATUS2_TORMENT)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Taunt
|
||||
else if (gDisableStructs[battlerId].tauntTimer && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0)
|
||||
else if (check & MOVE_LIMITATION_TAUNT && gDisableStructs[battlerId].tauntTimer && IS_MOVE_STATUS(gBattleMons[battlerId].moves[i]))
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Imprison
|
||||
else if (GetImprisonedMovesCount(battlerId, gBattleMons[battlerId].moves[i]) && check & MOVE_LIMITATION_IMPRISON)
|
||||
else if (check & MOVE_LIMITATION_IMPRISON && GetImprisonedMovesCount(battlerId, gBattleMons[battlerId].moves[i]))
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Encore
|
||||
else if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
|
||||
else if (check & MOVE_LIMITATION_ENCORE && gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Choice Items
|
||||
else if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
else if (check & MOVE_LIMITATION_CHOICE_ITEM && HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Assault Vest
|
||||
else if (holdEffect == HOLD_EFFECT_ASSAULT_VEST && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0 && gBattleMons[battlerId].moves[i] != MOVE_ME_FIRST)
|
||||
else if (check & MOVE_LIMITATION_ASSAULT_VEST && holdEffect == HOLD_EFFECT_ASSAULT_VEST && IS_MOVE_STATUS(gBattleMons[battlerId].moves[i]) && gBattleMons[battlerId].moves[i] != MOVE_ME_FIRST)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Gravity
|
||||
else if (IsGravityPreventingMove(gBattleMons[battlerId].moves[i]))
|
||||
else if (check & MOVE_LIMITATION_GRAVITY && IsGravityPreventingMove(gBattleMons[battlerId].moves[i]))
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Heal Block
|
||||
else if (IsHealBlockPreventingMove(battlerId, gBattleMons[battlerId].moves[i]))
|
||||
else if (check & MOVE_LIMITATION_HEAL_BLOCK && IsHealBlockPreventingMove(battlerId, gBattleMons[battlerId].moves[i]))
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Belch
|
||||
else if (IsBelchPreventingMove(battlerId, gBattleMons[battlerId].moves[i]))
|
||||
else if (check & MOVE_LIMITATION_BELCH && IsBelchPreventingMove(battlerId, gBattleMons[battlerId].moves[i]))
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Throat Chop
|
||||
else if (gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].flags & FLAG_SOUND)
|
||||
else if (check & MOVE_LIMITATION_THROAT_CHOP && gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].flags & FLAG_SOUND)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Stuff Cheeks
|
||||
else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
|
||||
else if (check & MOVE_LIMITATION_STUFF_CHEEKS && gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Gorilla Tactics
|
||||
else if (GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
else if (check & MOVE_LIMITATION_CHOICE_ITEM && GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
}
|
||||
return unusableMoves;
|
||||
@ -3546,7 +3566,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
gBattleStruct->atkCancellerTracker++;
|
||||
break;
|
||||
case CANCELLER_TAUNTED: // taunt
|
||||
if (gDisableStructs[gBattlerAttacker].tauntTimer && gBattleMoves[gCurrentMove].power == 0)
|
||||
if (gDisableStructs[gBattlerAttacker].tauntTimer && IS_MOVE_STATUS(gCurrentMove))
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].usedTauntedMove = TRUE;
|
||||
CancelMultiTurnMoves(gBattlerAttacker);
|
||||
|
@ -2978,8 +2978,9 @@ static const u8 sEerieSpellDescription[] = _(
|
||||
"Attacks with psychic power.\n"
|
||||
"Foe's last move has 3 PP cut.");
|
||||
|
||||
static const u8 sNotDoneYetDescription[] = _(
|
||||
"Not done yet.");
|
||||
const u8 gNotDoneYetDescription[] = _(
|
||||
"This move can't be used. Its\n"
|
||||
"effect is in development.");
|
||||
|
||||
// MOVE_NONE is ignored in this table. Make sure to always subtract 1 before getting the right pointer.
|
||||
const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] =
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "trig.h"
|
||||
#include "window.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/battle_move_effects.h"
|
||||
#include "gba/io_reg.h"
|
||||
|
||||
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
||||
@ -807,7 +808,11 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
|
||||
}
|
||||
AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x29, TEXT_SKIP_DRAW, NULL);
|
||||
|
||||
if (move->effect != EFFECT_PLACEHOLDER)
|
||||
str = gMoveDescriptionPointers[chosenMove - 1];
|
||||
else
|
||||
str = gNotDoneYetDescription;
|
||||
|
||||
AddTextPrinterParameterized(0, FONT_NARROW, str, 0, 0x41, 0, NULL);
|
||||
}
|
||||
|
||||
|
@ -41,13 +41,14 @@
|
||||
#include "text.h"
|
||||
#include "tv.h"
|
||||
#include "window.h"
|
||||
#include "constants/battle_config.h"
|
||||
#include "constants/battle_move_effects.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/party_menu.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/battle_config.h"
|
||||
|
||||
enum {
|
||||
PSS_PAGE_INFO,
|
||||
@ -3730,15 +3731,21 @@ static void PrintContestMoveDescription(u8 moveSlot)
|
||||
static void PrintMoveDetails(u16 move)
|
||||
{
|
||||
u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_DESCRIPTION);
|
||||
u8 moveEffect;
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
|
||||
if (move != MOVE_NONE)
|
||||
{
|
||||
if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES)
|
||||
{
|
||||
moveEffect = gBattleMoves[move].effect;
|
||||
if (B_SHOW_SPLIT_ICON == TRUE)
|
||||
ShowSplitIcon(GetBattleMoveSplit(move));
|
||||
PrintMovePowerAndAccuracy(move);
|
||||
|
||||
if (moveEffect != EFFECT_PLACEHOLDER)
|
||||
PrintTextOnWindow(windowId, gMoveDescriptionPointers[move - 1], 6, 1, 0, 0);
|
||||
else
|
||||
PrintTextOnWindow(windowId, gNotDoneYetDescription, 6, 1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user