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

Lucemon: Chaos Mode and Gate of Deadly Sins update

Albert Vasconcellos 2 лет назад
Родитель
Сommit
e8eb588e9b

+ 1 - 1
Assets/CardEffect/EX6/Purple/Gate_of_Deadly_Sins_EX6_006.cs

@@ -657,7 +657,7 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectOgudomonInTrash))
+                    if (count()>=7)
                     {
                         if (CardEffectCommons.IsExistOnBreedingAreaDigimon(card))
                         {

+ 520 - 0
Assets/CardEffect/EX6/Purple/Lucemon_Chaos_Mode_EX6_054.cs

@@ -0,0 +1,520 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System.Linq;
+using Photon;
+using System;
+using Photon.Pun;
+
+namespace DCGO.CardEffects.EX6
+{
+    public class Lucemon_Chaos_Mode_EX6_054 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Digivolution Condition
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    if (targetPermanent.TopCard.CardNames.Contains("Lucemon"))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 5, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Opponent deletes 1 Digimon or Tamer/Trash and Recover", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] Your opponent may delete 1 of their Digimon or Tamers. If this effect didn't delete, trash the top card of your opponents security stack and <Recovery +1>.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable,card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
+                    {
+                        if (permanent.IsDigimon || permanent.IsTamer)
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if(CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> deleteTargetPermanents = new List<Permanent>();
+
+                    bool attemptedToDelete = false;
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner.Enemy,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer to delete.", "The opponent is selecting 1 Digimon or Tamer to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                        {
+                            deleteTargetPermanents = permanents.Clone();
+
+                            attemptedToDelete = true;
+
+                            yield return null;
+                        }
+                    }
+
+                    if (attemptedToDelete)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargetPermanents, activateClass: activateClass, successProcess: null, failureProcess: FailureProcess));
+
+                        IEnumerator FailureProcess()
+                        {
+                            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());
+                        }
+                    }
+                    else
+                    {
+                        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 When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Opponent deletes 1 Digimon or Tamer/Trash and Recover", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] Your opponent may delete 1 of their Digimon or Tamers. If this effect didn't delete, trash the top card of your opponents security stack and <Recovery +1>.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
+                    {
+                        if (permanent.IsDigimon || permanent.IsTamer)
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> deleteTargetPermanents = new List<Permanent>();
+
+                    bool attemptedToDelete = false;
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner.Enemy,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer to delete.", "The opponent is selecting 1 Digimon or Tamer to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                        {
+                            deleteTargetPermanents = permanents.Clone();
+
+                            attemptedToDelete = true;
+
+                            yield return null;
+                        }
+                    }
+
+                    if (attemptedToDelete)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargetPermanents, activateClass: activateClass, successProcess: null, failureProcess: FailureProcess));
+
+                        IEnumerator FailureProcess()
+                        {
+                            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());
+                        }
+                    }
+                    else
+                    {
+                        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 All Turns
+            if (timing == EffectTiming.WhenRemoveField)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play 1 [Lucemon: Satan Mode] or level 6 with [Seven Great Demon Lords] trait", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] When this Digimon would leave the battle area; by returning 1 [Lucemon] from this Digimon's digivolution cards or from your trash to the bottom of the deck, you may play 1 [Lucemon: Satan Mode] or 1 level 6 Digimon card with the [Seven Great Demon Lords] trait from your trash without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectLucemon(CardSource cardSource)
+                {
+                    if(cardSource.CardNames.Contains("Lucemon"))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                bool CanSelectCardToPlayFromTrash(CardSource cardSource)
+                {
+                    if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
+                    {
+                        if (cardSource.CardNames.Contains("Lucemon"))
+                        {
+                            return true;
+                        }
+
+                        if (cardSource.CardTraits.Contains("Seven Great Demon Lords") || cardSource.CardTraits.Contains("SevenGreatDemonLords"))
+                        {
+                            if (cardSource.Level == 6)
+                            {
+                                return true;
+                            }
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if(CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if(card.PermanentOfThisCard().DigivolutionCards.Count(CanSelectLucemon) >= 1)
+                        {
+                            return true;
+                        }
+
+                        if(CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectLucemon))
+                        {
+                            return true; 
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    bool canSelectTrash = card.Owner.TrashCards.Count(CanSelectLucemon) >= 1;
+                    bool canSelectDigivolutionCards = CardEffectCommons.IsExistOnBattleArea(card)
+                    && card.PermanentOfThisCard().DigivolutionCards.Count(CanSelectLucemon) >= 1;
+
+                    if (canSelectTrash || canSelectDigivolutionCards)
+                    {
+                        if (canSelectTrash && canSelectDigivolutionCards)
+                        {
+                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                        {
+                            new SelectionElement<bool>(message: $"From digivolution cards", value : true, spriteIndex: 0),
+                            new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
+                        };
+
+                            string selectPlayerMessage = "From which area will you send [Lucemon] to the bottom of the deck?";
+                            string notSelectPlayerMessage = "The opponent is choosing from which area to bottom deck a [Lucemon].";
+
+                            GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                        }
+                        else
+                        {
+                            GManager.instance.userSelectionManager.SetBool(canSelectDigivolutionCards);
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                        bool fromDigivolution = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                        if (fromDigivolution)
+                        {
+                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                            canTargetCondition: CanSelectLucemon,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => false,
+                            selectCardCoroutine: null,
+                            afterSelectCardCoroutine: AfterSelectCardCoroutine1,
+                            message: "Select [Lucemon] to place at the bottom of the deck.",
+                            maxCount: 1,
+                            canEndNotMax: false,
+                            isShowOpponent: false,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Custom,
+                            customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                            selectCardEffect.SetNotShowCard();
+                            selectCardEffect.SetNotAddLog();
+
+                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+                            IEnumerator AfterSelectCardCoroutine1(List<CardSource> cardSources)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(cardSources));
+
+                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(cardSources, "Deck Bottom Cards", true, true));
+
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardToPlayFromTrash))
+                                {
+                                    int maxCount = Math.Min(1, card.Owner.TrashCards.Count(CanSelectCardToPlayFromTrash));
+
+                                    List<CardSource> selectedCards = new List<CardSource>();
+
+                                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                    selectCardEffect.SetUp(
+                                                canTargetCondition: CanSelectCardToPlayFromTrash,
+                                                canTargetCondition_ByPreSelecetedList: null,
+                                                canEndSelectCondition: null,
+                                                canNoSelect: () => true,
+                                                selectCardCoroutine: SelectCardCoroutine,
+                                                afterSelectCardCoroutine: null,
+                                                message: "Select 1 card to play.",
+                                                maxCount: maxCount,
+                                                canEndNotMax: false,
+                                                isShowOpponent: true,
+                                                mode: SelectCardEffect.Mode.Custom,
+                                                root: SelectCardEffect.Root.Trash,
+                                                customRootCardList: null,
+                                                canLookReverseCard: true,
+                                                selectPlayer: card.Owner,
+                                                cardEffect: activateClass);
+
+                                    selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                                    selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                                    {
+                                        selectedCards.Add(cardSource);
+
+                                        yield return null;
+                                    }
+
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                                        cardSources: selectedCards,
+                                        activateClass: activateClass,
+                                        payCost: false,
+                                        isTapped: false,
+                                        root: SelectCardEffect.Root.Trash,
+                                        activateETB: true));
+                                }
+                            }
+                        }
+                        else
+                        {
+                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                            canTargetCondition: CanSelectLucemon,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => false,
+                            selectCardCoroutine: null,
+                            afterSelectCardCoroutine: AfterSelectCardCoroutine1,
+                            message: "Select [Lucemon] to place at the bottom of the deck.",
+                            maxCount: 1,
+                            canEndNotMax: false,
+                            isShowOpponent: false,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Custom,
+                            customRootCardList: card.Owner.TrashCards,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                            selectCardEffect.SetNotShowCard();
+                            selectCardEffect.SetNotAddLog();
+
+                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+                            IEnumerator AfterSelectCardCoroutine1(List<CardSource> cardSources)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(cardSources));
+
+                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(cardSources, "Deck Bottom Cards", true, true));
+
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardToPlayFromTrash))
+                                {
+                                    int maxCount = Math.Min(1, card.Owner.TrashCards.Count(CanSelectCardToPlayFromTrash));
+
+                                    List<CardSource> selectedCards = new List<CardSource>();
+
+                                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                    selectCardEffect.SetUp(
+                                                canTargetCondition: CanSelectCardToPlayFromTrash,
+                                                canTargetCondition_ByPreSelecetedList: null,
+                                                canEndSelectCondition: null,
+                                                canNoSelect: () => true,
+                                                selectCardCoroutine: SelectCardCoroutine,
+                                                afterSelectCardCoroutine: null,
+                                                message: "Select 1 card to play.",
+                                                maxCount: maxCount,
+                                                canEndNotMax: false,
+                                                isShowOpponent: true,
+                                                mode: SelectCardEffect.Mode.Custom,
+                                                root: SelectCardEffect.Root.Trash,
+                                                customRootCardList: null,
+                                                canLookReverseCard: true,
+                                                selectPlayer: card.Owner,
+                                                cardEffect: activateClass);
+
+                                    selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                                    selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                                    {
+                                        selectedCards.Add(cardSource);
+
+                                        yield return null;
+                                    }
+
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                                        cardSources: selectedCards,
+                                        activateClass: activateClass,
+                                        payCost: false,
+                                        isTapped: false,
+                                        root: SelectCardEffect.Root.Trash,
+                                        activateETB: true));
+                                }
+                            }
+                        }
+
+                    }
+                }
+            }
+            #endregion
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX6/Purple/Lucemon_Chaos_Mode_EX6_054.cs.meta

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