Merge branch '_RHH/master' into _RHH/upcoming

This commit is contained in:
Eduardo Quezada 2024-04-15 18:29:06 -04:00
commit 5a276dcbbf
31 changed files with 918 additions and 86 deletions

View File

@ -23,9 +23,10 @@ body:
label: Version
description: What version of pokeemerald-expansion are you using as a base?
options:
- 1.8.1 (Latest release)
- 1.8.2 (Latest release)
- master (default, unreleased bugfixes)
- upcoming (Edge)
- 1.8.1
- 1.8.0
- 1.7.4
- 1.7.3

View File

@ -23,9 +23,10 @@ body:
label: Version
description: What version of pokeemerald-expansion are you using as a base?
options:
- 1.8.1 (Latest release)
- 1.8.2 (Latest release)
- master (default, unreleased bugfixes)
- upcoming (Edge)
- 1.8.1
- 1.8.0
- 1.7.4
- 1.7.3

View File

@ -23,9 +23,10 @@ body:
label: Version
description: What version of pokeemerald-expansion are you using as a base?
options:
- 1.8.1 (Latest release)
- 1.8.2 (Latest release)
- master (default, unreleased bugfixes)
- upcoming (Edge)
- 1.8.1
- 1.8.0
- 1.7.4
- 1.7.3

View File

@ -1,6 +1,7 @@
# Pokeemerald-Expansion Changelogs
## 1.8.x
- ### [Version 1.8.2](docs/changelogs/1.8.2.md) - Bugfix Release 🧹
- ### [Version 1.8.1](docs/changelogs/1.8.1.md) - HOTFIX Release 🔥
- ### [Version 1.8.0](docs/changelogs/1.8.0.md) - Feature Release ✨

View File

