merge with be

This commit is contained in:
ghoulslash 2021-09-13 19:40:28 -04:00
commit f3f26d1a6f
12 changed files with 103 additions and 36 deletions

View File

@ -2235,7 +2235,7 @@ BattleScript_EffectAbsorb::
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
setdrainedhp setdrainedhp
manipulatedamage DMG_BIG_ROOT manipulatedamage DMG_BIG_ROOT
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze
setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB
goto BattleScript_AbsorbUpdateHp goto BattleScript_AbsorbUpdateHp
@ -2837,7 +2837,7 @@ BattleScript_MoveMissedDoDamage::
.else .else
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED bichalfword gMoveResultFlags, MOVE_RESULT_MISSED
.endif .endif
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
@ -4319,6 +4319,7 @@ BattleScript_EffectWillOWisp::
jumpifstatus BS_TARGET, STATUS1_BURN, BattleScript_AlreadyBurned jumpifstatus BS_TARGET, STATUS1_BURN, BattleScript_AlreadyBurned
jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected
jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents
jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguard BattleScript_LeafGuardProtects
@ -4333,6 +4334,7 @@ BattleScript_EffectWillOWisp::
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_WaterVeilPrevents:: BattleScript_WaterVeilPrevents::
call BattleScript_AbilityPopUp
copybyte gEffectBattler, gBattlerTarget copybyte gEffectBattler, gBattlerTarget
setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS
call BattleScript_BRNPrevention call BattleScript_BRNPrevention
@ -6527,6 +6529,18 @@ BattleScript_TargetPRLZHeal::
updatestatusicon BS_TARGET updatestatusicon BS_TARGET
return return
BattleScript_TargetWokeUp::
printstring STRINGID_TARGETWOKEUP
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_TARGET
return
BattleScript_TargetBurnHeal::
printstring STRINGID_PKMNBURNHEALED
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_TARGET
return
BattleScript_MoveEffectSleep:: BattleScript_MoveEffectSleep::
statusanimation BS_EFFECT_BATTLER statusanimation BS_EFFECT_BATTLER
printfromtable gFellAsleepStringIds printfromtable gFellAsleepStringIds
@ -6630,7 +6644,7 @@ BattleScript_MoveEffectRecoil::
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
BattleScript_DoRecoil:: BattleScript_DoRecoil::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
printstring STRINGID_PKMNHITWITHRECOIL printstring STRINGID_PKMNHITWITHRECOIL
@ -6669,9 +6683,11 @@ BattleScript_DefiantActivates::
return return
BattleScript_AbilityPopUp: BattleScript_AbilityPopUp:
.if B_ABILITY_POP_UP == TRUE
showabilitypopup BS_ABILITY_BATTLER showabilitypopup BS_ABILITY_BATTLER
recordability BS_ABILITY_BATTLER recordability BS_ABILITY_BATTLER
pause 40 pause 40
.endif
sethword sABILITY_OVERWRITE, 0 sethword sABILITY_OVERWRITE, 0
return return
@ -7048,6 +7064,7 @@ BattleScript_MoveStatDrain::
waitanimation waitanimation
printstring STRINGID_TARGETABILITYSTATRAISE printstring STRINGID_TARGETABILITYSTATRAISE
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_MonMadeMoveUseless_PPLoss:: BattleScript_MonMadeMoveUseless_PPLoss::
@ -7058,6 +7075,7 @@ BattleScript_MonMadeMoveUseless::
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
printstring STRINGID_PKMNSXMADEYUSELESS printstring STRINGID_PKMNSXMADEYUSELESS
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
@ -7069,6 +7087,7 @@ BattleScript_FlashFireBoost::
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
printfromtable gFlashFireStringIds printfromtable gFlashFireStringIds
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_AbilityPreventsPhasingOut:: BattleScript_AbilityPreventsPhasingOut::
@ -7672,7 +7691,7 @@ BattleScript_AirBaloonMsgPop::
return return
BattleScript_ItemHurtRet:: BattleScript_ItemHurtRet::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
printstring STRINGID_HURTBYITEM printstring STRINGID_HURTBYITEM
@ -7690,7 +7709,7 @@ BattleScript_ItemHealHP_Ret::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
return return

