Requested changes, Sticky Web edge case

Fix issues found by ghoulslash, and make sure Defiant works properly with Sticky Web and Court Change.
This commit is contained in:
BuffelSaft 2022-04-27 21:51:10 +12:00
parent 5358cc0a00
commit af6242f2e0
5 changed files with 10 additions and 6 deletions

View File

@ -7290,7 +7290,7 @@ BattleScript_DefDownSpeedUpTryDef::
setstatchanger STAT_DEF, 1, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpTrySpeed
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpTrySpeed
printfromtable gStatUpStringIds
printfromtable gStatDownStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_DefDownSpeedUpTrySpeed:
playstatchangeanimation BS_ATTACKER, BIT_SPEED, 0

View File

@ -39,7 +39,7 @@
#define sABILITY_OVERWRITE (gBattleScripting + 0x34) // abilityPopupOverwrite
#define sSWITCH_CASE (gBattleScripting + 0x36) // switchCase
#define sBERRY_OVERRIDE (gBattleScripting + 0x37) // overrideBerryRequirements
#define sSTICKY_WEB_STAT_DROP (gBattleScripting + 0x38) //
#define sSTICKY_WEB_STAT_DROP (gBattleScripting + 0x38) // stickyWebStatDrop
// Array entries for battle communication
#define MULTIUSE_STATE 0

View File

@ -566,7 +566,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
GET_MOVE_TYPE(move, moveType);
// check non-user target
if (moveTarget & MOVE_TARGET_USER)
if (!(moveTarget & MOVE_TARGET_USER))
{
// handle negative checks on non-user target
// check powder moves

View File

@ -3504,8 +3504,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION;
break;
case MOVE_EFFECT_SCALE_SHOT:
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp;
if (!NoAliveMonsForEitherParty())
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp;
}
break;
}
}
@ -7700,6 +7703,7 @@ static bool32 CourtChangeSwapSideStatuses(void)
UPDATE_COURTCHANGED_BATTLER(auroraVeilBattlerId);
UPDATE_COURTCHANGED_BATTLER(tailwindBattlerId);
UPDATE_COURTCHANGED_BATTLER(luckyChantBattlerId);
gBattleStruct->stickyWebUser ^= BIT_SIDE;
// Track which side originally set the Sticky Web
SWAP(sideTimerPlayer->stickyWebBattlerSide, sideTimerOpp->stickyWebBattlerSide, temp);

View File

@ -1569,7 +1569,7 @@ void PrepareStringBattle(u16 stringId, u8 battler)
&& ((targetAbility == ABILITY_DEFIANT && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN))
|| (targetAbility == ABILITY_COMPETITIVE && CompareStat(gBattlerTarget, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN)))
&& gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != BATTLE_PARTNER(gBattlerTarget)
// && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) // Why was this here? Needs investigating
&& ((gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) || gBattleScripting.stickyWebStatDrop == 1)
&& !(gBattleScripting.stickyWebStatDrop == 1 && gSideTimers[targetSide].stickyWebBattlerSide == targetSide)) // Sticky Web must have been set by the foe
{
gBattleScripting.stickyWebStatDrop = 0;