Placeholder moves can't be used in battle.

This commit is contained in:
Eduardo Quezada 2022-08-24 00:30:49 -04:00
parent 56a2e91518
commit eea718cfc6
9 changed files with 53 additions and 5 deletions

View file

@ -9200,6 +9200,7 @@ BattleScript_ItemHealHP_Ret::
BattleScript_SelectingNotAllowedMoveChoiceItem:: BattleScript_SelectingNotAllowedMoveChoiceItem::
printselectionstring STRINGID_ITEMALLOWSONLYYMOVE printselectionstring STRINGID_ITEMALLOWSONLYYMOVE
endselectionscript endselectionscript
BattleScript_SelectingNotAllowedMoveChoiceItemInPalace:: BattleScript_SelectingNotAllowedMoveChoiceItemInPalace::
printstring STRINGID_ITEMALLOWSONLYYMOVE printstring STRINGID_ITEMALLOWSONLYYMOVE
goto BattleScript_SelectingUnusableMoveInPalace goto BattleScript_SelectingUnusableMoveInPalace
@ -9207,6 +9208,7 @@ BattleScript_SelectingNotAllowedMoveChoiceItemInPalace::
BattleScript_SelectingNotAllowedMoveGorillaTactics:: BattleScript_SelectingNotAllowedMoveGorillaTactics::
printselectionstring STRINGID_ABILITYALLOWSONLYMOVE printselectionstring STRINGID_ABILITYALLOWSONLYMOVE
endselectionscript endselectionscript
BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace:: BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace::
printstring STRINGID_ABILITYALLOWSONLYMOVE printstring STRINGID_ABILITYALLOWSONLYMOVE
goto BattleScript_SelectingUnusableMoveInPalace goto BattleScript_SelectingUnusableMoveInPalace
@ -9214,10 +9216,19 @@ BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace::
BattleScript_SelectingNotAllowedMoveAssaultVest:: BattleScript_SelectingNotAllowedMoveAssaultVest::
printselectionstring STRINGID_ASSAULTVESTDOESNTALLOW printselectionstring STRINGID_ASSAULTVESTDOESNTALLOW
endselectionscript endselectionscript
BattleScript_SelectingNotAllowedMoveAssaultVestInPalace:: BattleScript_SelectingNotAllowedMoveAssaultVestInPalace::
printstring STRINGID_ASSAULTVESTDOESNTALLOW printstring STRINGID_ASSAULTVESTDOESNTALLOW
goto BattleScript_SelectingUnusableMoveInPalace goto BattleScript_SelectingUnusableMoveInPalace
BattleScript_SelectingNotAllowedPlaceholder::
printselectionstring STRINGID_NOTDONEYET
endselectionscript
BattleScript_SelectingNotAllowedPlaceholderInPalace::
printstring STRINGID_NOTDONEYET
goto BattleScript_SelectingUnusableMoveInPalace
BattleScript_HangedOnMsg:: BattleScript_HangedOnMsg::
playanimation BS_TARGET, B_ANIM_HANGED_ON playanimation BS_TARGET, B_ANIM_HANGED_ON
printstring STRINGID_PKMNHUNGONWITHX printstring STRINGID_PKMNHUNGONWITHX

View file

@ -277,6 +277,8 @@ extern const u8 BattleScript_HarvestActivates[];
extern const u8 BattleScript_ImposterActivates[]; extern const u8 BattleScript_ImposterActivates[];
extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVest[]; extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVest[];
extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVestInPalace[]; extern const u8 BattleScript_SelectingNotAllowedMoveAssaultVestInPalace[];
extern const u8 BattleScript_SelectingNotAllowedPlaceholder[];
extern const u8 BattleScript_SelectingNotAllowedPlaceholderInPalace[];
extern const u8 BattleScript_SelectingNotAllowedMoveGravity[]; extern const u8 BattleScript_SelectingNotAllowedMoveGravity[];
extern const u8 BattleScript_MoveUsedGravityPrevents[]; extern const u8 BattleScript_MoveUsedGravityPrevents[];
extern const u8 BattleScript_SelectingNotAllowedMoveGravityInPalace[]; extern const u8 BattleScript_SelectingNotAllowedMoveGravityInPalace[];

View file

@ -15,6 +15,8 @@
#define MOVE_LIMITATION_BELCH (1 << 11) #define MOVE_LIMITATION_BELCH (1 << 11)
#define MOVE_LIMITATION_THROAT_CHOP (1 << 12) #define MOVE_LIMITATION_THROAT_CHOP (1 << 12)
#define MOVE_LIMITATION_STUFF_CHEEKS (1 << 13) #define MOVE_LIMITATION_STUFF_CHEEKS (1 << 13)
#define MOVE_LIMITATION_PLACEHOLDER (1 << 15)
#define MOVE_LIMITATIONS_ALL 0xFFFF #define MOVE_LIMITATIONS_ALL 0xFFFF
#define ABILITYEFFECT_ON_SWITCHIN 0 #define ABILITYEFFECT_ON_SWITCHIN 0

