merge w be

This commit is contained in:
ghoulslash 2021-11-06 10:40:57 -04:00
commit 41bf1dc2f4
73 changed files with 1652 additions and 591 deletions

View File

@ -1838,6 +1838,10 @@
.macro trytoclearprimalweather .macro trytoclearprimalweather
various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER
.endm .endm
.macro setattackertostickywebuser
various BS_TARGET, VARIOUS_SET_ATTACKER_STICKY_WEB_USER
.endm
.macro getrototillertargets ptr:req .macro getrototillertargets ptr:req
various BS_ATTACKER, VARIOUS_GET_ROTOTILLER_TARGETS various BS_ATTACKER, VARIOUS_GET_ROTOTILLER_TARGETS
@ -1861,6 +1865,12 @@
.macro applyplasmafists .macro applyplasmafists
various BS_ATTACKER, VARIOUS_APPLY_PLASMA_FISTS various BS_ATTACKER, VARIOUS_APPLY_PLASMA_FISTS
.endm .endm
.macro jumpifweatheraffected battler:req, weather:req, ptr:req
various \battler, VARIOUS_JUMP_IF_WEATHER_AFFECTED
.4byte \weather
.4byte \ptr
.endm
.macro jumpifspecies battler:req, species:req, ptr:req .macro jumpifspecies battler:req, species:req, ptr:req
various \battler, VARIOUS_JUMP_IF_SPECIES various \battler, VARIOUS_JUMP_IF_SPECIES
@ -1872,6 +1882,19 @@
various \battler, VARIOUS_TRY_END_NEUTRALIZING_GAS various \battler, VARIOUS_TRY_END_NEUTRALIZING_GAS
.endm .endm
.macro trytoapplymimicry battler:req, ptr:req
various \battler, VARIOUS_TRY_TO_APPLY_MIMICRY
.4byte \ptr
.endm
.macro photongeysercheck
various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK
.endm
.macro shellsidearmcheck
various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK
.endm
@ helpful macros @ helpful macros
.macro setstatchanger stat:req, stages:req, down:req .macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7
@ -1991,10 +2014,9 @@
goto \jumpptr goto \jumpptr
.endm .endm
.macro jumpifleafguard jumpptr:req .macro jumpifleafguardprotected battler:req, jumpptr:req
jumpifhalfword CMP_NO_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, 1f various \battler, VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED
jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr .4byte \jumpptr
1:
.endm .endm
.macro jumpifsafeguard jumpptr:req .macro jumpifsafeguard jumpptr:req

View File

@ -1893,7 +1893,7 @@ Move_AURA_SPHERE:
monbg ANIM_ATK_PARTNER monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER monbgprio_28 ANIM_ATTACKER
setalpha 12, 8 setalpha 12, 8
call SetHighSpeedBg call SetAuraSphereBG
playsewithpan SE_M_SKY_UPPERCUT, 0 playsewithpan SE_M_SKY_UPPERCUT, 0
delay 60 delay 60
createsprite gAuraSphereBlast, ANIM_TARGET, 3, 0 createsprite gAuraSphereBlast, ANIM_TARGET, 3, 0
@ -1908,6 +1908,10 @@ Move_AURA_SPHERE:
delay 1 delay 1
end end
SetAuraSphereBG:
fadetobg BG_AURA_SPHERE
goto SetHighSpeedBgFade
Move_ROCK_POLISH: Move_ROCK_POLISH:
loadspritegfx ANIM_TAG_WHITE_STREAK loadspritegfx ANIM_TAG_WHITE_STREAK
loadspritegfx ANIM_TAG_SPARKLE_3 loadspritegfx ANIM_TAG_SPARKLE_3
@ -2378,7 +2382,7 @@ Move_FOCUS_BLAST:
monbg ANIM_ATK_PARTNER monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER monbgprio_28 ANIM_ATTACKER
setalpha 12, 8 setalpha 12, 8
call SetHighSpeedBg call SetFocusBlastBG
createsprite gSuperpowerOrbSpriteTemplate, ANIM_TARGET, 2, 0 createsprite gSuperpowerOrbSpriteTemplate, ANIM_TARGET, 2, 0
playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER
waitforvisualfinish waitforvisualfinish
@ -2391,6 +2395,10 @@ Move_FOCUS_BLAST:
delay 1 delay 1
end end
SetFocusBlastBG:
fadetobg BG_FOCUS_BLAST
goto SetHighSpeedBgFade
Move_ENERGY_BALL: Move_ENERGY_BALL:
loadspritegfx ANIM_TAG_ENERGY_BALL loadspritegfx ANIM_TAG_ENERGY_BALL
monbg ANIM_TARGET monbg ANIM_TARGET
@ -3437,6 +3445,7 @@ Move_GUNK_SHOT:
monbg ANIM_DEF_PARTNER monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET monbgprio_28 ANIM_TARGET
setalpha 12, 8 setalpha 12, 8
call SetGunkShotBG
createvisualtask AnimTask_ShakeMon 5, 5, ANIM_ATTACKER, 0, 2, 40, 1 createvisualtask AnimTask_ShakeMon 5, 5, ANIM_ATTACKER, 0, 2, 40, 1
delay 6 delay 6
panse_1B SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 panse_1B SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0
@ -3464,6 +3473,7 @@ Move_GUNK_SHOT:
call GunkShotImpact call GunkShotImpact
call PoisonBubblesEffect call PoisonBubblesEffect
waitforvisualfinish waitforvisualfinish
call UnsetHighSpeedBg
clearmonbg ANIM_DEF_PARTNER clearmonbg ANIM_DEF_PARTNER
blendoff blendoff
end end
@ -3479,6 +3489,10 @@ GunkShotImpact:
createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, 15, 1, 1 createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, 15, 1, 1
createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, -15, 1, 1 createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, -15, 1, 1
return return
SetGunkShotBG:
fadetobg BG_GUNK_SHOT
goto SetHighSpeedBgFade
Move_IRON_HEAD: Move_IRON_HEAD:
loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_GUST
@ -6636,7 +6650,7 @@ Move_HURRICANE:
monbg ANIM_DEF_PARTNER monbg ANIM_DEF_PARTNER
monbgprio_28 ANIM_TARGET monbgprio_28 ANIM_TARGET
setalpha 12, 8 setalpha 12, 8
fadetobg BG_HIGH_SPEED fadetobg BG_HURRICANE
waitbgfadeout waitbgfadeout
launchtask AnimTask_StartSlidingBg 0x5 0x4 0x1000 0x0 0x1 0xffff launchtask AnimTask_StartSlidingBg 0x5 0x4 0x1000 0x0 0x1 0xffff
waitbgfadein waitbgfadein
@ -14012,7 +14026,50 @@ Move_METEOR_BEAM::
end @to do: end @to do:
Move_SHELL_SIDE_ARM:: Move_SHELL_SIDE_ARM::
end @to do: launchtask AnimTask_ShellSideArm 0x5 0x0
jumpargeq 0x0, TRUE, Move_SHELL_SIDE_ARM_PHYSICAL
jumpargeq 0x0, FALSE, Move_SHELL_SIDE_ARM_SPECIAL
Move_SHELL_SIDE_ARM_PHYSICAL: @ Modified Body Slam, placeholder
loadspritegfx ANIM_TAG_IMPACT
createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_IMPACT, 0, 6, 6, RGB_MAGENTA
monbg ANIM_DEF_PARTNER
setalpha 12, 8
playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER
createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 6, 1, ANIM_ATTACKER
waitforvisualfinish
delay 11
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 26, 0, 0, 5
delay 6
createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, -10, 0, ANIM_TARGET, 0
loopsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET, 10, 2
delay 1
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -28, 0, 0, 3
waitforvisualfinish
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1
waitforvisualfinish
delay 10
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 6
delay 5
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 6
waitforvisualfinish
clearmonbg ANIM_DEF_PARTNER
blendoff
end
Move_SHELL_SIDE_ARM_SPECIAL: @ Modified Snipe Shot, placeholder
loadspritegfx ANIM_TAG_IMPACT_2
loadspritegfx ANIM_TAG_LEER
createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_IMPACT_2, 0, 6, 6, RGB_MAGENTA
createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_LEER, 0, 6, 6, RGB_MAGENTA
launchtemplate gLeerSpriteTemplate 0x82, 2 0x18 -12
playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER
waitforvisualfinish
delay 0x20
playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET
launchtemplate gSnipeShotBallTemplate 0x82, 3, 0 0 24,
waitforvisualfinish
launchtask AnimTask_ShakeMon2 2 5 1 4 0 8, 1
waitforvisualfinish
end
Move_MISTY_EXPLOSION:: Move_MISTY_EXPLOSION::
end @to do: end @to do:
@ -24023,6 +24080,7 @@ General_TurnTrap:
jumpargeq 0, TRAP_ANIM_WHIRLPOOL, Status_Whirlpool jumpargeq 0, TRAP_ANIM_WHIRLPOOL, Status_Whirlpool
jumpargeq 0, TRAP_ANIM_CLAMP, Status_Clamp jumpargeq 0, TRAP_ANIM_CLAMP, Status_Clamp
jumpargeq 0, TRAP_ANIM_SAND_TOMB, Status_SandTomb jumpargeq 0, TRAP_ANIM_SAND_TOMB, Status_SandTomb
jumpargeq 0, TRAP_ANIM_MAGMA_STORM, Status_MagmaStorm
jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation
goto Status_BindWrap goto Status_BindWrap
Status_BindWrap: Status_BindWrap:
@ -24049,6 +24107,32 @@ Status_FireSpin:
stopsound stopsound
end end
Status_MagmaStorm:
loadspritegfx ANIM_TAG_SMALL_EMBER
fadetobg BG_MAGMA_STORM
waitbgfadeout
createvisualtask AnimTask_MoveSeismicTossBg, 3
playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET
loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET, 5, 8
createvisualtask AnimTask_SeismicTossBgAccelerateDownAtEnd, 3
createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1
createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7)
call FireSpinEffect
call FireSpinEffect
createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7)
call FireSpinEffect
call FireSpinEffect
createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7)
call FireSpinEffect
restorebg
waitbgfadeout
setarg 7, 0xFFF
waitbgfadein
stopsound
clearmonbg ANIM_DEF_PARTNER
blendoff
end
Status_Whirlpool: Status_Whirlpool:
loadspritegfx ANIM_TAG_WATER_ORB loadspritegfx ANIM_TAG_WATER_ORB
monbg ANIM_DEF_PARTNER monbg ANIM_DEF_PARTNER

View File

@ -367,7 +367,7 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectGeomancy @ EFFECT_GEOMANCY .4byte BattleScript_EffectGeomancy @ EFFECT_GEOMANCY
.4byte BattleScript_EffectFairyLock @ EFFECT_FAIRY_LOCK .4byte BattleScript_EffectFairyLock @ EFFECT_FAIRY_LOCK
.4byte BattleScript_EffectAllySwitch @ EFFECT_ALLY_SWITCH .4byte BattleScript_EffectAllySwitch @ EFFECT_ALLY_SWITCH
.4byte BattleScript_EffectSleepHit @ EFFECT_SLEEP_HIT .4byte BattleScript_EffectRelicSong @ EFFECT_RELIC_SONG
.4byte BattleScript_EffectAttackerDefenseDownHit @ EFFECT_ATTACKER_DEFENSE_DOWN_HIT .4byte BattleScript_EffectAttackerDefenseDownHit @ EFFECT_ATTACKER_DEFENSE_DOWN_HIT
.4byte BattleScript_EffectHit @ EFFECT_BODY_PRESS .4byte BattleScript_EffectHit @ EFFECT_BODY_PRESS
.4byte BattleScript_EffectEerieSpell @ EFFECT_EERIE_SPELL .4byte BattleScript_EffectEerieSpell @ EFFECT_EERIE_SPELL
@ -392,10 +392,49 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectSparklySwirl @ EFFECT_SPARKLY_SWIRL .4byte BattleScript_EffectSparklySwirl @ EFFECT_SPARKLY_SWIRL
.4byte BattleScript_EffectPlasmaFists @ EFFECT_PLASMA_FISTS .4byte BattleScript_EffectPlasmaFists @ EFFECT_PLASMA_FISTS
.4byte BattleScript_EffectHyperspaceFury @ EFFECT_HYPERSPACE_FURY .4byte BattleScript_EffectHyperspaceFury @ EFFECT_HYPERSPACE_FURY
.4byte BattleScript_EffectAuraWheel @ EFFECT_AURA_WHEEL
.4byte BattleScript_EffectPhotonGeyser @ EFFECT_PHOTON_GEYSER
.4byte BattleScript_EffectShellSideArm @ EFFECT_SHELL_SIDE_ARM
BattleScript_EffectShellSideArm:
shellsidearmcheck
setmoveeffect MOVE_EFFECT_POISON
goto BattleScript_EffectHit
BattleScript_EffectPhotonGeyser:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
photongeysercheck
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
goto BattleScript_MoveEnd
BattleScript_EffectAuraWheel: @ Aura Wheel can only be used by Morpeko
jumpifspecies BS_ATTACKER, SPECIES_MORPEKO, BattleScript_EffectSpeedUpHit
jumpifspecies BS_ATTACKER, SPECIES_MORPEKO_HANGRY, BattleScript_EffectSpeedUpHit
printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectHyperspaceFury: BattleScript_EffectHyperspaceFury:
jumpifspecies BS_ATTACKER, SPECIES_TREECKO, BattleScript_EffectHyperspaceFuryUnbound jumpifspecies BS_ATTACKER, SPECIES_HOOPA_UNBOUND, BattleScript_EffectHyperspaceFuryUnbound
jumpifspecies BS_ATTACKER, SPECIES_MUDKIP, BattleScript_ButHoopaCantUseIt jumpifspecies BS_ATTACKER, SPECIES_HOOPA, BattleScript_ButHoopaCantUseIt
printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
@ -734,9 +773,30 @@ BattleScript_EffectAttackerDefenseDownHit:
setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
goto BattleScript_EffectHit goto BattleScript_EffectHit
BattleScript_EffectSleepHit: BattleScript_EffectRelicSong:
setmoveeffect MOVE_EFFECT_SLEEP setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
goto BattleScript_EffectHit attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
seteffectwithchance
argumentstatuseffect
tryfaintmon BS_TARGET, FALSE, NULL
goto BattleScript_MoveEnd
BattleScript_EffectAllySwitch: BattleScript_EffectAllySwitch:
attackcanceler attackcanceler
@ -1672,7 +1732,7 @@ BattleScript_GrowthDoMoveAnim::
waitanimation waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0 playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, BattleScript_GrowthAtk2 jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_GrowthAtk2
setstatchanger STAT_ATK, 1, FALSE setstatchanger STAT_ATK, 1, FALSE
goto BattleScript_GrowthAtk goto BattleScript_GrowthAtk
BattleScript_GrowthAtk2: BattleScript_GrowthAtk2:
@ -1683,7 +1743,7 @@ BattleScript_GrowthAtk:
printfromtable gStatUpStringIds printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
BattleScript_GrowthTrySpAtk:: BattleScript_GrowthTrySpAtk::
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, BattleScript_GrowthSpAtk2 jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_GrowthSpAtk2
setstatchanger STAT_SPATK, 1, FALSE setstatchanger STAT_SPATK, 1, FALSE
goto BattleScript_GrowthSpAtk goto BattleScript_GrowthSpAtk
BattleScript_GrowthSpAtk2: BattleScript_GrowthSpAtk2:
@ -1908,6 +1968,23 @@ BattleScript_EffectPsychicTerrain:
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL
call BattleScript_TerrainSeedLoop call BattleScript_TerrainSeedLoop
jumpifabilitypresent ABILITY_MIMICRY, BattleScript_ApplyMimicry
goto BattleScript_MoveEnd
BattleScript_ApplyMimicry::
savetarget
setbyte gBattlerTarget, 0
BattleScript_MimicryLoopIter:
copybyte sBATTLER, gBattlerTarget
trytoapplymimicry BS_TARGET, BattleScript_MimicryLoop_NextBattler
copybyte gBattlerAbility, sBATTLER
call BattleScript_AbilityPopUp
printstring STRINGID_BATTLERTYPECHANGEDTO
waitmessage B_WAIT_TIME_LONG
BattleScript_MimicryLoop_NextBattler:
addbyte gBattlerTarget, 0x1
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_MimicryLoopIter
restoretarget
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_EffectTopsyTurvy: BattleScript_EffectTopsyTurvy:
@ -2514,7 +2591,7 @@ BattleScript_EffectSleep::
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents
@ -2583,6 +2660,18 @@ BattleScript_AromaVeilProtects:
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_PastelVeilProtectsRet::
pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp
printstring STRINGID_PASTELVEILPROTECTED
waitmessage B_WAIT_TIME_LONG
return
BattleScript_PastelVeilProtects:
call BattleScript_PastelVeilProtectsRet
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
goto BattleScript_MoveEnd
BattleScript_LeafGuardProtectsRet:: BattleScript_LeafGuardProtectsRet::
pause B_WAIT_TIME_SHORT pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
@ -2891,6 +2980,34 @@ BattleScript_StatDownPrintString::
BattleScript_StatDownEnd:: BattleScript_StatDownEnd::
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_MirrorArmorReflect::
pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp
jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss
BattleScript_MirrorArmorReflectStatLoss:
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim
goto BattleScript_MirrorArmorReflectWontFall
BattleScript_MirrorArmorReflectAnim:
setgraphicalstatchangevalues
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
BattleScript_MirrorArmorReflectPrintString:
printfromtable gStatDownStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_MirrorArmorReflectEnd:
return
BattleScript_MirrorArmorReflectWontFall:
copybyte gBattlerTarget, gBattlerAttacker @ STRINGID_STATSWONTDECREASE uses target
goto BattleScript_MirrorArmorReflectPrintString
@ gBattlerTarget is battler with Mirror Armor
BattleScript_MirrorArmorReflectStickyWeb:
call BattleScript_AbilityPopUp
setattackertostickywebuser
jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_StickyWebOnSwitchInEnd @ Sticky web user not on field -> no stat loss
goto BattleScript_MirrorArmorReflectStatLoss
BattleScript_StatDown:: BattleScript_StatDown::
playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatDownStringIds printfromtable gStatDownStringIds
@ -3055,8 +3172,9 @@ BattleScript_EffectToxic::
ppreduce ppreduce
jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned
@ -3082,6 +3200,7 @@ BattleScript_AlreadyPoisoned::
BattleScript_ImmunityProtected:: BattleScript_ImmunityProtected::
copybyte gEffectBattler, gBattlerTarget copybyte gEffectBattler, gBattlerTarget
call BattleScript_AbilityPopUp
setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS
call BattleScript_PSNPrevention call BattleScript_PSNPrevention
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
@ -3410,8 +3529,9 @@ BattleScript_EffectPoison::
ppreduce ppreduce
jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned
@ -3436,7 +3556,7 @@ BattleScript_EffectParalyze:
jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
.if B_GLARE_GHOST >= GEN_4 .if B_GLARE_GHOST >= GEN_4
@ -4559,9 +4679,7 @@ BattleScript_EffectGust::
goto BattleScript_EffectHit goto BattleScript_EffectHit
BattleScript_EffectSolarbeam:: BattleScript_EffectSolarbeam::
jumpifabilitypresent ABILITY_CLOUD_NINE, BattleScript_SolarbeamDecideTurn jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_SolarbeamOnFirstTurn
jumpifabilitypresent ABILITY_AIR_LOCK, BattleScript_SolarbeamDecideTurn
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT, BattleScript_SolarbeamOnFirstTurn
BattleScript_SolarbeamDecideTurn:: BattleScript_SolarbeamDecideTurn::
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn
@ -4878,7 +4996,7 @@ BattleScript_EffectWillOWisp::
jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, 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 jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents
@ -5156,7 +5274,7 @@ BattleScript_EffectYawn::
jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
jumpifsafeguard BattleScript_SafeguardProtected jumpifsafeguard BattleScript_SafeguardProtected
@ -6368,6 +6486,7 @@ BattleScript_StickyWebOnSwitchIn::
copybyte gBattlerTarget, sBATTLER copybyte gBattlerTarget, sBATTLER
printstring STRINGID_STICKYWEBSWITCHIN printstring STRINGID_STICKYWEBSWITCHIN
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
jumpifability BS_TARGET, ABILITY_MIRROR_ARMOR, BattleScript_MirrorArmorReflectStickyWeb
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StickyWebOnSwitchInEnd statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StickyWebOnSwitchInEnd
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StickyWebOnSwitchInStatAnim jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StickyWebOnSwitchInStatAnim
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StickyWebOnSwitchInEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StickyWebOnSwitchInEnd
@ -6932,6 +7051,7 @@ BattleScript_AttackerFormChange::
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
waitmessage 1 waitmessage 1
BattleScript_AttackerFormChangeNoPopup::
handleformchange BS_ATTACKER, 0 handleformchange BS_ATTACKER, 0
handleformchange BS_ATTACKER, 1 handleformchange BS_ATTACKER, 1
playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL
@ -6943,6 +7063,21 @@ BattleScript_AttackerFormChangeEnd3::
call BattleScript_AttackerFormChange call BattleScript_AttackerFormChange
end3 end3
BattleScript_AttackerFormChangeEnd3NoPopup::
call BattleScript_AttackerFormChangeNoPopup
BattleScript_AttackerFormChangeMoveEffect::
waitmessage 1
handleformchange BS_ATTACKER, 0
handleformchange BS_ATTACKER, 1
playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL
waitanimation
copybyte sBATTLER, gBattlerAttacker
printstring STRINGID_PKMNTRANSFORMED
waitmessage B_WAIT_TIME_LONG
handleformchange BS_ATTACKER, 2
end3
BattleScript_BallFetch:: BattleScript_BallFetch::
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
printstring STRINGID_FETCHEDPOKEBALL printstring STRINGID_FETCHEDPOKEBALL
@ -7942,6 +8077,7 @@ BattleScript_GrassyTerrainHealEnd:
BattleScript_AbilityNoSpecificStatLoss:: BattleScript_AbilityNoSpecificStatLoss::
pause B_WAIT_TIME_SHORT pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
BattleScript_AbilityNoSpecificStatLossPrint:
printstring STRINGID_PKMNSXPREVENTSYLOSS printstring STRINGID_PKMNSXPREVENTSYLOSS
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY
@ -7961,6 +8097,12 @@ BattleScript_ColorChangeActivates::
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
return return
BattleScript_MimicryActivatesEnd3::
call BattleScript_AbilityPopUp
printstring STRINGID_BATTLERTYPECHANGEDTO
waitmessage B_WAIT_TIME_LONG
end3
BattleScript_ProteanActivates:: BattleScript_ProteanActivates::
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
printstring STRINGID_PKMNCHANGEDTYPE printstring STRINGID_PKMNCHANGEDTYPE
@ -8222,6 +8364,13 @@ BattleScript_CuteCharmActivates::
call BattleScript_TryDestinyKnotTarget call BattleScript_TryDestinyKnotTarget
return return
BattleScript_GooeyActivates::
waitstate
call BattleScript_AbilityPopUp
swapattackerwithtarget @ for defiant, mirror armor
seteffectsecondary
return
BattleScript_AbilityStatusEffect:: BattleScript_AbilityStatusEffect::
waitstate waitstate
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
@ -8952,6 +9101,30 @@ BattleScript_DarkTypePreventsPrankster::
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_PastelVeilActivates::
setbyte gBattleCommunication, 0
setbyte gBattleCommunication + 1, 0
BattleScript_PastelVeil_TryCurePoison:
jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_PastelVeilCurePoison
goto BattleScript_PastelVeilLoopIncrement
BattleScript_PastelVeilCurePoison:
jumpifbyte CMP_NOT_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_PastelVeilCurePoisonNoPopUp
call BattleScript_AbilityPopUp
setbyte gBattleCommunication + 1, 1
BattleScript_PastelVeilCurePoisonNoPopUp: @ Only show Pastel Veil pop up once if it cures two mons
printfromtable gSwitchInAbilityStringIds
waitmessage B_WAIT_TIME_LONG
curestatus BS_TARGET
updatestatusicon BS_TARGET
BattleScript_PastelVeilLoopIncrement:
jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_PastelVeilEnd
addbyte gBattleCommunication, 1
jumpifnoally BS_TARGET, BattleScript_PastelVeilEnd
setallytonexttarget BattleScript_PastelVeil_TryCurePoison
goto BattleScript_PastelVeilEnd
BattleScript_PastelVeilEnd:
end3
sByteFour: sByteFour:
.byte MAX_BATTLERS_COUNT .byte MAX_BATTLERS_COUNT

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
0 0 0
131 131 131
123 123 123
115 115 115
106 106 106
98 98 98
82 82 82
65 65 65
49 49 49
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -2,14 +2,14 @@ JASC-PAL
0100 0100
16 16
0 0 0 0 0 0
131 131 131 48 48 48
123 123 123 72 72 72
115 115 115 88 88 88
106 106 106 120 120 120
98 98 98 0 0 0
82 82 82 0 0 0
65 65 65 0 0 0
49 49 49 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 984 B