View File

@ -144,6 +144,7 @@ struct ProtectStruct
u32 usedThroatChopPreventedMove:1; u32 usedThroatChopPreventedMove:1;
u32 micle:1; u32 micle:1;
u32 custap:1; // also quick claw u32 custap:1; // also quick claw
u32 touchedProtectLike:1;
u32 physicalDmg; u32 physicalDmg;
u32 specialDmg; u32 specialDmg;
u8 physicalBattlerId; u8 physicalBattlerId;
@ -217,7 +218,6 @@ struct FieldTimer
u8 mistyTerrainTimer; u8 mistyTerrainTimer;
u8 electricTerrainTimer; u8 electricTerrainTimer;
u8 psychicTerrainTimer; u8 psychicTerrainTimer;
u8 echoVoiceCounter;
u8 gravityTimer; u8 gravityTimer;
u8 fairyLockTimer; u8 fairyLockTimer;
}; };
@ -492,7 +492,9 @@ struct BattleStruct
u16 assistPossibleMoves[PARTY_SIZE * MAX_MON_MOVES]; // Each of mons can know max 4 moves. u16 assistPossibleMoves[PARTY_SIZE * MAX_MON_MOVES]; // Each of mons can know max 4 moves.
u8 focusPunchBattlerId; u8 focusPunchBattlerId;
u8 battlerPreventingSwitchout; u8 battlerPreventingSwitchout;
u8 moneyMultiplier; u8 moneyMultiplier:6;
u8 moneyMultiplierItem:1;
u8 moneyMultiplierMove:1;
u8 savedTurnActionNumber; u8 savedTurnActionNumber;
u8 switchInAbilitiesCounter; u8 switchInAbilitiesCounter;
u8 faintedActionsState; u8 faintedActionsState;

View File

@ -124,6 +124,8 @@ extern const u8 BattleScript_MoveUsedIsInLoveCantAttack[];
extern const u8 BattleScript_NightmareTurnDmg[]; extern const u8 BattleScript_NightmareTurnDmg[];
extern const u8 BattleScript_CurseTurnDmg[]; extern const u8 BattleScript_CurseTurnDmg[];
extern const u8 BattleScript_TargetPRLZHeal[]; extern const u8 BattleScript_TargetPRLZHeal[];
extern const u8 BattleScript_TargetWokeUp[];
extern const u8 BattleScript_TargetBurnHeal[];
extern const u8 BattleScript_MoveEffectSleep[]; extern const u8 BattleScript_MoveEffectSleep[];
extern const u8 BattleScript_YawnMakesAsleep[]; extern const u8 BattleScript_YawnMakesAsleep[];
extern const u8 BattleScript_MoveEffectPoison[]; extern const u8 BattleScript_MoveEffectPoison[];

View File

@ -185,7 +185,8 @@
#define HITMARKER_IGNORE_SAFEGUARD (1 << 13) #define HITMARKER_IGNORE_SAFEGUARD (1 << 13)
#define HITMARKER_SYNCHRONISE_EFFECT (1 << 14) #define HITMARKER_SYNCHRONISE_EFFECT (1 << 14)
#define HITMARKER_RUN (1 << 15) #define HITMARKER_RUN (1 << 15)
// 3 free spots because of change in handling of UNDERGROUND/UNDERGWATER/ON AIR #define HITMARKER_IGNORE_DISGUISE (1 << 16)
// 3 free spots because of change in handling of UNDERGROUND/UNDERWATER/ON AIR
#define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19) #define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19)
#define HITMARKER_x100000 (1 << 20) #define HITMARKER_x100000 (1 << 20)
#define HITMARKER_x200000 (1 << 21) #define HITMARKER_x200000 (1 << 21)

View File

