Can't change the forced Tera Type anymore
This commit is contained in:
parent
3b293b8327
commit
67157250ef
5 changed files with 15 additions and 16 deletions
|
@ -2330,6 +2330,7 @@ u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer
|
|||
if (partyData[i].teraType > 0)
|
||||
{
|
||||
u32 data = partyData[i].teraType;
|
||||
if (gSpeciesInfo[partyData[i].species].forceTeraType == TYPE_NONE)
|
||||
SetMonData(&party[i], MON_DATA_TERA_TYPE, &data);
|
||||
}
|
||||
CalculateMonStats(&party[i]);
|
||||
|
|
|
@ -82,13 +82,10 @@ bool32 CanTerastallize(u32 battler)
|
|||
// Returns a pokemon's Tera type.
|
||||
u32 GetTeraType(struct Pokemon *mon)
|
||||
{
|
||||
if (GetMonData(mon, MON_DATA_TERA_TYPE) + 1 == 0) // no tera type, so generate it
|
||||
if (GetMonData(mon, MON_DATA_TERA_TYPE) == -1) // no tera type, so generate it
|
||||
{
|
||||
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
|
||||
if (gSpeciesInfo[species].forceTeraType != TYPE_NONE)
|
||||
SetMonData(mon, MON_DATA_TERA_TYPE, &gSpeciesInfo[species].forceTeraType);
|
||||
else
|
||||
if (gSpeciesInfo[species].forceTeraType == TYPE_NONE)
|
||||
SetMonData(mon, MON_DATA_TERA_TYPE, ((GetMonData(mon, MON_DATA_PERSONALITY) & 0x1) == 0 ? &(gSpeciesInfo[species].types[0]) : &(gSpeciesInfo[species].types[1])));
|
||||
}
|
||||
|
||||
|
|
|
@ -1643,6 +1643,7 @@ void CreateFacilityMon(const struct TrainerMon *fmon, u16 level, u8 fixedIV, u32
|
|||
if (fmon->teraType)
|
||||
{
|
||||
u32 data = fmon->teraType;
|
||||
if (gSpeciesInfo[fmon->species].forceTeraType == TYPE_NONE)
|
||||
SetMonData(dst, MON_DATA_TERA_TYPE, &data);
|
||||
}
|
||||
|
||||
|
|
|
@ -1020,9 +1020,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
|
|||
SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
|
||||
}
|
||||
|
||||
if (gSpeciesInfo[species].forceTeraType != TYPE_NONE)
|
||||
SetBoxMonData(boxMon, MON_DATA_TERA_TYPE, &(gSpeciesInfo[species].forceTeraType));
|
||||
else
|
||||
if (gSpeciesInfo[species].forceTeraType == TYPE_NONE)
|
||||
SetBoxMonData(boxMon, MON_DATA_TERA_TYPE, ((personality & 0x1) == 0 ? &(gSpeciesInfo[species].types[0]) : &(gSpeciesInfo[species].types[1])));
|
||||
|
||||
GiveBoxMonInitialMoveset(boxMon);
|
||||
|
@ -2543,6 +2541,9 @@ u32 GetBoxMonData3(struct BoxPokemon *boxMon, s32 field, u8 *data)
|
|||
break;
|
||||
case MON_DATA_TERA_TYPE:
|
||||
{
|
||||
if (gSpeciesInfo[substruct0->species].forceTeraType != TYPE_NONE)
|
||||
retVal = gSpeciesInfo[substruct0->species].forceTeraType;
|
||||
else
|
||||
retVal = substruct0->teraType - 1;
|
||||
break;
|
||||
}
|
||||
|
@ -6274,9 +6275,6 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
|
|||
}
|
||||
}
|
||||
|
||||
if (gSpeciesInfo[targetSpecies].forceTeraType != TYPE_NONE) // Doing this here seems to cover all cases
|
||||
SetBoxMonData(boxMon, MON_DATA_TERA_TYPE, &gSpeciesInfo[targetSpecies].forceTeraType);
|
||||
|
||||
return targetSpecies;
|
||||
}
|
||||
|
||||
|
@ -6526,6 +6524,7 @@ void UpdateMonPersonality(struct BoxPokemon *boxMon, u32 personality)
|
|||
|
||||
SetBoxMonData(boxMon, MON_DATA_IS_SHINY, &isShiny);
|
||||
SetBoxMonData(boxMon, MON_DATA_HIDDEN_NATURE, &hiddenNature);
|
||||
if (gSpeciesInfo[GetBoxMonData(boxMon, MON_DATA_SPECIES)].forceTeraType == TYPE_NONE)
|
||||
SetBoxMonData(boxMon, MON_DATA_TERA_TYPE, &teraType);
|
||||
}
|
||||
|
||||
|
|
|
@ -334,6 +334,7 @@ u32 ScriptGiveMonParameterized(u16 species, u8 level, u16 item, u8 ball, u8 natu
|
|||
// tera type
|
||||
if (teraType >= NUMBER_OF_MON_TYPES)
|
||||
teraType = gSpeciesInfo[species].types[0];
|
||||
if (gSpeciesInfo[species].forceTeraType == TYPE_NONE)
|
||||
SetMonData(&mon, MON_DATA_TERA_TYPE, &teraType);
|
||||
|
||||
// EV and IV
|
||||
|
|
Loading…
Reference in a new issue