View File

@ -1,2 +0,0 @@
                                                                                            
                                                               ! " # $ % & ' ( ) * + , - . / 0 1 2 3 3 3 3 3 3 4 5 6 7 7 8 9 : ; < = > ? @ A A A A B C D E F G D H A A A A A A I J K A A L M N O M M P M M Q Q R S T U V W S S S S S S S S S S S S S X Y Z [ [ [ [ [ [ [ [ \ \ \ \ ] ^ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ _ _ _ _ ` a b c _ d d d d e f e d d g h i j k l m n o p q r s t j$u v w x y z w${ | | | | | | } ~ <20> ƒ „ … „$† } ‡ ˆ ‰ Š ˆ Œ <20> Ž <20> <20> $<24> ((((((“ ” • ˜ $™ ”$˜ š •$œ <20> ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

View File

@ -2,12 +2,12 @@ JASC-PAL
0100 0100
16 16
0 0 0 0 0 0
164 156 24 248 248 144
156 148 24 224 224 120
197 189 32 200 200 96
172 164 32 176 176 72
115 106 16 152 152 48
0 0 0 120 120 16
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

View File

@ -1,2 +0,0 @@
            
           $                      ! " # $ % & ' ( ) * + + , - . / 0 1 2 2 3 4 4 4 4 4 4 5 6 6 7 8 9 : ; < = = > ? @ A B C D E F F G H I I J K L M N N N O P P P P P Q R S S S S S T Q U V S W X X Y Z [ \ ] ] ] ] ] ^ _ ` a a b c d e f g g g g g h i i i i j k k l m n o p p p p p q m m m m r s t u v w x y z { { | } ~ ~  € € € <20> ~ ~ ƒ ƒ „ … … … † ‡ ˆ ‰ ‰ ‰ Š Š Œ <20> <20> <20> <20> Ž <20> <20> <20> <20> <20> “ “ ” <20>˜ ™ š œ œ œ œ <20> ž ž Ÿ             ¡ ž ž ¢ £ ¤ ¤ ¤ ¤ ¤ ¤ ¤ ¥ ¦ ¦ § ¨ ¨ ¨ ¨ © ª « ¬ ­ ® ¯ ¯ ° ± ± ± ± ± ± ± ² ³ ´ µ ¶ ¶ · ‰,‰,‰,‰,¸ ¹ ¹ ¹ ¹ ¹ ¹ º » ¼ ½ ¾ ¾ ¾ ¾ ¾ ¿ À Á Â Â Ã Ä Ä Å Â Â Æ Ç Ç Ç È s,t(É Ê Ê Ê Ë m,Ì Í Î Î Î Ï Ì Ð Ñ Ñ Ñ Ñ Ò Ó Ô Õ d,d,d,d,d,Ö × Ø Ù d,Ú Û Û Ü Ý Þ ß à á á á â ã ã ã ã ã ã ã ã ã ã ã ä å æ æ ç P,P,P,è é ê ê é$ë P,ì ì ì í î ï ð ð ð ð ð ð ñ ò ò ò ó ô õ õ õ õ õ õ õ ö 4,4,4,4,4,4,

View File

@ -1,19 +1,19 @@
JASC-PAL JASC-PAL
0100 0100
16 16
0 0 0 96 192 24
255 246 0 248 248 216
255 238 0 248 248 176
255 222 0 248 240 144
255 205 0 248 232 120
255 189 0 248 232 112
255 172 0 248 216 96
255 156 8 240 200 88
255 139 8 232 192 72
255 123 8 232 184 64
255 106 8 232 176 56
255 90 8 224 160 32
255 74 8 216 152 32
255 49 8 208 136 40
255 41 8 192 120 40
246 24 0 176 88 40

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
208 112 200
216 184 249
216 160 232
211 107 195
208 104 192
217 129 209
216 135 215
209 120 208
218 153 226
216 168 232
217 176 241
220 188 252
203 115 203
223 182 246
216 192 248

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
255 0 0
222 156 230
222 180 246
213 123 205
213 189 246
205 115 205
213 164 230
213 131 213
222 197 255
222 189 255
213 139 222
213 172 238
213 106 197
222 131 213
213 115 205
205 106 197

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
255 0 0
213 156 230
222 180 246
213 123 205
213 189 246
213 131 213
205 115 205
213 164 230
222 197 255
213 139 222
222 189 255
213 172 238
213 106 197
213 115 205
222 156 230
205 106 197

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -2,12 +2,12 @@ JASC-PAL
0100 0100
16 16
0 0 0 0 0 0
106 123 139 152 184 248
90 106 139 128 160 240
123 139 164 104 136 216
123 139 197 80 112 192
65 74 115 56 88 168
0 0 0 24 56 136
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -2,10 +2,10 @@ JASC-PAL
0100 0100
16 16
0 0 0 0 0 0
131 205 230 128 200 232
123 180 213 120 176 216
115 156 205 112 152 200
115 139 164 112 136 160
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 814 B

View File

@ -2,12 +2,12 @@ JASC-PAL
0100 0100
16 16
0 0 0 0 0 0
214 55 93 248 144 248
199 40 78 224 120 224
222 91 123 200 96 200
223 96 127 176 72 176
158 31 62 152 48 152
0 0 0 120 16 120
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
255 0 0
222 156 230
222 180 246
213 123 205
213 189 246
205 115 205
213 164 230
213 131 213
222 197 255
222 189 255
213 139 222
213 172 238
213 106 197
222 131 213
213 115 205
205 106 197

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
255 0 0
213 156 230
222 180 246
213 123 205
213 189 246
213 131 213
205 115 205
213 164 230
222 197 255
213 139 222
222 189 255
213 172 238
213 106 197
213 115 205
222 156 230
205 106 197

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -146,8 +146,8 @@ struct ProtectStruct
u32 powderSelfDmg:1; u32 powderSelfDmg:1;
u32 usedThroatChopPreventedMove:1; u32 usedThroatChopPreventedMove:1;
u32 statRaised:1; u32 statRaised:1;
u32 micle:1; u32 usedMicleBerry:1;
u32 custap:1; // also quick claw u32 usedCustapBerry:1; // also quick claw
u32 touchedProtectLike:1; u32 touchedProtectLike:1;
u32 disableEjectPack:1; u32 disableEjectPack:1;
u32 statFell:1; u32 statFell:1;
@ -615,6 +615,7 @@ struct BattleStruct
struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member) struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member)
u8 blunderPolicy:1; // should blunder policy activate u8 blunderPolicy:1; // should blunder policy activate
u8 ballSpriteIds[2]; // item gfx, window gfx u8 ballSpriteIds[2]; // item gfx, window gfx
u8 stickyWebUser;
}; };
#define GET_MOVE_TYPE(move, typeArg) \ #define GET_MOVE_TYPE(move, typeArg) \
@ -931,5 +932,6 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT];
extern bool8 gHasFetchedBall; extern bool8 gHasFetchedBall;
extern u8 gLastUsedBall; extern u8 gLastUsedBall;
extern u16 gLastThrownBall; extern u16 gLastThrownBall;
extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
#endif // GUARD_BATTLE_H #endif // GUARD_BATTLE_H

View File

@ -54,6 +54,7 @@ bool32 IsRecycleEncouragedItem(u16 item);
bool32 CanKnockOffItem(u8 battler, u16 item); bool32 CanKnockOffItem(u8 battler, u16 item);
bool32 IsAbilityOfRating(u16 ability, s8 rating); bool32 IsAbilityOfRating(u16 ability, s8 rating);
s8 GetAbilityRating(u16 ability); s8 GetAbilityRating(u16 ability);
bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability);
// stat stage checks // stat stage checks
bool32 AnyStatIsRaised(u8 battlerId); bool32 AnyStatIsRaised(u8 battlerId);
@ -120,7 +121,6 @@ bool32 IsSemiInvulnerable(u8 battlerDef, u16 move);
// status checks // status checks
bool32 AI_CanBeBurned(u8 battler, u16 ability); bool32 AI_CanBeBurned(u8 battler, u16 ability);
bool32 AI_CanBePoisoned(u8 battler, u16 ability);
bool32 AI_CanBeConfused(u8 battler, u16 ability); bool32 AI_CanBeConfused(u8 battler, u16 ability);
bool32 AI_CanSleep(u8 battler, u16 ability); bool32 AI_CanSleep(u8 battler, u16 ability);
bool32 IsBattlerIncapacitated(u8 battler, u16 ability); bool32 IsBattlerIncapacitated(u8 battler, u16 ability);

View File

@ -310,6 +310,5 @@ extern const u8 gText_BattleTourney[];
extern const u16 gMissStringIds[]; extern const u16 gMissStringIds[];
extern const u16 gStatUpStringIds[]; extern const u16 gStatUpStringIds[];
extern const u16 gTrappingMoves[];
#endif // GUARD_BATTLE_MESSAGE_H #endif // GUARD_BATTLE_MESSAGE_H

View File

@ -405,6 +405,13 @@ extern const u8 BattleScript_PrimalReversion[];
extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; extern const u8 BattleScript_HyperspaceFuryRemoveProtect[];
extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[]; extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[];
extern const u8 BattleScript_WanderingSpiritActivates[]; extern const u8 BattleScript_WanderingSpiritActivates[];
extern const u8 BattleScript_MirrorArmorReflect[];
extern const u8 BattleScript_GooeyActivates[];
extern const u8 BattleScript_PastelVeilActivates[];
extern const u8 BattleScript_MimicryActivatesEnd3[];
extern const u8 BattleScript_ApplyMimicry[];
extern const u8 BattleScript_AttackerFormChangeEnd3NoPopup[];
extern const u8 BattleScript_AttackerFormChangeMoveEffect[];
extern const u8 BattleScript_NeutralizingGasExits[]; extern const u8 BattleScript_NeutralizingGasExits[];
#endif // GUARD_BATTLE_SCRIPTS_H #endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -158,8 +158,12 @@ void BufferStatChange(u8 battlerId, u8 statId, u8 stringId);
void DoBurmyFormChange(u32 monId); void DoBurmyFormChange(u32 monId);
bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget); bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget);
u16 GetUsedHeldItem(u8 battler); u16 GetUsedHeldItem(u8 battler);
bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags);
void TryToApplyMimicry(u8 battlerId, bool8 various);
void TryToRevertMimicry(void);
void RestoreBattlerOriginalTypes(u8 battlerId);
// ability checks // Ability checks
bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbilityAtk(u16 ability);
bool32 IsRolePlayBannedAbility(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability);
bool32 IsSkillSwapBannedAbility(u16 ability); bool32 IsSkillSwapBannedAbility(u16 ability);
@ -169,7 +173,7 @@ bool32 IsEntrainmentBannedAbilityAttacker(u16 ability);
bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability); bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability);
bool32 CanSleep(u8 battlerId); bool32 CanSleep(u8 battlerId);
bool32 CanBePoisoned(u8 battlerId); bool32 CanBePoisoned(u8 battlerAttacker, u8 battlerTarget);
bool32 CanBeBurned(u8 battlerId); bool32 CanBeBurned(u8 battlerId);
bool32 CanBeParalyzed(u8 battlerId); bool32 CanBeParalyzed(u8 battlerId);
bool32 CanBeFrozen(u8 battlerId); bool32 CanBeFrozen(u8 battlerId);

View File

@ -357,7 +357,8 @@
#define MOVE_EFFECT_INCINERATE 0x44 #define MOVE_EFFECT_INCINERATE 0x44
#define MOVE_EFFECT_BUG_BITE 0x45 #define MOVE_EFFECT_BUG_BITE 0x45
#define MOVE_EFFECT_RECOIL_HP_25 0x46 #define MOVE_EFFECT_RECOIL_HP_25 0x46
#define NUM_MOVE_EFFECTS 0x47 #define MOVE_EFFECT_RELIC_SONG 0x47
#define NUM_MOVE_EFFECTS 0x48
#define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_AFFECTS_USER 0x4000
#define MOVE_EFFECT_CERTAIN 0x8000 #define MOVE_EFFECT_CERTAIN 0x8000

View File

@ -462,7 +462,7 @@
#define BG_WATER_2 41 #define BG_WATER_2 41
#define BG_POISON 42 #define BG_POISON 42
#define BG_AEROBLAST 43 #define BG_AEROBLAST 43
#define BG_HIGH_SPEED 44 //hurricane, close combat #define BG_HURRICANE 44
#define BG_ELECTRIC_TERRAIN 45 #define BG_ELECTRIC_TERRAIN 45
#define BG_GRASSY_TERRAIN 46 #define BG_GRASSY_TERRAIN 46
#define BG_MISTY_TERRAIN 47 #define BG_MISTY_TERRAIN 47
@ -565,7 +565,8 @@
#define TRAP_ANIM_WHIRLPOOL 2 #define TRAP_ANIM_WHIRLPOOL 2
#define TRAP_ANIM_CLAMP 3 #define TRAP_ANIM_CLAMP 3
#define TRAP_ANIM_SAND_TOMB 4 #define TRAP_ANIM_SAND_TOMB 4
#define TRAP_ANIM_INFESTATION 5 #define TRAP_ANIM_MAGMA_STORM 5
#define TRAP_ANIM_INFESTATION 6
// Weather defines for battle animation scripts. // Weather defines for battle animation scripts.
#define ANIM_WEATHER_NONE 0 #define ANIM_WEATHER_NONE 0

View File

@ -47,6 +47,10 @@
#define SPECIES_GRENINJA_ASH 10017 #define SPECIES_GRENINJA_ASH 10017
#define SPECIES_HOOPA 0 #define SPECIES_HOOPA 0
#define SPECIES_HOOPA_UNBOUND 10018 #define SPECIES_HOOPA_UNBOUND 10018
#define SPECIES_MELOETTA 0
#define SPECIES_MELOETTA_PIROUETTE 10019
#define SPECIES_MORPEKO 0
#define SPECIES_MORPEKO_HANGRY 10020
#endif #endif
// Items with peculiar battle effects. // Items with peculiar battle effects.
@ -157,7 +161,8 @@
#define B_SHADOW_TAG_ESCAPE GEN_7 // In Gen4+, if both sides have a Pokémon with Shadow Tag, all battlers can escape. Before, neither side could escape this situation. #define B_SHADOW_TAG_ESCAPE GEN_7 // In Gen4+, if both sides have a Pokémon with Shadow Tag, all battlers can escape. Before, neither side could escape this situation.
#define B_MOODY_ACC_EVASION GEN_8 // In Gen8, Moody CANNOT raise Accuracy and Evasion anymore. #define B_MOODY_ACC_EVASION GEN_8 // In Gen8, Moody CANNOT raise Accuracy and Evasion anymore.
#define B_FLASH_FIRE_FROZEN GEN_7 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before. #define B_FLASH_FIRE_FROZEN GEN_7 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before.
#define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if the Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously.
#define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned.
#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities.
// Item settings // Item settings
@ -166,6 +171,7 @@
#define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1. #define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1.
#define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable #define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable
#define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items.
#define B_SOUL_DEW_BOOST GEN_7 // In Gens3-6, Soul Dew boosts Lati@s' Sp. Atk and Sp. Def. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead.
// Flag settings // Flag settings
// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.

View File

@ -350,7 +350,7 @@
#define EFFECT_GEOMANCY 344 #define EFFECT_GEOMANCY 344
#define EFFECT_FAIRY_LOCK 345 #define EFFECT_FAIRY_LOCK 345
#define EFFECT_ALLY_SWITCH 346 #define EFFECT_ALLY_SWITCH 346
#define EFFECT_SLEEP_HIT 347 #define EFFECT_RELIC_SONG 347
#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 #define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348
#define EFFECT_BODY_PRESS 349 #define EFFECT_BODY_PRESS 349
#define EFFECT_EERIE_SPELL 350 #define EFFECT_EERIE_SPELL 350
@ -375,7 +375,10 @@
#define EFFECT_SPARKLY_SWIRL 369 #define EFFECT_SPARKLY_SWIRL 369
#define EFFECT_PLASMA_FISTS 370 #define EFFECT_PLASMA_FISTS 370
#define EFFECT_HYPERSPACE_FURY 371 #define EFFECT_HYPERSPACE_FURY 371
#define EFFECT_AURA_WHEEL 372
#define EFFECT_PHOTON_GEYSER 373
#define EFFECT_SHELL_SIDE_ARM 374
#define NUM_BATTLE_MOVE_EFFECTS 372 #define NUM_BATTLE_MOVE_EFFECTS 375
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -195,7 +195,13 @@
#define VARIOUS_APPLY_PLASMA_FISTS 122 #define VARIOUS_APPLY_PLASMA_FISTS 122
#define VARIOUS_JUMP_IF_SPECIES 123 #define VARIOUS_JUMP_IF_SPECIES 123
#define VARIOUS_UPDATE_ABILITY_POPUP 124 #define VARIOUS_UPDATE_ABILITY_POPUP 124
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 125 #define VARIOUS_JUMP_IF_WEATHER_AFFECTED 125
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127
#define VARIOUS_TRY_TO_APPLY_MIMICRY 128
#define VARIOUS_PHOTON_GEYSER_CHECK 129
#define VARIOUS_SHELL_SIDE_ARM_CHECK 130
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 131
// Cmd_manipulatedamage // Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0 #define DMG_CHANGE_SIGN 0

View File

@ -410,7 +410,7 @@
#define STRINGID_PKMNTWISTEDDIMENSIONS 406 #define STRINGID_PKMNTWISTEDDIMENSIONS 406
#define STRINGID_POINTEDSTONESFLOAT 407 #define STRINGID_POINTEDSTONESFLOAT 407
#define STRINGID_CLOAKEDINMYSTICALMOONLIGHT 408 #define STRINGID_CLOAKEDINMYSTICALMOONLIGHT 408
#define STRINGID_TRAPPERBYSWIRLINGMAGMA 409 #define STRINGID_TRAPPEDBYSWIRLINGMAGMA 409
#define STRINGID_VANISHEDINSTANTLY 410 #define STRINGID_VANISHEDINSTANTLY 410
#define STRINGID_PROTECTEDTEAM 411 #define STRINGID_PROTECTEDTEAM 411
#define STRINGID_SHAREDITSGUARD 412 #define STRINGID_SHAREDITSGUARD 412
@ -599,10 +599,13 @@
#define STRINGID_BROKETHROUGHPROTECTION 596 #define STRINGID_BROKETHROUGHPROTECTION 596
#define STRINGID_ABILITYALLOWSONLYMOVE 597 #define STRINGID_ABILITYALLOWSONLYMOVE 597
#define STRINGID_SWAPPEDABILITIES 598 #define STRINGID_SWAPPEDABILITIES 598
#define STRINGID_NEUTRALIZINGGASENTERS 599 #define STRINGID_PASTELVEILPROTECTED 599
#define STRINGID_NEUTRALIZINGGASOVER 600 #define STRINGID_PASTELVEILENTERS 600
#define STRINGID_BATTLERTYPECHANGEDTO 601
#define STRINGID_NEUTRALIZINGGASENTERS 602
#define STRINGID_NEUTRALIZINGGASOVER 603
#define BATTLESTRINGS_COUNT 601 #define BATTLESTRINGS_COUNT 604
// 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.
@ -837,7 +840,8 @@
#define B_MSG_SWITCHIN_SCREENCLEANER 12 #define B_MSG_SWITCHIN_SCREENCLEANER 12
#define B_MSG_SWITCHIN_ASONE 13 #define B_MSG_SWITCHIN_ASONE 13
#define B_MSG_SWITCHIN_CURIOUS_MEDICINE 14 #define B_MSG_SWITCHIN_CURIOUS_MEDICINE 14
#define B_MSG_SWITCHIN_NEUTRALIZING_GAS 15 #define B_MSG_SWITCHIN_PASTEL_VEIL 15
#define B_MSG_SWITCHIN_NEUTRALIZING_GAS 16
// gMentalHerbCureStringIds // gMentalHerbCureStringIds
#define B_MSG_MENTALHERBCURE_INFATUATION 0 #define B_MSG_MENTALHERBCURE_INFATUATION 0

View File

@ -238,5 +238,9 @@
#define COMBO_STARTER_THOUSAND_WAVES 82 #define COMBO_STARTER_THOUSAND_WAVES 82
#define COMBO_STARTER_HYPERSPACE_FURY 83 #define COMBO_STARTER_HYPERSPACE_FURY 83
#define COMBO_STARTER_SHADOW_BONE 84 #define COMBO_STARTER_SHADOW_BONE 84
#define COMBO_STARTER_ELECTRIC_TERRAIN 85
#define COMBO_STARTER_MISTY_TERRAIN 86
#define COMBO_STARTER_GRASSY_TERRAIN 87
#define COMBO_STARTER_PSYCHIC_TERRAIN 88
#endif // GUARD_CONSTANTS_CONTEST_H #endif // GUARD_CONSTANTS_CONTEST_H

View File

@ -308,6 +308,7 @@
#define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets #define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets
#define FLAG_THAW_USER (1 << 25) #define FLAG_THAW_USER (1 << 25)
#define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury #define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury
#define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit
// Split defines. // Split defines.
#define SPLIT_PHYSICAL 0x0 #define SPLIT_PHYSICAL 0x0

View File

