Merge branch 'pokemon_expansion' of https://github.com/rh-hideout/pokeemerald-expansion into cherrim

This commit is contained in:
sneed 2022-05-19 00:54:16 +03:00
commit ef496ddb9d
17 changed files with 156 additions and 36 deletions

View file

@ -1939,3 +1939,15 @@
setvar VAR_0x8006, \item setvar VAR_0x8006, \item
special CreateEventLegalEnemyMon special CreateEventLegalEnemyMon
.endm .endm
@ Attempts to trigger a special evolution method in the overworld.
@ There may be other conditions required which are coded for in GetEvolutionTargetSpecies.
@ EX: tryspecialevo EVO_WATER_SCROLL, FALSE, FALSE triggers Kubfu's EVO_WATER_SCROLL evolution
@ method, cannot be cancelled in the evolution scene, and will only evolve one Kubfu if there
@ are multiple in the player's party.
.macro tryspecialevo evoMethod:req, canStopEvo=TRUE, tryMultiple=TRUE
setvar VAR_0x8000, \evoMethod
setvar VAR_0x8001, \canStopEvo
setvar VAR_0x8002, \tryMultiple
special TrySpecialOverworldEvo
.endm

View file

@ -535,3 +535,4 @@ gSpecials::
def_special RemoveRecordsWindow def_special RemoveRecordsWindow
def_special CloseDeptStoreElevatorWindow def_special CloseDeptStoreElevatorWindow
def_special TrySetBattleTowerLinkType def_special TrySetBattleTowerLinkType
def_special TrySpecialOverworldEvo

View file

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

View file

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

View file

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

View file

@ -47,6 +47,37 @@ $(CHERRIMGFXDIR)/shiny.gbapal: $(CHERRIMGFXDIR)/normal/shiny.gbapal \
$(CHERRIMGFXDIR)/sunshine/shiny.gbapal $(CHERRIMGFXDIR)/sunshine/shiny.gbapal
@cat $^ >$@ @cat $^ >$@
### Castform ###
$(CASTFORMGFXDIR)/front.4bpp: $(CASTFORMGFXDIR)/normal/front.4bpp \
$(CASTFORMGFXDIR)/sunny/front.4bpp \
$(CASTFORMGFXDIR)/rainy/front.4bpp \
$(CASTFORMGFXDIR)/snowy/front.4bpp
@cat $^ >$@
$(CASTFORMGFXDIR)/back.4bpp: $(CASTFORMGFXDIR)/normal/back.4bpp \
$(CASTFORMGFXDIR)/sunny/back.4bpp \
$(CASTFORMGFXDIR)/rainy/back.4bpp \
$(CASTFORMGFXDIR)/snowy/back.4bpp
@cat $^ >$@
$(CASTFORMGFXDIR)/anim_front.4bpp: $(CASTFORMGFXDIR)/normal/anim_front.4bpp \
$(CASTFORMGFXDIR)/sunny/anim_front.4bpp \
$(CASTFORMGFXDIR)/rainy/anim_front.4bpp \
$(CASTFORMGFXDIR)/snowy/anim_front.4bpp
@cat $^ >$@
$(CASTFORMGFXDIR)/normal.gbapal: $(CASTFORMGFXDIR)/normal/normal.gbapal \
$(CASTFORMGFXDIR)/sunny/normal.gbapal \
$(CASTFORMGFXDIR)/rainy/normal.gbapal \
$(CASTFORMGFXDIR)/snowy/normal.gbapal
@cat $^ >$@
$(CASTFORMGFXDIR)/shiny.gbapal: $(CASTFORMGFXDIR)/normal/shiny.gbapal \
$(CASTFORMGFXDIR)/sunny/shiny.gbapal \
$(CASTFORMGFXDIR)/rainy/shiny.gbapal \
$(CASTFORMGFXDIR)/snowy/shiny.gbapal
@cat $^ >$@
### Tilesets ### ### Tilesets ###

View file

