| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace DCGO.CardEffects.BT19
- {
- public class BT19_014 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alliance
- if (timing == EffectTiming.OnAllyAttack)
- {
- cardEffects.Add(CardEffectFactory.AllianceSelfEffect(
- isInheritedEffect: false,
- card: card,
- condition: null));
- }
- #endregion
- #region Reboot
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(
- isInheritedEffect: false,
- card: card,
- condition: null));
- }
- #endregion
- #region Material Save
- if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
- {
- cardEffects.Add(CardEffectFactory.MaterialSaveEffect(card: card, materialSaveCount: 4));
- }
- #endregion
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect(
- "All of your opponent's Digimon get -DP for the turn then, play 1 [ShootingStarmon] from under your Tamers",
- CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[On Play] For each color in this Digimon's digivolution cards, all of your opponent's Digimon get -1000 DP for the turn. Then, you may play 1 [ShootingStarmon] from under your Tamers without paying the cost.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- bool OpponentPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- bool PlayCardCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon && cardSource.EqualsCardName("ShootingStarmon") &&
- CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass, SelectCardEffect.Root.DigivolutionCards);
- }
- bool TamerHasDigimonCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
- permanent.IsTamer && permanent.DigivolutionCards.Count(PlayCardCondition) >= 1;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDPPlayerEffect(
- permanentCondition: OpponentPermanentCondition,
- changeValue: -1000 * card.PermanentOfThisCard().DigivolutionCardsColors.Count,
- effectDuration: EffectDuration.UntilEachTurnEnd,
- activateClass: activateClass));
- if (CardEffectCommons.HasMatchConditionPermanent(TamerHasDigimonCondition))
- {
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: TamerHasDigimonCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select a Tamer.", "The opponent is selecting a Tamer.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- if (selectedPermanent != null)
- {
- List<CardSource> selectedCards = new List<CardSource>();
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: PlayCardCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- message: "Select 1 digivolution card to play.",
- maxCount: 1,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.Custom,
- customRootCardList: selectedPermanent.DigivolutionCards,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to play.",
- "The opponent is selecting 1 digivolution 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.DigivolutionCards,
- activateETB: true));
- }
- }
- }
- }
- #endregion
- #region When Attacking
- if (timing == EffectTiming.OnAllyAttack)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete 1 Digimon", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[When Attacking] Delete 1 of your opponent's Digimon with as much or less DP than this Digimon.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
- }
- bool IsEnemyPermanentWithAsMuchOrLessDpSharedCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
- permanent.DP <= card.PermanentOfThisCard().DP;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: IsEnemyPermanentWithAsMuchOrLessDpSharedCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Destroy,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- }
- }
- #endregion
- #region DigiXros
- if (timing == EffectTiming.None)
- {
- AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
- addDigiXrosConditionClass.SetUpICardEffect($"DigiXros -2", CanUseCondition, card);
- addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros);
- addDigiXrosConditionClass.SetNotShowUI(true);
- cardEffects.Add(addDigiXrosConditionClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- return true;
- }
- DigiXrosCondition GetDigiXros(CardSource cardSource)
- {
- if (cardSource == card)
- {
- DigiXrosConditionElement elementA = new DigiXrosConditionElement(CanSelectCardConditionA, "OmniShoutmon");
- bool CanSelectCardConditionA(CardSource conditionCardSource)
- {
- if (conditionCardSource)
- {
- if (conditionCardSource.Owner == card.Owner)
- {
- if (conditionCardSource.IsDigimon)
- {
- if (conditionCardSource.CardNames_DigiXros.Contains("OmniShoutmon"))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- DigiXrosConditionElement elementB = new DigiXrosConditionElement(CanSelectCardConditionB, "ZeigGreymon");
- bool CanSelectCardConditionB(CardSource conditionCardSource)
- {
- if (conditionCardSource)
- {
- if (conditionCardSource.Owner == card.Owner)
- {
- if (conditionCardSource.IsDigimon)
- {
- if (conditionCardSource.CardNames_DigiXros.Contains("ZeigGreymon"))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- DigiXrosConditionElement elementC = new DigiXrosConditionElement(CanSelectCardConditionC, "AtlurBallistamon");
- bool CanSelectCardConditionC(CardSource conditionCardSource)
- {
- if (conditionCardSource)
- {
- if (conditionCardSource.Owner == card.Owner)
- {
- if (conditionCardSource.IsDigimon)
- {
- if (conditionCardSource.CardNames_DigiXros.Contains("AtlurBallistamon"))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- DigiXrosConditionElement elementD = new DigiXrosConditionElement(CanSelectCardConditionD, "JaegerDorulumon");
- bool CanSelectCardConditionD(CardSource conditionCardSource)
- {
- if (conditionCardSource)
- {
- if (conditionCardSource.Owner == card.Owner)
- {
- if (conditionCardSource.IsDigimon)
- {
- if (conditionCardSource.CardNames_DigiXros.Contains("JaegerDorulumon"))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- DigiXrosConditionElement elementE = new DigiXrosConditionElement(CanSelectCardConditionE, "RaptorSparrowmon");
- bool CanSelectCardConditionE(CardSource conditionCardSource)
- {
- if (conditionCardSource)
- {
- if (conditionCardSource.Owner == card.Owner)
- {
- if (conditionCardSource.IsDigimon)
- {
- if (conditionCardSource.CardNames_DigiXros.Contains("RaptorSparrowmon"))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>()
- { elementA, elementB, elementC, elementD, elementE };
- DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 2);
- return digiXrosCondition;
- }
- return null;
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|