| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- using System.Collections;
- using System.Collections.Generic;
- // Omnimon
- namespace DCGO.CardEffects.EX12
- {
- public class EX12_037 : 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.EqualsTraits("ME")
- || 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.Blue)
- || permanent.TopCard.CardColors.Contains(CardColor.Yellow))
- && permanent.Levels_ForJogress(card).Contains(6);
- }
- bool PermanentCondition2(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && (permanent.TopCard.CardColors.Contains(CardColor.Red)
- || permanent.TopCard.CardColors.Contains(CardColor.Black))
- && permanent.Levels_ForJogress(card).Contains(6);
- }
- JogressConditionElement[] elements = new JogressConditionElement[]
- {
- new JogressConditionElement(PermanentCondition1, "a level 6 Blue or Yellow Digimon"),
- new JogressConditionElement(PermanentCondition2, "a level 6 Red or Black Digimon"),
- };
- JogressCondition jogressCondition = new JogressCondition(elements, 0);
- return jogressCondition;
- }
- return null;
- }
- }
- #endregion
- #region Piercing
- if (timing == EffectTiming.OnDetermineDoSecurityCheck)
- {
- cardEffects.Add(CardEffectFactory.PierceSelfEffect(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 Barrier
- if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
- {
- cardEffects.Add(CardEffectFactory.BarrierSelfEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Shared WD/WA
- string SharedEffectName = "Delete 1 enemy digimon, then per 5 sources -13K DP 1 enemy Digimon or trash 1 security and <Recovery +1>";
- string SharedEffectHash = "EX12_037_WD_WA";
- CardEffectFactory.ActivateClassesForSharedEffects
- (ref cardEffects, timing, card,
- SharedEffectName,
- SharedActivateCoroutine,
- SharedEffectDescription,
- optional: false,
- maxCountPerTurn: 1,
- hashValue: SharedEffectHash,
- whenDigivolving: true,
- whenAttacking: true);
- string SharedEffectDescription(string tag)
- {
- return $"[{tag}] [Once Per Turn] Delete 1 of your opponent's Digimon. Then, for every 5 of this Digimon's digivolution cards, activate 1 of the effects below:\r\n• 1 of your opponent's Digimon gets -13000 DP until their turn ends.\r\n• Trash your opponent's top security card. Then, <Recovery +1>.";
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- 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());
- }
- int sourceLoops = card.PermanentOfThisCard().DigivolutionCards.Count / 5;
- while (sourceLoops > 0)
- {
- string selectPlayerMessage = "Which effect will you use?";
- string notSelectPlayerMessage = "The opponent is choosing which effect to use.";
- List<SelectionElement<bool>> command_SelectCommands = new List<SelectionElement<bool>>()
- {
- new SelectionElement<bool>(message: $"DP - 13K", value: true, spriteIndex: 0),
- new SelectionElement<bool>(message: $"Trash security", value: false, spriteIndex: 0),
- };
- GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: command_SelectCommands, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
- bool DPMinus = GManager.instance.userSelectionManager.SelectedBoolValue;
- if (DPMinus)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage($"Select 1 Digimon that will get DP -13000.", $"The opponent is selecting 1 Digimon that will get DP -13000.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -13000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
- }
- }
- }
- 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(
- player: card.Owner,
- AddLifeCount: 1,
- cardEffect: activateClass).Recovery());
- }
- sourceLoops--;
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|