2018-02-08 00:35:13 +01:00
|
|
|
#include "constants/battle.h"
|
2018-02-08 11:17:41 +01:00
|
|
|
#include "constants/battle_script_commands.h"
|
2018-02-08 00:35:13 +01:00
|
|
|
#include "constants/battle_anim.h"
|
|
|
|
#include "constants/battle_string_ids.h"
|
2017-12-11 19:41:13 +01:00
|
|
|
#include "constants/items.h"
|
2017-12-11 19:27:51 +01:00
|
|
|
#include "constants/songs.h"
|
2018-08-03 18:07:45 +02:00
|
|
|
#include "constants/game_stat.h"
|
2016-11-01 16:29:13 +01:00
|
|
|
.include "asm/macros.inc"
|
2017-11-25 18:42:31 +01:00
|
|
|
.include "asm/macros/battle_script.inc"
|
2016-11-01 16:29:13 +01:00
|
|
|
.include "constants/constants.inc"
|
2016-09-03 19:20:06 +02:00
|
|
|
|
|
|
|
.section script_data, "aw", %progbits
|
|
|
|
|
2017-07-29 02:31:43 +02:00
|
|
|
.align 2
|
2017-10-06 00:12:01 +02:00
|
|
|
gBattlescriptsForBallThrow:: @ 82DBD08
|
2020-07-21 19:29:51 +02:00
|
|
|
.4byte BattleScript_BallThrow @ ITEM_NONE
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_MASTER_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_ULTRA_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_GREAT_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_POKE_BALL
|
|
|
|
.4byte BattleScript_SafariBallThrow @ ITEM_SAFARI_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_NET_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_DIVE_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_NEST_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_REPEAT_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_TIMER_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_LUXURY_BALL
|
|
|
|
.4byte BattleScript_BallThrow @ ITEM_PREMIER_BALL
|
2016-09-03 19:20:06 +02:00
|
|
|
|
2017-09-25 23:26:45 +02:00
|
|
|
.align 2
|
2017-12-02 23:31:58 +01:00
|
|
|
gBattlescriptsForUsingItem:: @ 82DBD3C
|
|
|
|
.4byte BattleScript_PlayerUsesItem
|
2020-07-21 19:29:51 +02:00
|
|
|
.4byte BattleScript_OpponentUsesHealItem @ AI_ITEM_FULL_RESTORE
|
|
|
|
.4byte BattleScript_OpponentUsesHealItem @ AI_ITEM_HEAL_HP
|
|
|
|
.4byte BattleScript_OpponentUsesStatusCureItem @ AI_ITEM_CURE_CONDITION
|
|
|
|
.4byte BattleScript_OpponentUsesXItem @ AI_ITEM_X_STAT
|
|
|
|
.4byte BattleScript_OpponentUsesGuardSpecs @ AI_ITEM_GUARD_SPECS
|
2016-09-03 19:20:06 +02:00
|
|
|
|
2017-09-25 23:26:45 +02:00
|
|
|
.align 2
|
2017-10-06 00:12:01 +02:00
|
|
|
gBattlescriptsForRunningByItem:: @ 82DBD54
|
|
|
|
.4byte BattleScript_RunByUsingItem
|
2016-09-03 19:20:06 +02:00
|
|
|
|
2017-09-25 23:26:45 +02:00
|
|
|
.align 2
|
2017-10-06 17:06:45 +02:00
|
|
|
gBattlescriptsForSafariActions:: @ 82DBD58
|
2017-11-26 00:33:40 +01:00
|
|
|
.4byte BattleScript_ActionWatchesCarefully
|
|
|
|
.4byte BattleScript_ActionGetNear
|
|
|
|
.4byte BattleScript_ActionThrowPokeblock
|
2018-06-28 21:06:32 +02:00
|
|
|
.4byte BattleScript_ActionWallyThrow
|
2017-11-25 18:42:31 +01:00
|
|
|
|
2017-11-26 01:19:57 +01:00
|
|
|
BattleScript_BallThrow::
|
2018-02-08 11:17:41 +01:00
|
|
|
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_WALLY_TUTORIAL, BattleScript_BallThrowByWally
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_PLAYERUSEDITEM
|
2017-11-26 01:19:57 +01:00
|
|
|
handleballthrow
|
2017-11-25 18:42:31 +01:00
|
|
|
|
2017-11-26 01:19:57 +01:00
|
|
|
BattleScript_BallThrowByWally::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_WALLYUSEDITEM
|
2017-11-26 01:19:57 +01:00
|
|
|
handleballthrow
|
2017-11-25 18:42:31 +01:00
|
|
|
|
2017-11-26 01:19:57 +01:00
|
|
|
BattleScript_SafariBallThrow::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_PLAYERUSEDITEM
|
2018-02-08 11:17:41 +01:00
|
|
|
updatestatusicon BS_ATTACKER
|
2017-11-26 01:19:57 +01:00
|
|
|
handleballthrow
|
2017-11-25 18:42:31 +01:00
|
|
|
|
|
|
|
BattleScript_SuccessBallThrow::
|
2018-02-08 11:17:41 +01:00
|
|
|
jumpifhalfword CMP_EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
|
2018-08-03 18:07:45 +02:00
|
|
|
incrementgamestat GAME_STAT_POKEMON_CAPTURES
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_PrintCaughtMonInfo::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_GOTCHAPKMNCAUGHT
|
2017-12-02 23:31:58 +01:00
|
|
|
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_PKMNDATAADDEDTODEX
|
|
|
|
waitstate
|
|
|
|
setbyte gBattleCommunication, 0x0
|
|
|
|
displaydexinfo
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_TryNicknameCaughtMon::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_GIVENICKNAMECAPTURED
|
|
|
|
waitstate
|
|
|
|
setbyte gBattleCommunication, 0x0
|
2017-12-02 23:31:58 +01:00
|
|
|
trygivecaughtmonnick BattleScript_GiveCaughtMonEnd
|
2017-11-25 18:42:31 +01:00
|
|
|
givecaughtmon
|
2017-11-26 00:33:40 +01:00
|
|
|
printfromtable gCaughtMonStringIds
|
2017-11-25 18:42:31 +01:00
|
|
|
waitmessage 0x40
|
2017-12-02 23:31:58 +01:00
|
|
|
goto BattleScript_SuccessBallThrowEnd
|
|
|
|
BattleScript_GiveCaughtMonEnd::
|
2017-11-25 18:42:31 +01:00
|
|
|
givecaughtmon
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_SuccessBallThrowEnd::
|
2018-02-08 00:35:13 +01:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
|
2017-11-25 18:42:31 +01:00
|
|
|
finishturn
|
|
|
|
|
|
|
|
BattleScript_WallyBallThrow::
|
|
|
|
printstring STRINGID_GOTCHAPKMNCAUGHT2
|
2018-02-08 00:35:13 +01:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
|
2017-11-25 18:42:31 +01:00
|
|
|
finishturn
|
|
|
|
|
|
|
|
BattleScript_ShakeBallThrow::
|
2017-11-26 00:33:40 +01:00
|
|
|
printfromtable gBallEscapeStringIds
|
2017-11-25 18:42:31 +01:00
|
|
|
waitmessage 0x40
|
2018-02-08 11:17:41 +01:00
|
|
|
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
|
|
|
|
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_OUTOFSAFARIBALLS
|
|
|
|
waitmessage 0x40
|
2018-02-08 00:35:13 +01:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
|
2017-12-03 00:47:21 +01:00
|
|
|
BattleScript_ShakeBallThrowEnd::
|
2017-11-25 18:42:31 +01:00
|
|
|
finishaction
|
|
|
|
|
|
|
|
BattleScript_TrainerBallBlock::
|
|
|
|
waitmessage 0x40
|
|
|
|
printstring STRINGID_TRAINERBLOCKEDBALL
|
|
|
|
waitmessage 0x40
|
|
|
|
printstring STRINGID_DONTBEATHIEF
|
|
|
|
waitmessage 0x40
|
|
|
|
finishaction
|
|
|
|
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_PlayerUsesItem::
|
2017-11-25 18:42:31 +01:00
|
|
|
setbyte sMOVEEND_STATE, 0xF
|
|
|
|
moveend 0x1, 0x0
|
|
|
|
end
|
|
|
|
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_OpponentUsesHealItem::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
|
|
|
pause 0x30
|
2020-08-21 00:02:00 +02:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
|
|
|
waitmessage 0x40
|
|
|
|
useitemonopponent
|
|
|
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
2018-02-08 11:17:41 +01:00
|
|
|
healthbarupdate BS_ATTACKER
|
|
|
|
datahpupdate BS_ATTACKER
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
|
|
|
waitmessage 0x40
|
2018-02-08 11:17:41 +01:00
|
|
|
updatestatusicon BS_ATTACKER
|
2017-11-25 18:42:31 +01:00
|
|
|
setbyte sMOVEEND_STATE, 0xF
|
|
|
|
moveend 0x1, 0x0
|
|
|
|
finishaction
|
|
|
|
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_OpponentUsesStatusCureItem::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
|
|
|
pause 0x30
|
2020-08-21 00:02:00 +02:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
|
|
|
waitmessage 0x40
|
|
|
|
useitemonopponent
|
2017-11-26 00:33:40 +01:00
|
|
|
printfromtable gTrainerItemCuredStatusStringIds
|
2017-11-25 18:42:31 +01:00
|
|
|
waitmessage 0x40
|
2018-02-08 11:17:41 +01:00
|
|
|
updatestatusicon BS_ATTACKER
|
2017-11-25 18:42:31 +01:00
|
|
|
setbyte sMOVEEND_STATE, 0xF
|
|
|
|
moveend 0x1, 0x0
|
|
|
|
finishaction
|
|
|
|
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_OpponentUsesXItem::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
|
|
|
pause 0x30
|
2020-08-21 00:02:00 +02:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
|
|
|
waitmessage 0x40
|
|
|
|
useitemonopponent
|
2017-11-26 00:33:40 +01:00
|
|
|
printfromtable gStatUpStringIds
|
2017-11-25 18:42:31 +01:00
|
|
|
waitmessage 0x40
|
|
|
|
setbyte sMOVEEND_STATE, 0xF
|
|
|
|
moveend 0x1, 0x0
|
|
|
|
finishaction
|
|
|
|
|
2017-12-02 23:31:58 +01:00
|
|
|
BattleScript_OpponentUsesGuardSpecs::
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
|
|
|
pause 0x30
|
2020-08-21 00:02:00 +02:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
|
|
|
waitmessage 0x40
|
|
|
|
useitemonopponent
|
2017-11-26 00:33:40 +01:00
|
|
|
printfromtable gMistUsedStringIds
|
2017-11-25 18:42:31 +01:00
|
|
|
waitmessage 0x40
|
|
|
|
setbyte sMOVEEND_STATE, 0xF
|
|
|
|
moveend 0x1, 0x0
|
|
|
|
finishaction
|
|
|
|
|
|
|
|
BattleScript_RunByUsingItem::
|
2020-08-21 00:02:00 +02:00
|
|
|
playse SE_FLEE
|
2018-02-08 00:35:13 +01:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_RAN
|
2017-11-25 18:42:31 +01:00
|
|
|
finishturn
|
|
|
|
|
2018-06-28 21:06:32 +02:00
|
|
|
BattleScript_ActionWatchesCarefully:
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_PKMNWATCHINGCAREFULLY
|
|
|
|
waitmessage 0x40
|
|
|
|
end2
|
|
|
|
|
2018-06-28 21:06:32 +02:00
|
|
|
BattleScript_ActionGetNear:
|
2017-11-26 00:33:40 +01:00
|
|
|
printfromtable gSafariGetNearStringIds
|
2017-11-25 18:42:31 +01:00
|
|
|
waitmessage 0x40
|
|
|
|
end2
|
|
|
|
|
2018-06-28 21:06:32 +02:00
|
|
|
BattleScript_ActionThrowPokeblock:
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_THREWPOKEBLOCKATPKMN
|
|
|
|
waitmessage 0x40
|
2018-09-10 21:19:19 +02:00
|
|
|
playanimation BS_ATTACKER, B_ANIM_POKEBLOCK_THROW, NULL
|
2017-11-26 00:33:40 +01:00
|
|
|
printfromtable gSafariPokeblockResultStringIds
|
2017-11-25 18:42:31 +01:00
|
|
|
waitmessage 0x40
|
|
|
|
end2
|
|
|
|
|
2018-06-28 21:06:32 +02:00
|
|
|
BattleScript_ActionWallyThrow:
|
2017-11-25 18:42:31 +01:00
|
|
|
printstring STRINGID_RETURNMON
|
|
|
|
waitmessage 0x40
|
|
|
|
returnatktoball
|
|
|
|
waitstate
|
2018-02-08 11:17:41 +01:00
|
|
|
trainerslidein BS_TARGET
|
2017-11-25 18:42:31 +01:00
|
|
|
waitstate
|
|
|
|
printstring STRINGID_YOUTHROWABALLNOWRIGHT
|
|
|
|
waitmessage 0x40
|
|
|
|
end2
|