Add controller buffer constants, finish misc battle doc

This commit is contained in:
GriffinR
2021-10-12 19:50:32 -04:00
parent b0598b1aef
commit fc15b0d5f0
22 changed files with 435 additions and 399 deletions

View File

@@ -2825,37 +2825,40 @@ BattleScript_GiveExp::
end2
BattleScript_HandleFaintedMon::
atk24 BattleScript_HandleFaintedMonMultiple
checkteamslost BattleScript_LinkHandleFaintedMonMultiple
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChooseAnother
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonTryChooseAnother
@ Yes/No for sending out a new Pokémon, when sending out is optional
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChoose
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonTryChoose
@ Yes/No for sending out a new Pokémon if one is defeated in a wild battle
printstring STRINGID_USENEXTPKMN
setbyte gBattleCommunication, 0
yesnobox
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0, BattleScript_FaintedMonTryChooseAnother
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0, BattleScript_FaintedMonTryChoose
@ Player said no, try to run
jumpifplayerran BattleScript_FaintedMonEnd
printstring STRINGID_CANTESCAPE2
BattleScript_FaintedMonTryChooseAnother::
BattleScript_FaintedMonTryChoose::
openpartyscreen BS_FAINTED, BattleScript_FaintedMonEnd
switchhandleorder BS_FAINTED, 2
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonChooseAnother
jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonChooseAnother
jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonChooseAnother
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonSendOutNew
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonSendOutNew
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_PLAYER_FAINTED, BattleScript_FaintedMonSendOutNew
jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonSendOutNew
jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonSendOutNew
@ Yes/No for sending out a new Pokémon when the opponent is switching
printstring STRINGID_ENEMYABOUTTOSWITCHPKMN
setbyte gBattleCommunication, 0
yesnobox
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 1, BattleScript_FaintedMonChooseAnother
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 1, BattleScript_FaintedMonSendOutNew
@ Player said yes, go to party screen (note optional flag, player may exit the menu instead)
setatktoplayer0
openpartyscreen BS_ATTACKER | PARTY_SCREEN_OPTIONAL, BattleScript_FaintedMonChooseAnother
openpartyscreen BS_ATTACKER | PARTY_SCREEN_OPTIONAL, BattleScript_FaintedMonSendOutNew
switchhandleorder BS_ATTACKER, 2
jumpifbyte CMP_EQUAL, gBattleCommunication, PARTY_SIZE, BattleScript_FaintedMonChooseAnother
jumpifbyte CMP_EQUAL, gBattleCommunication, PARTY_SIZE, BattleScript_FaintedMonSendOutNew
@ Switch Pokémon before opponent
atknameinbuff1
resetintimidatetracebits BS_ATTACKER
hpthresholds2 BS_ATTACKER
@@ -2874,7 +2877,7 @@ BattleScript_FaintedMonTryChooseAnother::
waitstate
switchineffects BS_ATTACKER
resetsentmonsvalue
BattleScript_FaintedMonChooseAnother::
BattleScript_FaintedMonSendOutNew::
drawpartystatussummary BS_FAINTED
getswitchedmondata BS_FAINTED
switchindataupdate BS_FAINTED
@@ -2890,13 +2893,13 @@ BattleScript_FaintedMonChooseAnother::
BattleScript_FaintedMonEnd::
end2
BattleScript_HandleFaintedMonMultiple::
openpartyscreen BS_UNK_5, BattleScript_HandleFaintedMonMultipleStart
BattleScript_HandleFaintedMonMultipleStart::
BattleScript_LinkHandleFaintedMonMultiple::
openpartyscreen BS_FAINTED_LINK_MULTIPLE_1, BattleScript_LinkHandleFaintedMonMultipleStart
BattleScript_LinkHandleFaintedMonMultipleStart::
switchhandleorder BS_FAINTED, 0
openpartyscreen BS_UNK_6, BattleScript_HandleFaintedMonMultipleEnd
openpartyscreen BS_FAINTED_LINK_MULTIPLE_2, BattleScript_LinkHandleFaintedMonMultipleEnd
switchhandleorder BS_FAINTED, 0
BattleScript_HandleFaintedMonLoop::
BattleScript_LinkHandleFaintedMonLoop::
switchhandleorder BS_FAINTED, 3
drawpartystatussummary BS_FAINTED
getswitchedmondata BS_FAINTED
@@ -2906,9 +2909,9 @@ BattleScript_HandleFaintedMonLoop::
hidepartystatussummary BS_FAINTED
switchinanim BS_FAINTED, FALSE
waitstate
switchineffects BS_UNK_5
jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_HandleFaintedMonLoop
BattleScript_HandleFaintedMonMultipleEnd::
switchineffects BS_FAINTED_LINK_MULTIPLE_1
jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_LinkHandleFaintedMonLoop
BattleScript_LinkHandleFaintedMonMultipleEnd::
end2
BattleScript_LocalTrainerBattleWon::
@@ -3208,7 +3211,7 @@ BattleScript_DamagingWeatherLoop::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL
atk24 BattleScript_DamagingWeatherLoopIncrement
checkteamslost BattleScript_DamagingWeatherLoopIncrement
BattleScript_DamagingWeatherLoopIncrement::
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_DamagingWeatherContinuesEnd
addbyte gBattleCommunication, 1
@@ -3523,7 +3526,7 @@ BattleScript_DoFutureAttackHit::
resultmessage
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
atk24 BattleScript_FutureAttackEnd
checkteamslost BattleScript_FutureAttackEnd
BattleScript_FutureAttackEnd::
moveendcase MOVEEND_RAGE
moveendfromto MOVEEND_ITEM_EFFECTS_ALL, MOVEEND_UPDATE_LAST_MOVES
@@ -3737,7 +3740,7 @@ BattleScript_DoTurnDmg::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL
atk24 BattleScript_DoTurnDmgEnd
checkteamslost BattleScript_DoTurnDmgEnd
BattleScript_DoTurnDmgEnd::
end2