Sync EVO_MODE consts from emerald
This commit is contained in:
@@ -213,9 +213,9 @@
|
|||||||
#define UNOWN_FORM_COUNT 28
|
#define UNOWN_FORM_COUNT 28
|
||||||
#define BOX_NAME_LENGTH 8
|
#define BOX_NAME_LENGTH 8
|
||||||
|
|
||||||
#define EVOTRIGGER_LEVEL_UP 0
|
#define EVO_MODE_NORMAL 0
|
||||||
#define EVOTRIGGER_TRADE 1
|
#define EVO_MODE_TRADE 1
|
||||||
#define EVOTRIGGER_STONE 2
|
#define EVO_MODE_ITEM_USE 2
|
||||||
#define EVOTRIGGER_STONE_2 3
|
#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
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_POKEMON_H
|
#endif // GUARD_CONSTANTS_POKEMON_H
|
||||||
|
|||||||
+1
-1
@@ -3791,7 +3791,7 @@ static void TryEvolvePokemon(void)
|
|||||||
|
|
||||||
levelUpBits &= ~(gBitTable[i]);
|
levelUpBits &= ~(gBitTable[i]);
|
||||||
gLeveledUpInBattle = levelUpBits;
|
gLeveledUpInBattle = levelUpBits;
|
||||||
species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVOTRIGGER_LEVEL_UP, levelUpBits);
|
species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_NORMAL, levelUpBits);
|
||||||
if (species != SPECIES_NONE)
|
if (species != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
gBattleMainFunc = WaitForEvoSceneToFinish;
|
gBattleMainFunc = WaitForEvoSceneToFinish;
|
||||||
|
|||||||
+3
-3
@@ -855,7 +855,7 @@ static bool8 DisplayPartyPokemonDataForMoveTutorOrEvolutionItem(u8 slot)
|
|||||||
DisplayPartyPokemonDataToTeachMove(slot, item, 0);
|
DisplayPartyPokemonDataToTeachMove(slot, item, 0);
|
||||||
break;
|
break;
|
||||||
case 2: // Evolution stone
|
case 2: // Evolution stone
|
||||||
if (!GetMonData(currentPokemon, MON_DATA_IS_EGG) && GetEvolutionTargetSpecies(currentPokemon, EVOTRIGGER_STONE_2, item) != SPECIES_NONE)
|
if (!GetMonData(currentPokemon, MON_DATA_IS_EGG) && GetEvolutionTargetSpecies(currentPokemon, EVO_MODE_ITEM_CHECK, item) != SPECIES_NONE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
DisplayPartyPokemonDescriptionData(slot, PARTYBOX_DESC_NO_USE);
|
DisplayPartyPokemonDescriptionData(slot, PARTYBOX_DESC_NO_USE);
|
||||||
break;
|
break;
|
||||||
@@ -5197,7 +5197,7 @@ static void Task_TryLearningNextMove(u8 taskId)
|
|||||||
static void PartyMenuTryEvolution(u8 taskId)
|
static void PartyMenuTryEvolution(u8 taskId)
|
||||||
{
|
{
|
||||||
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
|
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
|
||||||
u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVOTRIGGER_LEVEL_UP, 0);
|
u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_NORMAL, 0);
|
||||||
|
|
||||||
if (targetSpecies != SPECIES_NONE)
|
if (targetSpecies != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
@@ -5353,7 +5353,7 @@ static void sub_8126BD4(void)
|
|||||||
static bool8 MonCanEvolve(void)
|
static bool8 MonCanEvolve(void)
|
||||||
{
|
{
|
||||||
if (!IsNationalPokedexEnabled()
|
if (!IsNationalPokedexEnabled()
|
||||||
&& GetEvolutionTargetSpecies(&gPlayerParty[gPartyMenu.slotId], EVOTRIGGER_STONE, gSpecialVar_ItemId) > KANTO_DEX_COUNT)
|
&& GetEvolutionTargetSpecies(&gPlayerParty[gPartyMenu.slotId], EVO_MODE_ITEM_USE, gSpecialVar_ItemId) > KANTO_DEX_COUNT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
+6
-6
@@ -4259,7 +4259,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
|||||||
break;
|
break;
|
||||||
case 7: // EVO_STONE
|
case 7: // EVO_STONE
|
||||||
{
|
{
|
||||||
u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVOTRIGGER_STONE, item);
|
u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_ITEM_USE, item);
|
||||||
|
|
||||||
if (targetSpecies != SPECIES_NONE)
|
if (targetSpecies != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
@@ -4623,7 +4623,7 @@ bool8 PokemonItemUseNoEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mo
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (GetEvolutionTargetSpecies(mon, EVOTRIGGER_STONE, item) != SPECIES_NONE)
|
if (GetEvolutionTargetSpecies(mon, EVO_MODE_ITEM_USE, item) != SPECIES_NONE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4905,7 +4905,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
|
|||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case EVOTRIGGER_LEVEL_UP:
|
case EVO_MODE_NORMAL:
|
||||||
level = GetMonData(mon, MON_DATA_LEVEL, 0);
|
level = GetMonData(mon, MON_DATA_LEVEL, 0);
|
||||||
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);
|
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);
|
||||||
|
|
||||||
@@ -4970,7 +4970,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVOTRIGGER_TRADE:
|
case EVO_MODE_TRADE:
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
switch (gEvolutionTable[species][i].method)
|
switch (gEvolutionTable[species][i].method)
|
||||||
@@ -4993,8 +4993,8 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVOTRIGGER_STONE:
|
case EVO_MODE_ITEM_USE:
|
||||||
case EVOTRIGGER_STONE_2:
|
case EVO_MODE_ITEM_CHECK:
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
if (gEvolutionTable[species][i].method == EVO_ITEM
|
if (gEvolutionTable[species][i].method == EVO_ITEM
|
||||||
|
|||||||
+3
-3
@@ -1725,7 +1725,7 @@ static bool8 DoTradeAnim_Cable(void)
|
|||||||
case 72: // Only if in-game trade
|
case 72: // Only if in-game trade
|
||||||
TradeMons(gSpecialVar_0x8005, 0);
|
TradeMons(gSpecialVar_0x8005, 0);
|
||||||
gCB2_AfterEvolution = CB2_RunTradeAnim_InGameTrade;
|
gCB2_AfterEvolution = CB2_RunTradeAnim_InGameTrade;
|
||||||
evoTarget = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[0]], EVOTRIGGER_TRADE, ITEM_NONE);
|
evoTarget = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[0]], EVO_MODE_TRADE, ITEM_NONE);
|
||||||
if (evoTarget != SPECIES_NONE)
|
if (evoTarget != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[0]], evoTarget, sTradeData->pokePicSpriteIdxs[1], gSelectedTradeMonPositions[0]);
|
TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[0]], evoTarget, sTradeData->pokePicSpriteIdxs[1], gSelectedTradeMonPositions[0]);
|
||||||
@@ -2246,7 +2246,7 @@ static bool8 DoTradeAnim_Wireless(void)
|
|||||||
case 72: // Only if in-game trade
|
case 72: // Only if in-game trade
|
||||||
TradeMons(gSpecialVar_0x8005, 0);
|
TradeMons(gSpecialVar_0x8005, 0);
|
||||||
gCB2_AfterEvolution = CB2_RunTradeAnim_InGameTrade;
|
gCB2_AfterEvolution = CB2_RunTradeAnim_InGameTrade;
|
||||||
evoTarget = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[0]], EVOTRIGGER_TRADE, ITEM_NONE);
|
evoTarget = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[0]], EVO_MODE_TRADE, ITEM_NONE);
|
||||||
if (evoTarget != SPECIES_NONE)
|
if (evoTarget != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[0]], evoTarget, sTradeData->pokePicSpriteIdxs[1], gSelectedTradeMonPositions[0]);
|
TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[0]], evoTarget, sTradeData->pokePicSpriteIdxs[1], gSelectedTradeMonPositions[0]);
|
||||||
@@ -2290,7 +2290,7 @@ static void sub_8053788(void)
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
gCB2_AfterEvolution = sub_8053E8C;
|
gCB2_AfterEvolution = sub_8053E8C;
|
||||||
evoSpecies = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[0]], EVOTRIGGER_TRADE, 0);
|
evoSpecies = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[0]], EVO_MODE_TRADE, 0);
|
||||||
if (evoSpecies != SPECIES_NONE)
|
if (evoSpecies != SPECIES_NONE)
|
||||||
TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[0]], evoSpecies, sTradeData->pokePicSpriteIdxs[1], gSelectedTradeMonPositions[0]);
|
TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[0]], evoSpecies, sTradeData->pokePicSpriteIdxs[1], gSelectedTradeMonPositions[0]);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user