Add affixed ribbon legality check

https://github.com/kwsch/PKHeX/issues/3001#issuecomment-698749761
This commit is contained in:
Kurt 2020-09-25 19:37:38 -07:00
parent 6ed60fd35d
commit 7b19e3fb7f
2 changed files with 9 additions and 0 deletions

View File

@ -406,6 +406,7 @@ public static class LegalityCheckStrings
public static string LRibbonFInvalid_0 { get; set; } = "Invalid Ribbons: {0}";
public static string LRibbonFMissing_0 { get; set; } = "Missing Ribbons: {0}";
public static string LRibbonMarkingFInvalid_0 { get; set; } = "Invalid Marking: {0}";
public static string LRibbonMarkingAffixedF_0 { get; set; } = "Invalid Affixed Ribbon/Marking: {0}";
public static string LStatDynamaxInvalid { get; set; } = "Dynamax Level is not within the expected range.";
public static string LStatIncorrectHeight { get; set; } = "Calculated Height does not match stored value.";

View File

@ -54,6 +54,14 @@ private void VerifyMarksPresent(LegalityAnalysis data, IRibbonIndex m)
hasOne = true;
}
if (m is PK8 pk8 && pk8.AffixedRibbon != -1)
{
if (pk8.AffixedRibbon > (int)RibbonIndex.MarkSlump)
data.AddLine(GetInvalid(string.Format(LRibbonMarkingAffixedF_0, pk8.AffixedRibbon)));
else if (!hasOne)
data.AddLine(GetInvalid(string.Format(LRibbonMarkingAffixedF_0, (RibbonIndex)pk8.AffixedRibbon)));
}
}
private static bool VerifyMarking(LegalityAnalysis data, RibbonIndex mark)