Enforce AffixedRibbon -1

All your hacks are still hacks

Re-expose affixed ribbon in the ribbon editor for PB8
Since there's no way to change it in BDSP, flag anything non-neg1
This commit is contained in:
Kurt 2021-11-20 09:04:09 -08:00
parent b2fd51ddab
commit b26f4db6ab
3 changed files with 11 additions and 2 deletions

View File

@ -518,6 +518,10 @@ private void VerifyBDSPStats(LegalityAnalysis data, PB8 pb8)
if (pb8.Favorite)
data.AddLine(GetInvalid(LFavoriteMarkingUnavailable, Encounter));
var affix = pb8.AffixedRibbon;
if (affix != -1) // None
data.AddLine(GetInvalid(string.Format(LRibbonMarkingAffixedF_0, affix)));
var social = pb8.Sociability;
if (social != 0)
data.AddLine(GetInvalid(LMemorySocialZero, Encounter));

View File

@ -28,7 +28,12 @@ public sealed class PB8 : G8PKM
public override IReadOnlyList<ushort> ExtraBytes => Unused;
public override PersonalInfo PersonalInfo => PersonalTable.BDSP.GetFormEntry(Species, Form);
public PB8() => Egg_Location = Met_Location = Locations.Default8bNone;
public PB8()
{
Egg_Location = Met_Location = Locations.Default8bNone;
AffixedRibbon = -1; // 00 would make it show Kalos Champion :)
}
public PB8(byte[] data) : base(data) { }
public override PKM Clone() => new PB8((byte[])Data.Clone());

View File

@ -26,7 +26,7 @@ public RibbonEditor(PKM pk)
PopulateRibbons();
TLP_Ribbons.ResumeLayout();
if (pk is PK8 pk8)
if (pk is G8PKM pk8)
{
var names = Enum.GetNames(typeof(RibbonIndex));
var values = (RibbonIndex[])Enum.GetValues(typeof(RibbonIndex));