|
|
@@ -0,0 +1,196 @@
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using Unity.Mathematics;
|
|
|
+
|
|
|
+// Susanoomon
|
|
|
+namespace DCGO.CardEffects.EX12
|
|
|
+{
|
|
|
+ public class EX12_076 : CEntity_Effect
|
|
|
+ {
|
|
|
+ public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
+ {
|
|
|
+ List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
+
|
|
|
+ #region Alternate Digivolution Requirement
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ static bool PermanentCondition(Permanent targetPermanent)
|
|
|
+ {
|
|
|
+ return targetPermanent.TopCard.HasHybridTraits
|
|
|
+ || targetPermanent.TopCard.HasShambalaTraits
|
|
|
+ || targetPermanent.TopCard.HasTSTraits;
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 5, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 6));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Static Keywords
|
|
|
+ #region Rush
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ cardEffects.Add(CardEffectFactory.RushSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Raid
|
|
|
+ if (timing == EffectTiming.OnAllyAttack)
|
|
|
+ {
|
|
|
+ cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Blocker
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Shared Functions
|
|
|
+
|
|
|
+ bool IsOpponentsDigimon(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
|
|
|
+
|
|
|
+ int DigivolutionCardColors() => card.PermanentOfThisCard().DigivolutionCardsColors.Count;
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Shared OP/WD
|
|
|
+ string SharedEffectName = "Give all enemy Digimon -3K DP per color in digivolution cards util end of turn";
|
|
|
+
|
|
|
+ CardEffectFactory.ActivateClassesForSharedEffects
|
|
|
+ (ref cardEffects, timing, card,
|
|
|
+ SharedEffectName,
|
|
|
+ SharedActivateCoroutine,
|
|
|
+ SharedEffectDescription,
|
|
|
+ optional: false,
|
|
|
+ onPlay: true,
|
|
|
+ whenDigivolving: true);
|
|
|
+
|
|
|
+ string SharedEffectDescription(string tag)
|
|
|
+ {
|
|
|
+ return $"[{tag}] To all of your opponent's Digimon, give -3000 DP for the turn for each color this Digimon's digivolution cards.";
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
|
|
|
+ {
|
|
|
+ int dpChange = -3000 * DigivolutionCardColors();
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDPPlayerEffect(
|
|
|
+ permanentCondition: IsOpponentsDigimon,
|
|
|
+ changeValue: dpChange,
|
|
|
+ effectDuration: EffectDuration.UntilOwnerTurnEnd,
|
|
|
+ activateClass: activateClass));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region When Attacking
|
|
|
+ if (timing == EffectTiming.OnAllyAttack)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = CardEffectFactory.WhenAttackingClass(
|
|
|
+ card,
|
|
|
+ "Place 1 Enemy in Security, if 4+ colours in digivolution cards, Trash their security and recover 1",
|
|
|
+ ActivateCoroutine,
|
|
|
+ EffectDescription(),
|
|
|
+ optional: false,
|
|
|
+ maxCountPerTurn: 1,
|
|
|
+ hashValue: "EX12_076_WA"
|
|
|
+ );
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ => "[When Attacking] [Once Per Turn] Place 1 of your opponent's Digimon as the top security card. Then, if this Digimon has 4 or more colors in its digivolution cards, trash their top security card and <Recovery +1>.";
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(IsOpponentsDigimon))
|
|
|
+ {
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: IsOpponentsDigimon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: false,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: null,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.PutSecurityTop,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 opponent's Digimon to place as top security", "The opponent is selecting 1 Digimon to place as top security");
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (DigivolutionCardColors() >= 4)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
|
|
|
+ player: card.Owner.Enemy,
|
|
|
+ destroySecurityCount: 1,
|
|
|
+ cardEffect: activateClass,
|
|
|
+ fromTop: true).DestroySecurity());
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Assembly
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ AddAssemblyConditionClass addAssemblyConditionClass = new AddAssemblyConditionClass();
|
|
|
+ addAssemblyConditionClass.SetUpICardEffect($"Assembly", CanUseCondition, card);
|
|
|
+ addAssemblyConditionClass.SetUpAddAssemblyConditionClass(getAssemblyCondition: GetAssembly);
|
|
|
+ addAssemblyConditionClass.SetNotShowUI(true);
|
|
|
+ cardEffects.Add(addAssemblyConditionClass);
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ AssemblyCondition GetAssembly(CardSource cardSource)
|
|
|
+ {
|
|
|
+ if (cardSource == card)
|
|
|
+ {
|
|
|
+ AssemblyConditionElement element = new AssemblyConditionElement(CanSelectCardCondition);
|
|
|
+
|
|
|
+ bool CanSelectCardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource != null
|
|
|
+ && cardSource.Owner == card.Owner
|
|
|
+ && (cardSource.HasHybridTraits || cardSource.HasShambalaTraits);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanTargetCondition_ByPreSelecetedList(List<CardSource> cardSources, CardSource cardSource)
|
|
|
+ {
|
|
|
+ List<CardSource> AllCards = cardSources.Clone();
|
|
|
+
|
|
|
+ AllCards.Add(cardSource);
|
|
|
+
|
|
|
+ return AllCards.Count == Combinations.GetUniqueNameCardCount(AllCards);
|
|
|
+ }
|
|
|
+
|
|
|
+ AssemblyCondition assemblyCondition = new AssemblyCondition(
|
|
|
+ element: element,
|
|
|
+ CanTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
|
|
|
+ selectMessage: "8 [Hybrid]/[Shambala] Trait cards w/ different names",
|
|
|
+ elementCount: 8,
|
|
|
+ reduceCost: 9);
|
|
|
+
|
|
|
+ return assemblyCondition;
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return cardEffects;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|