@ -4933,14 +4933,14 @@ extern const u32 gBattleAnimBgImage_InAir[];
extern const u32 gBattleAnimBgImage_Aurora[]; extern const u32 gBattleAnimBgImage_Aurora[];
extern const u32 gBattleAnimBgImage_Fissure[]; extern const u32 gBattleAnimBgImage_Fissure[];
extern const u32 gBattleAnimBgImage_TrickRoom[]; extern const u32 gBattleAnimBgImage_TrickRoom[];
extern const u32 gBattleAnimBgImage_RockWrecker[]; extern const u32 gBattleAnimBgImage_Hurricane[];
extern const u32 gBattleAnimBgImage_SpacialRendOpponent[]; extern const u32 gBattleAnimBgPalette_Hurricane[];
extern const u32 gBattleAnimBgPalette_SpacialRendOpponent[]; extern const u32 gBattleAnimBgTilemap_Hurricane[];
extern const u32 gBattleAnimBgPalette_RockWrecker[];
extern const u32 gBattleAnimBgImage_SpacialRend[];
extern const u32 gBattleAnimBgPalette_SpacialRend[];
extern const u32 gBattleAnimBgTilemap_SpacialRendOpponent[]; extern const u32 gBattleAnimBgTilemap_SpacialRendOpponent[];
extern const u32 gBattleAnimBgImage_SpacialRendPlayer[];
extern const u32 gBattleAnimBgPalette_SpacialRendPlayer[];
extern const u32 gBattleAnimBgTilemap_SpacialRendPlayer[]; extern const u32 gBattleAnimBgTilemap_SpacialRendPlayer[];
extern const u32 gBattleAnimBgImage_DarkVoid[];
extern const u32 gBattleAnimBgPalette_DarkVoid[]; extern const u32 gBattleAnimBgPalette_DarkVoid[];
extern const u32 gBattleAnimBgTilemap_DarkVoid[]; extern const u32 gBattleAnimBgTilemap_DarkVoid[];
extern const u32 gBattleAnimBgPalette_Dark[]; extern const u32 gBattleAnimBgPalette_Dark[];
@ -4962,7 +4962,6 @@ extern const u32 gBattleAnimBgPalette_Solarbeam[];
extern const u32 gBattleAnimBgPalette_MagmaStorm[]; extern const u32 gBattleAnimBgPalette_MagmaStorm[];
extern const u32 gBattleAnimBgPalette_GigaImpact[]; extern const u32 gBattleAnimBgPalette_GigaImpact[];
extern const u32 gBattleAnimBgPalette_TrickRoom[]; extern const u32 gBattleAnimBgPalette_TrickRoom[];
extern const u32 gBattleAnimBgPalette_RockWrecker[];
extern const u32 gBattleAnimBgTilemap_Dark[]; extern const u32 gBattleAnimBgTilemap_Dark[];
extern const u32 gBattleAnimBgTilemap_Ghost[]; extern const u32 gBattleAnimBgTilemap_Ghost[];
extern const u32 gBattleAnimBgTilemap_Psychic[]; extern const u32 gBattleAnimBgTilemap_Psychic[];
@ -4974,7 +4973,6 @@ extern const u32 gBattleAnimBgTilemap_DrillContests[];
extern const u32 gBattleAnimBgTilemap_HighspeedOpponent[]; extern const u32 gBattleAnimBgTilemap_HighspeedOpponent[];
extern const u32 gBattleAnimBgTilemap_HighspeedPlayer[]; extern const u32 gBattleAnimBgTilemap_HighspeedPlayer[];
extern const u32 gBattleAnimBgTilemap_TrickRoom[]; extern const u32 gBattleAnimBgTilemap_TrickRoom[];
extern const u32 gBattleAnimBgTilemap_RockWrecker[];
extern const u32 gBattleAnimMaskImage_LightBeam[]; extern const u32 gBattleAnimMaskImage_LightBeam[];
extern const u32 gBattleAnimMaskPalette_LightBeam[]; extern const u32 gBattleAnimMaskPalette_LightBeam[];
extern const u32 gBattleAnimMaskTilemap_LightBeam[]; extern const u32 gBattleAnimMaskTilemap_LightBeam[];
@ -5020,9 +5018,6 @@ extern const u32 gBattleAnimBgImage_GrassyTerrain[];
extern const u32 gBattleAnimBgPalette_GrassyTerrain[]; extern const u32 gBattleAnimBgPalette_GrassyTerrain[];
extern const u32 gBattleAnimBgTilemap_GrassyTerrain[]; extern const u32 gBattleAnimBgTilemap_GrassyTerrain[];
extern const u32 gBattleAnimBgPalette_GunkShot[]; extern const u32 gBattleAnimBgPalette_GunkShot[];
extern const u32 gBattleAnimBgImage_HighSpeed[];
extern const u32 gBattleAnimBgPalette_HighSpeed[];
extern const u32 gBattleAnimBgTilemap_HighSpeed[];
extern const u32 gBattleAnimBgImage_HydroCannon[]; extern const u32 gBattleAnimBgImage_HydroCannon[];
extern const u32 gBattleAnimBgPalette_HydroCannon[]; extern const u32 gBattleAnimBgPalette_HydroCannon[];
extern const u32 gBattleAnimBgTilemap_HydroCannon[]; extern const u32 gBattleAnimBgTilemap_HydroCannon[];

View File

@ -578,6 +578,21 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
{ {
switch (AI_DATA->defAbility) switch (AI_DATA->defAbility)
{ {
case ABILITY_MAGIC_GUARD:
switch (moveEffect)
{
case EFFECT_POISON:
case EFFECT_WILL_O_WISP:
case EFFECT_TOXIC:
case EFFECT_LEECH_SEED:
score -= 5;
break;
case EFFECT_CURSE:
if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GHOST)) // Don't use Curse if you're a ghost type vs a Magic Guard user, they'll take no damage.
score -= 5;
break;
}
break;
case ABILITY_VOLT_ABSORB: case ABILITY_VOLT_ABSORB:
case ABILITY_MOTOR_DRIVE: case ABILITY_MOTOR_DRIVE:
case ABILITY_LIGHTNING_ROD: case ABILITY_LIGHTNING_ROD:
@ -2949,7 +2964,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
} }
} }
// ability checks // attacker ability checks
switch (AI_DATA->atkAbility) switch (AI_DATA->atkAbility)
{ {
case ABILITY_MOXIE: case ABILITY_MOXIE:
@ -2960,21 +2975,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score += 8; // prioritize killing target for stat boost score += 8; // prioritize killing target for stat boost
} }
break; break;
case ABILITY_MAGIC_GUARD:
switch (moveEffect)
{
case EFFECT_POISON:
case EFFECT_WILL_O_WISP:
case EFFECT_TOXIC:
case EFFECT_LEECH_SEED:
score -= 5;
break;
case EFFECT_CURSE:
if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST))
score -= 5;
break;
}
break;
} // ability checks } // ability checks
// move effect checks // move effect checks
@ -3999,7 +3999,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score += 2; score += 2;
break; break;
case HOLD_EFFECT_TOXIC_ORB: case HOLD_EFFECT_TOXIC_ORB:
if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility) && AI_CanBePoisoned(battlerDef, AI_DATA->defAbility)) if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility))
score += 2; score += 2;
break; break;
case HOLD_EFFECT_FLAME_ORB: case HOLD_EFFECT_FLAME_ORB:
@ -4305,7 +4305,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
if (!IsBattlerGrounded(battlerDef)) if (!IsBattlerGrounded(battlerDef))
score += 3; score += 3;
break; break;
case EFFECT_SLEEP_HIT: // Relic Song case EFFECT_RELIC_SONG:
#if (defined SPECIES_MELOETTA && defined SPECIES_MELOETTA_PIROUETTE) #if (defined SPECIES_MELOETTA && defined SPECIES_MELOETTA_PIROUETTE)
if (AI_DATA->atkSpecies == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) if (AI_DATA->atkSpecies == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense)
score += 3; // Change to pirouette if can do more damage score += 3; // Change to pirouette if can do more damage

View File