@ -572,10 +572,11 @@
#define STRINGID_PKMNGOTOVERITSINFATUATION 568 #define STRINGID_PKMNGOTOVERITSINFATUATION 568
#define STRINGID_ITEMCANNOTBEREMOVED 569 #define STRINGID_ITEMCANNOTBEREMOVED 569
#define STRINGID_STICKYBARBTRANSFER 570 #define STRINGID_STICKYBARBTRANSFER 570
#define STRINGID_REDCARDACTIVATE 571 #define STRINGID_PKMNBURNHEALED 571
#define STRINGID_EJECTBUTTONACTIVATE 572 #define STRINGID_REDCARDACTIVATE 572
#define STRINGID_EJECTBUTTONACTIVATE 573
#define BATTLESTRINGS_COUNT 573 #define BATTLESTRINGS_COUNT 574
// The below IDs are all indexes into battle message tables, // The below IDs are all indexes into battle message tables,
// used to determine which of a set of messages to print. // used to determine which of a set of messages to print.

View File

@ -795,6 +795,9 @@ static bool8 ShouldUseItem(void)
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT) if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT)
return FALSE; return FALSE;
if (gStatuses3[gActiveBattler] & STATUS3_EMBARGO)
return FALSE;
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
party = gPlayerParty; party = gPlayerParty;

View File

