mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-06 18:39:48 -05:00
Minor tweaks
no functional change gen7 statics with relearn moves get generated with the relearn moves as their moves rather than with current level up
This commit is contained in:
@@ -4,7 +4,7 @@ namespace PKHeX.Core;
|
||||
/// Generation 7 Static Encounter
|
||||
/// </summary>
|
||||
public sealed record EncounterStatic7(GameVersion Version)
|
||||
: IEncounterable, IEncounterMatch, IEncounterConvertible<PK7>, IRelearn, IEncounterFormRandom, IFlawlessIVCount, IFatefulEncounterReadOnly, IFixedGender, IFixedNature, IFixedIVSet
|
||||
: IEncounterable, IEncounterMatch, IEncounterConvertible<PK7>, IRelearn, IMoveset, IEncounterFormRandom, IFlawlessIVCount, IFatefulEncounterReadOnly, IFixedGender, IFixedNature, IFixedIVSet
|
||||
{
|
||||
public byte Generation => 7;
|
||||
public EntityContext Context => EntityContext.Gen7;
|
||||
@@ -16,6 +16,7 @@ public sealed record EncounterStatic7(GameVersion Version)
|
||||
public bool IsShiny => false;
|
||||
|
||||
public Moveset Relearn { get; init; }
|
||||
public Moveset Moves => Relearn;
|
||||
public IndividualValueSet IVs { get; init; }
|
||||
public ushort Location { get; init; }
|
||||
public ushort EggLocation { get; init; }
|
||||
@@ -95,8 +96,14 @@ public PK7 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria)
|
||||
}
|
||||
|
||||
if (Relearn.HasMoves)
|
||||
{
|
||||
pk.SetMoves(Relearn);
|
||||
pk.SetRelearnMoves(Relearn);
|
||||
EncounterUtil.SetEncounterMoves(pk, version, LevelMin);
|
||||
}
|
||||
else
|
||||
{
|
||||
EncounterUtil.SetEncounterMoves(pk, version, LevelMin);
|
||||
}
|
||||
SetPINGA(pk, criteria, pi);
|
||||
pk.ResetPartyStats();
|
||||
|
||||
|
||||
@@ -81,7 +81,11 @@ public static bool IsCuteCharm(PKM pk, uint pid)
|
||||
return false;
|
||||
|
||||
var (species, gender) = GetGenderSpecies(pk, pid, pk.Species);
|
||||
return IsCuteCharm(pid, gender, species);
|
||||
}
|
||||
|
||||
private static bool IsCuteCharm(uint pid, byte gender, ushort species)
|
||||
{
|
||||
switch (gender)
|
||||
{
|
||||
// case 2: break; // can't cute charm a genderless pk
|
||||
@@ -126,10 +130,10 @@ public static bool IsCuteCharm(PKM pk, uint pid)
|
||||
(int)Marill or (int)Azumarill when IsAzurillMale(pid) => ((int)Azurill, 0),
|
||||
|
||||
// Future evolutions
|
||||
_ => (GetSpeciesGen4(currentSpecies), pk.Gender),
|
||||
_ => (DevolveToSpeciesFromGen4(currentSpecies), pk.Gender),
|
||||
};
|
||||
|
||||
private static ushort GetSpeciesGen4(ushort species) => species switch
|
||||
private static ushort DevolveToSpeciesFromGen4(ushort species) => species switch
|
||||
{
|
||||
<= Legal.MaxSpeciesID_4 => species, // has a valid personal reference, all good
|
||||
(int)Sylveon => (int)Eevee,
|
||||
|
||||
Reference in New Issue
Block a user