|
@@ -1,5 +1,7 @@
|
|
|
|
|
+using System;
|
|
|
using System.Collections;
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
|
+using System.Linq;
|
|
|
|
|
|
|
|
namespace DCGO.CardEffects.BT18
|
|
namespace DCGO.CardEffects.BT18
|
|
|
{
|
|
{
|
|
@@ -9,34 +11,254 @@ namespace DCGO.CardEffects.BT18
|
|
|
{
|
|
{
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
|
|
|
|
+ #region Alternate Digivolution, Blast Digivolve
|
|
|
|
|
+
|
|
|
if (timing == EffectTiming.None)
|
|
if (timing == EffectTiming.None)
|
|
|
|
|
+ {
|
|
|
|
|
+ bool Condition()
|
|
|
|
|
+ {
|
|
|
|
|
+ return card.Owner.HandCards.Contains(card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool PermanentCondition(Permanent targetPermanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ return (targetPermanent.TopCard.EqualsCardName("Takuya Kanbara") ||
|
|
|
|
|
+ targetPermanent.TopCard.EqualsCardName("TakuyaKanbara") ||
|
|
|
|
|
+ targetPermanent.TopCard.EqualsCardName("Koji Minamoto") ||
|
|
|
|
|
+ targetPermanent.TopCard.EqualsCardName("KojiMinamoto")) &&
|
|
|
|
|
+ targetPermanent.DigivolutionCards.Count(cardSource => cardSource.ContainsTraits("Hybrid")) >= 10;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
|
|
|
|
|
+ permanentCondition: PermanentCondition, digivolutionCost: 6, ignoreDigivolutionRequirement: false,
|
|
|
|
|
+ card: card, condition: Condition));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (timing == EffectTiming.OnCounterTiming)
|
|
|
|
|
+ {
|
|
|
|
|
+ cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region When Digivolving, When Attacking Shared
|
|
|
|
|
+
|
|
|
|
|
+ int DeletionMaxDP()
|
|
|
|
|
+ {
|
|
|
|
|
+ int dp = 10000;
|
|
|
|
|
+
|
|
|
|
|
+ List<CardColor> cardColors = new List<CardColor>();
|
|
|
|
|
+
|
|
|
|
|
+ foreach (CardSource source in card.PermanentOfThisCard().cardSources)
|
|
|
|
|
+ {
|
|
|
|
|
+ cardColors.AddRange(source.CardColors);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ cardColors = cardColors.Distinct().ToList();
|
|
|
|
|
+
|
|
|
|
|
+ dp += cardColors.Count * 2000;
|
|
|
|
|
+
|
|
|
|
|
+ return dp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region When Digivolving
|
|
|
|
|
+
|
|
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
{
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("", CanUseCondition, card);
|
|
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
|
|
|
|
+ activateClass.SetUpICardEffect("Delete a Digimon with 10000 DP or less", CanUseCondition, card);
|
|
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
cardEffects.Add(activateClass);
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
|
|
- string EffectDiscription()
|
|
|
|
|
|
|
+ string EffectDescription()
|
|
|
{
|
|
{
|
|
|
- return "";
|
|
|
|
|
|
|
+ return
|
|
|
|
|
+ "[When Digivolving] Delete 1 of your opponent's Digimon with 10000 DP or less. For each color in this Digimon's digivolution cards, add 2000 to this DP deletion effect's maximum.";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
{
|
|
|
- return true;
|
|
|
|
|
|
|
+ return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
|
|
|
|
|
+ permanent.DP <= card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
{
|
|
|
- return true;
|
|
|
|
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
{
|
|
|
- yield return null;
|
|
|
|
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ canTargetCondition: CanSelectPermanentCondition,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ maxCount: 1,
|
|
|
|
|
+ canNoSelect: false,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ selectPermanentCoroutine: null,
|
|
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
|
|
+ mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region When Attacking Deletion
|
|
|
|
|
+
|
|
|
|
|
+ if (timing == EffectTiming.OnAllyAttack)
|
|
|
|
|
+ {
|
|
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
|
|
+ activateClass.SetUpICardEffect("Delete a Digimon with 10000 DP or less", CanUseCondition, card);
|
|
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ string EffectDescription()
|
|
|
|
|
+ {
|
|
|
|
|
+ return
|
|
|
|
|
+ "[When Attacking] Delete 1 of your opponent's Digimon with 10000 DP or less. For each color in this Digimon's digivolution cards, add 2000 to this DP deletion effect's maximum.";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
|
|
|
|
|
+ permanent.DP <= card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ canTargetCondition: CanSelectPermanentCondition,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ maxCount: 1,
|
|
|
|
|
+ canNoSelect: false,
|
|
|
|
|
+ canEndNotMax: false,
|
|
|
|
|
+ selectPermanentCoroutine: null,
|
|
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
|
|
+ mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region When Attacking Trash Security
|
|
|
|
|
+
|
|
|
|
|
+ if (timing == EffectTiming.OnAllyAttack)
|
|
|
|
|
+ {
|
|
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
|
|
+ activateClass.SetUpICardEffect(
|
|
|
|
|
+ "Place Tamer digivolution cards as your bottom security cards to trash Opponent's security cards", CanUseCondition,
|
|
|
|
|
+ card);
|
|
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
|
|
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ string EffectDescription()
|
|
|
|
|
+ {
|
|
|
|
|
+ return
|
|
|
|
|
+ "[When Attacking] By placing up to 5 Tamer cards from this Digimon's digivolution cards as your bottom security cards, trash opponent's top security cards for each card placed by this effect.";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanSelectTamerCardCondition(CardSource cardSource)
|
|
|
|
|
+ {
|
|
|
|
|
+ return cardSource.IsTamer;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
|
|
+ card.PermanentOfThisCard().DigivolutionCards.Some(CanSelectTamerCardCondition);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
|
|
+ {
|
|
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
|
|
+
|
|
|
|
|
+ selectCardEffect.SetUp(
|
|
|
|
|
+ canTargetCondition: CanSelectTamerCardCondition,
|
|
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
|
|
+ canEndSelectCondition: null,
|
|
|
|
|
+ canNoSelect: () => false,
|
|
|
|
|
+ selectCardCoroutine: null,
|
|
|
|
|
+ afterSelectCardCoroutine: AfterSelectCardCoroutine,
|
|
|
|
|
+ message:
|
|
|
|
|
+ "Select cards that will get placed to the bottom of your security stack\n(cards will be placed to the bottom of the security stack so that cards with lower numbers are on top).",
|
|
|
|
|
+ maxCount: Math.Min(5, card.PermanentOfThisCard().DigivolutionCards.Count(CanSelectTamerCardCondition)),
|
|
|
|
|
+ canEndNotMax: true,
|
|
|
|
|
+ isShowOpponent: true,
|
|
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
|
|
+ root: SelectCardEffect.Root.Custom,
|
|
|
|
|
+ customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
|
|
|
|
|
+ canLookReverseCard: true,
|
|
|
|
|
+ selectPlayer: card.Owner,
|
|
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
+
|
|
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select digivolution cards to place to the bottom of your security stack.",
|
|
|
|
|
+ "The opponent is selecting digivolution cards to place to the bottom of your security stack.");
|
|
|
|
|
+ selectCardEffect.SetNotShowCard();
|
|
|
|
|
+ yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
+
|
|
|
|
|
+ IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
|
|
|
|
|
+ {
|
|
|
|
|
+ foreach (var cardSource in cardSources)
|
|
|
|
|
+ {
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
+ CardObjectController.AddSecurityCard(cardSource, toTop: false));
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance
|
|
|
|
|
+ .GetComponent<Effects>().CreateRecoveryEffect(cardSource.Owner));
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(
|
|
|
|
|
+ new IAddSecurity(cardSource.Owner).AddSecurity());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
|
|
|
|
|
+ player: card.Owner.Enemy,
|
|
|
|
|
+ destroySecurityCount: cardSources.Count,
|
|
|
|
|
+ cardEffect: activateClass,
|
|
|
|
|
+ fromTop: true).DestroySecurity());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
return cardEffects;
|
|
return cardEffects;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|