|
|
@@ -108,12 +108,12 @@ public class CardSource : MonoBehaviour
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
- if (CanNotPlayThisOption)
|
|
|
+ if (IsDigimon && Owner.GetBattleAreaDigimons().Some(permanent => CanPlayCardTargetFrame(permanent.PermanentFrame, true, null)))
|
|
|
{
|
|
|
- return false;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
- if (_cEntity_Base.IsPermanent)
|
|
|
+ if (_cEntity_Base.IsPermanent && !IsOption)
|
|
|
{
|
|
|
if (!CanPlayJogress(true))
|
|
|
{
|
|
|
@@ -125,6 +125,11 @@ public class CardSource : MonoBehaviour
|
|
|
}
|
|
|
else if (IsOption)
|
|
|
{
|
|
|
+ if (CanNotPlayThisOption)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
#region whether cost can be paid
|
|
|
|
|
|
List<int> costs = new List<int>() { this.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: true) };
|
|
|
@@ -267,9 +272,11 @@ public class CardSource : MonoBehaviour
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- bool matchColorRequirement = CardColors.Every(cardColor =>
|
|
|
+ List<CardColor> colorsToCheck = IsDigimon ? DualCardColors : CardColors;
|
|
|
+
|
|
|
+ bool matchColorRequirement = colorsToCheck.Every(cardColor =>
|
|
|
Owner.GetFieldPermanents().Some(permanent =>
|
|
|
- !permanent.TopCard.IsOption && permanent.TopCard.CardColors.Contains(cardColor)));
|
|
|
+ permanent.TopCard.IsPermanent && permanent.TopCard.HasCardColor(cardColor)));
|
|
|
|
|
|
if (!matchColorRequirement)
|
|
|
{
|
|
|
@@ -315,6 +322,8 @@ public class CardSource : MonoBehaviour
|
|
|
|
|
|
public List<CardColor> BaseCardColorsFromEntity => _cEntity_Base.cardColors.Distinct().ToList();
|
|
|
|
|
|
+ public List<CardColor> BaseDualCardColorsFromEntity => _cEntity_Base.OptionCardColorRequirements.Distinct().ToList();
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region base card colors
|
|
|
@@ -358,6 +367,45 @@ public class CardSource : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public List<CardColor> BaseDualCardColors
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ List<CardColor> baseCardColors = BaseDualCardColorsFromEntity;
|
|
|
+
|
|
|
+ #region the effects that changes base card colors
|
|
|
+
|
|
|
+ #region the effects of itself
|
|
|
+
|
|
|
+ if (PermanentOfThisCard() == null)
|
|
|
+ {
|
|
|
+ EffectList(EffectTiming.None)
|
|
|
+ .Filter(cardEffect => cardEffect is IChangeBaseCardColorEffect && cardEffect.CanUse(null))
|
|
|
+ .ForEach(cardEffect => baseCardColors = ((IChangeBaseCardColorEffect)cardEffect).GetBaseCardColors(baseCardColors, this));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region the effects of permanents
|
|
|
+
|
|
|
+ GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer
|
|
|
+ .Map(player => player.GetFieldPermanents())
|
|
|
+ .Flat()
|
|
|
+ .Map(permanent => permanent.EffectList(EffectTiming.None))
|
|
|
+ .Flat()
|
|
|
+ .Filter(cardEffect => cardEffect is IChangeBaseCardColorEffect && cardEffect.CanUse(null))
|
|
|
+ .ForEach(cardEffect => baseCardColors = ((IChangeBaseCardColorEffect)cardEffect).GetBaseCardColors(baseCardColors, this));
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ baseCardColors = baseCardColors.Distinct().ToList();
|
|
|
+
|
|
|
+ return baseCardColors;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region card colors
|
|
|
@@ -401,6 +449,45 @@ public class CardSource : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public List<CardColor> DualCardColors
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ List<CardColor> cardColors = BaseDualCardColors;
|
|
|
+
|
|
|
+ #region the effects that changes card colors
|
|
|
+
|
|
|
+ #region the effects of itself
|
|
|
+
|
|
|
+ if (PermanentOfThisCard() == null)
|
|
|
+ {
|
|
|
+ EffectList(EffectTiming.None)
|
|
|
+ .Filter(cardEffect => cardEffect is IChangeCardColorEffect && cardEffect.CanUse(null))
|
|
|
+ .ForEach(cardEffect => cardColors = ((IChangeCardColorEffect)cardEffect).GetCardColors(cardColors, this));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region the effects of permanents
|
|
|
+
|
|
|
+ GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer
|
|
|
+ .Map(player => player.GetFieldPermanents())
|
|
|
+ .Flat()
|
|
|
+ .Map(permanent => permanent.EffectList(EffectTiming.None))
|
|
|
+ .Flat()
|
|
|
+ .Filter(cardEffect => cardEffect is IChangeCardColorEffect && cardEffect.CanUse(null))
|
|
|
+ .ForEach(cardEffect => cardColors = ((IChangeCardColorEffect)cardEffect).GetCardColors(cardColors, this));
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ cardColors = cardColors.Distinct().ToList();
|
|
|
+
|
|
|
+ return cardColors;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region evoCosts from entity
|
|
|
@@ -1021,7 +1108,7 @@ public class CardSource : MonoBehaviour
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if (PayCost && frame.GetFramePermanent() == null)
|
|
|
+ if (PayCost && frame.GetFramePermanent() == null && !IsOption)
|
|
|
{
|
|
|
int cost = PayingCost(root, new List<Permanent>() { frame.GetFramePermanent() }, checkAvailability: true, FixedCost: fixedCost);
|
|
|
|
|
|
@@ -1390,6 +1477,24 @@ public class CardSource : MonoBehaviour
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region whether this card has the mentioned color
|
|
|
+
|
|
|
+ public bool HasCardColor(CardColor cardColor, bool isOptionOnly = false)
|
|
|
+ {
|
|
|
+ if (isOptionOnly)
|
|
|
+ {
|
|
|
+ if (!IsOption)
|
|
|
+ return false;
|
|
|
+ if (IsDigimon)
|
|
|
+ {
|
|
|
+ return DualCardColors.Contains(cardColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return CardColors.Contains(cardColor) || DualCardColors.Contains(cardColor);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region whether this card has at least 1 card name that contains "Greymon"
|
|
|
|
|
|
public bool HasGreymonName
|