Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into 16-letter-move-names

This commit is contained in:
Greenphx9 2022-07-29 18:49:25 +10:00
commit 05cbd6a906
262 changed files with 16620 additions and 4083 deletions

View File

@ -418,21 +418,16 @@ If you aren't in the pokeemerald directory already, then **change directory** to
```bash
cd pokeemerald
```
To build **pokeemerald.gba** for the first time and confirm it matches the official ROM image (Note: to speed up builds, see [Parallel builds](#parallel-builds)):
To build **pokeemerald.gba** (Note: to speed up builds, see [Parallel builds](#parallel-builds)):
```bash
make compare
make
```
If an OK is returned, then the installation went smoothly.
If it has built successfully you will have the output file **pokeemerald.gba** in your project folder.
<details>
<summary>Note for Windows...</summary>
> If you switched terminals since the last build (e.g. from msys2 to WSL1), you must run `make clean-tools` once before any subsequent `make` commands.
</details>
To build **pokeemerald.gba** with your changes:
```bash
make
```
# Building guidance
## Parallel builds
@ -451,6 +446,22 @@ Replace `<output of nproc>` with the number that the `nproc` command returned.
`nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)).
## Compare ROM to the original
For contributing, or if you'd simply like to verify that your ROM is identical to the original game, run:
```bash
make compare
```
If it matches, you will see the following at the end of the output:
```bash
pokeemerald.gba: OK
```
If there are any changes from the original game, you will instead see:
```bash
pokeemerald.gba: FAILED
shasum: WARNING: 1 computed checksum did NOT match
```
## devkitARM's C compiler
This project supports the `arm-none-eabi-gcc` compiler included with devkitARM. If devkitARM (a.k.a. gba-dev) has already been installed as part of the platform-specific instructions, simply run:

View File

@ -288,43 +288,57 @@
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
.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
.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
.byte 0xC
.hword \setblends_value
.endm
.macro launchsoundtask launchsoundtaskPtr launchsoundtaskArgsNo launchsoundtaskarg0 launchsoundtaskarg1 launchsoundtaskarg2 launchsoundtaskarg3 launchsoundtaskarg4 launchsoundtaskarg5 launchsoundtaskarg6 launchsoundtaskarg7 launchsoundtaskarg8
.byte 0x1F
.word \launchsoundtaskPtr
.byte \launchsoundtaskArgsNo
.hword \launchsoundtaskarg0
.hword \launchsoundtaskarg1
.hword \launchsoundtaskarg2
.hword \launchsoundtaskarg3
.hword \launchsoundtaskarg4
.hword \launchsoundtaskarg5
.hword \launchsoundtaskarg6
.hword \launchsoundtaskarg7
.hword \launchsoundtaskarg8
.endm

View File

@ -1785,6 +1785,10 @@
various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH
.endm
.macro setzeffect
various BS_ATTACKER, VARIOUS_SET_Z_EFFECT
.endm
.macro consumeberry battler:req, restoreItem=FALSE
various \battler, VARIOUS_CONSUME_BERRY
.byte \restoreItem
@ -1924,8 +1928,8 @@
.4byte \ptr
.endm
.macro photongeysercheck
various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK
.macro photongeysercheck battler:req
various \battler, VARIOUS_PHOTON_GEYSER_CHECK
.endm
.macro shellsidearmcheck

File diff suppressed because it is too large Load Diff

View File

@ -411,6 +411,8 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST
.4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE
.4byte BattleScript_EffectSteelBeam @ EFFECT_STEEL_BEAM
.4byte BattleScript_EffectExtremeEvoboost @ EFFECT_EXTREME_EVOBOOST
.4byte BattleScript_EffectTerrainHit @ EFFECT_DAMAGE_SET_TERRAIN
BattleScript_EffectSteelBeam::
attackcanceler
@ -720,7 +722,7 @@ BattleScript_EffectPhotonGeyser:
critcalc
damagecalc
adjustdamage
photongeysercheck
photongeysercheck BS_ATTACKER
attackanimation
waitanimation
effectivenesssound
@ -2152,9 +2154,7 @@ BattleScript_GrowthDoMoveAnim::
waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0
.if B_GROWTH_UNDER_SUN >= GEN_5
jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthAtk2
.endif
setstatchanger STAT_ATK, 1, FALSE
goto BattleScript_GrowthAtk
BattleScript_GrowthAtk2:
@ -2165,9 +2165,7 @@ BattleScript_GrowthAtk:
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_GrowthTrySpAtk::
.if B_GROWTH_UNDER_SUN >= GEN_5
jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthSpAtk2
.endif
setstatchanger STAT_SPATK, 1, FALSE
goto BattleScript_GrowthSpAtk
BattleScript_GrowthSpAtk2:
@ -5542,6 +5540,7 @@ BattleScript_EffectCharge::
setcharge
attackanimation
waitanimation
.if B_CHARGE_SPDEF_RAISE >= GEN_5
setstatchanger STAT_SPDEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_EffectChargeString
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectChargeString
@ -5550,6 +5549,7 @@ BattleScript_EffectCharge::
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_EffectChargeString:
.endif
printstring STRINGID_PKMNCHARGINGPOWER
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
@ -9514,6 +9514,124 @@ BattleScript_JabocaRowapBerryActivate_Dmg:
removeitem BS_TARGET
return
@ z moves / effects
BattleScript_ZMoveActivateDamaging::
printstring STRINGID_ZPOWERSURROUNDS
playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL
printstring STRINGID_ZMOVEUNLEASHED
waitmessage 0x40
return
BattleScript_ZMoveActivateStatus::
savetarget
printstring STRINGID_ZPOWERSURROUNDS
playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL
setzeffect
restoretarget
copybyte sSTATCHANGER, sSAVED_STAT_CHANGER
return
BattleScript_ZEffectPrintString::
printfromtable gZEffectStringIds
waitmessage 0x40
return
BattleScript_RecoverHPZMove::
healthbarupdate BS_SCRIPTING
datahpupdate BS_SCRIPTING
printfromtable gZEffectStringIds
waitmessage 0x40
return
BattleScript_StatUpZMove::
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpZMoveEnd
setgraphicalstatchangevalues
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printstring STRINGID_ZMOVESTATUP
waitmessage 0x40
printfromtable gStatUpStringIds
waitmessage 0x40
BattleScript_StatUpZMoveEnd:
return
BattleScript_HealReplacementZMove::
playanimation BS_SCRIPTING B_ANIM_WISH_HEAL 0x0
printfromtable gZEffectStringIds
waitmessage 0x40
healthbarupdate BS_SCRIPTING
datahpupdate BS_SCRIPTING
return
BattleScript_EffectExtremeEvoboost::
attackcanceler
attackstring
ppreduce
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_DEF, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPEED, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim
goto BattleScript_ButItFailed
BattleScript_ExtremeEvoboostAnim:
attackanimation
waitanimation
BattleScript_ExtremeEvoboostAtk::
setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0x0
setstatchanger STAT_ATK, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostDef
printfromtable gStatUpStringIds
waitmessage 0x40
BattleScript_ExtremeEvoboostDef::
setstatchanger STAT_DEF, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpeed
printfromtable gStatUpStringIds
waitmessage 0x40
BattleScript_ExtremeEvoboostSpeed::
setstatchanger STAT_SPEED, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpAtk
printfromtable gStatUpStringIds
waitmessage 0x40
BattleScript_ExtremeEvoboostSpAtk::
setstatchanger STAT_SPATK, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpDef
printfromtable gStatUpStringIds
waitmessage 0x40
BattleScript_ExtremeEvoboostSpDef::
setstatchanger STAT_SPDEF, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostEnd
printfromtable gStatUpStringIds
waitmessage 0x40
BattleScript_ExtremeEvoboostEnd::
goto BattleScript_MoveEnd
BattleScript_EffectTerrainHit:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
setterrain BattleScript_TryFaint
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG
printfromtable gTerrainStringIds
BattleScript_TryFaint:
tryfaintmon BS_TARGET
goto BattleScript_MoveEnd
BattleScript_Pickpocket::
call BattleScript_AbilityPopUp
jumpifability BS_ATTACKER, ABILITY_STICKY_HOLD, BattleScript_PickpocketPrevented

View File

@ -5,6 +5,10 @@
.set LOCALID_PLAYER, 13
.set LOCALID_OPPONENT, 15
.set NO_DRAW, 0
.set DRAW_TRAINER, 1
.set DRAW_TUCKER, 2
BattleFrontier_BattleDomeBattleRoom_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleDomeBattleRoom_OnTransition
map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleDomeBattleRoom_OnFrame
@ -12,10 +16,6 @@ BattleFrontier_BattleDomeBattleRoom_MapScripts::
map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleDomeBattleRoom_OnResume
.byte 0
.set NO_DRAW, 0
.set DRAW_TRAINER, 1
.set DRAW_TUCKER, 2
BattleFrontier_BattleDomeBattleRoom_OnTransition:
dome_setopponentgfx
frontier_get FRONTIER_DATA_BATTLE_NUM

View File

@ -364,7 +364,8 @@ BattleFrontier_BattlePikeLobby_Text_AwardYouTheseBattlePoints2:
@ Unused
BattleFrontier_BattlePikeLobby_Text_ReachedBattlePointLimit:
.string "You appear to have reached the limit\n"
.string "for Battle Points…\pPlease exchange some Battle Points\n"
.string "for Battle Points…\p"
.string "Please exchange some Battle Points\n"
.string "for prizes, then return…$"
BattleFrontier_BattlePikeLobby_Text_FailedToSaveBeforeQuitting:

View File

@ -22,18 +22,20 @@ BattleFrontier_Lounge2_EventScript_AlreadyMetManiac::
end
BattleFrontier_Lounge2_EventScript_GiveAdvice::
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 0, BattleFrontier_Lounge2_EventScript_BufferSingle
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 1, BattleFrontier_Lounge2_EventScript_BufferDouble
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 2, BattleFrontier_Lounge2_EventScript_BufferMulti
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BufferMultiLink
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_BufferBattleDome
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 5, BattleFrontier_Lounge2_EventScript_BufferBattleFactory
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 6, BattleFrontier_Lounge2_EventScript_BufferBattlePalace
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 7, BattleFrontier_Lounge2_EventScript_BufferBattleArena
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 8, BattleFrontier_Lounge2_EventScript_BufferBattlePike
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 9, BattleFrontier_Lounge2_EventScript_BufferBattlePyramid
call_if_le VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BattleTowerNews
call_if_ge VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_FacilityNews
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_SINGLES, BattleFrontier_Lounge2_EventScript_BufferSingle
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_DOUBLES, BattleFrontier_Lounge2_EventScript_BufferDouble
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_MULTIS, BattleFrontier_Lounge2_EventScript_BufferMulti
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_LINK, BattleFrontier_Lounge2_EventScript_BufferMultiLink
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_DOME, BattleFrontier_Lounge2_EventScript_BufferBattleDome
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_FACTORY, BattleFrontier_Lounge2_EventScript_BufferBattleFactory
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PALACE, BattleFrontier_Lounge2_EventScript_BufferBattlePalace
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_ARENA, BattleFrontier_Lounge2_EventScript_BufferBattleArena
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PIKE, BattleFrontier_Lounge2_EventScript_BufferBattlePike
call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PYRAMID, BattleFrontier_Lounge2_EventScript_BufferBattlePyramid
@ <= FRONTIER_MANIAC_TOWER_LINK is any Battle Tower mode
call_if_le VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_LINK, BattleFrontier_Lounge2_EventScript_BattleTowerNews
@ >= FRONTIER_MANIAC_DOME is any facility other than Battle Tower
call_if_ge VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_DOME, BattleFrontier_Lounge2_EventScript_FacilityNews
special ShowFrontierManiacMessage
waitmessage
waitbuttonpress

View File

@ -12,7 +12,7 @@ MysteryGiftScript_AlteringCave_:
release
end
sText_MysteryGiftAlteringCave::
sText_MysteryGiftAlteringCave:
.string "Thank you for using the MYSTERY\n"
.string "GIFT System.\p"
.string "There appears to be a rumor about\n"

View File

@ -4,145 +4,192 @@ gText_HighlyAppealingMove::
.string "A highly appealing move.$"
gText_UserMoreEasilyStartled::
.string "After this move, the user is\nmore easily startled.$"
.string "After this move, the user is\n"
.string "more easily startled.$"
gText_GreatAppealButNoMoreToEnd::
.string "Makes a great appeal, but\nallows no more to the end.$"
.string "Makes a great appeal, but\n"
.string "allows no more to the end.$"
gText_UsedRepeatedlyWithoutBoringJudge::
.string "Can be repeatedly used\nwithout boring the JUDGE.$"
.string "Can be repeatedly used\n"
.string "without boring the JUDGE.$"
gText_AvoidStartledByOthersOnce::
.string "Can avoid being startled\nby others once.$"
.string "Can avoid being startled\n"
.string "by others once.$"
gText_AvoidStartledByOthers::
.string "Can avoid being startled\nby others.$"
.string "Can avoid being startled\n"
.string "by others.$"
gText_AvoidStartledByOthersLittle::
.string "Can avoid being startled\nby others a little.$"
.string "Can avoid being startled\n"
.string "by others a little.$"
gText_UserLessLikelyStartled::
.string "After this move, the user is\nless likely to be startled.$"
.string "After this move, the user is\n"
.string "less likely to be startled.$"
gText_SlightlyStartleFrontMon::
.string "Slightly startles the\nPOKéMON in front.$"
.string "Slightly startles the\n"
.string "POKéMON in front.$"
gText_SlightlyStartleAppealed::
.string "Slightly startles those\nthat have made appeals.$"
.string "Slightly startles those\n"
.string "that have made appeals.$"
gText_StartleAppealedBeforeUser::
.string "Startles the POKéMON that\nappealed before the user.$"
.string "Startles the POKéMON that\n"
.string "appealed before the user.$"
gText_StartleAllAppealed::
.string "Startles all POKéMON that\nhave done their appeals.$"
.string "Startles all POKéMON that\n"
.string "have done their appeals.$"
gText_BadlyStartleFrontMon::
.string "Badly startles the\nPOKéMON in front.$"
.string "Badly startles the\n"
.string "POKéMON in front.$"
gText_BadlyStartleAppealed::
.string "Badly startles those that\nhave made appeals.$"
.string "Badly startles those that\n"
.string "have made appeals.$"
gText_StartleAppealedBeforeUser2::
.string "Startles the POKéMON that\nappealed before the user.$"
.string "Startles the POKéMON that\n"
.string "appealed before the user.$"
gText_StartleAllAppealed2::
.string "Startles all POKéMON that\nhave done their appeals.$"
.string "Startles all POKéMON that\n"
.string "have done their appeals.$"
gText_ShiftJudgesAttentionFromOthers::
.string "Shifts the JUDGE's\nattention from others.$"
.string "Shifts the JUDGE's\n"
.string "attention from others.$"
gText_StartleMonHasJudgesAttention::
.string "Startles the POKéMON that\nhas the JUDGE's attention.$"
.string "Startles the POKéMON that\n"
.string "has the JUDGE's attention.$"
gText_JamOthersMissesTurn::
.string "Jams the others, and misses\none turn of appeals.$"
.string "Jams the others, and misses\n"
.string "one turn of appeals.$"
gText_StartleMonsMadeSameTypeAppeal::
.string "Startles POKéMON that\nmade a same-type appeal.$"
.string "Startles POKéMON that\n"
.string "made a same-type appeal.$"
gText_BadlyStartleCoolAppeals::
.string "Badly startles POKéMON\nthat made COOL appeals.$"
.string "Badly startles POKéMON\n"
.string "that made COOL appeals.$"
gText_BadlyStartleBeautyAppeals::
.string "Badly startles POKéMON\nthat made BEAUTY appeals.$"
.string "Badly startles POKéMON\n"
.string "that made BEAUTY appeals.$"
gText_BadlyStartleCuteAppeals::
.string "Badly startles POKéMON\nthat made CUTE appeals.$"
.string "Badly startles POKéMON\n"
.string "that made CUTE appeals.$"
gText_BadlyStartleSmartAppeals::
.string "Badly startles POKéMON\nthat made SMART appeals.$"
.string "Badly startles POKéMON\n"
.string "that made SMART appeals.$"
gText_BadlyStartleToughAppeals::
.string "Badly startles POKéMON\nthat made TOUGH appeals.$"
.string "Badly startles POKéMON\n"
.string "that made TOUGH appeals.$"
gText_MakeMonAfterUserNervous::
.string "Makes one POKéMON after\nthe user nervous.$"
.string "Makes one POKéMON after\n"
.string "the user nervous.$"
gText_MakeAllMonsAfterUserNervous::
.string "Makes all POKéMON after\nthe user nervous.$"
.string "Makes all POKéMON after\n"
.string "the user nervous.$"
gText_WorsenConditionOfThoseMadeAppeals::
.string "Worsens the condition of\nthose that made appeals.$"
.string "Worsens the condition of\n"
.string "those that made appeals.$"
gText_BadlyStartleMonsGoodCondition::
.string "Badly startles POKéMON in\ngood condition.$"
.string "Badly startles POKéMON in\n"
.string "good condition.$"
gText_AppealGreatIfPerformedFirst::
.string "The appeal works great if\nperformed first.$"
.string "The appeal works great if\n"
.string "performed first.$"
gText_AppealGreatIfPerformedLast::
.string "The appeal works great if\nperformed last.$"
.string "The appeal works great if\n"
.string "performed last.$"
gText_AppealAsGoodAsThoseBeforeIt::
.string "Makes the appeal as good\nas those before it.$"
.string "Makes the appeal as good\n"
.string "as those before it.$"
gText_AppealAsGoodAsOneBeforeIt::
.string "Makes the appeal as good\nas the one before it.$"
.string "Makes the appeal as good\n"
.string "as the one before it.$"
gText_AppealBetterLaterItsPerformed::
.string "The appeal works better\nthe later it is performed.$"
.string "The appeal works better\n"
.string "the later it is performed.$"
gText_AppealVariesDependingOnTiming::
.string "The appeal's quality varies\ndepending on its timing.$"
.string "The appeal's quality varies\n"
.string "depending on its timing.$"
gText_WorksWellIfSameTypeAsBefore::
.string "Works well if it's the same\ntype as the one before.$"
.string "Works well if it's the same\n"
.string "type as the one before.$"
gText_WorksWellIfDifferentTypeAsBefore::
.string "Works well if different in\ntype than the one before.$"
.string "Works well if different in\n"
.string "type than the one before.$"
gText_AffectedByAppealInFront::
.string "Affected by how well the\nappeal in front goes.$"
.string "Affected by how well the\n"
.string "appeal in front goes.$"
gText_UpsConditionHelpsPreventNervousness::
.string "Ups the user's condition.\nHelps prevent nervousness.$"
.string "Ups the user's condition.\n"
.string "Helps prevent nervousness.$"
gText_AppealWorksWellIfConditionGood::
.string "The appeal works well if the\nuser's condition is good.$"
.string "The appeal works well if the\n"
.string "user's condition is good.$"
gText_NextAppealMadeEarlier::
.string "The next appeal can be\nmade earlier next turn.$"
.string "The next appeal can be\n"
.string "made earlier next turn.$"
gText_NextAppealMadeLater::
.string "The next appeal can be\nmade later next turn.$"
.string "The next appeal can be\n"
.string "made later next turn.$"
gText_TurnOrderMoreEasilyScrambled::
.string "Makes the next turn's order\nmore easily scrambled.$"
.string "Makes the next turn's order\n"
.string "more easily scrambled.$"
gText_ScrambleOrderOfNextAppeals::
.string "Scrambles the order of\nappeals on the next turn.$"
.string "Scrambles the order of\n"
.string "appeals on the next turn.$"
gText_AppealExcitesAudienceInAnyContest::
.string "An appeal that excites the\naudience in any CONTEST.$"
.string "An appeal that excites the\n"
.string "audience in any CONTEST.$"
gText_BadlyStartlesMonsGoodAppeals::
.string "Badly startles all POKéMON\nthat made good appeals.$"
.string "Badly startles all POKéMON\n"
.string "that made good appeals.$"
gText_AppealBestMoreCrowdExcited::
.string "The appeal works best the\nmore the crowd is excited.$"
.string "The appeal works best the\n"
.string "more the crowd is excited.$"
gText_TemporarilyStopCrowdExcited::
.string "Temporarily stops the\ncrowd from growing excited.$"
.string "Temporarily stops the\n"
.string "crowd from growing excited.$"
@ Unused move names

View File

@ -5,7 +5,8 @@ gText_PkmnTransferredSomeonesPC::
.string "BOX “{STR_VAR_1}.”$"
gText_PkmnTransferredLanettesPC::
.string "{STR_VAR_2} was transferred to\nLANETTE'S PC.\p"
.string "{STR_VAR_2} was transferred to\n"
.string "LANETTE'S PC.\p"
.string "It was placed in \n"
.string "BOX “{STR_VAR_1}.”$"

View File

@ -3,7 +3,7 @@ gBirchDexRatingText_AreYouCurious::
.string "Are you curious about how your\n"
.string "POKéDEX is coming along?$"
gBirchDexRatingText_Cancel:
gBirchDexRatingText_Cancel::
.string "Hm? Oh, you haven't caught enough\n"
.string "POKéMON to make it worthwhile.$"

View File

@ -1,5 +1,6 @@
gText_WantToUseSurf::
.string "The water is dyed a deep blue…\nWould you like to SURF?$"
.string "The water is dyed a deep blue…\n"
.string "Would you like to SURF?$"
gText_PlayerUsedSurf::
.string "{STR_VAR_1} used SURF!$"

View File

@ -166,7 +166,7 @@ BattleFrontier_BattleTowerLobby_Text_LookingForwardToNextBattle::
.string "I'll be looking forward to your\n"
.string "next battle!$"
gTVBravoTrainerBattleTowerText00::
BravoTrainerBattleTower_Text_Intro::
.string "Yeah!\n"
.string "It's BRAVO TRAINER time!\p"
.string "Today, we're going to profile {STR_VAR_1},\n"
@ -174,12 +174,12 @@ gTVBravoTrainerBattleTowerText00::
.string "For the challenge, {STR_VAR_1} entered\n"
.string "one wicked {STR_VAR_2}.$"
gTVBravoTrainerBattleTowerText01::
BravoTrainerBattleTower_Text_NewRecord::
.string "The pair set a new record of {STR_VAR_2} wins\n"
.string "in a row in {STR_VAR_1} competition!\l"
.string "Bravo, TRAINER!$"
gTVBravoTrainerBattleTowerText02::
BravoTrainerBattleTower_Text_Lost::
.string "The twosome finally succumbed to\n"
.string "{STR_VAR_1} in match number {STR_VAR_2}.\l"
.string "Nice try, TRAINER!\p"
@ -188,7 +188,7 @@ gTVBravoTrainerBattleTowerText02::
.string "We asked the TRAINER for impressions\n"
.string "on the match with {STR_VAR_1}.$"
gTVBravoTrainerBattleTowerText03::
BravoTrainerBattleTower_Text_Won::
.string "The twosome won it all by defeating\n"
.string "{STR_VAR_1}'s {STR_VAR_2} thoroughly.\l"
.string "Bravo, TRAINER!\p"
@ -197,7 +197,7 @@ gTVBravoTrainerBattleTowerText03::
.string "We asked the TRAINER for impressions\n"
.string "on the moment of glory.$"
gTVBravoTrainerBattleTowerText04::
BravoTrainerBattleTower_Text_LostFinal::
.string "After a string of wins, the pair finally\n"
.string "succumbed to {STR_VAR_1}'s {STR_VAR_2},\l"
.string "their final hurdle.\p"
@ -208,7 +208,7 @@ gTVBravoTrainerBattleTowerText04::
.string "We asked the TRAINER for impressions\n"
.string "on battling the celebrity pair.$"
gTVBravoTrainerBattleTowerText05::
BravoTrainerBattleTower_Text_Satisfied::
.string "This is what the TRAINER had to say:\n"
.string "“I'm satisfied!”\p"
.string "Now isn't that a refreshing reply?\n"
@ -218,7 +218,7 @@ gTVBravoTrainerBattleTowerText05::
.string "I found out exactly how satisfied\n"
.string "when I heard the TRAINER say this:$"
gTVBravoTrainerBattleTowerText06::
BravoTrainerBattleTower_Text_Unsatisfied::
.string "This is what the TRAINER had to say:\n"
.string "“I'm not satisfied…”\p"
.string "Our TRAINER was obviously a little down\n"
@ -228,22 +228,22 @@ gTVBravoTrainerBattleTowerText06::
.string "Anyway, I found out how dissatisfied\n"
.string "our TRAINER was when I heard this:$"
gTVBravoTrainerBattleTowerText07::
BravoTrainerBattleTower_Text_None1::
.string "None$"
gTVBravoTrainerBattleTowerText08::
BravoTrainerBattleTower_Text_None2::
.string "None$"
gTVBravoTrainerBattleTowerText09::
BravoTrainerBattleTower_Text_None3::
.string "None$"
gTVBravoTrainerBattleTowerText10::
BravoTrainerBattleTower_Text_None4::
.string "None$"
gTVBravoTrainerBattleTowerText11::
BravoTrainerBattleTower_Text_Response::
.string "“{STR_VAR_1}.”$"
gTVBravoTrainerBattleTowerText12::
BravoTrainerBattleTower_Text_ResponseSatisfied::
.string "“{STR_VAR_1}.”\n"
.string "Now isn't that great?\p"
.string "It really expresses {STR_VAR_2}'s joy,\n"
@ -252,7 +252,7 @@ gTVBravoTrainerBattleTowerText12::
.string "end… It really was what you'd call\l"
.string "“{STR_VAR_1}”!$"
gTVBravoTrainerBattleTowerText13::
BravoTrainerBattleTower_Text_ResponseUnsatisfied::
.string "“{STR_VAR_1}.”\n"
.string "Now isn't that fitting?\p"
.string "That battle with {STR_VAR_3} at the\n"
@ -261,7 +261,7 @@ gTVBravoTrainerBattleTowerText13::
.string "{STR_VAR_2}'s disappointment comes across\n"
.string "loud and clear, I'd say!$"
gTVBravoTrainerBattleTowerText14::
BravoTrainerBattleTower_Text_Outro::
.string "Bravo, {STR_VAR_1}!\n"
.string "Bravo, {STR_VAR_2}!\p"
.string "I hope we can count on seeing\n"

View File

@ -1,51 +0,0 @@
# Bugs and Glitches
These are known bugs and glitches in the original Pokémon Emerald game: code that clearly does not work as intended, or that only works in limited circumstances but has the possibility to fail or crash. Defining the `BUGFIX` and `UBFIX` preprocessor variables will fix some of these automatically. `UBFIX` will already be defined for MODERN builds.
Fixes are written in the `diff` format. If you've used Git before, this should look familiar:
```diff
this is some code
-delete red - lines
+add green + lines
```
## Contents
- [Scrolling through items in the bag causes the image to flicker](#scrolling-through-items-in-the-bag-causes-the-image-to-flicker)
## Scrolling through items in the bag causes the image to flicker
**Fix:** Add the following function to [src/item_menu_icons.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu_icons.c):
```diff
+void HideBagItemIconSprite(u8 id)
+{
+ u8 *spriteId = &gBagMenu->spriteId[10];
+ if (spriteId[id] != 0xFF)
+ {
+ gSprites[spriteId[id]].invisible = TRUE;
+ }
+}
```
and its corresponding declaration in [include/item_menu_icons.h](https://github.com/pret/pokeemerald/blob/master/include/item_menu_icons.h):
```diff
+void HideBagItemIconSprite(u8 id);
```
Then edit `BagMenu_MoveCursorCallback` in [src/item_menu.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu.c):
```diff
...
{
- RemoveBagItemIconSprite(1 ^ gBagMenu->itemIconSlot);
+ HideBagItemIconSprite(gBagMenu->itemIconSlot ^ 1);
+ RemoveBagItemIconSprite(gBagMenu->itemIconSlot);
if (itemIndex != LIST_CANCEL)
...
```

View File

@ -76,7 +76,7 @@ s32 ChangeBgY(u8 bg, s32 value, u8 op);
s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op);
s32 GetBgY(u8 bg);
void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle);
u8 Unused_AdjustBgMosaic(u8 a1, u8 a2);
u8 Unused_AdjustBgMosaic(u8 val, u8 mode);
void SetBgTilemapBuffer(u8 bg, void *tilemap);
void UnsetBgTilemapBuffer(u8 bg);
void* GetBgTilemapBuffer(u8 bg);

View File

@ -94,7 +94,7 @@ static void ApplyAffineAnimFrame(u8 matrixNum, struct AffineAnimFrameCmd *frameC
static u8 IndexOfSpriteTileTag(u16 tag);
static void AllocSpriteTileRange(u16 tag, u16 start, u16 count);
static void DoLoadSpritePalette(const u16 *src, u16 paletteOffset);
static void UpdateSpriteMatrixAnchorPos(struct Sprite* sprite, s32 a1, s32 a2);
static void UpdateSpriteMatrixAnchorPos(struct Sprite*, s32, s32);
typedef void (*AnimFunc)(struct Sprite *);
typedef void (*AnimCmdFunc)(struct Sprite *);
@ -632,14 +632,11 @@ void DestroySprite(struct Sprite *sprite)
}
}
void ResetOamRange(u8 a, u8 b)
void ResetOamRange(u8 start, u8 end)
{
u8 i;
for (i = a; i < b; i++)
{
for (i = start; i < end; i++)
gMain.oamBuffer[i] = *(struct OamData *)&gDummyOamData;
}
}
void LoadOam(void)

View File

@ -270,7 +270,7 @@ u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 sub
u8 CreateInvisibleSprite(void (*callback)(struct Sprite *));
u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
void DestroySprite(struct Sprite *sprite);
void ResetOamRange(u8 a, u8 b);
void ResetOamRange(u8 start, u8 end);
void LoadOam(void);
void SetOamMatrix(u8 matrixNum, u16 a, u16 b, u16 c, u16 d);
void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode);

View File

@ -326,14 +326,14 @@ void RunTextPrinters(void)
{
if (sTextPrinters[i].active)
{
u16 temp = RenderFont(&sTextPrinters[i]);
switch (temp)
u16 renderCmd = RenderFont(&sTextPrinters[i]);
switch (renderCmd)
{
case RENDER_PRINT:
CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX);
case RENDER_UPDATE:
if (sTextPrinters[i].callback != 0)
sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, temp);
if (sTextPrinters[i].callback != NULL)
sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, renderCmd);
break;
case RENDER_FINISH:
sTextPrinters[i].active = FALSE;

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 B

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 B

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

After

Width:  |  Height:  |  Size: 231 B

View File

Before

Width:  |  Height:  |  Size: 394 B

After

Width:  |  Height:  |  Size: 394 B

View File

@ -467,6 +467,25 @@ struct Illusion
struct Pokemon *mon;
};
struct ZMoveData
{
u8 viable:1; // current move can become a z move
u8 viewing:1; // if player is viewing the z move name instead of regular moves
u8 active:1; // is z move being used this turn
u8 zStatusActive:1;
u8 healReplacement:1;
u8 activeSplit:2; // active z move split
u8 zUnused:1;
u8 triggerSpriteId;
u8 possibleZMoves[MAX_BATTLERS_COUNT];
u16 chosenZMove; // z move of move cursor is on
u8 effect;
u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles
u16 toBeUsed[MAX_BATTLERS_COUNT]; // z moves per battler to be used
u16 baseMoves[MAX_BATTLERS_COUNT];
u8 splits[MAX_BATTLERS_COUNT];
};
struct StolenItem
{
u16 originalItem:15;
@ -571,6 +590,7 @@ struct BattleStruct
u8 abilityPopUpSpriteIds[MAX_BATTLERS_COUNT][2]; // two per battler
bool8 throwingPokeBall;
struct MegaEvolutionData mega;
struct ZMoveData zmove;
const u8 *trainerSlideMsg;
bool8 trainerSlideLowHpMsgDone;
u8 introState;
@ -595,6 +615,7 @@ struct BattleStruct
u8 quickClawBattlerId;
struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member)
u8 blunderPolicy:1; // should blunder policy activate
u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
u8 ballSpriteIds[2]; // item gfx, window gfx
u8 stickyWebUser;
u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change
@ -811,7 +832,7 @@ extern u16 gBattle_WIN1V;
extern u8 gDisplayedStringBattle[400];
extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT];
extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT];
extern u8 gBattleTextBuff3[30]; //to handle stupidly large z move names
extern u32 gBattleTypeFlags;
extern u8 gBattleTerrain;
extern u32 gUnusedFirstBattleVar1;
@ -918,7 +939,6 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT];
extern bool8 gHasFetchedBall;
extern u8 gLastUsedBall;
extern u16 gLastThrownBall;
extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
extern u8 gPartyCriticalHits[PARTY_SIZE];
#endif // GUARD_BATTLE_H

View File

@ -62,6 +62,7 @@ s8 GetAbilityRating(u16 ability);
bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability);
bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u16 move);
u32 AI_GetBattlerMoveTargetType(u8 battlerId, u16 move);
bool32 ShouldUseZMove(u8 activeId, u8 targetId, u16 chosenMove);
// stat stage checks
bool32 AnyStatIsRaised(u8 battlerId);
@ -82,7 +83,7 @@ bool32 ShouldLowerEvasion(u8 battlerAtk, u8 battlerDef, u16 defAbility);
// move checks
bool32 IsAffectedByPowder(u8 battler, u16 ability, u16 holdEffect);
bool32 MovesWithSplitUnusable(u32 attacker, u32 target, u32 split);
s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *effectiveness);
s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *effectiveness, bool32 considerZPower);
u8 GetMoveDamageResult(u16 move);
u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef);
u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef);

View File

@ -64,7 +64,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
bool8 IsContest(void);
s8 BattleAnimAdjustPanning(s8 pan);
s8 BattleAnimAdjustPanning2(s8 pan);
s16 KeepPanInRange(s16 a, int oldPan);
s16 KeepPanInRange(s16 panArg, int oldPan);
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
void RelocateBattleBgPal(u16 paletteNum, u16 *dest, u32 offset, bool8 largeScreen);
void ResetBattleAnimBg(bool8);
@ -95,14 +95,14 @@ bool8 AnimTranslateLinear(struct Sprite *sprite);
void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite);
u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId);
void InitAnimLinearTranslationWithSpeed(struct Sprite *sprite);
u16 ArcTan2Neg(s16 a, s16 b);
void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation);
u16 ArcTan2Neg(s16 x, s16 y);
void TrySetSpriteRotScale(struct Sprite *sprite, bool8 recalcCenterVector, s16 xScale, s16 yScale, u16 rotation);
void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite);
void TranslateSpriteLinearAndFlicker(struct Sprite *sprite);
void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite);
void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite);
void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 a2);
s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 a2);
void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 xOffset);
s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr);
u8 GetBattlerYCoordWithElevation(u8 battlerId);
void WaitAnimForDuration(struct Sprite *sprite);
void AnimTravelDiagonally(struct Sprite *sprite);
@ -113,7 +113,7 @@ void *LoadPointerFromVars(s16 bottom, s16 top);
void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
void InitPrioritiesForVisibleBattlers(void);
void GetBattleAnimBg1Data(struct BattleAnimBgData*);
void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1);
void GetBattleAnimBgData(struct BattleAnimBgData*, u32 bgId);
u8 GetBattlerSpriteSubpriority(u8 battlerId);
bool8 TranslateAnimHorizontalArc(struct Sprite *sprite);
void TranslateSpriteLinearByIdFixedPoint(struct Sprite *sprite);
@ -122,7 +122,7 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation);
void InitSpriteDataForLinearTranslation(struct Sprite *sprite);
void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode);
void SetBattlerSpriteYOffsetFromRotation(u8 spriteId);
u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7);
u32 GetBattlePalettesMask(bool8 battleBackground, bool8 attacker, bool8 target, bool8 attackerPartner, bool8 targetPartner, bool8 anim1, bool8 anim2);
u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLeft, u8 opponentRight);
u8 AnimDummyReturnArg(u8 battler);
s16 CloneBattlerSpriteWithBlend(u8);
@ -133,7 +133,7 @@ void AnimLoadCompressedBgGfx(u32, const u32*, u32);
void UpdateAnimBg3ScreenSize(bool8);
void TranslateSpriteInGrowingCircle(struct Sprite *);
void SetBattlerSpriteYOffsetFromYScale(u8 spriteId);
void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
void PrepareEruptAnimTaskData(struct Task *task, u8 spriteId, s16 xScaleStart, s16 yScaleStart, s16 xScaleEnd, s16 yScaleEnd, u16 duration);
u8 UpdateEruptAnimTask(struct Task *task);
void DestroyAnimSpriteAndDisableBlend(struct Sprite *);
void AnimLoadCompressedBgTilemap(u32 bgId, const void *src);
@ -150,7 +150,7 @@ void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union Aff
bool8 RunAffineAnimFromTaskData(struct Task *task);
void AnimThrowProjectile(struct Sprite *sprite);
void GetBgDataForTransform(struct BattleAnimBgData *dest, u8 battlerId);
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm);
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm);
void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite);
void TradeMenuBouncePartySprites(struct Sprite *sprite);
void DestroyAnimVisualTaskAndDisableBlend(u8 taskId);
@ -185,7 +185,7 @@ enum
u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId);
bool8 IsBattlerSpritePresent(u8 battlerId);
void ClearBattleAnimBg(u32 arg0);
void ClearBattleAnimBg(u32 bgId);
u8 GetAnimBattlerSpriteId(u8 wantedBattler);
bool8 IsDoubleBattle(void);
u8 GetBattleBgPaletteNum(void);
@ -205,24 +205,26 @@ u8 GetSubstituteSpriteDefault_Y(u8 battlerId);
#define STAT_ANIM_MULTIPLE_MINUS1 57
#define STAT_ANIM_MULTIPLE_MINUS2 58
void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId);
extern const union AnimCmd *const sAnims_SpinningSparkle[];
// battle_anim_ground.c
void AnimTask_HorizontalShake(u8 taskId);
void AnimMudSportDirt(struct Sprite *sprite);
void AnimDirtScatter(struct Sprite *sprite);
void AnimMudSportDirtRising(struct Sprite *sprite);
void AnimDirtPlumeParticle(struct Sprite *);
extern const union AffineAnimCmd *const gAffineAnims_SpinningBone[];
// battle_anim_throw.c
void TryShinyAnimation(u8 battler, struct Pokemon *mon);
u8 ItemIdToBallId(u16 itemId);
u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId);
bool32 IsCriticalCapture(void);
// battle_anim_utility_funcs.c
void InitStatsChangeAnimation(u8);
void StartMonScrollingBgMask(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette);
void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette);
// battle_anim_effects_1.c
void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite);
@ -272,6 +274,7 @@ extern const union AnimCmd *const gScratchAnimTable[];
extern const union AnimCmd *const gIngrainRootAnimTable[];
extern const union AffineAnimCmd *const gSwiftStarAffineAnimTable[];
extern const union AnimCmd *const gMetronomeThroughtBubbleAnimTable[];
extern const union AffineAnimCmd *const gStockpileAbsorptionOrbAffineAnimTable[];
// battle_anim_effects_2.c
void AnimUproarRing(struct Sprite *sprite);
@ -280,6 +283,7 @@ void AnimOrbitFast(struct Sprite *sprite);
void AnimOrbitScatter(struct Sprite *sprite);
void AnimAngerMark(struct Sprite *sprite);
void AnimHyperVoiceRing(struct Sprite *sprite);
void AnimMagentaHeart(struct Sprite *);
extern const union AffineAnimCmd *const gThinRingShrinkingAffineAnimTable[];
extern const union AffineAnimCmd *const gThinRingExpandingAffineAnimTable[];
extern const union AnimCmd *const gExplosionAnimTable[];
@ -295,8 +299,13 @@ void AnimBlackSmoke(struct Sprite *sprite);
void AnimSweetScentPetal(struct Sprite *sprite);
void AnimTealAlert(struct Sprite *sprite);
void AnimBlockX(struct Sprite *sprite);
void AnimFlatterSpotlight_Step(struct Sprite *);
void AnimAssistPawprint(struct Sprite *);
void AnimReversalOrb(struct Sprite *);
void AnimFlatterSpotlight_Step(struct Sprite *sprite);
extern const union AnimCmd *const gOpeningEyeAnimTable[];
extern const union AnimCmd *const gEclipsingOrbAnimTable[];
extern const union AffineAnimCmd *const gSpotlightAffineAnimTable[];
// battle_anim_water.c
void AnimWaterPulseRing(struct Sprite *sprite);
@ -314,16 +323,21 @@ void AnimFlyBallUp(struct Sprite *sprite);
void AnimFlyBallAttack(struct Sprite *sprite);
void AnimFlyBallAttack_Step(struct Sprite *sprite);
void AnimFlyBallUp_Step(struct Sprite *sprite);
void AnimBounceBallLand(struct Sprite *);
void AnimEllipticalGust(struct Sprite *);
extern const union AnimCmd *const gAffineAnims_AirWaveCrescent[];
extern const union AffineAnimCmd *const gAffineAnims_FlyBallUp[];
extern const union AffineAnimCmd *const gAffineAnims_FlyBallAttack[];
extern const union AffineAnimCmd *const gAffineAnims_BounceBallLand[];
// battle_anim_poison.c
void AnimSludgeBombHitParticle(struct Sprite *);
void AnimAcidPoisonBubble_Step(struct Sprite *sprite);
void AnimBubbleEffect(struct Sprite *);
extern const union AffineAnimCmd *const gAffineAnims_PoisonProjectile[];
extern const union AnimCmd *const gAnims_PoisonProjectile[];
extern const union AnimCmd *const gAnims_AcidPoisonDroplet[];
extern const union AffineAnimCmd *const gAffineAnims_Bubble[];
// battle_anim_ghost.c
void AnimGhostStatusSprite(struct Sprite *sprite);
@ -337,9 +351,9 @@ extern const union AffineAnimCmd *const gAffineAnims_LusterPurgeCircle[];
void AnimPsychoBoost(struct Sprite *sprite);
// battle_anim_smokescreen.c
u8 SmokescreenImpact(s16 x, s16 y, u8 a3);
u8 SmokescreenImpact(s16 x, s16 y, bool8 persist);
u32 UnpackSelectedBattleBgPalettes(s16);
u32 UnpackSelectedBattlePalettes(s16);
u8 GetBattlerSpriteFinal_Y(u8, u16, u8);
@ -419,6 +433,7 @@ void AnimSparkElectricity(struct Sprite *sprite);
void AnimElectricPuff(struct Sprite *sprite);
void AnimSparkElectricityFlashing(struct Sprite *sprite);
void AnimGrowingShockWaveOrb(struct Sprite *sprite);
void AnimElectricity(struct Sprite *);
extern const union AffineAnimCmd *const gAffineAnims_GrowingElectricOrb[];
extern const union AffineAnimCmd *const gAffineAnims_FlashingSpark[];
extern const union AnimCmd *const gAnims_ThunderboltOrb[];
@ -434,6 +449,7 @@ void AnimBasicFistOrFoot(struct Sprite *sprite);
void AnimSpinningKickOrPunchFinish(struct Sprite *sprite);
void AnimRevengeScratch(struct Sprite *sprite);
void AnimDizzyPunchDuck(struct Sprite *sprite);
void AnimSuperpowerFireball(struct Sprite *);
extern const union AnimCmd *const gAnims_HandsAndFeet[];
extern const union AffineAnimCmd *const gAffineAnims_MegaPunchKick[];
extern const union AffineAnimCmd *const gAffineAnims_SpinningHandOrFoot[];
@ -443,6 +459,7 @@ extern const union AnimCmd *const gAnims_RevengeBigScratch[];
extern const union AnimCmd *const gAnims_FlyingRock[];
extern const union AffineAnimCmd *const gAffineAnims_Whirlpool[];
extern const union AffineAnimCmd *const gAffineAnims_BasicRock[];
extern const union AnimCmd *const gAnims_FlyingRock[];
void AnimParticleInVortex(struct Sprite *sprite);
void AnimFallingRock(struct Sprite *sprite);
void AnimRaiseSprite(struct Sprite *sprite);
@ -477,7 +494,13 @@ extern const union AnimCmd *const gAnims_BlizzardIceCrystal[];
// battle_anim_fire.c
void AnimFireSpread(struct Sprite *sprite);
void AnimFireSpiralOutward(struct Sprite *sprite);
void AnimWillOWispOrb(struct Sprite *);
void AnimEruptionFallingRock(struct Sprite *);
void AnimFireCross(struct Sprite *);
void AnimFirePlume(struct Sprite *);
extern const union AnimCmd *const gAnims_FireBlastCross[];
extern const union AnimCmd *const gAnims_WillOWispOrb[];
extern const union AnimCmd *const gAnims_FirePlume[];
// battle_anim_dragon.c
extern const union AnimCmd *const gAnims_DragonBreathFire[];

View File

@ -129,6 +129,7 @@ struct ChooseMoveStruct
u8 monType2;
u8 monType3;
struct MegaEvolutionData mega;
struct ZMoveData zmove;
};
enum
@ -227,7 +228,7 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId);
void BtlController_EmitChooseAction(u8 bufferId, u8 action, u16 itemId);
void BtlController_EmitYesNoBox(u8 bufferId);
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
void BtlController_EmitChooseItem(u8 bufferId, u8* arg1);
void BtlController_EmitChooseItem(u8 bufferId, u8* battlePartyOrder);
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u16 abilityId, u8* data);
void BtlController_EmitCmd23(u8 bufferId); // unused
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
@ -238,11 +239,11 @@ void BtlController_EmitStatusXor(u8 bufferId, u8 b); // unused
void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data);
void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data); // unused
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *c); // unused
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u32 arg2);
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c);
void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1);
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b);
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data); // unused
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u32 ret32);
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battlePartyOrder);
void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret);
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret);
void BtlController_EmitClearUnkVar(u8 bufferId); // unused
void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused
void BtlController_EmitClearUnkFlag(u8 bufferId); // unused
@ -259,7 +260,7 @@ void BtlController_EmitHidePartyStatusSummary(u8 bufferId);
void BtlController_EmitEndBounceEffect(u8 bufferId);
void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible);
void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument);
void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 record);
void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 mode, bool32 record);
void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome);
void BtlController_EmitDebugMenu(u8 bufferId);
@ -276,6 +277,8 @@ void Task_PlayerController_RestoreBgmAfterCry(u8 taskId);
void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused);
void ActionSelectionDestroyCursorAt(u8 cursorPos);
void InitMoveSelectionsVarsAndStrings(void);
void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1);
void MoveSelectionDestroyCursorAt(u8 cursorPosition);
// recorded player controller
void SetControllerToRecordedPlayer(void);

View File

@ -18,7 +18,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battlerId);
void BattleGfxSfxDummy3(u8 gender);
void FreeTrainerFrontPicPalette(u16 frontPicId);
bool8 BattleLoadAllHealthBoxesGfx(u8 state);
void LoadBattleBarGfx(u8 arg0);
void LoadBattleBarGfx(u8 unused);
bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId);
void ClearSpritesHealthboxAnimData(void);
void CopyAllBattleSpritesInvisibilities(void);

View File

@ -43,6 +43,7 @@ enum
#define TAG_MEGA_INDICATOR_TILE 0xD778
#define TAG_ALPHA_INDICATOR_TILE 0xD779
#define TAG_OMEGA_INDICATOR_TILE 0xD77A
#define TAG_ZMOVE_TRIGGER_TILE 0xD77B
#define TAG_HEALTHBOX_PAL 0xD6FF
#define TAG_HEALTHBAR_PAL 0xD704
@ -53,6 +54,7 @@ enum
#define TAG_MEGA_INDICATOR_PAL 0xD778
#define TAG_ALPHA_INDICATOR_PAL 0xD779
#define TAG_OMEGA_INDICATOR_PAL 0xD77A
#define TAG_ZMOVE_TRIGGER_PAL 0xD77B
enum
{
@ -89,14 +91,15 @@ void HideMegaTriggerSprite(void);
void DestroyMegaTriggerSprite(void);
u32 CreateMegaIndicatorSprite(u32 battlerId, u32 which);
void DestroyMegaIndicatorSprite(u32 healthboxSpriteId);
u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart);
u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, bool8 skipPlayer, bool8 isBattleStart);
void Task_HidePartyStatusSummary(u8 taskId);
void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId);
s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3);
s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 unused);
u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);
u8 GetHPBarLevel(s16 hp, s16 maxhp);
void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle);
void DestroyAbilityPopUp(u8 battlerId);
void HideTriggerSprites(void);
bool32 CanThrowLastUsedBall(void);
void TryHideLastUsedBall(void);
void TryRestoreLastUsedBall(void);

View File

@ -22,8 +22,6 @@ struct MultiPartnerMenuPokemon
/*0x1D*/ u8 language;
};
#define TYPE_NAME_LENGTH 6
#if B_EXPANDED_ABILITY_NAMES
#define ABILITY_NAME_LENGTH 16
#else

View File

@ -240,6 +240,7 @@ void BattlePutTextOnWindow(const u8* text, u8 windowId);
void SetPpNumbersPaletteInMoveSelection(void);
u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp);
bool32 ShouldDoTrainerSlide(u32 battlerId, u32 trainerId, u32 which);
void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst);
extern struct BattleMsgData *gBattleMsgDataPtr;

View File

@ -421,4 +421,13 @@ extern const u8 BattleScript_BeakBlastSetUp[];
extern const u8 BattleScript_BeakBlastBurn[];
extern const u8 BattleScript_DefDownSpeedUp[];
// zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[];
extern const u8 BattleScript_ZMoveActivateStatus[];
extern const u8 BattleScript_ZEffectPrintString[];
extern const u8 BattleScript_RecoverHPZMove[];
extern const u8 BattleScript_StatUpZMove[];
extern const u8 BattleScript_HealReplacementZMove[];
extern const u8 BattleScript_EffectExtremeEvoboost[];
#endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -32,7 +32,7 @@ void StartRegiBattle(void);
u8 BattleSetup_GetTerrainId(void);
u8 GetWildBattleTransition(void);
u8 GetTrainerBattleTransition(void);
u8 GetSpecialBattleTransition(s32 arg0);
u8 GetSpecialBattleTransition(s32 id);
void ChooseStarter(void);
void ResetTrainerOpponentIds(void);
void SetMapVarsToTrainer(void);

View File

@ -79,7 +79,7 @@ void PressurePPLoseOnUsingImprison(u8 attacker);
void MarkAllBattlersForControllerExec(void); // unused
bool32 IsBattlerMarkedForControllerExec(u8 battlerId);
void MarkBattlerForControllerExec(u8 battlerId);
void MarkBattlerReceivedLinkData(u8 arg0);
void MarkBattlerReceivedLinkData(u8 battlerId);
void CancelMultiTurnMoves(u8 battlerId);
bool8 WasUnableToUseMove(u8 battlerId);
void PrepareStringBattle(u16 stringId, u8 battlerId);
@ -153,6 +153,8 @@ bool32 CanFling(u8 battlerId);
bool32 IsTelekinesisBannedSpecies(u16 species);
bool32 IsHealBlockPreventingMove(u32 battler, u32 move);
bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId);
bool32 IsPartnerMonFromSameTrainer(u8 battlerId);
u8 GetSplitBasedOnStats(u8 battlerId);
void SortBattlersBySpeed(u8 *battlers, bool8 slowToFast);
bool32 TestSheerForceFlag(u8 battler, u16 move);
void TryRestoreStolenItems(void);

30
include/battle_z_move.h Normal file
View File

@ -0,0 +1,30 @@
#ifndef GUARD_BATTLE_Z_MOVE_H
#define GUARD_BATTLE_Z_MOVE_H
#include "constants/z_move_effects.h"
#define MOVE_Z_STATUS 0xFFFF
struct SignatureZMove
{
u16 species;
u16 item;
u16 move;
u16 zmove;
};
bool8 IsZMove(u16 move);
void QueueZMove(u8 battlerId, u16 baseMove);
bool32 IsViableZMove(u8 battlerId, u16 move);
bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex);
void CreateZMoveTriggerSprite(u8, bool8);
void HideZMoveTriggerSprite(void);
bool32 IsZMoveTriggerSpriteActive(void);
void DestroyZMoveTriggerSprite(void);
bool32 MoveSelectionDisplayZMove(u16 zmove);
const u8* GetZMoveName(u16 move);
void SetZEffect(void);
bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex);
void GetUsableZMoves(u8 battlerId, u16 *moves);
#endif // GUARD_BATTLE_Z_MOVE_H

View File

@ -421,7 +421,7 @@
#define B_WIN_TYPE_NORMAL 0
#define B_WIN_TYPE_ARENA 1
// Window Ids for gStandardBattleWindowTemplates / gBattleArenaWindowTemplates
// Window Ids for sStandardBattleWindowTemplates / sBattleArenaWindowTemplates
#define B_WIN_MSG 0
#define B_WIN_ACTION_PROMPT 1 // "What will {x} do?"
#define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu

View File

@ -535,6 +535,7 @@
#define B_ANIM_AQUA_RING_HEAL 32
#define B_ANIM_BEAK_BLAST_SETUP 33
#define B_ANIM_SHELL_TRAP_SETUP 34
#define B_ANIM_ZMOVE_ACTIVATE 35 // Using Z Moves
// special animations table (gBattleAnims_Special)
#define B_ANIM_LVL_UP 0
@ -601,9 +602,32 @@
#define ANIM_RIGHT_FIST 0
#define ANIM_LEFT_FIST 2
// fist/chop frames
#define ANIM_FIST_1 0
#define ANIM_FOOT_1 1
#define ANIM_FOOT_2 2
#define ANIM_CHOP 3
// surf wave palettes
#define ANIM_SURF_PAL_SURF 0
#define ANIM_SURF_PAL_MUDDY_WATER 1
#define ANIM_SURF_PAL_SLUDGE_WAVE 2
// Flags given to various functions to indicate which palettes to consider.
// Handled by UnpackSelectedBattlePalettes
#define F_PAL_BG (1 << 0)
#define F_PAL_ATTACKER (1 << 1)
#define F_PAL_TARGET (1 << 2)
#define F_PAL_ATK_PARTNER (1 << 3)
#define F_PAL_DEF_PARTNER (1 << 4)
#define F_PAL_ANIM_1 (1 << 5) // Palette set for GetBattleAnimBg1Data/GetBgDataForTransform. Only used (ineffectually?) by Aromatherapy.
#define F_PAL_ANIM_2 (1 << 6) // Palette set for GetBattleAnimBgData/GetBgDataForTransform. Unused.
#define F_PAL_ATK_SIDE (F_PAL_ATTACKER | F_PAL_ATK_PARTNER)
#define F_PAL_DEF_SIDE (F_PAL_TARGET | F_PAL_DEF_PARTNER)
#define F_PAL_BATTLERS (F_PAL_ATK_SIDE | F_PAL_DEF_SIDE)
// The below are only used by AnimTask_BlendBattleAnimPal to get battler sprite palettes by position rather than by role.
// It's redundant with F_PAL_BATTLERS, because they're only ever used together to refer to all the battlers at once.
#define F_PAL_BATTLERS_2 (1 << 7 | 1 << 8 | 1 << 9 | 1 << 10)
#endif // GUARD_CONSTANTS_BATTLE_ANIM_H

View File

@ -87,6 +87,41 @@
#define ITEM_RINDO_BERRY 207
#define ITEM_YACHE_BERRY 208
#define ITEM_GRISEOUS_ORB 369
// z crystals
#define ITEM_NORMALIUM_Z 568
#define ITEM_FIGHTINIUM_Z 569
#define ITEM_FLYINIUM_Z 570
#define ITEM_POISONIUM_Z 571
#define ITEM_GROUNDIUM_Z 572
#define ITEM_ROCKIUM_Z 573
#define ITEM_BUGINIUM_Z 574
#define ITEM_GHOSTIUM_Z 575
#define ITEM_STEELIUM_Z 576
#define ITEM_FIRIUM_Z 577
#define ITEM_WATERIUM_Z 578
#define ITEM_GRASSIUM_Z 579
#define ITEM_ELECTRIUM_Z 580
#define ITEM_PSYCHIUM_Z 581
#define ITEM_ICIUM_Z 582
#define ITEM_DRAGONIUM_Z 583
#define ITEM_DARKINIUM_Z 584
#define ITEM_FAIRIUM_Z 585
#define ITEM_ALORAICHIUM_Z 586
#define ITEM_DECIDIUM_Z 587
#define ITEM_EEVIUM_Z 588
#define ITEM_INCINIUM_Z 589
#define ITEM_KOMMONIUM_Z 590
#define ITEM_LUNALIUM_Z 591
#define ITEM_LYCANIUM_Z 592
#define ITEM_MARSHADIUM_Z 593
#define ITEM_MEWNIUM_Z 594
#define ITEM_MIMIKIUM_Z 595
#define ITEM_PIKANIUM_Z 596
#define ITEM_PIKASHUNIUM_Z 597
#define ITEM_PRIMARIUM_Z 598
#define ITEM_SNORLIUM_Z 599
#define ITEM_SOLGANIUM_Z 600
#define ITEM_TAPUNIUM_Z 601
#endif
#ifndef GEN_3
@ -125,6 +160,7 @@
#define B_ROUGH_SKIN_DMG GEN_7 // In Gen4+, Rough Skin contact damage is 1/8th of max HP instead of 1/16th. This will also affect Iron Barbs.
#define B_KNOCK_OFF_DMG GEN_8 // In Gen6+, Knock Off deals 50% more damage when knocking off an item.
#define B_SPORT_DMG_REDUCTION GEN_7 // In Gen5+, Water/Mud Sport reduce Fire/Electric Damage by 67% instead of 50%.
#define B_EXPLOSION_DEFENSE GEN_7 // In Gen5+, Self-Destruct and Explosion don't halve the targets' defense.
// Type settings
#define B_GHOSTS_ESCAPE GEN_7 // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle.
@ -144,18 +180,15 @@
#define B_SPORT_TURNS GEN_7 // In Gen6+, Water/Mud Sport last 5 turns, even if the user switches out.
#define B_MEGA_EVO_TURN_ORDER GEN_7 // In Gen7, a Pokémon's Speed after Mega Evolution is used to determine turn order, not its Speed before.
#define B_RECALC_TURN_AFTER_ACTIONS GEN_8 // In Gen8, switching/using a move affects the current turn's order of actions.
#define B_FAINT_SWITCH_IN GEN_7 // In Gen4+, sending out a new Pokémon after the previous one fainted happens at the end of the turn. Before, it would happen after each action.
// Move data settings
#define B_UPDATED_MOVE_DATA GEN_8 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc.
#define B_PHYSICAL_SPECIAL_SPLIT GEN_7 // In Gen3, the move's type determines if it will do physical or special damage. The split icon in the summary will reflect this.
#define B_FELL_STINGER_STAT_RAISE GEN_7 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint.
#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage.
#define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing.
#define B_KLUTZ_FLING_INTERACTION GEN_7 // In Gen5+, Pokémon with the Klutz ability can't use Fling.
#define B_UPDATED_CONVERSION GEN_7 // In Gen6+, Conversion changes the user's type to match their first move's. Before, it would choose a move at random.
#define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5.
#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1.
// Move accuracy settings
#define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss.
@ -163,6 +196,14 @@
#define B_BLIZZARD_HAIL GEN_7 // In Gen4+, Blizzard bypasses accuracy checks if it's hailing.
#define B_SHEER_COLD_ACC GEN_7 // In Gen7+, Sheer Cold's base chance of hitting is reduced to 20% if the user isn't Ice-typed.
// Move stat change settings
#define B_FELL_STINGER_STAT_RAISE GEN_7 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint.
#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage.
#define B_CHARGE_SPDEF_RAISE GEN_7 // In Gen5+, Charge raises the user's Special Defense by 1 stage.
#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1.
#define B_GROWTH_STAT_RAISE GEN_7 // In Gen5+, Growth raises Attack in addition to Special Attack by 1 stage each. Under the effects of the sun, it raises them by 2 stages each instead.
// Other move settings
#define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute.
#define B_INCINERATE_GEMS GEN_7 // In Gen6+, Incinerate can destroy Gems.
@ -177,7 +218,6 @@
#define B_HEAL_BLOCKING GEN_7 // In Gen5+, Heal Block prevents healing by Black Sludge, Leftovers, Shell Bell. Affected Pokémon will not consume held HP-restoring Berries or Berry Juice.
// Draining abilities will not heal but will prevent damage. In Gen6+, Heal Block prevents the use of most HP-draining moves.
#define B_ROOTED_GROUNDING GEN_7 // In Gen4+, Ingrain causes the affected Pokémon to become grounded.
#define B_GROWTH_UNDER_SUN GEN_7 // In Gen5+, Growth's effects are doubled when under the effects of the sun.
// Ability settings
#define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters.
@ -191,6 +231,8 @@
#define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned.
#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. It also activates Rattled.
#define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted.
#define B_STURDY GEN_7 // In Gen5+, Sturdy causes the Pokémon to have 1 HP remaining if another Pokémon's attack or confusion damage would have brought it from full health to 0 HP.
#define B_PLUS_MINUS_INTERACTION GEN_7 // In Gen5+, Plus and Minus can be activated with themselves and the opposite ability. Before, only the opposing ability could activate it.
// Item settings
#define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.

View File

@ -1,6 +1,8 @@
#ifndef GUARD_CONSTANTS_BATTLE_FRONTIER_H
#define GUARD_CONSTANTS_BATTLE_FRONTIER_H
#include "constants/pokemon.h"
#define FRONTIER_CHALLENGE(facility, mode) ((facility << 8) + mode)
// Battle Frontier facility ids.
@ -47,6 +49,14 @@
#define MAX_BATTLE_FRONTIER_POINTS 9999
#define MAX_STREAK 9999
#define FRONTIER_MAX_LEVEL_50 50
#define FRONTIER_MIN_LEVEL_OPEN 60
#define FRONTIER_MAX_LEVEL_OPEN MAX_LEVEL
// This is the default number of battles (or floors, in Battle Pyramid) per challenge.
// There are 2 facilities that differ: Battle Dome (DOME_ROUNDS_COUNT) and Battle Pike (NUM_PIKE_ROOMS).
#define FRONTIER_STAGES_PER_CHALLENGE 7
// These sets of facility ids would be redundant if the order was consistent
// The order is important for this set so that all the non-link records can be continuous
#define RANKING_HALL_TOWER_SINGLES 0

View File

@ -394,7 +394,9 @@
#define EFFECT_BEAK_BLAST 388
#define EFFECT_COURT_CHANGE 389
#define EFFECT_STEEL_BEAM 390
#define EFFECT_EXTREME_EVOBOOST 391
#define EFFECT_DAMAGE_SET_TERRAIN 392 // genesis supernova
#define NUM_BATTLE_MOVE_EFFECTS 391
#define NUM_BATTLE_MOVE_EFFECTS 393
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_CONSTANTS_BATTLE_PIKE_H
#define GUARD_CONSTANTS_BATTLE_PIKE_H
#define NUM_PIKE_ROOMS 14
#define PIKE_ROOM_SINGLE_BATTLE 0
#define PIKE_ROOM_HEAL_FULL 1
#define PIKE_ROOM_NPC 2

View File

@ -14,6 +14,13 @@
#define HINT_EXIT_FAR_REMAINING_TRAINERS 7
#define HINT_EXIT_FAR_REMAINING_ITEMS 8
#define MAX_PYRAMID_TRAINERS 8
// Each floor of the Battle Pyramid is 32x32 metatiles, subdivided into a 4x4 grid of 8x8 metatile squares
#define PYRAMID_FLOOR_SQUARES_WIDE 4
#define PYRAMID_FLOOR_SQUARES_HIGH 4
#define NUM_PYRAMID_FLOOR_SQUARES (PYRAMID_FLOOR_SQUARES_WIDE * PYRAMID_FLOOR_SQUARES_HIGH)
#define OBJ_TRAINERS 0
#define OBJ_ITEMS 1

View File

@ -241,6 +241,7 @@
#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 150
#define VARIOUS_SET_BEAK_BLAST 151
#define VARIOUS_SWAP_SIDE_STATUSES 152
#define VARIOUS_SET_Z_EFFECT 153
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -615,8 +615,17 @@
#define STRINGID_COURTCHANGE 613
#define STRINGID_PLAYERLOSTTOENEMYTRAINER 614
#define STRINGID_PLAYERPAIDPRIZEMONEY 615
#define STRINGID_ZPOWERSURROUNDS 616
#define STRINGID_ZMOVEUNLEASHED 617
#define STRINGID_ZMOVERESETSSTATS 618
#define STRINGID_ZMOVEALLSTATSUP 619
#define STRINGID_ZMOVEZBOOSTCRIT 620
#define STRINGID_ZMOVERESTOREHP 621
#define STRINGID_ZMOVESTATUP 622
#define STRINGID_ZMOVEHPTRAP 623
#define STRINGID_TERRAINREMOVED 624
#define BATTLESTRINGS_COUNT 616
#define BATTLESTRINGS_COUNT 625
// This is the string id that gBattleStringsTable starts with.
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
@ -884,6 +893,15 @@
#define B_MSG_WRAPPED_MAGMA_STORM 6
#define B_MSG_WRAPPED_INFESTATION 7
#define B_MSG_WRAPPED_SNAP_TRAP 8
#define TRAPPING_MOVES_COUNT 9
#define NUM_TRAPPING_MOVES 9
// z effects
#define B_MSG_Z_RESET_STATS 0
#define B_MSG_Z_ALL_STATS_UP 1
#define B_MSG_Z_BOOST_CRITS 2
#define B_MSG_Z_FOLLOW_ME 3
#define B_MSG_Z_RECOVER_HP 4
#define B_MSG_Z_STAT_UP 5
#define B_MSG_Z_HP_TRAP 6
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H

View File

@ -1,6 +1,12 @@
#ifndef GUARD_CONSTANTS_BATTLE_TENT_H
#define GUARD_CONSTANTS_BATTLE_TENT_H
#define TENT_MIN_LEVEL 30
// The number of battles in each Battle Tent challenge.
// Battle Tent equivalent of FRONTIER_STAGES_PER_CHALLENGE.
#define TENT_STAGES_PER_CHALLENGE 3
#define VERDANTURF_TENT_FUNC_INIT 0
#define VERDANTURF_TENT_FUNC_GET_PRIZE 1
#define VERDANTURF_TENT_FUNC_SET_PRIZE 2

View File

@ -241,6 +241,15 @@
#define OBJ_EVENT_GFX_LUGIA 237
#define OBJ_EVENT_GFX_HOOH 238
// NOTE: By default, the max value for NUM_OBJ_EVENT_GFX is 239.
//
// Object event graphics ids are 1 byte in size (max value of 255), and the dynamic
// graphics ids that start after NUM_OBJ_EVENT_GFX reach this limit. No graphics id
// uses the value 239 itself, so removing the "+ 1" in OBJ_EVENT_GFX_VARS would
// allow increasing NUM_OBJ_EVENT_GFX to 240. There are also a handful of unused
// object graphics that can be removed. If more graphics are needed, anything that
// stores graphics ids will need to be increased in size. See wiki entry below:
// https://github.com/pret/pokeemerald/wiki/Feature-Branches#overworld-expansion
#define NUM_OBJ_EVENT_GFX 239

View File

@ -1634,7 +1634,7 @@
#define FLAGS_COUNT (DAILY_FLAGS_END + 1)
// Special Flags (Stored in EWRAM (gSpecialFlags), not in the SaveBlock)
// Special Flags (Stored in EWRAM (sSpecialFlags), not in the SaveBlock)
#define SPECIAL_FLAGS_START 0x4000
#define FLAG_HIDE_MAP_NAME_POPUP (SPECIAL_FLAGS_START + 0x0)
#define FLAG_DONT_TRANSITION_MUSIC (SPECIAL_FLAGS_START + 0x1)

View File

@ -108,6 +108,7 @@
#define WONDER_NEWS_TEXT_LENGTH 40
#define WONDER_CARD_BODY_TEXT_LINES 4
#define WONDER_NEWS_BODY_TEXT_LINES 10
#define TYPE_NAME_LENGTH 6
#define MAX_STAMP_CARD_STAMPS 7

View File

@ -99,6 +99,7 @@
#define METATILE_PetalburgGym_SlidingDoor_Frame2 0x21A
#define METATILE_PetalburgGym_SlidingDoor_Frame3 0x21B
#define METATILE_PetalburgGym_SlidingDoor_Frame4 0x21C
#define METATILE_PetalburgGym_Door 0x224
// gTileset_MossdeepGym from R/S
#define METATILE_RS_MossdeepGym_RedArrow_Right 0x204
@ -128,7 +129,6 @@
// gTileset_BattleFrontier
#define METATILE_BattleFrontier_Door_Elevator 0x20E
#define METATILE_BattleFrontier_Door_Corridor 0x224
#define METATILE_BattleFrontier_Door_MultiCorridor 0x2AD
#define METATILE_BattleFrontier_CorridorOpenDoor_Top 0x207
#define METATILE_BattleFrontier_CorridorOpenDoor_Bottom 0x20F

View File

@ -784,6 +784,52 @@
#define MOVES_COUNT_GEN8 755
#define MOVES_COUNT MOVES_COUNT_GEN8
#define MOVES_COUNT MOVES_COUNT_GEN8
// Z Moves
#define MOVE_BREAKNECK_BLITZ (MOVES_COUNT + 0)
#define MOVE_ALL_OUT_PUMMELING (MOVES_COUNT + 1)
#define MOVE_SUPERSONIC_SKYSTRIKE (MOVES_COUNT + 2)
#define MOVE_ACID_DOWNPOUR (MOVES_COUNT + 3)
#define MOVE_TECTONIC_RAGE (MOVES_COUNT + 4)
#define MOVE_CONTINENTAL_CRUSH (MOVES_COUNT + 5)
#define MOVE_SAVAGE_SPIN_OUT (MOVES_COUNT + 6)
#define MOVE_NEVER_ENDING_NIGHTMARE (MOVES_COUNT + 7)
#define MOVE_CORKSCREW_CRASH (MOVES_COUNT + 8)
#define MOVE_INFERNO_OVERDRIVE (MOVES_COUNT + 9)
#define MOVE_HYDRO_VORTEX (MOVES_COUNT + 10)
#define MOVE_BLOOM_DOOM (MOVES_COUNT + 11)
#define MOVE_GIGAVOLT_HAVOC (MOVES_COUNT + 12)
#define MOVE_SHATTERED_PSYCHE (MOVES_COUNT + 13)
#define MOVE_SUBZERO_SLAMMER (MOVES_COUNT + 14)
#define MOVE_DEVASTATING_DRAKE (MOVES_COUNT + 15)
#define MOVE_BLACK_HOLE_ECLIPSE (MOVES_COUNT + 16)
#define MOVE_TWINKLE_TACKLE (MOVES_COUNT + 17)
// Signature Z Moves
#define MOVE_CATASTROPIKA (MOVES_COUNT + 18)
#define MOVE_10000000_VOLT_THUNDERBOLT (MOVES_COUNT + 19)
#define MOVE_STOKED_SPARKSURFER (MOVES_COUNT + 20)
#define MOVE_EXTREME_EVOBOOST (MOVES_COUNT + 21)
#define MOVE_PULVERIZING_PANCAKE (MOVES_COUNT + 22)
#define MOVE_GENESIS_SUPERNOVA (MOVES_COUNT + 23)
#define MOVE_SINISTER_ARROW_RAID (MOVES_COUNT + 24)
#define MOVE_MALICIOUS_MOONSAULT (MOVES_COUNT + 25)
#define MOVE_OCEANIC_OPERETTA (MOVES_COUNT + 26)
#define MOVE_SPLINTERED_STORMSHARDS (MOVES_COUNT + 27)
#define MOVE_LETS_SNUGGLE_FOREVER (MOVES_COUNT + 28)
#define MOVE_CLANGOROUS_SOULBLAZE (MOVES_COUNT + 29)
#define MOVE_GUARDIAN_OF_ALOLA (MOVES_COUNT + 30)
#define MOVE_SEARING_SUNRAZE_SMASH (MOVES_COUNT + 31)
#define MOVE_MENACING_MOONRAZE_MAELSTROM (MOVES_COUNT + 32)
#define MOVE_LIGHT_THAT_BURNS_THE_SKY (MOVES_COUNT + 33)
#define MOVE_SOUL_STEALING_7_STAR_STRIKE (MOVES_COUNT + 34)
#define FIRST_Z_MOVE MOVE_BREAKNECK_BLITZ
#define LAST_Z_MOVE MOVE_SOUL_STEALING_7_STAR_STRIKE
#define MOVES_COUNT_Z (LAST_Z_MOVE + 1)
// Used for checks for moves affected by Disable, Mimic, etc.
#define MOVE_UNAVAILABLE 0xFFFF
#endif // GUARD_CONSTANTS_MOVES_H

View File

@ -274,4 +274,21 @@
#define SMARTSHOPPER_NUM_ITEMS 3
// TV Show states for Bravo Trainer's Battle Tower interview
#define BRAVOTOWER_STATE_INTRO 0
#define BRAVOTOWER_STATE_NEW_RECORD 1
#define BRAVOTOWER_STATE_LOST 2
#define BRAVOTOWER_STATE_WON 3
#define BRAVOTOWER_STATE_LOST_FINAL 4
#define BRAVOTOWER_STATE_SATISFIED 5
#define BRAVOTOWER_STATE_UNSATISFIED 6
#define BRAVOTOWER_STATE_UNUSED_1 7
#define BRAVOTOWER_STATE_UNUSED_2 8
#define BRAVOTOWER_STATE_UNUSED_3 9
#define BRAVOTOWER_STATE_UNUSED_4 10
#define BRAVOTOWER_STATE_RESPONSE 11
#define BRAVOTOWER_STATE_RESPONSE_SATISFIED 12
#define BRAVOTOWER_STATE_RESPONSE_UNSATISFIED 13
#define BRAVOTOWER_STATE_OUTRO 14
#endif //GUARD_CONSTANTS_TV_H

View File

@ -11,6 +11,8 @@
#define UNION_ROOM_SPAWN_IN 1
#define UNION_ROOM_SPAWN_OUT 2
#define UNION_ROOM_MAX_LEVEL 30
#define ACTIVITY_NONE 0
#define ACTIVITY_BATTLE_SINGLE 1
#define ACTIVITY_BATTLE_DOUBLE 2

View File

@ -0,0 +1,38 @@
#ifndef GUARD_Z_MOVE_EFFECTS_H
#define GUARD_Z_MOVE_EFFECTS_H
#define Z_EFFECT_NONE 0
#define Z_EFFECT_RESET_STATS 1
#define Z_EFFECT_ALL_STATS_UP_1 2
#define Z_EFFECT_BOOST_CRITS 3
#define Z_EFFECT_FOLLOW_ME 4
#define Z_EFFECT_CURSE 5
#define Z_EFFECT_RECOVER_HP 6
#define Z_EFFECT_RESTORE_REPLACEMENT_HP 7
#define Z_EFFECT_ATK_UP_1 8
#define Z_EFFECT_DEF_UP_1 9
#define Z_EFFECT_SPD_UP_1 10
#define Z_EFFECT_SPATK_UP_1 11
#define Z_EFFECT_SPDEF_UP_1 12
#define Z_EFFECT_ACC_UP_1 13
#define Z_EFFECT_EVSN_UP_1 14
#define Z_EFFECT_ATK_UP_2 15
#define Z_EFFECT_DEF_UP_2 16
#define Z_EFFECT_SPD_UP_2 17
#define Z_EFFECT_SPATK_UP_2 18
#define Z_EFFECT_SPDEF_UP_2 19
#define Z_EFFECT_ACC_UP_2 20
#define Z_EFFECT_EVSN_UP_2 21
#define Z_EFFECT_ATK_UP_3 22
#define Z_EFFECT_DEF_UP_3 23
#define Z_EFFECT_SPD_UP_3 24
#define Z_EFFECT_SPATK_UP_3 25
#define Z_EFFECT_SPDEF_UP_3 26
#define Z_EFFECT_ACC_UP_3 27
#define Z_EFFECT_EVSN_UP_3 28
#endif // GUARD_Z_MOVE_EFFECTS_H

View File

@ -324,7 +324,6 @@ extern u16 gSpecialVar_ContestRank;
extern u8 gNumLinkContestPlayers;
extern u8 gHighestRibbonRank;
extern struct ContestResources *gContestResources;
extern u8 sContestBgCopyFlags;
extern struct ContestWinner gCurContestWinner;
extern u8 gCurContestWinnerIsForArtist;
extern u8 gCurContestWinnerSaveIdx;
@ -340,11 +339,11 @@ void SetLinkAIContestants(u8 contestType, u8 rank, bool32 isPostgame);
u8 GetContestEntryEligibility(struct Pokemon *pkmn);
void CalculateRound1Points(u8 contestCategory);
bool8 IsSpeciesNotUnown(u16 species);
bool8 Contest_IsMonsTurnDisabled(u8 a);
bool8 Contest_IsMonsTurnDisabled(u8 contestant);
void SaveLinkContestResults(void);
void SortContestants(bool8 a);
void SetContestantEffectStringID(u8 a, u8 b);
void SetContestantEffectStringID2(u8 a, u8 b);
void SortContestants(bool8 useRanking);
void SetContestantEffectStringID(u8 contestant, u8 effectStringId);
void SetContestantEffectStringID2(u8 contestant, u8 effectStringId);
void SetStartledString(u8 contestant, u8 jam);
void MakeContestantNervous(u8 p);
s8 Contest_GetMoveExcitement(u16 move);

View File

@ -126,5 +126,6 @@ extern const struct Trainer gTrainers[];
extern const u8 gTrainerClassNames[][13];
extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1];
extern const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1];
extern const u8 *const gZMoveNames[];
#endif // GUARD_DATA_H

View File

@ -13,7 +13,7 @@ void LoadCompressedSpriteSheetOverrideBuffer(const struct CompressedSpriteSheet
bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src);
void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src);
void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer);
void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer);
bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src);
void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species);

View File

@ -18,9 +18,9 @@ struct DigitObjUtilTemplate
bool32 DigitObjUtil_Init(u32 count);
void DigitObjUtil_Free(void);
bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemplate *template);
void DigitObjUtil_PrintNumOn(u32 id, s32 arg1);
void DigitObjUtil_PrintNumOn(u32 id, s32 num);
void DigitObjUtil_DeletePrinter(u32 id);
void DigitObjUtil_HideOrShow(u32 id, bool32 arg1);
void DigitObjUtil_HideOrShow(u32 id, bool32 hide);
u8 GetTilesPerImage(u32 shape, u32 size);
#endif // GUARD_DIGIT_OBJ_UTIL_H

View File

@ -21,21 +21,21 @@ extern const u8 gTVBravoTrainerText05[];
extern const u8 gTVBravoTrainerText06[];
extern const u8 gTVBravoTrainerText07[];
extern const u8 gTVBravoTrainerText08[];
extern const u8 gTVBravoTrainerBattleTowerText00[];
extern const u8 gTVBravoTrainerBattleTowerText01[];
extern const u8 gTVBravoTrainerBattleTowerText02[];
extern const u8 gTVBravoTrainerBattleTowerText03[];
extern const u8 gTVBravoTrainerBattleTowerText04[];
extern const u8 gTVBravoTrainerBattleTowerText05[];
extern const u8 gTVBravoTrainerBattleTowerText06[];
extern const u8 gTVBravoTrainerBattleTowerText07[];
extern const u8 gTVBravoTrainerBattleTowerText08[];
extern const u8 gTVBravoTrainerBattleTowerText09[];
extern const u8 gTVBravoTrainerBattleTowerText10[];
extern const u8 gTVBravoTrainerBattleTowerText11[];
extern const u8 gTVBravoTrainerBattleTowerText12[];
extern const u8 gTVBravoTrainerBattleTowerText13[];
extern const u8 gTVBravoTrainerBattleTowerText14[];
extern const u8 BravoTrainerBattleTower_Text_Intro[];
extern const u8 BravoTrainerBattleTower_Text_NewRecord[];
extern const u8 BravoTrainerBattleTower_Text_Lost[];
extern const u8 BravoTrainerBattleTower_Text_Won[];
extern const u8 BravoTrainerBattleTower_Text_LostFinal[];
extern const u8 BravoTrainerBattleTower_Text_Satisfied[];
extern const u8 BravoTrainerBattleTower_Text_Unsatisfied[];
extern const u8 BravoTrainerBattleTower_Text_None1[];
extern const u8 BravoTrainerBattleTower_Text_None2[];
extern const u8 BravoTrainerBattleTower_Text_None3[];
extern const u8 BravoTrainerBattleTower_Text_None4[];
extern const u8 BravoTrainerBattleTower_Text_Response[];
extern const u8 BravoTrainerBattleTower_Text_ResponseSatisfied[];
extern const u8 BravoTrainerBattleTower_Text_ResponseUnsatisfied[];
extern const u8 BravoTrainerBattleTower_Text_Outro[];
extern const u8 gTVFanClubOpinionsText00[];
extern const u8 gTVFanClubOpinionsText01[];
extern const u8 gTVFanClubOpinionsText02[];

View File

@ -3,7 +3,7 @@
void LoadEvoSparkleSpriteAndPal(void);
u8 EvolutionSparkles_SpiralUpward(u16 arg0);
u8 EvolutionSparkles_SpiralUpward(u16 palNum);
u8 EvolutionSparkles_ArcDown(void);
u8 EvolutionSparkles_CircleInward(void);
u8 EvolutionSparkles_SprayAndFlash(u16 species);

View File

@ -17,14 +17,14 @@ extern u16 gTotalCameraPixelOffsetY;
void DrawWholeMapView(void);
void CurrentMapDrawMetatileAt(int x, int y);
void GetCameraOffsetWithPan(s16 *a0, s16 *a1);
void GetCameraOffsetWithPan(s16 *x, s16 *y);
void DrawDoorMetatileAt(int x, int y, u16 *arr);
void ResetFieldCamera(void);
void ResetCameraUpdateInfo(void);
u32 InitCameraUpdateCallback(u8 a);
u32 InitCameraUpdateCallback(u8 trackedSpriteId);
void CameraUpdate(void);
void SetCameraPanningCallback(void (*a)(void));
void SetCameraPanning(s16 a, s16 b);
void SetCameraPanningCallback(void (*callback)(void));
void SetCameraPanning(s16 horizontal, s16 vertical);
void InstallCameraPanAheadCallback(void);
void UpdateCameraPanning(void);
void FieldUpdateBgTilemapScroll(void);

View File

@ -11,29 +11,29 @@ void PlayerGetDestCoords(s16 *, s16 *);
u8 GetPlayerFacingDirection(void);
u8 GetPlayerMovementDirection(void);
u8 PlayerGetCopyableMovement(void);
void PlayerWalkNormal(u8);
void PlayerWalkFast(u8);
void PlayerRideWaterCurrent(u8);
void PlayerWalkFaster(u8);
void PlayerOnBikeCollide(u8);
void PlayerFaceDirection(u8 a);
void PlayerTurnInPlace(u8 a);
void PlayerJumpLedge(u8 a);
void PlayerIdleWheelie(u8 a);
void PlayerStartWheelie(u8 a);
void PlayerEndWheelie(u8 a);
void PlayerStandingHoppingWheelie(u8 a);
void PlayerMovingHoppingWheelie(u8 a);
void PlayerLedgeHoppingWheelie(u8 a);
void PlayerAcroTurnJump(u8 a);
void PlayerSetAnimId(u8 a, u8 b);
void PlayerWalkNormal(u8 direction);
void PlayerWalkFast(u8 direction);
void PlayerRideWaterCurrent(u8 direction);
void PlayerWalkFaster(u8 direction);
void PlayerOnBikeCollide(u8 direction);
void PlayerFaceDirection(u8 direction);
void PlayerTurnInPlace(u8 direction);
void PlayerJumpLedge(u8 direction);
void PlayerIdleWheelie(u8 direction);
void PlayerStartWheelie(u8 direction);
void PlayerEndWheelie(u8 direction);
void PlayerStandingHoppingWheelie(u8 direction);
void PlayerMovingHoppingWheelie(u8 direction);
void PlayerLedgeHoppingWheelie(u8 direction);
void PlayerAcroTurnJump(u8 direction);
void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement);
bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction);
void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction);
u8 CheckForObjectEventCollision(struct ObjectEvent *a, s16 b, s16 c, u8 d, u8 e);
u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior);
u8 PlayerGetElevation(void);
void SetPlayerAvatarTransitionFlags(u16 a);
void SetPlayerAvatarTransitionFlags(u16 transitionFlags);
void CancelPlayerForcedMovement(void);
void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d);
void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender);
void PlayerFreeze(void);
void StopPlayerAvatar(void);
void SetSpinStartFacingDir(u8);
@ -41,8 +41,8 @@ void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr);
u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8);
void SetPlayerAvatarFieldMove(void);
u8 GetPlayerAvatarGraphicsIdByCurrentState(void);
void SetPlayerAvatarStateMask(u8 a);
u8 GetPlayerAvatarGraphicsIdByStateId(u8 a);
void SetPlayerAvatarStateMask(u8 flags);
u8 GetPlayerAvatarGraphicsIdByStateId(u8 state);
u8 GetJumpSpecialMovementAction(u32);
bool8 PartyHasMonWithSurf(void);
bool8 IsPlayerFacingSurfableFishableWater(void);

View File

@ -1,14 +1,8 @@
#ifndef GUARD_FIELD_SPECIAL_SCENE_H
#define GUARD_FIELD_SPECIAL_SCENE_H
s16 GetTruckCameraBobbingY(int a1);
s16 GetTruckBoxMovement(int a1);
void Task_Truck1(u8 taskId);
void Task_Truck2(u8 taskId);
void Task_Truck3(u8 taskId);
void Task_HandleTruckSequence(u8 taskId);
void ExecuteTruckSequence(void);
void EndTruckSequence(u8);
void EndTruckSequence(u8 taskId);
void FieldCB_ShowPortholeView(void);
#endif // GUARD_FIELD_SPECIAL_SCENE_H

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