Added Well Baked Body's effect and misc. changes

-Added a modifybattlerstatstage macro to handle stat stages in battle.
-Rewrote the checks inside the case ABILITYEFFECT_MOVES_BLOCK of AbilityBattleEffects.
This commit is contained in:
LOuroboros 2022-12-03 02:04:33 -03:00
parent eb082cd1a2
commit ca656b63b9
4 changed files with 80 additions and 32 deletions

View File

@ -2157,3 +2157,34 @@
.macro trysymbiosis
various BS_ATTACKER, VARIOUS_TRY_SYMBIOSIS
.endm
@ Tries to increase or decrease a battler's stat's stat stage by a specified amount. If impossible, jumps to \script.
.macro modifybattlerstatstage battler:req, stat:req, mode:req, amount:req, script:req, animation:req, customString
@ \mode parameters
INCREASE = FALSE
DECREASE = TRUE
@ \animation parameters
ANIM_OFF = FALSE
ANIM_ON = TRUE
setstatchanger \stat, \amount, \mode
statbuffchange STAT_CHANGE_ALLOW_PTR, \script
setgraphicalstatchangevalues
.if \animation == TRUE
playanimation \battler, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
.endif
.ifnb \customString
printstring \customString
.else
.if \mode == DECREASE
printfromtable gStatDownStringIds
.else
.if \mode == INCREASE
printfromtable gStatUpStringIds
.endif
.endif
.endif
waitmessage B_WAIT_TIME_LONG
.endm

View File

@ -9800,6 +9800,18 @@ BattleScript_DarkTypePreventsPrankster::
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
goto BattleScript_MoveEnd
BattleScript_WellBakedBodyActivates::
attackstring
ppreduce
showabilitypopup BS_TARGET
pause B_WAIT_TIME_MED
printstring STRINGID_ITDOESNTAFFECT
waitmessage B_WAIT_TIME_MED
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
modifybattlerstatstage BS_TARGET, STAT_DEF, INCREASE, 1, BattleScript_WellBakedBodyEnd, ANIM_ON
BattleScript_WellBakedBodyEnd:
goto BattleScript_MoveEnd
BattleScript_PastelVeilActivates::
setbyte gBattleCommunication, 0
setbyte gBattleCommunication + 1, 0

View File

@ -435,6 +435,7 @@ extern const u8 BattleScript_BurnUpRemoveType[];
extern const u8 BattleScript_TargetAbilityStatRaiseRet[];
extern const u8 BattleScript_SeedSowerActivates[];
extern const u8 BattleScript_AngerShellActivates[];
extern const u8 BattleScript_WellBakedBodyActivates[];
// zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[];

View File

@ -5081,6 +5081,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITYEFFECT_MOVES_BLOCK: // 2
{
u16 moveTarget = GetBattlerMoveTargetType(battler, move);
u16 battlerAbility = GetBattlerAbility(battler);
u16 targetAbility = GetBattlerAbility(gBattlerTarget);
if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(moveTarget & MOVE_TARGET_USER))
|| (gLastUsedAbility == ABILITY_BULLETPROOF && gBattleMoves[move].flags & FLAG_BALLISTIC))
@ -5090,10 +5092,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
gBattlescriptCurrInstr = BattleScript_SoundproofProtected;
effect = 1;
}
else if ((((gLastUsedAbility == ABILITY_DAZZLING || gLastUsedAbility == ABILITY_QUEENLY_MAJESTY
|| (IsBattlerAlive(battler ^= BIT_FLANK)
&& ((GetBattlerAbility(battler) == ABILITY_DAZZLING) || GetBattlerAbility(battler) == ABILITY_QUEENLY_MAJESTY)))
))
else if ((gLastUsedAbility == ABILITY_DAZZLING || gLastUsedAbility == ABILITY_QUEENLY_MAJESTY || IsBattlerAlive(battler ^= BIT_FLANK))
&& (battlerAbility == ABILITY_DAZZLING || battlerAbility == ABILITY_QUEENLY_MAJESTY)
&& GetChosenMovePriority(gBattlerAttacker) > 0
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(battler))
{
@ -5102,8 +5102,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
gBattlescriptCurrInstr = BattleScript_DazzlingProtected;
effect = 1;
}
else if (BlocksPrankster(move, gBattlerAttacker, gBattlerTarget, TRUE)
&& !(IS_MOVE_STATUS(move) && GetBattlerAbility(gBattlerTarget) == ABILITY_MAGIC_BOUNCE))
else if (BlocksPrankster(move, gBattlerAttacker, gBattlerTarget, TRUE) && !(IS_MOVE_STATUS(move) && targetAbility == ABILITY_MAGIC_BOUNCE))
{
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)))
CancelMultiTurnMoves(gBattlerAttacker); // Don't cancel moves that can hit two targets bc one target might not be protected
@ -5111,6 +5110,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
gBattlescriptCurrInstr = BattleScript_DarkTypePreventsPrankster;
effect = 1;
}
else if (targetAbility == ABILITY_WELL_BAKED_BODY && gBattleMoves[gCurrentMove].type == TYPE_FIRE)
{
gBattlescriptCurrInstr = BattleScript_WellBakedBodyActivates;
effect = 1;
}
break;
}
case ABILITYEFFECT_ABSORBING: // 3