pokeemerald/data/battle_scripts_2.s

208 lines
5.8 KiB
ArmAsm
Raw Normal View History

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