Sync pokemon.c

This commit is contained in:
GriffinR
2023-03-01 00:42:12 -05:00
parent 3a4eaa0ff5
commit ab417d1255
54 changed files with 3710 additions and 4365 deletions
+8 -8
View File
@@ -1113,8 +1113,8 @@ static void Cmd_count_alive_pokemon(void)
{
if (i != battlerOnField1 && i != battlerOnField2
&& GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
{
AI_THINKING_STRUCT->funcResult++;
}
@@ -1165,25 +1165,25 @@ static void Cmd_get_ability(void)
return;
}
if (gBaseStats[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE)
if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE)
{
if (gBaseStats[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE)
if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE)
{
// AI has no knowledge of opponent, so it guesses which ability.
if (Random() % 2)
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[0];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0];
else
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[1];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1];
}
else
{
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[0];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0];
}
}
else
{
// AI can't actually reach this part since no pokemon has ability 2 and no ability 1.
AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[1];
AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1];
}
}
else
+19 -19
View File
@@ -54,8 +54,8 @@ static bool8 ShouldSwitchIfWonderGuard(void)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG
|| i == gBattlerPartyIndexes[gActiveBattler])
continue;
GetMonData(&gEnemyParty[i], MON_DATA_SPECIES); // Unused return value.
@@ -120,8 +120,8 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
u8 monAbility;
if ((GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
|| (i == gBattlerPartyIndexes[battlerIn1])
|| (i == gBattlerPartyIndexes[battlerIn2])
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn1))
@@ -129,9 +129,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
continue;
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES);
if (GetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM) != ABILITY_NONE)
monAbility = gBaseStats[species].abilities[1];
monAbility = gSpeciesInfo[species].abilities[1];
else
monAbility = gBaseStats[species].abilities[0];
monAbility = gSpeciesInfo[species].abilities[0];
if (absorbingTypeAbility == monAbility && Random() & 1)
{
// we found a mon
@@ -265,8 +265,8 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
u8 monAbility;
if ((GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
|| (i == gBattlerPartyIndexes[battlerIn1])
|| (i == gBattlerPartyIndexes[battlerIn2])
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn1))
@@ -274,9 +274,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
continue;
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES);
if (GetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM) != ABILITY_NONE)
monAbility = gBaseStats[species].abilities[1];
monAbility = gSpeciesInfo[species].abilities[1];
else
monAbility = gBaseStats[species].abilities[0];
monAbility = gSpeciesInfo[species].abilities[0];
moveFlags = AI_TypeCalc(gLastLandedMoves[gActiveBattler], species, monAbility);
if (moveFlags & flags)
{
@@ -330,8 +330,8 @@ static bool8 ShouldSwitch(void)
for (i = 0; i < PARTY_SIZE; ++i)
{
if ((GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
|| (i == gBattlerPartyIndexes[battlerIn1])
|| (i == gBattlerPartyIndexes[battlerIn2])
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn1))
@@ -472,8 +472,8 @@ u8 GetMostSuitableMonToSwitchInto(void)
&& i != *(gBattleStruct->monToSwitchIntoId + battlerIn1)
&& i != *(gBattleStruct->monToSwitchIntoId + battlerIn2))
{
u8 type1 = gBaseStats[species].type1;
u8 type2 = gBaseStats[species].type2;
u8 type1 = gSpeciesInfo[species].types[0];
u8 type2 = gSpeciesInfo[species].types[1];
u8 typeDmg = 10;
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type1, type1, type2, &typeDmg);
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type2, type1, type2, &typeDmg);
@@ -551,9 +551,9 @@ static u8 GetAI_ItemType(u8 itemId, const u8 *itemEffect) // NOTE: should take u
return AI_ITEM_HEAL_HP;
else if (itemEffect[3] & ITEM3_STATUS_ALL)
return AI_ITEM_CURE_CONDITION;
else if (itemEffect[0] & (ITEM0_HIGH_CRIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0)
else if (itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0)
return AI_ITEM_X_STAT;
else if (itemEffect[3] & ITEM3_MIST)
else if (itemEffect[3] & ITEM3_GUARD_SPEC)
return AI_ITEM_GUARD_SPECS;
else
return AI_ITEM_NOT_RECOGNIZABLE;
@@ -567,8 +567,8 @@ static bool8 ShouldUseItem(void)
for (i = 0; i < PARTY_SIZE; ++i)
if (GetMonData(&gEnemyParty[i], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
++validMons;
for (i = 0; i < MAX_TRAINER_ITEMS; ++i)
{
@@ -650,7 +650,7 @@ static bool8 ShouldUseItem(void)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8;
if (itemEffects[2] & ITEM2_X_ACCURACY)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20;
if (itemEffects[0] & ITEM0_HIGH_CRIT)
if (itemEffects[0] & ITEM0_DIRE_HIT)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x80;
shouldUse = TRUE;
break;
+4 -4
View File
@@ -470,7 +470,7 @@ static void Task_GiveExpToMon(u8 taskId)
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u32 currExp = GetMonData(mon, MON_DATA_EXP);
u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1];
u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= nextLvlExp)
{
@@ -512,11 +512,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId)
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 exp = GetMonData(mon, MON_DATA_EXP);
u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level];
u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
u32 expToNextLvl;
exp -= currLvlExp;
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp;
SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp);
PlaySE(SE_EXP);
gTasks[taskId].func = Task_GiveExpWithExpBar;
@@ -548,7 +548,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1];
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= expOnNextLvl)
{
u8 savedActiveBattler;
+4 -4
View File
@@ -1031,7 +1031,7 @@ static void Task_GiveExpToMon(u8 taskId)
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u32 currExp = GetMonData(mon, MON_DATA_EXP);
u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1];
u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= nextLvlExp)
{
@@ -1073,11 +1073,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId)
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 exp = GetMonData(mon, MON_DATA_EXP);
u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level];
u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
u32 expToNextLvl;
exp -= currLvlExp;
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp;
SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp);
PlaySE(SE_EXP);
gTasks[taskId].func = Task_GiveExpWithExpBar;
@@ -1109,7 +1109,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1];
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= expOnNextLvl)
{
u8 savedActiveBattler;
+4 -4
View File
@@ -451,7 +451,7 @@ static void Task_GiveExpToMon(u8 taskId)
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u32 currExp = GetMonData(mon, MON_DATA_EXP);
u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1];
u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= nextLvlExp)
{
@@ -493,11 +493,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId)
u8 level = GetMonData(mon, MON_DATA_LEVEL);
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 exp = GetMonData(mon, MON_DATA_EXP);
u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level];
u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
u32 expToNextLvl;
exp -= currLvlExp;
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp;
SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp);
PlaySE(SE_EXP);
gTasks[taskId].func = Task_GiveExpWithExpBar;
@@ -529,7 +529,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1];
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= expOnNextLvl)
{
u8 savedActiveBattler;
+7 -7
View File
@@ -302,8 +302,8 @@ static void SetBattlePartyIds(void)
if (GET_BATTLER_SIDE2(i) == B_SIDE_PLAYER)
{
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG))
{
gBattlerPartyIndexes[i] = j;
@@ -313,8 +313,8 @@ static void SetBattlePartyIds(void)
else
{
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG))
{
gBattlerPartyIndexes[i] = j;
@@ -328,7 +328,7 @@ static void SetBattlePartyIds(void)
{
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES) != SPECIES_NONE // Probably a typo by Game Freak. The rest use SPECIES2.
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG)
&& gBattlerPartyIndexes[i - 2] != j)
{
@@ -339,8 +339,8 @@ static void SetBattlePartyIds(void)
else
{
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG)
&& gBattlerPartyIndexes[i - 2] != j)
{
+2 -2
View File
@@ -1811,9 +1811,9 @@ void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elem
species = GetMonData(mon, MON_DATA_SPECIES);
level = GetMonData(mon, MON_DATA_LEVEL);
exp = GetMonData(mon, MON_DATA_EXP);
currLevelExp = gExperienceTables[gBaseStats[species].growthRate][level];
currLevelExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
currExpBarValue = exp - currLevelExp;
maxExpBarValue = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLevelExp;
maxExpBarValue = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLevelExp;
SetBattleBarStruct(battlerId, healthboxSpriteId, maxExpBarValue, currExpBarValue, isDoubles);
MoveBattleBar(battlerId, healthboxSpriteId, EXP_BAR, 0);
}
+40 -40
View File
@@ -715,33 +715,33 @@ static void CB2_InitBattleInternal(void)
gBattleCommunication[MULTIUSE_STATE] = 0;
}
#define BUFFER_PARTY_VS_SCREEN_STATUS(party, flags, i) \
for ((i) = 0; (i) < PARTY_SIZE; (i)++) \
{ \
u16 species = GetMonData(&(party)[(i)], MON_DATA_SPECIES2); \
u16 hp = GetMonData(&(party)[(i)], MON_DATA_HP); \
u32 status = GetMonData(&(party)[(i)], MON_DATA_STATUS); \
\
if (species == SPECIES_NONE) \
continue; \
\
/* Is healthy mon? */ \
if (species != SPECIES_EGG && hp != 0 && status == 0) \
(flags) |= 1 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is Egg or statused? */ \
if (hp != 0 && (species == SPECIES_EGG || status != 0)) \
(flags) |= 2 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is fainted? */ \
if (species != SPECIES_EGG && hp == 0) \
(flags) |= 3 << (i) * 2; \
#define BUFFER_PARTY_VS_SCREEN_STATUS(party, flags, i) \
for ((i) = 0; (i) < PARTY_SIZE; (i)++) \
{ \
u16 species = GetMonData(&(party)[(i)], MON_DATA_SPECIES_OR_EGG); \
u16 hp = GetMonData(&(party)[(i)], MON_DATA_HP); \
u32 status = GetMonData(&(party)[(i)], MON_DATA_STATUS); \
\
if (species == SPECIES_NONE) \
continue; \
\
/* Is healthy mon? */ \
if (species != SPECIES_EGG && hp != 0 && status == 0) \
(flags) |= 1 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is Egg or statused? */ \
if (hp != 0 && (species == SPECIES_EGG || status != 0)) \
(flags) |= 2 << (i) * 2; \
\
if (species == SPECIES_NONE) /* Redundant */ \
continue; \
\
/* Is fainted? */ \
if (species != SPECIES_EGG && hp == 0) \
(flags) |= 3 << (i) * 2; \
}
// For Vs Screen at link battle start
@@ -2277,8 +2277,8 @@ static void BattleStartClearSetData(void)
gBattleStruct->runTries = 0;
gBattleStruct->safariRockThrowCounter = 0;
gBattleStruct->safariBaitThrowCounter = 0;
*(&gBattleStruct->safariCatchFactor) = gBaseStats[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275;
*(&gBattleStruct->safariEscapeFactor) = gBaseStats[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].safariZoneFleeRate * 100 / 1275;
*(&gBattleStruct->safariCatchFactor) = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275;
*(&gBattleStruct->safariEscapeFactor) = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].safariZoneFleeRate * 100 / 1275;
if (gBattleStruct->safariEscapeFactor <= 1)
gBattleStruct->safariEscapeFactor = 2;
gBattleStruct->wildVictorySong = 0;
@@ -2508,8 +2508,8 @@ void FaintClearSetData(void)
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
}
gBattleResources->flags->flags[gActiveBattler] = 0;
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
}
static void BattleIntroGetMonsData(void)
@@ -2573,8 +2573,8 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
for (i = 0; i < sizeof(struct BattlePokemon); i++)
ptr[i] = gBattleBufferB[gActiveBattler][4 + i];
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)];
*hpOnSwitchout = gBattleMons[gActiveBattler].hp;
@@ -2651,8 +2651,8 @@ static void BattleIntroDrawPartySummaryScreens(void)
{
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -2669,8 +2669,8 @@ static void BattleIntroDrawPartySummaryScreens(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -2695,8 +2695,8 @@ static void BattleIntroDrawPartySummaryScreens(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatus[i].hp = HP_EMPTY_SLOT;
hpStatus[i].status = 0;
@@ -4337,7 +4337,7 @@ static void HandleAction_WatchesCarefully(void)
--gBattleStruct->safariRockThrowCounter;
if (gBattleStruct->safariRockThrowCounter == 0)
{
*(&gBattleStruct->safariCatchFactor) = gBaseStats[GetMonData(gEnemyParty, MON_DATA_SPECIES)].catchRate * 100 / 1275;
*(&gBattleStruct->safariCatchFactor) = gSpeciesInfo[GetMonData(gEnemyParty, MON_DATA_SPECIES)].catchRate * 100 / 1275;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MON_WATCHING;
}
else
+19 -19
View File
@@ -1514,7 +1514,7 @@ u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility)
{
s32 i = 0;
u8 flags = 0;
u8 type1 = gBaseStats[targetSpecies].type1, type2 = gBaseStats[targetSpecies].type2;
u8 type1 = gSpeciesInfo[targetSpecies].types[0], type2 = gSpeciesInfo[targetSpecies].types[1];
u8 moveType;
if (move == MOVE_STRUGGLE)
@@ -3163,7 +3163,7 @@ static void Cmd_getexp(void)
viaExpShare++;
}
calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7;
calculatedExp = gSpeciesInfo[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7;
if (viaExpShare) // at least one mon is getting exp via exp share
{
@@ -4480,8 +4480,8 @@ static void Cmd_switchindataupdate(void)
for (i = 0; i < sizeof(struct BattlePokemon); i++)
monData[i] = gBattleBufferB[gActiveBattler][4 + i];
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
// check knocked off item
@@ -5453,8 +5453,8 @@ static void Cmd_drawpartystatussummary(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
{
hpStatuses[i].hp = 0xFFFF;
hpStatuses[i].status = 0;
@@ -6168,7 +6168,7 @@ static void Cmd_various(void)
}
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
abilityNum = GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM);
status = GetMonData(&gPlayerParty[i], MON_DATA_STATUS);
if (species != SPECIES_NONE
@@ -6188,7 +6188,7 @@ static void Cmd_various(void)
monToCheck = 0;
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG);
abilityNum = GetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM);
status = GetMonData(&gEnemyParty[i], MON_DATA_STATUS);
@@ -8041,7 +8041,7 @@ static void Cmd_healpartystatus(void)
for (i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&party[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG);
u8 abilityNum = GetMonData(&party[i], MON_DATA_ABILITY_NUM);
if (species != SPECIES_NONE && species != SPECIES_EGG)
@@ -8587,8 +8587,8 @@ static void Cmd_trydobeatup(void)
for (;gBattleCommunication[0] < PARTY_SIZE; gBattleCommunication[0]++)
{
if (GetMonData(&party[gBattleCommunication[0]], MON_DATA_HP)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG)
&& GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& !GetMonData(&party[gBattleCommunication[0]], MON_DATA_STATUS))
break;
}
@@ -8598,10 +8598,10 @@ static void Cmd_trydobeatup(void)
gBattlescriptCurrInstr += 9;
gBattleMoveDamage = gBaseStats[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack;
gBattleMoveDamage = gSpeciesInfo[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack;
gBattleMoveDamage *= gBattleMoves[gCurrentMove].power;
gBattleMoveDamage *= (GetMonData(&party[gBattleCommunication[0]], MON_DATA_LEVEL) * 2 / 5 + 2);
gBattleMoveDamage /= gBaseStats[gBattleMons[gBattlerTarget].species].baseDefense;
gBattleMoveDamage /= gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseDefense;
gBattleMoveDamage = (gBattleMoveDamage / 50) + 2;
if (gProtectStructs[gBattlerAttacker].helpingHand)
gBattleMoveDamage = gBattleMoveDamage * 15 / 10;
@@ -9104,9 +9104,9 @@ static void Cmd_assistattackselect(void)
{
if (monId == gBattlerPartyIndexes[gBattlerAttacker])
continue;
if (GetMonData(&party[monId], MON_DATA_SPECIES2) == SPECIES_NONE)
if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE)
continue;
if (GetMonData(&party[monId], MON_DATA_SPECIES2) == SPECIES_EGG)
if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG)
continue;
for (moveId = 0; moveId < MAX_MON_MOVES; moveId++)
@@ -9267,12 +9267,12 @@ static void Cmd_pickup(void)
for (i = 0; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM) != ABILITY_NONE)
ability = gBaseStats[species].abilities[1];
ability = gSpeciesInfo[species].abilities[1];
else
ability = gBaseStats[species].abilities[0];
ability = gSpeciesInfo[species].abilities[0];
if (ability == ABILITY_PICKUP && species != SPECIES_NONE && species != SPECIES_EGG && heldItem == ITEM_NONE && !(Random() % 10))
{
s32 random = Random() % 100;
@@ -9496,7 +9496,7 @@ static void Cmd_handleballthrow(void)
if (gLastUsedItem == ITEM_SAFARI_BALL)
catchRate = gBattleStruct->safariCatchFactor * 1275 / 100;
else
catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate;
catchRate = gSpeciesInfo[gBattleMons[gBattlerTarget].species].catchRate;
if (gLastUsedItem > ITEM_SAFARI_BALL)
{
+1 -1
View File
@@ -545,7 +545,7 @@ static u16 GetSumOfPlayerPartyLevel(u8 numMons)
for (i = 0; i < PARTY_SIZE; ++i)
{
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_EGG && species != SPECIES_NONE && GetMonData(&gPlayerParty[i], MON_DATA_HP) != 0)
{
+1 -1
View File
@@ -796,7 +796,7 @@ void CheckPartyBattleTowerBanlist(void)
for (i = 0; i < PARTY_SIZE; i++)
{
species2 = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species2 = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
hp = GetMonData(&gPlayerParty[i], MON_DATA_HP);
+7 -7
View File
@@ -1560,8 +1560,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
break;
}
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
@@ -1589,8 +1589,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
&& GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG
&& i != partyIdBattlerOn1 && i != partyIdBattlerOn2
&& i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId])
break;
@@ -3130,14 +3130,14 @@ u8 GetMoveTarget(u16 move, u8 setTarget)
return targetBattler;
}
static bool32 IsMonEventLegal(u8 battlerId)
static bool32 IsBattlerModernFatefulEncounter(u8 battlerId)
{
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
return TRUE;
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS
&& GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW)
return TRUE;
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_EVENT_LEGAL, NULL);
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_MODERN_FATEFUL_ENCOUNTER, NULL);
}
u8 IsMonDisobedient(void)
@@ -3151,7 +3151,7 @@ u8 IsMonDisobedient(void)
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)
return 0;
if (IsMonEventLegal(gBattlerAttacker)) // only false if illegal Mew or Deoxys
if (IsBattlerModernFatefulEncounter(gBattlerAttacker)) // only false if illegal Mew or Deoxys
{
if (!IsOtherTrainer(gBattleMons[gBattlerAttacker].otId, gBattleMons[gBattlerAttacker].otName))
return 0;
+1 -1
View File
@@ -2948,7 +2948,7 @@
"english": "SOOTHE BELL",
"itemId": "ITEM_SOOTHE_BELL",
"price": 100,
"holdEffect": "HOLD_EFFECT_HAPPINESS_UP",
"holdEffect": "HOLD_EFFECT_FRIENDSHIP_UP",
"holdEffectParam": 0,
"description_english": "An item to be held by a POKéMON.\\nA bell with a comforting chime that\\nmakes the holder calm and friendly.",
"importance": 0,
+135 -151
View File
@@ -1,6 +1,6 @@
static const u8 sItemEffect_Potion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 20,
[6] = 20, // Amount of HP to recover
};
static const u8 sItemEffect_Antidote[6] = {
@@ -26,22 +26,22 @@ static const u8 sItemEffect_ParalyzeHeal[6] = {
static const u8 sItemEffect_FullRestore[7] = {
[3] = ITEM3_STATUS_ALL,
[4] = ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
static const u8 sItemEffect_MaxPotion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
static const u8 sItemEffect_HyperPotion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 200,
[6] = 200, // Amount of HP to recover
};
static const u8 sItemEffect_SuperPotion[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 50,
[6] = 50, // Amount of HP to recover
};
static const u8 sItemEffect_FullHeal[6] = {
@@ -50,87 +50,87 @@ static const u8 sItemEffect_FullHeal[6] = {
static const u8 sItemEffect_Revive[7] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[6] = -2,
[6] = ITEM6_HEAL_HP_HALF,
};
static const u8 sItemEffect_MaxRevive[7] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
static const u8 sItemEffect_FreshWater[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 50,
[6] = 50, // Amount of HP to recover
};
static const u8 sItemEffect_SodaPop[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 60,
[6] = 60, // Amount of HP to recover
};
static const u8 sItemEffect_Lemonade[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 80,
[6] = 80, // Amount of HP to recover
};
static const u8 sItemEffect_MoomooMilk[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 100,
[6] = 100, // Amount of HP to recover
};
static const u8 sItemEffect_EnergyPowder[10] = {
[4] = ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 50,
[7] = -5,
[8] = -5,
[9] = -10,
[6] = 50, // Amount of HP to recover
[7] = -5, // Friendship change, low
[8] = -5, // Friendship change, mid
[9] = -10, // Friendship change, high
};
static const u8 sItemEffect_EnergyRoot[10] = {
[4] = ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 200,
[7] = -10,
[8] = -10,
[9] = -15,
[6] = 200, // Amount of HP to recover
[7] = -10, // Friendship change, low
[8] = -10, // Friendship change, mid
[9] = -15, // Friendship change, high
};
static const u8 sItemEffect_HealPowder[9] = {
[3] = ITEM3_STATUS_ALL,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = -5,
[7] = -5,
[8] = -10,
[6] = -5, // Friendship change, low
[7] = -5, // Friendship change, mid
[8] = -10, // Friendship change, high
};
static const u8 sItemEffect_RevivalHerb[10] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = -1,
[7] = -15,
[8] = -15,
[9] = -20,
[6] = ITEM6_HEAL_HP_FULL,
[7] = -15, // Friendship change, low
[8] = -15, // Friendship change, mid
[9] = -20, // Friendship change, high
};
static const u8 sItemEffect_Ether[7] = {
[4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL,
[6] = 10,
[6] = 10, // Amount of PP to recover
};
static const u8 sItemEffect_MaxEther[7] = {
[4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL,
[6] = 0x7F,
[6] = ITEM6_HEAL_PP_FULL,
};
static const u8 sItemEffect_Elixir[7] = {
[4] = ITEM4_HEAL_PP_ALL,
[6] = 10,
[6] = 10, // Amount of PP to recover
};
static const u8 sItemEffect_MaxElixir[7] = {
[4] = ITEM4_HEAL_PP_ALL,
[6] = 0x7F,
[6] = ITEM6_HEAL_PP_FULL,
};
static const u8 sItemEffect_LavaCookie[6] = {
@@ -151,137 +151,121 @@ static const u8 sItemEffect_RedFlute[6] = {
static const u8 sItemEffect_BerryJuice[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 20,
[6] = 20, // Amount of HP to recover
};
static const u8 sItemEffect_SacredAsh[7] = {
[0] = ITEM0_SACRED_ASH,
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[6] = -1,
[6] = ITEM6_HEAL_HP_FULL,
};
#define VITAMIN_FRIENDSHIP_CHANGE(i) \
[(i) + 0] = 5, /* Friendship change, low */ \
[(i) + 1] = 3, /* Friendship change, mid */ \
[(i) + 2] = 2 /* Friendship change, high */
static const u8 sItemEffect_HPUp[10] = {
[4] = ITEM4_EV_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Protein[10] = {
[4] = ITEM4_EV_ATK,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Iron[10] = {
[5] = ITEM5_EV_DEF | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Carbos[10] = {
[5] = ITEM5_EV_SPEED | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_Calcium[10] = {
[5] = ITEM5_EV_SPATK | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_RareCandy[10] = {
[3] = ITEM3_LEVEL_UP,
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 0xFD,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_HEAL_HP_LVL_UP,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_PPUp[9] = {
[4] = ITEM4_PP_UP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = 5,
[7] = 3,
[8] = 2,
VITAMIN_FRIENDSHIP_CHANGE(6),
};
static const u8 sItemEffect_Zinc[10] = {
[5] = ITEM5_EV_SPDEF | ITEM5_FRIENDSHIP_ALL,
[6] = 10,
[7] = 5,
[8] = 3,
[9] = 2,
[6] = ITEM6_ADD_EV,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
static const u8 sItemEffect_PPMax[9] = {
[5] = ITEM5_PP_MAX | ITEM5_FRIENDSHIP_ALL,
[6] = 5,
[7] = 3,
[8] = 2,
VITAMIN_FRIENDSHIP_CHANGE(6),
};
#define STAT_BOOST_FRIENDSHIP_CHANGE \
[6] = 1, /* Friendship change, low */ \
[7] = 1 /* Friendship change, mid */
static const u8 sItemEffect_GuardSpec[8] = {
[3] = ITEM3_MIST,
[3] = ITEM3_GUARD_SPEC,
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE
};
static const u8 sItemEffect_DireHit[8] = {
[0] = 2 << 4,
[0] = 2 << 4, // ITEM0_DIRE_HIT
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE
};
static const u8 sItemEffect_XAttack[8] = {
[0] = 1,
[0] = 1, // ITEM0_X_ATTACK
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE
};
static const u8 sItemEffect_XDefend[8] = {
[1] = 1 << 4,
[1] = 1 << 4, /// ITEM1_X_DEFEND
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_XSpeed[8] = {
[1] = 1,
[1] = 1, // ITEM1_X_SPEED
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_XAccuracy[8] = {
[2] = 1 << 4,
[2] = 1 << 4, // ITEM2_X_ACCURACY
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_XSpecial[8] = {
[2] = 1,
[2] = 1, // ITEM2_X_SPATK
[5] = ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID,
[6] = 1,
[7] = 1,
STAT_BOOST_FRIENDSHIP_CHANGE,
};
static const u8 sItemEffect_SunStone[6] = {
@@ -330,12 +314,12 @@ static const u8 sItemEffect_AspearBerry[6] = {
static const u8 sItemEffect_LeppaBerry[7] = {
[4] = ITEM4_HEAL_PP_ONE | ITEM4_HEAL_PP_ALL,
[6] = 10,
[6] = 10, // Amount of PP to recover
};
static const u8 sItemEffect_OranBerry[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 10,
[6] = 10, // Amount of HP to recover
};
static const u8 sItemEffect_PersimBerry[6] = {
@@ -348,73 +332,73 @@ static const u8 sItemEffect_LumBerry[6] = {
static const u8 sItemEffect_SitrusBerry[7] = {
[4] = ITEM4_HEAL_HP,
[6] = 30,
[6] = 30, // Amount of HP to recover
};
const u8 *const gItemEffectTable[] =
{
[ITEM_POTION - ITEM_POTION] = sItemEffect_Potion,
[ITEM_ANTIDOTE - ITEM_POTION] = sItemEffect_Antidote,
[ITEM_BURN_HEAL - ITEM_POTION] = sItemEffect_BurnHeal,
[ITEM_ICE_HEAL - ITEM_POTION] = sItemEffect_IceHeal,
[ITEM_AWAKENING - ITEM_POTION] = sItemEffect_Awakening,
[ITEM_POTION - ITEM_POTION] = sItemEffect_Potion,
[ITEM_ANTIDOTE - ITEM_POTION] = sItemEffect_Antidote,
[ITEM_BURN_HEAL - ITEM_POTION] = sItemEffect_BurnHeal,
[ITEM_ICE_HEAL - ITEM_POTION] = sItemEffect_IceHeal,
[ITEM_AWAKENING - ITEM_POTION] = sItemEffect_Awakening,
[ITEM_PARALYZE_HEAL - ITEM_POTION] = sItemEffect_ParalyzeHeal,
[ITEM_FULL_RESTORE - ITEM_POTION] = sItemEffect_FullRestore,
[ITEM_MAX_POTION - ITEM_POTION] = sItemEffect_MaxPotion,
[ITEM_HYPER_POTION - ITEM_POTION] = sItemEffect_HyperPotion,
[ITEM_SUPER_POTION - ITEM_POTION] = sItemEffect_SuperPotion,
[ITEM_FULL_HEAL - ITEM_POTION] = sItemEffect_FullHeal,
[ITEM_REVIVE - ITEM_POTION] = sItemEffect_Revive,
[ITEM_MAX_REVIVE - ITEM_POTION] = sItemEffect_MaxRevive,
[ITEM_FRESH_WATER - ITEM_POTION] = sItemEffect_FreshWater,
[ITEM_SODA_POP - ITEM_POTION] = sItemEffect_SodaPop,
[ITEM_LEMONADE - ITEM_POTION] = sItemEffect_Lemonade,
[ITEM_MOOMOO_MILK - ITEM_POTION] = sItemEffect_MoomooMilk,
[ITEM_FULL_RESTORE - ITEM_POTION] = sItemEffect_FullRestore,
[ITEM_MAX_POTION - ITEM_POTION] = sItemEffect_MaxPotion,
[ITEM_HYPER_POTION - ITEM_POTION] = sItemEffect_HyperPotion,
[ITEM_SUPER_POTION - ITEM_POTION] = sItemEffect_SuperPotion,
[ITEM_FULL_HEAL - ITEM_POTION] = sItemEffect_FullHeal,
[ITEM_REVIVE - ITEM_POTION] = sItemEffect_Revive,
[ITEM_MAX_REVIVE - ITEM_POTION] = sItemEffect_MaxRevive,
[ITEM_FRESH_WATER - ITEM_POTION] = sItemEffect_FreshWater,
[ITEM_SODA_POP - ITEM_POTION] = sItemEffect_SodaPop,
[ITEM_LEMONADE - ITEM_POTION] = sItemEffect_Lemonade,
[ITEM_MOOMOO_MILK - ITEM_POTION] = sItemEffect_MoomooMilk,
[ITEM_ENERGY_POWDER - ITEM_POTION] = sItemEffect_EnergyPowder,
[ITEM_ENERGY_ROOT - ITEM_POTION] = sItemEffect_EnergyRoot,
[ITEM_HEAL_POWDER - ITEM_POTION] = sItemEffect_HealPowder,
[ITEM_REVIVAL_HERB - ITEM_POTION] = sItemEffect_RevivalHerb,
[ITEM_ETHER - ITEM_POTION] = sItemEffect_Ether,
[ITEM_MAX_ETHER - ITEM_POTION] = sItemEffect_MaxEther,
[ITEM_ELIXIR - ITEM_POTION] = sItemEffect_Elixir,
[ITEM_MAX_ELIXIR - ITEM_POTION] = sItemEffect_MaxElixir,
[ITEM_LAVA_COOKIE - ITEM_POTION] = sItemEffect_LavaCookie,
[ITEM_BLUE_FLUTE - ITEM_POTION] = sItemEffect_BlueFlute,
[ITEM_YELLOW_FLUTE - ITEM_POTION] = sItemEffect_YellowFlute,
[ITEM_RED_FLUTE - ITEM_POTION] = sItemEffect_RedFlute,
[ITEM_BERRY_JUICE - ITEM_POTION] = sItemEffect_BerryJuice,
[ITEM_SACRED_ASH - ITEM_POTION] = sItemEffect_SacredAsh,
[ITEM_HP_UP - ITEM_POTION] = sItemEffect_HPUp,
[ITEM_PROTEIN - ITEM_POTION] = sItemEffect_Protein,
[ITEM_IRON - ITEM_POTION] = sItemEffect_Iron,
[ITEM_CARBOS - ITEM_POTION] = sItemEffect_Carbos,
[ITEM_CALCIUM - ITEM_POTION] = sItemEffect_Calcium,
[ITEM_RARE_CANDY - ITEM_POTION] = sItemEffect_RareCandy,
[ITEM_PP_UP - ITEM_POTION] = sItemEffect_PPUp,
[ITEM_ZINC - ITEM_POTION] = sItemEffect_Zinc,
[ITEM_PP_MAX - ITEM_POTION] = sItemEffect_PPMax,
[ITEM_GUARD_SPEC - ITEM_POTION] = sItemEffect_GuardSpec,
[ITEM_DIRE_HIT - ITEM_POTION] = sItemEffect_DireHit,
[ITEM_X_ATTACK - ITEM_POTION] = sItemEffect_XAttack,
[ITEM_X_DEFEND - ITEM_POTION] = sItemEffect_XDefend,
[ITEM_X_SPEED - ITEM_POTION] = sItemEffect_XSpeed,
[ITEM_X_ACCURACY - ITEM_POTION] = sItemEffect_XAccuracy,
[ITEM_X_SPECIAL - ITEM_POTION] = sItemEffect_XSpecial,
[ITEM_SUN_STONE - ITEM_POTION] = sItemEffect_SunStone,
[ITEM_MOON_STONE - ITEM_POTION] = sItemEffect_MoonStone,
[ITEM_FIRE_STONE - ITEM_POTION] = sItemEffect_FireStone,
[ITEM_ENERGY_ROOT - ITEM_POTION] = sItemEffect_EnergyRoot,
[ITEM_HEAL_POWDER - ITEM_POTION] = sItemEffect_HealPowder,
[ITEM_REVIVAL_HERB - ITEM_POTION] = sItemEffect_RevivalHerb,
[ITEM_ETHER - ITEM_POTION] = sItemEffect_Ether,
[ITEM_MAX_ETHER - ITEM_POTION] = sItemEffect_MaxEther,
[ITEM_ELIXIR - ITEM_POTION] = sItemEffect_Elixir,
[ITEM_MAX_ELIXIR - ITEM_POTION] = sItemEffect_MaxElixir,
[ITEM_LAVA_COOKIE - ITEM_POTION] = sItemEffect_LavaCookie,
[ITEM_BLUE_FLUTE - ITEM_POTION] = sItemEffect_BlueFlute,
[ITEM_YELLOW_FLUTE - ITEM_POTION] = sItemEffect_YellowFlute,
[ITEM_RED_FLUTE - ITEM_POTION] = sItemEffect_RedFlute,
[ITEM_BERRY_JUICE - ITEM_POTION] = sItemEffect_BerryJuice,
[ITEM_SACRED_ASH - ITEM_POTION] = sItemEffect_SacredAsh,
[ITEM_HP_UP - ITEM_POTION] = sItemEffect_HPUp,
[ITEM_PROTEIN - ITEM_POTION] = sItemEffect_Protein,
[ITEM_IRON - ITEM_POTION] = sItemEffect_Iron,
[ITEM_CARBOS - ITEM_POTION] = sItemEffect_Carbos,
[ITEM_CALCIUM - ITEM_POTION] = sItemEffect_Calcium,
[ITEM_RARE_CANDY - ITEM_POTION] = sItemEffect_RareCandy,
[ITEM_PP_UP - ITEM_POTION] = sItemEffect_PPUp,
[ITEM_ZINC - ITEM_POTION] = sItemEffect_Zinc,
[ITEM_PP_MAX - ITEM_POTION] = sItemEffect_PPMax,
[ITEM_GUARD_SPEC - ITEM_POTION] = sItemEffect_GuardSpec,
[ITEM_DIRE_HIT - ITEM_POTION] = sItemEffect_DireHit,
[ITEM_X_ATTACK - ITEM_POTION] = sItemEffect_XAttack,
[ITEM_X_DEFEND - ITEM_POTION] = sItemEffect_XDefend,
[ITEM_X_SPEED - ITEM_POTION] = sItemEffect_XSpeed,
[ITEM_X_ACCURACY - ITEM_POTION] = sItemEffect_XAccuracy,
[ITEM_X_SPECIAL - ITEM_POTION] = sItemEffect_XSpecial,
[ITEM_SUN_STONE - ITEM_POTION] = sItemEffect_SunStone,
[ITEM_MOON_STONE - ITEM_POTION] = sItemEffect_MoonStone,
[ITEM_FIRE_STONE - ITEM_POTION] = sItemEffect_FireStone,
[ITEM_THUNDER_STONE - ITEM_POTION] = sItemEffect_ThunderStone,
[ITEM_WATER_STONE - ITEM_POTION] = sItemEffect_WaterStone,
[ITEM_LEAF_STONE - ITEM_POTION] = sItemEffect_LeafStone,
[ITEM_CHERI_BERRY - ITEM_POTION] = sItemEffect_CheriBerry,
[ITEM_CHESTO_BERRY - ITEM_POTION] = sItemEffect_ChestoBerry,
[ITEM_PECHA_BERRY - ITEM_POTION] = sItemEffect_PechaBerry,
[ITEM_RAWST_BERRY - ITEM_POTION] = sItemEffect_RawstBerry,
[ITEM_ASPEAR_BERRY - ITEM_POTION] = sItemEffect_AspearBerry,
[ITEM_LEPPA_BERRY - ITEM_POTION] = sItemEffect_LeppaBerry,
[ITEM_ORAN_BERRY - ITEM_POTION] = sItemEffect_OranBerry,
[ITEM_PERSIM_BERRY - ITEM_POTION] = sItemEffect_PersimBerry,
[ITEM_LUM_BERRY - ITEM_POTION] = sItemEffect_LumBerry,
[ITEM_SITRUS_BERRY - ITEM_POTION] = sItemEffect_SitrusBerry,
[LAST_BERRY_INDEX - ITEM_POTION] = NULL,
[ITEM_WATER_STONE - ITEM_POTION] = sItemEffect_WaterStone,
[ITEM_LEAF_STONE - ITEM_POTION] = sItemEffect_LeafStone,
[ITEM_CHERI_BERRY - ITEM_POTION] = sItemEffect_CheriBerry,
[ITEM_CHESTO_BERRY - ITEM_POTION] = sItemEffect_ChestoBerry,
[ITEM_PECHA_BERRY - ITEM_POTION] = sItemEffect_PechaBerry,
[ITEM_RAWST_BERRY - ITEM_POTION] = sItemEffect_RawstBerry,
[ITEM_ASPEAR_BERRY - ITEM_POTION] = sItemEffect_AspearBerry,
[ITEM_LEPPA_BERRY - ITEM_POTION] = sItemEffect_LeppaBerry,
[ITEM_ORAN_BERRY - ITEM_POTION] = sItemEffect_OranBerry,
[ITEM_PERSIM_BERRY - ITEM_POTION] = sItemEffect_PersimBerry,
[ITEM_LUM_BERRY - ITEM_POTION] = sItemEffect_LumBerry,
[ITEM_SITRUS_BERRY - ITEM_POTION] = sItemEffect_SitrusBerry,
[LAST_BERRY_INDEX - ITEM_POTION] = NULL,
};
File diff suppressed because it is too large Load Diff
+13 -21
View File
@@ -1092,13 +1092,13 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
u8 metLocation;
u8 isEgg;
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, FALSE, 0, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
SetMonData(mon, MON_DATA_POKEBALL, &ball);
SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gSpeciesInfo[species].eggCycles);
SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel);
SetMonData(mon, MON_DATA_LANGUAGE, &language);
if (setHotSpringsLocation)
@@ -1119,13 +1119,13 @@ static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *
u8 language;
personality = daycare->offspringPersonality | (Random() << 16);
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, TRUE, personality, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
SetMonData(mon, MON_DATA_POKEBALL, &ball);
SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles);
SetMonData(mon, MON_DATA_FRIENDSHIP, &gSpeciesInfo[species].eggCycles);
SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel);
SetMonData(mon, MON_DATA_LANGUAGE, &language);
}
@@ -1284,8 +1284,8 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
trainerIds[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_OT_ID);
personality = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_PERSONALITY);
genders[i] = GetGenderFromSpeciesAndPersonality(species[i], personality);
eggGroups[i][0] = gBaseStats[species[i]].eggGroup1;
eggGroups[i][1] = gBaseStats[species[i]].eggGroup2;
eggGroups[i][0] = gSpeciesInfo[species[i]].eggGroups[0];
eggGroups[i][1] = gSpeciesInfo[species[i]].eggGroups[1];
}
// check unbreedable egg group
@@ -1594,42 +1594,34 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
{
u16 species;
u32 personality, pokerus;
u8 i, friendship, language, gameMet, markings, isEventLegal;
u16 moves[4];
u8 i, friendship, language, gameMet, markings, isModernFatefulEncounter;
u16 moves[MAX_MON_MOVES];
u32 ivs[NUM_STATS];
species = GetMonData(egg, MON_DATA_SPECIES);
for (i = 0; i < 4; i++)
{
for (i = 0; i < MAX_MON_MOVES; i++)
moves[i] = GetMonData(egg, MON_DATA_MOVE1 + i);
}
personality = GetMonData(egg, MON_DATA_PERSONALITY);
for (i = 0; i < NUM_STATS; i++)
{
ivs[i] = GetMonData(egg, MON_DATA_HP_IV + i);
}
// language = GetMonData(egg, MON_DATA_LANGUAGE);
gameMet = GetMonData(egg, MON_DATA_MET_GAME);
markings = GetMonData(egg, MON_DATA_MARKINGS);
pokerus = GetMonData(egg, MON_DATA_POKERUS);
isEventLegal = GetMonData(egg, MON_DATA_EVENT_LEGAL);
isModernFatefulEncounter = GetMonData(egg, MON_DATA_MODERN_FATEFUL_ENCOUNTER);
CreateMon(temp, species, EGG_HATCH_LEVEL, 32, TRUE, personality, 0, 0);
CreateMon(temp, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
for (i = 0; i < 4; i++)
{
for (i = 0; i < MAX_MON_MOVES; i++)
SetMonData(temp, MON_DATA_MOVE1 + i, &moves[i]);
}
for (i = 0; i < NUM_STATS; i++)
{
SetMonData(temp, MON_DATA_HP_IV + i, &ivs[i]);
}
language = GAME_LANGUAGE;
SetMonData(temp, MON_DATA_LANGUAGE, &language);
@@ -1639,7 +1631,7 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
friendship = 120;
SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship);
SetMonData(temp, MON_DATA_POKERUS, &pokerus);
SetMonData(temp, MON_DATA_EVENT_LEGAL, &isEventLegal);
SetMonData(temp, MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter);
*egg = *temp;
}
+1 -1
View File
@@ -2914,7 +2914,7 @@ void IsDodrioInParty(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_DODRIO)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_DODRIO)
{
gSpecialVar_Result = TRUE;
return;
+1 -1
View File
@@ -12,7 +12,7 @@
static bool32 IsMonValidSpecies(struct Pokemon *pokemon)
{
u16 species = GetMonData(pokemon, MON_DATA_SPECIES2);
u16 species = GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_NONE || species == SPECIES_EGG)
return FALSE;
return TRUE;
+8 -8
View File
@@ -199,7 +199,7 @@ bool8 PlayerHasGrassPokemonInParty(void)
)
{
species = GetMonData(pokemon, MON_DATA_SPECIES);
if (gBaseStats[species].type1 == TYPE_GRASS || gBaseStats[species].type2 == TYPE_GRASS)
if (gSpeciesInfo[species].types[0] == TYPE_GRASS || gSpeciesInfo[species].types[1] == TYPE_GRASS)
return TRUE;
}
}
@@ -423,7 +423,7 @@ bool8 IsStarterFirstStageInParty(void)
u8 i;
for (i = 0; i < partyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) == species)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) == species)
return TRUE;
}
return FALSE;
@@ -515,7 +515,7 @@ u8 GetLeadMonIndex(void)
for (i = 0; i < partyCount; i++)
{
pokemon = &gPlayerParty[i];
if (GetMonData(pokemon, MON_DATA_SPECIES2, NULL) != SPECIES_EGG && GetMonData(pokemon, MON_DATA_SPECIES2, NULL) != SPECIES_NONE)
if (GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_EGG && GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_NONE)
return i;
}
return 0;
@@ -523,7 +523,7 @@ u8 GetLeadMonIndex(void)
u16 GetPartyMonSpecies(void)
{
return GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES2, NULL);
return GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES_OR_EGG, NULL);
}
bool8 IsMonOTNameNotPlayers(void)
@@ -1716,7 +1716,7 @@ void UpdateTrainerCardPhotoIcons(void)
partyCount = CalculatePlayerPartyCount();
for (i = 0; i < partyCount; i++)
{
species[i] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL);
species[i] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL);
personality[i] = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY, NULL);
}
VarSet(VAR_TRAINER_CARD_MON_ICON_1, SpeciesToMailSpecies(species[0], personality[0]));
@@ -1768,7 +1768,7 @@ bool8 DoesPlayerPartyContainSpecies(void)
u8 i;
for (i = 0; i < partyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) == gSpecialVar_0x8004)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) == gSpecialVar_0x8004)
return TRUE;
}
return FALSE;
@@ -2232,7 +2232,7 @@ bool8 CapeBrinkGetMoveToTeachLeadPokemon(void)
gSpecialVar_0x8007 = leadMonSlot;
for (i = 0; i < NELEMS(sCapeBrinkCompatibleSpecies); i++)
{
if (GetMonData(&gPlayerParty[leadMonSlot], MON_DATA_SPECIES2, NULL) == sCapeBrinkCompatibleSpecies[i])
if (GetMonData(&gPlayerParty[leadMonSlot], MON_DATA_SPECIES_OR_EGG, NULL) == sCapeBrinkCompatibleSpecies[i])
{
tutorMonId = i;
break;
@@ -2500,7 +2500,7 @@ bool8 PlayerPartyContainsSpeciesWithPlayerID(void)
u8 i;
for (i = 0; i < playerCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) == gSpecialVar_0x8004
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) == gSpecialVar_0x8004
&& GetPlayerTrainerId() == GetMonData(&gPlayerParty[i], MON_DATA_OT_ID, NULL))
return TRUE;
}
+1 -1
View File
@@ -390,7 +390,7 @@ static void Task_Hof_InitMonData(u8 taskId)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE)
{
sHofMonPtr[0].mon[i].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
sHofMonPtr[0].mon[i].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
sHofMonPtr[0].mon[i].tid = GetMonData(&gPlayerParty[i], MON_DATA_OT_ID);
sHofMonPtr[0].mon[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
sHofMonPtr[0].mon[i].lvl = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
+1 -1
View File
@@ -923,7 +923,7 @@ void ItemUse_SetQuestLogEvent(u8 eventId, struct Pokemon *pokemon, u16 itemId, u
questLog->itemId = itemId;
questLog->param = param;
if (pokemon != NULL)
questLog->species = GetMonData(pokemon, MON_DATA_SPECIES2);
questLog->species = GetMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
else
questLog->species = 0xFFFF;
SetQuestLogEvent(eventId, (void *)questLog);
+1
View File
@@ -3,6 +3,7 @@
#include "gba/flash_internal.h"
#include "load_save.h"
#include "pokemon.h"
#include "pokemon_storage_system.h"
#include "random.h"
#include "item.h"
#include "save_location.h"
+1 -1
View File
@@ -242,7 +242,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx)
void *mailPtr = (void *)(data + sizeof(struct Pokemon));
pokemon = *(struct Pokemon *)pokemonPtr;
species = GetMonData(&pokemon, MON_DATA_SPECIES2);
species = GetMonData(&pokemon, MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_EGG)
StringCopyN(gStringVar1, gText_EggNickname, POKEMON_NAME_LENGTH + 1);
+3 -3
View File
@@ -722,7 +722,7 @@ static void Task_NewGameScene(u8 taskId)
break;
case 1:
sOakSpeechResources = AllocZeroed(sizeof(*sOakSpeechResources));
OakSpeechNidoranFSetup(1, TRUE);
CreateMonSpritesGfxManager(1, 1);
break;
case 2:
SetGpuReg(REG_OFFSET_WIN0H, 0);
@@ -1775,7 +1775,7 @@ static void Task_OakSpeech_WaitForFade(u8 taskId)
static void Task_OakSpeech_FreeResources(u8 taskId)
{
FreeAllWindowBuffers();
OakSpeechNidoranFFreeResources();
DestroyMonSpritesGfxManager();
Free(sOakSpeechResources);
sOakSpeechResources = NULL;
gTextFlags.canABSpeedUpPrint = FALSE;
@@ -1876,7 +1876,7 @@ static void CreateNidoranFSprite(u8 taskId)
{
u8 spriteId;
DecompressPicFromTable(&gMonFrontPicTable[SPECIES_NIDORAN_F], OakSpeechNidoranFGetBuffer(0), SPECIES_NIDORAN_F);
DecompressPicFromTable(&gMonFrontPicTable[SPECIES_NIDORAN_F], MonSpritesGfxManager_GetSpritePtr(0), SPECIES_NIDORAN_F);
LoadCompressedSpritePaletteUsingHeap(&gMonPaletteTable[SPECIES_NIDORAN_F]);
SetMultiuseSpriteTemplateToPokemon(SPECIES_NIDORAN_F, 0);
spriteId = CreateSprite(&gMultiuseSpriteTemplate, 96, 96, 1);
+13 -13
View File
@@ -2652,7 +2652,7 @@ static void CreatePartyMonIconSprite(struct Pokemon *mon, struct PartyMenuBox *m
// If in a multi battle, show partners Deoxys icon as Normal forme
if (IsMultiBattle() == TRUE && gMain.inBattle)
handleDeoxys = (sMultiBattlePartnersPartyMask[slot] ^ handleDeoxys) ? TRUE : FALSE;
species2 = GetMonData(mon, MON_DATA_SPECIES2);
species2 = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
CreatePartyMonIconSpriteParameterized(species2, GetMonData(mon, MON_DATA_PERSONALITY), menuBox, 1, handleDeoxys);
UpdatePartyMonHPBar(menuBox->monSpriteId, mon);
}
@@ -3357,8 +3357,8 @@ static void SetSwitchedPartyOrderQuestLogEvent(void)
{
u16 *buffer = Alloc(2 * sizeof(u16));
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES2);
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES_OR_EGG);
SetQuestLogEvent(QL_EVENT_SWITCHED_PARTY_ORDER, buffer);
Free(buffer);
}
@@ -3847,11 +3847,11 @@ static void CursorCB_Store(u8 taskId)
// Register mon for the Trading Board in Union Room
static void CursorCB_Register(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isEventLegal))
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isModernFatefulEncounter))
{
case CANT_REGISTER_MON:
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
@@ -3874,10 +3874,10 @@ static void CursorCB_Register(u8 taskId)
static void CursorCB_Trade1(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isModernFatefulEncounter);
if (stringId != UR_TRADE_MSG_NONE)
{
@@ -4133,7 +4133,7 @@ static void SetSwappedHeldItemQuestLogEvent(struct Pokemon *mon, u16 item, u16 i
{
u16 *ptr = Alloc(4 * sizeof(u16));
ptr[2] = GetMonData(mon, MON_DATA_SPECIES2);
ptr[2] = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
ptr[0] = item;
ptr[1] = item2;
if (gPartyMenu.action == PARTY_ACTION_GIVE_PC_ITEM)
@@ -4154,7 +4154,7 @@ static void SetUsedFieldMoveQuestLogEvent(struct Pokemon *mon, u8 fieldMove)
{
struct FieldMoveWarpParams *ptr = Alloc(sizeof(*ptr));
ptr->species = GetMonData(mon, MON_DATA_SPECIES2);
ptr->species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
ptr->fieldMove = fieldMove;
switch (ptr->fieldMove)
{
@@ -4187,7 +4187,7 @@ void SetUsedFlyQuestLogEvent(const u8 *healLocCtrlData)
mapHeader = Overworld_GetMapHeaderByGroupAndId(ptr->mapGroup, ptr->mapNum);
Free(ptr);
ptr2 = Alloc(4);
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES2);
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES_OR_EGG);
ptr2->fieldMove = FIELD_MOVE_FLY;
ptr2->regionMapSectionId = mapHeader->regionMapSectionId;
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (u16 *)ptr2);
@@ -5342,7 +5342,7 @@ u8 GetItemEffectType(u16 item)
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
itemEffect = gItemEffectTable[item - ITEM_POTION];
if ((itemEffect[0] & (ITEM0_HIGH_CRIT | ITEM0_X_ATTACK)) || itemEffect[1] || itemEffect[2] || (itemEffect[3] & ITEM3_MIST))
if ((itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK)) || itemEffect[1] || itemEffect[2] || (itemEffect[3] & ITEM3_GUARD_SPEC))
return ITEM_EFFECT_X_ITEM;
else if (itemEffect[0] & ITEM0_SACRED_ASH)
return ITEM_EFFECT_SACRED_ASH;
+6 -6
View File
@@ -1555,10 +1555,10 @@ static void ItemPrintFunc_OrderedListMenu(u8 windowId, u32 itemId, u8 y)
if (caught)
{
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, 0, 0x28, y);
type1 = gBaseStats[species].type1;
type1 = gSpeciesInfo[species].types[0];
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, type1 + 1, 0x78, y);
if (type1 != gBaseStats[species].type2)
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, gBaseStats[species].type2 + 1, 0x98, y);
if (type1 != gSpeciesInfo[species].types[1])
BlitMoveInfoIcon(sPokedexScreenData->numericalOrderWindowId, gSpeciesInfo[species].types[1] + 1, 0x98, y);
}
}
@@ -3091,9 +3091,9 @@ u8 DexScreen_DrawMonAreaPage(void)
if (monIsCaught)
{
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gBaseStats[species].type1, 0, 1);
if (gBaseStats[species].type1 != gBaseStats[species].type2)
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gBaseStats[species].type2, 32, 1);
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[0], 0, 1);
if (gSpeciesInfo[species].types[0] != gSpeciesInfo[species].types[1])
BlitMoveInfoIcon(sPokedexScreenData->windowIds[12], 1 + gSpeciesInfo[species].types[1], 32, 1);
}
PutWindowTilemap(sPokedexScreenData->windowIds[12]);
CopyWindowToVram(sPokedexScreenData->windowIds[12], COPYWIN_GFX);
+870 -714
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2692,7 +2692,7 @@ void IsPokemonJumpSpeciesInParty(void)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES))
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (IsSpeciesAllowedInPokemonJump(species))
{
gSpecialVar_Result = TRUE;
+2 -2
View File
@@ -1031,7 +1031,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
{
struct Pokemon *mon = (struct Pokemon *)pokemon;
gStorage->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES2);
gStorage->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
if (gStorage->displayMonSpecies != SPECIES_NONE)
{
sanityIsBagEgg = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG);
@@ -1054,7 +1054,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
{
struct BoxPokemon *boxMon = (struct BoxPokemon *)pokemon;
gStorage->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2);
gStorage->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES_OR_EGG);
if (gStorage->displayMonSpecies != SPECIES_NONE)
{
u32 otId = GetBoxMonData(boxMon, MON_DATA_OT_ID);
+6 -6
View File
@@ -298,7 +298,7 @@ static u8 GetMonIconPriorityByCursorArea(void)
void CreateMovingMonIcon(void)
{
u32 personality = GetMonData(&gStorage->movingMon, MON_DATA_PERSONALITY);
u16 species = GetMonData(&gStorage->movingMon, MON_DATA_SPECIES2);
u16 species = GetMonData(&gStorage->movingMon, MON_DATA_SPECIES_OR_EGG);
u8 priority = GetMonIconPriorityByCursorArea();
gStorage->movingMonSprite = CreateMonIconSprite(species, personality, 0, 0, priority, 7);
@@ -318,7 +318,7 @@ static void InitBoxMonSprites(u8 boxId)
{
for (j = 0; j < IN_BOX_COLUMNS; j++)
{
species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2);
species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
personality = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY);
@@ -344,7 +344,7 @@ static void InitBoxMonSprites(u8 boxId)
void CreateBoxMonIconAtPos(u8 boxPosition)
{
u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
@@ -567,7 +567,7 @@ static void SetBoxSpeciesAndPersonalities(u8 boxId)
{
for (j = 0; j < IN_BOX_COLUMNS; j++)
{
gStorage->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2);
gStorage->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES_OR_EGG);
if (gStorage->boxSpecies[boxPosition] != SPECIES_NONE)
gStorage->boxPersonalities[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY);
boxPosition++;
@@ -597,14 +597,14 @@ void SetBoxMonIconObjMode(u8 boxPosition, u8 objMode)
void CreatePartyMonsSprites(bool8 visible)
{
u16 i, count;
u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES_OR_EGG);
u32 personality = GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY);
gStorage->partySprites[0] = CreateMonIconSprite(species, personality, 104, 64, 1, 12);
count = 1;
for (i = 1; i < PARTY_SIZE; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
{
personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
+2 -2
View File
@@ -400,7 +400,7 @@ static void MultiMove_DeselectRow(u8 row, u8 minColumn, u8 maxColumn)
static void MultiMove_SetIconToBg(u8 x, u8 y)
{
u8 position = x + (IN_BOX_COLUMNS * y);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES_OR_EGG);
u32 personality = GetCurrentBoxMonData(position, MON_DATA_PERSONALITY);
if (species != SPECIES_NONE)
@@ -414,7 +414,7 @@ static void MultiMove_SetIconToBg(u8 x, u8 y)
static void MultiMove_ClearIconFromBg(u8 x, u8 y)
{
u8 position = x + (IN_BOX_COLUMNS * y);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE)
FillWindowPixelRect8Bit(gStorage->multiMoveWindowId, PIXEL_FILL(0), 24 * x, 24 * y, 32, 32);
+2 -2
View File
@@ -2680,12 +2680,12 @@ static void SetPokeStorageQuestLogEvent(u8 action)
if (sInPartyMenu)
{
box2 = TOTAL_BOXES_COUNT;
species2 = GetMonData(&gPlayerParty[GetBoxCursorPosition()], MON_DATA_SPECIES2);
species2 = GetMonData(&gPlayerParty[GetBoxCursorPosition()], MON_DATA_SPECIES_OR_EGG);
}
else
{
box2 = StorageGetCurrentBox();
species2 = GetCurrentBoxMonData(GetBoxCursorPosition(), MON_DATA_SPECIES2);
species2 = GetCurrentBoxMonData(GetBoxCursorPosition(), MON_DATA_SPECIES_OR_EGG);
}
questLogData = &gStorage->pokeStorageQuestLogData;
+15 -15
View File
@@ -2105,15 +2105,15 @@ static void BufferMonInfo(void)
return;
}
sMonSummaryScreen->monTypes[0] = gBaseStats[dexNum].type1;
sMonSummaryScreen->monTypes[1] = gBaseStats[dexNum].type2;
sMonSummaryScreen->monTypes[0] = gSpeciesInfo[dexNum].types[0];
sMonSummaryScreen->monTypes[1] = gSpeciesInfo[dexNum].types[1];
GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_NICKNAME, tempStr);
StringCopyN_Multibyte(sMonSummaryScreen->summary.nicknameStrBuf, tempStr, POKEMON_NAME_LENGTH);
StringGet_Nickname(sMonSummaryScreen->summary.nicknameStrBuf);
gender = GetMonGender(&sMonSummaryScreen->currentMon);
dexNum = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
dexNum = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
if (gender == MON_FEMALE)
StringCopy(sMonSummaryScreen->summary.genderSymbolStrBuf, gText_FemaleSymbol);
@@ -2224,7 +2224,7 @@ static void BufferMonSkills(void)
if (level < 100)
{
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES);
expToNextLevel = gExperienceTables[gBaseStats[species].growthRate][level + 1] - exp;
expToNextLevel = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - exp;
}
ConvertIntToDecimalStringN(sMonSummaryScreen->summary.expToNextLevelStrBuf, expToNextLevel, STR_CONV_MODE_LEFT_ALIGN, 7);
@@ -2646,7 +2646,7 @@ static void PokeSum_PrintTrainerMemo_Mon_HeldByOT(void)
// but Japanese uses different grammar for Bold and Gentle natures.
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MET_LEVEL) == 0) // Hatched
{
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1) // Fateful encounter
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
{
if (PokeSum_IsMonBoldOrGentle(nature))
DynamicPlaceholderTextUtil_ExpandPlaceholders(natureMetOrHatchedAtLevelStr, gText_PokeSum_FatefulEncounterHatched_BoldGentleGrammar);
@@ -2743,7 +2743,7 @@ static void PokeSum_PrintTrainerMemo_Mon_NotHeldByOT(void)
// but Japanese uses different grammar for Bold and Gentle natures.
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MET_LEVEL) == 0) // hatched from an EGG
{
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1) // Fateful encounter
if (GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
{
if (PokeSum_IsMonBoldOrGentle(nature))
DynamicPlaceholderTextUtil_ExpandPlaceholders(natureMetOrHatchedAtLevelStr, gText_PokeSum_ApparentlyFatefulEncounterHatched_BoldGentleGrammar);
@@ -2797,7 +2797,7 @@ static void PokeSum_PrintTrainerMemo_Egg(void)
if (sMonSummaryScreen->monList.mons != gEnemyParty)
{
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1)
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
chosenStrIndex = 4;
else
{
@@ -2815,7 +2815,7 @@ static void PokeSum_PrintTrainerMemo_Egg(void)
}
else
{
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_EVENT_LEGAL) == 1)
if (metLocation == METLOC_FATEFUL_ENCOUNTER || GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_MODERN_FATEFUL_ENCOUNTER) == TRUE)
chosenStrIndex = 4;
else
{
@@ -4014,7 +4014,7 @@ static void PokeSum_CreateMonPicSprite(void)
sMonPicBounceState = AllocZeroed(sizeof(struct MonPicBounceState));
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_PERSONALITY);
trainerId = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_OT_ID);
@@ -4142,7 +4142,7 @@ static void PokeSum_CreateMonIconSprite(void)
u16 species;
u32 personality;
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_PERSONALITY);
SafeLoadMonIconPalette(species);
@@ -4178,7 +4178,7 @@ static void PokeSum_ShowOrHideMonIconSprite(bool8 invisible)
static void PokeSum_DestroyMonIconSprite(void)
{
u16 species;
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
species = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG);
SafeFreeMonIconPalette(species);
DestroyMonIcon(&gSprites[sMonSummaryScreen->monIconSpriteId]);
}
@@ -4622,8 +4622,8 @@ static void UpdateExpBarObjs(void)
if (level < 100)
{
totalExpToNextLevel = gExperienceTables[gBaseStats[species].growthRate][level + 1] - gExperienceTables[gBaseStats[species].growthRate][level];
curExpToNextLevel = exp - gExperienceTables[gBaseStats[species].growthRate][level];
totalExpToNextLevel = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - gExperienceTables[gSpeciesInfo[species].growthRate][level];
curExpToNextLevel = exp - gExperienceTables[gSpeciesInfo[species].growthRate][level];
pointsPerTile = ((totalExpToNextLevel << 2) / 8);
totalPoints = (curExpToNextLevel << 2);
@@ -5183,9 +5183,9 @@ static void PokeSum_TryPlayMonCry(void)
if (!GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_IS_EGG))
{
if (ShouldPlayNormalMonCry(&sMonSummaryScreen->currentMon) == TRUE)
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2), 0, CRY_MODE_NORMAL);
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG), 0, CRY_MODE_NORMAL);
else
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2), 0, CRY_MODE_WEAK);
PlayCry_ByMode(GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES_OR_EGG), 0, CRY_MODE_WEAK);
}
}
+2 -2
View File
@@ -61,7 +61,7 @@ struct GFRomHeader
u32 externalEventFlagsOffset;
u32 externalEventDataOffset;
u32 unk18;
const struct BaseStats * baseStats;
const struct SpeciesInfo * speciesInfo;
const u8 (* abilityNames)[];
const u8 *const * abilityDescriptions;
const struct Item * items;
@@ -146,7 +146,7 @@ static const struct GFRomHeader sGFRomHeader = {
.externalEventFlagsOffset = offsetof(struct SaveBlock1, externalEventFlags),
.externalEventDataOffset = offsetof(struct SaveBlock1, externalEventData),
.unk18 = 0x00000000,
.baseStats = gBaseStats,
.speciesInfo = gSpeciesInfo,
.abilityNames = gAbilityNames,
.abilityDescriptions = gAbilityDescriptionPointers,
.items = gItems,
+1
View File
@@ -7,6 +7,7 @@
#include "link.h"
#include "save_failed_screen.h"
#include "fieldmap.h"
#include "pokemon_storage_system.h"
#include "gba/flash_internal.h"
static u8 HandleWriteSector(u16 sectorId, const struct SaveSectorLocation *locations);
+6 -6
View File
@@ -2222,21 +2222,21 @@ bool8 ScrCmd_normalmsg(struct ScriptContext * ctx)
return FALSE;
}
// This command will set a Pokémon's eventLegal bit; there is no similar command to clear it.
bool8 ScrCmd_setmoneventlegal(struct ScriptContext * ctx)
// This command will set a Pokémon's modernFatefulEncounter bit; there is no similar command to clear it.
bool8 ScrCmd_setmonmodernfatefulencounter(struct ScriptContext * ctx)
{
bool8 isEventLegal = TRUE;
bool8 isModernFatefulEncounter = TRUE;
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
SetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, &isEventLegal);
SetMonData(&gPlayerParty[partyIndex], MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter);
return FALSE;
}
bool8 ScrCmd_checkmoneventlegal(struct ScriptContext * ctx)
bool8 ScrCmd_checkmonmodernfatefulencounter(struct ScriptContext * ctx)
{
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, NULL);
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MODERN_FATEFUL_ENCOUNTER, NULL);
return FALSE;
}
+1 -1
View File
@@ -109,7 +109,7 @@ static bool8 CheckPartyMonHasHeldItem(u16 item)
for(i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species != SPECIES_NONE && species != SPECIES_EGG && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == item)
return TRUE;
}
+15 -15
View File
@@ -948,7 +948,7 @@ static void CB2_CreateTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++)
{
struct Pokemon * mon = &gPlayerParty[i];
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2),
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i][0] * 8) + 14,
(sTradeMonSpriteCoords[i][1] * 8) - 12,
@@ -960,7 +960,7 @@ static void CB2_CreateTradeMenu(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++)
{
struct Pokemon * mon = &gEnemyParty[i];
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL),
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
@@ -1145,7 +1145,7 @@ void CB2_ReturnToTradeMenuFromSummary(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++)
{
sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(
GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL),
GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
sTradeMonSpriteCoords[i][0] * 8 + 14,
sTradeMonSpriteCoords[i][1] * 8 - 12,
@@ -1157,7 +1157,7 @@ void CB2_ReturnToTradeMenuFromSummary(void)
for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++)
{
sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(
GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2, NULL),
GetMonData(&gEnemyParty[i], MON_DATA_SPECIES_OR_EGG, NULL),
SpriteCB_MonIcon,
sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8 + 14,
sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8 - 12,
@@ -1964,7 +1964,7 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 cursor
// Partner cant trade illegitimate Deoxys or Mew
partnerSpecies = GetMonData(&gEnemyParty[sTradeMenu->partnerCursorPosition % PARTY_SIZE], MON_DATA_SPECIES);
if ((partnerSpecies == SPECIES_DEOXYS || partnerSpecies == SPECIES_MEW)
&& !GetMonData(&gEnemyParty[sTradeMenu->partnerCursorPosition % PARTY_SIZE], MON_DATA_EVENT_LEGAL))
&& !GetMonData(&gEnemyParty[sTradeMenu->partnerCursorPosition % PARTY_SIZE], MON_DATA_MODERN_FATEFUL_ENCOUNTER))
return PARTNER_MON_INVALID;
if (hasLiveMon != 0)
@@ -2747,7 +2747,7 @@ static u32 CanTradeSelectedMon(struct Pokemon * playerParty, int partyCount, int
for (i = 0; i < partyCount; i++)
{
species2[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES2);
species2[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES_OR_EGG);
species[i] = GetMonData(&playerParty[i], MON_DATA_SPECIES);
}
@@ -2790,7 +2790,7 @@ static u32 CanTradeSelectedMon(struct Pokemon * playerParty, int partyCount, int
if (species[monIdx] == SPECIES_DEOXYS || species[monIdx] == SPECIES_MEW)
{
if (!GetMonData(&playerParty[monIdx], MON_DATA_EVENT_LEGAL))
if (!GetMonData(&playerParty[monIdx], MON_DATA_MODERN_FATEFUL_ENCOUNTER))
return CANT_TRADE_INVALID_MON;
}
@@ -2855,17 +2855,17 @@ s32 GetGameProgressForLinkTrade(void)
return TRADE_BOTH_PLAYERS_READY;
}
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal)
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isModernFatefulEncounter)
{
if (species == SPECIES_DEOXYS || species == SPECIES_MEW)
{
if (!isEventLegal)
if (!isModernFatefulEncounter)
return TRUE;
}
return FALSE;
}
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal)
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isModernFatefulEncounter)
{
bool8 playerHasNationalDex = player.hasNationalDex;
bool8 playerCanLinkNationally = player.canLinkNationally;
@@ -2890,7 +2890,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
}
// Cannot trade illegitimate Deoxys/Mew
if (IsDeoxysOrMewUntradable(playerSpecies, isEventLegal))
if (IsDeoxysOrMewUntradable(playerSpecies, isModernFatefulEncounter))
return UR_TRADE_MSG_MON_CANT_BE_TRADED_2;
if (partnerSpecies == SPECIES_EGG)
@@ -2902,8 +2902,8 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
else
{
// Player's Pokémon must be of the type the partner requested
if (gBaseStats[playerSpecies2].type1 != requestedType
&& gBaseStats[playerSpecies2].type2 != requestedType)
if (gSpeciesInfo[playerSpecies2].types[0] != requestedType
&& gSpeciesInfo[playerSpecies2].types[1] != requestedType)
return UR_TRADE_MSG_NOT_MON_PARTNER_WANTS;
}
@@ -2933,11 +2933,11 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
return UR_TRADE_MSG_NONE;
}
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal)
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isModernFatefulEncounter)
{
bool8 hasNationalDex = player.hasNationalDex;
if (IsDeoxysOrMewUntradable(species, isEventLegal))
if (IsDeoxysOrMewUntradable(species, isModernFatefulEncounter))
return CANT_REGISTER_MON;
if (hasNationalDex)
+3 -3
View File
@@ -755,7 +755,7 @@ static void LoadTradeMonPic(u8 whichParty, u8 state)
{
case 0:
// Load graphics
species = GetMonData(mon, MON_DATA_SPECIES2);
species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
if (whichParty == TRADE_PLAYER)
@@ -883,8 +883,8 @@ void CB2_LinkTrade(void)
case 10:
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
ShowBg(0);
sTradeAnim->questLogSpecies[TRADE_PLAYER] = GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_SPECIES2);
sTradeAnim->questLogSpecies[TRADE_PARTNER] = GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_SPECIES2);
sTradeAnim->questLogSpecies[TRADE_PLAYER] = GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_SPECIES_OR_EGG);
sTradeAnim->questLogSpecies[TRADE_PARTNER] = GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_SPECIES_OR_EGG);
memcpy(sTradeAnim->linkPartnerName, gLinkPlayers[GetMultiplayerId() ^ 1].name, PLAYER_NAME_LENGTH);
gMain.state++;
break;
+1 -1
View File
@@ -1030,7 +1030,7 @@ static s32 GetPartyMaxLevel(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) != 0 && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) != 0 && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG, NULL) != SPECIES_EGG)
{
s32 currLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL, NULL);
if (currLevel > topLevel)
+7 -7
View File
@@ -4002,7 +4002,7 @@ static s32 IsRequestedTradeInPlayerParty(u32 type, u32 species)
{
for (i = 0; i < gPlayerPartyCount; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (species == SPECIES_EGG)
return UR_TRADE_MATCH;
}
@@ -4012,8 +4012,8 @@ static s32 IsRequestedTradeInPlayerParty(u32 type, u32 species)
{
for (i = 0; i < gPlayerPartyCount; i++)
{
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
if (gBaseStats[species].type1 == type || gBaseStats[species].type2 == type)
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (gSpeciesInfo[species].types[0] == type || gSpeciesInfo[species].types[1] == type)
return UR_TRADE_MATCH;
}
return UR_TRADE_NOTYPE;
@@ -4145,7 +4145,7 @@ static bool32 HasAtLeastTwoMonsOfLevel30OrLower(void)
for (i = 0; i < gPlayerPartyCount; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= UNION_ROOM_MAX_LEVEL
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
count++;
}
@@ -4174,7 +4174,7 @@ void Script_ResetUnionRoomTrade(void)
static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade * trade)
{
trade->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
trade->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES_OR_EGG);
trade->playerLevel = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
trade->playerPersonality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
if (trade->playerSpecies == SPECIES_EGG)
@@ -4185,7 +4185,7 @@ static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade * tra
static void RegisterTradeMon(u32 monId, struct UnionRoomTrade * trade)
{
trade->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
trade->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES_OR_EGG);
trade->level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
trade->personality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
}
@@ -4217,7 +4217,7 @@ static u32 GetPartyPositionOfRegisteredMon(struct UnionRoomTrade * trade, u8 mul
cur_personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
if (cur_personality != personality)
continue;
cur_species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
cur_species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG);
if (cur_species != species)
continue;
response = i;