Set template version as byte

Be consistent with other templates

Also sets OT details for Static8a
Closes #3979
This commit is contained in:
Kurt 2023-09-04 18:50:35 -07:00
parent 4e0f23cdc0
commit 45216dfa1b
9 changed files with 14 additions and 9 deletions

View file

@ -173,7 +173,7 @@ public static class EncounterMovesetGenerator
/// <returns>A consumable <see cref="IEncounterable"/> list of possible encounters.</returns>
private static IEnumerable<IEncounterable> GenerateVersionEncounters(PKM pk, ReadOnlyMemory<ushort> moves, GameVersion version)
{
pk.Version = (int)version;
pk.Version = (byte)version;
var context = version.GetContext();
var generation = (byte)version.GetGeneration();
foreach (var enc in GenerateVersionEncounters(pk, moves, version, generation, context))

View file

@ -70,7 +70,12 @@ public sealed record EncounterStatic8a
Met_Location = Location,
Met_Level = LevelMin,
MetDate = EncounterDate.GetDateSwitch(),
Version = (int)Version,
Version = (byte)Version,
OT_Name = tr.OT,
OT_Gender = tr.Gender,
ID32 = tr.ID32,
IsAlpha = IsAlpha,
Ball = (byte)(FixedBall == Ball.None ? Ball.LAPoke : FixedBall),
Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, Generation),

View file

@ -252,7 +252,7 @@ public sealed record EncounterDist9
Met_Location = Location,
Met_Level = LevelMin,
MetDate = EncounterDate.GetDateSwitch(),
Version = (int)version,
Version = (byte)version,
Ball = (byte)Ball.Poke,
Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, Generation),

View file

@ -90,7 +90,7 @@ public sealed record EncounterFixed9
Met_Location = Location,
Met_Level = LevelMin,
MetDate = EncounterDate.GetDateSwitch(),
Version = (int)version,
Version = (byte)version,
Ball = (byte)Ball.Poke,
Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, Generation),

View file

@ -267,7 +267,7 @@ public sealed record EncounterMight9
Met_Location = Location,
Met_Level = LevelMin,
MetDate = EncounterDate.GetDateSwitch(),
Version = (int)version,
Version = (byte)version,
Ball = (byte)Ball.Poke,
Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, Generation),

View file

@ -63,7 +63,7 @@ public sealed record EncounterStatic9(GameVersion Version)
Met_Location = Location,
Met_Level = LevelMin,
MetDate = EncounterDate.GetDateSwitch(),
Version = (int)version,
Version = (byte)version,
Ball = (byte)Ball.Poke,
Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, Generation),

View file

@ -133,7 +133,7 @@ public sealed record EncounterTera9
Met_Location = Location,
Met_Level = LevelMin,
MetDate = EncounterDate.GetDateSwitch(),
Version = (int)version,
Version = (byte)version,
Ball = (byte)Ball.Poke,
Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, Generation),

View file

@ -38,7 +38,7 @@ public sealed record EncounterEgg(ushort Species, byte Form, byte Level, int Gen
pk.Language = lang;
pk.Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, gen);
pk.CurrentLevel = Level;
pk.Version = (int)version;
pk.Version = (byte)version;
var ball = FixedBall;
pk.Ball = ball is Ball.None ? (int)Ball.Poke : (int)ball;

View file

@ -1210,7 +1210,7 @@ public sealed partial class PKMEditor : UserControl, IMainEditor
{
CheckMetLocationChange(version, Entity.Context);
if (FieldsLoaded)
Entity.Version = (int)version;
Entity.Version = (byte)version;
}
// Visibility logic for Gen 4 ground tile; only show for Gen 4 Pokemon.