mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-03-21 18:04:50 -05:00
Move Target failure follow up (#8986)
Co-authored-by: PhallenTree <168426989+PhallenTree@users.noreply.github.com>
This commit is contained in:
parent
4a4a72f9fb
commit
0c44cc1b27
|
|
@ -683,10 +683,6 @@
|
|||
.byte B_SCR_OP_USEITEMONOPPONENT
|
||||
.endm
|
||||
|
||||
.macro unused_0x78
|
||||
.byte B_SCR_OP_UNUSED_0X78
|
||||
.endm
|
||||
|
||||
.macro setprotectlike
|
||||
.byte B_SCR_OP_SETPROTECTLIKE
|
||||
.endm
|
||||
|
|
@ -710,10 +706,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro trymirrormove
|
||||
.byte B_SCR_OP_UNUSED_0X7E
|
||||
.endm
|
||||
|
||||
.macro setfieldweather
|
||||
.byte B_SCR_OP_SETFIELDWEATHER
|
||||
.endm
|
||||
|
|
@ -735,14 +727,6 @@
|
|||
.byte B_SCR_OP_TRYSETREST
|
||||
.endm
|
||||
|
||||
.macro unused_0x82
|
||||
.byte B_SCR_OP_UNUSED_0X82
|
||||
.endm
|
||||
|
||||
.macro unused_0x83
|
||||
.byte B_SCR_OP_UNUSED_0X83
|
||||
.endm
|
||||
|
||||
.macro jumpifuproarwakes jumpInstr:req
|
||||
.byte B_SCR_OP_JUMPIFUPROARWAKES
|
||||
.4byte \jumpInstr
|
||||
|
|
@ -761,14 +745,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro removestockpilecounters
|
||||
callnative BS_RemoveStockpileCounters
|
||||
.endm
|
||||
|
||||
.macro unused_0x88
|
||||
.byte B_SCR_OP_UNUSED_0X88
|
||||
.endm
|
||||
|
||||
.macro statbuffchange battler:req, flags:req, failInstr:req, stats=0
|
||||
.byte B_SCR_OP_STATBUFFCHANGE
|
||||
.byte \battler
|
||||
|
|
@ -884,22 +860,6 @@
|
|||
.byte B_SCR_OP_SETCALLEDMOVE
|
||||
.endm
|
||||
|
||||
.macro unused_0x9f
|
||||
.byte B_SCR_OP_UNUSED_0X9F
|
||||
.endm
|
||||
|
||||
.macro unused_0xA0
|
||||
.byte B_SCR_OP_UNUSED_0XA0
|
||||
.endm
|
||||
|
||||
.macro unused_0xA1
|
||||
.byte B_SCR_OP_UNUSED_0XA1
|
||||
.endm
|
||||
|
||||
.macro unused_0xA2
|
||||
.byte B_SCR_OP_UNUSED_0XA2
|
||||
.endm
|
||||
|
||||
.macro disablelastusedattack failInstr:req
|
||||
.byte B_SCR_OP_DISABLELASTUSEDATTACK
|
||||
.4byte \failInstr
|
||||
|
|
@ -929,20 +889,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro trychoosesleeptalkmove failInstr:req
|
||||
.byte B_SCR_OP_UNUSED_0XA9
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro trysetdestinybond failInstr:req
|
||||
.byte B_SCR_OP_UNUSED_AA
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro unused_0xab
|
||||
.byte B_SCR_OP_UNUSED_0XAB
|
||||
.endm
|
||||
|
||||
.macro settailwind failInstr:req
|
||||
.byte B_SCR_OP_SETTAILWIND
|
||||
.4byte \failInstr
|
||||
|
|
@ -979,20 +925,12 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro unused_0xb3
|
||||
.byte B_SCR_OP_UNUSED_0XB3
|
||||
.endm
|
||||
|
||||
.macro jumpifconfusedandstatmaxed stat:req, jumpInstr:req
|
||||
.byte B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED
|
||||
.byte \stat
|
||||
.4byte \jumpInstr
|
||||
.endm
|
||||
|
||||
.macro unused_0xb5
|
||||
.byte B_SCR_OP_UNUSED_0XB5
|
||||
.endm
|
||||
|
||||
.macro setembargo failInstr:req
|
||||
.byte B_SCR_OP_SETEMBARGO
|
||||
.4byte \failInstr
|
||||
|
|
@ -1006,10 +944,6 @@
|
|||
.byte B_SCR_OP_SETSAFEGUARD
|
||||
.endm
|
||||
|
||||
.macro magnitudedamagecalculation
|
||||
.byte B_SCR_OP_MAGNITUDEDAMAGECALCULATION
|
||||
.endm
|
||||
|
||||
.macro jumpifnopursuitswitchdmg jumpInstr:req
|
||||
.byte B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG
|
||||
.4byte \jumpInstr
|
||||
|
|
@ -1067,18 +1001,6 @@
|
|||
setsemiinvulnerablebit TRUE
|
||||
.endm
|
||||
|
||||
.macro unused_0xC6
|
||||
.byte B_SCR_OP_UNUSED_0XC6
|
||||
.endm
|
||||
|
||||
.macro unused_0xC7
|
||||
.byte B_SCR_OP_UNUSED_0XC7
|
||||
.endm
|
||||
|
||||
.macro unused_c8
|
||||
.byte B_SCR_OP_UNUSED_C8
|
||||
.endm
|
||||
|
||||
.macro trymemento failInstr:req
|
||||
.byte B_SCR_OP_TRYMEMENTO
|
||||
.4byte \failInstr
|
||||
|
|
@ -1088,15 +1010,6 @@
|
|||
.byte B_SCR_OP_SETFORCEDTARGET
|
||||
.endm
|
||||
|
||||
.macro unused_0xcb battler:req
|
||||
.byte B_SCR_OP_UNUSED_0XCB
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro unused_0xCC
|
||||
.byte B_SCR_OP_UNUSED_0XCC
|
||||
.endm
|
||||
|
||||
.macro curestatuswithmove failInstr:req
|
||||
.byte B_SCR_OP_CURESTATUSWITHMOVE
|
||||
.4byte \failInstr
|
||||
|
|
@ -1107,10 +1020,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro unused_0xcf
|
||||
.byte B_SCR_OP_UNUSED_0XCF
|
||||
.endm
|
||||
|
||||
.macro settaunt failInstr:req
|
||||
.byte B_SCR_OP_SETTAUNT
|
||||
.4byte \failInstr
|
||||
|
|
@ -1152,10 +1061,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro Cmd_unused0xd8
|
||||
.byte B_SCR_OP_UNUSED0XD8
|
||||
.endm
|
||||
|
||||
.macro setroom
|
||||
.byte B_SCR_OP_SETROOM
|
||||
.endm
|
||||
|
|
@ -1182,11 +1087,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro assistattackselect failInstr:req
|
||||
.byte B_SCR_OP_UNUSED_0XDE
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro trysetmagiccoat failInstr:req
|
||||
.byte B_SCR_OP_TRYSETMAGICCOAT
|
||||
.4byte \failInstr
|
||||
|
|
@ -1197,11 +1097,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro unused2 ptr:req
|
||||
.byte B_SCR_OP_UNUSED2
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro switchoutabilities battler:req
|
||||
.byte B_SCR_OP_SWITCHOUTABILITIES
|
||||
.byte \battler
|
||||
|
|
@ -1213,22 +1108,10 @@
|
|||
.4byte \jumpInstr
|
||||
.endm
|
||||
|
||||
.macro unused_0xE4
|
||||
.byte B_SCR_OP_UNUSED_0XE4
|
||||
.endm
|
||||
|
||||
.macro pickup
|
||||
.byte B_SCR_OP_PICKUP
|
||||
.endm
|
||||
|
||||
.macro unused_0xE6
|
||||
.byte B_SCR_OP_UNUSED_0XE6
|
||||
.endm
|
||||
|
||||
.macro unused_0xE7
|
||||
.byte B_SCR_OP_UNUSED_0XE7
|
||||
.endm
|
||||
|
||||
.macro settypebasedhalvers failInstr:req
|
||||
.byte B_SCR_OP_SETTYPEBASEDHALVERS
|
||||
.4byte \failInstr
|
||||
|
|
@ -1258,10 +1141,6 @@
|
|||
.byte B_SCR_OP_SNATCHSETBATTLERS
|
||||
.endm
|
||||
|
||||
.macro unused_0xee
|
||||
.byte B_SCR_OP_UNUSED_0XEE
|
||||
.endm
|
||||
|
||||
.macro handleballthrow
|
||||
.byte B_SCR_OP_HANDLEBALLTHROW
|
||||
.endm
|
||||
|
|
@ -1335,10 +1214,6 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro unused_1
|
||||
.byte B_SCR_UNUSED_1
|
||||
.endm
|
||||
|
||||
.macro callnative func:req
|
||||
.byte B_SCR_OP_CALLNATIVE
|
||||
.4byte \func
|
||||
|
|
@ -1637,10 +1512,6 @@
|
|||
.4byte \jumpInstr
|
||||
.endm
|
||||
|
||||
.macro ficklebeamdamagecalculation
|
||||
callnative BS_FickleBeamDamageCalculation
|
||||
.endm
|
||||
|
||||
.macro trytarshot failInstr:req
|
||||
callnative BS_TryTarShot
|
||||
.4byte \failInstr
|
||||
|
|
@ -2319,9 +2190,8 @@
|
|||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro setpoltergeistmessage failInstr:req
|
||||
.macro setpoltergeistmessage
|
||||
callnative BS_SetPoltergeistMessage
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro tryresetnegativestatstages
|
||||
|
|
|
|||
|
|
@ -28872,8 +28872,9 @@ gBattleAnimMove_SpitUp::
|
|||
createsprite gSpitUpOrbSpriteTemplate, ANIM_ATTACKER, 2, 192, 12
|
||||
createsprite gSpitUpOrbSpriteTemplate, ANIM_ATTACKER, 2, 224, 12
|
||||
delay 5
|
||||
jumpifmoveturn 2, SpitUpStrong
|
||||
jumpifmoveturn 3, SpitUpStrongest
|
||||
createvisualtask AnimTask_GetStockpileCounter, 2
|
||||
jumpreteq 2, SpitUpStrong
|
||||
jumpreteq 3, SpitUpStrongest
|
||||
SpitUpContinue:
|
||||
delay 5
|
||||
createvisualtask AnimTask_ShakeTargetBasedOnMovePowerOrDmg, 2, FALSE, 1, 8, 1, 0
|
||||
|
|
|
|||
|
|
@ -22,16 +22,17 @@
|
|||
|
||||
.section script_data, "aw", %progbits
|
||||
|
||||
BattleScript_EffectFickleBeam::
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
ficklebeamdamagecalculation
|
||||
goto BattleScript_HitFromDamageCalc
|
||||
BattleScript_FickleBeamDoubled::
|
||||
BattleScript_FickleBeamMessage::
|
||||
pause B_WAIT_TIME_SHORTEST
|
||||
printstring STRINGID_FICKLEBEAMDOUBLED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_HitFromDamageCalc
|
||||
return
|
||||
|
||||
BattleScript_MagnitudeMessage::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_MAGNITUDESTRENGTH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_Terastallization::
|
||||
@ TODO: no string prints in S/V, but right now this helps with clarity
|
||||
|
|
@ -648,7 +649,7 @@ BattleScript_OctlockTurnDmgEnd:
|
|||
BattleScript_EffectPoltergeist::
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
setpoltergeistmessage BattleScript_ButItFailed
|
||||
setpoltergeistmessage
|
||||
printstring STRINGID_ABOUTTOUSEPOLTERGEIST
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_HitFromDamageCalc
|
||||
|
|
@ -2271,16 +2272,14 @@ BattleScript_HitFromAccCheck::
|
|||
setpreattackadditionaleffect
|
||||
BattleScript_HitFromDamageCalc::
|
||||
damagecalc
|
||||
BattleScript_HitFromAtkAnimation::
|
||||
call BattleScript_Hit_RetFromAtkAnimation
|
||||
BattleScript_MoveEnd::
|
||||
moveendall
|
||||
end
|
||||
|
||||
BattleScript_EffectHit_Ret::
|
||||
attackcanceler
|
||||
BattleScript_EffectHit_RetFromAccCheck::
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
setpreattackadditionaleffect
|
||||
damagecalc
|
||||
BattleScript_Hit_RetFromAtkAnimation::
|
||||
attackanimation
|
||||
|
|
@ -2297,15 +2296,6 @@ BattleScript_Hit_RetFromAtkAnimation::
|
|||
setadditionaleffects
|
||||
return
|
||||
|
||||
BattleScript_EffectNaturalGift::
|
||||
attackcanceler
|
||||
jumpifnotberry BS_ATTACKER, BattleScript_ButItFailed
|
||||
jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_MAGIC_ROOM, BattleScript_ButItFailed
|
||||
jumpifability BS_ATTACKER, ABILITY_KLUTZ, BattleScript_ButItFailed
|
||||
jumpifvolatile BS_ATTACKER, VOLATILE_EMBARGO, BattleScript_ButItFailed
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
call BattleScript_HitFromDamageCalc
|
||||
|
||||
BattleScript_MakeMoveMissed::
|
||||
setmoveresultflags MOVE_RESULT_MISSED
|
||||
BattleScript_MoveMissedPause::
|
||||
|
|
@ -3052,16 +3042,6 @@ BattleScript_EffectPainSplit::
|
|||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectSnore::
|
||||
attackcanceler
|
||||
jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoSnore
|
||||
printstring STRINGID_PKMNFASTASLEEP
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
statusanimation BS_ATTACKER
|
||||
BattleScript_DoSnore::
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
goto BattleScript_HitFromDamageCalc
|
||||
|
||||
BattleScript_EffectConversion2::
|
||||
attackcanceler
|
||||
settypetorandomresistance BattleScript_ButItFailed
|
||||
|
|
@ -3346,15 +3326,6 @@ BattleScript_EffectSafeguard::
|
|||
setsafeguard
|
||||
goto BattleScript_PrintReflectLightScreenSafeguardString
|
||||
|
||||
BattleScript_EffectMagnitude::
|
||||
attackcanceler
|
||||
magnitudedamagecalculation
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_MAGNITUDESTRENGTH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
goto BattleScript_HitFromDamageCalc
|
||||
|
||||
BattleScript_EffectBatonPass::
|
||||
attackcanceler
|
||||
jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_ButItFailed
|
||||
|
|
@ -3500,17 +3471,9 @@ BattleScript_DoEffectTeleport::
|
|||
setteleportoutcome BS_ATTACKER
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectBeatUp::
|
||||
jumpifgenconfiglowerthan CONFIG_BEAT_UP, GEN_5, BattleScript_EffectBeatUpGen3
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
BattleScript_EffectBeatUpGen3:
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
pause B_WAIT_TIME_SHORT
|
||||
trydobeatup BattleScript_MoveEnd, BattleScript_ButItFailed
|
||||
BattleScript_BeatUpAttackMessage::
|
||||
printstring STRINGID_PKMNATTACK
|
||||
goto BattleScript_HitFromDamageCalc
|
||||
return
|
||||
|
||||
BattleScript_EffectDefenseCurl::
|
||||
attackcanceler
|
||||
|
|
@ -3601,11 +3564,9 @@ BattleScript_EffectStockpileSpDef::
|
|||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_MoveEffectStockpileWoreOff::
|
||||
.if B_STOCKPILE_RAISES_DEFS >= GEN_4
|
||||
dostockpilestatchangeswearoff BS_ATTACKER, BattleScript_StockpileStatChangeDown
|
||||
printstring STRINGID_STOCKPILEDEFFECTWOREOFF
|
||||
waitmessage B_WAIT_TIME_SHORT
|
||||
.endif
|
||||
return
|
||||
|
||||
BattleScript_StockpileStatChangeDown:
|
||||
|
|
@ -3615,23 +3576,6 @@ BattleScript_StockpileStatChangeDown:
|
|||
BattleScript_StockpileStatChangeDown_Ret:
|
||||
return
|
||||
|
||||
BattleScript_EffectSpitUp::
|
||||
attackcanceler
|
||||
jumpifbyte CMP_EQUAL, cMISS_TYPE, B_MSG_PROTECTED, BattleScript_SpitUpFailProtect
|
||||
accuracycheck BattleScript_MoveMissedPause
|
||||
damagecalc
|
||||
stockpiletobasedamage
|
||||
call BattleScript_Hit_RetFromAtkAnimation
|
||||
removestockpilecounters
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_SpitUpFailProtect::
|
||||
pause B_WAIT_TIME_LONG
|
||||
stockpiletobasedamage
|
||||
resultmessage
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectSwallow::
|
||||
attackcanceler
|
||||
stockpiletohpheal BattleScript_ButItFailed
|
||||
|
|
@ -3641,7 +3585,6 @@ BattleScript_EffectSwallow::
|
|||
datahpupdate BS_TARGET, PASSIVE_HP_UPDATE
|
||||
printstring STRINGID_PKMNREGAINEDHEALTH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
removestockpilecounters
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectTorment::
|
||||
|
|
@ -5696,6 +5639,12 @@ BattleScript_MoveUsedIsAsleep::
|
|||
statusanimation BS_ATTACKER
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_BeforeSnoreMessage::
|
||||
printstring STRINGID_PKMNFASTASLEEP
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
statusanimation BS_ATTACKER
|
||||
return
|
||||
|
||||
BattleScript_MoveUsedWokeUp::
|
||||
printfromtable gWokeUpStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ struct LinkBattleAnim
|
|||
u8 furyCutterCounter;
|
||||
u8 syrupBombIsShiny:1;
|
||||
u8 isTransformedMonShiny:1;
|
||||
u8 padding:4;
|
||||
u8 stockpileCounter:4;
|
||||
};
|
||||
|
||||
#define ANIM_ARGS_COUNT 8
|
||||
|
|
|
|||
|
|
@ -514,6 +514,10 @@ extern const u8 BattleScript_Explosion[];
|
|||
extern const u8 BattleScript_ActivateSwitchInAbility[];
|
||||
extern const u8 BattleScript_BreakScreens[];
|
||||
extern const u8 BattleScript_StealStats[];
|
||||
extern const u8 BattleScript_BeatUpAttackMessage[];
|
||||
extern const u8 BattleScript_MagnitudeMessage[];
|
||||
extern const u8 BattleScript_FickleBeamMessage[];
|
||||
extern const u8 BattleScript_BeforeSnoreMessage[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
|
@ -618,7 +622,6 @@ extern const u8 BattleScript_EffectHappyHour[];
|
|||
extern const u8 BattleScript_EffectDisable[];
|
||||
extern const u8 BattleScript_EffectEncore[];
|
||||
extern const u8 BattleScript_EffectPainSplit[];
|
||||
extern const u8 BattleScript_EffectSnore[];
|
||||
extern const u8 BattleScript_EffectConversion2[];
|
||||
extern const u8 BattleScript_EffectLockOn[];
|
||||
extern const u8 BattleScript_EffectSketch[];
|
||||
|
|
@ -640,7 +643,6 @@ extern const u8 BattleScript_EffectSwagger[];
|
|||
extern const u8 BattleScript_EffectAttract[];
|
||||
extern const u8 BattleScript_EffectPresent[];
|
||||
extern const u8 BattleScript_EffectSafeguard[];
|
||||
extern const u8 BattleScript_EffectMagnitude[];
|
||||
extern const u8 BattleScript_EffectBatonPass[];
|
||||
extern const u8 BattleScript_EffectCaptivate[];
|
||||
extern const u8 BattleScript_EffectMorningSun[];
|
||||
|
|
@ -659,7 +661,6 @@ extern const u8 BattleScript_EffectSemiInvulnerable[];
|
|||
extern const u8 BattleScript_EffectDefenseCurl[];
|
||||
extern const u8 BattleScript_EffectSoftboiled[];
|
||||
extern const u8 BattleScript_EffectStockpile[];
|
||||
extern const u8 BattleScript_EffectSpitUp[];
|
||||
extern const u8 BattleScript_EffectSwallow[];
|
||||
extern const u8 BattleScript_EffectOverwriteAbility[];
|
||||
extern const u8 BattleScript_EffectTorment[];
|
||||
|
|
@ -695,7 +696,6 @@ extern const u8 BattleScript_EffectDragonDance[];
|
|||
extern const u8 BattleScript_EffectCamouflage[];
|
||||
extern const u8 BattleScript_EffectPledge[];
|
||||
extern const u8 BattleScript_EffectFling[];
|
||||
extern const u8 BattleScript_EffectNaturalGift[];
|
||||
extern const u8 BattleScript_EffectRoost[];
|
||||
extern const u8 BattleScript_EffectGravity[];
|
||||
extern const u8 BattleScript_EffectMiracleEye[];
|
||||
|
|
@ -808,6 +808,5 @@ extern const u8 BattleScript_EffectFilletAway[];
|
|||
extern const u8 BattleScript_EffectShedTail[];
|
||||
extern const u8 BattleScript_EffectTidyUp[];
|
||||
extern const u8 BattleScript_EffectSpicyExtract[];
|
||||
extern const u8 BattleScript_EffectFickleBeam[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||
|
|
|
|||
|
|
@ -592,6 +592,7 @@ enum __attribute__((packed)) MoveEffect
|
|||
// Move effects that happen before the move hits. Set in SetPreAttackMoveEffect
|
||||
MOVE_EFFECT_BREAK_SCREEN,
|
||||
MOVE_EFFECT_STEAL_STATS,
|
||||
MOVE_EFFECT_BEAT_UP_MESSAGE, // Handles the message printing for gen2,3 and 4
|
||||
|
||||
NUM_MOVE_EFFECTS
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ enum CancelerState
|
|||
CANCELER_STANCE_CHANGE_2,
|
||||
CANCELER_ATTACKSTRING,
|
||||
CANCELER_PPDEDUCTION,
|
||||
CANCELER_MOVE_SPECIFIC_MESSAGE,
|
||||
CANCELER_SKY_BATTLE,
|
||||
CANCELER_WEATHER_PRIMAL,
|
||||
CANCELER_FOCUS_PRE_GEN5,
|
||||
|
|
|
|||
|
|
@ -120,25 +120,20 @@ enum BattleScriptOpcode
|
|||
B_SCR_OP_HPTHRESHOLDS,
|
||||
B_SCR_OP_HPTHRESHOLDS2,
|
||||
B_SCR_OP_USEITEMONOPPONENT,
|
||||
B_SCR_OP_UNUSED_0X78,
|
||||
B_SCR_OP_SETPROTECTLIKE,
|
||||
B_SCR_OP_TRYEXPLOSION,
|
||||
B_SCR_OP_SETATKHPTOZERO,
|
||||
B_SCR_OP_JUMPIFNEXTTARGETVALID,
|
||||
B_SCR_OP_TRYHEALHALFHEALTH,
|
||||
B_SCR_OP_UNUSED_0X7E,
|
||||
B_SCR_OP_SETFIELDWEATHER,
|
||||
B_SCR_OP_SETREFLECT,
|
||||
B_SCR_OP_SETSEEDED,
|
||||
B_SCR_OP_MANIPULATEDAMAGE,
|
||||
B_SCR_OP_TRYSETREST,
|
||||
B_SCR_OP_UNUSED_0X82,
|
||||
B_SCR_OP_UNUSED_0X83,
|
||||
B_SCR_OP_JUMPIFUPROARWAKES,
|
||||
B_SCR_OP_STOCKPILE,
|
||||
B_SCR_OP_STOCKPILETOBASEDAMAGE,
|
||||
B_SCR_OP_STOCKPILETOHPHEAL,
|
||||
B_SCR_OP_UNUSED_0X88,
|
||||
B_SCR_OP_STATBUFFCHANGE,
|
||||
B_SCR_OP_NORMALISEBUFFS,
|
||||
B_SCR_OP_SETBIDE,
|
||||
|
|
@ -161,19 +156,12 @@ enum BattleScriptOpcode
|
|||
B_SCR_OP_SETSUBSTITUTE,
|
||||
B_SCR_OP_MIMICATTACKCOPY,
|
||||
B_SCR_OP_SETCALLEDMOVE,
|
||||
B_SCR_OP_UNUSED_0X9F,
|
||||
B_SCR_OP_UNUSED_0XA0,
|
||||
B_SCR_OP_UNUSED_0XA1,
|
||||
B_SCR_OP_UNUSED_0XA2,
|
||||
B_SCR_OP_DISABLELASTUSEDATTACK,
|
||||
B_SCR_OP_TRYSETENCORE,
|
||||
B_SCR_OP_PAINSPLITDMGCALC,
|
||||
B_SCR_OP_SETTYPETORANDOMRESISTANCE,
|
||||
B_SCR_OP_SETALWAYSHITFLAG,
|
||||
B_SCR_OP_COPYMOVEPERMANENTLY,
|
||||
B_SCR_OP_UNUSED_0XA9,
|
||||
B_SCR_OP_UNUSED_AA,
|
||||
B_SCR_OP_UNUSED_0XAB,
|
||||
B_SCR_OP_SETTAILWIND,
|
||||
B_SCR_OP_TRYSPITEPPREDUCE,
|
||||
B_SCR_OP_HEALPARTYSTATUS,
|
||||
|
|
@ -181,35 +169,25 @@ enum BattleScriptOpcode
|
|||
B_SCR_OP_TRYSETSPIKES,
|
||||
B_SCR_OP_SETVOLATILE,
|
||||
B_SCR_OP_TRYSETPERISHSONG,
|
||||
B_SCR_OP_UNUSED_0XB3,
|
||||
B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED,
|
||||
B_SCR_OP_UNUSED_0XB5,
|
||||
B_SCR_OP_SETEMBARGO,
|
||||
B_SCR_OP_PRESENTDAMAGECALCULATION,
|
||||
B_SCR_OP_SETSAFEGUARD,
|
||||
B_SCR_OP_MAGNITUDEDAMAGECALCULATION,
|
||||
B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG,
|
||||
B_SCR_OP_TRYACTIVATEITEM,
|
||||
B_SCR_OP_HALVEHP,
|
||||
B_SCR_OP_COPYFOESTATS,
|
||||
B_SCR_OP_RAPIDSPINFREE,
|
||||
B_SCR_OP_UNUSED_0XBF,
|
||||
B_SCR_OP_RECOVERBASEDONSUNLIGHT,
|
||||
B_SCR_OP_SETSTICKYWEB,
|
||||
B_SCR_OP_SELECTFIRSTVALIDTARGET,
|
||||
B_SCR_OP_SETFUTUREATTACK,
|
||||
B_SCR_OP_TRYDOBEATUP,
|
||||
B_SCR_OP_SETSEMIINVULNERABLEBIT,
|
||||
B_SCR_OP_UNUSED_0XC6,
|
||||
B_SCR_OP_UNUSED_0XC7,
|
||||
B_SCR_OP_UNUSED_C8,
|
||||
B_SCR_OP_TRYMEMENTO,
|
||||
B_SCR_OP_SETFORCEDTARGET,
|
||||
B_SCR_OP_UNUSED_0XCB,
|
||||
B_SCR_OP_UNUSED_0XCC,
|
||||
B_SCR_OP_CURESTATUSWITHMOVE,
|
||||
B_SCR_OP_SETTORMENT,
|
||||
B_SCR_OP_UNUSED_0XCF,
|
||||
B_SCR_OP_SETTAUNT,
|
||||
B_SCR_OP_TRYSETHELPINGHAND,
|
||||
B_SCR_OP_TRYSWAPITEMS,
|
||||
|
|
@ -218,29 +196,22 @@ enum BattleScriptOpcode
|
|||
B_SCR_OP_SETTOXICSPIKES,
|
||||
B_SCR_OP_SETGASTROACID,
|
||||
B_SCR_OP_SETYAWN,
|
||||
B_SCR_OP_UNUSED0XD8,
|
||||
B_SCR_OP_SETROOM,
|
||||
B_SCR_OP_TRYSWAPABILITIES,
|
||||
B_SCR_OP_TRYIMPRISON,
|
||||
B_SCR_OP_SETSTEALTHROCK,
|
||||
B_SCR_OP_TRYSETVOLATILE,
|
||||
B_SCR_OP_UNUSED_0XDE,
|
||||
B_SCR_OP_TRYSETMAGICCOAT,
|
||||
B_SCR_OP_TRYSETSNATCH,
|
||||
B_SCR_OP_UNUSED2,
|
||||
B_SCR_OP_SWITCHOUTABILITIES,
|
||||
B_SCR_OP_JUMPIFHASNOHP,
|
||||
B_SCR_OP_UNUSED_0XE4,
|
||||
B_SCR_OP_PICKUP,
|
||||
B_SCR_OP_UNUSED_0XE6,
|
||||
B_SCR_OP_UNUSED_0XE7,
|
||||
B_SCR_OP_SETTYPEBASEDHALVERS,
|
||||
B_SCR_OP_JUMPIFSUBSTITUTEBLOCKS,
|
||||
B_SCR_OP_TRYRECYCLEITEM,
|
||||
B_SCR_OP_SETTYPETOENVIRONMENT,
|
||||
B_SCR_OP_PURSUITDOUBLES,
|
||||
B_SCR_OP_SNATCHSETBATTLERS,
|
||||
B_SCR_OP_UNUSED_0XEE,
|
||||
B_SCR_OP_HANDLEBALLTHROW,
|
||||
B_SCR_OP_GIVECAUGHTMON,
|
||||
B_SCR_OP_TRYSETCAUGHTMONDEXFLAGS,
|
||||
|
|
@ -262,6 +233,35 @@ enum BattleScriptOpcode
|
|||
// They are reserved for expansion usage.
|
||||
// Use callnatives instead.
|
||||
B_SCR_OP_UNUSED_1,
|
||||
B_SCR_OP_UNUSED_2,
|
||||
B_SCR_OP_UNUSED_3,
|
||||
B_SCR_OP_UNUSED_4,
|
||||
B_SCR_OP_UNUSED_5,
|
||||
B_SCR_OP_UNUSED_6,
|
||||
B_SCR_OP_UNUSED_7,
|
||||
B_SCR_OP_UNUSED_8,
|
||||
B_SCR_OP_UNUSED_9,
|
||||
B_SCR_OP_UNUSED_10,
|
||||
B_SCR_OP_UNUSED_11,
|
||||
B_SCR_OP_UNUSED_12,
|
||||
B_SCR_OP_UNUSED_13,
|
||||
B_SCR_OP_UNUSED_14,
|
||||
B_SCR_OP_UNUSED_15,
|
||||
B_SCR_OP_UNUSED_16,
|
||||
B_SCR_OP_UNUSED_17,
|
||||
B_SCR_OP_UNUSED_18,
|
||||
B_SCR_OP_UNUSED_19,
|
||||
B_SCR_OP_UNUSED_20,
|
||||
B_SCR_OP_UNUSED_21,
|
||||
B_SCR_OP_UNUSED_22,
|
||||
B_SCR_OP_UNUSED_23,
|
||||
B_SCR_OP_UNUSED_24,
|
||||
B_SCR_OP_UNUSED_25,
|
||||
B_SCR_OP_UNUSED_26,
|
||||
B_SCR_OP_UNUSED_27,
|
||||
B_SCR_OP_UNUSED_28,
|
||||
B_SCR_OP_UNUSED_29,
|
||||
B_SCR_OP_UNUSED_30,
|
||||
B_SCR_OP_CALLNATIVE,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3777,3 +3777,9 @@ void AnimTask_GetFuryCutterHitCount(u8 taskId)
|
|||
gBattleAnimArgs[ARG_RET_ID] = gAnimDisableStructPtr->furyCutterCounter;
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
void AnimTask_GetStockpileCounter(u8 taskId)
|
||||
{
|
||||
gBattleAnimArgs[ARG_RET_ID] = gAnimDisableStructPtr->stockpileCounter;
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -981,6 +981,7 @@ void BtlController_EmitMoveAnimation(enum BattlerId battler, u32 bufferId, enum
|
|||
anim.furyCutterCounter = gBattleMons[battler].volatiles.furyCutterCounter;
|
||||
anim.syrupBombIsShiny = gBattleMons[battler].volatiles.syrupBombIsShiny;
|
||||
anim.isTransformedMonShiny = gBattleMons[battler].volatiles.isTransformedMonShiny;
|
||||
anim.stockpileCounter = gBattleMons[battler].volatiles.stockpileCounter;
|
||||
memcpy(&gBattleResources->transferBuffer[16], &anim, sizeof(struct LinkBattleAnim));
|
||||
|
||||
PrepareBufferDataTransfer(battler, bufferId, gBattleResources->transferBuffer, 16 + sizeof(struct LinkBattleAnim));
|
||||
|
|
@ -1378,6 +1379,7 @@ void BtlController_EmitBattleAnimation(enum BattlerId battler, u32 bufferId, u8
|
|||
anim.furyCutterCounter = gBattleMons[battler].volatiles.furyCutterCounter;
|
||||
anim.syrupBombIsShiny = gBattleMons[battler].volatiles.syrupBombIsShiny;
|
||||
anim.isTransformedMonShiny = gBattleMons[battler].volatiles.isTransformedMonShiny;
|
||||
anim.stockpileCounter = gBattleMons[battler].volatiles.stockpileCounter;
|
||||
memcpy(&gBattleResources->transferBuffer[4], &anim, sizeof(struct LinkBattleAnim));
|
||||
|
||||
PrepareBufferDataTransfer(battler, bufferId, gBattleResources->transferBuffer, 4 + sizeof(struct LinkBattleAnim));
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ static bool32 CanBattlerBounceBackMove(struct BattleContext *ctx);
|
|||
static bool32 TryMagicBounce(struct BattleContext *ctx);
|
||||
static bool32 TryMagicCoat(struct BattleContext *ctx);
|
||||
static bool32 TryActivatePowderStatus(enum Move move);
|
||||
static void CalculateMagnitudeDamage(void);
|
||||
|
||||
// Submoves
|
||||
static enum Move GetMirrorMoveMove(void);
|
||||
|
|
@ -124,17 +125,22 @@ static enum CancelerResult CancelerAsleepOrFrozen(struct BattleContext *ctx)
|
|||
else
|
||||
gBattleMons[ctx->battlerAtk].status1 -= toSub;
|
||||
|
||||
enum BattleMoveEffects moveEffect = GetMoveEffect(ctx->move);
|
||||
if (gBattleMons[ctx->battlerAtk].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
if (!IsUsableWhileAsleepEffect(moveEffect))
|
||||
enum BattleMoveEffects moveEffect = GetMoveEffect(ctx->move);
|
||||
if (moveEffect == EFFECT_SNORE)
|
||||
{
|
||||
result = CANCELER_RESULT_FAILURE;
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep;
|
||||
BattleScriptCall(BattleScript_BeforeSnoreMessage);
|
||||
result = CANCELER_RESULT_BREAK;
|
||||
}
|
||||
else if (moveEffect == EFFECT_SLEEP_TALK)
|
||||
{
|
||||
result = CANCELER_RESULT_BREAK;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = CANCELER_RESULT_BREAK;
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep;
|
||||
result = CANCELER_RESULT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -905,6 +911,13 @@ static enum CancelerResult CancelerMoveFailure(struct BattleContext *ctx)
|
|||
if (GetActiveGimmick(ctx->battlerDef) == GIMMICK_DYNAMAX)
|
||||
battleScript = BattleScript_MoveBlockedByDynamax;
|
||||
break;
|
||||
case EFFECT_NATURAL_GIFT:
|
||||
if (GetItemPocket(gBattleMons[ctx->battlerAtk].item) != POCKET_BERRIES
|
||||
|| gFieldStatuses & STATUS_FIELD_MAGIC_ROOM
|
||||
|| ctx->abilityAtk == ABILITY_KLUTZ
|
||||
|| gBattleMons[ctx->battlerAtk].volatiles.embargo)
|
||||
battleScript = BattleScript_ButItFailed;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -1091,6 +1104,29 @@ static enum CancelerResult CancelerCharging(struct BattleContext *ctx)
|
|||
return result;
|
||||
}
|
||||
|
||||
static enum CancelerResult CancelerMoveSpecificMessage(struct BattleContext *ctx)
|
||||
{
|
||||
switch (GetMoveEffect(ctx->move))
|
||||
{
|
||||
case EFFECT_MAGNITUDE:
|
||||
CalculateMagnitudeDamage();
|
||||
BattleScriptCall(BattleScript_MagnitudeMessage);
|
||||
return CANCELER_RESULT_BREAK;
|
||||
case EFFECT_FICKLE_BEAM:
|
||||
gBattleStruct->fickleBeamBoosted = RandomPercentage(RNG_FICKLE_BEAM, 30);
|
||||
if (gBattleStruct->fickleBeamBoosted)
|
||||
{
|
||||
BattleScriptCall(BattleScript_FickleBeamMessage);
|
||||
return CANCELER_RESULT_BREAK;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return CANCELER_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static bool32 NoTargetPresent(enum BattlerId battler, enum Move move, enum MoveTarget moveTarget)
|
||||
{
|
||||
switch (moveTarget)
|
||||
|
|
@ -1185,9 +1221,7 @@ static bool32 IsTargetingBothFoes(enum BattlerId battlerAtk, enum BattlerId batt
|
|||
|
||||
static bool32 IsTargetingSelf(enum BattlerId battlerAtk, enum BattlerId battlerDef)
|
||||
{
|
||||
if (battlerAtk != battlerDef)
|
||||
return skipFailure;
|
||||
return skipFailure; // In Gen3 the user checks it's own failure. Unclear because no such moves exists
|
||||
return skipFailure;
|
||||
}
|
||||
|
||||
static bool32 IsTargetingAlly(enum BattlerId battlerAtk, enum BattlerId battlerDef)
|
||||
|
|
@ -1208,7 +1242,7 @@ static bool32 IsTargetingSelfAndAlly(enum BattlerId battlerAtk, enum BattlerId b
|
|||
gBattleStruct->moveResultFlags[battlerDef] = MOVE_RESULT_NO_EFFECT;
|
||||
return skipFailure;
|
||||
}
|
||||
return checkFailure; // In Gen3 the user checks it's own failure. Unclear because no such moves exists
|
||||
return checkFailure;
|
||||
}
|
||||
|
||||
static bool32 IsTargetingSelfOrAlly(enum BattlerId battlerAtk, enum BattlerId battlerDef)
|
||||
|
|
@ -1222,7 +1256,7 @@ static bool32 IsTargetingSelfOrAlly(enum BattlerId battlerAtk, enum BattlerId ba
|
|||
return skipFailure;
|
||||
}
|
||||
|
||||
return checkFailure; // In Gen3 the user checks it's own failure. Unclear because no such move exists
|
||||
return checkFailure;
|
||||
}
|
||||
|
||||
static bool32 IsTargetingFoesAndAlly(enum BattlerId battlerAtk, enum BattlerId battlerDef)
|
||||
|
|
@ -1249,7 +1283,6 @@ static bool32 IsTargetingAllBattlers(enum BattlerId battlerAtk, enum BattlerId b
|
|||
return checkFailure;
|
||||
}
|
||||
|
||||
// ShouldCheckFailureOnTarget
|
||||
static bool32 (*const sShouldCheckTargetMoveFailure[])(enum BattlerId battlerAtk, enum BattlerId battlerDef) =
|
||||
{
|
||||
[TARGET_NONE] = IsTargetingField,
|
||||
|
|
@ -1579,6 +1612,7 @@ static enum CancelerResult (*const sMoveSuccessOrderCancelers[])(struct BattleCo
|
|||
[CANCELER_EXPLODING_DAMP] = CancelerExplodingDamp,
|
||||
[CANCELER_EXPLOSION] = CancelerExplosion,
|
||||
[CANCELER_CHARGING] = CancelerCharging,
|
||||
[CANCELER_MOVE_SPECIFIC_MESSAGE] = CancelerMoveSpecificMessage,
|
||||
[CANCELER_NO_TARGET] = CancelerNoTarget,
|
||||
[CANCELER_TOOK_ATTACK] = CancelerTookAttack,
|
||||
[CANCELER_TARGET_FAILURE] = CancelerTargetFailure,
|
||||
|
|
@ -1601,11 +1635,12 @@ enum CancelerResult DoAttackCanceler(void)
|
|||
while (gBattleStruct->eventState.atkCanceler < CANCELER_END && result == CANCELER_RESULT_SUCCESS)
|
||||
{
|
||||
result = sMoveSuccessOrderCancelers[gBattleStruct->eventState.atkCanceler](&ctx);
|
||||
gBattleStruct->unableToUseMove = (result == CANCELER_RESULT_FAILURE);
|
||||
if (result != CANCELER_RESULT_PAUSE)
|
||||
gBattleStruct->eventState.atkCanceler++;
|
||||
}
|
||||
|
||||
if (result == CANCELER_RESULT_FAILURE)
|
||||
gBattleStruct->unableToUseMove = TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -2303,14 +2338,7 @@ static enum MoveEndResult MoveEndNextTarget(void)
|
|||
gBattleStruct->moveTarget[gBattlerAttacker] = gBattlerTarget = nextTarget; // Fix for moxie spread moves
|
||||
gBattleScripting.moveendState = 0;
|
||||
MoveValuesCleanUp();
|
||||
|
||||
enum BattleMoveEffects moveEffect = GetMoveEffect(gCurrentMove);
|
||||
|
||||
// Edge cases for moves that shouldn't repeat their own script
|
||||
if (moveEffect == EFFECT_MAGNITUDE)
|
||||
BattleScriptPush(gBattleMoveEffects[EFFECT_HIT].battleScript);
|
||||
else
|
||||
BattleScriptPush(GetMoveBattleScript(gCurrentMove));
|
||||
BattleScriptPush(GetMoveBattleScript(gCurrentMove));
|
||||
gBattlescriptCurrInstr = BattleScript_FlushMessageBox;
|
||||
return MOVEEND_RESULT_BREAK;
|
||||
}
|
||||
|
|
@ -2430,6 +2458,18 @@ static enum MoveEndResult MoveEndMoveBlock(void)
|
|||
|
||||
switch (moveEffect)
|
||||
{
|
||||
case EFFECT_SPIT_UP:
|
||||
case EFFECT_SWALLOW:
|
||||
if (!gBattleStruct->unableToUseMove)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].volatiles.stockpileCounter = 0;
|
||||
if (B_STOCKPILE_RAISES_DEFS >= GEN_4)
|
||||
{
|
||||
BattleScriptCall(BattleScript_MoveEffectStockpileWoreOff);
|
||||
result = MOVEEND_RESULT_RUN_SCRIPT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EFFECT_KNOCK_OFF:
|
||||
if (gBattleMons[gBattlerTarget].item != ITEM_NONE
|
||||
&& IsBattlerAlive(gBattlerAttacker)
|
||||
|
|
@ -3726,3 +3766,46 @@ static bool32 TryActivatePowderStatus(enum Move move)
|
|||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void CalculateMagnitudeDamage(void)
|
||||
{
|
||||
u32 magnitude = RandomUniform(RNG_MAGNITUDE, 0, 99);
|
||||
|
||||
if (magnitude < 5)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 10;
|
||||
magnitude = 4;
|
||||
}
|
||||
else if (magnitude < 15)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 30;
|
||||
magnitude = 5;
|
||||
}
|
||||
else if (magnitude < 35)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 50;
|
||||
magnitude = 6;
|
||||
}
|
||||
else if (magnitude < 65)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 70;
|
||||
magnitude = 7;
|
||||
}
|
||||
else if (magnitude < 85)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 90;
|
||||
magnitude = 8;
|
||||
}
|
||||
else if (magnitude < 95)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 110;
|
||||
magnitude = 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 150;
|
||||
magnitude = 10;
|
||||
}
|
||||
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 2, magnitude)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -469,25 +469,20 @@ static void Cmd_jumpifplayerran(void);
|
|||
static void Cmd_hpthresholds(void);
|
||||
static void Cmd_hpthresholds2(void);
|
||||
static void Cmd_useitemonopponent(void);
|
||||
static void Cmd_unused_0x78(void);
|
||||
static void Cmd_setprotectlike(void);
|
||||
static void Cmd_tryexplosion(void);
|
||||
static void Cmd_setatkhptozero(void);
|
||||
static void Cmd_jumpifnexttargetvalid(void);
|
||||
static void Cmd_tryhealhalfhealth(void);
|
||||
static void Cmd_unused_0x7e(void);
|
||||
static void Cmd_setfieldweather(void);
|
||||
static void Cmd_setreflect(void);
|
||||
static void Cmd_setseeded(void);
|
||||
static void Cmd_manipulatedamage(void);
|
||||
static void Cmd_trysetrest(void);
|
||||
static void Cmd_unused_0x82(void);
|
||||
static void Cmd_unused_0x83(void);
|
||||
static void Cmd_jumpifuproarwakes(void);
|
||||
static void Cmd_stockpile(void);
|
||||
static void Cmd_stockpiletobasedamage(void);
|
||||
static void Cmd_stockpiletohpheal(void);
|
||||
static void Cmd_unused_0x88(void);
|
||||
static void Cmd_statbuffchange(void);
|
||||
static void Cmd_normalisebuffs(void);
|
||||
static void Cmd_setbide(void);
|
||||
|
|
@ -510,19 +505,12 @@ static void Cmd_transformdataexecution(void);
|
|||
static void Cmd_setsubstitute(void);
|
||||
static void Cmd_mimicattackcopy(void);
|
||||
static void Cmd_setcalledmove(void);
|
||||
static void Cmd_unused_0x9f(void);
|
||||
static void Cmd_unused_0xA0(void);
|
||||
static void Cmd_unused_0xA1(void);
|
||||
static void Cmd_unused_0xA2(void);
|
||||
static void Cmd_disablelastusedattack(void);
|
||||
static void Cmd_trysetencore(void);
|
||||
static void Cmd_painsplitdmgcalc(void);
|
||||
static void Cmd_settypetorandomresistance(void);
|
||||
static void Cmd_setalwayshitflag(void);
|
||||
static void Cmd_copymovepermanently(void);
|
||||
static void Cmd_unused_0xA9(void);
|
||||
static void Cmd_unused_AA(void);
|
||||
static void Cmd_unused_0xab(void);
|
||||
static void Cmd_settailwind(void);
|
||||
static void Cmd_tryspiteppreduce(void);
|
||||
static void Cmd_healpartystatus(void);
|
||||
|
|
@ -530,35 +518,25 @@ static void Cmd_cursetarget(void);
|
|||
static void Cmd_trysetspikes(void);
|
||||
static void Cmd_setvolatile(void);
|
||||
static void Cmd_trysetperishsong(void);
|
||||
static void Cmd_unused_0xb3(void);
|
||||
static void Cmd_jumpifconfusedandstatmaxed(void);
|
||||
static void Cmd_unused_0xb5(void);
|
||||
static void Cmd_setembargo(void);
|
||||
static void Cmd_presentdamagecalculation(void);
|
||||
static void Cmd_setsafeguard(void);
|
||||
static void Cmd_magnitudedamagecalculation(void);
|
||||
static void Cmd_jumpifnopursuitswitchdmg(void);
|
||||
static void Cmd_tryactivateitem(void);
|
||||
static void Cmd_halvehp(void);
|
||||
static void Cmd_copyfoestats(void);
|
||||
static void Cmd_rapidspinfree(void);
|
||||
static void Cmd_unused_0xBF(void);
|
||||
static void Cmd_recoverbasedonsunlight(void);
|
||||
static void Cmd_setstickyweb(void);
|
||||
static void Cmd_selectfirstvalidtarget(void);
|
||||
static void Cmd_setfutureattack(void);
|
||||
static void Cmd_trydobeatup(void);
|
||||
static void Cmd_setsemiinvulnerablebit(void);
|
||||
static void Cmd_unused_0xC6(void);
|
||||
static void Cmd_unused_0xC7(void);
|
||||
static void Cmd_unused_c8(void);
|
||||
static void Cmd_trymemento(void);
|
||||
static void Cmd_setforcedtarget(void);
|
||||
static void Cmd_unused_0xcb(void);
|
||||
static void Cmd_unused_0xCC(void);
|
||||
static void Cmd_curestatuswithmove(void);
|
||||
static void Cmd_settorment(void);
|
||||
static void Cmd_unused_0xCF(void);
|
||||
static void Cmd_settaunt(void);
|
||||
static void Cmd_trysethelpinghand(void);
|
||||
static void Cmd_tryswapitems(void);
|
||||
|
|
@ -567,29 +545,22 @@ static void Cmd_trywish(void);
|
|||
static void Cmd_settoxicspikes(void);
|
||||
static void Cmd_setgastroacid(void);
|
||||
static void Cmd_setyawn(void);
|
||||
static void Cmd_unused0xd8(void);
|
||||
static void Cmd_setroom(void);
|
||||
static void Cmd_tryswapabilities(void);
|
||||
static void Cmd_tryimprison(void);
|
||||
static void Cmd_setstealthrock(void);
|
||||
static void Cmd_trysetvolatile(void);
|
||||
static void Cmd_unused_0xde(void);
|
||||
static void Cmd_trysetmagiccoat(void);
|
||||
static void Cmd_trysetsnatch(void);
|
||||
static void Cmd_unused2(void);
|
||||
static void Cmd_switchoutabilities(void);
|
||||
static void Cmd_jumpifhasnohp(void);
|
||||
static void Cmd_unused_0xE4(void);
|
||||
static void Cmd_pickup(void);
|
||||
static void Cmd_unused_0xE6(void);
|
||||
static void Cmd_unused_0xE7(void);
|
||||
static void Cmd_settypebasedhalvers(void);
|
||||
static void Cmd_jumpifsubstituteblocks(void);
|
||||
static void Cmd_tryrecycleitem(void);
|
||||
static void Cmd_settypetoenvironment(void);
|
||||
static void Cmd_pursuitdoubles(void);
|
||||
static void Cmd_snatchsetbattlers(void);
|
||||
static void Cmd_unused_0xee(void);
|
||||
static void Cmd_handleballthrow(void);
|
||||
static void Cmd_givecaughtmon(void);
|
||||
static void Cmd_trysetcaughtmondexflags(void);
|
||||
|
|
@ -606,7 +577,7 @@ static void Cmd_averagestats(void);
|
|||
static void Cmd_jumpifcaptivateaffected(void);
|
||||
static void Cmd_setnonvolatilestatus(void);
|
||||
static void Cmd_tryoverwriteability(void);
|
||||
static void Cmd_unused_1(void);
|
||||
static void Cmd_dummy(void);
|
||||
static void Cmd_callnative(void);
|
||||
|
||||
void (*const gBattleScriptingCommandsTable[])(void) =
|
||||
|
|
@ -728,25 +699,20 @@ void (*const gBattleScriptingCommandsTable[])(void) =
|
|||
[B_SCR_OP_HPTHRESHOLDS] = Cmd_hpthresholds,
|
||||
[B_SCR_OP_HPTHRESHOLDS2] = Cmd_hpthresholds2,
|
||||
[B_SCR_OP_USEITEMONOPPONENT] = Cmd_useitemonopponent,
|
||||
[B_SCR_OP_UNUSED_0X78] = Cmd_unused_0x78,
|
||||
[B_SCR_OP_SETPROTECTLIKE] = Cmd_setprotectlike,
|
||||
[B_SCR_OP_TRYEXPLOSION] = Cmd_tryexplosion,
|
||||
[B_SCR_OP_SETATKHPTOZERO] = Cmd_setatkhptozero,
|
||||
[B_SCR_OP_JUMPIFNEXTTARGETVALID] = Cmd_jumpifnexttargetvalid,
|
||||
[B_SCR_OP_TRYHEALHALFHEALTH] = Cmd_tryhealhalfhealth,
|
||||
[B_SCR_OP_UNUSED_0X7E] = Cmd_unused_0x7e,
|
||||
[B_SCR_OP_SETFIELDWEATHER] = Cmd_setfieldweather,
|
||||
[B_SCR_OP_SETREFLECT] = Cmd_setreflect,
|
||||
[B_SCR_OP_SETSEEDED] = Cmd_setseeded,
|
||||
[B_SCR_OP_MANIPULATEDAMAGE] = Cmd_manipulatedamage,
|
||||
[B_SCR_OP_TRYSETREST] = Cmd_trysetrest,
|
||||
[B_SCR_OP_UNUSED_0X82] = Cmd_unused_0x82,
|
||||
[B_SCR_OP_UNUSED_0X83] = Cmd_unused_0x83,
|
||||
[B_SCR_OP_JUMPIFUPROARWAKES] = Cmd_jumpifuproarwakes,
|
||||
[B_SCR_OP_STOCKPILE] = Cmd_stockpile,
|
||||
[B_SCR_OP_STOCKPILETOBASEDAMAGE] = Cmd_stockpiletobasedamage,
|
||||
[B_SCR_OP_STOCKPILETOHPHEAL] = Cmd_stockpiletohpheal,
|
||||
[B_SCR_OP_UNUSED_0X88] = Cmd_unused_0x88,
|
||||
[B_SCR_OP_STATBUFFCHANGE] = Cmd_statbuffchange,
|
||||
[B_SCR_OP_NORMALISEBUFFS] = Cmd_normalisebuffs,
|
||||
[B_SCR_OP_SETBIDE] = Cmd_setbide,
|
||||
|
|
@ -769,19 +735,12 @@ void (*const gBattleScriptingCommandsTable[])(void) =
|
|||
[B_SCR_OP_SETSUBSTITUTE] = Cmd_setsubstitute,
|
||||
[B_SCR_OP_MIMICATTACKCOPY] = Cmd_mimicattackcopy,
|
||||
[B_SCR_OP_SETCALLEDMOVE] = Cmd_setcalledmove,
|
||||
[B_SCR_OP_UNUSED_0X9F] = Cmd_unused_0x9f,
|
||||
[B_SCR_OP_UNUSED_0XA0] = Cmd_unused_0xA0,
|
||||
[B_SCR_OP_UNUSED_0XA1] = Cmd_unused_0xA1,
|
||||
[B_SCR_OP_UNUSED_0XA2] = Cmd_unused_0xA2,
|
||||
[B_SCR_OP_DISABLELASTUSEDATTACK] = Cmd_disablelastusedattack,
|
||||
[B_SCR_OP_TRYSETENCORE] = Cmd_trysetencore,
|
||||
[B_SCR_OP_PAINSPLITDMGCALC] = Cmd_painsplitdmgcalc,
|
||||
[B_SCR_OP_SETTYPETORANDOMRESISTANCE] = Cmd_settypetorandomresistance,
|
||||
[B_SCR_OP_SETALWAYSHITFLAG] = Cmd_setalwayshitflag,
|
||||
[B_SCR_OP_COPYMOVEPERMANENTLY] = Cmd_copymovepermanently,
|
||||
[B_SCR_OP_UNUSED_0XA9] = Cmd_unused_0xA9,
|
||||
[B_SCR_OP_UNUSED_AA] = Cmd_unused_AA,
|
||||
[B_SCR_OP_UNUSED_0XAB] = Cmd_unused_0xab,
|
||||
[B_SCR_OP_SETTAILWIND] = Cmd_settailwind,
|
||||
[B_SCR_OP_TRYSPITEPPREDUCE] = Cmd_tryspiteppreduce,
|
||||
[B_SCR_OP_HEALPARTYSTATUS] = Cmd_healpartystatus,
|
||||
|
|
@ -789,35 +748,25 @@ void (*const gBattleScriptingCommandsTable[])(void) =
|
|||
[B_SCR_OP_TRYSETSPIKES] = Cmd_trysetspikes,
|
||||
[B_SCR_OP_SETVOLATILE] = Cmd_setvolatile,
|
||||
[B_SCR_OP_TRYSETPERISHSONG] = Cmd_trysetperishsong,
|
||||
[B_SCR_OP_UNUSED_0XB3] = Cmd_unused_0xb3,
|
||||
[B_SCR_OP_JUMPIFCONFUSEDANDSTATMAXED] = Cmd_jumpifconfusedandstatmaxed,
|
||||
[B_SCR_OP_UNUSED_0XB5] = Cmd_unused_0xb5,
|
||||
[B_SCR_OP_SETEMBARGO] = Cmd_setembargo,
|
||||
[B_SCR_OP_PRESENTDAMAGECALCULATION] = Cmd_presentdamagecalculation,
|
||||
[B_SCR_OP_SETSAFEGUARD] = Cmd_setsafeguard,
|
||||
[B_SCR_OP_MAGNITUDEDAMAGECALCULATION] = Cmd_magnitudedamagecalculation,
|
||||
[B_SCR_OP_JUMPIFNOPURSUITSWITCHDMG] = Cmd_jumpifnopursuitswitchdmg,
|
||||
[B_SCR_OP_TRYACTIVATEITEM] = Cmd_tryactivateitem,
|
||||
[B_SCR_OP_HALVEHP] = Cmd_halvehp,
|
||||
[B_SCR_OP_COPYFOESTATS] = Cmd_copyfoestats,
|
||||
[B_SCR_OP_RAPIDSPINFREE] = Cmd_rapidspinfree,
|
||||
[B_SCR_OP_UNUSED_0XBF] = Cmd_unused_0xBF,
|
||||
[B_SCR_OP_RECOVERBASEDONSUNLIGHT] = Cmd_recoverbasedonsunlight,
|
||||
[B_SCR_OP_SETSTICKYWEB] = Cmd_setstickyweb,
|
||||
[B_SCR_OP_SELECTFIRSTVALIDTARGET] = Cmd_selectfirstvalidtarget,
|
||||
[B_SCR_OP_SETFUTUREATTACK] = Cmd_setfutureattack,
|
||||
[B_SCR_OP_TRYDOBEATUP] = Cmd_trydobeatup,
|
||||
[B_SCR_OP_SETSEMIINVULNERABLEBIT] = Cmd_setsemiinvulnerablebit,
|
||||
[B_SCR_OP_UNUSED_0XC6] = Cmd_unused_0xC6,
|
||||
[B_SCR_OP_UNUSED_0XC7] = Cmd_unused_0xC7,
|
||||
[B_SCR_OP_UNUSED_C8] = Cmd_unused_c8,
|
||||
[B_SCR_OP_TRYMEMENTO] = Cmd_trymemento,
|
||||
[B_SCR_OP_SETFORCEDTARGET] = Cmd_setforcedtarget,
|
||||
[B_SCR_OP_UNUSED_0XCB] = Cmd_unused_0xcb,
|
||||
[B_SCR_OP_UNUSED_0XCC] = Cmd_unused_0xCC,
|
||||
[B_SCR_OP_CURESTATUSWITHMOVE] = Cmd_curestatuswithmove,
|
||||
[B_SCR_OP_SETTORMENT] = Cmd_settorment,
|
||||
[B_SCR_OP_UNUSED_0XCF] = Cmd_unused_0xCF,
|
||||
[B_SCR_OP_SETTAUNT] = Cmd_settaunt,
|
||||
[B_SCR_OP_TRYSETHELPINGHAND] = Cmd_trysethelpinghand,
|
||||
[B_SCR_OP_TRYSWAPITEMS] = Cmd_tryswapitems,
|
||||
|
|
@ -826,29 +775,22 @@ void (*const gBattleScriptingCommandsTable[])(void) =
|
|||
[B_SCR_OP_SETTOXICSPIKES] = Cmd_settoxicspikes,
|
||||
[B_SCR_OP_SETGASTROACID] = Cmd_setgastroacid,
|
||||
[B_SCR_OP_SETYAWN] = Cmd_setyawn,
|
||||
[B_SCR_OP_UNUSED0XD8] = Cmd_unused0xd8,
|
||||
[B_SCR_OP_SETROOM] = Cmd_setroom,
|
||||
[B_SCR_OP_TRYSWAPABILITIES] = Cmd_tryswapabilities,
|
||||
[B_SCR_OP_TRYIMPRISON] = Cmd_tryimprison,
|
||||
[B_SCR_OP_SETSTEALTHROCK] = Cmd_setstealthrock,
|
||||
[B_SCR_OP_TRYSETVOLATILE] = Cmd_trysetvolatile,
|
||||
[B_SCR_OP_UNUSED_0XDE] = Cmd_unused_0xde,
|
||||
[B_SCR_OP_TRYSETMAGICCOAT] = Cmd_trysetmagiccoat,
|
||||
[B_SCR_OP_TRYSETSNATCH] = Cmd_trysetsnatch,
|
||||
[B_SCR_OP_UNUSED2] = Cmd_unused2,
|
||||
[B_SCR_OP_SWITCHOUTABILITIES] = Cmd_switchoutabilities,
|
||||
[B_SCR_OP_JUMPIFHASNOHP] = Cmd_jumpifhasnohp,
|
||||
[B_SCR_OP_UNUSED_0XE4] = Cmd_unused_0xE4,
|
||||
[B_SCR_OP_PICKUP] = Cmd_pickup,
|
||||
[B_SCR_OP_UNUSED_0XE6] = Cmd_unused_0xE6,
|
||||
[B_SCR_OP_UNUSED_0XE7] = Cmd_unused_0xE7,
|
||||
[B_SCR_OP_SETTYPEBASEDHALVERS] = Cmd_settypebasedhalvers,
|
||||
[B_SCR_OP_JUMPIFSUBSTITUTEBLOCKS] = Cmd_jumpifsubstituteblocks,
|
||||
[B_SCR_OP_TRYRECYCLEITEM] = Cmd_tryrecycleitem,
|
||||
[B_SCR_OP_SETTYPETOENVIRONMENT] = Cmd_settypetoenvironment,
|
||||
[B_SCR_OP_PURSUITDOUBLES] = Cmd_pursuitdoubles,
|
||||
[B_SCR_OP_SNATCHSETBATTLERS] = Cmd_snatchsetbattlers,
|
||||
[B_SCR_OP_UNUSED_0XEE] = Cmd_unused_0xee,
|
||||
[B_SCR_OP_HANDLEBALLTHROW] = Cmd_handleballthrow,
|
||||
[B_SCR_OP_GIVECAUGHTMON] = Cmd_givecaughtmon,
|
||||
[B_SCR_OP_TRYSETCAUGHTMONDEXFLAGS] = Cmd_trysetcaughtmondexflags,
|
||||
|
|
@ -865,7 +807,36 @@ void (*const gBattleScriptingCommandsTable[])(void) =
|
|||
[B_SCR_OP_JUMPIFCAPTIVATEAFFECTED] = Cmd_jumpifcaptivateaffected,
|
||||
[B_SCR_OP_SETNONVOLATILESTATUS] = Cmd_setnonvolatilestatus,
|
||||
[B_SCR_OP_TRYOVERWRITEABILITY] = Cmd_tryoverwriteability,
|
||||
[B_SCR_OP_UNUSED_1] = Cmd_unused_1,
|
||||
[B_SCR_OP_UNUSED_1] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_2] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_3] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_4] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_5] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_6] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_7] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_8] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_9] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_10] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_11] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_12] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_13] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_14] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_15] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_16] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_17] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_18] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_19] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_20] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_21] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_22] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_23] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_24] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_25] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_26] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_27] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_28] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_29] = Cmd_dummy,
|
||||
[B_SCR_OP_UNUSED_30] = Cmd_dummy,
|
||||
[B_SCR_OP_CALLNATIVE] = Cmd_callnative,
|
||||
};
|
||||
|
||||
|
|
@ -3511,47 +3482,43 @@ void SetMoveEffect(enum BattlerId battlerAtk, enum BattlerId effectBattler, enum
|
|||
break;
|
||||
case MOVE_EFFECT_STEAL_STATS:
|
||||
if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
||||
bool32 contrary = abilities[gBattlerAttacker] == ABILITY_CONTRARY;
|
||||
gBattleStruct->stolenStats[0] = 0; // Stats to steal.
|
||||
gBattleScripting.animArg1 = 0;
|
||||
for (enum Stat stat = STAT_ATK; stat < NUM_BATTLE_STATS; stat++)
|
||||
{
|
||||
bool32 contrary = abilities[gBattlerAttacker] == ABILITY_CONTRARY;
|
||||
gBattleStruct->stolenStats[0] = 0; // Stats to steal.
|
||||
gBattleScripting.animArg1 = 0;
|
||||
for (enum Stat stat = STAT_ATK; stat < NUM_BATTLE_STATS; stat++)
|
||||
if (gBattleMons[gBattlerTarget].statStages[stat] > DEFAULT_STAT_STAGE && gBattleMons[gBattlerAttacker].statStages[stat] != MAX_STAT_STAGE)
|
||||
{
|
||||
if (gBattleMons[gBattlerTarget].statStages[stat] > DEFAULT_STAT_STAGE && gBattleMons[gBattlerAttacker].statStages[stat] != MAX_STAT_STAGE)
|
||||
bool32 byTwo = FALSE;
|
||||
|
||||
gBattleStruct->stolenStats[0] |= (1 << (stat));
|
||||
// Store by how many stages to raise the stat.
|
||||
gBattleStruct->stolenStats[stat] = gBattleMons[gBattlerTarget].statStages[stat] - DEFAULT_STAT_STAGE;
|
||||
|
||||
while (gBattleMons[gBattlerAttacker].statStages[stat] + gBattleStruct->stolenStats[stat] > MAX_STAT_STAGE)
|
||||
gBattleStruct->stolenStats[stat]--;
|
||||
|
||||
gBattleMons[gBattlerTarget].statStages[stat] = DEFAULT_STAT_STAGE;
|
||||
|
||||
if (gBattleStruct->stolenStats[stat] >= 2)
|
||||
byTwo++;
|
||||
|
||||
if (gBattleScripting.animArg1 == 0)
|
||||
{
|
||||
bool32 byTwo = FALSE;
|
||||
|
||||
gBattleStruct->stolenStats[0] |= (1 << (stat));
|
||||
// Store by how many stages to raise the stat.
|
||||
gBattleStruct->stolenStats[stat] = gBattleMons[gBattlerTarget].statStages[stat] - DEFAULT_STAT_STAGE;
|
||||
|
||||
while (gBattleMons[gBattlerAttacker].statStages[stat] + gBattleStruct->stolenStats[stat] > MAX_STAT_STAGE)
|
||||
gBattleStruct->stolenStats[stat]--;
|
||||
|
||||
gBattleMons[gBattlerTarget].statStages[stat] = DEFAULT_STAT_STAGE;
|
||||
|
||||
if (gBattleStruct->stolenStats[stat] >= 2)
|
||||
byTwo++;
|
||||
|
||||
if (gBattleScripting.animArg1 == 0)
|
||||
{
|
||||
if (byTwo)
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MINUS2 : STAT_ANIM_PLUS2) + stat;
|
||||
else
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MINUS1 : STAT_ANIM_PLUS1) + stat;
|
||||
}
|
||||
if (byTwo)
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MINUS2 : STAT_ANIM_PLUS2) + stat;
|
||||
else
|
||||
{
|
||||
if (byTwo)
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MULTIPLE_MINUS2 : STAT_ANIM_MULTIPLE_PLUS2);
|
||||
else
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MULTIPLE_MINUS1 : STAT_ANIM_MULTIPLE_PLUS1);
|
||||
}
|
||||
}
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MINUS1 : STAT_ANIM_PLUS1) + stat;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (byTwo)
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MULTIPLE_MINUS2 : STAT_ANIM_MULTIPLE_PLUS2);
|
||||
else
|
||||
gBattleScripting.animArg1 = (contrary ? STAT_ANIM_MULTIPLE_MINUS1 : STAT_ANIM_MULTIPLE_PLUS1);
|
||||
}
|
||||
}
|
||||
|
||||
if (gBattleStruct->stolenStats[0] != 0)
|
||||
|
|
@ -3562,6 +3529,26 @@ void SetMoveEffect(enum BattlerId battlerAtk, enum BattlerId effectBattler, enum
|
|||
}
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_BEAT_UP_MESSAGE:
|
||||
if (GetConfig(CONFIG_BEAT_UP) >= GEN_5) // Gen5+ don't print any custom message on attack
|
||||
break;
|
||||
|
||||
if (!IsBattlerAlive(gBattlerTarget))
|
||||
{
|
||||
gMultiHitCounter = 0;
|
||||
gBattlescriptCurrInstr = BattleScript_MoveEnd;
|
||||
}
|
||||
else if (gBattleStruct->beatUpSlot == 0 && gMultiHitCounter == 0)
|
||||
{
|
||||
gBattlescriptCurrInstr = BattleScript_ButItFailed;
|
||||
}
|
||||
else
|
||||
{
|
||||
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattleStruct->beatUpSpecies[gBattleStruct->beatUpSlot])
|
||||
BattleScriptPush(battleScript);
|
||||
gBattlescriptCurrInstr = BattleScript_BeatUpAttackMessage;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -7201,10 +7188,6 @@ static void HandleScriptMegaPrimalBurst(u32 caseId, enum BattlerId battler, u32
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_0x78(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_setprotectlike(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
|
@ -7303,10 +7286,6 @@ static void Cmd_tryhealhalfhealth(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0x7e(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_setfieldweather(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
|
@ -7411,14 +7390,6 @@ static void Cmd_trysetrest(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_0x82(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0x83(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool8 UproarWakeUpCheck(enum BattlerId battler)
|
||||
{
|
||||
enum BattlerId i;
|
||||
|
|
@ -7489,12 +7460,6 @@ static void Cmd_stockpile(void)
|
|||
|
||||
static void Cmd_stockpiletobasedamage(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
||||
if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
|
||||
gBattleScripting.animTurn = gBattleMons[gBattlerAttacker].volatiles.stockpileCounter;
|
||||
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_stockpiletohpheal(void)
|
||||
|
|
@ -7527,28 +7492,6 @@ static void Cmd_stockpiletohpheal(void)
|
|||
}
|
||||
}
|
||||
|
||||
void BS_RemoveStockpileCounters(void)
|
||||
{
|
||||
NATIVE_ARGS();
|
||||
|
||||
if (GetMoveEffect(gCurrentMove) == EFFECT_SPIT_UP
|
||||
&& gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT
|
||||
&& IsBattlerAlive(gBattlerTarget))
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].volatiles.stockpileCounter = 0;
|
||||
BattleScriptPush(cmd->nextInstr);
|
||||
gBattlescriptCurrInstr = BattleScript_MoveEffectStockpileWoreOff;
|
||||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_0x88(void)
|
||||
{
|
||||
}
|
||||
|
||||
static u16 ReverseStatChangeMoveEffect(u16 moveEffect)
|
||||
{
|
||||
switch (moveEffect)
|
||||
|
|
@ -8693,22 +8636,6 @@ static void Cmd_setcalledmove(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0x9f(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xA0(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xA1(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xA2(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_disablelastusedattack(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -8949,10 +8876,6 @@ static void Cmd_copymovepermanently(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xA9(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool32 IsDanamaxMonPresent(void)
|
||||
{
|
||||
for (enum BattlerId battler = 0; battler < gBattlersCount; battler++)
|
||||
|
|
@ -8967,14 +8890,6 @@ static inline bool32 IsDanamaxMonPresent(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void Cmd_unused_AA(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xab(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_settailwind(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -9231,10 +9146,6 @@ static void Cmd_trysetperishsong(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xb3(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_jumpifconfusedandstatmaxed(void)
|
||||
{
|
||||
CMD_ARGS(u8 stat, const u8 *jumpInstr);
|
||||
|
|
@ -9246,10 +9157,6 @@ static void Cmd_jumpifconfusedandstatmaxed(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xb5(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_setembargo(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -9336,52 +9243,6 @@ static void Cmd_setsafeguard(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_magnitudedamagecalculation(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
||||
u32 magnitude = RandomUniform(RNG_MAGNITUDE, 0, 99);
|
||||
|
||||
if (magnitude < 5)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 10;
|
||||
magnitude = 4;
|
||||
}
|
||||
else if (magnitude < 15)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 30;
|
||||
magnitude = 5;
|
||||
}
|
||||
else if (magnitude < 35)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 50;
|
||||
magnitude = 6;
|
||||
}
|
||||
else if (magnitude < 65)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 70;
|
||||
magnitude = 7;
|
||||
}
|
||||
else if (magnitude < 85)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 90;
|
||||
magnitude = 8;
|
||||
}
|
||||
else if (magnitude < 95)
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 110;
|
||||
magnitude = 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleStruct->magnitudeBasePower = 150;
|
||||
magnitude = 10;
|
||||
}
|
||||
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 2, magnitude)
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_jumpifnopursuitswitchdmg(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *jumpInstr);
|
||||
|
|
@ -9508,10 +9369,6 @@ static void Cmd_rapidspinfree(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xBF(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_recoverbasedonsunlight(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -9633,22 +9490,6 @@ static void Cmd_setfutureattack(void)
|
|||
|
||||
static void Cmd_trydobeatup(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *endInstr, const u8 *failInstr);
|
||||
|
||||
if (!IsBattlerAlive(gBattlerTarget))
|
||||
{
|
||||
gMultiHitCounter = 0;
|
||||
gBattlescriptCurrInstr = cmd->endInstr;
|
||||
}
|
||||
else if (gBattleStruct->beatUpSlot == 0 && gMultiHitCounter == 0)
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->failInstr;
|
||||
}
|
||||
else
|
||||
{
|
||||
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattleStruct->beatUpSpecies[gBattleStruct->beatUpSlot])
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
}
|
||||
|
||||
static void Cmd_setsemiinvulnerablebit(void)
|
||||
|
|
@ -9667,18 +9508,6 @@ static void Cmd_setsemiinvulnerablebit(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xC6(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xC7(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_c8(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_trymemento(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -9718,14 +9547,6 @@ static void Cmd_setforcedtarget(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xcb(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xCC(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_curestatuswithmove(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -9768,10 +9589,6 @@ static void Cmd_settorment(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xCF(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_settaunt(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -10080,10 +9897,6 @@ static void Cmd_setyawn(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused0xd8(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void HandleRoomMove(u32 statusFlag, u16 *timer, u8 stringId)
|
||||
{
|
||||
if (gFieldStatuses & statusFlag)
|
||||
|
|
@ -10249,10 +10062,6 @@ static void Cmd_trysetvolatile(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xde(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_trysetmagiccoat(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -10284,10 +10093,6 @@ static void Cmd_trysetsnatch(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused2(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_switchoutabilities(void)
|
||||
{
|
||||
CMD_ARGS(u8 battler);
|
||||
|
|
@ -10349,10 +10154,6 @@ static void Cmd_jumpifhasnohp(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xE4(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_pickup(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
|
@ -10427,14 +10228,6 @@ static void Cmd_pickup(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xE6(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xE7(void)
|
||||
{
|
||||
}
|
||||
|
||||
// Water and Mud Sport
|
||||
static void Cmd_settypebasedhalvers(void)
|
||||
{
|
||||
|
|
@ -10640,10 +10433,6 @@ static void Cmd_snatchsetbattlers(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_unused_0xee(void)
|
||||
{
|
||||
}
|
||||
|
||||
u8 GetCatchingBattler(void)
|
||||
{
|
||||
if (IsBattlerAlive(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)))
|
||||
|
|
@ -11659,7 +11448,7 @@ static void Cmd_tryoverwriteability(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void Cmd_unused_1(void)
|
||||
static void Cmd_dummy(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -12817,21 +12606,6 @@ void BS_JumpIfSleepClause(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
void BS_FickleBeamDamageCalculation(void)
|
||||
{
|
||||
NATIVE_ARGS();
|
||||
|
||||
if (RandomPercentage(RNG_FICKLE_BEAM, 30))
|
||||
{
|
||||
gBattleStruct->fickleBeamBoosted = TRUE;
|
||||
gBattlescriptCurrInstr = BattleScript_FickleBeamDoubled;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
}
|
||||
|
||||
void BS_TryTarShot(void)
|
||||
{
|
||||
NATIVE_ARGS(const u8 *failInstr);
|
||||
|
|
@ -15055,7 +14829,7 @@ void BS_CutOneThirdHpAndRaiseStats(void)
|
|||
|
||||
void BS_SetPoltergeistMessage(void)
|
||||
{
|
||||
NATIVE_ARGS(const u8 *failInstr);
|
||||
NATIVE_ARGS();
|
||||
PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].item);
|
||||
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
|
||||
[EFFECT_SNORE] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectSnore,
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 3,
|
||||
},
|
||||
|
||||
|
|
@ -715,7 +715,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
|
||||
[EFFECT_MAGNITUDE] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectMagnitude,
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 1,
|
||||
},
|
||||
|
||||
|
|
@ -826,7 +826,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
|
||||
[EFFECT_BEAT_UP] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectBeatUp,
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 2,
|
||||
},
|
||||
|
||||
|
|
@ -876,7 +876,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
|
||||
[EFFECT_SPIT_UP] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectSpitUp,
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 3,
|
||||
.encourageEncore = TRUE,
|
||||
},
|
||||
|
|
@ -1198,7 +1198,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
|
||||
[EFFECT_NATURAL_GIFT] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectNaturalGift,
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 0, // TODO: Assign points
|
||||
.encourageEncore = TRUE,
|
||||
},
|
||||
|
|
@ -2125,7 +2125,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
|
||||
[EFFECT_FICKLE_BEAM] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectFickleBeam,
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 0, // TODO: Assign points
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -6806,6 +6806,10 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_ALL] =
|
|||
.target = TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.category = DAMAGE_CATEGORY_PHYSICAL,
|
||||
.additionalEffects = ADDITIONAL_EFFECTS({
|
||||
.moveEffect = MOVE_EFFECT_BEAT_UP_MESSAGE,
|
||||
.preAttackEffect = TRUE,
|
||||
}),
|
||||
.contestEffect = C_UPDATED_MOVE_EFFECTS >= GEN_6 ? CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION : CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS,
|
||||
.contestCategory = CONTEST_CATEGORY_SMART,
|
||||
.contestComboStarterId = 0,
|
||||
|
|
|
|||
|
|
@ -35,3 +35,4 @@ SINGLE_BATTLE_TEST("Bide deals twice the taken damage over two turns")
|
|||
|
||||
TO_DO_BATTLE_TEST("Bide hits the last Pokémon that attacked the user, even allies");
|
||||
TO_DO_BATTLE_TEST("Bide has +1 priority if called via a different move"); // Gen 5 onwards
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,23 @@
|
|||
#include "global.h"
|
||||
#include "test/battle.h"
|
||||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
ASSUME(GetMoveEffect(MOVE_MAGNITUDE) == EFFECT_MAGNITUDE);
|
||||
}
|
||||
|
||||
TO_DO_BATTLE_TEST("TODO: Write Magnitude (Move Effect) test titles")
|
||||
|
||||
SINGLE_BATTLE_TEST("Magnitude message is printed before failing because of Levitate")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_FLYGON) { Ability(ABILITY_LEVITATE); }
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_MAGNITUDE); }
|
||||
} SCENE {
|
||||
MESSAGE("Magnitude 10!");
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_MAGNITUDE, player);
|
||||
ABILITY_POPUP(opponent, ABILITY_LEVITATE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ SINGLE_BATTLE_TEST("Snore fails if not asleep")
|
|||
TURN { MOVE(player, MOVE_SNORE); }
|
||||
} SCENE {
|
||||
if (status == STATUS1_SLEEP) {
|
||||
MESSAGE("Wobbuffet is fast asleep.");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SNORE, player);
|
||||
NOT MESSAGE("But it failed!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,3 +272,42 @@ DOUBLE_BATTLE_TEST("Stockpile's Def and Sp. Def boost is lost after using Spit U
|
|||
EXPECT_MUL_EQ(results[2].dmgSpecialBefore, UQ_4_12(1.0), results[2].dmgSpecialAfter);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Spit Up's Stockpile's are romoved if move is absorbed")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_PIKACHU) { Ability(ABILITY_LIGHTNING_ROD); }
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_STOCKPILE); }
|
||||
TURN { MOVE(opponent, MOVE_ELECTRIFY); MOVE(player, MOVE_SPIT_UP); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STOCKPILE, player);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIFY, opponent);
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIT_UP, player);
|
||||
ABILITY_POPUP(opponent, ABILITY_LIGHTNING_ROD);
|
||||
} THEN {
|
||||
EXPECT_EQ(player->statStages[STAT_DEF], DEFAULT_STAT_STAGE);
|
||||
EXPECT_EQ(player->statStages[STAT_SPDEF], DEFAULT_STAT_STAGE);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Spit Up's Stockpile's are romoved if hit into Protect")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(GetMoveEffect(MOVE_PROTECT) == EFFECT_PROTECT);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_STOCKPILE); }
|
||||
TURN { MOVE(opponent, MOVE_PROTECT); MOVE(player, MOVE_SPIT_UP); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STOCKPILE, player);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, opponent);
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIT_UP, player);
|
||||
} THEN {
|
||||
EXPECT_EQ(player->statStages[STAT_DEF], DEFAULT_STAT_STAGE);
|
||||
EXPECT_EQ(player->statStages[STAT_SPDEF], DEFAULT_STAT_STAGE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user