Просмотр исходного кода

Starting yellow with Wanyamon.

JanusClockwork 1 год назад
Родитель
Сommit
bd47708cfd

+ 88 - 0
Assets/CardEffect/BT18/Yellow/Wanyamon_BT18_003.cs

@@ -0,0 +1,88 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects
+{
+    public class Wanyamon_BT18_003 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+            {
+                List<ICardEffect> cardEffects = new List<ICardEffect>();
+        
+                if (timing == EffectTiming.OnAllyAttack)
+                {
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("DP -2000 when yellow tamer in play", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                    activateClass.SetIsInheritedEffect(true);
+                    cardEffects.Add(activateClass);
+        
+                    string EffectDiscription()
+                    {
+                        return "[When Attacking] If you have a yellow Tamer, 1 of your opponent's Digimon gets -2000 DP for the turn.";
+                    }
+        
+                    bool CanSelectPermanentCondition(Permanent permanent)
+                    {
+                        return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                    }
+        
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                    }
+        
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleArea(card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                            {
+                                if (card.Owner.GetBattleAreaPermanents().Count(
+                                        (permanent) => permanent.TopCard.CardColors.Contains(CardColor.Yellow) && permanent.IsTamer) >= 1)
+                                    return true;
+                            }
+                        }
+        
+                        return false;
+                    }
+        
+                    IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+        
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+        
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+        
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -2000.", 
+                            "The opponent is selecting 1 Digimon that will get DP -2000.");
+        
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+        
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(
+                                CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -2000, 
+                                    effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                        }
+                    }
+                }
+        
+                return cardEffects;
+            }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Yellow/Wanyamon_BT18_003.cs.meta

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