Sync bev2 with pret

This commit is contained in:
ExpoSeed 2020-10-10 23:57:16 -05:00
commit 9e2c8a95c1
854 changed files with 66663 additions and 14056 deletions

View File

@ -227,15 +227,15 @@
.byte \battler
.endm
.macro if_equal_ param0:req, param1:req
.macro if_equal_u32 param0:req, param1:req
.byte 0x26
.byte \param0
.4byte \param0
.4byte \param1
.endm
.macro if_not_equal_ param0:req, param1:req
.macro if_not_equal_u32 param0:req, param1:req
.byte 0x27
.byte \param0
.4byte \param0
.4byte \param1
.endm
@ -245,10 +245,10 @@
.4byte \param1
.endm
.macro if_user_doesnt_go param0:req, param1:req
.macro if_cant_use_belch battler:req, ptr:req
.byte 0x29
.byte \param0
.4byte \param1
.byte \battler
.4byte \ptr
.endm
.macro nullsub_2A
@ -315,13 +315,13 @@
.macro if_effect param0:req, param1:req
.byte 0x37
.byte \param0
.2byte \param0
.4byte \param1
.endm
.macro if_not_effect param0:req, param1:req
.byte 0x38
.byte \param0
.2byte \param0
.4byte \param1
.endm
@ -467,24 +467,32 @@
.byte \battler
.endm
.macro nullsub_52
.macro if_move_flag flag jumpptr
.byte 0x52
.4byte \flag
.4byte \jumpptr
.endm
.macro nullsub_53
.macro if_field_status flag jumpptr
.byte 0x53
.4byte \flag
.4byte \jumpptr
.endm
.macro nullsub_54
.macro get_move_accuracy
.byte 0x54
.endm
.macro nullsub_55
.macro call_if_eq value, ptr
.byte 0x55
.2byte \value
.4byte \ptr
.endm
.macro nullsub_56
.byte 0x56
.macro call_if_move_flag flag ptr
.byte 0x52
.4byte \flag
.4byte \ptr
.endm
.macro nullsub_57
@ -551,7 +559,158 @@
.4byte \param2
.endm
.macro get_ally_chosen_move
.byte 0x63
.endm
.macro if_has_no_attacking_moves battler:req, param1:req
.byte 0x64
.byte \battler
.4byte \param1
.endm
.macro get_hazards_count battler:req, effect:req
.byte 0x65
.byte \battler
.2byte \effect
.endm
.macro if_doesnt_hold_berry battler:req, ptr:req
.byte 0x66
.byte \battler
.4byte \ptr
.endm
.macro if_share_type battler1:req, battler2:req, ptr:req
.byte 0x67
.byte \battler1
.byte \battler2
.4byte \ptr
.endm
.macro if_cant_use_last_resort battler:req, ptr:req
.byte 0x68
.byte \battler
.4byte \ptr
.endm
.macro if_has_move_with_split battler:req, split:req, ptr:req
.byte 0x69
.byte \battler
.byte \split
.4byte \ptr
.endm
.macro if_has_no_move_with_split battler:req, split:req, ptr:req
.byte 0x6A
.byte \battler
.byte \split
.4byte \ptr
.endm
.macro if_physical_moves_unusable attacker:req, target:req, ptr:req
.byte 0x6B
.byte \attacker
.byte \target
.4byte \ptr
.endm
.macro if_ai_can_go_down ptr:req
.byte 0x6C
.4byte \ptr
.endm
.macro if_has_move_with_type battler:req, type:req, ptr:req
.byte 0x6D
.byte \battler
.byte \type
.4byte \ptr
.endm
.macro if_no_move_used battler:req, ptr:req
.byte 0x6E
.byte \battler
.4byte \ptr
.endm
.macro if_has_move_with_flag battler:req, flag:req, ptr:req
.byte 0x6F
.byte \battler
.4byte \flag
.4byte \ptr
.endm
.macro if_battler_absent battler:req, ptr:req
.byte 0x70
.byte \battler
.4byte \ptr
.endm
.macro if_grounded battler:req, ptr:req
.byte 0x71
.byte \battler
.4byte \ptr
.endm
.macro get_best_dmg_hp_percent
.byte 0x72
.endm
.macro get_curr_dmg_hp_percent
.byte 0x73
.endm
.macro get_move_split_from_result
.byte 0x74
.endm
.macro get_considered_move_split
.byte 0x75
.endm
.macro get_considered_move_target
.byte 0x76
.endm
.macro compare_speeds battler1:req, battler2:req
.byte 0x77
.byte \battler1
.byte \battler2
.endm
.macro is_wakeup_turn battler:req
.byte 0x78
.byte \battler
.endm
.macro if_has_move_with_accuracy_lt battler:req, value:req, ptr:req
.byte 0x79
.byte \battler
.byte \value
.4byte \ptr
.endm
@ useful script macros
.macro if_has_physical_move battler:req, ptr:req
if_has_move_with_split \battler, SPLIT_PHYSICAL, \ptr
.endm
.macro if_has_no_physical_move battler:req, ptr:req
if_has_no_move_with_split \battler, SPLIT_PHYSICAL, \ptr
.endm
.macro if_has_special_move battler:req, ptr:req
if_has_move_with_split \battler, SPLIT_SPECIAL, \ptr
.endm
.macro if_has_no_special_move battler:req, ptr:req
if_has_no_move_with_split \battler, SPLIT_SPECIAL, \ptr
.endm
.macro if_holds_no_item battler, ptr:req
if_holds_item \battler, 0, \ptr
.endm
.macro get_curr_move_type
get_type AI_TYPE_MOVE
.endm
@ -617,3 +776,8 @@
.macro if_any_move_encored battler:req, ptr:req
if_any_move_disabled_or_encored \battler, 1, \ptr
.endm
.macro call_if_always_hit ptr:req
get_move_accuracy
call_if_eq 0, \ptr
.endm

