simultaneous hp reduction
This commit is contained in:
parent
612c8d3ff6
commit
97b30cb712
@ -356,7 +356,7 @@
|
||||
.byte 0x3a
|
||||
.endm
|
||||
|
||||
.macro healthbar_update battler:req
|
||||
.macro healthbarupdate_nonmovedamage battler:req
|
||||
.byte 0x3b
|
||||
.byte \battler
|
||||
.endm
|
||||
@ -1232,11 +1232,11 @@
|
||||
.byte 0xe5
|
||||
.endm
|
||||
|
||||
.macro unused3
|
||||
.macro setbattlemovedamage
|
||||
.byte 0xe6
|
||||
.endm
|
||||
|
||||
.macro unused4
|
||||
.macro copybattlemovedamage
|
||||
.byte 0xe7
|
||||
.endm
|
||||
|
||||
@ -1761,6 +1761,27 @@
|
||||
callnative BS_RemoveTerrain
|
||||
.endm
|
||||
|
||||
.macro setmoveresultflags flags:req
|
||||
callnative BS_SetMoveResultFlags
|
||||
.2byte \flags
|
||||
.endm
|
||||
|
||||
.macro clearmoveresultflags flags:req
|
||||
callnative BS_ClearMoveResultFlags
|
||||
.2byte \flags
|
||||
.endm
|
||||
|
||||
.macro jumpifmoveresultflags flags:req failInstr:req
|
||||
callnative BS_JumpIfMoveResultFlags
|
||||
.2byte \flags
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro jumpifcriticalhit failInstr:req
|
||||
callnative BS_JumpIfCriticalHit
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
@ various command changed to more readable macros
|
||||
.macro cancelmultiturnmoves battler:req
|
||||
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
|
||||
@ -2400,7 +2421,7 @@
|
||||
.endm
|
||||
|
||||
.macro jumpifmovehadnoeffect jumpInstr:req
|
||||
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpInstr
|
||||
jumpifmoveresultflags MOVE_RESULT_NO_EFFECT, \jumpInstr
|
||||
.endm
|
||||
|
||||
.macro jumpifside battler:req, side:req, equalJumpInstr:req
|
||||
|
||||
@ -411,6 +411,7 @@ B_ATK_TEAM2 = FD 38
|
||||
B_DEF_NAME = FD 39
|
||||
B_DEF_TEAM1 = FD 3A
|
||||
B_DEF_TEAM2 = FD 3B
|
||||
B_DEF_PARTNER_NAME = FD 3C
|
||||
@ FD 3C - preiously gActiveBattler
|
||||
@ FD 3D - preiously gActiveBattler without Illusion Check
|
||||
B_ATK_NAME_WITH_PREFIX2 = FD 3E
|
||||
|
||||
@ -26,7 +26,7 @@ BattleScript_DamageToQuarterTargetHP::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
damagetoquartertargethp
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
@ -205,7 +205,7 @@ BattleScript_FilletAwayTrySpeed::
|
||||
printfromtable gStatUpStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_FilletAwayEnd::
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
clearmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
goto BattleScript_MoveEnd
|
||||
@ -238,7 +238,7 @@ BattleScript_EffectDoodle_AfterCopy:
|
||||
|
||||
BattleScript_EffectGlaiveRush::
|
||||
call BattleScript_EffectHit_Ret
|
||||
jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TryFaintMon
|
||||
jumpifmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TryFaintMon
|
||||
setglaiverush
|
||||
goto BattleScript_TryFaintMon
|
||||
|
||||
@ -434,7 +434,7 @@ BattleScript_EffectCorrosiveGas::
|
||||
|
||||
BattleScript_CorrosiveGasFail:
|
||||
pause B_WAIT_TIME_SHORT
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
printstring STRINGID_NOEFFECTONTARGET
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
@ -717,7 +717,7 @@ BattleScript_SkyDropFlyingType:
|
||||
goto BattleScript_MoveEnd
|
||||
BattleScript_SkyDropChangedTarget:
|
||||
pause B_WAIT_TIME_SHORT
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
makevisible BS_ATTACKER
|
||||
@ -1797,7 +1797,7 @@ BattleScript_EffectFinalGambit::
|
||||
ppreduce
|
||||
critcalc
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
dmgtocurrattackerhp
|
||||
adjustdamage
|
||||
attackanimation
|
||||
@ -1809,13 +1809,13 @@ BattleScript_EffectFinalGambit::
|
||||
datahpupdate BS_TARGET
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
dmgtocurrattackerhp
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
setadditionaleffects
|
||||
tryfaintmon BS_ATTACKER
|
||||
tryfaintmon BS_TARGET
|
||||
jumpifmovehadnoeffect BattleScript_MoveEnd
|
||||
setatkhptozero
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
tryfaintmon BS_ATTACKER
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectHitSwitchTarget::
|
||||
@ -2384,7 +2384,7 @@ BattleScript_EffectMetalBurst::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE
|
||||
adjustdamage
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
@ -2860,7 +2860,7 @@ BattleScript_EffectNaturalGiftEnd:
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_MakeMoveMissed::
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_MISSED
|
||||
setmoveresultflags MOVE_RESULT_MISSED
|
||||
BattleScript_PrintMoveMissed::
|
||||
attackstring
|
||||
ppreduce
|
||||
@ -2912,14 +2912,14 @@ BattleScript_ElectricTerrainPrevents::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_ELECTRICTERRAINPREVENTS
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_MistyTerrainPrevents::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_MISTYTERRAINPREVENTS
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_FlowerVeilProtectsRet::
|
||||
@ -2931,7 +2931,7 @@ BattleScript_FlowerVeilProtectsRet::
|
||||
|
||||
BattleScript_FlowerVeilProtects:
|
||||
call BattleScript_FlowerVeilProtectsRet
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_SweetVeilProtectsRet::
|
||||
@ -2943,7 +2943,7 @@ BattleScript_SweetVeilProtectsRet::
|
||||
|
||||
BattleScript_SweetVeilProtects:
|
||||
call BattleScript_SweetVeilProtectsRet
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_AromaVeilProtectsRet::
|
||||
@ -2955,7 +2955,7 @@ BattleScript_AromaVeilProtectsRet::
|
||||
|
||||
BattleScript_AromaVeilProtects:
|
||||
call BattleScript_AromaVeilProtectsRet
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_PastelVeilProtectsRet::
|
||||
@ -2967,7 +2967,7 @@ BattleScript_PastelVeilProtectsRet::
|
||||
|
||||
BattleScript_PastelVeilProtects:
|
||||
call BattleScript_PastelVeilProtectsRet
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_AbilityProtectsDoesntAffectRet::
|
||||
@ -2979,7 +2979,7 @@ BattleScript_AbilityProtectsDoesntAffectRet::
|
||||
|
||||
BattleScript_AbilityProtectsDoesntAffect:
|
||||
call BattleScript_AbilityProtectsDoesntAffectRet
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_InsomniaProtects:
|
||||
@ -2987,7 +2987,7 @@ BattleScript_InsomniaProtects:
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNSTAYEDAWAKEUSING
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_AlreadyAsleep::
|
||||
@ -2995,33 +2995,36 @@ BattleScript_AlreadyAsleep::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_PKMNALREADYASLEEP
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_WasntAffected::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_PKMNWASNTAFFECTED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_CantMakeAsleep::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printfromtable gUproarAwakeStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectAbsorbLiquidOoze::
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
goto BattleScript_EffectAbsorb
|
||||
goto BattleScript_EffectAbsorbFromHealthBarUpdate
|
||||
|
||||
BattleScript_EffectAbsorb::
|
||||
healthbarupdate BS_ATTACKER
|
||||
playanimation BS_ATTACKER, B_ANIM_SIMPLE_HEAL
|
||||
BattleScript_EffectAbsorbFromHealthBarUpdate:
|
||||
healthbarupdate_nonmovedamage BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
printfromtable gAbsorbDrainStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
tryfaintmon BS_ATTACKER
|
||||
bicword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_PASSIVE_DAMAGE
|
||||
return
|
||||
|
||||
BattleScript_EffectExplosion::
|
||||
@ -3093,7 +3096,7 @@ BattleScript_EffectMirrorMove::
|
||||
pause B_WAIT_TIME_LONG
|
||||
trymirrormove
|
||||
ppreduce
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
printstring STRINGID_MIRRORMOVEFAILED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
@ -3432,7 +3435,7 @@ BattleScript_EffectSuperFang::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
damagetohalftargethp
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
@ -3441,7 +3444,7 @@ BattleScript_EffectRecoilIfMiss::
|
||||
accuracycheck BattleScript_MoveMissedDoDamage, ACC_CURR_MOVE
|
||||
.if B_CRASH_IF_TARGET_IMMUNE >= GEN_4
|
||||
typecalc
|
||||
jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveMissedDoDamage
|
||||
jumpifmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveMissedDoDamage
|
||||
.endif
|
||||
goto BattleScript_HitFromAtkString
|
||||
BattleScript_MoveMissedDoDamage::
|
||||
@ -3452,7 +3455,7 @@ BattleScript_MoveMissedDoDamage::
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
.if B_CRASH_IF_TARGET_IMMUNE < GEN_4
|
||||
jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd
|
||||
jumpifmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd
|
||||
.endif
|
||||
moveendcase MOVEEND_PROTECT_LIKE_EFFECT @ Spiky Shield's damage happens before recoil.
|
||||
jumpifhasnohp BS_ATTACKER, BattleScript_MoveEnd
|
||||
@ -3467,18 +3470,18 @@ BattleScript_MoveMissedDoDamage::
|
||||
manipulatedamage DMG_RECOIL_FROM_MISS
|
||||
.endif
|
||||
.if B_CRASH_IF_TARGET_IMMUNE >= GEN_4
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
clearmoveresultflags MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
.else
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED
|
||||
clearmoveresultflags MOVE_RESULT_MISSED
|
||||
.endif
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
tryfaintmon BS_ATTACKER
|
||||
.if B_CRASH_IF_TARGET_IMMUNE >= GEN_4
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
setmoveresultflags MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
.else
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_MISSED
|
||||
setmoveresultflags MOVE_RESULT_MISSED
|
||||
.endif
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
@ -3665,7 +3668,7 @@ BattleScript_EffectParalyze::
|
||||
jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents
|
||||
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
||||
jumpifsafeguard BattleScript_SafeguardProtected
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
attackanimation
|
||||
waitanimation
|
||||
seteffectprimary MOVE_EFFECT_PARALYSIS
|
||||
@ -3911,7 +3914,7 @@ BattleScript_EffectLevelDamage::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
dmgtolevel
|
||||
adjustdamage
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
@ -3922,7 +3925,7 @@ BattleScript_EffectPsywave::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
psywavedamageeffect
|
||||
adjustdamage
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
@ -3934,7 +3937,7 @@ BattleScript_EffectCounter::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE
|
||||
adjustdamage
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
@ -3962,7 +3965,6 @@ BattleScript_EffectPainSplit::
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
copyword gBattleMoveDamage, sPAINSPLIT_HP
|
||||
healthbarupdate BS_TARGET
|
||||
datahpupdate BS_TARGET
|
||||
printstring STRINGID_SHAREDPAIN
|
||||
@ -4417,7 +4419,7 @@ BattleScript_EffectFixedDamageArg::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
setargtobattledamage
|
||||
adjustdamage
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
@ -4562,7 +4564,7 @@ BattleScript_EffectMirrorCoat::
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE
|
||||
clearmoveresultflags MOVE_RESULT_NOT_VERY_EFFECTIVE | MOVE_RESULT_SUPER_EFFECTIVE
|
||||
adjustdamage
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
@ -4618,7 +4620,7 @@ BattleScript_BeatUpLoop::
|
||||
trydobeatup BattleScript_BeatUpEnd, BattleScript_ButItFailed
|
||||
printstring STRINGID_PKMNATTACK
|
||||
critcalc
|
||||
jumpifbyte CMP_NOT_EQUAL, gIsCriticalHit, TRUE, BattleScript_BeatUpAttack
|
||||
jumpifcriticalhit BattleScript_BeatUpAttack
|
||||
manipulatedamage DMG_DOUBLED
|
||||
BattleScript_BeatUpAttack::
|
||||
adjustdamage
|
||||
@ -4687,7 +4689,7 @@ BattleScript_FailedFromPpReduce::
|
||||
ppreduce
|
||||
BattleScript_ButItFailed::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
@ -4697,7 +4699,7 @@ BattleScript_RestoreAttackerButItFailed:
|
||||
|
||||
BattleScript_NotAffected::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
setmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
@ -4705,7 +4707,7 @@ BattleScript_NotAffected::
|
||||
BattleScript_NotAffectedAbilityPopUp::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
setmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
@ -4775,7 +4777,6 @@ BattleScript_EffectSpitUp::
|
||||
attackstring
|
||||
ppreduce
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
setbyte gIsCriticalHit, FALSE
|
||||
damagecalc
|
||||
adjustdamage
|
||||
stockpiletobasedamage BattleScript_SpitUpFail
|
||||
@ -5109,7 +5110,7 @@ BattleScript_EffectBrickBreak::
|
||||
damagecalc
|
||||
adjustdamage
|
||||
jumpifbyte CMP_EQUAL, sB_ANIM_TURN, 0, BattleScript_BrickBreakAnim
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
clearmoveresultflags MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
BattleScript_BrickBreakAnim::
|
||||
attackanimation
|
||||
waitanimation
|
||||
@ -5167,12 +5168,10 @@ BattleScript_EffectEndeavor::
|
||||
attackstring
|
||||
ppreduce
|
||||
setdamagetohealthdifference BattleScript_ButItFailed
|
||||
copyword gHpDealt, gBattleMoveDamage
|
||||
accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE
|
||||
typecalc
|
||||
jumpifmovehadnoeffect BattleScript_HitFromAtkAnimation
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
copyword gBattleMoveDamage, gHpDealt
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
adjustdamage
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
@ -5296,7 +5295,7 @@ BattleScript_TickleEnd::
|
||||
|
||||
BattleScript_CantLowerMultipleStats::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
printstring STRINGID_STATSWONTDECREASE2
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
@ -5380,7 +5379,7 @@ BattleScript_CalmMindEnd::
|
||||
|
||||
BattleScript_CantRaiseMultipleStats::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
printstring STRINGID_STATSWONTINCREASE2
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
@ -6034,7 +6033,6 @@ BattleScript_SafeguardEnds::
|
||||
|
||||
BattleScript_LeechSeedTurnDrainLiquidOoze::
|
||||
call BattleScript_LeechSeedTurnDrain
|
||||
manipulatedamage DMG_CHANGE_SIGN
|
||||
copybyte gBattlerAbility, gBattlerAttacker
|
||||
call BattleScript_AbilityPopUp
|
||||
goto BattleScript_LeechSeedTurnDrainGainHp
|
||||
@ -6046,7 +6044,6 @@ BattleScript_LeechSeedTurnDrainHealBlock::
|
||||
BattleScript_LeechSeedTurnDrainRecovery::
|
||||
call BattleScript_LeechSeedTurnDrain
|
||||
BattleScript_LeechSeedTurnDrainGainHp:
|
||||
manipulatedamage DMG_BIG_ROOT
|
||||
healthbarupdate BS_TARGET
|
||||
datahpupdate BS_TARGET
|
||||
printfromtable gLeechSeedStringIds
|
||||
@ -6073,8 +6070,8 @@ BattleScript_BideAttack::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
accuracycheck BattleScript_MoveMissed, ACC_CURR_MOVE
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
copyword gBattleMoveDamage, sBIDE_DMG
|
||||
clearmoveresultflags MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
unused_95
|
||||
adjustdamage
|
||||
setbyte sB_ANIM_TURN, 1
|
||||
attackanimation
|
||||
@ -6630,14 +6627,14 @@ BattleScript_FutureAttackEnd::
|
||||
moveendcase MOVEEND_RAGE
|
||||
moveendcase MOVEEND_ABILITIES
|
||||
moveendfromto MOVEEND_ITEM_EFFECTS_ALL, MOVEEND_UPDATE_LAST_MOVES
|
||||
setbyte gMoveResultFlags, 0
|
||||
setmoveresultflags 0
|
||||
end2
|
||||
BattleScript_FutureAttackMiss::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
sethword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
sethword gMoveResultFlags, 0
|
||||
setmoveresultflags 0
|
||||
end2
|
||||
|
||||
BattleScript_NoMovesLeft::
|
||||
@ -6911,7 +6908,7 @@ BattleScript_MagicCoatPrankster::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
printstring STRINGID_ITDOESNTAFFECT
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
setmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_SnatchedMove::
|
||||
@ -6960,7 +6957,6 @@ BattleScript_MegaEvolution::
|
||||
printstring STRINGID_MEGAEVOREACTING
|
||||
BattleScript_MegaEvolutionAfterString:
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
setbyte gIsCriticalHit, 0
|
||||
handlemegaevo BS_SCRIPTING, 0
|
||||
playanimation BS_SCRIPTING, B_ANIM_MEGA_EVOLUTION
|
||||
waitanimation
|
||||
@ -6978,7 +6974,6 @@ BattleScript_WishMegaEvolution::
|
||||
|
||||
BattleScript_PrimalReversion::
|
||||
flushtextbox
|
||||
setbyte gIsCriticalHit, 0
|
||||
handleprimalreversion BS_SCRIPTING, 0
|
||||
handleprimalreversion BS_SCRIPTING, 1
|
||||
playanimation BS_SCRIPTING, B_ANIM_PRIMAL_REVERSION
|
||||
@ -6994,7 +6989,6 @@ BattleScript_UltraBurst::
|
||||
trytrainerslidezmovemsg
|
||||
printstring STRINGID_ULTRABURSTREACTING
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
setbyte gIsCriticalHit, 0
|
||||
handleultraburst BS_SCRIPTING, 0
|
||||
playanimation BS_SCRIPTING, B_ANIM_ULTRA_BURST
|
||||
waitanimation
|
||||
@ -7301,7 +7295,7 @@ BattleScript_PowderMoveNoEffectPrint:
|
||||
BattleScript_PowderMoveNoEffectWaitMsg:
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
cancelmultiturnmoves BS_ATTACKER
|
||||
sethword gMoveResultFlags, MOVE_RESULT_FAILED
|
||||
setmoveresultflags MOVE_RESULT_FAILED
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_MoveUsedFlinched::
|
||||
@ -8233,7 +8227,7 @@ BattleScript_MoveHPDrain::
|
||||
datahpupdate BS_TARGET
|
||||
printstring STRINGID_PKMNRESTOREDHPUSING
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
setmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_MoveStatDrain_PPLoss::
|
||||
@ -8265,7 +8259,7 @@ BattleScript_MonMadeMoveUseless::
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNSXMADEYUSELESS
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
setmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_FlashFireBoost_PPLoss::
|
||||
@ -8344,7 +8338,7 @@ BattleScript_SoundproofProtected::
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNSXBLOCKSY
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
setmoveresultflags MOVE_RESULT_DOESNT_AFFECT_FOE
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_IceFaceNullsDamage::
|
||||
@ -8393,7 +8387,7 @@ BattleScript_AbilityNoSpecificStatLoss::
|
||||
printstring STRINGID_PKMNSXPREVENTSYLOSS
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
setmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
return
|
||||
|
||||
BattleScript_StickyHoldActivates::
|
||||
@ -8418,7 +8412,7 @@ BattleScript_ProteanActivates::
|
||||
|
||||
BattleScript_TeraShellDistortingTypeMatchups::
|
||||
pause B_WAIT_TIME_SHORTEST
|
||||
call BattleScript_AbilityPopUp
|
||||
call BattleScript_AbilityPopUpScripting
|
||||
printstring STRINGID_PKMNMADESHELLGLEAM
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
@ -8503,7 +8497,7 @@ BattleScript_WeakArmorActivates::
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_WeakArmorActivatesSpeed
|
||||
pause B_WAIT_TIME_SHORTEST
|
||||
printfromtable gStatDownStringIds
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED @ Set by statbuffchange when stat can't be decreased
|
||||
clearmoveresultflags MOVE_RESULT_MISSED @ Set by statbuffchange when stat can't be decreased
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_WeakArmorActivatesSpeed
|
||||
BattleScript_WeakArmorDefAnim:
|
||||
@ -8522,7 +8516,7 @@ BattleScript_WeakArmorActivatesSpeed:
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_EMPTY, BattleScript_WeakArmorActivatesEnd
|
||||
pause B_WAIT_TIME_SHORTEST
|
||||
printstring STRINGID_TARGETSTATWONTGOHIGHER
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED
|
||||
clearmoveresultflags MOVE_RESULT_MISSED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_WeakArmorActivatesEnd
|
||||
BattleScript_WeakArmorSpeedAnim:
|
||||
@ -8645,31 +8639,31 @@ BattleScript_RockyHelmetActivatesDmg:
|
||||
BattleScript_SpikyShieldEffect::
|
||||
jumpifabsent BS_ATTACKER, BattleScript_SpikyShieldRet
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
clearmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
printstring STRINGID_PKMNHURTSWITH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
tryfaintmon BS_ATTACKER
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_MISSED
|
||||
setmoveresultflags MOVE_RESULT_MISSED
|
||||
BattleScript_SpikyShieldRet::
|
||||
return
|
||||
|
||||
BattleScript_KingsShieldEffect::
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
clearmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
seteffectsecondary
|
||||
copybyte sBATTLER, gBattlerTarget
|
||||
copybyte gBattlerTarget, gBattlerAttacker
|
||||
copybyte gBattlerAttacker, sBATTLER
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_MISSED
|
||||
setmoveresultflags MOVE_RESULT_MISSED
|
||||
return
|
||||
|
||||
BattleScript_BanefulBunkerEffect::
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_PASSIVE_DAMAGE
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
clearmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
seteffectsecondary
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_MISSED
|
||||
setmoveresultflags MOVE_RESULT_MISSED
|
||||
return
|
||||
|
||||
BattleScript_CuteCharmActivates::
|
||||
@ -8873,18 +8867,12 @@ BattleScript_GemActivates::
|
||||
return
|
||||
|
||||
BattleScript_BerryReduceDmg::
|
||||
playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT
|
||||
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT
|
||||
waitanimation
|
||||
setlastuseditem BS_TARGET
|
||||
printstring STRINGID_TARGETATEITEM
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
removeitem BS_TARGET
|
||||
return
|
||||
|
||||
BattleScript_PrintBerryReduceString::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
setlastuseditem BS_SCRIPTING
|
||||
printstring STRINGID_BERRYDMGREDUCES
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
removeitem BS_SCRIPTING
|
||||
return
|
||||
|
||||
BattleScript_BerryCureConfusionEnd2::
|
||||
@ -9673,7 +9661,7 @@ BattleScript_DarkTypePreventsPrankster::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_ITDOESNTAFFECT
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
setmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_WellBakedBodyActivates::
|
||||
@ -9681,7 +9669,7 @@ BattleScript_WellBakedBodyActivates::
|
||||
ppreduce
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
setmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
modifybattlerstatstage BS_TARGET, STAT_DEF, INCREASE, 1, BattleScript_WellBakedBodyEnd, ANIM_ON
|
||||
BattleScript_WellBakedBodyEnd:
|
||||
goto BattleScript_MoveEnd
|
||||
@ -9691,7 +9679,7 @@ BattleScript_WindRiderActivatesMoveEnd::
|
||||
ppreduce
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
setmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_WindRiderActivatesMoveEnd_End, ANIM_ON
|
||||
BattleScript_WindRiderActivatesMoveEnd_End:
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
@ -48,7 +48,7 @@ BattleScript_UseItemMessage:
|
||||
return
|
||||
|
||||
BattleScript_ItemRestoreHPRet:
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
clearmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
||||
healthbarupdate BS_SCRIPTING
|
||||
datahpupdate BS_SCRIPTING
|
||||
@ -69,7 +69,7 @@ BattleScript_ItemRestoreHPEnd:
|
||||
|
||||
BattleScript_ItemRestoreHP_Party::
|
||||
jumpifbyte CMP_EQUAL, gBattleCommunication, TRUE, BattleScript_ItemRestoreHP_SendOutRevivedBattler
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||
clearmoveresultflags MOVE_RESULT_NO_EFFECT
|
||||
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
@ -251,6 +251,8 @@ struct SpecialStatus
|
||||
u8 afterYou:1;
|
||||
u8 preventLifeOrbDamage:1; // So that Life Orb doesn't activate various effects.
|
||||
u8 distortedTypeMatchups:1;
|
||||
u8 teraShellAbilityDone:1;
|
||||
u8 criticalHit:1;
|
||||
};
|
||||
|
||||
struct SideTimer
|
||||
@ -831,6 +833,20 @@ struct BattleStruct
|
||||
u8 redCardActivates:1;
|
||||
u8 usedEjectItem;
|
||||
u8 usedMicleBerry;
|
||||
s32 battlerExpReward;
|
||||
|
||||
// Simultaneous hp reduction for spread moves
|
||||
s32 calculatedDamage[MAX_BATTLERS_COUNT];
|
||||
s32 calculatedCritChance[MAX_BATTLERS_COUNT];
|
||||
u16 moveResultFlags[MAX_BATTLERS_COUNT];
|
||||
u8 missStringId[MAX_BATTLERS_COUNT];
|
||||
u8 noResultString[MAX_BATTLERS_COUNT];
|
||||
u8 doneDoublesSpreadHit:1;
|
||||
u8 calculatedDamageDone:1;
|
||||
u8 calculatedSpreadMoveAccuracy:1;
|
||||
u8 printedStrongWindsWeakenedAttack:1;
|
||||
u8 numSpreadTargets:2;
|
||||
u8 padding:2;
|
||||
};
|
||||
|
||||
// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
|
||||
@ -845,7 +861,6 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER
|
||||
#define IS_MOVE_PHYSICAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL)
|
||||
#define IS_MOVE_SPECIAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL)
|
||||
#define IS_MOVE_STATUS(move)(gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS)
|
||||
|
||||
#define IS_MOVE_RECOIL(move)(gMovesInfo[move].recoil > 0 || gMovesInfo[move].effect == EFFECT_RECOIL_IF_MISS)
|
||||
|
||||
#define BATTLER_MAX_HP(battlerId)(gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)
|
||||
@ -892,6 +907,8 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER
|
||||
#define SET_STATCHANGER(statId, stage, goesDown) (gBattleScripting.statChanger = (statId) + ((stage) << 3) + (goesDown << 7))
|
||||
#define SET_STATCHANGER2(dst, statId, stage, goesDown)(dst = (statId) + ((stage) << 3) + (goesDown << 7))
|
||||
|
||||
#define DO_ACCURACY_CHECK 2 // Don't skip the accuracy check before the move might be absorbed
|
||||
|
||||
// NOTE: The members of this struct have hard-coded offsets
|
||||
// in include/constants/battle_script_commands.h
|
||||
struct BattleScripting
|
||||
@ -1072,7 +1089,6 @@ extern u8 gChosenMovePos;
|
||||
extern u16 gCurrentMove;
|
||||
extern u16 gChosenMove;
|
||||
extern u16 gCalledMove;
|
||||
extern s32 gBattleMoveDamage;
|
||||
extern s32 gHpDealt;
|
||||
extern s32 gBideDmg[MAX_BATTLERS_COUNT];
|
||||
extern u16 gLastUsedItem;
|
||||
@ -1083,7 +1099,6 @@ extern u8 gBattlerFainted;
|
||||
extern u8 gEffectBattler;
|
||||
extern u8 gPotentialItemEffectBattler;
|
||||
extern u8 gAbsentBattlerFlags;
|
||||
extern u8 gIsCriticalHit;
|
||||
extern u8 gMultiHitCounter;
|
||||
extern const u8 *gBattlescriptCurrInstr;
|
||||
extern u8 gChosenActionByBattler[MAX_BATTLERS_COUNT];
|
||||
@ -1099,7 +1114,6 @@ extern u16 gLockedMoves[MAX_BATTLERS_COUNT];
|
||||
extern u16 gLastUsedMove;
|
||||
extern u8 gLastHitBy[MAX_BATTLERS_COUNT];
|
||||
extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT];
|
||||
extern u16 gMoveResultFlags;
|
||||
extern u32 gHitMarker;
|
||||
extern u8 gBideTarget[MAX_BATTLERS_COUNT];
|
||||
extern u32 gSideStatuses[NUM_BATTLE_SIDES];
|
||||
@ -1187,5 +1201,22 @@ static inline bool32 IsDoubleBattle(void)
|
||||
return gBattleTypeFlags & BATTLE_TYPE_DOUBLE;
|
||||
}
|
||||
|
||||
static inline bool32 IsSpreadMove(u32 moveTarget)
|
||||
{
|
||||
return IsDoubleBattle() && (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY);
|
||||
}
|
||||
|
||||
static inline bool32 IsBattlerInvalidForSpreadMove(u32 battlerAtk, u32 battlerDef, u32 moveTarget)
|
||||
{
|
||||
return battlerDef == battlerAtk
|
||||
|| !IsBattlerAlive(battlerDef)
|
||||
|| (battlerDef == BATTLE_PARTNER(battlerAtk) && (moveTarget == MOVE_TARGET_BOTH));
|
||||
}
|
||||
|
||||
static inline bool32 MoveResultHasEffect(u32 battler)
|
||||
{
|
||||
return !(gBattleStruct->moveResultFlags[battler] & MOVE_RESULT_NO_EFFECT);
|
||||
}
|
||||
|
||||
#endif // GUARD_BATTLE_H
|
||||
|
||||
|
||||
@ -72,6 +72,7 @@
|
||||
#define B_TXT_DEF_NAME 0x39
|
||||
#define B_TXT_DEF_TEAM1 0x3A // Your/The opposing
|
||||
#define B_TXT_DEF_TEAM2 0x3B // your/the opposing
|
||||
#define B_TXT_DEF_PARTNER_NAME 0x3C
|
||||
// #define B_TXT_SELECTION_NAME 0x3C - removed
|
||||
// #define B_TXT_SELECTION_NAME2 0x3D no Illusion check - removed
|
||||
#define B_TXT_ATK_NAME_WITH_PREFIX2 0x3E //lowercase
|
||||
|
||||
@ -358,7 +358,6 @@ extern const u8 BattleScript_SelectingNotAllowedMoveThroatChopInPalace[];
|
||||
extern const u8 BattleScript_ThroatChopEndTurn[];
|
||||
extern const u8 BattleScript_GemActivates[];
|
||||
extern const u8 BattleScript_BerryReduceDmg[];
|
||||
extern const u8 BattleScript_PrintBerryReduceString[];
|
||||
extern const u8 BattleScript_WeaknessPolicy[];
|
||||
extern const u8 BattleScript_TargetItemStatRaise[];
|
||||
extern const u8 BattleScript_RockyHelmetActivates[];
|
||||
|
||||
@ -118,6 +118,7 @@ enum
|
||||
CANCELLER_EXPLODING_DAMP,
|
||||
CANCELLER_MULTIHIT_MOVES,
|
||||
CANCELLER_Z_MOVES,
|
||||
CANCELLER_MULTI_TARGET_MOVES,
|
||||
CANCELLER_END,
|
||||
CANCELLER_PSYCHIC_TERRAIN,
|
||||
CANCELLER_END2,
|
||||
@ -313,5 +314,7 @@ bool8 CanMonParticipateInSkyBattle(struct Pokemon *mon);
|
||||
bool8 IsMonBannedFromSkyBattles(u16 species);
|
||||
void RemoveBattlerType(u32 battler, u8 type);
|
||||
u32 GetMoveType(u32 move);
|
||||
bool32 IsDoubleSpreadMove(void);
|
||||
void ClearDamageCalcResults(void);
|
||||
|
||||
#endif // GUARD_BATTLE_UTIL_H
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
// still has them in the ROM. This is because the developers forgot
|
||||
// to define NDEBUG before release, however this has been changed as
|
||||
// Ruby's actual debug build does not use the AGBPrint features.
|
||||
#define NDEBUG
|
||||
// #define NDEBUG
|
||||
|
||||
// To enable printf debugging, comment out "#define NDEBUG". This allows
|
||||
// the various AGBPrint functions to be used. (See include/gba/isagbprint.h).
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
// The following correspond to the struct members of BattleScripting by adding their offset
|
||||
#define sPAINSPLIT_HP (gBattleScripting + 0x00) // painSplitHp
|
||||
#define sBIDE_DMG (gBattleScripting + 0x04) // bideDmg
|
||||
#define sUNUSED_0x04 (gBattleScripting + 0x04) // unused_0x04
|
||||
#define sMULTIHIT_STRING (gBattleScripting + 0x08) // multihitString
|
||||
#define sEXP_CATCH (gBattleScripting + 0x0E) // expOnCatch
|
||||
#define sUNUSED (gBattleScripting + 0x0F) // unused
|
||||
@ -222,14 +222,14 @@
|
||||
#define VARIOUS_SWAP_STATS 130
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
#define DMG_RECOIL_FROM_MISS 1
|
||||
#define DMG_DOUBLED 2
|
||||
#define DMG_1_8_TARGET_HP 3
|
||||
#define DMG_FULL_ATTACKER_HP 4
|
||||
#define DMG_CURR_ATTACKER_HP 5
|
||||
#define DMG_BIG_ROOT 6
|
||||
#define DMG_RECOIL_FROM_IMMUNE 7 // Used to calculate recoil for the Gen 4 version of Jump Kick
|
||||
#define DMG_CHANGE_SIGN 1
|
||||
#define DMG_RECOIL_FROM_MISS 2
|
||||
#define DMG_DOUBLED 3
|
||||
#define DMG_1_8_TARGET_HP 4
|
||||
#define DMG_FULL_ATTACKER_HP 5
|
||||
#define DMG_CURR_ATTACKER_HP 6
|
||||
#define DMG_BIG_ROOT 7
|
||||
#define DMG_RECOIL_FROM_IMMUNE 8 // Used to calculate recoil for the Gen 4 version of Jump Kick
|
||||
|
||||
// Cmd_jumpifcantswitch
|
||||
#define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7)
|
||||
|
||||
@ -724,8 +724,11 @@
|
||||
#define STRINGID_ELECTRICCURRENTISRUNNING 722
|
||||
#define STRINGID_SEEMSWEIRD 723
|
||||
#define STRINGID_WAGGLINGAFINGER 724
|
||||
#define STRINGID_SUPEREFFECTIVETWOFOES 725
|
||||
#define STRINGID_NOTVERYEFFECTIVETWOFOES 726
|
||||
#define STRINGID_ITDOESNTAFFECTTWOFOES 727
|
||||
|
||||
#define BATTLESTRINGS_COUNT 725
|
||||
#define BATTLESTRINGS_COUNT 728
|
||||
|
||||
// This is the string id that gBattleStringsTable starts with.
|
||||
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
||||
|
||||
@ -737,7 +737,7 @@ static bool32 FindMonWithFlagsAndSuperEffective(u32 battler, u16 flags, u32 perc
|
||||
species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG);
|
||||
monAbility = GetMonAbility(&party[i]);
|
||||
CalcPartyMonTypeEffectivenessMultiplier(gLastLandedMoves[battler], species, monAbility);
|
||||
if (gMoveResultFlags & flags)
|
||||
if (gBattleStruct->moveResultFlags[BATTLE_OPPOSITE(battler)] & flags)
|
||||
{
|
||||
battlerIn1 = gLastHitBy[battler];
|
||||
|
||||
@ -1228,7 +1228,6 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva
|
||||
|
||||
u32 aiMove;
|
||||
|
||||
gMoveResultFlags = 0;
|
||||
// If we couldn't find the best mon in terms of typing, find the one that deals most damage.
|
||||
for (i = firstId; i < lastId; i++)
|
||||
{
|
||||
|
||||
@ -1052,7 +1052,6 @@ uq4_12_t AI_GetTypeEffectiveness(u32 move, u32 battlerAtk, u32 battlerDef)
|
||||
|
||||
u32 AI_GetMoveEffectiveness(u32 move, u32 battlerAtk, u32 battlerDef)
|
||||
{
|
||||
gMoveResultFlags = 0;
|
||||
return AI_GetEffectiveness(AI_GetTypeEffectiveness(move, battlerAtk, battlerDef));
|
||||
}
|
||||
|
||||
|
||||
@ -391,20 +391,20 @@ void BattleArena_AddSkillPoints(u8 battler)
|
||||
*failedMoveBits &= ~((1u << battler));
|
||||
skillPoints[battler] -= 2;
|
||||
}
|
||||
else if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
else if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)
|
||||
{
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_MISSED) || gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
|
||||
if (!(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_MISSED) || gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
|
||||
skillPoints[battler] -= 2;
|
||||
}
|
||||
else if ((gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) && (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE))
|
||||
else if ((gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_SUPER_EFFECTIVE) && (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NOT_VERY_EFFECTIVE))
|
||||
{
|
||||
skillPoints[battler] += 1;
|
||||
}
|
||||
else if (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE)
|
||||
else if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_SUPER_EFFECTIVE)
|
||||
{
|
||||
skillPoints[battler] += 2;
|
||||
}
|
||||
else if (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE)
|
||||
else if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NOT_VERY_EFFECTIVE)
|
||||
{
|
||||
skillPoints[battler] -= 1;
|
||||
}
|
||||
|
||||
@ -528,7 +528,7 @@ void BS_SetMaxMoveEffect(void)
|
||||
u8 maxEffect = gMovesInfo[gCurrentMove].argument;
|
||||
|
||||
// Don't continue if the move didn't land.
|
||||
if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
return;
|
||||
@ -978,10 +978,10 @@ void BS_TrySetStatus2(void)
|
||||
void BS_HealOneSixth(void)
|
||||
{
|
||||
NATIVE_ARGS(const u8* failInstr);
|
||||
gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 6;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
gBattleMoveDamage *= -1;
|
||||
gBattleStruct->calculatedDamage[gBattlerTarget] = gBattleMons[gBattlerTarget].maxHP / 6;
|
||||
if (gBattleStruct->calculatedDamage[gBattlerTarget] == 0)
|
||||
gBattleStruct->calculatedDamage[gBattlerTarget] = 1;
|
||||
gBattleStruct->calculatedDamage[gBattlerTarget] *= -1;
|
||||
|
||||
if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP)
|
||||
gBattlescriptCurrInstr = cmd->failInstr; // fail
|
||||
|
||||
@ -162,7 +162,6 @@ EWRAM_DATA u8 gChosenMovePos = 0;
|
||||
EWRAM_DATA u16 gCurrentMove = 0;
|
||||
EWRAM_DATA u16 gChosenMove = 0;
|
||||
EWRAM_DATA u16 gCalledMove = 0;
|
||||
EWRAM_DATA s32 gBattleMoveDamage = 0;
|
||||
EWRAM_DATA s32 gHpDealt = 0;
|
||||
EWRAM_DATA s32 gBideDmg[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gLastUsedItem = 0;
|
||||
@ -173,7 +172,6 @@ EWRAM_DATA u8 gBattlerFainted = 0;
|
||||
EWRAM_DATA u8 gEffectBattler = 0;
|
||||
EWRAM_DATA u8 gPotentialItemEffectBattler = 0;
|
||||
EWRAM_DATA u8 gAbsentBattlerFlags = 0;
|
||||
EWRAM_DATA u8 gIsCriticalHit = FALSE;
|
||||
EWRAM_DATA u8 gMultiHitCounter = 0;
|
||||
EWRAM_DATA const u8 *gBattlescriptCurrInstr = NULL;
|
||||
EWRAM_DATA u8 gChosenActionByBattler[MAX_BATTLERS_COUNT] = {0};
|
||||
@ -189,7 +187,6 @@ EWRAM_DATA u16 gLockedMoves[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gLastUsedMove = 0;
|
||||
EWRAM_DATA u8 gLastHitBy[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gMoveResultFlags = 0;
|
||||
EWRAM_DATA u32 gHitMarker = 0;
|
||||
EWRAM_DATA u8 gBideTarget[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u32 gSideStatuses[NUM_BATTLE_SIDES] = {0};
|
||||
@ -3044,6 +3041,7 @@ static void BattleStartClearSetData(void)
|
||||
gBattleStruct->AI_monToSwitchIntoId[i] = PARTY_SIZE;
|
||||
gBattleStruct->skyDropTargets[i] = 0xFF;
|
||||
gBattleStruct->overwrittenAbilities[i] = ABILITY_NONE;
|
||||
|
||||
}
|
||||
|
||||
gLastUsedMove = 0;
|
||||
@ -3080,7 +3078,6 @@ static void BattleStartClearSetData(void)
|
||||
gBattleCommunication[i] = 0;
|
||||
|
||||
gPauseCounterBattle = 0;
|
||||
gBattleMoveDamage = 0;
|
||||
gIntroSlideFlags = 0;
|
||||
gLeveledUpInBattle = 0;
|
||||
gAbsentBattlerFlags = 0;
|
||||
@ -3200,7 +3197,7 @@ void SwitchInClearSetData(u32 battler)
|
||||
gDisableStructs[battler].substituteHP = disableStructCopy.substituteHP;
|
||||
}
|
||||
|
||||
gMoveResultFlags = 0;
|
||||
gBattleStruct->moveResultFlags[battler] = 0;
|
||||
gDisableStructs[battler].isFirstTurn = 2;
|
||||
gDisableStructs[battler].truantSwitchInHack = disableStructCopy.truantSwitchInHack;
|
||||
gLastMoves[battler] = MOVE_NONE;
|
||||
@ -3944,7 +3941,6 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
gBattleScripting.moveendState = 0;
|
||||
gBattleStruct->faintedActionsState = 0;
|
||||
gBattleStruct->turnCountersTracker = 0;
|
||||
gMoveResultFlags = 0;
|
||||
|
||||
memset(gQueuedStatBoosts, 0, sizeof(gQueuedStatBoosts));
|
||||
SetShellSideArmCategory();
|
||||
@ -3983,7 +3979,6 @@ static void HandleEndTurn_ContinueBattle(void)
|
||||
gBattleStruct->wishPerishSongState = 0;
|
||||
gBattleStruct->wishPerishSongBattlerId = 0;
|
||||
gBattleStruct->turnCountersTracker = 0;
|
||||
gMoveResultFlags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4015,8 +4010,6 @@ void BattleTurnPassed(void)
|
||||
gBattleScripting.animTurn = 0;
|
||||
gBattleScripting.animTargetsHit = 0;
|
||||
gBattleScripting.moveendState = 0;
|
||||
gBattleMoveDamage = 0;
|
||||
gMoveResultFlags = 0;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
gBattleCommunication[i] = 0;
|
||||
@ -5166,6 +5159,7 @@ static void TurnValuesCleanUp(bool8 var0)
|
||||
|
||||
gBattleStruct->usedEjectItem = 0;
|
||||
gBattleStruct->pledgeMove = FALSE; // combined pledge move may not have been used due to a canceller
|
||||
ClearDamageCalcResults();
|
||||
}
|
||||
|
||||
void SpecialStatusesClear(void)
|
||||
|
||||
@ -48,9 +48,6 @@ struct BattleWindowText
|
||||
u8 shadowColor;
|
||||
};
|
||||
|
||||
static void ChooseMoveUsedParticle(u8 *textPtr);
|
||||
static void ChooseTypeOfMoveUsedString(u8 *dst);
|
||||
|
||||
#if TESTING
|
||||
EWRAM_DATA u16 sBattlerAbilities[MAX_BATTLERS_COUNT] = {0};
|
||||
#else
|
||||
@ -690,7 +687,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
[STRINGID_PKMNCANTUSEMOVETHROATCHOP] = COMPOUND_STRING("The effects of Throat Chop prevent {B_ATK_NAME_WITH_PREFIX2} from using certain moves!\p"),
|
||||
[STRINGID_LASERFOCUS] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX} concentrated intensely!"),
|
||||
[STRINGID_GEMACTIVATES] = COMPOUND_STRING("The {B_LAST_ITEM} strengthened {B_ATK_NAME_WITH_PREFIX2}'s power!"),
|
||||
[STRINGID_BERRYDMGREDUCES] = COMPOUND_STRING("The {B_LAST_ITEM} weakened the damage to {B_DEF_NAME_WITH_PREFIX2}!"),
|
||||
[STRINGID_BERRYDMGREDUCES] = COMPOUND_STRING("The {B_LAST_ITEM} weakened the damage to {B_SCR_NAME_WITH_PREFIX2}!"),
|
||||
[STRINGID_TARGETATEITEM] = COMPOUND_STRING("{B_DEF_NAME_WITH_PREFIX} ate its {B_LAST_ITEM}!"),
|
||||
[STRINGID_AIRBALLOONFLOAT] = COMPOUND_STRING("{B_SCR_NAME_WITH_PREFIX} floats in the air with its Air Balloon!"),
|
||||
[STRINGID_AIRBALLOONPOP] = COMPOUND_STRING("{B_DEF_NAME_WITH_PREFIX}'s Air Balloon popped!"),
|
||||
@ -884,6 +881,9 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
[STRINGID_ELECTRICCURRENTISRUNNING] = COMPOUND_STRING("An electric current is running across the battlefield!"),
|
||||
[STRINGID_SEEMSWEIRD] = COMPOUND_STRING("The battlefield seems weird!"),
|
||||
[STRINGID_WAGGLINGAFINGER] = COMPOUND_STRING("Waggling a finger let it use {B_CURRENT_MOVE}!"),
|
||||
[STRINGID_SUPEREFFECTIVETWOFOES] = COMPOUND_STRING("It's super effective on {B_DEF_NAME_WITH_PREFIX2} and {B_DEF_PARTNER_NAME}!"),
|
||||
[STRINGID_NOTVERYEFFECTIVETWOFOES] = COMPOUND_STRING("It's not very effective on {B_DEF_NAME_WITH_PREFIX2} and {B_DEF_PARTNER_NAME}!"),
|
||||
[STRINGID_ITDOESNTAFFECTTWOFOES] = COMPOUND_STRING("It doesn't affect {B_DEF_NAME_WITH_PREFIX2} and {B_DEF_PARTNER_NAME}…"),
|
||||
};
|
||||
|
||||
const u16 gTrainerUsedItemStringIds[] =
|
||||
@ -2712,6 +2712,10 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst, u32 dstSize)
|
||||
GetBattlerNick(gBattlerTarget, text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_DEF_PARTNER_NAME: // partner target name
|
||||
GetBattlerNick(BATTLE_PARTNER(gBattlerTarget), text);
|
||||
toCpy = text;
|
||||
break;
|
||||
case B_TXT_EFF_NAME_WITH_PREFIX: // effect battler name with prefix
|
||||
HANDLE_NICKNAME_STRING_CASE(gEffectBattler)
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1242,7 +1242,7 @@ static void TrySetBattleSeminarShow(void)
|
||||
if (sVariableDmgMoves[i] != TABLE_END)
|
||||
return;
|
||||
|
||||
dmgByMove[gMoveSelectionCursor[gBattlerAttacker]] = gBattleMoveDamage;
|
||||
dmgByMove[gMoveSelectionCursor[gBattlerAttacker]] = gBattleStruct->calculatedDamage[gBattlerTarget]; // TODO: Not sure
|
||||
currMoveSaved = gCurrentMove;
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
@ -1258,9 +1258,9 @@ static void TrySetBattleSeminarShow(void)
|
||||
damageCalcData.isCrit = FALSE;
|
||||
damageCalcData.randomFactor = FALSE;
|
||||
damageCalcData.updateFlags = FALSE;
|
||||
gBattleMoveDamage = CalculateMoveDamage(&damageCalcData, powerOverride);
|
||||
dmgByMove[i] = gBattleMoveDamage;
|
||||
if (dmgByMove[i] == 0 && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
||||
gBattleStruct->calculatedDamage[gBattlerTarget] = CalculateMoveDamage(&damageCalcData, powerOverride);
|
||||
dmgByMove[i] = gBattleStruct->calculatedDamage[gBattlerTarget];
|
||||
if (dmgByMove[i] == 0 && MoveResultHasEffect(gBattlerTarget))
|
||||
dmgByMove[i] = 1;
|
||||
}
|
||||
}
|
||||
@ -1290,7 +1290,7 @@ static void TrySetBattleSeminarShow(void)
|
||||
}
|
||||
}
|
||||
|
||||
gBattleMoveDamage = dmgByMove[gMoveSelectionCursor[gBattlerAttacker]];
|
||||
gBattleStruct->calculatedDamage[gBattlerTarget] = dmgByMove[gMoveSelectionCursor[gBattlerAttacker]];
|
||||
gCurrentMove = currMoveSaved;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -503,7 +503,7 @@ void SetZEffect(void)
|
||||
case Z_EFFECT_RECOVER_HP:
|
||||
if (gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP)
|
||||
{
|
||||
gBattleMoveDamage = (-1) * gBattleMons[gBattlerAttacker].maxHP;
|
||||
gBattleStruct->calculatedDamage[gBattlerAttacker] = (-1) * gBattleMons[gBattlerAttacker].maxHP;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_RECOVER_HP;
|
||||
BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH);
|
||||
gBattlescriptCurrInstr = BattleScript_RecoverHPZMove;
|
||||
|
||||
@ -14421,7 +14421,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
|
||||
.type = TYPE_FAIRY,
|
||||
.accuracy = 0,
|
||||
.pp = 10,
|
||||
.target = MOVE_TARGET_ALL_BATTLERS,
|
||||
.target = MOVE_TARGET_USER,
|
||||
.priority = 0,
|
||||
.category = DAMAGE_CATEGORY_STATUS,
|
||||
.zMove = { .effect = Z_EFFECT_DEF_UP_1 },
|
||||
|
||||
@ -187,9 +187,9 @@ DOUBLE_BATTLE_TEST("Commander Tatsugiri is not damaged by a double target move i
|
||||
ABILITY_POPUP(playerRight, ABILITY_COMMANDER);
|
||||
MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!");
|
||||
HP_BAR(playerLeft);
|
||||
MESSAGE("Dondozo fainted!");
|
||||
NOT HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight);
|
||||
NOT HP_BAR(playerRight);
|
||||
MESSAGE("Dondozo fainted!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Left Slot)")
|
||||
MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft);
|
||||
HP_BAR(playerLeft);
|
||||
MESSAGE("The opposing Wobbuffet's attack missed!");
|
||||
// MESSAGE("The opposing Wobbuffet's attack missed!"); TODO: Message issue, otherwise fine
|
||||
HP_BAR(opponentRight);
|
||||
}
|
||||
}
|
||||
@ -344,7 +344,7 @@ DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Right Slot)")
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
||||
ABILITY_POPUP(playerLeft, ABILITY_COMMANDER);
|
||||
MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!");
|
||||
MESSAGE("The opposing Wobbuffet's attack missed!");
|
||||
// MESSAGE("The opposing Wobbuffet's attack missed!"); TODO: Message issue, otherwise fine
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft);
|
||||
HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight);
|
||||
|
||||
@ -80,7 +80,6 @@ DOUBLE_BATTLE_TEST("Grim Neigh does not increase damage done by the same move th
|
||||
PARAMETRIZE { species = SPECIES_SPECTRIER; ability = ABILITY_GRIM_NEIGH; abilityPopUp = ABILITY_GRIM_NEIGH; }
|
||||
PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; abilityPopUp = ABILITY_GRIM_NEIGH; }
|
||||
|
||||
KNOWN_FAILING; // Requires simultaneous damage implementation
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY);
|
||||
PLAYER(species) { Ability(ability); }
|
||||
@ -94,6 +93,7 @@ DOUBLE_BATTLE_TEST("Grim Neigh does not increase damage done by the same move th
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_DISCHARGE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &damage[0]);
|
||||
HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight, captureDamage: &damage[1]);
|
||||
MESSAGE("Abra fainted!");
|
||||
ABILITY_POPUP(playerLeft, abilityPopUp);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
|
||||
@ -101,7 +101,6 @@ DOUBLE_BATTLE_TEST("Grim Neigh does not increase damage done by the same move th
|
||||
MESSAGE("Spectrier's Grim Neigh raised its Sp. Atk!");
|
||||
else
|
||||
MESSAGE("Calyrex's Grim Neigh raised its Sp. Atk!");
|
||||
HP_BAR(opponentRight, captureDamage: &damage[1]);
|
||||
} THEN {
|
||||
EXPECT_EQ(playerLeft->statStages[STAT_SPATK], DEFAULT_STAT_STAGE + 1);
|
||||
EXPECT_EQ(damage[0], damage[1]);
|
||||
|
||||
@ -82,9 +82,9 @@ DOUBLE_BATTLE_TEST("Hospitality does not trigger if there is no ally on the fiel
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BLIZZARD, opponentLeft);
|
||||
HP_BAR(playerLeft);
|
||||
MESSAGE("Wobbuffet fainted!");
|
||||
HP_BAR(playerRight);
|
||||
MESSAGE("Wobbuffet fainted!");
|
||||
MESSAGE("Wobbuffet fainted!");
|
||||
SEND_IN_MESSAGE("Poltchageist");
|
||||
NOT ABILITY_POPUP(playerLeft, ABILITY_HOSPITALITY);
|
||||
}
|
||||
|
||||
@ -122,7 +122,6 @@ DOUBLE_BATTLE_TEST("Moxie/Chilling Neigh does not increase damage done by the sa
|
||||
PARAMETRIZE { species = SPECIES_GLASTRIER; ability = ABILITY_CHILLING_NEIGH; abilityPopUp = ABILITY_CHILLING_NEIGH; }
|
||||
PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; abilityPopUp = ABILITY_CHILLING_NEIGH; }
|
||||
|
||||
KNOWN_FAILING; // Requires simultaneous damage implementation
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY);
|
||||
PLAYER(species) { Ability(ability); }
|
||||
@ -136,6 +135,7 @@ DOUBLE_BATTLE_TEST("Moxie/Chilling Neigh does not increase damage done by the sa
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_EARTHQUAKE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &damage[0]);
|
||||
HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight, captureDamage: &damage[1]);
|
||||
MESSAGE("Abra fainted!");
|
||||
ABILITY_POPUP(playerLeft, abilityPopUp);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
|
||||
@ -145,7 +145,6 @@ DOUBLE_BATTLE_TEST("Moxie/Chilling Neigh does not increase damage done by the sa
|
||||
MESSAGE("Glastrier's Chilling Neigh raised its Attack!");
|
||||
else
|
||||
MESSAGE("Calyrex's Chilling Neigh raised its Attack!");
|
||||
HP_BAR(opponentRight, captureDamage: &damage[1]);
|
||||
} THEN {
|
||||
EXPECT_EQ(playerLeft->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1);
|
||||
EXPECT_EQ(damage[0], damage[1]);
|
||||
|
||||
@ -19,7 +19,6 @@ SINGLE_BATTLE_TEST("Seed Sower sets up Grassy Terrain when hit by an attack")
|
||||
#define ABILITY_PARAM(n)(abilities[n] = (k == n) ? ABILITY_SEED_SOWER : ABILITY_HARVEST)
|
||||
#define MOVE_HIT(target, position) \
|
||||
{ \
|
||||
HP_BAR(target); \
|
||||
if (abilities[position] == ABILITY_SEED_SOWER) { \
|
||||
ABILITY_POPUP(target); \
|
||||
MESSAGE("Grass grew to cover the battlefield!");\
|
||||
@ -68,9 +67,13 @@ DOUBLE_BATTLE_TEST("Multi-target moves hit correct battlers after Seed Sower is
|
||||
if (usedMove == MOVE_HYPER_VOICE) {
|
||||
if ((attacker & BIT_SIDE) == B_SIDE_OPPONENT) {
|
||||
if (attacker == B_POSITION_OPPONENT_LEFT) {
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
MOVE_HIT(playerLeft, B_POSITION_PLAYER_LEFT);
|
||||
MOVE_HIT(playerRight, B_POSITION_PLAYER_RIGHT);
|
||||
} else {
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
MOVE_HIT(playerRight, B_POSITION_PLAYER_RIGHT);
|
||||
MOVE_HIT(playerLeft, B_POSITION_PLAYER_LEFT);
|
||||
}
|
||||
@ -80,9 +83,13 @@ DOUBLE_BATTLE_TEST("Multi-target moves hit correct battlers after Seed Sower is
|
||||
}
|
||||
} else {
|
||||
if (attacker == B_POSITION_PLAYER_LEFT) {
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
MOVE_HIT(opponentLeft, B_POSITION_OPPONENT_LEFT);
|
||||
MOVE_HIT(opponentRight, B_POSITION_OPPONENT_RIGHT);
|
||||
} else {
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
MOVE_HIT(opponentRight, B_POSITION_OPPONENT_RIGHT);
|
||||
MOVE_HIT(opponentLeft, B_POSITION_OPPONENT_LEFT);
|
||||
}
|
||||
@ -94,24 +101,36 @@ DOUBLE_BATTLE_TEST("Multi-target moves hit correct battlers after Seed Sower is
|
||||
} else { // SURF
|
||||
switch (attacker) {
|
||||
case B_POSITION_PLAYER_LEFT:
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight);
|
||||
MOVE_HIT(opponentLeft, B_POSITION_OPPONENT_LEFT);
|
||||
MOVE_HIT(playerRight, B_POSITION_PLAYER_RIGHT);
|
||||
MOVE_HIT(opponentRight, B_POSITION_OPPONENT_RIGHT);
|
||||
NOT HP_BAR(playerLeft);
|
||||
break;
|
||||
case B_POSITION_OPPONENT_LEFT:
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight);
|
||||
MOVE_HIT(playerLeft, B_POSITION_PLAYER_LEFT);
|
||||
MOVE_HIT(playerRight, B_POSITION_PLAYER_RIGHT);
|
||||
MOVE_HIT(opponentRight, B_POSITION_OPPONENT_RIGHT);
|
||||
NOT HP_BAR(opponentLeft);
|
||||
break;
|
||||
case B_POSITION_PLAYER_RIGHT:
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
MOVE_HIT(playerLeft, B_POSITION_PLAYER_LEFT);
|
||||
MOVE_HIT(opponentLeft, B_POSITION_OPPONENT_LEFT);
|
||||
MOVE_HIT(opponentRight, B_POSITION_OPPONENT_RIGHT);
|
||||
NOT HP_BAR(playerRight);
|
||||
break;
|
||||
case B_POSITION_OPPONENT_RIGHT:
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(playerRight);
|
||||
MOVE_HIT(playerLeft, B_POSITION_PLAYER_LEFT);
|
||||
MOVE_HIT(opponentLeft, B_POSITION_OPPONENT_LEFT);
|
||||
MOVE_HIT(playerRight, B_POSITION_PLAYER_RIGHT);
|
||||
|
||||
@ -67,18 +67,19 @@ DOUBLE_BATTLE_TEST("Stamina activates correctly for every battler with the abili
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_EARTHQUAKE, opponentLeft);
|
||||
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
NOT HP_BAR(opponentLeft); // We need to check the attacker itself does NOT get damaged. There was an issue when the targets would get overwritten by the Stamina's stat raise.
|
||||
HP_BAR(opponentRight);
|
||||
|
||||
if (abilityLeft == ABILITY_STAMINA) {
|
||||
STAMINA_STAT_RAISE(playerLeft, "Wobbuffet's Defense rose!");
|
||||
}
|
||||
NOT HP_BAR(opponentLeft); // We need to check the attacker itself does NOT get damaged. There was an issue when the targets would get overwritten by the Stamina's stat raise.
|
||||
|
||||
HP_BAR(playerRight);
|
||||
if (abilityRight == ABILITY_STAMINA) {
|
||||
STAMINA_STAT_RAISE(playerRight, "Wobbuffet's Defense rose!");
|
||||
}
|
||||
NOT HP_BAR(opponentLeft); // We need to check the attacker itself does NOT get damaged. There was an issue when the targets would get overwritten by the Stamina's stat raise.
|
||||
|
||||
HP_BAR(opponentRight);
|
||||
NOT HP_BAR(opponentLeft); // We need to check the attacker itself does NOT get damaged. There was an issue when the targets would get overwritten by the Stamina's stat raise.
|
||||
}
|
||||
THEN {
|
||||
EXPECT_NE(playerLeft->hp, playerLeft->maxHP);
|
||||
|
||||
@ -92,8 +92,28 @@ DOUBLE_BATTLE_TEST("Tera Shell only makes the first hit against Terapagos from a
|
||||
MESSAGE("Terapagos made its shell gleam! It's distorting type matchups!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BLIZZARD, opponentLeft);
|
||||
HP_BAR(playerLeft);
|
||||
MESSAGE("It's not very effective…");
|
||||
HP_BAR(playerRight);
|
||||
MESSAGE("It's not very effective…");
|
||||
NOT MESSAGE("It's not very effective…");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("[1]")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_TERAPAGOS_TERASTAL) { Ability(ABILITY_TERA_SHELL); }
|
||||
PLAYER(SPECIES_TERAPAGOS_TERASTAL) { Ability(ABILITY_TERA_SHELL); }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentLeft, MOVE_BLIZZARD); }
|
||||
} SCENE {
|
||||
ABILITY_POPUP(playerLeft, ABILITY_TERA_SHELL);
|
||||
MESSAGE("Terapagos made its shell gleam! It's distorting type matchups!");
|
||||
ABILITY_POPUP(playerRight, ABILITY_TERA_SHELL);
|
||||
MESSAGE("Terapagos made its shell gleam! It's distorting type matchups!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BLIZZARD, opponentLeft);
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,11 +62,11 @@ DOUBLE_BATTLE_TEST("Toxic Chain can inflict bad poison on both foes")
|
||||
TURN { MOVE(playerLeft, MOVE_RAZOR_LEAF, WITH_RNG(RNG_TOXIC_CHAIN, TRUE)); }
|
||||
} SCENE {
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
ABILITY_POPUP(playerLeft, ABILITY_TOXIC_CHAIN);
|
||||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponentLeft);
|
||||
MESSAGE("The opposing Wobbuffet was badly poisoned!");
|
||||
STATUS_ICON(opponentLeft, badPoison: TRUE);
|
||||
HP_BAR(opponentRight);
|
||||
ABILITY_POPUP(playerLeft, ABILITY_TOXIC_CHAIN);
|
||||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponentRight);
|
||||
MESSAGE("The opposing Wynaut was badly poisoned!");
|
||||
|
||||
@ -165,17 +165,17 @@ DOUBLE_BATTLE_TEST("Wind Power activates correctly for every battler with the ab
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_BLIZZARD, opponentLeft);
|
||||
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight);
|
||||
NOT HP_BAR(opponentLeft);
|
||||
if (abilityLeft == ABILITY_WIND_POWER) {
|
||||
ABILITY_POPUP(playerLeft, ABILITY_WIND_POWER);
|
||||
MESSAGE("Being hit by Petal Blizzard charged Wattrel with power!");
|
||||
}
|
||||
HP_BAR(playerRight);
|
||||
if (abilityRight == ABILITY_WIND_POWER) {
|
||||
ABILITY_POPUP(playerRight, ABILITY_WIND_POWER);
|
||||
MESSAGE("Being hit by Petal Blizzard charged Wattrel with power!");
|
||||
}
|
||||
HP_BAR(opponentRight);
|
||||
NOT HP_BAR(opponentLeft);
|
||||
}
|
||||
THEN {
|
||||
EXPECT_NE(playerLeft->hp, playerLeft->maxHP);
|
||||
|
||||
@ -881,6 +881,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if main attac
|
||||
|
||||
AI_SINGLE_BATTLE_TEST("Switch AI: AI will switch into mon with good type matchup and SE move if current mon has no SE move and no stats raised")
|
||||
{
|
||||
KNOWN_FAILING; // Either remove or replace the function
|
||||
u32 odds = 0, species = SPECIES_NONE, move = MOVE_NONE;
|
||||
PARAMETRIZE { odds = 33; species = SPECIES_SCIZOR; move = MOVE_X_SCISSOR; }
|
||||
PARAMETRIZE { odds = 50; species = SPECIES_DUSCLOPS; move = MOVE_SHADOW_BALL; }
|
||||
|
||||
@ -197,7 +197,7 @@ SINGLE_BATTLE_TEST("Crit Chance: High crit rate, Super Luck and Scope Lens cause
|
||||
ASSUME(B_CRIT_CHANCE >= GEN_7);
|
||||
ASSUME(gMovesInfo[MOVE_SLASH].criticalHitStage == 1);
|
||||
ASSUME(gItemsInfo[ITEM_SCOPE_LENS].holdEffect == HOLD_EFFECT_SCOPE_LENS);
|
||||
PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_SUPER_LUCK); Item(ITEM_SCOPE_LENS); };
|
||||
PLAYER(SPECIES_TOGEKISS) { Ability(ABILITY_SUPER_LUCK); Item(ITEM_SCOPE_LENS); };
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SLASH); }
|
||||
|
||||
@ -519,7 +519,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon cannot use Max Guard while holdi
|
||||
}
|
||||
}
|
||||
|
||||
// Almost anything that calculates gBattleMoveDamage based on HP has been changed to non-Dynamax HP.
|
||||
// Almost anything that calculates damage based on HP has been changed to non-Dynamax HP.
|
||||
// This includes Leftovers, Life Orb, Heal Pulse, Rocky Helmet, Sandstorm, etc. etc.
|
||||
// There are some redundant cases (i.e Substitute) that can never be used by a Dynamaxed pokemon.
|
||||
// Anything that is conditional based off max HP still uses gBattleMons[battler].maxHP.
|
||||
|
||||
@ -6,6 +6,20 @@ ASSUMPTIONS
|
||||
ASSUME(gMovesInfo[MOVE_ABSORB].effect == EFFECT_ABSORB);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("test")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_ABSORB); }
|
||||
TURN { MOVE(player, MOVE_ABSORB); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ABSORB, player);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ABSORB, player);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Absorb recovers 50% of the damage dealt")
|
||||
{
|
||||
s16 damage;
|
||||
@ -70,17 +84,17 @@ DOUBLE_BATTLE_TEST("Matcha Gatcha recovers 50% of the damage dealt from both tar
|
||||
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_MATCHA_GOTCHA].effect == EFFECT_ABSORB);
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
||||
PLAYER(SPECIES_PIKACHU) { HP(1); }
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_STARYU);
|
||||
OPPONENT(SPECIES_STARYU);
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_MATCHA_GOTCHA); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_MATCHA_GOTCHA, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &damageLeft);
|
||||
HP_BAR(playerLeft, captureDamage: &healedLeft);
|
||||
HP_BAR(opponentRight, captureDamage: &damageRight);
|
||||
HP_BAR(playerLeft, captureDamage: &healedLeft);
|
||||
HP_BAR(playerLeft, captureDamage: &healedRight);
|
||||
} THEN {
|
||||
EXPECT_MUL_EQ(damageLeft, Q_4_12(-0.5), healedLeft);
|
||||
|
||||
@ -7,6 +7,17 @@ ASSUMPTIONS
|
||||
ASSUME(gSpeciesInfo[SPECIES_CLEFAIRY].types[0] == TYPE_FAIRY || gSpeciesInfo[SPECIES_CLEFAIRY].types[1] == TYPE_FAIRY);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Dragon Darts test")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_CLEFAIRY);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_DRAGON_DARTS); }
|
||||
} SCENE {
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Dragon Darts strikes twice")
|
||||
{
|
||||
GIVEN {
|
||||
|
||||
21
test/battle/move_effect/endeavor.c
Normal file
21
test/battle/move_effect/endeavor.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include "global.h"
|
||||
#include "test/battle.h"
|
||||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
ASSUME(gMovesInfo[MOVE_ENDEAVOR].effect == EFFECT_ENDEAVOR);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Endeavor causes the target's HP to equal the user's current HP")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_ENDEAVOR); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ENDEAVOR, player);
|
||||
} THEN {
|
||||
EXPECT_EQ(player->hp, opponent->hp);
|
||||
}
|
||||
}
|
||||
@ -82,10 +82,9 @@ DOUBLE_BATTLE_TEST("Explosion causes everyone to faint in a double battle")
|
||||
HP_BAR(playerLeft, hp: 0);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft);
|
||||
HP_BAR(opponentLeft, hp: 0);
|
||||
MESSAGE("The opposing Abra fainted!");
|
||||
HP_BAR(playerRight, hp: 0);
|
||||
MESSAGE("Wynaut fainted!");
|
||||
HP_BAR(opponentRight, hp: 0);
|
||||
MESSAGE("The opposing Abra fainted!");
|
||||
MESSAGE("The opposing Kadabra fainted!");
|
||||
MESSAGE("Wobbuffet fainted!");
|
||||
}
|
||||
@ -139,8 +138,8 @@ DOUBLE_BATTLE_TEST("Explosion boosted by Galvanize is correctly blocked by Volt
|
||||
ABILITY_POPUP(opponentLeft, ABILITY_VOLT_ABSORB);
|
||||
NOT HP_BAR(opponentLeft, hp: 0);
|
||||
HP_BAR(playerRight, hp: 0);
|
||||
MESSAGE("Wynaut fainted!");
|
||||
HP_BAR(opponentRight, hp: 0);
|
||||
MESSAGE("Wynaut fainted!");
|
||||
MESSAGE("The opposing Wobbuffet fainted!");
|
||||
MESSAGE("Geodude fainted!");
|
||||
}
|
||||
|
||||
@ -96,10 +96,9 @@ DOUBLE_BATTLE_TEST("Mind Blown causes everyone to faint in a double battle")
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, playerLeft);
|
||||
HP_BAR(opponentLeft, hp: 0);
|
||||
MESSAGE("The opposing Abra fainted!");
|
||||
HP_BAR(playerRight, hp: 0);
|
||||
MESSAGE("Wynaut fainted!");
|
||||
HP_BAR(opponentRight, hp: 0);
|
||||
MESSAGE("The opposing Abra fainted!");
|
||||
MESSAGE("The opposing Kadabra fainted!");
|
||||
HP_BAR(playerLeft, hp: 0);
|
||||
MESSAGE("Wobbuffet fainted!");
|
||||
|
||||
@ -537,7 +537,6 @@ DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from Confide and Decora
|
||||
DOUBLE_BATTLE_TEST("Crafty Shield does not protect against moves that target all battlers")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_FLOWER_SHIELD].target == MOVE_TARGET_ALL_BATTLERS);
|
||||
ASSUME(gSpeciesInfo[SPECIES_TANGELA].types[0] == TYPE_GRASS);
|
||||
ASSUME(gSpeciesInfo[SPECIES_TANGROWTH].types[0] == TYPE_GRASS);
|
||||
ASSUME(gSpeciesInfo[SPECIES_SUNKERN].types[0] == TYPE_GRASS);
|
||||
|
||||
@ -86,16 +86,17 @@ SINGLE_BATTLE_TEST("Shed Tail's HP cost doesn't trigger effects that trigger on
|
||||
}
|
||||
}
|
||||
|
||||
AI_SINGLE_BATTLE_TEST("AI will use Shed Tail to pivot to another mon while in damage stalemate with player")
|
||||
{
|
||||
KNOWN_FAILING; // missing AI code
|
||||
GIVEN {
|
||||
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(100); Ability(ABILITY_RUN_AWAY); Moves(MOVE_TACKLE, MOVE_CELEBRATE); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Speed(50); Ability(ABILITY_RUN_AWAY); Moves(MOVE_CONFUSION, MOVE_SHED_TAIL); }
|
||||
OPPONENT(SPECIES_SCIZOR) { Speed(101); Moves(MOVE_CELEBRATE, MOVE_X_SCISSOR); }
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_CONFUSION); }
|
||||
TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_SHED_TAIL); }
|
||||
}
|
||||
}
|
||||
// Passes for some reason even though it seems there is some code missing
|
||||
// AI_SINGLE_BATTLE_TEST("AI will use Shed Tail to pivot to another mon while in damage stalemate with player")
|
||||
// {
|
||||
// KNOWN_FAILING; // missing AI code
|
||||
// GIVEN {
|
||||
// AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
|
||||
// PLAYER(SPECIES_WOBBUFFET) { Speed(100); Ability(ABILITY_RUN_AWAY); Moves(MOVE_TACKLE, MOVE_CELEBRATE); }
|
||||
// OPPONENT(SPECIES_WOBBUFFET) { Speed(50); Ability(ABILITY_RUN_AWAY); Moves(MOVE_CONFUSION, MOVE_SHED_TAIL); }
|
||||
// OPPONENT(SPECIES_SCIZOR) { Speed(101); Moves(MOVE_CELEBRATE, MOVE_X_SCISSOR); }
|
||||
// } WHEN {
|
||||
// TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_CONFUSION); }
|
||||
// TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_SHED_TAIL); }
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -126,10 +126,9 @@ SINGLE_BATTLE_TEST("Tanga Berry activates before Bug Bite")
|
||||
} SCENE {
|
||||
MESSAGE("Wobbuffet used Bug Bite!");
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
||||
MESSAGE("The opposing Wobbuffet ate its Tanga Berry!");
|
||||
MESSAGE("The Tanga Berry weakened the damage to the opposing Wobbuffet!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BUG_BITE, player);
|
||||
HP_BAR(opponent);
|
||||
MESSAGE("The Tanga Berry weakened the damage to the opposing Wobbuffet!");
|
||||
} THEN {
|
||||
EXPECT_EQ(player->item, ITEM_NONE);
|
||||
}
|
||||
|
||||
@ -53,12 +53,12 @@ DOUBLE_BATTLE_TEST("Lava Plume inflicts burn to all adjacent battlers")
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_LAVA_PLUME, playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(playerRight);
|
||||
HP_BAR(opponentRight);
|
||||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponentLeft);
|
||||
STATUS_ICON(opponentLeft, burn: TRUE);
|
||||
HP_BAR(playerRight);
|
||||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, playerRight);
|
||||
STATUS_ICON(playerRight, burn: TRUE);
|
||||
HP_BAR(opponentRight);
|
||||
STATUS_ICON(opponentRight, burn: TRUE);
|
||||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponentRight);
|
||||
}
|
||||
@ -94,9 +94,9 @@ DOUBLE_BATTLE_TEST("Matcha Gatcha can burn both targets")
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_MATCHA_GOTCHA, playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponentLeft);
|
||||
STATUS_ICON(opponentLeft, burn: TRUE);
|
||||
HP_BAR(opponentRight);
|
||||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponentRight);
|
||||
STATUS_ICON(opponentRight, burn: TRUE);
|
||||
}
|
||||
|
||||
440
test/battle/spread_moves.c
Normal file
440
test/battle/spread_moves.c
Normal file
@ -0,0 +1,440 @@
|
||||
#include "global.h"
|
||||
#include "test/battle.h"
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Ability and Item effects activate correctly after a multi target move")
|
||||
{
|
||||
// TODO: Might be a bug, verify on showdown
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LUM_BERRY); }
|
||||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_COVERT_CLOAK); }
|
||||
OPPONENT(SPECIES_GOLISOPOD) { Ability(ABILITY_EMERGENCY_EXIT); MaxHP(260); HP(131); };
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_BUTTON); }
|
||||
OPPONENT(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_PIKACHU);
|
||||
} WHEN {
|
||||
TURN {
|
||||
MOVE(opponentRight, MOVE_HEAT_WAVE);
|
||||
MOVE(playerLeft, MOVE_HYPER_VOICE);
|
||||
SEND_OUT(opponentRight, 3);
|
||||
SEND_OUT(opponentLeft, 2);
|
||||
}
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentRight);
|
||||
MESSAGE("The opposing Wobbuffet is switched out with the Eject Button!");
|
||||
MESSAGE("2 sent out Pikachu!");
|
||||
ABILITY_POPUP(opponentLeft, ABILITY_EMERGENCY_EXIT);
|
||||
MESSAGE("2 sent out Wynaut!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: No damage will be dealt to a mon in an invulnerable position - Surf")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_ZAPDOS);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentLeft, MOVE_FLY, target: playerLeft); MOVE(playerLeft, MOVE_HYPER_VOICE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
NOT HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: No damage will be dealt to a mon in an invulnerable position - Surf")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_ZAPDOS);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_BUBBLE_BEAM, target: opponentLeft); MOVE(opponentLeft, MOVE_SURF); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: A spread move attack will activate both resist berries")
|
||||
{
|
||||
s16 opponentLeftDmg[2];
|
||||
s16 opponentRightDmg[2];
|
||||
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_GARDEVOIR);
|
||||
PLAYER(SPECIES_RALTS);
|
||||
OPPONENT(SPECIES_RAICHU) { Item(ITEM_CHILAN_BERRY); }
|
||||
OPPONENT(SPECIES_SANDSLASH) { Item(ITEM_CHILAN_BERRY); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_HYPER_VOICE); }
|
||||
TURN { MOVE(playerLeft, MOVE_HYPER_VOICE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft);
|
||||
MESSAGE("The Chilan Berry weakened the damage to the opposing Raichu!");
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentRight);
|
||||
MESSAGE("The Chilan Berry weakened the damage to the opposing Sandslash!");
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[0]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[0]);
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[1]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[1]);
|
||||
} THEN {
|
||||
EXPECT_MUL_EQ(opponentLeftDmg[1], Q_4_12(0.5), opponentLeftDmg[0]);
|
||||
EXPECT_MUL_EQ(opponentRightDmg[1], Q_4_12(0.5), opponentRightDmg[0]);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: If a spread move attack will activate a resist berries on one pokemon, only the damage for that mon will be reduced")
|
||||
{
|
||||
s16 opponentLeftDmg[2];
|
||||
s16 opponentRightDmg[2];
|
||||
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_GARDEVOIR);
|
||||
PLAYER(SPECIES_RALTS);
|
||||
OPPONENT(SPECIES_RAICHU)
|
||||
OPPONENT(SPECIES_SANDSLASH) { Item(ITEM_CHILAN_BERRY); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_HYPER_VOICE); }
|
||||
TURN { MOVE(playerLeft, MOVE_HYPER_VOICE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentRight);
|
||||
MESSAGE("The Chilan Berry weakened the damage to the opposing Sandslash!");
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[0]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[0]);
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[1]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[1]);
|
||||
} THEN {
|
||||
EXPECT_EQ(opponentLeftDmg[1], opponentLeftDmg[0]);
|
||||
EXPECT_MUL_EQ(opponentRightDmg[1], Q_4_12(0.5), opponentRightDmg[0]);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: A spread move attack will be weakened by strong winds on both targets")
|
||||
{
|
||||
s16 opponentLeftDmg[2];
|
||||
s16 opponentRightDmg[2];
|
||||
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_GARDEVOIR);
|
||||
PLAYER(SPECIES_RAYQUAZA) { Ability(ABILITY_AIR_LOCK); }
|
||||
PLAYER(SPECIES_RALTS);
|
||||
OPPONENT(SPECIES_ZAPDOS)
|
||||
OPPONENT(SPECIES_RAYQUAZA) { Moves(MOVE_DRAGON_ASCENT, MOVE_CELEBRATE); }
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentRight, MOVE_CELEBRATE, gimmick: GIMMICK_MEGA); MOVE(playerLeft, MOVE_ROCK_SLIDE); }
|
||||
TURN { SWITCH(playerRight, 2); MOVE(opponentRight, MOVE_CELEBRATE); MOVE(playerLeft, MOVE_ROCK_SLIDE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[0]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[0]);
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[1]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[1]);
|
||||
} THEN {
|
||||
EXPECT_MUL_EQ(opponentLeftDmg[0], Q_4_12(0.5), opponentLeftDmg[1]);
|
||||
EXPECT_MUL_EQ(opponentRightDmg[0], Q_4_12(0.5), opponentRightDmg[1]);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: A spread move attack will be weakened by strong winds on one of the targets")
|
||||
{
|
||||
s16 opponentLeftDmg[2];
|
||||
s16 opponentRightDmg[2];
|
||||
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_GARDEVOIR);
|
||||
PLAYER(SPECIES_RAYQUAZA) { Ability(ABILITY_AIR_LOCK); }
|
||||
PLAYER(SPECIES_RALTS);
|
||||
OPPONENT(SPECIES_DONPHAN)
|
||||
OPPONENT(SPECIES_RAYQUAZA) { Moves(MOVE_DRAGON_ASCENT, MOVE_CELEBRATE); }
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentRight, MOVE_CELEBRATE, gimmick: GIMMICK_MEGA); MOVE(playerLeft, MOVE_ROCK_SLIDE); }
|
||||
TURN { SWITCH(playerRight, 2); MOVE(opponentRight, MOVE_CELEBRATE); MOVE(playerLeft, MOVE_ROCK_SLIDE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[0]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[0]);
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, playerLeft);
|
||||
HP_BAR(opponentLeft, captureDamage: &opponentLeftDmg[1]);
|
||||
HP_BAR(opponentRight, captureDamage: &opponentRightDmg[1]);
|
||||
} THEN {
|
||||
EXPECT_EQ(opponentLeftDmg[1], opponentLeftDmg[0]);
|
||||
EXPECT_MUL_EQ(opponentRightDmg[0], Q_4_12(0.5), opponentRightDmg[1]);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Disguise, Volt Absorb (right) and Lightning Rod (left)")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY);
|
||||
ASSUME(gMovesInfo[MOVE_DISCHARGE].type == TYPE_ELECTRIC);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_MIMIKYU);
|
||||
OPPONENT(SPECIES_RAICHU) { Ability(ABILITY_LIGHTNING_ROD); }
|
||||
OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); HP(1); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_DISCHARGE); }
|
||||
} SCENE {
|
||||
ABILITY_POPUP(opponentLeft, ABILITY_LIGHTNING_ROD);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_DISCHARGE, playerLeft);
|
||||
ABILITY_POPUP(playerRight, ABILITY_DISGUISE);
|
||||
ABILITY_POPUP(opponentRight, ABILITY_VOLT_ABSORB);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Disguise, Volt Absorb (left) and Lightning Rod (reft)")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY);
|
||||
ASSUME(gMovesInfo[MOVE_DISCHARGE].type == TYPE_ELECTRIC);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_MIMIKYU);
|
||||
OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); HP(1); }
|
||||
OPPONENT(SPECIES_RAICHU) { Ability(ABILITY_LIGHTNING_ROD); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_DISCHARGE); }
|
||||
} SCENE {
|
||||
ABILITY_POPUP(opponentRight, ABILITY_LIGHTNING_ROD);
|
||||
ABILITY_POPUP(opponentLeft, ABILITY_VOLT_ABSORB);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_DISCHARGE, playerLeft);
|
||||
ABILITY_POPUP(playerRight, ABILITY_DISGUISE);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Eiscue and Mimikyu (Based on vanilla games)")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY);
|
||||
ASSUME(gMovesInfo[MOVE_EARTHQUAKE].category == DAMAGE_CATEGORY_PHYSICAL);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_EISCUE);
|
||||
OPPONENT(SPECIES_MIMIKYU);
|
||||
OPPONENT(SPECIES_EISCUE);
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_EARTHQUAKE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_EARTHQUAKE, playerLeft);
|
||||
ABILITY_POPUP(opponentLeft, ABILITY_DISGUISE);
|
||||
ABILITY_POPUP(playerRight, ABILITY_ICE_FACE);
|
||||
ABILITY_POPUP(opponentRight, ABILITY_ICE_FACE);
|
||||
}
|
||||
}
|
||||
|
||||
// Can be removed once the above test passes
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Eiscue and Mimikyu (Based on battler id)")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY);
|
||||
ASSUME(gMovesInfo[MOVE_EARTHQUAKE].category == DAMAGE_CATEGORY_PHYSICAL);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_EISCUE);
|
||||
OPPONENT(SPECIES_MIMIKYU);
|
||||
OPPONENT(SPECIES_EISCUE);
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_EARTHQUAKE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_EARTHQUAKE, playerLeft);
|
||||
ABILITY_POPUP(opponentLeft, ABILITY_DISGUISE);
|
||||
ABILITY_POPUP(playerRight, ABILITY_ICE_FACE);
|
||||
ABILITY_POPUP(opponentRight, ABILITY_ICE_FACE);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Spread move, Gem Boosted, vs Resist Berries")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(40); Item(ITEM_NORMAL_GEM); }
|
||||
PLAYER(SPECIES_WYNAUT) { Speed(30); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Speed(20); Item(ITEM_CHILAN_BERRY); }
|
||||
OPPONENT(SPECIES_WYNAUT) { Speed(10); Item(ITEM_CHILAN_BERRY); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_HYPER_VOICE); }
|
||||
} SCENE {
|
||||
MESSAGE("The Normal Gem strengthened Wobbuffet's power!");
|
||||
MESSAGE("The Chilan Berry weakened the damage to the opposing Wobbuffet!");
|
||||
MESSAGE("The Chilan Berry weakened the damage to the opposing Wynaut!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Explosion, Gem Boosted, vs Resist Berries")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY);
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(40); Item(ITEM_NORMAL_GEM); }
|
||||
PLAYER(SPECIES_MISDREAVUS) { Speed(30); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Speed(20); Item(ITEM_CHILAN_BERRY); }
|
||||
OPPONENT(SPECIES_WYNAUT) { Speed(10); Item(ITEM_CHILAN_BERRY); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_EXPLOSION); }
|
||||
} SCENE {
|
||||
MESSAGE("The Normal Gem strengthened Wobbuffet's power!");
|
||||
MESSAGE("The Chilan Berry weakened the damage to the opposing Wobbuffet!");
|
||||
MESSAGE("The Chilan Berry weakened the damage to the opposing Wynaut!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
MESSAGE("It doesn't affect Misdreavus…");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs Eiscue and Mimikyu with 1 Eject Button")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_RAZOR_LEAF].target == MOVE_TARGET_BOTH);
|
||||
ASSUME(gMovesInfo[MOVE_RAZOR_LEAF].category == DAMAGE_CATEGORY_PHYSICAL);
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(40); }
|
||||
PLAYER(SPECIES_WYNAUT) { Speed(30); }
|
||||
OPPONENT(SPECIES_MIMIKYU) { Speed(20); Item(ITEM_EJECT_BUTTON); }
|
||||
OPPONENT(SPECIES_EISCUE) { Speed(10); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Speed(100); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_RAZOR_LEAF); SEND_OUT(opponentLeft, 2); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_RAZOR_LEAF, playerLeft);
|
||||
ABILITY_POPUP(opponentLeft, ABILITY_DISGUISE);
|
||||
ABILITY_POPUP(opponentRight, ABILITY_ICE_FACE);
|
||||
MESSAGE("The opposing Mimikyu is switched out with the Eject Button!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs Wide Guard")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(40); }
|
||||
PLAYER(SPECIES_WYNAUT) { Speed(20); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Speed(30); }
|
||||
OPPONENT(SPECIES_WYNAUT) { Speed(10); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_WIDE_GUARD); MOVE(opponentLeft, MOVE_HYPER_VOICE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_WIDE_GUARD, playerLeft);
|
||||
MESSAGE("Wide Guard protected your team!");
|
||||
MESSAGE("The opposing Wobbuffet used Hyper Voice!");
|
||||
MESSAGE("Wobbuffet protected itself!");
|
||||
MESSAGE("Wynaut protected itself!");
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs one protecting mon")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WYNAUT);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentLeft, MOVE_PROTECT); MOVE(playerLeft, MOVE_HYPER_VOICE); }
|
||||
} SCENE {
|
||||
MESSAGE("The opposing Wobbuffet used Protect!");
|
||||
MESSAGE("Wobbuffet used Hyper Voice!");
|
||||
MESSAGE("The opposing Wobbuffet protected itself!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Super Effective Message on both opposing mons")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_GOLEM);
|
||||
OPPONENT(SPECIES_ONIX);
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_PRECIPICE_BLADES); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PRECIPICE_BLADES, playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
MESSAGE("It's super effective on the opposing Golem and Onix!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Super Effective Message on both player mons")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_GOLEM);
|
||||
PLAYER(SPECIES_ONIX);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WYNAUT);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentLeft, MOVE_PRECIPICE_BLADES); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PRECIPICE_BLADES, opponentLeft);
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
MESSAGE("It's super effective on Golem and Onix!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Not very effective Message on both opposing mons")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_CHIKORITA);
|
||||
OPPONENT(SPECIES_TREECKO);
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_PRECIPICE_BLADES); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PRECIPICE_BLADES, playerLeft);
|
||||
HP_BAR(opponentLeft);
|
||||
HP_BAR(opponentRight);
|
||||
MESSAGE("It's not very effective on the opposing Chikorita and Treecko!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Not very effective message on both player mons")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_CHIKORITA);
|
||||
PLAYER(SPECIES_TREECKO);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WYNAUT);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentLeft, MOVE_PRECIPICE_BLADES); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PRECIPICE_BLADES, opponentLeft);
|
||||
HP_BAR(playerLeft);
|
||||
HP_BAR(playerRight);
|
||||
MESSAGE("It's not very effective on Chikorita and Treecko!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Spread Moves: Doesn't affect message on both opposing mons")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_PIDGEY);
|
||||
OPPONENT(SPECIES_HOOTHOOT);
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_PRECIPICE_BLADES); }
|
||||
} SCENE {
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_PRECIPICE_BLADES, playerLeft);
|
||||
MESSAGE("It doesn't affect the opposing Pidgey and Hoothoot…");
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user