mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Document some single-remaining symbols
This commit is contained in:
parent
09fd4fc4c5
commit
a66d7e1b43
@ -1275,8 +1275,8 @@
|
|||||||
various \battler, VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP
|
various \battler, VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro various7 battler:req
|
.macro resetplayerfainted
|
||||||
various \battler, 7
|
various BS_ATTACKER, VARIOUS_RESET_PLAYER_FAINTED
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro palaceflavortext battler:req
|
.macro palaceflavortext battler:req
|
||||||
@ -1303,12 +1303,12 @@
|
|||||||
various \battler, VARIOUS_EMIT_YESNOBOX
|
various \battler, VARIOUS_EMIT_YESNOBOX
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro various14 battler:req
|
.macro arenadrawreftextbox
|
||||||
various \battler, 14
|
various BS_ATTACKER, VARIOUS_DRAW_ARENA_REF_TEXT_BOX
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro various15 battler:req
|
.macro arenaerasereftextbox
|
||||||
various \battler, 15
|
various BS_ATTACKER, VARIOUS_ERASE_ARENA_REF_TEXT_BOX
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro arenajudgmentstring id:req
|
.macro arenajudgmentstring id:req
|
||||||
@ -1340,11 +1340,11 @@
|
|||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro setalreadystatusedmoveattempt battler:req
|
.macro setalreadystatusedmoveattempt battler:req
|
||||||
various \battler, 23
|
various \battler, VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro various24 battler:req
|
.macro palacetryescapestatus battler:req
|
||||||
various \battler, 24
|
various \battler, VARIOUS_PALACE_TRY_ESCAPE_STATUS
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro setoutcomeonteleport battler:req
|
.macro setoutcomeonteleport battler:req
|
||||||
|
@ -1 +1 @@
|
|||||||
gUnneededFireRedVariable
|
gWindowTileAutoAllocEnabled
|
||||||
|
@ -3514,7 +3514,7 @@ Move_MEMENTO:
|
|||||||
delay 48
|
delay 48
|
||||||
playsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER
|
playsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER
|
||||||
waitforvisualfinish
|
waitforvisualfinish
|
||||||
createvisualtask sub_8114470, 2
|
createvisualtask AnimTask_MementoHandleBg, 2
|
||||||
delay 12
|
delay 12
|
||||||
setalpha 0, 16
|
setalpha 0, 16
|
||||||
delay 1
|
delay 1
|
||||||
|
@ -2828,7 +2828,7 @@ BattleScript_HandleFaintedMon::
|
|||||||
atk24 BattleScript_HandleFaintedMonMultiple
|
atk24 BattleScript_HandleFaintedMonMultiple
|
||||||
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd
|
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd
|
||||||
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChooseAnother
|
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChooseAnother
|
||||||
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonTryChooseAnother
|
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonTryChooseAnother
|
||||||
printstring STRINGID_USENEXTPKMN
|
printstring STRINGID_USENEXTPKMN
|
||||||
setbyte gBattleCommunication, 0
|
setbyte gBattleCommunication, 0
|
||||||
yesnobox
|
yesnobox
|
||||||
@ -2843,7 +2843,7 @@ BattleScript_FaintedMonTryChooseAnother::
|
|||||||
jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonChooseAnother
|
jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonChooseAnother
|
||||||
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother
|
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother
|
||||||
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother
|
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother
|
||||||
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonChooseAnother
|
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonChooseAnother
|
||||||
jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonChooseAnother
|
jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonChooseAnother
|
||||||
jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonChooseAnother
|
jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonChooseAnother
|
||||||
printstring STRINGID_ENEMYABOUTTOSWITCHPKMN
|
printstring STRINGID_ENEMYABOUTTOSWITCHPKMN
|
||||||
@ -2881,7 +2881,7 @@ BattleScript_FaintedMonChooseAnother::
|
|||||||
hidepartystatussummary BS_FAINTED
|
hidepartystatussummary BS_FAINTED
|
||||||
switchinanim BS_FAINTED, FALSE
|
switchinanim BS_FAINTED, FALSE
|
||||||
waitstate
|
waitstate
|
||||||
various7 BS_ATTACKER
|
resetplayerfainted
|
||||||
switchineffects BS_FAINTED
|
switchineffects BS_FAINTED
|
||||||
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonEnd
|
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonEnd
|
||||||
cancelallactions
|
cancelallactions
|
||||||
@ -3200,7 +3200,7 @@ BattleScript_DamagingWeatherLoop::
|
|||||||
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
|
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
|
||||||
printfromtable gSandStormHailDmgStringIds
|
printfromtable gSandStormHailDmgStringIds
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||||
effectivenesssound
|
effectivenesssound
|
||||||
hitanimation BS_ATTACKER
|
hitanimation BS_ATTACKER
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
@ -3212,7 +3212,7 @@ BattleScript_DamagingWeatherLoopIncrement::
|
|||||||
addbyte gBattleCommunication, 1
|
addbyte gBattleCommunication, 1
|
||||||
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
||||||
BattleScript_DamagingWeatherContinuesEnd::
|
BattleScript_DamagingWeatherContinuesEnd::
|
||||||
bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
|
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_SandStormHailEnds::
|
BattleScript_SandStormHailEnds::
|
||||||
@ -3256,7 +3256,7 @@ BattleScript_SafeguardEnds::
|
|||||||
|
|
||||||
BattleScript_LeechSeedTurnDrain::
|
BattleScript_LeechSeedTurnDrain::
|
||||||
playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1
|
playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
copyword gBattleMoveDamage, gHpDealt
|
copyword gBattleMoveDamage, gHpDealt
|
||||||
@ -3267,7 +3267,7 @@ BattleScript_LeechSeedTurnDrain::
|
|||||||
BattleScript_LeechSeedTurnPrintLiquidOoze::
|
BattleScript_LeechSeedTurnPrintLiquidOoze::
|
||||||
setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE
|
setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE
|
||||||
BattleScript_LeechSeedTurnPrintAndUpdateHp::
|
BattleScript_LeechSeedTurnPrintAndUpdateHp::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_TARGET
|
healthbarupdate BS_TARGET
|
||||||
datahpupdate BS_TARGET
|
datahpupdate BS_TARGET
|
||||||
printfromtable gLeechSeedStringIds
|
printfromtable gLeechSeedStringIds
|
||||||
@ -3371,14 +3371,14 @@ BattleScript_EncoredNoMore::
|
|||||||
BattleScript_DestinyBondTakesLife::
|
BattleScript_DestinyBondTakesLife::
|
||||||
printstring STRINGID_PKMNTOOKFOE
|
printstring STRINGID_PKMNTOOKFOE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_SpikesOnAttacker::
|
BattleScript_SpikesOnAttacker::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
call BattleScript_PrintHurtBySpikes
|
call BattleScript_PrintHurtBySpikes
|
||||||
@ -3393,7 +3393,7 @@ BattleScript_SpikesOnAttackerFainted::
|
|||||||
goto BattleScript_HandleFaintedMon
|
goto BattleScript_HandleFaintedMon
|
||||||
|
|
||||||
BattleScript_SpikesOnTarget::
|
BattleScript_SpikesOnTarget::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_TARGET
|
healthbarupdate BS_TARGET
|
||||||
datahpupdate BS_TARGET
|
datahpupdate BS_TARGET
|
||||||
call BattleScript_PrintHurtBySpikes
|
call BattleScript_PrintHurtBySpikes
|
||||||
@ -3408,7 +3408,7 @@ BattleScript_SpikesOnTargetFainted::
|
|||||||
goto BattleScript_HandleFaintedMon
|
goto BattleScript_HandleFaintedMon
|
||||||
|
|
||||||
BattleScript_SpikesOnFaintedBattler::
|
BattleScript_SpikesOnFaintedBattler::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_FAINTED
|
healthbarupdate BS_FAINTED
|
||||||
datahpupdate BS_FAINTED
|
datahpupdate BS_FAINTED
|
||||||
call BattleScript_PrintHurtBySpikes
|
call BattleScript_PrintHurtBySpikes
|
||||||
@ -3430,7 +3430,7 @@ BattleScript_PrintHurtBySpikes::
|
|||||||
BattleScript_PerishSongTakesLife::
|
BattleScript_PerishSongTakesLife::
|
||||||
printstring STRINGID_PKMNPERISHCOUNTFELL
|
printstring STRINGID_PKMNPERISHCOUNTFELL
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
@ -3662,7 +3662,7 @@ BattleScript_MagicCoatBounce::
|
|||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
printstring STRINGID_PKMNMOVEBOUNCED
|
printstring STRINGID_PKMNMOVEBOUNCED
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000
|
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_ALLOW_NO_PP
|
||||||
setmagiccoattarget BS_ATTACKER
|
setmagiccoattarget BS_ATTACKER
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -3673,7 +3673,7 @@ BattleScript_SnatchedMove::
|
|||||||
playanimation BS_TARGET, B_ANIM_SNATCH_MOVE, NULL
|
playanimation BS_TARGET, B_ANIM_SNATCH_MOVE, NULL
|
||||||
printstring STRINGID_PKMNSNATCHEDMOVE
|
printstring STRINGID_PKMNSNATCHEDMOVE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000
|
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_ALLOW_NO_PP
|
||||||
swapattackerwithtarget
|
swapattackerwithtarget
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -3713,7 +3713,7 @@ BattleScript_MoveUsedIsAsleep::
|
|||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_MoveUsedWokeUp::
|
BattleScript_MoveUsedWokeUp::
|
||||||
bicword gHitMarker, HITMARKER_x10
|
bicword gHitMarker, HITMARKER_WAKE_UP_CLEAR
|
||||||
printfromtable gWokeUpStringIds
|
printfromtable gWokeUpStringIds
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
updatestatusicon BS_ATTACKER
|
updatestatusicon BS_ATTACKER
|
||||||
@ -3731,7 +3731,7 @@ BattleScript_PoisonTurnDmg::
|
|||||||
BattleScript_DoStatusTurnDmg::
|
BattleScript_DoStatusTurnDmg::
|
||||||
statusanimation BS_ATTACKER
|
statusanimation BS_ATTACKER
|
||||||
BattleScript_DoTurnDmg::
|
BattleScript_DoTurnDmg::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
@ -3798,7 +3798,7 @@ BattleScript_DoSelfConfusionDmg::
|
|||||||
effectivenesssound
|
effectivenesssound
|
||||||
hitanimation BS_ATTACKER
|
hitanimation BS_ATTACKER
|
||||||
waitstate
|
waitstate
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
resultmessage
|
resultmessage
|
||||||
@ -3931,7 +3931,7 @@ BattleScript_MoveEffectRecoil::
|
|||||||
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
|
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
|
||||||
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
|
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
|
||||||
BattleScript_DoRecoil::
|
BattleScript_DoRecoil::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
printstring STRINGID_PKMNHITWITHRECOIL
|
printstring STRINGID_PKMNHITWITHRECOIL
|
||||||
@ -4174,7 +4174,7 @@ BattleScript_ColorChangeActivates::
|
|||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_RoughSkinActivates::
|
BattleScript_RoughSkinActivates::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
printstring STRINGID_PKMNHURTSWITH
|
printstring STRINGID_PKMNHURTSWITH
|
||||||
@ -4222,9 +4222,10 @@ BattleScript_IgnoresAndUsesRandomMove::
|
|||||||
jumptocalledmove FALSE
|
jumptocalledmove FALSE
|
||||||
|
|
||||||
BattleScript_MoveUsedLoafingAround::
|
BattleScript_MoveUsedLoafingAround::
|
||||||
|
@ Skip ahead if not the Battle Palace message
|
||||||
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER, BattleScript_MoveUsedLoafingAroundMsg
|
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER, BattleScript_MoveUsedLoafingAroundMsg
|
||||||
setbyte gBattleCommunication, 0
|
setbyte gBattleCommunication, 0
|
||||||
various24 BS_ATTACKER
|
palacetryescapestatus BS_ATTACKER
|
||||||
setbyte cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER
|
setbyte cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER
|
||||||
BattleScript_MoveUsedLoafingAroundMsg::
|
BattleScript_MoveUsedLoafingAroundMsg::
|
||||||
printfromtable gInobedientStringIds
|
printfromtable gInobedientStringIds
|
||||||
@ -4442,22 +4443,22 @@ BattleScript_ArenaTurnBeginning::
|
|||||||
playse SE_ARENA_TIMEUP1
|
playse SE_ARENA_TIMEUP1
|
||||||
pause 8
|
pause 8
|
||||||
playse SE_ARENA_TIMEUP1
|
playse SE_ARENA_TIMEUP1
|
||||||
various14 BS_ATTACKER
|
arenadrawreftextbox
|
||||||
arenajudgmentstring B_MSG_REF_COMMENCE_BATTLE
|
arenajudgmentstring B_MSG_REF_COMMENCE_BATTLE
|
||||||
arenawaitmessage B_MSG_REF_COMMENCE_BATTLE
|
arenawaitmessage B_MSG_REF_COMMENCE_BATTLE
|
||||||
pause B_WAIT_TIME_LONG
|
pause B_WAIT_TIME_LONG
|
||||||
various15 BS_ATTACKER
|
arenaerasereftextbox
|
||||||
volumeup
|
volumeup
|
||||||
end2
|
end2
|
||||||
|
|
||||||
@ Unused
|
@ Unused
|
||||||
BattleScript_ArenaNothingDecided::
|
BattleScript_ArenaNothingDecided::
|
||||||
playse SE_DING_DONG
|
playse SE_DING_DONG
|
||||||
various14 BS_ATTACKER
|
arenadrawreftextbox
|
||||||
arenajudgmentstring B_MSG_REF_NOTHING_IS_DECIDED
|
arenajudgmentstring B_MSG_REF_NOTHING_IS_DECIDED
|
||||||
arenawaitmessage B_MSG_REF_NOTHING_IS_DECIDED
|
arenawaitmessage B_MSG_REF_NOTHING_IS_DECIDED
|
||||||
pause B_WAIT_TIME_LONG
|
pause B_WAIT_TIME_LONG
|
||||||
various15 BS_ATTACKER
|
arenaerasereftextbox
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_ArenaDoJudgment::
|
BattleScript_ArenaDoJudgment::
|
||||||
@ -4470,7 +4471,7 @@ BattleScript_ArenaDoJudgment::
|
|||||||
pause 8
|
pause 8
|
||||||
playse SE_ARENA_TIMEUP1
|
playse SE_ARENA_TIMEUP1
|
||||||
pause B_WAIT_TIME_LONG
|
pause B_WAIT_TIME_LONG
|
||||||
various14 BS_ATTACKER
|
arenadrawreftextbox
|
||||||
arenajudgmentstring B_MSG_REF_THATS_IT
|
arenajudgmentstring B_MSG_REF_THATS_IT
|
||||||
arenawaitmessage B_MSG_REF_THATS_IT
|
arenawaitmessage B_MSG_REF_THATS_IT
|
||||||
pause B_WAIT_TIME_LONG
|
pause B_WAIT_TIME_LONG
|
||||||
@ -4492,7 +4493,7 @@ BattleScript_ArenaDoJudgment::
|
|||||||
arenajudgmentstring B_MSG_REF_PLAYER_WON
|
arenajudgmentstring B_MSG_REF_PLAYER_WON
|
||||||
arenawaitmessage B_MSG_REF_PLAYER_WON
|
arenawaitmessage B_MSG_REF_PLAYER_WON
|
||||||
arenajudgmentwindow
|
arenajudgmentwindow
|
||||||
various15 BS_ATTACKER
|
arenaerasereftextbox
|
||||||
printstring STRINGID_DEFEATEDOPPONENTBYREFEREE
|
printstring STRINGID_DEFEATEDOPPONENTBYREFEREE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
playfaintcry BS_OPPONENT1
|
playfaintcry BS_OPPONENT1
|
||||||
@ -4506,7 +4507,7 @@ BattleScript_ArenaJudgmentPlayerLoses:
|
|||||||
arenajudgmentstring B_MSG_REF_OPPONENT_WON
|
arenajudgmentstring B_MSG_REF_OPPONENT_WON
|
||||||
arenawaitmessage B_MSG_REF_OPPONENT_WON
|
arenawaitmessage B_MSG_REF_OPPONENT_WON
|
||||||
arenajudgmentwindow
|
arenajudgmentwindow
|
||||||
various15 BS_ATTACKER
|
arenaerasereftextbox
|
||||||
printstring STRINGID_LOSTTOOPPONENTBYREFEREE
|
printstring STRINGID_LOSTTOOPPONENTBYREFEREE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
playfaintcry BS_PLAYER1
|
playfaintcry BS_PLAYER1
|
||||||
@ -4520,7 +4521,7 @@ BattleScript_ArenaJudgmentDraw:
|
|||||||
arenajudgmentstring B_MSG_REF_DRAW
|
arenajudgmentstring B_MSG_REF_DRAW
|
||||||
arenawaitmessage B_MSG_REF_DRAW
|
arenawaitmessage B_MSG_REF_DRAW
|
||||||
arenajudgmentwindow
|
arenajudgmentwindow
|
||||||
various15 BS_ATTACKER
|
arenaerasereftextbox
|
||||||
printstring STRINGID_TIEDOPPONENTBYREFEREE
|
printstring STRINGID_TIEDOPPONENTBYREFEREE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
playfaintcry BS_PLAYER1
|
playfaintcry BS_PLAYER1
|
||||||
|
53
gflib/bg.c
53
gflib/bg.c
@ -42,10 +42,12 @@ static struct BgControl sGpuBgConfigs;
|
|||||||
static struct BgConfig2 sGpuBgConfigs2[NUM_BACKGROUNDS];
|
static struct BgConfig2 sGpuBgConfigs2[NUM_BACKGROUNDS];
|
||||||
static u32 sDmaBusyBitfield[NUM_BACKGROUNDS];
|
static u32 sDmaBusyBitfield[NUM_BACKGROUNDS];
|
||||||
|
|
||||||
u32 gUnneededFireRedVariable;
|
u32 gWindowTileAutoAllocEnabled;
|
||||||
|
|
||||||
static const struct BgConfig sZeroedBgControlStruct = { 0 };
|
static const struct BgConfig sZeroedBgControlStruct = { 0 };
|
||||||
|
|
||||||
|
static u32 GetBgType(u8 bg);
|
||||||
|
|
||||||
void ResetBgs(void)
|
void ResetBgs(void)
|
||||||
{
|
{
|
||||||
ResetBgControlStructs();
|
ResetBgControlStructs();
|
||||||
@ -288,7 +290,8 @@ bool8 IsInvalidBg(u8 bg)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4)
|
// From FRLG. Dummied out.
|
||||||
|
int BgTileAllocOp(int bg, int offset, int count, int mode)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -303,7 +306,7 @@ void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable)
|
|||||||
sDmaBusyBitfield[i] = 0;
|
sDmaBusyBitfield[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gUnneededFireRedVariable = leftoverFireRedLeafGreenVariable;
|
gWindowTileAutoAllocEnabled = leftoverFireRedLeafGreenVariable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates)
|
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates)
|
||||||
@ -392,10 +395,8 @@ u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset)
|
|||||||
|
|
||||||
sDmaBusyBitfield[cursor / 0x20] |= (1 << (cursor % 0x20));
|
sDmaBusyBitfield[cursor / 0x20] |= (1 << (cursor % 0x20));
|
||||||
|
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
BgTileAllocOp(bg, tileOffset / 0x20, size / 0x20, 1);
|
||||||
DummiedOutFireRedLeafGreenTileAllocFunc(bg, tileOffset / 0x20, size / 0x20, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
@ -523,9 +524,9 @@ u16 GetBgAttribute(u8 bg, u8 attributeId)
|
|||||||
case BG_ATTR_METRIC:
|
case BG_ATTR_METRIC:
|
||||||
switch (GetBgType(bg))
|
switch (GetBgType(bg))
|
||||||
{
|
{
|
||||||
case 0:
|
case BG_TYPE_NORMAL:
|
||||||
return GetBgMetricTextMode(bg, 0) * 0x800;
|
return GetBgMetricTextMode(bg, 0) * 0x800;
|
||||||
case 1:
|
case BG_TYPE_AFFINE:
|
||||||
return GetBgMetricAffineMode(bg, 0) * 0x100;
|
return GetBgMetricAffineMode(bg, 0) * 0x100;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
@ -891,10 +892,10 @@ void CopyBgTilemapBufferToVram(u8 bg)
|
|||||||
{
|
{
|
||||||
switch (GetBgType(bg))
|
switch (GetBgType(bg))
|
||||||
{
|
{
|
||||||
case 0:
|
case BG_TYPE_NORMAL:
|
||||||
sizeToLoad = GetBgMetricTextMode(bg, 0) * 0x800;
|
sizeToLoad = GetBgMetricTextMode(bg, 0) * 0x800;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case BG_TYPE_AFFINE:
|
||||||
sizeToLoad = GetBgMetricAffineMode(bg, 0) * 0x100;
|
sizeToLoad = GetBgMetricAffineMode(bg, 0) * 0x100;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -915,7 +916,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
|
|||||||
{
|
{
|
||||||
switch (GetBgType(bg))
|
switch (GetBgType(bg))
|
||||||
{
|
{
|
||||||
case 0:
|
case BG_TYPE_NORMAL:
|
||||||
{
|
{
|
||||||
const u16 * srcCopy = src;
|
const u16 * srcCopy = src;
|
||||||
for (destY16 = destY; destY16 < (destY + height); destY16++)
|
for (destY16 = destY; destY16 < (destY + height); destY16++)
|
||||||
@ -927,7 +928,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case BG_TYPE_AFFINE:
|
||||||
{
|
{
|
||||||
const u8 * srcCopy = src;
|
const u8 * srcCopy = src;
|
||||||
mode = GetBgMetricAffineMode(bg, 0x1);
|
mode = GetBgMetricAffineMode(bg, 0x1);
|
||||||
@ -963,7 +964,7 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
|
|||||||
screenHeight = GetBgMetricTextMode(bg, 0x2) * 0x20;
|
screenHeight = GetBgMetricTextMode(bg, 0x2) * 0x20;
|
||||||
switch (GetBgType(bg))
|
switch (GetBgType(bg))
|
||||||
{
|
{
|
||||||
case 0:
|
case BG_TYPE_NORMAL:
|
||||||
srcPtr = src + ((srcY * srcWidth) + srcX) * 2;
|
srcPtr = src + ((srcY * srcWidth) + srcX) * 2;
|
||||||
for (i = destX; i < (destX + rectWidth); i++)
|
for (i = destX; i < (destX + rectWidth); i++)
|
||||||
{
|
{
|
||||||
@ -976,7 +977,7 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
|
|||||||
srcPtr += (srcWidth - destY) * 2;
|
srcPtr += (srcWidth - destY) * 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case BG_TYPE_AFFINE:
|
||||||
srcPtr = src + ((srcY * srcWidth) + srcX);
|
srcPtr = src + ((srcY * srcWidth) + srcX);
|
||||||
var = GetBgMetricAffineMode(bg, 0x1);
|
var = GetBgMetricAffineMode(bg, 0x1);
|
||||||
for (i = destX; i < (destX + rectWidth); i++)
|
for (i = destX; i < (destX + rectWidth); i++)
|
||||||
@ -1003,7 +1004,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
|
|||||||
{
|
{
|
||||||
switch (GetBgType(bg))
|
switch (GetBgType(bg))
|
||||||
{
|
{
|
||||||
case 0:
|
case BG_TYPE_NORMAL:
|
||||||
for (y16 = y; y16 < (y + height); y16++)
|
for (y16 = y; y16 < (y + height); y16++)
|
||||||
{
|
{
|
||||||
for (x16 = x; x16 < (x + width); x16++)
|
for (x16 = x; x16 < (x + width); x16++)
|
||||||
@ -1012,7 +1013,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case BG_TYPE_AFFINE:
|
||||||
mode = GetBgMetricAffineMode(bg, 0x1);
|
mode = GetBgMetricAffineMode(bg, 0x1);
|
||||||
for (y16 = y; y16 < (y + height); y16++)
|
for (y16 = y; y16 < (y + height); y16++)
|
||||||
{
|
{
|
||||||
@ -1046,7 +1047,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
|||||||
mode2 = GetBgMetricTextMode(bg, 0x2) * 0x20;
|
mode2 = GetBgMetricTextMode(bg, 0x2) * 0x20;
|
||||||
switch (GetBgType(bg))
|
switch (GetBgType(bg))
|
||||||
{
|
{
|
||||||
case 0:
|
case BG_TYPE_NORMAL:
|
||||||
for (y16 = y; y16 < (y + height); y16++)
|
for (y16 = y; y16 < (y + height); y16++)
|
||||||
{
|
{
|
||||||
for (x16 = x; x16 < (x + width); x16++)
|
for (x16 = x; x16 < (x + width); x16++)
|
||||||
@ -1056,7 +1057,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case BG_TYPE_AFFINE:
|
||||||
mode3 = GetBgMetricAffineMode(bg, 0x1);
|
mode3 = GetBgMetricAffineMode(bg, 0x1);
|
||||||
for (y16 = y; y16 < (y + height); y16++)
|
for (y16 = y; y16 < (y + height); y16++)
|
||||||
{
|
{
|
||||||
@ -1190,7 +1191,7 @@ void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s
|
|||||||
*dest = var;
|
*dest = var;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 GetBgType(u8 bg)
|
static u32 GetBgType(u8 bg)
|
||||||
{
|
{
|
||||||
u8 mode = GetBgMode();
|
u8 mode = GetBgMode();
|
||||||
|
|
||||||
@ -1202,31 +1203,31 @@ u32 GetBgType(u8 bg)
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
return 0;
|
return BG_TYPE_NORMAL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return 0;
|
return BG_TYPE_NORMAL;
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
return 1;
|
return BG_TYPE_AFFINE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return 0;
|
return BG_TYPE_NORMAL;
|
||||||
case 2:
|
case 2:
|
||||||
return 1;
|
return BG_TYPE_AFFINE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0xFFFF;
|
return BG_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 IsInvalidBg32(u8 bg)
|
bool32 IsInvalidBg32(u8 bg)
|
||||||
|
@ -25,6 +25,12 @@ enum
|
|||||||
BG_ATTR_BASETILE,
|
BG_ATTR_BASETILE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
BG_TYPE_NORMAL,
|
||||||
|
BG_TYPE_AFFINE,
|
||||||
|
BG_TYPE_NONE = 0xFFFF
|
||||||
|
};
|
||||||
|
|
||||||
struct BgTemplate
|
struct BgTemplate
|
||||||
{
|
{
|
||||||
u16 bg:2; // 0x1, 0x2 -> 0x3
|
u16 bg:2; // 0x1, 0x2 -> 0x3
|
||||||
@ -43,7 +49,7 @@ void Unused_ResetBgControlStruct(u8 bg);
|
|||||||
u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode);
|
u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode);
|
||||||
void SetTextModeAndHideBgs(void);
|
void SetTextModeAndHideBgs(void);
|
||||||
bool8 IsInvalidBg(u8 bg);
|
bool8 IsInvalidBg(u8 bg);
|
||||||
int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4);
|
int BgTileAllocOp(int bg, int offset, int count, int mode);
|
||||||
void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable);
|
void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable);
|
||||||
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates);
|
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates);
|
||||||
void InitBgFromTemplate(const struct BgTemplate *template);
|
void InitBgFromTemplate(const struct BgTemplate *template);
|
||||||
@ -78,7 +84,6 @@ u16 GetBgMetricTextMode(u8 bg, u8 whichMetric);
|
|||||||
u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric);
|
u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric);
|
||||||
u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight);
|
u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight);
|
||||||
void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s32 palette2);
|
void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s32 palette2);
|
||||||
u32 GetBgType(u8 bg);
|
|
||||||
bool32 IsInvalidBg32(u8 bg);
|
bool32 IsInvalidBg32(u8 bg);
|
||||||
bool32 IsTileMapOutsideWram(u8 bg);
|
bool32 IsTileMapOutsideWram(u8 bg);
|
||||||
|
|
||||||
|
@ -630,7 +630,7 @@ bool32 IsStringJapanese(u8 *str)
|
|||||||
{
|
{
|
||||||
while (*str != EOS)
|
while (*str != EOS)
|
||||||
{
|
{
|
||||||
if (*str < CHAR_0)
|
if (*str <= JAPANESE_CHAR_END)
|
||||||
if (*str != CHAR_SPACE)
|
if (*str != CHAR_SPACE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
str++;
|
str++;
|
||||||
@ -639,13 +639,13 @@ bool32 IsStringJapanese(u8 *str)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_800924C(u8 *str, s32 n)
|
bool32 IsStringNJapanese(u8 *str, s32 n)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
for (i = 0; *str != EOS && i < n; i++)
|
for (i = 0; *str != EOS && i < n; i++)
|
||||||
{
|
{
|
||||||
if (*str < CHAR_0)
|
if (*str <= JAPANESE_CHAR_END)
|
||||||
if (*str != CHAR_SPACE)
|
if (*str != CHAR_SPACE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
str++;
|
str++;
|
||||||
|
@ -37,7 +37,7 @@ u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n);
|
|||||||
u32 StringLength_Multibyte(const u8 *str);
|
u32 StringLength_Multibyte(const u8 *str);
|
||||||
u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color);
|
u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color);
|
||||||
bool32 IsStringJapanese(u8 *str);
|
bool32 IsStringJapanese(u8 *str);
|
||||||
bool32 sub_800924C(u8 *str, s32 n);
|
bool32 IsStringNJapanese(u8 *str, s32 n);
|
||||||
u8 GetExtCtrlCodeLength(u8 code);
|
u8 GetExtCtrlCodeLength(u8 code);
|
||||||
s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2);
|
s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2);
|
||||||
void ConvertInternationalString(u8 *s, u8 language);
|
void ConvertInternationalString(u8 *s, u8 language);
|
||||||
|
@ -263,6 +263,10 @@
|
|||||||
#define PLACEHOLDER_ID_KYOGRE 0xC
|
#define PLACEHOLDER_ID_KYOGRE 0xC
|
||||||
#define PLACEHOLDER_ID_GROUDON 0xD
|
#define PLACEHOLDER_ID_GROUDON 0xD
|
||||||
|
|
||||||
|
// Hiragana from 0x1-0x50, Katakana from 0x51-0xA0.
|
||||||
|
// This excludes Japanese punctuation, which end at 0xB0
|
||||||
|
#define JAPANESE_CHAR_END 0xA0
|
||||||
|
|
||||||
// battle placeholders are located in battle_message.h
|
// battle placeholders are located in battle_message.h
|
||||||
|
|
||||||
#define NUM_TEXT_PRINTERS 32
|
#define NUM_TEXT_PRINTERS 32
|
||||||
|
@ -10,7 +10,7 @@ u32 gUnusedWindowVar2;
|
|||||||
u8 gTransparentTileNumber;
|
u8 gTransparentTileNumber;
|
||||||
u32 gUnusedWindowVar3;
|
u32 gUnusedWindowVar3;
|
||||||
void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS];
|
void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS];
|
||||||
extern u32 gUnneededFireRedVariable;
|
extern u32 gWindowTileAutoAllocEnabled;
|
||||||
|
|
||||||
#define WINDOWS_MAX 32
|
#define WINDOWS_MAX 32
|
||||||
|
|
||||||
@ -55,9 +55,9 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
|||||||
|
|
||||||
for (i = 0, allocatedBaseBlock = 0, bgLayer = templates[i].bg; bgLayer != 0xFF && i < WINDOWS_MAX; ++i, bgLayer = templates[i].bg)
|
for (i = 0, allocatedBaseBlock = 0, bgLayer = templates[i].bg; bgLayer != 0xFF && i < WINDOWS_MAX; ++i, bgLayer = templates[i].bg)
|
||||||
{
|
{
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
{
|
||||||
allocatedBaseBlock = DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, 0, templates[i].width * templates[i].height, 0);
|
allocatedBaseBlock = BgTileAllocOp(bgLayer, 0, templates[i].width * templates[i].height, 0);
|
||||||
if (allocatedBaseBlock == -1)
|
if (allocatedBaseBlock == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -100,10 +100,10 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
|||||||
gWindows[i].tileData = allocatedTilemapBuffer;
|
gWindows[i].tileData = allocatedTilemapBuffer;
|
||||||
gWindows[i].window = templates[i];
|
gWindows[i].window = templates[i];
|
||||||
|
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
{
|
||||||
gWindows[i].window.baseBlock = allocatedBaseBlock;
|
gWindows[i].window.baseBlock = allocatedBaseBlock;
|
||||||
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, allocatedBaseBlock, templates[i].width * templates[i].height, 1);
|
BgTileAllocOp(bgLayer, allocatedBaseBlock, templates[i].width * templates[i].height, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,9 +132,9 @@ u16 AddWindow(const struct WindowTemplate *template)
|
|||||||
bgLayer = template->bg;
|
bgLayer = template->bg;
|
||||||
allocatedBaseBlock = 0;
|
allocatedBaseBlock = 0;
|
||||||
|
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
{
|
||||||
allocatedBaseBlock = DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, 0, template->width * template->height, 0);
|
allocatedBaseBlock = BgTileAllocOp(bgLayer, 0, template->width * template->height, 0);
|
||||||
|
|
||||||
if (allocatedBaseBlock == -1)
|
if (allocatedBaseBlock == -1)
|
||||||
return WINDOW_NONE;
|
return WINDOW_NONE;
|
||||||
@ -174,10 +174,10 @@ u16 AddWindow(const struct WindowTemplate *template)
|
|||||||
gWindows[win].tileData = allocatedTilemapBuffer;
|
gWindows[win].tileData = allocatedTilemapBuffer;
|
||||||
gWindows[win].window = *template;
|
gWindows[win].window = *template;
|
||||||
|
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
{
|
||||||
gWindows[win].window.baseBlock = allocatedBaseBlock;
|
gWindows[win].window.baseBlock = allocatedBaseBlock;
|
||||||
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
|
BgTileAllocOp(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
@ -201,9 +201,9 @@ int AddWindowWithoutTileMap(const struct WindowTemplate *template)
|
|||||||
bgLayer = template->bg;
|
bgLayer = template->bg;
|
||||||
allocatedBaseBlock = 0;
|
allocatedBaseBlock = 0;
|
||||||
|
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
{
|
||||||
allocatedBaseBlock = DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, 0, template->width * template->height, 0);
|
allocatedBaseBlock = BgTileAllocOp(bgLayer, 0, template->width * template->height, 0);
|
||||||
|
|
||||||
if (allocatedBaseBlock == -1)
|
if (allocatedBaseBlock == -1)
|
||||||
return WINDOW_NONE;
|
return WINDOW_NONE;
|
||||||
@ -211,10 +211,10 @@ int AddWindowWithoutTileMap(const struct WindowTemplate *template)
|
|||||||
|
|
||||||
gWindows[win].window = *template;
|
gWindows[win].window = *template;
|
||||||
|
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
{
|
||||||
gWindows[win].window.baseBlock = allocatedBaseBlock;
|
gWindows[win].window.baseBlock = allocatedBaseBlock;
|
||||||
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
|
BgTileAllocOp(bgLayer, allocatedBaseBlock, gWindows[win].window.width * gWindows[win].window.height, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
@ -224,10 +224,8 @@ void RemoveWindow(u8 windowId)
|
|||||||
{
|
{
|
||||||
u8 bgLayer = gWindows[windowId].window.bg;
|
u8 bgLayer = gWindows[windowId].window.bg;
|
||||||
|
|
||||||
if (gUnneededFireRedVariable == 1)
|
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||||
{
|
BgTileAllocOp(bgLayer, gWindows[windowId].window.baseBlock, gWindows[windowId].window.width * gWindows[windowId].window.height, 2);
|
||||||
DummiedOutFireRedLeafGreenTileAllocFunc(bgLayer, gWindows[windowId].window.baseBlock, gWindows[windowId].window.width * gWindows[windowId].window.height, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
gWindows[windowId].window = sDummyWindowTemplate;
|
gWindows[windowId].window = sDummyWindowTemplate;
|
||||||
|
|
||||||
|
@ -9,6 +9,6 @@ void BattleArena_AddSkillPoints(u8 battler);
|
|||||||
void BattleArena_DeductMindPoints(u8 battler, u16 stringId);
|
void BattleArena_DeductMindPoints(u8 battler, u16 stringId);
|
||||||
void sub_81A586C(u8 battler);
|
void sub_81A586C(u8 battler);
|
||||||
void DrawArenaRefereeTextBox(void);
|
void DrawArenaRefereeTextBox(void);
|
||||||
void RemoveArenaRefereeTextBox(void);
|
void EraseArenaRefereeTextBox(void);
|
||||||
|
|
||||||
#endif //GUARD_BATTLE_ARENA_H
|
#endif //GUARD_BATTLE_ARENA_H
|
||||||
|
@ -39,7 +39,7 @@ void LoadAndCreateEnemyShadowSprites(void);
|
|||||||
void SpriteCB_SetInvisible(struct Sprite *sprite);
|
void SpriteCB_SetInvisible(struct Sprite *sprite);
|
||||||
void SetBattlerShadowSpriteCallback(u8 battlerId, u16 species);
|
void SetBattlerShadowSpriteCallback(u8 battlerId, u16 species);
|
||||||
void HideBattlerShadowSprite(u8 battlerId);
|
void HideBattlerShadowSprite(u8 battlerId);
|
||||||
void sub_805EF14(void);
|
void FillAroundBattleWindows(void);
|
||||||
void ClearTemporarySpeciesSpriteData(u8 battlerId, bool8 dontClearSubstitute);
|
void ClearTemporarySpeciesSpriteData(u8 battlerId, bool8 dontClearSubstitute);
|
||||||
void AllocateMonSpritesGfx(void);
|
void AllocateMonSpritesGfx(void);
|
||||||
void FreeMonSpritesGfx(void);
|
void FreeMonSpritesGfx(void);
|
||||||
|
@ -5,6 +5,6 @@ void AllocateBattleResources(void);
|
|||||||
void FreeBattleResources(void);
|
void FreeBattleResources(void);
|
||||||
void AdjustFriendshipOnBattleFaint(u8 battler);
|
void AdjustFriendshipOnBattleFaint(u8 battler);
|
||||||
void SwitchPartyOrderInGameMulti(u8 battler, u8 arg1);
|
void SwitchPartyOrderInGameMulti(u8 battler, u8 arg1);
|
||||||
u32 sub_805725C(u8 battler);
|
u32 BattlePalace_TryEscapeStatus(u8 battler);
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_UTIL_H
|
#endif // GUARD_BATTLE_UTIL_H
|
||||||
|
@ -161,8 +161,8 @@
|
|||||||
#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER)
|
#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER)
|
||||||
|
|
||||||
// Not really sure what a "hitmarker" is.
|
// Not really sure what a "hitmarker" is.
|
||||||
#define HITMARKER_x10 (1 << 4)
|
#define HITMARKER_WAKE_UP_CLEAR (1 << 4) // Cleared when waking up. Never set or checked.
|
||||||
#define HITMARKER_x20 (1 << 5)
|
#define HITMARKER_SKIP_DMG_TRACK (1 << 5)
|
||||||
#define HITMARKER_DESTINYBOND (1 << 6)
|
#define HITMARKER_DESTINYBOND (1 << 6)
|
||||||
#define HITMARKER_NO_ANIMATIONS (1 << 7)
|
#define HITMARKER_NO_ANIMATIONS (1 << 7)
|
||||||
#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8)
|
#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8)
|
||||||
@ -177,13 +177,13 @@
|
|||||||
#define HITMARKER_IGNORE_UNDERGROUND (1 << 17)
|
#define HITMARKER_IGNORE_UNDERGROUND (1 << 17)
|
||||||
#define HITMARKER_IGNORE_UNDERWATER (1 << 18)
|
#define HITMARKER_IGNORE_UNDERWATER (1 << 18)
|
||||||
#define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19)
|
#define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19)
|
||||||
#define HITMARKER_x100000 (1 << 20)
|
#define HITMARKER_PASSIVE_DAMAGE (1 << 20)
|
||||||
#define HITMARKER_x200000 (1 << 21)
|
#define HITMARKER_DISOBEDIENT_MOVE (1 << 21)
|
||||||
#define HITMARKER_x400000 (1 << 22)
|
#define HITMARKER_PLAYER_FAINTED (1 << 22)
|
||||||
#define HITMARKER_x800000 (1 << 23)
|
#define HITMARKER_ALLOW_NO_PP (1 << 23)
|
||||||
#define HITMARKER_GRUDGE (1 << 24)
|
#define HITMARKER_GRUDGE (1 << 24)
|
||||||
#define HITMARKER_OBEYS (1 << 25)
|
#define HITMARKER_OBEYS (1 << 25)
|
||||||
#define HITMARKER_x4000000 (1 << 26)
|
#define HITMARKER_NEVER_SET (1 << 26) // Cleared as part of a large group. Never set or checked
|
||||||
#define HITMARKER_CHARGING (1 << 27)
|
#define HITMARKER_CHARGING (1 << 27)
|
||||||
#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28)
|
#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28)
|
||||||
#define HITMARKER_FAINTED2(battler) ((1 << 28) << battler)
|
#define HITMARKER_FAINTED2(battler) ((1 << 28) << battler)
|
||||||
|
@ -72,12 +72,15 @@
|
|||||||
#define VARIOUS_GET_BATTLER_FAINTED 4
|
#define VARIOUS_GET_BATTLER_FAINTED 4
|
||||||
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
|
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
|
||||||
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
|
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
|
||||||
|
#define VARIOUS_RESET_PLAYER_FAINTED 7
|
||||||
#define VARIOUS_PALACE_FLAVOR_TEXT 8
|
#define VARIOUS_PALACE_FLAVOR_TEXT 8
|
||||||
#define VARIOUS_ARENA_JUDGMENT_WINDOW 9
|
#define VARIOUS_ARENA_JUDGMENT_WINDOW 9
|
||||||
#define VARIOUS_ARENA_OPPONENT_MON_LOST 10
|
#define VARIOUS_ARENA_OPPONENT_MON_LOST 10
|
||||||
#define VARIOUS_ARENA_PLAYER_MON_LOST 11
|
#define VARIOUS_ARENA_PLAYER_MON_LOST 11
|
||||||
#define VARIOUS_ARENA_BOTH_MONS_LOST 12
|
#define VARIOUS_ARENA_BOTH_MONS_LOST 12
|
||||||
#define VARIOUS_EMIT_YESNOBOX 13
|
#define VARIOUS_EMIT_YESNOBOX 13
|
||||||
|
#define VARIOUS_DRAW_ARENA_REF_TEXT_BOX 14
|
||||||
|
#define VARIOUS_ERASE_ARENA_REF_TEXT_BOX 15
|
||||||
#define VARIOUS_ARENA_JUDGMENT_STRING 16
|
#define VARIOUS_ARENA_JUDGMENT_STRING 16
|
||||||
#define VARIOUS_ARENA_WAIT_STRING 17
|
#define VARIOUS_ARENA_WAIT_STRING 17
|
||||||
#define VARIOUS_WAIT_CRY 18
|
#define VARIOUS_WAIT_CRY 18
|
||||||
@ -86,6 +89,7 @@
|
|||||||
#define VARIOUS_VOLUME_DOWN 21
|
#define VARIOUS_VOLUME_DOWN 21
|
||||||
#define VARIOUS_VOLUME_UP 22
|
#define VARIOUS_VOLUME_UP 22
|
||||||
#define VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT 23
|
#define VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT 23
|
||||||
|
#define VARIOUS_PALACE_TRY_ESCAPE_STATUS 24
|
||||||
#define VARIOUS_SET_TELEPORT_OUTCOME 25
|
#define VARIOUS_SET_TELEPORT_OUTCOME 25
|
||||||
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
|
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ struct PokedexAreaMapTemplate
|
|||||||
};
|
};
|
||||||
|
|
||||||
void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *);
|
void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *);
|
||||||
bool32 sub_81C4E90(void);
|
bool32 TryShowPokedexAreaMap(void);
|
||||||
void PokedexAreaMapChangeBgY(u32);
|
void PokedexAreaMapChangeBgY(u32);
|
||||||
void FreePokedexAreaMapBgNum(void);
|
void FreePokedexAreaMapBgNum(void);
|
||||||
|
|
||||||
|
@ -784,7 +784,7 @@ void AnimTask_InitMementoShadow(u8 taskId)
|
|||||||
DestroyAnimVisualTask(taskId);
|
DestroyAnimVisualTask(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_8114470(u8 taskId)
|
void AnimTask_MementoHandleBg(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0;
|
u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0;
|
||||||
ResetBattleAnimBg(toBG2);
|
ResetBattleAnimBg(toBG2);
|
||||||
|
@ -733,50 +733,67 @@ void AnimTask_InvertScreenColor(u8 taskId)
|
|||||||
DestroyAnimVisualTask(taskId);
|
DestroyAnimVisualTask(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnusedAnimTask_8115F94(u8 taskId)
|
// Unused
|
||||||
|
#define tTimer data[0]
|
||||||
|
#define tLength data[1]
|
||||||
|
#define tFlagsScenery data[2]
|
||||||
|
#define tFlagsAttacker data[3]
|
||||||
|
#define tFlagsTarget data[4]
|
||||||
|
#define tColorR data[5]
|
||||||
|
#define tColorG data[6]
|
||||||
|
#define tColorB data[7]
|
||||||
|
void AnimTask_TintPalettes(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 attackerBattler;
|
u8 attackerBattler;
|
||||||
u8 targetBattler;
|
u8 targetBattler;
|
||||||
u8 paletteIndex;
|
u8 paletteIndex;
|
||||||
u32 selectedPalettes = 0;
|
u32 selectedPalettes = 0;
|
||||||
|
|
||||||
if (gTasks[taskId].data[0] == 0)
|
if (gTasks[taskId].tTimer == 0)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[2] = gBattleAnimArgs[0];
|
gTasks[taskId].tFlagsScenery = gBattleAnimArgs[0];
|
||||||
gTasks[taskId].data[3] = gBattleAnimArgs[1];
|
gTasks[taskId].tFlagsAttacker = gBattleAnimArgs[1];
|
||||||
gTasks[taskId].data[4] = gBattleAnimArgs[2];
|
gTasks[taskId].tFlagsTarget = gBattleAnimArgs[2];
|
||||||
gTasks[taskId].data[1] = gBattleAnimArgs[3];
|
gTasks[taskId].tLength = gBattleAnimArgs[3];
|
||||||
gTasks[taskId].data[5] = gBattleAnimArgs[4];
|
gTasks[taskId].tColorR = gBattleAnimArgs[4];
|
||||||
gTasks[taskId].data[6] = gBattleAnimArgs[5];
|
gTasks[taskId].tColorG = gBattleAnimArgs[5];
|
||||||
gTasks[taskId].data[7] = gBattleAnimArgs[6];
|
gTasks[taskId].tColorB = gBattleAnimArgs[6];
|
||||||
}
|
}
|
||||||
|
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tTimer++;
|
||||||
attackerBattler = gBattleAnimAttacker;
|
attackerBattler = gBattleAnimAttacker;
|
||||||
targetBattler = gBattleAnimTarget;
|
targetBattler = gBattleAnimTarget;
|
||||||
|
|
||||||
if (gTasks[taskId].data[2] & 0x100)
|
if (gTasks[taskId].tFlagsScenery & (1 << 8))
|
||||||
selectedPalettes = 0x0000FFFF;
|
selectedPalettes = PALETTES_BG;
|
||||||
|
|
||||||
if (gTasks[taskId].data[2] & 0x1)
|
if (gTasks[taskId].tFlagsScenery & 1)
|
||||||
{
|
{
|
||||||
paletteIndex = IndexOfSpritePaletteTag(gSprites[gHealthboxSpriteIds[attackerBattler]].template->paletteTag);
|
paletteIndex = IndexOfSpritePaletteTag(gSprites[gHealthboxSpriteIds[attackerBattler]].template->paletteTag);
|
||||||
selectedPalettes |= (1 << paletteIndex) << 16;
|
selectedPalettes |= (1 << paletteIndex) << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gTasks[taskId].data[3] & 0x100)
|
if (gTasks[taskId].tFlagsAttacker & (1 << 8))
|
||||||
selectedPalettes |= (1 << attackerBattler) << 16;
|
selectedPalettes |= (1 << attackerBattler) << 16;
|
||||||
|
|
||||||
if (gTasks[taskId].data[4] & 0x100)
|
if (gTasks[taskId].tFlagsTarget & (1 << 8))
|
||||||
selectedPalettes |= (1 << targetBattler) << 16;
|
selectedPalettes |= (1 << targetBattler) << 16;
|
||||||
|
|
||||||
TintPlttBuffer(selectedPalettes, gTasks[taskId].data[5], gTasks[taskId].data[6], gTasks[taskId].data[7]);
|
TintPlttBuffer(selectedPalettes, gTasks[taskId].tColorR, gTasks[taskId].tColorG, gTasks[taskId].tColorB);
|
||||||
if (gTasks[taskId].data[0] == gTasks[taskId].data[1])
|
if (gTasks[taskId].tTimer == gTasks[taskId].tLength)
|
||||||
{
|
{
|
||||||
UnfadePlttBuffer(selectedPalettes);
|
UnfadePlttBuffer(selectedPalettes);
|
||||||
DestroyAnimVisualTask(taskId);
|
DestroyAnimVisualTask(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#undef tTimer
|
||||||
|
#undef tLength
|
||||||
|
#undef tFlagsScenery
|
||||||
|
#undef tFlagsAttacker
|
||||||
|
#undef tFlagsTarget
|
||||||
|
#undef tColorR
|
||||||
|
#undef tColorG
|
||||||
|
#undef tColorB
|
||||||
|
|
||||||
static void AnimShakeMonOrBattleTerrain(struct Sprite *sprite)
|
static void AnimShakeMonOrBattleTerrain(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
|
@ -917,7 +917,7 @@ void DrawArenaRefereeTextBox(void)
|
|||||||
FillBgTilemapBufferRect(0, 0x836, 29, 19, 1, 1, palNum);
|
FillBgTilemapBufferRect(0, 0x836, 29, 19, 1, 1, palNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveArenaRefereeTextBox(void)
|
void EraseArenaRefereeTextBox(void)
|
||||||
{
|
{
|
||||||
u8 width;
|
u8 width;
|
||||||
u8 height;
|
u8 height;
|
||||||
|
@ -1213,7 +1213,8 @@ void HideBattlerShadowSprite(u8 battlerId)
|
|||||||
gSprites[gBattleSpritesDataPtr->healthBoxesData[battlerId].shadowSpriteId].callback = SpriteCB_SetInvisible;
|
gSprites[gBattleSpritesDataPtr->healthBoxesData[battlerId].shadowSpriteId].callback = SpriteCB_SetInvisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_805EF14(void)
|
// Color the background tiles surrounding the action selection and move windows
|
||||||
|
void FillAroundBattleWindows(void)
|
||||||
{
|
{
|
||||||
u16 *vramPtr = (u16*)(VRAM + 0x240);
|
u16 *vramPtr = (u16*)(VRAM + 0x240);
|
||||||
s32 i;
|
s32 i;
|
||||||
|
@ -961,7 +961,7 @@ static void CB2_HandleStartBattle(void)
|
|||||||
ShowBg(1);
|
ShowBg(1);
|
||||||
ShowBg(2);
|
ShowBg(2);
|
||||||
ShowBg(3);
|
ShowBg(3);
|
||||||
sub_805EF14();
|
FillAroundBattleWindows();
|
||||||
gBattleCommunication[MULTIUSE_STATE] = 1;
|
gBattleCommunication[MULTIUSE_STATE] = 1;
|
||||||
}
|
}
|
||||||
if (gWirelessCommType)
|
if (gWirelessCommType)
|
||||||
@ -1157,7 +1157,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
|||||||
ShowBg(1);
|
ShowBg(1);
|
||||||
ShowBg(2);
|
ShowBg(2);
|
||||||
ShowBg(3);
|
ShowBg(3);
|
||||||
sub_805EF14();
|
FillAroundBattleWindows();
|
||||||
gBattleCommunication[MULTIUSE_STATE] = 1;
|
gBattleCommunication[MULTIUSE_STATE] = 1;
|
||||||
}
|
}
|
||||||
if (gWirelessCommType)
|
if (gWirelessCommType)
|
||||||
@ -1558,7 +1558,7 @@ static void CB2_HandleStartMultiBattle(void)
|
|||||||
ShowBg(1);
|
ShowBg(1);
|
||||||
ShowBg(2);
|
ShowBg(2);
|
||||||
ShowBg(3);
|
ShowBg(3);
|
||||||
sub_805EF14();
|
FillAroundBattleWindows();
|
||||||
gBattleCommunication[MULTIUSE_STATE] = 1;
|
gBattleCommunication[MULTIUSE_STATE] = 1;
|
||||||
}
|
}
|
||||||
if (gWirelessCommType)
|
if (gWirelessCommType)
|
||||||
@ -2150,7 +2150,7 @@ void CB2_InitEndLinkBattle(void)
|
|||||||
|
|
||||||
SetHBlankCallback(NULL);
|
SetHBlankCallback(NULL);
|
||||||
SetVBlankCallback(NULL);
|
SetVBlankCallback(NULL);
|
||||||
gBattleTypeFlags &= ~(BATTLE_TYPE_LINK_IN_BATTLE);
|
gBattleTypeFlags &= ~BATTLE_TYPE_LINK_IN_BATTLE;
|
||||||
|
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||||
{
|
{
|
||||||
@ -3116,7 +3116,7 @@ void SwitchInClearSetData(void)
|
|||||||
&& (gStatuses3[i] & STATUS3_ALWAYS_HITS) != 0
|
&& (gStatuses3[i] & STATUS3_ALWAYS_HITS) != 0
|
||||||
&& (gDisableStructs[i].battlerWithSureHit == gActiveBattler))
|
&& (gDisableStructs[i].battlerWithSureHit == gActiveBattler))
|
||||||
{
|
{
|
||||||
gStatuses3[i] &= ~(STATUS3_ALWAYS_HITS);
|
gStatuses3[i] &= ~STATUS3_ALWAYS_HITS;
|
||||||
gStatuses3[i] |= STATUS3_ALWAYS_HITS_TURN(2);
|
gStatuses3[i] |= STATUS3_ALWAYS_HITS_TURN(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3130,9 +3130,9 @@ void SwitchInClearSetData(void)
|
|||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler))
|
if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler))
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_INFATUATED_WITH(gActiveBattler));
|
gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(gActiveBattler);
|
||||||
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler)
|
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler)
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_WRAPPED);
|
gBattleMons[i].status2 &= ~STATUS2_WRAPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
gActionSelectionCursor[gActiveBattler] = 0;
|
gActionSelectionCursor[gActiveBattler] = 0;
|
||||||
@ -3212,9 +3212,9 @@ void FaintClearSetData(void)
|
|||||||
if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == gActiveBattler)
|
if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == gActiveBattler)
|
||||||
gBattleMons[i].status2 &= ~STATUS2_ESCAPE_PREVENTION;
|
gBattleMons[i].status2 &= ~STATUS2_ESCAPE_PREVENTION;
|
||||||
if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler))
|
if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler))
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_INFATUATED_WITH(gActiveBattler));
|
gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(gActiveBattler);
|
||||||
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler)
|
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler)
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_WRAPPED);
|
gBattleMons[i].status2 &= ~STATUS2_WRAPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
gActionSelectionCursor[gActiveBattler] = 0;
|
gActionSelectionCursor[gActiveBattler] = 0;
|
||||||
@ -3821,7 +3821,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||||||
gBattleCommunication[i] = 0;
|
gBattleCommunication[i] = 0;
|
||||||
|
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_FLINCHED);
|
gBattleMons[i].status2 &= ~STATUS2_FLINCHED;
|
||||||
|
|
||||||
*(&gBattleStruct->turnEffectsTracker) = 0;
|
*(&gBattleStruct->turnEffectsTracker) = 0;
|
||||||
*(&gBattleStruct->turnEffectsBattlerId) = 0;
|
*(&gBattleStruct->turnEffectsBattlerId) = 0;
|
||||||
@ -3852,7 +3852,7 @@ static void HandleEndTurn_ContinueBattle(void)
|
|||||||
gBattleCommunication[i] = 0;
|
gBattleCommunication[i] = 0;
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_FLINCHED);
|
gBattleMons[i].status2 &= ~STATUS2_FLINCHED;
|
||||||
if ((gBattleMons[i].status1 & STATUS1_SLEEP) && (gBattleMons[i].status2 & STATUS2_MULTIPLETURNS))
|
if ((gBattleMons[i].status1 & STATUS1_SLEEP) && (gBattleMons[i].status2 & STATUS2_MULTIPLETURNS))
|
||||||
CancelMultiTurnMoves(i);
|
CancelMultiTurnMoves(i);
|
||||||
}
|
}
|
||||||
@ -3884,10 +3884,10 @@ void BattleTurnPassed(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TurnValuesCleanUp(FALSE);
|
TurnValuesCleanUp(FALSE);
|
||||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
gHitMarker &= ~HITMARKER_NO_ATTACKSTRING;
|
||||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
gHitMarker &= ~HITMARKER_UNABLE_TO_USE_MOVE;
|
||||||
gHitMarker &= ~(HITMARKER_x400000);
|
gHitMarker &= ~HITMARKER_PLAYER_FAINTED;
|
||||||
gHitMarker &= ~(HITMARKER_x100000);
|
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
|
||||||
gBattleScripting.animTurn = 0;
|
gBattleScripting.animTurn = 0;
|
||||||
gBattleScripting.animTargetsHit = 0;
|
gBattleScripting.animTargetsHit = 0;
|
||||||
gBattleScripting.moveendState = 0;
|
gBattleScripting.moveendState = 0;
|
||||||
@ -4795,12 +4795,12 @@ static void TurnValuesCleanUp(bool8 var0)
|
|||||||
{
|
{
|
||||||
gDisableStructs[gActiveBattler].rechargeTimer--;
|
gDisableStructs[gActiveBattler].rechargeTimer--;
|
||||||
if (gDisableStructs[gActiveBattler].rechargeTimer == 0)
|
if (gDisableStructs[gActiveBattler].rechargeTimer == 0)
|
||||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_RECHARGE);
|
gBattleMons[gActiveBattler].status2 &= ~STATUS2_RECHARGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gDisableStructs[gActiveBattler].substituteHP == 0)
|
if (gDisableStructs[gActiveBattler].substituteHP == 0)
|
||||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE);
|
gBattleMons[gActiveBattler].status2 &= ~STATUS2_SUBSTITUTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gSideTimers[0].followmeTimer = 0;
|
gSideTimers[0].followmeTimer = 0;
|
||||||
@ -4860,15 +4860,15 @@ static void RunTurnActionsFunctions(void)
|
|||||||
|
|
||||||
if (gCurrentTurnActionNumber >= gBattlersCount) // everyone did their actions, turn finished
|
if (gCurrentTurnActionNumber >= gBattlersCount) // everyone did their actions, turn finished
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_x100000);
|
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
|
||||||
gBattleMainFunc = sEndTurnFuncsTable[gBattleOutcome & 0x7F];
|
gBattleMainFunc = sEndTurnFuncsTable[gBattleOutcome & 0x7F];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another battlerId
|
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another battlerId
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
gHitMarker &= ~HITMARKER_NO_ATTACKSTRING;
|
||||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
gHitMarker &= ~HITMARKER_UNABLE_TO_USE_MOVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4883,7 +4883,7 @@ static void HandleEndTurn_BattleWon(void)
|
|||||||
gBattleTextBuff1[0] = gBattleOutcome;
|
gBattleTextBuff1[0] = gBattleOutcome;
|
||||||
gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||||
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
|
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
|
||||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||||
}
|
}
|
||||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||||
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_EREADER_TRAINER))
|
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_EREADER_TRAINER))
|
||||||
@ -4942,13 +4942,13 @@ static void HandleEndTurn_BattleLost(void)
|
|||||||
if (gBattleOutcome & B_OUTCOME_LINK_BATTLE_RAN)
|
if (gBattleOutcome & B_OUTCOME_LINK_BATTLE_RAN)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeitedLinkBattle;
|
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeitedLinkBattle;
|
||||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||||
gSaveBlock2Ptr->frontier.disableRecordBattle = TRUE;
|
gSaveBlock2Ptr->frontier.disableRecordBattle = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_FrontierLinkBattleLost;
|
gBattlescriptCurrInstr = BattleScript_FrontierLinkBattleLost;
|
||||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4956,7 +4956,7 @@ static void HandleEndTurn_BattleLost(void)
|
|||||||
gBattleTextBuff1[0] = gBattleOutcome;
|
gBattleTextBuff1[0] = gBattleOutcome;
|
||||||
gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||||
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
|
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
|
||||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -924,7 +924,7 @@ static void Cmd_attackcanceler(void)
|
|||||||
return;
|
return;
|
||||||
if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0))
|
if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0))
|
||||||
return;
|
return;
|
||||||
if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & (HITMARKER_x800000 | HITMARKER_NO_ATTACKSTRING))
|
if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & (HITMARKER_ALLOW_NO_PP | HITMARKER_NO_ATTACKSTRING))
|
||||||
&& !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
&& !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_NoPPForMove;
|
gBattlescriptCurrInstr = BattleScript_NoPPForMove;
|
||||||
@ -932,7 +932,7 @@ static void Cmd_attackcanceler(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gHitMarker &= ~(HITMARKER_x800000);
|
gHitMarker &= ~HITMARKER_ALLOW_NO_PP;
|
||||||
|
|
||||||
if (!(gHitMarker & HITMARKER_OBEYS) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
if (!(gHitMarker & HITMARKER_OBEYS) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
||||||
{
|
{
|
||||||
@ -1237,7 +1237,7 @@ static void Cmd_ppreduce(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gHitMarker &= ~(HITMARKER_NO_PPDEDUCT);
|
gHitMarker &= ~HITMARKER_NO_PPDEDUCT;
|
||||||
gBattlescriptCurrInstr++;
|
gBattlescriptCurrInstr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1869,7 +1869,7 @@ static void Cmd_datahpupdate(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_IGNORE_SUBSTITUTE);
|
gHitMarker &= ~HITMARKER_IGNORE_SUBSTITUTE;
|
||||||
if (gBattleMoveDamage < 0) // hp goes up
|
if (gBattleMoveDamage < 0) // hp goes up
|
||||||
{
|
{
|
||||||
gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
|
gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
|
||||||
@ -1879,9 +1879,9 @@ static void Cmd_datahpupdate(void)
|
|||||||
}
|
}
|
||||||
else // hp goes down
|
else // hp goes down
|
||||||
{
|
{
|
||||||
if (gHitMarker & HITMARKER_x20)
|
if (gHitMarker & HITMARKER_SKIP_DMG_TRACK)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_x20);
|
gHitMarker &= ~HITMARKER_SKIP_DMG_TRACK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1903,10 +1903,10 @@ static void Cmd_datahpupdate(void)
|
|||||||
gBattleMons[gActiveBattler].hp = 0;
|
gBattleMons[gActiveBattler].hp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_x100000))
|
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||||
gSpecialStatuses[gActiveBattler].dmg = gHpDealt;
|
gSpecialStatuses[gActiveBattler].dmg = gHpDealt;
|
||||||
|
|
||||||
if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_x100000) && gCurrentMove != MOVE_PAIN_SPLIT)
|
if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT)
|
||||||
{
|
{
|
||||||
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
|
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
|
||||||
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
|
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
|
||||||
@ -1921,7 +1921,7 @@ static void Cmd_datahpupdate(void)
|
|||||||
gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerTarget;
|
gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_x100000))
|
else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||||
{
|
{
|
||||||
gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
|
gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
|
||||||
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
|
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
|
||||||
@ -1937,7 +1937,7 @@ static void Cmd_datahpupdate(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gHitMarker &= ~(HITMARKER_x100000);
|
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
|
||||||
BtlController_EmitSetMonData(0, REQUEST_HP_BATTLE, 0, 2, &gBattleMons[gActiveBattler].hp);
|
BtlController_EmitSetMonData(0, REQUEST_HP_BATTLE, 0, 2, &gBattleMons[gActiveBattler].hp);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -1972,7 +1972,7 @@ static void Cmd_effectivenesssound(void)
|
|||||||
gActiveBattler = gBattlerTarget;
|
gActiveBattler = gBattlerTarget;
|
||||||
if (!(gMoveResultFlags & MOVE_RESULT_MISSED))
|
if (!(gMoveResultFlags & MOVE_RESULT_MISSED))
|
||||||
{
|
{
|
||||||
switch (gMoveResultFlags & (u8)(~(MOVE_RESULT_MISSED)))
|
switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED))
|
||||||
{
|
{
|
||||||
case MOVE_RESULT_SUPER_EFFECTIVE:
|
case MOVE_RESULT_SUPER_EFFECTIVE:
|
||||||
BtlController_EmitPlaySE(0, SE_SUPER_EFFECTIVE);
|
BtlController_EmitPlaySE(0, SE_SUPER_EFFECTIVE);
|
||||||
@ -2026,7 +2026,7 @@ static void Cmd_resultmessage(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
gBattleCommunication[MSG_DISPLAY] = 1;
|
gBattleCommunication[MSG_DISPLAY] = 1;
|
||||||
switch (gMoveResultFlags & (u8)(~(MOVE_RESULT_MISSED)))
|
switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED))
|
||||||
{
|
{
|
||||||
case MOVE_RESULT_SUPER_EFFECTIVE:
|
case MOVE_RESULT_SUPER_EFFECTIVE:
|
||||||
stringId = STRINGID_SUPEREFFECTIVE;
|
stringId = STRINGID_SUPEREFFECTIVE;
|
||||||
@ -2060,9 +2060,9 @@ static void Cmd_resultmessage(void)
|
|||||||
}
|
}
|
||||||
else if (gMoveResultFlags & MOVE_RESULT_ONE_HIT_KO)
|
else if (gMoveResultFlags & MOVE_RESULT_ONE_HIT_KO)
|
||||||
{
|
{
|
||||||
gMoveResultFlags &= ~(MOVE_RESULT_ONE_HIT_KO);
|
gMoveResultFlags &= ~MOVE_RESULT_ONE_HIT_KO;
|
||||||
gMoveResultFlags &= ~(MOVE_RESULT_SUPER_EFFECTIVE);
|
gMoveResultFlags &= ~MOVE_RESULT_SUPER_EFFECTIVE;
|
||||||
gMoveResultFlags &= ~(MOVE_RESULT_NOT_VERY_EFFECTIVE);
|
gMoveResultFlags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
gBattlescriptCurrInstr = BattleScript_OneHitKOMsg;
|
gBattlescriptCurrInstr = BattleScript_OneHitKOMsg;
|
||||||
return;
|
return;
|
||||||
@ -2206,7 +2206,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_AFFECTS_USER)
|
if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_AFFECTS_USER)
|
||||||
{
|
{
|
||||||
gEffectBattler = gBattlerAttacker; // battlerId that effects get applied on
|
gEffectBattler = gBattlerAttacker; // battlerId that effects get applied on
|
||||||
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~(MOVE_EFFECT_AFFECTS_USER);
|
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~MOVE_EFFECT_AFFECTS_USER;
|
||||||
affectsUser = MOVE_EFFECT_AFFECTS_USER;
|
affectsUser = MOVE_EFFECT_AFFECTS_USER;
|
||||||
gBattleScripting.battler = gBattlerTarget; // theoretically the attacker
|
gBattleScripting.battler = gBattlerTarget; // theoretically the attacker
|
||||||
}
|
}
|
||||||
@ -2273,7 +2273,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2314,7 +2314,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2370,7 +2370,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2398,7 +2398,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2424,8 +2424,8 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// It's redundant, because at this point we know the status1 value is 0.
|
// It's redundant, because at this point we know the status1 value is 0.
|
||||||
gBattleMons[gEffectBattler].status1 &= ~(STATUS1_TOXIC_POISON);
|
gBattleMons[gEffectBattler].status1 &= ~STATUS1_TOXIC_POISON;
|
||||||
gBattleMons[gEffectBattler].status1 &= ~(STATUS1_POISON);
|
gBattleMons[gEffectBattler].status1 &= ~STATUS1_POISON;
|
||||||
statusChanged = TRUE;
|
statusChanged = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2453,7 +2453,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
|
||||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2790,7 +2790,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gBattleMons[gBattlerTarget].status1 &= ~(STATUS1_PARALYSIS);
|
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_PARALYSIS;
|
||||||
|
|
||||||
gActiveBattler = gBattlerTarget;
|
gActiveBattler = gBattlerTarget;
|
||||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
||||||
@ -2881,7 +2881,7 @@ static void Cmd_seteffectwithchance(void)
|
|||||||
if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_CERTAIN
|
if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_CERTAIN
|
||||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
||||||
{
|
{
|
||||||
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~(MOVE_EFFECT_CERTAIN);
|
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~MOVE_EFFECT_CERTAIN;
|
||||||
SetMoveEffect(FALSE, MOVE_EFFECT_CERTAIN);
|
SetMoveEffect(FALSE, MOVE_EFFECT_CERTAIN);
|
||||||
}
|
}
|
||||||
else if (Random() % 100 < percentChance
|
else if (Random() % 100 < percentChance
|
||||||
@ -2939,7 +2939,7 @@ static void Cmd_tryfaintmon(void)
|
|||||||
|
|
||||||
BattleScriptPop();
|
BattleScriptPop();
|
||||||
gBattlescriptCurrInstr = BS_ptr;
|
gBattlescriptCurrInstr = BS_ptr;
|
||||||
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED);
|
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~SIDE_STATUS_SPIKES_DAMAGED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2970,7 +2970,7 @@ static void Cmd_tryfaintmon(void)
|
|||||||
gBattlescriptCurrInstr = BS_ptr;
|
gBattlescriptCurrInstr = BS_ptr;
|
||||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||||
{
|
{
|
||||||
gHitMarker |= HITMARKER_x400000;
|
gHitMarker |= HITMARKER_PLAYER_FAINTED;
|
||||||
if (gBattleResults.playerFaintCounter < 0xFF)
|
if (gBattleResults.playerFaintCounter < 0xFF)
|
||||||
gBattleResults.playerFaintCounter++;
|
gBattleResults.playerFaintCounter++;
|
||||||
AdjustFriendshipOnBattleFaint(gActiveBattler);
|
AdjustFriendshipOnBattleFaint(gActiveBattler);
|
||||||
@ -2983,7 +2983,7 @@ static void Cmd_tryfaintmon(void)
|
|||||||
}
|
}
|
||||||
if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0)
|
if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_DESTINYBOND);
|
gHitMarker &= ~HITMARKER_DESTINYBOND;
|
||||||
BattleScriptPush(gBattlescriptCurrInstr);
|
BattleScriptPush(gBattlescriptCurrInstr);
|
||||||
gBattleMoveDamage = gBattleMons[battlerId].hp;
|
gBattleMoveDamage = gBattleMons[battlerId].hp;
|
||||||
gBattlescriptCurrInstr = BattleScript_DestinyBondTakesLife;
|
gBattlescriptCurrInstr = BattleScript_DestinyBondTakesLife;
|
||||||
@ -3581,8 +3581,8 @@ static void MoveValuesCleanUp(void)
|
|||||||
gCritMultiplier = 1;
|
gCritMultiplier = 1;
|
||||||
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
|
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
|
||||||
gBattleCommunication[MISS_TYPE] = 0;
|
gBattleCommunication[MISS_TYPE] = 0;
|
||||||
gHitMarker &= ~(HITMARKER_DESTINYBOND);
|
gHitMarker &= ~HITMARKER_DESTINYBOND;
|
||||||
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
|
gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Cmd_movevaluescleanup(void)
|
static void Cmd_movevaluescleanup(void)
|
||||||
@ -4217,7 +4217,7 @@ static void Cmd_moveend(void)
|
|||||||
&& gSpecialStatuses[gBattlerTarget].specialDmg
|
&& gSpecialStatuses[gBattlerTarget].specialDmg
|
||||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && moveType == TYPE_FIRE)
|
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && moveType == TYPE_FIRE)
|
||||||
{
|
{
|
||||||
gBattleMons[gBattlerTarget].status1 &= ~(STATUS1_FREEZE);
|
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE;
|
||||||
gActiveBattler = gBattlerTarget;
|
gActiveBattler = gBattlerTarget;
|
||||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gBattlerTarget].status1);
|
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gBattlerTarget].status1);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
@ -4313,7 +4313,7 @@ static void Cmd_moveend(void)
|
|||||||
gActiveBattler = gBattlerAttacker;
|
gActiveBattler = gBattlerAttacker;
|
||||||
BtlController_EmitSpriteInvisibility(0, FALSE);
|
BtlController_EmitSpriteInvisibility(0, FALSE);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE);
|
gStatuses3[gBattlerAttacker] &= ~STATUS3_SEMI_INVULNERABLE;
|
||||||
gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1;
|
gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1;
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
return;
|
return;
|
||||||
@ -4327,7 +4327,7 @@ static void Cmd_moveend(void)
|
|||||||
gActiveBattler = gBattlerTarget;
|
gActiveBattler = gBattlerTarget;
|
||||||
BtlController_EmitSpriteInvisibility(0, FALSE);
|
BtlController_EmitSpriteInvisibility(0, FALSE);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
gStatuses3[gBattlerTarget] &= ~(STATUS3_SEMI_INVULNERABLE);
|
gStatuses3[gBattlerTarget] &= ~STATUS3_SEMI_INVULNERABLE;
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4337,7 +4337,7 @@ static void Cmd_moveend(void)
|
|||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
if (gDisableStructs[i].substituteHP == 0)
|
if (gDisableStructs[i].substituteHP == 0)
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_SUBSTITUTE);
|
gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE;
|
||||||
}
|
}
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
break;
|
break;
|
||||||
@ -4347,7 +4347,7 @@ static void Cmd_moveend(void)
|
|||||||
gActiveBattler = gBattlerAttacker;
|
gActiveBattler = gBattlerAttacker;
|
||||||
gBattlerAttacker = gBattlerTarget;
|
gBattlerAttacker = gBattlerTarget;
|
||||||
gBattlerTarget = gActiveBattler;
|
gBattlerTarget = gActiveBattler;
|
||||||
gHitMarker &= ~(HITMARKER_SWAP_ATTACKER_TARGET);
|
gHitMarker &= ~HITMARKER_SWAP_ATTACKER_TARGET;
|
||||||
}
|
}
|
||||||
if (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED)
|
if (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED)
|
||||||
{
|
{
|
||||||
@ -4657,7 +4657,7 @@ static void Cmd_jumpifcantswitch(void)
|
|||||||
s32 lastMonId;
|
s32 lastMonId;
|
||||||
struct Pokemon *party;
|
struct Pokemon *party;
|
||||||
|
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(SWITCH_IGNORE_ESCAPE_PREVENTION));
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~SWITCH_IGNORE_ESCAPE_PREVENTION);
|
||||||
|
|
||||||
if (!(gBattlescriptCurrInstr[1] & SWITCH_IGNORE_ESCAPE_PREVENTION)
|
if (!(gBattlescriptCurrInstr[1] & SWITCH_IGNORE_ESCAPE_PREVENTION)
|
||||||
&& ((gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION))
|
&& ((gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION))
|
||||||
@ -4837,7 +4837,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE))
|
if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE))
|
||||||
{
|
{
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
BtlController_EmitLinkStandbyMsg(0, 2, FALSE);
|
BtlController_EmitLinkStandbyMsg(0, 2, FALSE);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -4866,7 +4866,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
if (HasNoMonsToSwitch(0, PARTY_SIZE, PARTY_SIZE))
|
if (HasNoMonsToSwitch(0, PARTY_SIZE, PARTY_SIZE))
|
||||||
{
|
{
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
BtlController_EmitCantSwitch(0);
|
BtlController_EmitCantSwitch(0);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -4888,7 +4888,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
if (HasNoMonsToSwitch(2, PARTY_SIZE, PARTY_SIZE))
|
if (HasNoMonsToSwitch(2, PARTY_SIZE, PARTY_SIZE))
|
||||||
{
|
{
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
BtlController_EmitCantSwitch(0);
|
BtlController_EmitCantSwitch(0);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -4909,7 +4909,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
if (HasNoMonsToSwitch(1, PARTY_SIZE, PARTY_SIZE))
|
if (HasNoMonsToSwitch(1, PARTY_SIZE, PARTY_SIZE))
|
||||||
{
|
{
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
BtlController_EmitCantSwitch(0);
|
BtlController_EmitCantSwitch(0);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -4931,7 +4931,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
if (HasNoMonsToSwitch(3, PARTY_SIZE, PARTY_SIZE))
|
if (HasNoMonsToSwitch(3, PARTY_SIZE, PARTY_SIZE))
|
||||||
{
|
{
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
BtlController_EmitCantSwitch(0);
|
BtlController_EmitCantSwitch(0);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -4994,7 +4994,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], PARTY_SIZE))
|
if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], PARTY_SIZE))
|
||||||
{
|
{
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
BtlController_EmitCantSwitch(0);
|
BtlController_EmitCantSwitch(0);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -5010,7 +5010,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], PARTY_SIZE))
|
if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], PARTY_SIZE))
|
||||||
{
|
{
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
BtlController_EmitCantSwitch(0);
|
BtlController_EmitCantSwitch(0);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -5049,7 +5049,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
else
|
else
|
||||||
hitmarkerFaintBits = PARTY_ACTION_SEND_OUT;
|
hitmarkerFaintBits = PARTY_ACTION_SEND_OUT;
|
||||||
|
|
||||||
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(PARTY_SCREEN_OPTIONAL));
|
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~PARTY_SCREEN_OPTIONAL);
|
||||||
if (gSpecialStatuses[battlerId].flag40)
|
if (gSpecialStatuses[battlerId].flag40)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr += 6;
|
gBattlescriptCurrInstr += 6;
|
||||||
@ -5058,7 +5058,7 @@ static void Cmd_openpartyscreen(void)
|
|||||||
{
|
{
|
||||||
gActiveBattler = battlerId;
|
gActiveBattler = battlerId;
|
||||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
gBattlescriptCurrInstr = jumpPtr;
|
gBattlescriptCurrInstr = jumpPtr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -5174,7 +5174,7 @@ static void Cmd_switchineffects(void)
|
|||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
UpdateSentPokesToOpponentValue(gActiveBattler);
|
UpdateSentPokesToOpponentValue(gActiveBattler);
|
||||||
|
|
||||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||||
gSpecialStatuses[gActiveBattler].flag40 = 0;
|
gSpecialStatuses[gActiveBattler].flag40 = 0;
|
||||||
|
|
||||||
if (!(gSideStatuses[GetBattlerSide(gActiveBattler)] & SIDE_STATUS_SPIKES_DAMAGED)
|
if (!(gSideStatuses[GetBattlerSide(gActiveBattler)] & SIDE_STATUS_SPIKES_DAMAGED)
|
||||||
@ -5186,8 +5186,8 @@ static void Cmd_switchineffects(void)
|
|||||||
|
|
||||||
gSideStatuses[GetBattlerSide(gActiveBattler)] |= SIDE_STATUS_SPIKES_DAMAGED;
|
gSideStatuses[GetBattlerSide(gActiveBattler)] |= SIDE_STATUS_SPIKES_DAMAGED;
|
||||||
|
|
||||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_DESTINY_BOND);
|
gBattleMons[gActiveBattler].status2 &= ~STATUS2_DESTINY_BOND;
|
||||||
gHitMarker &= ~(HITMARKER_DESTINYBOND);
|
gHitMarker &= ~HITMARKER_DESTINYBOND;
|
||||||
|
|
||||||
spikesDmg = (5 - gSideTimers[GetBattlerSide(gActiveBattler)].spikesAmount) * 2;
|
spikesDmg = (5 - gSideTimers[GetBattlerSide(gActiveBattler)].spikesAmount) * 2;
|
||||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (spikesDmg);
|
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (spikesDmg);
|
||||||
@ -5216,7 +5216,7 @@ static void Cmd_switchineffects(void)
|
|||||||
if (!AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0)
|
if (!AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0)
|
||||||
&& !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE))
|
&& !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE))
|
||||||
{
|
{
|
||||||
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED);
|
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~SIDE_STATUS_SPIKES_DAMAGED;
|
||||||
|
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
@ -5632,7 +5632,7 @@ static void Cmd_swapattackerwithtarget(void)
|
|||||||
gBattlerTarget = gActiveBattler;
|
gBattlerTarget = gActiveBattler;
|
||||||
|
|
||||||
if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET)
|
if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET)
|
||||||
gHitMarker &= ~(HITMARKER_SWAP_ATTACKER_TARGET);
|
gHitMarker &= ~HITMARKER_SWAP_ATTACKER_TARGET;
|
||||||
else
|
else
|
||||||
gHitMarker |= HITMARKER_SWAP_ATTACKER_TARGET;
|
gHitMarker |= HITMARKER_SWAP_ATTACKER_TARGET;
|
||||||
|
|
||||||
@ -6315,13 +6315,13 @@ static void Cmd_various(void)
|
|||||||
*choicedMove = 0;
|
*choicedMove = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case VARIOUS_RESET_PLAYER_FAINTED:
|
||||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE))
|
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE))
|
||||||
&& gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
&& gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||||
&& gBattleMons[0].hp != 0
|
&& gBattleMons[0].hp != 0
|
||||||
&& gBattleMons[1].hp != 0)
|
&& gBattleMons[1].hp != 0)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_x400000);
|
gHitMarker &= ~HITMARKER_PLAYER_FAINTED;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VARIOUS_PALACE_FLAVOR_TEXT:
|
case VARIOUS_PALACE_FLAVOR_TEXT:
|
||||||
@ -6355,7 +6355,7 @@ static void Cmd_various(void)
|
|||||||
case VARIOUS_ARENA_PLAYER_MON_LOST:
|
case VARIOUS_ARENA_PLAYER_MON_LOST:
|
||||||
gBattleMons[0].hp = 0;
|
gBattleMons[0].hp = 0;
|
||||||
gHitMarker |= HITMARKER_FAINTED(0);
|
gHitMarker |= HITMARKER_FAINTED(0);
|
||||||
gHitMarker |= HITMARKER_x400000;
|
gHitMarker |= HITMARKER_PLAYER_FAINTED;
|
||||||
gBattleStruct->arenaLostPlayerMons |= gBitTable[gBattlerPartyIndexes[0]];
|
gBattleStruct->arenaLostPlayerMons |= gBitTable[gBattlerPartyIndexes[0]];
|
||||||
gDisableStructs[0].truantSwitchInHack = 1;
|
gDisableStructs[0].truantSwitchInHack = 1;
|
||||||
break;
|
break;
|
||||||
@ -6364,7 +6364,7 @@ static void Cmd_various(void)
|
|||||||
gBattleMons[1].hp = 0;
|
gBattleMons[1].hp = 0;
|
||||||
gHitMarker |= HITMARKER_FAINTED(0);
|
gHitMarker |= HITMARKER_FAINTED(0);
|
||||||
gHitMarker |= HITMARKER_FAINTED(1);
|
gHitMarker |= HITMARKER_FAINTED(1);
|
||||||
gHitMarker |= HITMARKER_x400000;
|
gHitMarker |= HITMARKER_PLAYER_FAINTED;
|
||||||
gBattleStruct->arenaLostPlayerMons |= gBitTable[gBattlerPartyIndexes[0]];
|
gBattleStruct->arenaLostPlayerMons |= gBitTable[gBattlerPartyIndexes[0]];
|
||||||
gBattleStruct->arenaLostOpponentMons |= gBitTable[gBattlerPartyIndexes[1]];
|
gBattleStruct->arenaLostOpponentMons |= gBitTable[gBattlerPartyIndexes[1]];
|
||||||
gDisableStructs[0].truantSwitchInHack = 1;
|
gDisableStructs[0].truantSwitchInHack = 1;
|
||||||
@ -6374,11 +6374,11 @@ static void Cmd_various(void)
|
|||||||
BtlController_EmitYesNoBox(0);
|
BtlController_EmitYesNoBox(0);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
break;
|
break;
|
||||||
case 14:
|
case VARIOUS_DRAW_ARENA_REF_TEXT_BOX:
|
||||||
DrawArenaRefereeTextBox();
|
DrawArenaRefereeTextBox();
|
||||||
break;
|
break;
|
||||||
case 15:
|
case VARIOUS_ERASE_ARENA_REF_TEXT_BOX:
|
||||||
RemoveArenaRefereeTextBox();
|
EraseArenaRefereeTextBox();
|
||||||
break;
|
break;
|
||||||
case VARIOUS_ARENA_JUDGMENT_STRING:
|
case VARIOUS_ARENA_JUDGMENT_STRING:
|
||||||
BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]);
|
BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]);
|
||||||
@ -6420,8 +6420,8 @@ static void Cmd_various(void)
|
|||||||
case VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT:
|
case VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT:
|
||||||
gBattleStruct->alreadyStatusedMoveAttempt |= gBitTable[gActiveBattler];
|
gBattleStruct->alreadyStatusedMoveAttempt |= gBitTable[gActiveBattler];
|
||||||
break;
|
break;
|
||||||
case 24:
|
case VARIOUS_PALACE_TRY_ESCAPE_STATUS:
|
||||||
if (sub_805725C(gActiveBattler))
|
if (BattlePalace_TryEscapeStatus(gActiveBattler))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case VARIOUS_SET_TELEPORT_OUTCOME:
|
case VARIOUS_SET_TELEPORT_OUTCOME:
|
||||||
@ -6595,14 +6595,14 @@ static void Cmd_trymirrormove(void)
|
|||||||
|
|
||||||
if (move != 0 && move != 0xFFFF)
|
if (move != 0 && move != 0xFFFF)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||||
gCurrentMove = move;
|
gCurrentMove = move;
|
||||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||||
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
||||||
}
|
}
|
||||||
else if (validMovesCount)
|
else if (validMovesCount)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||||
i = Random() % validMovesCount;
|
i = Random() % validMovesCount;
|
||||||
gCurrentMove = movesArray[i];
|
gCurrentMove = movesArray[i];
|
||||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||||
@ -6882,15 +6882,15 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
|
|||||||
else
|
else
|
||||||
gActiveBattler = gBattlerTarget;
|
gActiveBattler = gBattlerTarget;
|
||||||
|
|
||||||
flags &= ~(MOVE_EFFECT_AFFECTS_USER);
|
flags &= ~MOVE_EFFECT_AFFECTS_USER;
|
||||||
|
|
||||||
if (flags & MOVE_EFFECT_CERTAIN)
|
if (flags & MOVE_EFFECT_CERTAIN)
|
||||||
certain++;
|
certain++;
|
||||||
flags &= ~(MOVE_EFFECT_CERTAIN);
|
flags &= ~MOVE_EFFECT_CERTAIN;
|
||||||
|
|
||||||
if (flags & STAT_BUFF_NOT_PROTECT_AFFECTED)
|
if (flags & STAT_BUFF_NOT_PROTECT_AFFECTED)
|
||||||
notProtectAffected++;
|
notProtectAffected++;
|
||||||
flags &= ~(STAT_BUFF_NOT_PROTECT_AFFECTED);
|
flags &= ~STAT_BUFF_NOT_PROTECT_AFFECTED;
|
||||||
|
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId)
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId)
|
||||||
|
|
||||||
@ -7719,7 +7719,7 @@ static void Cmd_setsubstitute(void)
|
|||||||
gBattleMoveDamage = 1;
|
gBattleMoveDamage = 1;
|
||||||
|
|
||||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE;
|
gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE;
|
||||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED);
|
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
||||||
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage;
|
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage;
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE;
|
||||||
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE;
|
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE;
|
||||||
@ -7803,7 +7803,7 @@ static void Cmd_metronome(void)
|
|||||||
|
|
||||||
if (sMovesForbiddenToCopy[i] == METRONOME_FORBIDDEN_END)
|
if (sMovesForbiddenToCopy[i] == METRONOME_FORBIDDEN_END)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||||
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
||||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||||
return;
|
return;
|
||||||
@ -8019,7 +8019,7 @@ static void Cmd_settypetorandomresistance(void) // conversion 2
|
|||||||
|
|
||||||
static void Cmd_setalwayshitflag(void)
|
static void Cmd_setalwayshitflag(void)
|
||||||
{
|
{
|
||||||
gStatuses3[gBattlerTarget] &= ~(STATUS3_ALWAYS_HITS);
|
gStatuses3[gBattlerTarget] &= ~STATUS3_ALWAYS_HITS;
|
||||||
gStatuses3[gBattlerTarget] |= STATUS3_ALWAYS_HITS_TURN(2);
|
gStatuses3[gBattlerTarget] |= STATUS3_ALWAYS_HITS_TURN(2);
|
||||||
gDisableStructs[gBattlerTarget].battlerWithSureHit = gBattlerAttacker;
|
gDisableStructs[gBattlerTarget].battlerWithSureHit = gBattlerAttacker;
|
||||||
gBattlescriptCurrInstr++;
|
gBattlescriptCurrInstr++;
|
||||||
@ -8137,7 +8137,7 @@ static void Cmd_trychoosesleeptalkmove(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~(MOVE_LIMITATION_PP));
|
unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~MOVE_LIMITATION_PP);
|
||||||
if (unusableMovesBits == 0xF) // all 4 moves cannot be chosen
|
if (unusableMovesBits == 0xF) // all 4 moves cannot be chosen
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr += 5;
|
gBattlescriptCurrInstr += 5;
|
||||||
@ -8153,7 +8153,7 @@ static void Cmd_trychoosesleeptalkmove(void)
|
|||||||
|
|
||||||
gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition];
|
gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition];
|
||||||
gCurrMovePos = movePosition;
|
gCurrMovePos = movePosition;
|
||||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||||
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
||||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
}
|
}
|
||||||
@ -8269,7 +8269,7 @@ static void Cmd_healpartystatus(void)
|
|||||||
if (gBattleMons[gBattlerAttacker].ability != ABILITY_SOUNDPROOF)
|
if (gBattleMons[gBattlerAttacker].ability != ABILITY_SOUNDPROOF)
|
||||||
{
|
{
|
||||||
gBattleMons[gBattlerAttacker].status1 = 0;
|
gBattleMons[gBattlerAttacker].status1 = 0;
|
||||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -8285,7 +8285,7 @@ static void Cmd_healpartystatus(void)
|
|||||||
if (gBattleMons[gActiveBattler].ability != ABILITY_SOUNDPROOF)
|
if (gBattleMons[gActiveBattler].ability != ABILITY_SOUNDPROOF)
|
||||||
{
|
{
|
||||||
gBattleMons[gActiveBattler].status1 = 0;
|
gBattleMons[gActiveBattler].status1 = 0;
|
||||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -8325,14 +8325,14 @@ static void Cmd_healpartystatus(void)
|
|||||||
toHeal = 0x3F;
|
toHeal = 0x3F;
|
||||||
|
|
||||||
gBattleMons[gBattlerAttacker].status1 = 0;
|
gBattleMons[gBattlerAttacker].status1 = 0;
|
||||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE;
|
||||||
|
|
||||||
gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK);
|
gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK);
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
||||||
&& !(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
|
&& !(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
|
||||||
{
|
{
|
||||||
gBattleMons[gActiveBattler].status1 = 0;
|
gBattleMons[gActiveBattler].status1 = 0;
|
||||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -8435,7 +8435,7 @@ static void Cmd_rolloutdamagecalculation(void)
|
|||||||
}
|
}
|
||||||
if (--gDisableStructs[gBattlerAttacker].rolloutTimer == 0) // last hit
|
if (--gDisableStructs[gBattlerAttacker].rolloutTimer == 0) // last hit
|
||||||
{
|
{
|
||||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_MULTIPLETURNS);
|
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
|
||||||
}
|
}
|
||||||
|
|
||||||
gDynamicBasePower = gBattleMoves[gCurrentMove].power;
|
gDynamicBasePower = gBattleMoves[gCurrentMove].power;
|
||||||
@ -8515,7 +8515,7 @@ static void Cmd_presentdamagecalculation(void)
|
|||||||
gBattlescriptCurrInstr = BattleScript_AlreadyAtFullHp;
|
gBattlescriptCurrInstr = BattleScript_AlreadyAtFullHp;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gMoveResultFlags &= ~(MOVE_RESULT_DOESNT_AFFECT_FOE);
|
gMoveResultFlags &= ~MOVE_RESULT_DOESNT_AFFECT_FOE;
|
||||||
gBattlescriptCurrInstr = BattleScript_PresentHealTarget;
|
gBattlescriptCurrInstr = BattleScript_PresentHealTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8628,7 +8628,7 @@ static void Cmd_jumpifnopursuitswitchdmg(void)
|
|||||||
gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerTarget);
|
gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerTarget);
|
||||||
gBattlescriptCurrInstr += 5;
|
gBattlescriptCurrInstr += 5;
|
||||||
gBattleScripting.animTurn = 1;
|
gBattleScripting.animTurn = 1;
|
||||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -8693,7 +8693,7 @@ static void Cmd_rapidspinfree(void)
|
|||||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_WRAPPED)
|
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_WRAPPED)
|
||||||
{
|
{
|
||||||
gBattleScripting.battler = gBattlerTarget;
|
gBattleScripting.battler = gBattlerTarget;
|
||||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED);
|
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
||||||
gBattlerTarget = *(gBattleStruct->wrappedBy + gBattlerAttacker);
|
gBattlerTarget = *(gBattleStruct->wrappedBy + gBattlerAttacker);
|
||||||
|
|
||||||
gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN;
|
gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN;
|
||||||
@ -8707,14 +8707,14 @@ static void Cmd_rapidspinfree(void)
|
|||||||
}
|
}
|
||||||
else if (gStatuses3[gBattlerAttacker] & STATUS3_LEECHSEED)
|
else if (gStatuses3[gBattlerAttacker] & STATUS3_LEECHSEED)
|
||||||
{
|
{
|
||||||
gStatuses3[gBattlerAttacker] &= ~(STATUS3_LEECHSEED);
|
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED;
|
||||||
gStatuses3[gBattlerAttacker] &= ~(STATUS3_LEECHSEED_BATTLER);
|
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED_BATTLER;
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
gBattlescriptCurrInstr = BattleScript_LeechSeedFree;
|
gBattlescriptCurrInstr = BattleScript_LeechSeedFree;
|
||||||
}
|
}
|
||||||
else if (gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_SPIKES)
|
else if (gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_SPIKES)
|
||||||
{
|
{
|
||||||
gSideStatuses[GetBattlerSide(gBattlerAttacker)] &= ~(SIDE_STATUS_SPIKES);
|
gSideStatuses[GetBattlerSide(gBattlerAttacker)] &= ~SIDE_STATUS_SPIKES;
|
||||||
gSideTimers[GetBattlerSide(gBattlerAttacker)].spikesAmount = 0;
|
gSideTimers[GetBattlerSide(gBattlerAttacker)].spikesAmount = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
gBattlescriptCurrInstr = BattleScript_SpikesFree;
|
gBattlescriptCurrInstr = BattleScript_SpikesFree;
|
||||||
@ -8970,7 +8970,7 @@ static void Cmd_setcharge(void)
|
|||||||
|
|
||||||
static void Cmd_callterrainattack(void) // nature power
|
static void Cmd_callterrainattack(void) // nature power
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||||
gCurrentMove = sNaturePowerMoves[gBattleTerrain];
|
gCurrentMove = sNaturePowerMoves[gBattleTerrain];
|
||||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||||
BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]);
|
BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]);
|
||||||
@ -9380,7 +9380,7 @@ static void Cmd_assistattackselect(void)
|
|||||||
}
|
}
|
||||||
if (chooseableMovesNo)
|
if (chooseableMovesNo)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||||
gCalledMove = movesArray[((Random() & 0xFF) * chooseableMovesNo) >> 8];
|
gCalledMove = movesArray[((Random() & 0xFF) * chooseableMovesNo) >> 8];
|
||||||
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
||||||
gBattlescriptCurrInstr += 5;
|
gBattlescriptCurrInstr += 5;
|
||||||
@ -9736,8 +9736,8 @@ static void Cmd_removelightscreenreflect(void) // brick break
|
|||||||
|
|
||||||
if (gSideTimers[opposingSide].reflectTimer || gSideTimers[opposingSide].lightscreenTimer)
|
if (gSideTimers[opposingSide].reflectTimer || gSideTimers[opposingSide].lightscreenTimer)
|
||||||
{
|
{
|
||||||
gSideStatuses[opposingSide] &= ~(SIDE_STATUS_REFLECT);
|
gSideStatuses[opposingSide] &= ~SIDE_STATUS_REFLECT;
|
||||||
gSideStatuses[opposingSide] &= ~(SIDE_STATUS_LIGHTSCREEN);
|
gSideStatuses[opposingSide] &= ~SIDE_STATUS_LIGHTSCREEN;
|
||||||
gSideTimers[opposingSide].reflectTimer = 0;
|
gSideTimers[opposingSide].reflectTimer = 0;
|
||||||
gSideTimers[opposingSide].lightscreenTimer = 0;
|
gSideTimers[opposingSide].lightscreenTimer = 0;
|
||||||
gBattleScripting.animTurn = 1;
|
gBattleScripting.animTurn = 1;
|
||||||
|
@ -646,9 +646,9 @@ void HandleAction_NothingIsFainted(void)
|
|||||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
||||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_x100000
|
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
|
||||||
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
|
||||||
| HITMARKER_CHARGING | HITMARKER_x4000000);
|
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleAction_ActionFinished(void)
|
void HandleAction_ActionFinished(void)
|
||||||
@ -659,9 +659,9 @@ void HandleAction_ActionFinished(void)
|
|||||||
SpecialStatusesClear();
|
SpecialStatusesClear();
|
||||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
||||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_x100000
|
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
|
||||||
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
|
||||||
| HITMARKER_CHARGING | HITMARKER_x4000000);
|
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
|
||||||
|
|
||||||
gCurrentMove = 0;
|
gCurrentMove = 0;
|
||||||
gBattleMoveDamage = 0;
|
gBattleMoveDamage = 0;
|
||||||
@ -1443,7 +1443,7 @@ u8 DoBattlerEndTurnEffects(void)
|
|||||||
{
|
{
|
||||||
u8 effect = 0;
|
u8 effect = 0;
|
||||||
|
|
||||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
|
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
|
||||||
{
|
{
|
||||||
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
||||||
@ -1756,13 +1756,13 @@ u8 DoBattlerEndTurnEffects(void)
|
|||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 HandleWishPerishSongOnTurnEnd(void)
|
bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||||
{
|
{
|
||||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
|
|
||||||
switch (gBattleStruct->wishPerishSongState)
|
switch (gBattleStruct->wishPerishSongState)
|
||||||
{
|
{
|
||||||
@ -1862,7 +1862,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -4067,7 +4067,7 @@ u8 IsMonDisobedient(void)
|
|||||||
gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
||||||
gBattlescriptCurrInstr = BattleScript_IgnoresAndUsesRandomMove;
|
gBattlescriptCurrInstr = BattleScript_IgnoresAndUsesRandomMove;
|
||||||
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
||||||
gHitMarker |= HITMARKER_x200000;
|
gHitMarker |= HITMARKER_DISOBEDIENT_MOVE;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,9 @@ void SwitchPartyOrderInGameMulti(u8 battlerId, u8 arg1)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sub_805725C(u8 battlerId)
|
// Called when a Pokémon is unable to attack during a Battle Palace battle.
|
||||||
|
// Check if it was because they are frozen/asleep, and if so try to cure the status.
|
||||||
|
u32 BattlePalace_TryEscapeStatus(u8 battlerId)
|
||||||
{
|
{
|
||||||
u32 effect = 0;
|
u32 effect = 0;
|
||||||
|
|
||||||
@ -134,6 +136,7 @@ u32 sub_805725C(u8 battlerId)
|
|||||||
{
|
{
|
||||||
if (UproarWakeUpCheck(battlerId))
|
if (UproarWakeUpCheck(battlerId))
|
||||||
{
|
{
|
||||||
|
// Wake up from Uproar
|
||||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
@ -150,6 +153,7 @@ u32 sub_805725C(u8 battlerId)
|
|||||||
else
|
else
|
||||||
toSub = 1;
|
toSub = 1;
|
||||||
|
|
||||||
|
// Reduce number of sleep turns
|
||||||
if ((gBattleMons[battlerId].status1 & STATUS1_SLEEP) < toSub)
|
if ((gBattleMons[battlerId].status1 & STATUS1_SLEEP) < toSub)
|
||||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||||
else
|
else
|
||||||
@ -157,11 +161,13 @@ u32 sub_805725C(u8 battlerId)
|
|||||||
|
|
||||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||||
{
|
{
|
||||||
|
// Still asleep
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep;
|
gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep;
|
||||||
effect = 2;
|
effect = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Wake up
|
||||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
|
||||||
@ -177,10 +183,12 @@ u32 sub_805725C(u8 battlerId)
|
|||||||
{
|
{
|
||||||
if (Random() % 5 != 0)
|
if (Random() % 5 != 0)
|
||||||
{
|
{
|
||||||
|
// Still frozen
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsFrozen;
|
gBattlescriptCurrInstr = BattleScript_MoveUsedIsFrozen;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Unfreeze
|
||||||
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
|
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
|
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
|
||||||
@ -193,7 +201,7 @@ u32 sub_805725C(u8 battlerId)
|
|||||||
case 2:
|
case 2:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// Loop until reaching the final state, or stop early if Pokémon was Asleep/Frozen
|
||||||
} while (gBattleCommunication[MULTIUSE_STATE] != 2 && effect == 0);
|
} while (gBattleCommunication[MULTIUSE_STATE] != 2 && effect == 0);
|
||||||
|
|
||||||
if (effect == 2)
|
if (effect == 2)
|
||||||
|
@ -75,7 +75,7 @@ static void Task_FinishRoundOfAppeals(u8);
|
|||||||
static void Task_ReadyUpdateHeartSliders(u8);
|
static void Task_ReadyUpdateHeartSliders(u8);
|
||||||
static void Task_UpdateHeartSliders(u8);
|
static void Task_UpdateHeartSliders(u8);
|
||||||
static void Task_WaitForHeartSliders(u8);
|
static void Task_WaitForHeartSliders(u8);
|
||||||
static void sub_80DA348(u8);
|
static void Task_RestorePlttBufferUnfaded(u8);
|
||||||
static void Task_WaitPrintRoundResult(u8);
|
static void Task_WaitPrintRoundResult(u8);
|
||||||
static void Task_PrintRoundResultText(u8);
|
static void Task_PrintRoundResultText(u8);
|
||||||
static void Task_ReUpdateHeartSliders(u8);
|
static void Task_ReUpdateHeartSliders(u8);
|
||||||
@ -2553,10 +2553,10 @@ static void Task_UpdateHeartSliders(u8 taskId)
|
|||||||
static void Task_WaitForHeartSliders(u8 taskId)
|
static void Task_WaitForHeartSliders(u8 taskId)
|
||||||
{
|
{
|
||||||
if (SlidersDoneUpdating())
|
if (SlidersDoneUpdating())
|
||||||
gTasks[taskId].func = sub_80DA348;
|
gTasks[taskId].func = Task_RestorePlttBufferUnfaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_80DA348(u8 taskId)
|
static void Task_RestorePlttBufferUnfaded(u8 taskId)
|
||||||
{
|
{
|
||||||
DmaCopy32Defvars(3, eContestTempSave.cachedPlttBufferUnfaded, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2);
|
DmaCopy32Defvars(3, eContestTempSave.cachedPlttBufferUnfaded, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2);
|
||||||
gTasks[taskId].data[0] = 0;
|
gTasks[taskId].data[0] = 0;
|
||||||
|
@ -978,7 +978,7 @@ static void Task_HofPC_PrintMonInfo(u8 taskId)
|
|||||||
|
|
||||||
currMonID = gTasks[taskId].tMonSpriteId(gTasks[taskId].tCurrMonId);
|
currMonID = gTasks[taskId].tMonSpriteId(gTasks[taskId].tCurrMonId);
|
||||||
gSprites[currMonID].oam.priority = 0;
|
gSprites[currMonID].oam.priority = 0;
|
||||||
sHofFadePalettes = (0x10000 << gSprites[currMonID].oam.paletteNum) ^ 0xFFFF0000;
|
sHofFadePalettes = (0x10000 << gSprites[currMonID].oam.paletteNum) ^ PALETTES_OBJECTS;
|
||||||
BlendPalettesUnfaded(sHofFadePalettes, 0xC, RGB(16, 29, 24));
|
BlendPalettesUnfaded(sHofFadePalettes, 0xC, RGB(16, 29, 24));
|
||||||
|
|
||||||
currMon = &savedTeams->mon[gTasks[taskId].tCurrMonId];
|
currMon = &savedTeams->mon[gTasks[taskId].tCurrMonId];
|
||||||
|
@ -562,23 +562,31 @@ void UpdateItemMenuSwapLinePos(u8 y)
|
|||||||
UpdateSwapLineSpritesPos(&gBagMenu->spriteIds[ITEMMENUSPRITE_SWAP_LINE], ITEMMENU_SWAP_LINE_LENGTH | SWAP_LINE_HAS_MARGIN, 120, (y + 1) * 16);
|
UpdateSwapLineSpritesPos(&gBagMenu->spriteIds[ITEMMENUSPRITE_SWAP_LINE], ITEMMENU_SWAP_LINE_LENGTH | SWAP_LINE_HAS_MARGIN, 120, (y + 1) * 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_80D5018(void *mem0, void *mem1)
|
static void ArrangeBerryGfx(void *src, void *dest)
|
||||||
{
|
{
|
||||||
u8 i, j;
|
u8 i, j;
|
||||||
|
|
||||||
memset(mem1, 0, 0x800);
|
memset(dest, 0, 0x800);
|
||||||
mem1 += 0x100;
|
|
||||||
|
// Create top margin
|
||||||
|
dest += 0x100;
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
mem1 += 0x20;
|
// Create left margin
|
||||||
|
dest += 0x20;
|
||||||
|
|
||||||
|
// Copy one row of berry's icon
|
||||||
for (j = 0; j < 6; j++)
|
for (j = 0; j < 6; j++)
|
||||||
{
|
{
|
||||||
memcpy(mem1, mem0, 0x20);
|
memcpy(dest, src, 0x20);
|
||||||
mem1 += 0x20;
|
dest += 0x20;
|
||||||
mem0 += 0x20;
|
src += 0x20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create right margin
|
||||||
if (i != 5)
|
if (i != 5)
|
||||||
mem1 += 0x20;
|
dest += 0x20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,7 +603,7 @@ static void LoadBerryGfx(u8 berryId)
|
|||||||
pal.tag = TAG_BERRY_PIC_PAL;
|
pal.tag = TAG_BERRY_PIC_PAL;
|
||||||
LoadCompressedSpritePalette(&pal);
|
LoadCompressedSpritePalette(&pal);
|
||||||
LZDecompressWram(sBerryPicTable[berryId].tiles, &gDecompressionBuffer[0x1000]);
|
LZDecompressWram(sBerryPicTable[berryId].tiles, &gDecompressionBuffer[0x1000]);
|
||||||
sub_80D5018(&gDecompressionBuffer[0x1000], &gDecompressionBuffer[0]);
|
ArrangeBerryGfx(&gDecompressionBuffer[0x1000], &gDecompressionBuffer[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y)
|
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y)
|
||||||
|
@ -57,7 +57,7 @@ const IntrFunc gIntrTableTemplate[] =
|
|||||||
|
|
||||||
#define INTR_COUNT ((int)(sizeof(gIntrTableTemplate)/sizeof(IntrFunc)))
|
#define INTR_COUNT ((int)(sizeof(gIntrTableTemplate)/sizeof(IntrFunc)))
|
||||||
|
|
||||||
static u16 gUnknown_03000000;
|
static u16 sUnusedVar; // Never read
|
||||||
|
|
||||||
u16 gKeyRepeatStartDelay;
|
u16 gKeyRepeatStartDelay;
|
||||||
bool8 gLinkTransferringData;
|
bool8 gLinkTransferringData;
|
||||||
@ -117,7 +117,7 @@ void AgbMain()
|
|||||||
SetMainCallback2(NULL);
|
SetMainCallback2(NULL);
|
||||||
|
|
||||||
gLinkTransferringData = FALSE;
|
gLinkTransferringData = FALSE;
|
||||||
gUnknown_03000000 = 0xFC0;
|
sUnusedVar = 0xFC0;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
@ -170,7 +170,7 @@
|
|||||||
|
|
||||||
// Static RAM declarations
|
// Static RAM declarations
|
||||||
|
|
||||||
static EWRAM_DATA u8 gUnknown_02022D04 = 0;
|
static EWRAM_DATA bool8 sStartedPokeBallTask = 0;
|
||||||
static EWRAM_DATA u16 sCurrItemAndOptionMenuCheck = 0;
|
static EWRAM_DATA u16 sCurrItemAndOptionMenuCheck = 0;
|
||||||
|
|
||||||
static u8 sBirchSpeechMainTaskId;
|
static u8 sBirchSpeechMainTaskId;
|
||||||
@ -201,7 +201,7 @@ static void NewGameBirchSpeech_ShowDialogueWindow(u8, u8);
|
|||||||
static void NewGameBirchSpeech_ClearWindow(u8);
|
static void NewGameBirchSpeech_ClearWindow(u8);
|
||||||
static void Task_NewGameBirchSpeech_ThisIsAPokemon(u8);
|
static void Task_NewGameBirchSpeech_ThisIsAPokemon(u8);
|
||||||
static void Task_NewGameBirchSpeech_MainSpeech(u8);
|
static void Task_NewGameBirchSpeech_MainSpeech(u8);
|
||||||
static void NewGameBirchSpeech_ShowPokeBallPrinterCallback(struct TextPrinterTemplate *printer, u16 a);
|
static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a);
|
||||||
static void Task_NewGameBirchSpeech_AndYouAre(u8);
|
static void Task_NewGameBirchSpeech_AndYouAre(u8);
|
||||||
static void Task_NewGameBirchSpeechSub_WaitForLotad(u8);
|
static void Task_NewGameBirchSpeechSub_WaitForLotad(u8);
|
||||||
static void Task_NewGameBirchSpeech_StartBirchLotadPlatformFade(u8);
|
static void Task_NewGameBirchSpeech_StartBirchLotadPlatformFade(u8);
|
||||||
@ -1348,7 +1348,7 @@ static void Task_NewGameBirchSpeech_ThisIsAPokemon(u8 taskId)
|
|||||||
{
|
{
|
||||||
gTasks[taskId].func = Task_NewGameBirchSpeech_MainSpeech;
|
gTasks[taskId].func = Task_NewGameBirchSpeech_MainSpeech;
|
||||||
StringExpandPlaceholders(gStringVar4, gText_ThisIsAPokemon);
|
StringExpandPlaceholders(gStringVar4, gText_ThisIsAPokemon);
|
||||||
AddTextPrinterWithCallbackForMessage(1, NewGameBirchSpeech_ShowPokeBallPrinterCallback);
|
AddTextPrinterWithCallbackForMessage(1, NewGameBirchSpeech_WaitForThisIsPokemonText);
|
||||||
sBirchSpeechMainTaskId = taskId;
|
sBirchSpeechMainTaskId = taskId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1411,7 +1411,7 @@ static void Task_NewGameBirchSpeech_AndYouAre(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (!RunTextPrintersAndIsPrinter0Active())
|
if (!RunTextPrintersAndIsPrinter0Active())
|
||||||
{
|
{
|
||||||
gUnknown_02022D04 = 0;
|
sStartedPokeBallTask = FALSE;
|
||||||
StringExpandPlaceholders(gStringVar4, gText_Birch_AndYouAre);
|
StringExpandPlaceholders(gStringVar4, gText_Birch_AndYouAre);
|
||||||
AddTextPrinterForMessage(1);
|
AddTextPrinterForMessage(1);
|
||||||
gTasks[taskId].func = Task_NewGameBirchSpeech_StartBirchLotadPlatformFade;
|
gTasks[taskId].func = Task_NewGameBirchSpeech_StartBirchLotadPlatformFade;
|
||||||
@ -2250,21 +2250,21 @@ static void NewGameBirchSpeech_ClearWindow(u8 windowId)
|
|||||||
CopyWindowToVram(windowId, 2);
|
CopyWindowToVram(windowId, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void NewGameBirchSpeech_ShowPokeBallPrinterCallback(struct TextPrinterTemplate *printer, u16 a)
|
static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a)
|
||||||
{
|
{
|
||||||
if (*(printer->currentChar - 2) == 8 && gUnknown_02022D04 == 0)
|
// Wait for Birch's "This is a Pokémon" text to reach the pause
|
||||||
|
// Then start the PokéBall release (if it hasn't been started already)
|
||||||
|
if (*(printer->currentChar - 2) == EXT_CTRL_CODE_PAUSE && !sStartedPokeBallTask)
|
||||||
{
|
{
|
||||||
gUnknown_02022D04 = 1;
|
sStartedPokeBallTask = TRUE;
|
||||||
CreateTask(Task_NewGameBirchSpeechSub_InitPokeBall, 0);
|
CreateTask(Task_NewGameBirchSpeechSub_InitPokeBall, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f)
|
void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum)
|
||||||
{
|
{
|
||||||
struct WindowTemplate sp;
|
struct WindowTemplate template = CreateWindowTemplate(0, x + 1, y + 1, 5, 4, winPalNum, baseBlock);
|
||||||
|
CreateYesNoMenu(&template, baseTileNum, yesNoPalNum, 0);
|
||||||
sp = CreateWindowTemplate(0, a + 1, b + 1, 5, 4, f, d);
|
|
||||||
CreateYesNoMenu(&sp, c, e, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram)
|
static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram)
|
||||||
|
@ -1769,9 +1769,7 @@ void ResetTempTileDataBuffers(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < (int)ARRAY_COUNT(sTempTileDataBuffer); i++)
|
for (i = 0; i < (int)ARRAY_COUNT(sTempTileDataBuffer); i++)
|
||||||
{
|
|
||||||
sTempTileDataBuffer[i] = NULL;
|
sTempTileDataBuffer[i] = NULL;
|
||||||
}
|
|
||||||
sTempTileDataBufferIdx = 0;
|
sTempTileDataBufferIdx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1784,9 +1782,7 @@ bool8 FreeTempTileDataBuffersIfPossible(void)
|
|||||||
if (sTempTileDataBufferIdx)
|
if (sTempTileDataBufferIdx)
|
||||||
{
|
{
|
||||||
for (i = 0; i < sTempTileDataBufferIdx; i++)
|
for (i = 0; i < sTempTileDataBufferIdx; i++)
|
||||||
{
|
|
||||||
FREE_AND_SET_NULL(sTempTileDataBuffer[i]);
|
FREE_AND_SET_NULL(sTempTileDataBuffer[i]);
|
||||||
}
|
|
||||||
sTempTileDataBufferIdx = 0;
|
sTempTileDataBufferIdx = 0;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -17,7 +17,7 @@ static const u32 sPokedexAreaMapAffine_Tilemap[] = INCBIN_U32("graphics/interfac
|
|||||||
void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
|
void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
|
||||||
{
|
{
|
||||||
u8 mode;
|
u8 mode;
|
||||||
sPokedexAreaMapBgNum = Alloc(4);
|
sPokedexAreaMapBgNum = Alloc(sizeof(sPokedexAreaMapBgNum));
|
||||||
mode = template->mode;
|
mode = template->mode;
|
||||||
|
|
||||||
if (mode == 0)
|
if (mode == 0)
|
||||||
@ -28,8 +28,9 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// This is never reached, only a mode of 0 is given
|
||||||
SetBgAttribute(template->bg, BG_ATTR_METRIC, 2);
|
SetBgAttribute(template->bg, BG_ATTR_METRIC, 2);
|
||||||
SetBgAttribute(template->bg, BG_ATTR_TYPE, 1);
|
SetBgAttribute(template->bg, BG_ATTR_TYPE, BG_TYPE_AFFINE); // This does nothing. BG_ATTR_TYPE can't be set with this function
|
||||||
DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Gfx, 0, template->offset, 0);
|
DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Gfx, 0, template->offset, 0);
|
||||||
sub_8199D3C(DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Tilemap, 0, 0, 1), template->offset, 64, 64, TRUE);
|
sub_8199D3C(DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Tilemap, 0, 0, 1), template->offset, 64, 64, TRUE);
|
||||||
}
|
}
|
||||||
@ -41,7 +42,7 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
|
|||||||
*sPokedexAreaMapBgNum = template->bg;
|
*sPokedexAreaMapBgNum = template->bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_81C4E90(void)
|
bool32 TryShowPokedexAreaMap(void)
|
||||||
{
|
{
|
||||||
if (!FreeTempTileDataBuffersIfPossible())
|
if (!FreeTempTileDataBuffersIfPossible())
|
||||||
{
|
{
|
||||||
@ -56,8 +57,7 @@ bool32 sub_81C4E90(void)
|
|||||||
|
|
||||||
void FreePokedexAreaMapBgNum(void)
|
void FreePokedexAreaMapBgNum(void)
|
||||||
{
|
{
|
||||||
if (sPokedexAreaMapBgNum != NULL)
|
TRY_FREE_AND_SET_NULL(sPokedexAreaMapBgNum);
|
||||||
FREE_AND_SET_NULL(sPokedexAreaMapBgNum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PokedexAreaMapChangeBgY(u32 a0)
|
void PokedexAreaMapChangeBgY(u32 a0)
|
||||||
|
@ -86,7 +86,7 @@ static void CreateAreaMarkerSprites(void);
|
|||||||
static void LoadAreaUnknownGraphics(void);
|
static void LoadAreaUnknownGraphics(void);
|
||||||
static void CreateAreaUnknownSprites(void);
|
static void CreateAreaUnknownSprites(void);
|
||||||
static void Task_HandlePokedexAreaScreenInput(u8);
|
static void Task_HandlePokedexAreaScreenInput(u8);
|
||||||
static void sub_813D6B4(void);
|
static void ResetPokedexAreaMapBg(void);
|
||||||
static void DestroyAreaMarkerSprites(void);
|
static void DestroyAreaMarkerSprites(void);
|
||||||
|
|
||||||
static const u32 sAreaGlow_Pal[] = INCBIN_U32("graphics/pokedex/area_glow.gbapal");
|
static const u32 sAreaGlow_Pal[] = INCBIN_U32("graphics/pokedex/area_glow.gbapal");
|
||||||
@ -665,7 +665,7 @@ static void Task_ShowPokedexAreaScreen(u8 taskId)
|
|||||||
StringFill(sPokedexAreaScreen->charBuffer, CHAR_SPACE, 16);
|
StringFill(sPokedexAreaScreen->charBuffer, CHAR_SPACE, 16);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (sub_81C4E90() == TRUE)
|
if (TryShowPokedexAreaMap() == TRUE)
|
||||||
return;
|
return;
|
||||||
PokedexAreaMapChangeBgY(-8);
|
PokedexAreaMapChangeBgY(-8);
|
||||||
break;
|
break;
|
||||||
@ -697,7 +697,7 @@ static void Task_ShowPokedexAreaScreen(u8 taskId)
|
|||||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_ALL);
|
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_ALL);
|
||||||
StartAreaGlow();
|
StartAreaGlow();
|
||||||
ShowBg(2);
|
ShowBg(2);
|
||||||
ShowBg(3);
|
ShowBg(3); // TryShowPokedexAreaMap will have done this already
|
||||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON);
|
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
@ -743,7 +743,7 @@ static void Task_HandlePokedexAreaScreenInput(u8 taskId)
|
|||||||
return;
|
return;
|
||||||
DestroyAreaMarkerSprites();
|
DestroyAreaMarkerSprites();
|
||||||
sPokedexAreaScreen->screenSwitchState[0] = gTasks[taskId].data[1];
|
sPokedexAreaScreen->screenSwitchState[0] = gTasks[taskId].data[1];
|
||||||
sub_813D6B4();
|
ResetPokedexAreaMapBg();
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
FreePokedexAreaMapBgNum();
|
FreePokedexAreaMapBgNum();
|
||||||
FREE_AND_SET_NULL(sPokedexAreaScreen);
|
FREE_AND_SET_NULL(sPokedexAreaScreen);
|
||||||
@ -753,7 +753,7 @@ static void Task_HandlePokedexAreaScreenInput(u8 taskId)
|
|||||||
gTasks[taskId].tState++;
|
gTasks[taskId].tState++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_813D6B4(void)
|
static void ResetPokedexAreaMapBg(void)
|
||||||
{
|
{
|
||||||
SetBgAttribute(3, BG_ATTR_CHARBASEINDEX, 0);
|
SetBgAttribute(3, BG_ATTR_CHARBASEINDEX, 0);
|
||||||
SetBgAttribute(3, BG_ATTR_PALETTEMODE, 0);
|
SetBgAttribute(3, BG_ATTR_PALETTEMODE, 0);
|
||||||
|
@ -9822,13 +9822,13 @@ struct
|
|||||||
u16 height;
|
u16 height;
|
||||||
} static const sTilemapDimensions[][4] =
|
} static const sTilemapDimensions[][4] =
|
||||||
{
|
{
|
||||||
{
|
[BG_TYPE_NORMAL] = {
|
||||||
{ 256, 256},
|
{ 256, 256},
|
||||||
{ 512, 256},
|
{ 512, 256},
|
||||||
{ 256, 512},
|
{ 256, 512},
|
||||||
{ 512, 512},
|
{ 512, 512},
|
||||||
},
|
},
|
||||||
{
|
[BG_TYPE_AFFINE] = {
|
||||||
{ 128, 128},
|
{ 128, 128},
|
||||||
{ 256, 256},
|
{ 256, 256},
|
||||||
{ 512, 512},
|
{ 512, 512},
|
||||||
@ -9853,7 +9853,7 @@ static void TilemapUtil_SetMap(u8 id, u8 bg, const void *tilemap, u16 width, u16
|
|||||||
bgType = GetBgAttribute(bg, BG_ATTR_TYPE);
|
bgType = GetBgAttribute(bg, BG_ATTR_TYPE);
|
||||||
sTilemapUtil[id].altWidth = sTilemapDimensions[bgType][bgScreenSize].width;
|
sTilemapUtil[id].altWidth = sTilemapDimensions[bgType][bgScreenSize].width;
|
||||||
sTilemapUtil[id].altHeight = sTilemapDimensions[bgType][bgScreenSize].height;
|
sTilemapUtil[id].altHeight = sTilemapDimensions[bgType][bgScreenSize].height;
|
||||||
if (bgType != 0)
|
if (bgType != BG_TYPE_NORMAL)
|
||||||
sTilemapUtil[id].tileSize = 1;
|
sTilemapUtil[id].tileSize = 1;
|
||||||
else
|
else
|
||||||
sTilemapUtil[id].tileSize = 2;
|
sTilemapUtil[id].tileSize = 2;
|
||||||
|
@ -162,7 +162,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
|
|||||||
BeginHardwarePaletteFade(0xFF, 0, 0x10, 0, 1);
|
BeginHardwarePaletteFade(0xFF, 0, 0x10, 0, 1);
|
||||||
gPaletteFade.bufferTransferDisabled = 0;
|
gPaletteFade.bufferTransferDisabled = 0;
|
||||||
SetMainCallback2(BattleMainCB2);
|
SetMainCallback2(BattleMainCB2);
|
||||||
sub_805EF14();
|
FillAroundBattleWindows();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
.include "main.o"
|
.include "main.o"
|
||||||
@ ../gflib/bg.o
|
@ ../gflib/bg.o
|
||||||
.align 2
|
.align 2
|
||||||
gUnneededFireRedVariable:
|
gWindowTileAutoAllocEnabled:
|
||||||
.space 4
|
.space 4
|
||||||
@ ../gflib/window.o
|
@ ../gflib/window.o
|
||||||
.align 4
|
.align 4
|
||||||
|
Loading…
Reference in New Issue
Block a user