sovereignx/data/battle_scripts_2.s

294 lines
8.7 KiB
ArmAsm
Raw Normal View History

#include "config/battle.h"
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"
#include "constants/moves.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"
2024-02-10 17:43:14 +00:00
.include "asm/macros.inc"
.include "asm/macros/battle_script.inc"
.include "constants/constants.inc"
2016-09-03 18:20:06 +01:00
2024-02-10 17:43:14 +00:00
.section script_data, "aw", %progbits
2016-09-03 18:20:06 +01:00
2024-02-10 17:43:14 +00:00
.align 2
2021-07-20 20:18:31 +01:00
gBattlescriptsForUsingItem::
2024-02-10 17:43:14 +00:00
.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
.4byte BattleScript_UsePokeFlute @ EFFECT_ITEM_USE_POKE_FLUTE
2024-02-10 17:43:14 +00:00
.align 2
2021-07-20 20:18:31 +01:00
gBattlescriptsForSafariActions::
2024-02-10 17:43:14 +00:00
.4byte BattleScript_ActionWatchesCarefully
.4byte BattleScript_ActionGetNear
.4byte BattleScript_ActionThrowPokeblock
.4byte BattleScript_ActionWallyThrow
BattleScript_ItemEnd:
2024-02-10 17:43:14 +00:00
end
BattleScript_UseItemMessage:
2024-02-10 17:43:14 +00:00
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_ItemRestoreHPRet:
2024-11-21 23:10:55 +00:00
clearmoveresultflags MOVE_RESULT_NO_EFFECT
2024-02-10 17:43:14 +00:00
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_SCRIPTING
datahpupdate BS_SCRIPTING
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
return
BattleScript_ItemRestoreHP::
2024-02-10 17:43:14 +00:00
call BattleScript_UseItemMessage
itemrestorehp BattleScript_ItemRestoreHPEnd, BattleScript_ItemRestoreHP_Battler
call BattleScript_ItemRestoreHP_Party
goto BattleScript_ItemRestoreHPEnd
BattleScript_ItemRestoreHP_Battler::
2024-02-10 17:43:14 +00:00
call BattleScript_ItemRestoreHPRet
BattleScript_ItemRestoreHPEnd:
2024-02-10 17:43:14 +00:00
end
BattleScript_ItemRestoreHP_Party::
2024-02-10 17:43:14 +00:00
jumpifbyte CMP_EQUAL, gBattleCommunication, TRUE, BattleScript_ItemRestoreHP_SendOutRevivedBattler
2024-11-21 23:10:55 +00:00
clearmoveresultflags MOVE_RESULT_NO_EFFECT
2024-02-10 17:43:14 +00:00
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
return
BattleScript_ItemRestoreHP_SendOutRevivedBattler:
2024-02-10 17:43:14 +00:00
switchinanim BS_SCRIPTING, FALSE
waitstate
switchineffects BS_SCRIPTING
end
BattleScript_ItemCureStatus::
2024-02-10 17:43:14 +00:00
call BattleScript_UseItemMessage
BattleScript_ItemCureStatusAfterItemMsg:
2024-02-10 17:43:14 +00:00
itemcurestatus BattleScript_ItemCureStatusEnd
updatestatusicon BS_SCRIPTING
printstring STRINGID_ITEMCUREDSPECIESSTATUS
waitmessage B_WAIT_TIME_LONG
BattleScript_ItemCureStatusEnd:
2024-02-10 17:43:14 +00:00
end
BattleScript_ItemHealAndCureStatus::
2024-02-10 17:43:14 +00:00
call BattleScript_UseItemMessage
itemrestorehp BattleScript_ItemCureStatusAfterItemMsg, BattleScript_ItemHealAndCureStatus_Battler
call BattleScript_ItemRestoreHP_Party
goto BattleScript_ItemHealAndCureStatusEnd
BattleScript_ItemHealAndCureStatus_Battler::
2024-02-10 17:43:14 +00:00
call BattleScript_ItemRestoreHPRet
BattleScript_ItemHealAndCureStatusEnd::
2024-02-10 17:43:14 +00:00
goto BattleScript_ItemCureStatusAfterItemMsg
BattleScript_ItemIncreaseStat::
2024-02-10 17:43:14 +00:00
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_UsePokeFlute::
checkpokeflute
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 1, BattleScript_PokeFluteWakeUp
printstring STRINGID_POKEFLUTECATCHY
waitmessage B_WAIT_TIME_LONG
goto BattleScript_PokeFluteEnd
BattleScript_PokeFluteWakeUp::
printstring STRINGID_POKEFLUTE
waitmessage B_WAIT_TIME_LONG
fanfare MUS_RG_POKE_FLUTE
waitfanfare
printstring STRINGID_MONHEARINGFLUTEAWOKE
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_PLAYER2
waitstate
BattleScript_PokeFluteEnd::
finishaction
BattleScript_ItemSetMist::
2024-02-10 17:43:14 +00:00
call BattleScript_UseItemMessage
setmist
playmoveanimation BS_ATTACKER, MOVE_MIST
waitanimation
printfromtable gMistUsedStringIds
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemSetFocusEnergy::
2024-02-10 17:43:14 +00:00
call BattleScript_UseItemMessage
jumpifstatus2 BS_ATTACKER, STATUS2_FOCUS_ENERGY_ANY, BattleScript_ButItFailed
setfocusenergy BS_ATTACKER
2024-02-10 17:43:14 +00:00
playmoveanimation BS_ATTACKER, MOVE_FOCUS_ENERGY
waitanimation
copybyte sBATTLER, gBattlerAttacker
printstring STRINGID_PKMNUSEDXTOGETPUMPED
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemRestorePP::
2024-02-10 17:43:14 +00:00
call BattleScript_UseItemMessage
itemrestorepp
printstring STRINGID_ITEMRESTOREDSPECIESPP
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemIncreaseAllStats::
2024-02-10 17:43:14 +00:00
call BattleScript_UseItemMessage
call BattleScript_AllStatsUp
end
2017-11-26 00:19:57 +00:00
BattleScript_BallThrow::
2024-02-10 17:43:14 +00:00
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_WALLY_TUTORIAL, BattleScript_BallThrowByWally
printstring STRINGID_PLAYERUSEDITEM
handleballthrow
2017-11-26 00:19:57 +00:00
BattleScript_BallThrowByWally::
2024-02-10 17:43:14 +00:00
printstring STRINGID_WALLYUSEDITEM
handleballthrow
2017-11-26 00:19:57 +00:00
BattleScript_SafariBallThrow::
2024-02-10 17:43:14 +00:00
printstring STRINGID_PLAYERUSEDITEM
updatestatusicon BS_ATTACKER
handleballthrow
BattleScript_SuccessBallThrow::
2024-02-10 17:43:14 +00:00
setbyte sMON_CAUGHT, TRUE
incrementgamestat GAME_STAT_POKEMON_CAPTURES
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 17:01:14 +01:00
BattleScript_TryPrintCaughtMonInfo:
2024-02-10 17:43:14 +00:00
jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_GiveCaughtMonEnd
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
printstring STRINGID_PKMNDATAADDEDTODEX
waitstate
setbyte gBattleCommunication, 0
displaydexinfo
BattleScript_TryNicknameCaughtMon::
2024-02-10 17:43:14 +00:00
printstring STRINGID_GIVENICKNAMECAPTURED
waitstate
setbyte gBattleCommunication, 0
trygivecaughtmonnick BattleScript_GiveCaughtMonEnd
givecaughtmon
printfromtable gCaughtMonStringIds
waitmessage B_WAIT_TIME_LONG
goto BattleScript_SuccessBallThrowEnd
BattleScript_GiveCaughtMonEnd::
2024-02-10 17:43:14 +00:00
givecaughtmon
BattleScript_SuccessBallThrowEnd::
2024-02-10 17:43:14 +00:00
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn
BattleScript_WallyBallThrow::
2024-02-10 17:43:14 +00:00
printstring STRINGID_GOTCHAPKMNCAUGHTWALLY
setbyte gBattleOutcome, B_OUTCOME_CAUGHT
finishturn
BattleScript_ShakeBallThrow::
2024-02-10 17:43:14 +00:00
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-02 23:47:21 +00:00
BattleScript_ShakeBallThrowEnd::
2024-02-10 17:43:14 +00:00
finishaction
BattleScript_TrainerBallBlock::
2024-02-10 17:43:14 +00:00
waitmessage B_WAIT_TIME_LONG
printstring STRINGID_TRAINERBLOCKEDBALL
waitmessage B_WAIT_TIME_LONG
printstring STRINGID_DONTBEATHIEF
waitmessage B_WAIT_TIME_LONG
finishaction
BattleScript_RunByUsingItem::
2024-02-10 17:43:14 +00:00
playse SE_FLEE
setbyte gBattleOutcome, B_OUTCOME_RAN
finishturn
2018-06-28 20:06:32 +01:00
BattleScript_ActionWatchesCarefully:
2024-02-10 17:43:14 +00:00
printstring STRINGID_PKMNWATCHINGCAREFULLY
waitmessage B_WAIT_TIME_LONG
end2
2018-06-28 20:06:32 +01:00
BattleScript_ActionGetNear:
2024-02-10 17:43:14 +00:00
printfromtable gSafariGetNearStringIds
waitmessage B_WAIT_TIME_LONG
end2
2018-06-28 20:06:32 +01:00
BattleScript_ActionThrowPokeblock:
2024-02-10 17:43:14 +00:00
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 20:06:32 +01:00
BattleScript_ActionWallyThrow:
2024-02-10 17:43:14 +00:00
printstring STRINGID_RETURNMON
waitmessage B_WAIT_TIME_LONG
returnatktoball
waitstate
trainerslidein BS_PLAYER1
2024-02-10 17:43:14 +00:00
waitstate
printstring STRINGID_YOUTHROWABALLNOWRIGHT
waitmessage B_WAIT_TIME_LONG
end2
BattleScript_TrainerASlideMsgRet::
2024-02-10 17:43:14 +00:00
handletrainerslidemsg BS_SCRIPTING, 0
trainerslidein BS_OPPONENT1
2024-02-10 17:43:14 +00:00
handletrainerslidemsg BS_SCRIPTING, 1
waitstate
trainerslideout BS_OPPONENT1
2024-02-10 17:43:14 +00:00
waitstate
handletrainerslidemsg BS_SCRIPTING, 2
return
BattleScript_TrainerASlideMsgEnd2::
2024-02-10 17:43:14 +00:00
call BattleScript_TrainerASlideMsgRet
end2
BattleScript_TrainerBSlideMsgRet::
2024-02-10 17:43:14 +00:00
handletrainerslidemsg BS_SCRIPTING, 0
trainerslidein BS_OPPONENT2
2024-02-10 17:43:14 +00:00
handletrainerslidemsg BS_SCRIPTING, 1
waitstate
trainerslideout BS_OPPONENT2
2024-02-10 17:43:14 +00:00
waitstate
handletrainerslidemsg BS_SCRIPTING, 2
return
BattleScript_TrainerBSlideMsgEnd2::
2024-02-10 17:43:14 +00:00
call BattleScript_TrainerBSlideMsgRet
end2