| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- // Proximamon
- namespace DCGO.CardEffects.EX12
- {
- public class EX12_077 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternative Digivolution Condition
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.HasText("Gammamon")
- && targetPermanent.TopCard.EqualsTraits("VB");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 5,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null,
- level: 6)
- );
- }
- #endregion
- #region DNA Digivolution
- if (timing == EffectTiming.None)
- {
- AddJogressConditionClass addJogressConditionClass = new AddJogressConditionClass();
- addJogressConditionClass.SetUpICardEffect("DNA Digivolution", CanUseCondition, card);
- addJogressConditionClass.SetUpAddJogressConditionClass(getJogressCondition: GetJogress);
- addJogressConditionClass.SetNotShowUI(true);
- cardEffects.Add(addJogressConditionClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- return true;
- }
- JogressCondition GetJogress(CardSource cardSource)
- {
- if (cardSource == card)
- {
- bool PermanentCondition1(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && (permanent.TopCard.CardColors.Contains(CardColor.Red)
- || permanent.TopCard.CardColors.Contains(CardColor.Blue))
- && permanent.Levels_ForJogress(card).Contains(6);
- }
- bool PermanentCondition2(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && (permanent.TopCard.CardColors.Contains(CardColor.Black)
- || permanent.TopCard.CardColors.Contains(CardColor.Purple))
- && permanent.Levels_ForJogress(card).Contains(6);
- }
- JogressConditionElement[] elements = new JogressConditionElement[]
- {
- new JogressConditionElement(PermanentCondition1, "a level 6 Red or Blue Digimon"),
- new JogressConditionElement(PermanentCondition2, "a level 6 Black or Purple Digimon"),
- };
- JogressCondition jogressCondition = new JogressCondition(elements, 0);
- return jogressCondition;
- }
- return null;
- }
- }
- #endregion
- #region Security A. +1
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Blocker
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Shared OP/WD
- string SharedEffectName1 = "Place 2 cards with [Gammamon] text/[VB] under 1 of your Digimon to delete 1 enemy Digimon/Tamer";
- CardEffectFactory.ActivateClassesForSharedEffects
- (ref cardEffects, timing, card,
- SharedEffectName1,
- SharedActivateCoroutine1,
- SharedEffectDescription1,
- optional: false,
- onPlay: true,
- whenDigivolving: true);
- string SharedEffectDescription1(string tag)
- {
- return $"[{tag}] By placing 2 cards with [Gammamon] in their texts or the [VB] trait from your hand or trash as 1 of your Digimon's top or bottom digivolution cards, delete 1 of your opponent's Digimon or Tamers.";
- }
- bool CanSelectCardCondition1(CardSource cardSource)
- {
- return cardSource.HasText("Gammamon")
- || cardSource.EqualsTraits("VB");
- }
- bool CanSelectPermanentPlaceCondition1(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
- }
- bool CanSelectPermanentDeletionCondition1(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card)
- && (permanent.IsDigimon
- || permanent.IsTamer);
- }
- IEnumerator SharedActivateCoroutine1(Hashtable hashtable, ActivateClass activateClass)
- {
- if (card.Owner.HandCards.Count(CanSelectCardCondition1) + card.Owner.TrashCards.Count(CanSelectCardCondition1) >= 2)
- {
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentPlaceCondition1,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- selectPermanentCoroutine: selectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass
- );
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to place sources under.", "The opponent is selecting 1 Digimon to place sources under.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator selectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- if (selectedPermanent != null)
- {
- int toSelect = 2;
- List<CardSource> selectedCards = new List<CardSource>();
- while (toSelect > 0)
- {
- bool CanSelectFilteredCardCondtion(CardSource cardSource)
- {
- return CanSelectCardCondition1(cardSource)
- && !selectedCards.Contains(cardSource);
- }
- int validHandCardCount = card.Owner.HandCards.Count(CanSelectFilteredCardCondtion);
- int validTrashCardCount = card.Owner.TrashCards.Count(CanSelectFilteredCardCondtion);
- List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>();
- if (validHandCardCount > 0)
- {
- selectionElements.Add(new(message: "from Hand", value: 1, spriteIndex: 0));
- }
- if (validTrashCardCount > 0)
- {
- selectionElements.Add(new(message: "from Trash", value: 2, spriteIndex: 0));
- }
- selectionElements.Add(new(message: "Do not place", value: 3, spriteIndex: 1));
- GManager.instance.userSelectionManager.SetIntSelection(
- selectionElements: selectionElements,
- selectPlayer: card.Owner,
- selectPlayerMessage: "From which area will you select a card?",
- notSelectPlayerMessage: "The opponent is choosing from which area to select card.");
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
- if (GManager.instance.userSelectionManager.SelectedIntValue == 3)
- {
- break;
- }
- if (GManager.instance.userSelectionManager.SelectedIntValue == 1)
- {
- int maxCount = Math.Min(toSelect, card.Owner.HandCards.Count(CanSelectCardCondition1));
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- selectHandEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectFilteredCardCondtion,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: true,
- canEndNotMax: true,
- isShowOpponent: true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- mode: SelectHandEffect.Mode.Custom,
- cardEffect: activateClass);
- string messagePluralize = maxCount > 1 ? "Select one or more cards to place under this Digimon. You will be able to select a second card if you only choose 1." : "Select a card to place under this Digimon.";
- selectHandEffect.SetUpCustomMessage(
- messagePluralize,
- $"The opponent is selecting cards to place.");
- yield return StartCoroutine(selectHandEffect.Activate());
- }
- else
- {
- int maxCount = Math.Min(toSelect, card.Owner.TrashCards.Count(CanSelectCardCondition1));
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: CanSelectFilteredCardCondtion,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- message: "Select link card(s)",
- maxCount: maxCount,
- canEndNotMax: true,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.Trash,
- customRootCardList: null,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- string messagePluralize = maxCount > 1 ? "Select one or more cards to place under this Digimon. You will be able to select a second card if you only choose 1." : "Select a card to place under this Digimon.";
- selectCardEffect.SetUpCustomMessage(
- messagePluralize,
- $"The opponent is selecting cards to place.");
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
- }
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- if (cardSource != null)
- {
- selectedCards.Add(cardSource);
- toSelect--;
- }
- yield return null;
- }
- }
- if (selectedCards.Count == 2)
- {
- List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
- {
- new SelectionElement<bool>(message: $"To Top", value : true, spriteIndex: 0),
- new SelectionElement<bool>(message: $"To Bottom", value : false, spriteIndex: 1),
- };
- string selectPlayerMessage1 = "What order do you place the cards?";
- string notSelectPlayerMessage1 = "The opponent is choosing what order to place the cards.";
- GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
- List<CardSource> fixedCards = new List<CardSource>();
- bool ToTop = GManager.instance.userSelectionManager.SelectedBoolValue;
- selectCardEffect.SetUp(
- canTargetCondition: _ => true,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => false,
- selectCardCoroutine: null,
- afterSelectCardCoroutine: AfterSelectCardCoroutine,
- message: "Specify the order to place the cards in the digivolution cards\n(cards will be placed so that cards with lower numbers are on top).",
- maxCount: selectedCards.Count,
- canEndNotMax: false,
- isShowOpponent: false,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.Custom,
- customRootCardList: selectedCards,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Cards");
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
- IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
- {
- fixedCards = cardSources.Clone();
- fixedCards.Reverse();
- if (ToTop)
- {
- yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsTop(fixedCards, activateClass));
- }
- else
- {
- yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(fixedCards, activateClass));
- }
- yield return null;
- }
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentDeletionCondition1))
- {
- SelectPermanentEffect selectPermanentEffect2 = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect2.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentDeletionCondition1,
- 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(selectPermanentEffect2.Activate());
- }
- }
- }
- }
- }
- #endregion
- #region Shared OP/WD/WA/C
- string SharedEffectName2 = "May play/use 1 10 cost or lower [Gammamon] text/[VB] from sources for free";
- string SharedEffectHash2 = "EX12_077_OP_WD_WA_C";
- CardEffectFactory.ActivateClassesForSharedEffects
- (ref cardEffects, timing, card,
- SharedEffectName2,
- SharedActivateCoroutine2,
- SharedEffectDescription2,
- additionalActivateCondition: AdditionalActivateCondition2,
- optional: false,
- isSkippable: true,
- maxCountPerTurn: 1,
- hashValue: SharedEffectHash2,
- onPlay: true,
- whenDigivolving: true,
- whenAttacking: true,
- counter: true);
- string SharedEffectDescription2(string tag)
- {
- return $"[{tag}] [Once Per Turn] You may play or use 1 play or use cost 10 or lower card with [Gammamon] in its text or the [VB] trait from any of your Digimon's digivolution cards without paying the cost.";
- }
- bool AdditionalActivateCondition2(Hashtable hashtable, ActivateClass activateClass)
- {
- return CardEffectCommons.HasMatchConditionPermanent(permanent => CanSelectPermanentCondition2(permanent, activateClass));
- }
- bool CanSelectCardCondition2(CardSource cardSource, ActivateClass activateClass)
- {
- return (cardSource.HasText("Gammamon")
- || cardSource.EqualsTraits("VB"))
- && cardSource.GetCostItself <= 10
- && ((cardSource.IsOption
- && !cardSource.CanNotPlayThisOption)
- || (cardSource.HasPlayCost
- && CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass)));
- }
- bool CanSelectPermanentCondition2(Permanent permanent, ActivateClass activateClass)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && permanent.DigivolutionCards.Some(cardSource => CanSelectCardCondition2(cardSource, activateClass));
- }
- IEnumerator SharedActivateCoroutine2(Hashtable hashtable, ActivateClass activateClass)
- {
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: permanent => CanSelectPermanentCondition2(permanent, activateClass),
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- selectPermanentCoroutine: selectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass
- );
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to play/use a source from.", "The opponent is selecting 1 Digimon to play/use a source from.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator selectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- if (selectedPermanent != null)
- {
- CardSource selectedCard = null;
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: cardSource => CanSelectCardCondition2(cardSource, activateClass),
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- message: "Select 1 card to play/use",
- maxCount: 1,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.DigivolutionCards,
- customRootCardList: selectedPermanent.DigivolutionCards,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectCardEffect.SetUpCustomMessage("Select 1 card to play/use.", "The opponent is selecting 1 card to play/use.");
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedCard = cardSource;
- yield return null;
- }
- if (selectedCard != null)
- {
- if (selectedCard.IsOption)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayOptionCards(
- cardSources: new List<CardSource>() { selectedCard },
- activateClass: activateClass,
- payCost: false,
- root: SelectCardEffect.Root.Hand));
- }
- else
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
- new List<CardSource>() { selectedCard },
- activateClass: activateClass,
- payCost: false,
- isTapped: false,
- root: SelectCardEffect.Root.Hand,
- activateETB: true));
- }
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|