@ -698,14 +698,15 @@ static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX
static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!");
static const u8 sText_ItemCannotBeRemoved[] = _("{B_ATK_NAME_WITH_PREFIX}'s item cannot be removed!"); static const u8 sText_ItemCannotBeRemoved[] = _("{B_ATK_NAME_WITH_PREFIX}'s item cannot be removed!");
static const u8 sText_StickyBarbTransfer[] = _("The {B_LAST_ITEM} attached itself to\n{B_ATK_NAME_WITH_PREFIX}!"); static const u8 sText_StickyBarbTransfer[] = _("The {B_LAST_ITEM} attached itself to\n{B_ATK_NAME_WITH_PREFIX}!");
static const u8 sText_PkmnBurnHealed[] = _("{B_DEF_NAME_WITH_PREFIX}'s\nburn was healed.");
static const u8 sText_RedCardActivate[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} held up its {B_LAST_ITEM}\nagainst {B_ATK_NAME_WITH_PREFIX}!"); static const u8 sText_RedCardActivate[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} held up its {B_LAST_ITEM}\nagainst {B_ATK_NAME_WITH_PREFIX}!");
static const u8 sText_EjectButtonActivate[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is switched\nout with the {B_LAST_ITEM}!"); static const u8 sText_EjectButtonActivate[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is switched\nout with the {B_LAST_ITEM}!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{ {
[STRINGID_EJECTBUTTONACTIVATE - 12] = sText_EjectButtonActivate, [STRINGID_EJECTBUTTONACTIVATE - 12] = sText_EjectButtonActivate,
[STRINGID_REDCARDACTIVATE - 12] = sText_RedCardActivate, [STRINGID_REDCARDACTIVATE - 12] = sText_RedCardActivate,
[STRINGID_PKMNBURNHEALED - 12] = sText_PkmnBurnHealed,
[STRINGID_STICKYBARBTRANSFER - 12] = sText_StickyBarbTransfer, [STRINGID_STICKYBARBTRANSFER - 12] = sText_StickyBarbTransfer,
[STRINGID_ITEMCANNOTBEREMOVED - 12] = sText_ItemCannotBeRemoved, [STRINGID_ITEMCANNOTBEREMOVED - 12] = sText_ItemCannotBeRemoved,
[STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation,

View File

@ -821,7 +821,7 @@ static bool8 DoesAbilityPreventStatus(struct Pokemon *mon, u32 status)
ret = TRUE; ret = TRUE;
break; break;
case STATUS1_BURN: case STATUS1_BURN:
if (ability == ABILITY_WATER_VEIL) if (ability == ABILITY_WATER_VEIL || ability == ABILITY_WATER_BUBBLE)
ret = TRUE; ret = TRUE;
break; break;
case STATUS1_PARALYSIS: case STATUS1_PARALYSIS:

View File

@ -1452,8 +1452,11 @@ static void Cmd_attackcanceler(void)
} }
else if (IsBattlerProtected(gBattlerTarget, gCurrentMove) else if (IsBattlerProtected(gBattlerTarget, gCurrentMove)
&& (gCurrentMove != MOVE_CURSE || IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) && (gCurrentMove != MOVE_CURSE || IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST))
&& ((!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)))) && ((!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)))
&& gBattleMoves[gCurrentMove].effect != EFFECT_SUCKER_PUNCH)
{ {
if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT)
gProtectStructs[gBattlerAttacker].touchedProtectLike = 1;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
@ -1743,7 +1746,7 @@ static void Cmd_ppreduce(void)
if (!(gHitMarker & (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING)) && gBattleMons[gBattlerAttacker].pp[gCurrMovePos]) if (!(gHitMarker & (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING)) && gBattleMons[gBattlerAttacker].pp[gCurrMovePos])
{ {
gProtectStructs[gBattlerAttacker].notFirstStrike = 1; gProtectStructs[gBattlerAttacker].notFirstStrike = 1;
// For item Metronome // For item Metronome, echoed voice
if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] if (gCurrentMove == gLastResultingMoves[gBattlerAttacker]
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& !WasUnableToUseMove(gBattlerAttacker)) && !WasUnableToUseMove(gBattlerAttacker))
@ -2356,6 +2359,7 @@ static void Cmd_resultmessage(void)
if (gSpecialStatuses[gBattlerTarget].berryReduced if (gSpecialStatuses[gBattlerTarget].berryReduced
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{ {
gLastUsedItem = gBattleMons[gBattlerTarget].item;
gSpecialStatuses[gBattlerTarget].berryReduced = 0; gSpecialStatuses[gBattlerTarget].berryReduced = 0;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString;
@ -2615,11 +2619,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
statusChanged = TRUE; statusChanged = TRUE;
break; break;
case STATUS1_BURN: case STATUS1_BURN:
if (GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL if ((GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL || GetBattlerAbility(gEffectBattler) == ABILITY_WATER_BUBBLE)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{ {
gLastUsedAbility = ABILITY_WATER_VEIL; gLastUsedAbility = GetBattlerAbility(gEffectBattler);
RecordAbilityBattle(gEffectBattler, ABILITY_WATER_VEIL); RecordAbilityBattle(gEffectBattler, GetBattlerAbility(gEffectBattler));
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattlescriptCurrInstr = BattleScript_BRNPrevention;
@ -2648,6 +2652,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
break; break;
if (GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL if (GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL
|| GetBattlerAbility(gEffectBattler) == ABILITY_COMATOSE || GetBattlerAbility(gEffectBattler) == ABILITY_COMATOSE
|| GetBattlerAbility(gEffectBattler) == ABILITY_WATER_BUBBLE
|| IsAbilityStatusProtected(gEffectBattler)) || IsAbilityStatusProtected(gEffectBattler))
break; break;
if (gBattleMons[gEffectBattler].status1) if (gBattleMons[gEffectBattler].status1)
@ -2878,9 +2883,10 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect];
break; break;
case MOVE_EFFECT_HAPPY_HOUR: case MOVE_EFFECT_HAPPY_HOUR:
if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER) if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER && !gBattleStruct->moneyMultiplierMove)
{ {
gBattleStruct->moneyMultiplier *= 2; gBattleStruct->moneyMultiplier *= 2;
gBattleStruct->moneyMultiplierMove = 1;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
break; break;
@ -3109,7 +3115,18 @@ void SetMoveEffect(bool32 primary, u32 certain)
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_TargetPRLZHeal; switch (gBattleMoves[gCurrentMove].argument)
{
case STATUS1_PARALYSIS:
gBattlescriptCurrInstr = BattleScript_TargetPRLZHeal;
break;
case STATUS1_SLEEP:
gBattlescriptCurrInstr = BattleScript_TargetWokeUp;
break;
case STATUS1_BURN:
gBattlescriptCurrInstr = BattleScript_TargetBurnHeal;
break;
}
} }
break; break;
case MOVE_EFFECT_ATK_DEF_DOWN: // SuperPower case MOVE_EFFECT_ATK_DEF_DOWN: // SuperPower
@ -4748,10 +4765,11 @@ static void Cmd_moveend(void)
switch (gBattleScripting.moveendState) switch (gBattleScripting.moveendState)
{ {
case MOVEEND_PROTECT_LIKE_EFFECT: case MOVEEND_PROTECT_LIKE_EFFECT:
if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) if (gProtectStructs[gBattlerAttacker].touchedProtectLike)
{ {
if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
{ {
gProtectStructs[gBattlerAttacker].touchedProtectLike = 0;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
@ -4762,6 +4780,7 @@ static void Cmd_moveend(void)
} }
else if (gProtectStructs[gBattlerTarget].kingsShielded) else if (gProtectStructs[gBattlerTarget].kingsShielded)
{ {
gProtectStructs[gBattlerAttacker].touchedProtectLike = 0;
i = gBattlerAttacker; i = gBattlerAttacker;
gBattlerAttacker = gBattlerTarget; gBattlerAttacker = gBattlerTarget;
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
@ -4772,6 +4791,7 @@ static void Cmd_moveend(void)
} }
else if (gProtectStructs[gBattlerTarget].banefulBunkered) else if (gProtectStructs[gBattlerTarget].banefulBunkered)
{ {
gProtectStructs[gBattlerAttacker].touchedProtectLike = 0;
gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER; gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER); PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER);
BattleScriptPushCursor(); BattleScriptPushCursor();
@ -7317,9 +7337,14 @@ static void Cmd_various(void)
return; return;
case VARIOUS_JUMP_IF_NO_HOLD_EFFECT: case VARIOUS_JUMP_IF_NO_HOLD_EFFECT:
if (GetBattlerHoldEffect(gActiveBattler, TRUE) != gBattlescriptCurrInstr[3]) if (GetBattlerHoldEffect(gActiveBattler, TRUE) != gBattlescriptCurrInstr[3])
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4);
}
else else
{
gLastUsedItem = gBattleMons[gActiveBattler].item; // For B_LAST_USED_ITEM
gBattlescriptCurrInstr += 8; gBattlescriptCurrInstr += 8;
}
return; return;
case VARIOUS_JUMP_IF_NO_ALLY: case VARIOUS_JUMP_IF_NO_ALLY:
if (!IsBattlerAlive(BATTLE_PARTNER(gActiveBattler))) if (!IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)))
@ -8290,7 +8315,8 @@ static void Cmd_various(void)
} }
else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_BURN) else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_BURN)
{ {
if (GetBattlerAbility(gBattlerTarget) == ABILITY_WATER_VEIL) if (GetBattlerAbility(gBattlerTarget) == ABILITY_WATER_VEIL
|| GetBattlerAbility(gBattlerTarget) == ABILITY_WATER_BUBBLE)
{ {
gBattlerAbility = gBattlerTarget; gBattlerAbility = gBattlerTarget;
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3)); BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));
@ -12048,7 +12074,8 @@ bool32 DoesDisguiseBlockMove(u8 battlerAtk, u8 battlerDef, u32 move)
if (GetBattlerAbility(battlerDef) != ABILITY_DISGUISE if (GetBattlerAbility(battlerDef) != ABILITY_DISGUISE
|| gBattleMons[battlerDef].species != SPECIES_MIMIKYU || gBattleMons[battlerDef].species != SPECIES_MIMIKYU
|| gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED || gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED
|| gBattleMoves[move].power == 0) || gBattleMoves[move].power == 0
|| gHitMarker & HITMARKER_IGNORE_DISGUISE)
return FALSE; return FALSE;
else else
return TRUE; return TRUE;

View File

@ -859,7 +859,7 @@ void HandleAction_ActionFinished(void)
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000 | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_x4000000); | HITMARKER_CHARGING | HITMARKER_x4000000 | HITMARKER_IGNORE_DISGUISE);
gCurrentMove = 0; gCurrentMove = 0;
gBattleMoveDamage = 0; gBattleMoveDamage = 0;
@ -4864,6 +4864,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_WATER_VEIL && GetBattlerAbility(gBattlerAttacker) != ABILITY_WATER_VEIL
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_WATER_BUBBLE
&& !(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY) && !(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY)
&& !IsAbilityStatusProtected(gBattlerAttacker) && !IsAbilityStatusProtected(gBattlerAttacker)
&& (Random() % 3) == 0) && (Random() % 3) == 0)
@ -5071,6 +5072,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
} }
break; break;
case ABILITY_WATER_VEIL: case ABILITY_WATER_VEIL:
case ABILITY_WATER_BUBBLE:
if (gBattleMons[battler].status1 & STATUS1_BURN) if (gBattleMons[battler].status1 & STATUS1_BURN)
{ {
StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn);
@ -5654,8 +5656,11 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
switch (battlerHoldEffect) switch (battlerHoldEffect)
{ {
case HOLD_EFFECT_DOUBLE_PRIZE: case HOLD_EFFECT_DOUBLE_PRIZE:
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) if (GetBattlerSide(battlerId) == B_SIDE_PLAYER && !gBattleStruct->moneyMultiplierItem)
{
gBattleStruct->moneyMultiplier *= 2; gBattleStruct->moneyMultiplier *= 2;
gBattleStruct->moneyMultiplierItem = 1;
}
break; break;
case HOLD_EFFECT_RESTORE_STATS: case HOLD_EFFECT_RESTORE_STATS:
for (i = 0; i < NUM_BATTLE_STATS; i++) for (i = 0; i < NUM_BATTLE_STATS; i++)
@ -7313,12 +7318,12 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
basePower = 150; basePower = 150;
break; break;
case EFFECT_ECHOED_VOICE: case EFFECT_ECHOED_VOICE:
if (gFieldTimers.echoVoiceCounter != 0) // gBattleStruct->sameMoveTurns incremented in ppreduce
if (gBattleStruct->sameMoveTurns[battlerAtk] != 0)
{ {
if (gFieldTimers.echoVoiceCounter >= 5) basePower += (basePower * gBattleStruct->sameMoveTurns[battlerAtk]);
basePower *= 5; if (basePower > 200)
else basePower = 200;
basePower *= gFieldTimers.echoVoiceCounter;
} }
break; break;
case EFFECT_PAYBACK: case EFFECT_PAYBACK:

View File

@ -5711,7 +5711,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.type = TYPE_FIGHTING, .type = TYPE_FIGHTING,
.accuracy = 90, .accuracy = 90,
.pp = 10, .pp = 10,
.secondaryEffectChance = 0, .secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST,
@ -9767,8 +9767,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.type = TYPE_WATER, .type = TYPE_WATER,
.accuracy = 100, .accuracy = 100,
.pp = 10, .pp = 10,
.secondaryEffectChance = 0, .secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_FOES_AND_ALLY,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
@ -9782,7 +9782,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.type = TYPE_ICE, .type = TYPE_ICE,
.accuracy = 90, .accuracy = 90,
.pp = 10, .pp = 10,
.secondaryEffectChance = 0, .secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST,
@ -10289,7 +10289,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 20, .secondaryEffectChance = 20,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },

View File

@ -4313,7 +4313,13 @@ static bool8 IsItemFlute(u16 item)
static bool8 ExecuteTableBasedItemEffect_(u8 partyMonIndex, u16 item, u8 monMoveIndex) static bool8 ExecuteTableBasedItemEffect_(u8 partyMonIndex, u16 item, u8 monMoveIndex)
{ {
if (gMain.inBattle) if (gMain.inBattle)
return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, GetPartyIdFromBattleSlot(partyMonIndex), monMoveIndex); {
if ((partyMonIndex == 0 && gStatuses3[B_POSITION_PLAYER_LEFT] & STATUS3_EMBARGO)
|| (partyMonIndex == 1 && gStatuses3[B_POSITION_PLAYER_RIGHT] & STATUS3_EMBARGO))
return TRUE; // cannot use on this mon
else
return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, GetPartyIdFromBattleSlot(partyMonIndex), monMoveIndex);
}
else else
return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, partyMonIndex, monMoveIndex); return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, partyMonIndex, monMoveIndex);
} }