@ -352,14 +352,20 @@
#define EVO_SPECIFIC_MAP 32 // Pokémon levels up on specified map #define EVO_SPECIFIC_MAP 32 // Pokémon levels up on specified map
#define EVO_LEVEL_NATURE_AMPED 33 // Pokémon reaches the specified level, it has a Hardy, Brave, Adamant, Naughty, Docile, Impish, Lax, Hasty, Jolly, Naive, Rash, Sassy, or Quirky nature. #define EVO_LEVEL_NATURE_AMPED 33 // Pokémon reaches the specified level, it has a Hardy, Brave, Adamant, Naughty, Docile, Impish, Lax, Hasty, Jolly, Naive, Rash, Sassy, or Quirky nature.
#define EVO_LEVEL_NATURE_LOW_KEY 34 // Pokémon reaches the specified level, it has a Lonely, Bold, Relaxed, Timid, Serious, Modest, Mild, Quiet, Bashful, Calm, Gentle, or Careful nature. #define EVO_LEVEL_NATURE_LOW_KEY 34 // Pokémon reaches the specified level, it has a Lonely, Bold, Relaxed, Timid, Serious, Modest, Mild, Quiet, Bashful, Calm, Gentle, or Careful nature.
#define EVO_CRITICAL_HITS 35 // Pokémon performs specified number of critical hits in one battle
#define EVO_SCRIPT_TRIGGER_DMG 36 // Pokémon has specified HP below max, then player interacts trigger
#define EVO_DARK_SCROLL 37 // interacts with Scroll of Darkness
#define EVO_WATER_SCROLL 38 // interacts with Scroll of Waters
#define EVOS_PER_MON 10 #define EVOS_PER_MON 10
// Evolution 'modes,' for GetEvolutionTargetSpecies // Evolution 'modes,' for GetEvolutionTargetSpecies
#define EVO_MODE_NORMAL 0 #define EVO_MODE_NORMAL 0
#define EVO_MODE_TRADE 1 #define EVO_MODE_TRADE 1
#define EVO_MODE_ITEM_USE 2 #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_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
// Form change types // Form change types
#define FORM_CHANGE_END 0 #define FORM_CHANGE_END 0

View file

@ -161,8 +161,8 @@
//FORM_ITEM_USE //FORM_ITEM_USE
#define ITEM_GRACIDEA 10125 #define ITEM_GRACIDEA 10125
// #define ITEM_REVEAL_GLASS 10126 #define ITEM_REVEAL_GLASS 10126
// #define ITEM_PRISON_BOTTLE 10127 #define ITEM_PRISON_BOTTLE 10127
#define ITEM_RED_NECTAR 10128 #define ITEM_RED_NECTAR 10128
#define ITEM_YELLOW_NECTAR 10129 #define ITEM_YELLOW_NECTAR 10129
#define ITEM_PINK_NECTAR 10130 #define ITEM_PINK_NECTAR 10130

View file

