improvements
This commit is contained in:
@@ -12,9 +12,15 @@ public static class ActionValidator
|
||||
bool pendingSkip,
|
||||
RuleOptions rules)
|
||||
{
|
||||
// 1. Ak je na stole trest zo sedmy (napr. +2, +4, +6)
|
||||
// 1. Ak je na stole trest zo sedmy (napr. +3, +6, +9)
|
||||
if (pendingDrawCount > 0)
|
||||
{
|
||||
// Zelený dolník ruší sedmičky
|
||||
if (rules.GreenUnderKnaveCancelsSevens && card.IsGreenUnderKnave)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Ak je povolené prebíjanie sediem, musí zahrať sedmu
|
||||
return rules.StackSevens && card.IsSeven;
|
||||
}
|
||||
@@ -38,6 +44,21 @@ public static class ActionValidator
|
||||
return true;
|
||||
}
|
||||
|
||||
// 4b. Červená sedma v režime AnyCardOneRound sa môže zahrať na ľubovoľnú kartu
|
||||
if (card.IsRedSeven && rules.RedSevenMode == RedSevenMode.AnyCardOneRound)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 4c. Zelený dolník v režime UniversalWildcard ide na čokoľvek a naňho ide čokoľvek
|
||||
if (rules.GreenUnderKnaveMode == GreenUnderKnaveMode.UniversalWildcard)
|
||||
{
|
||||
if (card.IsGreenUnderKnave || topCard.IsGreenUnderKnave)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Ak bola zmenená farba Horníkom
|
||||
if (activeSuit.HasValue)
|
||||
{
|
||||
@@ -66,6 +87,10 @@ public static class ActionValidator
|
||||
// 1. Ak je na stole trest zo sedmy
|
||||
if (pendingDrawCount > 0)
|
||||
{
|
||||
if (rules.GreenUnderKnaveCancelsSevens && cards.Any(c => c.IsGreenUnderKnave))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return rules.StackSevens && cards.All(c => c.IsSeven);
|
||||
}
|
||||
|
||||
@@ -87,6 +112,21 @@ public static class ActionValidator
|
||||
return true;
|
||||
}
|
||||
|
||||
// 4b. Combo so Srdcovou/Červenou sedmou v režime AnyCardOneRound sa dá vyložiť na čokoľvek
|
||||
if (firstRank == Rank.Seven && cards.Any(c => c.IsRedSeven) && rules.RedSevenMode == RedSevenMode.AnyCardOneRound)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 4c. Zelený dolník v režime UniversalWildcard
|
||||
if (rules.GreenUnderKnaveMode == GreenUnderKnaveMode.UniversalWildcard)
|
||||
{
|
||||
if (cards.Any(c => c.IsGreenUnderKnave) || topCard.IsGreenUnderKnave)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Ak bola zmenená farba Horníkom
|
||||
if (activeSuit.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user