mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
Cleaned up use of configs be almost exclusively preproc functions
This commit is contained in:
parent
7c7887aa65
commit
1f5adf93c7
@ -23548,26 +23548,25 @@ Move_SECRET_POWER:
|
||||
jumpargeq 0, BATTLE_TERRAIN_PUDDLE, Move_MUD_SHOT
|
||||
jumpargeq 0, BATTLE_TERRAIN_MARSH, Move_MUD_SHOT
|
||||
jumpargeq 0, BATTLE_TERRAIN_SWAMP, Move_MUD_SHOT
|
||||
.if B_SECRET_POWER_ANIMATION >= GEN_7
|
||||
jumpargeq 0, BATTLE_TERRAIN_SNOW, Move_ICE_SHARD
|
||||
.else
|
||||
jumpargeq 0, BATTLE_TERRAIN_SNOW, Move_AVALANCHE
|
||||
.endif
|
||||
jumpargeq 0, BATTLE_TERRAIN_ICE, Move_ICE_SHARD
|
||||
jumpargeq 0, BATTLE_TERRAIN_VOLCANO, Move_INCINERATE
|
||||
jumpargeq 0, BATTLE_TERRAIN_DISTORTION_WORLD, Move_POUND
|
||||
jumpargeq 0, BATTLE_TERRAIN_SPACE, Move_SWIFT
|
||||
jumpargeq 0, BATTLE_TERRAIN_ULTRA_SPACE, Move_PSYWAVE
|
||||
.if B_SECRET_POWER_ANIMATION >= GEN_7
|
||||
jumpargeq 0, BATTLE_TERRAIN_SNOW, Move_ICE_SHARD
|
||||
jumpargeq 0, BATTLE_TERRAIN_BUILDING, Move_SPIT_UP
|
||||
goto Move_SPIT_UP
|
||||
.elseif B_SECRET_POWER_ANIMATION == GEN_6
|
||||
.elseif B_SECRET_POWER_ANIMATION >= GEN_6
|
||||
jumpargeq 0, BATTLE_TERRAIN_SNOW, Move_AVALANCHE
|
||||
jumpargeq 0, BATTLE_TERRAIN_BUILDING, Move_BODY_SLAM
|
||||
goto Move_BODY_SLAM
|
||||
.elseif B_SECRET_POWER_ANIMATION == GEN_5 || B_SECRET_POWER_ANIMATION == GEN_4
|
||||
.elseif B_SECRET_POWER_ANIMATION >= GEN_4
|
||||
jumpargeq 0, BATTLE_TERRAIN_SNOW, Move_AVALANCHE
|
||||
jumpargeq 0, BATTLE_TERRAIN_BUILDING, Move_BODY_SLAM
|
||||
goto Move_MUD_SLAP
|
||||
.else
|
||||
jumpargeq 0, BATTLE_TERRAIN_SNOW, Move_AVALANCHE
|
||||
jumpargeq 0, BATTLE_TERRAIN_BUILDING, Move_STRENGTH
|
||||
goto Move_SLAM
|
||||
.endif
|
||||
|
@ -77,7 +77,7 @@
|
||||
|
||||
// Move stat change settings
|
||||
#define B_FELL_STINGER_STAT_RAISE GEN_7 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint.
|
||||
#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
|
||||
#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen8+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
|
||||
#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage.
|
||||
#define B_CHARGE_SPDEF_RAISE GEN_7 // In Gen5+, Charge raises the user's Special Defense by 1 stage.
|
||||
#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1.
|
||||
@ -117,9 +117,8 @@
|
||||
#define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.
|
||||
#define B_BERRIES_INSTANT GEN_7 // In Gen4+, most berries activate on battle start/switch-in if applicable. In Gen3, they only activate either at the move end or turn end.
|
||||
#define B_CONFUSE_BERRIES_HEAL GEN_8 // Before Gen7, Figy and similar berries restore 1/8th of HP and trigger at half HP. In Gen7 they restore half HP, triggering at 25% HP. In Gen8 they heal 1/3rd of HP.
|
||||
// Requires using Item Expansion or manually editing the holdEffectParam of Figy, Wiki, Mago, Aguav and Iapapa berries.
|
||||
#define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1.
|
||||
#define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable
|
||||
#define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Taunt, Encore, Torment, Heal Block, and Disable in addition to Infatuation from before.
|
||||
#define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items.
|
||||
#define B_SOUL_DEW_BOOST GEN_7 // In Gens3-6, Soul Dew boosts Lati@s' Sp. Atk and Sp. Def. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead.
|
||||
#define B_NET_BALL_MODIFIER GEN_7 // In Gen7+, Net Ball's catch multiplier is x5 instead of x3.
|
||||
|
@ -142,8 +142,10 @@ static u32 GetWildAiFlags(void)
|
||||
if (avgLevel >= 80)
|
||||
flags |= AI_FLAG_HP_AWARE;
|
||||
|
||||
if (B_VAR_WILD_AI_FLAGS != 0 && VarGet(B_VAR_WILD_AI_FLAGS) != 0)
|
||||
#if B_VAR_WILD_AI_FLAGS != 0
|
||||
if (VarGet(B_VAR_WILD_AI_FLAGS) != 0)
|
||||
flags |= VarGet(B_VAR_WILD_AI_FLAGS);
|
||||
#endif
|
||||
|
||||
return flags;
|
||||
}
|
||||
@ -1273,10 +1275,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
score -= 10;
|
||||
break;
|
||||
case EFFECT_OHKO:
|
||||
if (B_SHEER_COLD_IMMUNITY >= GEN_7
|
||||
&& move == MOVE_SHEER_COLD
|
||||
&& IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
|
||||
#if B_SHEER_COLD_IMMUNITY >= GEN_7
|
||||
if (move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
|
||||
return 0;
|
||||
#endif
|
||||
if (!ShouldTryOHKO(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move))
|
||||
score -= 10;
|
||||
break;
|
||||
@ -1304,8 +1306,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
score -= 8;
|
||||
else if (AI_DATA->hpPercents[battlerAtk] <= 25)
|
||||
score -= 10;
|
||||
else if (B_SOUND_SUBSTITUTE >= GEN_6 && TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND))
|
||||
#if B_SOUND_SUBSTITUTE >= GEN_6
|
||||
else if (TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND))
|
||||
score -= 8;
|
||||
#endif
|
||||
break;
|
||||
case EFFECT_LEECH_SEED:
|
||||
if (gStatuses3[battlerDef] & STATUS3_LEECHSEED
|
||||
@ -1317,7 +1321,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
break;
|
||||
case EFFECT_DISABLE:
|
||||
if (gDisableStructs[battlerDef].disableTimer == 0
|
||||
&& (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB
|
||||
#endif
|
||||
&& !PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
|
||||
{
|
||||
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first
|
||||
@ -1337,7 +1343,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
break;
|
||||
case EFFECT_ENCORE:
|
||||
if (gDisableStructs[battlerDef].encoreTimer == 0
|
||||
&& (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB
|
||||
#endif
|
||||
&& !DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove))
|
||||
{
|
||||
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first
|
||||
@ -1570,9 +1578,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
score -= 10;
|
||||
break;
|
||||
}
|
||||
|
||||
if (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_MENTAL_HERB)
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
if (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_MENTAL_HERB)
|
||||
score -= 6;
|
||||
#endif
|
||||
break;
|
||||
case EFFECT_WILL_O_WISP:
|
||||
if (!AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
|
||||
@ -3543,7 +3552,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
break;
|
||||
case EFFECT_DISABLE:
|
||||
if (gDisableStructs[battlerDef].disableTimer == 0
|
||||
&& (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)) // mental herb
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB // mental herb
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // AI goes first
|
||||
{
|
||||
@ -3565,7 +3577,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
break;
|
||||
case EFFECT_ENCORE:
|
||||
if (gDisableStructs[battlerDef].encoreTimer == 0
|
||||
&& (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)) // mental herb
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB // mental herb
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (IsEncoreEncouragedEffect(gBattleMoves[gLastMoves[battlerDef]].effect))
|
||||
score += 3;
|
||||
@ -3614,7 +3629,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
{
|
||||
bool32 canSteal = FALSE;
|
||||
|
||||
#if defined B_TRAINERS_KNOCK_OFF_ITEMS && B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
canSteal = TRUE;
|
||||
#endif
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER || GetBattlerSide(battlerAtk) == B_SIDE_PLAYER)
|
||||
|
@ -600,21 +600,25 @@ bool32 AtMaxHp(u8 battlerId)
|
||||
bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch)
|
||||
{
|
||||
u8 holdEffect = AI_DATA->holdEffects[battler];
|
||||
if ((B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST))
|
||||
|| (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL)
|
||||
|| (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY)
|
||||
|| (!checkSwitch && holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN))
|
||||
{
|
||||
|
||||
#if B_GHOSTS_ESCAPE >= GEN_6
|
||||
if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)
|
||||
|| IsAbilityPreventingEscape(battler)
|
||||
|| gStatuses3[battler] & (STATUS3_ROOTED | STATUS3_SKY_DROPPED)
|
||||
|| (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK))
|
||||
#endif
|
||||
if (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL)
|
||||
return FALSE;
|
||||
else if (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY)
|
||||
return FALSE;
|
||||
else if (!checkSwitch && holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
||||
return FALSE;
|
||||
else if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|
||||
return TRUE;
|
||||
else if (gStatuses3[battler] & (STATUS3_ROOTED | STATUS3_SKY_DROPPED))
|
||||
return TRUE;
|
||||
else if (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)
|
||||
return TRUE;
|
||||
else if (IsAbilityPreventingEscape(battler))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -647,8 +651,10 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler)
|
||||
// move checks
|
||||
bool32 IsAffectedByPowder(u8 battler, u16 ability, u16 holdEffect)
|
||||
{
|
||||
if ((B_POWDER_GRASS >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GRASS))
|
||||
|| ability == ABILITY_OVERCOAT
|
||||
if (ability == ABILITY_OVERCOAT
|
||||
#if B_POWDER_GRASS >= GEN_6
|
||||
|| IS_BATTLER_OF_TYPE(battler, TYPE_GRASS)
|
||||
#endif
|
||||
|| holdEffect == HOLD_EFFECT_SAFETY_GOGGLES)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
@ -1415,8 +1421,10 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move)
|
||||
if (AI_DATA->abilities[battlerDef] == ABILITY_NO_GUARD || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD)
|
||||
return TRUE;
|
||||
|
||||
if (B_TOXIC_NEVER_MISS >= GEN_6 && gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON))
|
||||
#if B_TOXIC_NEVER_MISS >= GEN_6
|
||||
if (gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON))
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
// discouraged from hitting
|
||||
if (AI_WeatherHasEffect() && (gBattleWeather & B_WEATHER_SUN)
|
||||
@ -1428,8 +1436,10 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move)
|
||||
(((gBattleWeather & B_WEATHER_RAIN) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE))
|
||||
|| (((gBattleWeather & B_WEATHER_HAIL) && move == MOVE_BLIZZARD))))
|
||||
|| (gBattleMoves[move].effect == EFFECT_VITAL_THROW)
|
||||
|| (gBattleMoves[move].accuracy == 0)
|
||||
|| ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[battlerDef] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE)))
|
||||
#if B_MINIMIZE_DMG_ACC >= GEN_6
|
||||
|| ((gStatuses3[battlerDef] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))
|
||||
#endif
|
||||
|| (gBattleMoves[move].accuracy == 0))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@ -2240,10 +2250,15 @@ static u32 GetTrapDamage(u8 battlerId)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_WRAPPED)
|
||||
{
|
||||
if (holdEffect == HOLD_EFFECT_BINDING_BAND)
|
||||
damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 6 : 8;
|
||||
#if B_BINDING_DAMAGE >= GEN_6
|
||||
damage = gBattleMons[battlerId].maxHP / 6;
|
||||
else
|
||||
damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 8 : 16;
|
||||
|
||||
damage = gBattleMons[battlerId].maxHP / 8;
|
||||
#else
|
||||
damage = gBattleMons[battlerId].maxHP / 8;
|
||||
else
|
||||
damage = gBattleMons[battlerId].maxHP / 16;
|
||||
#endif
|
||||
if (damage == 0)
|
||||
damage = 1;
|
||||
}
|
||||
@ -2463,13 +2478,21 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo
|
||||
|
||||
if (!IS_MOVE_STATUS(move) && (shouldSwitch
|
||||
|| (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH
|
||||
|| (defAbility == ABILITY_STURDY && B_STURDY >= GEN_5) || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD))))
|
||||
#if B_STURDY >= GEN_5
|
||||
|| defAbility == ABILITY_STURDY
|
||||
#endif
|
||||
|| defAbility == ABILITY_MULTISCALE
|
||||
|| defAbility == ABILITY_SHADOW_SHIELD))))
|
||||
return PIVOT; // pivot to break sash/sturdy/multiscale
|
||||
}
|
||||
else if (!hasStatBoost)
|
||||
{
|
||||
if (!IS_MOVE_STATUS(move) && (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH
|
||||
|| (defAbility == ABILITY_STURDY && B_STURDY >= GEN_5) || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD)))
|
||||
#if B_STURDY >= GEN_5
|
||||
|| (defAbility == ABILITY_STURDY)
|
||||
#endif
|
||||
|| defAbility == ABILITY_MULTISCALE
|
||||
|| defAbility == ABILITY_SHADOW_SHIELD)))
|
||||
return PIVOT; // pivot to break sash/sturdy/multiscale
|
||||
|
||||
if (shouldSwitch)
|
||||
@ -2608,7 +2631,7 @@ bool32 CanKnockOffItem(u8 battler, u16 item)
|
||||
| BATTLE_TYPE_LINK
|
||||
| BATTLE_TYPE_RECORDED_LINK
|
||||
| BATTLE_TYPE_SECRET_BASE
|
||||
#if defined B_TRAINERS_KNOCK_OFF_ITEMS
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
| BATTLE_TYPE_TRAINER
|
||||
#endif
|
||||
)) && GetBattlerSide(battler) == B_SIDE_PLAYER)
|
||||
|
@ -330,11 +330,13 @@ static void HandleInputChooseAction(void)
|
||||
{
|
||||
SwapHpBarsWithHpText();
|
||||
}
|
||||
else if (B_ENABLE_DEBUG && gMain.newKeys & SELECT_BUTTON)
|
||||
#if B_ENABLE_DEBUG == TRUE
|
||||
else if (gMain.newKeys & SELECT_BUTTON)
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_DEBUG, 0);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
#endif
|
||||
#if B_LAST_USED_BALL == TRUE
|
||||
else if (JOY_NEW(B_LAST_USED_BALL_BUTTON) && CanThrowLastUsedBall())
|
||||
{
|
||||
@ -652,9 +654,8 @@ static void HandleInputChooseMove(void)
|
||||
canSelectTarget = 0;
|
||||
}
|
||||
|
||||
#if B_SHOW_TARGETS == TRUE
|
||||
// Show all available targets for multi-target moves
|
||||
if (B_SHOW_TARGETS)
|
||||
{
|
||||
if ((moveTarget & MOVE_TARGET_ALL_BATTLERS) == MOVE_TARGET_ALL_BATTLERS)
|
||||
{
|
||||
u32 i = 0;
|
||||
@ -671,7 +672,7 @@ static void HandleInputChooseMove(void)
|
||||
TryShowAsTarget(BATTLE_PARTNER(gActiveBattler));
|
||||
canSelectTarget = 2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (canSelectTarget)
|
||||
|
@ -3119,10 +3119,11 @@ static void RestoreOverwrittenPixels(u8 *tiles)
|
||||
|
||||
void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle)
|
||||
{
|
||||
#if B_ABILITY_POP_UP == TRUE
|
||||
const s16 (*coords)[2];
|
||||
u8 spriteId1, spriteId2, battlerPosition, taskId;
|
||||
|
||||
if (!B_ABILITY_POP_UP)
|
||||
|
||||
return;
|
||||
|
||||
if (gBattleScripting.abilityPopupOverwrite != 0)
|
||||
@ -3189,6 +3190,7 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle)
|
||||
PrintBattlerOnAbilityPopUp(battlerId, spriteId1, spriteId2);
|
||||
PrintAbilityOnAbilityPopUp(ability, spriteId1, spriteId2);
|
||||
RestoreOverwrittenPixels((void*)(OBJ_VRAM0) + (gSprites[spriteId1].oam.tileNum * 32));
|
||||
#endif
|
||||
}
|
||||
|
||||
void UpdateAbilityPopup(u8 battlerId)
|
||||
|
@ -3361,10 +3361,11 @@ static void DoBattleIntro(void)
|
||||
}
|
||||
else // Skip party summary since it is a wild battle.
|
||||
{
|
||||
if (B_FAST_INTRO)
|
||||
#if B_FAST_INTRO == TRUE
|
||||
*state = 7; // Don't wait for sprite, print message at the same time.
|
||||
else
|
||||
#else
|
||||
*state = 6; // Wait for sprite to load.
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case 5: // draw party summary in trainer battles
|
||||
@ -3433,10 +3434,11 @@ static void DoBattleIntro(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (B_FAST_INTRO)
|
||||
#if B_FAST_INTRO == TRUE
|
||||
*state = 15; // Wait for text to be printed.
|
||||
else
|
||||
#else
|
||||
*state = 14; // Wait for text and sprite.
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -3474,9 +3476,11 @@ static void DoBattleIntro(void)
|
||||
BtlController_EmitIntroTrainerBallThrow(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
if (B_FAST_INTRO && !(gBattleTypeFlags & (BATTLE_TYPE_RECORDED | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_RECORDED_IS_MASTER | BATTLE_TYPE_LINK)))
|
||||
#if B_FAST_INTRO == TRUE
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_RECORDED | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_RECORDED_IS_MASTER | BATTLE_TYPE_LINK)))
|
||||
*state = 15; // Print at the same time as trainer sends out second mon.
|
||||
else
|
||||
#endif
|
||||
(*state)++;
|
||||
break;
|
||||
case 14: // wait for opponent 2 send out
|
||||
@ -3496,13 +3500,14 @@ static void DoBattleIntro(void)
|
||||
gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
|
||||
// A hack that makes fast intro work in trainer battles too.
|
||||
if (B_FAST_INTRO
|
||||
&& gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||
#if B_FAST_INTRO == TRUE
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||
&& !(gBattleTypeFlags & (BATTLE_TYPE_RECORDED | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_RECORDED_IS_MASTER | BATTLE_TYPE_LINK))
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_SIDE]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
PrepareStringBattle(STRINGID_INTROSENDOUT, gActiveBattler);
|
||||
}
|
||||
@ -4456,7 +4461,11 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId)
|
||||
|
||||
// paralysis drop
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS && ability != ABILITY_QUICK_FEET)
|
||||
speed /= (B_PARALYSIS_SPEED >= GEN_7 ? 2 : 4);
|
||||
#if B_PARALYSIS_SPEED >= GEN_7
|
||||
speed /= 2;
|
||||
#else
|
||||
speed /= 4;
|
||||
#endif
|
||||
|
||||
return speed;
|
||||
}
|
||||
@ -4481,8 +4490,10 @@ s8 GetMovePriority(u32 battlerId, u16 move)
|
||||
|
||||
priority = gBattleMoves[move].priority;
|
||||
if (ability == ABILITY_GALE_WINGS
|
||||
&& gBattleMoves[move].type == TYPE_FLYING
|
||||
&& (B_GALE_WINGS <= GEN_6 || BATTLER_MAX_HP(battlerId)))
|
||||
#if B_GALE_WINGS >= GEN_7
|
||||
&& BATTLER_MAX_HP(battlerId)
|
||||
#endif
|
||||
&& gBattleMoves[move].type == TYPE_FLYING)
|
||||
{
|
||||
priority++;
|
||||
}
|
||||
@ -5125,7 +5136,7 @@ static void HandleEndTurn_FinishBattle(void)
|
||||
RecordedBattle_SetPlaybackFinished();
|
||||
BeginFastPaletteFade(3);
|
||||
FadeOutMapMusic(5);
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
|
||||
TryRestoreStolenItems();
|
||||
#endif
|
||||
@ -5170,7 +5181,10 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
|
||||
| BATTLE_TYPE_FRONTIER
|
||||
| BATTLE_TYPE_EREADER_TRAINER
|
||||
| BATTLE_TYPE_WALLY_TUTORIAL))
|
||||
&& (B_EVOLUTION_AFTER_WHITEOUT >= GEN_6 || gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
|
||||
#if B_EVOLUTION_AFTER_WHITEOUT <= GEN_5
|
||||
&& (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
gBattleMainFunc = TrySpecialEvolution;
|
||||
}
|
||||
@ -5455,5 +5469,9 @@ void SetTotemBoost(void)
|
||||
|
||||
bool32 IsWildMonSmart(void)
|
||||
{
|
||||
return (B_SMART_WILD_AI_FLAG != 0 && FlagGet(B_SMART_WILD_AI_FLAG));
|
||||
#if B_SMART_WILD_AI_FLAG != 0
|
||||
return (FlagGet(B_SMART_WILD_AI_FLAG));
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
@ -856,8 +856,10 @@ static bool8 DoesTypePreventStatus(u16 species, u32 status)
|
||||
break;
|
||||
case STATUS1_PARALYSIS:
|
||||
if (gBaseStats[species].type1 == TYPE_GROUND || gBaseStats[species].type2 == TYPE_GROUND
|
||||
|| (B_PARALYZE_ELECTRIC >= GEN_6 &&
|
||||
(gBaseStats[species].type1 == TYPE_ELECTRIC || gBaseStats[species].type2 == TYPE_ELECTRIC)))
|
||||
#if B_PARALYZE_ELECTRIC >= GEN_6
|
||||
|| gBaseStats[species].type1 == TYPE_ELECTRIC || gBaseStats[species].type2 == TYPE_ELECTRIC
|
||||
#endif
|
||||
)
|
||||
ret = TRUE;
|
||||
break;
|
||||
case STATUS1_BURN:
|
||||
|
@ -1395,7 +1395,7 @@ static void Cmd_attackcanceler(void)
|
||||
gBattlescriptCurrInstr = BattleScript_MoveEnd;
|
||||
return;
|
||||
}
|
||||
#if (B_STANCE_CHANGE_FAIL <= GEN_6)
|
||||
#if B_STANCE_CHANGE_FAIL <= GEN_6
|
||||
if (TryAegiFormChange())
|
||||
return;
|
||||
#endif
|
||||
@ -1430,7 +1430,7 @@ static void Cmd_attackcanceler(void)
|
||||
gMoveResultFlags |= MOVE_RESULT_MISSED;
|
||||
return;
|
||||
}
|
||||
#if (B_STANCE_CHANGE_FAIL >= GEN_7)
|
||||
#if B_STANCE_CHANGE_FAIL >= GEN_7
|
||||
if (TryAegiFormChange())
|
||||
return;
|
||||
#endif
|
||||
@ -1601,13 +1601,13 @@ static bool32 AccuracyCalcHelper(u16 move)
|
||||
JumpIfMoveFailed(7, move);
|
||||
return TRUE;
|
||||
}
|
||||
else if (B_TOXIC_NEVER_MISS >= GEN_6
|
||||
&& gBattleMoves[move].effect == EFFECT_TOXIC
|
||||
&& IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_POISON))
|
||||
#if B_TOXIC_NEVER_MISS >= GEN_6
|
||||
else if (gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_POISON))
|
||||
{
|
||||
JumpIfMoveFailed(7, move);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
// If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits.
|
||||
else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF))
|
||||
{
|
||||
@ -1639,17 +1639,43 @@ static bool32 AccuracyCalcHelper(u16 move)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((WEATHER_HAS_EFFECT &&
|
||||
((IsBattlerWeatherAffected(gBattlerTarget, B_WEATHER_RAIN) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE))
|
||||
|| ((B_BLIZZARD_HAIL >= GEN_4 && (gBattleWeather & B_WEATHER_HAIL) && move == MOVE_BLIZZARD))))
|
||||
|| (gBattleMoves[move].effect == EFFECT_VITAL_THROW)
|
||||
|| (gBattleMoves[move].accuracy == 0)
|
||||
|| ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE)))
|
||||
if (WEATHER_HAS_EFFECT)
|
||||
{
|
||||
if ((IsBattlerWeatherAffected(gBattlerTarget, B_WEATHER_RAIN) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)))
|
||||
{
|
||||
// thunder/hurricane ignore acc checks in rain unless target is holding utility umbrella
|
||||
JumpIfMoveFailed(7, move);
|
||||
return TRUE;
|
||||
}
|
||||
#if B_BLIZZARD_HAIL >= GEN_4
|
||||
else if ((gBattleWeather & B_WEATHER_HAIL) && move == MOVE_BLIZZARD)
|
||||
{
|
||||
// thunder/hurricane ignore acc checks in rain unless target is holding utility umbrella
|
||||
JumpIfMoveFailed(7, move);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (gBattleMoves[move].effect == EFFECT_VITAL_THROW)
|
||||
{
|
||||
JumpIfMoveFailed(7, move);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if B_MINIMIZE_DMG_ACC >= GEN_6
|
||||
if ((gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))
|
||||
{
|
||||
JumpIfMoveFailed(7, move);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gBattleMoves[move].accuracy == 0)
|
||||
{
|
||||
JumpIfMoveFailed(7, move);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -2885,7 +2911,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
|
||||
if (sStatusFlagsForMoveEffects[gBattleScripting.moveEffect] == STATUS1_SLEEP)
|
||||
gBattleMons[gEffectBattler].status1 |= (B_SLEEP_TURNS >= GEN_5) ? ((Random() % 3) + 2) : ((Random() % 4) + 3);
|
||||
#if B_SLEEP_TURNS >= GEN_5
|
||||
gBattleMons[gEffectBattler].status1 |= ((Random() % 3) + 2);
|
||||
#else
|
||||
gBattleMons[gEffectBattler].status1 |= ((Random() % 4) + 3);
|
||||
#endif
|
||||
else
|
||||
gBattleMons[gEffectBattler].status1 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect];
|
||||
|
||||
@ -2987,7 +3017,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
{
|
||||
gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS;
|
||||
gLockedMoves[gEffectBattler] = gCurrentMove;
|
||||
gBattleMons[gEffectBattler].status2 |= STATUS2_UPROAR_TURN(B_UPROAR_TURNS >= GEN_5 ? 3 : ((Random() & 3) + 2));
|
||||
#if B_UPROAR_TURNS >= GEN_5
|
||||
gBattleMons[gEffectBattler].status2 |= STATUS2_UPROAR_TURN(3);
|
||||
#else
|
||||
gBattleMons[gEffectBattler].status2 |= STATUS2_UPROAR_TURN((Random() & 3) + 2);
|
||||
#endif
|
||||
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect];
|
||||
@ -3042,9 +3076,15 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
{
|
||||
gBattleMons[gEffectBattler].status2 |= STATUS2_WRAPPED;
|
||||
if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_GRIP_CLAW)
|
||||
gDisableStructs[gEffectBattler].wrapTurns = (B_BINDING_TURNS >= GEN_5) ? 7 : 5;
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
gDisableStructs[gEffectBattler].wrapTurns = 7;
|
||||
else
|
||||
gDisableStructs[gEffectBattler].wrapTurns = (B_BINDING_TURNS >= GEN_5) ? ((Random() % 2) + 4) : ((Random() % 4) + 2);
|
||||
gDisableStructs[gEffectBattler].wrapTurns = (Random() % 2) + 4;
|
||||
#else
|
||||
gDisableStructs[gEffectBattler].wrapTurns = 5;
|
||||
else
|
||||
gDisableStructs[gEffectBattler].wrapTurns = (Random() % 4) + 2;
|
||||
#endif
|
||||
|
||||
gBattleStruct->wrappedMove[gEffectBattler] = gCurrentMove;
|
||||
gBattleStruct->wrappedBy[gEffectBattler] = gBattlerAttacker;
|
||||
@ -3459,8 +3499,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
gBattlescriptCurrInstr++;
|
||||
break;
|
||||
case MOVE_EFFECT_INCINERATE:
|
||||
if ((B_INCINERATE_GEMS >= GEN_6 && GetBattlerHoldEffect(gEffectBattler, FALSE) == HOLD_EFFECT_GEMS)
|
||||
|| (gBattleMons[gEffectBattler].item >= FIRST_BERRY_INDEX && gBattleMons[gEffectBattler].item <= LAST_BERRY_INDEX))
|
||||
if ((gBattleMons[gEffectBattler].item >= FIRST_BERRY_INDEX && gBattleMons[gEffectBattler].item <= LAST_BERRY_INDEX)
|
||||
#if B_INCINERATE_GEMS >= GEN_6
|
||||
|| (GetBattlerHoldEffect(gEffectBattler, FALSE) == HOLD_EFFECT_GEMS)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
gLastUsedItem = gBattleMons[gEffectBattler].item;
|
||||
gBattleMons[gEffectBattler].item = 0;
|
||||
@ -4004,12 +4047,19 @@ static void Cmd_getexp(void)
|
||||
gBattleMoveDamage = 0;
|
||||
|
||||
// only give exp share bonus in later gens if the mon wasn't sent out
|
||||
if ((holdEffect == HOLD_EFFECT_EXP_SHARE) && ((gBattleMoveDamage == 0) || (B_SPLIT_EXP < GEN_6)))
|
||||
#if B_SPLIT_EXP < GEN_6
|
||||
if (holdEffect == HOLD_EFFECT_EXP_SHARE)
|
||||
gBattleMoveDamage += gExpShareExp;
|
||||
#else
|
||||
if (holdEffect == HOLD_EFFECT_EXP_SHARE && gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage += gExpShareExp;
|
||||
#endif
|
||||
if (holdEffect == HOLD_EFFECT_LUCKY_EGG)
|
||||
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && B_TRAINER_EXP_MULTIPLIER <= GEN_7)
|
||||
#if B_TRAINER_EXP_MULTIPLIER <= GEN_7
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
|
||||
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
|
||||
#endif
|
||||
#if (B_SCALED_EXP >= GEN_5) && (B_SCALED_EXP != GEN_6)
|
||||
{
|
||||
// Note: There is an edge case where if a pokemon receives a large amount of exp, it wouldn't be properly calculated
|
||||
@ -5035,7 +5085,11 @@ static void Cmd_moveend(void)
|
||||
i = gBattlerAttacker;
|
||||
gBattlerAttacker = gBattlerTarget;
|
||||
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
|
||||
gBattleScripting.moveEffect = (B_KINGS_SHIELD_LOWER_ATK >= GEN_8) ? MOVE_EFFECT_ATK_MINUS_1 : MOVE_EFFECT_ATK_MINUS_2;
|
||||
#if B_KINGS_SHIELD_LOWER_ATK >= GEN_8
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
#else
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_2;
|
||||
#endif
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_KingsShieldEffect;
|
||||
effect = 1;
|
||||
@ -5605,17 +5659,19 @@ static void Cmd_moveend(void)
|
||||
BattleScriptPushCursor();
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER || GetBattlerSide(i) == B_SIDE_PLAYER)
|
||||
{
|
||||
if (B_ABILITY_POP_UP)
|
||||
#if B_ABILITY_POP_UP == TRUE
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExit;
|
||||
else
|
||||
#else
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExitNoPopUp;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (B_ABILITY_POP_UP)
|
||||
#if B_ABILITY_POP_UP == TRUE
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExitWild;
|
||||
else
|
||||
#else
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExitWildNoPopUp;
|
||||
#endif
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -8361,11 +8417,11 @@ static void Cmd_various(void)
|
||||
&& !NoAliveMonsForEitherParty()
|
||||
&& CompareStat(gBattlerAttacker, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN))
|
||||
{
|
||||
if (B_FELL_STINGER_STAT_RAISE >= GEN_7)
|
||||
#if B_FELL_STINGER_STAT_RAISE >= GEN_7
|
||||
SET_STATCHANGER(STAT_ATK, 3, FALSE);
|
||||
else
|
||||
#else
|
||||
SET_STATCHANGER(STAT_ATK, 2, FALSE);
|
||||
|
||||
#endif
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK);
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 3);
|
||||
gBattlescriptCurrInstr = BattleScript_FellStingerRaisesStat;
|
||||
@ -9944,13 +10000,16 @@ static void Cmd_manipulatedamage(void)
|
||||
gBattleMoveDamage *= -1;
|
||||
break;
|
||||
case DMG_RECOIL_FROM_MISS:
|
||||
#if B_RECOIL_IF_MISS_DMG >= GEN_5
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
|
||||
#elif B_RECOIL_IF_MISS_DMG == GEN_4
|
||||
if ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage)
|
||||
gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2;
|
||||
#else
|
||||
gBattleMoveDamage /= 2;
|
||||
#endif
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if (B_RECOIL_IF_MISS_DMG >= GEN_5)
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
|
||||
if ((B_RECOIL_IF_MISS_DMG <= GEN_4) && ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage))
|
||||
gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2;
|
||||
break;
|
||||
case DMG_DOUBLED:
|
||||
gBattleMoveDamage *= 2;
|
||||
@ -10569,8 +10628,9 @@ static void Cmd_setmultihitcounter(void)
|
||||
{
|
||||
gMultiHitCounter = 5;
|
||||
}
|
||||
else if (B_MULTI_HIT_CHANCE >= GEN_5)
|
||||
else
|
||||
{
|
||||
#if B_MULTI_HIT_CHANCE >= GEN_5
|
||||
// 2 and 3 hits: 33.3%
|
||||
// 4 and 5 hits: 16.7%
|
||||
gMultiHitCounter = Random() % 4;
|
||||
@ -10584,9 +10644,7 @@ static void Cmd_setmultihitcounter(void)
|
||||
}
|
||||
else
|
||||
gMultiHitCounter += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
#else
|
||||
// 2 and 3 hits: 37.5%
|
||||
// 4 and 5 hits: 12.5%
|
||||
gMultiHitCounter = Random() % 4;
|
||||
@ -10594,6 +10652,7 @@ static void Cmd_setmultihitcounter(void)
|
||||
gMultiHitCounter = (Random() % 4) + 2;
|
||||
else
|
||||
gMultiHitCounter += 2;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -11354,10 +11413,11 @@ static void Cmd_dmgtolevel(void)
|
||||
static void Cmd_psywavedamageeffect(void)
|
||||
{
|
||||
s32 randDamage;
|
||||
if (B_PSYWAVE_DMG >= GEN_6)
|
||||
#if B_PSYWAVE_DMG >= GEN_6
|
||||
randDamage = (Random() % 101);
|
||||
else
|
||||
#else
|
||||
randDamage = (Random() % 11) * 10;
|
||||
#endif
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].level * (randDamage + 50) / 100;
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
@ -11428,12 +11488,13 @@ static void Cmd_disablelastusedattack(void)
|
||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].moves[i])
|
||||
|
||||
gDisableStructs[gBattlerTarget].disabledMove = gBattleMons[gBattlerTarget].moves[i];
|
||||
if (B_DISABLE_TURNS == GEN_3)
|
||||
#if B_DISABLE_TURNS == GEN_3
|
||||
gDisableStructs[gBattlerTarget].disableTimer = (Random() & 3) + 2;
|
||||
else if (B_DISABLE_TURNS == GEN_4)
|
||||
#elif B_DISABLE_TURNS == GEN_4
|
||||
gDisableStructs[gBattlerTarget].disableTimer = (Random() & 3) + 4;
|
||||
else
|
||||
#else
|
||||
gDisableStructs[gBattlerTarget].disableTimer = 4;
|
||||
#endif
|
||||
gDisableStructs[gBattlerTarget].disableTimerStartValue = gDisableStructs[gBattlerTarget].disableTimer; // used to save the random amount of turns?
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
@ -11711,7 +11772,11 @@ static void Cmd_settailwind(void)
|
||||
{
|
||||
gSideStatuses[side] |= SIDE_STATUS_TAILWIND;
|
||||
gSideTimers[side].tailwindBattlerId = gBattlerAttacker;
|
||||
gSideTimers[side].tailwindTimer = (B_TAILWIND_TURNS >= GEN_5) ? 4 : 3;
|
||||
#if B_TAILWIND_TURNS >= GEN_5
|
||||
gSideTimers[side].tailwindTimer = 4;
|
||||
#else
|
||||
gSideTimers[side].tailwindTimer = 3;
|
||||
#endif
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
else
|
||||
@ -12634,7 +12699,7 @@ static void Cmd_tryswapitems(void)
|
||||
| BATTLE_TYPE_FRONTIER
|
||||
| BATTLE_TYPE_SECRET_BASE
|
||||
| BATTLE_TYPE_RECORDED_LINK
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
| BATTLE_TYPE_TRAINER
|
||||
#endif
|
||||
))))
|
||||
@ -13180,45 +13245,40 @@ u16 GetSecretPowerMoveEffect(void)
|
||||
{
|
||||
switch (gBattleTerrain)
|
||||
{
|
||||
case BATTLE_TERRAIN_GRASS:
|
||||
#if B_SECRET_POWER_EFFECT >= GEN_4
|
||||
moveEffect = MOVE_EFFECT_SLEEP;
|
||||
#if B_SECRET_POWER_EFFECT >= GEN_6
|
||||
case BATTLE_TERRAIN_GRASS: moveEffect = MOVE_EFFECT_SLEEP; break;
|
||||
case BATTLE_TERRAIN_UNDERWATER: moveEffect = MOVE_EFFECT_ATK_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_POND: moveEffect = MOVE_EFFECT_ATK_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_MOUNTAIN: moveEffect = MOVE_EFFECT_ACC_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_PUDDLE: moveEffect = MOVE_EFFECT_SPD_MINUS_1; break;
|
||||
#elif B_SECRET_POWER_EFFECT >= GEN_5
|
||||
case BATTLE_TERRAIN_GRASS: moveEffect = MOVE_EFFECT_SLEEP; break;
|
||||
case BATTLE_TERRAIN_UNDERWATER: moveEffect = MOVE_EFFECT_DEF_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_POND: moveEffect = MOVE_EFFECT_ATK_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_MOUNTAIN: moveEffect = MOVE_EFFECT_ACC_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_PUDDLE: moveEffect = MOVE_EFFECT_SPD_MINUS_1; break;
|
||||
#elif B_SECRET_POWER_EFFECT >= GEN_4
|
||||
case BATTLE_TERRAIN_GRASS: moveEffect = MOVE_EFFECT_SLEEP; break;
|
||||
case BATTLE_TERRAIN_UNDERWATER: moveEffect = MOVE_EFFECT_DEF_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_POND: moveEffect = MOVE_EFFECT_ATK_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_MOUNTAIN: moveEffect = MOVE_EFFECT_FLINCH; break;
|
||||
case BATTLE_TERRAIN_PUDDLE: moveEffect = MOVE_EFFECT_ACC_MINUS_1; break;
|
||||
#else
|
||||
moveEffect = MOVE_EFFECT_POISON;
|
||||
case BATTLE_TERRAIN_GRASS: moveEffect = MOVE_EFFECT_POISON; break;
|
||||
case BATTLE_TERRAIN_UNDERWATER: moveEffect = MOVE_EFFECT_DEF_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_POND: moveEffect = MOVE_EFFECT_SPD_MINUS_1; break;
|
||||
case BATTLE_TERRAIN_MOUNTAIN: moveEffect = MOVE_EFFECT_CONFUSION; break;
|
||||
case BATTLE_TERRAIN_PUDDLE: moveEffect = MOVE_EFFECT_ACC_MINUS_1; break;
|
||||
#endif
|
||||
break;
|
||||
case BATTLE_TERRAIN_LONG_GRASS:
|
||||
moveEffect = MOVE_EFFECT_SLEEP;
|
||||
break;
|
||||
case BATTLE_TERRAIN_SAND:
|
||||
moveEffect = MOVE_EFFECT_ACC_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_UNDERWATER:
|
||||
#if B_SECRET_POWER_EFFECT >= GEN_6
|
||||
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
#else
|
||||
moveEffect = MOVE_EFFECT_DEF_MINUS_1;
|
||||
#endif
|
||||
break;
|
||||
case BATTLE_TERRAIN_WATER:
|
||||
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_POND:
|
||||
#if B_SECRET_POWER_EFFECT >= GEN_4
|
||||
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
#else
|
||||
moveEffect = MOVE_EFFECT_SPD_MINUS_1;
|
||||
#endif
|
||||
break;
|
||||
case BATTLE_TERRAIN_MOUNTAIN:
|
||||
#if B_SECRET_POWER_EFFECT >= GEN_5
|
||||
moveEffect = MOVE_EFFECT_ACC_MINUS_1;
|
||||
#elif B_SECRET_POWER_EFFECT == GEN_4
|
||||
moveEffect = MOVE_EFFECT_FLINCH;
|
||||
#else
|
||||
moveEffect = MOVE_EFFECT_CONFUSION;
|
||||
#endif
|
||||
break;
|
||||
case BATTLE_TERRAIN_CAVE:
|
||||
case BATTLE_TERRAIN_BURIAL_GROUND:
|
||||
case BATTLE_TERRAIN_SPACE:
|
||||
@ -13230,13 +13290,6 @@ u16 GetSecretPowerMoveEffect(void)
|
||||
case BATTLE_TERRAIN_SWAMP:
|
||||
moveEffect = MOVE_EFFECT_SPD_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_PUDDLE:
|
||||
#if B_SECRET_POWER_EFFECT >= GEN_5
|
||||
moveEffect = MOVE_EFFECT_SPD_MINUS_1;
|
||||
#else
|
||||
moveEffect = MOVE_EFFECT_ACC_MINUS_1;
|
||||
#endif
|
||||
break;
|
||||
case BATTLE_TERRAIN_SNOW:
|
||||
case BATTLE_TERRAIN_ICE:
|
||||
moveEffect = MOVE_EFFECT_FREEZE;
|
||||
@ -13439,12 +13492,14 @@ bool32 DoesSubstituteBlockMove(u8 battlerAtk, u8 battlerDef, u32 move)
|
||||
{
|
||||
if (!(gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE))
|
||||
return FALSE;
|
||||
else if (gBattleMoves[move].flags & FLAG_SOUND && B_SOUND_SUBSTITUTE >= GEN_6)
|
||||
#if B_SOUND_SUBSTITUTE >= GEN_6
|
||||
else if (gBattleMoves[move].flags & FLAG_SOUND)
|
||||
return FALSE;
|
||||
#endif
|
||||
else if (gBattleMoves[move].flags & FLAG_HIT_IN_SUBSTITUTE)
|
||||
return FALSE;
|
||||
else if (GetBattlerAbility(battlerAtk) == ABILITY_INFILTRATOR)
|
||||
return FALSE;
|
||||
else if (gBattleMoves[move].flags & FLAG_HIT_IN_SUBSTITUTE)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
@ -13680,13 +13735,12 @@ static void Cmd_handleballthrow(void)
|
||||
#endif
|
||||
break;
|
||||
case ITEM_DIVE_BALL:
|
||||
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER
|
||||
#if B_DIVE_BALL_MODIFIER >= GEN_4
|
||||
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER || gIsFishingEncounter || gIsSurfingEncounter)
|
||||
ballMultiplier = 35;
|
||||
#else
|
||||
if (GetCurrentMapType() == MAP_TYPE_UNDERWATER)
|
||||
ballMultiplier = 35;
|
||||
|| gIsFishingEncounter || gIsSurfingEncounter
|
||||
#endif
|
||||
)
|
||||
ballMultiplier = 35;
|
||||
break;
|
||||
case ITEM_NEST_BALL:
|
||||
#if B_NEST_BALL_MODIFIER >= GEN_6
|
||||
@ -14210,13 +14264,11 @@ static const u16 sTelekinesisBanList[] =
|
||||
{
|
||||
SPECIES_DIGLETT,
|
||||
SPECIES_DUGTRIO,
|
||||
// #ifdef NEW_POKEMON
|
||||
SPECIES_DIGLETT_ALOLAN,
|
||||
SPECIES_DUGTRIO_ALOLAN,
|
||||
SPECIES_SANDYGAST,
|
||||
SPECIES_PALOSSAND,
|
||||
SPECIES_GENGAR_MEGA,
|
||||
// #endif
|
||||
};
|
||||
|
||||
bool32 IsTelekinesisBannedSpecies(u16 species)
|
||||
|
@ -57,6 +57,7 @@ functions instead of at the top of the file with the other declarations.
|
||||
|
||||
static bool32 TryRemoveScreens(u8 battler);
|
||||
static bool32 IsUnnerveAbilityOnOpposingSide(u8 battlerId);
|
||||
static u8 GetFlingPowerFromItemId(u16 itemId);
|
||||
|
||||
extern const u8 *const gBattleScriptsForMoveEffects[];
|
||||
extern const u8 *const gBattlescriptsForRunningByItem[];
|
||||
@ -2770,8 +2771,11 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
&& gBattleMons[gActiveBattler].hp != 0)
|
||||
{
|
||||
MAGIC_GUARD_CHECK;
|
||||
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (B_BURN_DAMAGE >= GEN_7 ? 16 : 8);
|
||||
#if B_BURN_DAMAGE >= GEN_7
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 16;
|
||||
#else
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8;
|
||||
#endif
|
||||
if (ability == ABILITY_HEATPROOF)
|
||||
{
|
||||
if (gBattleMoveDamage > (gBattleMoveDamage / 2) + 1) // Record ability if the burn takes less damage than it normally would.
|
||||
@ -2832,9 +2836,15 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleStruct->wrappedMove[gActiveBattler]);
|
||||
gBattlescriptCurrInstr = BattleScript_WrapTurnDmg;
|
||||
if (GetBattlerHoldEffect(gBattleStruct->wrappedBy[gActiveBattler], TRUE) == HOLD_EFFECT_BINDING_BAND)
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / ((B_BINDING_DAMAGE >= GEN_6) ? 6 : 8);
|
||||
#if B_BINDING_DAMAGE >= GEN_6
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 6;
|
||||
else
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / ((B_BINDING_DAMAGE >= GEN_6) ? 8 : 16);
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8;
|
||||
#else
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8;
|
||||
else
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 16;
|
||||
#endif
|
||||
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
@ -3025,7 +3035,11 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMons[gActiveBattler].status1 |= (B_SLEEP_TURNS >= GEN_5) ? ((Random() % 3) + 2) : ((Random() % 4) + 3);
|
||||
#if B_SLEEP_TURNS >= GEN_5
|
||||
gBattleMons[gActiveBattler].status1 |= ((Random() % 3) + 2);
|
||||
#else
|
||||
gBattleMons[gActiveBattler].status1 |= ((Random() % 4) + 3);
|
||||
#endif
|
||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
BattleScriptExecute(BattleScript_YawnMakesAsleep);
|
||||
@ -3572,7 +3586,12 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
gBattleMons[gBattlerAttacker].status2 -= STATUS2_CONFUSION_TURN(1);
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
if (Random() % ((B_CONFUSION_SELF_DMG_CHANCE >= GEN_7) ? 3 : 2) == 0) // confusion dmg
|
||||
// confusion dmg
|
||||
#if B_CONFUSION_SELF_DMG_CHANCE >= GEN_7
|
||||
if (Random() % 3 == 0)
|
||||
#else
|
||||
if (Random() % 2 == 0)
|
||||
#endif
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = TRUE;
|
||||
gBattlerTarget = gBattlerAttacker;
|
||||
@ -3675,8 +3694,11 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
case CANCELLER_POWDER_MOVE:
|
||||
if ((gBattleMoves[gCurrentMove].flags & FLAG_POWDER) && (gBattlerAttacker != gBattlerTarget))
|
||||
{
|
||||
if ((B_POWDER_GRASS >= GEN_6 && IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS))
|
||||
|| GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT)
|
||||
#if B_POWDER_GRASS >= GEN_6
|
||||
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS) || GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT)
|
||||
#else
|
||||
if (GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT)
|
||||
#endif
|
||||
{
|
||||
gBattlerAbility = gBattlerTarget;
|
||||
effect = 1;
|
||||
@ -4003,19 +4025,20 @@ bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility)
|
||||
{
|
||||
u16 battlerAbility = GetBattlerAbility(battler);
|
||||
|
||||
if (viaAbility && B_ABILITY_WEATHER <= GEN_5
|
||||
&& !(gBattleWeather & sWeatherFlagsInfo[weatherEnumId][1]))
|
||||
{
|
||||
gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1]);
|
||||
return TRUE;
|
||||
}
|
||||
else if (gBattleWeather & B_WEATHER_PRIMAL_ANY
|
||||
if (gBattleWeather & B_WEATHER_PRIMAL_ANY
|
||||
&& battlerAbility != ABILITY_DESOLATE_LAND
|
||||
&& battlerAbility != ABILITY_PRIMORDIAL_SEA
|
||||
&& battlerAbility != ABILITY_DELTA_STREAM)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#if B_ABILITY_WEATHER <= GEN_5
|
||||
else if (viaAbility && !(gBattleWeather & sWeatherFlagsInfo[weatherEnumId][1]))
|
||||
{
|
||||
gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1]);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
else if (!(gBattleWeather & (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1])))
|
||||
{
|
||||
gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0]);
|
||||
@ -4745,7 +4768,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
if (gDisableStructs[battler].isFirstTurn != 2)
|
||||
{
|
||||
u32 validToRaise = 0, validToLower = 0;
|
||||
u32 statsNum = (B_MOODY_ACC_EVASION != GEN_8) ? NUM_BATTLE_STATS : NUM_STATS;
|
||||
#if B_MOODY_ACC_EVASION < GEN_8
|
||||
u32 statsNum = NUM_BATTLE_STATS;
|
||||
#else
|
||||
u32 statsNum = NUM_STATS;
|
||||
#endif
|
||||
|
||||
for (i = STAT_ATK; i < statsNum; i++)
|
||||
{
|
||||
@ -4932,7 +4959,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
effect = 2, statId = STAT_ATK;
|
||||
break;
|
||||
case ABILITY_FLASH_FIRE:
|
||||
if (moveType == TYPE_FIRE && !((gBattleMons[battler].status1 & STATUS1_FREEZE) && B_FLASH_FIRE_FROZEN <= GEN_4))
|
||||
if (moveType == TYPE_FIRE
|
||||
#if B_FLASH_FIRE_FROZEN <= GEN_4
|
||||
&& !(gBattleMons[battler].status1 & STATUS1_FREEZE)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE))
|
||||
{
|
||||
@ -5980,7 +6011,11 @@ bool32 CanBattlerEscape(u32 battlerId) // no ability check
|
||||
{
|
||||
if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_SHED_SHELL)
|
||||
return TRUE;
|
||||
else if ((B_GHOSTS_ESCAPE >= GEN_6 && !IS_BATTLER_OF_TYPE(battlerId, TYPE_GHOST)) && gBattleMons[battlerId].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|
||||
#if B_GHOSTS_ESCAPE >= GEN_6
|
||||
else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_GHOST))
|
||||
return TRUE;
|
||||
#endif
|
||||
else if (gBattleMons[battlerId].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|
||||
return FALSE;
|
||||
else if (gStatuses3[battlerId] & STATUS3_ROOTED)
|
||||
return FALSE;
|
||||
@ -6078,8 +6113,11 @@ bool32 CanBeBurned(u8 battlerId)
|
||||
bool32 CanBeParalyzed(u8 battlerId)
|
||||
{
|
||||
u16 ability = GetBattlerAbility(battlerId);
|
||||
if ((B_PARALYZE_ELECTRIC >= GEN_6 && IS_BATTLER_OF_TYPE(battlerId, TYPE_ELECTRIC))
|
||||
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|
||||
if (
|
||||
#if B_PARALYZE_ELECTRIC >= GEN_6
|
||||
IS_BATTLER_OF_TYPE(battlerId, TYPE_ELECTRIC) ||
|
||||
#endif
|
||||
gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|
||||
|| ability == ABILITY_LIMBER
|
||||
|| ability == ABILITY_COMATOSE
|
||||
|| gBattleMons[battlerId].status1 & STATUS1_ANY
|
||||
@ -6146,11 +6184,11 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId)
|
||||
|
||||
static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2)
|
||||
{
|
||||
if (HasEnoughHpToEatBerry(battlerId, CONFUSE_BERRY_HP_FRACTION, itemId)
|
||||
#if B_HEAL_BLOCKING >= GEN_5
|
||||
if (HasEnoughHpToEatBerry(battlerId, CONFUSE_BERRY_HP_FRACTION, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK))
|
||||
#else
|
||||
if (HasEnoughHpToEatBerry(battlerId, CONFUSE_BERRY_HP_FRACTION, itemId))
|
||||
&& !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, flavorId);
|
||||
|
||||
@ -6338,12 +6376,11 @@ u8 TryHandleSeed(u8 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 exec
|
||||
|
||||
static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal)
|
||||
{
|
||||
if (!(gBattleScripting.overrideBerryRequirements && gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)
|
||||
#if B_HEAL_BLOCKING >= GEN_5
|
||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)
|
||||
#else
|
||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId)
|
||||
&& !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)
|
||||
#endif
|
||||
&& !(gBattleScripting.overrideBerryRequirements && gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP))
|
||||
&& HasEnoughHpToEatBerry(battlerId, 2, itemId))
|
||||
{
|
||||
if (percentHeal)
|
||||
gBattleMoveDamage = (gBattleMons[battlerId].maxHP * GetBattlerHoldEffectParam(battlerId) / 100) * -1;
|
||||
@ -6478,48 +6515,39 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
BattleScriptExecute(BattleScript_WhiteHerbEnd2);
|
||||
}
|
||||
break;
|
||||
#if B_BERRIES_INSTANT >= GEN_4
|
||||
case HOLD_EFFECT_CONFUSE_SPICY:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_SPICY, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_DRY:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_DRY, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_SWEET:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_SWEET, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_BITTER:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_BITTER, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_SOUR:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_SOUR, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_ATTACK_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_ATK, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_DEFENSE_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_DEF, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_SPEED_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPEED, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_SP_ATTACK_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPATK, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_SP_DEFENSE_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPDEF, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_CRITICAL_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4 && !(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY) && HasEnoughHpToEatBerry(battlerId, GetBattlerHoldEffectParam(battlerId), gLastUsedItem))
|
||||
if (!(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY) && HasEnoughHpToEatBerry(battlerId, GetBattlerHoldEffectParam(battlerId), gLastUsedItem))
|
||||
{
|
||||
gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY;
|
||||
BattleScriptExecute(BattleScript_BerryFocusEnergyEnd2);
|
||||
@ -6527,11 +6555,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_RANDOM_STAT_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = RandomStatRaiseBerry(battlerId, gLastUsedItem, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_PAR:
|
||||
if (B_BERRIES_INSTANT >= GEN_4 && gBattleMons[battlerId].status1 & STATUS1_PARALYSIS && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
{
|
||||
gBattleMons[battlerId].status1 &= ~STATUS1_PARALYSIS;
|
||||
BattleScriptExecute(BattleScript_BerryCurePrlzEnd2);
|
||||
@ -6539,7 +6566,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_PSN:
|
||||
if (B_BERRIES_INSTANT >= GEN_4 && gBattleMons[battlerId].status1 & STATUS1_PSN_ANY && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
{
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER);
|
||||
BattleScriptExecute(BattleScript_BerryCurePsnEnd2);
|
||||
@ -6547,7 +6574,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_BRN:
|
||||
if (B_BERRIES_INSTANT >= GEN_4 && gBattleMons[battlerId].status1 & STATUS1_BURN && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_BURN && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
{
|
||||
gBattleMons[battlerId].status1 &= ~STATUS1_BURN;
|
||||
BattleScriptExecute(BattleScript_BerryCureBrnEnd2);
|
||||
@ -6555,7 +6582,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_FRZ:
|
||||
if (B_BERRIES_INSTANT >= GEN_4 && gBattleMons[battlerId].status1 & STATUS1_FREEZE && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_FREEZE && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
{
|
||||
gBattleMons[battlerId].status1 &= ~STATUS1_FREEZE;
|
||||
BattleScriptExecute(BattleScript_BerryCureFrzEnd2);
|
||||
@ -6563,7 +6590,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_SLP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4 && gBattleMons[battlerId].status1 & STATUS1_SLEEP && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
{
|
||||
gBattleMons[battlerId].status1 &= ~STATUS1_SLEEP;
|
||||
gBattleMons[battlerId].status2 &= ~STATUS2_NIGHTMARE;
|
||||
@ -6572,7 +6599,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CURE_STATUS:
|
||||
if (B_BERRIES_INSTANT >= GEN_4 && (gBattleMons[battlerId].status1 & STATUS1_ANY || gBattleMons[battlerId].status2 & STATUS2_CONFUSION) && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
if ((gBattleMons[battlerId].status1 & STATUS1_ANY || gBattleMons[battlerId].status2 & STATUS2_CONFUSION) && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
{
|
||||
i = 0;
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PSN_ANY)
|
||||
@ -6617,13 +6644,12 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_RESTORE_HP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = ItemHealHp(battlerId, gLastUsedItem, TRUE, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_RESTORE_PCT_HP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = ItemHealHp(battlerId, gLastUsedItem, TRUE, TRUE);
|
||||
break;
|
||||
#endif
|
||||
case HOLD_EFFECT_AIR_BALLOON:
|
||||
effect = ITEM_EFFECT_OTHER;
|
||||
gBattleScripting.battler = battlerId;
|
||||
@ -6984,62 +7010,52 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
DO_ITEMEFFECT_MOVE_END:
|
||||
switch (battlerHoldEffect)
|
||||
{
|
||||
#if B_HP_BERRIES >= GEN_4
|
||||
case HOLD_EFFECT_MICLE_BERRY:
|
||||
if (B_HP_BERRIES >= GEN_4)
|
||||
effect = TrySetMicleBerry(battlerId, gLastUsedItem, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_RESTORE_HP:
|
||||
if (B_HP_BERRIES >= GEN_4)
|
||||
effect = ItemHealHp(battlerId, gLastUsedItem, FALSE, FALSE);
|
||||
break;
|
||||
#endif
|
||||
#if B_BERRIES_INSTANT >= GEN_4
|
||||
case HOLD_EFFECT_RESTORE_PCT_HP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = ItemHealHp(battlerId, gLastUsedItem, FALSE, TRUE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_SPICY:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_SPICY, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_DRY:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_DRY, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_SWEET:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_SWEET, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_BITTER:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_BITTER, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_CONFUSE_SOUR:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = HealConfuseBerry(battlerId, gLastUsedItem, FLAVOR_SOUR, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_ATTACK_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_ATK, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_DEFENSE_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_DEF, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_SPEED_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPEED, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_SP_ATTACK_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPATK, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_SP_DEFENSE_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPDEF, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_RANDOM_STAT_UP:
|
||||
if (B_BERRIES_INSTANT >= GEN_4)
|
||||
effect = RandomStatRaiseBerry(battlerId, gLastUsedItem, FALSE);
|
||||
break;
|
||||
#endif
|
||||
case HOLD_EFFECT_CURE_PAR:
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS && !UnnerveOn(battlerId, gLastUsedItem))
|
||||
{
|
||||
@ -7722,9 +7738,12 @@ u32 GetBattlerHoldEffect(u8 battlerId, bool32 checkNegating)
|
||||
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
|
||||
if (B_ENABLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId] != 0 && gBattleMons[battlerId].item)
|
||||
#if B_ENABLE_DEBUG == TRUE
|
||||
if (gBattleStruct->debugHoldEffects[battlerId] != 0 && gBattleMons[battlerId].item)
|
||||
return gBattleStruct->debugHoldEffects[battlerId];
|
||||
else if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
|
||||
else
|
||||
#endif
|
||||
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
|
||||
return gEnigmaBerries[battlerId].holdEffect;
|
||||
else
|
||||
return ItemId_GetHoldEffect(gBattleMons[battlerId].item);
|
||||
@ -8058,7 +8077,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||
// todo
|
||||
break;
|
||||
case EFFECT_FLING:
|
||||
basePower = ItemId_GetFlingPower(gBattleMons[battlerAtk].item);
|
||||
basePower = GetFlingPowerFromItemId(gBattleMons[battlerAtk].item);
|
||||
break;
|
||||
case EFFECT_ERUPTION:
|
||||
basePower = gBattleMons[battlerAtk].hp * basePower / gBattleMons[battlerAtk].maxHP;
|
||||
@ -8202,7 +8221,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||
break;
|
||||
case EFFECT_PAYBACK:
|
||||
if (GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)
|
||||
&& (gDisableStructs[battlerDef].isFirstTurn != 2 || B_PAYBACK_SWITCH_BOOST < GEN_5))
|
||||
#if B_PAYBACK_SWITCH_BOOST >= GEN_5
|
||||
&& (gDisableStructs[battlerDef].isFirstTurn != 2)
|
||||
#endif
|
||||
)
|
||||
basePower *= 2;
|
||||
break;
|
||||
case EFFECT_BOLT_BEAK:
|
||||
@ -8575,6 +8597,12 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
|
||||
break;
|
||||
}
|
||||
|
||||
#if B_TERRAIN_TYPE_BOOST >= GEN_8
|
||||
#define TERRAIN_TYPE_BOOST UQ_4_12(1.3)
|
||||
#else
|
||||
#define TERRAIN_TYPE_BOOST UQ_4_12(1.5)
|
||||
#endif
|
||||
|
||||
// various effecs
|
||||
if (gProtectStructs[battlerAtk].helpingHand)
|
||||
MulModifier(&modifier, UQ_4_12(1.5));
|
||||
@ -8583,24 +8611,28 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
|
||||
if (gStatuses3[battlerAtk] & STATUS3_ME_FIRST)
|
||||
MulModifier(&modifier, UQ_4_12(1.5));
|
||||
if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && moveType == TYPE_GRASS && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE))
|
||||
MulModifier(&modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8) ? UQ_4_12(1.3) : UQ_4_12(1.5));
|
||||
MulModifier(&modifier, TERRAIN_TYPE_BOOST);
|
||||
if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN && moveType == TYPE_DRAGON && IsBattlerGrounded(battlerDef) && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE))
|
||||
MulModifier(&modifier, UQ_4_12(0.5));
|
||||
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && moveType == TYPE_ELECTRIC && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE))
|
||||
MulModifier(&modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8) ? UQ_4_12(1.3) : UQ_4_12(1.5));
|
||||
MulModifier(&modifier, TERRAIN_TYPE_BOOST);
|
||||
if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN && moveType == TYPE_PSYCHIC && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE))
|
||||
MulModifier(&modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8) ? UQ_4_12(1.3) : UQ_4_12(1.5));
|
||||
MulModifier(&modifier, TERRAIN_TYPE_BOOST);
|
||||
#if B_SPORT_TURNS >= GEN_6
|
||||
if ((gFieldStatuses & STATUS_FIELD_MUDSPORT && moveType == TYPE_ELECTRIC)
|
||||
|| (gFieldStatuses & STATUS_FIELD_WATERSPORT && moveType == TYPE_FIRE))
|
||||
MulModifier(&modifier, (B_SPORT_DMG_REDUCTION >= GEN_5) ? UQ_4_12(0.23) : UQ_4_12(0.5));
|
||||
if ((moveType == TYPE_ELECTRIC && gFieldStatuses & STATUS_FIELD_MUDSPORT)
|
||||
|| (moveType == TYPE_FIRE && gFieldStatuses & STATUS_FIELD_WATERSPORT))
|
||||
#else
|
||||
if ((moveType == TYPE_ELECTRIC && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, ABILITYEFFECT_MUD_SPORT, 0))
|
||||
|| (moveType == TYPE_FIRE && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, ABILITYEFFECT_WATER_SPORT, 0)))
|
||||
MulModifier(&modifier, (B_SPORT_DMG_REDUCTION >= GEN_5) ? UQ_4_12(0.23) : UQ_4_12(0.5));
|
||||
#endif
|
||||
#if B_SPORT_DMG_REDUCTION >= GEN_5
|
||||
MulModifier(&modifier, UQ_4_12(0.23));
|
||||
#else
|
||||
MulModifier(&modifier, UQ_4_12(0.5));
|
||||
#endif
|
||||
return ApplyModifier(modifier, basePower);
|
||||
}
|
||||
#undef TERRAIN_TYPE_BOOST
|
||||
|
||||
static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, bool32 isCrit, bool32 updateFlags)
|
||||
{
|
||||
@ -8976,11 +9008,17 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
|
||||
|
||||
// check crit
|
||||
if (isCrit)
|
||||
dmg = ApplyModifier((B_CRIT_MULTIPLIER >= GEN_6 ? UQ_4_12(1.5) : UQ_4_12(2.0)), dmg);
|
||||
#if B_CRIT_MULTIPLIER >= GEN_6
|
||||
dmg = ApplyModifier(UQ_4_12(1.5), dmg);
|
||||
#else
|
||||
dmg = ApplyModifier(UQ_4_12(2.0), dmg);
|
||||
#endif
|
||||
|
||||
// check burn
|
||||
if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_PHYSICAL(move)
|
||||
&& (gBattleMoves[move].effect != EFFECT_FACADE || B_BURN_FACADE_DMG < GEN_6)
|
||||
#if B_BURN_FACADE_DMG >= GEN_6
|
||||
&& gBattleMoves[move].effect != EFFECT_FACADE
|
||||
#endif
|
||||
&& abilityAtk != ABILITY_GUTS)
|
||||
dmg = ApplyModifier(UQ_4_12(0.5), dmg);
|
||||
|
||||
@ -9254,14 +9292,18 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
|
||||
RecordAbilityBattle(battlerDef, ABILITY_LEVITATE);
|
||||
}
|
||||
}
|
||||
else if (B_SHEER_COLD_IMMUNITY >= GEN_7 && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
|
||||
#if B_SHEER_COLD_IMMUNITY >= GEN_7
|
||||
else if (move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
|
||||
{
|
||||
modifier = UQ_4_12(0.0);
|
||||
}
|
||||
else if (B_GLARE_GHOST >= GEN_4 && move == MOVE_GLARE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST))
|
||||
#endif
|
||||
#if B_GLARE_GHOST >= GEN_4
|
||||
else if (move == MOVE_GLARE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST))
|
||||
{
|
||||
modifier = UQ_4_12(1.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Thousand Arrows ignores type modifiers for flying mons
|
||||
if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)
|
||||
@ -9327,9 +9369,10 @@ u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilit
|
||||
|
||||
u16 GetTypeModifier(u8 atkType, u8 defType)
|
||||
{
|
||||
if (B_FLAG_INVERSE_BATTLE != 0 && FlagGet(B_FLAG_INVERSE_BATTLE))
|
||||
#if B_FLAG_INVERSE_BATTLE != 0
|
||||
if (FlagGet(B_FLAG_INVERSE_BATTLE))
|
||||
return sInverseTypeEffectivenessTable[atkType][defType];
|
||||
else
|
||||
#endif
|
||||
return sTypeEffectivenessTable[atkType][defType];
|
||||
}
|
||||
|
||||
@ -9476,9 +9519,12 @@ bool32 CanMegaEvolve(u8 battlerId)
|
||||
// Check if there is an entry in the evolution table for regular Mega Evolution.
|
||||
if (GetMegaEvolutionSpecies(species, itemId) != SPECIES_NONE)
|
||||
{
|
||||
#if B_ENABLE_DEBUG == TRUE
|
||||
if (B_ENABLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId])
|
||||
holdEffect = gBattleStruct->debugHoldEffects[battlerId];
|
||||
else if (itemId == ITEM_ENIGMA_BERRY_E_READER)
|
||||
else
|
||||
#endif
|
||||
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
|
||||
holdEffect = gEnigmaBerries[battlerId].holdEffect;
|
||||
else
|
||||
holdEffect = ItemId_GetHoldEffect(itemId);
|
||||
@ -9679,9 +9725,8 @@ bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId)
|
||||
|
||||
bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId)
|
||||
{
|
||||
if (B_BADGE_BOOST != GEN_3)
|
||||
return FALSE;
|
||||
else if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_FRONTIER))
|
||||
#if B_BADGE_BOOST != GEN_3
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_FRONTIER))
|
||||
return FALSE;
|
||||
else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
|
||||
return FALSE;
|
||||
@ -9689,7 +9734,7 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId)
|
||||
return FALSE;
|
||||
else if (FlagGet(badgeFlag))
|
||||
return TRUE;
|
||||
else
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -9699,12 +9744,17 @@ u8 GetBattleMoveSplit(u32 moveId)
|
||||
return gBattleStruct->zmove.activeSplit;
|
||||
if (gBattleStruct != NULL && gBattleStruct->swapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky
|
||||
return SPLIT_PHYSICAL;
|
||||
else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4)
|
||||
|
||||
#if B_PHYSICAL_SPECIAL_SPLIT >= GEN_4
|
||||
return gBattleMoves[moveId].split;
|
||||
#else
|
||||
if (IS_MOVE_STATUS(moveId))
|
||||
return SPLIT_STATUS;
|
||||
else if (gBattleMoves[moveId].type < TYPE_MYSTERY)
|
||||
return SPLIT_PHYSICAL;
|
||||
else
|
||||
return SPLIT_SPECIAL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool32 TryRemoveScreens(u8 battler)
|
||||
@ -9781,6 +9831,19 @@ struct Pokemon *GetBattlerPartyData(u8 battlerId)
|
||||
return mon;
|
||||
}
|
||||
|
||||
static u8 GetFlingPowerFromItemId(u16 itemId)
|
||||
{
|
||||
if (itemId >= ITEM_TM01 && itemId <= ITEM_HM08)
|
||||
{
|
||||
u8 power = gBattleMoves[ItemIdToBattleMoveId(itemId)].power;
|
||||
if (power > 1)
|
||||
return power;
|
||||
return 10; // Status moves and moves with variable power always return 10 power.
|
||||
}
|
||||
else
|
||||
return ItemId_GetFlingPower(itemId);
|
||||
}
|
||||
|
||||
// Make sure the input bank is any bank on the specific mon's side
|
||||
bool32 CanFling(u8 battlerId)
|
||||
{
|
||||
@ -9793,7 +9856,7 @@ bool32 CanFling(u8 battlerId)
|
||||
#endif
|
||||
|| gFieldStatuses & STATUS_FIELD_MAGIC_ROOM
|
||||
|| gDisableStructs[battlerId].embargoTimer != 0
|
||||
|| ItemId_GetFlingPower(item) != 0
|
||||
|| GetFlingPowerFromItemId(item) != 0
|
||||
|| !CanBattlerGetOrLoseItem(battlerId, item))
|
||||
return FALSE;
|
||||
|
||||
@ -9949,7 +10012,7 @@ bool32 CanStealItem(u8 battlerStealing, u8 battlerItem, u16 item)
|
||||
| BATTLE_TYPE_LINK
|
||||
| BATTLE_TYPE_RECORDED_LINK
|
||||
| BATTLE_TYPE_SECRET_BASE
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
| BATTLE_TYPE_TRAINER
|
||||
#endif
|
||||
)))
|
||||
|
@ -58,7 +58,6 @@ static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove);
|
||||
// Const Data
|
||||
static const struct SignatureZMove sSignatureZMoves[] =
|
||||
{
|
||||
// #ifdef NEW_POKEMON
|
||||
{SPECIES_PIKACHU_COSPLAY, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_ROCK_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_BELLE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
@ -95,7 +94,6 @@ static const struct SignatureZMove sSignatureZMoves[] =
|
||||
{SPECIES_TAPU_LELE, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_TAPU_FINI, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z, MOVE_PHOTON_GEYSER, MOVE_LIGHT_THAT_BURNS_THE_SKY},
|
||||
// #endif
|
||||
{SPECIES_MEW, ITEM_MEWNIUM_Z, MOVE_PSYCHIC, MOVE_GENESIS_SUPERNOVA},
|
||||
{SPECIES_PIKACHU, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_EEVEE, ITEM_EEVIUM_Z, MOVE_LAST_RESORT, MOVE_EXTREME_EVOBOOST},
|
||||
@ -190,9 +188,12 @@ bool32 IsViableZMove(u8 battlerId, u16 move)
|
||||
return FALSE; // Partner has mega evolved or is about to mega evolve
|
||||
}
|
||||
|
||||
if (B_ENABLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId])
|
||||
#if B_ENABLE_DEBUG == TRUE
|
||||
if (gBattleStruct->debugHoldEffects[battlerId])
|
||||
holdEffect = gBattleStruct->debugHoldEffects[battlerId];
|
||||
else if (item == ITEM_ENIGMA_BERRY)
|
||||
else
|
||||
#endif
|
||||
if (item == ITEM_ENIGMA_BERRY)
|
||||
return FALSE; // HoldEffect = gEnigmaBerries[battlerId].holdEffect;
|
||||
else
|
||||
holdEffect = ItemId_GetHoldEffect(item);
|
||||
|
128
src/data/items.h
128
src/data/items.h
@ -7794,7 +7794,7 @@ const struct Item gItems[] =
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
// TMs/HMs
|
||||
// TMs/HMs. They don't have a set flingPower, as that's handled by GetFlingPowerFromItemId.
|
||||
|
||||
[ITEM_TM01_FOCUS_PUNCH] =
|
||||
{
|
||||
@ -7805,7 +7805,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 150,
|
||||
},
|
||||
|
||||
[ITEM_TM02_DRAGON_CLAW] =
|
||||
@ -7817,7 +7816,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 80,
|
||||
},
|
||||
|
||||
[ITEM_TM03_WATER_PULSE] =
|
||||
@ -7829,7 +7827,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 60,
|
||||
},
|
||||
|
||||
[ITEM_TM04_CALM_MIND] =
|
||||
@ -7841,7 +7838,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM05_ROAR] =
|
||||
@ -7853,7 +7849,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM06_TOXIC] =
|
||||
@ -7865,7 +7860,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM07_HAIL] =
|
||||
@ -7877,7 +7871,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM08_BULK_UP] =
|
||||
@ -7889,7 +7882,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM09_BULLET_SEED] =
|
||||
@ -7901,11 +7893,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_5
|
||||
.flingPower = 25,
|
||||
#else
|
||||
.flingPower = 10,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM10_HIDDEN_POWER] =
|
||||
@ -7917,11 +7904,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 60,
|
||||
#else
|
||||
.flingPower = 10,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM11_SUNNY_DAY] =
|
||||
@ -7933,7 +7915,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM12_TAUNT] =
|
||||
@ -7945,7 +7926,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM13_ICE_BEAM] =
|
||||
@ -7957,11 +7937,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 90,
|
||||
#else
|
||||
.flingPower = 95,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM14_BLIZZARD] =
|
||||
@ -7973,11 +7948,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 110,
|
||||
#else
|
||||
.flingPower = 120,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM15_HYPER_BEAM] =
|
||||
@ -7989,7 +7959,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 150,
|
||||
},
|
||||
|
||||
[ITEM_TM16_LIGHT_SCREEN] =
|
||||
@ -8001,7 +7970,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM17_PROTECT] =
|
||||
@ -8013,7 +7981,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM18_RAIN_DANCE] =
|
||||
@ -8025,7 +7992,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM19_GIGA_DRAIN] =
|
||||
@ -8037,11 +8003,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_5
|
||||
.flingPower = 75,
|
||||
#else
|
||||
.flingPower = 60,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM20_SAFEGUARD] =
|
||||
@ -8053,7 +8014,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM21_FRUSTRATION] =
|
||||
@ -8065,7 +8025,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM22_SOLAR_BEAM] =
|
||||
@ -8077,7 +8036,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 120,
|
||||
},
|
||||
|
||||
[ITEM_TM23_IRON_TAIL] =
|
||||
@ -8089,7 +8047,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 100,
|
||||
},
|
||||
|
||||
[ITEM_TM24_THUNDERBOLT] =
|
||||
@ -8101,11 +8058,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 90,
|
||||
#else
|
||||
.flingPower = 95,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM25_THUNDER] =
|
||||
@ -8117,11 +8069,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 110,
|
||||
#else
|
||||
.flingPower = 120,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM26_EARTHQUAKE] =
|
||||
@ -8133,7 +8080,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 100,
|
||||
},
|
||||
|
||||
[ITEM_TM27_RETURN] =
|
||||
@ -8145,7 +8091,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM28_DIG] =
|
||||
@ -8157,11 +8102,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_4
|
||||
.flingPower = 80,
|
||||
#else
|
||||
.flingPower = 60,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM29_PSYCHIC] =
|
||||
@ -8173,7 +8113,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 90,
|
||||
},
|
||||
|
||||
[ITEM_TM30_SHADOW_BALL] =
|
||||
@ -8185,7 +8124,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 80,
|
||||
},
|
||||
|
||||
[ITEM_TM31_BRICK_BREAK] =
|
||||
@ -8197,7 +8135,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 75,
|
||||
},
|
||||
|
||||
[ITEM_TM32_DOUBLE_TEAM] =
|
||||
@ -8209,7 +8146,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM33_REFLECT] =
|
||||
@ -8221,7 +8157,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM34_SHOCK_WAVE] =
|
||||
@ -8233,7 +8168,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 60,
|
||||
},
|
||||
|
||||
[ITEM_TM35_FLAMETHROWER] =
|
||||
@ -8245,11 +8179,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 90,
|
||||
#else
|
||||
.flingPower = 95,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM36_SLUDGE_BOMB] =
|
||||
@ -8261,7 +8190,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 90,
|
||||
},
|
||||
|
||||
[ITEM_TM37_SANDSTORM] =
|
||||
@ -8273,7 +8201,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM38_FIRE_BLAST] =
|
||||
@ -8285,11 +8212,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 110,
|
||||
#else
|
||||
.flingPower = 120,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM39_ROCK_TOMB] =
|
||||
@ -8301,11 +8223,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 60,
|
||||
#else
|
||||
.flingPower = 50,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM40_AERIAL_ACE] =
|
||||
@ -8317,7 +8234,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 60,
|
||||
},
|
||||
|
||||
[ITEM_TM41_TORMENT] =
|
||||
@ -8329,7 +8245,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM42_FACADE] =
|
||||
@ -8341,7 +8256,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM43_SECRET_POWER] =
|
||||
@ -8353,7 +8267,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 70,
|
||||
},
|
||||
|
||||
[ITEM_TM44_REST] =
|
||||
@ -8365,7 +8278,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM45_ATTRACT] =
|
||||
@ -8377,7 +8289,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM46_THIEF] =
|
||||
@ -8389,11 +8300,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 60,
|
||||
#else
|
||||
.flingPower = 40,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM47_STEEL_WING] =
|
||||
@ -8405,7 +8311,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 70,
|
||||
},
|
||||
|
||||
[ITEM_TM48_SKILL_SWAP] =
|
||||
@ -8417,7 +8322,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM49_SNATCH] =
|
||||
@ -8429,7 +8333,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_TM50_OVERHEAT] =
|
||||
@ -8441,11 +8344,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 130,
|
||||
#else
|
||||
.flingPower = 140,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_TM51] =
|
||||
@ -9008,7 +8906,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 50,
|
||||
},
|
||||
|
||||
[ITEM_HM02_FLY] =
|
||||
@ -9021,11 +8918,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_4
|
||||
.flingPower = 90,
|
||||
#else
|
||||
.flingPower = 70,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_HM03_SURF] =
|
||||
@ -9038,11 +8930,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
.flingPower = 90,
|
||||
#else
|
||||
.flingPower = 95,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_HM04_STRENGTH] =
|
||||
@ -9055,7 +8942,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 80,
|
||||
},
|
||||
|
||||
[ITEM_HM05_FLASH] =
|
||||
@ -9068,7 +8954,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_HM06_ROCK_SMASH] =
|
||||
@ -9081,11 +8966,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_4
|
||||
.flingPower = 20,
|
||||
#else
|
||||
.flingPower = 40,
|
||||
#endif
|
||||
},
|
||||
|
||||
[ITEM_HM07_WATERFALL] =
|
||||
@ -9098,7 +8978,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
.flingPower = 80,
|
||||
},
|
||||
|
||||
[ITEM_HM08_DIVE] =
|
||||
@ -9111,11 +8990,6 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_TM_HM,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
|
||||
#if B_UPDATED_MOVE_DATA >= GEN_4
|
||||
.flingPower = 80,
|
||||
#else
|
||||
.flingPower = 60,
|
||||
#endif
|
||||
},
|
||||
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
#define BINDING_TURNS "4 or 5"
|
||||
#else
|
||||
#define BINDING_TURNS "2 to 5"
|
||||
#endif
|
||||
|
||||
static const u8 sNullDescription[] = _(
|
||||
"");
|
||||
|
||||
@ -79,11 +86,7 @@ static const u8 sFlyDescription[] = _(
|
||||
|
||||
static const u8 sBindDescription[] = _(
|
||||
"Binds and squeezes the foe\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"for 4 or 5 turns.");
|
||||
#else
|
||||
"for 2 to 5 turns.");
|
||||
#endif
|
||||
"for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sSlamDescription[] = _(
|
||||
"Slams the foe with a long\n"
|
||||
@ -143,11 +146,7 @@ static const u8 sBodySlamDescription[] = _(
|
||||
|
||||
static const u8 sWrapDescription[] = _(
|
||||
"Wraps and squeezes the foe\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"4 or 5 times with vines, etc.");
|
||||
#else
|
||||
"2 to 5 times with vines, etc.");
|
||||
#endif
|
||||
BINDING_TURNS" times with vines, etc.");
|
||||
|
||||
static const u8 sTakeDownDescription[] = _(
|
||||
"A reckless charge attack\n"
|
||||
@ -339,11 +338,7 @@ static const u8 sDragonRageDescription[] = _(
|
||||
|
||||
static const u8 sFireSpinDescription[] = _(
|
||||
"Traps the foe in a ring of\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"fire for 4 or 5 turns.");
|
||||
#else
|
||||
"fire for 2 to 5 turns.");
|
||||
#endif
|
||||
"fire for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sThunderShockDescription[] = _(
|
||||
"An electrical attack that\n"
|
||||
@ -523,11 +518,7 @@ static const u8 sWaterfallDescription[] = _(
|
||||
|
||||
static const u8 sClampDescription[] = _(
|
||||
"Traps and squeezes the\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"foe for 4 or 5 turns.");
|
||||
#else
|
||||
"foe for 2 to 5 turns.");
|
||||
#endif
|
||||
"foe for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sSwiftDescription[] = _(
|
||||
"Sprays star-shaped rays\n"
|
||||
@ -1015,11 +1006,7 @@ static const u8 sRockSmashDescription[] = _(
|
||||
|
||||
static const u8 sWhirlpoolDescription[] = _(
|
||||
"Traps and hurts the foe in\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"a whirlpool for 4 or 5 turns.");
|
||||
#else
|
||||
"a whirlpool for 2 to 5 turns.");
|
||||
#endif
|
||||
"a whirlpool for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sBeatUpDescription[] = _(
|
||||
"Summons party Pokémon to\n"
|
||||
@ -1030,7 +1017,11 @@ static const u8 sFakeOutDescription[] = _(
|
||||
"that causes flinching.");
|
||||
|
||||
static const u8 sUproarDescription[] = _(
|
||||
#if B_UPROAR_TURNS >= GEN_5
|
||||
"Causes an uproar for 2 to 5\n"
|
||||
#else
|
||||
"Causes an uproar for 3\n"
|
||||
#endif
|
||||
"turns and prevents sleep.");
|
||||
|
||||
static const u8 sStockpileDescription[] = _(
|
||||
@ -1331,11 +1322,7 @@ static const u8 sSkyUppercutDescription[] = _(
|
||||
|
||||
static const u8 sSandTombDescription[] = _(
|
||||
"Traps and hurts the foe in\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"quicksand for 4 or 5 turns.");
|
||||
#else
|
||||
"quicksand for 2 to 5 turns.");
|
||||
#endif
|
||||
"quicksand for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sSheerColdDescription[] = _(
|
||||
"A chilling attack that\n"
|
||||
@ -1839,11 +1826,7 @@ static const u8 sSpacialRendDescription[] = _(
|
||||
|
||||
static const u8 sMagmaStormDescription[] = _(
|
||||
"Traps the foe in a vortex\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"of fire for 4 or 5 turns.");
|
||||
#else
|
||||
"of fire for 2 to 5 turns.");
|
||||
#endif
|
||||
"of fire for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sDarkVoidDescription[] = _(
|
||||
"Drags the foe into total\n"
|
||||
@ -2395,11 +2378,7 @@ static const u8 sNuzzleDescription[] = _(
|
||||
|
||||
static const u8 sInfestationDescription[] = _(
|
||||
"The foe is infested and\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"attacked for 4 or 5 turns.");
|
||||
#else
|
||||
"attacked for 2 to 5 turns.");
|
||||
#endif
|
||||
"attacked for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sPowerUpPunchDescription[] = _(
|
||||
"A hard punch that raises\n"
|
||||
@ -2944,11 +2923,7 @@ static const u8 sSurgingStrikesDescription[] = _(
|
||||
|
||||
static const u8 sThunderCageDescription[] = _(
|
||||
"Traps the foe in a cage of\n"
|
||||
#if B_BINDING_TURNS >= GEN_5
|
||||
"electricity for 4 or 5 turns.");
|
||||
#else
|
||||
"electricity for 2 to 5 turns.");
|
||||
#endif
|
||||
"electricity for "BINDING_TURNS" turns.");
|
||||
|
||||
static const u8 sDragonEnergyDescription[] = _(
|
||||
"The higher the user's HP\n"
|
||||
@ -2981,6 +2956,8 @@ static const u8 sEerieSpellDescription[] = _(
|
||||
static const u8 sNotDoneYetDescription[] = _(
|
||||
"Not done yet.");
|
||||
|
||||
#undef BINDING_TURNS
|
||||
|
||||
// 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] =
|
||||
{
|
||||
|
@ -551,7 +551,10 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon)
|
||||
u32 data = 0;
|
||||
u16 ball = ITEM_POKE_BALL;
|
||||
if (gEvolutionTable[preEvoSpecies][0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE
|
||||
&& (P_SHEDINJA_BALL == GEN_3 || CheckBagHasItem(ball, 1)))
|
||||
#if P_SHEDINJA_BALL >= GEN_4
|
||||
&& (CheckBagHasItem(ball, 1))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
s32 i;
|
||||
struct Pokemon *shedinja = &gPlayerParty[gPlayerPartyCount];
|
||||
|
@ -5470,6 +5470,12 @@ bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex,
|
||||
} \
|
||||
}
|
||||
|
||||
#if B_X_ITEMS_BUFF >= GEN_7
|
||||
#define X_ITEM_STAGES 2
|
||||
#else
|
||||
#define X_ITEM_STAGES 1
|
||||
#endif
|
||||
|
||||
// Returns TRUE if the item has no effect on the Pokémon, FALSE otherwise
|
||||
bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex, bool8 usedByAI)
|
||||
{
|
||||
@ -5576,10 +5582,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[i] & ITEM1_X_ATTACK)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_ATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] += 1;
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] += X_ITEM_STAGES;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_ATK] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -5589,10 +5592,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[i] & ITEM1_X_DEFENSE)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_DEF] < MAX_STAT_STAGE)
|
||||
{
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] += 1;
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] += X_ITEM_STAGES;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_DEF] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -5602,10 +5602,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[i] & ITEM1_X_SPEED)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_SPEED] < MAX_STAT_STAGE)
|
||||
{
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] += 1;
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] += X_ITEM_STAGES;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_SPEED] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -5615,10 +5612,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[i] & ITEM1_X_SPATK)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_SPATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] += 1;
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] += X_ITEM_STAGES;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_SPATK] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -5628,10 +5622,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[i] & ITEM1_X_SPDEF)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_SPDEF] < MAX_STAT_STAGE)
|
||||
{
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPDEF] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPDEF] += 1;
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPDEF] += X_ITEM_STAGES;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_SPDEF] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPDEF] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -5641,10 +5632,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[i] & ITEM1_X_ACCURACY)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_ACC] < MAX_STAT_STAGE)
|
||||
{
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] += 1;
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] += X_ITEM_STAGES;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_ACC] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -6204,15 +6192,12 @@ static void BufferStatRoseMessage(s32 statIdx)
|
||||
{
|
||||
gBattlerTarget = gBattlerInMenuId;
|
||||
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[statIdx]]);
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
{
|
||||
#if B_X_ITEMS_BUFF >= GEN_7
|
||||
StringCopy(gBattleTextBuff2, gText_StatSharply);
|
||||
StringAppend(gBattleTextBuff2, gText_StatRose);
|
||||
}
|
||||
else
|
||||
{
|
||||
#else
|
||||
StringCopy(gBattleTextBuff2, gText_StatRose);
|
||||
}
|
||||
#endif
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
|
||||
}
|
||||
|
||||
@ -6324,7 +6309,10 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
|
||||
// Prevent evolution with Everstone, unless we're just viewing the party menu with an evolution item
|
||||
if (holdEffect == HOLD_EFFECT_PREVENT_EVOLVE
|
||||
&& mode != EVO_MODE_ITEM_CHECK
|
||||
&& (P_KADABRA_EVERSTONE < GEN_4 || species != SPECIES_KADABRA))
|
||||
#if P_KADABRA_EVERSTONE >= GEN_4
|
||||
&& species != SPECIES_KADABRA
|
||||
#endif
|
||||
)
|
||||
return SPECIES_NONE;
|
||||
|
||||
switch (mode)
|
||||
|
@ -3735,8 +3735,9 @@ static void PrintMoveDetails(u16 move)
|
||||
{
|
||||
if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES)
|
||||
{
|
||||
if (B_SHOW_SPLIT_ICON == TRUE)
|
||||
#if B_SHOW_SPLIT_ICON == TRUE
|
||||
ShowSplitIcon(GetBattleMoveSplit(move));
|
||||
#endif
|
||||
PrintMovePowerAndAccuracy(move);
|
||||
PrintTextOnWindow(windowId, gMoveDescriptionPointers[move - 1], 6, 1, 0, 0);
|
||||
}
|
||||
|
@ -367,7 +367,10 @@ static u8 PickWildMonNature(void)
|
||||
// check synchronize for a pokemon with the same ability
|
||||
if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)
|
||||
&& GetMonAbility(&gPlayerParty[0]) == ABILITY_SYNCHRONIZE
|
||||
&& ((B_SYNCHRONIZE_NATURE >= GEN_8) || Random() % 2 == 0))
|
||||
#if B_SYNCHRONIZE_NATURE <= GEN_7
|
||||
&& (Random() % 2 == 0)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
return GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY) % NUM_NATURES;
|
||||
}
|
||||
@ -1003,8 +1006,10 @@ bool8 TryDoDoubleWildBattle(void)
|
||||
{
|
||||
if (GetSafariZoneFlag() || GetMonsStateToDoubles() != PLAYER_HAS_TWO_USABLE_MONS)
|
||||
return FALSE;
|
||||
else if (B_FLAG_FORCE_DOUBLE_WILD != 0 && FlagGet(B_FLAG_FORCE_DOUBLE_WILD))
|
||||
#if B_FLAG_FORCE_DOUBLE_WILD != 0
|
||||
else if (FlagGet(B_FLAG_FORCE_DOUBLE_WILD))
|
||||
return TRUE;
|
||||
#endif
|
||||
#if B_DOUBLE_WILD_CHANCE != 0
|
||||
else if ((Random() % 100) + 1 < B_DOUBLE_WILD_CHANCE)
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user