mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 20:24:18 +01:00
Implement Gorilla Tactics
It's Choice Band but as an ability.
This commit is contained in:
parent
6b65ef5bcf
commit
47bfeaeecd
@ -8502,6 +8502,10 @@ BattleScript_SelectingNotAllowedMoveChoiceItem::
|
|||||||
printselectionstring STRINGID_ITEMALLOWSONLYYMOVE
|
printselectionstring STRINGID_ITEMALLOWSONLYYMOVE
|
||||||
endselectionscript
|
endselectionscript
|
||||||
|
|
||||||
|
BattleScript_SelectingNotAllowedMoveGorillaTactics::
|
||||||
|
printselectionstring STRINGID_ABILITYALLOWSONLYMOVE
|
||||||
|
endselectionscript
|
||||||
|
|
||||||
BattleScript_SelectingNotAllowedMoveAssaultVest::
|
BattleScript_SelectingNotAllowedMoveAssaultVest::
|
||||||
printselectionstring STRINGID_ASSAULTVESTDOESNTALLOW
|
printselectionstring STRINGID_ASSAULTVESTDOESNTALLOW
|
||||||
endselectionscript
|
endselectionscript
|
||||||
|
@ -402,5 +402,6 @@ extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[];
|
|||||||
extern const u8 BattleScript_BlockedByPrimalWeatherRet[];
|
extern const u8 BattleScript_BlockedByPrimalWeatherRet[];
|
||||||
extern const u8 BattleScript_PrimalReversion[];
|
extern const u8 BattleScript_PrimalReversion[];
|
||||||
extern const u8 BattleScript_HyperspaceFuryRemoveProtect[];
|
extern const u8 BattleScript_HyperspaceFuryRemoveProtect[];
|
||||||
|
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[];
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||||
|
@ -597,8 +597,9 @@
|
|||||||
#define STRINGID_BUTPOKEMONCANTUSETHEMOVE 594
|
#define STRINGID_BUTPOKEMONCANTUSETHEMOVE 594
|
||||||
#define STRINGID_BUTHOOPACANTUSEIT 595
|
#define STRINGID_BUTHOOPACANTUSEIT 595
|
||||||
#define STRINGID_BROKETHROUGHPROTECTION 596
|
#define STRINGID_BROKETHROUGHPROTECTION 596
|
||||||
|
#define STRINGID_ABILITYALLOWSONLYMOVE 597
|
||||||
|
|
||||||
#define BATTLESTRINGS_COUNT 597
|
#define BATTLESTRINGS_COUNT 598
|
||||||
|
|
||||||
// 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.
|
||||||
|
@ -723,9 +723,11 @@ static const u8 sText_PkmnRevertedToPrimal[] = _("{B_ATK_NAME_WITH_PREFIX}'s Pri
|
|||||||
static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFIX} can't\nuse the move!");
|
static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFIX} can't\nuse the move!");
|
||||||
static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!");
|
static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!");
|
||||||
static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!");
|
static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!");
|
||||||
|
static const u8 sText_AbilityAllowsOnlyMove[] = _("{B_ATK_ABILITY} allows the\nuse of only {B_CURRENT_MOVE}!\p");
|
||||||
|
|
||||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||||
{
|
{
|
||||||
|
[STRINGID_ABILITYALLOWSONLYMOVE - 12] = sText_AbilityAllowsOnlyMove,
|
||||||
[STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection,
|
[STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection,
|
||||||
[STRINGID_BUTPOKEMONCANTUSETHEMOVE - 12] = sText_ButPokemonCantUseTheMove,
|
[STRINGID_BUTPOKEMONCANTUSETHEMOVE - 12] = sText_ButPokemonCantUseTheMove,
|
||||||
[STRINGID_BUTHOOPACANTUSEIT - 12] = sText_ButHoopaCantUseIt,
|
[STRINGID_BUTHOOPACANTUSEIT - 12] = sText_ButHoopaCantUseIt,
|
||||||
|
@ -4942,7 +4942,7 @@ static void Cmd_moveend(void)
|
|||||||
break;
|
break;
|
||||||
case MOVEEND_CHOICE_MOVE: // update choice band move
|
case MOVEEND_CHOICE_MOVE: // update choice band move
|
||||||
if (gHitMarker & HITMARKER_OBEYS
|
if (gHitMarker & HITMARKER_OBEYS
|
||||||
&& HOLD_EFFECT_CHOICE(holdEffectAtk)
|
&& (HOLD_EFFECT_CHOICE(holdEffectAtk) || GetBattlerAbility(gBattlerAttacker))
|
||||||
&& gChosenMove != MOVE_STRUGGLE
|
&& gChosenMove != MOVE_STRUGGLE
|
||||||
&& (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF))
|
&& (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF))
|
||||||
{
|
{
|
||||||
|
@ -1776,6 +1776,21 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
|||||||
limitations++;
|
limitations++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ((GetBattlerAbility(gActiveBattler) == ABILITY_GORILLA_TACTICS) && *choicedMove != 0
|
||||||
|
&& *choicedMove != 0xFFFF && *choicedMove != move)
|
||||||
|
{
|
||||||
|
gCurrentMove = *choicedMove;
|
||||||
|
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||||
|
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||||
|
{
|
||||||
|
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveGorillaTactics;
|
||||||
|
limitations++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (gBattleMons[gActiveBattler].pp[moveId] == 0)
|
if (gBattleMons[gActiveBattler].pp[moveId] == 0)
|
||||||
{
|
{
|
||||||
@ -1831,6 +1846,8 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
|||||||
unusableMoves |= gBitTable[i];
|
unusableMoves |= gBitTable[i];
|
||||||
else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
|
else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
|
||||||
unusableMoves |= gBitTable[i];
|
unusableMoves |= gBitTable[i];
|
||||||
|
else if (GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||||
|
unusableMoves |= gBitTable[i];
|
||||||
}
|
}
|
||||||
return unusableMoves;
|
return unusableMoves;
|
||||||
}
|
}
|
||||||
@ -7837,6 +7854,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
|
|||||||
if (moveType == TYPE_DRAGON)
|
if (moveType == TYPE_DRAGON)
|
||||||
MulModifier(&modifier, UQ_4_12(1.5));
|
MulModifier(&modifier, UQ_4_12(1.5));
|
||||||
break;
|
break;
|
||||||
|
case ABILITY_GORILLA_TACTICS:
|
||||||
|
if (IS_MOVE_PHYSICAL(move))
|
||||||
|
MulModifier(&modifier, UQ_4_12(1.5));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// field abilities
|
// field abilities
|
||||||
|
Loading…
Reference in New Issue
Block a user