Skip to content

Commit

Permalink
Document battle_scripts_2.s
Browse files Browse the repository at this point in the history
  • Loading branch information
PikalaxALT committed Nov 6, 2019
1 parent 60b75e8 commit f14f13b
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 78 deletions.
140 changes: 70 additions & 70 deletions data/battle_scripts_2.s
Original file line number Diff line number Diff line change
Expand Up @@ -18,120 +18,120 @@
.section script_data, "aw", %progbits
.align 2

gBattlescriptsForBallThrow:: @ 81D99B4
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A3C
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14
.4byte BattleScript_81D9A14

gBattlescriptsForUsingItem:: @ 81D99E8
.4byte BattleScript_81D9ADB
.4byte BattleScript_81D9AE5
.4byte BattleScript_81D9AE5
.4byte BattleScript_81D9B14
.4byte BattleScript_81D9B38
.4byte BattleScript_81D9B5A

gBattlescriptsForRunningByItem:: @ 81D9A00
.4byte BattleScript_81D9B7C
.4byte BattleScript_81D9B86

gBattlescriptsForSafariActions:: @ 81D9A08
.4byte BattleScript_81D9BB5
.4byte BattleScript_81D9BC5
.4byte BattleScript_81D9BD3
.4byte BattleScript_81D9BE1

BattleScript_81D9A14:: @ 81D9A14
jumpifbattletype BATTLE_TYPE_OLD_MAN_TUTORIAL, BattleScript_81D9A34
jumpifbattletype BATTLE_TYPE_POKEDUDE, BattleScript_81D9A38
gBattlescriptsForBallThrow::
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowSafariBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall
.4byte BattleScript_ThrowBall

gBattlescriptsForUsingItem::
.4byte BattleScript_PlayerUseItem
.4byte BattleScript_AIuseFullRestoreOrHpHeal
.4byte BattleScript_AIuseFullRestoreOrHpHeal
.4byte BattleScript_AIuseStatRestore
.4byte BattleScript_AIuseXstat
.4byte BattleScript_AIuseGuardSpec

gBattlescriptsForRunningByItem::
.4byte BattleScript_UseFluffyTail
.4byte BattleScript_UsePokeFlute

gBattlescriptsForSafariActions::
.4byte BattleScript_WatchesCarefully
.4byte BattleScript_ThrowRock
.4byte BattleScript_ThrowBait
.4byte BattleScript_LeftoverWallyPrepToThrow

BattleScript_ThrowBall::
jumpifbattletype BATTLE_TYPE_OLD_MAN_TUTORIAL, BattleScript_OldManThrowBall
jumpifbattletype BATTLE_TYPE_POKEDUDE, BattleScript_PokeDudeThrowBall
printstring STRINGID_PLAYERUSEDITEM
handleballthrow

BattleScript_81D9A34:: @ 81D9A34
BattleScript_OldManThrowBall::
printstring STRINGID_OLDMANUSEDITEM
handleballthrow

BattleScript_81D9A38:: @ 81D9A38
BattleScript_PokeDudeThrowBall::
printstring STRINGID_POKEDUDEUSED
handleballthrow

BattleScript_81D9A3C:: @ 81D9A3C
BattleScript_ThrowSafariBall::
printstring STRINGID_PLAYERUSEDITEM
updatestatusicon BS_ATTACKER
handleballthrow

BattleScript_SuccessBallThrow:: @ 81D9A42
jumpifhalfword CMP_EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_81D9A50
BattleScript_SuccessBallThrow::
jumpifhalfword CMP_EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_SafariNoIncGameStat
incrementgamestat GAME_STAT_POKEMON_CAPTURES
BattleScript_81D9A50:: @ 81D9A50
BattleScript_SafariNoIncGameStat::
printstring STRINGID_GOTCHAPKMNCAUGHT
trysetcaughtmondexflags BattleScript_81D9A63
trysetcaughtmondexflags BattleScript_CaughtPokemonSkipNewDex
printstring STRINGID_PKMNDATAADDEDTODEX
waitstate
setbyte gBattleCommunication, 0
displaydexinfo
BattleScript_81D9A63:: @ 81D9A63
BattleScript_CaughtPokemonSkipNewDex::
printstring STRINGID_GIVENICKNAMECAPTURED
waitstate
setbyte gBattleCommunication, 0
trygivecaughtmonnick BattleScript_81D9A80
trygivecaughtmonnick BattleScript_CaughtPokemonSkipNickname
givecaughtmon
printfromtable gCaughtMonStringIds
waitmessage 64
goto BattleScript_81D9A81
goto BattleScript_CaughtPokemonDone