@ -140,6 +140,7 @@ Based off RHH's pokeemerald-expansion v1.8.0 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
- [Saveblock Cleansing](https://github.com/ghoulslash/pokeemerald/tree/saveblock) by @ghoulslash
- ***Other features***
- Pressing B while holding a Pokémon drops them like in modern games (configurable).
- Running indoors (configurable).
@ -166,7 +167,14 @@ 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.8.1`.
- Check your current version.
- You can check in the debug menu's `Utilities -> Expansion Version` option.
- If the option is not available, you possibly have version 1.6.2 or older. In that case, please check the [changelogs](CHANGELOG.md) to determine your version based on the features available on your repository.
- Once you have your remote set up, run the command `git pull RHH expansion/X.Y.Z`, replacing X, Y and Z with the digits of the respective version you want to update to (eg, to update to 1.8.2, use `git pull RHH expansion/1.8.2`).
- ***Important:*** If you are several versions behind, we recommend updating one minor version at a time, skipping directly to the latest patch version (eg, 1.5.3 -> 1.6.2 -> 1.7.4 and so on)
- Alternatively, you can update to unreleased versions of the expansion.
- ***master (stable):*** It contains unreleased **bugfixes** that will come in the next patch version. To merge, use `git pull RHH master`.
- ***upcoming (unstable, with potential bugs):*** It contains unreleased **features** that will come in the next minor version. To merge, use `git pull RHH upcoming`.
### 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 :)

View File

@ -579,6 +579,7 @@ gStdScripts_End::
.include "data/scripts/new_game.inc"
.include "data/scripts/hall_of_fame.inc"
.include "data/scripts/config.inc"
.include "data/scripts/debug.inc"
EventScript_WhiteOut::

12
data/scripts/config.inc Normal file
View File

@ -0,0 +1,12 @@
Debug_FlagsAndVarNotSetBattleConfigMessage::
lockall
message Debug_FlagsAndVarNotSetBattleConfigMessage_Text
waitmessage
waitbuttonpress
releaseall
end
Debug_FlagsAndVarNotSetBattleConfigMessage_Text:
.string "Feature unavailable! Please define a\n"
.string "usable flag and a usable var in:\l"
.string "'include/config/battle.h'!$"

View File

@ -281,21 +281,6 @@ DebugText_BerryWeedsDisabled:
.string "OW_BERRY_WEEDS is disabled.\n"
.string "Unable to force weeds onto berry trees.$"
.endif
Debug_FlagsAndVarNotSetBattleConfigMessage::
lockall
message Debug_FlagsAndVarNotSetBattleConfigMessage_Text
waitmessage
waitbuttonpress
releaseall
end
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
@ -445,3 +430,5 @@ Debug_EventScript_InflictStatus1_Text_Freeze:
Debug_EventScript_InflictStatus1_Text_Frostbite:
.string "Frostbite$"
.endif

View File

@ -312,7 +312,7 @@
* 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
### ***Incorporated @ghoulslash's Saveblock Cleansing 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.

144
docs/changelogs/1.8.2.md Normal file
View File

@ -0,0 +1,144 @@
# Version 1.8.2
```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.2`.
```
## 🌋 Important changes 🌋
* ***Added check during compilation to make sure that the code is inside a git directory before building*** by @SBird1337 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4363
* *If you downloaded the code using the "Download ZIP" option on GitHub, you will not be able to update your expansion version or merge any other feature brances, which is why we added this check to make sure that users don't fall into this trap.*
## 💥 *Softlock/Crash fixes* 💥
* Fixed Battle Pyramid freeze when `BATTLE_PYRAMID_RANDOM_ENCOUNTERS` is set to `TRUE` by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4326
* Fixed switch-in AI infinite loop when calculating amount of hits to faint the opponent by @Pawkkie and @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4338
* Fixed softlock with weather-triggered form changes and Cloud Nine by @skolgrahd in https://github.com/rh-hideout/pokeemerald-expansion/pull/4382
* Fixes Eject Pack softlock when there are no other party members left to switch to by @skolgrahd and @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4387
## 🧬 General 🧬
### Changed
* Changed Frostbite's abbreviation from `FSB` to `FRB` by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4355
### Fixed
* Fixed `BATTLE_PYRAMID_RANDOM_ENCOUNTERS` not including species past `FORMS_START`, including Gen 9 Pokémon by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4326
* Fixed potential compile issue that occurs when `gba/types.h` is included before `gba/defines.h` by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/4364
* Fixed `givemon` setting every move despite only specifying a couple by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4377
* Level up moves will be used when no move is specified.
* Rewrite `GiveBoxMonInitialMoveset_Fast` to match `GiveBoxMonInitialMoveset` results (but still faster) by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4373
* Fixed Teachable Learnset helper crashing in some environments by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4389
## ✨ Feature Branches ✨
### ***TheXaman's Debug Menu***:
#### Fixed
* Fixed compile issue when disabling Debug Menu by @damon-murdoch in https://github.com/rh-hideout/pokeemerald-expansion/pull/4372
### ***TheXaman's HGSS Pokédex Plus***:
#### Changed
* Male icons and front pics are now the default by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4390
#### Fixed
* Fixed showing graphical errors for icons by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4390
* Fixed disabled forms appearing in form list by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4395
## 🐉 Pokémon 🐉
### Added
* Added missing Pecharunt sprite [from PokéCommunity](https://www.pokecommunity.com/threads/ds-style-gen-vii-and-beyond-pok%C3%A9mon-sprite-repository-in-64x64.368703/post-10814369) by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4324
* Added missing icons for multiple Pokémon by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4290
* Archaludon
* Partner Eevee
* Gouging Fire
* Iron Boulder
* Iron Crown
* Cornerstone Ogerpon
* Hearthflame Ogerpon
* Wellspring Ogerpon
* Pecharunt
* Partner Pikachu
* Raging Bolt
* Terapagos (all forms)
* Bloodmoon Ursaluna
### Changed
* Updated almost all Gen 9 icon sprites to cleaner ones by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4290
* Original Source (there were some tweaks): https://www.deviantart.com/ezerart/art/Pokemon-Gen-9-Icon-sprites-3DS-Style-944211258
* GBA Pal sprites source: https://whackahack.com/foro/threads/9-gen-sprites.67492/page-46#post-493662
* Further tweaks were made after that.
### Fixed
* Fixed Gengar's missing cries by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4385
* Fixed silent Klefki cry by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4392
## ⚔️ Battle General ⚔️ ##
### Fixed
* Level Cap issues
* Fixed Soft Level Caps not properly working by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4327
* Fixed issue that caused Level Caps to give 0 Exp when below the cap and `B_LEVEL_CAP_EXP_UP` set to `FALSE` by @ravepossum in https://github.com/rh-hideout/pokeemerald-expansion/pull/4305
* Fixed graphical bug in Battle Arena windows by @Bassoonian and @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4307
* Fixed Totem Boosts not triggering by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4328
* Fixed Trainer Slide message for Low HP appearing when the HP was above 25% HP instead of below by @MelonSpeedruns and @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4353
* Fixed Pokémon Mega Evolving/Gigantamaxing/Fusing into `SPECIES_NONE` when the respective form toggles are set to `FALSE` by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4395
## 🤹 Moves 🤹
### Fixed
* Fixed Z-Mirror Move's base power being set to 0 instead of the mirrored move's base power by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4308
* Fixed Searing Sunraze Smash, Menacing Moonraze Maelstrom and Light That Burns The Sky not bypassing abilities by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4360
* Fixed multiple Future Sight issues by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4350
* Fixed Future Sight using the active Pokémon's stats if the original user switches out.
* Fixed Future Sight not being boosted by the user's item when the user is active when the move hits.
* Fixed Future Sight not failing when the target of the attack faints before it hits.
* Fixed Belch not being usable even if a berry was eating via Stuff Cheeks by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4376
## 🎭 Abilities 🎭
### Added
* Added missing Disguise Gen8+ HP loss behavior by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4360
### Fixed
* Fixed No Guard checking the wrong battler by @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/4320
* Fixed Intimidate's ability pop up appearing even when `B_ABILITY_POP_UP` is set to `FALSE` by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4339
* Fixed Guts preventing Frostbite's Sp. Attack reduction by @Sneed69 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4351
* Fixed Iron Barbs/Rough Skin and confusion self-damage breaking Disguise by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4360
* Fixed Gulp Missile not changing Cramorant's form when Dive is triggered in a single turn using Power Herb by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4371
* Fixed Cud Chew showing its ability pop up but not triggering its berry again by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4379
* Fixed Ability flags by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4381
* Gulp Missle can't be copied.
* Commander can't be supressed.
## 🧶 Items 🧶
### Fixed
* Fixed multiple White Herb Known issues by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4258
* Fixed White Herb not activating after Intimidade.
* Fixed White Herb not activating after all hits of a multi-hit move.
* Fixed White Herb activating when Knocked Off on the same turn as the lowering of the stat (eg. via Weak Armor)
* Fixed White Herb activating even if Magician steals it
* Fixed White Herb activating before Defiant and Competitive.
* Fixed Protective Pads ignoring Fluffy by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4340
* Fixed Ability Shield not preventing Neutralizing Gas from supressing the holder's ability by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4391
## 🤖 Battle AI 🤖
### Fixed
* Fixed AI not considering Earth Eater by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4352
* Fixed AI not considering Memento an effect that reduces stats by adding it to `IsStatLoweringEffect` by @PCG06 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4386
## 🧹 Other Cleanup 🧹
### Added
* Clarify in `README.md` to not use the "Download ZIP" option by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4336
### Fixed
* Fixed formatting of plate items in type table by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4318
* Fixed style of some bit definitions by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4319
## 🧪 Test Runner 🧪
### Added
* Added missing Defiant tests by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4331
* Added missing parametrized Gastro Acid tests by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4381
* Added missing parametrized Role Play tests by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4381
## 📦 Pret merges 📦
* Pret merge (2024/03/24) by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4304
* Simplify weirdly matching division/substraction code by @DizzyEggg in https://github.com/pret/pokeemerald/pull/1982
* Document camera sprite functions by @GriffinRichards in https://github.com/pret/pokeemerald/pull/1961
* Renamed "fateful encounter" commands for consistency reasons by @LOuroboros in https://github.com/pret/pokeemerald/pull/1983
* Mid-April pret merge (2024/04/12) by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4380
* Incorporated @ghoulslash's [Surfing Dismount graphical fix](https://github.com/pret/pokeemerald/wiki/Surfing-Dismount-Ground-Effects) by @pkmnsnfrn in https://github.com/pret/pokeemerald/pull/1985
* Updated value of `gMain.inBattle` at `OpponentHandleEndLinkBattle` by @LOuroboros in https://github.com/pret/pokeemerald/pull/1986
* Added fix to Keep the Camera from Making Waves by @pkmnsnfrn in https://github.com/pret/pokeemerald/pull/1987
## New Contributors
* @skolgrahd made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4382
**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.8.1...expansion/1.8.2
<!--Last PR: 4372-->

View File

@ -9,6 +9,9 @@
## 🌋 *IMPORTANT CHANGES* 🌋
* We deleted the whole repo LOL by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3367
## 💥 *Softlock/Crash fixes* 💥
* N/A
## 🧬 General 🧬
### Added
* N/A
@ -18,11 +21,33 @@
* N/A
## ✨ Feature Branches ✨
### Added
### ***TheXaman's Debug Menu***:
#### Added
* N/A
### Changed
#### Changed
* N/A
### Fixed
#### Fixed
* N/A
### ***TheXaman's HGSS Pokédex Plus***:
#### Added
* N/A
#### Changed
* N/A
#### Fixed
* N/A
### ***SBird/Karathan's Dynamic Multichoices***:
#### Added
* N/A
#### Changed
* N/A
#### Fixed
* N/A
### ***ghoulslash's Saveblock Cleansing***:
#### Added
* N/A
#### Changed
* N/A
#### Fixed
* N/A
## 🐉 Pokémon 🐉

View File

@ -165,6 +165,8 @@ u32 SetRandomTarget(u32 battler);
u32 GetMoveTarget(u16 move, u8 setTarget);
u8 IsMonDisobedient(void);
u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating);
u32 GetBattlerHoldEffectIgnoreAbility(u32 battler, bool32 checkNegating);
u32 GetBattlerHoldEffectInternal(u32 battler, bool32 checkNegating, bool32 checkAbility);
u32 GetBattlerHoldEffectParam(u32 battler);
bool32 IsMoveMakingContact(u32 move, u32 battlerAtk);
bool32 IsBattlerGrounded(u32 battler);

View File

@ -1,6 +1,9 @@
#ifndef GUARD_CONFIG_SPECIES_ENABLED_H
#define GUARD_CONFIG_SPECIES_ENABLED_H
// WARNING: For some reason, using 1/0 instead of TRUE/FALSE causes cry IDs to be shifted.
// Please use TRUE/FALSE when using the family toggles.
// Modifying the latest generation WILL change the saveblock due to Dex flags and will require a new save file.
// Generations of Pokémon are defined by the first member introduced,
// so Pikachu depends on the Gen 1 setting despite Pichu being the lowest member of the evolution tree.

View File

@ -1,10 +1,10 @@
#ifndef GUARD_CONSTANTS_EXPANSION_H
#define GUARD_CONSTANTS_EXPANSION_H
// 1.8.1
// 1.8.2
#define EXPANSION_VERSION_MAJOR 1
#define EXPANSION_VERSION_MINOR 8
#define EXPANSION_VERSION_PATCH 1
#define EXPANSION_VERSION_PATCH 2
// FALSE if this this version of Expansion is not a tagged commit, i.e.
// it contains unreleased changes.

View File

@ -1707,7 +1707,7 @@ gCryTable::
cry Cry_Goodra
.endif @ P_FAMILY_GOOMY
.if P_FAMILY_KLEFKI == TRUE
cry Cry_Klefki
cry_uncomp Cry_Klefki @ Cannot be heard unless we use cry_uncomp here.
.endif @ P_FAMILY_KLEFKI
.if P_FAMILY_PHANTUMP == TRUE
cry Cry_Phantump
@ -4133,7 +4133,7 @@ gCryTable_Reverse::
cry_reverse Cry_Goodra
.endif @ P_FAMILY_GOOMY
.if P_FAMILY_KLEFKI == TRUE
cry_reverse Cry_Klefki
cry_reverse_uncomp Cry_Klefki @ Cannot be heard unless we use cry_reverse_uncomp here.
.endif @ P_FAMILY_KLEFKI
.if P_FAMILY_PHANTUMP == TRUE
cry_reverse Cry_Phantump

View File

@ -2049,6 +2049,7 @@ bool32 IsStatLoweringEffect(u32 effect)
case EFFECT_TICKLE:
case EFFECT_CAPTIVATE:
case EFFECT_NOBLE_ROAR:
case EFFECT_MEMENTO:
return TRUE;
default:
return FALSE;

View File

@ -6142,7 +6142,9 @@ u32 GetBattlerAbility(u32 battler)
if (gStatuses3[battler] & STATUS3_GASTRO_ACID)
return ABILITY_NONE;
if (IsNeutralizingGasOnField() && gBattleMons[battler].ability != ABILITY_NEUTRALIZING_GAS)
if (IsNeutralizingGasOnField()
&& gBattleMons[battler].ability != ABILITY_NEUTRALIZING_GAS
&& GetBattlerHoldEffectIgnoreAbility(battler, TRUE) != HOLD_EFFECT_ABILITY_SHIELD)
return ABILITY_NONE;
if (IsMyceliumMightOnField())
@ -7260,6 +7262,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
case HOLD_EFFECT_EJECT_PACK:
if (gProtectStructs[battler].statFell
&& gProtectStructs[battler].disableEjectPack == 0
&& CountUsablePartyMons(battler) > 0
&& !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker))) // Does not activate if attacker used Parting Shot and can switch out
{
gProtectStructs[battler].statFell = FALSE;
@ -8188,6 +8191,16 @@ u8 IsMonDisobedient(void)
}
u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating)
{
return GetBattlerHoldEffectInternal(battler, checkNegating, TRUE);
}
u32 GetBattlerHoldEffectIgnoreAbility(u32 battler, bool32 checkNegating)
{
return GetBattlerHoldEffectInternal(battler, checkNegating, FALSE);
}
u32 GetBattlerHoldEffectInternal(u32 battler, bool32 checkNegating, bool32 checkAbility)
{
if (checkNegating)
{
@ -8195,7 +8208,7 @@ u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating)
return HOLD_EFFECT_NONE;
if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM)
return HOLD_EFFECT_NONE;
if (GetBattlerAbility(battler) == ABILITY_KLUTZ)
if (checkAbility && GetBattlerAbility(battler) == ABILITY_KLUTZ)
return HOLD_EFFECT_NONE;
}
@ -10486,7 +10499,8 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method)
targetSpecies = formChanges[i].targetSpecies;
}
// Otherwise, just check for a match between the weather and the form change table.
else if (gBattleWeather & formChanges[i].param1
// Added a check for whether the weather is in effect to prevent end-of-turn soft locks with Cloud Nine / Air Lock
else if (((gBattleWeather & formChanges[i].param1) && WEATHER_HAS_EFFECT)
|| (gBattleWeather == B_WEATHER_NONE && formChanges[i].param1 == B_WEATHER_NONE))
{
targetSpecies = formChanges[i].targetSpecies;

View File

@ -1902,6 +1902,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] =
.name = _("Gulp Missile"),
.description = COMPOUND_STRING("If hit, spits prey from sea."),
.aiRating = 3,
.cantBeCopied = TRUE,
.cantBeSuppressed = TRUE,
.cantBeOverwritten = TRUE,
.failsOnImposter = TRUE,
@ -2265,6 +2266,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] =
.cantBeCopied = TRUE,
.cantBeSwapped = TRUE,
.cantBeTraced = TRUE,
.cantBeSuppressed = TRUE,
},
[ABILITY_ELECTROMORPHOSIS] =

