diff --git a/PKHeX.Core/Editing/CommonEdits.cs b/PKHeX.Core/Editing/CommonEdits.cs index e1dc4c496..4f2035805 100644 --- a/PKHeX.Core/Editing/CommonEdits.cs +++ b/PKHeX.Core/Editing/CommonEdits.cs @@ -377,7 +377,7 @@ public static void ApplySetDetails(this PKM pk, ShowdownSet Set) b.ResetCalculatedValues(); } } - + if (pk is IGigantamax c) c.CanGigantamax = Set.CanGigantamax; @@ -387,6 +387,7 @@ public static void ApplySetDetails(this PKM pk, ShowdownSet Set) var legal = new LegalityAnalysis(pk); if (legal.Parsed && legal.Info.Relearn.Any(z => !z.Valid)) pk.SetRelearnMoves(legal.GetSuggestedRelearnMoves()); + pk.ResetPartyStats(); pk.RefreshChecksum(); } diff --git a/PKHeX.Core/PKM/PK8.cs b/PKHeX.Core/PKM/PK8.cs index 9a0e91a3a..a1157c9e9 100644 --- a/PKHeX.Core/PKM/PK8.cs +++ b/PKHeX.Core/PKM/PK8.cs @@ -600,7 +600,7 @@ public void FixMemories() { if (IsEgg) // No memories if is egg. { - HT_Friendship = HT_Affection = HT_TextVar = HT_Memory = HT_Intensity = HT_Feeling = + HT_Language = HT_Friendship = HT_Affection = HT_TextVar = HT_Memory = HT_Intensity = HT_Feeling = /* OT_Friendship */ OT_Affection = OT_TextVar = OT_Memory = OT_Intensity = OT_Feeling = 0; // Clear Handler @@ -609,7 +609,7 @@ public void FixMemories() } if (IsUntraded) - HT_Friendship = HT_Affection = HT_TextVar = HT_Memory = HT_Intensity = HT_Feeling = 0; + HT_Language = HT_Friendship = HT_Affection = HT_TextVar = HT_Memory = HT_Intensity = HT_Feeling = 0; if (GenNumber < 6) { /* OT_Affection = */ @@ -673,6 +673,7 @@ public int GetRibbonByte(int index) throw new ArgumentOutOfRangeException(nameof(index)); if (index < 64) return 0x34 + (index >> 3); + index -= 64; return 0x40 + (index >> 3); } } diff --git a/PKHeX.Drawing/ImageUtil.cs b/PKHeX.Drawing/ImageUtil.cs index 90defa890..6feadf124 100644 --- a/PKHeX.Drawing/ImageUtil.cs +++ b/PKHeX.Drawing/ImageUtil.cs @@ -229,6 +229,8 @@ public static Color ColorBaseStat(int v) return Blend(Color.FromArgb((int)red, (int)green, 0), Color.White, 0.4); } + public static Color ColorBaseStatTotal(int tot) => ColorBaseStat((int) (Math.Max(0, tot - 175) / 3f)); + public static Color Blend(Color color, Color backColor, double amount) { byte r = (byte)((color.R * amount) + (backColor.R * (1 - amount))); diff --git a/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs index 4f77e0b36..bd1d4f8bc 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs @@ -340,7 +340,7 @@ private void LoadBST(PersonalInfo pi) } var bst = pi.BST; TB_BST.Text = bst.ToString("000"); - TB_BST.BackColor = ImageUtil.ColorBaseStat((int)(Math.Max(0, bst - 175) / 3f)); + TB_BST.BackColor = ImageUtil.ColorBaseStatTotal(bst); } public void UpdateRandomIVs(object sender, EventArgs e) diff --git a/PKHeX.WinForms/Subforms/KChart.cs b/PKHeX.WinForms/Subforms/KChart.cs index 2db4458e1..ca81c8bba 100644 --- a/PKHeX.WinForms/Subforms/KChart.cs +++ b/PKHeX.WinForms/Subforms/KChart.cs @@ -52,7 +52,7 @@ private void PopEntry(int index) row.Cells[r++].Value = SpriteUtil.GetSprite(s, f, 0, 0, false, false, SAV.Generation); row.Cells[r++].Value = species[index]; row.Cells[r++].Value = GetIsNative(p, s); - row.Cells[r].Style.BackColor = ImageUtil.ColorBaseStat((int)((Math.Max(p.BST - 175, 0)) / 3f)); + row.Cells[r].Style.BackColor = ImageUtil.ColorBaseStatTotal(p.BST); row.Cells[r++].Value = p.BST.ToString("000"); row.Cells[r++].Value = SpriteUtil.GetTypeSprite(p.Type1, SAV.Generation); row.Cells[r++].Value = p.Type1 == p.Type2 ? SpriteUtil.Spriter.Transparent : SpriteUtil.GetTypeSprite(p.Type2, SAV.Generation);