BattleScript_81D9A80:: @ 81D9A80
BattleScript_CaughtPokemonSkipNickname::
givecaughtmon
BattleScript_81D9A81:: @ 81D9A81
BattleScript_CaughtPokemonDone::
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn

gUnknown_81D9A88:: @ 81D9A88
BattleScript_OldMan_Pokedude_CaughtMessage::
printstring STRINGID_GOTCHAPKMNCAUGHT2
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
atk57
finishturn

BattleScript_ShakeBallThrow:: @ 81D9A93
BattleScript_ShakeBallThrow::
printfromtable gBallEscapeStringIds
waitmessage 64
jumpifnotbattletype BATTLE_TYPE_SAFARI, BattleScript_81D9AC0
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_81D9AC0
jumpifnotbattletype BATTLE_TYPE_SAFARI, BattleScript_CatchFailEnd
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_CatchFailEnd
printstring STRINGID_OUTOFSAFARIBALLS
waitmessage 64
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
BattleScript_81D9AC0:: @ 81D9AC0
BattleScript_CatchFailEnd::
finishaction

BattleScript_TrainerBallBlock:: @ 81D9AC1
BattleScript_TrainerBallBlock::
waitmessage 64
printstring STRINGID_TRAINERBLOCKEDBALL
waitmessage 64
printstring STRINGID_DONTBEATHIEF
waitmessage 64
finishaction

BattleScript_GhostBallDodge:: @ 81D9AD1
BattleScript_GhostBallDodge::
waitmessage 64
printstring STRINGID_ITDODGEDBALL
waitmessage 64
finishaction

BattleScript_81D9ADB:: @ 81D9ADB
BattleScript_PlayerUseItem::
moveendcase 15
end

BattleScript_81D9AE5:: @ 81D9AE5
BattleScript_AIuseFullRestoreOrHpHeal::
printstring STRINGID_EMPTYSTRING3
pause 48
playse SE_KAIFUKU
Expand All @@ -147,7 +147,7 @@ BattleScript_81D9AE5:: @ 81D9AE5
moveendcase 15
finishaction

BattleScript_81D9B14:: @ 81D9B14
BattleScript_AIuseStatRestore::
printstring STRINGID_EMPTYSTRING3
pause 48
playse SE_KAIFUKU
Expand All @@ -160,7 +160,7 @@ BattleScript_81D9B14:: @ 81D9B14
moveendcase 15
finishaction

BattleScript_81D9B38:: @ 81D9B38
BattleScript_AIuseXstat::
printstring STRINGID_EMPTYSTRING3
pause 48
playse SE_KAIFUKU
Expand All @@ -172,7 +172,7 @@ BattleScript_81D9B38:: @ 81D9B38
moveendcase 15
finishaction

BattleScript_81D9B5A:: @ 81D9B5A
BattleScript_AIuseGuardSpec::
printstring STRINGID_EMPTYSTRING3
pause 48
playse SE_KAIFUKU
Expand All @@ -184,19 +184,19 @@ BattleScript_81D9B5A:: @ 81D9B5A
moveendcase 15
finishaction

BattleScript_81D9B7C:: @ 81D9B7C
BattleScript_UseFluffyTail::
playse SE_NIGERU
setbyte gBattleOutcome, B_OUTCOME_RAN
finishturn

BattleScript_81D9B86:: @ 81D9B86
BattleScript_UsePokeFlute::
checkpokeflute BS_ATTACKER
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 1, BattleScript_81D9B9F
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 1, BattleScript_PokeFluteWakeUp
printstring STRINGID_POKEFLUTECATCHY
waitmessage 64
goto BattleScript_81D9BB4
goto BattleScript_PokeFluteEnd

BattleScript_81D9B9F:: @ 81D9B9F
BattleScript_PokeFluteWakeUp::
printstring STRINGID_POKEFLUTE
waitmessage 64
fanfare MUS_POKEFUE
Expand All @@ -205,28 +205,28 @@ BattleScript_81D9B9F:: @ 81D9B9F
waitmessage 64
updatestatusicon BS_PLAYER2
waitstate
BattleScript_81D9BB4:: @ 81D9BB4
BattleScript_PokeFluteEnd::
finishaction

