فهرست منبع

Update BT21_077.cs

x89rt2 4 ماه پیش
والد
کامیت
bdbda2241b
1فایلهای تغییر یافته به همراه15 افزوده شده و 119 حذف شده
  1. 15 119
      Assets/Scripts/CardEffect/BT21/Purple/BT21_077.cs

+ 15 - 119
Assets/Scripts/CardEffect/BT21/Purple/BT21_077.cs

@@ -132,66 +132,13 @@ namespace DCGO.CardEffects.BT21
 
                                 if (selectedPermanent != null)
                                 {
-                                    CollisionClass collisionClass = PermanentEffectFactory.CollisionEffect(selectedPermanent, activateClass);
-                                    CardEffectCommons.AddEffectToPermanent(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOwnerTurnEnd, card: card, cardEffect: collisionClass, timing: EffectTiming.OnCounterTiming);
-
-                                    ActivateClass activateClassDebuff = new ActivateClass();
-                                    activateClassDebuff.SetUpICardEffect("Attack with this Digimon", CanUseConditionDebuff,
-                                        selectedPermanent.TopCard);
-                                    activateClassDebuff.SetUpActivateClass(CanActivateConditionDebuff, ActivateCoroutineDebuff, -1, false,
-                                        EffectDescriptionDebuff());
-                                    activateClassDebuff.SetEffectSourcePermanent(selectedPermanent);
-                                    selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
-
-                                    if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
-                                    {
-                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
-                                            .CreateDebuffEffect(selectedPermanent));
-                                    }
-
-                                    string EffectDescriptionDebuff()
-                                    {
-                                        return "[Start of Your Main Phase] Attack with this Digimon.";
-                                    }
-
-                                    bool CanUseConditionDebuff(Hashtable hashtable1)
-                                    {
-                                        return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(selectedPermanent) &&
-                                               selectedPermanent.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedPermanent) &&
-                                               GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedPermanent.TopCard.Owner;
-                                    }
-
-                                    bool CanActivateConditionDebuff(Hashtable hashtable1)
-                                    {
-                                        return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(selectedPermanent) &&
-                                               !selectedPermanent.TopCard.CanNotBeAffected(activateClass) &&
-                                               selectedPermanent.CanAttack(activateClassDebuff);
-                                    }
-
-                                    IEnumerator ActivateCoroutineDebuff(Hashtable hashtableDebuff)
-                                    {
-                                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent) &&
-                                            selectedPermanent.CanAttack(activateClassDebuff))
-                                        {
-                                            SelectAttackEffect selectAttackEffect =
-                                                GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                            selectAttackEffect.SetUp(
-                                                attacker: selectedPermanent,
-                                                canAttackPlayerCondition: () => true,
-                                                defenderCondition: _ => true,
-                                                cardEffect: activateClassDebuff);
-
-                                            selectAttackEffect.SetCanNotSelectNotAttack();
-
-                                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
-                                        }
-                                    }
-
-                                    ICardEffect GetCardEffect(EffectTiming timingDebuff)
-                                    {
-                                        return timingDebuff == EffectTiming.OnStartMainPhase ? activateClassDebuff : null;
-                                    }
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCollision(
+                                        targetPermanent: selectedPermanent,
+                                        effectDuration: EffectDuration.UntilOwnerTurnEnd,
+                                        activateClass: activateClass));
+
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.StartOfMainAttack(
+                                        targetPermanent: selectedPermanent));
                                 }
                             }
                         }
@@ -289,64 +236,13 @@ namespace DCGO.CardEffects.BT21
 
                                 if (selectedPermanent != null)
                                 {
-                                    CollisionClass collisionClass = PermanentEffectFactory.CollisionEffect(selectedPermanent, activateClass);
-                                    CardEffectCommons.AddEffectToPermanent(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOwnerTurnEnd, card: card, cardEffect: collisionClass, timing: EffectTiming.OnCounterTiming);
-
-                                    ActivateClass activateClassDebuff = new ActivateClass();
-                                    activateClassDebuff.SetUpICardEffect("Attack with this Digimon", CanUseConditionDebuff, selectedPermanent.TopCard);
-                                    activateClassDebuff.SetUpActivateClass(CanActivateConditionDebuff, ActivateCoroutineDebuff, -1, false, EffectDescriptionDebuff());
-                                    activateClassDebuff.SetEffectSourcePermanent(selectedPermanent);
-                                    selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
-
-                                    if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
-                                    {
-                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
-                                            .CreateDebuffEffect(selectedPermanent));
-                                    }
-
-                                    string EffectDescriptionDebuff()
-                                    {
-                                        return "[Start of Your Main Phase] Attack with this Digimon.";
-                                    }
-
-                                    bool CanUseConditionDebuff(Hashtable hashtable1)
-                                    {
-                                        return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(selectedPermanent) &&
-                                               selectedPermanent.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedPermanent) &&
-                                               GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedPermanent.TopCard.Owner;
-                                    }
-
-                                    bool CanActivateConditionDebuff(Hashtable hashtable1)
-                                    {
-                                        return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(selectedPermanent) &&
-                                               !selectedPermanent.TopCard.CanNotBeAffected(activateClass) &&
-                                               selectedPermanent.CanAttack(activateClassDebuff);
-                                    }
-
-                                    IEnumerator ActivateCoroutineDebuff(Hashtable hashtableDebuff)
-                                    {
-                                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent) &&
-                                            selectedPermanent.CanAttack(activateClassDebuff))
-                                        {
-                                            SelectAttackEffect selectAttackEffect =
-                                                GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                            selectAttackEffect.SetUp(
-                                                attacker: selectedPermanent,
-                                                canAttackPlayerCondition: () => true,
-                                                defenderCondition: _ => true,
-                                                cardEffect: activateClassDebuff);
-
-                                            selectAttackEffect.SetCanNotSelectNotAttack();
-
-                                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
-                                        }
-                                    }
-
-                                    ICardEffect GetCardEffect(EffectTiming timingDebuff)
-                                    {
-                                        return timingDebuff == EffectTiming.OnStartMainPhase ? activateClassDebuff : null;
-                                    }
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCollision(
+                                        targetPermanent: selectedPermanent,
+                                        effectDuration: EffectDuration.UntilOwnerTurnEnd,
+                                        activateClass: activateClass));
+
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.StartOfMainAttack(
+                                        targetPermanent: selectedPermanent));
                                 }
                             }
                         }
@@ -518,4 +414,4 @@ namespace DCGO.CardEffects.BT21
             return cardEffects;
         }
     }
-}
+}