View File

@ -1,5 +1,6 @@
const struct Fusion *const gFusionTablePointers[NUM_SPECIES] =
{
#if P_FUSION_FORMS
#if P_FAMILY_KYUREM
[SPECIES_KYUREM] = sKyuremFusionTable,
#if P_FAMILY_RESHIRAM
@ -31,4 +32,5 @@ const struct Fusion *const gFusionTablePointers[NUM_SPECIES] =
[SPECIES_GLASTRIER] = sCalyrexFusionTable,
#endif //P_FAMILY_GLASTRIER
#endif //P_FAMILY_CALYREX
#endif //P_FUSION_FORMS
};

View File

@ -1,24 +1,36 @@
#if P_FAMILY_BULBASAUR
static const struct FormChange sVenusaurFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_VENUSAUR_MEGA, ITEM_VENUSAURITE},
#endif
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_VENUSAUR_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_BULBASAUR
#if P_FAMILY_CHARMANDER
static const struct FormChange sCharizardFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_X, ITEM_CHARIZARDITE_X},
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_Y, ITEM_CHARIZARDITE_Y},
#endif
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CHARIZARD_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_CHARMANDER
#if P_FAMILY_SQUIRTLE
static const struct FormChange sBlastoiseFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLASTOISE_MEGA, ITEM_BLASTOISINITE},
#endif
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_BLASTOISE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SQUIRTLE
@ -26,21 +38,27 @@ static const struct FormChange sBlastoiseFormChangeTable[] = {
#if P_FAMILY_CATERPIE
static const struct FormChange sButterfreeFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_BUTTERFREE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_CATERPIE
#if P_FAMILY_WEEDLE
static const struct FormChange sBeedrillFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BEEDRILL_MEGA, ITEM_BEEDRILLITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_WEEDLE
#if P_FAMILY_PIDGEY
static const struct FormChange sPidgeotFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PIDGEOT_MEGA, ITEM_PIDGEOTITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_PIDGEY
@ -48,7 +66,9 @@ static const struct FormChange sPidgeotFormChangeTable[] = {
#if P_FAMILY_PIKACHU
static const struct FormChange sPikachuFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_PIKACHU_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_PIKACHU
@ -56,14 +76,18 @@ static const struct FormChange sPikachuFormChangeTable[] =
#if P_FAMILY_MEOWTH
static const struct FormChange sMeowthFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_MEOWTH_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MEOWTH
#if P_FAMILY_ABRA
static const struct FormChange sAlakazamFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALAKAZAM_MEGA, ITEM_ALAKAZITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_ABRA
@ -71,22 +95,30 @@ static const struct FormChange sAlakazamFormChangeTable[] = {
#if P_FAMILY_MACHOP
static const struct FormChange sMachampFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_MACHAMP_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MACHOP
#if P_FAMILY_SLOWPOKE
static const struct FormChange sSlowbroFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SLOWBRO_MEGA, ITEM_SLOWBRONITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SLOWPOKE
#if P_FAMILY_GASTLY
static const struct FormChange sGengarFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GENGAR_MEGA, ITEM_GENGARITE},
#endif
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_GENGAR_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_GASTLY
@ -94,7 +126,9 @@ static const struct FormChange sGengarFormChangeTable[] = {
#if P_FAMILY_ONIX
#if P_GEN_2_CROSS_EVOS
static const struct FormChange sSteelixFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_STEELIX_MEGA, ITEM_STEELIXITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_GEN_2_CROSS_EVOS
@ -103,14 +137,18 @@ static const struct FormChange sSteelixFormChangeTable[] = {
#if P_FAMILY_KRABBY
static const struct FormChange sKinglerFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_KINGLER_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_KRABBY
#if P_FAMILY_KANGASKHAN
static const struct FormChange sKangaskhanFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_KANGASKHAN_MEGA, ITEM_KANGASKHANITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_KANGASKHAN
@ -118,7 +156,9 @@ static const struct FormChange sKangaskhanFormChangeTable[] = {
#if P_FAMILY_SCYTHER
#if P_GEN_2_CROSS_EVOS
static const struct FormChange sScizorFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCIZOR_MEGA, ITEM_SCIZORITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_GEN_2_CROSS_EVOS
@ -126,112 +166,144 @@ static const struct FormChange sScizorFormChangeTable[] = {
#if P_FAMILY_PINSIR
static const struct FormChange sPinsirFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PINSIR_MEGA, ITEM_PINSIRITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_PINSIR
#if P_FAMILY_MAGIKARP
static const struct FormChange sGyaradosFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GYARADOS_MEGA, ITEM_GYARADOSITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MAGIKARP
#if P_FAMILY_LAPRAS
static const struct FormChange sLaprasFormChangeTable[] = {
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_LAPRAS_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_LAPRAS
#if P_FAMILY_EEVEE
static const struct FormChange sEeveeFormChangeTable[] = {
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_EEVEE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_EEVEE
#if P_FAMILY_AERODACTYL
static const struct FormChange sAerodactylFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AERODACTYL_MEGA, ITEM_AERODACTYLITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_AERODACTYL
#if P_FAMILY_SNORLAX
static const struct FormChange sSnorlaxFormChangeTable[] = {
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_SNORLAX_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SNORLAX
#if P_FAMILY_MEWTWO
static const struct FormChange sMewtwoFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_X, ITEM_MEWTWONITE_X},
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_Y, ITEM_MEWTWONITE_Y},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MEWTWO
#if P_FAMILY_MAREEP
static const struct FormChange sAmpharosFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AMPHAROS_MEGA, ITEM_AMPHAROSITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MAREEP
#if P_FAMILY_HERACROSS
static const struct FormChange sHeracrossFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HERACROSS_MEGA, ITEM_HERACRONITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_HERACROSS
#if P_FAMILY_HOUNDOUR
static const struct FormChange sHoundoomFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HOUNDOOM_MEGA, ITEM_HOUNDOOMINITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_HOUNDOUR
#if P_FAMILY_LARVITAR
static const struct FormChange sTyranitarFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_TYRANITAR_MEGA, ITEM_TYRANITARITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_LARVITAR
#if P_FAMILY_TREECKO
static const struct FormChange sSceptileFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCEPTILE_MEGA, ITEM_SCEPTILITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_TREECKO
#if P_FAMILY_TORCHIC
static const struct FormChange sBlazikenFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLAZIKEN_MEGA, ITEM_BLAZIKENITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_TORCHIC
#if P_FAMILY_MUDKIP
static const struct FormChange sSwampertFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SWAMPERT_MEGA, ITEM_SWAMPERTITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MUDKIP
#if P_FAMILY_RALTS
static const struct FormChange sGardevoirFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARDEVOIR_MEGA, ITEM_GARDEVOIRITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#if P_GEN_4_CROSS_EVOS
static const struct FormChange sGalladeFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GALLADE_MEGA, ITEM_GALLADITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_GEN_4_CROSS_EVOS
@ -239,77 +311,99 @@ static const struct FormChange sGalladeFormChangeTable[] = {
#if P_FAMILY_SABLEYE
static const struct FormChange sSableyeFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SABLEYE_MEGA, ITEM_SABLENITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SABLEYE
#if P_FAMILY_MAWILE
static const struct FormChange sMawileFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MAWILE_MEGA, ITEM_MAWILITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MAWILE
#if P_FAMILY_ARON
static const struct FormChange sAggronFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AGGRON_MEGA, ITEM_AGGRONITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_ARON
#if P_FAMILY_MEDITITE
static const struct FormChange sMedichamFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEDICHAM_MEGA, ITEM_MEDICHAMITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MEDITITE
#if P_FAMILY_ELECTRIKE
static const struct FormChange sManectricFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MANECTRIC_MEGA, ITEM_MANECTITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_ELECTRIKE
#if P_FAMILY_CARVANHA
static const struct FormChange sSharpedoFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SHARPEDO_MEGA, ITEM_SHARPEDONITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_CARVANHA
#if P_FAMILY_NUMEL
static const struct FormChange sCameruptFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CAMERUPT_MEGA, ITEM_CAMERUPTITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_NUMEL
#if P_FAMILY_SWABLU
static const struct FormChange sAltariaFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALTARIA_MEGA, ITEM_ALTARIANITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SWABLU
#if P_FAMILY_SHUPPET
static const struct FormChange sBanetteFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BANETTE_MEGA, ITEM_BANETTITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SHUPPET
#if P_FAMILY_ABSOL
static const struct FormChange sAbsolFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABSOL_MEGA, ITEM_ABSOLITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_ABSOL
#if P_FAMILY_SNORUNT
static const struct FormChange sGlalieFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GLALIE_MEGA, ITEM_GLALITITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SNORUNT
@ -338,49 +432,63 @@ static const struct FormChange sCastformFormChangeTable[] = {
#if P_FAMILY_BAGON
static const struct FormChange sSalamenceFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SALAMENCE_MEGA, ITEM_SALAMENCITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_BAGON
#if P_FAMILY_BELDUM
static const struct FormChange sMetagrossFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_METAGROSS_MEGA, ITEM_METAGROSSITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_BELDUM
#if P_FAMILY_LATIAS
static const struct FormChange sLatiasFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIAS_MEGA, ITEM_LATIASITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_LATIAS
#if P_FAMILY_LATIOS
static const struct FormChange sLatiosFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIOS_MEGA, ITEM_LATIOSITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_LATIOS
#if P_FAMILY_KYOGRE
static const struct FormChange sKyogreFormChangeTable[] = {
#if P_PRIMAL_REVERSIONS
{FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_KYOGRE_PRIMAL, ITEM_BLUE_ORB},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_KYOGRE
#if P_FAMILY_GROUDON
static const struct FormChange sGroudonFormChangeTable[] = {
#if P_PRIMAL_REVERSIONS
{FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_GROUDON_PRIMAL, ITEM_RED_ORB},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_GROUDON
#if P_FAMILY_RAYQUAZA
static const struct FormChange sRayquazaFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE, SPECIES_RAYQUAZA_MEGA, MOVE_DRAGON_ASCENT},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_RAYQUAZA
@ -441,28 +549,36 @@ static const struct FormChange sCherrimFormChangeTable[] = {
#if P_FAMILY_BUNEARY
static const struct FormChange sLopunnyFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LOPUNNY_MEGA, ITEM_LOPUNNITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_BUNEARY
#if P_FAMILY_GIBLE
static const struct FormChange sGarchompFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARCHOMP_MEGA, ITEM_GARCHOMPITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_GIBLE
#if P_FAMILY_RIOLU
static const struct FormChange sLucarioFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LUCARIO_MEGA, ITEM_LUCARIONITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_RIOLU
#if P_FAMILY_SNOVER
static const struct FormChange sAbomasnowFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABOMASNOW_MEGA, ITEM_ABOMASITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SNOVER
@ -559,7 +675,9 @@ static const struct FormChange sArceusFormChangeTable[] = {
#if P_FAMILY_AUDINO
static const struct FormChange sAudinoFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AUDINO_MEGA, ITEM_AUDINITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_AUDINO
@ -587,7 +705,9 @@ static const struct FormChange sDarmanitanGalarianFormChangeTable[] = {
#if P_FAMILY_TRUBBISH
static const struct FormChange sGarbodorFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_GARBODOR_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_TRUBBISH
@ -712,7 +832,9 @@ static const struct FormChange sZygardeCompleteFormChangeTable[] = {
#if P_FAMILY_DIANCIE
static const struct FormChange sDiancieFormChangeTable[] = {
#if P_MEGA_EVOLUTIONS
{FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_DIANCIE_MEGA, ITEM_DIANCITE},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_DIANCIE
@ -851,11 +973,15 @@ static const struct Fusion sNecrozmaFusionTable[] = {
};
static const struct FormChange sNecrozmaDuskManeFormChangeTable[] = {
#if P_ULTRA_BURST_FORMS
{FORM_CHANGE_BATTLE_ULTRA_BURST, SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z},
#endif
{FORM_CHANGE_TERMINATOR},
};
static const struct FormChange sNecrozmaDawnWingsFormChangeTable[] = {
#if P_ULTRA_BURST_FORMS
{FORM_CHANGE_BATTLE_ULTRA_BURST, SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_NECROZMA
@ -863,7 +989,9 @@ static const struct FormChange sNecrozmaDawnWingsFormChangeTable[] = {
#if P_FAMILY_MELTAN
static const struct FormChange sMelmetalFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_MELMETAL_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MELTAN
@ -871,7 +999,9 @@ static const struct FormChange sMelmetalFormChangeTable[] =
#if P_FAMILY_GROOKEY
static const struct FormChange sRillaboomFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_RILLABOOM_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_GROOKEY
@ -879,7 +1009,9 @@ static const struct FormChange sRillaboomFormChangeTable[] =
#if P_FAMILY_SCORBUNNY
static const struct FormChange sCinderaceFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CINDERACE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SCORBUNNY
@ -887,7 +1019,9 @@ static const struct FormChange sCinderaceFormChangeTable[] =
#if P_FAMILY_SOBBLE
static const struct FormChange sInteleonFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_INTELEON_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SOBBLE
@ -895,7 +1029,9 @@ static const struct FormChange sInteleonFormChangeTable[] =
#if P_FAMILY_ROOKIDEE
static const struct FormChange sCorviknightFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CORVIKNIGHT_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_ROOKIDEE
@ -903,7 +1039,9 @@ static const struct FormChange sCorviknightFormChangeTable[] =
#if P_FAMILY_BLIPBUG
static const struct FormChange sOrbeetleFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_ORBEETLE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_BLIPBUG
@ -911,7 +1049,9 @@ static const struct FormChange sOrbeetleFormChangeTable[] =
#if P_FAMILY_CHEWTLE
static const struct FormChange sDrednawFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_DREDNAW_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_CHEWTLE
@ -919,7 +1059,9 @@ static const struct FormChange sDrednawFormChangeTable[] =
#if P_FAMILY_ROLYCOLY
static const struct FormChange sCoalossalFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_COALOSSAL_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_ROLYCOLY
@ -927,13 +1069,17 @@ static const struct FormChange sCoalossalFormChangeTable[] =
#if P_FAMILY_APPLIN
static const struct FormChange sFlappleFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_FLAPPLE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
static const struct FormChange sAppletunFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_APPLETUN_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_APPLIN
@ -941,7 +1087,9 @@ static const struct FormChange sAppletunFormChangeTable[] =
#if P_FAMILY_SILICOBRA
static const struct FormChange sSandacondaFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_SANDACONDA_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SILICOBRA
@ -960,13 +1108,17 @@ static const struct FormChange sCramorantFormChangeTable[] = {
#if P_FAMILY_TOXEL
static const struct FormChange sToxtricityAmpedFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_TOXTRICITY_AMPED_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
static const struct FormChange sToxtricityLowKeyFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_TOXTRICITY_LOW_KEY_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_TOXEL
@ -974,7 +1126,9 @@ static const struct FormChange sToxtricityLowKeyFormChangeTable[] =
#if P_FAMILY_SIZZLIPEDE
static const struct FormChange sCentiskorchFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_CENTISKORCH_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_SIZZLIPEDE
@ -982,7 +1136,9 @@ static const struct FormChange sCentiskorchFormChangeTable[] =
#if P_FAMILY_HATENNA
static const struct FormChange sHattereneFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_HATTERENE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_HATENNA
@ -990,7 +1146,9 @@ static const struct FormChange sHattereneFormChangeTable[] =
#if P_FAMILY_IMPIDIMP
static const struct FormChange sGrimmsnarlFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_GRIMMSNARL_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_IMPIDIMP
@ -998,7 +1156,9 @@ static const struct FormChange sGrimmsnarlFormChangeTable[] =
#if P_FAMILY_MILCERY
static const struct FormChange sAlcremieFormChangeTable[] =
{
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_ALCREMIE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_MILCERY
@ -1024,14 +1184,18 @@ static const struct FormChange sMorpekoFormChangeTable[] = {
#if P_FAMILY_CUFANT
static const struct FormChange sCopperajahFormChangeTable[] = {
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_COPPERAJAH_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_CUFANT
#if P_FAMILY_DURALUDON
static const struct FormChange sDuraludonFormChangeTable[] = {
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_DURALUDON_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_DURALUDON
@ -1054,12 +1218,16 @@ static const struct FormChange sZamazentaFormChangeTable[] = {
#if P_FAMILY_KUBFU
static const struct FormChange sUrshifuSingleStrikeFormChangeTable[] = {
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_URSHIFU_SINGLE_STRIKE_STYLE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
static const struct FormChange sUrshifuRapidStrikeFormChangeTable[] = {
#if P_GIGANTAMAX_FORMS
{FORM_CHANGE_BATTLE_GIGANTAMAX, SPECIES_URSHIFU_RAPID_STRIKE_STYLE_GIGANTAMAX},
#endif
{FORM_CHANGE_TERMINATOR},
};
#endif //P_FAMILY_KUBFU
@ -1101,7 +1269,9 @@ static const struct FormChange sOgerponFormChangeTable[] = {
#if P_FAMILY_TERAPAGOS
static const struct FormChange sTerapagosFormChangeTable[] = {
{FORM_CHANGE_BEGIN_BATTLE, SPECIES_TERAPAGOS_TERASTAL}, //needs to be tied to the ability
#if P_TERA_FORMS
//{FORM_CHANGE_TERASTALLIZATION, SPECIES_TERAPAGOS_STELLAR},
#endif
{FORM_CHANGE_END_BATTLE, SPECIES_TERAPAGOS_NORMAL},
{FORM_CHANGE_TERMINATOR},
};

File diff suppressed because it is too large Load Diff

View File

@ -9259,6 +9259,7 @@ const struct SpeciesInfo gSpeciesInfoGen1[] =
.abilities = GENGAR_ABILITIES,
.bodyColor = BODY_COLOR_PURPLE,
.speciesName = _("Gengar"),
.cryId = CRY_GENGAR,
.natDexNum = NATIONAL_DEX_GENGAR,
.categoryName = _("Shadow"),
.height = 15,
@ -9313,6 +9314,7 @@ const struct SpeciesInfo gSpeciesInfoGen1[] =
.abilities = { ABILITY_SHADOW_TAG, ABILITY_SHADOW_TAG, ABILITY_SHADOW_TAG },
.bodyColor = BODY_COLOR_PURPLE,
.speciesName = _("Gengar"),
.cryId = CRY_GENGAR_MEGA,
.natDexNum = NATIONAL_DEX_GENGAR,
.categoryName = _("Shadow"),
.height = 14,
@ -9369,6 +9371,7 @@ const struct SpeciesInfo gSpeciesInfoGen1[] =
.abilities = GENGAR_ABILITIES,
.bodyColor = BODY_COLOR_PURPLE,
.speciesName = _("Gengar"),
.cryId = CRY_GENGAR,
.natDexNum = NATIONAL_DEX_GENGAR,
.categoryName = _("Shadow"),
.height = 200,

View File

@ -4549,6 +4549,8 @@ static u8 PrintCryScreenSpeciesName(u8 windowId, u16 num, u8 left, u8 top)
return i;
}
#define MALE_PERSONALITY 0xFE
// Unown and Spinda use the personality of the first seen individual of that species
// All others use personality 0
static u32 GetPokedexMonPersonality(u16 species)
@ -4562,7 +4564,7 @@ static u32 GetPokedexMonPersonality(u16 species)
}
else
{
return 0;
return MALE_PERSONALITY;
}
}
@ -4926,9 +4928,11 @@ static void Task_LoadStatsScreen(u8 taskId)
if (gTasks[taskId].data[1] == 0)
{
//Icon
u32 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
u32 personality = GetPokedexMonPersonality(species);
FreeMonIconPalettes(); //Free space for new pallete
LoadMonIconPalette(NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum)); //Loads pallete for current mon
gTasks[taskId].data[6] = CreateMonIcon(NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum), SpriteCB_MonIcon, 18, 31, 4, 0); //Create pokemon sprite
LoadMonIconPalettePersonality(species, personality); //Loads pallete for current mon
gTasks[taskId].data[6] = CreateMonIcon(species, SpriteCB_MonIcon, 18, 31, 4, personality); //Create pokemon sprite
gSprites[gTasks[taskId].data[4]].oam.priority = 0;
}
gMain.state++;
@ -6060,13 +6064,15 @@ static void Task_LoadEvolutionScreen(u8 taskId)
case 3:
if (gTasks[taskId].data[1] == 0)
{
u32 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
u32 personality = GetPokedexMonPersonality(species);
sPokedexView->selectedScreen = EVO_SCREEN;
ResetEvoScreenDataStruct();
//Icon
FreeMonIconPalettes(); //Free space for new pallete
LoadMonIconPalette(NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum)); //Loads pallete for current mon
PrintPreEvolutions(taskId, NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum));
gTasks[taskId].data[4] = CreateMonIcon(NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum), SpriteCB_MonIcon, 18 + 32*sPokedexView->numPreEvolutions, 31, 4, 0); //Create pokemon sprite
LoadMonIconPalettePersonality(species, personality); //Loads pallete for current mon
PrintPreEvolutions(taskId, species);
gTasks[taskId].data[4] = CreateMonIcon(species, SpriteCB_MonIcon, 18 + 32*sPokedexView->numPreEvolutions, 31, 4, personality); //Create pokemon sprite
EvoFormsPage_PrintNavigationButtons(); // Navigation buttons
gSprites[gTasks[taskId].data[4]].oam.priority = 0;
}
@ -6248,11 +6254,12 @@ static void HandleTargetSpeciesPrint(u8 taskId, u16 targetSpecies, u16 previousT
if (base_i < iterations)
{
LoadMonIconPalette(targetSpecies); //Loads pallete for current mon
u32 personality = GetPokedexMonPersonality(targetSpecies);
LoadMonIconPalettePersonality(targetSpecies, personality); //Loads pallete for current mon
if (isEevee)
gTasks[taskId].data[4+base_i] = CreateMonIcon(targetSpecies, SpriteCB_MonIcon, 45 + 26*base_i, 31, 4, 0); //Create pokemon sprite
gTasks[taskId].data[4+base_i] = CreateMonIcon(targetSpecies, SpriteCB_MonIcon, 45 + 26*base_i, 31, 4, personality); //Create pokemon sprite
else
gTasks[taskId].data[4+base_i] = CreateMonIcon(targetSpecies, SpriteCB_MonIcon, 50 + 32*base_i, 31, 4, 0); //Create pokemon sprite
gTasks[taskId].data[4+base_i] = CreateMonIcon(targetSpecies, SpriteCB_MonIcon, 50 + 32*base_i, 31, 4, personality); //Create pokemon sprite
gSprites[gTasks[taskId].data[4+base_i]].oam.priority = 0;
}
}
@ -6293,8 +6300,9 @@ static void HandlePreEvolutionSpeciesPrint(u8 taskId, u16 preSpecies, u16 specie
if (base_i < 3)
{
LoadMonIconPalette(preSpecies); //Loads pallete for current mon
gTasks[taskId].data[4+base_i] = CreateMonIcon(preSpecies, SpriteCB_MonIcon, 18 + 32*base_i, 31, 4, 0); //Create pokemon sprite
u32 personality = GetPokedexMonPersonality(preSpecies);
LoadMonIconPalettePersonality(preSpecies, personality); //Loads pallete for current mon
gTasks[taskId].data[4+base_i] = CreateMonIcon(preSpecies, SpriteCB_MonIcon, 18 + 32*base_i, 31, 4, personality); //Create pokemon sprite
gSprites[gTasks[taskId].data[4+base_i]].oam.priority = 0;
}
}
@ -6771,9 +6779,11 @@ static void Task_LoadFormsScreen(u8 taskId)
if (gTasks[taskId].data[1] == 0)
{
//Icon
u32 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
u32 personality = GetPokedexMonPersonality(species);
FreeMonIconPalettes(); //Free space for new pallete
LoadMonIconPalette(NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum)); //Loads pallete for current mon
gTasks[taskId].data[4] = CreateMonIcon(NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum), SpriteCB_MonIcon, 18, 31, 4, 0); //Create pokemon sprite
LoadMonIconPalettePersonality(species, personality); //Loads pallete for current mon
gTasks[taskId].data[4] = CreateMonIcon(species, SpriteCB_MonIcon, 18, 31, 4, personality); //Create pokemon sprite
gSprites[gTasks[taskId].data[4]].oam.priority = 0;
}
EvoFormsPage_PrintNavigationButtons(); // Navigation buttons
@ -6952,13 +6962,14 @@ static void PrintForms(u8 taskId, u16 species)
continue;
else
{
u32 personality = GetPokedexMonPersonality(speciesForm);
sPokedexView->sFormScreenData.formIds[j++] = i;
times += 1;
LoadMonIconPalette(speciesForm); //Loads pallete for current mon
LoadMonIconPalettePersonality(speciesForm, personality); //Loads pallete for current mon
if (times < 7)
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 52 + 34*(times-1), 31, 4, 0); //Create pokemon sprite
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 52 + 34*(times-1), 31, 4, personality); //Create pokemon sprite
else if (times < 14)
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-7), 70 - y_offset_icons, 4, 0); //Create pokemon sprite
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-7), 70 - y_offset_icons, 4, personality); //Create pokemon sprite
gSprites[gTasks[taskId].data[4+times]].oam.priority = 0;
}
}

View File

@ -1703,25 +1703,43 @@ void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: Asparagu
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
s32 level = GetLevelFromBoxMonExp(boxMon);
s32 i;
u16 levelMoveCount = 0;
u16 moves[MAX_MON_MOVES] = {0};
u8 addedMoves = 0;
const struct LevelUpMove *learnset = GetSpeciesLevelUpLearnset(species);
for (i = 0; learnset[i].move != LEVEL_UP_MOVE_END; i++)
levelMoveCount++;
for (i = levelMoveCount; (i >= 0 && addedMoves < MAX_MON_MOVES); i--)
{
s32 j;
bool32 alreadyKnown = FALSE;
if (learnset[i].level > level)
continue;
break;
if (learnset[i].level == 0)
continue;
if (moves[addedMoves] != learnset[i].move)
moves[addedMoves++] = learnset[i].move;
for (j = 0; j < addedMoves + 1; j++)
if (moves[j] == learnset[i].move)
{
alreadyKnown = TRUE;
break;
}
if (!alreadyKnown)
{
if (addedMoves < MAX_MON_MOVES)
{
moves[addedMoves] = learnset[i].move;
addedMoves++;
}
else
{
for (j = 0; j < MAX_MON_MOVES - 1; j++)
moves[j] = moves[j + 1];
moves[MAX_MON_MOVES - 1] = learnset[i].move;
}
}
}
for (i = MAX_MON_MOVES - 1; i >= 0; i--)
for (i = 0; i < MAX_MON_MOVES; i++)
{
SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &moves[i]);
SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gMovesInfo[moves[i]].pp);

View File

@ -266,7 +266,6 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when Sandstorm i
SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock")
{
KNOWN_FAILING;
GIVEN {
PLAYER(SPECIES_CASTFORM_NORMAL) { Ability(ABILITY_FORECAST); }
OPPONENT(SPECIES_WOBBUFFET);

View File

@ -0,0 +1,41 @@
#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_GASTRO_ACID].effect == EFFECT_GASTRO_ACID);
}
SINGLE_BATTLE_TEST("Gastro Acid fails if target has a banned ability")
{
u32 species, ability;
PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; }
PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; }
PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; }
PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; }
PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; }
PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; }
PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; }
PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; }
PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; }
PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; }
PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; }
PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; }
PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; }
// Needs confirmation since those abilities can be surpressed by Neutralizing Gas
// PARAMETRIZE { species = SPECIES_IRON_MOTH; ability = ABILITY_QUARK_DRIVE; }
// PARAMETRIZE { species = SPECIES_WALKING_WAKE; ability = ABILITY_PROTOSYNTHESIS; }
PARAMETRIZE { species = SPECIES_CALYREX_SHADOW_RIDER; ability = ABILITY_AS_ONE_SHADOW_RIDER; }
PARAMETRIZE { species = SPECIES_CALYREX_ICE_RIDER; ability = ABILITY_AS_ONE_ICE_RIDER; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(species) { Ability(ability); }
} WHEN {
TURN { MOVE(player, MOVE_GASTRO_ACID); }
} SCENE {
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_GASTRO_ACID, player);
MESSAGE("But it failed!");
}
}