View File

@ -283,3 +283,48 @@
.macro jumpretfalse ptr:req
jumpreteq FALSE, \ptr
.endm
.macro jumpifdoublebattle ptr:req
createvisualtask AnimTask_IsDoubleBattle, 0
jumprettrue \ptr
.endm
@ keep CFRU macros cause I'm lazy. todo: update to createsprite and createvisualtask, respectively
.macro launchtemplate launchtemplatePtr launchtemplatePriority launchtemplateArgsNo launchtemplatearg0 launchtemplatearg1 launchtemplatearg2 launchtemplatearg3 launchtemplatearg4 launchtemplatearg5 launchtemplatearg6 launchtemplatearg7 launchtemplatearg8
.byte 0x2
.word \launchtemplatePtr
.byte \launchtemplatePriority
.byte \launchtemplateArgsNo
.hword \launchtemplatearg0
.hword \launchtemplatearg1
.hword \launchtemplatearg2
.hword \launchtemplatearg3
.hword \launchtemplatearg4
.hword \launchtemplatearg5
.hword \launchtemplatearg6
.hword \launchtemplatearg7
.hword \launchtemplatearg8
.endm
.macro launchtask launchtaskPtr launchtaskPriority launchtaskArgsNo launchtaskarg0 launchtaskarg1 launchtaskarg2 launchtaskarg3 launchtaskarg4 launchtaskarg5 launchtaskarg6 launchtaskarg7 launchtaskarg8
.byte 0x3
.word \launchtaskPtr
.byte \launchtaskPriority
.byte \launchtaskArgsNo
.hword \launchtaskarg0
.hword \launchtaskarg1
.hword \launchtaskarg2
.hword \launchtaskarg3
.hword \launchtaskarg4
.hword \launchtaskarg5
.hword \launchtaskarg6
.hword \launchtaskarg7
.hword \launchtaskarg8
.endm
.macro setblends setblends_value
.byte 0xC
.hword \setblends_value
.endm

View File

@ -89,3 +89,77 @@
setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_INTERVIEW_DATA
special CallBattleTowerFunc
.endm
@Custom multi-battle commands
.macro choose_mons
fadescreen 1
special ChooseHalfPartyForBattle @ choose 3 mons for battle
waitstate
.endm
.macro multi_do type:req, partnerId:req, partnerPicId:req
special ReducePlayerPartyToSelectedMons
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA
setvar VAR_0x8005, FRONTIER_DATA_SELECTED_MON_ORDER
special CallFrontierUtilFunc @ saves the mon order, so the non-selected mons get restored afterwards
setvar VAR_0x8004, SPECIAL_BATTLE_MULTI
setvar VAR_0x8005, \type | MULTI_BATTLE_CHOOSE_MONS
setvar VAR_0x8006, \partnerId
setvar VAR_0x8007, \partnerPicId
special DoSpecialTrainerBattle
waitstate
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY
special CallFrontierUtilFunc
special LoadPlayerParty
.endm
.macro multi_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons
multi_do MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId
.endm
.macro multi_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
multi_do MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId
.endm
@ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out.
.macro multi_wild partnerId:req, partnerPicId:req
special SavePlayerParty
multi_do MULTI_BATTLE_2_VS_WILD, \partnerId, \partnerPicId
.endm
.macro multi_do_fixed type:req, partnerId:req, partnerPicId:req
setvar VAR_0x8004, SPECIAL_BATTLE_MULTI
setvar VAR_0x8005, \type
setvar VAR_0x8006, \partnerId
setvar VAR_0x8007, \partnerPicId
special DoSpecialTrainerBattle
waitstate
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY
special CallFrontierUtilFunc
special LoadPlayerParty
.endm
.macro multi_fixed_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons
multi_do_fixed MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId
.endm
.macro multi_fixed_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req
special SavePlayerParty
trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons
multi_do_fixed MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId
.endm
@ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out.
.macro multi_fixed_wild partnerId:req, partnerPicId:req
special SavePlayerParty
multi_do_fixed MULTI_BATTLE_2_VS_WILD, \partnerId, \partnerPicId
.endm