View file

@ -6,6 +6,7 @@
extern u8 gLastViewedMonIndex; extern u8 gLastViewedMonIndex;
extern const u8 *const gMoveDescriptionPointers[]; extern const u8 *const gMoveDescriptionPointers[];
extern const u8 gNotDoneYetDescription[];
extern const u8 *const gNatureNamePointers[]; extern const u8 *const gNatureNamePointers[];
void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void));

View file

@ -2512,6 +2512,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
if (gBattleMons[battlerAtk].hp <= gBattleMons[battlerAtk].maxHP / 3) if (gBattleMons[battlerAtk].hp <= gBattleMons[battlerAtk].maxHP / 3)
score -= 10; score -= 10;
break;*/ break;*/
case EFFECT_PLACEHOLDER:
return 0; // cannot even select
} // move effect checks } // move effect checks
if (score < 0) if (score < 0)

View file

@ -1930,6 +1930,20 @@ 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; return limitations;
} }
@ -1949,6 +1963,9 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u16 check)
// No PP // No PP
else if (check & MOVE_LIMITATION_PP && gBattleMons[battlerId].pp[i] == 0) else if (check & MOVE_LIMITATION_PP && gBattleMons[battlerId].pp[i] == 0)
unusableMoves |= gBitTable[i]; unusableMoves |= gBitTable[i];
// Placeholder
else if (check & MOVE_LIMITATION_PLACEHOLDER && gBattleMoves[gBattleMons[battlerId].moves[i]].effect == EFFECT_PLACEHOLDER)
unusableMoves |= gBitTable[i];
// Disable // Disable
else if (check & MOVE_LIMITATION_DISABLED && gBattleMons[battlerId].moves[i] == gDisableStructs[battlerId].disabledMove) else if (check & MOVE_LIMITATION_DISABLED && gBattleMons[battlerId].moves[i] == gDisableStructs[battlerId].disabledMove)
unusableMoves |= gBitTable[i]; unusableMoves |= gBitTable[i];

View file

@ -2978,8 +2978,9 @@ static const u8 sEerieSpellDescription[] = _(
"Attacks with psychic power.\n" "Attacks with psychic power.\n"
"Foe's last move has 3 PP cut."); "Foe's last move has 3 PP cut.");
static const u8 sNotDoneYetDescription[] = _( const u8 gNotDoneYetDescription[] = _(
"Not done yet."); "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. // 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] = const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] =

View file

@ -24,6 +24,7 @@
#include "trig.h" #include "trig.h"
#include "window.h" #include "window.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/battle_move_effects.h"
#include "gba/io_reg.h" #include "gba/io_reg.h"
extern const struct CompressedSpriteSheet gMonFrontPicTable[]; 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); AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x29, TEXT_SKIP_DRAW, NULL);
str = gMoveDescriptionPointers[chosenMove - 1]; if (move->effect != EFFECT_PLACEHOLDER)
str = gMoveDescriptionPointers[chosenMove - 1];
else
str = gNotDoneYetDescription;
AddTextPrinterParameterized(0, FONT_NARROW, str, 0, 0x41, 0, NULL); AddTextPrinterParameterized(0, FONT_NARROW, str, 0, 0x41, 0, NULL);
} }

View file

@ -41,13 +41,14 @@
#include "text.h" #include "text.h"
#include "tv.h" #include "tv.h"
#include "window.h" #include "window.h"
#include "constants/battle_config.h"
#include "constants/battle_move_effects.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/party_menu.h" #include "constants/party_menu.h"
#include "constants/region_map_sections.h" #include "constants/region_map_sections.h"
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/battle_config.h"
enum { enum {
PSS_PAGE_INFO, PSS_PAGE_INFO,
@ -3730,15 +3731,21 @@ static void PrintContestMoveDescription(u8 moveSlot)
static void PrintMoveDetails(u16 move) static void PrintMoveDetails(u16 move)
{ {
u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_DESCRIPTION); u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_DESCRIPTION);
u8 moveEffect;
FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
if (move != MOVE_NONE) if (move != MOVE_NONE)
{ {
if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES) if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES)
{ {
moveEffect = gBattleMoves[move].effect;
if (B_SHOW_SPLIT_ICON == TRUE) if (B_SHOW_SPLIT_ICON == TRUE)
ShowSplitIcon(GetBattleMoveSplit(move)); ShowSplitIcon(GetBattleMoveSplit(move));
PrintMovePowerAndAccuracy(move); PrintMovePowerAndAccuracy(move);
PrintTextOnWindow(windowId, gMoveDescriptionPointers[move - 1], 6, 1, 0, 0);
if (moveEffect != EFFECT_PLACEHOLDER)
PrintTextOnWindow(windowId, gMoveDescriptionPointers[move - 1], 6, 1, 0, 0);
else
PrintTextOnWindow(windowId, gNotDoneYetDescription, 6, 1, 0, 0);
} }
else else
{ {