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 HasEnoughHpToEatBerry(u32 battler, u32 hpFraction, u32 itemId);
|
||||||
bool32 IsPartnerMonFromSameTrainer(u32 battler);
|
bool32 IsPartnerMonFromSameTrainer(u32 battler);
|
||||||
u8 GetCategoryBasedOnStats(u32 battler);
|
u8 GetCategoryBasedOnStats(u32 battler);
|
||||||
|
bool32 MoveIsAffectedBySheerForce(u16 move);
|
||||||
bool32 TestSheerForceFlag(u32 battler, u16 move);
|
bool32 TestSheerForceFlag(u32 battler, u16 move);
|
||||||
void TryRestoreHeldItems(void);
|
void TryRestoreHeldItems(void);
|
||||||
bool32 CanStealItem(u32 battlerStealing, u32 battlerItem, u16 item);
|
bool32 CanStealItem(u32 battlerStealing, u32 battlerItem, u16 item);
|
||||||
|
|
|
@ -527,6 +527,9 @@ struct MoveInfo
|
||||||
#define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__}
|
#define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__}
|
||||||
#define ADDITIONAL_EFFECTS(...) EFFECTS_ARR( __VA_ARGS__ ), .numAdditionalEffects = ARRAY_COUNT(EFFECTS_ARR( __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
|
struct AdditionalEffect
|
||||||
{
|
{
|
||||||
u8 self:1;
|
u8 self:1;
|
||||||
|
|
|
@ -4391,7 +4391,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||||
allocatedArray[k] = (gMovesInfo[move].pp <= 5) ? 1 : 0;
|
allocatedArray[k] = (gMovesInfo[move].pp <= 5) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
case MOVE_POINTS_EFFECT:
|
case MOVE_POINTS_EFFECT:
|
||||||
allocatedArray[k] = gMovesInfo[move].sheerForceBoost;
|
allocatedArray[k] = MoveIsAffectedBySheerForce(move);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2759,6 +2759,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
|
||||||
u16 battlerAbility;
|
u16 battlerAbility;
|
||||||
bool8 activateAfterFaint = FALSE;
|
bool8 activateAfterFaint = FALSE;
|
||||||
|
|
||||||
|
// NULL move effect
|
||||||
|
if (gBattleScripting.moveEffect == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT
|
if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT
|
||||||
&& gBattleMons[gBattlerTarget].hp != 0
|
&& gBattleMons[gBattlerTarget].hp != 0
|
||||||
&& IsFinalStrikeEffect(gBattleScripting.moveEffect))
|
&& 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));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(1.2));
|
||||||
break;
|
break;
|
||||||
case ABILITY_SHEER_FORCE:
|
case ABILITY_SHEER_FORCE:
|
||||||
if (gMovesInfo[move].sheerForceBoost)
|
if (MoveIsAffectedBySheerForce(move))
|
||||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
||||||
break;
|
break;
|
||||||
case ABILITY_SAND_FORCE:
|
case ABILITY_SAND_FORCE:
|
||||||
|
@ -10688,12 +10688,21 @@ bool32 IsBattlerAffectedByHazards(u32 battler, bool32 toxicSpikes)
|
||||||
return ret;
|
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)
|
bool32 TestSheerForceFlag(u32 battler, u16 move)
|
||||||
{
|
{
|
||||||
if (GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && gMovesInfo[move].sheerForceBoost)
|
return GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && MoveIsAffectedBySheerForce(move);
|
||||||
return TRUE;
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is the body of "jumpifstat", but can be used dynamically in a function
|
// 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 "global.h"
|
||||||
#include "test/battle.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)
|
SINGLE_BATTLE_TEST("Sheer Force boosts power, but removes secondary effects of moves", s16 damage)
|
||||||
{
|
{
|
||||||
s32 j;
|
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++)
|
for (j = 1; j < MOVES_COUNT; j++)
|
||||||
{
|
{
|
||||||
if (gMovesInfo[j].sheerForceBoost
|
if (MoveIsAffectedBySheerForce(j)
|
||||||
//&& gMovesInfo[j].effect != EFFECT_ORDER_UP
|
//&& gMovesInfo[j].effect != EFFECT_ORDER_UP
|
||||||
&& gMovesInfo[j].effect != EFFECT_AURA_WHEEL
|
&& gMovesInfo[j].effect != EFFECT_AURA_WHEEL
|
||||||
&& gMovesInfo[j].effect != EFFECT_PLACEHOLDER)
|
&& 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 {
|
GIVEN {
|
||||||
ASSUME(gMovesInfo[MOVE_FLARE_BLITZ].recoil == 33);
|
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);
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
OPPONENT(SPECIES_WOBBUFFET);
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
} WHEN {
|
} WHEN {
|
||||||
|
|
Loading…
Reference in a new issue