@ -733,28 +733,45 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef)
else else
dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; dmg = (critDmg + normalDmg * (critChance - 1)) / critChance;
// handle dynamic move damage // Handle dynamic move damage
switch (gBattleMoves[move].effect) switch (gBattleMoves[move].effect)
{ {
case EFFECT_LEVEL_DAMAGE: case EFFECT_LEVEL_DAMAGE:
case EFFECT_PSYWAVE: case EFFECT_PSYWAVE:
//psywave's expected damage is equal to the user's level dmg = gBattleMons[battlerAtk].level * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1);
dmg = gBattleMons[battlerAtk].level;
break; break;
case EFFECT_DRAGON_RAGE: case EFFECT_DRAGON_RAGE:
dmg = 40; dmg = 40 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1);
break; break;
case EFFECT_SONICBOOM: case EFFECT_SONICBOOM:
dmg = 20; dmg = 20 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1);
break; break;
//case EFFECT_METAL_BURST: case EFFECT_MULTI_HIT:
//case EFFECT_COUNTER: dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 5 : 3);
default: break;
//do not add the random factor, it's an average case analysis case EFFECT_TRIPLE_KICK:
//dmg *= (100 - (Random() % 10)) / 100; // add random factor dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 6 : 5);
break;
case EFFECT_ENDEAVOR:
// If target has less HP than user, Endeavor does no damage
dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp);
break;
case EFFECT_SUPER_FANG:
dmg = (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND
? max(2, gBattleMons[battlerDef].hp * 3 / 4)
: max(1, gBattleMons[battlerDef].hp / 2));
break;
case EFFECT_FINAL_GAMBIT:
dmg = gBattleMons[battlerAtk].hp;
break; break;
} }
// Handle other multi-strike moves
if (gBattleMoves[move].flags & FLAG_TWO_STRIKES)
dmg *= 2;
else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
dmg *= 3;
RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerAtk);
RestoreBattlerData(battlerDef); RestoreBattlerData(battlerDef);
@ -1065,6 +1082,16 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM
return FALSE; return FALSE;
} }
bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability)
{
if (IsBattlerAlive(battlerId) && AI_GetAbility(battlerId) == ability)
return TRUE;
else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_GetAbility(BATTLE_PARTNER(battlerId)) == ability)
return TRUE;
else
return FALSE;
}
// does NOT include ability suppression checks // does NOT include ability suppression checks
s32 AI_GetAbility(u32 battlerId) s32 AI_GetAbility(u32 battlerId)
{ {
@ -2612,27 +2639,38 @@ bool32 AI_CanSleep(u8 battler, u16 ability)
bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove)
{ {
if (!AI_CanSleep(battlerDef, defAbility) if (!AI_CanSleep(battlerDef, defAbility)
|| AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|| PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) // shouldn't try to sleep mon that partner is trying to make sleep || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) // shouldn't try to sleep mon that partner is trying to make sleep
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
bool32 AI_CanBePoisoned(u8 battler, u16 ability) static bool32 AI_CanPoisonType(u8 battlerAttacker, u8 battlerTarget)
{ {
if (ability == ABILITY_IMMUNITY return ((AI_GetAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS)
|| ability == ABILITY_PASTEL_VEIL || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL)));
|| gBattleMons[battler].status1 & STATUS1_ANY }
|| IsAbilityStatusProtected(battler)
|| gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD) static bool32 AI_CanBePoisoned(u8 battlerAtk, u8 battlerDef)
{
u16 ability = AI_GetAbility(battlerDef);
if (!(AI_CanPoisonType(battlerAtk, battlerDef))
|| gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD
|| gBattleMons[battlerDef].status1 & STATUS1_ANY
|| ability == ABILITY_IMMUNITY
|| ability == ABILITY_COMATOSE
|| AI_IsAbilityOnSide(battlerDef, ABILITY_PASTEL_VEIL)
|| gBattleMons[battlerDef].status1 & STATUS1_ANY
|| IsAbilityStatusProtected(battlerDef)
|| AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
bool32 ShouldPoisonSelf(u8 battler, u16 ability) bool32 ShouldPoisonSelf(u8 battler, u16 ability)
{ {
if (AI_CanBePoisoned(battler, ability) && ( if (AI_CanBePoisoned(battler, battler) && (
ability == ABILITY_MARVEL_SCALE ability == ABILITY_MARVEL_SCALE
|| ability == ABILITY_POISON_HEAL || ability == ABILITY_POISON_HEAL
|| ability == ABILITY_QUICK_FEET || ability == ABILITY_QUICK_FEET
@ -2647,7 +2685,7 @@ bool32 ShouldPoisonSelf(u8 battler, u16 ability)
bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove)
{ {
if (!AI_CanBePoisoned(battlerDef, defAbility) if (!AI_CanBePoisoned(battlerAtk, battlerDef)
|| AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|| PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove))
@ -2660,7 +2698,7 @@ bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16
return TRUE; return TRUE;
} }
static bool32 CanBeParayzed(u8 battler, u16 ability) static bool32 AI_CanBeParalyzed(u8 battler, u16 ability)
{ {
if (ability == ABILITY_LIMBER if (ability == ABILITY_LIMBER
|| IS_BATTLER_OF_TYPE(battler, TYPE_ELECTRIC) || IS_BATTLER_OF_TYPE(battler, TYPE_ELECTRIC)
@ -2672,7 +2710,7 @@ static bool32 CanBeParayzed(u8 battler, u16 ability)
bool32 AI_CanParalyze(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) bool32 AI_CanParalyze(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove)
{ {
if (!CanBeParayzed(battlerDef, defAbility) if (!AI_CanBeParalyzed(battlerDef, defAbility)
|| AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0
|| gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
@ -2750,7 +2788,7 @@ bool32 AI_CanBeInfatuated(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 atkGe
|| atkGender == defGender || atkGender == defGender
|| atkGender == MON_GENDERLESS || atkGender == MON_GENDERLESS
|| defGender == MON_GENDERLESS || defGender == MON_GENDERLESS
|| IsAbilityOnSide(battlerDef, ABILITY_AROMA_VEIL)) || AI_IsAbilityOnSide(battlerDef, ABILITY_AROMA_VEIL))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }

View File

@ -2056,10 +2056,10 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] =
[BG_GIGA_IMPACT_PLAYER] = {gBattleAnimBgImage_Impact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_ImpactPlayer}, [BG_GIGA_IMPACT_PLAYER] = {gBattleAnimBgImage_Impact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_ImpactPlayer},
[BG_GIGA_IMPACT_CONTEST] = {gBattleAnimBgImage_Impact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_ImpactContests}, [BG_GIGA_IMPACT_CONTEST] = {gBattleAnimBgImage_Impact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_ImpactContests},
[BG_TRICK_ROOM] = {gBattleAnimBgImage_TrickRoom, gBattleAnimBgPalette_TrickRoom, gBattleAnimBgTilemap_TrickRoom}, [BG_TRICK_ROOM] = {gBattleAnimBgImage_TrickRoom, gBattleAnimBgPalette_TrickRoom, gBattleAnimBgTilemap_TrickRoom},
[BG_ROCK_WRECKER] = {gBattleAnimBgImage_RockWrecker, gBattleAnimBgPalette_RockWrecker, gBattleAnimBgTilemap_RockWrecker}, [BG_ROCK_WRECKER] = {gBattleAnimBgImage_Hurricane, gBattleAnimBgPalette_RockWrecker, gBattleAnimBgTilemap_Hurricane},
[BG_SPACIAL_REND_ON_OPPONENT] = {gBattleAnimBgImage_SpacialRendOpponent, gBattleAnimBgPalette_SpacialRendOpponent, gBattleAnimBgTilemap_SpacialRendOpponent}, [BG_SPACIAL_REND_ON_OPPONENT] = {gBattleAnimBgImage_SpacialRend, gBattleAnimBgPalette_SpacialRend, gBattleAnimBgTilemap_SpacialRendOpponent},
[BG_SPACIAL_REND_ON_PLAYER] = {gBattleAnimBgImage_SpacialRendPlayer, gBattleAnimBgPalette_SpacialRendPlayer, gBattleAnimBgTilemap_SpacialRendPlayer}, [BG_SPACIAL_REND_ON_PLAYER] = {gBattleAnimBgImage_SpacialRend, gBattleAnimBgPalette_SpacialRend, gBattleAnimBgTilemap_SpacialRendPlayer},
[BG_DARK_VOID] = {gBattleAnimBgImage_DarkVoid, gBattleAnimBgPalette_DarkVoid, gBattleAnimBgTilemap_DarkVoid}, [BG_DARK_VOID] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_DarkVoid, gBattleAnimBgTilemap_DarkVoid},
[BG_WATER] = {gBattleAnimBgImage_HydroPump, gBattleAnimBgPalette_HydroPump, gBattleAnimBgTilemap_HydroPump}, [BG_WATER] = {gBattleAnimBgImage_HydroPump, gBattleAnimBgPalette_HydroPump, gBattleAnimBgTilemap_HydroPump},
[BG_NIGHTMARE] = {gBattleAnimBgImage_Nightmare, gBattleAnimBgPalette_Nightmare, gBattleAnimBgTilemap_Nightmare}, [BG_NIGHTMARE] = {gBattleAnimBgImage_Nightmare, gBattleAnimBgPalette_Nightmare, gBattleAnimBgTilemap_Nightmare},
[BG_LEAF_STORM] = {gBattleAnimBgImage_LeafStorm, gBattleAnimBgPalette_LeafStorm, gBattleAnimBgTilemap_LeafStorm}, [BG_LEAF_STORM] = {gBattleAnimBgImage_LeafStorm, gBattleAnimBgPalette_LeafStorm, gBattleAnimBgTilemap_LeafStorm},
@ -2068,7 +2068,7 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] =
[BG_WATER_2] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_Waterfall, gBattleAnimBgTilemap_Waterfall}, [BG_WATER_2] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_Waterfall, gBattleAnimBgTilemap_Waterfall},
[BG_POISON] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_PoisonFalls, gBattleAnimBgTilemap_Waterfall}, [BG_POISON] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_PoisonFalls, gBattleAnimBgTilemap_Waterfall},
[BG_AEROBLAST] = {gBattleAnimBgImage_Aeroblast, gBattleAnimBgPalette_Aeroblast, gBattleAnimBgTilemap_Aeroblast}, [BG_AEROBLAST] = {gBattleAnimBgImage_Aeroblast, gBattleAnimBgPalette_Aeroblast, gBattleAnimBgTilemap_Aeroblast},
[BG_HIGH_SPEED] = {gBattleAnimBgImage_HighSpeed, gBattleAnimBgPalette_HighSpeed, gBattleAnimBgTilemap_HighSpeed}, [BG_HURRICANE] = {gBattleAnimBgImage_Hurricane, gBattleAnimBgPalette_Hurricane, gBattleAnimBgTilemap_Hurricane},
[BG_ELECTRIC_TERRAIN] = {gBattleAnimBgImage_ElectricTerrain, gBattleAnimBgPalette_ElectricTerrain, gBattleAnimBgTilemap_ElectricTerrain}, [BG_ELECTRIC_TERRAIN] = {gBattleAnimBgImage_ElectricTerrain, gBattleAnimBgPalette_ElectricTerrain, gBattleAnimBgTilemap_ElectricTerrain},
[BG_GRASSY_TERRAIN] = {gBattleAnimBgImage_GrassyTerrain, gBattleAnimBgPalette_GrassyTerrain, gBattleAnimBgTilemap_GrassyTerrain}, [BG_GRASSY_TERRAIN] = {gBattleAnimBgImage_GrassyTerrain, gBattleAnimBgPalette_GrassyTerrain, gBattleAnimBgTilemap_GrassyTerrain},
[BG_MISTY_TERRAIN] = {gBattleAnimBgImage_MistyTerrain, gBattleAnimBgPalette_MistyTerrain, gBattleAnimBgTilemap_MistyTerrain}, [BG_MISTY_TERRAIN] = {gBattleAnimBgImage_MistyTerrain, gBattleAnimBgPalette_MistyTerrain, gBattleAnimBgTilemap_MistyTerrain},

View File

@ -22,6 +22,7 @@
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/weather.h" #include "constants/weather.h"
#include "constants/hold_effects.h"
extern const struct SpriteTemplate gThoughtBubbleSpriteTemplate; extern const struct SpriteTemplate gThoughtBubbleSpriteTemplate;
@ -5526,10 +5527,12 @@ static void AnimRecycle_Step(struct Sprite *sprite)
void AnimTask_GetWeather(u8 taskId) void AnimTask_GetWeather(u8 taskId)
{ {
bool32 utilityUmbrellaAffected = GetBattlerHoldEffect(gBattleAnimAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA;
gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_NONE; gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_NONE;
if (gWeatherMoveAnim & WEATHER_SUN_ANY) if (gWeatherMoveAnim & WEATHER_SUN_ANY && !utilityUmbrellaAffected)
gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SUN; gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SUN;
else if (gWeatherMoveAnim & WEATHER_RAIN_ANY) else if (gWeatherMoveAnim & WEATHER_RAIN_ANY && !utilityUmbrellaAffected)
gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_RAIN; gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_RAIN;
else if (gWeatherMoveAnim & WEATHER_SANDSTORM_ANY) else if (gWeatherMoveAnim & WEATHER_SANDSTORM_ANY)
gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SANDSTORM; gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SANDSTORM;

View File

@ -5064,3 +5064,12 @@ void AnimTask_PrimalReversion(u8 taskId)
gBattleAnimArgs[0] = 0; gBattleAnimArgs[0] = 0;
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
void AnimTask_ShellSideArm(u8 taskId)
{
if (gSwapDamageCategory)
gBattleAnimArgs[0] = TRUE;
else
gBattleAnimArgs[0] = FALSE;
DestroyAnimVisualTask(taskId);
}

View File

@ -2496,6 +2496,8 @@ void AnimTask_GetTrappedMoveAnimId(u8 taskId)
gBattleAnimArgs[0] = TRAP_ANIM_CLAMP; gBattleAnimArgs[0] = TRAP_ANIM_CLAMP;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SAND_TOMB) else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SAND_TOMB)
gBattleAnimArgs[0] = TRAP_ANIM_SAND_TOMB; gBattleAnimArgs[0] = TRAP_ANIM_SAND_TOMB;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_MAGMA_STORM)
gBattleAnimArgs[0] = TRAP_ANIM_MAGMA_STORM;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION) else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION)
gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION; gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION;
else else

View File

@ -559,7 +559,7 @@ static const struct BgTemplate sBgTemplates[] =
}, },
{ {
.bg = 1, .bg = 1,
.charBaseIndex = 10, .charBaseIndex = 2,
.mapBaseIndex = 20, .mapBaseIndex = 20,
.screenSize = 0, .screenSize = 0,
.paletteMode = 0, .paletteMode = 0,

View File

@ -232,6 +232,7 @@ EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA bool8 gHasFetchedBall = FALSE; EWRAM_DATA bool8 gHasFetchedBall = FALSE;
EWRAM_DATA u8 gLastUsedBall = 0; EWRAM_DATA u8 gLastUsedBall = 0;
EWRAM_DATA u16 gLastThrownBall = 0; EWRAM_DATA u16 gLastThrownBall = 0;
EWRAM_DATA bool8 gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
// IWRAM common vars // IWRAM common vars
void (*gPreBattleCallback1)(void); void (*gPreBattleCallback1)(void);
@ -2933,12 +2934,16 @@ static void BattleStartClearSetData(void)
gBattleStruct->mega.triggerSpriteId = 0xFF; gBattleStruct->mega.triggerSpriteId = 0xFF;
gBattleStruct->stickyWebUser = 0xFF;
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
gBattleStruct->usedHeldItems[i][0] = 0; gBattleStruct->usedHeldItems[i][0] = 0;
gBattleStruct->usedHeldItems[i][1] = 0; gBattleStruct->usedHeldItems[i][1] = 0;
gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
} }
gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
} }
void SwitchInClearSetData(void) void SwitchInClearSetData(void)
@ -3030,6 +3035,9 @@ void SwitchInClearSetData(void)
gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0;
gBattleStruct->lastMoveFailed &= ~(gBitTable[gActiveBattler]); gBattleStruct->lastMoveFailed &= ~(gBitTable[gActiveBattler]);
gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]);
if (gActiveBattler == gBattleStruct->stickyWebUser)
gBattleStruct->stickyWebUser = 0xFF; // Switched into sticky web user slot so reset it
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
{ {
@ -3079,35 +3087,35 @@ void FaintClearSetData(void)
memset(&gDisableStructs[gActiveBattler], 0, sizeof(struct DisableStruct)); memset(&gDisableStructs[gActiveBattler], 0, sizeof(struct DisableStruct));
gProtectStructs[gActiveBattler].protected = 0; gProtectStructs[gActiveBattler].protected = FALSE;
gProtectStructs[gActiveBattler].spikyShielded = 0; gProtectStructs[gActiveBattler].spikyShielded = FALSE;
gProtectStructs[gActiveBattler].kingsShielded = 0; gProtectStructs[gActiveBattler].kingsShielded = FALSE;
gProtectStructs[gActiveBattler].banefulBunkered = 0; gProtectStructs[gActiveBattler].banefulBunkered = FALSE;
gProtectStructs[gActiveBattler].obstructed = 0; gProtectStructs[gActiveBattler].obstructed = FALSE;
gProtectStructs[gActiveBattler].endured = 0; gProtectStructs[gActiveBattler].endured = FALSE;
gProtectStructs[gActiveBattler].noValidMoves = 0; gProtectStructs[gActiveBattler].noValidMoves = FALSE;
gProtectStructs[gActiveBattler].helpingHand = 0; gProtectStructs[gActiveBattler].helpingHand = FALSE;
gProtectStructs[gActiveBattler].bounceMove = 0; gProtectStructs[gActiveBattler].bounceMove = FALSE;
gProtectStructs[gActiveBattler].stealMove = 0; gProtectStructs[gActiveBattler].stealMove = FALSE;
gProtectStructs[gActiveBattler].prlzImmobility = 0; gProtectStructs[gActiveBattler].prlzImmobility = FALSE;
gProtectStructs[gActiveBattler].confusionSelfDmg = 0; gProtectStructs[gActiveBattler].confusionSelfDmg = FALSE;
gProtectStructs[gActiveBattler].targetAffected = 0; gProtectStructs[gActiveBattler].targetAffected = FALSE;
gProtectStructs[gActiveBattler].chargingTurn = 0; gProtectStructs[gActiveBattler].chargingTurn = FALSE;
gProtectStructs[gActiveBattler].fleeFlag = 0; gProtectStructs[gActiveBattler].fleeFlag = 0;
gProtectStructs[gActiveBattler].usedImprisonedMove = 0; gProtectStructs[gActiveBattler].usedImprisonedMove = FALSE;
gProtectStructs[gActiveBattler].loveImmobility = 0; gProtectStructs[gActiveBattler].loveImmobility = FALSE;
gProtectStructs[gActiveBattler].usedDisabledMove = 0; gProtectStructs[gActiveBattler].usedDisabledMove = FALSE;
gProtectStructs[gActiveBattler].usedTauntedMove = 0; gProtectStructs[gActiveBattler].usedTauntedMove = FALSE;
gProtectStructs[gActiveBattler].flag2Unknown = 0; gProtectStructs[gActiveBattler].flag2Unknown = FALSE;
gProtectStructs[gActiveBattler].flinchImmobility = 0; gProtectStructs[gActiveBattler].flinchImmobility = FALSE;
gProtectStructs[gActiveBattler].notFirstStrike = 0; gProtectStructs[gActiveBattler].notFirstStrike = FALSE;
gProtectStructs[gActiveBattler].usedHealBlockedMove = 0; gProtectStructs[gActiveBattler].usedHealBlockedMove = FALSE;
gProtectStructs[gActiveBattler].usesBouncedMove = 0; gProtectStructs[gActiveBattler].usesBouncedMove = FALSE;
gProtectStructs[gActiveBattler].usedGravityPreventedMove = 0; gProtectStructs[gActiveBattler].usedGravityPreventedMove = FALSE;
gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0; gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = FALSE;
gProtectStructs[gActiveBattler].statRaised = 0; gProtectStructs[gActiveBattler].statRaised = FALSE;
gProtectStructs[gActiveBattler].statFell = 0; gProtectStructs[gActiveBattler].statFell = FALSE;
gProtectStructs[gActiveBattler].pranksterElevated = 0; gProtectStructs[gActiveBattler].pranksterElevated = FALSE;
gDisableStructs[gActiveBattler].isFirstTurn = 2; gDisableStructs[gActiveBattler].isFirstTurn = 2;
@ -3127,6 +3135,9 @@ void FaintClearSetData(void)
gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0;
gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]);
if (gActiveBattler == gBattleStruct->stickyWebUser)
gBattleStruct->stickyWebUser = 0xFF; // User of sticky web fainted, so reset the stored battler ID
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
{ {
@ -4293,9 +4304,9 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId)
// weather abilities // weather abilities
if (WEATHER_HAS_EFFECT) if (WEATHER_HAS_EFFECT)
{ {
if (ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY) if (ability == ABILITY_SWIFT_SWIM && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_RAIN_ANY)
speed *= 2; speed *= 2;
else if (ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY) else if (ability == ABILITY_CHLOROPHYLL && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_SUN_ANY)
speed *= 2; speed *= 2;
else if (ability == ABILITY_SAND_RUSH && gBattleWeather & WEATHER_SANDSTORM_ANY) else if (ability == ABILITY_SAND_RUSH && gBattleWeather & WEATHER_SANDSTORM_ANY)
speed *= 2; speed *= 2;
@ -4422,7 +4433,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
|| (!IsAbilityOnOpposingSide(battler1, ABILITY_UNNERVE) || (!IsAbilityOnOpposingSide(battler1, ABILITY_UNNERVE)
&& holdEffectBattler1 == HOLD_EFFECT_CUSTAP_BERRY && holdEffectBattler1 == HOLD_EFFECT_CUSTAP_BERRY
&& HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item)))) && HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item))))
gProtectStructs[battler1].custap = TRUE; gProtectStructs[battler1].usedCustapBerry = TRUE;
// Battler 2 // Battler 2
speedBattler2 = GetBattlerTotalSpeedStat(battler2); speedBattler2 = GetBattlerTotalSpeedStat(battler2);
@ -4436,7 +4447,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
|| (!IsAbilityOnOpposingSide(battler2, ABILITY_UNNERVE) || (!IsAbilityOnOpposingSide(battler2, ABILITY_UNNERVE)
&& holdEffectBattler2 == HOLD_EFFECT_CUSTAP_BERRY && holdEffectBattler2 == HOLD_EFFECT_CUSTAP_BERRY
&& HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item)))) && HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item))))
gProtectStructs[battler2].custap = TRUE; gProtectStructs[battler2].usedCustapBerry = TRUE;
if (!ignoreChosenMoves) if (!ignoreChosenMoves)
{ {
@ -4456,9 +4467,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
strikesFirst = 0; strikesFirst = 0;
else if (!gProtectStructs[battler1].quickDraw && gProtectStructs[battler2].quickDraw) else if (!gProtectStructs[battler1].quickDraw && gProtectStructs[battler2].quickDraw)
strikesFirst = 1; strikesFirst = 1;
else if (gProtectStructs[battler1].custap && !gProtectStructs[battler2].custap) else if (gProtectStructs[battler1].usedCustapBerry && !gProtectStructs[battler2].usedCustapBerry)
strikesFirst = 0; strikesFirst = 0;
else if (gProtectStructs[battler2].custap && !gProtectStructs[battler1].custap) else if (gProtectStructs[battler2].usedCustapBerry && !gProtectStructs[battler1].usedCustapBerry)
strikesFirst = 1; strikesFirst = 1;
else if (holdEffectBattler1 == HOLD_EFFECT_LAGGING_TAIL && holdEffectBattler2 != HOLD_EFFECT_LAGGING_TAIL) else if (holdEffectBattler1 == HOLD_EFFECT_LAGGING_TAIL && holdEffectBattler2 != HOLD_EFFECT_LAGGING_TAIL)
strikesFirst = 1; strikesFirst = 1;
@ -4619,10 +4630,10 @@ static void TurnValuesCleanUp(bool8 var0)
{ {
if (var0) if (var0)
{ {
gProtectStructs[gActiveBattler].protected = 0; gProtectStructs[gActiveBattler].protected = FALSE;
gProtectStructs[gActiveBattler].spikyShielded = 0; gProtectStructs[gActiveBattler].spikyShielded = FALSE;
gProtectStructs[gActiveBattler].kingsShielded = 0; gProtectStructs[gActiveBattler].kingsShielded = FALSE;
gProtectStructs[gActiveBattler].banefulBunkered = 0; gProtectStructs[gActiveBattler].banefulBunkered = FALSE;
} }
else else
{ {
@ -4717,14 +4728,14 @@ static void CheckQuickClaw_CustapBerryActivation(void)
gBattleStruct->quickClawBattlerId++; gBattleStruct->quickClawBattlerId++;
if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_MOVE if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_MOVE
&& gChosenMoveByBattler[gActiveBattler] != MOVE_FOCUS_PUNCH // quick claw message doesn't need to activate here && gChosenMoveByBattler[gActiveBattler] != MOVE_FOCUS_PUNCH // quick claw message doesn't need to activate here
&& (gProtectStructs[gActiveBattler].custap || gProtectStructs[gActiveBattler].quickDraw) && (gProtectStructs[gActiveBattler].usedCustapBerry || gProtectStructs[gActiveBattler].quickDraw)
&& !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)
&& !(gDisableStructs[gBattlerAttacker].truantCounter) && !(gDisableStructs[gBattlerAttacker].truantCounter)
&& !(gProtectStructs[gActiveBattler].noValidMoves)) && !(gProtectStructs[gActiveBattler].noValidMoves))
{ {
if (gProtectStructs[gActiveBattler].custap) if (gProtectStructs[gActiveBattler].usedCustapBerry)
{ {
gProtectStructs[gActiveBattler].custap = FALSE; gProtectStructs[gActiveBattler].usedCustapBerry = FALSE;
gLastUsedItem = gBattleMons[gActiveBattler].item; gLastUsedItem = gBattleMons[gActiveBattler].item;
PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem);
if (GetBattlerHoldEffect(gActiveBattler, FALSE) == HOLD_EFFECT_CUSTAP_BERRY) if (GetBattlerHoldEffect(gActiveBattler, FALSE) == HOLD_EFFECT_CUSTAP_BERRY)
@ -5127,23 +5138,24 @@ void RunBattleScriptCommands(void)
void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
{ {
u32 moveType, ateType, attackerAbility; u32 moveType, ateType, attackerAbility;
u16 holdEffect = GetBattlerHoldEffect(battlerAtk, TRUE);
if (move == MOVE_STRUGGLE) if (move == MOVE_STRUGGLE)
return; return;
gBattleStruct->dynamicMoveType = 0; gBattleStruct->dynamicMoveType = 0;
gBattleStruct->ateBoost[battlerAtk] = 0; gBattleStruct->ateBoost[battlerAtk] = 0;
gSpecialStatuses[battlerAtk].gemBoost = 0; gSpecialStatuses[battlerAtk].gemBoost = FALSE;
if (gBattleMoves[move].effect == EFFECT_WEATHER_BALL) if (gBattleMoves[move].effect == EFFECT_WEATHER_BALL)
{ {
if (WEATHER_HAS_EFFECT) if (WEATHER_HAS_EFFECT)
{ {
if (gBattleWeather & WEATHER_RAIN_ANY) if (gBattleWeather & WEATHER_RAIN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA)
gBattleStruct->dynamicMoveType = TYPE_WATER | 0x80; gBattleStruct->dynamicMoveType = TYPE_WATER | 0x80;
else if (gBattleWeather & WEATHER_SANDSTORM_ANY) else if (gBattleWeather & WEATHER_SANDSTORM_ANY)
gBattleStruct->dynamicMoveType = TYPE_ROCK | 0x80; gBattleStruct->dynamicMoveType = TYPE_ROCK | 0x80;
else if (gBattleWeather & WEATHER_SUN_ANY) else if (gBattleWeather & WEATHER_SUN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA)
gBattleStruct->dynamicMoveType = TYPE_FIRE | 0x80; gBattleStruct->dynamicMoveType = TYPE_FIRE | 0x80;
else if (gBattleWeather & WEATHER_HAIL_ANY) else if (gBattleWeather & WEATHER_HAIL_ANY)
gBattleStruct->dynamicMoveType = TYPE_ICE | 0x80; gBattleStruct->dynamicMoveType = TYPE_ICE | 0x80;
@ -5167,7 +5179,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
} }
else if (gBattleMoves[move].effect == EFFECT_CHANGE_TYPE_ON_ITEM) else if (gBattleMoves[move].effect == EFFECT_CHANGE_TYPE_ON_ITEM)
{ {
if (GetBattlerHoldEffect(battlerAtk, TRUE) == gBattleMoves[move].argument) if (holdEffect == gBattleMoves[move].argument)
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80; gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80;
} }
else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE) else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE)
@ -5224,14 +5236,18 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
{ {
gBattleStruct->dynamicMoveType = 0x80 | TYPE_ELECTRIC; gBattleStruct->dynamicMoveType = 0x80 | TYPE_ELECTRIC;
} }
else if (move == MOVE_AURA_WHEEL && gBattleMons[battlerAtk].species == SPECIES_MORPEKO_HANGRY)
{
gBattleStruct->dynamicMoveType = 0x80 | TYPE_DARK;
}
// Check if a gem should activate. // Check if a gem should activate.
GET_MOVE_TYPE(move, moveType); GET_MOVE_TYPE(move, moveType);
if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_GEMS if (holdEffect == HOLD_EFFECT_GEMS
&& moveType == ItemId_GetSecondaryId(gBattleMons[battlerAtk].item)) && moveType == ItemId_GetSecondaryId(gBattleMons[battlerAtk].item))
{ {
gSpecialStatuses[battlerAtk].gemParam = GetBattlerHoldEffectParam(battlerAtk); gSpecialStatuses[battlerAtk].gemParam = GetBattlerHoldEffectParam(battlerAtk);
gSpecialStatuses[battlerAtk].gemBoost = 1; gSpecialStatuses[battlerAtk].gemBoost = TRUE;
} }
} }

View File

@ -725,6 +725,9 @@ static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way i
static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!");
static const u8 sText_AbilityAllowsOnlyMove[] = _("{B_ATK_ABILITY} allows the\nuse of only {B_CURRENT_MOVE}!\p"); static const u8 sText_AbilityAllowsOnlyMove[] = _("{B_ATK_ABILITY} allows the\nuse of only {B_CURRENT_MOVE}!\p");
static const u8 sText_SwappedAbilities[] = _("{B_DEF_NAME_WITH_PREFIX} swapped Abilities\nwith its target!"); static const u8 sText_SwappedAbilities[] = _("{B_DEF_NAME_WITH_PREFIX} swapped Abilities\nwith its target!");
static const u8 sText_PastelVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby a pastel veil!");
static const u8 sText_PastelVeilEnters[] = _("{B_DEF_NAME_WITH_PREFIX} was cured\nof its poisoning!");
static const u8 sText_BattlerTypeChangedTo[] = _("{B_BUFF1}'s type\nchanged to {B_BUFF2}!");
static const u8 sText_NeutralizingGasEnters[] = _("Neutralizing Gas filled the area!"); static const u8 sText_NeutralizingGasEnters[] = _("Neutralizing Gas filled the area!");
static const u8 sText_NeutralizingGasOver[] = _("The effects of Neutralizing\nGas wore off!"); static const u8 sText_NeutralizingGasOver[] = _("The effects of Neutralizing\nGas wore off!");
@ -732,6 +735,9 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{ {
[STRINGID_NEUTRALIZINGGASOVER - 12] = sText_NeutralizingGasOver, [STRINGID_NEUTRALIZINGGASOVER - 12] = sText_NeutralizingGasOver,
[STRINGID_NEUTRALIZINGGASENTERS - 12] = sText_NeutralizingGasEnters, [STRINGID_NEUTRALIZINGGASENTERS - 12] = sText_NeutralizingGasEnters,
[STRINGID_BATTLERTYPECHANGEDTO - 12] = sText_BattlerTypeChangedTo,
[STRINGID_PASTELVEILENTERS - 12] = sText_PastelVeilEnters,
[STRINGID_PASTELVEILPROTECTED -12] = sText_PastelVeilProtected,
[STRINGID_SWAPPEDABILITIES - 12] = sText_SwappedAbilities, [STRINGID_SWAPPEDABILITIES - 12] = sText_SwappedAbilities,
[STRINGID_ABILITYALLOWSONLYMOVE - 12] = sText_AbilityAllowsOnlyMove, [STRINGID_ABILITYALLOWSONLYMOVE - 12] = sText_AbilityAllowsOnlyMove,
[STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection, [STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection,
@ -1198,7 +1204,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_PKMNTWISTEDDIMENSIONS - 12] = sText_PkmnTwistedDimensions, [STRINGID_PKMNTWISTEDDIMENSIONS - 12] = sText_PkmnTwistedDimensions,
[STRINGID_POINTEDSTONESFLOAT - 12] = sText_PointedStonesFloat, [STRINGID_POINTEDSTONESFLOAT - 12] = sText_PointedStonesFloat,
[STRINGID_CLOAKEDINMYSTICALMOONLIGHT - 12] = sText_CloakedInMysticalMoonlight, [STRINGID_CLOAKEDINMYSTICALMOONLIGHT - 12] = sText_CloakedInMysticalMoonlight,
[STRINGID_TRAPPERBYSWIRLINGMAGMA - 12] = sText_TrappedBySwirlingMagma, [STRINGID_TRAPPEDBYSWIRLINGMAGMA - 12] = sText_TrappedBySwirlingMagma,
[STRINGID_VANISHEDINSTANTLY - 12] = sText_VanishedInstantly, [STRINGID_VANISHEDINSTANTLY - 12] = sText_VanishedInstantly,
[STRINGID_PROTECTEDTEAM - 12] = sText_ProtectedTeam, [STRINGID_PROTECTEDTEAM - 12] = sText_ProtectedTeam,
[STRINGID_SHAREDITSGUARD - 12] = sText_SharedItsGuard, [STRINGID_SHAREDITSGUARD - 12] = sText_SharedItsGuard,
@ -1379,6 +1385,7 @@ const u16 gSwitchInAbilityStringIds[] =
[B_MSG_SWITCHIN_SCREENCLEANER] = STRINGID_SCREENCLEANERENTERS, [B_MSG_SWITCHIN_SCREENCLEANER] = STRINGID_SCREENCLEANERENTERS,
[B_MSG_SWITCHIN_ASONE] = STRINGID_ASONEENTERS, [B_MSG_SWITCHIN_ASONE] = STRINGID_ASONEENTERS,
[B_MSG_SWITCHIN_CURIOUS_MEDICINE] = STRINGID_CURIOUSMEDICINEENTERS, [B_MSG_SWITCHIN_CURIOUS_MEDICINE] = STRINGID_CURIOUSMEDICINEENTERS,
[B_MSG_SWITCHIN_PASTEL_VEIL] = STRINGID_PASTELVEILENTERS,
[B_MSG_SWITCHIN_NEUTRALIZING_GAS] = STRINGID_NEUTRALIZINGGASENTERS, [B_MSG_SWITCHIN_NEUTRALIZING_GAS] = STRINGID_NEUTRALIZINGGASENTERS,
}; };
@ -1533,16 +1540,17 @@ const u16 gFirstTurnOfTwoStringIds[] =
[B_MSG_TURN1_FREEZE_SHOCK] = STRINGID_CLOAKEDINAFREEZINGLIGHT, [B_MSG_TURN1_FREEZE_SHOCK] = STRINGID_CLOAKEDINAFREEZINGLIGHT,
}; };
// Index copied from move's index in gTrappingMoves // Index copied from move's index in sTrappingMoves
const u16 gWrappedStringIds[] = const u16 gWrappedStringIds[] =
{ {
STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND
STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP
STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN
STRINGID_PKMNCLAMPED, // MOVE_CLAMP STRINGID_PKMNCLAMPED, // MOVE_CLAMP
STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL
STRINGID_PKMNTRAPPEDBYSANDTOMB,// MOVE_SAND_TOMB STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB
STRINGID_INFESTATION, // MOVE_INFESTATION STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM
STRINGID_INFESTATION, // MOVE_INFESTATION
}; };
const u16 gMistUsedStringIds[] = const u16 gMistUsedStringIds[] =
@ -1753,11 +1761,6 @@ const u16 gCaughtMonStringIds[] =
[B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL,
}; };
const u16 gTrappingMoves[] =
{
MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, 0xFFFF
};
const u16 gRoomsStringIds[] = const u16 gRoomsStringIds[] =
{ {
STRINGID_PKMNTWISTEDDIMENSIONS, STRINGID_TRICKROOMENDS, STRINGID_PKMNTWISTEDDIMENSIONS, STRINGID_TRICKROOMENDS,

View File

@ -54,6 +54,7 @@
#include "constants/rgb.h" #include "constants/rgb.h"
#include "data.h" #include "data.h"
#include "constants/party_menu.h" #include "constants/party_menu.h"
#include "battle_util.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct Evolution gEvolutionTable[][EVOS_PER_MON]; extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
@ -278,6 +279,11 @@ static const s32 sExperienceScalingFactors[] =
159767, 159767,
}; };
static const u16 sTrappingMoves[] =
{
MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, 0xFFFF
};
#define STAT_CHANGE_WORKED 0 #define STAT_CHANGE_WORKED 0
#define STAT_CHANGE_DIDNT_WORK 1 #define STAT_CHANGE_DIDNT_WORK 1
@ -1436,8 +1442,8 @@ static void Cmd_attackcanceler(void)
&& !gProtectStructs[gBattlerAttacker].usesBouncedMove) && !gProtectStructs[gBattlerAttacker].usesBouncedMove)
{ {
PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT); PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT);
gProtectStructs[gBattlerTarget].bounceMove = 0; gProtectStructs[gBattlerTarget].bounceMove = FALSE;
gProtectStructs[gBattlerTarget].usesBouncedMove = 1; gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = 0;
if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker, TRUE)) if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker, TRUE))
{ {
@ -1457,7 +1463,7 @@ static void Cmd_attackcanceler(void)
&& !gProtectStructs[gBattlerAttacker].usesBouncedMove) && !gProtectStructs[gBattlerAttacker].usesBouncedMove)
{ {
RecordAbilityBattle(gBattlerTarget, ABILITY_MAGIC_BOUNCE); RecordAbilityBattle(gBattlerTarget, ABILITY_MAGIC_BOUNCE);
gProtectStructs[gBattlerTarget].usesBouncedMove = 1; gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = 1;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; gBattlescriptCurrInstr = BattleScript_MagicCoatBounce;
@ -1469,7 +1475,7 @@ static void Cmd_attackcanceler(void)
if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED) if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED)
{ {
PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH); PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH);
gProtectStructs[gBattlerByTurnOrder[i]].stealMove = 0; gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE;
gBattleScripting.battler = gBattlerByTurnOrder[i]; gBattleScripting.battler = gBattlerByTurnOrder[i];
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SnatchedMove; gBattlescriptCurrInstr = BattleScript_SnatchedMove;
@ -1479,7 +1485,7 @@ static void Cmd_attackcanceler(void)
if (gSpecialStatuses[gBattlerTarget].lightningRodRedirected) if (gSpecialStatuses[gBattlerTarget].lightningRodRedirected)
{ {
gSpecialStatuses[gBattlerTarget].lightningRodRedirected = 0; gSpecialStatuses[gBattlerTarget].lightningRodRedirected = FALSE;
gLastUsedAbility = ABILITY_LIGHTNING_ROD; gLastUsedAbility = ABILITY_LIGHTNING_ROD;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TookAttack; gBattlescriptCurrInstr = BattleScript_TookAttack;
@ -1487,7 +1493,7 @@ static void Cmd_attackcanceler(void)
} }
else if (gSpecialStatuses[gBattlerTarget].stormDrainRedirected) else if (gSpecialStatuses[gBattlerTarget].stormDrainRedirected)
{ {
gSpecialStatuses[gBattlerTarget].stormDrainRedirected = 0; gSpecialStatuses[gBattlerTarget].stormDrainRedirected = FALSE;
gLastUsedAbility = ABILITY_STORM_DRAIN; gLastUsedAbility = ABILITY_STORM_DRAIN;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TookAttack; gBattlescriptCurrInstr = BattleScript_TookAttack;
@ -1498,8 +1504,8 @@ static void Cmd_attackcanceler(void)
&& ((!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) && ((!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)))
&& gBattleMoves[gCurrentMove].effect != EFFECT_SUCKER_PUNCH) && gBattleMoves[gCurrentMove].effect != EFFECT_SUCKER_PUNCH)
{ {
if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) if (IsMoveMakingContact(gCurrentMove, gBattlerAttacker))
gProtectStructs[gBattlerAttacker].touchedProtectLike = 1; gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
@ -1598,12 +1604,13 @@ static bool32 AccuracyCalcHelper(u16 move)
} }
if ((WEATHER_HAS_EFFECT && if ((WEATHER_HAS_EFFECT &&
(((gBattleWeather & WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) ((IsBattlerWeatherAffected(gBattlerTarget, WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE))
|| ((B_BLIZZARD_HAIL >= GEN_4 && (gBattleWeather & WEATHER_HAIL_ANY) && move == MOVE_BLIZZARD)))) || ((B_BLIZZARD_HAIL >= GEN_4 && (gBattleWeather & WEATHER_HAIL_ANY) && move == MOVE_BLIZZARD))))
|| (gBattleMoves[move].effect == EFFECT_VITAL_THROW) || (gBattleMoves[move].effect == EFFECT_VITAL_THROW)
|| (gBattleMoves[move].accuracy == 0) || (gBattleMoves[move].accuracy == 0)
|| ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))) || ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE)))
{ {
// thunder/hurricane ignore acc checks in rain unless target is holding utility umbrella
JumpIfMoveFailed(7, move); JumpIfMoveFailed(7, move);
return TRUE; return TRUE;
} }
@ -1646,8 +1653,8 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move)
moveAcc = gBattleMoves[move].accuracy; moveAcc = gBattleMoves[move].accuracy;
// Check Thunder and Hurricane on sunny weather. // Check Thunder and Hurricane on sunny weather.
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY if (IsBattlerWeatherAffected(battlerDef, WEATHER_SUN_ANY)
&& (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE))
moveAcc = 50; moveAcc = 50;
// Check Wonder Skin. // Check Wonder Skin.
if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0) if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0)
@ -1681,9 +1688,9 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move)
else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)); else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef));
calc = (calc * (100 + atkParam)) / 100; calc = (calc * (100 + atkParam)) / 100;
if (gProtectStructs[battlerAtk].micle) if (gProtectStructs[battlerAtk].usedMicleBerry)
{ {
gProtectStructs[battlerAtk].micle = FALSE; gProtectStructs[battlerAtk].usedMicleBerry = FALSE;
if (atkAbility == ABILITY_RIPEN) if (atkAbility == ABILITY_RIPEN)
calc = (calc * 140) / 100; // ripen gives 40% acc boost calc = (calc * 140) / 100; // ripen gives 40% acc boost
else else
@ -1788,7 +1795,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 = TRUE;
// For item Metronome, echoed voice // For item Metronome, echoed voice
if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] if (gCurrentMove == gLastResultingMoves[gBattlerAttacker]
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
@ -1935,17 +1942,17 @@ static void Cmd_adjustdamage(void)
if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param) if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param)
{ {
RecordItemEffectBattle(gBattlerTarget, holdEffect); RecordItemEffectBattle(gBattlerTarget, holdEffect);
gSpecialStatuses[gBattlerTarget].focusBanded = 1; gSpecialStatuses[gBattlerTarget].focusBanded = TRUE;
} }
else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget))
{ {
RecordItemEffectBattle(gBattlerTarget, holdEffect); RecordItemEffectBattle(gBattlerTarget, holdEffect);
gSpecialStatuses[gBattlerTarget].focusSashed = 1; gSpecialStatuses[gBattlerTarget].focusSashed = TRUE;
} }
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STURDY && BATTLER_MAX_HP(gBattlerTarget)) else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STURDY && BATTLER_MAX_HP(gBattlerTarget))
{ {
RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY); RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY);
gSpecialStatuses[gBattlerTarget].sturdied = 1; gSpecialStatuses[gBattlerTarget].sturdied = TRUE;
} }
if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE
@ -2025,7 +2032,7 @@ static void Cmd_multihitresultmessage(void)
if (gMoveResultFlags & MOVE_RESULT_STURDIED) if (gMoveResultFlags & MOVE_RESULT_STURDIED)
{ {
gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON);
gSpecialStatuses[gBattlerTarget].sturdied = 0; // Delete this line to make Sturdy last for the duration of the whole move turn. gSpecialStatuses[gBattlerTarget].sturdied = FALSE; // Delete this line to make Sturdy last for the duration of the whole move turn.
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SturdiedMsg; gBattlescriptCurrInstr = BattleScript_SturdiedMsg;
return; return;
@ -2035,8 +2042,8 @@ static void Cmd_multihitresultmessage(void)
gLastUsedItem = gBattleMons[gBattlerTarget].item; gLastUsedItem = gBattleMons[gBattlerTarget].item;
gPotentialItemEffectBattler = gBattlerTarget; gPotentialItemEffectBattler = gBattlerTarget;
gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON);
gSpecialStatuses[gBattlerTarget].focusBanded = 0; // Delete this line to make Focus Band last for the duration of the whole move turn. gSpecialStatuses[gBattlerTarget].focusBanded = FALSE; // Delete this line to make Focus Band last for the duration of the whole move turn.
gSpecialStatuses[gBattlerTarget].focusSashed = 0; // Delete this line to make Focus Sash last for the duration of the whole move turn. gSpecialStatuses[gBattlerTarget].focusSashed = FALSE; // Delete this line to make Focus Sash last for the duration of the whole move turn.
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_HangedOnMsg; gBattlescriptCurrInstr = BattleScript_HangedOnMsg;
return; return;
@ -2048,7 +2055,7 @@ static void Cmd_multihitresultmessage(void)
if (gSpecialStatuses[gBattlerTarget].berryReduced if (gSpecialStatuses[gBattlerTarget].berryReduced
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{ {
gSpecialStatuses[gBattlerTarget].berryReduced = 0; gSpecialStatuses[gBattlerTarget].berryReduced = FALSE;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString;
} }
@ -2400,7 +2407,7 @@ static void Cmd_resultmessage(void)
else if (gMoveResultFlags & MOVE_RESULT_STURDIED) else if (gMoveResultFlags & MOVE_RESULT_STURDIED)
{ {
gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON); gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
gSpecialStatuses[gBattlerTarget].sturdied = 0; gSpecialStatuses[gBattlerTarget].sturdied = FALSE;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SturdiedMsg; gBattlescriptCurrInstr = BattleScript_SturdiedMsg;
return; return;
@ -2442,7 +2449,7 @@ static void Cmd_resultmessage(void)
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{ {
gLastUsedItem = gBattleMons[gBattlerTarget].item; gLastUsedItem = gBattleMons[gBattlerTarget].item;
gSpecialStatuses[gBattlerTarget].berryReduced = 0; gSpecialStatuses[gBattlerTarget].berryReduced = FALSE;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString;
} }
@ -2584,6 +2591,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
{ {
s32 i, byTwo, affectsUser = 0; s32 i, byTwo, affectsUser = 0;
bool32 statusChanged = FALSE; bool32 statusChanged = FALSE;
bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR);
u32 flags = 0;
switch (gBattleScripting.moveEffect) // Set move effects which happen later on switch (gBattleScripting.moveEffect) // Set move effects which happen later on
{ {
@ -2682,15 +2691,13 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT;
RESET_RETURN RESET_RETURN
} }
if (!CanPoisonType(gBattleScripting.battler, gEffectBattler)) if (!CanBePoisoned(gBattleScripting.battler, gEffectBattler))
break;
if (!CanBePoisoned(gEffectBattler))
break; break;
statusChanged = TRUE; statusChanged = TRUE;
break; break;
case STATUS1_BURN: case STATUS1_BURN:
if (gCurrentMove == MOVE_BURNING_JEALOUSY && gProtectStructs[gEffectBattler].statRaised == 0) if (gCurrentMove == MOVE_BURNING_JEALOUSY && !gProtectStructs[gEffectBattler].statRaised)
break; break;
if ((GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL || GetBattlerAbility(gEffectBattler) == ABILITY_WATER_BUBBLE) if ((GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL || GetBattlerAbility(gEffectBattler) == ABILITY_WATER_BUBBLE)
@ -2809,11 +2816,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
} }
if (gBattleMons[gEffectBattler].status1) if (gBattleMons[gEffectBattler].status1)
break; break;
if (CanPoisonType(gBattleScripting.battler, gEffectBattler)) if (CanBePoisoned(gBattleScripting.battler, gEffectBattler))
{ {
if (!CanBePoisoned(gEffectBattler))
break;
// It's redundant, because at this point we know the status1 value is 0. // It's redundant, because at this point we know the status1 value is 0.
gBattleMons[gEffectBattler].status1 &= ~(STATUS1_TOXIC_POISON); gBattleMons[gEffectBattler].status1 &= ~(STATUS1_TOXIC_POISON);
gBattleMons[gEffectBattler].status1 &= ~(STATUS1_POISON); gBattleMons[gEffectBattler].status1 &= ~(STATUS1_POISON);
@ -2955,7 +2959,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
case MOVE_EFFECT_CHARGING: case MOVE_EFFECT_CHARGING:
gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS;
gLockedMoves[gEffectBattler] = gCurrentMove; gLockedMoves[gEffectBattler] = gCurrentMove;
gProtectStructs[gEffectBattler].chargingTurn = 1; gProtectStructs[gEffectBattler].chargingTurn = TRUE;
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
break; break;
case MOVE_EFFECT_WRAP: case MOVE_EFFECT_WRAP:
@ -2979,9 +2983,9 @@ void SetMoveEffect(bool32 primary, u32 certain)
for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++)
{ {
if (gBattleCommunication[MULTISTRING_CHOOSER] > 5) if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves) - 1)
break; break;
if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove)
break; break;
} }
} }
@ -3014,11 +3018,16 @@ void SetMoveEffect(bool32 primary, u32 certain)
case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_SP_DEF_MINUS_1:
case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1:
case MOVE_EFFECT_EVS_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1:
flags = affectsUser;
if (mirrorArmorReflected && !affectsUser)
flags |= STAT_BUFF_ALLOW_PTR;
if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE,
gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1,
affectsUser, 0)) flags, gBattlescriptCurrInstr + 1))
{ {
gBattlescriptCurrInstr++; if (!mirrorArmorReflected)
gBattlescriptCurrInstr++;
} }
else else
{ {
@ -3056,11 +3065,15 @@ void SetMoveEffect(bool32 primary, u32 certain)
case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_SP_DEF_MINUS_2:
case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2:
case MOVE_EFFECT_EVS_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2:
flags = affectsUser;
if (mirrorArmorReflected && !affectsUser)
flags |= STAT_BUFF_ALLOW_PTR;
if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE, if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE,
gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_2 + 1, gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_2 + 1,
affectsUser, 0)) flags, gBattlescriptCurrInstr + 1))
{ {
gBattlescriptCurrInstr++; if (!mirrorArmorReflected)
gBattlescriptCurrInstr++;
} }
else else
{ {
@ -3280,15 +3293,15 @@ void SetMoveEffect(bool32 primary, u32 certain)
case MOVE_EFFECT_FEINT: case MOVE_EFFECT_FEINT:
if (IS_BATTLER_PROTECTED(gBattlerTarget)) if (IS_BATTLER_PROTECTED(gBattlerTarget))
{ {
gProtectStructs[gBattlerTarget].protected = 0; gProtectStructs[gBattlerTarget].protected = FALSE;
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD); gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD);
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_QUICK_GUARD); gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_QUICK_GUARD);
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_CRAFTY_SHIELD); gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_CRAFTY_SHIELD);
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_MAT_BLOCK); gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_MAT_BLOCK);
gProtectStructs[gBattlerTarget].spikyShielded = 0; gProtectStructs[gBattlerTarget].spikyShielded = FALSE;
gProtectStructs[gBattlerTarget].kingsShielded = 0; gProtectStructs[gBattlerTarget].kingsShielded = FALSE;
gProtectStructs[gBattlerTarget].banefulBunkered = 0; gProtectStructs[gBattlerTarget].banefulBunkered = FALSE;
gProtectStructs[gBattlerTarget].obstructed = 0; gProtectStructs[gBattlerTarget].obstructed = FALSE;
if (gCurrentMove == MOVE_FEINT) if (gCurrentMove == MOVE_FEINT)
{ {
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@ -3392,6 +3405,21 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlescriptCurrInstr = BattleScript_MoveEffectBugBite; gBattlescriptCurrInstr = BattleScript_MoveEffectBugBite;
} }
break; break;
case MOVE_EFFECT_RELIC_SONG:
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SHEER_FORCE)
{
if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA)
{
gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA_PIROUETTE;
BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect);
}
else if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA_PIROUETTE)
{
gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA;
BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect);
}
}
break;
} }
} }
} }
@ -4841,7 +4869,7 @@ static void Cmd_moveend(void)
{ {
if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
{ {
gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
@ -4852,7 +4880,7 @@ static void Cmd_moveend(void)
} }
else if (gProtectStructs[gBattlerTarget].kingsShielded) else if (gProtectStructs[gBattlerTarget].kingsShielded)
{ {
gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
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
@ -4863,7 +4891,7 @@ static void Cmd_moveend(void)
} }
else if (gProtectStructs[gBattlerTarget].banefulBunkered) else if (gProtectStructs[gBattlerTarget].banefulBunkered)
{ {
gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
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();
@ -5023,7 +5051,7 @@ static void Cmd_moveend(void)
BtlController_EmitSpriteInvisibility(0, FALSE); BtlController_EmitSpriteInvisibility(0, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE); gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE);
gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1; gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = TRUE;
gBattleScripting.moveendState++; gBattleScripting.moveendState++;
return; return;
} }
@ -5129,7 +5157,7 @@ static void Cmd_moveend(void)
// Set a flag if move hits either target (for throat spray that can't check damage) // Set a flag if move hits either target (for throat spray that can't check damage)
if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
gProtectStructs[gBattlerAttacker].targetAffected = 1; gProtectStructs[gBattlerAttacker].targetAffected = TRUE;
if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
&& gBattleTypeFlags & BATTLE_TYPE_DOUBLE && gBattleTypeFlags & BATTLE_TYPE_DOUBLE
@ -5327,7 +5355,7 @@ static void Cmd_moveend(void)
{ {
gBattleScripting.savedBattler = gBattlerTarget | 0x4; gBattleScripting.savedBattler = gBattlerTarget | 0x4;
gBattleScripting.savedBattler |= (gBattlerAttacker << 4); gBattleScripting.savedBattler |= (gBattlerAttacker << 4);
gSpecialStatuses[gBattlerAttacker].dancerUsedMove = 1; gSpecialStatuses[gBattlerAttacker].dancerUsedMove = TRUE;
} }
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
{ {
@ -5375,13 +5403,13 @@ static void Cmd_moveend(void)
*(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].instructedChosenTarget & 0x3; *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].instructedChosenTarget & 0x3;
if (gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget) if (gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget)
*(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget & 0x3; *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget & 0x3;
gProtectStructs[gBattlerAttacker].usesBouncedMove = 0; gProtectStructs[gBattlerAttacker].usesBouncedMove = FALSE;
gProtectStructs[gBattlerAttacker].targetAffected = 0; gProtectStructs[gBattlerAttacker].targetAffected = FALSE;
gBattleStruct->ateBoost[gBattlerAttacker] = 0; gBattleStruct->ateBoost[gBattlerAttacker] = 0;
gStatuses3[gBattlerAttacker] &= ~(STATUS3_ME_FIRST); gStatuses3[gBattlerAttacker] &= ~(STATUS3_ME_FIRST);
gSpecialStatuses[gBattlerAttacker].gemBoost = 0; gSpecialStatuses[gBattlerAttacker].gemBoost = FALSE;
gSpecialStatuses[gBattlerAttacker].damagedMons = 0; gSpecialStatuses[gBattlerAttacker].damagedMons = 0;
gSpecialStatuses[gBattlerTarget].berryReduced = 0; gSpecialStatuses[gBattlerTarget].berryReduced = FALSE;
gBattleScripting.moveEffect = 0; gBattleScripting.moveEffect = 0;
gBattleScripting.moveendState++; gBattleScripting.moveendState++;
break; break;
@ -7266,9 +7294,8 @@ static void HandleTerrainMove(u32 moveEffect)
bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget) bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget)
{ {
return (GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION return ((GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS)
|| !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL)));
|| IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL)));
} }
bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget) bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget)
@ -7345,7 +7372,7 @@ u32 IsFlowerVeilProtected(u32 battler)
u32 IsLeafGuardProtected(u32 battler) u32 IsLeafGuardProtected(u32 battler)
{ {
if (WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY)) if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY))
return GetBattlerAbility(battler) == ABILITY_LEAF_GUARD; return GetBattlerAbility(battler) == ABILITY_LEAF_GUARD;
else else
return 0; return 0;
@ -7662,9 +7689,9 @@ static void Cmd_various(void)
gBattleCommunication[0] = FALSE; gBattleCommunication[0] = FALSE;
break; break;
case VARIOUS_RESET_INTIMIDATE_TRACE_BITS: case VARIOUS_RESET_INTIMIDATE_TRACE_BITS:
gSpecialStatuses[gActiveBattler].intimidatedMon = 0; gSpecialStatuses[gActiveBattler].intimidatedMon = FALSE;
gSpecialStatuses[gActiveBattler].traced = 0; gSpecialStatuses[gActiveBattler].traced = FALSE;
gSpecialStatuses[gActiveBattler].switchInAbilityDone = 0; gSpecialStatuses[gActiveBattler].switchInAbilityDone = FALSE;
break; break;
case VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP: case VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP:
if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId || gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId) if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId || gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId)
@ -8294,6 +8321,9 @@ static void Cmd_various(void)
case VARIOUS_ARGUMENT_STATUS_EFFECT: case VARIOUS_ARGUMENT_STATUS_EFFECT:
switch (gBattleMoves[gCurrentMove].argument) switch (gBattleMoves[gCurrentMove].argument)
{ {
case STATUS1_SLEEP:
gBattleScripting.moveEffect = MOVE_EFFECT_SLEEP;
break;
case STATUS1_BURN: case STATUS1_BURN:
gBattleScripting.moveEffect = MOVE_EFFECT_BURN; gBattleScripting.moveEffect = MOVE_EFFECT_BURN;
break; break;
@ -8865,6 +8895,7 @@ static void Cmd_various(void)
break; break;
} }
gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain
TryToRevertMimicry(); // restore the types of Pokémon with Mimicry
break; break;
case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED: case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED:
if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gActiveBattler, TRUE)) if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gActiveBattler, TRUE))
@ -8994,6 +9025,15 @@ static void Cmd_various(void)
else else
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
return; return;
case VARIOUS_JUMP_IF_WEATHER_AFFECTED:
{
u32 weatherFlags = T1_READ_32(gBattlescriptCurrInstr + 3);
if (IsBattlerWeatherAffected(gActiveBattler, weatherFlags))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7);
else
gBattlescriptCurrInstr += 11;
}
return;
} }
case VARIOUS_APPLY_PLASMA_FISTS: case VARIOUS_APPLY_PLASMA_FISTS:
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
@ -9005,6 +9045,95 @@ static void Cmd_various(void)
else else
gBattlescriptCurrInstr += 9; gBattlescriptCurrInstr += 9;
return; return;
case VARIOUS_PHOTON_GEYSER_CHECK:
{
u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack;
u8 attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK];
u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack;
gSwapDamageCategory = FALSE;
attackerAtkStat *= gStatStageRatios[attackerAtkStage][0];
attackerAtkStat /= gStatStageRatios[attackerAtkStage][1];
attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK];
attackerSpAtkStat *= gStatStageRatios[attackerAtkStage][0];
attackerSpAtkStat /= gStatStageRatios[attackerAtkStage][1];
if (attackerAtkStat > attackerSpAtkStat)
gSwapDamageCategory = TRUE;
break;
}
case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment
{
u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack;
u32 targetDefStat = gBattleMons[gBattlerTarget].defense;
u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack;
u32 targetSpDefStat = gBattleMons[gBattlerTarget].spDefense;
u8 statStage;
u32 physical;
u32 special;
gSwapDamageCategory = FALSE;
statStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK];
attackerAtkStat *= gStatStageRatios[statStage][0];
attackerAtkStat /= gStatStageRatios[statStage][1];
statStage = gBattleMons[gBattlerTarget].statStages[STAT_DEF];
targetDefStat *= gStatStageRatios[statStage][0];
targetDefStat /= gStatStageRatios[statStage][1];
physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerAtkStat) / targetDefStat) / 50);
statStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK];
attackerSpAtkStat *= gStatStageRatios[statStage][0];
attackerSpAtkStat /= gStatStageRatios[statStage][1];
statStage = gBattleMons[gBattlerTarget].statStages[STAT_SPDEF];
targetSpDefStat *= gStatStageRatios[statStage][0];
targetSpDefStat /= gStatStageRatios[statStage][1];
special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerSpAtkStat) / targetSpDefStat) / 50);
if (((physical > special) || (physical == special && (Random() % 2) == 0)))
gSwapDamageCategory = TRUE;
break;
}
case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED:
if (IsLeafGuardProtected(gActiveBattler))
{
gBattlerAbility = gActiveBattler;
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
}
else
{
gBattlescriptCurrInstr += 7;
}
return;
case VARIOUS_SET_ATTACKER_STICKY_WEB_USER:
// For Mirror Armor: "If the Pokémon with this Ability is affected by Sticky Web, the effect is reflected back to the Pokémon which set it up.
// If Pokémon which set up Sticky Web is not on the field, no Pokémon have their Speed lowered."
gBattlerAttacker = gBattlerTarget; // Initialize 'fail' condition
SET_STATCHANGER(STAT_SPEED, 1, TRUE);
if (gBattleStruct->stickyWebUser != 0xFF)
gBattlerAttacker = gBattleStruct->stickyWebUser;
break;
case VARIOUS_TRY_TO_APPLY_MIMICRY:
{
bool8 isMimicryDone = FALSE;
if (GetBattlerAbility(gActiveBattler) == ABILITY_MIMICRY)
{
TryToApplyMimicry(gActiveBattler, TRUE);
isMimicryDone = TRUE;
}
if (!isMimicryDone)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
else
gBattlescriptCurrInstr += 7;
return;
}
} }
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;
@ -9027,32 +9156,32 @@ static void Cmd_setprotectlike(void)
{ {
if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE) if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE)
{ {
gProtectStructs[gBattlerAttacker].endured = 1; gProtectStructs[gBattlerAttacker].endured = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF;
} }
else if (gCurrentMove == MOVE_DETECT || gCurrentMove == MOVE_PROTECT) else if (gCurrentMove == MOVE_DETECT || gCurrentMove == MOVE_PROTECT)
{ {
gProtectStructs[gBattlerAttacker].protected = 1; gProtectStructs[gBattlerAttacker].protected = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF;
} }
else if (gCurrentMove == MOVE_SPIKY_SHIELD) else if (gCurrentMove == MOVE_SPIKY_SHIELD)
{ {
gProtectStructs[gBattlerAttacker].spikyShielded = 1; gProtectStructs[gBattlerAttacker].spikyShielded = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF;
} }
else if (gCurrentMove == MOVE_KINGS_SHIELD) else if (gCurrentMove == MOVE_KINGS_SHIELD)
{ {
gProtectStructs[gBattlerAttacker].kingsShielded = 1; gProtectStructs[gBattlerAttacker].kingsShielded = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF;
} }
else if (gCurrentMove == MOVE_BANEFUL_BUNKER) else if (gCurrentMove == MOVE_BANEFUL_BUNKER)
{ {
gProtectStructs[gBattlerAttacker].banefulBunkered = 1; gProtectStructs[gBattlerAttacker].banefulBunkered = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF;
} }
else if (gCurrentMove == MOVE_OBSTRUCT) else if (gCurrentMove == MOVE_OBSTRUCT)
{ {
gProtectStructs[gBattlerAttacker].obstructed = 1; gProtectStructs[gBattlerAttacker].obstructed = TRUE;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = 0;
} }
@ -9217,7 +9346,7 @@ static void Cmd_trymirrormove(void)
} }
else else
{ {
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
} }
@ -9538,8 +9667,9 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
bool32 certain = FALSE; bool32 certain = FALSE;
bool32 notProtectAffected = FALSE; bool32 notProtectAffected = FALSE;
u32 index; u32 index;
bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER);
if (flags & MOVE_EFFECT_AFFECTS_USER) if (affectsUser)
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
else else
gActiveBattler = gBattlerTarget; gActiveBattler = gBattlerTarget;
@ -9585,7 +9715,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
BattleScriptPush(BS_ptr); BattleScriptPush(BS_ptr);
gBattleScripting.battler = gActiveBattler; gBattleScripting.battler = gActiveBattler;
gBattlescriptCurrInstr = BattleScript_MistProtected; gBattlescriptCurrInstr = BattleScript_MistProtected;
gSpecialStatuses[gActiveBattler].statLowered = 1; gSpecialStatuses[gActiveBattler].statLowered = TRUE;
} }
} }
return STAT_CHANGE_DIDNT_WORK; return STAT_CHANGE_DIDNT_WORK;
@ -9615,7 +9745,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
gBattlescriptCurrInstr = BattleScript_AbilityNoStatLoss; gBattlescriptCurrInstr = BattleScript_AbilityNoStatLoss;
gLastUsedAbility = GetBattlerAbility(gActiveBattler); gLastUsedAbility = GetBattlerAbility(gActiveBattler);
RecordAbilityBattle(gActiveBattler, gLastUsedAbility); RecordAbilityBattle(gActiveBattler, gLastUsedAbility);
gSpecialStatuses[gActiveBattler].statLowered = 1; gSpecialStatuses[gActiveBattler].statLowered = TRUE;
} }
} }
return STAT_CHANGE_DIDNT_WORK; return STAT_CHANGE_DIDNT_WORK;
@ -9635,13 +9765,14 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
gBattlerAbility = index - 1; gBattlerAbility = index - 1;
gBattlescriptCurrInstr = BattleScript_FlowerVeilProtectsRet; gBattlescriptCurrInstr = BattleScript_FlowerVeilProtectsRet;
gLastUsedAbility = ABILITY_FLOWER_VEIL; gLastUsedAbility = ABILITY_FLOWER_VEIL;
gSpecialStatuses[gActiveBattler].statLowered = 1; gSpecialStatuses[gActiveBattler].statLowered = TRUE;
} }
} }
return STAT_CHANGE_DIDNT_WORK; return STAT_CHANGE_DIDNT_WORK;
} }
else if (GetBattlerAbility(gActiveBattler) == ABILITY_KEEN_EYE else if (!certain
&& !certain && statId == STAT_ACC) && ((GetBattlerAbility(gActiveBattler) == ABILITY_KEEN_EYE && statId == STAT_ACC)
|| (GetBattlerAbility(gActiveBattler) == ABILITY_HYPER_CUTTER && statId == STAT_ATK)))
{ {
if (flags == STAT_BUFF_ALLOW_PTR) if (flags == STAT_BUFF_ALLOW_PTR)
{ {
@ -9654,17 +9785,16 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
} }
return STAT_CHANGE_DIDNT_WORK; return STAT_CHANGE_DIDNT_WORK;
} }
else if (GetBattlerAbility(gActiveBattler) == ABILITY_HYPER_CUTTER else if (GetBattlerAbility(gActiveBattler) == ABILITY_MIRROR_ARMOR && !affectsUser && gBattlerAttacker != gBattlerTarget && gActiveBattler == gBattlerTarget)
&& !certain && statId == STAT_ATK)
{ {
if (flags == STAT_BUFF_ALLOW_PTR) if (flags == STAT_BUFF_ALLOW_PTR)
{ {
SET_STATCHANGER(statId, GET_STAT_BUFF_VALUE(statValue) | STAT_BUFF_NEGATIVE, TRUE);
BattleScriptPush(BS_ptr); BattleScriptPush(BS_ptr);
gBattleScripting.battler = gActiveBattler; gBattleScripting.battler = gActiveBattler;
gBattlerAbility = gActiveBattler; gBattlerAbility = gActiveBattler;
gBattlescriptCurrInstr = BattleScript_AbilityNoSpecificStatLoss; gBattlescriptCurrInstr = BattleScript_MirrorArmorReflect;
gLastUsedAbility = GetBattlerAbility(gActiveBattler); RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability);
RecordAbilityBattle(gActiveBattler, gLastUsedAbility);
} }
return STAT_CHANGE_DIDNT_WORK; return STAT_CHANGE_DIDNT_WORK;
} }
@ -9709,7 +9839,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
} }
else else
{ {
gProtectStructs[gActiveBattler].statFell = 1; // Eject pack, lash out gProtectStructs[gActiveBattler].statFell = TRUE; // Eject pack, lash out
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL
} }
} }
@ -9752,7 +9882,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler);
gProtectStructs[gActiveBattler].statRaised = 1; gProtectStructs[gActiveBattler].statRaised = TRUE;
} }
} }
@ -10207,12 +10337,12 @@ static void Cmd_tryKO(void)
if (holdEffect == HOLD_EFFECT_FOCUS_BAND if (holdEffect == HOLD_EFFECT_FOCUS_BAND
&& (Random() % 100) < GetBattlerHoldEffectParam(gBattlerTarget)) && (Random() % 100) < GetBattlerHoldEffectParam(gBattlerTarget))
{ {
gSpecialStatuses[gBattlerTarget].focusBanded = 1; gSpecialStatuses[gBattlerTarget].focusBanded = TRUE;
RecordItemEffectBattle(gBattlerTarget, holdEffect); RecordItemEffectBattle(gBattlerTarget, holdEffect);
} }
else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget))
{ {
gSpecialStatuses[gBattlerTarget].focusSashed = 1; gSpecialStatuses[gBattlerTarget].focusSashed = TRUE;
RecordItemEffectBattle(gBattlerTarget, holdEffect); RecordItemEffectBattle(gBattlerTarget, holdEffect);
} }
@ -10626,7 +10756,7 @@ static void Cmd_counterdamagecalculator(void)
} }
else else
{ {
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
} }
@ -10651,7 +10781,7 @@ static void Cmd_mirrorcoatdamagecalculator(void) // a copy of atkA1 with the phy
} }
else else
{ {
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
} }
@ -10866,11 +10996,12 @@ static bool8 IsTwoTurnsMove(u16 move)
return FALSE; return FALSE;
} }
// unused
static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2 static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2
{ {
// first argument is unused // first argument is unused
if (gBattleMoves[move].effect == EFFECT_SOLARBEAM if (gBattleMoves[move].effect == EFFECT_SOLARBEAM
&& (gBattleWeather & WEATHER_SUN_ANY)) && IsBattlerWeatherAffected(battlerId, WEATHER_SUN_ANY))
return 2; return 2;
if (gBattleMoves[move].effect == EFFECT_SKULL_BASH if (gBattleMoves[move].effect == EFFECT_SKULL_BASH
@ -11140,7 +11271,7 @@ static void Cmd_trysetspikes(void)
if (gSideTimers[targetSide].spikesAmount == 3) if (gSideTimers[targetSide].spikesAmount == 3)
{ {
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
else else
@ -11528,7 +11659,7 @@ static void Cmd_recoverbasedonsunlight(void)
} }
else else
{ {
if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT) if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT || GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA)
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
else if (gBattleWeather & WEATHER_SUN_ANY) else if (gBattleWeather & WEATHER_SUN_ANY)
gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30;
@ -11559,6 +11690,7 @@ static void Cmd_setstickyweb(void)
{ {
gSideStatuses[targetSide] |= SIDE_STATUS_STICKY_WEB; gSideStatuses[targetSide] |= SIDE_STATUS_STICKY_WEB;
gSideTimers[targetSide].stickyWebAmount = 1; gSideTimers[targetSide].stickyWebAmount = 1;
gBattleStruct->stickyWebUser = gBattlerAttacker; // For Mirror Armor
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
} }
@ -11834,7 +11966,7 @@ static void Cmd_trysethelpinghand(void)
&& !gProtectStructs[gBattlerAttacker].helpingHand && !gProtectStructs[gBattlerAttacker].helpingHand
&& !gProtectStructs[gBattlerTarget].helpingHand) && !gProtectStructs[gBattlerTarget].helpingHand)
{ {
gProtectStructs[gBattlerTarget].helpingHand = 1; gProtectStructs[gBattlerTarget].helpingHand = TRUE;
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
else else
@ -12257,28 +12389,28 @@ static void Cmd_assistattackselect(void)
static void Cmd_trysetmagiccoat(void) static void Cmd_trysetmagiccoat(void)
{ {
gBattlerTarget = gBattlerAttacker; gBattlerTarget = gBattlerAttacker;
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
else else
{ {
gProtectStructs[gBattlerAttacker].bounceMove = 1; gProtectStructs[gBattlerAttacker].bounceMove = TRUE;
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
} }
static void Cmd_trysetsnatch(void) // snatch static void Cmd_trysetsnatch(void) // snatch
{ {
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
else else
{ {
gProtectStructs[gBattlerAttacker].stealMove = 1; gProtectStructs[gBattlerAttacker].stealMove = TRUE;
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
} }
@ -12813,7 +12945,7 @@ static void Cmd_handleballthrow(void)
gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = 0; gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = 0;
if (CriticalCapture(odds)) if (CriticalCapture(odds))
{ {
maxShakes = 1; //critical capture doesn't gauarantee capture maxShakes = 1; //critical capture doesn't guarantee capture
gBattleSpritesDataPtr->animationData->isCriticalCapture = 1; gBattleSpritesDataPtr->animationData->isCriticalCapture = 1;
} }
else else
@ -13276,7 +13408,7 @@ static void Cmd_metalburstdamagecalculator(void)
} }
else else
{ {
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
} }
@ -13313,4 +13445,3 @@ static bool32 CriticalCapture(u32 odds)
return FALSE; return FALSE;
#endif #endif
} }

View File

@ -256,7 +256,7 @@ void HandleAction_UseMove(void)
// choose move // choose move
if (gProtectStructs[gBattlerAttacker].noValidMoves) if (gProtectStructs[gBattlerAttacker].noValidMoves)
{ {
gProtectStructs[gBattlerAttacker].noValidMoves = 0; gProtectStructs[gBattlerAttacker].noValidMoves = FALSE;
gCurrentMove = gChosenMove = MOVE_STRUGGLE; gCurrentMove = gChosenMove = MOVE_STRUGGLE;
gHitMarker |= HITMARKER_NO_PPDEDUCT; gHitMarker |= HITMARKER_NO_PPDEDUCT;
*(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(MOVE_STRUGGLE, 0); *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(MOVE_STRUGGLE, 0);
@ -388,9 +388,9 @@ void HandleAction_UseMove(void)
gActiveBattler = gBattlerByTurnOrder[var]; gActiveBattler = gBattlerByTurnOrder[var];
RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability);
if (GetBattlerAbility(gActiveBattler) == ABILITY_LIGHTNING_ROD) if (GetBattlerAbility(gActiveBattler) == ABILITY_LIGHTNING_ROD)
gSpecialStatuses[gActiveBattler].lightningRodRedirected = 1; gSpecialStatuses[gActiveBattler].lightningRodRedirected = TRUE;
else if (GetBattlerAbility(gActiveBattler) == ABILITY_STORM_DRAIN) else if (GetBattlerAbility(gActiveBattler) == ABILITY_STORM_DRAIN)
gSpecialStatuses[gActiveBattler].stormDrainRedirected = 1; gSpecialStatuses[gActiveBattler].stormDrainRedirected = TRUE;
gBattlerTarget = gActiveBattler; gBattlerTarget = gActiveBattler;
} }
} }
@ -1618,7 +1618,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1633,7 +1633,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1648,7 +1648,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1663,7 +1663,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveThroatChopInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveThroatChopInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1678,7 +1678,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1693,7 +1693,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveGravityInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveGravityInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1708,7 +1708,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveHealBlockInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveHealBlockInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1723,7 +1723,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedBelchInPalace; gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedBelchInPalace;
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1754,7 +1754,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
gLastUsedItem = gBattleMons[gActiveBattler].item; gLastUsedItem = gBattleMons[gActiveBattler].item;
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1768,7 +1768,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
gLastUsedItem = gBattleMons[gActiveBattler].item; gLastUsedItem = gBattleMons[gActiveBattler].item;
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1796,7 +1796,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;
} }
else else
{ {
@ -1859,12 +1859,12 @@ bool8 AreAllMovesUnusable(void)
if (unusable == 0xF) // All moves are unusable. if (unusable == 0xF) // All moves are unusable.
{ {
gProtectStructs[gActiveBattler].noValidMoves = 1; gProtectStructs[gActiveBattler].noValidMoves = TRUE;
gSelectionBattleScripts[gActiveBattler] = BattleScript_NoMovesLeft; gSelectionBattleScripts[gActiveBattler] = BattleScript_NoMovesLeft;
} }
else else
{ {
gProtectStructs[gActiveBattler].noValidMoves = 0; gProtectStructs[gActiveBattler].noValidMoves = FALSE;
} }
return (unusable == 0xF); return (unusable == 0xF);
@ -1894,6 +1894,57 @@ u8 GetImprisonedMovesCount(u8 battlerId, u16 move)
return imprisonedMoves; return imprisonedMoves;
} }
void RestoreBattlerOriginalTypes(u8 battlerId)
{
gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1;
gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2;
}
void TryToApplyMimicry(u8 battlerId, bool8 various)
{
u32 moveType, move;
GET_MOVE_TYPE(move, moveType);
switch (gFieldStatuses)
{
case STATUS_FIELD_ELECTRIC_TERRAIN:
moveType = TYPE_ELECTRIC;
break;
case STATUS_FIELD_MISTY_TERRAIN:
moveType = TYPE_FAIRY;
break;
case STATUS_FIELD_GRASSY_TERRAIN:
moveType = TYPE_GRASS;
break;
case STATUS_FIELD_PSYCHIC_TERRAIN:
moveType = TYPE_PSYCHIC;
break;
default:
moveType = 0;
break;
}
if (moveType != 0 && !IS_BATTLER_OF_TYPE(battlerId, moveType))
{
SET_BATTLER_TYPE(battlerId, moveType);
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, battlerId, gBattlerPartyIndexes[battlerId])
PREPARE_TYPE_BUFFER(gBattleTextBuff2, moveType);
if (!various)
BattleScriptPushCursorAndCallback(BattleScript_MimicryActivatesEnd3);
}
}
void TryToRevertMimicry(void)
{
s32 i;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerAbility(i) == ABILITY_MIMICRY)
RestoreBattlerOriginalTypes(i);
}
}
enum enum
{ {
ENDTURN_ORDER, ENDTURN_ORDER,
@ -2278,6 +2329,7 @@ u8 DoFieldEndTurnEffects(void)
&& (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.electricTerrainTimer == 0)) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.electricTerrainTimer == 0))
{ {
gFieldStatuses &= ~(STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); gFieldStatuses &= ~(STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT);
TryToRevertMimicry();
BattleScriptExecute(BattleScript_ElectricTerrainEnds); BattleScriptExecute(BattleScript_ElectricTerrainEnds);
effect++; effect++;
} }
@ -2288,6 +2340,7 @@ u8 DoFieldEndTurnEffects(void)
&& (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.mistyTerrainTimer == 0)) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.mistyTerrainTimer == 0))
{ {
gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN); gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN);
TryToRevertMimicry();
BattleScriptExecute(BattleScript_MistyTerrainEnds); BattleScriptExecute(BattleScript_MistyTerrainEnds);
effect++; effect++;
} }
@ -2298,8 +2351,10 @@ u8 DoFieldEndTurnEffects(void)
{ {
if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT)
&& (gFieldTimers.grassyTerrainTimer == 0 || --gFieldTimers.grassyTerrainTimer == 0)) && (gFieldTimers.grassyTerrainTimer == 0 || --gFieldTimers.grassyTerrainTimer == 0))
{
gFieldStatuses &= ~(STATUS_FIELD_GRASSY_TERRAIN); gFieldStatuses &= ~(STATUS_FIELD_GRASSY_TERRAIN);
TryToRevertMimicry();
}
BattleScriptExecute(BattleScript_GrassyTerrainHeals); BattleScriptExecute(BattleScript_GrassyTerrainHeals);
effect++; effect++;
} }
@ -2310,6 +2365,7 @@ u8 DoFieldEndTurnEffects(void)
&& (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.psychicTerrainTimer == 0)) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.psychicTerrainTimer == 0))
{ {
gFieldStatuses &= ~(STATUS_FIELD_PSYCHIC_TERRAIN); gFieldStatuses &= ~(STATUS_FIELD_PSYCHIC_TERRAIN);
TryToRevertMimicry();
BattleScriptExecute(BattleScript_PsychicTerrainEnds); BattleScriptExecute(BattleScript_PsychicTerrainEnds);
effect++; effect++;
} }
@ -3269,7 +3325,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_FLINCH: // flinch case CANCELLER_FLINCH: // flinch
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FLINCHED) if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FLINCHED)
{ {
gProtectStructs[gBattlerAttacker].flinchImmobility = 1; gProtectStructs[gBattlerAttacker].flinchImmobility = TRUE;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched; gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
@ -3280,7 +3336,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_DISABLED: // disabled move case CANCELLER_DISABLED: // disabled move
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0) if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0)
{ {
gProtectStructs[gBattlerAttacker].usedDisabledMove = 1; gProtectStructs[gBattlerAttacker].usedDisabledMove = TRUE;
gBattleScripting.battler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled; gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled;
@ -3292,7 +3348,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_HEAL_BLOCKED: case CANCELLER_HEAL_BLOCKED:
if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(gBattlerAttacker, gCurrentMove)) if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(gBattlerAttacker, gCurrentMove))
{ {
gProtectStructs[gBattlerAttacker].usedHealBlockedMove = 1; gProtectStructs[gBattlerAttacker].usedHealBlockedMove = TRUE;
gBattleScripting.battler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents; gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents;
@ -3304,7 +3360,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_GRAVITY: case CANCELLER_GRAVITY:
if (gFieldStatuses & STATUS_FIELD_GRAVITY && IsGravityPreventingMove(gCurrentMove)) if (gFieldStatuses & STATUS_FIELD_GRAVITY && IsGravityPreventingMove(gCurrentMove))
{ {
gProtectStructs[gBattlerAttacker].usedGravityPreventedMove = 1; gProtectStructs[gBattlerAttacker].usedGravityPreventedMove = TRUE;
gBattleScripting.battler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents; gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents;
@ -3316,7 +3372,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_TAUNTED: // taunt case CANCELLER_TAUNTED: // taunt
if (gDisableStructs[gBattlerAttacker].tauntTimer && gBattleMoves[gCurrentMove].power == 0) if (gDisableStructs[gBattlerAttacker].tauntTimer && gBattleMoves[gCurrentMove].power == 0)
{ {
gProtectStructs[gBattlerAttacker].usedTauntedMove = 1; gProtectStructs[gBattlerAttacker].usedTauntedMove = TRUE;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted; gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
@ -3327,7 +3383,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_IMPRISONED: // imprisoned case CANCELLER_IMPRISONED: // imprisoned
if (GetImprisonedMovesCount(gBattlerAttacker, gCurrentMove)) if (GetImprisonedMovesCount(gBattlerAttacker, gCurrentMove))
{ {
gProtectStructs[gBattlerAttacker].usedImprisonedMove = 1; gProtectStructs[gBattlerAttacker].usedImprisonedMove = TRUE;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned; gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
@ -3346,7 +3402,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleCommunication[MULTISTRING_CHOOSER] = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = TRUE;
gBattlerTarget = gBattlerAttacker; gBattlerTarget = gBattlerAttacker;
gBattleMoveDamage = CalculateMoveDamage(MOVE_NONE, gBattlerAttacker, gBattlerAttacker, TYPE_MYSTERY, 40, FALSE, FALSE, TRUE); gBattleMoveDamage = CalculateMoveDamage(MOVE_NONE, gBattlerAttacker, gBattlerAttacker, TYPE_MYSTERY, 40, FALSE, FALSE, TRUE);
gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1; gProtectStructs[gBattlerAttacker].confusionSelfDmg = TRUE;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
} }
else else
@ -3368,7 +3424,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_PARALYSED: // paralysis case CANCELLER_PARALYSED: // paralysis
if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0) if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0)
{ {
gProtectStructs[gBattlerAttacker].prlzImmobility = 1; gProtectStructs[gBattlerAttacker].prlzImmobility = TRUE;
// This is removed in Emerald for some reason // This is removed in Emerald for some reason
//CancelMultiTurnMoves(gBattlerAttacker); //CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed; gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed;
@ -3389,7 +3445,7 @@ u8 AtkCanceller_UnableToUseMove(void)
{ {
BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack); BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack);
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
gProtectStructs[gBattlerAttacker].loveImmobility = 1; gProtectStructs[gBattlerAttacker].loveImmobility = TRUE;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
} }
gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove; gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove;
@ -3469,7 +3525,7 @@ u8 AtkCanceller_UnableToUseMove(void)
GET_MOVE_TYPE(gCurrentMove, moveType); GET_MOVE_TYPE(gCurrentMove, moveType);
if (moveType == TYPE_FIRE) if (moveType == TYPE_FIRE)
{ {
gProtectStructs[gBattlerAttacker].powderSelfDmg = 1; gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; gBattlescriptCurrInstr = BattleScript_MoveUsedPowder;
effect = 1; effect = 1;
@ -3480,7 +3536,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_THROAT_CHOP: case CANCELLER_THROAT_CHOP:
if (gDisableStructs[gBattlerAttacker].throatChopTimer && gBattleMoves[gCurrentMove].flags & FLAG_SOUND) if (gDisableStructs[gBattlerAttacker].throatChopTimer && gBattleMoves[gCurrentMove].flags & FLAG_SOUND)
{ {
gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = 1; gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = TRUE;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented; gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
@ -3679,7 +3735,8 @@ u8 TryWeatherFormChange(u8 battler)
{ {
u8 ret = 0; u8 ret = 0;
bool32 weatherEffect = WEATHER_HAS_EFFECT; bool32 weatherEffect = WEATHER_HAS_EFFECT;
u16 holdEffect = GetBattlerHoldEffect(battler, TRUE);
if (gBattleMons[battler].species == SPECIES_CASTFORM) if (gBattleMons[battler].species == SPECIES_CASTFORM)
{ {
if (GetBattlerAbility(battler) != ABILITY_FORECAST || gBattleMons[battler].hp == 0) if (GetBattlerAbility(battler) != ABILITY_FORECAST || gBattleMons[battler].hp == 0)
@ -3695,17 +3752,17 @@ u8 TryWeatherFormChange(u8 battler)
{ {
ret = 0; ret = 0;
} }
else if (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)) else if (holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA || (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)))
{ {
SET_BATTLER_TYPE(battler, TYPE_NORMAL); SET_BATTLER_TYPE(battler, TYPE_NORMAL);
ret = 1; ret = 1;
} }
else if (gBattleWeather & WEATHER_SUN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE)) else if (gBattleWeather & WEATHER_SUN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE))
{ {
SET_BATTLER_TYPE(battler, TYPE_FIRE); SET_BATTLER_TYPE(battler, TYPE_FIRE);
ret = 2; ret = 2;
} }
else if (gBattleWeather & WEATHER_RAIN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER)) else if (gBattleWeather & WEATHER_RAIN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER))
{ {
SET_BATTLER_TYPE(battler, TYPE_WATER); SET_BATTLER_TYPE(battler, TYPE_WATER);
ret = 3; ret = 3;
@ -3720,9 +3777,9 @@ u8 TryWeatherFormChange(u8 battler)
{ {
if (GetBattlerAbility(battler) != ABILITY_FLOWER_GIFT || gBattleMons[battler].hp == 0) if (GetBattlerAbility(battler) != ABILITY_FLOWER_GIFT || gBattleMons[battler].hp == 0)
ret = 0; ret = 0;
else if (gBattleMonForms[battler] == 0 && weatherEffect && gBattleWeather & WEATHER_SUN_ANY) else if (gBattleMonForms[battler] == 0 && weatherEffect && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_SUN_ANY)
ret = 2; ret = 2;
else if (gBattleMonForms[battler] != 0 && (!weatherEffect || !(gBattleWeather & WEATHER_SUN_ANY))) else if (gBattleMonForms[battler] != 0 && (!weatherEffect || holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA || !(gBattleWeather & WEATHER_SUN_ANY)))
ret = 1; ret = 1;
} }
@ -4014,7 +4071,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_MOLDBREAKER; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_MOLDBREAKER;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4023,7 +4080,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TERAVOLT; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TERAVOLT;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4032,7 +4089,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TURBOBLAZE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TURBOBLAZE;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4042,7 +4099,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
{ {
gDisableStructs[battler].slowStartTimer = 5; gDisableStructs[battler].slowStartTimer = 5;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SLOWSTART; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SLOWSTART;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4051,7 +4108,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_UNNERVE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_UNNERVE;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4061,7 +4118,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ASONE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ASONE;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_ActivateAsOne); BattleScriptPushCursorAndCallback(BattleScript_ActivateAsOne);
effect++; effect++;
} }
@ -4073,11 +4130,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
u32 i; u32 i;
gEffectBattler = BATTLE_PARTNER(battler); gEffectBattler = BATTLE_PARTNER(battler);
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_CURIOUS_MEDICINE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_CURIOUS_MEDICINE;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
break; break;
case ABILITY_PASTEL_VEIL:
if (!gSpecialStatuses[battler].switchInAbilityDone)
{
gBattlerTarget = battler;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PASTEL_VEIL;
BattleScriptPushCursorAndCallback(BattleScript_PastelVeilActivates);
effect++;
gSpecialStatuses[battler].switchInAbilityDone = 1;
}
break;
case ABILITY_ANTICIPATION: case ABILITY_ANTICIPATION:
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
@ -4103,7 +4170,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (effect) if (effect)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ANTICIPATION; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ANTICIPATION;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
} }
} }
@ -4111,7 +4178,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITY_FRISK: case ABILITY_FRISK:
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_FriskActivates); // Try activate BattleScriptPushCursorAndCallback(BattleScript_FriskActivates); // Try activate
effect++; effect++;
} }
@ -4121,7 +4188,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
{ {
ForewarnChooseMove(battler); ForewarnChooseMove(battler);
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FOREWARN; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FOREWARN;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4151,7 +4218,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
else else
statId = STAT_SPATK; statId = STAT_SPATK;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
if (CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN)) if (CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN))
{ {
@ -4168,7 +4235,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PRESSURE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PRESSURE;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4177,7 +4244,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_DARKAURA; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_DARKAURA;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4186,7 +4253,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FAIRYAURA; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FAIRYAURA;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4195,7 +4262,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_AURABREAK; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_AURABREAK;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4204,7 +4271,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_COMATOSE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_COMATOSE;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4213,7 +4280,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone && TryRemoveScreens(battler)) if (!gSpecialStatuses[battler].switchInAbilityDone && TryRemoveScreens(battler))
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SCREENCLEANER; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SCREENCLEANER;
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg);
effect++; effect++;
} }
@ -4302,7 +4369,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gSpecialStatuses[battler].intimidatedMon)) if (!(gSpecialStatuses[battler].intimidatedMon))
{ {
gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_INTIMIDATED; gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_INTIMIDATED;
gSpecialStatuses[battler].intimidatedMon = 1; gSpecialStatuses[battler].intimidatedMon = TRUE;
} }
break; break;
case ABILITY_FORECAST: case ABILITY_FORECAST:
@ -4318,14 +4385,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gSpecialStatuses[battler].traced)) if (!(gSpecialStatuses[battler].traced))
{ {
gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_TRACED; gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_TRACED;
gSpecialStatuses[battler].traced = 1; gSpecialStatuses[battler].traced = TRUE;
} }
break; break;
case ABILITY_CLOUD_NINE: case ABILITY_CLOUD_NINE:
case ABILITY_AIR_LOCK: case ABILITY_AIR_LOCK:
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
BattleScriptPushCursorAndCallback(BattleScript_AnnounceAirLockCloudNine); BattleScriptPushCursorAndCallback(BattleScript_AnnounceAirLockCloudNine);
effect++; effect++;
} }
@ -4343,7 +4410,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITY_INTREPID_SWORD: case ABILITY_INTREPID_SWORD:
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
SET_STATCHANGER(STAT_ATK, 1, FALSE); SET_STATCHANGER(STAT_ATK, 1, FALSE);
BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn);
effect++; effect++;
@ -4352,7 +4419,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITY_DAUNTLESS_SHIELD: case ABILITY_DAUNTLESS_SHIELD:
if (!gSpecialStatuses[battler].switchInAbilityDone) if (!gSpecialStatuses[battler].switchInAbilityDone)
{ {
gSpecialStatuses[battler].switchInAbilityDone = 1; gSpecialStatuses[battler].switchInAbilityDone = TRUE;
SET_STATCHANGER(STAT_DEF, 1, FALSE); SET_STATCHANGER(STAT_DEF, 1, FALSE);
BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn);
effect++; effect++;
@ -4379,6 +4446,13 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
effect++; effect++;
} }
break; break;
case ABILITY_MIMICRY:
if (gBattleMons[battler].hp != 0 && gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
{
TryToApplyMimicry(battler, FALSE);
effect++;
}
break;
} }
break; break;
case ABILITYEFFECT_ENDTURN: // 1 case ABILITYEFFECT_ENDTURN: // 1
@ -4388,7 +4462,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
switch (gLastUsedAbility) switch (gLastUsedAbility)
{ {
case ABILITY_HARVEST: case ABILITY_HARVEST:
if (((WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || Random() % 2 == 0) if ((IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY) || Random() % 2 == 0)
&& gBattleMons[battler].item == ITEM_NONE && gBattleMons[battler].item == ITEM_NONE
&& gBattleStruct->changedItems[battler] == ITEM_NONE // Will not inherit an item && gBattleStruct->changedItems[battler] == ITEM_NONE // Will not inherit an item
&& ItemId_GetPocket(GetUsedHeldItem(battler)) == POCKET_BERRIES) && ItemId_GetPocket(GetUsedHeldItem(battler)) == POCKET_BERRIES)
@ -4398,12 +4472,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
} }
break; break;
case ABILITY_DRY_SKIN: case ABILITY_DRY_SKIN:
if (gBattleWeather & WEATHER_SUN_ANY) if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY))
goto SOLAR_POWER_HP_DROP; goto SOLAR_POWER_HP_DROP;
// Dry Skin works similarly to Rain Dish in Rain // Dry Skin works similarly to Rain Dish in Rain
case ABILITY_RAIN_DISH: case ABILITY_RAIN_DISH:
if (WEATHER_HAS_EFFECT if (IsBattlerWeatherAffected(battler, WEATHER_RAIN_ANY)
&& (gBattleWeather & WEATHER_RAIN_ANY)
&& !BATTLER_MAX_HP(battler) && !BATTLER_MAX_HP(battler)
&& !(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) && !(gStatuses3[battler] & STATUS3_HEAL_BLOCK))
{ {
@ -4416,8 +4489,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
} }
break; break;
case ABILITY_HYDRATION: case ABILITY_HYDRATION:
if (WEATHER_HAS_EFFECT if (IsBattlerWeatherAffected(battler, WEATHER_RAIN_ANY)
&& (gBattleWeather & WEATHER_RAIN_ANY)
&& gBattleMons[battler].status1 & STATUS1_ANY) && gBattleMons[battler].status1 & STATUS1_ANY)
{ {
goto ABILITY_HEAL_MON_STATUS; goto ABILITY_HEAL_MON_STATUS;
@ -4512,7 +4584,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
break; break;
SOLAR_POWER_HP_DROP: SOLAR_POWER_HP_DROP:
case ABILITY_SOLAR_POWER: case ABILITY_SOLAR_POWER:
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY))
{ {
BattleScriptPushCursorAndCallback(BattleScript_SolarPowerActivates); BattleScriptPushCursorAndCallback(BattleScript_SolarPowerActivates);
gBattleMoveDamage = gBattleMons[battler].maxHP / 8; gBattleMoveDamage = gBattleMons[battler].maxHP / 8;
@ -4563,6 +4635,22 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
effect++; effect++;
} }
break; break;
case ABILITY_HUNGER_SWITCH:
if (!(gBattleMons[battler].status2 & STATUS2_TRANSFORMED))
{
if (gBattleMons[battler].species == SPECIES_MORPEKO)
{
gBattleMons[battler].species = SPECIES_MORPEKO_HANGRY;
BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup);
}
else if (gBattleMons[battler].species == SPECIES_MORPEKO_HANGRY)
{
gBattleMons[battler].species = SPECIES_MORPEKO;
BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup);
}
effect++;
}
break;
} }
} }
break; break;
@ -4800,7 +4888,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|| CompareStat(battler, STAT_DEF, MIN_STAT_STAGE, CMP_GREATER_THAN))) // Don't activate if defense cannot be lowered || CompareStat(battler, STAT_DEF, MIN_STAT_STAGE, CMP_GREATER_THAN))) // Don't activate if defense cannot be lowered
{ {
if (gBattleMoves[gCurrentMove].effect == EFFECT_HIT_ESCAPE && CanBattlerSwitch(gBattlerAttacker)) if (gBattleMoves[gCurrentMove].effect == EFFECT_HIT_ESCAPE && CanBattlerSwitch(gBattlerAttacker))
gProtectStructs[battler].disableEjectPack = 1; // Set flag for target gProtectStructs[battler].disableEjectPack = TRUE; // Set flag for target
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_WeakArmorActivates; gBattlescriptCurrInstr = BattleScript_WeakArmorActivates;
@ -4828,7 +4916,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& IsBattlerAlive(gBattlerAttacker) && IsBattlerAlive(gBattlerAttacker)
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) && (IsMoveMakingContact(move, gBattlerAttacker)))
{ {
switch (gBattleMons[gBattlerAttacker].ability) switch (gBattleMons[gBattlerAttacker].ability)
{ {
@ -4919,15 +5007,16 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITY_TANGLING_HAIR: case ABILITY_TANGLING_HAIR:
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& gBattleMons[gBattlerAttacker].hp != 0 && gBattleMons[gBattlerAttacker].hp != 0
&& CompareStat(gBattlerAttacker, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN) && (CompareStat(gBattlerAttacker, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN) || GetBattlerAbility(gBattlerAttacker) == ABILITY_MIRROR_ARMOR)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& IsMoveMakingContact(move, gBattlerAttacker)) && IsMoveMakingContact(move, gBattlerAttacker))
{ {
gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_SPD_MINUS_1; SET_STATCHANGER(STAT_SPEED, 1, TRUE);
gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1;
PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; gBattlescriptCurrInstr = BattleScript_GooeyActivates;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++; effect++;
} }
@ -5013,7 +5102,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& gBattleMons[gBattlerAttacker].hp != 0 && gBattleMons[gBattlerAttacker].hp != 0
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& CanBePoisoned(gBattlerAttacker) && CanBePoisoned(gBattlerAttacker, gBattlerTarget)
&& IsMoveMakingContact(move, gBattlerAttacker) && IsMoveMakingContact(move, gBattlerAttacker)
&& (Random() % 3) == 0) && (Random() % 3) == 0)
{ {
@ -5046,7 +5135,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& gBattleMons[gBattlerAttacker].hp != 0 && gBattleMons[gBattlerAttacker].hp != 0
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) && (IsMoveMakingContact(move, gBattlerAttacker))
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& CanBeBurned(gBattlerAttacker) && CanBeBurned(gBattlerAttacker)
&& (Random() % 3) == 0) && (Random() % 3) == 0)
@ -5062,7 +5151,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& gBattleMons[gBattlerAttacker].hp != 0 && gBattleMons[gBattlerAttacker].hp != 0
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) && (IsMoveMakingContact(move, gBattlerAttacker))
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& gBattleMons[gBattlerTarget].hp != 0 && gBattleMons[gBattlerTarget].hp != 0
&& (Random() % 3) == 0 && (Random() % 3) == 0
@ -5138,7 +5227,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& IsBattlerAlive(battler) && IsBattlerAlive(battler)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) && (IsMoveMakingContact(move, gBattlerAttacker))
&& !(gStatuses3[gBattlerAttacker] & STATUS3_PERISH_SONG)) && !(gStatuses3[gBattlerAttacker] & STATUS3_PERISH_SONG))
{ {
if (!(gStatuses3[battler] & STATUS3_PERISH_SONG)) if (!(gStatuses3[battler] & STATUS3_PERISH_SONG))
@ -5200,8 +5289,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& gBattleMons[gBattlerTarget].hp != 0 && gBattleMons[gBattlerTarget].hp != 0
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& CanBePoisoned(gBattlerTarget) && CanBePoisoned(gBattlerAttacker, gBattlerTarget)
&& IsMoveMakingContact(move, gBattlerAttacker) && IsMoveMakingContact(move, gBattlerAttacker)
&& TARGET_TURN_DAMAGED // Need to actually hit the target
&& (Random() % 3) == 0) && (Random() % 3) == 0)
{ {
gBattleScripting.moveEffect = MOVE_EFFECT_POISON; gBattleScripting.moveEffect = MOVE_EFFECT_POISON;
@ -5248,7 +5338,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& gBattlerAttacker != battler) && gBattlerAttacker != battler)
{ {
// Set bit and save Dancer mon's original target // Set bit and save Dancer mon's original target
gSpecialStatuses[battler].dancerUsedMove = 1; gSpecialStatuses[battler].dancerUsedMove = TRUE;
gSpecialStatuses[battler].dancerOriginalTarget = *(gBattleStruct->moveTarget + battler) | 0x4; gSpecialStatuses[battler].dancerOriginalTarget = *(gBattleStruct->moveTarget + battler) | 0x4;
gBattleStruct->atkCancellerTracker = 0; gBattleStruct->atkCancellerTracker = 0;
gBattlerAttacker = gBattlerAbility = battler; gBattlerAttacker = gBattlerAbility = battler;
@ -5381,8 +5471,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY)) if (!(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY))
{ {
gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN);
if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC) #if B_SYNCHRONIZE_TOXIC < GEN_5
gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON; if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC)
gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON;
#endif
gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect + MOVE_EFFECT_AFFECTS_USER; gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect + MOVE_EFFECT_AFFECTS_USER;
gBattleScripting.battler = gBattlerAbility = gBattlerTarget; gBattleScripting.battler = gBattlerAbility = gBattlerTarget;
@ -5698,18 +5790,19 @@ bool32 CanSleep(u8 battlerId)
return TRUE; return TRUE;
} }
bool32 CanBePoisoned(u8 battlerId) bool32 CanBePoisoned(u8 battlerAttacker, u8 battlerTarget)
{ {
u16 ability = GetBattlerAbility(battlerId); u16 ability = GetBattlerAbility(battlerTarget);
if (IS_BATTLER_OF_TYPE(battlerId, TYPE_POISON)
|| IS_BATTLER_OF_TYPE(battlerId, TYPE_STEEL) if (!(CanPoisonType(battlerAttacker, battlerTarget))
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD || gSideStatuses[GetBattlerSide(battlerTarget)] & SIDE_STATUS_SAFEGUARD
|| gBattleMons[battlerId].status1 & STATUS1_ANY || gBattleMons[battlerTarget].status1 & STATUS1_ANY
|| ability == ABILITY_IMMUNITY || ability == ABILITY_IMMUNITY
|| ability == ABILITY_COMATOSE || ability == ABILITY_COMATOSE
|| gBattleMons[battlerId].status1 & STATUS1_ANY || IsAbilityOnSide(battlerTarget, ABILITY_PASTEL_VEIL)
|| IsAbilityStatusProtected(battlerId) || gBattleMons[battlerTarget].status1 & STATUS1_ANY
|| IsBattlerTerrainAffected(battlerId, STATUS_FIELD_MISTY_TERRAIN)) || IsAbilityStatusProtected(battlerTarget)
|| IsBattlerTerrainAffected(battlerTarget, STATUS_FIELD_MISTY_TERRAIN))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
@ -5747,7 +5840,7 @@ bool32 CanBeFrozen(u8 battlerId)
{ {
u16 ability = GetBattlerAbility(battlerId); u16 ability = GetBattlerAbility(battlerId);
if (IS_BATTLER_OF_TYPE(battlerId, TYPE_ICE) if (IS_BATTLER_OF_TYPE(battlerId, TYPE_ICE)
|| (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || IsBattlerWeatherAffected(battlerId, WEATHER_SUN_ANY)
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD
|| ability == ABILITY_MAGMA_ARMOR || ability == ABILITY_MAGMA_ARMOR
|| ability == ABILITY_COMATOSE || ability == ABILITY_COMATOSE
@ -5912,7 +6005,7 @@ static u8 TrySetMicleBerry(u32 battlerId, u32 itemId, bool32 end2)
{ {
if (HasEnoughHpToEatBerry(battlerId, 4, itemId)) if (HasEnoughHpToEatBerry(battlerId, 4, itemId))
{ {
gProtectStructs[battlerId].micle = TRUE; // battler's next attack has increased accuracy gProtectStructs[battlerId].usedMicleBerry = TRUE; // battler's next attack has increased accuracy
if (end2) if (end2)
{ {
@ -6314,7 +6407,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
if (effect) if (effect)
{ {
gSpecialStatuses[battlerId].switchInItemDone = 1; gSpecialStatuses[battlerId].switchInItemDone = TRUE;
gActiveBattler = gBattlerAttacker = gPotentialItemEffectBattler = gBattleScripting.battler = battlerId; gActiveBattler = gBattlerAttacker = gPotentialItemEffectBattler = gBattleScripting.battler = battlerId;
switch (effect) switch (effect)
{ {
@ -7170,7 +7263,7 @@ u32 GetMoveTarget(u16 move, u8 setTarget)
{ {
targetBattler ^= BIT_FLANK; targetBattler ^= BIT_FLANK;
RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability); RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);
gSpecialStatuses[targetBattler].lightningRodRedirected = 1; gSpecialStatuses[targetBattler].lightningRodRedirected = TRUE;
} }
else if (gBattleMoves[move].type == TYPE_WATER else if (gBattleMoves[move].type == TYPE_WATER
&& IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_STORM_DRAIN) && IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_STORM_DRAIN)
@ -7178,7 +7271,7 @@ u32 GetMoveTarget(u16 move, u8 setTarget)
{ {
targetBattler ^= BIT_FLANK; targetBattler ^= BIT_FLANK;
RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability); RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);
gSpecialStatuses[targetBattler].stormDrainRedirected = 1; gSpecialStatuses[targetBattler].stormDrainRedirected = TRUE;
} }
} }
break; break;
@ -7377,13 +7470,24 @@ u32 GetBattlerHoldEffectParam(u8 battlerId)
bool32 IsMoveMakingContact(u16 move, u8 battlerAtk) bool32 IsMoveMakingContact(u16 move, u8 battlerAtk)
{ {
if (!(gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) if (!(gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
return FALSE; {
if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory)
return TRUE;
else
return FALSE;
}
else if (GetBattlerAbility(battlerAtk) == ABILITY_LONG_REACH) else if (GetBattlerAbility(battlerAtk) == ABILITY_LONG_REACH)
{
return FALSE; return FALSE;
}
else if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_PROTECTIVE_PADS) else if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_PROTECTIVE_PADS)
{
return FALSE; return FALSE;
}
else else
{
return TRUE; return TRUE;
}
} }
bool32 IsBattlerGrounded(u8 battlerId) bool32 IsBattlerGrounded(u8 battlerId)
@ -7705,7 +7809,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
basePower *= 2; basePower *= 2;
break; break;
case EFFECT_ASSURANCE: case EFFECT_ASSURANCE:
if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg != 0) if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg)
basePower *= 2; basePower *= 2;
break; break;
case EFFECT_TRUMP_CARD: case EFFECT_TRUMP_CARD:
@ -7891,7 +7995,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(1.3)); MulModifier(&modifier, UQ_4_12(1.3));
break; break;
case ABILITY_TOUGH_CLAWS: case ABILITY_TOUGH_CLAWS:
if (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) if (IsMoveMakingContact(move, battlerAtk))
MulModifier(&modifier, UQ_4_12(1.3)); MulModifier(&modifier, UQ_4_12(1.3));
break; break;
case ABILITY_STRONG_JAW: case ABILITY_STRONG_JAW:
@ -8041,7 +8145,11 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, holdEffectModifier); MulModifier(&modifier, holdEffectModifier);
break; break;
case HOLD_EFFECT_SOUL_DEW: case HOLD_EFFECT_SOUL_DEW:
#if B_SOUL_DEW_BOOST >= GEN_7
if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && (moveType == TYPE_PSYCHIC || moveType == TYPE_DRAGON))
#else
if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER)) if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER))
#endif
MulModifier(&modifier, holdEffectModifier); MulModifier(&modifier, holdEffectModifier);
break; break;
case HOLD_EFFECT_GEMS: case HOLD_EFFECT_GEMS:
@ -8102,7 +8210,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(2.0)); MulModifier(&modifier, UQ_4_12(2.0));
break; break;
case EFFECT_SOLARBEAM: case EFFECT_SOLARBEAM:
if (WEATHER_HAS_EFFECT && gBattleWeather & (WEATHER_HAIL_ANY | WEATHER_SANDSTORM_ANY | WEATHER_RAIN_ANY)) if (IsBattlerWeatherAffected(battlerAtk, (WEATHER_HAIL_ANY | WEATHER_SANDSTORM_ANY | WEATHER_RAIN_ANY)))
MulModifier(&modifier, UQ_4_12(0.5)); MulModifier(&modifier, UQ_4_12(0.5));
break; break;
case EFFECT_STOMPING_TANTRUM: case EFFECT_STOMPING_TANTRUM:
@ -8204,7 +8312,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
MulModifier(&modifier, UQ_4_12(0.5)); MulModifier(&modifier, UQ_4_12(0.5));
break; break;
case ABILITY_SOLAR_POWER: case ABILITY_SOLAR_POWER:
if (IS_MOVE_SPECIAL(move) && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) if (IS_MOVE_SPECIAL(move) && IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY))
MulModifier(&modifier, UQ_4_12(1.5)); MulModifier(&modifier, UQ_4_12(1.5));
break; break;
case ABILITY_DEFEATIST: case ABILITY_DEFEATIST:
@ -8241,7 +8349,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
} }
break; break;
case ABILITY_FLOWER_GIFT: case ABILITY_FLOWER_GIFT:
if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move))
MulModifier(&modifier, UQ_4_12(1.5)); MulModifier(&modifier, UQ_4_12(1.5));
break; break;
case ABILITY_HUSTLE: case ABILITY_HUSTLE:
@ -8281,7 +8389,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk)))
{ {
case ABILITY_FLOWER_GIFT: case ABILITY_FLOWER_GIFT:
if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move))
MulModifier(&modifier, UQ_4_12(1.5)); MulModifier(&modifier, UQ_4_12(1.5));
break; break;
} }
@ -8414,7 +8522,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
} }
break; break;
case ABILITY_FLOWER_GIFT: case ABILITY_FLOWER_GIFT:
if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && !usesDefStat) if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerDef, WEATHER_SUN_ANY) && !usesDefStat)
MulModifier(&modifier, UQ_4_12(1.5)); MulModifier(&modifier, UQ_4_12(1.5));
break; break;
case ABILITY_PUNK_ROCK: case ABILITY_PUNK_ROCK:
@ -8429,7 +8537,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef))) switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef)))
{ {
case ABILITY_FLOWER_GIFT: case ABILITY_FLOWER_GIFT:
if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && !usesDefStat) if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerDef), WEATHER_SUN_ANY) && !usesDefStat)
MulModifier(&modifier, UQ_4_12(1.5)); MulModifier(&modifier, UQ_4_12(1.5));
break; break;
} }
@ -8454,6 +8562,14 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
if (!usesDefStat) if (!usesDefStat)
MulModifier(&modifier, UQ_4_12(1.5)); MulModifier(&modifier, UQ_4_12(1.5));
break; break;
#if B_SOUL_DEW_BOOST <= GEN_6
case HOLD_EFFECT_SOUL_DEW:
if ((gBattleMons[battlerDef].species == SPECIES_LATIAS || gBattleMons[battlerDef].species == SPECIES_LATIOS)
&& !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
&& !usesDefStat)
MulModifier(&modifier, UQ_4_12(1.5));
break;
#endif
} }
// sandstorm sp.def boost for rock types // sandstorm sp.def boost for rock types
@ -8496,14 +8612,14 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
dmg = ApplyModifier(UQ_4_12(0.5), dmg); dmg = ApplyModifier(UQ_4_12(0.5), dmg);
// check sunny/rain weather // check sunny/rain weather
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_RAIN_ANY) if (IsBattlerWeatherAffected(battlerAtk, WEATHER_RAIN_ANY))
{ {
if (moveType == TYPE_FIRE) if (moveType == TYPE_FIRE)
dmg = ApplyModifier(UQ_4_12(0.5), dmg); dmg = ApplyModifier(UQ_4_12(0.5), dmg);
else if (moveType == TYPE_WATER) else if (moveType == TYPE_WATER)
dmg = ApplyModifier(UQ_4_12(1.5), dmg); dmg = ApplyModifier(UQ_4_12(1.5), dmg);
} }
else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) else if (IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY))
{ {
if (moveType == TYPE_FIRE) if (moveType == TYPE_FIRE)
dmg = ApplyModifier(UQ_4_12(1.5), dmg); dmg = ApplyModifier(UQ_4_12(1.5), dmg);
@ -8606,7 +8722,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
else else
MulModifier(&finalModifier, UQ_4_12(0.5)); MulModifier(&finalModifier, UQ_4_12(0.5));
if (updateFlags) if (updateFlags)
gSpecialStatuses[battlerDef].berryReduced = 1; gSpecialStatuses[battlerDef].berryReduced = TRUE;
} }
break; break;
} }
@ -9011,33 +9127,31 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut)
{ {
u32 i, currSpecies; u32 i, currSpecies;
struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty;
static const u16 species[][2] = // changed form id, default form id static const u16 species[][3] =
{ {
{SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU}, // Changed Form ID Default Form ID Should change on switch
{SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND}, {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU, FALSE},
{SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH}, {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND, FALSE},
{SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN}, {SPECIES_MELOETTA_PIROUETTE, SPECIES_MELOETTA, FALSE},
{SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED}, {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH, TRUE},
{SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE}, {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN, TRUE},
{SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN}, {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED, TRUE},
{SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO}, {SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE, TRUE},
{SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE}, {SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN, TRUE},
{SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET}, {SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO, TRUE},
{SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW}, {SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE, TRUE},
{SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI}, {SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET, TRUE},
{SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT}, {SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW, TRUE},
{SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT}, {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI, TRUE},
{SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT, TRUE},
{SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT, TRUE},
{SPECIES_MORPEKO_HANGRY, SPECIES_MORPEKO, TRUE},
}; };
if (isSwitchingOut) // Don't revert Mimikyu Busted or Ash-Greninja when switching out
i = 2;
else
i = 0;
currSpecies = GetMonData(&party[monId], MON_DATA_SPECIES, NULL); currSpecies = GetMonData(&party[monId], MON_DATA_SPECIES, NULL);
for (; i < ARRAY_COUNT(species); i++) for (i = 0; i < ARRAY_COUNT(species); i++)
{ {
if (currSpecies == species[i][0]) if (currSpecies == species[i][0] && (!isSwitchingOut || species[i][2] == TRUE))
{ {
SetMonData(&party[monId], MON_DATA_SPECIES, &species[i][1]); SetMonData(&party[monId], MON_DATA_SPECIES, &species[i][1]);
CalculateMonStats(&party[monId]); CalculateMonStats(&party[monId]);
@ -9177,7 +9291,9 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId)
u8 GetBattleMoveSplit(u32 moveId) u8 GetBattleMoveSplit(u32 moveId)
{ {
if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) if (gSwapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky
return SPLIT_PHYSICAL;
else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4)
return gBattleMoves[moveId].split; return gBattleMoves[moveId].split;
else if (gBattleMoves[moveId].type < TYPE_MYSTERY) else if (gBattleMoves[moveId].type < TYPE_MYSTERY)
return SPLIT_PHYSICAL; return SPLIT_PHYSICAL;
@ -9635,3 +9751,19 @@ u16 GetUsedHeldItem(u8 battler)
{ {
return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]; return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)];
} }
bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags)
{
if (!WEATHER_HAS_EFFECT)
return FALSE;
if (gBattleWeather & weatherFlags)
{
// given weather is active -> check if its sun, rain against utility umbrella ( since only 1 weather can be active at once)
if (gBattleWeather & (WEATHER_SUN_ANY | WEATHER_RAIN_ANY) && GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA)
return FALSE; // utility umbrella blocks sun, rain effects
return TRUE;
}
return FALSE;
}

View File

@ -378,7 +378,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.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_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },
@ -649,7 +649,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_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },
@ -2460,7 +2460,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },
@ -7267,7 +7267,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.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_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },
@ -8367,7 +8367,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.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_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },
@ -8575,7 +8575,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.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_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },
@ -8614,7 +8614,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_RELIC_SONG] = [MOVE_RELIC_SONG] =
{ {
.effect = EFFECT_SLEEP_HIT, .effect = EFFECT_RELIC_SONG,
.power = 75, .power = 75,
.type = TYPE_NORMAL, .type = TYPE_NORMAL,
.accuracy = 100, .accuracy = 100,
@ -8624,6 +8624,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.argument = STATUS1_SLEEP,
}, },
[MOVE_SECRET_SWORD] = [MOVE_SECRET_SWORD] =
@ -10454,7 +10455,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_PHOTON_GEYSER] = [MOVE_PHOTON_GEYSER] =
{ {
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect .effect = EFFECT_PHOTON_GEYSER,
.power = 100, .power = 100,
.type = TYPE_PSYCHIC, .type = TYPE_PSYCHIC,
.accuracy = 100, .accuracy = 100,
@ -10462,7 +10463,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_FOES_AND_ALLY, .target = MOVE_TARGET_FOES_AND_ALLY,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
}, },
@ -10726,9 +10727,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_DOUBLE_IRON_BASH] = [MOVE_DOUBLE_IRON_BASH] =
{ {
#if B_UPDATED_MOVE_DATA >= GEN_8 #if B_UPDATED_MOVE_DATA >= GEN_8
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES,
#else #else
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES,
#endif #endif
.effect = EFFECT_DOUBLE_IRON_BASH, .effect = EFFECT_DOUBLE_IRON_BASH,
.power = 60, .power = 60,
@ -10850,7 +10851,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },
@ -11038,7 +11039,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_AURA_WHEEL] = [MOVE_AURA_WHEEL] =
{ {
.effect = EFFECT_SPEED_UP_HIT, .effect = EFFECT_AURA_WHEEL,
.power = 110, .power = 110,
.type = TYPE_ELECTRIC, .type = TYPE_ELECTRIC,
.accuracy = 100, .accuracy = 100,
@ -11290,12 +11291,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_SHELL_SIDE_ARM] = [MOVE_SHELL_SIDE_ARM] =
{ {
.effect = EFFECT_PLACEHOLDER, //TODO .effect = EFFECT_SHELL_SIDE_ARM,
.power = 90, .power = 90,
.type = TYPE_POISON, .type = TYPE_POISON,
.accuracy = 100, .accuracy = 100,
.pp = 10, .pp = 10,
.secondaryEffectChance = 0, .secondaryEffectChance = 20,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST,
@ -11480,7 +11481,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.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_TWO_STRIKES,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
}, },

View File

@ -1158,7 +1158,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
[MOVE_BUBBLE] = [MOVE_BUBBLE] =
{ {
.effect = CONTEST_EFFECT_STARTLE_PREV_MONS, .effect = CONTEST_EFFECT_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_COOL, .contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0, .comboStarterId = 0,
.comboMoves = {COMBO_STARTER_RAIN_DANCE}, .comboMoves = {COMBO_STARTER_RAIN_DANCE},
}, },
@ -4633,7 +4633,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
{ {
.effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED,
.contestCategory = CONTEST_CATEGORY_SMART, .contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0, .comboStarterId = COMBO_STARTER_GRASSY_TERRAIN,
.comboMoves = {0} .comboMoves = {0}
}, },
@ -4641,7 +4641,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
{ {
.effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED,
.contestCategory = CONTEST_CATEGORY_CUTE, .contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0, .comboStarterId = COMBO_STARTER_MISTY_TERRAIN,
.comboMoves = {0} .comboMoves = {0}
}, },
@ -4825,7 +4825,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
{ {
.effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED,
.contestCategory = CONTEST_CATEGORY_BEAUTY, .contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0, .comboStarterId = COMBO_STARTER_ELECTRIC_TERRAIN,
.comboMoves = {0} .comboMoves = {0}
}, },
@ -5115,7 +5115,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
{ {
.effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED,
.contestCategory = CONTEST_CATEGORY_SMART, .contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0, .comboStarterId = COMBO_STARTER_PSYCHIC_TERRAIN,
.comboMoves = {0} .comboMoves = {0}
}, },
@ -5398,6 +5398,526 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
.comboStarterId = 0, .comboStarterId = 0,
.comboMoves = {0} .comboMoves = {0}
}, },
[MOVE_DYNAMAX_CANNON] =
{
.effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_SNIPE_SHOT] =
{
.effect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_JAW_LOCK] =
{
.effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_STUFF_CHEEKS] =
{
.effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_NO_RETREAT] =
{
.effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_TAR_SHOT] =
{
.effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_MAGIC_POWDER] =
{
.effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_DRAGON_DARTS] =
{
.effect = CONTEST_EFFECT_REPETITION_NOT_BORING,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_TEATIME] =
{
.effect = CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_OCTOLOCK] =
{
.effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_BOLT_BEAK] =
{
.effect = CONTEST_EFFECT_BETTER_IF_FIRST,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_FISHIOUS_REND] =
{
.effect = CONTEST_EFFECT_BETTER_IF_FIRST,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_COURT_CHANGE] =
{
.effect = CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_CLANGOROUS_SOUL] =
{
.effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_BODY_PRESS] =
{
.effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_DECORATE] =
{
.effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_DRUM_BEATING] =
{
.effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_SNAP_TRAP] =
{
.effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_PYRO_BALL] =
{
.effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_BEHEMOTH_BLADE] =
{
.effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_BEHEMOTH_BASH] =
{
.effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_AURA_WHEEL] =
{
.effect = CONTEST_EFFECT_BETTER_IF_FIRST,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_BREAKING_SWIPE] =
{
.effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_BRANCH_POKE] =
{
.effect = CONTEST_EFFECT_HIGHLY_APPEALING,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_OVERDRIVE] =
{
.effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_APPLE_ACID] =
{
.effect = CONTEST_EFFECT_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_GRAV_APPLE] =
{
.effect = CONTEST_EFFECT_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_SPIRIT_BREAK] =
{
.effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_STRANGE_STEAM] =
{
.effect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_LIFE_DEW] =
{
.effect = CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_OBSTRUCT] =
{
.effect = CONTEST_EFFECT_AVOID_STARTLE,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_FALSE_SURRENDER] =
{
.effect = CONTEST_EFFECT_BETTER_IF_FIRST,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_METEOR_ASSAULT] =
{
.effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_ETERNABEAM] =
{
.effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_STEEL_BEAM] =
{
.effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_EXPANDING_FORCE] =
{
.effect = CONTEST_EFFECT_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {COMBO_STARTER_PSYCHIC_TERRAIN}
},
[MOVE_STEEL_ROLLER] =
{
.effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_SCALE_SHOT] =
{
.effect = CONTEST_EFFECT_NEXT_APPEAL_EARLIER,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_METEOR_BEAM] =
{
.effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_SHELL_SIDE_ARM] =
{
.effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_MISTY_EXPLOSION] =
{
.effect = CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {COMBO_STARTER_MISTY_TERRAIN}
},
[MOVE_GRASSY_GLIDE] =
{
.effect = CONTEST_EFFECT_NEXT_APPEAL_EARLIER,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {COMBO_STARTER_GRASSY_TERRAIN}
},
[MOVE_RISING_VOLTAGE] =
{
.effect = CONTEST_EFFECT_HIGHLY_APPEALING,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {COMBO_STARTER_ELECTRIC_TERRAIN}
},
[MOVE_TERRAIN_PULSE] =
{
.effect = CONTEST_EFFECT_HIGHLY_APPEALING,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {COMBO_STARTER_ELECTRIC_TERRAIN, COMBO_STARTER_MISTY_TERRAIN, COMBO_STARTER_GRASSY_TERRAIN, COMBO_STARTER_PSYCHIC_TERRAIN},
},
[MOVE_SKITTER_SMACK] =
{
.effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_BURNING_JEALOUSY] =
{
.effect = CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_LASH_OUT] =
{
.effect = CONTEST_EFFECT_STARTLE_PREV_MON,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_POLTERGEIST] =
{
.effect = CONTEST_EFFECT_BETTER_IF_FIRST,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_CORROSIVE_GAS] =
{
.effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_COACHING] =
{
.effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_FLIP_TURN] =
{
.effect = CONTEST_EFFECT_AVOID_STARTLE,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_TRIPLE_AXEL] =
{
.effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_DUAL_WINGBEAT] =
{
.effect = CONTEST_EFFECT_REPETITION_NOT_BORING,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_SCORCHING_SANDS] =
{
.effect = CONTEST_EFFECT_HIGHLY_APPEALING,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_JUNGLE_HEALING] =
{
.effect = CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_WICKED_BLOW] =
{
.effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_SURGING_STRIKES] =
{
.effect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_THUNDER_CAGE] =
{
.effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_DRAGON_ENERGY] =
{
.effect = CONTEST_EFFECT_BETTER_WHEN_LATER,
.contestCategory = CONTEST_CATEGORY_COOL,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_FREEZING_GLARE] =
{
.effect = CONTEST_EFFECT_HIGHLY_APPEALING,
.contestCategory = CONTEST_CATEGORY_CUTE,
.comboStarterId = 0,
.comboMoves = {0}
},
[MOVE_FIERY_WRATH] =
{
.effect = CONTEST_EFFECT_HIGHLY_APPEALING,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_THUNDEROUS_KICK] =
{
.effect = CONTEST_EFFECT_HIGHLY_APPEALING,
.contestCategory = CONTEST_CATEGORY_TOUGH,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_GLACIAL_LANCE] =
{
.effect = CONTEST_EFFECT_BETTER_IF_LAST,
.contestCategory = CONTEST_CATEGORY_BEAUTY,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_ASTRAL_BARRAGE] =
{
.effect = CONTEST_EFFECT_BETTER_IF_FIRST,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0},
},
[MOVE_EERIE_SPELL] =
{
.effect = CONTEST_EFFECT_BETTER_WHEN_LATER,
.contestCategory = CONTEST_CATEGORY_SMART,
.comboStarterId = 0,
.comboMoves = {0}
},
}; };
const struct ContestEffect gContestEffects[] = const struct ContestEffect gContestEffects[] =

