Fixes a mistake made by me (#6828)
This commit is contained in:
parent
a880cfe6d2
commit
7f894ef5fb
@ -380,7 +380,7 @@ void ClearPursuitValuesIfSet(u32 battler);
|
||||
void ClearPursuitValues(void);
|
||||
bool32 HasWeatherEffect(void);
|
||||
u32 RestoreWhiteHerbStats(u32 battler);
|
||||
bool32 IsFutureSightAttackerInParty(u32 battlerAtk, u32 battlerDef);
|
||||
bool32 IsFutureSightAttackerInParty(u32 battlerAtk, u32 battlerDef, u32 move);
|
||||
bool32 HadMoreThanHalfHpNowDoesnt(u32 battler);
|
||||
void UpdateStallMons(void);
|
||||
|
||||
|
||||
@ -368,7 +368,7 @@ static bool32 HandleEndTurnFutureSight(u32 battler)
|
||||
gBattlerAttacker = gWishFutureKnock.futureSightBattlerIndex[battler];
|
||||
gCurrentMove = gWishFutureKnock.futureSightMove[battler];
|
||||
|
||||
if (!IsFutureSightAttackerInParty(gBattlerAttacker, gBattlerTarget))
|
||||
if (!IsFutureSightAttackerInParty(gBattlerAttacker, gBattlerTarget, gCurrentMove))
|
||||
SetTypeBeforeUsingMove(gCurrentMove, gBattlerAttacker);
|
||||
|
||||
BattleScriptExecute(BattleScript_MonTookFutureAttack);
|
||||
|
||||
@ -4614,8 +4614,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
&& IsBattlerAlive(gBattlerAttacker))
|
||||
{
|
||||
// Prevent Innards Out effect if Future Sight user is currently not on field
|
||||
if (GetMoveEffect(gCurrentMove) == EFFECT_FUTURE_SIGHT
|
||||
&& IsFutureSightAttackerInParty(gBattlerAttacker, gBattlerTarget))
|
||||
if (IsFutureSightAttackerInParty(gBattlerAttacker, gBattlerTarget, gCurrentMove))
|
||||
break;
|
||||
|
||||
gBattleScripting.battler = gBattlerTarget;
|
||||
@ -7154,7 +7153,7 @@ u32 ItemBattleEffects(enum ItemCaseId caseID, u32 battler, bool32 moveTurn)
|
||||
&& (IsBattlerTurnDamaged(gBattlerTarget) || !(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)) // Needs the second check in case of Substitute
|
||||
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD
|
||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& !IsFutureSightAttackerInParty(gBattlerAttacker, gBattlerTarget))
|
||||
&& !IsFutureSightAttackerInParty(gBattlerAttacker, gBattlerTarget, gCurrentMove))
|
||||
{
|
||||
gBattleStruct->moveDamage[gBattlerAttacker] = GetNonDynamaxMaxHP(gBattlerAttacker) / 10;
|
||||
if (gBattleStruct->moveDamage[gBattlerAttacker] == 0)
|
||||
@ -9615,8 +9614,11 @@ static u32 GetWeather(void)
|
||||
return gBattleWeather;
|
||||
}
|
||||
|
||||
bool32 IsFutureSightAttackerInParty(u32 battlerAtk, u32 battlerDef)
|
||||
bool32 IsFutureSightAttackerInParty(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
{
|
||||
if (GetMoveEffect(move) != EFFECT_FUTURE_SIGHT)
|
||||
return FALSE;
|
||||
|
||||
struct Pokemon *party = GetSideParty(GetBattlerSide(battlerAtk));
|
||||
return &party[gWishFutureKnock.futureSightPartyIndex[battlerDef]] != &party[gBattlerPartyIndexes[battlerAtk]]
|
||||
&& &party[gWishFutureKnock.futureSightPartyIndex[battlerDef]] != &party[BATTLE_PARTNER(gBattlerPartyIndexes[battlerAtk])];
|
||||
@ -9631,8 +9633,7 @@ s32 CalculateMoveDamage(struct DamageCalculationData *damageCalcData, u32 fixedB
|
||||
GetBattlerAbility(damageCalcData->battlerDef),
|
||||
damageCalcData->updateFlags);
|
||||
|
||||
if (GetMoveEffect(damageCalcData->move) == EFFECT_FUTURE_SIGHT
|
||||
&& IsFutureSightAttackerInParty(damageCalcData->battlerAtk, damageCalcData->battlerDef))
|
||||
if (IsFutureSightAttackerInParty(damageCalcData->battlerAtk, damageCalcData->battlerDef, damageCalcData->move))
|
||||
return DoFutureSightAttackDamageCalc(damageCalcData, typeEffectivenessMultiplier, GetWeather());
|
||||
|
||||
return DoMoveDamageCalc(damageCalcData, fixedBasePower, typeEffectivenessMultiplier, GetWeather());
|
||||
|
||||
@ -68,3 +68,20 @@ SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant and keeps ori
|
||||
MESSAGE("The opposing Pawniard was hurt by Dugtrio's Rocky Helmet!");
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Tangling Hair does not activate on confusion damage")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(GetMoveEffect(MOVE_CONFUSE_RAY) == EFFECT_CONFUSE);
|
||||
PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); }
|
||||
OPPONENT(SPECIES_WYNAUT);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_CONFUSE_RAY); MOVE(player, MOVE_CELEBRATE, WITH_RNG(RNG_CONFUSION, TRUE)); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFUSE_RAY, opponent);
|
||||
NONE_OF {
|
||||
ABILITY_POPUP(player, ABILITY_TANGLING_HAIR);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user