View File

@ -29,11 +29,11 @@
.byte 0x6
.endm
.macro adjustnormaldamage
.macro adjustdamage
.byte 0x7
.endm
.macro adjustnormaldamage2
.macro multihitresultmessage
.byte 0x8
.endm
@ -150,7 +150,7 @@
.macro jumpifsideaffecting battler:req, sidestatus:req, ptr:req
.byte 0x1f
.byte \battler
.2byte \sidestatus
.4byte \sidestatus
.4byte \ptr
.endm
@ -171,12 +171,21 @@
.4byte \ptr
.endm
.macro jumpiftype battler:req, type:req, ptr:req
.macro jumpbasedontype battler:req, type:req, case:req, ptr:req
.byte 0x22
.byte \battler
.byte \type
.byte \case
.4byte \ptr
.endm
.macro jumpiftype battler:req, type:req, ptr:req
jumpbasedontype \battler, \type, 1, \ptr
.endm
.macro jumpifnottype battler:req, type:req, ptr:req
jumpbasedontype \battler, \type, 0, \ptr
.endm
.macro getexp battler:req
.byte 0x23
@ -356,11 +365,8 @@
.4byte \ptr
.endm
.macro jumpiftype2 battler:req, type:req, ptr:req
.macro setroost
.byte 0x42
.byte \battler
.byte \type
.4byte \ptr
.endm
.macro jumpifabilitypresent ability:req, ptr:req
@ -436,8 +442,9 @@
moveend 2, \to
.endm
.macro typecalc2
.macro sethealblock ptr
.byte 0x4a
.4byte \ptr
.endm
.macro returnatktoball
@ -593,8 +600,9 @@
.byte 0x68
.endm
.macro adjustsetdamage
.macro setgravity ptr
.byte 0x69
.4byte \ptr
.endm
.macro removeitem battler:req
@ -623,7 +631,7 @@
.byte \battler
.endm
.macro recordlastability battler:req
.macro recordability battler:req
.byte 0x70
.byte \battler
.endm
@ -711,8 +719,9 @@
.4byte \ptr
.endm
.macro nop
.macro setmiracleeye ptr
.byte 0x83
.4byte \ptr
.endm
.macro jumpifcantmakeasleep param0:req
@ -720,8 +729,9 @@
.4byte \param0
.endm
.macro stockpile
.macro stockpile id:req
.byte 0x85
.byte \id
.endm
.macro stockpiletobasedamage param0:req
@ -734,13 +744,13 @@
.4byte \param0
.endm
.macro negativedamage
.macro setdrainedhp
.byte 0x88
.endm
.macro statbuffchange flags:req, jumpptr:req
.byte 0x89
.byte \flags
.2byte \flags
.4byte \jumpptr
.endm
@ -895,8 +905,9 @@
.byte 0xab
.endm
.macro remaininghptopower
.macro settailwind ptr:req
.byte 0xac
.4byte \ptr
.endm
.macro tryspiteppreduce param0:req
@ -927,7 +938,7 @@
.4byte \param0
.endm
.macro rolloutdamagecalculation
.macro handlerollout
.byte 0xb3
.endm
@ -937,12 +948,13 @@
.4byte \ptr
.endm
.macro furycuttercalc
.macro handlefurycutter
.byte 0xb5
.endm
.macro happinesstodamagecalculation
.macro setembargo ptr
.byte 0xb6
.4byte \ptr
.endm
.macro presentdamagecalculation
@ -989,8 +1001,9 @@
.4byte \param0
.endm
.macro hiddenpowercalc
.macro setstickyweb ptr
.byte 0xc1
.4byte \ptr
.endm
.macro selectfirstvalidtarget
@ -1082,13 +1095,14 @@
.4byte \param1
.endm
.macro trysetroots param0:req
.macro settoxicspikes ptr:req
.byte 0xd5
.4byte \param0
.4byte \ptr
.endm
.macro doubledamagedealtifdamaged
.macro setgastroacid ptr
.byte 0xd6
.4byte \ptr
.endm
.macro setyawn param0:req
@ -1101,7 +1115,7 @@
.4byte \param0
.endm
.macro scaledamagebyhealthratio
.macro setroom
.byte 0xd9
.endm
@ -1115,13 +1129,15 @@
.4byte \param0
.endm
.macro trysetgrudge param0:req
.macro setstealthrock ptr:req
.byte 0xdc
.4byte \param0
.4byte \ptr
.endm
.macro weightdamagecalculation
.macro setuserstatus3 flags ptr
.byte 0xdd
.4byte \flags
.4byte \ptr
.endm
.macro assistattackselect param0:req
@ -1176,8 +1192,9 @@
.4byte \param0
.endm
.macro setweatherballtype
.macro jumpifsubstituteblocks ptr
.byte 0xe9
.4byte \ptr
.endm
.macro tryrecycleitem param0:req
@ -1246,6 +1263,41 @@
.byte \param0
.endm
.macro settelekinesis ptr:req
.byte 0xf9
.4byte \ptr
.endm
.macro swapstatstages stat:req
.byte 0xfa
.byte \stat
.endm
.macro averagestats stat:req
.byte 0xfb
.byte \stat
.endm
.macro jumpifoppositegenders ptr:req
.byte 0xfc
.4byte \ptr
.endm
.macro trygetbaddreamstarget ptr:req
.byte 0xfd
.4byte \ptr
.endm
.macro tryworryseed ptr:req
.byte 0xfe
.4byte \ptr
.endm
.macro metalburstdamagecalculator ptr:req
.byte 0xff
.4byte \ptr
.endm
@ various command changed to more readable macros
.macro cancelmultiturnmoves battler:req
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
@ -1355,13 +1407,363 @@
various \battler, VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC
.endm
.macro stattextbuffer battler:req
various \battler, VARIOUS_STAT_TEXT_BUFFER
.endm
.macro switchinabilities battler:req
various \battler, VARIOUS_SWITCHIN_ABILITIES
.endm
.macro savetarget
various BS_TARGET, VARIOUS_SAVE_TARGET
.endm
.macro restoretarget
various BS_TARGET, VARIOUS_RESTORE_TARGET
.endm
.macro instanthpdrop battler:req
various \battler, VARIOUS_INSTANT_HP_DROP
.endm
.macro clearstatus battler:req
various \battler, VARIOUS_CLEAR_STATUS
.endm
.macro restorepp battler:req
various \battler, VARIOUS_RESTORE_PP
.endm
.macro tryactivatemoxie battler:req
various \battler, VARIOUS_TRY_ACTIVATE_MOXIE
.endm
.macro tryactivatebeastboost battler:req
various \battler, VARIOUS_TRY_ACTIVATE_BEAST_BOOST
.endm
.macro tryactivatereceiver battler:req
various \battler, VARIOUS_TRY_ACTIVATE_RECEIVER
.endm
.macro tryactivatesoulheart
various BS_ATTACKER, VARIOUS_TRY_ACTIVATE_SOULHEART
.endm
.macro tryactivatefellstinger battler:req
various \battler, VARIOUS_TRY_ACTIVATE_FELL_STINGER
.endm
.macro playmoveanimation battler:req, move:req
various \battler, VARIOUS_PLAY_MOVE_ANIMATION
.2byte \move
.endm
.macro setluckychant battler:req, ptr:req
various \battler VARIOUS_SET_LUCKY_CHANT
.4byte \ptr
.endm
.macro suckerpunchcheck ptr:req
various BS_ATTACKER, VARIOUS_SUCKER_PUNCH_CHECK
.4byte \ptr
.endm
.macro setabilitysimple battler:req, ptr:req
various \battler VARIOUS_SET_SIMPLE_BEAM
.4byte \ptr
.endm
.macro tryentrainment ptr:req
various BS_ATTACKER, VARIOUS_TRY_ENTRAINMENT
.4byte \ptr
.endm
.macro setlastusedability battler:req
various \battler, VARIOUS_SET_LAST_USED_ABILITY
.endm
.macro tryhealpulse battler:req, ptr:req
various \battler, VARIOUS_TRY_HEAL_PULSE
.4byte \ptr
.endm
.macro tryquash ptr:req
various BS_ATTACKER, VARIOUS_TRY_QUASH
.4byte \ptr
.endm
.macro tryafteryou ptr:req
various BS_ATTACKER, VARIOUS_AFTER_YOU
.4byte \ptr
.endm
.macro trybestow ptr:req
various BS_ATTACKER, VARIOUS_BESTOW
.4byte \ptr
.endm
.macro invertstatstages battler:req
various \battler, VARIOUS_INVERT_STAT_STAGES
.endm
.macro setterrain ptr:req
various BS_ATTACKER, VARIOUS_SET_TERRAIN
.4byte \ptr
.endm
.macro trymefirst ptr:req
various BS_ATTACKER, VARIOUS_TRY_ME_FIRST
.4byte \ptr
.endm
.macro jumpifbattleend ptr:req
various BS_ATTACKER, VARIOUS_JUMP_IF_BATTLE_END
.4byte \ptr
.endm
.macro tryelectrify ptr:req
various BS_ATTACKER, VARIOUS_TRY_ELECTRIFY
.4byte \ptr
.endm
.macro tryreflecttype ptr:req
various BS_ATTACKER, VARIOUS_TRY_REFLECT_TYPE
.4byte \ptr
.endm
.macro trysoak ptr:req
various BS_ATTACKER, VARIOUS_TRY_SOAK
.4byte \ptr
.endm
.macro handlemegaevo battler:req, case:req
various \battler, VARIOUS_HANDLE_MEGA_EVO
.byte \case
.endm
.macro handleformchange battler:req, case:req
various \battler, VARIOUS_HANDLE_FORM_CHANGE
.byte \case
.endm
.macro jumpifcantuselastresort battler:req, ptr:req
various \battler, VARIOUS_TRY_LAST_RESORT
.4byte \ptr
.endm
.macro argumentstatuseffect
various BS_ATTACKER, VARIOUS_ARGUMENT_STATUS_EFFECT
.endm
.macro tryhitswitchtarget ptr:req
various BS_ATTACKER, VARIOUS_TRY_HIT_SWITCH_TARGET
.4byte \ptr
.endm
.macro tryautotomize battler:req, ptr:req
various \battler, VARIOUS_TRY_AUTOTOMIZE
.4byte \ptr
.endm
.macro jumpifcantusesynchronoise ptr:req
various BS_ATTACKER, VARIOUS_TRY_SYNCHRONOISE
.4byte \ptr
.endm
.macro trycopycat ptr:req
various BS_ATTACKER, VARIOUS_TRY_COPYCAT
.4byte \ptr
.endm
.macro showabilitypopup battler:req
various \battler, VARIOUS_ABILITY_POPUP
.endm
.macro defogclear battler:req, clear:req, ptr:req
various \battler, VARIOUS_DEFOG
.byte \clear
.4byte \ptr
.endm
.macro jumpiftargetally ptr:req
various BS_ATTACKER, VARIOUS_JUMP_IF_TARGET_ALLY
.4byte \ptr
.endm
.macro trypsychoshift ptr:req
various BS_ATTACKER, VARIOUS_PSYCHO_SHIFT
.4byte \ptr
.endm
.macro curestatus battler:req
various \battler, VARIOUS_CURE_STATUS
.endm
.macro powertrick battler:req
various \battler, VARIOUS_POWER_TRICK
.endm
.macro argumenttomoveeffect
various BS_ATTACKER, VARIOUS_ARGUMENT_TO_MOVE_EFFECT
.endm
.macro jumpifnotgrounded battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_NOT_GROUNDED
.4byte \ptr
.endm
.macro handletrainerslidemsg battler:req, field:req
various \battler, VARIOUS_HANDLE_TRAINER_SLIDE_MSG
.byte \field
.endm
.macro trytrainerslidefirstdownmsg battler:req
various \battler, VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF
.endm
.macro trytrainerslidelastonmsg battler:req
various \battler, VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON
.endm
.macro setauroraveil battler:req
various \battler, VARIOUS_SET_AURORA_VEIL
.endm
.macro trysetthirdtype battler:req, ptr:req
various \battler, VARIOUS_TRY_THIRD_TYPE
.4byte \ptr
.endm
.macro tryaccupressure battler:req, ptr:req
various \battler, VARIOUS_ACUPRESSURE
.4byte \ptr
.endm
.macro setpowder battler:req
various \battler, VARIOUS_SET_POWDER
.endm
.macro spectralthiefprintstats
various BS_ATTACKER, VARIOUS_SPECTRAL_THIEF
.endm
.macro bringdownairbornebattler battler:req
various \battler, VARIOUS_GRAVITY_ON_AIRBORNE_MONS
.endm
.macro checkgrassyterrainheal battler:req, ptr:req
various \battler, VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS
.4byte \ptr
.endm
.macro jumpifnotberry battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_NOT_BERRY
.4byte \ptr
.endm
.macro jumpifroarfails ptr:req
various BS_ATTACKER, VARIOUS_JUMP_IF_ROAR_FAILS
.4byte \ptr
.endm
.macro tryinstruct ptr:req
various BS_ATTACKER, VARIOUS_TRY_INSTRUCT
.4byte \ptr
.endm
.macro settracedability battler:req
various \battler, VARIOUS_TRACE_ABILITY
.endm
.macro updatenick battler:req
various \battler, VARIOUS_UPDATE_NICK
.endm
.macro tryillusionoff battler:req
various \battler, VARIOUS_TRY_ILLUSION_OFF
.endm
.macro spriteignore0hp val:req
various BS_ATTACKER, VARIOUS_SET_SPRITEIGNORE0HP
.byte \val
.endm
.macro getstatvalue battler:req, statId:req
various \battler, VARIOUS_GET_STAT_VALUE
.byte \statId
.endm
.macro jumpiffullhp battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_FULL_HP
.4byte \ptr
.endm
.macro losetype battler:req, type:req
various \battler, VARIOUS_LOSE_TYPE
.byte \type
.endm
.macro tryfriskmsg battler:req
various \battler, VARIOUS_TRY_FRISK
.endm
.macro jumpifshieldsdown battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED
.4byte \ptr
.endm
.macro trypoisontype attacker:req, target:req, ptr:req
various \attacker, VARIOUS_POISON_TYPE_IMMUNITY
.byte \target
.4byte \ptr
.endm
.macro tryparalyzetype attacker:req, target:req, ptr:req
various \attacker, VARIOUS_PARALYZE_TYPE_IMMUNITY
.byte \target
.4byte \ptr
.endm
.macro trysetfairylock ptr:req
various BS_ATTACKER, VARIOUS_TRY_FAIRY_LOCK
.4byte \ptr
.endm
.macro jumpifnoally battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_NO_ALLY
.4byte \ptr
.endm
.macro jumpifnoholdeffect battler:req, holdEffet:req, ptr:req
various \battler, VARIOUS_JUMP_IF_NO_HOLD_EFFECT
.byte \holdEffet
.4byte \ptr
.endm
.macro infatuatewithbattler battler1:req, battler2:req
various \battler1, VARIOUS_INFATUATE_WITH_BATTLER
.byte \battler2
.endm
.macro setlastuseditem battler:req
various \battler, VARIOUS_SET_LAST_USED_ITEM
.endm
.macro jumpifabsent battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_ABSENT
.4byte \ptr
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7
.endm
.macro setmoveeffect effect:req
setbyte cEFFECT_CHOOSER \effect
sethword sMOVE_EFFECT \effect
sethword sSAVED_MOVE_EFFECT \effect
.endm
.macro chosenstatus1animation battler:req, status:req
@ -1411,8 +1813,12 @@
.macro jumpifnotmove move:req, jumpptr:req
jumpifhalfword CMP_NOT_EQUAL, gCurrentMove, \move, \jumpptr
.endm
.macro jumpifstatus3 battler:req, status:req, jumpptr:req
.macro jumpifnotchosenmove move:req, jumpptr:req
jumpifhalfword CMP_NOT_EQUAL, gChosenMove, \move, \jumpptr
.endm
.macro jumpifstatus3 battler, status:req, jumpptr:req
jumpifstatus3condition \battler, \status, 0x0, \jumpptr
.endm
@ -1431,3 +1837,47 @@
.macro jumpifnotbattletype flags:req, jumpptr:req
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
.endm
.macro dmg_1_8_targethp
manipulatedamage DMG_1_8_TARGET_HP
.endm
.macro dmgtomaxattackerhp
manipulatedamage DMG_FULL_ATTACKER_HP
.endm
.macro dmgtocurrattackerhp
manipulatedamage DMG_CURR_ATTACKER_HP
.endm
.macro dmg_1_2_attackerhp
manipulatedamage DMG_1_2_ATTACKER_HP
.endm
.macro jumpifflowerveil jumpptr:req
jumpifnottype BS_TARGET, TYPE_GRASS, 1f
jumpifability BS_TARGET_SIDE, ABILITY_FLOWER_VEIL, \jumpptr
1:
.endm
.macro setallytonexttarget jumpptr:req
jumpifbyte CMP_GREATER_THAN, gBattlerTarget, 0x1, 1f
addbyte gBattlerTarget, 0x2
goto \jumpptr
1:
subbyte gBattlerTarget, 0x2
goto \jumpptr
.endm
.macro jumpifleafguard jumpptr:req
jumpifhalfword CMP_NO_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, 1f
jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr
1:
.endm
.macro jumpifsafeguard jumpptr:req
jumpifability BS_ATTACKER, ABILITY_INFILTRATOR, 1f
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, \jumpptr
1:
.endm

