Merge pull request #391 from DizzyEggg/decompile_battle_3

(Don't merge yet) Decompile battle 3
This commit is contained in:
Cameron Hall 2017-07-29 14:48:33 -05:00 committed by GitHub
commit ea36898775
12 changed files with 6882 additions and 12207 deletions

View File

@ -262,7 +262,7 @@ _08012538:
.4byte _08012968
.4byte _0801292C
_0801256C:
bl sub_8015C90
bl AreAllMovesUnusable
lsls r0, 24
cmp r0, 0
beq _080125D0
@ -3558,7 +3558,7 @@ _08014044:
str r0, [r2]
movs r0, 0xA5
movs r1, 0
bl sub_801B5C0
bl GetMoveTarget
ldrb r1, [r7]
ldr r2, _080140EC @ =0x00016010
adds r1, r2
@ -3646,7 +3646,7 @@ _08014138:
strb r0, [r3]
ldrh r0, [r1]
movs r1, 0
bl sub_801B5C0
bl GetMoveTarget
ldrb r1, [r7]
ldr r4, _0801419C @ =0x00016010
adds r1, r4
@ -3702,7 +3702,7 @@ _080141A0:
strb r0, [r1, 0xE]
ldrh r0, [r3]
movs r1, 0
bl sub_801B5C0
bl GetMoveTarget
ldrb r1, [r7]
ldr r3, _08014214 @ =0x00016010
adds r1, r3
@ -3740,7 +3740,7 @@ _08014218:
strh r3, [r1]
ldrh r0, [r1]
movs r1, 0
bl sub_801B5C0
bl GetMoveTarget
ldr r2, _08014270 @ =0x02000000
ldrb r1, [r4]
ldr r3, _08014274 @ =0x00016010

File diff suppressed because it is too large Load Diff

View File

@ -1168,7 +1168,7 @@ MoveEffect_Recharge: @ 81D7943
setbyte 0x2024d21, 221
jump BattleScript_1D6F42
gUnknown_081D7956:: @ 81D7956
BattleScript_MoveUsedMustRecharge:: @ 81D7956
printstring BATTLE_TEXT_MustRecharge
waitmessage 64
jump BattleScript_EndTurn
@ -3311,7 +3311,7 @@ gUnknown_081D9041:: @ 81D9041
waitmessage 64
end2
gUnknown_081D904B:: @ 81D904B
BattleScript_LeechSeedTurnDrain:: @ 81D904B
playanimation USER, 14, 0x20160a4
orword 0x2024c6c, 0x100100
graphicalhpupdate USER
@ -3335,12 +3335,12 @@ BattleScript_1D9083: @ 81D9083
faintpokemon TARGET, 0, 0x0
end2
gUnknown_081D90A7:: @ 81D90A7
BattleScript_BideStoringEnergy:: @ 81D90A7
printstring BATTLE_TEXT_StoringEnergy
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D90B2:: @ 81D90B2
BattleScript_BideAttack:: @ 81D90B2
printstring BATTLE_TEXT_UnleashedEnergy
waitmessage 64
accuracycheck BattleScript_1D6F77, 0
@ -3361,7 +3361,7 @@ gUnknown_081D90B2:: @ 81D90B2
faintpokemon TARGET, 0, 0x0
jump BattleScript_EndTurn
gUnknown_081D90F1:: @ 81D90F1
BattleScript_BideNoEnergyToAttack:: @ 81D90F1
printstring BATTLE_TEXT_UnleashedEnergy
waitmessage 64
jump BattleScript_ButItFailed
@ -3396,21 +3396,21 @@ gUnknown_081D9132:: @ 81D9132
waitmessage 64
return
gUnknown_081D9139:: @ 81D9139
BattleScript_MoveUsedIsDisabled:: @ 81D9139
printstring BATTLE_TEXT_MoveIsDisabled
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D9144:: @ 81D9144
BattleScript_MoveSelectionDisabledMove:: @ 81D9144
printstring2 BATTLE_TEXT_MoveIsDisabled
atk44
gUnknown_081D9148:: @ 81D9148
BattleScript_DisabledNoMore:: @ 81D9148
printstring BATTLE_TEXT_DisabledNoMore
waitmessage 64
end2
gUnknown_081D914F:: @ 81D914F
BattleScript_EncoredNoMore:: @ 81D914F
printstring BATTLE_TEXT_EncoreEnded
waitmessage 64
end2
@ -3471,7 +3471,7 @@ BattleScript_1D91FB: @ 81D91FB
waitmessage 64
return
gUnknown_081D9202:: @ 81D9202
BattleScript_PerishSongHits:: @ 81D9202
printstring BATTLE_TEXT_PerishSongFell
waitmessage 64
orword 0x2024c6c, 0x100100
@ -3480,7 +3480,7 @@ gUnknown_081D9202:: @ 81D9202
faintpokemon USER, 0, 0x0
end2
gUnknown_081D921D:: @ 81D921D
BattleScript_PerishSongTimerGoesDown:: @ 81D921D
printstring BATTLE_TEXT_PerishSongFell
waitmessage 64
end2
@ -3546,7 +3546,7 @@ BattleScript_SpikesFree:: @ 81D92D0
waitmessage 64
return
gUnknown_081D92D7:: @ 81D92D7
BattleScript_FutureSightHits:: @ 81D92D7
printstring BATTLE_TEXT_TookAttack
waitmessage 64
jumpifbyte 1, 0x2024d23, 0, BattleScript_1D92F4
@ -3593,11 +3593,11 @@ BattleScript_1D934B: @ 81D934B
setbyte 0x2024c68, 0
end2
gUnknown_081D9365:: @ 81D9365
BattleScript_NoMovesLeft:: @ 81D9365
printstring2 BATTLE_TEXT_NoMovesLeft
atk44
gUnknown_081D9369:: @ 81D9369
BattleScript_MoveSelectionNoPP:: @ 81D9369
printstring2 BATTLE_TEXT_NoPP1
atk44
@ -3608,23 +3608,23 @@ BattleScript_NoPPForMove:: @ 81D936D
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D937C:: @ 81D937C
BattleScript_MoveSelectionTormented:: @ 81D937C
printstring2 BATTLE_TEXT_TormentNoUse
atk44
printstring BATTLE_TEXT_TormentNoUse
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D938B:: @ 81D938B
BattleScript_MoveSelectionTaunted:: @ 81D938B
printstring2 BATTLE_TEXT_TauntNoUse
atk44
gUnknown_081D938F:: @ 81D938F
BattleScript_MoveUsedIsTaunted:: @ 81D938F
printstring BATTLE_TEXT_TauntNoUse
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D939A:: @ 81D939A
BattleScript_WishComesTrue:: @ 81D939A
atkd4 1, BattleScript_1D93C1
playanimation TARGET, 22, 0x0
printstring BATTLE_TEXT_WishTrue
@ -3644,7 +3644,7 @@ BattleScript_1D93C1: @ 81D93C1
waitmessage 64
end2
gUnknown_081D93D1:: @ 81D93D1
BattleScript_IngrainTurnHeal:: @ 81D93D1
playanimation USER, 21, 0x0
printstring BATTLE_TEXT_AbsorbNutrients
waitmessage 64
@ -3686,12 +3686,12 @@ BattleScript_KnockedOff:: @ 81D944B
waitmessage 64
return
gUnknown_081D9459:: @ 81D9459
BattleScript_MoveUsedIsImprisoned:: @ 81D9459
printstring BATTLE_TEXT_SealedNoUse
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D9464:: @ 81D9464
BattleScript_MoveSelectionImprisoned:: @ 81D9464
printstring2 BATTLE_TEXT_SealedNoUse
atk44
@ -3751,13 +3751,13 @@ gUnknown_081D94DA:: @ 81D94DA
waitmessage 64
end2
gUnknown_081D94EE:: @ 81D94EE
BattleScript_MoveUsedIsAsleep:: @ 81D94EE
printstring BATTLE_TEXT_FastAsleep
waitmessage 64
statusanimation USER
jump BattleScript_EndTurn
gUnknown_081D94FB:: @ 81D94FB
BattleScript_MoveUsedWokeUp:: @ 81D94FB
bicword 0x2024c6c, 0x10
printfromtable BattleTextList_401562
waitmessage 64
@ -3770,7 +3770,7 @@ gUnknown_081D950F:: @ 81D950F
atk98 1
end2
gUnknown_081D9518:: @ 81D9518
BattleScript_PoisonTurnDmg:: @ 81D9518
printstring BATTLE_TEXT_PoisonHurt
waitmessage 64
@ -3787,18 +3787,18 @@ BattleScript_1D9520: @ 81D9520
BattleScript_1D9539: @ 81D9539
end2
gUnknown_081D953A:: @ 81D953A
BattleScript_BurnTurnDmg:: @ 81D953A
printstring BATTLE_TEXT_BurnHurt
waitmessage 64
jump BattleScript_1D951E
gUnknown_081D9545:: @ 81D9545
BattleScript_MoveUsedIsFrozen:: @ 81D9545
printstring BATTLE_TEXT_FrozenSolid
waitmessage 64
statusanimation USER
jump BattleScript_EndTurn
gUnknown_081D9552:: @ 81D9552
BattleScript_MoveUsedUnfroze:: @ 81D9552
printfromtable BattleTextList_4015C4
waitmessage 64
atk98 1
@ -3810,13 +3810,13 @@ gUnknown_081D955D:: @ 81D955D
atk98 0
return
gUnknown_081D9566:: @ 81D9566
BattleScript_MoveUsedIsParalyzed:: @ 81D9566
printstring BATTLE_TEXT_Paralyzed3
waitmessage 64
statusanimation USER
jump BattleScript_EndTurn
gUnknown_081D9573:: @ 81D9573
BattleScript_MoveUsedFlinched:: @ 81D9573
printstring BATTLE_TEXT_Flinched
waitmessage 64
jump BattleScript_EndTurn
@ -3826,13 +3826,13 @@ gUnknown_081D957E:: @ 81D957E
waitmessage 64
end2
gUnknown_081D9587:: @ 81D9587
BattleScript_ThrashConfuses:: @ 81D9587
atk66 1, 1, S_CONFUSED
printstring BATTLE_TEXT_FatigueConfuse
waitmessage 64
end2
gUnknown_081D9595:: @ 81D9595
BattleScript_MoveUsedIsConfused:: @ 81D9595
printstring BATTLE_TEXT_Confused
waitmessage 64
atk65 1, 0x7
@ -3855,7 +3855,7 @@ BattleScript_1D95AC: @ 81D95AC
BattleScript_1D95D3: @ 81D95D3
return
gUnknown_081D95D4:: @ 81D95D4
BattleScript_MoveUsedIsConfusedNoMore:: @ 81D95D4
printstring BATTLE_TEXT_ConfusionSnapOut
waitmessage 64
return
@ -3865,35 +3865,35 @@ gUnknown_081D95DB:: @ 81D95DB
waitmessage 64
return
gUnknown_081D95E2:: @ 81D95E2
BattleScript_WrapTurnDmg:: @ 81D95E2
playanimation USER, 6, 0x20160a4
printstring BATTLE_TEXT_HurtBy
waitmessage 64
jump BattleScript_1D9520
gUnknown_081D95F4:: @ 81D95F4
BattleScript_WrapEnds:: @ 81D95F4
printstring BATTLE_TEXT_FreedFrom
waitmessage 64
end2
gUnknown_081D95FB:: @ 81D95FB
BattleScript_MoveUsedIsInLove:: @ 81D95FB
printstring BATTLE_TEXT_InLoveWith
waitmessage 64
atk65 1, 0xf0000
return
gUnknown_081D9608:: @ 81D9608
BattleScript_MoveUsedIsParalyzedCantAttack:: @ 81D9608
printstring BATTLE_TEXT_ImmobilizedBy
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D9613:: @ 81D9613
BattleScript_NightmareTurnDmg:: @ 81D9613
printstring BATTLE_TEXT_NightmareLock
waitmessage 64
atk65 1, Start
jump BattleScript_1D9520
gUnknown_081D9624:: @ 81D9624
BattleScript_CurseTurnDmg:: @ 81D9624
printstring BATTLE_TEXT_CurseAfflict
waitmessage 64
atk65 1, 0x10000000
@ -3915,7 +3915,7 @@ BattleScript_1D9648: @ 81D9648
waitstateatk
return
gUnknown_081D964C:: @ 81D964C
BattleScript_YawnMakesAsleep:: @ 81D964C
statusanimation 2
printstring BATTLE_TEXT_FellAsleep
waitmessage 64
@ -3996,7 +3996,7 @@ BattleScript_ItemSteal:: @ 81D96F6
waitmessage 64
return
gUnknown_081D9704:: @ 81D9704
BattleScript_DrizzleActivates:: @ 81D9704
pause 32
printstring BATTLE_TEXT_RainMade
waitstateatk
@ -4004,19 +4004,19 @@ gUnknown_081D9704:: @ 81D9704
callatk BattleScript_1D9761
end3
gUnknown_081D9718:: @ 81D9718
BattleScript_SpeedBoostActivates:: @ 81D9718
playanimation USER, 1, 0x20160a4
printstring BATTLE_TEXT_SpeedRisen
waitmessage 64
end3
gUnknown_081D9726:: @ 81D9726
BattleScript_TraceActivates:: @ 81D9726
pause 32
printstring BATTLE_TEXT_Traced
waitmessage 64
end3
gUnknown_081D9730:: @ 81D9730
BattleScript_RainDishActivates:: @ 81D9730
printstring BATTLE_TEXT_RestoredHPByItem
waitmessage 64
orword 0x2024c6c, 0x100
@ -4024,7 +4024,7 @@ gUnknown_081D9730:: @ 81D9730
datahpupdate USER
end3
gUnknown_081D9744:: @ 81D9744
BattleScript_SandstreamActivates:: @ 81D9744
pause 32
printstring BATTLE_TEXT_WhipSandstorm
waitstateatk
@ -4032,7 +4032,7 @@ gUnknown_081D9744:: @ 81D9744
callatk BattleScript_1D9761
end3
gUnknown_081D9758:: @ 81D9758
BattleScript_ShedSkinActivates:: @ 81D9758
printstring BATTLE_TEXT_CuredProblem
waitmessage 64
atk98 1
@ -4047,7 +4047,7 @@ BattleScript_1D9767: @ 81D9767
jumpifarraynotequal 0x2016003, 0x2024a68, 1, BattleScript_1D9767
return
gUnknown_081D977D:: @ 81D977D
BattleScript_CastformChange:: @ 81D977D
callatk BattleScript_1D9783
end3
@ -4095,7 +4095,7 @@ BattleScript_1D97F0: @ 81D97F0
waitmessage 64
jump BattleScript_1D97E4
gUnknown_081D97FE:: @ 81D97FE
BattleScript_DroughtActivates:: @ 81D97FE
pause 32
printstring BATTLE_TEXT_SunIntensified
waitstateatk
@ -4123,10 +4123,10 @@ gUnknown_081D9834:: @ 81D9834
pause 64
jump BattleScript_EndTurn
gUnknown_081D9842:: @ 81D9842
BattleScript_MoveHPDrain_PPLoss:: @ 81D9842
ppreduce
gUnknown_081D9843:: @ 81D9843
BattleScript_MoveHPDrain:: @ 81D9843
attackstring
pause 32
orword 0x2024c6c, 0x100
@ -4137,10 +4137,10 @@ gUnknown_081D9843:: @ 81D9843
orbyte 0x2024c68, 8
jump BattleScript_EndTurn
gUnknown_081D9865:: @ 81D9865
BattleScript_MoveHPDrain_FullHP_PPLoss:: @ 81D9865
ppreduce
gUnknown_081D9866:: @ 81D9866
BattleScript_MoveHPDrain_FullHP:: @ 81D9866
attackstring
pause 32
printstring BATTLE_TEXT_MadeUseless
@ -4148,10 +4148,10 @@ gUnknown_081D9866:: @ 81D9866
orbyte 0x2024c68, 8
jump BattleScript_EndTurn
gUnknown_081D987B:: @ 81D987B
BattleScript_FlashFireBoost_PPLoss:: @ 81D987B
ppreduce
gUnknown_081D987C:: @ 81D987C
BattleScript_FlashFireBoost:: @ 81D987C
attackstring
pause 32
printfromtable BattleTextList_401648
@ -4206,7 +4206,7 @@ BattleScript_1D98E5: @ 81D98E5
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D98F3:: @ 81D98F3
BattleScript_SoundproofProtected:: @ 81D98F3
attackstring
ppreduce
pause 32
@ -4227,12 +4227,12 @@ BattleScript_NoItemSteal:: @ 81D9913
waitmessage 64
jump BattleScript_EndTurn
gUnknown_081D9921:: @ 81D9921
BattleScript_ColorChangeActivates:: @ 81D9921
printstring BATTLE_TEXT_MadeType
waitmessage 64
return
gUnknown_081D9928:: @ 81D9928
BattleScript_RoughSkinActivates:: @ 81D9928
orword 0x2024c6c, 0x100100
graphicalhpupdate USER
datahpupdate USER
@ -4241,18 +4241,18 @@ gUnknown_081D9928:: @ 81D9928
faintpokemon USER, 0, 0x0
return
gUnknown_081D9943:: @ 81D9943
BattleScript_CuteCharmActivates:: @ 81D9943
atk65 1, 0xf0000
printstring BATTLE_TEXT_InfatuatedPoke
waitmessage 64
return
gUnknown_081D9950:: @ 81D9950
BattleScript_ApplySecondaryEffect:: @ 81D9950
waitstateatk
seteffectuser
return
gUnknown_081D9953:: @ 81D9953
BattleScript_SynchronizeActivates:: @ 81D9953
waitstateatk
seteffecttarget
return
@ -4275,7 +4275,7 @@ gUnknown_081D996F:: @ 81D996F
waitmessage 64
jumptoattack TARGET
gUnknown_081D9977:: @ 81D9977
BattleScript_MoveUsedLoafingAround:: @ 81D9977
printfromtable BattleTextList_40160E
waitmessage 64
setbyte 0x201600c, 0
@ -4301,11 +4301,11 @@ BattleScript_SubstituteFade:: @ 81D99AB
printstring BATTLE_TEXT_SubFaded
return
gUnknown_081D99B6:: @ 81D99B6
callatk gUnknown_081D99BC
BattleScript_BerryCurePrlzEnd2:: @ 81D99B6
callatk BattleScript_BerryCureParRet
end2
gUnknown_081D99BC:: @ 81D99BC
BattleScript_BerryCureParRet:: @ 81D99BC
playanimation 10, 7, 0x0
printstring BATTLE_TEXT_CuredParalysis
waitmessage 64
@ -4313,11 +4313,11 @@ gUnknown_081D99BC:: @ 81D99BC
removeitem 10
return
gUnknown_081D99CE:: @ 81D99CE
callatk gUnknown_081D99D4
BattleScript_BerryCurePsnEnd2:: @ 81D99CE
callatk BattleScript_BerryCurePsnRet
end2
gUnknown_081D99D4:: @ 81D99D4
BattleScript_BerryCurePsnRet:: @ 81D99D4
playanimation 10, 7, 0x0
printstring BATTLE_TEXT_CuredPoison
waitmessage 64
@ -4325,11 +4325,11 @@ gUnknown_081D99D4:: @ 81D99D4
removeitem 10
return
gUnknown_081D99E6:: @ 81D99E6
callatk gUnknown_081D99EC
BattleScript_BerryCureBrnEnd2:: @ 81D99E6
callatk BattleScript_BerryCureBrnRet
end2
gUnknown_081D99EC:: @ 81D99EC
BattleScript_BerryCureBrnRet:: @ 81D99EC
playanimation 10, 7, 0x0
printstring BATTLE_TEXT_CuredBurn
waitmessage 64
@ -4337,11 +4337,11 @@ gUnknown_081D99EC:: @ 81D99EC
removeitem 10
return
gUnknown_081D99FE:: @ 81D99FE
callatk gUnknown_081D9A04
BattleScript_BerryCureFrzEnd2:: @ 81D99FE
callatk BattleScript_BerryCureFrzRet
end2
gUnknown_081D9A04:: @ 81D9A04
BattleScript_BerryCureFrzRet:: @ 81D9A04
playanimation 10, 7, 0x0
printstring BATTLE_TEXT_CuredFreeze
waitmessage 64
@ -4349,11 +4349,11 @@ gUnknown_081D9A04:: @ 81D9A04
removeitem 10
return
gUnknown_081D9A16:: @ 81D9A16
callatk gUnknown_081D9A1C
BattleScript_BerryCureSlpEnd2:: @ 81D9A16
callatk BattleScript_BerryCureSlpRet
end2
gUnknown_081D9A1C:: @ 81D9A1C
BattleScript_BerryCureSlpRet:: @ 81D9A1C
playanimation 10, 7, 0x0
printstring BATTLE_TEXT_CuredSleep
waitmessage 64
@ -4361,11 +4361,11 @@ gUnknown_081D9A1C:: @ 81D9A1C
removeitem 10
return
gUnknown_081D9A2E:: @ 81D9A2E
callatk gUnknown_081D9A34
BattleScript_BerryCureConfusionEnd2:: @ 81D9A2E
callatk BattleScript_BerryCureConfusionRet
end2
gUnknown_081D9A34:: @ 81D9A34
BattleScript_BerryCureConfusionRet:: @ 81D9A34
playanimation 10, 7, 0x0
printstring BATTLE_TEXT_CuredConfusion
waitmessage 64
@ -4384,18 +4384,18 @@ gUnknown_081D9A4A:: @ 81D9A4A
removeitem 10
return
gUnknown_081D9A5E:: @ 81D9A5E
callatk gUnknown_081D9A64
BattleScript_WhiteHerbEnd2:: @ 81D9A5E
callatk BattleScript_WhiteHerbRet
end2
gUnknown_081D9A64:: @ 81D9A64
BattleScript_WhiteHerbRet:: @ 81D9A64
playanimation 10, 7, 0x0
printstring BATTLE_TEXT_RestoredStatus
waitmessage 64
removeitem 10
return
gUnknown_081D9A74:: @ 81D9A74
BattleScript_ItemHealHP_RemoveItem:: @ 81D9A74
playanimation USER, 7, 0x0
printstring BATTLE_TEXT_RestoredHealth
waitmessage 64
@ -4405,18 +4405,18 @@ gUnknown_081D9A74:: @ 81D9A74
removeitem USER
end2
gUnknown_081D9A91:: @ 81D9A91
BattleScript_BerryPPHealEnd2:: @ 81D9A91
playanimation USER, 7, 0x0
printstring BATTLE_TEXT_RestoredPP
waitmessage 64
removeitem USER
end2
gUnknown_081D9AA1:: @ 81D9AA1
callatk gUnknown_081D9AA7
BattleScript_ItemHealHP_End2:: @ 81D9AA1
callatk BattleScript_ItemHealHP_Ret
end2
gUnknown_081D9AA7:: @ 81D9AA7
BattleScript_ItemHealHP_Ret:: @ 81D9AA7
playanimation USER, 7, 0x0
printstring BATTLE_TEXT_RestoredHPLittle
waitmessage 64
@ -4425,7 +4425,7 @@ gUnknown_081D9AA7:: @ 81D9AA7
datahpupdate USER
return
gUnknown_081D9AC2:: @ 81D9AC2
BattleScript_MoveSelectionChoiceBanded:: @ 81D9AC2
printstring2 BATTLE_TEXT_ChoiceBand
atk44
@ -4435,7 +4435,7 @@ BattleScript_HangedOnMsg:: @ 81D9AC6
waitmessage 64
return
gUnknown_081D9AD4:: @ 81D9AD4
BattleScript_BerryConfuseHealEnd2:: @ 81D9AD4
playanimation USER, 7, 0x0
printstring BATTLE_TEXT_RestoredHealth
waitmessage 64
@ -4449,7 +4449,7 @@ gUnknown_081D9AD4:: @ 81D9AD4
removeitem USER
end2
gUnknown_081D9AFE:: @ 81D9AFE
BattleScript_BerryStatRaiseEnd2:: @ 81D9AFE
playanimation USER, 7, 0x0
statbuffchange 65, BattleScript_1D9B0B
@ -4459,7 +4459,7 @@ BattleScript_1D9B0B: @ 81D9B0B
removeitem USER
end2
gUnknown_081D9B19:: @ 81D9B19
BattleScript_BerryFocusEnergyEnd2:: @ 81D9B19
playanimation USER, 7, 0x0
printstring BATTLE_TEXT_HustleUse
waitmessage 64

View File

@ -1015,7 +1015,7 @@ gUnknown_081FA71F:: @ 81FA71F
.byte 4, 4, 4, 4
.align 1
gUnknown_081FA724:: @ 81FA724
gSoundMovesTable:: @ 81FA724
.2byte 0x2D
.2byte 0x2E
.2byte 0x2F

View File

@ -286,11 +286,3 @@ gLinkOpponentBufferCommands:: @ 81FB048
@ 81FB12C
.include "data/battle_moves.inc"
.align 2
gUnknown_081FC1D0:: @ 81FC1D0
.2byte 0x34, 0x10, 0x101
.space 2
.2byte -1, -1, -1
.space 2

View File

@ -34,8 +34,13 @@
#define STATUS_FREEZE 0x20
#define STATUS_PARALYSIS 0x40
#define STATUS_TOXIC_POISON 0x80
#define STATUS_TOXIC_COUNTER 0xF00
#define STATUS_PSN_ANY ((STATUS_POISON | STATUS_TOXIC_POISON))
#define STATUS_ANY ((STATUS_SLEEP | STATUS_POISON | STATUS_BURN | STATUS_FREEZE | STATUS_PARALYSIS | STATUS_TOXIC_POISON))
#define STATUS2_CONFUSION 0x00000007
#define STATUS2_FLINCHED 0x00000008
#define STATUS2_UPROAR 0x00000070
#define STATUS2_BIDE 0x00000300 //two bits 0x100 0x200
#define STATUS2_LOCK_CONFUSE 0x00000C00
@ -71,6 +76,8 @@
#define STATUS3_MUDSPORT 0x10000
#define STATUS3_WATERSPORT 0x20000
#define STATUS3_UNDERWATER 0x40000
#define STATUS3_INTIMIDATE_POKES 0x80000
#define STATUS3_TRACE 0x100000
#define STATUS3_SEMI_INVULNERABLE ((STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER))
@ -87,8 +94,9 @@
#define HITMARKER_IGNORE_ON_AIR 0x00010000
#define HITMARKER_IGNORE_UNDERGROUND 0x00020000
#define HITMARKER_IGNORE_UNDERWATER 0x00040000
#define HITMARKER_x80000 0x00080000
#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000
#define HITMARKER_x100000 0x00100000
#define HITMARKER_x200000 0x00200000
#define HITMARKER_x400000 0x00400000
#define HITMARKER_x800000 0x00800000
#define HITMARKER_GRUDGE 0x01000000
@ -99,12 +107,47 @@
#define SIDE_STATUS_REFLECT (1 << 0)
#define SIDE_STATUS_LIGHTSCREEN (1 << 1)
#define SIDE_STATUS_X4 (1 << 2)
#define SIDE_STATUS_SPIKES (1 << 4)
#define SIDE_STATUS_SAFEGUARD (1 << 5)
#define SIDE_STATUS_FUTUREATTACK (1 << 6)
#define SIDE_STATUS_MIST (1 << 8)
#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
#define ABILITYEFFECT_ON_SWITCHIN 0x0
#define ABILITYEFFECT_ENDTURN 0x1
#define ABILITYEFFECT_MOVES_BLOCK 0x2
#define ABILITYEFFECT_ABSORBING 0x3
#define ABILITYEFFECT_CONTACT 0x4
#define ABILITYEFFECT_IMMUNITY 0x5
#define ABILITYEFFECT_FORECAST 0x6
#define ABILITYEFFECT_SYNCHRONIZE 0x7
#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
#define ABILITYEFFECT_INTIMIDATE1 0x9
#define ABILITYEFFECT_INTIMIDATE2 0xA
#define ABILITYEFFECT_TRACE 0xB
#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
#define ABILITYEFFECT_FIELD_SPORT 0xE
#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF
#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0)))
#define MOVESTATUS_MISSED (1 << 0)
#define MOVESTATUS_SUPEREFFECTIVE (1 << 1)
#define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2)
#define MOVESTATUS_NOTAFFECTED (1 << 3)
#define MOVESTATUS_ONEHITKO (1 << 4)
#define MOVESTATUS_FAILED (1 << 5)
#define MOVESTATUS_ENDURED (1 << 6)
#define MOVESTATUS_HUNGON (1 << 7)
#define MOVESTATUS_NOEFFECT ((MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED))
#define MAX_TRAINER_ITEMS 4
#define MAX_MON_MOVES 4
#define MAX_BANKS_BATTLE 4
@ -172,14 +215,16 @@ struct BattleStruct /* 0x2000000 */
u8 filler0[0x15DDE];
/*0x15DDE*/ u8 unk15DDE;
/*0x15DDF*/ u8 unk15DDF;
/*0x15DE0*/ u8 filler15DE0[0x222];
/*0x15DE0*/ u8 filler15DE0[0x220];
/*0x16000*/ u8 turnEffectsTracker;
/*0x16001*/ u8 turnEffectsBank;
/*0x16002*/ u8 animTurn;
/*0x16003*/ u8 scriptingActive;
/*0x16004*/ u8 wrappedMove1[4];
/*0x16008*/ u8 wrappedMove2[4];
/*0x1600C*/ u8 cmd49StateTracker;
/*0x1600D*/ u8 unk1600D;
/*0x1600E*/ u8 unk1600E;
/*0x1600E*/ u8 turncountersTracker;
/*0x1600F*/ u8 cmd23StateTracker;
/*0x16010*/ u8 moveTarget[4];
/*0x16014*/ u8 unk16014;
@ -248,7 +293,7 @@ struct BattleStruct /* 0x2000000 */
/*0x16056*/ u8 moneyMultiplier;
/*0x16057*/ u8 unk16057;
/*0x16058*/ u8 unk16058;
/*0x16059*/ u8 unk16059;
/*0x16059*/ u8 sub80173A4_Tracker;
/*0x1605A*/ u8 unk1605A;
/*0x1605B*/ u8 unk1605B;
/*0x1605C*/ u16 exp;
@ -269,10 +314,7 @@ struct BattleStruct /* 0x2000000 */
/*0x1608A*/ u8 unk1608A;
/*0x1608B*/ u8 unk1608B;
/*0x1608C*/ u8 ChosenMoveID[4];
/*0x16090*/ u8 unk16090;
/*0x16091*/ u8 unk16091;
/*0x16092*/ u8 unk16092;
/*0x16093*/ u8 unk16093;
/*0x16090*/ s32 bideDmg;
/*0x16094*/ u8 unk16094;
/*0x16095*/ u8 unk16095;
/*0x16096*/ u8 unk16096;
@ -327,7 +369,84 @@ struct BattleStruct /* 0x2000000 */
/*0x160CA*/ u8 synchroniseEffect;
/*0x160CB*/ u8 linkPlayerIndex;
/*0x160CC*/ u16 usedHeldItems[4];
u8 filler2[0x72E];
/*0x160D4*/ u8 unk160D4;
/*0x160D5*/ u8 unk160D5;
/*0x160D6*/ u8 unk160D6;
/*0x160D7*/ u8 unk160D7;
/*0x160D8*/ u8 unk160D8;
/*0x160D9*/ u8 unk160D9;
/*0x160DA*/ u8 unk160DA;
/*0x160DB*/ u8 unk160DB;
/*0x160DC*/ u8 unk160DC;
/*0x160DD*/ u8 intimidateBank;
/*0x160DE*/ u8 unk160DE;
/*0x160DF*/ u8 unk160DF;
/*0x160E0*/ u8 unk160E0;
/*0x160E1*/ u8 unk160E1;
/*0x160E2*/ u8 unk160E2;
/*0x160E3*/ u8 unk160E3;
/*0x160E4*/ u8 unk160E4;
/*0x160E5*/ u8 unk160E5;
/*0x160E6*/ u8 unk160E6;
/*0x160E7*/ u8 atkCancellerTracker;
/*0x160E8*/ u8 unk160E8;
/*0x160E9*/ u8 unk160E9;
/*0x160EA*/ u8 unk160EA;
/*0x160EB*/ u8 unk160EB;
/*0x160EC*/ u8 unk160EC;
/*0x160ED*/ u8 unk160ED;
/*0x160EE*/ u8 unk160EE;
/*0x160EF*/ u8 unk160EF;
/*0x160F0*/ u8 unk160F0;
/*0x160F1*/ u8 unk160F1;
/*0x160F2*/ u8 unk160F2;
/*0x160F3*/ u8 unk160F3;
/*0x160F4*/ u8 unk160F4;
/*0x160F5*/ u8 unk160F5;
/*0x160F6*/ u8 unk160F6;
/*0x160F7*/ u8 unk160F7;
/*0x160F8*/ u8 unk160F8;
/*0x160F9*/ u8 unk160F9;
/*0x160FA*/ u8 unk160FA;
/*0x160FB*/ u8 unk160FB;
/*0x160FC*/ u8 turnSideTracker;
/*0x160FD*/ u8 unk160FD;
/*0x160FE*/ u8 unk160FE;
/*0x160FF*/ u8 unk160FF;
/*0x16100*/ u8 unk16100;
/*0x16101*/ u8 unk16101;
/*0x16102*/ u8 unk16102;
/*0x16103*/ u8 unk16103;
/*0x16104*/ u8 unk16104;
/*0x16105*/ u8 unk16105;
/*0x16106*/ u8 unk16106;
/*0x16107*/ u8 unk16107;
/*0x16108*/ u8 unk16108;
/*0x16109*/ u8 unk16109;
/*0x1610A*/ u8 unk1610A;
/*0x1610B*/ u8 unk1610B;
/*0x1610C*/ u8 unk1610C;
/*0x1610D*/ u8 unk1610D;
/*0x1610E*/ u8 unk1610E;
/*0x1610F*/ u8 unk1610F;
/*0x16110*/ u8 sub80170DC_Tracker;
/*0x16111*/ u8 sub80170DC_Bank;
/*0x16112*/ u8 unk16112;
/*0x16113*/ u8 unk16113;
/*0x16114*/ u8 unk16114;
/*0x16115*/ u8 unk16115;
/*0x16116*/ u8 unk16116;
/*0x16117*/ u8 unk16117;
/*0x16118*/ u8 unk16118;
/*0x16119*/ u8 unk16119;
/*0x1611A*/ u8 unk1611A;
/*0x1611B*/ u8 unk1611B;
/*0x1611C*/ u8 unk1611C;
/*0x1611D*/ u8 unk1611D;
/*0x1611E*/ u8 unk1611E;
/*0x1611F*/ u8 unk1611F;
//u8 filler2[0x72E];
/* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2;
};
@ -482,9 +601,9 @@ struct SpecialStatus
u8 flag40 : 1;
u8 focusBanded : 1;
u8 field1[3];
u32 moveturnLostHP;
u32 moveturnLostHP_physical;
u32 moveturnLostHP_special;
s32 moveturnLostHP;
s32 moveturnLostHP_physical;
s32 moveturnLostHP_special;
u8 moveturnPhysicalBank;
u8 moveturnSpecialBank;
u8 field12;
@ -497,8 +616,7 @@ struct sideTimer
u8 lightscreenTimer; //0x1
u8 mistTimer; //0x2
u8 field3; //0x3
u8 field4; //0x4
u8 field5; //0x5
u16 field4; //0x4
u8 spikesAmount; //0x6
u8 safeguardTimer; //0x7
u8 followmeTimer; //0x8
@ -516,7 +634,7 @@ struct WishFutureKnock
u8 wishCounter[MAX_BANKS_BATTLE];
u8 wishUserID[MAX_BANKS_BATTLE];
u8 weatherDuration;
u8 knockedOffPokes[2];
u16 knockedOffPokes;
};
extern struct UnkBattleStruct1 unk_2016A00;
@ -532,15 +650,19 @@ extern struct Struct20238C8 gUnknown_020238C8;
// TODO: move ewram to global.h
extern u8 ewram[];
#define BATTLE_STRUCT ((struct BattleStruct *) (ewram + 0x00000))
#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(ewram + 0x16800))
#define UNK_2016A00_STRUCT ((struct UnkBattleStruct1 *) (ewram + 0x16A00))
#define AI_STACK ((struct AI_Stack *) (ewram + 0x16C00))
#define AI_ARRAY_160CC ((struct SmallItemStruct *) (ewram + 0x160CC))
#define B_FUNCTION_STACK ((struct funcStack *) (ewram + 0x17140))
#define ewram17800 ((struct Struct2017800 *) (ewram + 0x17800))
#define ewram17810 ((struct Struct2017810 *) (ewram + 0x17810))
#define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840))
#define BATTLE_STRUCT ((struct BattleStruct *) (ewram + 0x00000))
#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(ewram + 0x16800))
#define UNK_2016A00_STRUCT ((struct UnkBattleStruct1 *) (ewram + 0x16A00))
#define AI_STACK ((struct AI_Stack *) (ewram + 0x16C00))
#define AI_ARRAY_160CC ((struct SmallItemStruct *) (ewram + 0x160CC))
#define B_BATTLESCRIPTS_STACK ((struct scriptsStack *) (ewram + 0x17110))
#define B_FUNCTION_STACK ((struct funcStack *) (ewram + 0x17140))
#define ewram17800 ((struct Struct2017800 *) (ewram + 0x17800))
#define ewram17810 ((struct Struct2017810 *) (ewram + 0x17810))
#define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840))
#define ewram17000 ((u32 *) (ewram + 0x17100))
typedef void (*BattleCmdFunc)(void);
struct funcStack
{
@ -548,6 +670,12 @@ struct funcStack
u8 size;
};
struct scriptsStack
{
u8* ptr[8];
u8 size;
};
extern u8 gBattleTextBuff1[];
//function declarations of buffer emits
@ -650,19 +778,19 @@ void TurnValuesCleanUp(u8);
void SpecialStatusesClear(void);
void sub_80138F0(void);
void sub_80155A4();
void CancelMultiTurnMoves(u8);
void CancelMultiTurnMoves(u8 bank);
void PrepareStringBattle();
void sub_80156DC();
void sub_80157C4(u8 index);
// asm/battle_3.o
u8 sub_8015A98(u8, u8, u8);
u8 UpdateTurnCounters();
u8 TurnBasedEffects();
u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check);
u8 UpdateTurnCounters(void);
u8 TurnBasedEffects(void);
u8 sub_80170DC();
u8 sub_80173A4();
u8 AbilityBattleEffects(u8, u8, u8, u8, u16);
u8 ItemBattleEffects();
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 move);
u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn);
// asm/battle_4.o
void AI_CalcDmg(u8, u8);

View File

@ -408,9 +408,11 @@ struct BattleMove
u8 pad[3];
};
#define FLAG_MAKES_CONTACT 0x1
#define FLAG_PROTECT_AFFECTED 0x2
#define FLAG_MAGICCOAT_AFFECTED 0x4
#define FLAG_SNATCH_AFFECTED 0x8
#define FLAG_KINGSROCK_AFFECTED 0x20
struct PokemonStorage
{

View File

@ -53,7 +53,7 @@ SECTIONS {
asm/battle_1.o(.text_800DC24);
src/battle_2.o(.text);
asm/battle_2.o(.text);
asm/battle_3.o(.text);
src/battle_3.o(.text);
src/battle_4.o(.text);
asm/battle_5.o(.text);
src/battle_6.o(.text);
@ -332,6 +332,7 @@ SECTIONS {
data/data2a.o(.rodata);
src/battle_4.o(.rodata);
data/data2b.o(.rodata);
src/battle_3.o(.rodata);
src/pokemon_data.o(.rodata);
. = ALIGN(4);
src/trig.o(.rodata);

6595
src/battle_3.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -95,13 +95,13 @@ extern u16 gUnknown_02024C4C[4]; //last used moves by banks, another one
extern u8 gCurrentMoveTurn;
//extern functions
bool8 CantUseMove(void);
u8 AtkCanceller_UnableToUseMove(void);
void PressurePPLose(u8 bank_atk, u8 bank_def, u16 move);
void CancelMultiTurnMoves(u8 bank);
void b_movescr_stack_push(u8* BS_ptr);
void b_movescr_stack_push_cursor(void);
void RecordAbilityBattle(u8 bank, u8 ability);
void RecordItemBattle(u8 bank, u8 item);
void RecordItemBattle(u8 bank, u8 holdEffect);
int IsPokeDisobedient(void);
static bool8 IsTwoTurnsMove(u16 move);
static void DestinyBondFlagUpdate(void);
@ -150,16 +150,16 @@ bool8 sub_8014AB8(u8 bank); //can run from battle
u8 CountAliveMons(u8 caseID);
void sub_803E1B0(struct Pokemon*, u16 item, u8 partyID, u8 r3, u8 sp);
u8 CanRunFromBattle(void);
u8 sub_801B5C0(u16 move, u8 targetbyte); //get target of move
u8 GetMoveTarget(u16 move, u8 targetbyte); //get target of move
void sub_80153D0(u8 atk); //pressure perish song pp decrement
u8 castform_switch(u8 bank);
u8 CastformDataTypeChange(u8 bank);
void b_push_move_exec(u8* bs_ptr);
u8 sav1_map_get_light_level(void);
u8 CalculatePlayerPartyCount(void);
u16 Sqrt(u32 num);
u8 sub_809070C(u16 nationalNum, u32 TiD, u32 PiD); //task prepare poke dex display
void sub_814A880(u8 a1, u8 a2);
u8 sub_8015A98(u8 bank, u8 unusable_moves, u8 flags); //choose move limitations
u8 CheckMoveLimitations(u8 bank, u8 unusable_moves, u8 flags);
void sub_801529C(u8 bank);
bool8 IsLinkDoubleBattle(void);
void sub_8094B6C(u8 bank, u8 partyID, u8 r2);
@ -207,7 +207,7 @@ extern u8 BattleScript_1D6F44[]; //present dmg
extern u8 BattleScript_1D83B5[]; //present full hp
extern u8 BattleScript_1D839B[]; //present hp heal
extern u8 BattleScript_1D6F74[];
extern u8 gUnknown_081D977D[]; //castform change bs
extern u8 BattleScript_CastformChange[];
extern u8 gUnknown_081D9834[];
extern u8 gUnknown_081D90FC[]; //bs random switchout
extern u8 gUnknown_081D95DB[]; //bs payday money give
@ -223,31 +223,8 @@ extern u8 gUnknown_081D95DB[]; //bs payday money give
#define BS2ScriptRead16(ptr) ((ptr)[0] + ((ptr)[1] << 8))
#define BS2ScriptReadPtr(ptr) ((void *)BS2ScriptRead32(ptr))
#define MOVESTATUS_MISSED (1 << 0)
#define MOVESTATUS_SUPEREFFECTIVE (1 << 1)
#define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2)
#define MOVESTATUS_NOTAFFECTED (1 << 3)
#define MOVESTATUS_ONEHITKO (1 << 4)
#define MOVESTATUS_FAILED (1 << 5)
#define MOVESTATUS_ENDURED (1 << 6)
#define MOVESTATUS_HUNGON (1 << 7)
#define MOVESTATUS_NOEFFECT ((MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED))
#define TargetProtectAffected ((gProtectStructs[gBankTarget].protected && gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED))
#define ABILITYEFFECT_CONTACT 0x4
#define ABILITYEFFECT_IMMUNITY 0x5
#define ABILITYEFFECT_SYNCHRONIZE 0x7
#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
//array entries for battle communication
#define MOVE_EFFECT_BYTE 0x3
#define MULTISTRING_CHOOSER 0x5
@ -299,7 +276,6 @@ extern u8 gUnknown_081D95DB[]; //bs payday money give
#define RecordAbilitySetField6(ability, fieldValue) \
(gLastUsedAbility = ability, gBattleCommunication[6] = fieldValue, RecordAbilityBattle(gBankTarget, ability))
#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0)))
#define TARGET_TURN_DAMAGED (((gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_physical.moveturnLostHP_special)))
#define HP_ON_SWITCHOUT (((u16*)(0x020160bc)))
@ -553,8 +529,6 @@ static void atkF5_removeattackerstatus1(void);
static void atkF6_802BF48(void);
static void atkF7_802BF54(void);
typedef void (*BattleCmdFunc)(void);
const BattleCmdFunc gBattleScriptingCommandsTable[] =
{
atk00_attackcanceler,
@ -1061,11 +1035,11 @@ static void atk00_attackcanceler(void)
}
if (gBattleMons[gBankAttacker].hp == 0 && !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
{
gHitMarker |= HITMARKER_x80000;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
gBattlescriptCurrInstr = BattleScript_EndTurn;
return;
}
if (CantUseMove())
if (AtkCanceller_UnableToUseMove())
return;
if (AbilityBattleEffects(2, gBankTarget, 0, 0, 0))
return;
@ -5217,7 +5191,7 @@ static void atk15_seteffectwithchancetarget(void)
else
gBattlescriptCurrInstr++;
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
BATTLE_STRUCT->filler2[0x3E] = 0; //TODO: to fix this later
BATTLE_STRUCT->unk16112 = 0;
}
static void atk16_seteffectprimary(void)
@ -5240,7 +5214,7 @@ static void atk18_status_effect_clear(void)
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
gBattlescriptCurrInstr += 2;
BATTLE_STRUCT->filler2[0x3E] = 0; //TODO: to fix this later
BATTLE_STRUCT->unk16112 = 0;
}
//Fuck this, Maybe later
@ -10144,7 +10118,7 @@ static void atk4D_switch_data_update(void)
gBattleTextBuff1[1] = 7;
gBattleTextBuff1[2] = gActiveBank;
gBattleTextBuff1[3] = gBattlePartyID[gActiveBank];
gBattleTextBuff1[4] = 0xFF;
gBattleTextBuff1[4] = EOS;
gBattlescriptCurrInstr += 2;
}
@ -12788,7 +12762,7 @@ static void atk76_various(void)
gBattleCommunication[0] = CanRunFromBattle();
break;
case 3:
gBankTarget = sub_801B5C0(gCurrentMove, 0);
gBankTarget = GetMoveTarget(gCurrentMove, 0);
break;
case 4:
if (gHitMarker & HITMARKER_FAINTED(gActiveBank))
@ -12964,7 +12938,7 @@ static void atk7C_8025508(void)
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gCurrentMove = r7;
gBankTarget = sub_801B5C0(gCurrentMove, 0);
gBankTarget = GetMoveTarget(gCurrentMove, 0);
gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect];
}
else if (r6 != 0 && r5 != 0 && r6 != 0xFFFF && r5 != 0xFFFF)
@ -12974,21 +12948,21 @@ static void atk7C_8025508(void)
gCurrentMove = r6;
else
gCurrentMove = r5;
gBankTarget = sub_801B5C0(gCurrentMove, 0);
gBankTarget = GetMoveTarget(gCurrentMove, 0);
gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect];
}
else if (r6 != 0 && r6 != 0xFFFF)
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gCurrentMove = r6;
gBankTarget = sub_801B5C0(gCurrentMove, 0);
gBankTarget = GetMoveTarget(gCurrentMove, 0);
gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect];
}
else if (r5 != 0 && r5 != 0xFFFF)
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gCurrentMove = r5;
gBankTarget = sub_801B5C0(gCurrentMove, 0);
gBankTarget = GetMoveTarget(gCurrentMove, 0);
gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect];
}
else
@ -13113,7 +13087,7 @@ static void atk83_nop(void)
gBattlescriptCurrInstr++;
}
bool8 sub_8025A44(u8 bank) //uproar wakeup check
bool8 UproarWakeUpCheck(u8 bank)
{
int i;
for (i = 0; i < gNoOfAllBanks; i++)
@ -13138,7 +13112,7 @@ bool8 sub_8025A44(u8 bank) //uproar wakeup check
static void atk84_jump_if_cant_sleep(void)
{
u8* jump_loc = BSScriptReadPtr(gBattlescriptCurrInstr + 1);
if (sub_8025A44(gBankTarget))
if (UproarWakeUpCheck(gBankTarget))
gBattlescriptCurrInstr = jump_loc;
else if (gBattleMons[gBankTarget].ability == ABILITY_INSOMNIA || gBattleMons[gBankTarget].ability == ABILITY_VITAL_SPIRIT)
{
@ -14962,7 +14936,7 @@ static void atk9E_metronome(void)
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gBattlescriptCurrInstr = gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect];
gBankTarget = sub_801B5C0(gCurrentMove, 0);
gBankTarget = GetMoveTarget(gCurrentMove, 0);
}
#else
@ -15028,7 +15002,7 @@ _080278F8:\n\
str r0, [r1]\n\
ldrh r0, [r4]\n\
movs r1, 0\n\
bl sub_801B5C0\n\
bl GetMoveTarget\n\
ldr r1, _0802795C @ =gBankTarget\n\
strb r0, [r1]\n\
pop {r3}\n\
@ -15582,7 +15556,7 @@ static void atkA9_sleeptalk_choose_move(void)
|| gBattleMons[gBankAttacker].moves[i] == MOVE_UPROAR || IsTwoTurnsMove(gBattleMons[gBankAttacker].moves[i]))
unusable_moves |= gBitTable[i];
}
unusable_moves = sub_8015A98(gBankAttacker, unusable_moves, 0xFD);
unusable_moves = CheckMoveLimitations(gBankAttacker, unusable_moves, 0xFD);
if (unusable_moves == 0xF) //all 4 moves cannot be chosen
gBattlescriptCurrInstr += 5;
else //at least one move can be chosen
@ -15596,7 +15570,7 @@ static void atkA9_sleeptalk_choose_move(void)
gRandomMove = gBattleMons[gBankAttacker].moves[random_pos];
gCurrMovePos = random_pos;
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gBankTarget = sub_801B5C0(gRandomMove, 0);
gBankTarget = GetMoveTarget(gRandomMove, 0);
gBattlescriptCurrInstr = BSScriptReadPtr(gBattlescriptCurrInstr + 1);
}
}
@ -16710,7 +16684,7 @@ static void atkCC_callterrainattack(void) //nature power
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gCurrentMove = sNaturePowerMoves[gBattleTerrain];
gBankTarget = sub_801B5C0(gCurrentMove, 0);
gBankTarget = GetMoveTarget(gCurrentMove, 0);
b_movescr_stack_push(gBattleScriptsEffectsTable[gBattleMoves[gCurrentMove].effect]);
gBattlescriptCurrInstr++;
}
@ -17333,7 +17307,7 @@ static void atkDE_asistattackselect(void)
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gRandomMove = BATTLE_STRUCT->assistMove[Random() % chooseable_moves_no];
gBankTarget = sub_801B5C0(gRandomMove, 0);
gBankTarget = GetMoveTarget(gRandomMove, 0);
gBattlescriptCurrInstr += 5;
}
else
@ -17477,7 +17451,7 @@ _0802AB54:\n\
strh r0, [r4]\n\
ldrh r0, [r4]\n\
movs r1, 0\n\
bl sub_801B5C0\n\
bl GetMoveTarget\n\
ldr r1, _0802ABC4 @ =gBankTarget\n\
strb r0, [r1]\n\
ldr r1, _0802ABC8 @ =gBattlescriptCurrInstr\n\
@ -17678,10 +17652,10 @@ static void atkE7_castform_data_change(void)
{
u8 form;
gBattlescriptCurrInstr++;
form = castform_switch(BATTLE_STRUCT->scriptingActive);
form = CastformDataTypeChange(BATTLE_STRUCT->scriptingActive);
if (form)
{
b_push_move_exec(gUnknown_081D977D);
b_push_move_exec(BattleScript_CastformChange);
BATTLE_STRUCT->castformToChangeInto = form - 1;
}
}

View File

@ -301,7 +301,7 @@ void BattleAI_SetupAIData(void)
for (i = 0; i < MAX_MON_MOVES; i++)
AI_THINKING_STRUCT->score[i] = 100;
r7 = sub_8015A98(gActiveBank, 0, 0xFF);
r7 = CheckMoveLimitations(gActiveBank, 0, 0xFF);
// probably sets up the moves to consider and ignores non-valid moves such as NO_MOVE or glitch moves.
for (i = 0; i < MAX_MON_MOVES; i++)

View File

@ -1219,7 +1219,7 @@ s8 sub_8040A54(struct Pokemon *mon, u8 a2)
return gPokeblockFlavorCompatibilityTable[nature * 5 + a2];
}
s8 sub_8040A7C(u32 personality, u8 a2)
s8 GetPokeFlavourRelation(u32 personality, u8 a2)
{
u8 nature = GetNatureFromPersonality(personality);
return gPokeblockFlavorCompatibilityTable[nature * 5 + a2];