View File

@ -2839,7 +2839,7 @@ static const u8 sMETEOR_BEAMDescription[] = _(
"Sp. Attack before attacking."); "Sp. Attack before attacking.");
static const u8 sSHELL_SIDE_ARMDescription[] = _( static const u8 sSHELL_SIDE_ARMDescription[] = _(
"Uses higher of physical and\n" "Deals better of physical and\n"
"special damage. May poison."); "special damage. May poison.");
static const u8 sMISTY_EXPLOSIONDescription[] = _( static const u8 sMISTY_EXPLOSIONDescription[] = _(

View File

@ -1397,26 +1397,16 @@ const u32 gBattleAnimBgPalette_MagmaStorm[] = INCBIN_U32("graphics/battle_anims/
//new battle bgs //new battle bgs
const u32 gBattleAnimBgPalette_GigaImpact[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact.gbapal.lz"); const u32 gBattleAnimBgPalette_GigaImpact[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact.gbapal.lz");
//const u32 gBattleAnimBgImage_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room.4bpp.lz"); const u32 gBattleAnimBgImage_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.4bpp.lz");
//const u32 gBattleAnimBgPalette_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room.gbapal.lz"); const u32 gBattleAnimBgPalette_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.gbapal.lz");
//const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room_map.bin.lz"); const u32 gBattleAnimBgTilemap_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.bin.lz");
const u32 gBattleAnimBgImage_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/rock_wrecker.4bpp.lz"); const u32 gBattleAnimBgPalette_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.gbapal.lz");
const u32 gBattleAnimBgPalette_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/rock_wrecker.gbapal.lz");
const u32 gBattleAnimBgTilemap_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/rock_wrecker_map.bin.lz");
const u32 gBattleAnimBgImage_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_opponent.4bpp.lz");
const u32 gBattleAnimBgPalette_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_opponent.gbapal.lz");
const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_opponent.bin.lz");
const u32 gBattleAnimBgImage_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_player.4bpp.lz");
const u32 gBattleAnimBgPalette_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_player.gbapal.lz");
const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_player.bin.lz");
const u32 gBattleAnimBgImage_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.4bpp.lz");
const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.gbapal.lz");
const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.bin.lz");
const u32 gBattleAnimBgImage_SpacialRend[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend.4bpp.lz");
const u32 gBattleAnimBgPalette_SpacialRend[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend.gbapal.lz");
const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin.lz");
const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.bin.lz");
const u32 gBattleAnimBgPalette_SludgeWave[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sludge_wave.gbapal.lz"); const u32 gBattleAnimBgPalette_SludgeWave[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sludge_wave.gbapal.lz");
@ -1442,10 +1432,6 @@ const u32 gBattleAnimBgImage_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle
const u32 gBattleAnimBgPalette_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.gbapal.lz"); const u32 gBattleAnimBgPalette_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.gbapal.lz");
const u32 gBattleAnimBgTilemap_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin.lz"); const u32 gBattleAnimBgTilemap_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin.lz");
//const u32 gBattleAnimBgImage_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.4bpp.lz");
//const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.gbapal.lz");
//const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.bin.lz");
const u32 gBattleAnimBgPalette_DynamaxCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dynamax_cannon.gbapal.lz"); const u32 gBattleAnimBgPalette_DynamaxCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dynamax_cannon.gbapal.lz");
const u32 gBattleAnimBgImage_ElectricTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/electric_terrain.4bpp.lz"); const u32 gBattleAnimBgImage_ElectricTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/electric_terrain.4bpp.lz");
@ -1478,10 +1464,6 @@ const u32 gBattleAnimBgTilemap_GrassyTerrain[] = INCBIN_U32("graphics/battle_ani
const u32 gBattleAnimBgPalette_GunkShot[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/gunk_shot.gbapal.lz"); const u32 gBattleAnimBgPalette_GunkShot[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/gunk_shot.gbapal.lz");
const u32 gBattleAnimBgImage_HighSpeed[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/high_speed.4bpp.lz");
const u32 gBattleAnimBgPalette_HighSpeed[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/high_speed.gbapal.lz");
const u32 gBattleAnimBgTilemap_HighSpeed[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/high_speed.bin.lz");
const u32 gBattleAnimBgImage_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.4bpp.lz"); const u32 gBattleAnimBgImage_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.4bpp.lz");
const u32 gBattleAnimBgPalette_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.gbapal.lz"); const u32 gBattleAnimBgPalette_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.gbapal.lz");
const u32 gBattleAnimBgTilemap_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.bin.lz"); const u32 gBattleAnimBgTilemap_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.bin.lz");
@ -1502,8 +1484,6 @@ const u32 gBattleAnimBgImage_LeafStorm[] = INCBIN_U32("graphics/battle_anims/bac
const u32 gBattleAnimBgPalette_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.gbapal.lz"); const u32 gBattleAnimBgPalette_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.gbapal.lz");
const u32 gBattleAnimBgTilemap_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.bin.lz"); const u32 gBattleAnimBgTilemap_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.bin.lz");
const u32 gBattleAnimBgPalette_MagicRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/magic_room.gbapal.lz");
const u32 gBattleAnimBgImage_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.4bpp.lz"); const u32 gBattleAnimBgImage_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.4bpp.lz");
const u32 gBattleAnimBgPalette_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.gbapal.lz"); const u32 gBattleAnimBgPalette_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.gbapal.lz");
const u32 gBattleAnimBgTilemap_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.bin.lz"); const u32 gBattleAnimBgTilemap_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.bin.lz");
@ -1532,10 +1512,6 @@ const u32 gBattleAnimBgImage_PsychicTerrain[] = INCBIN_U32("graphics/battle_anim
const u32 gBattleAnimBgPalette_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.gbapal.lz"); const u32 gBattleAnimBgPalette_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.gbapal.lz");
const u32 gBattleAnimBgTilemap_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.bin.lz"); const u32 gBattleAnimBgTilemap_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.bin.lz");
//const u32 gBattleAnimBgImage_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.4bpp.lz");
//const u32 gBattleAnimBgPalette_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.gbapal.lz");
//const u32 gBattleAnimBgTilemap_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.bin.lz");
const u32 gBattleAnimBgImage_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.4bpp.lz"); const u32 gBattleAnimBgImage_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.4bpp.lz");
const u32 gBattleAnimBgPalette_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.gbapal.lz"); const u32 gBattleAnimBgPalette_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.gbapal.lz");
const u32 gBattleAnimBgTilemap_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.bin.lz"); const u32 gBattleAnimBgTilemap_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.bin.lz");
@ -1556,19 +1532,16 @@ const u32 gBattleAnimBgImage_SoulStealing7StarStrike[] = INCBIN_U32("graphics/ba
const u32 gBattleAnimBgPalette_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.gbapal.lz"); const u32 gBattleAnimBgPalette_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.gbapal.lz");
const u32 gBattleAnimBgTilemap_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin.lz"); const u32 gBattleAnimBgTilemap_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin.lz");
//const u32 gBattleAnimBgImage_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.4bpp.lz");
//const u32 gBattleAnimBgPalette_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.gbapal.lz");
//const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin.lz");
//const u32 gBattleAnimBgImage_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.4bpp.lz");
//const u32 gBattleAnimBgPalette_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.gbapal.lz");
//const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.bin.lz");
const u32 gBattleAnimBgPalette_TectonicRage[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/tectonic_rage.gbapal.lz"); const u32 gBattleAnimBgPalette_TectonicRage[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/tectonic_rage.gbapal.lz");
const u32 gBattleAnimBgImage_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.4bpp.lz"); const u32 gBattleAnimBgImage_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.4bpp.lz");
const u32 gBattleAnimBgPalette_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.gbapal.lz"); const u32 gBattleAnimBgPalette_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.gbapal.lz");
const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.bin.lz"); const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.bin.lz");
const u32 gBattleAnimBgPalette_MagicRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/magic_room.gbapal.lz");
const u32 gBattleAnimBgPalette_WonderRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/wonder_room.gbapal.lz");
const u32 gBattleAnimBgImage_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.4bpp.lz"); const u32 gBattleAnimBgImage_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.4bpp.lz");
const u32 gBattleAnimBgPalette_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.gbapal.lz"); const u32 gBattleAnimBgPalette_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.gbapal.lz");
const u32 gBattleAnimBgTilemap_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.bin.lz"); const u32 gBattleAnimBgTilemap_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.bin.lz");
@ -1581,7 +1554,8 @@ const u32 gBattleAnimBgImage_Waterfall[] = INCBIN_U32("graphics/battle_anims/bac
const u32 gBattleAnimBgPalette_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.gbapal.lz"); const u32 gBattleAnimBgPalette_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.gbapal.lz");
const u32 gBattleAnimBgTilemap_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.bin.lz"); const u32 gBattleAnimBgTilemap_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.bin.lz");
const u32 gBattleAnimBgPalette_WonderRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/wonder_room.gbapal.lz"); const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.gbapal.lz");
const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.bin.lz");
const u32 gBattleAnimBgImage_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.4bpp.lz"); const u32 gBattleAnimBgImage_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.4bpp.lz");
const u32 gBattleAnimBgPalette_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.gbapal.lz"); const u32 gBattleAnimBgPalette_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.gbapal.lz");