View File

@ -400,6 +400,15 @@ B_TRAINER2_WIN_TEXT = FD 31
B_PARTNER_CLASS = FD 32
B_PARTNER_NAME = FD 33
B_BUFF3 = FD 34
B_ATK_TRAINER_NAME = FD 35
B_ATK_TRAINER_CLASS = FD 36
B_ATK_TEAM1 = FD 37
B_ATK_TEAM2 = FD 38
B_DEF_NAME = FD 39
B_DEF_TEAM1 = FD 3A
B_DEF_TEAM2 = FD 3B
B_ACTIVE_NAME = FD 3C
B_ACTIVE_NAME2 = FD 3D @ no Illusion check
@ indicates the end of a town/city name (before " TOWN" or " CITY")
NAME_END = FC 00

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@
#include "constants/battle_script_commands.h"
#include "constants/battle_anim.h"
#include "constants/battle_string_ids.h"
#include "constants/battle_config.h"
#include "constants/items.h"
#include "constants/songs.h"
#include "constants/game_stat.h"
@ -62,10 +63,16 @@ BattleScript_SafariBallThrow::
handleballthrow
BattleScript_SuccessBallThrow::
setbyte sMON_CAUGHT, TRUE
jumpifhalfword CMP_EQUAL, gLastUsedItem, ITEM_SAFARI_BALL, BattleScript_PrintCaughtMonInfo
incrementgamestat GAME_STAT_POKEMON_CAPTURES
BattleScript_PrintCaughtMonInfo::
printstring STRINGID_GOTCHAPKMNCAUGHT
jumpifbyte CMP_NOT_EQUAL, sEXP_CATCH, TRUE, BattleScript_TryPrintCaughtMonInfo
setbyte sGIVEEXP_STATE, 0x0
getexp BS_TARGET
sethword gBattle_BG2_X, 0x0
BattleScript_TryPrintCaughtMonInfo:
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
printstring STRINGID_PKMNDATAADDEDTODEX
waitstate
@ -121,6 +128,7 @@ BattleScript_OpponentUsesHealItem::
playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM
waitmessage 0x40
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
useitemonopponent
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
@ -205,3 +213,17 @@ BattleScript_ActionWallyThrow:
printstring STRINGID_YOUTHROWABALLNOWRIGHT
waitmessage 0x40
end2
BattleScript_TrainerSlideMsgRet::
handletrainerslidemsg BS_SCRIPTING, 0
trainerslidein 1
handletrainerslidemsg BS_SCRIPTING, 1
waitstate
trainerslideout 1
handletrainerslidemsg BS_SCRIPTING, 2
waitstate
return
BattleScript_TrainerSlideMsgEnd2::
call BattleScript_TrainerSlideMsgRet
end2

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
131 131 131
123 123 123
115 115 115
106 106 106
98 98 98
82 82 82
65 65 65
49 49 49
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 214 0
255 197 0
255 173 0
255 165 0
148 90 222
255 107 0
255 132 0
255 148 0
255 156 41
0 0 0
0 90 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 214 0
255 197 0
255 173 0
255 165 0
148 90 222
255 107 0
255 132 0
255 148 0
255 156 41
0 0 0
0 90 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
172 222 230
164 213 230
148 205 222
131 205 222
123 197 213
115 189 205
98 180 197
90 180 197
82 172 189
74 164 180
65 156 180
57 131 156
49 115 131
41 82 106
24 74 82

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
246 205 82
238 205 74
238 205 57
246 222 123
238 205 57
238 197 49
230 189 24
246 213 82
255 222 131
255 213 115
255 213 106
255 213 90
246 213 82
255 230 156
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
255 0 0
131 230 255
106 213 255
98 205 255
57 156 180
8 115 123
180 189 172
156 180 164
115 164 131
74 131 106
49 106 65
0 106 74
0 90 49
0 82 24
0 65 0
0 32 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 8 8
255 255 255
222 246 246
189 230 230
156 213 213
131 205 205
115 189 189
90 172 172
65 156 156
49 139 139
32 123 123
16 98 98
0 74 74
0 49 49
0 32 32
0 16 16

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 255
246 189 49
246 172 41
238 156 32
222 131 24
205 115 8
197 65 0
180 57 0
172 90 65
156 74 49
148 65 24
139 74 49
123 65 32
98 49 32
82 32 16
74 24 8

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
131 131 131
123 123 123
115 115 115
106 106 106
98 98 98
82 82 82
65 65 65
49 49 49
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 164 255
255 106 139
255 131 222
255 139 230
255 164 238
255 189 255
255 205 255
246 230 255
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
238 24 32
255 246 205
246 246 222
246 238 189
238 238 213
238 238 205
238 230 197
230 230 180
230 222 164
230 222 172
222 213 139
213 205 123
213 205 115
205 197 106
197 189 106
57 49 65

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 255 0
255 156 0
255 98 0
255 49 0
246 57 16
238 65 16
180 65 24
123 49 24
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
104 168 168
88 144 160
72 112 160
64 64 120
56 80 152
64 80 144
72 64 104
72 56 96
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 98 74
255 90 65
255 82 57
255 139 123
255 74 49
255 65 41
255 57 32
255 106 90
255 148 139
255 131 123
255 123 115
255 115 106
255 106 98
255 164 164
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
180 172 148
159 156 129
137 140 110
115 123 90
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
41 49 49
106 139 189
246 131 180
255 0 255
255 16 98
238 98 164
230 65 131
222 0 57
222 24 90
205 41 74
205 32 82
189 0 49
172 16 65
156 0 41
148 16 49
131 8 32

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 255 255
255 0 255
255 16 98
246 131 180
238 98 164
230 65 131
222 0 57
222 24 90
205 32 82
205 41 74
189 0 49
172 16 65
156 0 41
148 16 49
131 8 32

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
238 24 32
230 255 238
172 255 205
222 255 230
205 255 222
180 255 205
172 255 197
213 255 230
197 255 213
164 255 197
189 255 213
213 255 222
156 246 189
148 246 180
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
205 98 255
197 90 255
197 82 255
213 148 255
197 72 255
197 64 255
189 56 255
205 106 255
222 156 255
205 139 255
205 131 255
205 123 255
205 115 255
230 180 255
0 0 0

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
197 255 255
139 222 246
115 213 255
106 205 255
98 197 255
90 180 246
74 164 238
65 156 238
49 148 230
41 139 230
41 115 213
32 131 222
32 98 205
32 90 197
41 74 180

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 255 255
197 230 255
139 205 246
82 172 238
57 131 205
32 82 164
16 41 123
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 255 255
222 246 255
189 230 255
148 213 246
123 205 255
90 180 238
65 164 230
41 139 222
24 123 213
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 164 255
255 255 255
246 197 222
230 148 180
205 98 139
156 82 106
90 57 74
41 32 41
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
197 0 65
160 0 0
80 0 0
0 0 0
189 139 0
80 0 112
120 0 168
255 32 106
0 164 90
65 0 213
49 0 123
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 255
255 255 230
255 255 172
255 255 139
255 255 106
255 238 82
255 230 65
255 197 32
255 172 16
255 148 8
238 115 0
222 82 0
197 49 0
156 24 0
98 8 0
57 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 255 255
238 246 230
205 238 180
213 238 189
197 230 180
197 230 172
172 222 148
189 222 164
164 213 139
156 205 131
131 197 106
139 197 115
123 189 98
98 180 65
65 172 32

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
164 156 24
156 148 24
197 189 32
172 164 32
115 106 16
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 255 0
255 74 74
238 24 24
222 65 65
164 41 41
164 16 16
106 32 32
106 8 8
65 16 16
32 24 222
98 65 222
24 16 131
0 0 65
32 8 8
8 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
238 24 32
115 115 139
90 90 106
74 74 98
65 65 82
57 57 74
49 49 57
41 41 49
32 32 41
24 24 32
16 16 24
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
238 24 32
255 246 246
255 238 238
255 230 230
255 222 230
255 222 222
255 213 222
255 205 213
255 205 205
255 197 205
255 197 197
255 189 189
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
255 0 0
0 41 98
0 41 90
0 32 82
0 32 74
0 24 74
0 24 65
0 24 57
0 16 57
0 16 49
0 8 41
0 8 32
0 0 24
0 0 16
0 0 8
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
98 49 74
90 32 65
82 32 65
82 32 57
74 24 57
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
180 106 255
180 82 246
148 65 205
115 24 205
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
19 0 82
38 0 98
58 0 114
78 0 131
97 0 147
117 0 164
137 0 180
156 0 196
176 0 213
196 0 229
216 0 246
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
238 24 32
246 222 255
238 213 255
238 205 246
230 197 246
230 180 246
222 172 246
222 164 246
222 156 246
213 148 246
205 139 238
197 115 238
189 98 238
189 90 230
180 74 230
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 246 0
255 238 0
255 222 0
255 205 0
255 189 0
255 172 0
255 156 8
255 139 8
255 123 8
255 106 8
255 90 8
255 74 8
255 49 8
255 41 8
246 24 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
222 164 255
238 139 255
213 139 255
189 139 255
213 115 255
197 90 255
189 115 246
172 148 238
180 90 230
172 90 213
156 131 213
148 82 205
123 139 197
131 90 180
115 123 172

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
246 230 180
255 222 139
255 230 123
255 222 106
255 213 98
255 197 57
255 180 32
255 172 8
255 156 8
230 131 8
222 123 8
205 106 8
205 90 8
197 74 8
189 57 8

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More