View File

@ -0,0 +1,76 @@
#include "global.h"
#include "test/battle.h"
// Technically also covers Skill Swap and Doodle since both moves use the same command as Role Play
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY);
}
SINGLE_BATTLE_TEST("Role Play fails if target has a banned ability")
{
u32 species, ability;
PARAMETRIZE { species = SPECIES_SHEDINJA; ability = ABILITY_WONDER_GUARD; }
PARAMETRIZE { species = SPECIES_CASTFORM; ability = ABILITY_FORECAST; }
PARAMETRIZE { species = SPECIES_CHERRIM; ability = ABILITY_FLOWER_GIFT; }
PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; }
PARAMETRIZE { species = SPECIES_ZORUA; ability = ABILITY_ILLUSION; }
PARAMETRIZE { species = SPECIES_DARMANITAN; ability = ABILITY_ZEN_MODE; }
PARAMETRIZE { species = SPECIES_DITTO; ability = ABILITY_IMPOSTER; }
PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; }
PARAMETRIZE { species = SPECIES_MUK_ALOLAN; ability = ABILITY_POWER_OF_ALCHEMY; }
PARAMETRIZE { species = SPECIES_PASSIMIAN; ability = ABILITY_RECEIVER; }
PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; }
PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; }
PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; }
PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; }
PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; }
PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; }
PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; }
PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; }
PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; }
PARAMETRIZE { species = SPECIES_KOFFING; ability = ABILITY_NEUTRALIZING_GAS; }
PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; }
PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); }
OPPONENT(species) { Ability(ability); }
} WHEN {
TURN { MOVE(player,MOVE_ROLE_PLAY); }
} SCENE {
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, player);
MESSAGE("But it failed!");
}
}
SINGLE_BATTLE_TEST("Role Play fails if user has a banned ability")
{
u32 species, ability;
PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; }
PARAMETRIZE { species = SPECIES_DARMANITAN; ability = ABILITY_ZEN_MODE; }
PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; }
PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; }
PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; }
PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; }
PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; }
PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; }
PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; }
PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; }
PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; }
PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; }
PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; }
PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); }
OPPONENT(species) { Ability(ability); }
} WHEN {
TURN { MOVE(opponent,MOVE_ROLE_PLAY); }
} SCENE {
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, opponent);
MESSAGE("But it failed!");
}
}

