Kaynağa Gözat

Implement 065

Lewisaaronwelch 11 ay önce
ebeveyn
işleme
f4788d0695

+ 126 - 0
Assets/CardEffect/EX10/Purple/EX10_065.cs

@@ -0,0 +1,126 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+// Yukio Oikawa
+namespace DCGO.CardEffects.EX10
+{
+    public class EX10_065 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Start of Your Turn
+
+            if (timing == EffectTiming.OnStartTurn)
+            {
+                cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
+            }
+
+            #endregion
+
+            #region All Turns
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete this tamer, give one of your played digimon Rush, then gain 1 memory", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] When any of your Digimon with [Myotismon] in their names are played, by deleting this Tamer, 1 of those Digimon gains <Rush> for the turn. (This Digimon can attack the turn it comes into play.) Then, gain 1 memory.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnField(card) &&
+                           CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermamentCondition);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnField(card)
+                        && CardEffectCommons.CanActivateSuspendCostEffect(card);
+                }
+
+                bool PermamentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
+                           && permanent.TopCard.ContainsCardName("Myotismon");
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> playedPermanents = null;
+                    foreach (Hashtable hash in CardEffectCommons.GetHashtablesFromHashtable(hashtable))
+                    {
+                        playedPermanents.Add(CardEffectCommons.GetPermanentFromHashtable(hash));
+                    }
+
+                    if (playedPermanents != null)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                            targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() },
+                            activateClass: activateClass,
+                            successProcess: SuccessProcess,
+                            failureProcess: null
+                        ));
+
+                        IEnumerator SuccessProcess(List<Permanent> permanents)
+                        {
+                            Permanent selectedPermanent = null;
+                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(playedPermanents.Contains));
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: playedPermanents.Contains,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: false,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: SelectPermanentCoroutine,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Custom,
+                                cardEffect: activateClass);
+
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                            {
+                                selectedPermanent = permanent;
+                                yield return null;
+                            }
+
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to gain rush.", "The opponent is selecting 1 Digimon to gain rush.");
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                            if (selectedPermanent != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
+                                targetPermanent: selectedPermanent,
+                                effectDuration: EffectDuration.UntilEachTurnEnd,
+                                activateClass: activateClass));
+
+                            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Security
+
+            if (timing == EffectTiming.SecuritySkill)
+            {
+                cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX10/Purple/EX10_065.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5c746289a80c3024ba12e9d0200ad1a8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: