Removed Sheer Force flag
This commit is contained in:
parent
e602a310c9
commit
02ffd05aea
8 changed files with 34 additions and 207 deletions
|
@ -200,6 +200,7 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move);
|
|||
bool32 HasEnoughHpToEatBerry(u32 battler, u32 hpFraction, u32 itemId);
|
||||
bool32 IsPartnerMonFromSameTrainer(u32 battler);
|
||||
u8 GetCategoryBasedOnStats(u32 battler);
|
||||
bool32 MoveIsAffectedBySheerForce(u16 move);
|
||||
bool32 TestSheerForceFlag(u32 battler, u16 move);
|
||||
void TryRestoreHeldItems(void);
|
||||
bool32 CanStealItem(u32 battlerStealing, u32 battlerItem, u16 item);
|
||||
|
|
|
@ -527,6 +527,9 @@ struct MoveInfo
|
|||
#define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__}
|
||||
#define ADDITIONAL_EFFECTS(...) EFFECTS_ARR( __VA_ARGS__ ), .numAdditionalEffects = ARRAY_COUNT(EFFECTS_ARR( __VA_ARGS__ ))
|
||||
|
||||
// Just a hack to make a move boosted by Sheer Force despite having no secondary effects affected
|
||||
#define SHEER_FORCE_HACK { .moveEffect = 0, .chance = 100, }
|
||||
|
||||
struct AdditionalEffect
|
||||
{
|
||||
u8 self:1;
|
||||
|
|
|
@ -4391,7 +4391,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||
allocatedArray[k] = (gMovesInfo[move].pp <= 5) ? 1 : 0;
|
||||
break;
|
||||
case MOVE_POINTS_EFFECT:
|
||||
allocatedArray[k] = gMovesInfo[move].sheerForceBoost;
|
||||
allocatedArray[k] = MoveIsAffectedBySheerForce(move);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2740,13 +2740,13 @@ void StealTargetItem(u8 battlerStealer, u8 battlerItem)
|
|||
#define INCREMENT_RESET_RETURN \
|
||||
{ \
|
||||
gBattlescriptCurrInstr++; \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define RESET_RETURN \
|
||||
{ \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
return; \
|
||||
}
|
||||
|
||||
|
@ -2759,6 +2759,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
|
|||
u16 battlerAbility;
|
||||
bool8 activateAfterFaint = FALSE;
|
||||
|
||||
// NULL move effect
|
||||
if (gBattleScripting.moveEffect == 0)
|
||||
return;
|
||||
|
||||
if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT
|
||||
&& gBattleMons[gBattlerTarget].hp != 0
|
||||
&& IsFinalStrikeEffect(gBattleScripting.moveEffect))
|
||||
|
|
|
@ -8732,7 +8732,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32
|
|||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.2));
|
||||
break;
|
||||
case ABILITY_SHEER_FORCE:
|
||||
if (gMovesInfo[move].sheerForceBoost)
|
||||
if (MoveIsAffectedBySheerForce(move))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
||||
break;
|
||||
case ABILITY_SAND_FORCE:
|
||||
|
@ -10688,12 +10688,21 @@ bool32 IsBattlerAffectedByHazards(u32 battler, bool32 toxicSpikes)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool32 MoveIsAffectedBySheerForce(u16 move)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
{
|
||||
if (gMovesInfo[move].additionalEffects[i].chance > 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 TestSheerForceFlag(u32 battler, u16 move)
|
||||
{
|
||||
if (GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && gMovesInfo[move].sheerForceBoost)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
return GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && MoveIsAffectedBySheerForce(move);
|
||||
}
|
||||
|
||||
// This function is the body of "jumpifstat", but can be used dynamically in a function
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,12 @@
|
|||
#include "global.h"
|
||||
#include "test/battle.h"
|
||||
|
||||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
ASSUME(MoveIsAffectedBySheerForce(MOVE_ELECTRO_SHOT) == TRUE);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Sheer Force boosts power, but removes secondary effects of moves", s16 damage)
|
||||
{
|
||||
s32 j;
|
||||
|
@ -8,7 +14,7 @@ SINGLE_BATTLE_TEST("Sheer Force boosts power, but removes secondary effects of m
|
|||
|
||||
for (j = 1; j < MOVES_COUNT; j++)
|
||||
{
|
||||
if (gMovesInfo[j].sheerForceBoost
|
||||
if (MoveIsAffectedBySheerForce(j)
|
||||
//&& gMovesInfo[j].effect != EFFECT_ORDER_UP
|
||||
&& gMovesInfo[j].effect != EFFECT_AURA_WHEEL
|
||||
&& gMovesInfo[j].effect != EFFECT_PLACEHOLDER)
|
||||
|
|
|
@ -68,7 +68,7 @@ SINGLE_BATTLE_TEST("Flare Blitz deals 33% of recoil damage to the user and can b
|
|||
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_FLARE_BLITZ].recoil == 33);
|
||||
ASSUME(gMovesInfo[MOVE_FLARE_BLITZ].argument == STATUS1_BURN);
|
||||
ASSUME(MoveHasMoveEffect(MOVE_FLARE_BLITZ, MOVE_EFFECT_BURN));
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
|
|
Loading…
Reference in a new issue