View File

@ -96,28 +96,6 @@ SINGLE_BATTLE_TEST("Gastro Acid, Worry Seed, and Simple Beam fail if the target
}
}
SINGLE_BATTLE_TEST("Role Play, Skill Swap, and Entrainment fail if either Pokémon has Zero to Hero")
{
u16 move;
PARAMETRIZE { move = MOVE_ROLE_PLAY; }
PARAMETRIZE { move = MOVE_SKILL_SWAP; }
PARAMETRIZE { move = MOVE_ENTRAINMENT; }
GIVEN {
ASSUME(gMovesInfo[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY);
ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP);
ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT);
PLAYER(SPECIES_PALAFIN_ZERO) { Ability(ABILITY_ZERO_TO_HERO); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
NOT ANIMATION(ANIM_TYPE_MOVE, move, player);
MESSAGE("But it failed!");
}
}
SINGLE_BATTLE_TEST("Transform doesn't apply the heroic transformation message when copying Palafin")
{
GIVEN {

View File

@ -0,0 +1,34 @@
#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItemsInfo[ITEM_ABILITY_SHIELD].holdEffect == HOLD_EFFECT_ABILITY_SHIELD);
}
SINGLE_BATTLE_TEST("Ability Shield prevents Neutralizing Gas")
{
u32 item;
PARAMETRIZE { item = ITEM_ABILITY_SHIELD; }
PARAMETRIZE { item = ITEM_NONE; }
GIVEN {
PLAYER(SPECIES_TORKOAL) { Ability(ABILITY_DROUGHT); Item(item); }
OPPONENT(SPECIES_KOFFING) { Ability(ABILITY_NEUTRALIZING_GAS); }
} WHEN {
TURN { }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_NEUTRALIZING_GAS);
MESSAGE("Neutralizing Gas filled the area!");
if (item == ITEM_ABILITY_SHIELD) {
ABILITY_POPUP(player, ABILITY_DROUGHT);
MESSAGE("Torkoal's Drought intensified the sun's rays!");
} else {
NONE_OF {
ABILITY_POPUP(player, ABILITY_DROUGHT);
MESSAGE("Torkoal's Drought intensified the sun's rays!");
}
}
}
}

