2018-02-07 23:35:13 +00:00
|
|
|
#include "constants/battle.h"
|
2018-02-08 10:17:41 +00:00
|
|
|
#include "constants/battle_script_commands.h"
|
2018-02-07 23:35:13 +00:00
|
|
|
#include "constants/battle_anim.h"
|
|
|
|
#include "constants/battle_string_ids.h"
|
2018-08-03 17:01:14 +01:00
|
|
|
#include "constants/battle_config.h"
|
2017-12-11 18:41:13 +00:00
|
|
|
#include "constants/items.h"
|
2017-12-11 18:27:51 +00:00
|
|
|
#include "constants/songs.h"
|
2018-08-03 17:07:45 +01:00
|
|
|
#include "constants/game_stat.h"
|
2016-11-01 15:29:13 +00:00
|
|
|
.include "asm/macros.inc"
|
2017-11-25 17:42:31 +00:00
|
|
|
.include "asm/macros/battle_script.inc"
|
2016-11-01 15:29:13 +00:00
|
|
|
.include "constants/constants.inc"
|
2016-09-03 18:20:06 +01:00
|
|
|
|
|
|
|
.section script_data, "aw", %progbits
|
|
|
|
|
2017-09-25 22:26:45 +01:00
|
|
|
.align 2
|
2021-07-20 20:18:31 +01:00
|
|
|
gBattlescriptsForUsingItem::
|
2017-12-02 22:31:58 +00:00
|
|
|
.4byte BattleScript_PlayerUsesItem
|
2020-07-21 18:29:51 +01: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
|
2021-04-03 20:18:17 +01:00
|
|
|
.4byte BattleScript_OpponentUsesGuardSpec @ AI_ITEM_GUARD_SPEC
|
2016-09-03 18:20:06 +01:00
|
|
|
|
2017-09-25 22:26:45 +01:00
|
|
|
.align 2
|
2021-07-20 20:18:31 +01:00
|
|
|
gBattlescriptsForRunningByItem::
|
2017-10-05 23:12:01 +01:00
|
|
|
.4byte BattleScript_RunByUsingItem
|
2016-09-03 18:20:06 +01:00
|
|
|
|
2017-09-25 22:26:45 +01:00
|
|
|
.align 2
|
2021-07-20 20:18:31 +01:00
|
|
|
gBattlescriptsForSafariActions::
|
2017-11-25 23:33:40 +00:00
|
|
|
.4byte BattleScript_ActionWatchesCarefully
|
|
|
|
.4byte BattleScript_ActionGetNear
|
|
|
|
.4byte BattleScript_ActionThrowPokeblock
|
2018-06-28 20:06:32 +01:00
|
|
|
.4byte BattleScript_ActionWallyThrow
|
2017-11-25 17:42:31 +00:00
|
|
|
|
2017-11-26 00:19:57 +00:00
|
|
|
BattleScript_BallThrow::
|
2018-02-08 10:17:41 +00:00
|
|
|
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_WALLY_TUTORIAL, BattleScript_BallThrowByWally
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_PLAYERUSEDITEM
|
2017-11-26 00:19:57 +00:00
|
|
|
handleballthrow
|
2017-11-25 17:42:31 +00:00
|
|
|
|
2017-11-26 00:19:57 +00:00
|
|
|
BattleScript_BallThrowByWally::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_WALLYUSEDITEM
|
2017-11-26 00:19:57 +00:00
|
|
|
handleballthrow
|
2017-11-25 17:42:31 +00:00
|
|
|
|
2017-11-26 00:19:57 +00:00
|
|
|
BattleScript_SafariBallThrow::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_PLAYERUSEDITEM
|
2018-02-08 10:17:41 +00:00
|
|
|
updatestatusicon BS_ATTACKER
|
2017-11-26 00:19:57 +00:00
|
|
|
handleballthrow
|
2017-11-25 17:42:31 +00:00
|
|
|
|
|
|
|
BattleScript_SuccessBallThrow::
|
2018-08-03 17:01:14 +01:00
|
|
|
setbyte sMON_CAUGHT, TRUE
|
2018-08-03 17:07:45 +01:00
|
|
|
incrementgamestat GAME_STAT_POKEMON_CAPTURES
|
2017-12-02 22:31:58 +00:00
|
|
|
BattleScript_PrintCaughtMonInfo::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_GOTCHAPKMNCAUGHT
|
2018-08-03 17:01:14 +01:00
|
|
|
jumpifbyte CMP_NOT_EQUAL, sEXP_CATCH, TRUE, BattleScript_TryPrintCaughtMonInfo
|
2021-04-28 02:36:37 +01:00
|
|
|
setbyte sGIVEEXP_STATE, 0
|
2018-08-03 17:01:14 +01:00
|
|
|
getexp BS_TARGET
|
2021-04-28 02:36:37 +01:00
|
|
|
sethword gBattle_BG2_X, 0
|
2018-08-03 17:01:14 +01:00
|
|
|
BattleScript_TryPrintCaughtMonInfo:
|
2017-12-02 22:31:58 +00:00
|
|
|
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_PKMNDATAADDEDTODEX
|
|
|
|
waitstate
|
2021-04-02 07:27:12 +01:00
|
|
|
setbyte gBattleCommunication, 0
|
2017-11-25 17:42:31 +00:00
|
|
|
displaydexinfo
|
2017-12-02 22:31:58 +00:00
|
|
|
BattleScript_TryNicknameCaughtMon::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_GIVENICKNAMECAPTURED
|
|
|
|
waitstate
|
2021-04-02 07:27:12 +01:00
|
|
|
setbyte gBattleCommunication, 0
|
2017-12-02 22:31:58 +00:00
|
|
|
trygivecaughtmonnick BattleScript_GiveCaughtMonEnd
|
2017-11-25 17:42:31 +00:00
|
|
|
givecaughtmon
|
2017-11-25 23:33:40 +00:00
|
|
|
printfromtable gCaughtMonStringIds
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-12-02 22:31:58 +00:00
|
|
|
goto BattleScript_SuccessBallThrowEnd
|
|
|
|
BattleScript_GiveCaughtMonEnd::
|
2017-11-25 17:42:31 +00:00
|
|
|
givecaughtmon
|
2017-12-02 22:31:58 +00:00
|
|
|
BattleScript_SuccessBallThrowEnd::
|
2018-02-07 23:35:13 +00:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
|
2017-11-25 17:42:31 +00:00
|
|
|
finishturn
|
|
|
|
|
|
|
|
BattleScript_WallyBallThrow::
|
|
|
|
printstring STRINGID_GOTCHAPKMNCAUGHT2
|
2018-02-07 23:35:13 +00:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
|
2017-11-25 17:42:31 +00:00
|
|
|
finishturn
|
|
|
|
|
|
|
|
BattleScript_ShakeBallThrow::
|
2017-11-25 23:33:40 +00:00
|
|
|
printfromtable gBallEscapeStringIds
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2018-02-08 10:17:41 +00:00
|
|
|
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
|
2021-04-03 17:38:07 +01:00
|
|
|
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_ShakeBallThrowEnd
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_OUTOFSAFARIBALLS
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2018-02-07 23:35:13 +00:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
|
2017-12-02 23:47:21 +00:00
|
|
|
BattleScript_ShakeBallThrowEnd::
|
2017-11-25 17:42:31 +00:00
|
|
|
finishaction
|
|
|
|
|
|
|
|
BattleScript_TrainerBallBlock::
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_TRAINERBLOCKEDBALL
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_DONTBEATHIEF
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
finishaction
|
|
|
|
|
2017-12-02 22:31:58 +00:00
|
|
|
BattleScript_PlayerUsesItem::
|
2021-04-03 17:38:07 +01:00
|
|
|
moveendcase MOVEEND_MIRROR_MOVE
|
2017-11-25 17:42:31 +00:00
|
|
|
end
|
|
|
|
|
2017-12-02 22:31:58 +00:00
|
|
|
BattleScript_OpponentUsesHealItem::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
2021-04-02 07:27:12 +01:00
|
|
|
pause B_WAIT_TIME_MED
|
2020-08-20 23:02:00 +01:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2018-08-11 11:16:00 +01:00
|
|
|
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
2017-11-25 17:42:31 +00:00
|
|
|
useitemonopponent
|
|
|
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
2018-02-08 10:17:41 +00:00
|
|
|
healthbarupdate BS_ATTACKER
|
|
|
|
datahpupdate BS_ATTACKER
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2018-02-08 10:17:41 +00:00
|
|
|
updatestatusicon BS_ATTACKER
|
2021-04-03 17:38:07 +01:00
|
|
|
moveendcase MOVEEND_MIRROR_MOVE
|
2017-11-25 17:42:31 +00:00
|
|
|
finishaction
|
|
|
|
|
2017-12-02 22:31:58 +00:00
|
|
|
BattleScript_OpponentUsesStatusCureItem::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
2021-04-02 07:27:12 +01:00
|
|
|
pause B_WAIT_TIME_MED
|
2020-08-20 23:02:00 +01:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
useitemonopponent
|
2017-11-25 23:33:40 +00:00
|
|
|
printfromtable gTrainerItemCuredStatusStringIds
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2018-02-08 10:17:41 +00:00
|
|
|
updatestatusicon BS_ATTACKER
|
2021-04-03 17:38:07 +01:00
|
|
|
moveendcase MOVEEND_MIRROR_MOVE
|
2017-11-25 17:42:31 +00:00
|
|
|
finishaction
|
|
|
|
|
2017-12-02 22:31:58 +00:00
|
|
|
BattleScript_OpponentUsesXItem::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
2021-04-02 07:27:12 +01:00
|
|
|
pause B_WAIT_TIME_MED
|
2020-08-20 23:02:00 +01:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
useitemonopponent
|
2017-11-25 23:33:40 +00:00
|
|
|
printfromtable gStatUpStringIds
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2021-04-03 17:38:07 +01:00
|
|
|
moveendcase MOVEEND_MIRROR_MOVE
|
2017-11-25 17:42:31 +00:00
|
|
|
finishaction
|
|
|
|
|
2021-04-03 20:18:17 +01:00
|
|
|
BattleScript_OpponentUsesGuardSpec::
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_EMPTYSTRING3
|
2021-04-02 07:27:12 +01:00
|
|
|
pause B_WAIT_TIME_MED
|
2020-08-20 23:02:00 +01:00
|
|
|
playse SE_USE_ITEM
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_TRAINER1USEDITEM
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
useitemonopponent
|
2017-11-25 23:33:40 +00:00
|
|
|
printfromtable gMistUsedStringIds
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2021-04-03 17:38:07 +01:00
|
|
|
moveendcase MOVEEND_MIRROR_MOVE
|
2017-11-25 17:42:31 +00:00
|
|
|
finishaction
|
|
|
|
|
|
|
|
BattleScript_RunByUsingItem::
|
2020-08-20 23:02:00 +01:00
|
|
|
playse SE_FLEE
|
2018-02-07 23:35:13 +00:00
|
|
|
setbyte gBattleOutcome, B_OUTCOME_RAN
|
2017-11-25 17:42:31 +00:00
|
|
|
finishturn
|
|
|
|
|
2018-06-28 20:06:32 +01:00
|
|
|
BattleScript_ActionWatchesCarefully:
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_PKMNWATCHINGCAREFULLY
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
end2
|
|
|
|
|
2018-06-28 20:06:32 +01:00
|
|
|
BattleScript_ActionGetNear:
|
2017-11-25 23:33:40 +00:00
|
|
|
printfromtable gSafariGetNearStringIds
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
end2
|
|
|
|
|
2018-06-28 20:06:32 +01:00
|
|
|
BattleScript_ActionThrowPokeblock:
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_THREWPOKEBLOCKATPKMN
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2018-09-10 20:19:19 +01:00
|
|
|
playanimation BS_ATTACKER, B_ANIM_POKEBLOCK_THROW, NULL
|
2017-11-25 23:33:40 +00:00
|
|
|
printfromtable gSafariPokeblockResultStringIds
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
end2
|
|
|
|
|
2018-06-28 20:06:32 +01:00
|
|
|
BattleScript_ActionWallyThrow:
|
2017-11-25 17:42:31 +00:00
|
|
|
printstring STRINGID_RETURNMON
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
returnatktoball
|
|
|
|
waitstate
|
2018-02-08 10:17:41 +00:00
|
|
|
trainerslidein BS_TARGET
|
2017-11-25 17:42:31 +00:00
|
|
|
waitstate
|
|
|
|
printstring STRINGID_YOUTHROWABALLNOWRIGHT
|
2021-04-02 07:27:12 +01:00
|
|
|
waitmessage B_WAIT_TIME_LONG
|
2017-11-25 17:42:31 +00:00
|
|
|
end2
|
2021-02-01 19:43:10 +00:00
|
|
|
|
2018-11-03 00:17:16 +00:00
|
|
|
BattleScript_TrainerSlideMsgRet::
|
|
|
|
handletrainerslidemsg BS_SCRIPTING, 0
|
|
|
|
trainerslidein 1
|
|
|
|
handletrainerslidemsg BS_SCRIPTING, 1
|
|
|
|
waitstate
|
|
|
|
trainerslideout 1
|
|
|
|
handletrainerslidemsg BS_SCRIPTING, 2
|
|
|
|
waitstate
|
|
|
|
return
|
2021-02-01 19:43:10 +00:00
|
|
|
|
2018-11-03 00:17:16 +00:00
|
|
|
BattleScript_TrainerSlideMsgEnd2::
|
|
|
|
call BattleScript_TrainerSlideMsgRet
|
|
|
|
end2
|