@ -467,15 +467,15 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_YAMPER] = {{EVO_LEVEL, 25, SPECIES_BOLTUND}}, [SPECIES_YAMPER] = {{EVO_LEVEL, 25, SPECIES_BOLTUND}},
[SPECIES_ROLYCOLY] = {{EVO_LEVEL, 18, SPECIES_CARKOL}}, [SPECIES_ROLYCOLY] = {{EVO_LEVEL, 18, SPECIES_CARKOL}},
[SPECIES_CARKOL] = {{EVO_LEVEL, 34, SPECIES_COALOSSAL}}, [SPECIES_CARKOL] = {{EVO_LEVEL, 34, SPECIES_COALOSSAL}},
[SPECIES_APPLIN] = {{EVO_ITEM, ITEM_NONE, SPECIES_FLAPPLE}, [SPECIES_APPLIN] = {{EVO_ITEM, ITEM_TART_APPLE, SPECIES_FLAPPLE},
{EVO_ITEM, ITEM_NONE, SPECIES_APPLETUN}}, {EVO_ITEM, ITEM_SWEET_APPLE, SPECIES_APPLETUN}},
[SPECIES_SILICOBRA] = {{EVO_LEVEL, 36, SPECIES_SANDACONDA}}, [SPECIES_SILICOBRA] = {{EVO_LEVEL, 36, SPECIES_SANDACONDA}},
[SPECIES_ARROKUDA] = {{EVO_LEVEL, 26, SPECIES_BARRASKEWDA}}, [SPECIES_ARROKUDA] = {{EVO_LEVEL, 26, SPECIES_BARRASKEWDA}},
[SPECIES_TOXEL] = {{EVO_LEVEL_NATURE_AMPED, 30, SPECIES_TOXTRICITY}, [SPECIES_TOXEL] = {{EVO_LEVEL_NATURE_AMPED, 30, SPECIES_TOXTRICITY},
{EVO_LEVEL_NATURE_LOW_KEY, 30, SPECIES_TOXTRICITY_LOW_KEY}}, {EVO_LEVEL_NATURE_LOW_KEY, 30, SPECIES_TOXTRICITY_LOW_KEY}},
[SPECIES_SIZZLIPEDE] = {{EVO_LEVEL, 28, SPECIES_CENTISKORCH}}, [SPECIES_SIZZLIPEDE] = {{EVO_LEVEL, 28, SPECIES_CENTISKORCH}},
[SPECIES_CLOBBOPUS] = {{EVO_MOVE, MOVE_TAUNT, SPECIES_GRAPPLOCT}}, [SPECIES_CLOBBOPUS] = {{EVO_MOVE, MOVE_TAUNT, SPECIES_GRAPPLOCT}},
[SPECIES_SINISTEA] = {{EVO_ITEM, ITEM_NONE, SPECIES_POLTEAGEIST}}, [SPECIES_SINISTEA] = {{EVO_ITEM, ITEM_CRACKED_POT, SPECIES_POLTEAGEIST}},
[SPECIES_HATENNA] = {{EVO_LEVEL, 32, SPECIES_HATTREM}}, [SPECIES_HATENNA] = {{EVO_LEVEL, 32, SPECIES_HATTREM}},
[SPECIES_HATTREM] = {{EVO_LEVEL, 42, SPECIES_HATTERENE}}, [SPECIES_HATTREM] = {{EVO_LEVEL, 42, SPECIES_HATTERENE}},
[SPECIES_IMPIDIMP] = {{EVO_LEVEL, 32, SPECIES_MORGREM}}, [SPECIES_IMPIDIMP] = {{EVO_LEVEL, 32, SPECIES_MORGREM}},
@ -493,8 +493,8 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_CUFANT] = {{EVO_LEVEL, 34, SPECIES_COPPERAJAH}}, [SPECIES_CUFANT] = {{EVO_LEVEL, 34, SPECIES_COPPERAJAH}},
[SPECIES_DREEPY] = {{EVO_LEVEL, 50, SPECIES_DRAKLOAK}}, [SPECIES_DREEPY] = {{EVO_LEVEL, 50, SPECIES_DRAKLOAK}},
[SPECIES_DRAKLOAK] = {{EVO_LEVEL, 60, SPECIES_DRAGAPULT}}, [SPECIES_DRAKLOAK] = {{EVO_LEVEL, 60, SPECIES_DRAGAPULT}},
[SPECIES_KUBFU] = {{EVO_LEVEL, 0, SPECIES_URSHIFU}, [SPECIES_KUBFU] = {{EVO_DARK_SCROLL, 0, SPECIES_URSHIFU},
{EVO_LEVEL, 0, SPECIES_URSHIFU_RAPID_STRIKE_STYLE}}, {EVO_WATER_SCROLL, 0, SPECIES_URSHIFU_RAPID_STRIKE_STYLE}},
[SPECIES_RATTATA_ALOLAN] = {{EVO_LEVEL_NIGHT, 20, SPECIES_RATICATE_ALOLAN}}, [SPECIES_RATTATA_ALOLAN] = {{EVO_LEVEL_NIGHT, 20, SPECIES_RATICATE_ALOLAN}},
[SPECIES_SANDSHREW_ALOLAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_SANDSLASH_ALOLAN}}, [SPECIES_SANDSHREW_ALOLAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_SANDSLASH_ALOLAN}},
[SPECIES_VULPIX_ALOLAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_NINETALES_ALOLAN}}, [SPECIES_VULPIX_ALOLAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_NINETALES_ALOLAN}},
@ -505,15 +505,15 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_GRIMER_ALOLAN] = {{EVO_LEVEL, 38, SPECIES_MUK_ALOLAN}}, [SPECIES_GRIMER_ALOLAN] = {{EVO_LEVEL, 38, SPECIES_MUK_ALOLAN}},
[SPECIES_MEOWTH_GALARIAN] = {{EVO_LEVEL, 28, SPECIES_PERRSERKER}}, [SPECIES_MEOWTH_GALARIAN] = {{EVO_LEVEL, 28, SPECIES_PERRSERKER}},
[SPECIES_PONYTA_GALARIAN] = {{EVO_LEVEL, 40, SPECIES_RAPIDASH_GALARIAN}}, [SPECIES_PONYTA_GALARIAN] = {{EVO_LEVEL, 40, SPECIES_RAPIDASH_GALARIAN}},
[SPECIES_SLOWPOKE_GALARIAN] = {{EVO_ITEM, ITEM_NONE, SPECIES_SLOWBRO_GALARIAN}, [SPECIES_SLOWPOKE_GALARIAN] = {{EVO_ITEM, ITEM_GALARICA_CUFF, SPECIES_SLOWBRO_GALARIAN},
{EVO_ITEM, ITEM_NONE, SPECIES_SLOWKING_GALARIAN}}, {EVO_ITEM, ITEM_GALARICA_WREATH, SPECIES_SLOWKING_GALARIAN}},
[SPECIES_FARFETCHD_GALARIAN] = {{EVO_LEVEL, 0, SPECIES_SIRFETCHD}}, [SPECIES_FARFETCHD_GALARIAN] = {{EVO_CRITICAL_HITS, 3, SPECIES_SIRFETCHD}},
[SPECIES_MR_MIME_GALARIAN] = {{EVO_LEVEL, 42, SPECIES_MR_RIME}}, [SPECIES_MR_MIME_GALARIAN] = {{EVO_LEVEL, 42, SPECIES_MR_RIME}},
[SPECIES_CORSOLA_GALARIAN] = {{EVO_LEVEL, 38, SPECIES_CURSOLA}}, [SPECIES_CORSOLA_GALARIAN] = {{EVO_LEVEL, 38, SPECIES_CURSOLA}},
[SPECIES_ZIGZAGOON_GALARIAN] = {{EVO_LEVEL, 20, SPECIES_LINOONE_GALARIAN}}, [SPECIES_ZIGZAGOON_GALARIAN] = {{EVO_LEVEL, 20, SPECIES_LINOONE_GALARIAN}},
[SPECIES_LINOONE_GALARIAN] = {{EVO_LEVEL_NIGHT, 35, SPECIES_OBSTAGOON}}, [SPECIES_LINOONE_GALARIAN] = {{EVO_LEVEL_NIGHT, 35, SPECIES_OBSTAGOON}},
[SPECIES_DARUMAKA_GALARIAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_DARMANITAN_GALARIAN}}, [SPECIES_DARUMAKA_GALARIAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_DARMANITAN_GALARIAN}},
[SPECIES_YAMASK_GALARIAN] = {{EVO_LEVEL, 0, SPECIES_RUNERIGUS}}, [SPECIES_YAMASK_GALARIAN] = {{EVO_SCRIPT_TRIGGER_DMG, 49, SPECIES_RUNERIGUS}},
[SPECIES_BURMY_SANDY_CLOAK] = {{EVO_LEVEL_FEMALE, 20, SPECIES_WORMADAM_SANDY_CLOAK}, [SPECIES_BURMY_SANDY_CLOAK] = {{EVO_LEVEL_FEMALE, 20, SPECIES_WORMADAM_SANDY_CLOAK},
{EVO_LEVEL_MALE, 20, SPECIES_MOTHIM}}, {EVO_LEVEL_MALE, 20, SPECIES_MOTHIM}},
[SPECIES_BURMY_TRASH_CLOAK] = {{EVO_LEVEL_FEMALE, 20, SPECIES_WORMADAM_TRASH_CLOAK}, [SPECIES_BURMY_TRASH_CLOAK] = {{EVO_LEVEL_FEMALE, 20, SPECIES_WORMADAM_TRASH_CLOAK},
@ -534,5 +534,5 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_PUMPKABOO_LARGE] = {{EVO_TRADE, 0, SPECIES_GOURGEIST_LARGE}}, [SPECIES_PUMPKABOO_LARGE] = {{EVO_TRADE, 0, SPECIES_GOURGEIST_LARGE}},
[SPECIES_PUMPKABOO_SUPER] = {{EVO_TRADE, 0, SPECIES_GOURGEIST_SUPER}}, [SPECIES_PUMPKABOO_SUPER] = {{EVO_TRADE, 0, SPECIES_GOURGEIST_SUPER}},
[SPECIES_ROCKRUFF_OWN_TEMPO] = {{EVO_LEVEL_DUSK, 25, SPECIES_LYCANROC_DUSK}}, [SPECIES_ROCKRUFF_OWN_TEMPO] = {{EVO_LEVEL_DUSK, 25, SPECIES_LYCANROC_DUSK}},
[SPECIES_SINISTEA_ANTIQUE] = {{EVO_ITEM, ITEM_NONE, SPECIES_POLTEAGEIST_ANTIQUE}}, [SPECIES_SINISTEA_ANTIQUE] = {{EVO_ITEM, ITEM_CHIPPED_POT, SPECIES_POLTEAGEIST_ANTIQUE}},
}; };

