Merge remote-tracking branch '_RHH_origin/upcoming' into _RHH/pr/upcoming/merrpFollowers
# Conflicts: # include/data.h # src/data/graphics/pokemon.h # src/data/pokemon/species_info.h # src/data/pokemon/species_info/gen_1_families.h # src/data/pokemon/species_info/gen_2_families.h # src/data/pokemon/species_info/gen_3_families.h # src/data/pokemon/species_info/gen_4_families.h # src/data/pokemon/species_info/gen_5_families.h # src/data/pokemon/species_info/gen_6_families.h # src/data/pokemon/species_info/gen_7_families.h # src/data/pokemon/species_info/gen_8_families.h
This commit is contained in:
commit
39ed85635f
@ -23,17 +23,15 @@ body:
|
||||
label: Version
|
||||
description: What version of pokeemerald-expansion are you using as a base?
|
||||
options:
|
||||
- 1.7.4 (Latest release)
|
||||
- master (default when pulling, unreleased bugfixes)
|
||||
- 1.8.0 (Latest release)
|
||||
- master (default, unreleased bugfixes)
|
||||
- upcoming (Edge)
|
||||
- 1.7.4
|
||||
- 1.7.3
|
||||
- 1.7.2
|
||||
- 1.7.1
|
||||
- 1.7.0
|
||||
- 1.6.2
|
||||
- 1.6.1
|
||||
- 1.6.0
|
||||
- pre-1.6.0
|
||||
- pre-1.7.0
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml
vendored
10
.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml
vendored
@ -23,17 +23,15 @@ body:
|
||||
label: Version
|
||||
description: What version of pokeemerald-expansion are you using as a base?
|
||||
options:
|
||||
- 1.7.4 (Latest release)
|
||||
- master (default when pulling, unreleased bugfixes)
|
||||
- 1.8.0 (Latest release)
|
||||
- master (default, unreleased bugfixes)
|
||||
- upcoming (Edge)
|
||||
- 1.7.4
|
||||
- 1.7.3
|
||||
- 1.7.2
|
||||
- 1.7.1
|
||||
- 1.7.0
|
||||
- 1.6.2
|
||||
- 1.6.1
|
||||
- 1.6.0
|
||||
- pre-1.6.0
|
||||
- pre-1.7.0
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/04_other_errors.yaml
vendored
10
.github/ISSUE_TEMPLATE/04_other_errors.yaml
vendored
@ -23,17 +23,15 @@ body:
|
||||
label: Version
|
||||
description: What version of pokeemerald-expansion are you using as a base?
|
||||
options:
|
||||
- 1.7.4 (Latest release)
|
||||
- master (default when pulling, unreleased bugfixes)
|
||||
- 1.8.0 (Latest release)
|
||||
- master (default, unreleased bugfixes)
|
||||
- upcoming (Edge)
|
||||
- 1.7.4
|
||||
- 1.7.3
|
||||
- 1.7.2
|
||||
- 1.7.1
|
||||
- 1.7.0
|
||||
- 1.6.2
|
||||
- 1.6.1
|
||||
- 1.6.0
|
||||
- pre-1.6.0
|
||||
- pre-1.7.0
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
# Pokeemerald-Expansion Changelogs
|
||||
|
||||
## Version 1.8.x
|
||||
### [Version 1.8.0](docs/changelogs/1.8.0.md) - Feature Release
|
||||
|
||||
## Version 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
|
||||
|
||||
27
README.md
27
README.md
@ -25,24 +25,23 @@ Based off RHH's pokeemerald-expansion v1.7.3 https://github.com/rh-hideout/pokee
|
||||
- Physical/Special/Status Category (configurable).
|
||||
- New moves and abilities up to Scarlet and Violet.
|
||||
- Custom Contest data up to SwSh, newer moves are WIP. ([source](https://pokemonurpg.com/info/contests/rse-move-list/))
|
||||
- Mega Evolution
|
||||
- Primal Reversion
|
||||
- Ultra Burst
|
||||
- Z-Moves
|
||||
- Gen 8+ damaging moves are given power extrapolated from Gen 7.
|
||||
- Gen 8+ status moves have no additional effects, like Healing Wish.
|
||||
- Dynamax
|
||||
- Gigantamax forms
|
||||
- Battle gimmick support:
|
||||
- Mega Evolution
|
||||
- Primal Reversion
|
||||
- Ultra Burst
|
||||
- Z-Moves
|
||||
- Gen 8+ damaging moves are given power extrapolated from Gen 7.
|
||||
- Gen 8+ status moves have no additional effects, like Healing Wish.
|
||||
- Dynamax and Gigantamax
|
||||
- Initial battle parameters
|
||||
- Queueing stat boosts (aka, Totem Boosts)
|
||||
- Setting Terrains.
|
||||
- Mid-turn speed recalculation.
|
||||
- Quick Poké Ball selection in Wild Battles
|
||||
- Press `R` to use last selected Poké Ball.
|
||||
- Hold `R` to change selection with the D-Pad.
|
||||
- Press `R` to use last selected Poké Ball.
|
||||
- Run option shortcut
|
||||
- Faster battle intro
|
||||
- Message and animation/cry happens at the same time.
|
||||
- Faster battle intro - Message and animation/cry happens at the same time.
|
||||
- Faster HP drain.
|
||||
- Battle Debug menu.
|
||||
- Accessed by pressing `Select` on the "Fight/Bag/Pokémon/Run" menu.
|
||||
@ -105,7 +104,8 @@ Based off RHH's pokeemerald-expansion v1.7.3 https://github.com/rh-hideout/pokee
|
||||
- HP Threshold (eg. Darmanitan)
|
||||
- Weather (eg. Castform)
|
||||
- End of turn (eg. Morpeko)
|
||||
- Time of day (Shaymin)
|
||||
- Time of day (eg. Shaymin)
|
||||
- Fusions (eg. Kyurem)
|
||||
- ***Breeding Improvements***
|
||||
- Incense Baby Pokémon now happen automatically (configurable).
|
||||
- Level 1 eggs (configurable).
|
||||
@ -138,7 +138,6 @@ Based off RHH's pokeemerald-expansion v1.7.3 https://github.com/rh-hideout/pokee
|
||||
- *Dark Mode*.
|
||||
- [Nature Colors](https://github.com/DizzyEggg/pokeemerald/tree/nature_color) in summary screen by @DizzyEggg
|
||||
- [Dynamic Multichoice](https://github.com/SBird1337/pokeemerald/tree/feature/dynmulti) by @SBird1337
|
||||
- [Guillotine](https://github.com/aarant/pokeemerald/tree/guillotine) (Decapitalization) by @aarant
|
||||
- ***Other features***
|
||||
- Pressing B while holding a Pokémon drops them like in modern games (configurable).
|
||||
- Running indoors (configurable).
|
||||
@ -165,7 +164,7 @@ With this, you'll get the latest version of pokeemerald-expansion, plus a couple
|
||||
|
||||
## **How do I update my version of pokeemerald-expansion?**
|
||||
- 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.7.4`.
|
||||
- Once you have your remote set up, run the command `git pull RHH expansion/1.8.0`.
|
||||
|
||||
### Please consider crediting the entire [list of contributors](https://github.com/rh-hideout/pokeemerald-expansion/wiki/Credits) in your project, as they have all worked hard to develop this project :)
|
||||
|
||||
|
||||
@ -2170,3 +2170,11 @@
|
||||
setvar VAR_RESULT, TRUE
|
||||
2:
|
||||
.endm
|
||||
|
||||
@ Inflicts \status1 to the Pokémon in \slot.
|
||||
@ If \slot is greater or equal than PARTY_SIZE, the status is inflicted on each of the Player's Pokémon.
|
||||
.macro setstatus1 status1:req, slot:req
|
||||
callnative Script_SetStatus1
|
||||
.2byte \status1
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ -4612,7 +4612,7 @@ BattleScript_EffectFutureSight::
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectTeleport::
|
||||
.if B_TELEPORT_BEHAVIOR >= GEN_7
|
||||
.if B_TELEPORT_BEHAVIOR >= GEN_8
|
||||
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_EffectBatonPass
|
||||
jumpifside BS_ATTACKER, B_SIDE_PLAYER, BattleScript_EffectBatonPass
|
||||
.else
|
||||
@ -8552,7 +8552,8 @@ BattleScript_GooeyActivates::
|
||||
waitstate
|
||||
call BattleScript_AbilityPopUp
|
||||
swapattackerwithtarget @ for defiant, mirror armor
|
||||
seteffectsecondary
|
||||
seteffectsecondary MOVE_EFFECT_SPD_MINUS_1
|
||||
swapattackerwithtarget
|
||||
return
|
||||
|
||||
BattleScript_AbilityStatusEffect::
|
||||
|
||||
@ -95,47 +95,47 @@ Debug_BoxFilledMessage::
|
||||
Debug_BoxFilledMessage_Text:
|
||||
.string "Storage boxes filled!$"
|
||||
|
||||
Debug_EventScript_CheckEV::
|
||||
Debug_EventScript_CheckEVs::
|
||||
lockall
|
||||
getpartysize
|
||||
goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon
|
||||
goto_if_eq VAR_RESULT, 0, Debug_NoPokemon
|
||||
special ChoosePartyMon
|
||||
waitstate
|
||||
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_CheckEV_End
|
||||
callnative Script_GetChosenMonOffensiveEV
|
||||
msgbox Debug_EventScript_Text_OffensiveEV, MSGBOX_DEFAULT
|
||||
callnative Script_GetChosenMonDefensiveEV
|
||||
msgbox Debug_EventScript_Text_DefensiveEV, MSGBOX_DEFAULT
|
||||
Debug_EventScript_CheckEV_End::
|
||||
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_CheckEVs_End
|
||||
callnative Script_GetChosenMonOffensiveEVs
|
||||
msgbox Debug_EventScript_Text_OffensiveEVs, MSGBOX_DEFAULT
|
||||
callnative Script_GetChosenMonDefensiveEVs
|
||||
msgbox Debug_EventScript_Text_DefensiveEVs, MSGBOX_DEFAULT
|
||||
Debug_EventScript_CheckEVs_End::
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_Text_OffensiveEV:
|
||||
.string "ATK EV: {STR_VAR_1}, SPATK EV: {STR_VAR_2}, SPEED EV: {STR_VAR_3}$"
|
||||
Debug_EventScript_Text_OffensiveEVs:
|
||||
.string "ATK EVs: {STR_VAR_1}, SPATK EVs: {STR_VAR_2}, SPEED EVs: {STR_VAR_3}$"
|
||||
|
||||
Debug_EventScript_Text_DefensiveEV:
|
||||
.string "HP EV: {STR_VAR_1}, DEF EV: {STR_VAR_2}, SPDEF EV: {STR_VAR_3}$"
|
||||
Debug_EventScript_Text_DefensiveEVs:
|
||||
.string "HP EVs: {STR_VAR_1}, DEF EVs: {STR_VAR_2}, SPDEF EVs: {STR_VAR_3}$"
|
||||
|
||||
Debug_EventScript_CheckIV::
|
||||
Debug_EventScript_CheckIVs::
|
||||
lockall
|
||||
getpartysize
|
||||
goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon
|
||||
goto_if_eq VAR_RESULT, 0, Debug_NoPokemon
|
||||
special ChoosePartyMon
|
||||
waitstate
|
||||
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_CheckIV_End
|
||||
callnative Script_GetChosenMonOffensiveIV
|
||||
msgbox Debug_EventScript_Text_OffensiveIV, MSGBOX_DEFAULT
|
||||
callnative Script_GetChosenMonDefensiveIV
|
||||
msgbox Debug_EventScript_Text_DefensiveIV, MSGBOX_DEFAULT
|
||||
Debug_EventScript_CheckIV_End::
|
||||
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_CheckIVs_End
|
||||
callnative Script_GetChosenMonOffensiveIVs
|
||||
msgbox Debug_EventScript_Text_OffensiveIVs, MSGBOX_DEFAULT
|
||||
callnative Script_GetChosenMonDefensiveIVs
|
||||
msgbox Debug_EventScript_Text_DefensiveIVs, MSGBOX_DEFAULT
|
||||
Debug_EventScript_CheckIVs_End::
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_Text_OffensiveIV:
|
||||
.string "ATK IV: {STR_VAR_1}, SPATK IV: {STR_VAR_2}, SPEED IV: {STR_VAR_3}$"
|
||||
Debug_EventScript_Text_OffensiveIVs:
|
||||
.string "ATK IVs: {STR_VAR_1}, SPATK IVs: {STR_VAR_2}, SPEED IVs: {STR_VAR_3}$"
|
||||
|
||||
Debug_EventScript_Text_DefensiveIV:
|
||||
.string "HP IV: {STR_VAR_1}, DEF IV: {STR_VAR_2}, SPDEF IV: {STR_VAR_3}$"
|
||||
Debug_EventScript_Text_DefensiveIVs:
|
||||
.string "HP IVs: {STR_VAR_1}, DEF IVs: {STR_VAR_2}, SPDEF IVs: {STR_VAR_3}$"
|
||||
|
||||
Debug_EventScript_Script_1::
|
||||
end
|
||||
@ -202,7 +202,7 @@ Debug_ROMSize::
|
||||
Debug_HatchAnEgg::
|
||||
lockall
|
||||
getpartysize
|
||||
goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon
|
||||
goto_if_eq VAR_RESULT, 0, Debug_NoPokemon
|
||||
special ChoosePartyMon
|
||||
waitstate
|
||||
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_HatchAnEgg_End
|
||||
@ -214,8 +214,8 @@ Debug_HatchAnEgg_End::
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_HatchAnEgg_NoPokemon::
|
||||
msgbox DebugScript_HatchAnEgg_Text_EmptyParty, MSGBOX_DEFAULT
|
||||
Debug_NoPokemon::
|
||||
msgbox DebugScript_Text_EmptyParty, MSGBOX_DEFAULT
|
||||
releaseall
|
||||
end
|
||||
|
||||
@ -224,7 +224,7 @@ DebugScript_HatchAnEgg_CantForceHatch::
|
||||
releaseall
|
||||
end
|
||||
|
||||
DebugScript_HatchAnEgg_Text_EmptyParty::
|
||||
DebugScript_Text_EmptyParty::
|
||||
.string "You have no Pokémon nor Eggs.$"
|
||||
|
||||
DebugScript_HatchAnEgg_Text_NotAnEgg::
|
||||
@ -295,3 +295,153 @@ Debug_FlagsAndVarNotSetBattleConfigMessage_Text:
|
||||
.string "Feature unavailable! Please define a\n"
|
||||
.string "usable flag and a usable var in:\l"
|
||||
.string "'include/config/battle.h'!$"
|
||||
|
||||
Debug_EventScript_InflictStatus1::
|
||||
lockall
|
||||
getpartysize
|
||||
goto_if_eq VAR_RESULT, 0, Debug_NoPokemon
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Single, 0
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_PartyWide, 1
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Close, 2
|
||||
dynmultistack 0, 0, FALSE, 3 FALSE, 0, NULL
|
||||
switch VAR_RESULT
|
||||
case 0, Debug_EventScript_InflictStatus1_Single
|
||||
case 1, Debug_EventScript_InflictStatus1_Party
|
||||
case 2, Debug_EventScript_InflictStatus1_Close
|
||||
Debug_EventScript_InflictStatus1_Close:
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Single:
|
||||
special ChoosePartyMon
|
||||
waitstate
|
||||
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_InflictStatus1_Close
|
||||
specialvar VAR_RESULT, ScriptGetPartyMonSpecies
|
||||
goto_if_eq VAR_RESULT, SPECIES_EGG, Debug_EventScript_InflictStatus1_Close
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Poison, 0
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Paralysis, 1
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Sleep, 2
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Burn, 3
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Freeze, 4
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Frostbite, 5
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Close, 6
|
||||
dynmultistack 0, 0, FALSE, 7, FALSE, 0, NULL
|
||||
switch VAR_RESULT
|
||||
case 0, Debug_EventScript_InflictStatus1_Single_Poison
|
||||
case 1, Debug_EventScript_InflictStatus1_Single_Paralysis
|
||||
case 2, Debug_EventScript_InflictStatus1_Single_Sleep
|
||||
case 3, Debug_EventScript_InflictStatus1_Single_Burn
|
||||
case 4, Debug_EventScript_InflictStatus1_Single_Freeze
|
||||
case 5, Debug_EventScript_InflictStatus1_Single_Frostbite
|
||||
case 6, Debug_EventScript_InflictStatus1_Close
|
||||
case MULTI_B_PRESSED, Debug_EventScript_InflictStatus1_Close
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Single_Poison:
|
||||
setstatus1 STATUS1_POISON, VAR_0x8004
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Single_Paralysis:
|
||||
setstatus1 STATUS1_PARALYSIS, VAR_0x8004
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Single_Sleep:
|
||||
setstatus1 STATUS1_SLEEP, VAR_0x8004
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Single_Burn:
|
||||
setstatus1 STATUS1_BURN, VAR_0x8004
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Single_Freeze:
|
||||
setstatus1 STATUS1_FREEZE, VAR_0x8004
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Single_Frostbite:
|
||||
setstatus1 STATUS1_FROSTBITE, VAR_0x8004
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Party:
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Poison, 0
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Paralysis, 1
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Sleep, 2
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Burn, 3
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Freeze, 4
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Frostbite, 5
|
||||
dynmultipush Debug_EventScript_InflictStatus1_Text_Close, 6
|
||||
dynmultistack 0, 0, FALSE, 7, FALSE, 0, NULL
|
||||
switch VAR_RESULT
|
||||
case 0, Debug_EventScript_InflictStatus1_Party_Poison
|
||||
case 1, Debug_EventScript_InflictStatus1_Party_Paralysis
|
||||
case 2, Debug_EventScript_InflictStatus1_Party_Sleep
|
||||
case 3, Debug_EventScript_InflictStatus1_Party_Burn
|
||||
case 4, Debug_EventScript_InflictStatus1_Party_Freeze
|
||||
case 5, Debug_EventScript_InflictStatus1_Party_Frostbite
|
||||
case 6, Debug_EventScript_InflictStatus1_Close
|
||||
case MULTI_B_PRESSED, Debug_EventScript_InflictStatus1_Close
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Party_Poison:
|
||||
setstatus1 STATUS1_POISON, PARTY_SIZE
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Party_Paralysis:
|
||||
setstatus1 STATUS1_PARALYSIS, PARTY_SIZE
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Party_Sleep:
|
||||
setstatus1 STATUS1_SLEEP, PARTY_SIZE
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Party_Burn:
|
||||
setstatus1 STATUS1_BURN, PARTY_SIZE
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Party_Freeze:
|
||||
setstatus1 STATUS1_FREEZE, PARTY_SIZE
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Party_Frostbite:
|
||||
setstatus1 STATUS1_FROSTBITE, PARTY_SIZE
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Single:
|
||||
.string "Single$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_PartyWide:
|
||||
.string "Party-wide$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Close:
|
||||
.string "Close$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Poison:
|
||||
.string "Poison$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Paralysis:
|
||||
.string "Paralysis$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Sleep:
|
||||
.string "Sleep$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Burn:
|
||||
.string "Burn$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Freeze:
|
||||
.string "Freeze$"
|
||||
|
||||
Debug_EventScript_InflictStatus1_Text_Frostbite:
|
||||
.string "Frostbite$"
|
||||
|
||||
@ -550,7 +550,7 @@ gSpecials::
|
||||
def_special ObjectEventInteractionBerryHasWeed
|
||||
def_special ObjectEventInteractionBerryHasPests
|
||||
def_special CanWaterBerryPlot
|
||||
def_special Script_GetChosenMonOffensiveEV
|
||||
def_special Script_GetChosenMonDefensiveEV
|
||||
def_special Script_GetChosenMonOffensiveIV
|
||||
def_special Script_GetChosenMonDefensiveIV
|
||||
def_special Script_GetChosenMonOffensiveEVs
|
||||
def_special Script_GetChosenMonDefensiveEVs
|
||||
def_special Script_GetChosenMonOffensiveIVs
|
||||
def_special Script_GetChosenMonDefensiveIVs
|
||||
|
||||
704
docs/changelogs/1.8.0.md
Normal file
704
docs/changelogs/1.8.0.md
Normal file
@ -0,0 +1,704 @@
|
||||
# Version 1.8.0
|
||||
|
||||
```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.0`.
|
||||
```
|
||||
|
||||
## 🌋 *IMPORTANT CHANGES* 🌋
|
||||
* ***Python is now a required for the Expansion***.
|
||||
* Run the `command -v python3` command to see if you have it. If you don't, please check INSTALL.md to see how to install it.
|
||||
* **Support for PoryMap v5.1.1 and lower has been dropped.**
|
||||
* [Please update your PoryMap version](https://github.com/huderlem/porymap/releases).
|
||||
* Specifically, we have removed the commented-out `gMonIconTable` table used to associate species IDs with icon images by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3896
|
||||
* From PoryMap v5.2.0 onwards, these icons are autodetected based on file/directory names instead.
|
||||
* To continue using older versions of PoryMap, you may restore the commented-out table, though you'll need to keep it up to date with any new items you add.
|
||||
* **Backwards-compatible `BoxPokemon` Refactor** by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/3438
|
||||
* HP and Status is now kept when depositing Pokémon in the PC
|
||||
* Previous behavior can be restored by setting `OW_PC_HEAL`.
|
||||
* Nature Mints are now fully functional.
|
||||
* Nature colors in summary screen are based on the changed nature by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3898
|
||||
* Gigantamax Factor and Dynamax Level fully supported.
|
||||
* Cannot be seen in summary screen.
|
||||
* Dynamax Candy effect added.
|
||||
* Gigantamax Factor prevents Duraludon from evolving, like Pikachu, Eevee and Meowth beforehand.
|
||||
* Added `hasgigantamaxfactor` and `togglegigantamaxfactor` overworld script commands.
|
||||
* Gigantamax Factor cannot be toggled for Mythical Pokémon (vanilla behavior).
|
||||
* Hyper Training is now fully supported.
|
||||
* Cannot be seen in summary screen.
|
||||
* Added `canhypertrain` and `hypertrain` overworld script commands.
|
||||
* Shininess can be toggled with `MON_DATA_IS_SHINY`.
|
||||
* Added Tera Type field is added for future-proofing.
|
||||
* It can be seen in the summary screen by turning `P_SHOW_TERA_TYPE` on.
|
||||
* Added `isShadow` field for future-proofing.
|
||||
* Added options for Tera Type, Dynamax Level, Gigantamax Factor and Shadow flag in tests.
|
||||
* Cleanup by
|
||||
* @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/3832
|
||||
* @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4017
|
||||
|
||||
* **Move Refactors**:
|
||||
* ***Move data unification*** by @LOuroboros, with help from @Bassoonian, @cfmnephrite and @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3999
|
||||
* Renamed `gBattleMoves` to `gMovesInfo`.
|
||||
* Moved move names to `gMovesInfo`.
|
||||
* Added `GetMoveName` to get all move names, removing the need for `GetMaxMoveName` and `GetZMoveName`.
|
||||
* Moved move descriptions to `gMovesInfo`.
|
||||
* Moved contest data to `gMovesInfo`.
|
||||
* ***Secondary/primary effects overhaul*** by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3577
|
||||
* Secondary effects such as stat stage modifiers and status via are now set via `additionalEffects` field.
|
||||
* Eg.
|
||||
```c
|
||||
[MOVE_THUNDER_FANG] =
|
||||
{
|
||||
.effect = EFFECT_FLINCH_STATUS,
|
||||
.secondaryEffectChance = 10,
|
||||
.argument = STATUS1_PARALYSIS,
|
||||
...
|
||||
},
|
||||
```
|
||||
Now becomes:
|
||||
```c
|
||||
[MOVE_THUNDER_FANG] =
|
||||
{
|
||||
.effect = EFFECT_HIT,
|
||||
.additionalEffects = ADDITIONAL_EFFECTS(
|
||||
{ .moveEffect = MOVE_EFFECT_PARALYSIS, .chance = 10, },
|
||||
{ .moveEffect = MOVE_EFFECT_FLINCH, .chance = 10, }
|
||||
),
|
||||
...
|
||||
},
|
||||
```
|
||||
With customizable independent chances for each effect. Because of this, `secondaryEffectChance` has been removed.
|
||||
* For more info, check the wiki article on [How to add a new move](https://github.com/rh-hideout/pokeemerald-expansion/wiki/How-to-add-a-new-move-(Version-1.8.0-and-higher)).
|
||||
* Cleanup by:
|
||||
* @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/3986
|
||||
* @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4003
|
||||
* By @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/4137
|
||||
* By @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4277
|
||||
* ***Renamed Battle Move "Split" to the proper "Category" term*** by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3774
|
||||
```diff
|
||||
-.split = SPLIT_PHYSICAL,
|
||||
+.category = DAMAGE_CATEGORY_PHYSICAL,
|
||||
```
|
||||
* Z-move power override (eg. Mega Drain) was moved from a switch in `GetZMovePower` to move data. It's part of an union alongsize with Z-move status effect by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3575
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4201
|
||||
* Removed `EFFECT_RECOIL_x` effects in favor of new `recoil` field by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3575
|
||||
* Removed critical-hit move effects in favor of new `criticalHitStage` by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3779
|
||||
* Added `alwaysCriticalHit` move flag.
|
||||
* Converted `EFFECT_x` defines to an enum by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3975
|
||||
* Move data now uses ternaries for data that was changed only once across generations by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3987
|
||||
```diff
|
||||
[MOVE_SWORDS_DANCE] =
|
||||
{
|
||||
- #if B_UPDATED_MOVE_DATA >= GEN_6
|
||||
- .pp = 20,
|
||||
- #else
|
||||
- .pp = 30,
|
||||
- #endif
|
||||
.effect = EFFECT_ATTACK_UP_2,
|
||||
.power = 0,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 0,
|
||||
+ .pp = B_UPDATED_MOVE_DATA >= GEN_6 ? 20 : 30,
|
||||
```
|
||||
* Moved effect script array to `src/data/battle_move_effects.h` by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3994
|
||||
* AI's `sEncouragedEncoreEffects` and Battle TV's `sPoints_MoveEffect` are now handled in this struct.
|
||||
* Some move flags were moved to this array instead
|
||||
* Semi-invulnerable flag (`semiInvulnerableEffect`) in https://github.com/rh-hideout/pokeemerald-expansion/pull/4062
|
||||
* Cleanup by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/4150
|
||||
* Flag to define Two-turn effects (`twoTurnEffect`) in https://github.com/rh-hideout/pokeemerald-expansion/pull/4062
|
||||
* Flag for increasing the protection counter (`usesProtectCounter`) in https://github.com/rh-hideout/pokeemerald-expansion/pull/4062
|
||||
* Removed `sheerForceBoost` in favor of checking their actual secondary effects by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/4096
|
||||
* To force Sheer Boost acting for a move without secondary effect, you can add `SHEER_FORCE_HACK` in the `additionalEffects` field.
|
||||
* ***Learnset refactors***
|
||||
* ***Level up learnsets can now be switched by generational config*** by @MartyKen in https://github.com/rh-hideout/pokeemerald-expansion/pull/4049
|
||||
* Adds a file for each generation with data for all species.
|
||||
* Gen 1: Yellow
|
||||
* Gen 2: Crystal
|
||||
* Gen 3: RSE
|
||||
* Gen 4: HGSS
|
||||
* Gen 5: B2W2
|
||||
* Gen 6: ORAS
|
||||
* Gen 7: USUM
|
||||
* Gen 8:
|
||||
* Species from Gens 1-4: BDSP
|
||||
* Species from Legends: Arceus: Use that game's data.
|
||||
* Species from Gens 5-8: SwSh if they exist there. Otherwise, default to Gen 7's data.
|
||||
* Gen 9:
|
||||
* If they exist in SV, use that game's data.
|
||||
* Otherwise, default to Gen 8's data.
|
||||
* If a Pokémon doesn't exist in the respective generation, it uses the first instance it appears in.
|
||||
* Eg. Chikorita uses its Gen 2 learnset if the config is set to Gen 1.
|
||||
* ***IMPORTANT:*** Since the expansion's default had most movesets correspond to USUM's, conflicts will arise in `data/pokemon/level_up_learnsets/gen_7.h` if you modified the level learnsets. Be sure to backup your `data/pokemon/level_up_learnsets.h` before merging and then do the following after merging to keep your changes:
|
||||
```diff
|
||||
+#include "data/pokemon/level_up_learnsets.h"
|
||||
+#if FALSE
|
||||
+
|
||||
#if P_LVL_UP_LEARNSETS >= GEN_9
|
||||
#include "data/pokemon/level_up_learnsets/gen_9.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_8
|
||||
#include "data/pokemon/level_up_learnsets/gen_8.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_7
|
||||
#include "data/pokemon/level_up_learnsets/gen_7.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_6
|
||||
#include "data/pokemon/level_up_learnsets/gen_6.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_5
|
||||
#include "data/pokemon/level_up_learnsets/gen_5.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_4
|
||||
#include "data/pokemon/level_up_learnsets/gen_4.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_3
|
||||
#include "data/pokemon/level_up_learnsets/gen_3.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_2
|
||||
#include "data/pokemon/level_up_learnsets/gen_2.h"
|
||||
#elif P_LVL_UP_LEARNSETS >= GEN_1
|
||||
#include "data/pokemon/level_up_learnsets/gen_1.h"
|
||||
#endif
|
||||
+#endif
|
||||
```
|
||||
* Cleanup by
|
||||
* @MartyKen in https://github.com/rh-hideout/pokeemerald-expansion/pull/4267
|
||||
* @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4275
|
||||
* Added `sUniversalMoves`, a near-universal teachable move array by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4052
|
||||
* This removes the need to add moves such as Hidden Power to almost every species.
|
||||
* Adds `tmIlliterate` flag that controls when specific species cannot learn these moves, such as Magikarp, Caterpie and Ditto.
|
||||
* ***Auto-generate teachable learnset data from JSON data*** by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3856
|
||||
- Scans the repository for TMs and tutor moves.
|
||||
- Checks JSON files (same format as PoryMoves, with minor label adjustments for an easier time) for compatibility.
|
||||
- Creates a `teachable_learnsets.h` file with the smallest size possible by only including the moves found in the scan.
|
||||
- Users can easily delete/add JSON files to reference less/more data as they see fit.
|
||||
- Eg. they can remove hgss.json to remove those games' compatibility list from being considered.
|
||||
- Any changes in `teachable_learnsets.h` made before this tool runs for the first time will be saved in `custom.json` for flawless migration.
|
||||
* Updated `teachable_learnsets.h` using this script by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4064
|
||||
* Further updated with new Indigo Disk data compatibility by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4155
|
||||
* Can be disabled via `P_LEARNSET_HELPER_TEACHABLE`.
|
||||
* Removed previously untutorable moves from Mew's unteachable moves by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/4142
|
||||
|
||||
* **Ability Refactor: new struct called `Ability` that stores both name and description of abilities** by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3861
|
||||
* AI ability scores moved to this struct by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3862
|
||||
* Added ability flags to replace arrays and switch statements by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3886
|
||||
* `cantBeCopied`: Cannot be copied by Role Play or Doodle.
|
||||
* `cantBeSwapped`: Cannot be swapped with Skill Swap or Wandering Spirit.
|
||||
* `cantBeTraced`: Cannot be copied by Trace.
|
||||
* `cantBeSuppressed`: Cannot be negated by Gastro Acid or Neutralizing Gas.
|
||||
* `cantBeOverwritten`: Cannot be overwritten by Entrainment, Worry Seed or Simple Beam. Mummy/Lingering Aroma checks for `cantBeSuppressed` instead.
|
||||
* `breakable`: Can be bypassed by Mold Breaker-like abilities.
|
||||
* `failsOnImposter`: Currently unused.
|
||||
* Cleanup by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3889
|
||||
|
||||
* **Type info consolidation by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/4185**
|
||||
* New struct called `TypeInfo` that stores:
|
||||
* Name
|
||||
* Generic move name
|
||||
* Icon Palette index number
|
||||
* Type Z-Move
|
||||
* Type Max Move
|
||||
* Commented out data to assist users that desire to use it in their own hacks and as a reference for them to add items of new types.
|
||||
* Type-enhancing item (eg. Charcoal)
|
||||
* Type-resist berry
|
||||
* Type Gems
|
||||
* Z-Crystal
|
||||
* Tera Shard
|
||||
* Arceus form
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4276
|
||||
|
||||
## 🧬 General 🧬
|
||||
### Added
|
||||
* Added optional high-quality RNG by @tertu-m in https://github.com/rh-hideout/pokeemerald-expansion/pull/3780
|
||||
* Can be toggled with `HQ_RANDOM`.
|
||||
* Cleanup by
|
||||
* @tertu-m in https://github.com/rh-hideout/pokeemerald-expansion/pull/3812
|
||||
* @tertu-m in https://github.com/rh-hideout/pokeemerald-expansion/pull/4218
|
||||
* @tertu-m in https://github.com/rh-hideout/pokeemerald-expansion/pull/4278
|
||||
* Added defines to RHH's rom header
|
||||
* `MOVES_COUNT` and `NUM_SPECIES` by @Ninjdai1 in https://github.com/rh-hideout/pokeemerald-expansion/pull/3831
|
||||
* Cleanup by @Ninjdai1 in https://github.com/rh-hideout/pokeemerald-expansion/pull/3992
|
||||
* `ITEMS_COUNT` and `ITEM_NAME_LENGTH` by @Ninjdai1 in https://github.com/rh-hideout/pokeemerald-expansion/pull/3988
|
||||
* IWRAM and EWRAM variables can now be assigned at boot by using `EWRAM_INIT` and `IWRAM_INIT` by @aronson in https://github.com/rh-hideout/pokeemerald-expansion/pull/3892
|
||||
* For example:
|
||||
```c
|
||||
EWRAM_INIT u32 gFoo = 1337;
|
||||
IWRAM_INIT u32 gFastFoo = 31337;
|
||||
```
|
||||
* Cleanup by @aronson in https://github.com/rh-hideout/pokeemerald-expansion/pull/3903
|
||||
* Level Caps by @AlexOn1ine, @SBird1337 and PokemonCrazy in https://github.com/rh-hideout/pokeemerald-expansion/pull/3632
|
||||
* Types of caps (set in `B_EXP_CAP_TYPE`):
|
||||
* None (`EXP_CAP_NONE`): Regular behavior, no level caps are applied.
|
||||
* Hard (`EXP_CAP_HARD`): Pokémon with a level equal or above cap cap cannot gain any experience.
|
||||
* Soft (`EXP_CAP_SOFT`): Pokémon with a level equal or above cap will gain reduced experience.
|
||||
* Cap level can be set using either:
|
||||
* `LEVEL_CAP_FLAG_LIST`: Level cap is chosen according to the first unset flag in `sLevelCapFlagMap`.
|
||||
* `LEVEL_CAP_VARIABLE`: Uses a defined variable to dynamically change level cap.
|
||||
* Additional options include:
|
||||
* `B_RARE_CANDY_CAP`: If set to true, Rare Candies can't be used to go over the level cap.
|
||||
* `B_LEVEL_CAP_EXP_UP`: If set to true, mons under level cap will receive more experience.
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4275
|
||||
* Added new metaprogram macros by @cfmnephrite in https://github.com/rh-hideout/pokeemerald-expansion/pull/3968
|
||||
* Allows to set up default data without explicitily defining it.
|
||||
* Eg. setting Poké Balls as the default ball for all trainer classes.
|
||||
* Elite Four/Champion transitions can now easily be applied to any trainer in their data by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/4000
|
||||
* Based off @ShinyDragonHunter's [BetterMugshots](https://github.com/ShinyDragonHunter/pokeemerald/tree/BetterMugshots) branch.
|
||||
* To use, use these in `src/data/trainers.h`:
|
||||
* Use`mugshotEnabled` to enable it for the specific trainer.
|
||||
* Use `mugshotColor` to choose the color of the background for the transition between the following:
|
||||
* `MUGSHOT_COLOR_PURPLE`
|
||||
* `MUGSHOT_COLOR_GREEN`
|
||||
* `MUGSHOT_COLOR_PINK`
|
||||
* `MUGSHOT_COLOR_BLUE`
|
||||
* `MUGSHOT_COLOR_YELLOW`
|
||||
* Cleanup using metaprogram by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/4140
|
||||
* Added `OW_DOUBLE_APPROACH_WITH_ONE_MON` config to allow being spotted by two trainers with one mon in party for a 2v1 battle by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4007
|
||||
* Added configs to enable metric system units by @pkmnsnfrn in https://github.com/rh-hideout/pokeemerald-expansion/pull/4183
|
||||
* Toggled by `UNITS` in `include/config.h`.
|
||||
* Cleanup by @pkmnsnfrn in https://github.com/rh-hideout/pokeemerald-expansion/pull/4193
|
||||
* ***Implemented custom GiveMon scripting command*** by @LOuroboros, with help from @ghoulslash and @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/3924
|
||||
* Based off @ghoulslash's [custom_givemon](https://github.com/ghoulslash/pokeemerald/tree/custom_givemon) branch.
|
||||
* In addition to Species, Level and Held Item, users can now specify:
|
||||
* Poké Ball
|
||||
* Nature
|
||||
* Ability number
|
||||
* You can pass `NUM_ABILITY_PERSONALITY` to generate the ability based on personality by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4192
|
||||
* Gender
|
||||
* EVs
|
||||
* IVs
|
||||
* Moves
|
||||
* Shininess
|
||||
* Gigantamax Factor
|
||||
* Tera Type
|
||||
* Save-compatible SaveBlock3, with 1624 bytes by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/4112
|
||||
* ***IMPORTANT:*** This is incompatible with the "[Extra save space with two lines of code](https://github.com/pret/pokeemerald/wiki/Extra-save-space-with-two-lines-of-code)" tutorial, which allocates that additional space to `SaveBlock1`, `SaveBlock2`, and `PokemonStorage` instead. To preserve save compatibility, change `SAVE_BLOCK_3_CHUNK_SIZE` to 0 and keep `SECTOR_DATA_SIZE` as 4084.
|
||||
* Trainer Control
|
||||
* Trainer data encapsulation by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4216
|
||||
* Added options for `TrainerMon`:
|
||||
* By @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/3438
|
||||
* Dynamax Level (`dynamaxLevel`)
|
||||
* Gigantamax Factor (`gigantamaxFactor`)
|
||||
* By @Nopinou in https://github.com/rh-hideout/pokeemerald-expansion/pull/4169
|
||||
* AI flags to signal when to Dynamax (`shouldDynamax`)
|
||||
* AI flags to signal when to Terastalize (`shouldTerastal`)
|
||||
* Sets neutral nature and ability to 0 as default by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4172
|
||||
* Added `randompercentage` and `randomelement` script commands by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/4189
|
||||
* Allows to do the following:
|
||||
```
|
||||
@ VAR_RESULT is one of Treecko, Torchic, or Mudkip
|
||||
randomelement SPECIES_TREECKO, SPECIES_TORCHIC, SPECIES_MUDKIP
|
||||
@ Gives a random one of Treecko, Torchic, or Mudkip.
|
||||
givemon VAR_RESULT, 5
|
||||
```
|
||||
```
|
||||
@ VAR_RESULT is TRUE 25% of the time, and FALSE 75% of the time.
|
||||
randompercentage 25
|
||||
@ Gives a Wobbuffet that is shiny 25% of the time.
|
||||
givemon SPECIES_WOBBUFFET, 20, isShiny=VAR_RESULT
|
||||
```
|
||||
### Changed
|
||||
* Simplified creation of Object Events by adding `overworld_ascending_frames` for sequential `overworld_ascending`s by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/3625
|
||||
* Comparison functions now follow -1, 1, 0 convention by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3777
|
||||
* Centralized Trainer sprites by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/3597
|
||||
* Standarized usage of array shuffling to use `Shuffle` function by @tertu-m in https://github.com/rh-hideout/pokeemerald-expansion/pull/3801
|
||||
* Turned nature names into compound strings by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3871
|
||||
* `TrainerMoney` struct is renamed to `TrainerClass` and now includes Trainer Class name by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/3875
|
||||
* Improve error message with unsupported cpp by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4272
|
||||
### Fixed
|
||||
* Fixed potential compiler errors by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4252
|
||||
* Fixed `ScriptGiveMonParameterized` not recognizing the state of `P_FLAG_FORCE_SHINY` and `P_FLAG_FORCE_NO_SHINY` by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4256
|
||||
* Fixed a graphical issue when catching a form of a Pokémon for the first time by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4279
|
||||
* Fixed `ScriptGiveMonParameterized` randomizing nature even when being set by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4271
|
||||
|
||||
## ✨ Feature Branches ✨
|
||||
### ***Incorporated @SBird1337's Dynamic Multichoices*** by @SBird1337 in https://github.com/rh-hideout/pokeemerald-expansion/pull/3826
|
||||
* This allows to set up custom multichoices much easier!
|
||||
* Allows you to control what options appear based custom conditions (such as them being based on what items you have currently, or even completely at random!).
|
||||
* Event callbacks can be added as well, to fully customize what happens with your multichoices.
|
||||
* Included there's `DYN_MULTICHOICE_CB_SHOW_ITEM`, which shows icons of the items defined by your script.
|
||||
* Compatible with Poryscript.
|
||||
* For more information and how to use it, please visit the [Pokécommunity thread](https://www.pokecommunity.com/threads/event-scripts-dynamic-multichoice.489984/).
|
||||
### ***Incorporated @ghoulslash's save block branch*** by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4113
|
||||
* Differences from the the standalone branch:
|
||||
- Moved configs to dedicated file (`include/config/save.h`).
|
||||
- Fixed comments to the proper amount of space saved.
|
||||
- Added `FREE_MYSTERY_GIFT`, saving 876 bytes in `SaveBlock1`.
|
||||
* Added new `FREE_EXTRA_SEEN_FLAGS_SAVEBLOCK2` to Pokedex struct to save an extra 108 in `SaveBlock2` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4213
|
||||
* Renamed `FREE_EXTRA_SEEN_FLAGS` to `FREE_EXTRA_SEEN_FLAGS_SAVEBLOCK1` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4213
|
||||
- Converted `#ifndef` configs to the config format the rest of expansion uses
|
||||
- Cleaned up the code and fixed to work on `modern`.
|
||||
### ***TheXaman's Debug Menu***:
|
||||
#### Added
|
||||
* *"Give Pokémon Complex"* option can now set EVs by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/3566
|
||||
* Fix by @gabrielcowley in https://github.com/rh-hideout/pokeemerald-expansion/pull/3930
|
||||
* Added *"Clear bag"* option by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/
|
||||
* Added new party debug options by @LOuroboros, with help from @ghoulslash and @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/3924
|
||||
* *"Check IV"*: Checks the selected Pokémon's IVs.
|
||||
* *"Check EV"*: Checks the selected Pokémon's EVs.
|
||||
* *"Clear Party"*: Deletes all Pokémon from the Player's party.
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4275
|
||||
* Upgraded "Poison Party" to "Inflict Status1" by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4235
|
||||
* Now it can also inflict: Paralysis, Sleep, Burn, Freeze and Frostbite.
|
||||
* Can be applied to a single member or the whole party.
|
||||
* Built using SBird's Multichoice.
|
||||
#### Changed
|
||||
* Cleaned up text and adjusted size to support longer text by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/3919
|
||||
* Reorganization and better naming by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/3926
|
||||
* Removed duplicated "Give all TMs" option by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4025
|
||||
#### Fixed
|
||||
* Fixed sound effect clipping when giving an item via debug menu by using a shorter sound by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4025
|
||||
|
||||
## 🐉 Pokémon 🐉
|
||||
### Added
|
||||
* Added Indigo Disk Pokémon data:
|
||||
* Doesn't break saves since it uses the reserved IDs used in 1.7.0
|
||||
* Species data by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3878
|
||||
* Cleanup by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3974
|
||||
* Sprites from [PokéCommunity's 64x64 DS-Style thread](https://www.pokecommunity.com/threads/ds-style-gen-vii-and-beyond-pok%C3%A9mon-sprite-repository-in-64x64.368703/post-10786160) by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4117
|
||||
* Front/Back sprites for: Gouging Fire, Raging Bolt, Iron Boulder, Iron Crown, Archaludon, Hydrapple.
|
||||
* Icon for: Hydrapple.
|
||||
* Cries by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4164
|
||||
* Added `P_FOOTPRINTS` config to disable Pokémon footprints, saving around 35KB of ROM space by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3902
|
||||
* Cleanup by
|
||||
* @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3925
|
||||
* @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4251
|
||||
* Added missing `P_UPDATED_EVS` config that allows setting the EV yield changes across generations by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3993
|
||||
* Added missing `P_UPDATED_EXP_YIELDS` config that allows setting the Experience yield changes across generations by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3995
|
||||
* Added evolution methods that require custom trackers (`MON_DATA_EVOLUTION_TRACKER`) by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4087
|
||||
* `EVO_LEVEL_MOVE_TWENTY_TIMES`:
|
||||
* Stantler can now evolve into Wyrdeer by using Psyshield Bash 20 times.
|
||||
* Primeape can now evolve into Annihilape by using Rage Fist 20 times.
|
||||
* `EVO_LEVEL_RECOIL_DAMAGE_MALE`/`EVO_LEVEL_RECOIL_DAMAGE_FEMALE`
|
||||
* White-Striped Basculin can now evolve into Basculegion when leveling up after receiving 294HP of recoil damage and being the corresponding gender.
|
||||
* Added missing Paldean Wooper icon by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4260
|
||||
* Added missing data for placeholder Pokémon by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4281
|
||||
* Internal Mothim forms used for accurate breeding.
|
||||
* Internal Scatterbug/Spewpa forms that can be used to specify Vivillon form in previous stages.
|
||||
* Totem Pokémon
|
||||
* Partner Pikachu/Eevee
|
||||
### Changed
|
||||
* ***Made all species IDs absolute instead of relative, to avoid confusion when adding new species*** by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4281
|
||||
* Moved shared Pokédex text descriptions to their own file by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4281
|
||||
* Renamed `species_info/gen_X.h` to `species_info/gen_X_families.h`
|
||||
* Added missing entries for Hidden Abilities that default to `ABILITY_NONE`.
|
||||
* Updated Gen 9 mon sprites from [PokéCommunity's 64x64 DS-Style thread](https://www.pokecommunity.com/threads/ds-style-gen-vii-and-beyond-pok%C3%A9mon-sprite-repository-in-64x64.368703/post-10786160) by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3969
|
||||
- Brute Bonnet
|
||||
- Chi-Yu
|
||||
- Flutter Mane
|
||||
- Iron Bundle
|
||||
- Sandy Shocks
|
||||
- Scream Tail
|
||||
- Skeledirge
|
||||
- Slither Wing
|
||||
* Added `MON_TYPES` and `MON_EGG_GROUPS` metaprogram macros by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4154
|
||||
* They're used to define a single type/egg group without needing to define it twice.
|
||||
```diff
|
||||
-.types = { TYPE_WATER, TYPE_WATER },
|
||||
+.types = MON_TYPES(TYPE_WATER),
|
||||
...
|
||||
-.eggGroups = { EGG_GROUP_WATER_3, EGG_GROUP_WATER_3 },
|
||||
+.eggGroups = MON_EGG_GROUPS(EGG_GROUP_WATER_3),
|
||||
```
|
||||
Still supports double types:
|
||||
```diff
|
||||
-.types = { TYPE_GROUND, TYPE_ROCK },
|
||||
+.types = MON_TYPES(TYPE_GROUND, TYPE_ROCK),
|
||||
...
|
||||
-.eggGroups = { EGG_GROUP_MONSTER, EGG_GROUP_FIELD },
|
||||
+.eggGroups = MON_EGG_GROUPS(EGG_GROUP_MONSTER, EGG_GROUP_FIELD),
|
||||
```
|
||||
* ***To avoid confusion, reverted gSpeciesInfo "INFO" macros*** by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4230
|
||||
|
||||
## ⚔️ Battle General ⚔️ ##
|
||||
### Added
|
||||
* Implemented optional Gen1 type immunity logic. by @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/3627
|
||||
* Added Calyrex's blue Dynamax aura by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4018
|
||||
* Expanded `VAR_TERRAIN` functionality
|
||||
* Added `B_VAR_STARTING_STATUS_TIMER` to allow `VAR_TERRAIN` (now called `B_VAR_STARTING_STATUS`) to last only a certain amount of turns instead of permanently by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4132
|
||||
* Further expanded by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/4176
|
||||
* Can be used to set up these as well:
|
||||
* Trick Room
|
||||
* Magic Room
|
||||
* Wonder Room
|
||||
* Tailwind (for player or opponent sides independenly)
|
||||
* Cleanup by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4237
|
||||
|
||||
* AI score debug menu can now cycle through battlers by pressing L/R by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/4134
|
||||
### Changed
|
||||
* Simplified Battle Partners code (eg. Steven) by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3592
|
||||
* Based off @ShinyDragonHunter's [CustomMultiBattles](https://github.com/ShinyDragonHunter/pokeemerald/tree/CustomMultiBattles) branch.
|
||||
* Removed specialized code for Steven partner cases.
|
||||
* Partners are now stored in their own array.
|
||||
* Fixed infinite loop by @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/3808
|
||||
* B_VAR_TERRAIN_TIMERRenamed VAR_TERRAIN to B_VAR_TERRAIN and added a var-based field terrain timer by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4132
|
||||
### Fixed
|
||||
* Fixed AI calculations potentially stomping data when emiting data by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3784
|
||||
* Fixed Battle AI debug screen showing shiny sprites by @fdeblasio in https://github.com/rh-hideout/pokeemerald-expansion/pull/3922
|
||||
* Fixed Gigantamax Factor not changing form by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4108
|
||||
* Fixed Quick Draw having increased chances of activation in double battles by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/4266
|
||||
|
||||
## 🤹 Moves 🤹
|
||||
### Added
|
||||
* Added missing move effects:
|
||||
* Ally Switch by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3533
|
||||
* Cleanup by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3835
|
||||
* Doodle by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3609
|
||||
* Cleanup by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3800
|
||||
* Fillet Away by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3616
|
||||
* Shed Tail by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4016
|
||||
* Last Respects by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4151
|
||||
* Tidy Up by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4136
|
||||
* Added Indigo Disk Moves
|
||||
* Data by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3704
|
||||
* Moves with existing effects by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3704
|
||||
* Thunderclap
|
||||
* Mighty Cleave
|
||||
* Tachyon Cutter
|
||||
* Hard Press
|
||||
* Temper Flare
|
||||
* Animation by @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4145
|
||||
* Supercell Slam
|
||||
* Malignant Chain
|
||||
* New move effects
|
||||
* By @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3853
|
||||
* Burning Bulwark (uses Protect's animation as placeholder)
|
||||
* Alluring Voice (and animation)
|
||||
* Fickle Beam
|
||||
* Electro Shot
|
||||
* Animation by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4148
|
||||
* Psychic Noise by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4005
|
||||
* Animation by @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4145
|
||||
* Cleanup by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4021
|
||||
* Upper Hand (and animation) by @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4085
|
||||
* Dragon Cheer by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4122
|
||||
* Cleanup by @AlexOn1ine, based on comments by @Skeli789 and @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/4136
|
||||
* Added move animations for existing moves:
|
||||
* By @ZnogyroP, with adjustments from @AlexOn1ine and @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/3989
|
||||
* Raging Bull
|
||||
* Gigaton Hammer
|
||||
* Ice Spinner
|
||||
* Aqua Cutter
|
||||
* Jet Punch by @PCG06 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4067
|
||||
* By @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4145
|
||||
* Last Respects
|
||||
* Lumina Crash
|
||||
* Kowtow Cleave
|
||||
* Torch Song
|
||||
* Aqua Step
|
||||
* Hydro Steam
|
||||
* Tidy Up
|
||||
* Pounce
|
||||
* Trailblaze
|
||||
* Chilling Water
|
||||
* Rage Fist
|
||||
|
||||
### Changed
|
||||
* Updated move data to Gen 9 with configs by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3704
|
||||
* Added `sketchBanned` move flag, given to:
|
||||
* Sketch, Dark Void, Hyperspace Fury, Revival Blessing, Torque moves.
|
||||
* Luster Purge: 70 Power -> 95 Power
|
||||
* Mist Ball: 70 Power -> 95 Power
|
||||
* Aeroblast: Added Wind Move flag.
|
||||
* Ivy Cudgel's type now changes based on Ogerpon's form rather than held item by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3865
|
||||
* Renamed `healBlockBanned` flag to `healingMove` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3981
|
||||
* Removed some hardcoded move IDs
|
||||
* By @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3982
|
||||
* `MOVE_EXPLOSION`, `MOVE_SELF_DESTRUCT`, `MOVE_FRUSTRATION`, `MOVE_AURA_WHEEL`, `MOVE_PRESENT`, `MOVE_BLIZZARD`.
|
||||
* By @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4085
|
||||
* `MOVE_SUCKER_PUNCH`.
|
||||
* Removed now redundant `EFFECT_HURRICANE` in favor of `EFFECT_THUNDER` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3982
|
||||
* Renamed `constants/z_move_effects.h` to `constants/battle_z_move_effects.h` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3982
|
||||
* Updated Draco Meteor's animation to use @Skeli789's from CFRU, by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3989
|
||||
* Improved Double Shock's animation by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3989
|
||||
* Set `EFFECT_PLACEHOLDER` as the default move effect by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4079
|
||||
* Renamed `EFFECT_FAKE_OUT` to `EFFECT_FIRST_TURN_ONLY` due to the flinch effect separation by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4081
|
||||
* Renamed `EFFECT_WRING_OUT` to `EFFECT_VARY_POWER_BASED_ON_HP` and now it uses `argument` to set its base power by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4180
|
||||
### Fixed
|
||||
* Fixed `GetBattleAnimMoveTargets` function that caused multiple animation issues, such as Overheat's animation by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/4139
|
||||
* Fixed hardcoded battle strings by @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4147
|
||||
* Hospitality had Sinistcha's name hardcoded.
|
||||
* Battler prefixes (eg. "The opposing") were hardcoded in some places.
|
||||
* Fixed Supreme Overlord's incorrect effect by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4151
|
||||
* Fixed Hard Press' base power by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4180
|
||||
* Fixed Teeter Dance not being copyable by Dancer in singles by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4129
|
||||
* *Known issue*: In doubles, it copies the move, but only confuses a single Pokémon.
|
||||
|
||||
## 🎭 Abilities 🎭
|
||||
### Added
|
||||
* Added Mind's Eye by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3782
|
||||
* Added Hospitality by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3818
|
||||
* Fixed Dynamax interaction by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3821
|
||||
* Added Embody Aspect (all 4 versions) by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3821
|
||||
* Added Supersweet Syrup by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/4115
|
||||
* Cleanup by
|
||||
* @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4170
|
||||
* @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4171
|
||||
* Indigo Disk Abilities
|
||||
* Data by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3838
|
||||
### Changed
|
||||
* Updated ability banlists to Indigo Disk data by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3609
|
||||
### Fixed
|
||||
* Fixed Tangling Hair preventing Rocky Helmet from triggering interaction by @AlexOn1ine, with help from @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4219
|
||||
|
||||
## 🧶 Items 🧶
|
||||
### Added
|
||||
* Added Meteorite item form change functionality for Deoxys by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3770
|
||||
* Added item price configs by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3834
|
||||
* `I_PRICE` and `I_BERRY_PRICE`.
|
||||
* Fixed missing data by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3836
|
||||
* Added Pokemon Box Link functionality by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3837
|
||||
* Added Indigo Disk item data by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3854
|
||||
* Metal Alloy
|
||||
* Stellar Tera Shard
|
||||
* Added Legends: Arceus item data by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3825
|
||||
* Jubilife Muffin - Local specialty (Full Heal)
|
||||
* Remedy - Medicine (Potion)
|
||||
* Fine Remedy - Medicine (Super Potion)
|
||||
* Super Remedy - Medicine (Hyper Potion)
|
||||
* Aux items
|
||||
* Aux Evasion
|
||||
* Aux Power
|
||||
* Aux Guard
|
||||
* Aux Powerguard
|
||||
* Sprites based off [lichen's sprites from Relic Castle](https://reliccastle.com/resources/1287/) by @MartyKen in https://github.com/rh-hideout/pokeemerald-expansion/pull/4160
|
||||
* Choice Dumpling
|
||||
* Swap Snack
|
||||
* Twice Spiced Radish
|
||||
* Pokéshi Doll
|
||||
* ***Berry Expansion*** by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3618
|
||||
* Berry Mutations (from XY): Planting a Berry tree next to another has a `BERRY_MUTATION_CHANCE` (25% by default) chance of causing a mutation (as dictated by `sBerryMutations`). Mutations mean that besides the usual output, the Berry plant will have a single Berry of the mutation (e.g. planting a Iapapa Berry next to a Mago Berry will cause it to have a single Pomeg Berry on top of its usual output).
|
||||
* Enabled via `OW_BERRY_MUTATIONS` config.
|
||||
* Easier Berry Debugging: Add berry manipulation functions to the debug menu to allow for forced growth and more.
|
||||
* Mulch (from Gen IV and XY): Using it on soil affects the growth, watering and production values of the plants.
|
||||
* Enabled via `OW_BERRY_MULCH_USAGE` config.
|
||||
* Gradient watering (from Gen IV and XY) (`OW_BERRY_MOISTURE` and `OW_BERRY_ALWAYS_WATERABLE`): rather than keeping track of if each stage has been watered like Gen III, the humidity of the soil is kept track of separately.
|
||||
* Enabled via `OW_BERRY_MOISTURE` config.
|
||||
* Switch between Gen4/6 via `OW_BERRY_ALWAYS_WATERABLE` config.
|
||||
* Rate of drying set by `OW_BERRY_DRAIN_RATE` config.
|
||||
* Weeding from XY: Berries may require unweeding for additional produce.
|
||||
* Enabled via `OW_BERRY_WEEDS` config.
|
||||
* Pests (from XY): Bug-type Pokémon may appear to feast on your plants.
|
||||
* Enabled via `OW_BERRY_PESTS` config.
|
||||
* Customisable stages: XY has six stages rather than four, so with this easy toggle you can choose the amount of stages without influencing the growth time.
|
||||
* Enabled via `OW_BERRY_SIX_STAGES` config.
|
||||
* Growth configs: Pick a generation whose Berry growth rates to use
|
||||
* Changed via `OW_BERRY_GROWTH_RATE` config.
|
||||
* Yield configs: Pick a generation whose Berry yields to use
|
||||
* Changed via `OW_BERRY_YIELD_RATE` config.
|
||||
* Cleanup by
|
||||
* @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3931
|
||||
* @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/4028
|
||||
* @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4275
|
||||
* Added missing pre-Gen7 Power Item config (giving 4 EVs instead of 8) by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3961
|
||||
* Added LGPE+ Premier Ball Bonus config by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4191
|
||||
* Originally based off [pret's tutorial](https://github.com/pret/pokeemerald/wiki/LGPE-Style-Bonus-Premier-Balls), but with the following changes:
|
||||
- If there's no space for the full amount of Premier Balls that would've been given, give the partial amount.
|
||||
- Shows the amount of Premier Balls given.
|
||||
### Changed
|
||||
* ***Raised the limit of max items per stack to 999*** by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/3923
|
||||
* ***Unified item data***
|
||||
* Move descriptions are now defined in `src/data/items.h` instead of `src/data/text/item_descriptions.h` by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/3432
|
||||
* Cleanup by
|
||||
* @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3797
|
||||
* @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4088
|
||||
* Moved Item Effects (`gItemEffectTable`) to `gItemsInfo` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3991
|
||||
* Renamed `gItems` to `gItemsInfo` by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4068
|
||||
* Item Balls now can be defined in the map's JSON (or using PoryMap) via the common script `Common_EventScript_FindItem` instead of needing to define a new script for it by @pkmnsnfrn in https://github.com/rh-hideout/pokeemerald-expansion/pull/3942
|
||||
```diff
|
||||
"trainer_type": "TRAINER_TYPE_NONE",
|
||||
- "trainer_sight_or_berry_tree_id": "0",
|
||||
- "script": "AbandonedShip_CaptainsOffice_EventScript_ItemStorageKey",
|
||||
+ "trainer_sight_or_berry_tree_id": "ITEM_STORAGE_KEY",
|
||||
+ "script": "Common_EventScript_FindItem",
|
||||
"flag": "FLAG_ITEM_ABANDONED_SHIP_CAPTAINS_OFFICE_STORAGE_KEY"
|
||||
```
|
||||
* Item count can also be defined by using the `movement_range_x` field:
|
||||
```diff
|
||||
"trainer_sight_or_berry_tree_id": "ITEM_NUGGET",
|
||||
"script": "Common_EventScript_FindItem",
|
||||
"flag": "FLAG_ITEM_AQUA_HIDEOUT_B1F_NUGGET"
|
||||
+ "movement_range_x": 2,
|
||||
```
|
||||
* Existing scripts have been adapted to use this new format.
|
||||
* Added plural item name support with new `pluralName` field in `gItemsInfo` by @pkmnsnfrn in https://github.com/rh-hideout/pokeemerald-expansion/pull/3942
|
||||
* When obtaining multiples of an item and the field is not defined, it appends an `s` at the end instead (eg. "Brendan got 40 Potion***s***!").
|
||||
* Python migration script available in `migration_scripts/item_ball_refactor.py` by @pkmnsnfrn in https://github.com/rh-hideout/pokeemerald-expansion/pull/3997
|
||||
* Deprecated `GetBerryCountString` by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4012
|
||||
* Cleanup by
|
||||
* @pkmnsnfrn in https://github.com/rh-hideout/pokeemerald-expansion/pull/4001
|
||||
* @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4015
|
||||
* Combined `CannotUseBagBattleItem` and `CannotUsePartyBattleItem` into `CannotUseItemsInBattle` by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/3524
|
||||
### Fixed
|
||||
* Fixed some ball multiplier data by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3939
|
||||
* Fixed `B_SPORT_BALL_MODIFIER` config being ignored and always applying a 1.5x multiplier.
|
||||
* Added missing `B_SAFARI_BALL_MODIFIER` that makes Safari Balls have a 1x multiplier from Gen7 onwards.
|
||||
* Added missing `B_LURE_BALL_MODIFIER` state that sets Lure Ball's multiplier to 4x from Gen8 onwards.
|
||||
* Fixed Quick Claw having increased chances of activation in double battles by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/4266
|
||||
|
||||
## 🤖 Battle AI 🤖
|
||||
### Added
|
||||
* Added `AI_CalcMoveScore` function to more easily control score increases by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3984
|
||||
* Added `AI_FLAG_POWERFUL_STATUS` AI flag, replacing `AI_FLAG_SCREENER` by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4125
|
||||
* It's meant to force the AI to do status instead of fainting the target (eg. setting up Trick Room to support the rest of the team)
|
||||
### Changed
|
||||
* AI flags are now saved by battler position instead of per side by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/3003
|
||||
* Cleanup by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4114
|
||||
### Fixed
|
||||
* Improved AI score changes handling by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4036
|
||||
* AI will not further increase Attack / Sp. Atk stat if it knows it faints to target.
|
||||
* AI will not use Throat Chop if opposing mon has a better move.
|
||||
* AI will select Throat Chop if the sound move is the best damaging move from opposing mon.
|
||||
* Cleanup by
|
||||
* @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4074
|
||||
* @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4075
|
||||
* @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4199
|
||||
* Fixed AI not setting sets up double flags correctly by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4228
|
||||
* Move most damage `AI_BadMove` checks to `AI_CalcDamage` by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4238
|
||||
* Fixes AI trying to use Burn Up after losing its fire type.
|
||||
* Fixes AI trying to use Electric moves when the target has Volt Absorb.
|
||||
* Fixed AI vs AI battles would crash during the throw animation by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4240
|
||||
* Fixed AI considering Mold Breaker but not Turboblaze/Teravolt for flinch-related decisions by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4244
|
||||
|
||||
## 🧹 Other Cleanup 🧹
|
||||
* Removed hardcoded uses of `MOVE_STUFF_CHEEKS` and `MOVE_ME_FIRST` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3950
|
||||
* Cleaned up `CheckMoveLimitations` to use less horizontal space by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3950
|
||||
* Small `CanFirstMonBoostHeldItemRarity` optimization by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4008
|
||||
* Tag previously-unused icon pals as such in code. by @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/4072
|
||||
* Converted a bunch of `#if/#else` to regular conditions by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4071
|
||||
* Clean up contest strings by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3876
|
||||
* Fixed inconsistent braces style by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4023
|
||||
* Replaced some `AI_GetMoveEffectiveness` instances with `AI_CanStatus` for speeding up calculations by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/4166
|
||||
* Remove some unused data by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4239
|
||||
* Use `u32` instead of `u8`/`u16` in gflib files by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4250
|
||||
* Unify monSpritesGfx bytes/ptr field by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4252
|
||||
* `gHeap` can go in the middle of ram by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4253
|
||||
* Corrected initial value of `targetSpecies` variable in `GetEvolutionTargetSpecies` by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/4269
|
||||
* Replaces `MOVE_FIRST_IMPRESSION` argument with a check for Fake Out for 100% flinch effect by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4274
|
||||
|
||||
## 🧪 Test Runner 🧪
|
||||
### Added
|
||||
* Added option to set flags in tests by @fakuzatsu in https://github.com/rh-hideout/pokeemerald-expansion/pull/3786
|
||||
* Added missing Illuminate and Keen Eye Tests by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3782
|
||||
* Added missing Belly Drum tests by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3616
|
||||
* Added missing Stuff Cheeks by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3950
|
||||
* Added Teeter Dance + Dancer test for doubles by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4274
|
||||
### Changed
|
||||
* Updated tests to use Gen 9 mon for appropiate abilities by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3740
|
||||
* Tests no longer allow to use SEND_OUT if the chosen mon is fainted by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3752
|
||||
### Fixed
|
||||
* Consistent `BENCHMARK` timing by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/3866
|
||||
* Fixed Teatime test checking for Wonder Room instead of Magic Room by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3950
|
||||
* Fixed test battle move category assumptions by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4051
|
||||
* Fixed Tri Attack status ability immunity test by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4229
|
||||
* Fixed Dauntless Shield test names by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4229
|
||||
|
||||
## 📦 Pret merges 📦
|
||||
* 2023/12/30 by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3869
|
||||
* 2024/02/10 by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4173
|
||||
* 2024/03/07 by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4255
|
||||
|
||||
## New Contributors
|
||||
* @cfmnephrite made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/3575
|
||||
* @tertu-m made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/3780
|
||||
* @aronson made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/3892
|
||||
* @MartyKen made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4049
|
||||
* @ZnogyroP made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4085
|
||||
* @Nopinou made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4169
|
||||
|
||||
**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.7.4...expansion/1.8.0
|
||||
|
||||
<!--Last PR: 4272-->
|
||||
@ -17,6 +17,14 @@
|
||||
### Fixed
|
||||
* N/A
|
||||
|
||||
## ✨ Feature Branches ✨
|
||||
### Added
|
||||
* N/A
|
||||
### Changed
|
||||
* N/A
|
||||
### Fixed
|
||||
* N/A
|
||||
|
||||
## 🐉 Pokémon 🐉
|
||||
### Added
|
||||
* N/A
|
||||
|
||||
145
gflib/bg.c
145
gflib/bg.c
@ -19,9 +19,6 @@ struct BgControl
|
||||
u8 charBaseIndex:2;
|
||||
u8 mapBaseIndex:5;
|
||||
u8 paletteMode:1;
|
||||
|
||||
u8 unknown_2; // Assigned to but never read
|
||||
u8 unknown_3; // Assigned to but never read
|
||||
} configs[NUM_BACKGROUNDS];
|
||||
|
||||
u16 bgVisibilityAndMode;
|
||||
@ -31,7 +28,6 @@ struct BgConfig2
|
||||
{
|
||||
u32 baseTile:10;
|
||||
u32 basePalette:4;
|
||||
u32 unk_3:18;
|
||||
|
||||
void *tilemap;
|
||||
s32 bg_x;
|
||||
@ -46,7 +42,7 @@ u32 gWindowTileAutoAllocEnabled;
|
||||
|
||||
static const struct BgConfig sZeroedBgControlStruct = { 0 };
|
||||
|
||||
static u32 GetBgType(u8 bg);
|
||||
static u32 GetBgType(u32 bg);
|
||||
|
||||
void ResetBgs(void)
|
||||
{
|
||||
@ -55,13 +51,13 @@ void ResetBgs(void)
|
||||
SetTextModeAndHideBgs();
|
||||
}
|
||||
|
||||
static void SetBgModeInternal(u8 bgMode)
|
||||
static void SetBgModeInternal(u32 bgMode)
|
||||
{
|
||||
sGpuBgConfigs.bgVisibilityAndMode &= ~0x7;
|
||||
sGpuBgConfigs.bgVisibilityAndMode |= bgMode;
|
||||
}
|
||||
|
||||
u8 GetBgMode(void)
|
||||
u32 GetBgMode(void)
|
||||
{
|
||||
return sGpuBgConfigs.bgVisibilityAndMode & 0x7;
|
||||
}
|
||||
@ -76,7 +72,7 @@ void ResetBgControlStructs(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Unused_ResetBgControlStruct(u8 bg)
|
||||
void Unused_ResetBgControlStruct(u32 bg)
|
||||
{
|
||||
if (!IsInvalidBg(bg))
|
||||
{
|
||||
@ -96,7 +92,7 @@ enum
|
||||
BG_CTRL_ATTR_WRAPAROUND = 8,
|
||||
};
|
||||
|
||||
static void SetBgControlAttributes(u8 bg, u8 charBaseIndex, u8 mapBaseIndex, u8 screenSize, u8 paletteMode, u8 priority, u8 mosaic, u8 wraparound)
|
||||
static void SetBgControlAttributes(u32 bg, u8 charBaseIndex, u8 mapBaseIndex, u8 screenSize, u8 paletteMode, u8 priority, u8 mosaic, u8 wraparound)
|
||||
{
|
||||
if (!IsInvalidBg(bg))
|
||||
{
|
||||
@ -135,14 +131,11 @@ static void SetBgControlAttributes(u8 bg, u8 charBaseIndex, u8 mapBaseIndex, u8
|
||||
sGpuBgConfigs.configs[bg].wraparound = wraparound;
|
||||
}
|
||||
|
||||
sGpuBgConfigs.configs[bg].unknown_2 = 0;
|
||||
sGpuBgConfigs.configs[bg].unknown_3 = 0;
|
||||
|
||||
sGpuBgConfigs.configs[bg].visible = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static u16 GetBgControlAttribute(u8 bg, u8 attributeId)
|
||||
static u16 GetBgControlAttribute(u32 bg, u32 attributeId)
|
||||
{
|
||||
if (!IsInvalidBg(bg) && sGpuBgConfigs.configs[bg].visible)
|
||||
{
|
||||
@ -170,7 +163,7 @@ static u16 GetBgControlAttribute(u8 bg, u8 attributeId)
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode)
|
||||
u8 LoadBgVram(u32 bg, const void *src, u16 size, u16 destOffset, u32 mode)
|
||||
{
|
||||
u16 offset;
|
||||
s8 cursor;
|
||||
@ -202,7 +195,7 @@ u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode)
|
||||
return cursor;
|
||||
}
|
||||
|
||||
static void ShowBgInternal(u8 bg)
|
||||
static void ShowBgInternal(u32 bg)
|
||||
{
|
||||
u16 value;
|
||||
if (!IsInvalidBg(bg) && sGpuBgConfigs.configs[bg].visible)
|
||||
@ -222,7 +215,7 @@ static void ShowBgInternal(u8 bg)
|
||||
}
|
||||
}
|
||||
|
||||
static void HideBgInternal(u8 bg)
|
||||
static void HideBgInternal(u32 bg)
|
||||
{
|
||||
if (!IsInvalidBg(bg))
|
||||
{
|
||||
@ -241,7 +234,7 @@ void SetTextModeAndHideBgs(void)
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) & ~DISPCNT_ALL_BG_AND_MODE_BITS);
|
||||
}
|
||||
|
||||
static void SetBgAffineInternal(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle)
|
||||
static void SetBgAffineInternal(u32 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle)
|
||||
{
|
||||
struct BgAffineSrcData src;
|
||||
struct BgAffineDstData dest;
|
||||
@ -282,7 +275,7 @@ static void SetBgAffineInternal(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispC
|
||||
SetGpuReg(REG_OFFSET_BG2Y_H, (s16)(dest.dy >> 16));
|
||||
}
|
||||
|
||||
bool8 IsInvalidBg(u8 bg)
|
||||
bool32 IsInvalidBg(u32 bg)
|
||||
{
|
||||
if (bg >= NUM_BACKGROUNDS)
|
||||
return TRUE;
|
||||
@ -309,10 +302,10 @@ void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable)
|
||||
gWindowTileAutoAllocEnabled = leftoverFireRedLeafGreenVariable;
|
||||
}
|
||||
|
||||
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates)
|
||||
void InitBgsFromTemplates(u32 bgMode, const struct BgTemplate *templates, u8 numTemplates)
|
||||
{
|
||||
int i;
|
||||
u8 bg;
|
||||
u32 bg;
|
||||
|
||||
SetBgModeInternal(bgMode);
|
||||
ResetBgControlStructs();
|
||||
@ -333,7 +326,6 @@ void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numT
|
||||
|
||||
sGpuBgConfigs2[bg].baseTile = templates[i].baseTile;
|
||||
sGpuBgConfigs2[bg].basePalette = 0;
|
||||
sGpuBgConfigs2[bg].unk_3 = 0;
|
||||
|
||||
sGpuBgConfigs2[bg].tilemap = NULL;
|
||||
sGpuBgConfigs2[bg].bg_x = 0;
|
||||
@ -344,7 +336,7 @@ void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numT
|
||||
|
||||
void InitBgFromTemplate(const struct BgTemplate *template)
|
||||
{
|
||||
u8 bg = template->bg;
|
||||
u32 bg = template->bg;
|
||||
|
||||
if (bg < NUM_BACKGROUNDS)
|
||||
{
|
||||
@ -359,7 +351,6 @@ void InitBgFromTemplate(const struct BgTemplate *template)
|
||||
|
||||
sGpuBgConfigs2[bg].baseTile = template->baseTile;
|
||||
sGpuBgConfigs2[bg].basePalette = 0;
|
||||
sGpuBgConfigs2[bg].unk_3 = 0;
|
||||
|
||||
sGpuBgConfigs2[bg].tilemap = NULL;
|
||||
sGpuBgConfigs2[bg].bg_x = 0;
|
||||
@ -367,12 +358,12 @@ void InitBgFromTemplate(const struct BgTemplate *template)
|
||||
}
|
||||
}
|
||||
|
||||
void SetBgMode(u8 bgMode)
|
||||
void SetBgMode(u32 bgMode)
|
||||
{
|
||||
SetBgModeInternal(bgMode);
|
||||
}
|
||||
|
||||
u16 LoadBgTiles(u8 bg, const void *src, u16 size, u16 destOffset)
|
||||
u16 LoadBgTiles(u32 bg, const void *src, u16 size, u16 destOffset)
|
||||
{
|
||||
u16 tileOffset;
|
||||
u8 cursor;
|
||||
@ -404,7 +395,7 @@ u16 LoadBgTiles(u8 bg, const void *src, u16 size, u16 destOffset)
|
||||
return cursor;
|
||||
}
|
||||
|
||||
u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset)
|
||||
u16 LoadBgTilemap(u32 bg, const void *src, u16 size, u16 destOffset)
|
||||
{
|
||||
u8 cursor = LoadBgVram(bg, src, size, destOffset * 2, DISPCNT_MODE_2);
|
||||
|
||||
@ -418,11 +409,11 @@ u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset)
|
||||
return cursor;
|
||||
}
|
||||
|
||||
u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset)
|
||||
u16 Unused_LoadBgPalette(u32 bg, const void *src, u16 size, u16 destOffset)
|
||||
{
|
||||
s8 cursor;
|
||||
|
||||
if (!IsInvalidBg32(bg))
|
||||
if (!IsInvalidBg(bg))
|
||||
{
|
||||
u16 paletteOffset = PLTT_OFFSET_4BPP(sGpuBgConfigs2[bg].basePalette) + (destOffset * 2);
|
||||
cursor = RequestDma3Copy(src, (void *)(paletteOffset + BG_PLTT), size, 0);
|
||||
@ -440,7 +431,7 @@ u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset)
|
||||
return (u8)cursor;
|
||||
}
|
||||
|
||||
bool8 IsDma3ManagerBusyWithBgCopy(void)
|
||||
bool32 IsDma3ManagerBusyWithBgCopy(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -464,19 +455,19 @@ bool8 IsDma3ManagerBusyWithBgCopy(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ShowBg(u8 bg)
|
||||
void ShowBg(u32 bg)
|
||||
{
|
||||
ShowBgInternal(bg);
|
||||
SyncBgVisibilityAndMode();
|
||||
}
|
||||
|
||||
void HideBg(u8 bg)
|
||||
void HideBg(u32 bg)
|
||||
{
|
||||
HideBgInternal(bg);
|
||||
SyncBgVisibilityAndMode();
|
||||
}
|
||||
|
||||
void SetBgAttribute(u8 bg, u8 attributeId, u8 value)
|
||||
void SetBgAttribute(u32 bg, u32 attributeId, u8 value)
|
||||
{
|
||||
switch (attributeId)
|
||||
{
|
||||
@ -504,7 +495,7 @@ void SetBgAttribute(u8 bg, u8 attributeId, u8 value)
|
||||
}
|
||||
}
|
||||
|
||||
u16 GetBgAttribute(u8 bg, u8 attributeId)
|
||||
u16 GetBgAttribute(u32 bg, u32 attributeId)
|
||||
{
|
||||
switch (attributeId)
|
||||
{
|
||||
@ -541,13 +532,13 @@ u16 GetBgAttribute(u8 bg, u8 attributeId)
|
||||
}
|
||||
}
|
||||
|
||||
s32 ChangeBgX(u8 bg, s32 value, u8 op)
|
||||
s32 ChangeBgX(u32 bg, s32 value, u8 op)
|
||||
{
|
||||
u8 mode;
|
||||
u32 mode;
|
||||
u16 temp1;
|
||||
u16 temp2;
|
||||
|
||||
if (IsInvalidBg32(bg) || !GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
if (IsInvalidBg(bg) || !GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -611,9 +602,9 @@ s32 ChangeBgX(u8 bg, s32 value, u8 op)
|
||||
return sGpuBgConfigs2[bg].bg_x;
|
||||
}
|
||||
|
||||
s32 GetBgX(u8 bg)
|
||||
s32 GetBgX(u32 bg)
|
||||
{
|
||||
if (IsInvalidBg32(bg))
|
||||
if (IsInvalidBg(bg))
|
||||
return -1;
|
||||
else if (!GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
return -1;
|
||||
@ -621,13 +612,13 @@ s32 GetBgX(u8 bg)
|
||||
return sGpuBgConfigs2[bg].bg_x;
|
||||
}
|
||||
|
||||
s32 ChangeBgY(u8 bg, s32 value, u8 op)
|
||||
s32 ChangeBgY(u32 bg, s32 value, u8 op)
|
||||
{
|
||||
u8 mode;
|
||||
u32 mode;
|
||||
u16 temp1;
|
||||
u16 temp2;
|
||||
|
||||
if (IsInvalidBg32(bg) || !GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
if (IsInvalidBg(bg) || !GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -691,13 +682,13 @@ s32 ChangeBgY(u8 bg, s32 value, u8 op)
|
||||
return sGpuBgConfigs2[bg].bg_y;
|
||||
}
|
||||
|
||||
s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op)
|
||||
s32 ChangeBgY_ScreenOff(u32 bg, s32 value, u8 op)
|
||||
{
|
||||
u8 mode;
|
||||
u32 mode;
|
||||
u16 temp1;
|
||||
u16 temp2;
|
||||
|
||||
if (IsInvalidBg32(bg) || !GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
if (IsInvalidBg(bg) || !GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -762,9 +753,9 @@ s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op)
|
||||
return sGpuBgConfigs2[bg].bg_y;
|
||||
}
|
||||
|
||||
s32 GetBgY(u8 bg)
|
||||
s32 GetBgY(u32 bg)
|
||||
{
|
||||
if (IsInvalidBg32(bg))
|
||||
if (IsInvalidBg(bg))
|
||||
return -1;
|
||||
else if (!GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
return -1;
|
||||
@ -772,12 +763,12 @@ s32 GetBgY(u8 bg)
|
||||
return sGpuBgConfigs2[bg].bg_y;
|
||||
}
|
||||
|
||||
void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle)
|
||||
void SetBgAffine(u32 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle)
|
||||
{
|
||||
SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle);
|
||||
}
|
||||
|
||||
u8 Unused_AdjustBgMosaic(u8 val, u8 mode)
|
||||
u8 Unused_AdjustBgMosaic(u8 val, u32 mode)
|
||||
{
|
||||
u16 mosaic = GetGpuReg(REG_OFFSET_MOSAIC);
|
||||
s16 bgH = mosaic & 0xF;
|
||||
@ -848,25 +839,25 @@ u8 Unused_AdjustBgMosaic(u8 val, u8 mode)
|
||||
return mosaic;
|
||||
}
|
||||
|
||||
void SetBgTilemapBuffer(u8 bg, void *tilemap)
|
||||
void SetBgTilemapBuffer(u32 bg, void *tilemap)
|
||||
{
|
||||
if (!IsInvalidBg32(bg) && GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
if (!IsInvalidBg(bg) && GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
{
|
||||
sGpuBgConfigs2[bg].tilemap = tilemap;
|
||||
}
|
||||
}
|
||||
|
||||
void UnsetBgTilemapBuffer(u8 bg)
|
||||
void UnsetBgTilemapBuffer(u32 bg)
|
||||
{
|
||||
if (!IsInvalidBg32(bg) && GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
if (!IsInvalidBg(bg) && GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
{
|
||||
sGpuBgConfigs2[bg].tilemap = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void *GetBgTilemapBuffer(u8 bg)
|
||||
void *GetBgTilemapBuffer(u32 bg)
|
||||
{
|
||||
if (IsInvalidBg32(bg))
|
||||
if (IsInvalidBg(bg))
|
||||
return NULL;
|
||||
else if (!GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
return NULL;
|
||||
@ -874,9 +865,9 @@ void *GetBgTilemapBuffer(u8 bg)
|
||||
return sGpuBgConfigs2[bg].tilemap;
|
||||
}
|
||||
|
||||
void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset)
|
||||
void CopyToBgTilemapBuffer(u32 bg, const void *src, u16 mode, u16 destOffset)
|
||||
{
|
||||
if (!IsInvalidBg32(bg) && !IsTileMapOutsideWram(bg))
|
||||
if (!IsInvalidBg(bg) && !IsTileMapOutsideWram(bg))
|
||||
{
|
||||
if (mode != 0)
|
||||
CpuCopy16(src, (void *)(sGpuBgConfigs2[bg].tilemap + (destOffset * 2)), mode);
|
||||
@ -885,11 +876,11 @@ void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset)
|
||||
}
|
||||
}
|
||||
|
||||
void CopyBgTilemapBufferToVram(u8 bg)
|
||||
void CopyBgTilemapBufferToVram(u32 bg)
|
||||
{
|
||||
u16 sizeToLoad;
|
||||
|
||||
if (!IsInvalidBg32(bg) && !IsTileMapOutsideWram(bg))
|
||||
if (!IsInvalidBg(bg) && !IsTileMapOutsideWram(bg))
|
||||
{
|
||||
switch (GetBgType(bg))
|
||||
{
|
||||
@ -907,13 +898,13 @@ void CopyBgTilemapBufferToVram(u8 bg)
|
||||
}
|
||||
}
|
||||
|
||||
void CopyToBgTilemapBufferRect(u8 bg, const void *src, u8 destX, u8 destY, u8 width, u8 height)
|
||||
void CopyToBgTilemapBufferRect(u32 bg, const void *src, u8 destX, u8 destY, u8 width, u8 height)
|
||||
{
|
||||
u16 destX16;
|
||||
u16 destY16;
|
||||
u16 mode;
|
||||
|
||||
if (!IsInvalidBg32(bg) && !IsTileMapOutsideWram(bg))
|
||||
if (!IsInvalidBg(bg) && !IsTileMapOutsideWram(bg))
|
||||
{
|
||||
switch (GetBgType(bg))
|
||||
{
|
||||
@ -946,19 +937,19 @@ void CopyToBgTilemapBufferRect(u8 bg, const void *src, u8 destX, u8 destY, u8 wi
|
||||
}
|
||||
}
|
||||
|
||||
void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette)
|
||||
void CopyToBgTilemapBufferRect_ChangePalette(u32 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette)
|
||||
{
|
||||
CopyRectToBgTilemapBufferRect(bg, src, 0, 0, rectWidth, rectHeight, destX, destY, rectWidth, rectHeight, palette, 0, 0);
|
||||
}
|
||||
|
||||
void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, s16 tileOffset, s16 palette2)
|
||||
void CopyRectToBgTilemapBufferRect(u32 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, s16 tileOffset, s16 palette2)
|
||||
{
|
||||
u16 screenWidth, screenHeight, screenSize;
|
||||
u16 var;
|
||||
const void *srcPtr;
|
||||
u16 i, j;
|
||||
|
||||
if (!IsInvalidBg32(bg) && !IsTileMapOutsideWram(bg))
|
||||
if (!IsInvalidBg(bg) && !IsTileMapOutsideWram(bg))
|
||||
{
|
||||
screenSize = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE);
|
||||
screenWidth = GetBgMetricTextMode(bg, 0x1) * 0x20;
|
||||
@ -995,13 +986,13 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
|
||||
}
|
||||
}
|
||||
|
||||
void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height)
|
||||
void FillBgTilemapBufferRect_Palette0(u32 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height)
|
||||
{
|
||||
u16 x16;
|
||||
u16 y16;
|
||||
u16 mode;
|
||||
|
||||
if (!IsInvalidBg32(bg) && !IsTileMapOutsideWram(bg))
|
||||
if (!IsInvalidBg(bg) && !IsTileMapOutsideWram(bg))
|
||||
{
|
||||
switch (GetBgType(bg))
|
||||
{
|
||||
@ -1028,12 +1019,12 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width,
|
||||
}
|
||||
}
|
||||
|
||||
void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette)
|
||||
void FillBgTilemapBufferRect(u32 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette)
|
||||
{
|
||||
WriteSequenceToBgTilemapBuffer(bg, tileNum, x, y, width, height, palette, 0);
|
||||
}
|
||||
|
||||
void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta)
|
||||
void WriteSequenceToBgTilemapBuffer(u32 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta)
|
||||
{
|
||||
u16 mode;
|
||||
u16 mode2;
|
||||
@ -1041,7 +1032,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
||||
u16 mode3;
|
||||
u16 x16, y16;
|
||||
|
||||
if (!IsInvalidBg32(bg) && !IsTileMapOutsideWram(bg))
|
||||
if (!IsInvalidBg(bg) && !IsTileMapOutsideWram(bg))
|
||||
{
|
||||
attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE);
|
||||
mode = GetBgMetricTextMode(bg, 0x1) * 0x20;
|
||||
@ -1073,7 +1064,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
|
||||
}
|
||||
}
|
||||
|
||||
u16 GetBgMetricTextMode(u8 bg, u8 whichMetric)
|
||||
u16 GetBgMetricTextMode(u32 bg, u32 whichMetric)
|
||||
{
|
||||
u8 screenSize = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE);
|
||||
|
||||
@ -1119,7 +1110,7 @@ u16 GetBgMetricTextMode(u8 bg, u8 whichMetric)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric)
|
||||
u32 GetBgMetricAffineMode(u32 bg, u32 whichMetric)
|
||||
{
|
||||
u8 screenSize = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE);
|
||||
|
||||
@ -1192,9 +1183,9 @@ void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s
|
||||
*dest = var;
|
||||
}
|
||||
|
||||
static u32 GetBgType(u8 bg)
|
||||
static u32 GetBgType(u32 bg)
|
||||
{
|
||||
u8 mode = GetBgMode();
|
||||
u32 mode = GetBgMode();
|
||||
|
||||
switch (bg)
|
||||
{
|
||||
@ -1231,15 +1222,7 @@ static u32 GetBgType(u8 bg)
|
||||
return BG_TYPE_NONE;
|
||||
}
|
||||
|
||||
bool32 IsInvalidBg32(u8 bg)
|
||||
{
|
||||
if (bg >= NUM_BACKGROUNDS)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 IsTileMapOutsideWram(u8 bg)
|
||||
bool32 IsTileMapOutsideWram(u32 bg)
|
||||
{
|
||||
if (sGpuBgConfigs2[bg].tilemap > (void *)IWRAM_END)
|
||||
return TRUE;
|
||||
|
||||
71
gflib/bg.h
71
gflib/bg.h
@ -51,48 +51,47 @@ struct BgTemplate
|
||||
};
|
||||
|
||||
void ResetBgs(void);
|
||||
u8 GetBgMode(void);
|
||||
u32 GetBgMode(void);
|
||||
void ResetBgControlStructs(void);
|
||||
void Unused_ResetBgControlStruct(u8 bg);
|
||||
u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode);
|
||||
void Unused_ResetBgControlStruct(u32 bg);
|
||||
u8 LoadBgVram(u32 bg, const void *src, u16 size, u16 destOffset, u32 mode);
|
||||
void SetTextModeAndHideBgs(void);
|
||||
bool8 IsInvalidBg(u8 bg);
|
||||
bool32 IsInvalidBg(u32 bg);
|
||||
int BgTileAllocOp(int bg, int offset, int count, int mode);
|
||||
void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable);
|
||||
void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates);
|
||||
void InitBgsFromTemplates(u32 bgMode, const struct BgTemplate *templates, u8 numTemplates);
|
||||
void InitBgFromTemplate(const struct BgTemplate *template);
|
||||
void SetBgMode(u8 bgMode);
|
||||
u16 LoadBgTiles(u8 bg, const void *src, u16 size, u16 destOffset);
|
||||
u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset);
|
||||
u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset);
|
||||
bool8 IsDma3ManagerBusyWithBgCopy(void);
|
||||
void ShowBg(u8 bg);
|
||||
void HideBg(u8 bg);
|
||||
void SetBgAttribute(u8 bg, u8 attributeId, u8 value);
|
||||
u16 GetBgAttribute(u8 bg, u8 attributeId);
|
||||
s32 ChangeBgX(u8 bg, s32 value, u8 op);
|
||||
s32 GetBgX(u8 bg);
|
||||
s32 ChangeBgY(u8 bg, s32 value, u8 op);
|
||||
s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op);
|
||||
s32 GetBgY(u8 bg);
|
||||
void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle);
|
||||
u8 Unused_AdjustBgMosaic(u8 val, u8 mode);
|
||||
void SetBgTilemapBuffer(u8 bg, void *tilemap);
|
||||
void UnsetBgTilemapBuffer(u8 bg);
|
||||
void *GetBgTilemapBuffer(u8 bg);
|
||||
void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset);
|
||||
void CopyBgTilemapBufferToVram(u8 bg);
|
||||
void CopyToBgTilemapBufferRect(u8 bg, const void *src, u8 destX, u8 destY, u8 width, u8 height);
|
||||
void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette);
|
||||
void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, s16 tileOffset, s16 palette2);
|
||||
void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height);
|
||||
void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette);
|
||||
void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta);
|
||||
u16 GetBgMetricTextMode(u8 bg, u8 whichMetric);
|
||||
u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric);
|
||||
void SetBgMode(u32 bgMode);
|
||||
u16 LoadBgTiles(u32 bg, const void *src, u16 size, u16 destOffset);
|
||||
u16 LoadBgTilemap(u32 bg, const void *src, u16 size, u16 destOffset);
|
||||
u16 Unused_LoadBgPalette(u32 bg, const void *src, u16 size, u16 destOffset);
|
||||
bool32 IsDma3ManagerBusyWithBgCopy(void);
|
||||
void ShowBg(u32 bg);
|
||||
void HideBg(u32 bg);
|
||||
void SetBgAttribute(u32 bg, u32 attributeId, u8 value);
|
||||
u16 GetBgAttribute(u32 bg, u32 attributeId);
|
||||
s32 ChangeBgX(u32 bg, s32 value, u8 op);
|
||||
s32 GetBgX(u32 bg);
|
||||
s32 ChangeBgY(u32 bg, s32 value, u8 op);
|
||||
s32 ChangeBgY_ScreenOff(u32 bg, s32 value, u8 op);
|
||||
s32 GetBgY(u32 bg);
|
||||
void SetBgAffine(u32 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle);
|
||||
u8 Unused_AdjustBgMosaic(u8 val, u32 mode);
|
||||
void SetBgTilemapBuffer(u32 bg, void *tilemap);
|
||||
void UnsetBgTilemapBuffer(u32 bg);
|
||||
void *GetBgTilemapBuffer(u32 bg);
|
||||
void CopyToBgTilemapBuffer(u32 bg, const void *src, u16 mode, u16 destOffset);
|
||||
void CopyBgTilemapBufferToVram(u32 bg);
|
||||
void CopyToBgTilemapBufferRect(u32 bg, const void *src, u8 destX, u8 destY, u8 width, u8 height);
|
||||
void CopyToBgTilemapBufferRect_ChangePalette(u32 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette);
|
||||
void CopyRectToBgTilemapBufferRect(u32 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, s16 tileOffset, s16 palette2);
|
||||
void FillBgTilemapBufferRect_Palette0(u32 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height);
|
||||
void FillBgTilemapBufferRect(u32 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette);
|
||||
void WriteSequenceToBgTilemapBuffer(u32 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta);
|
||||
u16 GetBgMetricTextMode(u32 bg, u32 whichMetric);
|
||||
u32 GetBgMetricAffineMode(u32 bg, u32 whichMetric);
|
||||
u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight);
|
||||
void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s32 palette2);
|
||||
bool32 IsInvalidBg32(u8 bg);
|
||||
bool32 IsTileMapOutsideWram(u8 bg);
|
||||
bool32 IsTileMapOutsideWram(u32 bg);
|
||||
|
||||
#endif // GUARD_BG_H
|
||||
|
||||
@ -48,8 +48,8 @@
|
||||
|
||||
void ClearDma3Requests(void);
|
||||
void ProcessDma3Requests(void);
|
||||
s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode);
|
||||
s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode);
|
||||
s16 RequestDma3Copy(const void *src, void *dest, u16 size, u32 mode);
|
||||
s16 RequestDma3Fill(s32 value, void *dest, u16 size, u32 mode);
|
||||
s16 CheckForSpaceForDma3Request(s16 index);
|
||||
|
||||
#endif // GUARD_DMA3_H
|
||||
|
||||
@ -95,7 +95,7 @@ void ProcessDma3Requests(void)
|
||||
}
|
||||
}
|
||||
|
||||
s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode)
|
||||
s16 RequestDma3Copy(const void *src, void *dest, u16 size, u32 mode)
|
||||
{
|
||||
int cursor;
|
||||
int i = 0;
|
||||
@ -127,7 +127,7 @@ s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode)
|
||||
return -1; // no free DMA request was found
|
||||
}
|
||||
|
||||
s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode)
|
||||
s16 RequestDma3Fill(s32 value, void *dest, u16 size, u32 mode)
|
||||
{
|
||||
int cursor;
|
||||
int i = 0;
|
||||
|
||||
@ -2,25 +2,6 @@
|
||||
#include "io_reg.h"
|
||||
#include "gba/io_reg.h"
|
||||
|
||||
static const u32 sUnused[] = {
|
||||
0,
|
||||
0,
|
||||
(1 << 26) | (1 << 3),
|
||||
(1 << 26) | (1 << 3) | (1 << 1),
|
||||
(1 << 26) | (1 << 3) | (1 << 2),
|
||||
(1 << 26) | (1 << 3) | (1 << 2) | (1 << 1),
|
||||
(1 << 26) | (1 << 4),
|
||||
(1 << 26) | (1 << 4) | (1 << 2),
|
||||
(1 << 26) | (1 << 4) | (1 << 3),
|
||||
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 2),
|
||||
(1 << 26) | (1 << 4) | (1 << 1),
|
||||
(1 << 26) | (1 << 4) | (1 << 2) | (1 << 1),
|
||||
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 1),
|
||||
(1 << 26) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1),
|
||||
(1 << 25) | (1 << 8),
|
||||
(1 << 27) | (1 << 10),
|
||||
};
|
||||
|
||||
const u16 gOverworldBackgroundLayerFlags[] = {
|
||||
BLDCNT_TGT2_BG0,
|
||||
BLDCNT_TGT2_BG1,
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
static void *sHeapStart;
|
||||
static u32 sHeapSize;
|
||||
|
||||
EWRAM_DATA u8 gHeap[HEAP_SIZE] = {0};
|
||||
ALIGNED(4) EWRAM_DATA u8 gHeap[HEAP_SIZE] = {0};
|
||||
|
||||
void PutMemBlockHeader(void *block, struct MemBlock *prev, struct MemBlock *next, u32 size)
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ struct OamDimensions
|
||||
};
|
||||
|
||||
static void SortSprites(u32 *spritePriorities, s32 n);
|
||||
static u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
|
||||
static u32 CreateSpriteAt(u32 index, const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority);
|
||||
static void ResetOamMatrices(void);
|
||||
static void ResetSprite(struct Sprite *sprite);
|
||||
static void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct SpriteFrameImage *images);
|
||||
@ -120,17 +120,6 @@ const union AnimCmd * const gDummySpriteAnimTable[];
|
||||
const union AffineAnimCmd * const gDummySpriteAffineAnimTable[];
|
||||
const struct SpriteTemplate gDummySpriteTemplate;
|
||||
|
||||
// Unreferenced data. Also unreferenced in R/S.
|
||||
static const u8 sUnknownData[24] =
|
||||
{
|
||||
0x01, 0x04, 0x10, 0x40,
|
||||
0x02, 0x04, 0x08, 0x20,
|
||||
0x02, 0x04, 0x08, 0x20,
|
||||
0x01, 0x04, 0x10, 0x40,
|
||||
0x02, 0x04, 0x08, 0x20,
|
||||
0x02, 0x04, 0x08, 0x20,
|
||||
};
|
||||
|
||||
static const u8 sCenterToCornerVecTable[3][4][2] =
|
||||
{
|
||||
{ // square
|
||||
@ -305,7 +294,7 @@ void ResetSpriteData(void)
|
||||
|
||||
void AnimateSprites(void)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
for (i = 0; i < MAX_SPRITES; i++)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[i];
|
||||
@ -446,9 +435,9 @@ static void SortSprites(u32 *spritePriorities, s32 n)
|
||||
InsertionSort(spritePriorities, n);
|
||||
}
|
||||
|
||||
u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority)
|
||||
u32 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < MAX_SPRITES; i++)
|
||||
if (!gSprites[i].inUse)
|
||||
@ -457,9 +446,9 @@ u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subprior
|
||||
return MAX_SPRITES;
|
||||
}
|
||||
|
||||
u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority)
|
||||
u32 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority)
|
||||
{
|
||||
s16 i;
|
||||
s32 i;
|
||||
|
||||
for (i = MAX_SPRITES - 1; i > -1; i--)
|
||||
if (!gSprites[i].inUse)
|
||||
@ -468,9 +457,9 @@ u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 sub
|
||||
return MAX_SPRITES;
|
||||
}
|
||||
|
||||
u8 CreateInvisibleSprite(void (*callback)(struct Sprite *))
|
||||
u32 CreateInvisibleSprite(void (*callback)(struct Sprite *))
|
||||
{
|
||||
u8 index = CreateSprite(&gDummySpriteTemplate, 0, 0, 31);
|
||||
u32 index = CreateSprite(&gDummySpriteTemplate, 0, 0, 31);
|
||||
|
||||
if (index == MAX_SPRITES)
|
||||
{
|
||||
@ -484,7 +473,7 @@ u8 CreateInvisibleSprite(void (*callback)(struct Sprite *))
|
||||
}
|
||||
}
|
||||
|
||||
u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority)
|
||||
u32 CreateSpriteAt(u32 index, const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[index];
|
||||
|
||||
@ -535,9 +524,9 @@ u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y,
|
||||
return index;
|
||||
}
|
||||
|
||||
u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority)
|
||||
u32 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < MAX_SPRITES; i++)
|
||||
{
|
||||
@ -545,7 +534,7 @@ u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u
|
||||
|
||||
if (!gSprites[i].inUse)
|
||||
{
|
||||
u8 index = CreateSpriteAt(i, template, x, y, subpriority);
|
||||
u32 index = CreateSpriteAt(i, template, x, y, subpriority);
|
||||
|
||||
if (index == MAX_SPRITES)
|
||||
return MAX_SPRITES;
|
||||
@ -577,11 +566,11 @@ void DestroySprite(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
void ResetOamRange(u8 start, u8 end)
|
||||
void ResetOamRange(u32 start, u32 end)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
for (i = start; i < end; i++)
|
||||
gMain.oamBuffer[i] = *(struct OamData *)&gDummyOamData;
|
||||
gMain.oamBuffer[i] = gDummyOamData;
|
||||
}
|
||||
|
||||
void LoadOam(void)
|
||||
@ -592,7 +581,7 @@ void LoadOam(void)
|
||||
|
||||
void ClearSpriteCopyRequests(void)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
sShouldProcessSpriteCopyRequests = FALSE;
|
||||
sSpriteCopyRequestCount = 0;
|
||||
@ -607,7 +596,7 @@ void ClearSpriteCopyRequests(void)
|
||||
|
||||
void ResetOamMatrices(void)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
for (i = 0; i < OAM_MATRIX_COUNT; i++)
|
||||
{
|
||||
// set to identity matrix
|
||||
@ -1373,7 +1362,7 @@ void SetSpriteSheetFrameTileNum(struct Sprite *sprite)
|
||||
|
||||
void ResetAffineAnimData(void)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
gAffineAnimsDisabled = FALSE;
|
||||
gOamMatrixAllocBitmap = 0;
|
||||
@ -1476,7 +1465,7 @@ u16 LoadSpriteSheetByTemplate(const struct SpriteTemplate *template, u32 frame,
|
||||
|
||||
void LoadSpriteSheets(const struct SpriteSheet *sheets)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
for (i = 0; sheets[i].data != NULL; i++)
|
||||
LoadSpriteSheet(&sheets[i]);
|
||||
}
|
||||
@ -1509,7 +1498,7 @@ void FreeSpriteTilesByTag(u16 tag)
|
||||
|
||||
void FreeSpriteTileRanges(void)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < MAX_SPRITES; i++)
|
||||
{
|
||||
@ -1528,7 +1517,7 @@ u16 GetSpriteTileStartByTag(u16 tag)
|
||||
|
||||
u8 IndexOfSpriteTileTag(u16 tag)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < MAX_SPRITES; i++)
|
||||
if (sSpriteTileRangeTags[i] == tag)
|
||||
@ -1539,7 +1528,7 @@ u8 IndexOfSpriteTileTag(u16 tag)
|
||||
|
||||
u16 GetSpriteTileTagByTileStart(u16 start)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < MAX_SPRITES; i++)
|
||||
{
|
||||
@ -1559,7 +1548,7 @@ void AllocSpriteTileRange(u16 tag, u16 start, u16 count)
|
||||
|
||||
void FreeAllSpritePalettes(void)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
gReservedSpritePaletteCount = 0;
|
||||
for (i = 0; i < 16; i++)
|
||||
sSpritePaletteTags[i] = TAG_NONE;
|
||||
@ -1588,7 +1577,7 @@ u8 LoadSpritePalette(const struct SpritePalette *palette)
|
||||
|
||||
void LoadSpritePalettes(const struct SpritePalette *palettes)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
for (i = 0; palettes[i].data != NULL; i++)
|
||||
if (LoadSpritePalette(&palettes[i]) == 0xFF)
|
||||
break;
|
||||
@ -1615,7 +1604,7 @@ u8 AllocSpritePalette(u16 tag)
|
||||
|
||||
u8 IndexOfSpritePaletteTag(u16 tag)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
for (i = gReservedSpritePaletteCount; i < 16; i++)
|
||||
if (sSpritePaletteTags[i] == tag)
|
||||
return i;
|
||||
@ -1689,7 +1678,7 @@ bool8 AddSubspritesToOamBuffer(struct Sprite *sprite, struct OamData *destOam, u
|
||||
u8 subspriteCount;
|
||||
u8 hFlip;
|
||||
u8 vFlip;
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
tileNum = oam->tileNum;
|
||||
subspriteCount = subspriteTable->subspriteCount;
|
||||
|
||||
@ -271,12 +271,12 @@ extern bool8 gAffineAnimsDisabled;
|
||||
void ResetSpriteData(void);
|
||||
void AnimateSprites(void);
|
||||
void BuildOamBuffer(void);
|
||||
u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
|
||||
u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
|
||||
u8 CreateInvisibleSprite(void (*callback)(struct Sprite *));
|
||||
u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
|
||||
u32 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority);
|
||||
u32 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority);
|
||||
u32 CreateInvisibleSprite(void (*callback)(struct Sprite *));
|
||||
u32 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority);
|
||||
void DestroySprite(struct Sprite *sprite);
|
||||
void ResetOamRange(u8 start, u8 end);
|
||||
void ResetOamRange(u32 start, u32 end);
|
||||
void LoadOam(void);
|
||||
void SetOamMatrix(u8 matrixNum, u16 a, u16 b, u16 c, u16 d);
|
||||
void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode);
|
||||
|
||||
@ -63,7 +63,7 @@ u8 *StringCopy_Nickname(u8 *dest, const u8 *src)
|
||||
|
||||
u8 *StringGet_Nickname(u8 *str)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
u32 limit = POKEMON_NAME_LENGTH;
|
||||
|
||||
if (DECAP_ENABLED && !DECAP_NICKNAMES && *str == CHAR_FIXED_CASE)
|
||||
@ -124,7 +124,7 @@ u8 *StringAppend(u8 *dest, const u8 *src)
|
||||
|
||||
u8 *StringCopyN(u8 *dest, const u8 *src, u8 n)
|
||||
{
|
||||
u16 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
dest[i] = src[i];
|
||||
@ -196,7 +196,7 @@ s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n)
|
||||
|
||||
bool8 IsStringLengthAtLeast(const u8 *str, s32 n)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (str[i] && str[i] != EOS)
|
||||
@ -320,7 +320,7 @@ u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode
|
||||
u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n)
|
||||
{
|
||||
enum { WAITING_FOR_NONZERO_DIGIT, WRITING_DIGITS, WRITING_SPACES } state;
|
||||
u8 i;
|
||||
u32 i;
|
||||
s32 powerOfSixteen;
|
||||
s32 largestPowerOfSixteen = 1;
|
||||
|
||||
@ -596,7 +596,7 @@ const u8 *GetExpandedPlaceholder(u32 id)
|
||||
|
||||
u8 *StringFill(u8 *dest, u8 c, u16 n)
|
||||
{
|
||||
u16 i;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
*dest++ = c;
|
||||
@ -813,7 +813,7 @@ void ConvertInternationalString(u8 *s, u8 language)
|
||||
{
|
||||
if (language == LANGUAGE_JAPANESE)
|
||||
{
|
||||
u8 i;
|
||||
u32 i;
|
||||
|
||||
StripExtCtrlCodes(s);
|
||||
i = StringLength(s);
|
||||
|
||||
18
gflib/text.c
18
gflib/text.c
@ -302,7 +302,7 @@ u16 AddTextPrinterFixedCaseParameterized(u8 windowId, u8 fontId, const u8 *str,
|
||||
return AddTextPrinterParameterized(windowId, fontId, MirrorPtr(str), x, y, speed, callback);
|
||||
}
|
||||
|
||||
bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
|
||||
bool32 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
|
||||
{
|
||||
int i;
|
||||
u16 j;
|
||||
@ -388,7 +388,7 @@ void RunTextPrinters(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool16 IsTextPrinterActive(u8 id)
|
||||
bool32 IsTextPrinterActive(u8 id)
|
||||
{
|
||||
return sTextPrinters[id].active;
|
||||
}
|
||||
@ -891,7 +891,7 @@ void TextPrinterClearDownArrow(struct TextPrinter *textPrinter)
|
||||
CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX);
|
||||
}
|
||||
|
||||
bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter)
|
||||
bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
@ -906,9 +906,9 @@ bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter)
|
||||
}
|
||||
}
|
||||
|
||||
bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter)
|
||||
bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter)
|
||||
{
|
||||
bool8 result = FALSE;
|
||||
bool32 result = FALSE;
|
||||
if (gTextFlags.autoScroll != 0)
|
||||
{
|
||||
result = TextPrinterWaitAutoMode(textPrinter);
|
||||
@ -925,9 +925,9 @@ bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool16 TextPrinterWait(struct TextPrinter *textPrinter)
|
||||
bool32 TextPrinterWait(struct TextPrinter *textPrinter)
|
||||
{
|
||||
bool16 result = FALSE;
|
||||
bool32 result = FALSE;
|
||||
if (gTextFlags.autoScroll != 0)
|
||||
{
|
||||
result = TextPrinterWaitAutoMode(textPrinter);
|
||||
@ -943,7 +943,7 @@ bool16 TextPrinterWait(struct TextPrinter *textPrinter)
|
||||
return result;
|
||||
}
|
||||
|
||||
void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex)
|
||||
void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool32 drawArrow, u8 *counter, u8 *yCoordIndex)
|
||||
{
|
||||
const u8 *arrowTiles;
|
||||
|
||||
@ -1437,7 +1437,7 @@ static u32 (*GetFontWidthFunc(u8 fontId))(u16, bool32)
|
||||
|
||||
s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
||||
{
|
||||
bool8 isJapanese;
|
||||
bool32 isJapanese;
|
||||
int minGlyphWidth;
|
||||
u32 (*func)(u16 fontId, bool32 isJapanese);
|
||||
int localLetterSpacing;
|
||||
|
||||
12
gflib/text.h
12
gflib/text.h
@ -159,9 +159,9 @@ u16 AddTextPrinterFixedCaseParameterized(u8 windowId, u8 fontId, const u8 *str,
|
||||
|
||||
void DeactivateAllTextPrinters(void);
|
||||
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16));
|
||||
bool16 AddTextPrinter(struct TextPrinterTemplate *template, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16));
|
||||
bool32 AddTextPrinter(struct TextPrinterTemplate *template, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16));
|
||||
void RunTextPrinters(void);
|
||||
bool16 IsTextPrinterActive(u8 id);
|
||||
bool32 IsTextPrinterActive(u8 id);
|
||||
void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor);
|
||||
void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor);
|
||||
void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor);
|
||||
@ -172,10 +172,10 @@ void ClearTextSpan(struct TextPrinter *textPrinter, u32 width);
|
||||
void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter);
|
||||
void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter);
|
||||
void TextPrinterClearDownArrow(struct TextPrinter *textPrinter);
|
||||
bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter);
|
||||
bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter);
|
||||
bool16 TextPrinterWait(struct TextPrinter *textPrinter);
|
||||
void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex);
|
||||
bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter);
|
||||
bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter);
|
||||
bool32 TextPrinterWait(struct TextPrinter *textPrinter);
|
||||
void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool32 drawArrow, u8 *counter, u8 *yCoordIndex);
|
||||
s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing);
|
||||
u8 RenderTextHandleBold(u8 *pixels, u8 fontId, u8 *str);
|
||||
u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y);
|
||||
|
||||
@ -13,8 +13,8 @@ EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0};
|
||||
EWRAM_DATA static struct Window* sWindowPtr = NULL;
|
||||
EWRAM_DATA static u16 sWindowSize = 0;
|
||||
|
||||
static u8 GetNumActiveWindowsOnBg(u8 bgId);
|
||||
static u8 GetNumActiveWindowsOnBg8Bit(u8 bgId);
|
||||
static u32 GetNumActiveWindowsOnBg(u32 bgId);
|
||||
static u32 GetNumActiveWindowsOnBg8Bit(u32 bgId);
|
||||
|
||||
static const struct WindowTemplate sDummyWindowTemplate = DUMMY_WIN_TEMPLATE;
|
||||
|
||||
@ -23,12 +23,12 @@ static void DummyWindowBgTilemap(void)
|
||||
|
||||
}
|
||||
|
||||
bool16 InitWindows(const struct WindowTemplate *templates)
|
||||
bool32 InitWindows(const struct WindowTemplate *templates)
|
||||
{
|
||||
int i;
|
||||
void *bgTilemapBuffer;
|
||||
int j;
|
||||
u8 bgLayer;
|
||||
u32 bgLayer;
|
||||
u16 attrib;
|
||||
u8 *allocatedTilemapBuffer;
|
||||
int allocatedBaseBlock;
|
||||
@ -106,10 +106,10 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u16 AddWindow(const struct WindowTemplate *template)
|
||||
u32 AddWindow(const struct WindowTemplate *template)
|
||||
{
|
||||
u16 win;
|
||||
u8 bgLayer;
|
||||
u32 win;
|
||||
u32 bgLayer;
|
||||
int allocatedBaseBlock;
|
||||
u16 attrib;
|
||||
u8 *allocatedTilemapBuffer;
|
||||
@ -180,8 +180,8 @@ u16 AddWindow(const struct WindowTemplate *template)
|
||||
|
||||
int AddWindowWithoutTileMap(const struct WindowTemplate *template)
|
||||
{
|
||||
u16 win;
|
||||
u8 bgLayer;
|
||||
int win;
|
||||
u32 bgLayer;
|
||||
int allocatedBaseBlock;
|
||||
|
||||
for (win = 0; win < WINDOWS_MAX; ++win)
|
||||
@ -215,9 +215,9 @@ int AddWindowWithoutTileMap(const struct WindowTemplate *template)
|
||||
return win;
|
||||
}
|
||||
|
||||
void RemoveWindow(u8 windowId)
|
||||
void RemoveWindow(u32 windowId)
|
||||
{
|
||||
u8 bgLayer = gWindows[windowId].window.bg;
|
||||
u32 bgLayer = gWindows[windowId].window.bg;
|
||||
|
||||
if (gWindowTileAutoAllocEnabled == TRUE)
|
||||
BgTileAllocOp(bgLayer, gWindows[windowId].window.baseBlock, gWindows[windowId].window.width * gWindows[windowId].window.height, 2);
|
||||
@ -263,7 +263,7 @@ void FreeAllWindowBuffers(void)
|
||||
}
|
||||
}
|
||||
|
||||
void CopyWindowToVram(u8 windowId, u8 mode)
|
||||
void CopyWindowToVram(u32 windowId, u32 mode)
|
||||
{
|
||||
struct Window windowLocal = gWindows[windowId];
|
||||
u16 windowSize = 32 * (windowLocal.window.width * windowLocal.window.height);
|
||||
@ -316,7 +316,7 @@ void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h)
|
||||
}
|
||||
}
|
||||
|
||||
void PutWindowTilemap(u8 windowId)
|
||||
void PutWindowTilemap(u32 windowId)
|
||||
{
|
||||
struct Window windowLocal = gWindows[windowId];
|
||||
|
||||
@ -331,7 +331,7 @@ void PutWindowTilemap(u8 windowId)
|
||||
1);
|
||||
}
|
||||
|
||||
void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette)
|
||||
void PutWindowRectTilemapOverridePalette(u32 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette)
|
||||
{
|
||||
struct Window windowLocal = gWindows[windowId];
|
||||
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
|
||||
@ -354,7 +354,7 @@ void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 h
|
||||
}
|
||||
|
||||
// Fills a window with transparent tiles.
|
||||
void ClearWindowTilemap(u8 windowId)
|
||||
void ClearWindowTilemap(u32 windowId)
|
||||
{
|
||||
struct Window windowLocal = gWindows[windowId];
|
||||
|
||||
@ -368,7 +368,7 @@ void ClearWindowTilemap(u8 windowId)
|
||||
windowLocal.window.paletteNum);
|
||||
}
|
||||
|
||||
void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height)
|
||||
void PutWindowRectTilemap(u32 windowId, u8 x, u8 y, u8 width, u8 height)
|
||||
{
|
||||
struct Window windowLocal = gWindows[windowId];
|
||||
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
|
||||
@ -390,12 +390,12 @@ void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height)
|
||||
}
|
||||
}
|
||||
|
||||
void BlitBitmapToWindow(u8 windowId, const u8 *pixels, u16 x, u16 y, u16 width, u16 height)
|
||||
void BlitBitmapToWindow(u32 windowId, const u8 *pixels, u16 x, u16 y, u16 width, u16 height)
|
||||
{
|
||||
BlitBitmapRectToWindow(windowId, pixels, 0, 0, width, height, x, y, width, height);
|
||||
}
|
||||
|
||||
void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight)
|
||||
void BlitBitmapRectToWindow(u32 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight)
|
||||
{
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
@ -411,7 +411,7 @@ void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u
|
||||
BlitBitmapRect4Bit(&sourceRect, &destRect, srcX, srcY, destX, destY, rectWidth, rectHeight, 0);
|
||||
}
|
||||
|
||||
static void UNUSED BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
|
||||
static void UNUSED BlitBitmapRectToWindowWithColorKey(u32 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
|
||||
{
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
@ -427,7 +427,7 @@ static void UNUSED BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pix
|
||||
BlitBitmapRect4Bit(&sourceRect, &destRect, srcX, srcY, destX, destY, rectWidth, rectHeight, colorKey);
|
||||
}
|
||||
|
||||
void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height)
|
||||
void FillWindowPixelRect(u32 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height)
|
||||
{
|
||||
struct Bitmap pixelRect;
|
||||
|
||||
@ -438,7 +438,7 @@ void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16
|
||||
FillBitmapRect4Bit(&pixelRect, x, y, width, height, fillValue);
|
||||
}
|
||||
|
||||
void CopyToWindowPixelBuffer(u8 windowId, const void *src, u16 size, u16 tileOffset)
|
||||
void CopyToWindowPixelBuffer(u32 windowId, const void *src, u16 size, u16 tileOffset)
|
||||
{
|
||||
if (size != 0)
|
||||
CpuCopy16(src, gWindows[windowId].tileData + (32 * tileOffset), size);
|
||||
@ -447,7 +447,7 @@ void CopyToWindowPixelBuffer(u8 windowId, const void *src, u16 size, u16 tileOff
|
||||
}
|
||||
|
||||
// Sets all pixels within the window to the fillValue color.
|
||||
void FillWindowPixelBuffer(u8 windowId, u8 fillValue)
|
||||
void FillWindowPixelBuffer(u32 windowId, u8 fillValue)
|
||||
{
|
||||
int fillSize = gWindows[windowId].window.width * gWindows[windowId].window.height;
|
||||
CpuFastFill8(fillValue, gWindows[windowId].tileData, 32 * fillSize);
|
||||
@ -475,7 +475,7 @@ void FillWindowPixelBuffer(u8 windowId, u8 fillValue)
|
||||
distanceLoop++; \
|
||||
}
|
||||
|
||||
void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue)
|
||||
void ScrollWindow(u32 windowId, u8 direction, u8 distance, u8 fillValue)
|
||||
{
|
||||
struct WindowTemplate window = gWindows[windowId].window;
|
||||
u8 *tileData = gWindows[windowId].tileData;
|
||||
@ -522,13 +522,13 @@ void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue)
|
||||
}
|
||||
}
|
||||
|
||||
void CallWindowFunction(u8 windowId, void ( *func)(u8, u8, u8, u8, u8, u8))
|
||||
void CallWindowFunction(u32 windowId, void ( *func)(u8, u8, u8, u8, u8, u8))
|
||||
{
|
||||
struct WindowTemplate window = gWindows[windowId].window;
|
||||
func(window.bg, window.tilemapLeft, window.tilemapTop, window.width, window.height, window.paletteNum);
|
||||
}
|
||||
|
||||
bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value)
|
||||
bool32 SetWindowAttribute(u32 windowId, u32 attributeId, u32 value)
|
||||
{
|
||||
switch (attributeId)
|
||||
{
|
||||
@ -555,7 +555,7 @@ bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value)
|
||||
}
|
||||
}
|
||||
|
||||
u32 GetWindowAttribute(u8 windowId, u8 attributeId)
|
||||
u32 GetWindowAttribute(u32 windowId, u32 attributeId)
|
||||
{
|
||||
switch (attributeId)
|
||||
{
|
||||
@ -580,9 +580,9 @@ u32 GetWindowAttribute(u8 windowId, u8 attributeId)
|
||||
}
|
||||
}
|
||||
|
||||
static u8 GetNumActiveWindowsOnBg(u8 bgId)
|
||||
static u32 GetNumActiveWindowsOnBg(u32 bgId)
|
||||
{
|
||||
u8 windowsNum = 0;
|
||||
u32 windowsNum = 0;
|
||||
s32 i;
|
||||
for (i = 0; i < WINDOWS_MAX; i++)
|
||||
{
|
||||
@ -597,11 +597,11 @@ static void DummyWindowBgTilemap8Bit(void)
|
||||
|
||||
}
|
||||
|
||||
u16 AddWindow8Bit(const struct WindowTemplate *template)
|
||||
u32 AddWindow8Bit(const struct WindowTemplate *template)
|
||||
{
|
||||
u16 windowId;
|
||||
u32 windowId;
|
||||
u8 *memAddress;
|
||||
u8 bgLayer;
|
||||
u32 bgLayer;
|
||||
|
||||
for (windowId = 0; windowId < WINDOWS_MAX; windowId++)
|
||||
{
|
||||
@ -644,7 +644,7 @@ u16 AddWindow8Bit(const struct WindowTemplate *template)
|
||||
}
|
||||
}
|
||||
|
||||
void FillWindowPixelBuffer8Bit(u8 windowId, u8 fillValue)
|
||||
void FillWindowPixelBuffer8Bit(u32 windowId, u8 fillValue)
|
||||
{
|
||||
s32 i;
|
||||
s32 size;
|
||||
@ -654,7 +654,7 @@ void FillWindowPixelBuffer8Bit(u8 windowId, u8 fillValue)
|
||||
gWindows[windowId].tileData[i] = fillValue;
|
||||
}
|
||||
|
||||
void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height)
|
||||
void FillWindowPixelRect8Bit(u32 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height)
|
||||
{
|
||||
struct Bitmap pixelRect;
|
||||
|
||||
@ -665,7 +665,7 @@ void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width,
|
||||
FillBitmapRect8Bit(&pixelRect, x, y, width, height, fillValue);
|
||||
}
|
||||
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum)
|
||||
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)
|
||||
{
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
@ -681,7 +681,7 @@ void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u
|
||||
BlitBitmapRect4BitTo8Bit(&sourceRect, &destRect, srcX, srcY, destX, destY, rectWidth, rectHeight, 0, paletteNum);
|
||||
}
|
||||
|
||||
void CopyWindowToVram8Bit(u8 windowId, u8 mode)
|
||||
void CopyWindowToVram8Bit(u32 windowId, u8 mode)
|
||||
{
|
||||
sWindowPtr = &gWindows[windowId];
|
||||
sWindowSize = 64 * (sWindowPtr->window.width * sWindowPtr->window.height);
|
||||
@ -701,9 +701,9 @@ void CopyWindowToVram8Bit(u8 windowId, u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
static u8 GetNumActiveWindowsOnBg8Bit(u8 bgId)
|
||||
static u32 GetNumActiveWindowsOnBg8Bit(u32 bgId)
|
||||
{
|
||||
u8 windowsNum = 0;
|
||||
u32 windowsNum = 0;
|
||||
s32 i;
|
||||
for (i = 0; i < WINDOWS_MAX; i++)
|
||||
{
|
||||
|
||||
@ -48,31 +48,31 @@ struct Window
|
||||
u8 *tileData;
|
||||
};
|
||||
|
||||
bool16 InitWindows(const struct WindowTemplate *templates);
|
||||
u16 AddWindow(const struct WindowTemplate *template);
|
||||
bool32 InitWindows(const struct WindowTemplate *templates);
|
||||
u32 AddWindow(const struct WindowTemplate *template);
|
||||
int AddWindowWithoutTileMap(const struct WindowTemplate *template);
|
||||
void RemoveWindow(u8 windowId);
|
||||
void RemoveWindow(u32 windowId);
|
||||
void FreeAllWindowBuffers(void);
|
||||
void CopyWindowToVram(u8 windowId, u8 mode);
|
||||
void CopyWindowToVram(u32 windowId, u32 mode);
|
||||
void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h);
|
||||
void PutWindowTilemap(u8 windowId);
|
||||
void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette);
|
||||
void ClearWindowTilemap(u8 windowId);
|
||||
void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height);
|
||||
void BlitBitmapToWindow(u8 windowId, const u8 *pixels, u16 x, u16 y, u16 width, u16 height);
|
||||
void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight);
|
||||
void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
|
||||
void CopyToWindowPixelBuffer(u8 windowId, const void *src, u16 size, u16 tileOffset);
|
||||
void FillWindowPixelBuffer(u8 windowId, u8 fillValue);
|
||||
void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue);
|
||||
void CallWindowFunction(u8 windowId, void ( *func)(u8, u8, u8, u8, u8, u8));
|
||||
bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value);
|
||||
u32 GetWindowAttribute(u8 windowId, u8 attributeId);
|
||||
u16 AddWindow8Bit(const struct WindowTemplate *template);
|
||||
void FillWindowPixelBuffer8Bit(u8 windowId, u8 fillValue);
|
||||
void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum);
|
||||
void CopyWindowToVram8Bit(u8 windowId, u8 mode);
|
||||
void PutWindowTilemap(u32 windowId);
|
||||
void PutWindowRectTilemapOverridePalette(u32 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette);
|
||||
void ClearWindowTilemap(u32 windowId);
|
||||
void PutWindowRectTilemap(u32 windowId, u8 x, u8 y, u8 width, u8 height);
|
||||
void BlitBitmapToWindow(u32 windowId, const u8 *pixels, u16 x, u16 y, u16 width, u16 height);
|
||||
void BlitBitmapRectToWindow(u32 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight);
|
||||
void FillWindowPixelRect(u32 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
|
||||
void CopyToWindowPixelBuffer(u32 windowId, const void *src, u16 size, u16 tileOffset);
|
||||
void FillWindowPixelBuffer(u32 windowId, u8 fillValue);
|
||||
void ScrollWindow(u32 windowId, u8 direction, u8 distance, u8 fillValue);
|
||||
void CallWindowFunction(u32 windowId, void ( *func)(u8, u8, u8, u8, u8, u8));
|
||||
bool32 SetWindowAttribute(u32 windowId, u32 attributeId, u32 value);
|
||||
u32 GetWindowAttribute(u32 windowId, u32 attributeId);
|
||||
u32 AddWindow8Bit(const struct WindowTemplate *template);
|
||||
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);
|
||||
|
||||
extern struct Window gWindows[];
|
||||
extern void *gWindowBgTilemapBuffers[];
|
||||
|
||||
BIN
graphics/pokemon/wooper/wooper_paldean/icon.png
Normal file
BIN
graphics/pokemon/wooper/wooper_paldean/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 286 B |
@ -54,8 +54,10 @@ struct __attribute__((packed, aligned(2))) BattleMoveEffect
|
||||
const u8 *battleScript;
|
||||
u16 battleTvScore:3;
|
||||
u16 encourageEncore:1;
|
||||
u16 twoTurnEffect:1;
|
||||
u16 semiInvulnerableEffect:1;
|
||||
u16 flags:11; // coming soon...
|
||||
u16 usesProtectCounter:1;
|
||||
u16 padding:9;
|
||||
};
|
||||
|
||||
#define GET_MOVE_BATTLESCRIPT(move) gBattleMoveEffects[gMovesInfo[move].effect].battleScript
|
||||
@ -612,7 +614,6 @@ struct BattleStruct
|
||||
u32 expValue;
|
||||
u8 expGettersOrder[PARTY_SIZE]; // First battlers which were sent out, then via exp-share
|
||||
u8 expGetterMonId;
|
||||
u8 additionalEffectsCounter:2;
|
||||
u8 expOrderId:3;
|
||||
u8 expGetterBattlerId:2;
|
||||
u8 teamGotExpMsgPrinted:1; // The 'Rest of your team got msg' has been printed.
|
||||
@ -736,6 +737,7 @@ struct BattleStruct
|
||||
u8 forcedSwitch:4; // For each battler
|
||||
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 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.
|
||||
@ -774,6 +776,8 @@ struct BattleStruct
|
||||
u8 dauntlessShieldBoost[NUM_BATTLE_SIDES];
|
||||
u8 supersweetSyrup[NUM_BATTLE_SIDES];
|
||||
u8 supremeOverlordCounter[MAX_BATTLERS_COUNT];
|
||||
u8 quickClawRandom[MAX_BATTLERS_COUNT];
|
||||
u8 quickDrawRandom[MAX_BATTLERS_COUNT];
|
||||
};
|
||||
|
||||
// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
|
||||
@ -971,15 +975,10 @@ struct BattleSpriteData
|
||||
struct MonSpritesGfx
|
||||
{
|
||||
void *firstDecompressed; // ptr to the decompressed sprite of the first Pokémon
|
||||
union {
|
||||
void *ptr[MAX_BATTLERS_COUNT];
|
||||
u8 *byte[MAX_BATTLERS_COUNT];
|
||||
} sprites;
|
||||
u8 *spritesGfx[MAX_BATTLERS_COUNT];
|
||||
struct SpriteTemplate templates[MAX_BATTLERS_COUNT];
|
||||
struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][MAX_MON_PIC_FRAMES];
|
||||
u8 unusedArr[0x80];
|
||||
u8 *barFontGfx;
|
||||
void *unusedPtr;
|
||||
u16 *buffer;
|
||||
};
|
||||
|
||||
@ -1008,7 +1007,6 @@ extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
|
||||
extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT + 13]; //to handle stupidly large z move names
|
||||
extern u32 gBattleTypeFlags;
|
||||
extern u8 gBattleTerrain;
|
||||
extern u32 gUnusedFirstBattleVar1;
|
||||
extern u8 *gBattleAnimBgTileBuffer;
|
||||
extern u8 *gBattleAnimBgTilemapBuffer;
|
||||
extern u32 gBattleControllerExecFlags;
|
||||
@ -1055,7 +1053,6 @@ extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT];
|
||||
extern u16 gMoveResultFlags;
|
||||
extern u32 gHitMarker;
|
||||
extern u8 gBideTarget[MAX_BATTLERS_COUNT];
|
||||
extern u8 gUnusedFirstBattleVar2;
|
||||
extern u32 gSideStatuses[NUM_BATTLE_SIDES];
|
||||
extern struct SideTimer gSideTimers[NUM_BATTLE_SIDES];
|
||||
extern u32 gStatuses3[MAX_BATTLERS_COUNT];
|
||||
@ -1087,8 +1084,6 @@ extern bool8 gTransformedShininess[MAX_BATTLERS_COUNT];
|
||||
extern u8 gPlayerDpadHoldFrames;
|
||||
extern struct BattleSpriteData *gBattleSpritesDataPtr;
|
||||
extern struct MonSpritesGfx *gMonSpritesGfxPtr;
|
||||
extern struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData;
|
||||
extern struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData;
|
||||
extern u16 gBattleMovePower;
|
||||
extern u16 gMoveToLearn;
|
||||
extern u32 gFieldStatuses;
|
||||
|
||||
@ -77,7 +77,7 @@ extern struct MultiPartnerMenuPokemon gMultiPartnerParty[MULTI_PARTY_SIZE];
|
||||
extern const struct SpriteTemplate gUnusedBattleInitSprite;
|
||||
extern const struct OamData gOamData_BattleSpriteOpponentSide;
|
||||
extern const struct OamData gOamData_BattleSpritePlayerSide;
|
||||
extern const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1];
|
||||
extern const struct TypeInfo gTypesInfo[NUMBER_OF_MON_TYPES];
|
||||
|
||||
extern const u8 gStatusConditionString_PoisonJpn[8];
|
||||
extern const u8 gStatusConditionString_SleepJpn[8];
|
||||
|
||||
@ -202,7 +202,8 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move);
|
||||
bool32 HasEnoughHpToEatBerry(u32 battler, u32 hpFraction, u32 itemId);
|
||||
bool32 IsPartnerMonFromSameTrainer(u32 battler);
|
||||
u8 GetCategoryBasedOnStats(u32 battler);
|
||||
bool32 TestSheerForceFlag(u32 battler, u16 move);
|
||||
bool32 MoveIsAffectedBySheerForce(u32 move);
|
||||
bool32 TestIfSheerForceAffected(u32 battler, u16 move);
|
||||
void TryRestoreHeldItems(void);
|
||||
bool32 CanStealItem(u32 battlerStealing, u32 battlerItem, u16 item);
|
||||
void TrySaveExchangedItem(u32 battler, u16 stolenItem);
|
||||
@ -223,11 +224,11 @@ void CopyMonAbilityAndTypesToBattleMon(u32 battler, struct Pokemon *mon);
|
||||
void RecalcBattlerStats(u32 battler, struct Pokemon *mon);
|
||||
bool32 IsAlly(u32 battlerAtk, u32 battlerDef);
|
||||
bool32 IsGen6ExpShareEnabled(void);
|
||||
bool32 MoveHasMoveEffect(u32 move, u32 moveEffect);
|
||||
bool32 MoveHasMoveEffectWithChance(u32 move, u32 moveEffect, u32 chance);
|
||||
bool32 MoveHasMoveEffectSelf(u32 move, u32 moveEffect);
|
||||
bool32 MoveHasMoveEffectSelfArg(u32 move, u32 moveEffect, u32 argument);
|
||||
bool32 MoveHasChargeTurnMoveEffect(u32 move);
|
||||
bool32 MoveHasAdditionalEffect(u32 move, u32 moveEffect);
|
||||
bool32 MoveHasAdditionalEffectWithChance(u32 move, u32 moveEffect, u32 chance);
|
||||
bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect);
|
||||
bool32 MoveHasAdditionalEffectSelfArg(u32 move, u32 moveEffect, u32 argument);
|
||||
bool32 MoveHasChargeTurnAdditionalEffect(u32 move);
|
||||
|
||||
bool32 CanSleep(u32 battler);
|
||||
bool32 CanBePoisoned(u32 battlerAttacker, u32 battlerTarget);
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
// Draining abilities will not heal but will prevent damage. In Gen6+, Heal Block prevents the use of most HP-draining moves.
|
||||
#define B_ROOTED_GROUNDING GEN_LATEST // In Gen4+, Ingrain causes the affected Pokémon to become grounded.
|
||||
#define B_METRONOME_MOVES GEN_LATEST // This config will determine up to which generation will Metronome pull moves from.
|
||||
#define B_TELEPORT_BEHAVIOR GEN_LATEST // In Gen7+, starting with Pokémon LGPE, Teleport allows the user to swap out with another party member.
|
||||
#define B_TELEPORT_BEHAVIOR GEN_LATEST // In LGPE onwards (Gen8+ here), Teleport allows the user to swap out with another party member.
|
||||
#define B_BEAT_UP GEN_LATEST // In Gen5+, Beat Up uses a different formula to calculate its damage, and deals Dark-type damage. Prior to Gen 5, each hit also announces the party member's name.
|
||||
#define B_DARK_VOID_FAIL GEN_LATEST // In Gen7+, only Darkrai can use Dark Void.
|
||||
#define B_BURN_HIT_THAW GEN_LATEST // In Gen6+, damaging moves with a chance of burn will thaw the target, regardless if they're fire-type moves or not.
|
||||
@ -180,7 +180,7 @@
|
||||
|
||||
// Var Settings
|
||||
// To use the following features in scripting, replace the 0s with the var ID you're assigning it to.
|
||||
// Eg: Replace with VAR_UNUSED_0x40F7 so you can use B_VAR_TERRAIN for that feature.
|
||||
// Eg: Replace with VAR_UNUSED_0x40F7 so you can use B_VAR_STARTING_STATUS for that feature.
|
||||
#define B_VAR_STARTING_STATUS 0 // If this var has a value, assigning a STATUS_FIELD_xx_TERRAIN to it before battle causes the battle to start with that terrain active.
|
||||
#define B_VAR_STARTING_STATUS_TIMER 0 // If this var has a value greater or equal than 1 field terrains will last that number of turns, otherwise they will last until they're overwritten.
|
||||
#define B_VAR_WILD_AI_FLAGS 0 // If not 0, you can use this var to add to default wild AI flags. NOT usable with flags above (1 << 15)
|
||||
|
||||
@ -11,7 +11,7 @@ Exceptions:
|
||||
- ASM strings that use `.fixstr`
|
||||
- If mirroring enabled, string addresses passed through MirrorPtr
|
||||
*/
|
||||
#define DECAP_ENABLED TRUE
|
||||
#define DECAP_ENABLED FALSE
|
||||
// Enables signaling that a string's case should be preserved
|
||||
// by *mirroring* its address: i.e 08xxxxxx to 0Axxxxxx
|
||||
// Unless you are targeting a different platform than the GBA,
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#define I_PRICE GEN_LATEST // Some items have varied in value across generations.
|
||||
#define I_BERRY_PRICE GEN_7 // Since Berries have become unplantable (Gen8+), their price has gone up.
|
||||
#define I_POWER_ITEM_BOOST GEN_LATEST // In Gen7+, Power Items grant 8 EVs instead of 4 EVs.
|
||||
#define I_PREMIER_BALL_BONUS GEN_LATEST // In LGPE onwards (Gen8+ here), you are given a Premier Ball for every 10 Poké Balls of any type and in the same purchase. Previously, it only applied to regular Poké Balls and only 1 could be obtained per purchase.
|
||||
|
||||
// TM config
|
||||
#define I_REUSABLE_TMS FALSE // In Gen5-8, TMs are reusable. Setting this to TRUE will make all vanilla TMs reusable, though they can also be cherry-picked by setting their importance to 1.
|
||||
|
||||
21
include/config/level_caps.h
Normal file
21
include/config/level_caps.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef GUARD_CONFIG_LEVEL_CAP_H
|
||||
#define GUARD_CONFIG_LEVEL_CAP_H
|
||||
|
||||
// Constants
|
||||
#define EXP_CAP_NONE 0 // Regular behavior, no level caps are applied
|
||||
#define EXP_CAP_HARD 1 // Pokémon with a level >= the level cap cannot gain any experience
|
||||
#define EXP_CAP_SOFT 2 // Pokémon with a level >= the level cap will gain reduced experience
|
||||
|
||||
#define LEVEL_CAP_NONE 0 // No level cap, only applicable if B_EXP_CAP_TYPE is EXP_CAP_NONE
|
||||
#define LEVEL_CAP_FLAG_LIST 1 // Level cap is chosen according to the first unset flag in `sLevelCapFlagMap`
|
||||
#define LEVEL_CAP_VARIABLE 2 // Level cap is chosen according to the contents of the event variable specified by B_LEVEL_CAP_VARIABLE
|
||||
|
||||
// Configs
|
||||
#define B_EXP_CAP_TYPE EXP_CAP_NONE // [EXP_CAP_NONE, EXP_CAP_HARD, EXP_CAP_SOFT] choose the type of level cap to apply
|
||||
#define B_LEVEL_CAP_TYPE LEVEL_CAP_NONE // [LEVEL_CAP_NONE, LEVEL_CAP_FLAG_LIST, LEVEL_CAP_VARIABLE] choose the method to derive the level cap
|
||||
#define B_LEVEL_CAP_VARIABLE 0 // event variable used to derive level cap if B_LEVEL_CAP_TYPE is set to LEVEL_CAP_VARIABLE
|
||||
|
||||
#define B_RARE_CANDY_CAP FALSE // If set to true, Rare Candies can't be used to go over the level cap
|
||||
#define B_LEVEL_CAP_EXP_UP FALSE // If set to true, mons under level cap will receive more experience
|
||||
|
||||
#endif /* GUARD_CONFIG_LEVEL_CAP_H */
|
||||
@ -20,6 +20,7 @@
|
||||
#define GEN_6_ORAS GEN_LATEST + 1
|
||||
|
||||
#define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them.
|
||||
#define OW_BERRY_MUTATION_CHANCE 25 // Determines the % chance of a mutation.
|
||||
#define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist.
|
||||
#define OW_BERRY_ALWAYS_WATERABLE FALSE // If OW_BERRY_MOISTURE is enabled, this setting allows the player to continuously water soil; dry soil will cause a decrease in Berry Yield (like Gen4). When off, soil can only be watered when dry and watering increases yield (like Gen6).
|
||||
#define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled!
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
#define P_LVL_UP_LEARNSETS GEN_LATEST // Choose which set of Level Up Learnsets to use.
|
||||
// For generations that hadn't introduced a species yet, we use their first appearence (eg. Chikorita's Gen2 data if the config is set to GEN_1).
|
||||
// For generations that don't include a previously introduced species, we use their last apperance (eg. Snivy's Gen7 data if the config is set to GEN_8).
|
||||
// GEN_1/2/3/4/5/6/7: Yellow, Crystal, RSE, HGSS, B2W2, XY, USUM learnsets respectively.
|
||||
// GEN_1/2/3/4/5/6/7: Yellow, Crystal, RSE, HGSS, B2W2, ORAS, USUM learnsets respectively.
|
||||
// GEN_8: Use the following priority: BDSP for Gen1-4 Pokémon, then LA for species introduced in that game, then SwSh for species present in those games. Otherwise, use GEN_7.
|
||||
// GEN_9: SV For species present in those games. Otherwise use GEN_8.
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
#ifndef GUARD_CONSTANTS_EXPANSION_H
|
||||
#define GUARD_CONSTANTS_EXPANSION_H
|
||||
|
||||
// 1.8.0
|
||||
#define EXPANSION_VERSION_MAJOR 1
|
||||
#define EXPANSION_VERSION_MINOR 7
|
||||
#define EXPANSION_VERSION_PATCH 4
|
||||
#define EXPANSION_VERSION_MINOR 8
|
||||
#define EXPANSION_VERSION_PATCH 0
|
||||
|
||||
// FALSE if this this version of Expansion is not a tagged commit, i.e.
|
||||
// it contains unreleased changes.
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include "config/battle.h"
|
||||
#include "config/debug.h"
|
||||
#include "config/item.h"
|
||||
#include "config/level_caps.h"
|
||||
#include "config/pokemon.h"
|
||||
#include "config/overworld.h"
|
||||
#include "config/decap.h"
|
||||
|
||||
@ -294,14 +294,16 @@
|
||||
#define EVO_LEVEL_MOVE_TWENTY_TIMES 47 // Pokémon levels up after having used a move for at least 20 times
|
||||
#define EVO_LEVEL_RECOIL_DAMAGE_MALE 48 // Pokémon levels up after having suffered specified amount of non-fainting recoil damage as a male
|
||||
#define EVO_LEVEL_RECOIL_DAMAGE_FEMALE 49 // Pokémon levels up after having suffered specified amount of non-fainting recoil damage as a female
|
||||
#define EVO_LEVEL_ITEM_COUNT_999 50 // Pokémon levels up after trainer has collected 999 of a specific item
|
||||
|
||||
// Evolution 'modes,' for GetEvolutionTargetSpecies
|
||||
#define EVO_MODE_NORMAL 0
|
||||
#define EVO_MODE_TRADE 1
|
||||
#define EVO_MODE_ITEM_USE 2
|
||||
#define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve
|
||||
#define EVO_MODE_BATTLE_SPECIAL 4
|
||||
#define EVO_MODE_OVERWORLD_SPECIAL 5
|
||||
#define EVO_MODE_CANT_STOP 1
|
||||
#define EVO_MODE_TRADE 2
|
||||
#define EVO_MODE_ITEM_USE 3
|
||||
#define EVO_MODE_ITEM_CHECK 4 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve
|
||||
#define EVO_MODE_BATTLE_SPECIAL 5
|
||||
#define EVO_MODE_OVERWORLD_SPECIAL 6
|
||||
|
||||
#define MON_PIC_WIDTH 64
|
||||
#define MON_PIC_HEIGHT 64
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -110,6 +110,23 @@ struct TrainerClass
|
||||
u16 ball;
|
||||
};
|
||||
|
||||
struct TypeInfo
|
||||
{
|
||||
u8 name[TYPE_NAME_LENGTH + 1];
|
||||
u8 generic[17];
|
||||
u8 palette;
|
||||
u16 zMove;
|
||||
u16 maxMove;
|
||||
//u16 enhanceItem;
|
||||
//u16 berry;
|
||||
//u16 gem;
|
||||
//u16 plate;
|
||||
//u16 memory;
|
||||
//u16 zCrystal;
|
||||
//u16 teraShard;
|
||||
//u16 arceusForm;
|
||||
};
|
||||
|
||||
struct FollowerMsgInfo {
|
||||
const u8 *text;
|
||||
const u8 *script;
|
||||
@ -122,7 +139,6 @@ struct FollowerMessagePool
|
||||
u16 length;
|
||||
};
|
||||
|
||||
|
||||
extern const u16 gMinigameDigits_Pal[];
|
||||
extern const u32 gMinigameDigits_Gfx[];
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ bool8 IsBagPocketNonEmpty(u8 pocket);
|
||||
bool8 CheckBagHasItem(u16 itemId, u16 count);
|
||||
bool8 HasAtLeastOneBerry(void);
|
||||
bool8 CheckBagHasSpace(u16 itemId, u16 count);
|
||||
u32 GetFreeSpaceForItemInBag(u16 itemId);
|
||||
bool8 AddBagItem(u16 itemId, u16 count);
|
||||
bool8 RemoveBagItem(u16 itemId, u16 count);
|
||||
u8 GetPocketByItemId(u16 itemId);
|
||||
|
||||
@ -1,23 +1,6 @@
|
||||
#ifndef GUARD_LEVEL_CAP_H
|
||||
#define GUARD_LEVEL_CAP_H
|
||||
|
||||
// experience (soft-)caps
|
||||
|
||||
#define EXP_CAP_NONE 0 // Regular behavior, no level caps are applied
|
||||
#define EXP_CAP_HARD 1 // Pokémon with a level >= the level cap cannot gain any experience
|
||||
#define EXP_CAP_SOFT 2 // Pokémon with a level >= the level cap will gain reduced experience
|
||||
|
||||
#define LEVEL_CAP_NONE 0 // No level cap, only applicable if B_EXP_CAP_TYPE is EXP_CAP_NONE
|
||||
#define LEVEL_CAP_FLAG_LIST 1 // Level cap is chosen according to the first unset flag in `sLevelCapFlagMap`
|
||||
#define LEVEL_CAP_VARIABLE 2 // Level cap is chosen according to the contents of the event variable specified by B_LEVEL_CAP_VARIABLE
|
||||
|
||||
#define B_EXP_CAP_TYPE EXP_CAP_NONE // [EXP_CAP_NONE, EXP_CAP_HARD, EXP_CAP_SOFT] choose the type of level cap to apply
|
||||
#define B_LEVEL_CAP_TYPE LEVEL_CAP_NONE // [LEVEL_CAP_NONE, LEVEL_CAP_FLAG_LIST, LEVEL_CAP_VARIABLE] choose the method to derive the level cap
|
||||
#define B_LEVEL_CAP_VARIABLE 0 // event variable used to derive level cap if B_LEVEL_CAP_TYPE is set to LEVEL_CAP_VARIABLE
|
||||
|
||||
#define B_RARE_CANDY_CAP FALSE // If set to true, Rare Candies can't be used to go over the level cap
|
||||
#define B_LEVEL_CAP_EXP_UP FALSE // If set to true, mons under level cap will receive more experience
|
||||
|
||||
#if B_EXP_CAP_TYPE != EXP_CAP_NONE && B_EXP_CAP_TYPE != EXP_CAP_HARD && B_EXP_CAP_TYPE != EXP_CAP_SOFT
|
||||
#error "Invalid choice for B_EXP_CAP_TYPE, must be of [EXP_CAP_NONE, EXP_CAP_HARD, EXP_CAP_SOFT]"
|
||||
#endif
|
||||
|
||||
@ -2,6 +2,15 @@
|
||||
#ifndef METAPROGRAM_H
|
||||
#define METAPROGRAM_H
|
||||
|
||||
/* Check if VA_OPT_ is supported by the compiler. GCC's version should be at least 9.5*/
|
||||
#define PP_THIRD_ARG(a,b,c,...) c
|
||||
#define VA_OPT_SUPPORTED_I(...) PP_THIRD_ARG(__VA_OPT__(,),TRUE,FALSE,)
|
||||
#define VA_OPT_SUPPORTED VA_OPT_SUPPORTED_I(?)
|
||||
|
||||
#if !VA_OPT_SUPPORTED
|
||||
#error ERROR: VA_OPT__ is not supported. Please update your gcc compiler to version 10 or higher
|
||||
#endif // VA_OPT_SUPPORTED
|
||||
|
||||
/* Calls m0/m1/.../m8 depending on how many arguments are passed. */
|
||||
#define VARARG_8(m, ...) CAT(m, NARG_8(__VA_ARGS__))(__VA_ARGS__)
|
||||
|
||||
|
||||
@ -424,6 +424,7 @@ struct SpeciesInfo /*0x8C*/
|
||||
/* 0x7A */ u32 isLegendary:1;
|
||||
u32 isMythical:1;
|
||||
u32 isUltraBeast:1;
|
||||
u32 isTotem:1;
|
||||
u32 isParadoxForm:1;
|
||||
u32 isMegaEvolution:1;
|
||||
u32 isPrimalReversion:1;
|
||||
@ -454,44 +455,41 @@ struct MoveInfo
|
||||
const u8 *name;
|
||||
const u8 *description;
|
||||
u16 effect;
|
||||
u8 power;
|
||||
u8 type:5;
|
||||
u8 category:3;
|
||||
|
||||
u16 type:5;
|
||||
u16 category:2;
|
||||
u16 power:9; // up to 511
|
||||
u16 accuracy:7;
|
||||
u16 recoil:7;
|
||||
u16 criticalHitStage:2;
|
||||
u8 padding:6; // coming soon...
|
||||
u8 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy
|
||||
u16 target:9;
|
||||
u8 pp;
|
||||
|
||||
u16 target;
|
||||
s8 priority;
|
||||
union {
|
||||
u8 effect;
|
||||
u8 powerOverride;
|
||||
} zMove;
|
||||
|
||||
s32 priority:4;
|
||||
u32 recoil:7;
|
||||
u32 strikeCount:4; // Max 15 hits. Defaults to 1 if not set. May apply its effect on each hit.
|
||||
u32 criticalHitStage:2;
|
||||
u32 alwaysCriticalHit:1;
|
||||
u32 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy
|
||||
// 12 bits left to complete this word - continues into flags
|
||||
|
||||
// Flags
|
||||
u32 makesContact:1;
|
||||
u32 ignoresProtect:1;
|
||||
u32 magicCoatAffected:1;
|
||||
u32 snatchAffected:1;
|
||||
u32 mirrorMoveBanned:1;
|
||||
u32 ignoresKingsRock:1;
|
||||
u32 alwaysCriticalHit:1;
|
||||
u32 twoTurnMove:1;
|
||||
u32 punchingMove:1;
|
||||
u32 sheerForceBoost:1;
|
||||
u32 bitingMove:1;
|
||||
u32 pulseMove:1;
|
||||
u32 soundMove:1;
|
||||
u32 ballisticMove:1;
|
||||
u32 protectionMove:1;
|
||||
u32 powderMove:1;
|
||||
u32 danceMove:1;
|
||||
u32 windMove:1;
|
||||
u32 slicingMove:1;
|
||||
u32 slicingMove:1; // end of word
|
||||
u32 healingMove:1;
|
||||
u32 minimizeDoubleDamage:1;
|
||||
u32 ignoresTargetAbility:1;
|
||||
u32 ignoresTargetDefenseEvasionStages:1;
|
||||
@ -502,11 +500,12 @@ struct MoveInfo
|
||||
u32 ignoreTypeIfFlyingAndUngrounded:1;
|
||||
u32 thawsUser:1;
|
||||
u32 ignoresSubstitute:1;
|
||||
u32 strikeCount:4; // Max 15 hits. Defaults to 1 if not set. May apply its effect on each hit.
|
||||
u32 forcePressure:1;
|
||||
u32 cantUseTwice:1;
|
||||
|
||||
// Ban flags
|
||||
u32 gravityBanned:1;
|
||||
u32 healingMove:1;
|
||||
u32 mirrorMoveBanned:1;
|
||||
u32 meFirstBanned:1;
|
||||
u32 mimicBanned:1;
|
||||
u32 metronomeBanned:1;
|
||||
@ -519,7 +518,7 @@ struct MoveInfo
|
||||
u32 skyBattleBanned:1;
|
||||
u32 sketchBanned:1;
|
||||
|
||||
u32 argument; // also coming soon
|
||||
u32 argument;
|
||||
|
||||
// primary/secondary effects
|
||||
const struct AdditionalEffect *additionalEffects;
|
||||
@ -534,13 +533,16 @@ struct MoveInfo
|
||||
#define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__}
|
||||
#define ADDITIONAL_EFFECTS(...) EFFECTS_ARR( __VA_ARGS__ ), .numAdditionalEffects = ARRAY_COUNT(EFFECTS_ARR( __VA_ARGS__ ))
|
||||
|
||||
// Just a hack to make a move boosted by Sheer Force despite having no secondary effects affected
|
||||
#define SHEER_FORCE_HACK { .moveEffect = 0, .chance = 100, }
|
||||
|
||||
struct AdditionalEffect
|
||||
{
|
||||
u16 moveEffect;
|
||||
u8 self:1;
|
||||
u8 onlyIfTargetRaisedStats:1;
|
||||
u8 onChargeTurnOnly:1;
|
||||
u8 chance; // 0% = effect certain, primary effect
|
||||
u16 moveEffect;
|
||||
};
|
||||
|
||||
struct Ability
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
* LocalRandom(*val) allows you to have local random states that are the same
|
||||
* type as the global states regardless of HQ_RANDOM setting, which is useful
|
||||
* if you want to be able to set them from or assign them to gRngValue.
|
||||
* LocalRandomSeed(u32) returns a properly seeded rng_value_t.
|
||||
*
|
||||
* Random2_32() was added to HQ_RANDOM because the output of the generator is
|
||||
* always 32 bits and Random()/Random2() are just wrappers in that mode. It is
|
||||
@ -61,6 +62,7 @@ static inline u16 Random(void)
|
||||
|
||||
void SeedRng(u32 seed);
|
||||
void SeedRng2(u32 seed);
|
||||
rng_value_t LocalRandomSeed(u32 seed);
|
||||
|
||||
static inline u16 Random2(void)
|
||||
{
|
||||
@ -96,6 +98,11 @@ static inline void AdvanceRandom(void)
|
||||
Random();
|
||||
}
|
||||
|
||||
static inline rng_value_t LocalRandomSeed(u32 seed)
|
||||
{
|
||||
return seed;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
extern rng_value_t gRngValue;
|
||||
|
||||
@ -9,9 +9,9 @@ void CreateScriptedDoubleWildMon(u16, u8, u16, u16, u8, u16);
|
||||
void ScriptSetMonMoveSlot(u8, u16, u8);
|
||||
void ReducePlayerPartyToSelectedMons(void);
|
||||
void HealPlayerParty(void);
|
||||
void Script_GetChosenMonOffensiveEV(void);
|
||||
void Script_GetChosenMonDefensiveEV(void);
|
||||
void Script_GetChosenMonOffensiveIV(void);
|
||||
void Script_GetChosenMonDefensiveIV(void);
|
||||
void Script_GetChosenMonOffensiveEVs(void);
|
||||
void Script_GetChosenMonDefensiveEVs(void);
|
||||
void Script_GetChosenMonOffensiveIVs(void);
|
||||
void Script_GetChosenMonDefensiveIVs(void);
|
||||
|
||||
#endif // GUARD_SCRIPT_POKEMON_UTIL_H
|
||||
|
||||
@ -1026,6 +1026,7 @@ extern const u8 gText_ThankYouIllSendItHome[];
|
||||
extern const u8 gText_ThanksIllSendItHome[];
|
||||
extern const u8 gText_SpaceForVar1Full[];
|
||||
extern const u8 gText_ThrowInPremierBall[];
|
||||
extern const u8 gText_ThrowInPremierBalls[];
|
||||
extern const u8 gText_ShopBuy[];
|
||||
extern const u8 gText_ShopSell[];
|
||||
extern const u8 gText_ShopQuit[];
|
||||
|
||||
@ -18,11 +18,6 @@ SECTIONS {
|
||||
ALIGN(4)
|
||||
{
|
||||
__ewram_start = .;
|
||||
/*
|
||||
We link malloc.o here to prevent `gHeap` from landing in the middle of EWRAM.
|
||||
Otherwise this causes corruption issues on some ld versions
|
||||
*/
|
||||
gflib/malloc.o(ewram_data);
|
||||
*(.ewram*)
|
||||
__ewram_end = .;
|
||||
} > EWRAM
|
||||
|
||||
@ -171,14 +171,19 @@ static u32 GetAiFlags(u16 trainerId)
|
||||
}
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
flags |= AI_FLAG_DOUBLE_BATTLE;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
void BattleAI_SetupFlags(void)
|
||||
{
|
||||
AI_THINKING_STRUCT->aiFlags[B_POSITION_PLAYER_LEFT] = 0; // player has no AI
|
||||
if (IsAiVsAiBattle())
|
||||
AI_THINKING_STRUCT->aiFlags[B_POSITION_PLAYER_LEFT] = GetAiFlags(gPartnerTrainerId);
|
||||
else
|
||||
AI_THINKING_STRUCT->aiFlags[B_POSITION_PLAYER_LEFT] = 0; // player has no AI
|
||||
|
||||
#if DEBUG_OVERWORLD_MENU == TRUE
|
||||
if (gIsDebugBattle)
|
||||
@ -208,6 +213,10 @@ void BattleAI_SetupFlags(void)
|
||||
{
|
||||
AI_THINKING_STRUCT->aiFlags[B_POSITION_PLAYER_RIGHT] = GetAiFlags(gPartnerTrainerId - TRAINER_PARTNER(PARTNER_NONE));
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && IsAiVsAiBattle())
|
||||
{
|
||||
AI_THINKING_STRUCT->aiFlags[B_POSITION_PLAYER_RIGHT] = AI_THINKING_STRUCT->aiFlags[B_POSITION_PLAYER_LEFT];
|
||||
}
|
||||
else
|
||||
{
|
||||
AI_THINKING_STRUCT->aiFlags[B_POSITION_PLAYER_RIGHT] = 0; // player
|
||||
@ -789,47 +798,30 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
SetTypeBeforeUsingMove(move, battlerAtk);
|
||||
GET_MOVE_TYPE(move, moveType);
|
||||
|
||||
if (gMovesInfo[move].powderMove && !IsAffectedByPowder(battlerDef, aiData->abilities[battlerDef], aiData->holdEffects[battlerDef]))
|
||||
RETURN_SCORE_MINUS(10);
|
||||
|
||||
if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER)
|
||||
RETURN_SCORE_MINUS(10);
|
||||
|
||||
if (IsTwoTurnNotSemiInvulnerableMove(battlerAtk, move) && CanTargetFaintAi(battlerDef, battlerAtk))
|
||||
RETURN_SCORE_MINUS(10);
|
||||
|
||||
// check if negates type
|
||||
switch (effectiveness)
|
||||
{
|
||||
case AI_EFFECTIVENESS_x0:
|
||||
RETURN_SCORE_MINUS(20);
|
||||
break;
|
||||
case AI_EFFECTIVENESS_x0_125:
|
||||
case AI_EFFECTIVENESS_x0_25:
|
||||
RETURN_SCORE_MINUS(10);
|
||||
break;
|
||||
}
|
||||
|
||||
// check non-user target
|
||||
if (!(moveTarget & MOVE_TARGET_USER))
|
||||
{
|
||||
// handle negative checks on non-user target
|
||||
// check powder moves
|
||||
if (gMovesInfo[move].powderMove && !IsAffectedByPowder(battlerDef, aiData->abilities[battlerDef], aiData->holdEffects[battlerDef]))
|
||||
{
|
||||
RETURN_SCORE_MINUS(20);
|
||||
}
|
||||
|
||||
// check ground immunities
|
||||
if (moveType == TYPE_GROUND
|
||||
&& !IsBattlerGrounded(battlerDef)
|
||||
&& ((aiData->abilities[battlerDef] == ABILITY_LEVITATE
|
||||
&& DoesBattlerIgnoreAbilityChecks(aiData->abilities[battlerAtk], move))
|
||||
|| aiData->holdEffects[battlerDef] == HOLD_EFFECT_AIR_BALLOON
|
||||
|| (gStatuses3[battlerDef] & (STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS)))
|
||||
&& move != MOVE_THOUSAND_ARROWS)
|
||||
{
|
||||
RETURN_SCORE_MINUS(20);
|
||||
}
|
||||
|
||||
// check off screen
|
||||
if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER)
|
||||
RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move
|
||||
|
||||
if (IsTwoTurnNotSemiInvulnerableMove(battlerAtk, move) && CanTargetFaintAi(battlerDef, battlerAtk))
|
||||
RETURN_SCORE_MINUS(10);
|
||||
|
||||
// check if negates type
|
||||
switch (effectiveness)
|
||||
{
|
||||
case AI_EFFECTIVENESS_x0:
|
||||
RETURN_SCORE_MINUS(20);
|
||||
break;
|
||||
case AI_EFFECTIVENESS_x0_125:
|
||||
case AI_EFFECTIVENESS_x0_25:
|
||||
RETURN_SCORE_MINUS(10);
|
||||
break;
|
||||
}
|
||||
|
||||
// target ability checks
|
||||
if (!DoesBattlerIgnoreAbilityChecks(aiData->abilities[battlerAtk], move))
|
||||
{
|
||||
@ -850,30 +842,10 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ABILITY_VOLT_ABSORB:
|
||||
case ABILITY_MOTOR_DRIVE:
|
||||
case ABILITY_LIGHTNING_ROD:
|
||||
if (moveType == TYPE_ELECTRIC)
|
||||
RETURN_SCORE_MINUS(20);
|
||||
break;
|
||||
case ABILITY_WATER_ABSORB:
|
||||
case ABILITY_DRY_SKIN:
|
||||
case ABILITY_STORM_DRAIN:
|
||||
if (moveType == TYPE_WATER)
|
||||
RETURN_SCORE_MINUS(20);
|
||||
break;
|
||||
case ABILITY_FLASH_FIRE:
|
||||
if (moveType == TYPE_FIRE)
|
||||
RETURN_SCORE_MINUS(20);
|
||||
break;
|
||||
case ABILITY_WONDER_GUARD:
|
||||
if (effectiveness < AI_EFFECTIVENESS_x2)
|
||||
return 0;
|
||||
break;
|
||||
case ABILITY_SAP_SIPPER:
|
||||
if (moveType == TYPE_GRASS)
|
||||
RETURN_SCORE_MINUS(20);
|
||||
break;
|
||||
case ABILITY_JUSTIFIED:
|
||||
if (moveType == TYPE_DARK && !IS_MOVE_STATUS(move))
|
||||
RETURN_SCORE_MINUS(10);
|
||||
@ -883,14 +855,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
&& (moveType == TYPE_DARK || moveType == TYPE_GHOST || moveType == TYPE_BUG))
|
||||
RETURN_SCORE_MINUS(10);
|
||||
break;
|
||||
case ABILITY_SOUNDPROOF:
|
||||
if (gMovesInfo[move].soundMove)
|
||||
RETURN_SCORE_MINUS(10);
|
||||
break;
|
||||
case ABILITY_BULLETPROOF:
|
||||
if (gMovesInfo[move].ballisticMove)
|
||||
RETURN_SCORE_MINUS(10);
|
||||
break;
|
||||
case ABILITY_DAZZLING:
|
||||
case ABILITY_QUEENLY_MAJESTY:
|
||||
case ABILITY_ARMOR_TAIL:
|
||||
@ -1096,12 +1060,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
ADJUST_SCORE(-1);
|
||||
}
|
||||
break;
|
||||
case EFFECT_DREAM_EATER:
|
||||
if (!AI_IsBattlerAsleepOrComatose(battlerDef))
|
||||
ADJUST_SCORE(-8);
|
||||
else if (effectiveness == AI_EFFECTIVENESS_x0)
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
// stat raising effects
|
||||
case EFFECT_ATTACK_UP:
|
||||
case EFFECT_ATTACK_UP_2:
|
||||
@ -1897,10 +1855,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
else if (aiData->hpPercents[battlerAtk] >= 90)
|
||||
ADJUST_SCORE(-8); //No point in healing, but should at least do it if nothing better
|
||||
break;
|
||||
case EFFECT_SUPER_FANG:
|
||||
if (aiData->hpPercents[battlerDef] < 50)
|
||||
ADJUST_SCORE(-4);
|
||||
break;
|
||||
case EFFECT_RECOIL_IF_MISS:
|
||||
if (aiData->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->moveAccuracy[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] < 75)
|
||||
ADJUST_SCORE(-6);
|
||||
@ -1926,11 +1880,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
break;
|
||||
case EFFECT_METRONOME:
|
||||
break;
|
||||
case EFFECT_ENDEAVOR:
|
||||
case EFFECT_PAIN_SPLIT:
|
||||
if (gBattleMons[battlerAtk].hp > (gBattleMons[battlerAtk].hp + gBattleMons[battlerDef].hp) / 2)
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
|
||||
case EFFECT_CONVERSION_2:
|
||||
//TODO
|
||||
@ -1956,9 +1905,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
if (gBattleMons[battlerDef].status2 & STATUS2_DESTINY_BOND)
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_FALSE_SWIPE:
|
||||
// TODO
|
||||
break;
|
||||
case EFFECT_HEAL_BELL:
|
||||
if (!AnyPartyMemberStatused(battlerAtk, gMovesInfo[move].soundMove) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove))
|
||||
ADJUST_SCORE(-10);
|
||||
@ -2041,10 +1987,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
|| DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, aiData->partnerMove))
|
||||
ADJUST_SCORE(-9);
|
||||
break;
|
||||
case EFFECT_FAIL_IF_NOT_ARG_TYPE:
|
||||
if (!IS_BATTLER_OF_TYPE(battlerAtk, gMovesInfo[move].argument))
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_DEFOG:
|
||||
if (gSideStatuses[GetBattlerSide(battlerDef)]
|
||||
& (SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL | SIDE_STATUS_SAFEGUARD | SIDE_STATUS_MIST)
|
||||
@ -2146,10 +2088,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
if (!HasMagicCoatAffectedMove(battlerDef))
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_BELCH:
|
||||
if (ItemId_GetPocket(GetUsedHeldItem(battlerAtk)) != POCKET_BERRIES)
|
||||
ADJUST_SCORE(-10); // attacker has not consumed a berry
|
||||
break;
|
||||
case EFFECT_YAWN:
|
||||
if (gStatuses3[battlerDef] & STATUS3_YAWN)
|
||||
ADJUST_SCORE(-10);
|
||||
@ -2498,8 +2436,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
|
||||
if (instructedMove == MOVE_NONE
|
||||
|| gMovesInfo[instructedMove].instructBanned
|
||||
|| gMovesInfo[instructedMove].twoTurnMove
|
||||
|| MoveHasMoveEffectSelf(instructedMove, MOVE_EFFECT_RECHARGE)
|
||||
|| MoveHasAdditionalEffectSelf(instructedMove, MOVE_EFFECT_RECHARGE)
|
||||
|| IsZMove(instructedMove)
|
||||
|| (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF)
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS
|
||||
@ -2570,10 +2507,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
if (!CanCamouflage(battlerAtk))
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_LAST_RESORT:
|
||||
if (!CanUseLastResort(battlerAtk))
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_SYNCHRONOISE:
|
||||
//Check holding ring target or is of same type
|
||||
if (aiData->holdEffects[battlerDef] == HOLD_EFFECT_RING_TARGET
|
||||
@ -2647,10 +2580,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
&& !BattlerStatCanRise(battlerAtk, aiData->abilities[battlerAtk], STAT_SPDEF))
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_LOW_KICK:
|
||||
if (IsDynamaxed(battlerDef))
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_UPPER_HAND:
|
||||
if (predictedMove == MOVE_NONE || IS_MOVE_STATUS(predictedMove) || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER || GetMovePriority(battlerDef, move) < 1 || GetMovePriority(battlerDef, move) > 3) // Opponent going first or not using priority move
|
||||
ADJUST_SCORE(-10);
|
||||
@ -3132,7 +3061,7 @@ static s32 AI_CompareDamagingMoves(u32 battlerAtk, u32 battlerDef, u32 currId)
|
||||
if (moves[i] != MOVE_NONE && gMovesInfo[moves[i]].power)
|
||||
{
|
||||
noOfHits[i] = GetNoOfHitsToKOBattler(battlerAtk, battlerDef, i);
|
||||
if (noOfHits[i] < leastHits)
|
||||
if (noOfHits[i] < leastHits && noOfHits[i] != 0)
|
||||
{
|
||||
leastHits = noOfHits[i];
|
||||
}
|
||||
@ -3837,9 +3766,9 @@ static u32 AI_CalcMoveScore(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
IncreaseStatUpScore(battlerAtk, battlerDef, STAT_CHANGE_DEF, &score);
|
||||
break;
|
||||
case EFFECT_FIRST_TURN_ONLY:
|
||||
if (ShouldFakeOut(battlerAtk, battlerDef, move))
|
||||
if (ShouldFakeOut(battlerAtk, battlerDef, move) && MoveHasAdditionalEffectWithChance(move, MOVE_EFFECT_FLINCH, 100))
|
||||
ADJUST_SCORE(GOOD_EFFECT);
|
||||
else if (gMovesInfo[move].argument == MOVE_FIRST_IMPRESSION && gDisableStructs[battlerAtk].isFirstTurn && GetBestDmgMoveFromBattler(battlerAtk, battlerDef) == move)
|
||||
else if (gDisableStructs[battlerAtk].isFirstTurn && GetBestDmgMoveFromBattler(battlerAtk, battlerDef) == move)
|
||||
ADJUST_SCORE(BEST_EFFECT);
|
||||
break;
|
||||
case EFFECT_STOCKPILE:
|
||||
@ -4683,7 +4612,12 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||
return score;
|
||||
|
||||
if (gMovesInfo[move].power)
|
||||
score += AI_CompareDamagingMoves(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex);
|
||||
{
|
||||
if (GetNoOfHitsToKOBattler(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex) == 0)
|
||||
ADJUST_SCORE(-20);
|
||||
else
|
||||
score += AI_CompareDamagingMoves(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex);
|
||||
}
|
||||
|
||||
// Calculates score based on effects of a move
|
||||
score += AI_CalcMoveScore(battlerAtk, battlerDef, move);
|
||||
@ -4796,6 +4730,7 @@ static s32 AI_SetupFirstTurn(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||
ADJUST_SCORE(DECENT_EFFECT);
|
||||
break;
|
||||
case EFFECT_HIT:
|
||||
{
|
||||
// TEMPORARY - should applied to all moves regardless of EFFECT
|
||||
// Consider move effects
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
@ -4810,6 +4745,7 @@ static s32 AI_SetupFirstTurn(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -4850,6 +4786,7 @@ static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
ADJUST_SCORE(DECENT_EFFECT);
|
||||
break;
|
||||
case EFFECT_HIT:
|
||||
{
|
||||
// TEMPORARY - should applied to all moves regardless of EFFECT
|
||||
// Consider move effects
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
@ -4864,6 +4801,7 @@ static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -366,10 +366,84 @@ static inline s32 LowestRollDmg(s32 dmg)
|
||||
return dmg;
|
||||
}
|
||||
|
||||
bool32 IsDamageMoveUsable(u32 move, u32 battlerAtk, u32 battlerDef)
|
||||
{
|
||||
s32 moveType;
|
||||
struct AiLogicData *aiData = AI_DATA;
|
||||
u32 battlerDefAbility;
|
||||
|
||||
if (DoesBattlerIgnoreAbilityChecks(aiData->abilities[battlerAtk], move))
|
||||
battlerDefAbility = ABILITY_NONE;
|
||||
else
|
||||
battlerDefAbility = aiData->abilities[battlerDef];
|
||||
|
||||
SetTypeBeforeUsingMove(move, battlerAtk);
|
||||
GET_MOVE_TYPE(move, moveType);
|
||||
|
||||
switch (battlerDefAbility)
|
||||
{
|
||||
case ABILITY_VOLT_ABSORB:
|
||||
case ABILITY_MOTOR_DRIVE:
|
||||
case ABILITY_LIGHTNING_ROD:
|
||||
if (moveType == TYPE_ELECTRIC)
|
||||
return TRUE;
|
||||
break;
|
||||
case ABILITY_WATER_ABSORB:
|
||||
case ABILITY_DRY_SKIN:
|
||||
case ABILITY_STORM_DRAIN:
|
||||
if (moveType == TYPE_WATER)
|
||||
return TRUE;
|
||||
break;
|
||||
case ABILITY_FLASH_FIRE:
|
||||
if (moveType == TYPE_FIRE)
|
||||
return TRUE;
|
||||
break;
|
||||
case ABILITY_SOUNDPROOF:
|
||||
if (gMovesInfo[move].soundMove)
|
||||
return TRUE;
|
||||
break;
|
||||
case ABILITY_BULLETPROOF:
|
||||
if (gMovesInfo[move].ballisticMove)
|
||||
return TRUE;
|
||||
break;
|
||||
case ABILITY_SAP_SIPPER:
|
||||
if (moveType == TYPE_GRASS)
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (gMovesInfo[move].effect)
|
||||
{
|
||||
case EFFECT_DREAM_EATER:
|
||||
if (!AI_IsBattlerAsleepOrComatose(battlerDef))
|
||||
return TRUE;
|
||||
break;
|
||||
case EFFECT_BELCH:
|
||||
if (ItemId_GetPocket(GetUsedHeldItem(battlerAtk)) != POCKET_BERRIES)
|
||||
return TRUE;
|
||||
break;
|
||||
case EFFECT_LAST_RESORT:
|
||||
if (!CanUseLastResort(battlerAtk))
|
||||
return TRUE;
|
||||
break;
|
||||
case EFFECT_LOW_KICK:
|
||||
if (IsDynamaxed(battlerDef))
|
||||
return TRUE;
|
||||
break;
|
||||
case EFFECT_FAIL_IF_NOT_ARG_TYPE:
|
||||
if (!IS_BATTLER_OF_TYPE(battlerAtk, gMovesInfo[move].argument))
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectiveness, bool32 considerZPower, u32 weather)
|
||||
{
|
||||
s32 dmg, moveType;
|
||||
uq4_12_t effectivenessMultiplier;
|
||||
bool32 isDamageMoveUnusable = FALSE;
|
||||
struct AiLogicData *aiData = AI_DATA;
|
||||
|
||||
SetBattlerData(battlerAtk);
|
||||
@ -393,8 +467,11 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes
|
||||
SetTypeBeforeUsingMove(move, battlerAtk);
|
||||
GET_MOVE_TYPE(move, moveType);
|
||||
|
||||
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, aiData->abilities[battlerDef], FALSE);
|
||||
if (gMovesInfo[move].power)
|
||||
isDamageMoveUnusable = IsDamageMoveUsable(move, battlerAtk, battlerDef);
|
||||
|
||||
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, aiData->abilities[battlerDef], FALSE);
|
||||
if (gMovesInfo[move].power && !isDamageMoveUnusable)
|
||||
{
|
||||
s32 critChanceIndex, normalDmg, fixedBasePower, n;
|
||||
|
||||
@ -612,7 +689,7 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3
|
||||
case MOVE_EFFECT_SP_DEF_MINUS_2:
|
||||
case MOVE_EFFECT_ACC_MINUS_2:
|
||||
case MOVE_EFFECT_EVS_MINUS_2:
|
||||
if (ShouldLowerStat(battlerDef, abilityDef, STAT_ATK + (gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_MINUS_2)) && noOfHitsToKo != 1)
|
||||
if (ShouldLowerStat(battlerDef, abilityDef, STAT_ATK + (gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_MINUS_1)) && noOfHitsToKo != 1)
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
@ -642,6 +719,7 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s
|
||||
return TRUE;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
{
|
||||
switch (gMovesInfo[move].additionalEffects[i].moveEffect)
|
||||
@ -666,6 +744,7 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1716,7 +1795,7 @@ bool32 HasMoveWithAdditionalEffect(u32 battlerId, u32 moveEffect)
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE
|
||||
&& MoveHasMoveEffect(moves[i], moveEffect))
|
||||
&& MoveHasAdditionalEffect(moves[i], moveEffect))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1747,7 +1826,7 @@ bool32 HasMoveWithMoveEffectExcept(u32 battlerId, u32 moveEffect, u32 exception)
|
||||
{
|
||||
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE
|
||||
&& gMovesInfo[moves[i]].effect != exception
|
||||
&& MoveHasMoveEffect(moves[i], moveEffect))
|
||||
&& MoveHasAdditionalEffect(moves[i], moveEffect))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1843,8 +1922,8 @@ bool32 IsTrappingMove(u32 move)
|
||||
//case EFFECT_NO_RETREAT: // TODO
|
||||
return TRUE;
|
||||
default:
|
||||
return MoveHasMoveEffect(move, MOVE_EFFECT_PREVENT_ESCAPE)
|
||||
|| MoveHasMoveEffect(move, MOVE_EFFECT_WRAP);
|
||||
return MoveHasAdditionalEffect(move, MOVE_EFFECT_PREVENT_ESCAPE)
|
||||
|| MoveHasAdditionalEffect(move, MOVE_EFFECT_WRAP);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2700,7 +2779,7 @@ bool32 AI_CanBeInfatuated(u32 battlerAtk, u32 battlerDef, u32 defAbility)
|
||||
|
||||
u32 ShouldTryToFlinch(u32 battlerAtk, u32 battlerDef, u32 atkAbility, u32 defAbility, u32 move)
|
||||
{
|
||||
if (((AI_DATA->abilities[battlerAtk] != ABILITY_MOLD_BREAKER && (defAbility == ABILITY_SHIELD_DUST || defAbility == ABILITY_INNER_FOCUS))
|
||||
if (((!IsMoldBreakerTypeAbility(AI_DATA->abilities[battlerAtk]) && (defAbility == ABILITY_SHIELD_DUST || defAbility == ABILITY_INNER_FOCUS))
|
||||
|| AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK
|
||||
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|
||||
|| AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER)) // Opponent goes first
|
||||
@ -2738,12 +2817,12 @@ bool32 ShouldTrap(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
|
||||
bool32 ShouldFakeOut(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
{
|
||||
if ((!gDisableStructs[battlerAtk].isFirstTurn && MoveHasMoveEffectWithChance(move, MOVE_EFFECT_FLINCH, 100))
|
||||
if ((!gDisableStructs[battlerAtk].isFirstTurn && MoveHasAdditionalEffectWithChance(move, MOVE_EFFECT_FLINCH, 100))
|
||||
|| AI_DATA->abilities[battlerAtk] == ABILITY_GORILLA_TACTICS
|
||||
|| AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND
|
||||
|| AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK
|
||||
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|
||||
|| (AI_DATA->abilities[battlerAtk] != ABILITY_MOLD_BREAKER
|
||||
|| (!IsMoldBreakerTypeAbility(AI_DATA->abilities[battlerAtk])
|
||||
&& (AI_DATA->abilities[battlerDef] == ABILITY_SHIELD_DUST || AI_DATA->abilities[battlerDef] == ABILITY_INNER_FOCUS)))
|
||||
return FALSE;
|
||||
|
||||
@ -3546,7 +3625,8 @@ bool32 ShouldUseZMove(u32 battlerAtk, u32 battlerDef, u32 chosenMove)
|
||||
{
|
||||
u8 effectiveness;
|
||||
|
||||
if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE && gBattleMons[battlerDef].species == SPECIES_MIMIKYU_DISGUISED)
|
||||
if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE
|
||||
&& (gBattleMons[battlerDef].species == SPECIES_MIMIKYU_DISGUISED || gBattleMons[battlerDef].species == SPECIES_MIMIKYU_TOTEM_DISGUISED))
|
||||
return FALSE; // Don't waste a Z-Move busting disguise
|
||||
if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE && gBattleMons[battlerDef].species == SPECIES_EISCUE_ICE_FACE && IS_MOVE_PHYSICAL(chosenMove))
|
||||
return FALSE; // Don't waste a Z-Move busting Ice Face
|
||||
|
||||
@ -2368,7 +2368,7 @@ void AnimTask_TransformMon(u8 taskId)
|
||||
else
|
||||
position = GetBattlerPosition(gBattleAnimAttacker);
|
||||
|
||||
src = gMonSpritesGfxPtr->sprites.ptr[position];
|
||||
src = gMonSpritesGfxPtr->spritesGfx[position];
|
||||
dest = animBg.bgTiles;
|
||||
CpuCopy32(src, dest, MON_PIC_SIZE);
|
||||
LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset);
|
||||
|
||||
@ -40,11 +40,6 @@ static void AnimTask_WaitAndRestoreVisibility(u8);
|
||||
|
||||
static const u16 sCurseLinesPalette[] = { RGB_WHITE };
|
||||
|
||||
// These belong in battle_intro.c, but putting them there causes 2 bytes of alignment padding
|
||||
// between the two .rodata segments. Perhaps battle_intro.c actually belongs in this file, too.
|
||||
const u8 gBattleAnimBgCntSet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT};
|
||||
const u8 gBattleAnimBgCntGet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT};
|
||||
|
||||
void AnimTask_BlendBattleAnimPal(u8 taskId)
|
||||
{
|
||||
u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]);
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
#include "constants/battle_partner.h"
|
||||
|
||||
// .rodata
|
||||
static const u16 sUnrefArray[] = {0x0300, 0x0000}; //OamData?
|
||||
|
||||
static const struct OamData sVsLetter_V_OamData =
|
||||
{
|
||||
|
||||
@ -170,9 +170,6 @@ static void Intro_WaitForShinyAnimAndHealthbox(u32 battler)
|
||||
twoMons = TRUE;
|
||||
}
|
||||
|
||||
gBattleControllerOpponentHealthboxData = &gBattleSpritesDataPtr->healthBoxesData[battler];
|
||||
gBattleControllerOpponentFlankHealthboxData = &gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(battler)];
|
||||
|
||||
if (healthboxAnimDone)
|
||||
{
|
||||
if (twoMons == TRUE)
|
||||
|
||||
@ -1756,7 +1756,7 @@ static void MoveSelectionDisplayMoveType(u32 battler)
|
||||
else
|
||||
type = gMovesInfo[moveInfo->moves[gMoveSelectionCursor[battler]]].type;
|
||||
|
||||
StringCopy(txtPtr, gTypeNames[type]);
|
||||
StringCopy(txtPtr, gTypesInfo[type].name);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE);
|
||||
}
|
||||
|
||||
|
||||
@ -84,10 +84,6 @@ void SetUpBattleVarsAndBirchZigzagoon(void)
|
||||
i = 0;
|
||||
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &i);
|
||||
}
|
||||
|
||||
// Below are never read
|
||||
gUnusedFirstBattleVar1 = 0;
|
||||
gUnusedFirstBattleVar2 = 0;
|
||||
}
|
||||
|
||||
void InitBattleControllers(void)
|
||||
|
||||
@ -1480,7 +1480,7 @@ static void PrintSecondaryEntries(struct BattleDebugMenu *data)
|
||||
{
|
||||
u8 *types = &gBattleMons[data->battlerId].type1;
|
||||
|
||||
PadString(gTypeNames[types[i]], text);
|
||||
PadString(gTypesInfo[types[i]].name, text);
|
||||
printer.currentY = printer.y = (i * yMultiplier) + sSecondaryListTemplate.upText_Y;
|
||||
AddTextPrinter(&printer, 0, NULL);
|
||||
}
|
||||
|
||||
@ -198,17 +198,6 @@ static const u8 sBattleStyleThresholds[NUM_BATTLE_STYLES - 1][NUM_MOVE_POINT_TYP
|
||||
[DOME_BATTLE_STYLE_UNUSED3] = {0},
|
||||
//[DOME_BATTLE_STYLE_UNUSED4] = {0}, // Excluded here, presumably was meant to be a style just for Dome Ace Tucker
|
||||
};
|
||||
static const u8 sUnusedArray[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 3, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 2,
|
||||
0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
|
||||
0, 2, 253, 0, 0, 0, 0, 0, 253, 0, 0, 0, 0, 0, 253, 0,
|
||||
0, 0, 0, 0, 253, 0, 0, 0, 0, 0, 253, 254, 0, 0, 0, 0,
|
||||
0, 254, 0, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 254, 0, 0,
|
||||
0, 0, 0, 254, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
// 1st array is for cursor position (sprite id): cursor can be on a trainer info button, a match info button, or the exit/cancel button
|
||||
// 2nd array is for round count. For some reason this array contains an inaccessible Round 5 which is identical to Round 4
|
||||
@ -4059,7 +4048,7 @@ static bool32 IsDomeStatusMoveEffect(u32 move)
|
||||
case EFFECT_CURSE:
|
||||
return TRUE;
|
||||
default:
|
||||
return MoveHasMoveEffect(move, MOVE_EFFECT_WRAP);
|
||||
return MoveHasAdditionalEffect(move, MOVE_EFFECT_WRAP);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4388,7 +4377,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||
allocatedArray[k] = (gMovesInfo[move].pp <= 5) ? 1 : 0;
|
||||
break;
|
||||
case MOVE_POINTS_EFFECT:
|
||||
allocatedArray[k] = gMovesInfo[move].sheerForceBoost;
|
||||
allocatedArray[k] = MoveIsAffectedBySheerForce(move);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,29 +24,6 @@
|
||||
|
||||
static u8 GetMaxPowerTier(u16 move);
|
||||
|
||||
// Constant Data
|
||||
static const u16 sMaxMoveTable[NUMBER_OF_MON_TYPES] =
|
||||
{
|
||||
[TYPE_NORMAL] = MOVE_MAX_STRIKE,
|
||||
[TYPE_FIGHTING] = MOVE_MAX_KNUCKLE,
|
||||
[TYPE_FLYING] = MOVE_MAX_AIRSTREAM,
|
||||
[TYPE_POISON] = MOVE_MAX_OOZE,
|
||||
[TYPE_GROUND] = MOVE_MAX_QUAKE,
|
||||
[TYPE_ROCK] = MOVE_MAX_ROCKFALL,
|
||||
[TYPE_BUG] = MOVE_MAX_FLUTTERBY,
|
||||
[TYPE_GHOST] = MOVE_MAX_PHANTASM,
|
||||
[TYPE_STEEL] = MOVE_MAX_STEELSPIKE,
|
||||
[TYPE_FIRE] = MOVE_MAX_FLARE,
|
||||
[TYPE_WATER] = MOVE_MAX_GEYSER,
|
||||
[TYPE_GRASS] = MOVE_MAX_OVERGROWTH,
|
||||
[TYPE_ELECTRIC] = MOVE_MAX_LIGHTNING,
|
||||
[TYPE_PSYCHIC] = MOVE_MAX_MINDSTORM,
|
||||
[TYPE_ICE] = MOVE_MAX_HAILSTORM,
|
||||
[TYPE_DRAGON] = MOVE_MAX_WYRMWIND,
|
||||
[TYPE_DARK] = MOVE_MAX_DARKNESS,
|
||||
[TYPE_FAIRY] = MOVE_MAX_STARFALL,
|
||||
};
|
||||
|
||||
struct GMaxMove
|
||||
{
|
||||
u16 species;
|
||||
@ -305,9 +282,9 @@ static u16 GetTypeBasedMaxMove(u16 battlerId, u16 type)
|
||||
}
|
||||
|
||||
// Regular Max Move
|
||||
if (sMaxMoveTable[type] == MOVE_NONE) // failsafe
|
||||
return sMaxMoveTable[0];
|
||||
return sMaxMoveTable[type];
|
||||
if (gTypesInfo[type].maxMove == MOVE_NONE) // failsafe
|
||||
return gTypesInfo[0].maxMove;
|
||||
return gTypesInfo[type].maxMove;
|
||||
}
|
||||
|
||||
// Returns the appropriate Max Move or G-Max Move for a battler to use.
|
||||
@ -637,7 +614,7 @@ void BS_SetMaxMoveEffect(void)
|
||||
case MAX_EFFECT_SANDSTORM:
|
||||
case MAX_EFFECT_HAIL:
|
||||
{
|
||||
u8 weather, msg;
|
||||
u8 weather = 0, msg = 0;
|
||||
switch (maxEffect)
|
||||
{
|
||||
case MAX_EFFECT_SUN:
|
||||
|
||||
@ -606,13 +606,13 @@ void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battler)
|
||||
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
species, currentPersonality);
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
species, currentPersonality);
|
||||
}
|
||||
|
||||
@ -654,7 +654,7 @@ void DecompressTrainerFrontPic(u16 frontPicId, u8 battler)
|
||||
{
|
||||
u8 position = GetBattlerPosition(battler);
|
||||
DecompressPicFromTable(&gTrainerSprites[frontPicId].frontPic,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
LoadCompressedSpritePalette(&gTrainerSprites[frontPicId].palette);
|
||||
}
|
||||
|
||||
@ -662,7 +662,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battler)
|
||||
{
|
||||
u8 position = GetBattlerPosition(battler);
|
||||
DecompressPicFromTable(&gTrainerBacksprites[backPicId].backPic,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
LoadCompressedPalette(gTrainerBacksprites[backPicId].palette.data,
|
||||
OBJ_PLTT_ID(battler), PLTT_SIZE_4BPP);
|
||||
}
|
||||
@ -883,7 +883,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
||||
isShiny = gContestResources->moveAnim->isShiny;
|
||||
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
targetSpecies,
|
||||
gContestResources->moveAnim->targetPersonality);
|
||||
}
|
||||
@ -910,7 +910,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
||||
}
|
||||
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
targetSpecies,
|
||||
gTransformedPersonalities[battlerAtk]);
|
||||
}
|
||||
@ -928,12 +928,12 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
||||
}
|
||||
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
targetSpecies,
|
||||
gTransformedPersonalities[battlerAtk]);
|
||||
}
|
||||
}
|
||||
src = gMonSpritesGfxPtr->sprites.ptr[position];
|
||||
src = gMonSpritesGfxPtr->spritesGfx[position];
|
||||
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
|
||||
DmaCopy32(3, src, dst, MON_PIC_SIZE);
|
||||
paletteOffset = OBJ_PLTT_ID(battlerAtk);
|
||||
@ -961,22 +961,21 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battler, bool8 loadMonSprite)
|
||||
|
||||
if (!loadMonSprite)
|
||||
{
|
||||
|
||||
if (IsContest())
|
||||
position = B_POSITION_PLAYER_LEFT;
|
||||
else
|
||||
position = GetBattlerPosition(battler);
|
||||
|
||||
if (IsContest())
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
else if (GetBattlerSide(battler) != B_SIDE_PLAYER)
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_Substitute, gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_Substitute, gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
else
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
Dma3CopyLarge32_(gMonSpritesGfxPtr->sprites.ptr[position], &gMonSpritesGfxPtr->sprites.byte[position][MON_PIC_SIZE * i], MON_PIC_SIZE);
|
||||
Dma3CopyLarge32_(gMonSpritesGfxPtr->spritesGfx[position], &gMonSpritesGfxPtr->spritesGfx[position][MON_PIC_SIZE * i], MON_PIC_SIZE);
|
||||
}
|
||||
|
||||
palOffset = OBJ_PLTT_ID(battler);
|
||||
@ -1217,14 +1216,14 @@ void AllocateMonSpritesGfx(void)
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
gMonSpritesGfxPtr->sprites.ptr[i] = gMonSpritesGfxPtr->firstDecompressed + (i * MON_PIC_SIZE * 4);
|
||||
*(gMonSpritesGfxPtr->templates + i) = gBattlerSpriteTemplates[i];
|
||||
gMonSpritesGfxPtr->spritesGfx[i] = gMonSpritesGfxPtr->firstDecompressed + (i * MON_PIC_SIZE * 4);
|
||||
gMonSpritesGfxPtr->templates[i] = gBattlerSpriteTemplates[i];
|
||||
|
||||
for (j = 0; j < 4; j++)
|
||||
for (j = 0; j < MAX_MON_PIC_FRAMES; j++)
|
||||
{
|
||||
if (gMonSpritesGfxPtr->sprites.ptr[i])
|
||||
if (gMonSpritesGfxPtr->spritesGfx[i])
|
||||
{
|
||||
gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE);
|
||||
gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->spritesGfx[i] + (j * MON_PIC_SIZE);
|
||||
gMonSpritesGfxPtr->frameImages[i][j].size = MON_PIC_SIZE;
|
||||
}
|
||||
}
|
||||
@ -1241,13 +1240,12 @@ void FreeMonSpritesGfx(void)
|
||||
return;
|
||||
|
||||
TRY_FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer);
|
||||
TRY_FREE_AND_SET_NULL(gMonSpritesGfxPtr->unusedPtr);
|
||||
FREE_AND_SET_NULL(gMonSpritesGfxPtr->barFontGfx);
|
||||
FREE_AND_SET_NULL(gMonSpritesGfxPtr->firstDecompressed);
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT] = NULL;
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT] = NULL;
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_RIGHT] = NULL;
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT] = NULL;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT] = NULL;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT] = NULL;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_RIGHT] = NULL;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT] = NULL;
|
||||
FREE_AND_SET_NULL(gMonSpritesGfxPtr);
|
||||
}
|
||||
|
||||
|
||||
@ -12,15 +12,14 @@
|
||||
#include "constants/battle_partner.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern const u8 gBattleAnimBgCntSet[];
|
||||
extern const u8 gBattleAnimBgCntGet[];
|
||||
|
||||
static void BattleIntroSlide1(u8);
|
||||
static void BattleIntroSlide2(u8);
|
||||
static void BattleIntroSlide3(u8);
|
||||
static void BattleIntroSlideLink(u8);
|
||||
static void BattleIntroSlidePartner(u8);
|
||||
|
||||
static const u8 sBattleAnimBgCnts[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT};
|
||||
|
||||
static const TaskFunc sBattleIntroSlideFuncs[] =
|
||||
{
|
||||
[BATTLE_TERRAIN_GRASS] = BattleIntroSlide1,
|
||||
@ -39,7 +38,7 @@ void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value)
|
||||
{
|
||||
if (bgId < 4)
|
||||
{
|
||||
u32 bgCnt = GetGpuReg(gBattleAnimBgCntSet[bgId]);
|
||||
u32 bgCnt = GetGpuReg(sBattleAnimBgCnts[bgId]);
|
||||
switch (attributeId)
|
||||
{
|
||||
case BG_ANIM_SCREEN_SIZE:
|
||||
@ -65,7 +64,7 @@ void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value)
|
||||
break;
|
||||
}
|
||||
|
||||
SetGpuReg(gBattleAnimBgCntSet[bgId], bgCnt);
|
||||
SetGpuReg(sBattleAnimBgCnts[bgId], bgCnt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +74,7 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId)
|
||||
|
||||
if (bgId < 4)
|
||||
{
|
||||
bgCnt = GetGpuReg(gBattleAnimBgCntGet[bgId]);
|
||||
bgCnt = GetGpuReg(sBattleAnimBgCnts[bgId]);
|
||||
switch (attributeId)
|
||||
{
|
||||
case BG_ANIM_SCREEN_SIZE:
|
||||
@ -587,7 +586,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8
|
||||
{
|
||||
int i, j;
|
||||
int offset = tilesOffset;
|
||||
CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition], tiles, BG_SCREEN_SIZE);
|
||||
CpuCopy16(gMonSpritesGfxPtr->spritesGfx[battlerPosition], tiles, BG_SCREEN_SIZE);
|
||||
LoadBgTiles(bgId, tiles, 0x1000, tilesOffset);
|
||||
for (i = y; i < y + 8; i++)
|
||||
{
|
||||
@ -604,7 +603,7 @@ static void UNUSED DrawBattlerOnBgDMA(u8 x, u8 y, u8 battlerPosition, u8 arg3, u
|
||||
{
|
||||
int i, j, offset;
|
||||
|
||||
DmaCopy16(3, gMonSpritesGfxPtr->sprites.ptr[battlerPosition] + BG_SCREEN_SIZE * arg3, (void *)BG_SCREEN_ADDR(0) + arg5, BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gMonSpritesGfxPtr->spritesGfx[battlerPosition] + BG_SCREEN_SIZE * arg3, (void *)BG_SCREEN_ADDR(0) + arg5, BG_SCREEN_SIZE);
|
||||
offset = (arg5 >> 5) - (arg7 << 9);
|
||||
for (i = y; i < y + 8; i++)
|
||||
{
|
||||
|
||||
@ -137,7 +137,6 @@ EWRAM_DATA u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT + 13] = {0}; // expanded for stupidly long z move names
|
||||
EWRAM_DATA u32 gBattleTypeFlags = 0;
|
||||
EWRAM_DATA u8 gBattleTerrain = 0;
|
||||
EWRAM_DATA u32 gUnusedFirstBattleVar1 = 0; // Never read
|
||||
EWRAM_DATA struct MultiPartnerMenuPokemon gMultiPartnerParty[MULTI_PARTY_SIZE] = {0};
|
||||
EWRAM_DATA static struct MultiPartnerMenuPokemon* sMultiPartnerPartyBuffer = NULL;
|
||||
EWRAM_DATA u8 *gBattleAnimBgTileBuffer = NULL;
|
||||
@ -186,7 +185,6 @@ EWRAM_DATA u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u16 gMoveResultFlags = 0;
|
||||
EWRAM_DATA u32 gHitMarker = 0;
|
||||
EWRAM_DATA u8 gBideTarget[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gUnusedFirstBattleVar2 = 0; // Never read
|
||||
EWRAM_DATA u32 gSideStatuses[NUM_BATTLE_SIDES] = {0};
|
||||
EWRAM_DATA struct SideTimer gSideTimers[NUM_BATTLE_SIDES] = {0};
|
||||
EWRAM_DATA u32 gStatuses3[MAX_BATTLERS_COUNT] = {0};
|
||||
@ -218,8 +216,6 @@ EWRAM_DATA bool8 gTransformedShininess[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gPlayerDpadHoldFrames = 0;
|
||||
EWRAM_DATA struct BattleSpriteData *gBattleSpritesDataPtr = NULL;
|
||||
EWRAM_DATA struct MonSpritesGfx *gMonSpritesGfxPtr = NULL;
|
||||
EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData = NULL; // Never read
|
||||
EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData = NULL; // Never read
|
||||
EWRAM_DATA u16 gBattleMovePower = 0;
|
||||
EWRAM_DATA u16 gMoveToLearn = 0;
|
||||
EWRAM_DATA u32 gFieldStatuses = 0;
|
||||
@ -299,27 +295,308 @@ const struct OamData gOamData_BattleSpritePlayerSide =
|
||||
|
||||
static const s8 sCenterToCornerVecXs[8] ={-32, -16, -16, -32, -32};
|
||||
|
||||
const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1] =
|
||||
// .generic is large enough that the text for TYPE_ELECTRIC will exceed TEXT_BUFF_ARRAY_COUNT.
|
||||
const struct TypeInfo gTypesInfo[NUMBER_OF_MON_TYPES] =
|
||||
{
|
||||
[TYPE_NORMAL] = _("Normal"),
|
||||
[TYPE_FIGHTING] = _("Fight"),
|
||||
[TYPE_FLYING] = _("Flying"),
|
||||
[TYPE_POISON] = _("Poison"),
|
||||
[TYPE_GROUND] = _("Ground"),
|
||||
[TYPE_ROCK] = _("Rock"),
|
||||
[TYPE_BUG] = _("Bug"),
|
||||
[TYPE_GHOST] = _("Ghost"),
|
||||
[TYPE_STEEL] = _("Steel"),
|
||||
[TYPE_MYSTERY] = _("???"),
|
||||
[TYPE_FIRE] = _("Fire"),
|
||||
[TYPE_WATER] = _("Water"),
|
||||
[TYPE_GRASS] = _("Grass"),
|
||||
[TYPE_ELECTRIC] = _("Electr"),
|
||||
[TYPE_PSYCHIC] = _("Psychc"),
|
||||
[TYPE_ICE] = _("Ice"),
|
||||
[TYPE_DRAGON] = _("Dragon"),
|
||||
[TYPE_DARK] = _("Dark"),
|
||||
[TYPE_FAIRY] = _("Fairy"),
|
||||
[TYPE_NORMAL] =
|
||||
{
|
||||
.name = _("Normal"),
|
||||
.generic = _("a NORMAL move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_BREAKNECK_BLITZ,
|
||||
.maxMove = MOVE_MAX_STRIKE,
|
||||
//.enhanceItem = ITEM_SILK_SCARF,
|
||||
//.berry = ITEM_CHILAN_BERRY,
|
||||
//.gem = ITEM_NORMAL_GEM,
|
||||
//.zCrystal = ITEM_NORMALIUM_Z,
|
||||
//.teraShard = ITEM_NORMAL_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_NORMAL,
|
||||
},
|
||||
[TYPE_FIGHTING] =
|
||||
{
|
||||
.name = _("Fight"),
|
||||
.generic = _("a FIGHTING move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_ALL_OUT_PUMMELING,
|
||||
.maxMove = MOVE_MAX_KNUCKLE,
|
||||
//.enhanceItem = ITEM_BLACK_BELT,
|
||||
//.berry = ITEM_CHOPLE_BERRY,
|
||||
//.gem = ITEM_FIGHTING_GEM,
|
||||
//.zCrystal = ITEM_FIGHTINIUM_Z,
|
||||
//.plate= ITEM_FIST_PLATE,
|
||||
//.memory = ITEM_FIGHTING_MEMORY,
|
||||
//.teraShard = ITEM_FIGHTING_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_FIGHTING,
|
||||
},
|
||||
[TYPE_FLYING] =
|
||||
{
|
||||
.name = _("Flying"),
|
||||
.generic = _("a FLYING move"),
|
||||
.palette = 14,
|
||||
.zMove = MOVE_SUPERSONIC_SKYSTRIKE,
|
||||
.maxMove = MOVE_MAX_AIRSTREAM,
|
||||
//.enhanceItem = ITEM_SHARP_BEAK,
|
||||
//.berry = ITEM_COBA_BERRY,
|
||||
//.gem = ITEM_FLYING_GEM,
|
||||
//.zCrystal = ITEM_FLYINIUM_Z,
|
||||
//.plate= ITEM_SKY_PLATE,
|
||||
//.memory = ITEM_FLYING_MEMORY,
|
||||
//.teraShard = ITEM_FLYING_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_FLYING,
|
||||
},
|
||||
[TYPE_POISON] =
|
||||
{
|
||||
.name = _("Poison"),
|
||||
.generic = _("a POISON move"),
|
||||
.palette = 14,
|
||||
.zMove = MOVE_ACID_DOWNPOUR,
|
||||
.maxMove = MOVE_MAX_OOZE,
|
||||
//.enhanceItem = ITEM_POISON_BARB,
|
||||
//.berry = ITEM_KEBIA_BERRY,
|
||||
//.gem = ITEM_POISON_GEM,
|
||||
//.zCrystal = ITEM_POISONIUM_Z,
|
||||
//.plate= ITEM_TOXIC_PLATE,
|
||||
//.memory = ITEM_POISON_MEMORY,
|
||||
//.teraShard = ITEM_POISON_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_POISON,
|
||||
},
|
||||
[TYPE_GROUND] =
|
||||
{
|
||||
.name = _("Ground"),
|
||||
.generic = _("a GROUND move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_TECTONIC_RAGE,
|
||||
.maxMove = MOVE_MAX_QUAKE,
|
||||
//.enhanceItem = ITEM_SOFT_SAND,
|
||||
//.berry = ITEM_SHUCA_BERRY,
|
||||
//.gem = ITEM_GROUND_GEM,
|
||||
//.zCrystal = ITEM_GROUNDIUM_Z,
|
||||
//.plate= ITEM_EARTH_PLATE,
|
||||
//.memory = ITEM_GROUND_MEMORY,
|
||||
//.teraShard = ITEM_GROUND_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_GROUND,
|
||||
},
|
||||
[TYPE_ROCK] =
|
||||
{
|
||||
.name = _("Rock"),
|
||||
.generic = _("a ROCK move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_CONTINENTAL_CRUSH,
|
||||
.maxMove = MOVE_MAX_ROCKFALL,
|
||||
//.enhanceItem = ITEM_HARD_STONE,
|
||||
//.berry = ITEM_CHARTI_BERRY,
|
||||
//.gem = ITEM_ROCK_GEM,
|
||||
//.zCrystal = ITEM_ROCKIUM_Z,
|
||||
//.plate= ITEM_STONE_PLATE,
|
||||
//.memory = ITEM_ROCK_MEMORY,
|
||||
//.teraShard = ITEM_ROCK_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_ROCK,
|
||||
},
|
||||
[TYPE_BUG] =
|
||||
{
|
||||
.name = _("Bug"),
|
||||
.generic = _("a BUG move"),
|
||||
.palette = 15,
|
||||
.zMove = MOVE_SAVAGE_SPIN_OUT,
|
||||
.maxMove = MOVE_MAX_FLUTTERBY,
|
||||
//.enhanceItem = ITEM_SILVER_POWDER,
|
||||
//.berry = ITEM_TANGA_BERRY,
|
||||
//.gem = ITEM_BUG_GEM,
|
||||
//.zCrystal = ITEM_BUGINIUM_Z,
|
||||
//.plate= ITEM_INSECT_PLATE,
|
||||
//.memory = ITEM_BUG_MEMORY,
|
||||
//.teraShard = ITEM_BUG_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_BUG,
|
||||
},
|
||||
[TYPE_GHOST] =
|
||||
{
|
||||
.name = _("Ghost"),
|
||||
.generic = _("a GHOST move"),
|
||||
.palette = 14,
|
||||
.zMove = MOVE_NEVER_ENDING_NIGHTMARE,
|
||||
.maxMove = MOVE_MAX_PHANTASM,
|
||||
//.enhanceItem = ITEM_SPELL_TAG,
|
||||
//.berry = ITEM_KASIB_BERRY,
|
||||
//.gem = ITEM_GHOST_GEM,
|
||||
//.zCrystal = ITEM_GHOSTIUM_Z,
|
||||
//.plate= ITEM_SPOOKY_PLATE,
|
||||
//.memory = ITEM_GHOST_MEMORY,
|
||||
//.teraShard = ITEM_GHOST_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_GHOST,
|
||||
},
|
||||
[TYPE_STEEL] =
|
||||
{
|
||||
.name = _("Steel"),
|
||||
.generic = _("a STEEL move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_CORKSCREW_CRASH,
|
||||
.maxMove = MOVE_MAX_STEELSPIKE,
|
||||
//.enhanceItem = ITEM_METAL_COAT,
|
||||
//.berry = ITEM_BABIRI_BERRY,
|
||||
//.gem = ITEM_STEEL_GEM,
|
||||
//.zCrystal = ITEM_STEELIUM_Z,
|
||||
//.plate= ITEM_IRON_PLATE,
|
||||
//.memory = ITEM_STEEL_MEMORY,
|
||||
//.teraShard = ITEM_STEEL_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_STEEL,
|
||||
},
|
||||
[TYPE_MYSTERY] =
|
||||
{
|
||||
.name = _("???"),
|
||||
.generic = _("a ??? move"),
|
||||
.palette = 15,
|
||||
},
|
||||
[TYPE_FIRE] =
|
||||
{
|
||||
.name = _("Fire"),
|
||||
.generic = _("a FIRE move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_INFERNO_OVERDRIVE,
|
||||
.maxMove = MOVE_MAX_FLARE,
|
||||
//.enhanceItem = ITEM_CHARCOAL,
|
||||
//.berry = ITEM_OCCA_BERRY,
|
||||
//.gem = ITEM_FIRE_GEM,
|
||||
//.zCrystal = ITEM_FIRIUM_Z,
|
||||
//.plate= ITEM_FLAME_PLATE,
|
||||
//.memory = ITEM_FIRE_MEMORY,
|
||||
//.teraShard = ITEM_FIRE_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_FIRE,
|
||||
},
|
||||
[TYPE_WATER] =
|
||||
{
|
||||
.name = _("Water"),
|
||||
.generic = _("a WATER move"),
|
||||
.palette = 14,
|
||||
.zMove = MOVE_HYDRO_VORTEX,
|
||||
.maxMove = MOVE_MAX_GEYSER,
|
||||
//.enhanceItem = ITEM_MYSTIC_WATER,
|
||||
//.berry = ITEM_PASSHO_BERRY,
|
||||
//.gem = ITEM_WATER_GEM,
|
||||
//.zCrystal = ITEM_WATERIUM_Z,
|
||||
//.plate= ITEM_SPLASH_PLATE,
|
||||
//.memory = ITEM_WATER_MEMORY,
|
||||
//.teraShard = ITEM_WATER_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_WATER,
|
||||
},
|
||||
[TYPE_GRASS] =
|
||||
{
|
||||
.name = _("Grass"),
|
||||
.generic = _("a GRASS move"),
|
||||
.palette = 15,
|
||||
.zMove = MOVE_BLOOM_DOOM,
|
||||
.maxMove = MOVE_MAX_OVERGROWTH,
|
||||
//.enhanceItem = ITEM_MIRACLE_SEED,
|
||||
//.berry = ITEM_RINDO_BERRY,
|
||||
//.gem = ITEM_GRASS_GEM,
|
||||
//.zCrystal = ITEM_GRASSIUM_Z,
|
||||
//.plate= ITEM_MEADOW_PLATE,
|
||||
//.memory = ITEM_GRASS_MEMORY,
|
||||
//.teraShard = ITEM_GRASS_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_GRASS,
|
||||
},
|
||||
[TYPE_ELECTRIC] =
|
||||
{
|
||||
.name = _("Electr"),
|
||||
.generic = _("an ELECTRIC move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_GIGAVOLT_HAVOC,
|
||||
.maxMove = MOVE_MAX_LIGHTNING,
|
||||
//.enhanceItem = ITEM_MAGNET,
|
||||
//.berry = ITEM_WACAN_BERRY,
|
||||
//.gem = ITEM_ELECTRIC_GEM,
|
||||
//.zCrystal = ITEM_ELECTRIUM_Z,
|
||||
//.plate= ITEM_ZAP_PLATE,
|
||||
//.memory = ITEM_ELECTRIC_MEMORY,
|
||||
//.teraShard = ITEM_ELECTRIC_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_ELECTRIC,
|
||||
},
|
||||
[TYPE_PSYCHIC] =
|
||||
{
|
||||
.name = _("Psychc"),
|
||||
.generic = _("a PSYCHIC move"),
|
||||
.palette = 14,
|
||||
.zMove = MOVE_SHATTERED_PSYCHE,
|
||||
.maxMove = MOVE_MAX_MINDSTORM,
|
||||
//.enhanceItem = ITEM_TWISTED_SPOON,
|
||||
//.berry = ITEM_PAYAPA_BERRY,
|
||||
//.gem = ITEM_PSYCHIC_GEM,
|
||||
//.zCrystal = ITEM_PSYCHIUM_Z,
|
||||
//.plate= ITEM_MIND_PLATE,
|
||||
//.memory = ITEM_PSYCHIC_MEMORY,
|
||||
//.teraShard = ITEM_PSYCHIC_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_PSYCHIC,
|
||||
},
|
||||
[TYPE_ICE] =
|
||||
{
|
||||
.name = _("Ice"),
|
||||
.generic = _("an ICE move"),
|
||||
.palette = 14,
|
||||
.zMove = MOVE_SUBZERO_SLAMMER,
|
||||
.maxMove = MOVE_MAX_HAILSTORM,
|
||||
//.enhanceItem = ITEM_NEVER_MELT_ICE,
|
||||
//.berry = ITEM_YACHE_BERRY,
|
||||
//.gem = ITEM_ICE_GEM,
|
||||
//.zCrystal = ITEM_ICIUM_Z,
|
||||
//.plate= ITEM_ICICLE_PLATE,
|
||||
//.memory = ITEM_ICE_MEMORY,
|
||||
//.teraShard = ITEM_ICE_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_ICE,
|
||||
},
|
||||
[TYPE_DRAGON] =
|
||||
{
|
||||
.name = _("Dragon"),
|
||||
.generic = _("a DRAGON move"),
|
||||
.palette = 15,
|
||||
.zMove = MOVE_DEVASTATING_DRAKE,
|
||||
.maxMove = MOVE_MAX_WYRMWIND,
|
||||
//.enhanceItem = ITEM_DRAGON_FANG,
|
||||
//.berry = ITEM_HABAN_BERRY,
|
||||
//.gem = ITEM_DRAGON_GEM,
|
||||
//.zCrystal = ITEM_DRAGONIUM_Z,
|
||||
//.plate= ITEM_DRACO_PLATE,
|
||||
//.memory = ITEM_DRAGON_MEMORY,
|
||||
//.teraShard = ITEM_DRAGON_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_DRAGON,
|
||||
},
|
||||
[TYPE_DARK] =
|
||||
{
|
||||
.name = _("Dark"),
|
||||
.generic = _("a DARK move"),
|
||||
.palette = 13,
|
||||
.zMove = MOVE_BLACK_HOLE_ECLIPSE,
|
||||
.maxMove = MOVE_MAX_DARKNESS,
|
||||
//.enhanceItem = ITEM_BLACK_GLASSES,
|
||||
//.berry = ITEM_COLBUR_BERRY,
|
||||
//.gem = ITEM_DARK_GEM,
|
||||
//.zCrystal = ITEM_DARKINIUM_Z,
|
||||
//.plate= ITEM_DREAD_PLATE,
|
||||
//.memory = ITEM_DARK_MEMORY,
|
||||
//.teraShard = ITEM_DARK_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_DARK,
|
||||
},
|
||||
[TYPE_FAIRY] =
|
||||
{
|
||||
.name = _("Fairy"),
|
||||
.generic = _("a FAIRY move"),
|
||||
.palette = 14,
|
||||
.zMove = MOVE_TWINKLE_TACKLE,
|
||||
.maxMove = MOVE_MAX_STARFALL,
|
||||
//.enhanceItem = ITEM_FAIRY_FEATHER,
|
||||
//.berry = ITEM_ROSELI_BERRY,
|
||||
//.gem = ITEM_FAIRY_GEM,
|
||||
//.zCrystal = ITEM_FAIRIUM_Z,
|
||||
//.plate= ITEM_PIXIE_PLATE,
|
||||
//.memory = ITEM_FAIRY_MEMORY,
|
||||
//.teraShard = ITEM_FAIRY_TERA_SHARD,
|
||||
//.arceusForm = SPECIES_ARCEUS_FAIRY,
|
||||
},
|
||||
/*
|
||||
[TYPE_STELLAR] =
|
||||
{
|
||||
.name = _("Stellar"),
|
||||
.teraShard = ITEM_STELLAR_TERA_SHARD,
|
||||
},
|
||||
*/
|
||||
};
|
||||
|
||||
// extra args are money and ball
|
||||
@ -548,6 +825,13 @@ static void CB2_InitBattleInternal(void)
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
gBattleTerrain = BATTLE_TERRAIN_BUILDING;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER
|
||||
| BATTLE_TYPE_EREADER_TRAINER
|
||||
| BATTLE_TYPE_TRAINER_HILL)))
|
||||
{
|
||||
gBattleTypeFlags |= (IsTrainerDoubleBattle(gTrainerBattleOpponent_A) ? BATTLE_TYPE_DOUBLE : 0);
|
||||
}
|
||||
|
||||
InitBattleBgsVideo();
|
||||
LoadBattleTextboxAndBackground();
|
||||
ResetSpriteData();
|
||||
@ -2056,13 +2340,6 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
|
||||
if (trainerNum == TRAINER_SECRET_BASE)
|
||||
return 0;
|
||||
retVal = CreateNPCTrainerPartyFromTrainer(party, GetTrainerStructFromId(trainerNum), firstTrainer, gBattleTypeFlags);
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER
|
||||
| BATTLE_TYPE_EREADER_TRAINER
|
||||
| BATTLE_TYPE_TRAINER_HILL)))
|
||||
{
|
||||
gBattleTypeFlags |= (IsTrainerDoubleBattle(trainerNum) ? BATTLE_TYPE_DOUBLE : 0);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@ -2743,7 +3020,7 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
|
||||
}
|
||||
else // Erase bottom part of the sprite to create a smooth illusion of mon falling down.
|
||||
{
|
||||
u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (sprite->data[3] << 8);
|
||||
u8 *dst = &gMonSpritesGfxPtr->spritesGfx[GetBattlerPosition(sprite->sBattler)][(sprite->data[3] << 8)];
|
||||
|
||||
for (i = 0; i < 0x100; i++)
|
||||
*(dst++) = 0;
|
||||
@ -3734,7 +4011,7 @@ static void DoBattleIntro(void)
|
||||
gBattleStruct->overworldWeatherDone = FALSE;
|
||||
SetAiLogicDataForTurn(AI_DATA); // get assumed abilities, hold effects, etc of all battlers
|
||||
Ai_InitPartyStruct(); // Save mons party counts, and first 2/4 mons on the battlefield.
|
||||
|
||||
|
||||
// Try to set a status to start the battle with
|
||||
gBattleStruct->startingStatus = 0;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && GetTrainerStartingStatusFromId(gTrainerBattleOpponent_B))
|
||||
@ -4966,6 +5243,8 @@ static void SetActionsAndBattlersTurnOrder(void)
|
||||
{
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[battler];
|
||||
gBattlerByTurnOrder[turnOrderId] = battler;
|
||||
gBattleStruct->quickClawRandom[battler] = RandomPercentage(RNG_QUICK_CLAW, GetBattlerHoldEffectParam(battler));
|
||||
gBattleStruct->quickDrawRandom[battler] = RandomPercentage(RNG_QUICK_DRAW, 30);
|
||||
turnOrderId++;
|
||||
}
|
||||
}
|
||||
@ -5172,21 +5451,21 @@ static void TryChangingTurnOrderEffects(u32 battler1, u32 battler2)
|
||||
|
||||
// Battler 1
|
||||
// Quick Draw
|
||||
if (ability1 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler1]) && RandomPercentage(RNG_QUICK_DRAW, 30))
|
||||
if (ability1 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler1]) && gBattleStruct->quickDrawRandom[battler1])
|
||||
gProtectStructs[battler1].quickDraw = TRUE;
|
||||
// Quick Claw and Custap Berry
|
||||
if (!gProtectStructs[battler1].quickDraw
|
||||
&& ((holdEffectBattler1 == HOLD_EFFECT_QUICK_CLAW && RandomPercentage(RNG_QUICK_CLAW, GetBattlerHoldEffectParam(battler1)))
|
||||
&& ((holdEffectBattler1 == HOLD_EFFECT_QUICK_CLAW && gBattleStruct->quickClawRandom[battler1])
|
||||
|| (holdEffectBattler1 == HOLD_EFFECT_CUSTAP_BERRY && HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item))))
|
||||
gProtectStructs[battler1].usedCustapBerry = TRUE;
|
||||
|
||||
// Battler 2
|
||||
// Quick Draw
|
||||
if (ability2 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler2]) && RandomPercentage(RNG_QUICK_DRAW, 30))
|
||||
if (ability2 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler2]) && gBattleStruct->quickDrawRandom[battler2])
|
||||
gProtectStructs[battler2].quickDraw = TRUE;
|
||||
// Quick Claw and Custap Berry
|
||||
if (!gProtectStructs[battler2].quickDraw
|
||||
&& ((holdEffectBattler2 == HOLD_EFFECT_QUICK_CLAW && RandomPercentage(RNG_QUICK_CLAW, GetBattlerHoldEffectParam(battler2)))
|
||||
&& ((holdEffectBattler2 == HOLD_EFFECT_QUICK_CLAW && gBattleStruct->quickClawRandom[battler2])
|
||||
|| (holdEffectBattler2 == HOLD_EFFECT_CUSTAP_BERRY && HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item))))
|
||||
gProtectStructs[battler2].usedCustapBerry = TRUE;
|
||||
}
|
||||
@ -5592,16 +5871,23 @@ static void TryEvolvePokemon(void)
|
||||
{
|
||||
u16 species;
|
||||
u8 levelUpBits = gLeveledUpInBattle;
|
||||
bool32 evoModeNormal = TRUE;
|
||||
|
||||
levelUpBits &= ~(gBitTable[i]);
|
||||
gLeveledUpInBattle = levelUpBits;
|
||||
|
||||
species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_NORMAL, levelUpBits, NULL);
|
||||
species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_NORMAL, ITEM_NONE, NULL);
|
||||
if (species == SPECIES_NONE)
|
||||
{
|
||||
species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_CANT_STOP, ITEM_NONE, NULL);
|
||||
evoModeNormal = FALSE;
|
||||
}
|
||||
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
FreeAllWindowBuffers();
|
||||
gBattleMainFunc = WaitForEvoSceneToFinish;
|
||||
EvolutionScene(&gPlayerParty[i], species, TRUE, i);
|
||||
EvolutionScene(&gPlayerParty[i], species, evoModeNormal, i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2098,31 +2098,6 @@ const u8 gText_Draw[] = _("{HIGHLIGHT TRANSPARENT}Draw");
|
||||
static const u8 sText_SpaceIs[] = _(" is");
|
||||
static const u8 sText_ApostropheS[] = _("'s");
|
||||
|
||||
// For displaying names of invalid moves.
|
||||
// This is large enough that the text for TYPE_ELECTRIC will exceed TEXT_BUFF_ARRAY_COUNT.
|
||||
static const u8 sATypeMove_Table[NUMBER_OF_MON_TYPES][17] =
|
||||
{
|
||||
[TYPE_NORMAL] = _("a NORMAL move"),
|
||||
[TYPE_FIGHTING] = _("a FIGHTING move"),
|
||||
[TYPE_FLYING] = _("a FLYING move"),
|
||||
[TYPE_POISON] = _("a POISON move"),
|
||||
[TYPE_GROUND] = _("a GROUND move"),
|
||||
[TYPE_ROCK] = _("a ROCK move"),
|
||||
[TYPE_BUG] = _("a BUG move"),
|
||||
[TYPE_GHOST] = _("a GHOST move"),
|
||||
[TYPE_STEEL] = _("a STEEL move"),
|
||||
[TYPE_MYSTERY] = _("a ??? move"),
|
||||
[TYPE_FIRE] = _("a FIRE move"),
|
||||
[TYPE_WATER] = _("a WATER move"),
|
||||
[TYPE_GRASS] = _("a GRASS move"),
|
||||
[TYPE_ELECTRIC] = _("an ELECTRIC move"),
|
||||
[TYPE_PSYCHIC] = _("a PSYCHIC move"),
|
||||
[TYPE_ICE] = _("an ICE move"),
|
||||
[TYPE_DRAGON] = _("a DRAGON move"),
|
||||
[TYPE_DARK] = _("a DARK move"),
|
||||
[TYPE_FAIRY] = _("a FAIRY move"),
|
||||
};
|
||||
|
||||
const u8 gText_BattleTourney[] = _("BATTLE TOURNEY");
|
||||
static const u8 sText_Round1[] = _("Round 1");
|
||||
static const u8 sText_Round2[] = _("Round 2");
|
||||
@ -2940,7 +2915,7 @@ void BufferStringBattle(u16 stringID, u32 battler)
|
||||
if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT
|
||||
&& !IsZMove(gBattleMsgDataPtr->currentMove)
|
||||
&& !IsMaxMove(gBattleMsgDataPtr->currentMove))
|
||||
StringCopy(gBattleTextBuff3, sATypeMove_Table[*(&gBattleStruct->stringMoveType)]);
|
||||
StringCopy(gBattleTextBuff3, gTypesInfo[*(&gBattleStruct->stringMoveType)].generic);
|
||||
else
|
||||
StringCopy(gBattleTextBuff3, GetMoveName(gBattleMsgDataPtr->currentMove));
|
||||
stringPtr = sText_AttackerUsedX;
|
||||
@ -3370,7 +3345,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT
|
||||
&& !IsZMove(gBattleMsgDataPtr->currentMove)
|
||||
&& !IsMaxMove(gBattleMsgDataPtr->currentMove))
|
||||
toCpy = sATypeMove_Table[gBattleStruct->stringMoveType];
|
||||
toCpy = gTypesInfo[gBattleStruct->stringMoveType].generic;
|
||||
else
|
||||
toCpy = GetMoveName(gBattleMsgDataPtr->currentMove);
|
||||
break;
|
||||
@ -3378,7 +3353,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
if (gBattleMsgDataPtr->originallyUsedMove >= MOVES_COUNT
|
||||
&& !IsZMove(gBattleMsgDataPtr->currentMove)
|
||||
&& !IsMaxMove(gBattleMsgDataPtr->currentMove))
|
||||
toCpy = sATypeMove_Table[gBattleStruct->stringMoveType];
|
||||
toCpy = gTypesInfo[gBattleStruct->stringMoveType].generic;
|
||||
else
|
||||
toCpy = GetMoveName(gBattleMsgDataPtr->originallyUsedMove);
|
||||
break;
|
||||
@ -3762,7 +3737,7 @@ void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
||||
srcID += 3;
|
||||
break;
|
||||
case B_BUFF_TYPE: // type name
|
||||
StringAppend(dst, gTypeNames[src[srcID + 1]]);
|
||||
StringAppend(dst, gTypesInfo[src[srcID + 1]].name);
|
||||
srcID += 2;
|
||||
break;
|
||||
case B_BUFF_MON_NICK_WITH_PREFIX: // poke nick with prefix
|
||||
|
||||
@ -1370,7 +1370,7 @@ static void Cmd_attackcanceler(void)
|
||||
gHitMarker |= HITMARKER_OBEYS;
|
||||
// Check if no available target present on the field or if Sky Battles ban the move
|
||||
if ((NoTargetPresent(gBattlerAttacker, gCurrentMove)
|
||||
&& (!gMovesInfo[gCurrentMove].twoTurnMove || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)))
|
||||
&& (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)))
|
||||
|| (IsMoveNotAllowedInSkyBattles(gCurrentMove)))
|
||||
{
|
||||
if (gMovesInfo[gCurrentMove].effect == EFFECT_FLING) // Edge case for removing a mon's item when there is no target available after using Fling.
|
||||
@ -1378,7 +1378,7 @@ static void Cmd_attackcanceler(void)
|
||||
else
|
||||
gBattlescriptCurrInstr = BattleScript_FailedFromAtkString;
|
||||
|
||||
if (!gMovesInfo[gCurrentMove].twoTurnMove || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
||||
if (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
||||
CancelMultiTurnMoves(gBattlerAttacker);
|
||||
return;
|
||||
}
|
||||
@ -1457,7 +1457,7 @@ static void Cmd_attackcanceler(void)
|
||||
}
|
||||
else if (IsBattlerProtected(gBattlerTarget, gCurrentMove)
|
||||
&& (gCurrentMove != MOVE_CURSE || IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST))
|
||||
&& ((!gMovesInfo[gCurrentMove].twoTurnMove || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)))
|
||||
&& (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
||||
&& gMovesInfo[gCurrentMove].effect != EFFECT_SUCKER_PUNCH
|
||||
&& gMovesInfo[gCurrentMove].effect != EFFECT_UPPER_HAND)
|
||||
{
|
||||
@ -2317,7 +2317,10 @@ static void Cmd_datahpupdate(void)
|
||||
u32 side = GetBattlerSide(battler);
|
||||
if (gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] == SPECIES_NONE)
|
||||
gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battler]] = gBattleMons[battler].species;
|
||||
gBattleMons[battler].species = SPECIES_MIMIKYU_BUSTED;
|
||||
if (gBattleMons[battler].species == SPECIES_MIMIKYU_TOTEM_DISGUISED)
|
||||
gBattleMons[battler].species = SPECIES_MIMIKYU_TOTEM_BUSTED;
|
||||
else
|
||||
gBattleMons[battler].species = SPECIES_MIMIKYU_BUSTED;
|
||||
BattleScriptPush(cmd->nextInstr);
|
||||
gBattlescriptCurrInstr = BattleScript_TargetFormChange;
|
||||
return;
|
||||
@ -2749,13 +2752,13 @@ void StealTargetItem(u8 battlerStealer, u8 battlerItem)
|
||||
#define INCREMENT_RESET_RETURN \
|
||||
{ \
|
||||
gBattlescriptCurrInstr++; \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define RESET_RETURN \
|
||||
{ \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
gBattleScripting.moveEffect = 0; \
|
||||
return; \
|
||||
}
|
||||
|
||||
@ -2768,6 +2771,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
|
||||
u16 battlerAbility;
|
||||
bool8 activateAfterFaint = FALSE;
|
||||
|
||||
// NULL move effect
|
||||
if (gBattleScripting.moveEffect == 0)
|
||||
return;
|
||||
|
||||
if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT
|
||||
&& gBattleMons[gBattlerTarget].hp != 0
|
||||
&& IsFinalStrikeEffect(gBattleScripting.moveEffect))
|
||||
@ -2827,7 +2834,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
|
||||
&& !primary && gBattleScripting.moveEffect <= MOVE_EFFECT_CONFUSION)
|
||||
INCREMENT_RESET_RETURN
|
||||
|
||||
if (TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && !primary && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING)
|
||||
if (!(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
|
||||
&& TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)
|
||||
&& !primary
|
||||
&& gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING)
|
||||
INCREMENT_RESET_RETURN
|
||||
|
||||
if (gBattleMons[gEffectBattler].hp == 0 && !activateAfterFaint)
|
||||
@ -3306,12 +3316,14 @@ void SetMoveEffect(bool32 primary, bool32 certain)
|
||||
case MOVE_EFFECT_ACC_MINUS_1:
|
||||
case MOVE_EFFECT_EVS_MINUS_1:
|
||||
flags = affectsUser;
|
||||
if (mirrorArmorReflected && !affectsUser)
|
||||
flags |= STAT_CHANGE_ALLOW_PTR;
|
||||
if (mirrorArmorReflected)
|
||||
flags |= (STAT_CHANGE_ALLOW_PTR * !affectsUser);
|
||||
else
|
||||
flags |= STAT_CHANGE_UPDATE_MOVE_EFFECT;
|
||||
|
||||
if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE,
|
||||
gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1,
|
||||
flags | STAT_CHANGE_UPDATE_MOVE_EFFECT, gBattlescriptCurrInstr + 1))
|
||||
flags, gBattlescriptCurrInstr + 1))
|
||||
{
|
||||
if (!mirrorArmorReflected)
|
||||
gBattlescriptCurrInstr++;
|
||||
@ -3823,6 +3835,26 @@ void SetMoveEffect(bool32 primary, bool32 certain)
|
||||
gBattleScripting.moveEffect = 0;
|
||||
}
|
||||
|
||||
static bool32 CanApplyAdditionalEffect(const struct AdditionalEffect *additionalEffect)
|
||||
{
|
||||
// Self-targeting move effects only apply after the last mon has been hit
|
||||
u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove);
|
||||
if (additionalEffect->self
|
||||
&& (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY)
|
||||
&& GetNextTarget(moveTarget, TRUE) != MAX_BATTLERS_COUNT)
|
||||
return FALSE;
|
||||
|
||||
// Certain move effects only apply if the target raised stats this turn (e.g. Burning Jealousy)
|
||||
if (additionalEffect->onlyIfTargetRaisedStats && !gProtectStructs[gBattlerTarget].statRaised)
|
||||
return FALSE;
|
||||
|
||||
// Certain additional effects only apply on a two-turn move's charge turn
|
||||
if (additionalEffect->onChargeTurnOnly != gProtectStructs[gBattlerAttacker].chargingTurn)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void Cmd_setadditionaleffects(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
@ -3832,18 +3864,11 @@ static void Cmd_setadditionaleffects(void)
|
||||
if (gMovesInfo[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter)
|
||||
{
|
||||
u32 percentChance;
|
||||
u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove);
|
||||
const u8 *currentPtr = gBattlescriptCurrInstr;
|
||||
const struct AdditionalEffect *additionalEffect = &gMovesInfo[gCurrentMove].additionalEffects[gBattleStruct->additionalEffectsCounter];
|
||||
const u8 *currentPtr = gBattlescriptCurrInstr;
|
||||
|
||||
// Check additional effect flags
|
||||
// self-targeting move effects cannot occur multiple times per turn
|
||||
// only occur on the last setmoveeffect when there are multiple targets
|
||||
if (!(gMovesInfo[gCurrentMove].additionalEffects[gBattleStruct->additionalEffectsCounter].self
|
||||
&& (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY)
|
||||
&& GetNextTarget(moveTarget, TRUE) != MAX_BATTLERS_COUNT)
|
||||
&& !(additionalEffect->onlyIfTargetRaisedStats && !gProtectStructs[gBattlerTarget].statRaised)
|
||||
&& additionalEffect->onChargeTurnOnly == gProtectStructs[gBattlerAttacker].chargingTurn)
|
||||
// Various checks for if this move effect can be applied this turn
|
||||
if (CanApplyAdditionalEffect(additionalEffect))
|
||||
{
|
||||
percentChance = CalcSecondaryEffectChance(gBattlerAttacker, GetBattlerAbility(gBattlerAttacker), additionalEffect);
|
||||
|
||||
@ -5761,7 +5786,7 @@ static void Cmd_moveend(void)
|
||||
&& GetBattlerSide(gBattlerTarget) != GetBattlerSide(gBattlerAttacker)
|
||||
&& gProtectStructs[gBattlerTarget].physicalDmg
|
||||
&& gProtectStructs[gBattlerTarget].physicalBattlerId == gBattlerAttacker
|
||||
&& !TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
|
||||
&& !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))
|
||||
{
|
||||
gProtectStructs[gBattlerTarget].shellTrap = TRUE;
|
||||
// Change move order in double battles, so the hit mon with shell trap moves immediately after being hit.
|
||||
@ -5992,7 +6017,7 @@ static void Cmd_moveend(void)
|
||||
case MOVEEND_EJECT_BUTTON:
|
||||
if (gMovesInfo[gCurrentMove].effect != EFFECT_HIT_SWITCH_TARGET
|
||||
&& IsBattlerAlive(gBattlerAttacker)
|
||||
&& !TestSheerForceFlag(gBattlerAttacker, gCurrentMove)
|
||||
&& !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)
|
||||
&& (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER || (gBattleTypeFlags & BATTLE_TYPE_TRAINER)))
|
||||
{
|
||||
// Since we check if battler was damaged, we don't need to check move result.
|
||||
@ -6025,7 +6050,7 @@ static void Cmd_moveend(void)
|
||||
case MOVEEND_RED_CARD:
|
||||
if ((gMovesInfo[gCurrentMove].effect != EFFECT_HIT_SWITCH_TARGET || gBattleStruct->hitSwitchTargetFailed)
|
||||
&& IsBattlerAlive(gBattlerAttacker)
|
||||
&& !TestSheerForceFlag(gBattlerAttacker, gCurrentMove)
|
||||
&& !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)
|
||||
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_GUARD_DOG)
|
||||
{
|
||||
// Since we check if battler was damaged, we don't need to check move result.
|
||||
@ -6095,7 +6120,7 @@ static void Cmd_moveend(void)
|
||||
if (IsBattlerAlive(gBattlerAttacker)
|
||||
&& gBattleMons[gBattlerAttacker].item != ITEM_NONE // Attacker must be holding an item
|
||||
&& !(gWishFutureKnock.knockedOffMons[GetBattlerSide(gBattlerAttacker)] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]) // But not knocked off
|
||||
&& !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove)) // Pickpocket doesn't activate for sheer force
|
||||
&& !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)) // Pickpocket doesn't activate for sheer force
|
||||
&& IsMoveMakingContact(gCurrentMove, gBattlerAttacker) // Pickpocket requires contact
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) // Obviously attack needs to have worked
|
||||
{
|
||||
@ -6224,7 +6249,7 @@ static void Cmd_moveend(void)
|
||||
*(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget & 0x3;
|
||||
|
||||
if (B_RAMPAGE_CANCELLING >= GEN_5
|
||||
&& MoveHasMoveEffectSelf(gCurrentMove, MOVE_EFFECT_THRASH) // If we're rampaging
|
||||
&& MoveHasAdditionalEffectSelf(gCurrentMove, MOVE_EFFECT_THRASH) // If we're rampaging
|
||||
&& (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) // And it is unusable
|
||||
&& (gBattleMons[gBattlerAttacker].status2 & STATUS2_LOCK_CONFUSE) != STATUS2_LOCK_CONFUSE_TURN(1)) // And won't end this turn
|
||||
CancelMultiTurnMoves(gBattlerAttacker); // Cancel it
|
||||
@ -9678,8 +9703,10 @@ static void Cmd_various(void)
|
||||
{
|
||||
VARIOUS_ARGS(const u8 *failInstr);
|
||||
u16 move = gLastPrintedMoves[gBattlerTarget];
|
||||
if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || MoveHasMoveEffectSelf(move, MOVE_EFFECT_RECHARGE)
|
||||
|| gMovesInfo[move].instructBanned || gMovesInfo[move].twoTurnMove || IsDynamaxed(gBattlerTarget))
|
||||
if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || MoveHasAdditionalEffectSelf(move, MOVE_EFFECT_RECHARGE)
|
||||
|| gMovesInfo[move].instructBanned
|
||||
|| gBattleMoveEffects[gMovesInfo[move].effect].twoTurnEffect
|
||||
|| IsDynamaxed(gBattlerTarget))
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->failInstr;
|
||||
}
|
||||
@ -10760,7 +10787,8 @@ static void TryResetProtectUseCounter(u32 battler)
|
||||
{
|
||||
u32 lastMove = gLastResultingMoves[battler];
|
||||
if (lastMove == MOVE_UNAVAILABLE
|
||||
|| (!gMovesInfo[lastMove].protectionMove && (B_ALLY_SWITCH_FAIL_CHANCE >= GEN_9 && gMovesInfo[lastMove].effect != EFFECT_ALLY_SWITCH)))
|
||||
|| (!gBattleMoveEffects[gMovesInfo[lastMove].effect].usesProtectCounter
|
||||
&& (B_ALLY_SWITCH_FAIL_CHANCE >= GEN_9 && gMovesInfo[lastMove].effect != EFFECT_ALLY_SWITCH)))
|
||||
gDisableStructs[battler].protectUses = 0;
|
||||
}
|
||||
|
||||
@ -11730,7 +11758,7 @@ static void Cmd_twoturnmoveschargestringandanimation(void)
|
||||
CMD_ARGS(const u8 *animationThenStringPtr);
|
||||
|
||||
gBattleScripting.savedStringId = LOHALF(gMovesInfo[gCurrentMove].argument);
|
||||
if (B_UPDATED_MOVE_DATA < GEN_5 || MoveHasChargeTurnMoveEffect(gCurrentMove))
|
||||
if (B_UPDATED_MOVE_DATA < GEN_5 || MoveHasChargeTurnAdditionalEffect(gCurrentMove))
|
||||
gBattlescriptCurrInstr = cmd->animationThenStringPtr;
|
||||
else
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
@ -12741,7 +12769,7 @@ static void Cmd_settypetorandomresistance(void)
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->failInstr;
|
||||
}
|
||||
else if (gMovesInfo[gLastLandedMoves[gBattlerAttacker]].twoTurnMove
|
||||
else if (gBattleMoveEffects[gMovesInfo[gLastLandedMoves[gBattlerAttacker]].effect].twoTurnEffect
|
||||
&& gBattleMons[gLastHitBy[gBattlerAttacker]].status2 & STATUS2_MULTIPLETURNS)
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->failInstr;
|
||||
@ -12857,7 +12885,7 @@ static void Cmd_trychoosesleeptalkmove(void)
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].sleepTalkBanned
|
||||
|| gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].twoTurnMove)
|
||||
|| gBattleMoveEffects[gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].effect].twoTurnEffect)
|
||||
{
|
||||
unusableMovesBits |= gBitTable[i];
|
||||
}
|
||||
@ -13709,7 +13737,7 @@ static bool32 CheckIfCanFireTwoTurnMoveNow(u8 battler, bool8 checkChargeTurnEffe
|
||||
return FALSE;
|
||||
|
||||
// If this move has charge turn effects, it must charge, activate them, then try to fire
|
||||
if (checkChargeTurnEffects && MoveHasChargeTurnMoveEffect(gCurrentMove))
|
||||
if (checkChargeTurnEffects && MoveHasChargeTurnAdditionalEffect(gCurrentMove))
|
||||
return FALSE;
|
||||
|
||||
// Insert custom conditions here
|
||||
@ -14657,7 +14685,7 @@ bool32 DoesSubstituteBlockMove(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
|
||||
bool32 DoesDisguiseBlockMove(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
{
|
||||
if (gBattleMons[battlerDef].species != SPECIES_MIMIKYU_DISGUISED
|
||||
if (!(gBattleMons[battlerDef].species == SPECIES_MIMIKYU_DISGUISED || gBattleMons[battlerDef].species == SPECIES_MIMIKYU_TOTEM_DISGUISED)
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED
|
||||
|| IS_MOVE_STATUS(move)
|
||||
|| gHitMarker & HITMARKER_IGNORE_DISGUISE
|
||||
|
||||
@ -50,9 +50,6 @@ static const u32 sLogoCenter_Tilemap[] = INCBIN_U32("graphics/battle_transitions
|
||||
static const u32 sLogoCircles_Gfx[] = INCBIN_U32("graphics/battle_transitions/frontier_logo_circles.4bpp.lz");
|
||||
static const u16 sLogo_Pal[] = INCBIN_U16("graphics/battle_transitions/frontier_logo_circles.gbapal");
|
||||
|
||||
// Unused Empty data.
|
||||
static const u8 sFiller[0x1C0] = {0};
|
||||
|
||||
static const struct OamData sOamData_LogoCircles =
|
||||
{
|
||||
.y = 0,
|
||||
|
||||
@ -942,15 +942,15 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3)
|
||||
// Various cases to add/remove points
|
||||
if (gMovesInfo[arg2].recoil > 0)
|
||||
baseFromEffect++; // Recoil moves
|
||||
if (MoveHasMoveEffect(arg2, MOVE_EFFECT_RAPID_SPIN))
|
||||
if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_RAPID_SPIN))
|
||||
baseFromEffect++;
|
||||
if (MoveHasMoveEffect(arg2, MOVE_EFFECT_SP_ATK_TWO_DOWN) || MoveHasMoveEffect(arg2, MOVE_EFFECT_ATK_DEF_DOWN))
|
||||
if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_SP_ATK_TWO_DOWN) || MoveHasAdditionalEffect(arg2, MOVE_EFFECT_ATK_DEF_DOWN))
|
||||
baseFromEffect += 2; // Overheat, Superpower, etc.
|
||||
if (MoveHasMoveEffect(arg2, MOVE_EFFECT_STEAL_ITEM))
|
||||
if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_STEAL_ITEM))
|
||||
baseFromEffect += 3;
|
||||
if (MoveHasMoveEffect(arg2, MOVE_EFFECT_WRAP) || MoveHasMoveEffectSelf(arg2, MOVE_EFFECT_THRASH))
|
||||
if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_WRAP) || MoveHasAdditionalEffectSelf(arg2, MOVE_EFFECT_THRASH))
|
||||
baseFromEffect += 3;
|
||||
if (MoveHasMoveEffect(arg2, MOVE_EFFECT_RECHARGE))
|
||||
if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_RECHARGE))
|
||||
baseFromEffect += 4;
|
||||
|
||||
movePoints->points[atkSide][gBattlerPartyIndexes[gBattlerAttacker] * 4 + arg1] += baseFromEffect;
|
||||
|
||||
@ -3445,7 +3445,7 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType)
|
||||
case CANCELLER_THAW: // move thawing
|
||||
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)
|
||||
{
|
||||
if (!(MoveHasMoveEffectSelfArg(gCurrentMove, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)))
|
||||
if (!(MoveHasAdditionalEffectSelfArg(gCurrentMove, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)))
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status1 &= ~STATUS1_FREEZE;
|
||||
BattleScriptPushCursor();
|
||||
@ -3456,7 +3456,7 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType)
|
||||
}
|
||||
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE && gMovesInfo[gCurrentMove].thawsUser)
|
||||
{
|
||||
if (!(MoveHasMoveEffectSelfArg(gCurrentMove, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)))
|
||||
if (!(MoveHasAdditionalEffectSelfArg(gCurrentMove, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)))
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status1 &= ~STATUS1_FROSTBITE;
|
||||
BattleScriptPushCursor();
|
||||
@ -4123,7 +4123,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (effect == 1)
|
||||
BattleScriptPushCursorAndCallback(BattleScript_OverworldStatusStarts);
|
||||
else if (effect == 2)
|
||||
@ -4989,7 +4989,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
case ABILITYEFFECT_ABSORBING: // 3
|
||||
if (move != MOVE_NONE)
|
||||
{
|
||||
u8 statId;
|
||||
u8 statId = 0;
|
||||
u8 statAmount = 1;
|
||||
switch (gLastUsedAbility)
|
||||
{
|
||||
@ -5172,7 +5172,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
&& IsBattlerAlive(battler)
|
||||
&& HadMoreThanHalfHpNowHasLess(battler)
|
||||
&& (gMultiHitCounter == 0 || gMultiHitCounter == 1)
|
||||
&& !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
|
||||
&& !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))
|
||||
&& CompareStat(battler, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN))
|
||||
{
|
||||
gEffectBattler = battler;
|
||||
@ -5190,7 +5190,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
// Had more than half of hp before, now has less
|
||||
&& HadMoreThanHalfHpNowHasLess(battler)
|
||||
&& (gMultiHitCounter == 0 || gMultiHitCounter == 1)
|
||||
&& !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
|
||||
&& !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))
|
||||
&& (CanBattlerSwitch(battler) || !(gBattleTypeFlags & BATTLE_TYPE_TRAINER))
|
||||
&& !(gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
||||
&& CountUsablePartyMons(battler) > 0
|
||||
@ -5320,7 +5320,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
&& IsMoveMakingContact(move, gBattlerAttacker))
|
||||
{
|
||||
SET_STATCHANGER(STAT_SPEED, 1, TRUE);
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1;
|
||||
PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_GooeyActivates;
|
||||
@ -5621,7 +5620,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
&& (gMultiHitCounter == 0 || gMultiHitCounter == 1) // Activates after all hits from a multi-hit move.
|
||||
&& IsBattlerAlive(gBattlerTarget)
|
||||
&& HadMoreThanHalfHpNowHasLess(gBattlerTarget)
|
||||
&& !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove)))
|
||||
&& !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)))
|
||||
{
|
||||
gBattlerAttacker = gBattlerTarget;
|
||||
BattleScriptPushCursor();
|
||||
@ -5686,7 +5685,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& RandomWeighted(RNG_STENCH, 9, 1)
|
||||
&& TARGET_TURN_DAMAGED
|
||||
&& !MoveHasMoveEffect(gCurrentMove, MOVE_EFFECT_FLINCH))
|
||||
&& !MoveHasAdditionalEffect(gCurrentMove, MOVE_EFFECT_FLINCH))
|
||||
{
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH;
|
||||
BattleScriptPushCursor();
|
||||
@ -7649,7 +7648,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
||||
break;
|
||||
case HOLD_EFFECT_LIFE_ORB:
|
||||
if (IsBattlerAlive(gBattlerAttacker)
|
||||
&& !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
|
||||
&& !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))
|
||||
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD
|
||||
&& !gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage
|
||||
&& gSpecialStatuses[gBattlerAttacker].damagedMons)
|
||||
@ -8851,7 +8850,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.2));
|
||||
break;
|
||||
case ABILITY_SHEER_FORCE:
|
||||
if (gMovesInfo[move].sheerForceBoost)
|
||||
if (MoveIsAffectedBySheerForce(move))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
|
||||
break;
|
||||
case ABILITY_SAND_FORCE:
|
||||
@ -10830,12 +10829,9 @@ bool32 IsBattlerAffectedByHazards(u32 battler, bool32 toxicSpikes)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool32 TestSheerForceFlag(u32 battler, u16 move)
|
||||
bool32 TestIfSheerForceAffected(u32 battler, u16 move)
|
||||
{
|
||||
if (GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && gMovesInfo[move].sheerForceBoost)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
return GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && MoveIsAffectedBySheerForce(move);
|
||||
}
|
||||
|
||||
// This function is the body of "jumpifstat", but can be used dynamically in a function
|
||||
@ -11105,50 +11101,51 @@ bool32 IsGen6ExpShareEnabled(void)
|
||||
return FlagGet(I_EXP_SHARE_FLAG);
|
||||
}
|
||||
|
||||
bool32 MoveHasMoveEffect(u32 move, u32 moveEffect)
|
||||
|
||||
bool32 MoveHasAdditionalEffect(u32 move, u32 moveEffect)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
{
|
||||
if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect
|
||||
&& gMovesInfo[move].additionalEffects[i].self == FALSE)
|
||||
&& gMovesInfo[move].additionalEffects[i].self == FALSE)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 MoveHasMoveEffectWithChance(u32 move, u32 moveEffect, u32 chance)
|
||||
bool32 MoveHasAdditionalEffectWithChance(u32 move, u32 moveEffect, u32 chance)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
{
|
||||
if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect
|
||||
&& gMovesInfo[move].additionalEffects[i].chance == chance)
|
||||
&& gMovesInfo[move].additionalEffects[i].chance == chance)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 MoveHasMoveEffectSelf(u32 move, u32 moveEffect)
|
||||
bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
{
|
||||
if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect
|
||||
&& gMovesInfo[move].additionalEffects[i].self == TRUE)
|
||||
&& gMovesInfo[move].additionalEffects[i].self == TRUE)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 MoveHasMoveEffectSelfArg(u32 move, u32 moveEffect, u32 argument)
|
||||
bool32 MoveHasAdditionalEffectSelfArg(u32 move, u32 moveEffect, u32 argument)
|
||||
{
|
||||
return (gMovesInfo[move].argument == argument) && MoveHasMoveEffectSelf(move, moveEffect);
|
||||
return (gMovesInfo[move].argument == argument) && MoveHasAdditionalEffectSelf(move, moveEffect);
|
||||
}
|
||||
|
||||
bool32 MoveHasChargeTurnMoveEffect(u32 move)
|
||||
bool32 MoveHasChargeTurnAdditionalEffect(u32 move)
|
||||
{
|
||||
u8 i = 0;
|
||||
u32 i;
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
{
|
||||
if (gMovesInfo[move].additionalEffects[i].onChargeTurnOnly)
|
||||
@ -11157,6 +11154,17 @@ bool32 MoveHasChargeTurnMoveEffect(u32 move)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 MoveIsAffectedBySheerForce(u32 move)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++)
|
||||
{
|
||||
if (gMovesInfo[move].additionalEffects[i].chance > 0)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CanMonParticipateInSkyBattle(struct Pokemon *mon)
|
||||
{
|
||||
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
|
||||
@ -57,45 +57,47 @@ static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler);
|
||||
// Const Data
|
||||
static const struct SignatureZMove sSignatureZMoves[] =
|
||||
{
|
||||
{SPECIES_PIKACHU_COSPLAY, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_ROCK_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_BELLE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_POP_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_PH_D, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_LIBRE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_COSPLAY, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_ROCK_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_BELLE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_POP_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_PH_D, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_PIKACHU_LIBRE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
|
||||
{SPECIES_RAICHU_ALOLAN, ITEM_ALORAICHIUM_Z, MOVE_THUNDERBOLT, MOVE_STOKED_SPARKSURFER},
|
||||
{SPECIES_DECIDUEYE, ITEM_DECIDIUM_Z, MOVE_SPIRIT_SHACKLE, MOVE_SINISTER_ARROW_RAID},
|
||||
{SPECIES_INCINEROAR, ITEM_INCINIUM_Z, MOVE_DARKEST_LARIAT, MOVE_MALICIOUS_MOONSAULT},
|
||||
{SPECIES_KOMMO_O, ITEM_KOMMONIUM_Z, MOVE_CLANGING_SCALES, MOVE_CLANGOROUS_SOULBLAZE},
|
||||
{SPECIES_LUNALA, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM},
|
||||
{SPECIES_NECROZMA_DAWN_WINGS, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM},
|
||||
{SPECIES_LYCANROC_MIDDAY, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS},
|
||||
{SPECIES_LYCANROC_MIDNIGHT, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS},
|
||||
{SPECIES_LYCANROC_DUSK, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS},
|
||||
{SPECIES_MARSHADOW, ITEM_MARSHADIUM_Z, MOVE_SPECTRAL_THIEF, MOVE_SOUL_STEALING_7_STAR_STRIKE},
|
||||
{SPECIES_MIMIKYU_DISGUISED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER},
|
||||
{SPECIES_MIMIKYU_BUSTED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER},
|
||||
{SPECIES_PIKACHU_ORIGINAL_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_HOENN_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_SINNOH_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_UNOVA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_KALOS_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_ALOLA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_PARTNER_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_WORLD_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PRIMARINA, ITEM_PRIMARIUM_Z, MOVE_SPARKLING_ARIA, MOVE_OCEANIC_OPERETTA},
|
||||
{SPECIES_SOLGALEO, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH},
|
||||
{SPECIES_NECROZMA_DUSK_MANE, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH},
|
||||
{SPECIES_TAPU_KOKO, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_TAPU_BULU, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_TAPU_LELE, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_TAPU_FINI, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z, MOVE_PHOTON_GEYSER, MOVE_LIGHT_THAT_BURNS_THE_SKY},
|
||||
{SPECIES_MEW, ITEM_MEWNIUM_Z, MOVE_PSYCHIC, MOVE_GENESIS_SUPERNOVA},
|
||||
{SPECIES_PIKACHU, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_EEVEE, ITEM_EEVIUM_Z, MOVE_LAST_RESORT, MOVE_EXTREME_EVOBOOST},
|
||||
{SPECIES_SNORLAX, ITEM_SNORLIUM_Z, MOVE_GIGA_IMPACT, MOVE_PULVERIZING_PANCAKE},
|
||||
{SPECIES_RAICHU_ALOLAN, ITEM_ALORAICHIUM_Z, MOVE_THUNDERBOLT, MOVE_STOKED_SPARKSURFER},
|
||||
{SPECIES_DECIDUEYE, ITEM_DECIDIUM_Z, MOVE_SPIRIT_SHACKLE, MOVE_SINISTER_ARROW_RAID},
|
||||
{SPECIES_INCINEROAR, ITEM_INCINIUM_Z, MOVE_DARKEST_LARIAT, MOVE_MALICIOUS_MOONSAULT},
|
||||
{SPECIES_KOMMO_O, ITEM_KOMMONIUM_Z, MOVE_CLANGING_SCALES, MOVE_CLANGOROUS_SOULBLAZE},
|
||||
{SPECIES_LUNALA, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM},
|
||||
{SPECIES_NECROZMA_DAWN_WINGS, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM},
|
||||
{SPECIES_LYCANROC_MIDDAY, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS},
|
||||
{SPECIES_LYCANROC_MIDNIGHT, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS},
|
||||
{SPECIES_LYCANROC_DUSK, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS},
|
||||
{SPECIES_MARSHADOW, ITEM_MARSHADIUM_Z, MOVE_SPECTRAL_THIEF, MOVE_SOUL_STEALING_7_STAR_STRIKE},
|
||||
{SPECIES_MIMIKYU_DISGUISED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER},
|
||||
{SPECIES_MIMIKYU_BUSTED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER},
|
||||
{SPECIES_MIMIKYU_TOTEM_DISGUISED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER},
|
||||
{SPECIES_MIMIKYU_TOTEM_BUSTED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER},
|
||||
{SPECIES_PIKACHU_ORIGINAL_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_HOENN_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_SINNOH_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_UNOVA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_KALOS_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_ALOLA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_PARTNER_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PIKACHU_WORLD_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT},
|
||||
{SPECIES_PRIMARINA, ITEM_PRIMARIUM_Z, MOVE_SPARKLING_ARIA, MOVE_OCEANIC_OPERETTA},
|
||||
{SPECIES_SOLGALEO, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH},
|
||||
{SPECIES_NECROZMA_DUSK_MANE, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH},
|
||||
{SPECIES_TAPU_KOKO, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_TAPU_BULU, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_TAPU_LELE, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_TAPU_FINI, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA},
|
||||
{SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z, MOVE_PHOTON_GEYSER, MOVE_LIGHT_THAT_BURNS_THE_SKY},
|
||||
{SPECIES_MEW, ITEM_MEWNIUM_Z, MOVE_PSYCHIC, MOVE_GENESIS_SUPERNOVA},
|
||||
{SPECIES_PIKACHU, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA},
|
||||
{SPECIES_EEVEE, ITEM_EEVIUM_Z, MOVE_LAST_RESORT, MOVE_EXTREME_EVOBOOST},
|
||||
{SPECIES_SNORLAX, ITEM_SNORLIUM_Z, MOVE_GIGA_IMPACT, MOVE_PULVERIZING_PANCAKE},
|
||||
};
|
||||
|
||||
static const u8 sText_ResetStats[] = _("Reset Lowered Stats");
|
||||
@ -378,13 +380,13 @@ static u16 GetTypeBasedZMove(u16 move, u8 battler)
|
||||
{
|
||||
u8 moveType = gMovesInfo[move].type;
|
||||
|
||||
// Get z move from type
|
||||
if (moveType < TYPE_FIRE)
|
||||
return MOVE_BREAKNECK_BLITZ + moveType;
|
||||
else if (moveType >= TYPE_FAIRY)
|
||||
return MOVE_TWINKLE_TACKLE + (moveType - TYPE_FAIRY);
|
||||
else
|
||||
return MOVE_BREAKNECK_BLITZ + (moveType - 1);
|
||||
if (moveType >= NUMBER_OF_MON_TYPES)
|
||||
moveType = TYPE_MYSTERY;
|
||||
|
||||
// Get Z-Move from type
|
||||
if (gTypesInfo[moveType].zMove == MOVE_NONE) // failsafe
|
||||
return gTypesInfo[0].zMove;
|
||||
return gTypesInfo[moveType].zMove;
|
||||
}
|
||||
|
||||
bool32 MoveSelectionDisplayZMove(u16 zmove, u32 battler)
|
||||
@ -553,7 +555,7 @@ static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler)
|
||||
*(txtPtr)++ = EXT_CTRL_CODE_FONT;
|
||||
*(txtPtr)++ = FONT_NORMAL;
|
||||
|
||||
StringCopy(txtPtr, gTypeNames[zMoveType]);
|
||||
StringCopy(txtPtr, gTypesInfo[zMoveType].name);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE);
|
||||
}
|
||||
|
||||
|
||||
@ -2295,8 +2295,6 @@ bool8 PlayerHasMulch(void)
|
||||
}
|
||||
|
||||
#if OW_BERRY_MUTATIONS == TRUE
|
||||
#define BERRY_MUTATION_CHANCE 25
|
||||
|
||||
static const u8 sBerryMutations[][3] = {
|
||||
{ITEM_TO_BERRY(ITEM_IAPAPA_BERRY), ITEM_TO_BERRY(ITEM_MAGO_BERRY), ITEM_TO_BERRY(ITEM_POMEG_BERRY)},
|
||||
{ITEM_TO_BERRY(ITEM_CHESTO_BERRY), ITEM_TO_BERRY(ITEM_PERSIM_BERRY), ITEM_TO_BERRY(ITEM_KELPSY_BERRY)},
|
||||
@ -2353,7 +2351,7 @@ static u8 TryForMutation(u8 berryTreeId, u8 berry)
|
||||
{
|
||||
x2 = gObjectEvents[j].currentCoords.x;
|
||||
y2 = gObjectEvents[j].currentCoords.y;
|
||||
if (Random() % 100 < (BERRY_MUTATION_CHANCE * (mulch == ITEM_TO_MULCH(ITEM_SURPRISE_MULCH) || mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) && (
|
||||
if (Random() % 100 < (OW_BERRY_MUTATION_CHANCE * (mulch == ITEM_TO_MULCH(ITEM_SURPRISE_MULCH) || mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) && (
|
||||
(x1 == x2 && y1 == y2 - 1) ||
|
||||
(x1 == x2 && y1 == y2 + 1) ||
|
||||
(x1 == x2 - 1 && y1 == y2) ||
|
||||
|
||||
@ -3211,7 +3211,7 @@ static u8 CreateContestantSprite(u16 species, bool8 isShiny, u32 personality, u3
|
||||
u8 spriteId;
|
||||
species = SanitizeSpecies(species);
|
||||
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT], species, personality);
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT], species, personality);
|
||||
|
||||
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, isShiny, personality), OBJ_PLTT_ID(2), PLTT_SIZE_4BPP);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_PLAYER_LEFT);
|
||||
|
||||
@ -368,18 +368,18 @@ static void InitContestMonPixels(u16 species, bool8 backPic)
|
||||
if (!backPic)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
species,
|
||||
gContestPaintingWinner->personality);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT],
|
||||
species,
|
||||
gContestPaintingWinner->personality);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -893,7 +893,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
|
||||
personality = gContestMons[i].personality;
|
||||
isShiny = gContestMons[i].isShiny;
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
species,
|
||||
personality);
|
||||
|
||||
@ -2576,7 +2576,7 @@ void ShowContestEntryMonPic(void)
|
||||
taskId = CreateTask(Task_ShowContestEntryMonPic, 0x50);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = species;
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
|
||||
LoadCompressedSpritePaletteWithTag(GetMonSpritePalFromSpeciesAndPersonality(species, isShiny, personality), species);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_OPPONENT_LEFT);
|
||||
|
||||
@ -222,6 +222,7 @@ const union AnimCmd *const gAnims_MonPic[MAX_MON_PIC_FRAMES] =
|
||||
|
||||
const union AnimCmd *const sAnims_Trainer[] ={
|
||||
sAnim_GeneralFrame0,
|
||||
sAnim_GeneralFrame0,
|
||||
};
|
||||
|
||||
#include "data/trainer_parties.h"
|
||||
|
||||
@ -12,7 +12,6 @@ const struct OamData gOamData_AffineOff_ObjNormal_8x8 =
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
|
||||
const struct OamData gOamData_AffineOff_ObjNormal_16x16 =
|
||||
{
|
||||
.y = 0,
|
||||
|
||||
@ -384,6 +384,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectTwoTurnsAttack,
|
||||
.battleTvScore = 3,
|
||||
.twoTurnEffect = TRUE,
|
||||
},
|
||||
|
||||
[EFFECT_SUBSTITUTE] =
|
||||
@ -569,6 +570,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
||||
.battleScript = BattleScript_EffectProtect,
|
||||
.battleTvScore = 5,
|
||||
.encourageEncore = TRUE,
|
||||
.usesProtectCounter = TRUE,
|
||||
},
|
||||
|
||||
[EFFECT_SPIKES] =
|
||||
@ -603,6 +605,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
||||
.battleScript = BattleScript_EffectEndure,
|
||||
.battleTvScore = 3,
|
||||
.encourageEncore = TRUE,
|
||||
.usesProtectCounter = TRUE,
|
||||
},
|
||||
|
||||
[EFFECT_ROLLOUT] =
|
||||
@ -765,6 +768,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectTwoTurnsAttack,
|
||||
.battleTvScore = 1,
|
||||
.twoTurnEffect = TRUE,
|
||||
},
|
||||
|
||||
[EFFECT_THUNDER] =
|
||||
@ -789,6 +793,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectTwoTurnsAttack,
|
||||
.battleTvScore = 3,
|
||||
.twoTurnEffect = TRUE,
|
||||
.semiInvulnerableEffect = TRUE,
|
||||
},
|
||||
|
||||
@ -1791,6 +1796,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectGeomancy,
|
||||
.battleTvScore = 0, // TODO: Assign points
|
||||
.twoTurnEffect = TRUE,
|
||||
},
|
||||
|
||||
[EFFECT_FAIRY_LOCK] =
|
||||
@ -1993,6 +1999,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectSkyDrop,
|
||||
.battleTvScore = 0, // TODO: Assign points
|
||||
.twoTurnEffect = TRUE,
|
||||
.semiInvulnerableEffect = TRUE,
|
||||
},
|
||||
|
||||
|
||||
@ -3993,7 +3993,7 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_
|
||||
const u32 gMonPalette_WooperPaldean[] = INCBIN_U32("graphics/pokemon/wooper/wooper_paldean/normal.gbapal.lz");
|
||||
const u32 gMonBackPic_WooperPaldean[] = INCBIN_U32("graphics/pokemon/wooper/wooper_paldean/back.4bpp.lz");
|
||||
const u32 gMonShinyPalette_WooperPaldean[] = INCBIN_U32("graphics/pokemon/wooper/wooper_paldean/shiny.gbapal.lz");
|
||||
// const u8 gMonIcon_WooperPaldean[] = INCBIN_U8("graphics/pokemon/wooper/wooper_paldean/icon.4bpp");
|
||||
const u8 gMonIcon_WooperPaldean[] = INCBIN_U8("graphics/pokemon/wooper/wooper_paldean/icon.4bpp");
|
||||
#if OW_FOLLOWERS_ENABLED
|
||||
// const u32 gObjectEventPic_WooperPaldean[] = INCBIN_COMP("graphics/pokemon/wooper/wooper_paldean/follower.4bpp");
|
||||
#endif //OW_FOLLOWERS_ENABLED
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -835,6 +835,12 @@ static const struct FormChange sMimikyuFormChangeTable[] = {
|
||||
{FORM_CHANGE_END_BATTLE, SPECIES_MIMIKYU_DISGUISED},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sMimikyuTotemFormChangeTable[] = {
|
||||
{FORM_CHANGE_FAINT, SPECIES_MIMIKYU_TOTEM_DISGUISED},
|
||||
{FORM_CHANGE_END_BATTLE, SPECIES_MIMIKYU_TOTEM_DISGUISED},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
#endif //P_FAMILY_MIMIKYU
|
||||
|
||||
#if P_FAMILY_NECROZMA
|
||||
|
||||
@ -60,6 +60,7 @@ static const u16 sRattataFormSpeciesIdTable[] = {
|
||||
static const u16 sRaticateFormSpeciesIdTable[] = {
|
||||
SPECIES_RATICATE,
|
||||
SPECIES_RATICATE_ALOLAN,
|
||||
SPECIES_RATICATE_ALOLAN_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_RATTATA
|
||||
@ -90,6 +91,7 @@ static const u16 sPikachuFormSpeciesIdTable[] = {
|
||||
SPECIES_PIKACHU_PARTNER_CAP,
|
||||
SPECIES_PIKACHU_WORLD_CAP,
|
||||
SPECIES_PIKACHU_GIGANTAMAX,
|
||||
SPECIES_PIKACHU_PARTNER,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
|
||||
@ -320,6 +322,7 @@ static const u16 sExeggutorFormSpeciesIdTable[] = {
|
||||
static const u16 sMarowakFormSpeciesIdTable[] = {
|
||||
SPECIES_MAROWAK,
|
||||
SPECIES_MAROWAK_ALOLAN,
|
||||
SPECIES_MAROWAK_ALOLAN_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_CUBONE
|
||||
@ -396,6 +399,7 @@ static const u16 sLaprasFormSpeciesIdTable[] = {
|
||||
static const u16 sEeveeFormSpeciesIdTable[] = {
|
||||
SPECIES_EEVEE,
|
||||
SPECIES_EEVEE_GIGANTAMAX,
|
||||
SPECIES_EEVEE_PARTNER,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_EEVEE
|
||||
@ -803,6 +807,13 @@ static const u16 sWormadamFormSpeciesIdTable[] = {
|
||||
SPECIES_WORMADAM_TRASH_CLOAK,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
|
||||
static const u16 sMothimFormSpeciesIdTable[] = {
|
||||
SPECIES_MOTHIM_PLANT_CLOAK,
|
||||
SPECIES_MOTHIM_SANDY_CLOAK,
|
||||
SPECIES_MOTHIM_TRASH_CLOAK,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_BURMY
|
||||
|
||||
#if P_FAMILY_CHERUBI
|
||||
@ -1116,6 +1127,54 @@ static const u16 sGreninjaFormSpeciesIdTable[] = {
|
||||
#endif //P_FAMILY_FROAKIE
|
||||
|
||||
#if P_FAMILY_SCATTERBUG
|
||||
static const u16 sScatterbugFormSpeciesIdTable[] = {
|
||||
SPECIES_SCATTERBUG_ICY_SNOW,
|
||||
SPECIES_SCATTERBUG_POLAR,
|
||||
SPECIES_SCATTERBUG_TUNDRA,
|
||||
SPECIES_SCATTERBUG_CONTINENTAL,
|
||||
SPECIES_SCATTERBUG_GARDEN,
|
||||
SPECIES_SCATTERBUG_ELEGANT,
|
||||
SPECIES_SCATTERBUG_MEADOW,
|
||||
SPECIES_SCATTERBUG_MODERN,
|
||||
SPECIES_SCATTERBUG_MARINE,
|
||||
SPECIES_SCATTERBUG_ARCHIPELAGO,
|
||||
SPECIES_SCATTERBUG_HIGH_PLAINS,
|
||||
SPECIES_SCATTERBUG_SANDSTORM,
|
||||
SPECIES_SCATTERBUG_RIVER,
|
||||
SPECIES_SCATTERBUG_MONSOON,
|
||||
SPECIES_SCATTERBUG_SAVANNA,
|
||||
SPECIES_SCATTERBUG_SUN,
|
||||
SPECIES_SCATTERBUG_OCEAN,
|
||||
SPECIES_SCATTERBUG_JUNGLE,
|
||||
SPECIES_SCATTERBUG_FANCY,
|
||||
SPECIES_SCATTERBUG_POKE_BALL,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
|
||||
static const u16 sSpewpaFormSpeciesIdTable[] = {
|
||||
SPECIES_SPEWPA_ICY_SNOW,
|
||||
SPECIES_SPEWPA_POLAR,
|
||||
SPECIES_SPEWPA_TUNDRA,
|
||||
SPECIES_SPEWPA_CONTINENTAL,
|
||||
SPECIES_SPEWPA_GARDEN,
|
||||
SPECIES_SPEWPA_ELEGANT,
|
||||
SPECIES_SPEWPA_MEADOW,
|
||||
SPECIES_SPEWPA_MODERN,
|
||||
SPECIES_SPEWPA_MARINE,
|
||||
SPECIES_SPEWPA_ARCHIPELAGO,
|
||||
SPECIES_SPEWPA_HIGH_PLAINS,
|
||||
SPECIES_SPEWPA_SANDSTORM,
|
||||
SPECIES_SPEWPA_RIVER,
|
||||
SPECIES_SPEWPA_MONSOON,
|
||||
SPECIES_SPEWPA_SAVANNA,
|
||||
SPECIES_SPEWPA_SUN,
|
||||
SPECIES_SPEWPA_OCEAN,
|
||||
SPECIES_SPEWPA_JUNGLE,
|
||||
SPECIES_SPEWPA_FANCY,
|
||||
SPECIES_SPEWPA_POKE_BALL,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
|
||||
static const u16 sVivillonFormSpeciesIdTable[] = {
|
||||
SPECIES_VIVILLON_ICY_SNOW,
|
||||
SPECIES_VIVILLON_POLAR,
|
||||
@ -1286,6 +1345,22 @@ static const u16 sDecidueyeFormSpeciesIdTable[] = {
|
||||
};
|
||||
#endif //P_FAMILY_ROWLET
|
||||
|
||||
#if P_FAMILY_YUNGOOS
|
||||
static const u16 sGumshoosFormSpeciesIdTable[] = {
|
||||
SPECIES_GUMSHOOS,
|
||||
SPECIES_GUMSHOOS_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_YUNGOOS
|
||||
|
||||
#if P_FAMILY_GRUBBIN
|
||||
static const u16 sVikavoltFormSpeciesIdTable[] = {
|
||||
SPECIES_VIKAVOLT,
|
||||
SPECIES_VIKAVOLT_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_GRUBBIN
|
||||
|
||||
#if P_FAMILY_ORICORIO
|
||||
static const u16 sOricorioFormSpeciesIdTable[] = {
|
||||
SPECIES_ORICORIO_BAILE,
|
||||
@ -1296,6 +1371,14 @@ static const u16 sOricorioFormSpeciesIdTable[] = {
|
||||
};
|
||||
#endif //P_FAMILY_ORICORIO
|
||||
|
||||
#if P_FAMILY_CUTIEFLY
|
||||
static const u16 sRibombeeFormSpeciesIdTable[] = {
|
||||
SPECIES_RIBOMBEE,
|
||||
SPECIES_RIBOMBEE_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_CUTIEFLY
|
||||
|
||||
#if P_FAMILY_ROCKRUFF
|
||||
static const u16 sRockruffFormSpeciesIdTable[] = {
|
||||
SPECIES_ROCKRUFF,
|
||||
@ -1319,6 +1402,30 @@ static const u16 sWishiwashiFormSpeciesIdTable[] = {
|
||||
};
|
||||
#endif //P_FAMILY_WISHIWASHI
|
||||
|
||||
#if P_FAMILY_DEWPIDER
|
||||
static const u16 sAraquanidFormSpeciesIdTable[] = {
|
||||
SPECIES_ARAQUANID,
|
||||
SPECIES_ARAQUANID_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_DEWPIDER
|
||||
|
||||
#if P_FAMILY_FOMANTIS
|
||||
static const u16 sLurantisFormSpeciesIdTable[] = {
|
||||
SPECIES_LURANTIS,
|
||||
SPECIES_LURANTIS_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_FOMANTIS
|
||||
|
||||
#if P_FAMILY_SALANDIT
|
||||
static const u16 sSalanditFormSpeciesIdTable[] = {
|
||||
SPECIES_SALAZZLE,
|
||||
SPECIES_SALAZZLE_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_FOMANTIS
|
||||
|
||||
#if P_FAMILY_TYPE_NULL
|
||||
static const u16 sSilvallyFormSpeciesIdTable[] = {
|
||||
SPECIES_SILVALLY_NORMAL,
|
||||
@ -1363,14 +1470,32 @@ static const u16 sMiniorFormSpeciesIdTable[] = {
|
||||
};
|
||||
#endif //P_FAMILY_MINIOR
|
||||
|
||||
#if P_FAMILY_TOGEDEMARU
|
||||
static const u16 sTogedemaruFormSpeciesIdTable[] = {
|
||||
SPECIES_TOGEDEMARU,
|
||||
SPECIES_TOGEDEMARU_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_TOGEDEMARU
|
||||
|
||||
#if P_FAMILY_MIMIKYU
|
||||
static const u16 sMimikyuFormSpeciesIdTable[] = {
|
||||
SPECIES_MIMIKYU_DISGUISED,
|
||||
SPECIES_MIMIKYU_BUSTED,
|
||||
SPECIES_MIMIKYU_TOTEM_DISGUISED,
|
||||
SPECIES_MIMIKYU_TOTEM_BUSTED,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_MIMIKYU
|
||||
|
||||
#if P_FAMILY_JANGMO_O
|
||||
static const u16 sKommoOFormSpeciesIdTable[] = {
|
||||
SPECIES_KOMMO_O,
|
||||
SPECIES_KOMMO_O_TOTEM,
|
||||
FORM_SPECIES_END,
|
||||
};
|
||||
#endif //P_FAMILY_JANGMO_O
|
||||
|
||||
#if P_FAMILY_NECROZMA
|
||||
static const u16 sNecrozmaFormSpeciesIdTable[] = {
|
||||
SPECIES_NECROZMA,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,222 +1,10 @@
|
||||
#include "constants/abilities.h"
|
||||
|
||||
// Shared Pokédex entries
|
||||
const u8 gPichuPokedexText[] = _(
|
||||
"It is still inept at retaining electricity.\n"
|
||||
"When it is startled, it discharges power\n"
|
||||
"accidentally. It gets better at holding\n"
|
||||
"power as it grows older.");
|
||||
|
||||
const u8 gPikachuPokedexText[] = _(
|
||||
"It stores electricity in the electric sacs\n"
|
||||
"on its cheeks. When it releases pent-up\n"
|
||||
"energy in a burst, the electric power is\n"
|
||||
"equal to a lightning bolt.");
|
||||
|
||||
const u8 gUnownPokedexText[] = _(
|
||||
"This Pokémon is shaped like ancient text\n"
|
||||
"characters. Although research is ongoing,\n"
|
||||
"it is a mystery as to which came first,\n"
|
||||
"the ancient writings or the various Unown.");
|
||||
|
||||
const u8 gDeoxysNormalPokedexText[] = _(
|
||||
"Deoxys emerged from a virus that came\n"
|
||||
"from space. It is highly intelligent and\n"
|
||||
"can shoot lasers from the crystalline\n"
|
||||
"organ on its chest.");
|
||||
|
||||
const u8 gArceusPokedexText[] = _(
|
||||
"It is told in mythology that this Pokémon\n"
|
||||
"emerged from an egg and shaped all there\n"
|
||||
"is in this world, before the universe\n"
|
||||
"even existed.");
|
||||
|
||||
const u8 gGenesectPokedexText[] = _(
|
||||
"Over 300 million years ago, it was\n"
|
||||
"feared as the strongest of hunters.\n"
|
||||
"Team Plasma altered it and attached\n"
|
||||
"a cannon to its back.");
|
||||
|
||||
const u8 gGreninjaPokedexText[] = _(
|
||||
"It appears and vanishes with a ninja's\n"
|
||||
"grace. It toys with its enemies using swift\n"
|
||||
"movements, while slicing them with throwing\n"
|
||||
"stars made of compressed water.");
|
||||
|
||||
const u8 gFurfrouPokedexText[] = _(
|
||||
"Trimming its fluffy fur not only makes\n"
|
||||
"it more elegant but also increases the\n"
|
||||
"swiftness of its movements. These\n"
|
||||
"Pokémon were the guardians of kings.");
|
||||
|
||||
const u8 gXerneasPokedexText[] = _(
|
||||
"Legends say that when the horns on\n"
|
||||
"its head shine in seven colors, it is\n"
|
||||
"sharing everlasting life. It slept for a\n"
|
||||
"thousand years in the form of a tree");
|
||||
|
||||
const u8 gZygarde50PokedexText[] = _(
|
||||
"It's said to be monitoring the ecosystem\n"
|
||||
"from deep in the caves where it lives.\n"
|
||||
"There are rumors that even greater power\n"
|
||||
"lies hidden within its cells.");
|
||||
|
||||
const u8 gZygarde10PokedexText[] = _(
|
||||
"This is Zygarde when about 10% of\n"
|
||||
"its pieces have been assembled. It\n"
|
||||
"leaps at its opponent's chest and\n"
|
||||
"sinks its sharp fangs into them.");
|
||||
|
||||
const u8 gRockruffPokedexText[] = _(
|
||||
"This Pokémon has lived with people since\n"
|
||||
"times long ago. It can sense when its\n"
|
||||
"Trainer is in the dumps and will stick\n"
|
||||
"close by its Trainer's side.");
|
||||
|
||||
const u8 gSilvallyNormalPokedexText[] = _(
|
||||
"Its trust in its partner awakens it.\n"
|
||||
"This Pokémon is capable of changing its\n"
|
||||
"type by equipping special memories, a\n"
|
||||
"trait that is well displayed in battle.");
|
||||
|
||||
const u8 gSilvallyMemoryPokedexText[] = _(
|
||||
"Upon awakening, its RKS System is\n"
|
||||
"activated. By employing specific\n"
|
||||
"memories, this Pokémon can adapt its\n"
|
||||
"type to confound its enemies.");
|
||||
|
||||
const u8 gMiniorMeteorPokedexText[] = _(
|
||||
"Originally making its home in the ozone\n"
|
||||
"layer, it hurtles to the ground when the\n"
|
||||
"shell encasing its body grows too heavy.\n"
|
||||
"It was born from mutated nanoparticles.");
|
||||
|
||||
const u8 gMiniorCorePokedexText[] = _(
|
||||
"If its core stays exposed, it will\n"
|
||||
"soon die off. It's possible that it\n"
|
||||
"may survive if it's put into a Poké Ball\n"
|
||||
"quickly enough.");
|
||||
|
||||
const u8 gAlcremieVanillaCreamPokedexText[] = _(
|
||||
"When it trusts a Trainer, it will treat\n"
|
||||
"them to berries it's decorated with cream.");
|
||||
|
||||
const u8 gAlcremieRubyCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"sweet and tart flavor. This is\n"
|
||||
"because of the way its cells\n"
|
||||
"spontaneously shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieMatchaCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on\n"
|
||||
"an aromatic flavor. This is because\n"
|
||||
"of the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieMintCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"refreshing flavor. This is because\n"
|
||||
"of the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieLemonCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"sour flavor. This is because of the\n"
|
||||
"way its cells spontaneously shifted\n"
|
||||
"during evolution.");
|
||||
|
||||
const u8 gAlcremieSaltedCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"salty flavor. This is because of the\n"
|
||||
"way its cells spontaneously shifted\n"
|
||||
"during evolution.");
|
||||
|
||||
const u8 gAlcremieRubySwirlPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"mixed flavor. This is because of the\n"
|
||||
"way its cells spontaneously shifted\n"
|
||||
"during evolution.");
|
||||
|
||||
const u8 gAlcremieCaramelSwirlPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"bitter flavor. This is because of\n"
|
||||
"the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieRainbowSwirlPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"complex flavor. This is because of\n"
|
||||
"the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gToxtricityGigantamaxPokedexText[] = _(
|
||||
"Out of control after its own\n"
|
||||
"poison penetrated its brain, it tears\n"
|
||||
"across the land in a rampage,\n"
|
||||
"contaminating the earth with toxic sweat.");
|
||||
|
||||
const u8 gOgerponTealMaskPokedexText[] = _(
|
||||
"This Pokémon's type changes based on\n"
|
||||
"which mask it's wearing. It confounds\n"
|
||||
"its enemies with nimble movements\n"
|
||||
"and kicks.");
|
||||
|
||||
const u8 gOgerponWellspringMaskPokedexText[] = _(
|
||||
"This form excels in both attack\n"
|
||||
"and defense. It ceaselessly unleashes\n"
|
||||
"moves like a spring gushes water.");
|
||||
|
||||
const u8 gOgerponHearthflameMaskPokedexText[] = _(
|
||||
"This form is the most aggressive,\n"
|
||||
"bombarding enemies with the\n"
|
||||
"intensity of flames blazing within a hearth.");
|
||||
|
||||
const u8 gOgerponCornerstoneMaskPokedexText[] = _(
|
||||
"In this form, it draws on the power\n"
|
||||
"of stone. Its body is rock-solid,\n"
|
||||
"protecting it from all manner of\n"
|
||||
"attacks.");
|
||||
#include "species_info/shared_dex_text.h"
|
||||
|
||||
// Macros for ease of use.
|
||||
|
||||
#define EVOLUTION(...) (const struct Evolution[]) { __VA_ARGS__, { EVOLUTIONS_END }, }
|
||||
|
||||
#define FRONT_PIC(sprite, width, height) \
|
||||
.frontPic = gMonFrontPic_## sprite, \
|
||||
.frontPicSize = MON_COORDS_SIZE(width, height)
|
||||
|
||||
#define FRONT_PIC_FEMALE(sprite, width, height) \
|
||||
.frontPicFemale = gMonFrontPic_## sprite##F, \
|
||||
.frontPicSizeFemale = MON_COORDS_SIZE(width, height)
|
||||
|
||||
#define BACK_PIC(sprite, width, height) \
|
||||
.backPic = gMonBackPic_## sprite, \
|
||||
.backPicSize = MON_COORDS_SIZE(width, height)
|
||||
|
||||
#define BACK_PIC_FEMALE(sprite, width, height) \
|
||||
.backPicFemale = gMonBackPic_## sprite##F, \
|
||||
.backPicSizeFemale = MON_COORDS_SIZE(width, height)
|
||||
|
||||
#define PALETTES(pal) \
|
||||
.palette = gMonPalette_## pal, \
|
||||
.shinyPalette = gMonShinyPalette_## pal
|
||||
|
||||
#define PALETTE_FEMALE(pal) \
|
||||
.paletteFemale = gMonPalette_## pal##F, \
|
||||
.shinyPaletteFemale = gMonShinyPalette_## pal##F
|
||||
|
||||
#define ICON(sprite, palId) \
|
||||
.iconSprite = gMonIcon_## sprite, \
|
||||
.iconPalIndex = palId
|
||||
|
||||
#define ICON_FEMALE(sprite, palId) \
|
||||
.iconSpriteFemale = gMonIcon_## sprite##F, \
|
||||
.iconPalIndexFemale = palId
|
||||
|
||||
#define LEARNSETS(learn) \
|
||||
.levelUpLearnset = s ## learn##LevelUpLearnset, \
|
||||
.teachableLearnset = s ## learn##TeachableLearnset
|
||||
|
||||
#if P_FOOTPRINTS
|
||||
#define FOOTPRINT(sprite) .footprint = gMonFootprint_## sprite,
|
||||
#else
|
||||
@ -282,41 +70,48 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.pokemonOffset = 0,
|
||||
.trainerScale = 256,
|
||||
.trainerOffset = 0,
|
||||
FRONT_PIC(CircledQuestionMark, 40, 40),
|
||||
.frontPic = gMonFrontPic_CircledQuestionMark,
|
||||
.frontPicSize = MON_COORDS_SIZE(40, 40),
|
||||
.frontPicYOffset = 12,
|
||||
.frontAnimFrames = sAnims_None,
|
||||
.frontAnimId = ANIM_V_SQUISH_AND_BOUNCE,
|
||||
BACK_PIC(CircledQuestionMark, 40, 40),
|
||||
.backPic = gMonBackPic_CircledQuestionMark,
|
||||
.backPicSize = MON_COORDS_SIZE(40, 40),
|
||||
.backPicYOffset = 12,
|
||||
.backAnimId = BACK_ANIM_NONE,
|
||||
PALETTES(CircledQuestionMark),
|
||||
ICON(QuestionMark, 0),
|
||||
.palette = gMonPalette_CircledQuestionMark,
|
||||
.shinyPalette = gMonShinyPalette_CircledQuestionMark,
|
||||
.iconSprite = gMonIcon_QuestionMark,
|
||||
.iconPalIndex = 0,
|
||||
#if OW_FOLLOWERS_ENABLED
|
||||
.followerData = {TAG_NONE, OBJ_EVENT_PAL_TAG_SUBSTITUTE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, COMP, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_Substitute, gDummySpriteAffineAnimTable},
|
||||
#endif
|
||||
LEARNSETS(None),
|
||||
.levelUpLearnset = sNoneLevelUpLearnset,
|
||||
.teachableLearnset = sNoneTeachableLearnset,
|
||||
},
|
||||
|
||||
#include "species_info/gen_1.h"
|
||||
#include "species_info/gen_2.h"
|
||||
#include "species_info/gen_3.h"
|
||||
#include "species_info/gen_4.h"
|
||||
#include "species_info/gen_5.h"
|
||||
#include "species_info/gen_6.h"
|
||||
#include "species_info/gen_7.h"
|
||||
#include "species_info/gen_8.h"
|
||||
#include "species_info/gen_9.h"
|
||||
#include "species_info/gen_1_families.h"
|
||||
#include "species_info/gen_2_families.h"
|
||||
#include "species_info/gen_3_families.h"
|
||||
#include "species_info/gen_4_families.h"
|
||||
#include "species_info/gen_5_families.h"
|
||||
#include "species_info/gen_6_families.h"
|
||||
#include "species_info/gen_7_families.h"
|
||||
#include "species_info/gen_8_families.h"
|
||||
#include "species_info/gen_9_families.h"
|
||||
|
||||
[SPECIES_EGG] =
|
||||
{
|
||||
FRONT_PIC(Egg, 24, 24),
|
||||
.frontPic = gMonFrontPic_Egg,
|
||||
.frontPicSize = MON_COORDS_SIZE(24, 24),
|
||||
.frontPicYOffset = 20,
|
||||
.backPic = gMonFrontPic_Egg,
|
||||
.backPicSize = MON_COORDS_SIZE(24, 24),
|
||||
.backPicYOffset = 20,
|
||||
.palette = gMonPalette_Egg,
|
||||
.shinyPalette = gMonPalette_Egg,
|
||||
ICON(Egg, 1),
|
||||
.iconSprite = gMonIcon_Egg,
|
||||
.iconPalIndex = 1,
|
||||
},
|
||||
|
||||
/* You may add any custom species below this point based on the following structure: */
|
||||
@ -358,22 +153,30 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.pokemonOffset = 0,
|
||||
.trainerScale = 256,
|
||||
.trainerOffset = 0,
|
||||
FRONT_PIC(CircledQuestionMark, 64, 64),
|
||||
//FRONT_PIC_FEMALE(CircledQuestionMark, 64, 64),
|
||||
.frontPic = gMonFrontPic_CircledQuestionMark,
|
||||
.frontPicSize = MON_COORDS_SIZE(64, 64),
|
||||
//.frontPicFemale = gMonFrontPic_CircledQuestionMark,
|
||||
//.frontPicSizeFemale = MON_COORDS_SIZE(64, 64),
|
||||
.frontPicYOffset = 0,
|
||||
.frontAnimFrames = sAnims_None,
|
||||
//.frontAnimId = ANIM_V_SQUISH_AND_BOUNCE,
|
||||
.enemyMonElevation = 0,
|
||||
BACK_PIC(CircledQuestionMark, 64, 64),
|
||||
//BACK_PIC_FEMALE(CircledQuestionMark, 64, 64),
|
||||
.backPic = gMonBackPic_CircledQuestionMark,
|
||||
.backPicSize = MON_COORDS_SIZE(64, 64),
|
||||
//.backPicFemale = gMonBackPic_CircledQuestionMarkF,
|
||||
//.backPicSizeFemale = MON_COORDS_SIZE(64, 64),
|
||||
.backPicYOffset = 7,
|
||||
.backAnimId = BACK_ANIM_NONE,
|
||||
PALETTES(CircledQuestionMark),
|
||||
//PALETTE_FEMALE(CircledQuestionMark),
|
||||
ICON(QuestionMark, 0),
|
||||
//ICON_FEMALE(QuestionMark, 1),
|
||||
.palette = gMonPalette_CircledQuestionMark,
|
||||
.shinyPalette = gMonShinyPalette_CircledQuestionMark,
|
||||
//.paletteFemale = gMonPalette_CircledQuestionMarkF,
|
||||
.shinyPaletteFemale = gMonShinyPalette_CircledQuestionMarkF,
|
||||
.iconSprite = gMonIcon_QuestionMark,
|
||||
.iconPalIndex = 0,
|
||||
//.iconSpriteFemale = gMonIcon_QuestionMarkF,
|
||||
//.iconPalIndexFemale = 1,
|
||||
//FOOTPRINT(None)
|
||||
LEARNSETS(None),
|
||||
.levelUpLearnset = sNoneLevelUpLearnset,
|
||||
.teachableLearnset = sNoneTeachableLearnset,
|
||||
.evolutions = EVOLUTION({EVO_LEVEL, 100, SPECIES_NONE},
|
||||
{EVO_ITEM, ITEM_MOOMOO_MILK, SPECIES_NONE}),
|
||||
//.formSpeciesIdTable = sNoneFormSpeciesIdTable,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
282
src/data/pokemon/species_info/shared_dex_text.h
Normal file
282
src/data/pokemon/species_info/shared_dex_text.h
Normal file
@ -0,0 +1,282 @@
|
||||
// Gen 1 families
|
||||
const u8 gRaticateAlolanPokedexText[] = _(
|
||||
"It forms a group of Rattata, which it \n"
|
||||
"assumes command of. Each group\n"
|
||||
"has its own territory, and disputes\n"
|
||||
"over food happen often.");
|
||||
|
||||
const u8 gPichuPokedexText[] = _(
|
||||
"It is still inept at retaining electricity.\n"
|
||||
"When it is startled, it discharges power\n"
|
||||
"accidentally. It gets better at holding\n"
|
||||
"power as it grows older.");
|
||||
|
||||
const u8 gPikachuPokedexText[] = _(
|
||||
"It stores electricity in the electric sacs\n"
|
||||
"on its cheeks. When it releases pent-up\n"
|
||||
"energy in a burst, the electric power is\n"
|
||||
"equal to a lightning bolt.");
|
||||
|
||||
const u8 gMarowakAlolanPokedexText[] = _(
|
||||
"The cursed flames that light up the bone\n"
|
||||
"carried by this Pokémon are said\n"
|
||||
"to cause both mental and physical\n"
|
||||
"pain that will never fade.");
|
||||
|
||||
const u8 gEeveePokedexText[] = _(
|
||||
"An Eevee has an unstable genetic makeup\n"
|
||||
"that suddenly mutates due to its\n"
|
||||
"environment. Radiation from various\n"
|
||||
"Stones causes this Pokémon to evolve.");
|
||||
|
||||
// Gen 2 families
|
||||
const u8 gUnownPokedexText[] = _(
|
||||
"This Pokémon is shaped like ancient text\n"
|
||||
"characters. Although research is ongoing,\n"
|
||||
"it is a mystery as to which came first,\n"
|
||||
"the ancient writings or the various Unown.");
|
||||
|
||||
// Gen 3 families
|
||||
const u8 gDeoxysNormalPokedexText[] = _(
|
||||
"Deoxys emerged from a virus that came\n"
|
||||
"from space. It is highly intelligent and\n"
|
||||
"can shoot lasers from the crystalline\n"
|
||||
"organ on its chest.");
|
||||
|
||||
// Gen 4 families
|
||||
const u8 gMothimPokedexText[] = _(
|
||||
"It does not keep a nest. While it\n"
|
||||
"loves floral honey, it won't gather\n"
|
||||
"any itself. Instead, it plots to steal\n"
|
||||
"honey collected by Combee.");
|
||||
|
||||
const u8 gArceusPokedexText[] = _(
|
||||
"It is told in mythology that this Pokémon\n"
|
||||
"emerged from an egg and shaped all there\n"
|
||||
"is in this world, before the universe\n"
|
||||
"even existed.");
|
||||
|
||||
// Gen 5 families
|
||||
const u8 gGenesectPokedexText[] = _(
|
||||
"Over 300 million years ago, it was\n"
|
||||
"feared as the strongest of hunters.\n"
|
||||
"Team Plasma altered it and attached\n"
|
||||
"a cannon to its back.");
|
||||
|
||||
// Gen 6 families
|
||||
const u8 gGreninjaPokedexText[] = _(
|
||||
"It appears and vanishes with a ninja's\n"
|
||||
"grace. It toys with its enemies using swift\n"
|
||||
"movements, while slicing them with throwing\n"
|
||||
"stars made of compressed water.");
|
||||
|
||||
const u8 gScatterbugPokedexText[] = _(
|
||||
"When under attack from bird Pokémon,\n"
|
||||
"it spews a poisonous black powder that\n"
|
||||
"causes paralysis on contact. Scatterbug\n"
|
||||
"can live in any region or climate.");
|
||||
|
||||
const u8 gSpewpaPokedexText[] = _(
|
||||
"It lives hidden within thicket shadows.\n"
|
||||
"When predators attack, it quickly bristles\n"
|
||||
"the fur covering its body in an effort to\n"
|
||||
"threaten them.");
|
||||
|
||||
const u8 gFurfrouPokedexText[] = _(
|
||||
"Trimming its fluffy fur not only makes\n"
|
||||
"it more elegant but also increases the\n"
|
||||
"swiftness of its movements. These\n"
|
||||
"Pokémon were the guardians of kings.");
|
||||
|
||||
const u8 gXerneasPokedexText[] = _(
|
||||
"Legends say that when the horns on\n"
|
||||
"its head shine in seven colors, it is\n"
|
||||
"sharing everlasting life. It slept for a\n"
|
||||
"thousand years in the form of a tree");
|
||||
|
||||
const u8 gZygarde50PokedexText[] = _(
|
||||
"It's said to be monitoring the ecosystem\n"
|
||||
"from deep in the caves where it lives.\n"
|
||||
"There are rumors that even greater power\n"
|
||||
"lies hidden within its cells.");
|
||||
|
||||
const u8 gZygarde10PokedexText[] = _(
|
||||
"This is Zygarde when about 10% of\n"
|
||||
"its pieces have been assembled. It\n"
|
||||
"leaps at its opponent's chest and\n"
|
||||
"sinks its sharp fangs into them.");
|
||||
|
||||
// Gen 7 families
|
||||
const u8 gGumshoosPokedexText[] = _(
|
||||
"When it finds a trace of its prey, it\n"
|
||||
"patiently stakes out the location...\n"
|
||||
"but as it's diurnal, it's always snoozing\n"
|
||||
"by nightfall.");
|
||||
|
||||
const u8 gVikavoltPokedexText[] = _(
|
||||
"It concentrates electrical energy within\n"
|
||||
"its large jaws and uses it to zap its foes.\n"
|
||||
"It overwhelms bird Pokémon with shocking\n"
|
||||
"beams of electrical energy.");
|
||||
|
||||
const u8 gRibombeePokedexText[] = _(
|
||||
"Ribombee rolls up pollen into puffs.\n"
|
||||
"It makes many different varieties, some\n"
|
||||
"used as food and others used in battle.\n"
|
||||
"They are sometimes sold as supplements.");
|
||||
|
||||
const u8 gRockruffPokedexText[] = _(
|
||||
"This Pokémon has lived with people since\n"
|
||||
"times long ago. It can sense when its\n"
|
||||
"Trainer is in the dumps and will stick\n"
|
||||
"close by its Trainer's side.");
|
||||
|
||||
const u8 gAraquanidPokedexText[] = _(
|
||||
"Despite what its appearance suggests,\n"
|
||||
"it cares for others. If it finds vulnerable,\n"
|
||||
"weak Pokémon, it protectively brings\n"
|
||||
"them into its water bubble.");
|
||||
|
||||
const u8 gLurantisPokedexText[] = _(
|
||||
"It requires a lot of effort to maintain\n"
|
||||
"Lurantis's vivid coloring, but some\n"
|
||||
"collectors enjoy this work and treat it\n"
|
||||
"as their hobby.");
|
||||
|
||||
const u8 gSalazzlePokedexText[] = _(
|
||||
"For some reason, only females have\n"
|
||||
"been found. It creates a reverse harem of\n"
|
||||
"male Salandit to live with. Its poisonous\n"
|
||||
"gas is filled with pheromones.");
|
||||
|
||||
const u8 gSilvallyNormalPokedexText[] = _(
|
||||
"Its trust in its partner awakens it.\n"
|
||||
"This Pokémon is capable of changing its\n"
|
||||
"type by equipping special memories, a\n"
|
||||
"trait that is well displayed in battle.");
|
||||
|
||||
const u8 gSilvallyMemoryPokedexText[] = _(
|
||||
"Upon awakening, its RKS System is\n"
|
||||
"activated. By employing specific\n"
|
||||
"memories, this Pokémon can adapt its\n"
|
||||
"type to confound its enemies.");
|
||||
|
||||
const u8 gMiniorMeteorPokedexText[] = _(
|
||||
"Originally making its home in the ozone\n"
|
||||
"layer, it hurtles to the ground when the\n"
|
||||
"shell encasing its body grows too heavy.\n"
|
||||
"It was born from mutated nanoparticles.");
|
||||
|
||||
const u8 gMiniorCorePokedexText[] = _(
|
||||
"If its core stays exposed, it will\n"
|
||||
"soon die off. It's possible that it\n"
|
||||
"may survive if it's put into a Poké Ball\n"
|
||||
"quickly enough.");
|
||||
|
||||
const u8 gTogedemaruPokedexText[] = _(
|
||||
"The spiny fur on its back is normally\n"
|
||||
"at rest. When this Pokémon becomes\n"
|
||||
"agitated, its fur stands on end and stabs\n"
|
||||
"into its attackers.");
|
||||
|
||||
const u8 gMimikyuDisguisedPokedexText[] = _(
|
||||
"A lonely Pokémon, it hides its terrifying\n"
|
||||
"appearance beneath an old rag so it can\n"
|
||||
"get closer to people and other Pokémon.\n"
|
||||
"Its actual appearance is unknown.");
|
||||
|
||||
const u8 gMimikyuBustedPokedexText[] = _(
|
||||
"After going to all the effort of\n"
|
||||
"disguising itself, its neck was\n"
|
||||
"broken. Whatever is inside is probably\n"
|
||||
"unharmed, but it's still feeling sad.");
|
||||
|
||||
const u8 gKommoOPokedexText[] = _(
|
||||
"Its rigid scales function as offense and\n"
|
||||
"defense. In the past, its scales were\n"
|
||||
"processed and used to make weapons\n"
|
||||
"and other valuable commodities.");
|
||||
|
||||
// Gen 8 families
|
||||
const u8 gAlcremieVanillaCreamPokedexText[] = _(
|
||||
"If Alcremie is content, the secreted cream\n"
|
||||
"from its hands becomes sweeter and richer."
|
||||
"When it trusts a Trainer, it will treat\n"
|
||||
"them to berries it's decorated with cream.");
|
||||
|
||||
const u8 gAlcremieRubyCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"sweet and tart flavor. This is\n"
|
||||
"because of the way its cells\n"
|
||||
"spontaneously shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieMatchaCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on\n"
|
||||
"an aromatic flavor. This is because\n"
|
||||
"of the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieMintCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"refreshing flavor. This is because\n"
|
||||
"of the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieLemonCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"sour flavor. This is because of the\n"
|
||||
"way its cells spontaneously shifted\n"
|
||||
"during evolution.");
|
||||
|
||||
const u8 gAlcremieSaltedCreamPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"salty flavor. This is because of the\n"
|
||||
"way its cells spontaneously shifted\n"
|
||||
"during evolution.");
|
||||
|
||||
const u8 gAlcremieRubySwirlPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"mixed flavor. This is because of the\n"
|
||||
"way its cells spontaneously shifted\n"
|
||||
"during evolution.");
|
||||
|
||||
const u8 gAlcremieCaramelSwirlPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"bitter flavor. This is because of\n"
|
||||
"the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gAlcremieRainbowSwirlPokedexText[] = _(
|
||||
"The moment it evolved, it took on a\n"
|
||||
"complex flavor. This is because of\n"
|
||||
"the way its cells spontaneously\n"
|
||||
"shifted during evolution.");
|
||||
|
||||
const u8 gToxtricityGigantamaxPokedexText[] = _(
|
||||
"Out of control after its own\n"
|
||||
"poison penetrated its brain, it tears\n"
|
||||
"across the land in a rampage,\n"
|
||||
"contaminating the earth with toxic sweat.");
|
||||
|
||||
// Gen 9 families
|
||||
const u8 gOgerponTealMaskPokedexText[] = _(
|
||||
"This Pokémon's type changes based on\n"
|
||||
"which mask it's wearing. It confounds\n"
|
||||
"its enemies with nimble movements\n"
|
||||
"and kicks.");
|
||||
|
||||
const u8 gOgerponWellspringMaskPokedexText[] = _(
|
||||
"This form excels in both attack\n"
|
||||
"and defense. It ceaselessly unleashes\n"
|
||||
"moves like a spring gushes water.");
|
||||
|
||||
const u8 gOgerponHearthflameMaskPokedexText[] = _(
|
||||
"This form is the most aggressive,\n"
|
||||
"bombarding enemies with the\n"
|
||||
"intensity of flames blazing within a hearth.");
|
||||
|
||||
const u8 gOgerponCornerstoneMaskPokedexText[] = _(
|
||||
"In this form, it draws on the power\n"
|
||||
"of stone. Its body is rock-solid,\n"
|
||||
"protecting it from all manner of\n"
|
||||
"attacks.");
|
||||
@ -868,24 +868,24 @@ static const struct WindowTemplate sWindowTemplate_TradingBoardRequestType = {
|
||||
};
|
||||
|
||||
static const struct ListMenuItem sTradingBoardTypes[NUMBER_OF_MON_TYPES] = {
|
||||
{ gTypeNames[TYPE_NORMAL], TYPE_NORMAL },
|
||||
{ gTypeNames[TYPE_FIRE], TYPE_FIRE },
|
||||
{ gTypeNames[TYPE_WATER], TYPE_WATER },
|
||||
{ gTypeNames[TYPE_ELECTRIC], TYPE_ELECTRIC },
|
||||
{ gTypeNames[TYPE_GRASS], TYPE_GRASS },
|
||||
{ gTypeNames[TYPE_ICE], TYPE_ICE },
|
||||
{ gTypeNames[TYPE_GROUND], TYPE_GROUND },
|
||||
{ gTypeNames[TYPE_ROCK], TYPE_ROCK },
|
||||
{ gTypeNames[TYPE_FLYING], TYPE_FLYING },
|
||||
{ gTypeNames[TYPE_PSYCHIC], TYPE_PSYCHIC },
|
||||
{ gTypeNames[TYPE_FIGHTING], TYPE_FIGHTING },
|
||||
{ gTypeNames[TYPE_POISON], TYPE_POISON },
|
||||
{ gTypeNames[TYPE_BUG], TYPE_BUG },
|
||||
{ gTypeNames[TYPE_GHOST], TYPE_GHOST },
|
||||
{ gTypeNames[TYPE_DRAGON], TYPE_DRAGON },
|
||||
{ gTypeNames[TYPE_STEEL], TYPE_STEEL },
|
||||
{ gTypeNames[TYPE_DARK], TYPE_DARK },
|
||||
{ gTypeNames[TYPE_FAIRY], TYPE_FAIRY },
|
||||
{ gTypesInfo[TYPE_NORMAL].name, TYPE_NORMAL },
|
||||
{ gTypesInfo[TYPE_FIRE].name, TYPE_FIRE },
|
||||
{ gTypesInfo[TYPE_WATER].name, TYPE_WATER },
|
||||
{ gTypesInfo[TYPE_ELECTRIC].name, TYPE_ELECTRIC },
|
||||
{ gTypesInfo[TYPE_GRASS].name, TYPE_GRASS },
|
||||
{ gTypesInfo[TYPE_ICE].name, TYPE_ICE },
|
||||
{ gTypesInfo[TYPE_GROUND].name, TYPE_GROUND },
|
||||
{ gTypesInfo[TYPE_ROCK].name, TYPE_ROCK },
|
||||
{ gTypesInfo[TYPE_FLYING].name, TYPE_FLYING },
|
||||
{ gTypesInfo[TYPE_PSYCHIC].name, TYPE_PSYCHIC },
|
||||
{ gTypesInfo[TYPE_FIGHTING].name, TYPE_FIGHTING },
|
||||
{ gTypesInfo[TYPE_POISON].name, TYPE_POISON },
|
||||
{ gTypesInfo[TYPE_BUG].name, TYPE_BUG },
|
||||
{ gTypesInfo[TYPE_GHOST].name, TYPE_GHOST },
|
||||
{ gTypesInfo[TYPE_DRAGON].name, TYPE_DRAGON },
|
||||
{ gTypesInfo[TYPE_STEEL].name, TYPE_STEEL },
|
||||
{ gTypesInfo[TYPE_DARK].name, TYPE_DARK },
|
||||
{ gTypesInfo[TYPE_FAIRY].name, TYPE_FAIRY },
|
||||
{ sText_Exit, NUMBER_OF_MON_TYPES }
|
||||
};
|
||||
|
||||
|
||||
@ -1054,12 +1054,15 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent
|
||||
eggSpecies = SPECIES_PHIONE;
|
||||
else if (eggSpecies == SPECIES_SINISTEA_ANTIQUE)
|
||||
eggSpecies = SPECIES_SINISTEA_PHONY;
|
||||
else if (GET_BASE_SPECIES_ID(eggSpecies) == SPECIES_VIVILLON)
|
||||
eggSpecies = SPECIES_SCATTERBUG;
|
||||
else if (GET_BASE_SPECIES_ID(eggSpecies) == SPECIES_ROTOM)
|
||||
eggSpecies = SPECIES_ROTOM;
|
||||
else if (GET_BASE_SPECIES_ID(eggSpecies) == SPECIES_FURFROU)
|
||||
eggSpecies = SPECIES_FURFROU;
|
||||
// To avoid single-stage Totem Pokémon to breed more of themselves.
|
||||
else if (eggSpecies == SPECIES_MIMIKYU_TOTEM_DISGUISED)
|
||||
eggSpecies = SPECIES_MIMIKYU_DISGUISED;
|
||||
else if (eggSpecies == SPECIES_TOGEDEMARU_TOTEM)
|
||||
eggSpecies = SPECIES_TOGEDEMARU;
|
||||
|
||||
// Make Ditto the "mother" slot if the other daycare mon is male.
|
||||
if (species[parentSlots[1]] == SPECIES_DITTO && GetBoxMonGender(&daycare->mons[parentSlots[0]].mon) != MON_FEMALE)
|
||||
|
||||
76
src/debug.c
76
src/debug.c
@ -126,9 +126,9 @@ enum PartyDebugMenu
|
||||
DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER,
|
||||
DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG,
|
||||
DEBUG_PARTY_MENU_ITEM_HEAL_PARTY,
|
||||
DEBUG_PARTY_MENU_ITEM_POISON_MONS,
|
||||
DEBUG_PARTY_MENU_ITEM_CHECK_EV,
|
||||
DEBUG_PARTY_MENU_ITEM_CHECK_IV,
|
||||
DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1,
|
||||
DEBUG_PARTY_MENU_ITEM_CHECK_EVS,
|
||||
DEBUG_PARTY_MENU_ITEM_CHECK_IVS,
|
||||
DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY,
|
||||
};
|
||||
|
||||
@ -391,9 +391,9 @@ static void DebugAction_PCBag_ClearBoxes(u8 taskId);
|
||||
static void DebugAction_Party_MoveReminder(u8 taskId);
|
||||
static void DebugAction_Party_HatchAnEgg(u8 taskId);
|
||||
static void DebugAction_Party_HealParty(u8 taskId);
|
||||
static void DebugAction_Party_PoisonMons(u8 taskId);
|
||||
static void DebugAction_Party_CheckEV(u8 taskId);
|
||||
static void DebugAction_Party_CheckIV(u8 taskId);
|
||||
static void DebugAction_Party_InflictStatus1(u8 taskId);
|
||||
static void DebugAction_Party_CheckEVs(u8 taskId);
|
||||
static void DebugAction_Party_CheckIVs(u8 taskId);
|
||||
static void DebugAction_Party_ClearParty(u8 taskId);
|
||||
|
||||
static void DebugAction_FlagsVars_Flags(u8 taskId);
|
||||
@ -452,8 +452,9 @@ static void DebugAction_BerryFunctions_Weeds(u8 taskId);
|
||||
extern const u8 Debug_FlagsNotSetOverworldConfigMessage[];
|
||||
extern const u8 Debug_FlagsNotSetBattleConfigMessage[];
|
||||
extern const u8 Debug_FlagsAndVarNotSetBattleConfigMessage[];
|
||||
extern const u8 Debug_EventScript_CheckEV[];
|
||||
extern const u8 Debug_EventScript_CheckIV[];
|
||||
extern const u8 Debug_EventScript_CheckEVs[];
|
||||
extern const u8 Debug_EventScript_CheckIVs[];
|
||||
extern const u8 Debug_EventScript_InflictStatus1[];
|
||||
extern const u8 Debug_EventScript_Script_1[];
|
||||
extern const u8 Debug_EventScript_Script_2[];
|
||||
extern const u8 Debug_EventScript_Script_3[];
|
||||
@ -548,9 +549,9 @@ static const u8 sDebugText_PCBag_ClearBoxes[] = _("Clear Storage Bo
|
||||
static const u8 sDebugText_Party_MoveReminder[] = _("Move Reminder");
|
||||
static const u8 sDebugText_Party_HatchAnEgg[] = _("Hatch an Egg");
|
||||
static const u8 sDebugText_Party_HealParty[] = _("Heal party");
|
||||
static const u8 sDebugText_Party_PoisonParty[] = _("Poison party");
|
||||
static const u8 sDebugText_Party_CheckEV[] = _("Check EV");
|
||||
static const u8 sDebugText_Party_CheckIV[] = _("Check IV");
|
||||
static const u8 sDebugText_Party_InflictStatus1[] = _("Inflict Status1");
|
||||
static const u8 sDebugText_Party_CheckEVs[] = _("Check EVs");
|
||||
static const u8 sDebugText_Party_CheckIVs[] = _("Check IVs");
|
||||
static const u8 sDebugText_Party_ClearParty[] = _("Clear Party");
|
||||
// Flags/Vars Menu
|
||||
static const u8 sDebugText_FlagsVars_Flags[] = _("Set Flag XYZ…{CLEAR_TO 110}{RIGHT_ARROW}");
|
||||
@ -743,13 +744,13 @@ static const struct ListMenuItem sDebugMenu_Items_PCBag_Fill[] =
|
||||
|
||||
static const struct ListMenuItem sDebugMenu_Items_Party[] =
|
||||
{
|
||||
[DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER] = {sDebugText_Party_MoveReminder, DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER},
|
||||
[DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG] = {sDebugText_Party_HatchAnEgg, DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG},
|
||||
[DEBUG_PARTY_MENU_ITEM_HEAL_PARTY] = {sDebugText_Party_HealParty, DEBUG_PARTY_MENU_ITEM_HEAL_PARTY},
|
||||
[DEBUG_PARTY_MENU_ITEM_POISON_MONS] = {sDebugText_Party_PoisonParty, DEBUG_PARTY_MENU_ITEM_POISON_MONS},
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_EV] = {sDebugText_Party_CheckEV, DEBUG_PARTY_MENU_ITEM_CHECK_EV},
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_IV] = {sDebugText_Party_CheckIV, DEBUG_PARTY_MENU_ITEM_CHECK_IV},
|
||||
[DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY] = {sDebugText_Party_ClearParty, DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY},
|
||||
[DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER] = {sDebugText_Party_MoveReminder, DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER},
|
||||
[DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG] = {sDebugText_Party_HatchAnEgg, DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG},
|
||||
[DEBUG_PARTY_MENU_ITEM_HEAL_PARTY] = {sDebugText_Party_HealParty, DEBUG_PARTY_MENU_ITEM_HEAL_PARTY},
|
||||
[DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1] = {sDebugText_Party_InflictStatus1, DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1},
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_EVS] = {sDebugText_Party_CheckEVs, DEBUG_PARTY_MENU_ITEM_CHECK_EVS},
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_IVS] = {sDebugText_Party_CheckIVs, DEBUG_PARTY_MENU_ITEM_CHECK_IVS},
|
||||
[DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY] = {sDebugText_Party_ClearParty, DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY},
|
||||
};
|
||||
|
||||
static const struct ListMenuItem sDebugMenu_Items_Scripts[] =
|
||||
@ -912,13 +913,13 @@ static void (*const sDebugMenu_Actions_PCBag_Fill[])(u8) =
|
||||
|
||||
static void (*const sDebugMenu_Actions_Party[])(u8) =
|
||||
{
|
||||
[DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER] = DebugAction_Party_MoveReminder,
|
||||
[DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG] = DebugAction_Party_HatchAnEgg,
|
||||
[DEBUG_PARTY_MENU_ITEM_HEAL_PARTY] = DebugAction_Party_HealParty,
|
||||
[DEBUG_PARTY_MENU_ITEM_POISON_MONS] = DebugAction_Party_PoisonMons,
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_EV] = DebugAction_Party_CheckEV,
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_IV] = DebugAction_Party_CheckIV,
|
||||
[DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY] = DebugAction_Party_ClearParty,
|
||||
[DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER] = DebugAction_Party_MoveReminder,
|
||||
[DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG] = DebugAction_Party_HatchAnEgg,
|
||||
[DEBUG_PARTY_MENU_ITEM_HEAL_PARTY] = DebugAction_Party_HealParty,
|
||||
[DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1] = DebugAction_Party_InflictStatus1,
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_EVS] = DebugAction_Party_CheckEVs,
|
||||
[DEBUG_PARTY_MENU_ITEM_CHECK_IVS] = DebugAction_Party_CheckIVs,
|
||||
[DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY] = DebugAction_Party_ClearParty,
|
||||
};
|
||||
|
||||
static void (*const sDebugMenu_Actions_Scripts[])(u8) =
|
||||
@ -5084,32 +5085,19 @@ static void DebugAction_Party_HealParty(u8 taskId)
|
||||
Debug_DestroyMenu_Full(taskId);
|
||||
}
|
||||
|
||||
static void DebugAction_Party_PoisonMons(u8 taskId)
|
||||
static void DebugAction_Party_InflictStatus1(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, 0)
|
||||
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
|
||||
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
|
||||
{
|
||||
u32 curStatus = STATUS1_POISON;
|
||||
SetMonData(&gPlayerParty[i], MON_DATA_STATUS, &curStatus);
|
||||
}
|
||||
}
|
||||
PlaySE(SE_FIELD_POISON);
|
||||
ScriptContext_Enable();
|
||||
Debug_DestroyMenu_Full(taskId);
|
||||
Debug_DestroyMenu_Full_Script(taskId, Debug_EventScript_InflictStatus1);
|
||||
}
|
||||
|
||||
static void DebugAction_Party_CheckEV(u8 taskId)
|
||||
static void DebugAction_Party_CheckEVs(u8 taskId)
|
||||
{
|
||||
Debug_DestroyMenu_Full_Script(taskId, Debug_EventScript_CheckEV);
|
||||
Debug_DestroyMenu_Full_Script(taskId, Debug_EventScript_CheckEVs);
|
||||
}
|
||||
|
||||
static void DebugAction_Party_CheckIV(u8 taskId)
|
||||
static void DebugAction_Party_CheckIVs(u8 taskId)
|
||||
{
|
||||
Debug_DestroyMenu_Full_Script(taskId, Debug_EventScript_CheckIV);
|
||||
Debug_DestroyMenu_Full_Script(taskId, Debug_EventScript_CheckIVs);
|
||||
}
|
||||
|
||||
static void DebugAction_Party_ClearParty(u8 taskId)
|
||||
|
||||
@ -442,7 +442,7 @@ static u8 EggHatchCreateMonSprite(u8 useAlt, u8 state, u8 partyId, u16 *speciesL
|
||||
{
|
||||
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[(useAlt * 2) + B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[(useAlt * 2) + B_POSITION_OPPONENT_LEFT],
|
||||
species, pid);
|
||||
LoadCompressedSpritePaletteWithTag(GetMonFrontSpritePal(mon), species);
|
||||
*speciesLoc = species;
|
||||
|
||||
@ -258,7 +258,7 @@ void EvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u
|
||||
currSpecies = GetMonData(mon, MON_DATA_SPECIES);
|
||||
isShiny = GetMonData(mon, MON_DATA_IS_SHINY);
|
||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
currSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
@ -273,7 +273,7 @@ void EvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u
|
||||
gSprites[id].invisible = TRUE;
|
||||
|
||||
// postEvo sprite
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
@ -350,7 +350,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
|
||||
FreeAllSpritePalettes();
|
||||
gReservedSpritePaletteCount = 4;
|
||||
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
@ -420,7 +420,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
|
||||
{
|
||||
bool8 isShiny = GetMonData(mon, MON_DATA_IS_SHINY);
|
||||
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
@ -484,7 +484,7 @@ void TradeEvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, u8 preEvoSprit
|
||||
sEvoStructPtr = AllocZeroed(sizeof(struct EvoInfo));
|
||||
sEvoStructPtr->preEvoSpriteId = preEvoSpriteId;
|
||||
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
|
||||
52
src/item.c
52
src/item.c
@ -160,57 +160,39 @@ bool8 HasAtLeastOneBerry(void)
|
||||
|
||||
bool8 CheckBagHasSpace(u16 itemId, u16 count)
|
||||
{
|
||||
u8 i;
|
||||
u8 pocket = ItemId_GetPocket(itemId) - 1;
|
||||
u16 ownedCount;
|
||||
|
||||
if (ItemId_GetPocket(itemId) == POCKET_NONE)
|
||||
return FALSE;
|
||||
|
||||
if (InBattlePyramid() || FlagGet(FLAG_STORING_ITEMS_IN_PYRAMID_BAG) == TRUE)
|
||||
return CheckPyramidBagHasSpace(itemId, count);
|
||||
|
||||
return GetFreeSpaceForItemInBag(itemId) >= count;
|
||||
}
|
||||
|
||||
u32 GetFreeSpaceForItemInBag(u16 itemId)
|
||||
{
|
||||
u8 i;
|
||||
u8 pocket = ItemId_GetPocket(itemId) - 1;
|
||||
u16 ownedCount;
|
||||
u32 spaceForItem = 0;
|
||||
|
||||
if (ItemId_GetPocket(itemId) == POCKET_NONE)
|
||||
return 0;
|
||||
|
||||
// Check space in any existing item slots that already contain this item
|
||||
for (i = 0; i < gBagPockets[pocket].capacity; i++)
|
||||
{
|
||||
if (gBagPockets[pocket].itemSlots[i].itemId == itemId)
|
||||
{
|
||||
ownedCount = GetBagItemQuantity(&gBagPockets[pocket].itemSlots[i].quantity);
|
||||
if (ownedCount + count <= MAX_BAG_ITEM_CAPACITY)
|
||||
return TRUE;
|
||||
if (pocket == TMHM_POCKET || pocket == BERRIES_POCKET)
|
||||
return FALSE;
|
||||
count -= (MAX_BAG_ITEM_CAPACITY - ownedCount);
|
||||
if (count == 0)
|
||||
break; //should be return TRUE, but that doesn't match
|
||||
spaceForItem += max(0, MAX_BAG_ITEM_CAPACITY - ownedCount);
|
||||
}
|
||||
}
|
||||
|
||||
// Check space in empty item slots
|
||||
if (count > 0)
|
||||
{
|
||||
for (i = 0; i < gBagPockets[pocket].capacity; i++)
|
||||
else if (gBagPockets[pocket].itemSlots[i].itemId == ITEM_NONE)
|
||||
{
|
||||
if (gBagPockets[pocket].itemSlots[i].itemId == 0)
|
||||
{
|
||||
if (count > MAX_BAG_ITEM_CAPACITY)
|
||||
{
|
||||
if (pocket == TMHM_POCKET || pocket == BERRIES_POCKET)
|
||||
return FALSE;
|
||||
count -= MAX_BAG_ITEM_CAPACITY;
|
||||
}
|
||||
else
|
||||
{
|
||||
count = 0; //should be return TRUE, but that doesn't match
|
||||
break;
|
||||
}
|
||||
}
|
||||
spaceForItem += MAX_BAG_ITEM_CAPACITY;
|
||||
}
|
||||
if (count > 0)
|
||||
return FALSE; // No more item slots. The bag is full
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return spaceForItem;
|
||||
}
|
||||
|
||||
bool8 AddBagItem(u16 itemId, u16 count)
|
||||
|
||||
@ -24,7 +24,7 @@ s32 AgbRFU_checkID(u8 maxTries)
|
||||
{
|
||||
u16 ieBak;
|
||||
vu16 *regTMCNTL;
|
||||
s32 id;
|
||||
s32 id = 0;
|
||||
|
||||
// Interrupts must be enabled
|
||||
if (REG_IME == 0)
|
||||
|
||||
35
src/main.c
35
src/main.c
@ -61,8 +61,6 @@ const IntrFunc gIntrTableTemplate[] =
|
||||
|
||||
#define INTR_COUNT ((int)(sizeof(gIntrTableTemplate)/sizeof(IntrFunc)))
|
||||
|
||||
static u16 sUnusedVar; // Never read
|
||||
|
||||
u16 gKeyRepeatStartDelay;
|
||||
bool8 gLinkTransferringData;
|
||||
struct Main gMain;
|
||||
@ -126,7 +124,6 @@ void AgbMain()
|
||||
SetMainCallback2(NULL);
|
||||
|
||||
gLinkTransferringData = FALSE;
|
||||
sUnusedVar = 0xFC0;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT)
|
||||
@ -215,15 +212,37 @@ void SetMainCallback2(MainCallback callback)
|
||||
|
||||
void StartTimer1(void)
|
||||
{
|
||||
REG_TM1CNT_H = 0x80;
|
||||
if (HQ_RANDOM)
|
||||
{
|
||||
REG_TM2CNT_L = 0;
|
||||
REG_TM2CNT_H = TIMER_ENABLE | TIMER_COUNTUP;
|
||||
}
|
||||
|
||||
REG_TM1CNT_H = TIMER_ENABLE;
|
||||
}
|
||||
|
||||
void SeedRngAndSetTrainerId(void)
|
||||
{
|
||||
u16 val = REG_TM1CNT_L;
|
||||
SeedRng(val);
|
||||
REG_TM1CNT_H = 0;
|
||||
sTrainerId = val;
|
||||
u32 val;
|
||||
|
||||
if (HQ_RANDOM)
|
||||
{
|
||||
REG_TM1CNT_H = 0;
|
||||
REG_TM2CNT_H = 0;
|
||||
val = ((u32)REG_TM2CNT_L) << 16;
|
||||
val |= REG_TM1CNT_L;
|
||||
SeedRng(val);
|
||||
sTrainerId = Random();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do it exactly like it was originally done, including not stopping
|
||||
// the timer beforehand.
|
||||
val = REG_TM1CNT_L;
|
||||
SeedRng((u16)val);
|
||||
REG_TM1CNT_H = 0;
|
||||
sTrainerId = val;
|
||||
}
|
||||
}
|
||||
|
||||
u16 GetGeneratedTrainerIdLower(void)
|
||||
|
||||
@ -777,7 +777,7 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
|
||||
return;
|
||||
}
|
||||
move = &gMovesInfo[chosenMove];
|
||||
str = gTypeNames[move->type];
|
||||
str = gTypesInfo[move->type].name;
|
||||
AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 4, 25, TEXT_SKIP_DRAW, NULL);
|
||||
|
||||
x = 4 + GetStringWidth(FONT_NORMAL, gText_MoveRelearnerPP, 0);
|
||||
|
||||
@ -545,7 +545,7 @@ static u8 FrameType_ProcessInput(u8 selection)
|
||||
|
||||
static void FrameType_DrawChoices(u8 selection)
|
||||
{
|
||||
u8 text[16];
|
||||
u8 text[16] = {EOS};
|
||||
u8 n = selection + 1;
|
||||
u16 i;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user