BattleScript_81D9BB5:: @ 81D9BB5
BattleScript_WatchesCarefully::
printfromtable gSafariPokeblockResultStringIds
waitmessage 64
playanimation BS_OPPONENT1, B_ANIM_SAFARI_REACTION, NULL
end2

BattleScript_81D9BC5:: @ 81D9BC5
BattleScript_ThrowRock::
printstring STRINGID_THREWROCK
waitmessage 64
playanimation BS_ATTACKER, B_ANIM_ROCK_THROW, NULL
end2

BattleScript_81D9BD3:: @ 81D9BD3
BattleScript_ThrowBait::
printstring STRINGID_THREWBAIT
waitmessage 64
playanimation BS_ATTACKER, B_ANIM_BAIT_THROW, NULL
end2

BattleScript_81D9BE1:: @ 81D9BE1
BattleScript_LeftoverWallyPrepToThrow::
printstring STRINGID_RETURNMON
waitmessage 64
returnatktoball
Expand Down
2 changes: 1 addition & 1 deletion include/battle_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ extern const u8 BattleScript_MoveEffectRecoil[];
extern const u8 BattleScript_FlushMessageBox[];
extern const u8 BattleScript_SpikesOnFaintedBattler[];
extern const u8 BattleScript_GhostBallDodge[];
extern const u8 gUnknown_81D9A88[];
extern const u8 BattleScript_OldMan_Pokedude_CaughtMessage[];
extern const u8 gUnknown_81D91A1[]; // knizz: silph scope unveil
extern const u8 BattleScript_BattleTowerTrainerBattleWon[];

Expand Down
12 changes: 6 additions & 6 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ static void HandleAction_UseItem(void);
static void HandleAction_Run(void);
static void HandleAction_WatchesCarefully(void);
static void HandleAction_SafariZoneBallThrow(void);
static void HandleAction_ThrowPokeblock(void);
static void HandleAction_GoNear(void);
static void HandleAction_ThrowBait(void);
static void HandleAction_ThrowRock(void);
static void HandleAction_SafariZoneRun(void);
static void HandleAction_OldManBallThrow(void);
static void HandleAction_TryFinish(void);
Expand Down Expand Up @@ -582,8 +582,8 @@ static void (*const sTurnActionsFuncsTable[])(void) =
[B_ACTION_RUN] = HandleAction_Run,
[B_ACTION_SAFARI_WATCH_CAREFULLY] = HandleAction_WatchesCarefully,
[B_ACTION_SAFARI_BALL] = HandleAction_SafariZoneBallThrow,
[B_ACTION_SAFARI_POKEBLOCK] = HandleAction_ThrowPokeblock,
[B_ACTION_SAFARI_GO_NEAR] = HandleAction_GoNear,
[B_ACTION_SAFARI_POKEBLOCK] = HandleAction_ThrowBait,
[B_ACTION_SAFARI_GO_NEAR] = HandleAction_ThrowRock,
[B_ACTION_SAFARI_RUN] = HandleAction_SafariZoneRun,
[B_ACTION_OLDMAN_THROW] = HandleAction_OldManBallThrow,
[B_ACTION_EXEC_SCRIPT] = HandleAction_RunBattleScript,
Expand Down Expand Up @@ -4313,7 +4313,7 @@ static void HandleAction_SafariZoneBallThrow(void)
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
}

static void HandleAction_ThrowPokeblock(void)
static void HandleAction_ThrowBait(void)
{
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
gBattle_BG0_X = 0;
Expand All @@ -4329,7 +4329,7 @@ static void HandleAction_ThrowPokeblock(void)
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
}

static void HandleAction_GoNear(void)
static void HandleAction_ThrowRock(void)
{
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
gBattle_BG0_X = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -9441,7 +9441,7 @@ static void atkEF_handleballthrow(void)
{
BtlController_EmitBallThrowAnim(0, BALL_3_SHAKES_SUCCESS);
MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr = gUnknown_81D9A88;
gBattlescriptCurrInstr = BattleScript_OldMan_Pokedude_CaughtMessage;
}
else
{
Expand Down

0 comments on commit f14f13b

Please sign in to comment.