View file

@ -3,7 +3,7 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] =
[SPECIES_GIRATINA] = sGiratinaFormChangeTable, [SPECIES_GIRATINA] = sGiratinaFormChangeTable,
[SPECIES_GIRATINA_ORIGIN] = sGiratinaFormChangeTable, [SPECIES_GIRATINA_ORIGIN] = sGiratinaFormChangeTable,
[SPECIES_SHAYMIN] = sShayminFormChangeTable, [SPECIES_SHAYMIN] = sShayminFormChangeTable,
[SPECIES_SHAYMIN_SKY] = sShayminSkyFormChangeTable, [SPECIES_SHAYMIN_SKY] = sShayminFormChangeTable,
[SPECIES_ARCEUS] = sArceusFormChangeTable, [SPECIES_ARCEUS] = sArceusFormChangeTable,
[SPECIES_ARCEUS_FIGHTING] = sArceusFormChangeTable, [SPECIES_ARCEUS_FIGHTING] = sArceusFormChangeTable,
[SPECIES_ARCEUS_FLYING] = sArceusFormChangeTable, [SPECIES_ARCEUS_FLYING] = sArceusFormChangeTable,

View file

@ -1,4 +1,8 @@
/* /*
For cycling between forms with the same method and parameters but different target species (eg. Tornadus using the
Reveal Glass to change between its two forms), a separate form change table is required for each form.
Otherwise, only the last form change on the table will trigger.
FORM_ITEM_HOLD: FORM_ITEM_HOLD:
Form change activates when the item is given to or taken from the selected Pokémon. Form change activates when the item is given to or taken from the selected Pokémon.
param1 = item to hold param1 = item to hold
@ -47,10 +51,6 @@ static const struct FormChange sGiratinaFormChangeTable[] = {
static const struct FormChange sShayminFormChangeTable[] = { static const struct FormChange sShayminFormChangeTable[] = {
{FORM_ITEM_USE_TIME, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY}, {FORM_ITEM_USE_TIME, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY},
{FORM_CHANGE_END},
};
static const struct FormChange sShayminSkyFormChangeTable[] = {
{FORM_WITHDRAW, SPECIES_SHAYMIN}, {FORM_WITHDRAW, SPECIES_SHAYMIN},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
@ -95,32 +95,32 @@ static const struct FormChange sArceusFormChangeTable[] = {
}; };
static const struct FormChange sTornadusFormChangeTable[] = { static const struct FormChange sTornadusFormChangeTable[] = {
// {FORM_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sTornadusTherianFormChangeTable[] = { static const struct FormChange sTornadusTherianFormChangeTable[] = {
// {FORM_ITEM_USE, SPECIES_TORNADUS, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_TORNADUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sThundurusFormChangeTable[] = { static const struct FormChange sThundurusFormChangeTable[] = {
// {FORM_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sThundurusTherianFormChangeTable[] = { static const struct FormChange sThundurusTherianFormChangeTable[] = {
// {FORM_ITEM_USE, SPECIES_THUNDURUS, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_THUNDURUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sLandorusFormChangeTable[] = { static const struct FormChange sLandorusFormChangeTable[] = {
// {FORM_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sLandorusTherianFormChangeTable[] = { static const struct FormChange sLandorusTherianFormChangeTable[] = {
// {FORM_ITEM_USE, SPECIES_LANDORUS, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_LANDORUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };

View file

@ -1,5 +1,4 @@
#define LEVEL_UP_MOVE(lvl, moveLearned) {.move = moveLearned, .level = lvl} #define LEVEL_UP_MOVE(lvl, moveLearned) {.move = moveLearned, .level = lvl}
#define LEVEL_UP_END (0xffff)
static const struct LevelUpMove sBulbasaurLevelUpLearnset[] = { static const struct LevelUpMove sBulbasaurLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_TACKLE),

View file

@ -37,12 +37,7 @@ const u16 gTutorMoves[] =
static const u32 sTutorLearnsets[] = static const u32 sTutorLearnsets[] =
{ {
[SPECIES_NONE] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) [SPECIES_NONE] = (0),
| TUTOR(MOVE_MEGA_KICK)
| TUTOR(MOVE_MEGA_PUNCH)
| TUTOR(MOVE_SEISMIC_TOSS)
| TUTOR(MOVE_SWORDS_DANCE)
| TUTOR(MOVE_THUNDER_WAVE)),
[SPECIES_BULBASAUR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) [SPECIES_BULBASAUR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM)
| TUTOR(MOVE_DEFENSE_CURL) | TUTOR(MOVE_DEFENSE_CURL)

View file

@ -3989,7 +3989,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId)
gTasks[taskId].tState++; gTasks[taskId].tState++;
break; break;
case 4: case 4:
spriteId = CreateMonPicSprite(dexNum, 0, ((u16)gTasks[taskId].tPersonalityHi << 16) | (u16)gTasks[taskId].tPersonalityLo, TRUE, MON_PAGE_X, MON_PAGE_Y, 0, TAG_NONE); spriteId = CreateMonPicSprite(NationalPokedexNumToSpecies(dexNum), 0, ((u16)gTasks[taskId].tPersonalityHi << 16) | (u16)gTasks[taskId].tPersonalityLo, TRUE, MON_PAGE_X, MON_PAGE_Y, 0, TAG_NONE);
gSprites[spriteId].oam.priority = 0; gSprites[spriteId].oam.priority = 0;
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
SetVBlankCallback(gPokedexVBlankCB); SetVBlankCallback(gPokedexVBlankCB);

View file

@ -66,6 +66,7 @@ static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
static bool8 ShouldSkipFriendshipChange(void); static bool8 ShouldSkipFriendshipChange(void);
static u8 SendMonToPC(struct Pokemon* mon); static u8 SendMonToPC(struct Pokemon* mon);
static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv); static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv);
void TrySpecialOverworldEvo();
EWRAM_DATA static u8 sLearningMoveTableID = 0; EWRAM_DATA static u8 sLearningMoveTableID = 0;
EWRAM_DATA u8 gPlayerPartyCount = 0; EWRAM_DATA u8 gPlayerPartyCount = 0;
@ -74,6 +75,7 @@ EWRAM_DATA struct Pokemon gPlayerParty[PARTY_SIZE] = {0};
EWRAM_DATA struct Pokemon gEnemyParty[PARTY_SIZE] = {0}; EWRAM_DATA struct Pokemon gEnemyParty[PARTY_SIZE] = {0};
EWRAM_DATA struct SpriteTemplate gMultiuseSpriteTemplate = {0}; EWRAM_DATA struct SpriteTemplate gMultiuseSpriteTemplate = {0};
EWRAM_DATA static struct MonSpritesGfxManager *sMonSpritesGfxManagers[MON_SPR_GFX_MANAGERS_COUNT] = {NULL}; EWRAM_DATA static struct MonSpritesGfxManager *sMonSpritesGfxManagers[MON_SPR_GFX_MANAGERS_COUNT] = {NULL};
EWRAM_DATA static u8 sTriedEvolving = 0;
#include "data/battle_moves.h" #include "data/battle_moves.h"
@ -6755,6 +6757,47 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s
} }
} }
break; break;
#ifdef BATTLE_ENGINE
// Battle evolution without leveling; party slot is being passed into the evolutionItem arg.
case EVO_MODE_BATTLE_SPECIAL:
for (i = 0; i < EVOS_PER_MON; i++)
{
switch (gEvolutionTable[species][i].method)
{
case EVO_CRITICAL_HITS:
if (gPartyCriticalHits[evolutionItem] >= gEvolutionTable[species][i].param)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
}
break;
#endif
// Overworld evolution without leveling; evolution method is being passed into the evolutionItem arg.
case EVO_MODE_OVERWORLD_SPECIAL:
for (i = 0; i < EVOS_PER_MON; i++)
{
switch (gEvolutionTable[species][i].method)
{
case EVO_SCRIPT_TRIGGER_DMG:
{
u16 currentHp = GetMonData(mon, MON_DATA_HP, NULL);
if (evolutionItem == EVO_SCRIPT_TRIGGER_DMG
&& currentHp != 0
&& (GetMonData(mon, MON_DATA_MAX_HP, NULL) - currentHp >= gEvolutionTable[species][i].param))
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
case EVO_DARK_SCROLL:
if (evolutionItem == EVO_DARK_SCROLL)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_WATER_SCROLL:
if (evolutionItem == EVO_WATER_SCROLL)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
}
}
break;
} }
return targetSpecies; return targetSpecies;
@ -8100,7 +8143,10 @@ bool8 HasTwoFramesAnimation(u16 species)
return (species != SPECIES_CASTFORM return (species != SPECIES_CASTFORM
&& species != SPECIES_SPINDA && species != SPECIES_SPINDA
&& species != SPECIES_UNOWN && species != SPECIES_UNOWN
&& species != SPECIES_CHERRIM); && species != SPECIES_CHERRIM
&& species != SPECIES_CASTFORM_SUNNY
&& species != SPECIES_CASTFORM_RAINY
&& species != SPECIES_CASTFORM_SNOWY);
} }
static bool8 ShouldSkipFriendshipChange(void) static bool8 ShouldSkipFriendshipChange(void)
@ -8431,3 +8477,33 @@ static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv)
ivs[j++] = temp[i]; ivs[j++] = temp[i];
} }
} }
// Attempts to perform non-level/item related overworld evolutions; called by tryspecialevo command.
void TrySpecialOverworldEvo(void)
{
u8 i;
u8 evoMethod = gSpecialVar_0x8000;
u16 canStopEvo = gSpecialVar_0x8001;
u16 tryMultiple = gSpecialVar_0x8002;
for (i = 0; i < PARTY_SIZE; i++)
{
u16 targetSpecies = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_OVERWORLD_SPECIAL, evoMethod, SPECIES_NONE);
if (targetSpecies != SPECIES_NONE && !(sTriedEvolving & gBitTable[i]))
{
sTriedEvolving |= gBitTable[i];
if(gMain.callback2 == TrySpecialOverworldEvo) // This fixes small graphics glitches.
EvolutionScene(&gPlayerParty[i], targetSpecies, canStopEvo, i);
else
BeginEvolutionScene(&gPlayerParty[i], targetSpecies, canStopEvo, i);
if (tryMultiple)
gCB2_AfterEvolution = TrySpecialOverworldEvo;
else
gCB2_AfterEvolution = CB2_ReturnToField;
return;
}
}
sTriedEvolving = 0;
SetMainCallback2(CB2_ReturnToField);
}