View File

@ -24,3 +24,20 @@ SINGLE_BATTLE_TEST("Eject Pack does not cause the new pokemon to lose hp due to
NOT MESSAGE("Wynaut was hurt by its Life Orb!");
}
}
SINGLE_BATTLE_TEST("Eject Pack does not activate if there are no pokemon left to battle")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
PLAYER(SPECIES_WOBBUFFET) { HP(0); }
OPPONENT(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }
} WHEN {
TURN { }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet is switched out with the Eject Pack!");
}
}
}

View File

@ -5,14 +5,14 @@ import os
# before all else, abort if the config is off
with open("./include/config/pokemon.h", "r") as file:
learnset_config = re.findall("#define P_LEARNSET_HELPER_TEACHABLE *([^ ]*)", file.read())
learnset_config = re.findall(r"#define P_LEARNSET_HELPER_TEACHABLE *([^ ]*)", file.read())
if len(learnset_config) != 1:
quit()
if learnset_config[0] != "TRUE":
quit()
def parse_mon_name(name):
return re.sub('(?!^)([A-Z]+)', r'_\1', name).upper()
return re.sub(r'(?!^)([A-Z]+)', r'_\1', name).upper()
tm_moves = []
tutor_moves = []
@ -28,20 +28,20 @@ for file in incs_to_check:
with open(file, 'r') as f2:
raw = f2.read()
if 'special ChooseMonForMoveTutor' in raw:
for x in re.findall('setvar VAR_0x8005, (MOVE_.*)', raw):
for x in re.findall(r'setvar VAR_0x8005, (MOVE_.*)', raw):
if not x in tutor_moves:
tutor_moves.append(x)
# scan TMs and HMs
with open("./include/constants/tms_hms.h", 'r') as file:
for x in re.findall('F\((.*)\)', file.read()):
for x in re.findall(r'F\((.*)\)', file.read()):
if not 'MOVE_' + x in tm_moves:
tm_moves.append('MOVE_' + x)
# look up universal moves to exclude them
universal_moves = []
with open("./src/pokemon.c", "r") as file:
for x in re.findall("static const u16 sUniversalMoves\[\] =(.|\n)*?{((.|\n)*?)};", file.read())[0]:
for x in re.findall(r"static const u16 sUniversalMoves\[\] =(.|\n)*?{((.|\n)*?)};", file.read())[0]:
x = x.replace("\n", "")
for y in x.split(","):
y = y.strip()
@ -79,7 +79,7 @@ def construct_compatibility_dict(force_custom_check):
raw = file.read()
if not "// DO NOT MODIFY THIS FILE!" in raw and force_custom_check == True:
custom_teachable_compatibilities = {}
for entry in re.findall("static const u16 s(.*)TeachableLearnset\[\] = {\n((.|\n)*?)\n};", raw):
for entry in re.findall(r"static const u16 s(.*)TeachableLearnset\[\] = {\n((.|\n)*?)\n};", raw):
monname = parse_mon_name(entry[0])
if monname == "NONE":
continue
@ -128,7 +128,7 @@ compatibility_dict = construct_compatibility_dict(True)
# actually prepare the file
with open("./src/data/pokemon/teachable_learnsets.h", 'r') as file:
out = file.read()
list_of_mons = re.findall('static const u16 s(.*)TeachableLearnset', out)
list_of_mons = re.findall(r'static const u16 s(.*)TeachableLearnset', out)
for mon in list_of_mons:
mon_parsed = parse_mon_name(mon)
tm_learnset = []
@ -161,7 +161,7 @@ for mon in list_of_mons:
if len(tm_learnset) > 0:
repl += ",\n ".join(tm_learnset) + ",\n "
repl += "MOVE_UNAVAILABLE,\n};"
newout = re.sub('static const u16 s%sTeachableLearnset\[\] = {[\s\S]*?};' % mon, repl, out)
newout = re.sub(r'static const u16 s%sTeachableLearnset\[\] = {[\s\S]*?};' % mon, repl, out)
if newout != out:
out = newout
print("Updated %s" % mon)
@ -208,7 +208,7 @@ header += "// " + longest_move_name * "*" + " //\n\n"
if not "// DO NOT MODIFY THIS FILE!" in out:
out = header + out
else:
out = re.sub("\/\/\n\/\/ DO NOT MODIFY THIS FILE!(.|\n)*\* \/\/\n\n", header, out)
out = re.sub(r"\/\/\n\/\/ DO NOT MODIFY THIS FILE!(.|\n)*\* \/\/\n\n", header, out)
with open("./src/data/pokemon/teachable_learnsets.h", 'w') as file:
file.write(out)