pokeemerald/data/battle_scripts_2.s

260 lines
8.1 KiB
ArmAsm
Raw Normal View History

#include "config/battle.h"
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"
#include "constants/moves.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"
.include "asm/macros.inc"
.include "asm/macros/battle_script.inc"
.include "constants/constants.inc"
2016-09-03 19:20:06 +02:00
.section script_data, "aw", %progbits
2016-09-03 19:20:06 +02:00
.align 2
2021-07-20 21:18:31 +02:00
gBattlescriptsForUsingItem::
.4byte BattleScript_ItemRestoreHP @ EFFECT_ITEM_RESTORE_HP
.4byte BattleScript_ItemCureStatus @ EFFECT_ITEM_CURE_STATUS
.4byte BattleScript_ItemHealAndCureStatus @ EFFECT_ITEM_HEAL_AND_CURE_STATUS
.4byte BattleScript_ItemIncreaseStat @ EFFECT_ITEM_INCREASE_STAT
.4byte BattleScript_ItemSetMist @ EFFECT_ITEM_SET_MIST
.4byte BattleScript_ItemSetFocusEnergy @ EFFECT_ITEM_SET_FOCUS_ENERGY
.4byte BattleScript_RunByUsingItem @ EFFECT_ITEM_ESCAPE
.4byte BattleScript_BallThrow @ EFFECT_ITEM_THROW_BALL
.4byte BattleScript_ItemRestoreHP @ EFFECT_ITEM_REVIVE
.4byte BattleScript_ItemRestorePP @ EFFECT_ITEM_RESTORE_PP
.4byte BattleScript_ItemIncreaseAllStats @ EFFECT_ITEM_INCREASE_ALL_STATS
.align 2
2021-07-20 21:18:31 +02:00
gBattlescriptsForSafariActions::
.4byte BattleScript_ActionWatchesCarefully
.4byte BattleScript_ActionGetNear
.4byte BattleScript_ActionThrowPokeblock
.4byte BattleScript_ActionWallyThrow
BattleScript_ItemEnd:
end
BattleScript_UseItemMessage:
printstring STRINGID_EMPTYSTRING3
pause B_WAIT_TIME_MED
playse SE_USE_ITEM
getbattlerside BS_ATTACKER
copybyte cMULTISTRING_CHOOSER, gBattleCommunication
printfromtable gTrainerUsedItemStringIds
waitmessage B_WAIT_TIME_LONG
return
BattleScript_ItemRestoreHP::
call BattleScript_UseItemMessage
itemrestorehp
jumpifbyte CMP_EQUAL, gBattleCommunication, TRUE, BattleScript_ItemRestoreHP_SendOutRevivedBattler
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
2023-04-15 18:27:28 +02:00
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemRestoreHP_SendOutRevivedBattler:
2023-05-23 23:19:24 +02:00
switchinanim BS_SCRIPTING, FALSE
waitstate
2023-05-23 23:19:24 +02:00
switchineffects BS_SCRIPTING
end
BattleScript_ItemCureStatus::
call BattleScript_UseItemMessage
itemcurestatus
2023-04-15 18:27:28 +02:00
updatestatusicon BS_ATTACKER
printstring STRINGID_ITEMCUREDSPECIESSTATUS
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemHealAndCureStatus::
call BattleScript_UseItemMessage
itemrestorehp
2023-04-21 21:37:02 +02:00
itemcurestatus
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
updatestatusicon BS_ATTACKER
2023-04-15 18:27:28 +02:00
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemIncreaseStat::
call BattleScript_UseItemMessage
itemincreasestat
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_ItemEnd
setgraphicalstatchangevalues
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemSetMist::
call BattleScript_UseItemMessage
setmist
playmoveanimation BS_ATTACKER, MOVE_MIST
waitanimation
printfromtable gMistUsedStringIds
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemSetFocusEnergy::
call BattleScript_UseItemMessage
jumpifstatus2 BS_ATTACKER, STATUS2_FOCUS_ENERGY, BattleScript_ButItFailed
setfocusenergy
playmoveanimation BS_ATTACKER, MOVE_FOCUS_ENERGY
waitanimation
printstring STRINGID_PKMNUSEDXTOGETPUMPED
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemRestorePP::
call BattleScript_UseItemMessage
itemrestorepp
printstring STRINGID_ITEMRESTOREDSPECIESPP
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemIncreaseAllStats::
call BattleScript_UseItemMessage
call BattleScript_AllStatsUp
end
2017-11-26 01:19:57 +01:00
BattleScript_BallThrow::
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_WALLY_TUTORIAL, BattleScript_BallThrowByWally
printstring STRINGID_PLAYERUSEDITEM
handleballthrow
2017-11-26 01:19:57 +01:00
BattleScript_BallThrowByWally::
printstring STRINGID_WALLYUSEDITEM
handleballthrow
2017-11-26 01:19:57 +01:00
BattleScript_SafariBallThrow::
printstring STRINGID_PLAYERUSEDITEM
updatestatusicon BS_ATTACKER
handleballthrow
BattleScript_SuccessBallThrow::
setbyte sMON_CAUGHT, TRUE
incrementgamestat GAME_STAT_POKEMON_CAPTURES
BattleScript_PrintCaughtMonInfo::
printstring STRINGID_GOTCHAPKMNCAUGHTPLAYER
jumpifbyte CMP_NOT_EQUAL, sEXP_CATCH, TRUE, BattleScript_TryPrintCaughtMonInfo
setbyte sGIVEEXP_STATE, 0
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::
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn
BattleScript_WallyBallThrow::
printstring STRINGID_GOTCHAPKMNCAUGHTWALLY
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn
BattleScript_ShakeBallThrow::
printfromtable gBallEscapeStringIds
waitmessage B_WAIT_TIME_LONG
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_ShakeBallThrowEnd
printstring STRINGID_OUTOFSAFARIBALLS
waitmessage B_WAIT_TIME_LONG
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_RunByUsingItem::
playse SE_FLEE
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
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
trainerslidein BS_TARGET
waitstate
printstring STRINGID_YOUTHROWABALLNOWRIGHT
waitmessage B_WAIT_TIME_LONG
end2
BattleScript_TrainerASlideMsgRet::
handletrainerslidemsg BS_SCRIPTING, 0
trainerslidein B_POSITION_OPPONENT_LEFT
handletrainerslidemsg BS_SCRIPTING, 1
waitstate
trainerslideout B_POSITION_OPPONENT_LEFT
waitstate
handletrainerslidemsg BS_SCRIPTING, 2
return
BattleScript_TrainerASlideMsgEnd2::
call BattleScript_TrainerASlideMsgRet
end2
BattleScript_TrainerBSlideMsgRet::
handletrainerslidemsg BS_SCRIPTING, 0
trainerslidein B_POSITION_OPPONENT_RIGHT
handletrainerslidemsg BS_SCRIPTING, 1
waitstate
trainerslideout B_POSITION_OPPONENT_RIGHT
waitstate
handletrainerslidemsg BS_SCRIPTING, 2
return
BattleScript_TrainerBSlideMsgEnd2::
call BattleScript_TrainerBSlideMsgRet
end2