mirror of
https://github.com/kwsch/pkNX.git
synced 2026-09-11 12:05:25 -05:00
Add size export for new raids
This commit is contained in:
@@ -59,33 +59,35 @@ public List<string> Dump(PersonalTable9SV table)
|
||||
|
||||
for (ushort species = 0; species <= table.MaxSpeciesID; species++)
|
||||
{
|
||||
var spec = table[species];
|
||||
for (byte form = 0; form < spec.FormCount; form++)
|
||||
AddDump(lines, table, species, form);
|
||||
var pi = table[species];
|
||||
var specInternal = SpeciesConverterSV.GetInternal9(species);
|
||||
for (byte form = 0; form < pi.FormCount; form++)
|
||||
AddDump(lines, table, specInternal, species, form);
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
private string GetSpeciesName(ushort nationalIndex) => Species[nationalIndex];
|
||||
private string GetSpeciesName(ushort internalIndex) => Species[internalIndex];
|
||||
|
||||
public void AddDump(List<string> lines, PersonalTable9SV table, ushort species, byte form)
|
||||
public void AddDump(List<string> lines, PersonalTable9SV table, ushort speciesInternal, ushort species, byte form)
|
||||
{
|
||||
var index = table.GetFormIndex(species, form);
|
||||
var entry = table[index];
|
||||
string name = GetSpeciesName(species);
|
||||
string name = GetSpeciesName(speciesInternal);
|
||||
if (form != 0)
|
||||
name += $"-{form}";
|
||||
if (entry.FB.Dex is { } dex)
|
||||
name += $" #{dex.Index:000}";
|
||||
AddDump(lines, entry, index, name, species, form);
|
||||
AddDump(lines, entry, index, name, speciesInternal, form);
|
||||
}
|
||||
|
||||
private void AddDump(List<string> lines, PersonalInfo9SV pi, int entry, string name, int species, int form)
|
||||
private void AddDump(List<string> lines, PersonalInfo9SV pi, int entry, string name, ushort speciesInternal, byte form)
|
||||
{
|
||||
if (pi is { IsPresentInGame: false })
|
||||
return;
|
||||
|
||||
var specCode = pi.FormCount > 1 ? $"{Species[species]}-{form}" : $"{Species[species]}";
|
||||
var specName = GetSpeciesName(speciesInternal);
|
||||
var specCode = pi.FormCount > 1 ? $"{specName}-{form}" : $"{specName}";
|
||||
|
||||
if (Settings.Stats)
|
||||
AddPersonalLines(lines, pi, entry, name, specCode);
|
||||
@@ -177,7 +179,7 @@ private void AddEvolutions(PersonalInfo9SVfb fb, List<string> lines)
|
||||
|
||||
var method = (EvolutionType)z.Method;
|
||||
string arg = GetArgTypeDisplayValue(method, z.Argument);
|
||||
var line = $"Evolves into {Species[z.SpeciesInternal]}-{z.Form} @ lv{z.Level} ({method}) [{arg}]";
|
||||
var line = $"Evolves into {GetSpeciesName(z.SpeciesInternal)}-{z.Form} @ lv{z.Level} ({method}) [{arg}]";
|
||||
lines.Add(line);
|
||||
}
|
||||
}
|
||||
@@ -199,7 +201,7 @@ private string GetArgTypeDisplayValue(EvolutionType type, ushort value)
|
||||
EvolutionTypeArgumentType.NoArg => value.ToString(),
|
||||
EvolutionTypeArgumentType.Items => Items[value],
|
||||
EvolutionTypeArgumentType.Moves => Moves[value],
|
||||
EvolutionTypeArgumentType.Species => Species[value],
|
||||
EvolutionTypeArgumentType.Species => GetSpeciesName(value),
|
||||
EvolutionTypeArgumentType.Type => Types[value],
|
||||
//EvolutionTypeArgumentType.Stat => expr,
|
||||
//EvolutionTypeArgumentType.Version => expr,
|
||||
|
||||
@@ -28,12 +28,12 @@ public PersonalTable9SV(IFileContainer file)
|
||||
|
||||
var formGrouped = Root.Table
|
||||
.GroupBy(x => x.Info.SpeciesNational)
|
||||
.Select(group => group).ToArray();
|
||||
formGrouped = SpeciesConverterSV.GetRearrangedAsNational(formGrouped);
|
||||
.OrderBy(x => x.Key).ToArray();
|
||||
|
||||
for (int i = 0; i <= MaxSpecies; i++)
|
||||
{
|
||||
var forms = formGrouped[i].ToArray();
|
||||
var item = formGrouped[i];
|
||||
var forms = item.ToArray();
|
||||
|
||||
baseForms[i] = GetObj(forms[0], forms, MaxSpecies, formTable);
|
||||
for (int f = 1; f < forms.Length; f++)
|
||||
|
||||
@@ -61,6 +61,13 @@ public void SerializePKHeX(BinaryWriter bw, byte star, sbyte rate, RaidSerializa
|
||||
bw.Write(rate);
|
||||
}
|
||||
|
||||
public void SerializeType2(BinaryWriter bw)
|
||||
{
|
||||
var b = BossPokePara;
|
||||
bw.Write((byte)b.ScaleType);
|
||||
bw.Write((byte)b.ScaleValue);
|
||||
}
|
||||
|
||||
public void SerializeType3(BinaryWriter bw)
|
||||
{
|
||||
// Fixed Nature, fixed IVs, fixed Scale
|
||||
|
||||
@@ -293,6 +293,8 @@ private static void AddToList(IReadOnlyCollection<DeliveryRaidEnemyTable> table,
|
||||
bw.Write(noTotal ? (ushort)0 : totalS[stage]);
|
||||
bw.Write(noTotal ? (ushort)0 : totalV[stage]);
|
||||
}
|
||||
if (format == RaidSerializationFormat.Type2)
|
||||
enc.SerializeType2(bw);
|
||||
if (format == RaidSerializationFormat.Type3)
|
||||
enc.SerializeType3(bw);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user