From 823a204bfaaa4692b4b45f7e8d0a63f6dd9ebc14 Mon Sep 17 00:00:00 2001 From: sora10pls <17801814+sora10pls@users.noreply.github.com> Date: Sat, 1 Apr 2023 11:47:29 -0400 Subject: [PATCH] Pretty dump: print EVs --- .../Gen9/Entity/ParamSet.cs | 16 ++++++++++++++++ pkNX.WinForms/Dumping/TeraRaidRipper.cs | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/pkNX.Structures.FlatBuffers/Gen9/Entity/ParamSet.cs b/pkNX.Structures.FlatBuffers/Gen9/Entity/ParamSet.cs index c856b991..9fe56311 100644 --- a/pkNX.Structures.FlatBuffers/Gen9/Entity/ParamSet.cs +++ b/pkNX.Structures.FlatBuffers/Gen9/Entity/ParamSet.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.ComponentModel; using FlatSharp.Attributes; // ReSharper disable UnusedMember.Global @@ -15,4 +16,19 @@ public class ParamSet [FlatBufferItem(3)] public int SPA { get; set; } [FlatBufferItem(4)] public int SPD { get; set; } [FlatBufferItem(5)] public int SPE { get; set; } + + public int[] Stats + { + get => new int[] { HP, ATK, DEF, SPA, SPD, SPE }; + set + { + if (value?.Length != 6) return; + HP = (sbyte)value[0]; + ATK = (sbyte)value[1]; + DEF = (sbyte)value[2]; + SPA = (sbyte)value[3]; + SPD = (sbyte)value[4]; + SPE = (sbyte)value[5]; + } + } } diff --git a/pkNX.WinForms/Dumping/TeraRaidRipper.cs b/pkNX.WinForms/Dumping/TeraRaidRipper.cs index b2a5a782..1d607d23 100644 --- a/pkNX.WinForms/Dumping/TeraRaidRipper.cs +++ b/pkNX.WinForms/Dumping/TeraRaidRipper.cs @@ -461,6 +461,21 @@ private static void DumpPretty(IFileInternal ROM, DeliveryRaidEnemyTableArray ta lines.Add($"\tIVs: {iv}"); + if (boss.EffortValue.Stats.Any(z => z != 0)) + { + string[] names = new[] { "HP", "Atk", "Def", "SpA", "SpD", "Spe" }; + var spread = new List(); + + for (int i = 0; i < boss.EffortValue.Stats.Length; i++) + { + if (boss.EffortValue.Stats[i] == 0) + continue; + spread.Add($"{boss.EffortValue.Stats[i]} {names[i]}"); + } + + lines.Add($"\tEVs: {string.Join(" / ", spread)}"); + } + if (boss.RareType != RareType.DEFAULT) lines.Add($"\tShiny: {shiny}");