Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/merrpFollowers
# Conflicts: # src/data/pokemon/species_info/gen_4_families.h
@ -23,9 +23,10 @@ body:
|
||||
label: Version
|
||||
description: What version of pokeemerald-expansion are you using as a base?
|
||||
options:
|
||||
- 1.8.2 (Latest release)
|
||||
- 1.8.3 (Latest release)
|
||||
- master (default, unreleased bugfixes)
|
||||
- upcoming (Edge)
|
||||
- 1.8.2
|
||||
- 1.8.1
|
||||
- 1.8.0
|
||||
- 1.7.4
|
||||
|
||||
@ -23,9 +23,10 @@ body:
|
||||
label: Version
|
||||
description: What version of pokeemerald-expansion are you using as a base?
|
||||
options:
|
||||
- 1.8.2 (Latest release)
|
||||
- 1.8.3 (Latest release)
|
||||
- master (default, unreleased bugfixes)
|
||||
- upcoming (Edge)
|
||||
- 1.8.2
|
||||
- 1.8.1
|
||||
- 1.8.0
|
||||
- 1.7.4
|
||||
|
||||
3
.github/ISSUE_TEMPLATE/04_other_errors.yaml
vendored
@ -23,9 +23,10 @@ body:
|
||||
label: Version
|
||||
description: What version of pokeemerald-expansion are you using as a base?
|
||||
options:
|
||||
- 1.8.2 (Latest release)
|
||||
- 1.8.3 (Latest release)
|
||||
- master (default, unreleased bugfixes)
|
||||
- upcoming (Edge)
|
||||
- 1.8.2
|
||||
- 1.8.1
|
||||
- 1.8.0
|
||||
- 1.7.4
|
||||
|
||||
1
.gitignore
vendored
@ -39,3 +39,4 @@ prefabs.json
|
||||
*.sym
|
||||
*.js
|
||||
src/data/map_group_count.h
|
||||
tools/trainerproc/trainerproc
|
||||
|
||||
51
CHANGELOG.md
@ -1,46 +1,47 @@
|
||||
# Pokeemerald-Expansion Changelogs
|
||||
|
||||
## 1.8.x
|
||||
- ### [Version 1.8.2](docs/changelogs/1.8.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.8.1](docs/changelogs/1.8.1.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.8.0](docs/changelogs/1.8.0.md) - Feature Release ✨
|
||||
- ### [Version 1.8.3](docs/changelogs/1.8.x/1.8.3.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.8.2](docs/changelogs/1.8.x/1.8.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.8.1](docs/changelogs/1.8.x/1.8.1.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.8.0](docs/changelogs/1.8.x/1.8.0.md) - Feature Release ✨
|
||||
|
||||
## 1.7.x
|
||||
- ### [Version 1.7.4](docs/changelogs/1.7.4.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.3](docs/changelogs/1.7.3.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.2](docs/changelogs/1.7.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.1](docs/changelogs/1.7.1.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.0](docs/changelogs/1.7.0.md) - Feature Release ✨
|
||||
- ### [Version 1.7.4](docs/changelogs/1.7.x/1.7.4.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.3](docs/changelogs/1.7.x/1.7.3.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.2](docs/changelogs/1.7.x/1.7.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.1](docs/changelogs/1.7.x/1.7.1.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.7.0](docs/changelogs/1.7.x/1.7.0.md) - Feature Release ✨
|
||||
|
||||
## 1.6.x
|
||||
- ### [Version 1.6.2](docs/changelogs/1.6.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.6.1](docs/changelogs/1.6.1.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.6.0](docs/changelogs/1.6.0.md) - Feature Release ✨
|
||||
- ### [Version 1.6.2](docs/changelogs/1.6.x/1.6.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.6.1](docs/changelogs/1.6.x/1.6.1.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.6.0](docs/changelogs/1.6.x/1.6.0.md) - Feature Release ✨
|
||||
|
||||
## 1.5.x
|
||||
- ### [Version 1.5.3](docs/changelogs/1.5.3.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.5.2](docs/changelogs/1.5.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.5.1](docs/changelogs/1.5.1.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.5.0](docs/changelogs/1.5.0.md) - Feature Release ✨
|
||||
- ### [Version 1.5.3](docs/changelogs/1.5.x/1.5.3.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.5.2](docs/changelogs/1.5.x/1.5.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.5.1](docs/changelogs/1.5.x/1.5.1.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.5.0](docs/changelogs/1.5.x/1.5.0.md) - Feature Release ✨
|
||||
|
||||
## 1.4.x
|
||||
- ### [Version 1.4.3](docs/changelogs/1.4.3.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.4.2](docs/changelogs/1.4.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.4.1](docs/changelogs/1.4.1.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.4.0](docs/changelogs/1.4.0.md) - Feature Release ✨
|
||||
- ### [Version 1.4.3](docs/changelogs/1.4.x/1.4.3.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.4.2](docs/changelogs/1.4.x/1.4.2.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.4.1](docs/changelogs/1.4.x/1.4.1.md) - HOTFIX Release 🔥
|
||||
- ### [Version 1.4.0](docs/changelogs/1.4.x/1.4.0.md) - Feature Release ✨
|
||||
|
||||
## 1.3.x
|
||||
- ### [Version 1.3.0](docs/changelogs/1.3.0.md) - Feature Release ✨
|
||||
- ### [Version 1.3.0](docs/changelogs/1.3.x/1.3.0.md) - Feature Release ✨
|
||||
|
||||
## 1.2.x
|
||||
- ### [Version 1.2.0](docs/changelogs/1.2.0.md) - Feature Release ✨
|
||||
- ### [Version 1.2.0](docs/changelogs/1.2.x/1.2.0.md) - Feature Release ✨
|
||||
|
||||
## 1.1.x
|
||||
- ### [Version 1.1.1](docs/changelogs/1.1.1.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.1.0](docs/changelogs/1.1.0.md) - Feature Release ✨
|
||||
- ### [Version 1.1.1](docs/changelogs/1.1.x/1.1.1.md) - Bugfix Release 🧹
|
||||
- ### [Version 1.1.0](docs/changelogs/1.1.x/1.1.0.md) - Feature Release ✨
|
||||
|
||||
## 1.0.x
|
||||
- ### [Version 1.0.0](docs/changelogs/1.0.0.md) - Feature Release ✨
|
||||
- ### [Version 1.0.0](docs/changelogs/1.0.x/1.0.0.md) - Feature Release ✨
|
||||
|
||||
## Pre-1.0.x:
|
||||
- ### [Version 0.9.0](docs/changelogs/0.9.0.md) - Retroactive Version 🦕
|
||||
- ### [Version 0.9.0](docs/changelogs/0.9.x/0.9.0.md) - Retroactive Version 🦕
|
||||
|
||||
18
README.md
@ -14,11 +14,11 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee
|
||||
|
||||
## What features are included?
|
||||
- ***IMPORTANT*❗❗ Read through these to learn what features you can toggle**:
|
||||
- [Battle configurations](/include/config/battle.h)
|
||||
- [Pokémon configurations](/include/config/pokemon.h)
|
||||
- [Item configurations](/include/config/item.h)
|
||||
- [Overworld configurations](/include/config/overworld.h)
|
||||
- [Debug configurations](/include/config/debug.h)
|
||||
- [Battle configurations](include/config/battle.h)
|
||||
- [Pokémon configurations](include/config/pokemon.h)
|
||||
- [Item configurations](include/config/item.h)
|
||||
- [Overworld configurations](include/config/overworld.h)
|
||||
- [Debug configurations](include/config/debug.h)
|
||||
- ***Upgraded battle engine.***
|
||||
- Gen5+ damage calculation.
|
||||
- 2v2 Wild battles support.
|
||||
@ -62,7 +62,7 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee
|
||||
- Recalculating stats at the end of every battle.
|
||||
- Level 100 Pokémon can earn EVs.
|
||||
- Inverse battle support.
|
||||
- TONS of other features listed [here](/include/config/battle.h).
|
||||
- TONS of other features listed [here](include/config/battle.h).
|
||||
- ***Full Trainer customization***
|
||||
- Nickname, EVs, IVs, moves, ability, ball, friendship, nature, gender, shininess.
|
||||
- Custom tag battle support (teaming up an NPC in a double battle).
|
||||
@ -94,7 +94,7 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee
|
||||
- All gender differences.
|
||||
- Custom female icons for female Hippopotas Hippowdon, Pikachu and Wobbufett
|
||||
- 3 Perfect IVs on Legendaries, Mythicals and Ultra Beasts.
|
||||
- ***Customizable form change tables. Full list of methods [here](/include/constants/form_change_types.h).***
|
||||
- ***Customizable form change tables. Full list of methods [here](include/constants/form_change_types.h).***
|
||||
- Item holding (eg. Giratina/Arceus)
|
||||
- Item using (eg. Oricorio)
|
||||
- Time of day option for Shaymin
|
||||
@ -115,7 +115,7 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee
|
||||
- Egg Move Transfer, including Mirror Herb (configurable).
|
||||
- Nature inheriting 100% of the time with Everstone (configurable)
|
||||
- Gen6+ Ability inheriting (configurable).
|
||||
- ***Items from newer Generations. Full list [here](/include/constants/items.h).***
|
||||
- ***Items from newer Generations. Full list [here](include/constants/items.h).***
|
||||
- ***Gen 6+ Exp. Share*** (configurable)
|
||||
- Berserk Gene
|
||||
- Most battle items from Gen 4+
|
||||
@ -170,7 +170,7 @@ With this, you'll get the latest version of pokeemerald-expansion, plus a couple
|
||||
- Check your current version.
|
||||
- You can check in the debug menu's `Utilities -> Expansion Version` option.
|
||||
- If the option is not available, you possibly have version 1.6.2 or older. In that case, please check the [changelogs](CHANGELOG.md) to determine your version based on the features available on your repository.
|
||||
- Once you have your remote set up, run the command `git pull RHH expansion/X.Y.Z`, replacing X, Y and Z with the digits of the respective version you want to update to (eg, to update to 1.8.2, use `git pull RHH expansion/1.8.2`).
|
||||
- Once you have your remote set up, run the command `git pull RHH expansion/X.Y.Z`, replacing X, Y and Z with the digits of the respective version you want to update to (eg, to update to 1.8.3, use `git pull RHH expansion/1.8.3`).
|
||||
- ***Important:*** If you are several versions behind, we recommend updating one minor version at a time, skipping directly to the latest patch version (eg, 1.5.3 -> 1.6.2 -> 1.7.4 and so on)
|
||||
- Alternatively, you can update to unreleased versions of the expansion.
|
||||
- ***master (stable):*** It contains unreleased **bugfixes** that will come in the next patch version. To merge, use `git pull RHH master`.
|
||||
|
||||
@ -710,8 +710,9 @@
|
||||
.byte 0x7c
|
||||
.endm
|
||||
|
||||
.macro setrain
|
||||
.macro setfieldweather weather:req
|
||||
.byte 0x7d
|
||||
.byte \weather
|
||||
.endm
|
||||
|
||||
.macro setreflect
|
||||
@ -833,7 +834,7 @@
|
||||
.byte 0x94
|
||||
.endm
|
||||
|
||||
.macro setsandstorm
|
||||
.macro unused_95
|
||||
.byte 0x95
|
||||
.endm
|
||||
|
||||
@ -1005,7 +1006,7 @@
|
||||
.4byte \jumpInstr
|
||||
.endm
|
||||
|
||||
.macro setsunny
|
||||
.macro unused_bb
|
||||
.byte 0xbb
|
||||
.endm
|
||||
|
||||
@ -1080,7 +1081,7 @@
|
||||
.byte 0xc7
|
||||
.endm
|
||||
|
||||
.macro sethail
|
||||
.macro unused_c8
|
||||
.byte 0xc8
|
||||
.endm
|
||||
|
||||
@ -1409,10 +1410,6 @@
|
||||
callnative BS_TryRevertWeatherForm
|
||||
.endm
|
||||
|
||||
.macro setsnow
|
||||
callnative BS_SetSnow
|
||||
.endm
|
||||
|
||||
.macro applysaltcure battler:req
|
||||
callnative BS_ApplySaltCure
|
||||
.byte \battler
|
||||
@ -1636,6 +1633,15 @@
|
||||
callnative BS_TryGulpMissile
|
||||
.endm
|
||||
|
||||
.macro tryquash failInstr:req
|
||||
callnative BS_TryQuash
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro removeweather
|
||||
callnative BS_RemoveWeather
|
||||
.endm
|
||||
|
||||
@ various command changed to more readable macros
|
||||
.macro cancelmultiturnmoves battler:req
|
||||
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
|
||||
@ -1827,11 +1833,6 @@
|
||||
various \battler, VARIOUS_SET_LAST_USED_ABILITY
|
||||
.endm
|
||||
|
||||
.macro tryquash failInstr:req
|
||||
various BS_ATTACKER, VARIOUS_TRY_QUASH
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro tryafteryou failInstr:req
|
||||
various BS_ATTACKER, VARIOUS_AFTER_YOU
|
||||
.4byte \failInstr
|
||||
|
||||
@ -2178,3 +2178,16 @@
|
||||
.2byte \status1
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Sets VAR_RESULT to the Pokémon in \slot's Tera Type
|
||||
.macro checkteratype slot:req
|
||||
callnative CheckTeraType
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Sets the Pokémon in \slot's Tera Type
|
||||
.macro setteratype type:req, slot:req
|
||||
callnative SetTeraType
|
||||
.byte \type
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ -464,6 +464,9 @@ FONT_NORMAL = FC 06 01
|
||||
FONT_SHORT = FC 06 02
|
||||
FONT_NARROW = FC 06 07
|
||||
FONT_SMALL_NARROW = FC 06 08
|
||||
FONT_NARROWER = FC 06 0A
|
||||
FONT_SMALL_NARROWER = FC 06 0B
|
||||
FONT_SHORT_NARROW = FC 06 0C
|
||||
|
||||
@ colors
|
||||
|
||||
|
||||
@ -20,6 +20,34 @@
|
||||
|
||||
.section script_data, "aw", %progbits
|
||||
|
||||
BattleScript_Terastallization::
|
||||
@ TODO: no string prints in S/V, but right now this helps with clarity
|
||||
printstring STRINGID_PKMNTERASTALLIZEDINTO
|
||||
@ TODO: replace this animation
|
||||
playanimation BS_ATTACKER, B_ANIM_TOTEM_FLARE
|
||||
waitanimation
|
||||
end3
|
||||
|
||||
BattleScript_LowerAtkSpAtk::
|
||||
jumpifstat BS_EFFECT_BATTLER, CMP_GREATER_THAN, STAT_ATK, MIN_STAT_STAGE, BattleScript_LowerAtkSpAtkDoAnim
|
||||
jumpifstat BS_EFFECT_BATTLER, CMP_EQUAL, STAT_SPATK, MIN_STAT_STAGE, BattleScript_LowerAtkSpAtkEnd
|
||||
BattleScript_LowerAtkSpAtkDoAnim::
|
||||
setbyte sSTAT_ANIM_PLAYED, FALSE
|
||||
playstatchangeanimation BS_EFFECT_BATTLER, BIT_ATK | BIT_SPATK, STAT_CHANGE_NEGATIVE
|
||||
setstatchanger STAT_ATK, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_LowerAtkSpAtkTrySpAtk
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_LowerAtkSpAtkTrySpAtk
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_LowerAtkSpAtkTrySpAtk::
|
||||
setstatchanger STAT_SPATK, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_LowerAtkSpAtkEnd
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_LowerAtkSpAtkEnd
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_LowerAtkSpAtkEnd:
|
||||
return
|
||||
|
||||
BattleScript_EffectTidyUp::
|
||||
attackcanceler
|
||||
attackstring
|
||||
@ -159,7 +187,7 @@ BattleScript_EffectChillyReception::
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_RAIN_PRIMAL, BattleScript_EffectChillyReceptionBlockedByPrimalRain
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_STRONG_WINDS, BattleScript_EffectChillyReceptionBlockedByStrongWinds
|
||||
call BattleScript_EffectChillyReceptionPlayAnimation
|
||||
setsnow
|
||||
setfieldweather ENUM_WEATHER_SNOW
|
||||
call BattleScript_MoveWeatherChangeRet
|
||||
goto BattleScript_MoveSwitch
|
||||
BattleScript_EffectChillyReceptionPlayAnimation:
|
||||
@ -4307,7 +4335,7 @@ BattleScript_EffectSandstorm::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setsandstorm
|
||||
setfieldweather ENUM_WEATHER_SANDSTORM
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
BattleScript_EffectRollout::
|
||||
@ -4473,7 +4501,7 @@ BattleScript_EffectRainDance::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setrain
|
||||
setfieldweather ENUM_WEATHER_RAIN
|
||||
BattleScript_MoveWeatherChange::
|
||||
attackanimation
|
||||
waitanimation
|
||||
@ -4491,7 +4519,7 @@ BattleScript_EffectSunnyDay::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setsunny
|
||||
setfieldweather ENUM_WEATHER_SUN
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
BattleScript_ExtremelyHarshSunlightWasNotLessened:
|
||||
@ -4849,7 +4877,7 @@ BattleScript_EffectHail::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
sethail
|
||||
setfieldweather ENUM_WEATHER_HAIL
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
BattleScript_EffectTorment::
|
||||
@ -6298,6 +6326,21 @@ BattleScript_DmgHazardsOnTargetFainted::
|
||||
moveendall
|
||||
goto BattleScript_HandleFaintedMon
|
||||
|
||||
BattleScript_DmgHazardsOnBattlerScripting::
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||
healthbarupdate BS_SCRIPTING
|
||||
datahpupdate BS_SCRIPTING
|
||||
call BattleScript_PrintHurtByDmgHazards
|
||||
tryfaintmon BS_SCRIPTING
|
||||
tryfaintmon_spikes BS_SCRIPTING, BattleScript_DmgHazardsOnBattlerScriptingFainted
|
||||
return
|
||||
|
||||
BattleScript_DmgHazardsOnBattlerScriptingFainted::
|
||||
setbyte sGIVEEXP_STATE, 0
|
||||
getexp BS_SCRIPTING
|
||||
moveendall
|
||||
goto BattleScript_HandleFaintedMon
|
||||
|
||||
BattleScript_DmgHazardsOnFaintedBattler::
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||
healthbarupdate BS_FAINTED
|
||||
@ -6639,6 +6682,7 @@ BattleScript_DoFutureAttackResult:
|
||||
checkteamslost BattleScript_FutureAttackEnd
|
||||
BattleScript_FutureAttackEnd::
|
||||
moveendcase MOVEEND_RAGE
|
||||
moveendcase MOVEEND_ABILITIES
|
||||
moveendfromto MOVEEND_ITEM_EFFECTS_ALL, MOVEEND_UPDATE_LAST_MOVES
|
||||
setbyte gMoveResultFlags, 0
|
||||
end2
|
||||
@ -7050,6 +7094,29 @@ BattleScript_AttackerFormChangeEnd3NoPopup::
|
||||
call BattleScript_AttackerFormChangeNoPopup
|
||||
end3
|
||||
|
||||
BattleScript_AttackerFormChangeWithString::
|
||||
pause 5
|
||||
copybyte gBattlerAbility, gBattlerAttacker
|
||||
call BattleScript_AbilityPopUp
|
||||
flushtextbox
|
||||
BattleScript_AttackerFormChangeWithStringNoPopup::
|
||||
handleformchange BS_ATTACKER, 0
|
||||
handleformchange BS_ATTACKER, 1
|
||||
playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE
|
||||
waitanimation
|
||||
handleformchange BS_ATTACKER, 2
|
||||
printstring STRINGID_PKMNTRANSFORMED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_AttackerFormChangeWithStringEnd3::
|
||||
call BattleScript_AttackerFormChangeWithString
|
||||
end3
|
||||
|
||||
BattleScript_AttackerFormChangeWithStringEnd3NoPopup::
|
||||
call BattleScript_AttackerFormChangeWithStringNoPopup
|
||||
end3
|
||||
|
||||
BattleScript_AttackerFormChangeMoveEffect::
|
||||
waitmessage 1
|
||||
handleformchange BS_ATTACKER, 0
|
||||
@ -7801,6 +7868,7 @@ BattleScript_IntimidateEffect:
|
||||
statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_IntimidateLoopIncrement
|
||||
setgraphicalstatchangevalues
|
||||
jumpifability BS_TARGET, ABILITY_CONTRARY, BattleScript_IntimidateContrary
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_IntimidateWontDecrease
|
||||
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
printstring STRINGID_PKMNCUTSATTACKWITH
|
||||
BattleScript_IntimidateEffect_WaitString:
|
||||
@ -7817,6 +7885,10 @@ BattleScript_IntimidateEnd:
|
||||
pause B_WAIT_TIME_MED
|
||||
end3
|
||||
|
||||
BattleScript_IntimidateWontDecrease:
|
||||
printstring STRINGID_STATSWONTDECREASE
|
||||
goto BattleScript_IntimidateEffect_WaitString
|
||||
|
||||
BattleScript_IntimidateContrary:
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_IntimidateContrary_WontIncrease
|
||||
@ -7856,6 +7928,7 @@ BattleScript_SupersweetSyrupEffect:
|
||||
statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_SupersweetSyrupLoopIncrement
|
||||
setgraphicalstatchangevalues
|
||||
jumpifability BS_TARGET, ABILITY_CONTRARY, BattleScript_SupersweetSyrupContrary
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SupersweetSyrupWontDecrease
|
||||
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
printfromtable gStatDownStringIds
|
||||
BattleScript_SupersweetSyrupEffect_WaitString:
|
||||
@ -7872,6 +7945,10 @@ BattleScript_SupersweetSyrupEnd:
|
||||
pause B_WAIT_TIME_MED
|
||||
end3
|
||||
|
||||
BattleScript_SupersweetSyrupWontDecrease:
|
||||
printstring STRINGID_STATSWONTDECREASE
|
||||
goto BattleScript_SupersweetSyrupEffect_WaitString
|
||||
|
||||
BattleScript_SupersweetSyrupContrary:
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SupersweetSyrupContrary_WontIncrease
|
||||
@ -7945,7 +8022,7 @@ BattleScript_QuarkDriveActivates::
|
||||
|
||||
BattleScript_RuinAbilityActivates::
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT
|
||||
printstring STRINGID_ABILITYWEAKENEDSURROUNDINGMONSSTAT
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
end3
|
||||
|
||||
@ -8318,6 +8395,13 @@ BattleScript_ProteanActivates::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_TeraShellDistortingTypeMatchups::
|
||||
pause B_WAIT_TIME_SHORTEST
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNMADESHELLGLEAM
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_CursedBodyActivates::
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_CUSEDBODYDISABLED
|
||||
@ -9223,6 +9307,25 @@ BattleScript_AnnounceAirLockCloudNine::
|
||||
call BattleScript_ActivateWeatherAbilities
|
||||
end3
|
||||
|
||||
BattleScript_ActivateTeraformZero::
|
||||
call BattleScript_AbilityPopUp
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_ANY, BattleScript_ActivateTeraformZero_RemoveWeather
|
||||
jumpifhalfword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_ANY, BattleScript_ActivateTeraformZero_RemoveTerrain
|
||||
goto BattleScript_ActivateTeraformZero_End
|
||||
BattleScript_ActivateTeraformZero_RemoveWeather:
|
||||
removeweather
|
||||
printfromtable gWeatherEndsStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
jumpifhalfword CMP_NO_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_ANY, BattleScript_ActivateTeraformZero_End
|
||||
BattleScript_ActivateTeraformZero_RemoveTerrain:
|
||||
removeterrain
|
||||
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG
|
||||
printfromtable gTerrainStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_ActivateTeraformZero_End:
|
||||
end3
|
||||
|
||||
BattleScript_QuickClawActivation::
|
||||
flushtextbox
|
||||
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
|
||||
@ -9968,5 +10071,5 @@ BattleScript_EffectSnow::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setsnow
|
||||
setfieldweather ENUM_WEATHER_SNOW
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
132
docs/changelogs/1.8.x/1.8.3.md
Normal file
@ -0,0 +1,132 @@
|
||||
# Version 1.8.3
|
||||
|
||||
```md
|
||||
## How to update
|
||||
- If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`.
|
||||
- Once you have your remote set up, run the command `git pull RHH expansion/1.8.3`.
|
||||
```
|
||||
|
||||
## 💥 *Softlock/Crash fixes* 💥
|
||||
* Fixed AI bug that caused an infinite loop when player mon has only status moves by @Pawkkie and @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4403
|
||||
* Temporarely disabled `AI_FLAG_SMART_MON_CHOICES` flag in double battles to prevent a softlock by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4405
|
||||
* Fixed debug option "Fill PC Boxes Fast" softlocking the game by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/4428
|
||||
* Fixed infinite loop caused by Leftovers with `AI_FLAG_SMART_MON_CHOICES` by @Pokabbie and @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4453
|
||||
|
||||
## 🧬 General 🧬
|
||||
### Changed
|
||||
* Updated outdated macOS instructions in `INSTALL.md` by @jschoeny in https://github.com/rh-hideout/pokeemerald-expansion/pull/4407
|
||||
* Made filepath links in `README.md` relative by @lolbinarycat in https://github.com/rh-hideout/pokeemerald-expansion/pull/4509
|
||||
### Fixed
|
||||
* Fixed abilities not being properly inherited via breeding for species/abilities with IDs over 255 by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4411
|
||||
* Fixed Hard Level Caps issues by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4420
|
||||
* Fixed Pokémon being able to surpass cap if they gained enough experience at once.
|
||||
* Fixed Exp. Candies ignoring hard caps.
|
||||
* Fixed Pokémon gaining 1 experience if they are at the level cap.
|
||||
* Fixed evolution tracker issues by @cawtds in https://github.com/rh-hideout/pokeemerald-expansion/pull/4503
|
||||
* `EVO_LEVEL_MOVE_TWENTY_TIMES` no longer increases with every move.
|
||||
* `EVO_LEVEL_RECOIL_DAMAGE_MALE/FEMALE` is no longer updated twice than intended.
|
||||
|
||||
## ✨ Feature Branches ✨
|
||||
### ***TheXaman's HGSS Pokédex Plus***:
|
||||
#### Fixed
|
||||
* Fixed Pokémon data page not properly handling `u16` Exp. Yields by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4432
|
||||
* Cleanup by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4445
|
||||
|
||||
## 🐉 Pokémon 🐉
|
||||
### Changed
|
||||
* Further Gen 9 Pokémon icon improvements by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4413
|
||||
* Original sprites by [ezerart on DeviantArt](https://www.deviantart.com/ezerart/art/Pokemon-Gen-9-Icon-sprites-3DS-Style-944211258). Palette assignments and 2nd frames by kittenchilly.
|
||||
* Cyclizar, Dipplin, Farigiraf, Glimmet, Glimmora, Greavard, Iron Moth, Revavroom, Tadbulb, Paldean Tauros (all three of them), Tinkaton and Paldean Wooper.
|
||||
* Further Gen 9 Pokémon front/back sprite improvements by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4414
|
||||
* Source: [PokéCommunity](https://www.pokecommunity.com/threads/ds-style-gen-vii-and-beyond-pok%C3%A9mon-sprite-repository-in-64x64.368703/post-10814369)
|
||||
* Dolliv, Arboliva, Charcadet, Mabosstiff, Tinkatink, Tinkatuff, Tinkaton and Chien-Pao.
|
||||
### Fixed
|
||||
* Fixed Lycanroc Dusk and Midnight forms using Midday's backsprite by @Eemeliri in https://github.com/rh-hideout/pokeemerald-expansion/pull/4430
|
||||
* Fixed Tatsugiri Droopy back sprite palette by @cafei-uh in https://github.com/rh-hideout/pokeemerald-expansion/pull/4455
|
||||
|
||||
## ⚔️ Battle General ⚔️ ##
|
||||
### Changed
|
||||
* Turned `B_RESTORE_HELD_BATTLE_ITEMS` into a generational config by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4402
|
||||
### Fixed
|
||||
* Fixed battle Partner trainer class and potential OOB-related issues by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4422
|
||||
|
||||
## 🤹 Moves 🤹
|
||||
### Fixed
|
||||
* Fixed Quash not properly working when `B_RECALC_TURN_AFTER_ACTIONS` is set to `GEN_8` or greater by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4419
|
||||
* Fixed Will-O-Wisp's name capitalization in gMovesInfo by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4425
|
||||
* Fixed Thunder Cage not printing the right battle message by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4426
|
||||
* Fixed Diamond Storm missing its effect by @PhallenTree in https://github.com/rh-hideout/pokeemerald-expansion/pull/4489
|
||||
* Fixed Mortal Spin's description by @PhallenTree in https://github.com/rh-hideout/pokeemerald-expansion/pull/4489
|
||||
* Fixed Assist being able to call `MOVE_NONE` by @PhallenTree in https://github.com/rh-hideout/pokeemerald-expansion/pull/4491
|
||||
|
||||
## 🎭 Abilities 🎭
|
||||
### Changed
|
||||
* Changed the Embody Aspect defines to use the full form name, to be in line with the species define by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4439
|
||||
* Eg. `ABILITY_EMBODY_ASPECT_TEAL` -> `ABILITY_EMBODY_ASPECT_TEAL_MASK`.
|
||||
### Fixed
|
||||
* Fixed Intimidate/Supersweet Syrup playing their animation and not printing the right message for battlers at -6 stage Attack/Evasion by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4406
|
||||
* Fixed ability pop ups not respecting `abilityPopupOverwrite` in tests by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4423
|
||||
* Fixed Dancer copying multi-target moves by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4437
|
||||
* Fixed Hospitality triggering on a fainted mon by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4450
|
||||
* Fixed Embody Aspect (Teal Mask) boosting Sp. Attack instead of Speed by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4439
|
||||
* Fixed lingering long ability popup names by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4456
|
||||
* Fixed Fur Coat not being skipped by Mold Breaker abilities by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4459
|
||||
* Fixed Color change not being triggered by Future Sight or Doom Desire by @AlexOn1ine and @hedara90 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4472
|
||||
* Fixes Magic Bounce only working for battlers in certain positions by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4464
|
||||
* Fixed Costar, Zero to Hero, Supreme Overlord and Ruin abilities' switch-in battle messages showing sometimes incorrectly by @PhallenTree in https://github.com/rh-hideout/pokeemerald-expansion/pull/4500
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4511
|
||||
|
||||
## 🧶 Items 🧶
|
||||
### Fixed
|
||||
* Fixed typo in Rotom Catalogue description by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/4433
|
||||
* Eject item fixes (Eject Button/Pack):
|
||||
* Fixed regression from 1.8.2 that caused Eject Pack to not trigger upon self-inflicted stat decreases by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4463
|
||||
* Fixed Eject Items causing wrong Pokémon taking damage by entry hazards by @PhallenTree in https://github.com/rh-hideout/pokeemerald-expansion/pull/4465
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4497
|
||||
* Fixed Flute Items being consumed in battle by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4496
|
||||
* Fixed Red Card activating if the holder was switched in in the same turn (eg. via Endure) by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4482
|
||||
|
||||
## 🤖 Battle AI 🤖
|
||||
### Changed
|
||||
* `AI_FLAG_SMART_SWITCHING` flag now automatically sets `AI_FLAG_SMART_MON_CHOICES` as well by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4405
|
||||
* Cleanup by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4409
|
||||
* Corrected `IsDamageMoveUsable`'s name to `IsDamageMoveUnusable` by @WillKolada in https://github.com/rh-hideout/pokeemerald-expansion/pull/4476
|
||||
* Fixed AI not knowing that Steam Roller fails when there's no terrain by @WillKolada in https://github.com/rh-hideout/pokeemerald-expansion/pull/4476
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4498
|
||||
|
||||
## 🧪 Test Runner 🧪
|
||||
### Added
|
||||
* Added missing Color change tests by @hedara90 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4472
|
||||
### Changed
|
||||
### Fixed
|
||||
* Fixed AI test error messages by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/4404
|
||||
* The error messages for `EXPECT_MOVE` and `EXPECT_SWITCH` were backwards, saying, e.g. `Expected MOVE, got SWITCH` when it should say `Expected SWITCH, got MOVE`.
|
||||
* Fixed typos in Embody Aspect tests by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4439
|
||||
* Fixed Battle Test organization by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4504
|
||||
* Fixed Cud Chew's file being in the move effect folder.
|
||||
* Fixed Cud Chew's file name and test names (Cud Chuw).
|
||||
* Fixed Gastro Acid and Role Play's files being in the ability folder.
|
||||
* Moved Recoil file to move flags folder.
|
||||
* Renamed White Herb's file to `restore_stats.c`.
|
||||
* Renamed Techno Blast's file to `change_type_on_item.c`.
|
||||
* `semi_invulnerable_moves.c` to `semi_invulnerable.c`.
|
||||
* `two_turn_moves.c` to `two_turns_attack.c`.
|
||||
* Combined Burn Up/Double Shock to a single file `fail_if_not_arg_type.c`
|
||||
* Added Spit Up/Swallow files that point Stockpile's file.
|
||||
* Moved secondary effect files to their own folder.
|
||||
* Combinations of secondary effects moved to their own folder
|
||||
* Split `hit_set_entry_hazards.c` to separate files for Spikes/Stealth Rock.
|
||||
* Grouped Hex/Venoshock to the same file `double_power_on_arg_status.c`
|
||||
|
||||
## New Contributors
|
||||
* @jschoeny made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4407
|
||||
* @Eemeliri made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4430
|
||||
* @cafei-uh made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4455
|
||||
* @PhallenTree made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4465
|
||||
* @WillKolada made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4476
|
||||
* @cawtds made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4503
|
||||
* @lolbinarycat made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4509
|
||||
|
||||
**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.8.2...expansion/1.8.3
|
||||
|
||||
<!--Last PR: 4503-->
|
||||
@ -7,7 +7,7 @@
|
||||
```
|
||||
|
||||
## 🌋 *IMPORTANT CHANGES* 🌋
|
||||
* We deleted the whole repo LOL by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3367
|
||||
* N/A
|
||||
|
||||
## 💥 *Softlock/Crash fixes* 💥
|
||||
* N/A
|
||||
@ -119,7 +119,7 @@
|
||||
|
||||
|
||||
## New Contributors
|
||||
* Tony
|
||||
* N/A
|
||||
|
||||
**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.Y.Z...expansion/1.Y.Z
|
||||
|
||||
|
||||
331
gflib/text.c
@ -23,17 +23,26 @@ static u16 FontFunc_ShortCopy2(struct TextPrinter *);
|
||||
static u16 FontFunc_ShortCopy3(struct TextPrinter *);
|
||||
static u16 FontFunc_Narrow(struct TextPrinter *);
|
||||
static u16 FontFunc_SmallNarrow(struct TextPrinter *);
|
||||
static u16 FontFunc_Narrower(struct TextPrinter *);
|
||||
static u16 FontFunc_SmallNarrower(struct TextPrinter *);
|
||||
static u16 FontFunc_ShortNarrow(struct TextPrinter *);
|
||||
static void DecompressGlyph_Small(u16, bool32);
|
||||
static void DecompressGlyph_Normal(u16, bool32);
|
||||
static void DecompressGlyph_Short(u16, bool32);
|
||||
static void DecompressGlyph_Narrow(u16, bool32);
|
||||
static void DecompressGlyph_SmallNarrow(u16, bool32);
|
||||
static void DecompressGlyph_Bold(u16);
|
||||
static void DecompressGlyph_Narrower(u16, bool32);
|
||||
static void DecompressGlyph_SmallNarrower(u16, bool32);
|
||||
static void DecompressGlyph_ShortNarrow(u16, bool32);
|
||||
static u32 GetGlyphWidth_Small(u16, bool32);
|
||||
static u32 GetGlyphWidth_Normal(u16, bool32);
|
||||
static u32 GetGlyphWidth_Short(u16, bool32);
|
||||
static u32 GetGlyphWidth_Narrow(u16, bool32);
|
||||
static u32 GetGlyphWidth_SmallNarrow(u16, bool32);
|
||||
static u32 GetGlyphWidth_Narrower(u16, bool32);
|
||||
static u32 GetGlyphWidth_SmallNarrower(u16, bool32);
|
||||
static u32 GetGlyphWidth_ShortNarrow(u16, bool32);
|
||||
|
||||
static EWRAM_DATA struct TextPrinter sTempTextPrinter = {0};
|
||||
static EWRAM_DATA struct TextPrinter sTextPrinters[WINDOWS_MAX] = {0};
|
||||
@ -81,15 +90,18 @@ static const u8 sWindowVerticalScrollSpeeds[] = {
|
||||
|
||||
static const struct GlyphWidthFunc sGlyphWidthFuncs[] =
|
||||
{
|
||||
{ FONT_SMALL, GetGlyphWidth_Small },
|
||||
{ FONT_NORMAL, GetGlyphWidth_Normal },
|
||||
{ FONT_SHORT, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_1, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_2, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_3, GetGlyphWidth_Short },
|
||||
{ FONT_BRAILLE, GetGlyphWidth_Braille },
|
||||
{ FONT_NARROW, GetGlyphWidth_Narrow },
|
||||
{ FONT_SMALL_NARROW, GetGlyphWidth_SmallNarrow }
|
||||
{ FONT_SMALL, GetGlyphWidth_Small },
|
||||
{ FONT_NORMAL, GetGlyphWidth_Normal },
|
||||
{ FONT_SHORT, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_1, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_2, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_3, GetGlyphWidth_Short },
|
||||
{ FONT_BRAILLE, GetGlyphWidth_Braille },
|
||||
{ FONT_NARROW, GetGlyphWidth_Narrow },
|
||||
{ FONT_SMALL_NARROW, GetGlyphWidth_SmallNarrow },
|
||||
{ FONT_NARROWER, GetGlyphWidth_Narrower },
|
||||
{ FONT_SMALL_NARROWER, GetGlyphWidth_SmallNarrower },
|
||||
{ FONT_SHORT_NARROW, GetGlyphWidth_ShortNarrow },
|
||||
};
|
||||
|
||||
struct
|
||||
@ -217,21 +229,54 @@ static const struct FontInfo sFontInfos[] =
|
||||
.fgColor = 1,
|
||||
.bgColor = 2,
|
||||
.shadowColor = 15,
|
||||
}
|
||||
},
|
||||
[FONT_NARROWER] = {
|
||||
.fontFunction = FontFunc_Narrower,
|
||||
.maxLetterWidth = 5,
|
||||
.maxLetterHeight = 16,
|
||||
.letterSpacing = 0,
|
||||
.lineSpacing = 0,
|
||||
.fgColor = 2,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
[FONT_SMALL_NARROWER] = {
|
||||
.fontFunction = FontFunc_SmallNarrower,
|
||||
.maxLetterWidth = 5,
|
||||
.maxLetterHeight = 8,
|
||||
.letterSpacing = 0,
|
||||
.lineSpacing = 0,
|
||||
.fgColor = 2,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
[FONT_SHORT_NARROW] = {
|
||||
.fontFunction = FontFunc_ShortNarrow,
|
||||
.maxLetterWidth = 5,
|
||||
.maxLetterHeight = 14,
|
||||
.letterSpacing = 0,
|
||||
.lineSpacing = 0,
|
||||
.fgColor = 2,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
};
|
||||
|
||||
static const u8 sMenuCursorDimensions[][2] =
|
||||
{
|
||||
[FONT_SMALL] = { 8, 12 },
|
||||
[FONT_NORMAL] = { 8, 15 },
|
||||
[FONT_SHORT] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_1] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_2] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_3] = { 8, 14 },
|
||||
[FONT_BRAILLE] = { 8, 16 },
|
||||
[FONT_NARROW] = { 8, 15 },
|
||||
[FONT_SMALL_NARROW] = { 8, 8 },
|
||||
[FONT_BOLD] = {}
|
||||
[FONT_SMALL] = { 8, 12 },
|
||||
[FONT_NORMAL] = { 8, 15 },
|
||||
[FONT_SHORT] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_1] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_2] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_3] = { 8, 14 },
|
||||
[FONT_BRAILLE] = { 8, 16 },
|
||||
[FONT_NARROW] = { 8, 15 },
|
||||
[FONT_SMALL_NARROW] = { 8, 8 },
|
||||
[FONT_BOLD] = {},
|
||||
[FONT_NARROWER] = { 8, 15 },
|
||||
[FONT_SMALL_NARROWER] = { 8, 8 },
|
||||
[FONT_SHORT_NARROW] = { 8, 14 },
|
||||
};
|
||||
|
||||
static const u16 sFontBoldJapaneseGlyphs[] = INCBIN_U16("graphics/fonts/bold.hwjpnfont");
|
||||
@ -813,6 +858,42 @@ static u16 FontFunc_SmallNarrow(struct TextPrinter *textPrinter)
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
static u16 FontFunc_Narrower(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
if (subStruct->hasFontIdBeenSet == FALSE)
|
||||
{
|
||||
subStruct->fontId = FONT_NARROWER;
|
||||
subStruct->hasFontIdBeenSet = TRUE;
|
||||
}
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
static u16 FontFunc_SmallNarrower(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
if (subStruct->hasFontIdBeenSet == FALSE)
|
||||
{
|
||||
subStruct->fontId = FONT_SMALL_NARROWER;
|
||||
subStruct->hasFontIdBeenSet = TRUE;
|
||||
}
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
static u16 FontFunc_ShortNarrow(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
if (subStruct->hasFontIdBeenSet == FALSE)
|
||||
{
|
||||
subStruct->fontId = FONT_SHORT_NARROW;
|
||||
subStruct->hasFontIdBeenSet = TRUE;
|
||||
}
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
@ -1250,6 +1331,15 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
||||
case FONT_SMALL_NARROW:
|
||||
DecompressGlyph_SmallNarrow(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_NARROWER:
|
||||
DecompressGlyph_Narrower(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_SMALL_NARROWER:
|
||||
DecompressGlyph_SmallNarrower(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_SHORT_NARROW:
|
||||
DecompressGlyph_ShortNarrow(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_BRAILLE:
|
||||
break;
|
||||
}
|
||||
@ -2012,3 +2102,204 @@ static void DecompressGlyph_Bold(u16 glyphId)
|
||||
gCurGlyph.width = 8;
|
||||
gCurGlyph.height = 12;
|
||||
}
|
||||
|
||||
static void DecompressGlyph_Narrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
glyphs = gFontNormalJapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId % 0x10));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom);
|
||||
gCurGlyph.width = 8;
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs = gFontNarrowerLatinGlyphs + (0x20 * glyphId);
|
||||
gCurGlyph.width = gFontNarrowerLatinGlyphWidths[glyphId];
|
||||
|
||||
if (gCurGlyph.width <= 8)
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8);
|
||||
}
|
||||
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetGlyphWidth_Narrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
if (isJapanese == TRUE)
|
||||
return 8;
|
||||
else
|
||||
return gFontNarrowerLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static void DecompressGlyph_SmallNarrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
glyphs = gFontSmallJapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId % 0x10));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom);
|
||||
gCurGlyph.width = 8;
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs = gFontSmallNarrowerLatinGlyphs + (0x20 * glyphId);
|
||||
gCurGlyph.width = gFontSmallNarrowerLatinGlyphWidths[glyphId];
|
||||
|
||||
if (gCurGlyph.width <= 8)
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8);
|
||||
}
|
||||
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetGlyphWidth_SmallNarrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
if (isJapanese == TRUE)
|
||||
return 8;
|
||||
else
|
||||
return gFontSmallNarrowerLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static void DecompressGlyph_ShortNarrow(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
glyphs = gFontShortJapaneseGlyphs + (0x100 * (glyphId >> 0x3)) + (0x10 * (glyphId & 0x7));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); // gCurGlyph + 0x20
|
||||
DecompressGlyphTile(glyphs + 0x88, gCurGlyph.gfxBufferBottom + 8); // gCurGlyph + 0x60
|
||||
gCurGlyph.width = gFontShortJapaneseGlyphWidths[glyphId];
|
||||
gCurGlyph.height = 14;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs = gFontShortNarrowLatinGlyphs + (0x20 * glyphId);
|
||||
gCurGlyph.width = gFontShortNarrowLatinGlyphWidths[glyphId];
|
||||
|
||||
if (gCurGlyph.width <= 8)
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8);
|
||||
}
|
||||
|
||||
gCurGlyph.height = 14;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetGlyphWidth_ShortNarrow(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
if (isJapanese == TRUE)
|
||||
return gFontShortJapaneseGlyphWidths[glyphId];
|
||||
else
|
||||
return gFontShortNarrowLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static const s8 sNarrowerFontIds[] =
|
||||
{
|
||||
[FONT_SMALL] = FONT_SMALL_NARROW,
|
||||
[FONT_NORMAL] = FONT_NARROW,
|
||||
[FONT_SHORT] = FONT_SHORT_NARROW,
|
||||
[FONT_SHORT_COPY_1] = FONT_SHORT_NARROW,
|
||||
[FONT_SHORT_COPY_2] = FONT_SHORT_NARROW,
|
||||
[FONT_SHORT_COPY_3] = FONT_SHORT_NARROW,
|
||||
[FONT_BRAILLE] = -1,
|
||||
[FONT_NARROW] = FONT_NARROWER,
|
||||
[FONT_SMALL_NARROW] = FONT_SMALL_NARROWER,
|
||||
[FONT_BOLD] = -1,
|
||||
[FONT_NARROWER] = -1,
|
||||
[FONT_SMALL_NARROWER] = -1,
|
||||
[FONT_SHORT_NARROW] = -1,
|
||||
};
|
||||
|
||||
// If the narrowest font ID doesn't fit the text, we still return that
|
||||
// ID because clipping is better than crashing.
|
||||
u32 GetFontIdToFit(const u8 *string, u32 fontId, u32 letterSpacing, u32 widthPx)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
s32 narrowerFontId = sNarrowerFontIds[fontId];
|
||||
if (narrowerFontId == -1)
|
||||
return fontId;
|
||||
if (GetStringWidth(fontId, string, letterSpacing) <= widthPx)
|
||||
return fontId;
|
||||
fontId = narrowerFontId;
|
||||
}
|
||||
}
|
||||
|
||||
u8 *PrependFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width)
|
||||
{
|
||||
|
||||
u32 fitFontId = GetFontIdToFit(start, fontId, 0, width);
|
||||
if (fitFontId != fontId)
|
||||
{
|
||||
memmove(&start[3], &start[0], end - start);
|
||||
start[0] = EXT_CTRL_CODE_BEGIN;
|
||||
start[1] = EXT_CTRL_CODE_FONT;
|
||||
start[2] = fitFontId;
|
||||
end[3] = EOS;
|
||||
return end + 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
return end;
|
||||
}
|
||||
}
|
||||
|
||||
u8 *WrapFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width)
|
||||
{
|
||||
|
||||
u32 fitFontId = GetFontIdToFit(start, fontId, 0, width);
|
||||
if (fitFontId != fontId)
|
||||
{
|
||||
memmove(&start[3], &start[0], end - start);
|
||||
start[0] = EXT_CTRL_CODE_BEGIN;
|
||||
start[1] = EXT_CTRL_CODE_FONT;
|
||||
start[2] = fitFontId;
|
||||
end[3] = EXT_CTRL_CODE_BEGIN;
|
||||
end[4] = EXT_CTRL_CODE_FONT;
|
||||
end[5] = fontId;
|
||||
end[6] = EOS;
|
||||
return end + 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
return end;
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,9 @@ enum {
|
||||
FONT_NARROW,
|
||||
FONT_SMALL_NARROW, // Very similar to FONT_SMALL, some glyphs are narrower
|
||||
FONT_BOLD, // JP glyph set only
|
||||
FONT_NARROWER,
|
||||
FONT_SMALL_NARROWER,
|
||||
FONT_SHORT_NARROW,
|
||||
};
|
||||
|
||||
// Return values for font functions
|
||||
@ -190,4 +193,8 @@ u8 GetMenuCursorDimensionByFont(u8 fontId, u8 whichDimension);
|
||||
u16 FontFunc_Braille(struct TextPrinter *textPrinter);
|
||||
u32 GetGlyphWidth_Braille(u16 glyphId, bool32 isJapanese);
|
||||
|
||||
u32 GetFontIdToFit(const u8 *string, u32 widestFontId, u32 letterSpacing, u32 widthPx);
|
||||
u8 *PrependFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width);
|
||||
u8 *WrapFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width);
|
||||
|
||||
#endif // GUARD_TEXT_H
|
||||
|
||||
@ -712,3 +712,13 @@ static u32 GetNumActiveWindowsOnBg8Bit(u32 bgId)
|
||||
}
|
||||
return windowsNum;
|
||||
}
|
||||
|
||||
u32 WindowWidthPx(u32 windowId)
|
||||
{
|
||||
return gWindows[windowId].window.width * TILE_WIDTH;
|
||||
}
|
||||
|
||||
u32 WindowTemplateWidthPx(const struct WindowTemplate *template)
|
||||
{
|
||||
return template->width * TILE_WIDTH;
|
||||
}
|
||||
|
||||
@ -73,6 +73,8 @@ void FillWindowPixelBuffer8Bit(u32 windowId, u8 fillValue);
|
||||
void FillWindowPixelRect8Bit(u32 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u32 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum);
|
||||
void CopyWindowToVram8Bit(u32 windowId, u8 mode);
|
||||
u32 WindowWidthPx(u32 windowId);
|
||||
u32 WindowTemplateWidthPx(const struct WindowTemplate *template);
|
||||
|
||||
extern struct Window gWindows[];
|
||||
extern void *gWindowBgTilemapBuffers[];
|
||||
|
||||
BIN
graphics/battle_interface/bug_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/dark_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/dragon_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/electric_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/fairy_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/fighting_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/fire_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/flying_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/ghost_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/grass_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/ground_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/ice_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/normal_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/poison_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/psychic_indicator.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
graphics/battle_interface/rock_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/steel_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/stellar_indicator.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
19
graphics/battle_interface/tera_indicator.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
0 0 0
|
||||
98 83 124
|
||||
207 63 109
|
||||
83 105 175
|
||||
80 144 216
|
||||
216 208 179
|
||||
254 115 121
|
||||
148 155 163
|
||||
99 188 91
|
||||
147 192 47
|
||||
255 156 85
|
||||
199 182 140
|
||||
113 206 198
|
||||
117 206 192
|
||||
245 210 55
|
||||
255 255 255
|
||||
BIN
graphics/battle_interface/tera_trigger.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
graphics/battle_interface/water_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/fonts/latin_narrower.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
graphics/fonts/latin_short_narrow.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
graphics/fonts/latin_small_narrower.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 386 B |
BIN
graphics/types/stellar.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
@ -22,7 +22,7 @@ STARTERGFXDIR := graphics/starter_choose
|
||||
NAMINGGFXDIR := graphics/naming_screen
|
||||
SPINDAGFXDIR := graphics/pokemon/spinda/spots
|
||||
|
||||
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy
|
||||
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy stellar
|
||||
contest_types := cool beauty cute smart tough
|
||||
|
||||
### Tilesets ###
|
||||
@ -238,6 +238,15 @@ $(FONTGFXDIR)/narrow.latfont: $(FONTGFXDIR)/latin_narrow.png
|
||||
$(FONTGFXDIR)/small_narrow.latfont: $(FONTGFXDIR)/latin_small_narrow.png
|
||||
$(GFX) $< $@
|
||||
|
||||
$(FONTGFXDIR)/narrower.latfont: $(FONTGFXDIR)/latin_narrower.png
|
||||
$(GFX) $< $@
|
||||
|
||||
$(FONTGFXDIR)/small_narrower.latfont: $(FONTGFXDIR)/latin_small_narrower.png
|
||||
$(GFX) $< $@
|
||||
|
||||
$(FONTGFXDIR)/short_narrow.latfont: $(FONTGFXDIR)/latin_short_narrow.png
|
||||
$(GFX) $< $@
|
||||
|
||||
$(FONTGFXDIR)/small.hwjpnfont: $(FONTGFXDIR)/japanese_small.png
|
||||
$(GFX) $< $@
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include "pokeball.h"
|
||||
#include "battle_debug.h"
|
||||
#include "battle_dynamax.h"
|
||||
#include "battle_terastal.h"
|
||||
#include "random.h" // for rng_value_t
|
||||
|
||||
// Helper for accessing command arguments and advancing gBattlescriptCurrInstr.
|
||||
@ -177,7 +178,6 @@ struct ProtectStruct
|
||||
u32 flinchImmobility:1;
|
||||
u32 notFirstStrike:1;
|
||||
u32 palaceUnableToUseMove:1;
|
||||
u32 usesBouncedMove:1;
|
||||
u32 usedHealBlockedMove:1;
|
||||
u32 usedGravityPreventedMove:1;
|
||||
u32 powderSelfDmg:1;
|
||||
@ -363,6 +363,8 @@ struct AiLogicData
|
||||
bool8 weatherHasEffect; // The same as WEATHER_HAS_EFFECT. Stored here, so it's called only once.
|
||||
u8 mostSuitableMonId[MAX_BATTLERS_COUNT]; // Stores result of GetMostSuitableMonToSwitchInto, which decides which generic mon the AI would switch into if they decide to switch. This can be overruled by specific mons found in ShouldSwitch; the final resulting mon is stored in AI_monToSwitchIntoId.
|
||||
struct SwitchinCandidate switchinCandidate; // Struct used for deciding which mon to switch to in battle_ai_switch_items.c
|
||||
bool8 shouldTerastal[MAX_BATTLERS_COUNT];
|
||||
bool8 shouldDynamax[MAX_BATTLERS_COUNT];
|
||||
};
|
||||
|
||||
struct AI_ThinkingStruct
|
||||
@ -611,6 +613,17 @@ struct DynamaxData
|
||||
u16 levelUpHP;
|
||||
};
|
||||
|
||||
struct TeraData
|
||||
{
|
||||
bool8 toTera; // flags using gBitTable
|
||||
bool8 isTerastallized[NUM_BATTLE_SIDES]; // stored as a bitfield for each side's party members
|
||||
bool8 alreadyTerastallized[MAX_BATTLERS_COUNT];
|
||||
bool8 playerSelect;
|
||||
u32 stellarBoostFlags[NUM_BATTLE_SIDES]; // stored as a bitfield of flags for all types for each side
|
||||
u8 triggerSpriteId;
|
||||
u8 indicatorSpriteId[MAX_BATTLERS_COUNT];
|
||||
};
|
||||
|
||||
struct LostItem
|
||||
{
|
||||
u16 originalItem:15;
|
||||
@ -733,6 +746,7 @@ struct BattleStruct
|
||||
struct UltraBurstData burst;
|
||||
struct ZMoveData zmove;
|
||||
struct DynamaxData dynamax;
|
||||
struct TeraData tera;
|
||||
const u8 *trainerSlideMsg;
|
||||
bool8 trainerSlideLowHpMsgDone;
|
||||
u8 introState;
|
||||
@ -756,9 +770,10 @@ struct BattleStruct
|
||||
u8 quickClawBattlerId;
|
||||
struct LostItem itemLost[PARTY_SIZE]; // Player's team that had items consumed or stolen (two bytes per party member)
|
||||
u8 forcedSwitch:4; // For each battler
|
||||
u8 additionalEffectsCounter:4; // A counter for the additionalEffects applied by the current move in Cmd_setadditionaleffects
|
||||
u8 blunderPolicy:1; // should blunder policy activate
|
||||
u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
|
||||
u8 additionalEffectsCounter:4; // A counter for the additionalEffects applied by the current move in Cmd_setadditionaleffects
|
||||
u8 bouncedMoveIsUsed:1;
|
||||
u8 ballSpriteIds[2]; // item gfx, window gfx
|
||||
u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change
|
||||
u8 skyDropTargets[MAX_BATTLERS_COUNT]; // For Sky Drop, to account for if multiple Pokemon use Sky Drop in a double battle.
|
||||
@ -787,6 +802,7 @@ struct BattleStruct
|
||||
u8 trainerSlideDynamaxMsgDone:1;
|
||||
u8 pledgeMove:1;
|
||||
u8 isSkyBattle:1;
|
||||
u8 poisonPuppeteerConfusion:1;
|
||||
u32 aiDelayTimer; // Counts number of frames AI takes to choose an action.
|
||||
u32 aiDelayFrames; // Number of frames it took to choose an action.
|
||||
u8 timesGotHit[NUM_BATTLE_SIDES][PARTY_SIZE];
|
||||
@ -800,6 +816,7 @@ struct BattleStruct
|
||||
u8 quickClawRandom[MAX_BATTLERS_COUNT];
|
||||
u8 quickDrawRandom[MAX_BATTLERS_COUNT];
|
||||
u8 boosterEnergyActivates;
|
||||
u8 distortedTypeMatchups;
|
||||
};
|
||||
|
||||
// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
|
||||
@ -829,9 +846,9 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER
|
||||
#define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[gBattlerTarget]))
|
||||
#define BATTLER_TURN_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[battler]))
|
||||
|
||||
#define IS_BATTLER_OF_TYPE(battlerId, type)((GetBattlerType(battlerId, 0) == type || GetBattlerType(battlerId, 1) == type || (GetBattlerType(battlerId, 2) != TYPE_MYSTERY && GetBattlerType(battlerId, 2) == type)))
|
||||
|
||||
#define IS_BATTLER_TYPELESS(battlerId)(GetBattlerType(battlerId, 0) == TYPE_MYSTERY && GetBattlerType(battlerId, 1) == TYPE_MYSTERY && GetBattlerType(battlerId, 2) == TYPE_MYSTERY)
|
||||
#define IS_BATTLER_OF_TYPE(battlerId, type)((GetBattlerType(battlerId, 0, FALSE) == type || GetBattlerType(battlerId, 1, FALSE) == type || (GetBattlerType(battlerId, 2, FALSE) != TYPE_MYSTERY && GetBattlerType(battlerId, 2, FALSE) == type)))
|
||||
#define IS_BATTLER_OF_BASE_TYPE(battlerId, type)((GetBattlerType(battlerId, 0, TRUE) == type || GetBattlerType(battlerId, 1, TRUE) == type || (GetBattlerType(battlerId, 2, TRUE) != TYPE_MYSTERY && GetBattlerType(battlerId, 2, TRUE) == type)))
|
||||
#define IS_BATTLER_TYPELESS(battlerId)(GetBattlerType(battlerId, 0, FALSE) == TYPE_MYSTERY && GetBattlerType(battlerId, 1, FALSE) == TYPE_MYSTERY && GetBattlerType(battlerId, 2, FALSE) == TYPE_MYSTERY)
|
||||
|
||||
#define SET_BATTLER_TYPE(battlerId, type) \
|
||||
{ \
|
||||
|
||||
@ -101,6 +101,7 @@ enum {
|
||||
#define RET_MEGA_EVOLUTION (1 << 7)
|
||||
#define RET_ULTRA_BURST (1 << 6)
|
||||
#define RET_DYNAMAX (1 << 5)
|
||||
#define RET_TERASTAL (1 << 4)
|
||||
|
||||
struct UnusedControllerStruct
|
||||
{
|
||||
|
||||
@ -31,6 +31,7 @@ void BattleStopLowHpSound(void);
|
||||
u8 GetMonHPBarLevel(struct Pokemon *mon);
|
||||
void HandleBattleLowHpMusicChange(void);
|
||||
void SetBattlerSpriteAffineMode(u8 affineMode);
|
||||
void CreateEnemyShadowSprite(u32 battler);
|
||||
void LoadAndCreateEnemyShadowSprites(void);
|
||||
void SpriteCB_SetInvisible(struct Sprite *sprite);
|
||||
void SetBattlerShadowSpriteCallback(u8 battler, u16 species);
|
||||
|
||||
@ -57,12 +57,36 @@ enum
|
||||
#define TAG_DYNAMAX_TRIGGER_TILE 0xD77D
|
||||
#define TAG_DYNAMAX_INDICATOR_TILE 0xD77E
|
||||
|
||||
#define TAG_NORMAL_INDICATOR_TILE 0xD77F
|
||||
#define TAG_FIGHTING_INDICATOR_TILE 0xD780
|
||||
#define TAG_FLYING_INDICATOR_TILE 0xD781
|
||||
#define TAG_POISON_INDICATOR_TILE 0xD782
|
||||
#define TAG_GROUND_INDICATOR_TILE 0xD783
|
||||
#define TAG_ROCK_INDICATOR_TILE 0xD784
|
||||
#define TAG_BUG_INDICATOR_TILE 0xD785
|
||||
#define TAG_GHOST_INDICATOR_TILE 0xD786
|
||||
#define TAG_STEEL_INDICATOR_TILE 0xD787
|
||||
// empty spot for TYPE_MYSTERY
|
||||
#define TAG_FIRE_INDICATOR_TILE 0xD789
|
||||
#define TAG_WATER_INDICATOR_TILE 0xD78A
|
||||
#define TAG_GRASS_INDICATOR_TILE 0xD78B
|
||||
#define TAG_ELECTRIC_INDICATOR_TILE 0xD78C
|
||||
#define TAG_PSYCHIC_INDICATOR_TILE 0xD78D
|
||||
#define TAG_ICE_INDICATOR_TILE 0xD78E
|
||||
#define TAG_DRAGON_INDICATOR_TILE 0xD78F
|
||||
#define TAG_DARK_INDICATOR_TILE 0xD790
|
||||
#define TAG_FAIRY_INDICATOR_TILE 0xD791
|
||||
#define TAG_STELLAR_INDICATOR_TILE 0xD792
|
||||
#define TAG_TERA_TRIGGER_TILE 0xD793
|
||||
|
||||
#define TAG_MEGA_TRIGGER_PAL 0xD777
|
||||
#define TAG_MEGA_INDICATOR_PAL 0xD778
|
||||
#define TAG_MISC_INDICATOR_PAL 0xD779 // Alpha, Omega, and Dynamax indicators use the same palette as each of them only uses 4 different colors.
|
||||
#define TAG_ZMOVE_TRIGGER_PAL 0xD77B
|
||||
#define TAG_BURST_TRIGGER_PAL 0xD77C
|
||||
#define TAG_DYNAMAX_TRIGGER_PAL 0xD77D
|
||||
#define TAG_TERA_INDICATOR_PAL 0xD77E
|
||||
#define TAG_TERA_TRIGGER_PAL 0xD77F
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@ -52,6 +52,7 @@ void StealTargetItem(u8 battlerStealer, u8 battlerItem);
|
||||
u8 GetCatchingBattler(void);
|
||||
u32 GetHighestStatId(u32 battlerId);
|
||||
bool32 ProteanTryChangeType(u32 battler, u32 ability, u32 move, u32 moveType);
|
||||
bool32 ShouldTeraShellDistortTypeMatchups(u32 move, u32 battlerDef);
|
||||
bool32 IsMoveNotAllowedInSkyBattles(u32 move);
|
||||
bool32 DoSwitchInAbilities(u32 battlerId);
|
||||
u8 GetFirstFaintedPartyIndex(u8 battlerId);
|
||||
|
||||
@ -80,6 +80,7 @@ extern const u8 BattleScript_EncoredNoMore[];
|
||||
extern const u8 BattleScript_DestinyBondTakesLife[];
|
||||
extern const u8 BattleScript_DmgHazardsOnAttacker[];
|
||||
extern const u8 BattleScript_DmgHazardsOnTarget[];
|
||||
extern const u8 BattleScript_DmgHazardsOnBattlerScripting[];
|
||||
extern const u8 BattleScript_DmgHazardsOnFaintedBattler[];
|
||||
extern const u8 BattleScript_PerishSongTakesLife[];
|
||||
extern const u8 BattleScript_PerishSongCountGoesDown[];
|
||||
@ -364,6 +365,8 @@ extern const u8 BattleScript_DancerActivates[];
|
||||
extern const u8 BattleScript_AftermathDmg[];
|
||||
extern const u8 BattleScript_AttackerFormChange[];
|
||||
extern const u8 BattleScript_AttackerFormChangeEnd3[];
|
||||
extern const u8 BattleScript_AttackerFormChangeWithString[];
|
||||
extern const u8 BattleScript_AttackerFormChangeWithStringEnd3[];
|
||||
extern const u8 BattleScript_TargetFormChange[];
|
||||
extern const u8 BattleScript_AnticipationActivates[];
|
||||
extern const u8 BattleScript_SlowStartEnds[];
|
||||
@ -382,6 +385,7 @@ extern const u8 BattleScript_CheekPouchActivates[];
|
||||
extern const u8 BattleScript_TotemVar[];
|
||||
extern const u8 BattleScript_TotemFlaredToLife[];
|
||||
extern const u8 BattleScript_AnnounceAirLockCloudNine[];
|
||||
extern const u8 BattleScript_ActivateTeraformZero[];
|
||||
extern const u8 BattleScript_BattlerAbilityStatRaiseOnSwitchIn[];
|
||||
extern const u8 BattleScript_CottonDownActivates[];
|
||||
extern const u8 BattleScript_BallFetch[];
|
||||
@ -436,6 +440,7 @@ extern const u8 BattleScript_PastelVeilActivates[];
|
||||
extern const u8 BattleScript_MimicryActivatesEnd3[];
|
||||
extern const u8 BattleScript_ApplyMimicry[];
|
||||
extern const u8 BattleScript_AttackerFormChangeEnd3NoPopup[];
|
||||
extern const u8 BattleScript_AttackerFormChangeWithStringEnd3NoPopup[];
|
||||
extern const u8 BattleScript_AttackerFormChangeMoveEffect[];
|
||||
extern const u8 BattleScript_BothCanNoLongerEscape[];
|
||||
extern const u8 BattleScript_OctolockEndTurn[];
|
||||
@ -499,7 +504,10 @@ extern const u8 BattleScript_TheSwampDisappeared[];
|
||||
extern const u8 BattleScript_ItemRestoreHP_Party[];
|
||||
extern const u8 BattleScript_EffectPsychicNoise[];
|
||||
extern const u8 BattleScript_AromaVeilProtectsRet[];
|
||||
extern const u8 BattleScript_LowerAtkSpAtk[];
|
||||
extern const u8 BattleScript_Terastallization[];
|
||||
extern const u8 BattleScript_BoosterEnergyEnd2[];
|
||||
extern const u8 BattleScript_TeraShellDistortingTypeMatchups[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
||||
30
include/battle_terastal.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef GUARD_BATTLE_TERASTAL_H
|
||||
#define GUARD_BATTLE_TERASTAL_H
|
||||
|
||||
void PrepareBattlerForTera(u32 battler);
|
||||
bool32 CanTerastallize(u32 battler);
|
||||
u32 GetBattlerTeraType(u32 battler);
|
||||
bool32 IsTerastallized(u32 battler);
|
||||
void ExpendTypeStellarBoost(u32 battler, u32 type);
|
||||
bool32 IsTypeStellarBoosted(u32 battler, u32 type);
|
||||
uq4_12_t GetTeraMultiplier(u32 battler, u32 type);
|
||||
|
||||
u16 GetTeraTypeRGB(u32 type);
|
||||
|
||||
void ChangeTeraTriggerSprite(u8 spriteId, u8 animId);
|
||||
void CreateTeraTriggerSprite(u8 battler, u8 palId);
|
||||
bool32 IsTeraTriggerSpriteActive(void);
|
||||
void HideTeraTriggerSprite(void);
|
||||
void DestroyTeraTriggerSprite(void);
|
||||
|
||||
void TeraIndicator_LoadSpriteGfx(void);
|
||||
bool32 TeraIndicator_ShouldBeInvisible(u32 battler);
|
||||
u8 TeraIndicator_GetSpriteId(u32 healthboxSpriteId);
|
||||
void TeraIndicator_SetVisibilities(u32 healthboxId, bool32 invisible);
|
||||
void TeraIndicator_UpdateOamPriorities(u32 healthboxId, u32 oamPriority);
|
||||
void TeraIndicator_UpdateLevel(u32 healthboxId, u32 level);
|
||||
void TeraIndicator_CreateSprite(u32 battler, u32 healthboxSpriteId);
|
||||
void TeraIndicator_DestroySprite(u32 healthboxSpriteId);
|
||||
void TeraIndicator_UpdateType(u32 battler, u32 healthboxSpriteId);
|
||||
|
||||
#endif
|
||||
@ -251,7 +251,7 @@ bool32 AreBattlersOfOppositeGender(u32 battler1, u32 battler2);
|
||||
bool32 AreBattlersOfSameGender(u32 battler1, u32 battler2);
|
||||
u32 CalcSecondaryEffectChance(u32 battler, u32 battlerAbility, const struct AdditionalEffect *additionalEffect);
|
||||
bool32 MoveEffectIsGuaranteed(u32 battler, u32 battlerAbility, const struct AdditionalEffect *additionalEffect);
|
||||
u8 GetBattlerType(u32 battler, u8 typeIndex);
|
||||
u8 GetBattlerType(u32 battler, u8 typeIndex, bool32 ignoreTera);
|
||||
bool8 CanMonParticipateInSkyBattle(struct Pokemon *mon);
|
||||
bool8 IsMonBannedFromSkyBattles(u16 species);
|
||||
void RemoveBattlerType(u32 battler, u8 type);
|
||||
|
||||
@ -39,10 +39,11 @@
|
||||
#define B_MULTIPLE_TARGETS_DMG GEN_LATEST // In Gen4+, damage dealt by moves that hit multiple targets at once is reduced to 75%. Before, it was 50%.
|
||||
|
||||
// Type settings
|
||||
#define B_EXPANDED_TYPE_NAMES TRUE // If TRUE, type names are increased from 6 characters to 8 characters.
|
||||
#define B_GHOSTS_ESCAPE GEN_LATEST // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle.
|
||||
#define B_PARALYZE_ELECTRIC GEN_LATEST // In Gen6+, Electric-type Pokémon can't be paralyzed.
|
||||
#define B_POWDER_GRASS GEN_LATEST // In Gen6+, Grass-type Pokémon are immune to powder and spore moves.
|
||||
#define B_STEEL_RESISTANCES GEN_LATEST // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves.
|
||||
#define B_UPDATED_TYPE_MATCHUPS GEN_LATEST // Updates Type matchups. Refer to sTypeEffectivenessTable for details.
|
||||
#define B_PRANKSTER_DARK_TYPES GEN_LATEST // In Gen7+, Prankster-elevated status moves do not affect Dark type Pokémon.
|
||||
#define B_SHEER_COLD_IMMUNITY GEN_LATEST // In Gen7+, Ice-types are immune to Sheer Cold
|
||||
#define B_ROOST_PURE_FLYING GEN_LATEST // In Gen5+, Roost makes pure Flying-types into Normal-type.
|
||||
@ -179,6 +180,8 @@
|
||||
#define B_FLAG_NO_CATCHING 0 // If this flag is set, the ability to catch wild Pokémon is disabled.
|
||||
#define B_FLAG_AI_VS_AI_BATTLE 0 // If this flag is set, the player's mons will be controlled by the ai next battles.
|
||||
#define B_FLAG_DYNAMAX_BATTLE 0 // If this flag is set, the ability to Dynamax in battle is enabled for all trainers.
|
||||
#define B_FLAG_TERA_ORB_CHARGED 0 // If this flag is set, the Tera Orb is charged. It is automatically set upon healing and cleared upon Terastallizing once configured.
|
||||
#define B_FLAG_TERA_ORB_NO_COST 0 // If this flag is set, the Tera Orb does not use up its charge upon Terastallization. In S/V, this occurs after an event with Terapagos.
|
||||
|
||||
// Var Settings
|
||||
// To use the following features in scripting, replace the 0s with the var ID you're assigning it to.
|
||||
@ -212,7 +215,7 @@
|
||||
#define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move.
|
||||
#define B_SHOW_CATEGORY_ICON TRUE // If set to TRUE, it will show an icon in the summary showing the move's category.
|
||||
#define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations.
|
||||
#define B_EXPANDED_MOVE_NAMES FALSE // If set to TRUE, move names are increased from 12 characters to 16 characters.
|
||||
#define B_EXPANDED_MOVE_NAMES TRUE // If set to FALSE, move names are decreased from 16 characters to 12 characters.
|
||||
#define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles.
|
||||
#define B_QUICK_MOVE_CURSOR_TO_RUN FALSE // If set to TRUE, pushing B in the battle options against a wild encounter will move the cursor to the run option
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
#define GUARD_CONFIG_ITEM_H
|
||||
|
||||
// Item config
|
||||
#define I_EXPANDED_ITEM_NAMES TRUE // If set to FALSE, item names are decreased from 20 characters to 14 characters.
|
||||
#define I_SHINY_CHARM_ADDITIONAL_ROLLS 2 // Amount of additional shiny rolls if the player has the Shiny Charm. Set it to 0 to disable Shiny Charm's effects.
|
||||
#define I_KEY_FOSSILS GEN_LATEST // In Gen4+, all Gen 3 fossils became regular items.
|
||||
#define I_KEY_ESCAPE_ROPE GEN_LATEST // In Gen8, Escape Rope became a Key Item. Keep in mind, this will make it free to buy in marts.
|
||||
|
||||
13
include/config/test.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef GUARD_CONFIG_TEST_H
|
||||
#define GUARD_CONFIG_TEST_H
|
||||
|
||||
#undef B_EXPANDED_MOVE_NAMES
|
||||
#define B_EXPANDED_MOVE_NAMES TRUE
|
||||
#undef I_EXPANDED_ITEM_NAMES
|
||||
#define I_EXPANDED_ITEM_NAMES TRUE
|
||||
#undef POKEMON_NAME_LENGTH
|
||||
#define POKEMON_NAME_LENGTH 12
|
||||
#undef B_EXPANDED_TYPE_NAMES
|
||||
#define B_EXPANDED_TYPE_NAMES TRUE
|
||||
|
||||
#endif // GUARD_CONFIG_TEST_H
|
||||
@ -326,10 +326,10 @@
|
||||
#define ABILITY_MYCELIUM_MIGHT 298
|
||||
#define ABILITY_HOSPITALITY 299
|
||||
#define ABILITY_MINDS_EYE 300
|
||||
#define ABILITY_EMBODY_ASPECT_TEAL 301
|
||||
#define ABILITY_EMBODY_ASPECT_HEARTHFLAME 302
|
||||
#define ABILITY_EMBODY_ASPECT_WELLSPRING 303
|
||||
#define ABILITY_EMBODY_ASPECT_CORNERSTONE 304
|
||||
#define ABILITY_EMBODY_ASPECT_TEAL_MASK 301
|
||||
#define ABILITY_EMBODY_ASPECT_HEARTHFLAME_MASK 302
|
||||
#define ABILITY_EMBODY_ASPECT_WELLSPRING_MASK 303
|
||||
#define ABILITY_EMBODY_ASPECT_CORNERSTONE_MASK 304
|
||||
#define ABILITY_TOXIC_CHAIN 305
|
||||
#define ABILITY_SUPERSWEET_SYRUP 306
|
||||
#define ABILITY_TERA_SHIFT 307
|
||||
|
||||
@ -299,7 +299,7 @@
|
||||
#define B_WEATHER_HAIL_PERMANENT (1 << 10)
|
||||
#define B_WEATHER_HAIL (B_WEATHER_HAIL_TEMPORARY | B_WEATHER_HAIL_PERMANENT)
|
||||
#define B_WEATHER_STRONG_WINDS (1 << 11)
|
||||
#define B_WEATHER_ANY (B_WEATHER_RAIN | B_WEATHER_SANDSTORM | B_WEATHER_SUN | B_WEATHER_HAIL | B_WEATHER_STRONG_WINDS | B_WEATHER_SNOW)
|
||||
#define B_WEATHER_ANY (B_WEATHER_RAIN | B_WEATHER_SANDSTORM | B_WEATHER_SUN | B_WEATHER_HAIL | B_WEATHER_STRONG_WINDS | B_WEATHER_SNOW | B_WEATHER_FOG)
|
||||
#define B_WEATHER_PRIMAL_ANY (B_WEATHER_RAIN_PRIMAL | B_WEATHER_SUN_PRIMAL | B_WEATHER_STRONG_WINDS)
|
||||
#define B_WEATHER_SNOW_TEMPORARY (1 << 12)
|
||||
#define B_WEATHER_SNOW_PERMANENT (1 << 13)
|
||||
@ -402,8 +402,9 @@
|
||||
#define MOVE_EFFECT_FLORAL_HEALING 77
|
||||
#define MOVE_EFFECT_SECRET_POWER 78
|
||||
#define MOVE_EFFECT_PSYCHIC_NOISE 79
|
||||
#define MOVE_EFFECT_TERA_BLAST 80
|
||||
|
||||
#define NUM_MOVE_EFFECTS 80
|
||||
#define NUM_MOVE_EFFECTS 81
|
||||
|
||||
#define MOVE_EFFECT_AFFECTS_USER 0x2000
|
||||
#define MOVE_EFFECT_CERTAIN 0x4000
|
||||
|
||||
@ -350,6 +350,8 @@ enum {
|
||||
EFFECT_DRAGON_CHEER,
|
||||
EFFECT_LAST_RESPECTS,
|
||||
EFFECT_TIDY_UP,
|
||||
EFFECT_TERA_BLAST,
|
||||
EFFECT_TERA_STARSTORM,
|
||||
NUM_BATTLE_MOVE_EFFECTS,
|
||||
};
|
||||
|
||||
|
||||
@ -131,113 +131,112 @@
|
||||
#define VARIOUS_SET_SIMPLE_BEAM 39
|
||||
#define VARIOUS_TRY_ENTRAINMENT 40
|
||||
#define VARIOUS_SET_LAST_USED_ABILITY 41
|
||||
#define VARIOUS_TRY_QUASH 42
|
||||
#define VARIOUS_INVERT_STAT_STAGES 43
|
||||
#define VARIOUS_TRY_ME_FIRST 44
|
||||
#define VARIOUS_JUMP_IF_BATTLE_END 45
|
||||
#define VARIOUS_TRY_ELECTRIFY 46
|
||||
#define VARIOUS_TRY_REFLECT_TYPE 47
|
||||
#define VARIOUS_TRY_SOAK 48
|
||||
#define VARIOUS_HANDLE_MEGA_EVO 49
|
||||
#define VARIOUS_TRY_LAST_RESORT 50
|
||||
#define VARIOUS_SET_ARG_TO_BATTLE_DAMAGE 51
|
||||
#define VARIOUS_TRY_HIT_SWITCH_TARGET 52
|
||||
#define VARIOUS_TRY_AUTOTOMIZE 53
|
||||
#define VARIOUS_ABILITY_POPUP 54
|
||||
#define VARIOUS_JUMP_IF_TARGET_ALLY 55
|
||||
#define VARIOUS_TRY_SYNCHRONOISE 56
|
||||
#define VARIOUS_PSYCHO_SHIFT 57
|
||||
#define VARIOUS_CURE_STATUS 58
|
||||
#define VARIOUS_POWER_TRICK 59
|
||||
#define VARIOUS_AFTER_YOU 60
|
||||
#define VARIOUS_BESTOW 61
|
||||
#define VARIOUS_JUMP_IF_NOT_GROUNDED 62
|
||||
#define VARIOUS_HANDLE_TRAINER_SLIDE_MSG 63
|
||||
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF 64
|
||||
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON 65
|
||||
#define VARIOUS_SET_AURORA_VEIL 66
|
||||
#define VARIOUS_TRY_THIRD_TYPE 67
|
||||
#define VARIOUS_ACUPRESSURE 68
|
||||
#define VARIOUS_SET_POWDER 69
|
||||
#define VARIOUS_SPECTRAL_THIEF 70
|
||||
#define VARIOUS_GRAVITY_ON_AIRBORNE_MONS 71
|
||||
#define VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS 72
|
||||
#define VARIOUS_JUMP_IF_ROAR_FAILS 73
|
||||
#define VARIOUS_TRY_INSTRUCT 74
|
||||
#define VARIOUS_JUMP_IF_NOT_BERRY 75
|
||||
#define VARIOUS_TRACE_ABILITY 76
|
||||
#define VARIOUS_UPDATE_NICK 77
|
||||
#define VARIOUS_TRY_ILLUSION_OFF 78
|
||||
#define VARIOUS_SET_SPRITEIGNORE0HP 79
|
||||
#define VARIOUS_HANDLE_FORM_CHANGE 80
|
||||
#define VARIOUS_GET_STAT_VALUE 81
|
||||
#define VARIOUS_JUMP_IF_FULL_HP 82
|
||||
#define VARIOUS_LOSE_TYPE 83
|
||||
#define VARIOUS_TRY_ACTIVATE_SOULHEART 84
|
||||
#define VARIOUS_TRY_ACTIVATE_RECEIVER 85
|
||||
#define VARIOUS_TRY_ACTIVATE_BEAST_BOOST 86
|
||||
#define VARIOUS_TRY_FRISK 87
|
||||
#define VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED 88
|
||||
#define VARIOUS_TRY_FAIRY_LOCK 89
|
||||
#define VARIOUS_JUMP_IF_NO_ALLY 90
|
||||
#define VARIOUS_POISON_TYPE_IMMUNITY 91
|
||||
#define VARIOUS_JUMP_IF_HOLD_EFFECT 92
|
||||
#define VARIOUS_INFATUATE_WITH_BATTLER 93
|
||||
#define VARIOUS_SET_LAST_USED_ITEM 94
|
||||
#define VARIOUS_PARALYZE_TYPE_IMMUNITY 95
|
||||
#define VARIOUS_JUMP_IF_ABSENT 96
|
||||
#define VARIOUS_DESTROY_ABILITY_POPUP 97
|
||||
#define VARIOUS_TOTEM_BOOST 98
|
||||
#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 99
|
||||
#define VARIOUS_MOVEEND_ITEM_EFFECTS 100
|
||||
#define VARIOUS_TERRAIN_SEED 101
|
||||
#define VARIOUS_MAKE_INVISIBLE 102
|
||||
#define VARIOUS_ROOM_SERVICE 103
|
||||
#define VARIOUS_EERIE_SPELL_PP_REDUCE 104
|
||||
#define VARIOUS_JUMP_IF_TEAM_HEALTHY 105
|
||||
#define VARIOUS_TRY_HEAL_QUARTER_HP 106
|
||||
#define VARIOUS_REMOVE_TERRAIN 107
|
||||
#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 108
|
||||
#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 109
|
||||
#define VARIOUS_GET_ROTOTILLER_TARGETS 110
|
||||
#define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 111
|
||||
#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 112
|
||||
#define VARIOUS_CONSUME_BERRY 113
|
||||
#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 114
|
||||
#define VARIOUS_JUMP_IF_SPECIES 115
|
||||
#define VARIOUS_UPDATE_ABILITY_POPUP 116
|
||||
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 117
|
||||
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 118
|
||||
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 119
|
||||
#define VARIOUS_SHELL_SIDE_ARM_CHECK 120
|
||||
#define VARIOUS_TRY_NO_RETREAT 121
|
||||
#define VARIOUS_TRY_TAR_SHOT 122
|
||||
#define VARIOUS_CAN_TAR_SHOT_WORK 123
|
||||
#define VARIOUS_CHECK_POLTERGEIST 124
|
||||
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 125
|
||||
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 126
|
||||
#define VARIOUS_JUMP_IF_UNDER_200 127
|
||||
#define VARIOUS_SET_SKY_DROP 128
|
||||
#define VARIOUS_CLEAR_SKY_DROP 129
|
||||
#define VARIOUS_SKY_DROP_YAWN 130
|
||||
#define VARIOUS_CURE_CERTAIN_STATUSES 131
|
||||
#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 132
|
||||
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 133
|
||||
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 134
|
||||
#define VARIOUS_SAVE_BATTLER_ITEM 135
|
||||
#define VARIOUS_RESTORE_BATTLER_ITEM 136
|
||||
#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 137
|
||||
#define VARIOUS_SET_BEAK_BLAST 138
|
||||
#define VARIOUS_SWAP_SIDE_STATUSES 139
|
||||
#define VARIOUS_SWAP_STATS 140
|
||||
#define VARIOUS_TEATIME_INVUL 141
|
||||
#define VARIOUS_TEATIME_TARGETS 142
|
||||
#define VARIOUS_TRY_WIND_RIDER_POWER 143
|
||||
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 144
|
||||
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 145
|
||||
#define VARIOUS_STORE_HEALING_WISH 146
|
||||
#define VARIOUS_HIT_SWITCH_TARGET_FAILED 147
|
||||
#define VARIOUS_TRY_REVIVAL_BLESSING 148
|
||||
#define VARIOUS_INVERT_STAT_STAGES 42
|
||||
#define VARIOUS_TRY_ME_FIRST 43
|
||||
#define VARIOUS_JUMP_IF_BATTLE_END 44
|
||||
#define VARIOUS_TRY_ELECTRIFY 45
|
||||
#define VARIOUS_TRY_REFLECT_TYPE 46
|
||||
#define VARIOUS_TRY_SOAK 47
|
||||
#define VARIOUS_HANDLE_MEGA_EVO 48
|
||||
#define VARIOUS_TRY_LAST_RESORT 49
|
||||
#define VARIOUS_SET_ARG_TO_BATTLE_DAMAGE 50
|
||||
#define VARIOUS_TRY_HIT_SWITCH_TARGET 51
|
||||
#define VARIOUS_TRY_AUTOTOMIZE 52
|
||||
#define VARIOUS_ABILITY_POPUP 53
|
||||
#define VARIOUS_JUMP_IF_TARGET_ALLY 54
|
||||
#define VARIOUS_TRY_SYNCHRONOISE 55
|
||||
#define VARIOUS_PSYCHO_SHIFT 56
|
||||
#define VARIOUS_CURE_STATUS 57
|
||||
#define VARIOUS_POWER_TRICK 58
|
||||
#define VARIOUS_AFTER_YOU 59
|
||||
#define VARIOUS_BESTOW 60
|
||||
#define VARIOUS_JUMP_IF_NOT_GROUNDED 61
|
||||
#define VARIOUS_HANDLE_TRAINER_SLIDE_MSG 62
|
||||
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF 63
|
||||
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON 64
|
||||
#define VARIOUS_SET_AURORA_VEIL 65
|
||||
#define VARIOUS_TRY_THIRD_TYPE 66
|
||||
#define VARIOUS_ACUPRESSURE 67
|
||||
#define VARIOUS_SET_POWDER 68
|
||||
#define VARIOUS_SPECTRAL_THIEF 69
|
||||
#define VARIOUS_GRAVITY_ON_AIRBORNE_MONS 70
|
||||
#define VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS 71
|
||||
#define VARIOUS_JUMP_IF_ROAR_FAILS 72
|
||||
#define VARIOUS_TRY_INSTRUCT 73
|
||||
#define VARIOUS_JUMP_IF_NOT_BERRY 74
|
||||
#define VARIOUS_TRACE_ABILITY 75
|
||||
#define VARIOUS_UPDATE_NICK 76
|
||||
#define VARIOUS_TRY_ILLUSION_OFF 77
|
||||
#define VARIOUS_SET_SPRITEIGNORE0HP 78
|
||||
#define VARIOUS_HANDLE_FORM_CHANGE 79
|
||||
#define VARIOUS_GET_STAT_VALUE 80
|
||||
#define VARIOUS_JUMP_IF_FULL_HP 81
|
||||
#define VARIOUS_LOSE_TYPE 82
|
||||
#define VARIOUS_TRY_ACTIVATE_SOULHEART 83
|
||||
#define VARIOUS_TRY_ACTIVATE_RECEIVER 84
|
||||
#define VARIOUS_TRY_ACTIVATE_BEAST_BOOST 85
|
||||
#define VARIOUS_TRY_FRISK 86
|
||||
#define VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED 87
|
||||
#define VARIOUS_TRY_FAIRY_LOCK 88
|
||||
#define VARIOUS_JUMP_IF_NO_ALLY 89
|
||||
#define VARIOUS_POISON_TYPE_IMMUNITY 90
|
||||
#define VARIOUS_JUMP_IF_HOLD_EFFECT 91
|
||||
#define VARIOUS_INFATUATE_WITH_BATTLER 92
|
||||
#define VARIOUS_SET_LAST_USED_ITEM 93
|
||||
#define VARIOUS_PARALYZE_TYPE_IMMUNITY 94
|
||||
#define VARIOUS_JUMP_IF_ABSENT 95
|
||||
#define VARIOUS_DESTROY_ABILITY_POPUP 96
|
||||
#define VARIOUS_TOTEM_BOOST 97
|
||||
#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 98
|
||||
#define VARIOUS_MOVEEND_ITEM_EFFECTS 99
|
||||
#define VARIOUS_TERRAIN_SEED 100
|
||||
#define VARIOUS_MAKE_INVISIBLE 101
|
||||
#define VARIOUS_ROOM_SERVICE 102
|
||||
#define VARIOUS_EERIE_SPELL_PP_REDUCE 103
|
||||
#define VARIOUS_JUMP_IF_TEAM_HEALTHY 104
|
||||
#define VARIOUS_TRY_HEAL_QUARTER_HP 105
|
||||
#define VARIOUS_REMOVE_TERRAIN 106
|
||||
#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 107
|
||||
#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 108
|
||||
#define VARIOUS_GET_ROTOTILLER_TARGETS 109
|
||||
#define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 110
|
||||
#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 111
|
||||
#define VARIOUS_CONSUME_BERRY 112
|
||||
#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 113
|
||||
#define VARIOUS_JUMP_IF_SPECIES 114
|
||||
#define VARIOUS_UPDATE_ABILITY_POPUP 115
|
||||
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 116
|
||||
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 117
|
||||
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 118
|
||||
#define VARIOUS_SHELL_SIDE_ARM_CHECK 119
|
||||
#define VARIOUS_TRY_NO_RETREAT 120
|
||||
#define VARIOUS_TRY_TAR_SHOT 121
|
||||
#define VARIOUS_CAN_TAR_SHOT_WORK 122
|
||||
#define VARIOUS_CHECK_POLTERGEIST 123
|
||||
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 124
|
||||
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 125
|
||||
#define VARIOUS_JUMP_IF_UNDER_200 126
|
||||
#define VARIOUS_SET_SKY_DROP 127
|
||||
#define VARIOUS_CLEAR_SKY_DROP 128
|
||||
#define VARIOUS_SKY_DROP_YAWN 129
|
||||
#define VARIOUS_CURE_CERTAIN_STATUSES 130
|
||||
#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 131
|
||||
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 132
|
||||
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 133
|
||||
#define VARIOUS_SAVE_BATTLER_ITEM 134
|
||||
#define VARIOUS_RESTORE_BATTLER_ITEM 135
|
||||
#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 136
|
||||
#define VARIOUS_SET_BEAK_BLAST 137
|
||||
#define VARIOUS_SWAP_SIDE_STATUSES 138
|
||||
#define VARIOUS_SWAP_STATS 139
|
||||
#define VARIOUS_TEATIME_INVUL 140
|
||||
#define VARIOUS_TEATIME_TARGETS 141
|
||||
#define VARIOUS_TRY_WIND_RIDER_POWER 142
|
||||
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 143
|
||||
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 144
|
||||
#define VARIOUS_STORE_HEALING_WISH 145
|
||||
#define VARIOUS_HIT_SWITCH_TARGET_FAILED 146
|
||||
#define VARIOUS_TRY_REVIVAL_BLESSING 147
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
|
||||
@ -635,7 +635,7 @@
|
||||
#define STRINGID_SUNLIGHTACTIVATEDABILITY 633
|
||||
#define STRINGID_STATWASHEIGHTENED 634
|
||||
#define STRINGID_ELECTRICTERRAINACTIVATEDABILITY 635
|
||||
#define STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT 636
|
||||
#define STRINGID_ABILITYWEAKENEDSURROUNDINGMONSSTAT 636
|
||||
#define STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN 637
|
||||
#define STRINGID_PKMNSABILITYPREVENTSABILITY 638
|
||||
#define STRINGID_PREPARESHELLTRAP 639
|
||||
@ -707,12 +707,14 @@
|
||||
#define STRINGID_BIZARREARENACREATED 705
|
||||
#define STRINGID_BIZARREAREACREATED 706
|
||||
#define STRINGID_TIDYINGUPCOMPLETE 707
|
||||
#define STRINGID_BOOSTERENERGYACTIVATES 708
|
||||
#define STRINGID_FOGCREPTUP 709
|
||||
#define STRINGID_FOGISDEEP 710
|
||||
#define STRINGID_FOGLIFTED 711
|
||||
#define STRINGID_PKMNTERASTALLIZEDINTO 708
|
||||
#define STRINGID_BOOSTERENERGYACTIVATES 709
|
||||
#define STRINGID_FOGCREPTUP 710
|
||||
#define STRINGID_FOGISDEEP 711
|
||||
#define STRINGID_FOGLIFTED 712
|
||||
#define STRINGID_PKMNMADESHELLGLEAM 713
|
||||
|
||||
#define BATTLESTRINGS_COUNT 712
|
||||
#define BATTLESTRINGS_COUNT 714
|
||||
|
||||
// This is the string id that gBattleStringsTable starts with.
|
||||
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
||||
@ -766,6 +768,16 @@
|
||||
#define B_MSG_STARTED_SNOW 6
|
||||
#define B_MSG_STARTED_FOG 7
|
||||
|
||||
// gWeatherEndsStringIds
|
||||
#define B_MSG_WEATHER_END_RAIN 0
|
||||
#define B_MSG_WEATHER_END_SANDSTORM 1
|
||||
#define B_MSG_WEATHER_END_SUN 2
|
||||
#define B_MSG_WEATHER_END_HAIL 3
|
||||
#define B_MSG_WEATHER_END_STRONG_WINDS 4
|
||||
#define B_MSG_WEATHER_END_SNOW 5
|
||||
#define B_MSG_WEATHER_END_FOG 6
|
||||
#define B_MSG_WEATHER_END_COUNT 7
|
||||
|
||||
// gRainContinuesStringIds
|
||||
#define B_MSG_RAIN_CONTINUES 0
|
||||
#define B_MSG_DOWNPOUR_CONTINUES 1
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
#ifndef GUARD_CONSTANTS_EXPANSION_H
|
||||
#define GUARD_CONSTANTS_EXPANSION_H
|
||||
|
||||
// 1.8.2
|
||||
// 1.8.3
|
||||
#define EXPANSION_VERSION_MAJOR 1
|
||||
#define EXPANSION_VERSION_MINOR 8
|
||||
#define EXPANSION_VERSION_PATCH 2
|
||||
#define EXPANSION_VERSION_PATCH 3
|
||||
|
||||
// FALSE if this this version of Expansion is not a tagged commit, i.e.
|
||||
// it contains unreleased changes.
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
#define FORM_CHANGE_END_BATTLE_TERRAIN 8
|
||||
|
||||
// Form change that activates when the Pokémon is switched out in battle.
|
||||
// - No parameters.
|
||||
// param1: ability to check, optional
|
||||
#define FORM_CHANGE_BATTLE_SWITCH 9
|
||||
|
||||
// Form change that activates when the Pokémon's HP % passes a certain threshold.
|
||||
|
||||
@ -102,9 +102,10 @@
|
||||
#define CONTEST_CATEGORIES_COUNT 5
|
||||
|
||||
// string lengths
|
||||
#define ITEM_NAME_LENGTH 14
|
||||
#define ITEM_NAME_LENGTH ((I_EXPANDED_ITEM_NAMES == TRUE) ? 20 : 14)
|
||||
#define ITEM_NAME_PLURAL_LENGTH ITEM_NAME_LENGTH + 2 // 2 is used for the instance where a word's suffix becomes y->ies
|
||||
#define POKEMON_NAME_LENGTH 10
|
||||
#define POKEMON_NAME_LENGTH 12
|
||||
#define VANILLA_POKEMON_NAME_LENGTH 10
|
||||
#define POKEMON_NAME_BUFFER_SIZE max(20, POKEMON_NAME_LENGTH + 1) // Frequently used buffer size. Larger than necessary
|
||||
#define PLAYER_NAME_LENGTH 7
|
||||
#define MAIL_WORDS_COUNT 9
|
||||
@ -116,7 +117,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 TYPE_NAME_LENGTH ((B_EXPANDED_TYPE_NAMES == TRUE) ? 8 : 6)
|
||||
#define ABILITY_NAME_LENGTH ((B_EXPANDED_ABILITY_NAMES == TRUE) ? 16 : 12)
|
||||
#define TRAINER_NAME_LENGTH 10
|
||||
|
||||
@ -170,4 +171,8 @@
|
||||
#define CONNECTION_DIVE 5
|
||||
#define CONNECTION_EMERGE 6
|
||||
|
||||
#if TESTING
|
||||
#include "config/test.h"
|
||||
#endif
|
||||
|
||||
#endif // GUARD_CONSTANTS_GLOBAL_H
|
||||
|
||||
@ -22,7 +22,8 @@
|
||||
#define TYPE_DRAGON 16
|
||||
#define TYPE_DARK 17
|
||||
#define TYPE_FAIRY 18
|
||||
#define NUMBER_OF_MON_TYPES 19
|
||||
#define TYPE_STELLAR 19
|
||||
#define NUMBER_OF_MON_TYPES 20
|
||||
|
||||
// Pokémon egg groups
|
||||
#define EGG_GROUP_NONE 0
|
||||
|
||||
@ -82,6 +82,7 @@ struct TrainerMon
|
||||
bool8 gender:2;
|
||||
bool8 isShiny:1;
|
||||
u8 dynamaxLevel:4;
|
||||
u8 teraType:5;
|
||||
bool8 gigantamaxFactor:1;
|
||||
bool8 shouldDynamax:1;
|
||||
bool8 shouldTerastal:1;
|
||||
@ -119,6 +120,7 @@ struct TypeInfo
|
||||
u8 palette;
|
||||
u16 zMove;
|
||||
u16 maxMove;
|
||||
const u32 *const paletteTMHM;
|
||||
//u16 enhanceItem;
|
||||
//u16 berry;
|
||||
//u16 gem;
|
||||
@ -206,14 +208,14 @@ static inline const u8 GetTrainerClassFromId(u16 trainerId)
|
||||
static inline const u8 *GetTrainerClassNameFromId(u16 trainerId)
|
||||
{
|
||||
if (trainerId > TRAINER_PARTNER(PARTNER_NONE))
|
||||
return gTrainerClasses[gBattlePartners[trainerId].trainerClass].name;
|
||||
return gTrainerClasses[gBattlePartners[trainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerClass].name;
|
||||
return gTrainerClasses[GetTrainerClassFromId(trainerId)].name;
|
||||
}
|
||||
|
||||
static inline const u8 *GetTrainerNameFromId(u16 trainerId)
|
||||
{
|
||||
if (trainerId > TRAINER_PARTNER(PARTNER_NONE))
|
||||
return gBattlePartners[trainerId].trainerName;
|
||||
return gBattlePartners[trainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerName;
|
||||
return gTrainers[SanitizeTrainerId(trainerId)].trainerName;
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ struct RecordMixingDaycareMail
|
||||
bool16 cantHoldItem[DAYCARE_MON_COUNT];
|
||||
};
|
||||
|
||||
u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest);
|
||||
u8 *GetMonNicknameVanilla(struct Pokemon *mon, u8 *dest);
|
||||
u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest);
|
||||
u8 CountPokemonInDaycare(struct DayCare *daycare);
|
||||
void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *mixMail);
|
||||
|
||||
@ -15,5 +15,11 @@ extern const u16 gFontNarrowLatinGlyphs[];
|
||||
extern const u8 gFontNarrowLatinGlyphWidths[];
|
||||
extern const u16 gFontSmallNarrowLatinGlyphs[];
|
||||
extern const u8 gFontSmallNarrowLatinGlyphWidths[];
|
||||
extern const u8 gFontNarrowerLatinGlyphWidths[];
|
||||
extern const u16 gFontNarrowerLatinGlyphs[];
|
||||
extern const u8 gFontSmallNarrowerLatinGlyphWidths[];
|
||||
extern const u16 gFontSmallNarrowerLatinGlyphs[];
|
||||
extern const u8 gFontShortNarrowLatinGlyphWidths[];
|
||||
extern const u16 gFontShortNarrowLatinGlyphs[];
|
||||
|
||||
#endif // GUARD_FONTS_H
|
||||
|
||||
@ -25,6 +25,4 @@ u8 GetFrontierBrainMonNature(u8 monId);
|
||||
u8 GetFrontierBrainMonEvs(u8 monId, u8 evStatId);
|
||||
s32 GetFronterBrainSymbol(void);
|
||||
|
||||
extern const u16 gFrontierBannedSpecies[];
|
||||
|
||||
#endif // GUARD_FRONTIER_UTIL_H
|
||||
|
||||
@ -288,7 +288,7 @@ struct BattleTowerPokemon
|
||||
u32 gap:1;
|
||||
u32 abilityNum:1;
|
||||
u32 personality;
|
||||
u8 nickname[POKEMON_NAME_LENGTH + 1];
|
||||
u8 nickname[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
u8 friendship;
|
||||
};
|
||||
|
||||
@ -313,7 +313,7 @@ struct BattleTowerInterview
|
||||
u16 playerSpecies;
|
||||
u16 opponentSpecies;
|
||||
u8 opponentName[PLAYER_NAME_LENGTH + 1];
|
||||
u8 opponentMonNickname[POKEMON_NAME_LENGTH + 1];
|
||||
u8 opponentMonNickname[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
u8 opponentLanguage;
|
||||
};
|
||||
|
||||
@ -747,7 +747,7 @@ struct ContestWinner
|
||||
u32 trainerId;
|
||||
u16 species;
|
||||
u8 contestCategory;
|
||||
u8 monName[POKEMON_NAME_LENGTH + 1];
|
||||
u8 monName[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
u8 trainerName[PLAYER_NAME_LENGTH + 1];
|
||||
u8 contestRank:7;
|
||||
bool8 isShiny:1;
|
||||
@ -767,7 +767,7 @@ struct DaycareMail
|
||||
{
|
||||
struct Mail message;
|
||||
u8 otName[PLAYER_NAME_LENGTH + 1];
|
||||
u8 monName[POKEMON_NAME_LENGTH + 1];
|
||||
u8 monName[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
u8 gameLanguage:4;
|
||||
u8 monLanguage:4;
|
||||
};
|
||||
|
||||
@ -82,7 +82,7 @@ typedef union // size = 0x24
|
||||
/*0x00*/ u8 kind;
|
||||
/*0x01*/ bool8 active;
|
||||
/*0x02*/ u16 species;
|
||||
/*0x04*/ u8 pokemonName[POKEMON_NAME_LENGTH + 1];
|
||||
/*0x04*/ u8 pokemonName[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
/*0x0F*/ u8 trainerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x17*/ u8 unused[3];
|
||||
/*0x1A*/ u8 random;
|
||||
@ -98,7 +98,7 @@ typedef union // size = 0x24
|
||||
/*0x01*/ bool8 active;
|
||||
/*0x02*/ u16 species;
|
||||
/*0x04*/ u16 words[2];
|
||||
/*0x08*/ u8 pokemonNickname[POKEMON_NAME_LENGTH + 1];
|
||||
/*0x08*/ u8 pokemonNickname[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
/*0x13*/ u8 contestCategory:3;
|
||||
u8 contestRank:2;
|
||||
u8 contestResult:2;
|
||||
@ -196,7 +196,7 @@ typedef union // size = 0x24
|
||||
/*0x01*/ bool8 active;
|
||||
/*0x02*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x0A*/ u8 contestCategory;
|
||||
/*0x0B*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
|
||||
/*0x0B*/ u8 nickname[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
/*0x16*/ u8 pokeblockState;
|
||||
/*0x17*/ u8 language;
|
||||
/*0x18*/ u8 pokemonNameLanguage;
|
||||
@ -209,7 +209,7 @@ typedef union // size = 0x24
|
||||
/*0x01*/ bool8 active;
|
||||
/*0x02*/ u8 language;
|
||||
/*0x03*/ u8 language2;
|
||||
/*0x04*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
|
||||
/*0x04*/ u8 nickname[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
/*0x0F*/ u8 ball;
|
||||
/*0x10*/ u16 species;
|
||||
/*0x12*/ u8 nBallsUsed;
|
||||
@ -409,7 +409,7 @@ typedef union // size = 0x24
|
||||
/*0x01*/ bool8 active;
|
||||
/*0x02*/ u8 nRibbons;
|
||||
/*0x03*/ u8 selectedRibbon;
|
||||
/*0x04*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
|
||||
/*0x04*/ u8 nickname[VANILLA_POKEMON_NAME_LENGTH + 1];
|
||||
/*0x0F*/ u8 language;
|
||||
/*0x10*/ u8 pokemonNameLanguage;
|
||||
/*0x11*/ u8 filler_12[2];
|
||||
|
||||
@ -37,8 +37,8 @@ extern struct BagPocket gBagPockets[];
|
||||
void ApplyNewEncryptionKeyToBagItems(u32 newKey);
|
||||
void ApplyNewEncryptionKeyToBagItems_(u32 newKey);
|
||||
void SetBagItemsPointers(void);
|
||||
void CopyItemName(u16 itemId, u8 *dst);
|
||||
void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity);
|
||||
u8 *CopyItemName(u16 itemId, u8 *dst);
|
||||
u8 *CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity);
|
||||
bool8 IsBagPocketNonEmpty(u8 pocket);
|
||||
bool8 CheckBagHasItem(u16 itemId, u16 count);
|
||||
bool8 HasAtLeastOneBerry(void);
|
||||
|
||||
@ -40,8 +40,9 @@ struct ListMenuTemplate
|
||||
const struct ListMenuItem *items;
|
||||
void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list);
|
||||
void (* itemPrintFunc)(u8 windowId, u32 itemId, u8 y);
|
||||
u16 totalItems;
|
||||
u16 maxShowed;
|
||||
u16 totalItems:12;
|
||||
u16 maxShowed:12;
|
||||
u16 textNarrowWidth:8;
|
||||
u8 windowId;
|
||||
u8 header_X;
|
||||
u8 item_X;
|
||||
|
||||
@ -28,6 +28,7 @@ enum {
|
||||
MON_DATA_HP_LOST,
|
||||
MON_DATA_ENCRYPT_SEPARATOR,
|
||||
MON_DATA_NICKNAME,
|
||||
MON_DATA_NICKNAME10,
|
||||
MON_DATA_SPECIES,
|
||||
MON_DATA_HELD_ITEM,
|
||||
MON_DATA_MOVE1,
|
||||
@ -424,8 +425,8 @@ struct SpeciesInfo /*0x8C*/
|
||||
/* 0x7A */ u32 isLegendary:1;
|
||||
u32 isMythical:1;
|
||||
u32 isUltraBeast:1;
|
||||
u32 isParadox:1;
|
||||
u32 isTotem:1;
|
||||
u32 isParadoxForm:1;
|
||||
u32 isMegaEvolution:1;
|
||||
u32 isPrimalReversion:1;
|
||||
u32 isUltraBurst:1;
|
||||
@ -437,8 +438,9 @@ struct SpeciesInfo /*0x8C*/
|
||||
u32 cannotBeTraded:1;
|
||||
u32 allPerfectIVs:1;
|
||||
u32 dexForceRequired:1; // This species will be taken into account for Pokédex ratings even if they have the "isMythical" flag set.
|
||||
u32 tmIlliterate:1; // This species will be unable to learn the universal moves.
|
||||
u32 padding4:15;
|
||||
u32 tmIlliterate:1; // This species will be unable to learn the universal moves.
|
||||
u32 isFrontierBanned:1; // This species is not allowed to participate in Battle Frontier facilities.
|
||||
u32 padding4:14;
|
||||
// Move Data
|
||||
/* 0x80 */ const struct LevelUpMove *levelUpLearnset;
|
||||
/* 0x84 */ const u16 *teachableLearnset;
|
||||
@ -664,8 +666,6 @@ void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot);
|
||||
void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot);
|
||||
void GiveMonInitialMoveset(struct Pokemon *mon);
|
||||
void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon);
|
||||
void GiveMonInitialMoveset_Fast(struct Pokemon *mon);
|
||||
void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon);
|
||||
u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove);
|
||||
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
|
||||
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
|
||||
|
||||
@ -935,6 +935,8 @@ struct MoveContext
|
||||
// TODO: u8 zMove:1;
|
||||
u16 dynamax:1;
|
||||
u16 explicitDynamax:1;
|
||||
u16 tera:1;
|
||||
u16 explicitTera:1;
|
||||
u16 allowed:1;
|
||||
u16 explicitAllowed:1;
|
||||
u16 notExpected:1; // Has effect only with EXPECT_MOVE
|
||||
|
||||
@ -215,6 +215,8 @@ static inline struct Benchmark BenchmarkStop(void)
|
||||
|
||||
#define PARAMETRIZE if (gFunctionTestRunnerState->parameters++ == gFunctionTestRunnerState->runParameter)
|
||||
|
||||
#define PARAMETRIZE_LABEL(f, label) if (gFunctionTestRunnerState->parameters++ == gFunctionTestRunnerState->runParameter && (MgbaPrintf_(":N%s: " f " (%d/%d)", gTestRunnerState.test->name, label, gFunctionTestRunnerState->runParameter + 1, gFunctionTestRunnerState->parameters), 1))
|
||||
|
||||
#define TO_DO \
|
||||
do { \
|
||||
Test_ExpectedResult(TEST_RESULT_TODO); \
|
||||
|
||||
319
migration_scripts/convert_partner_parties.py
Normal file
@ -0,0 +1,319 @@
|
||||
# If you have extra members in 'TrainerMon':
|
||||
# 1. Add a regular expression which matches that member (e.g. 'shadow_definition').
|
||||
# 2. Match that regular expression in 'convert' and write into 'attributes' with the key that 'trainerproc' should parse.
|
||||
# 3. Add the key used in 'attributes' to 'pokemon_attribute_order'.
|
||||
# 4. Update 'trainerproc.c' to parse the new key.
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
is_blank = re.compile(r'^[ \t]*(//.*)?$')
|
||||
|
||||
begin_party_definition = re.compile(r'struct TrainerMon (\w+)\[\] =')
|
||||
end_party_definition = re.compile(r'^};')
|
||||
begin_pokemon_definition = re.compile(r'^ { *$')
|
||||
end_pokemon_definition = re.compile(r'^ },? *$')
|
||||
level_definition = re.compile(r'\.lvl = (\d+)')
|
||||
species_definition = re.compile(r'\.species = SPECIES_(\w+)')
|
||||
gender_definition = re.compile(r'\.gender = TRAINER_MON_(\w+)')
|
||||
nickname_definition = re.compile(r'\.nickname = COMPOUND_STRING\("([^"]+)"\)')
|
||||
item_definition = re.compile(r'\.heldItem = ITEM_(\w+)')
|
||||
ball_definition = re.compile(r'\.ball = ITEM_(\w+)')
|
||||
ability_definition = re.compile(r'\.ability = ABILITY_(\w+)')
|
||||
friendship_definition = re.compile(r'\.friendship = (\d+)')
|
||||
shiny_definition = re.compile(r'\.isShiny = (\w+)')
|
||||
ivs_definition = re.compile(r'\.iv = TRAINER_PARTY_IVS\(([0-9 ]+),([0-9 ]+),([0-9 ]+),([0-9 ]+),([0-9 ]+),([0-9 ]+)\)')
|
||||
evs_definition = re.compile(r'\.ev = TRAINER_PARTY_EVS\(([0-9 ]+),([0-9 ]+),([0-9 ]+),([0-9 ]+),([0-9 ]+),([0-9 ]+)\)')
|
||||
moves_definition = re.compile(r'\.moves = \{([^}]+)\}')
|
||||
move_definition = re.compile(r'MOVE_(\w+)')
|
||||
nature_definition = re.compile(r'\.nature = NATURE_(\w+)')
|
||||
|
||||
# NOTE: These are just for aesthetics, the Pokemon would still compile
|
||||
# without them.
|
||||
species_replacements = {
|
||||
"CHIEN_PAO": "Chien-Pao",
|
||||
"CHI_YU": "Chi-Yu",
|
||||
"HAKAMO_O": "Hakamo-o",
|
||||
"HO_OH": "Ho-Oh",
|
||||
"JANGMO_O": "Jangmo-o",
|
||||
"KOMMO_O": "Kommo-o",
|
||||
"PORYGON_Z": "Porygon-Z",
|
||||
"ROTOM_": "Rotom-",
|
||||
"TING_LU": "Ting-Lu",
|
||||
"TYPE_NULL": "Type: Null",
|
||||
"WO_CHIEN": "Wo-Chien",
|
||||
|
||||
"_ALOLAN": "-Alola",
|
||||
"_AQUA_BREED": "-Aqua",
|
||||
"_BATTLE_BOND": "-Bond",
|
||||
"_BLAZE_BREED": "-Blaze",
|
||||
"_CAP": "",
|
||||
"_CLOAK": "",
|
||||
"_COMBAT_BREED": "-Combat",
|
||||
"_CROWED_SHIELD": "-Crowned",
|
||||
"_CROWED_SWORD": "-Crowned",
|
||||
"_DRIVE": "",
|
||||
"_EAST_SEA": "-East",
|
||||
"_FAMILY_OF_FOUR": "-Four",
|
||||
"_FEMALE": "-F",
|
||||
"_FLOWER": "",
|
||||
"_GALARIAN": "-Galar",
|
||||
"_GIGANTAMAX": "-Gmax",
|
||||
"_HISUIAN": "-Hisui",
|
||||
"_ICE_RIDER": "-Ice",
|
||||
"_NOICE_FACE": "-Noice",
|
||||
"_ORIGIN": "-Origin",
|
||||
"_ORIGINAL_COLOR": "-Original",
|
||||
"_PALDEAN": "-Paldea",
|
||||
"_PLUMAGE": "",
|
||||
"_POKE_BALL": "-Pokeball",
|
||||
"_SHADOW_RIDER": "-Shadow",
|
||||
"_STRIKE_STYLE": "-Style",
|
||||
"_TOTEM": "-Totem",
|
||||
"_ZEN_MODE": "-Zen",
|
||||
}
|
||||
|
||||
pokemon_attribute_order = ['Level', 'Ability', 'IVs', 'EVs', 'Happiness', 'Shiny', 'Ball']
|
||||
|
||||
class Pokemon:
|
||||
def __init__(self):
|
||||
self.nickname = None
|
||||
self.species = None
|
||||
self.gender = None
|
||||
self.item = None
|
||||
self.nature = None
|
||||
self.attributes = {}
|
||||
self.attributes['IVs'] = "0 HP / 0 Atk / 0 Def / 0 SpA / 0 SpD / 0 Spe"
|
||||
self.moves = []
|
||||
|
||||
def convert_parties(in_path, in_h):
|
||||
party_identifier = None
|
||||
party = None
|
||||
pokemon = None
|
||||
parties = {}
|
||||
|
||||
for line_no, line in enumerate(in_h, 1):
|
||||
try:
|
||||
line = line[:-1]
|
||||
if m := begin_party_definition.search(line):
|
||||
if party:
|
||||
raise Exception(f"unexpected start of party")
|
||||
[identifier] = m.groups()
|
||||
party_identifier = identifier
|
||||
party = []
|
||||
elif end_party_definition.search(line):
|
||||
if not party:
|
||||
raise Exception(f"unexpected end of party")
|
||||
parties[party_identifier] = party
|
||||
party = None
|
||||
elif begin_pokemon_definition.search(line):
|
||||
if pokemon:
|
||||
raise Exception(f"unexpected start of Pokemon")
|
||||
pokemon = Pokemon()
|
||||
elif end_pokemon_definition.search(line):
|
||||
if not pokemon:
|
||||
raise Exception(f"unexpected end of Pokemon")
|
||||
else:
|
||||
party.append(pokemon)
|
||||
pokemon = None
|
||||
elif m := level_definition.search(line):
|
||||
[level] = m.groups()
|
||||
pokemon.attributes['Level'] = level
|
||||
elif m := species_definition.search(line):
|
||||
[species_] = m.groups()
|
||||
for match, replacement in species_replacements.items():
|
||||
species_ = species_.replace(match, replacement)
|
||||
pokemon.species = species_.replace("_", " ").title()
|
||||
elif m := gender_definition.search(line):
|
||||
[gender_] = m.groups()
|
||||
if gender_ == 'MALE':
|
||||
pokemon.gender = 'M'
|
||||
elif gender_ == 'FEMALE':
|
||||
pokemon.gender = 'F'
|
||||
else:
|
||||
raise Exception(f"unknown gender: '{gender_}'")
|
||||
elif m := nickname_definition.search(line):
|
||||
[nickname] = m.groups()
|
||||
pokemon.nickname = nickname
|
||||
elif m := item_definition.search(line):
|
||||
[item_] = m.groups()
|
||||
pokemon.item = item_.replace("_", " ").title()
|
||||
elif m := ball_definition.search(line):
|
||||
[ball] = m.groups()
|
||||
pokemon.attributes['Ball'] = ball.replace("_", " ").title()
|
||||
elif m := ability_definition.search(line):
|
||||
[ability] = m.groups()
|
||||
pokemon.attributes['Ability'] = ability.replace("_", " ").title()
|
||||
elif m := friendship_definition.search(line):
|
||||
[friendship] = m.groups()
|
||||
pokemon.attributes['Happiness'] = friendship
|
||||
elif m := shiny_definition.search(line):
|
||||
[shiny] = m.groups()
|
||||
if shiny == 'TRUE':
|
||||
pokemon.attributes['Shiny'] = 'Yes'
|
||||
elif shiny == 'FALSE':
|
||||
pokemon.attributes['Shiny'] = 'No'
|
||||
else:
|
||||
raise Exception(f"unknown isShiny: '{shiny}'")
|
||||
elif m := ivs_definition.search(line):
|
||||
[hp, attack, defense, speed, special_attack, special_defense] = [stat.strip() for stat in m.groups()]
|
||||
stats = {"HP": hp, "Atk": attack, "Def": defense, "SpA": special_attack, "SpD": special_defense, "Spe": speed}
|
||||
pokemon.attributes['IVs'] = ' / '.join(f"{value} {key}" for key, value in stats.items())
|
||||
elif m := evs_definition.search(line):
|
||||
[hp, attack, defense, speed, special_attack, special_defense] = [stat.strip() for stat in m.groups()]
|
||||
stats = {"HP": hp, "Atk": attack, "Def": defense, "SpA": special_attack, "SpD": special_defense, "Spe": speed}
|
||||
pokemon.attributes['EVs'] = ' / '.join(f"{value} {key}" for key, value in stats.items() if value != '0')
|
||||
elif m := moves_definition.search(line):
|
||||
[moves_] = m.groups()
|
||||
pokemon.moves = [move.replace("_", " ").title() for move in move_definition.findall(moves_) if move != "NONE"]
|
||||
elif m := nature_definition.search(line):
|
||||
[nature_] = m.groups()
|
||||
pokemon.nature = nature_.replace("_", " ").title()
|
||||
elif is_blank.search(line):
|
||||
pass
|
||||
else:
|
||||
raise Exception(f"could not parse '{line.strip()}'")
|
||||
except Exception as e:
|
||||
print(f"{in_path}:{line_no}: {e}")
|
||||
return parties
|
||||
|
||||
is_trainer_skip = re.compile(r'(const struct Trainer gBattlePartners\[\] = \{)|(^ \{$)|(\.partySize =)|(\.party = NULL)|(\.mugshotEnabled = TRUE)|(\};)')
|
||||
|
||||
begin_trainer_definition = re.compile(r' \[(PARTNER_\w+)\] =')
|
||||
end_trainer_definition = re.compile(r' }')
|
||||
trainer_class_definition = re.compile(r'\.trainerClass = TRAINER_CLASS_(\w+)')
|
||||
encounter_music_gender_definition = re.compile(r'\.encounterMusic_gender = (F_TRAINER_FEMALE \| )?TRAINER_ENCOUNTER_MUSIC_(\w+)')
|
||||
trainer_pic_definition = re.compile(r'\.trainerPic = TRAINER_BACK_PIC_(\w+)')
|
||||
trainer_name_definition = re.compile(r'\.trainerName = _\("([^"]*)"\)')
|
||||
trainer_items_definition = re.compile(r'\.items = \{([^}]*)\}')
|
||||
trainer_item_definition = re.compile(r'ITEM_(\w+)')
|
||||
trainer_ai_flags_definition = re.compile(r'\.aiFlags = (.*)')
|
||||
trainer_ai_flag_definition = re.compile(r'AI_FLAG_(\w+)')
|
||||
trainer_party_definition = re.compile(r'\.party = TRAINER_PARTY\((\w+)\)')
|
||||
trainer_mugshot_definition = re.compile(r'\.mugshotColor = MUGSHOT_COLOR_(\w+)')
|
||||
trainer_starting_status_definition = re.compile(r'\.startingStatus = STARTING_STATUS_(\w+)')
|
||||
|
||||
class_fixups = {
|
||||
"Rs": "RS",
|
||||
}
|
||||
|
||||
pic_fixups = {
|
||||
"Rs": "RS",
|
||||
}
|
||||
|
||||
class Trainer:
|
||||
def __init__(self, id_):
|
||||
self.id = id_
|
||||
self.class_ = None
|
||||
self.encounter_music = None
|
||||
self.gender = None
|
||||
self.pic = None
|
||||
self.name = None
|
||||
self.items = []
|
||||
self.ai_flags = None
|
||||
self.mugshot = None
|
||||
self.starting_status = None
|
||||
self.party = None
|
||||
|
||||
def convert_trainers(in_path, in_h, parties, out_party):
|
||||
newlines = 0
|
||||
trainer = None
|
||||
for line_no, line in enumerate(in_h, 1):
|
||||
try:
|
||||
line = line[:-1]
|
||||
if m := begin_trainer_definition.search(line):
|
||||
if trainer:
|
||||
raise Exception(f"unexpected start of trainer")
|
||||
[id_] = m.groups()
|
||||
trainer = Trainer(id_)
|
||||
elif m := trainer_class_definition.search(line):
|
||||
[class_] = m.groups()
|
||||
class_ = class_.replace("_", " ").title()
|
||||
for match, replacement in class_fixups.items():
|
||||
class_ = class_.replace(match, replacement)
|
||||
trainer.class_ = class_
|
||||
elif m := encounter_music_gender_definition.search(line):
|
||||
[is_female, music] = m.groups()
|
||||
trainer.gender = 'Female' if is_female else 'Male'
|
||||
trainer.encounter_music = music.replace("_", " ").title()
|
||||
elif m := trainer_pic_definition.search(line):
|
||||
[pic] = m.groups()
|
||||
pic = pic.replace("_", " ").title()
|
||||
for match, replacement in pic_fixups.items():
|
||||
pic = pic.replace(match, replacement)
|
||||
trainer.pic = pic
|
||||
elif m := trainer_name_definition.search(line):
|
||||
[name] = m.groups()
|
||||
trainer.name = name
|
||||
elif m := trainer_items_definition.search(line):
|
||||
[items] = m.groups()
|
||||
trainer.items = " / ".join(item.replace("_", " ").title() for item in trainer_item_definition.findall(items) if item != "NONE")
|
||||
elif m := trainer_ai_flags_definition.search(line):
|
||||
[ai_flags] = m.groups()
|
||||
trainer.ai_flags = " / ".join(ai_flag.replace("_", " ").title() for ai_flag in trainer_ai_flag_definition.findall(ai_flags))
|
||||
elif m := trainer_mugshot_definition.search(line):
|
||||
[color] = m.groups()
|
||||
trainer.mugshot = color.title()
|
||||
elif m := trainer_starting_status_definition.search(line):
|
||||
[starting_status] = m.groups()
|
||||
trainer.starting_status = starting_status.replace("_", " ").title()
|
||||
elif m := trainer_party_definition.search(line):
|
||||
[party] = m.groups()
|
||||
trainer.party = parties[party]
|
||||
elif end_trainer_definition.search(line):
|
||||
if not trainer:
|
||||
raise Exception(f"unexpected end of trainer")
|
||||
while newlines > 0:
|
||||
out_party.write(f"\n")
|
||||
newlines -= 1
|
||||
newlines = 1
|
||||
out_party.write(f"=== {trainer.id} ===\n")
|
||||
out_party.write(f"Name: {trainer.name}\n")
|
||||
out_party.write(f"Class: {trainer.class_}\n")
|
||||
out_party.write(f"Pic: {trainer.pic}\n")
|
||||
out_party.write(f"Gender: {trainer.gender}\n")
|
||||
out_party.write(f"Music: {trainer.encounter_music}\n")
|
||||
if trainer.items:
|
||||
out_party.write(f"Items: {trainer.items}\n")
|
||||
if trainer.ai_flags:
|
||||
out_party.write(f"AI: {trainer.ai_flags}\n")
|
||||
if trainer.mugshot:
|
||||
out_party.write(f"Mugshot: {trainer.mugshot}\n")
|
||||
if trainer.starting_status:
|
||||
out_party.write(f"Starting Status: {trainer.starting_status}\n")
|
||||
if trainer.party:
|
||||
for i, pokemon in enumerate(trainer.party):
|
||||
out_party.write(f"\n")
|
||||
if pokemon.nickname:
|
||||
out_party.write(f"{pokemon.nickname} ({pokemon.species})")
|
||||
else:
|
||||
out_party.write(f"{pokemon.species}")
|
||||
if pokemon.gender:
|
||||
out_party.write(f" ({pokemon.gender})")
|
||||
if pokemon.item and pokemon.item != 'None':
|
||||
out_party.write(f" @ {pokemon.item}")
|
||||
out_party.write(f"\n")
|
||||
if pokemon.nature:
|
||||
out_party.write(f"{pokemon.nature} Nature\n")
|
||||
for key in pokemon_attribute_order:
|
||||
if key in pokemon.attributes:
|
||||
out_party.write(f"{key}: {pokemon.attributes[key]}\n")
|
||||
for move in pokemon.moves:
|
||||
out_party.write(f"- {move}\n")
|
||||
trainer = None
|
||||
elif is_blank.search(line) or is_trainer_skip.search(line):
|
||||
pass
|
||||
else:
|
||||
raise Exception(f"could not parse '{line.strip()}'")
|
||||
except Exception as e:
|
||||
print(f"{in_path}:{line_no}: {e}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
[argv0, trainers_in_path, parties_in_path, out_path] = sys.argv
|
||||
except:
|
||||
print(f"usage: python3 {sys.argv[0]} <trainers.h> <trainer_parties.h> <out>")
|
||||
else:
|
||||
with open(trainers_in_path, "r") as trainers_in_h, open(parties_in_path, "r") as parties_in_h, open(out_path, "w") as out_party:
|
||||
parties = convert_parties(parties_in_path, parties_in_h)
|
||||
trainers = convert_trainers(trainers_in_path, trainers_in_h, parties, out_party)
|
||||