Simplify contest ribbon deadlock set

Was missing the check & revert step; just fix the logic completely.
We should have the contest star ribbon if we've set all the ribbons, otherwise it was already removed.
This commit is contained in:
Kurt 2022-09-06 21:05:39 -07:00
parent 20dcb8d407
commit a0c998fdd5

View File

@ -22,7 +22,7 @@ public static void SetAllValidRibbons(LegalityAnalysis la)
// Ribbon Deadlock
if (la.Entity is IRibbonSetCommon6 c6)
InvertDeadlockContest(c6, true, args);
InvertDeadlockContest(c6, true);
}
/// <summary>
@ -73,14 +73,9 @@ private static void SetAllRibbonState(RibbonVerifierArguments args, bool desired
}
}
private static void InvertDeadlockContest(IRibbonSetCommon6 c6, bool desiredState, RibbonVerifierArguments args)
private static void InvertDeadlockContest(IRibbonSetCommon6 c6, bool desiredState)
{
// RibbonContestStar depends on having all contest ribbons, and having RibbonContestStar requires all.
// Since the above logic sets individual ribbons, we must try setting this deadlock pair manually.
if (c6.RibbonMasterToughness == desiredState || c6.RibbonContestStar == desiredState)
return;
c6.RibbonMasterToughness = c6.RibbonContestStar = desiredState;
FixInvalidRibbons(args);
if (desiredState)
c6.RibbonContestStar = c6.HasAllContestRibbons();
}
}