x89rt2 пре 3 месеци
родитељ
комит
e8efd641e8
1 измењених фајлова са 117 додато и 0 уклоњено
  1. 117 0
      Assets/Scripts/CardEffect/BT25/Black/BT25_066.cs

+ 117 - 0
Assets/Scripts/CardEffect/BT25/Black/BT25_066.cs

@@ -0,0 +1,117 @@
+using System.Collections;
+using System.Collections.Generic;
+
+// Guardromon
+namespace DCGO.CardEffects.BT25
+{
+    public class BT25_066 : 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.HasTSTraits;
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 3));
+            }
+            #endregion
+
+            #region All Turns
+            if (timing == EffectTiming.WhenRemoveField)
+            {
+                List<Permanent> removedPermanents = new List<Permanent>();
+
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Trash a linked card to prevent this digimon from leaving", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[All Turns] When this Digimon would leave the battle area, by trashing 1 of its link cards, it doesn't leave.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card)
+                        && CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card);
+                }                
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card)
+                        && !card.PermanentOfThisCard().HasNoLinkCards;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    Permanent thisPermanent = card.PermanentOfThisCard();
+
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                                canTargetCondition: _ => true,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                canNoSelect: () => true,
+                                selectCardCoroutine: null,
+                                afterSelectCardCoroutine: SelectCardCoroutine,
+                                message: "Select 1 link card to trash.",
+                                maxCount: 1,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Discard,
+                                root: SelectCardEffect.Root.LinkedCards,
+                                customRootCardList: card.PermanentOfThisCard().LinkedCards,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
+
+                    selectCardEffect.SetUpCustomMessage("Select 1 link card to trash.", "The opponent is selecting 1 link card to trash.");
+
+                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                    IEnumerator SelectCardCoroutine(List<CardSource> cardSources)
+                    {
+                        if (cardSources.Count > 0)
+                        {
+                            thisPermanent.willBeRemoveField = false;
+
+                            thisPermanent.HideHandBounceEffect();
+                            thisPermanent.HideDeckBounceEffect();
+                            thisPermanent.HideWillRemoveFieldEffect();
+                            thisPermanent.HideDeleteEffect();
+                        }
+                        yield return null;
+                    }
+                }
+            }
+            #endregion
+
+            #region All Turns - Inherited Effect
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return true;
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
+                    changeValue: 1000,
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: Condition));
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}