| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- using System.Collections;
- using System.Collections.Generic;
- using System;
- using System.Linq;
- // Zofr Kabus
- namespace DCGO.CardEffects.EX8
- {
- public class EX8_070 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Main
- if (timing == EffectTiming.OptionSkill)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("By trashing 1 source, gain collision, piercing, reboot, +3000 DP, and can't be returned to hand or deck by opponent", CanUseCondition, card);
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Main] By trashing any 1 digivolution card of 1 of your [Mineral] or [Rock] trait Digimon, until the end of your opponent's turn, it gains <Collision>, <Piercing> and <Reboot>, gets +3000 DP, and can't be returned to the hand or deck by your opponent's effects.";
- }
- bool HasProperTrait(CardSource source)
- {
- return source.EqualsTraits("Mineral") || source.EqualsTraits("Rock");
- }
- bool DigimonWithProperSource(Permanent permanent)
- {
- return CardEffectCommons.IsOwnerPermanent(permanent, card) &&
- permanent.IsDigimon &&
- HasProperTrait(permanent.TopCard) &&
- permanent.DigivolutionCards.Count() > 0;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card) &&
- CardEffectCommons.HasMatchConditionPermanent(DigimonWithProperSource);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- bool cardsTrashed = false;
- Permanent selectedPermanent = null;
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
- permanentCondition: DigimonWithProperSource,
- cardCondition: null,
- maxCount: 1,
- canNoTrash: true,
- isFromOnly1Permanent: true,
- activateClass: activateClass,
- afterSelectionCoroutine: AfterTrashedCards
- ));
- IEnumerator AfterTrashedCards(Permanent permanent, List<CardSource> cards)
- {
- if (cards.Count == 1)
- cardsTrashed = true;
- selectedPermanent = permanent;
- yield return null;
- }
- if (cardsTrashed)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCollision(selectedPermanent, EffectDuration.UntilOpponentTurnEnd, activateClass));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainPierce(selectedPermanent, EffectDuration.UntilOpponentTurnEnd, activateClass));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainReboot(selectedPermanent, EffectDuration.UntilOpponentTurnEnd, activateClass));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(selectedPermanent, 3000, EffectDuration.UntilOpponentTurnEnd, activateClass));
- bool CardEffectCondition(ICardEffect cardEffect)
- {
- return CardEffectCommons.IsOpponentEffect(cardEffect, card);
- }
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToHand(
- targetPermanent: selectedPermanent,
- cardEffectCondition: CardEffectCondition,
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
- activateClass: activateClass,
- effectName: "Can't return to hand by opponent's effects"));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToDeck(
- targetPermanent: selectedPermanent,
- cardEffectCondition: CardEffectCondition,
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
- activateClass: activateClass,
- effectName: "Can't return to deck by opponent's effects"));
- }
- }
- }
- #endregion
- #region Security Effect
- if (timing == EffectTiming.SecuritySkill)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect($"Delete 1 Digimon", CanUseCondition, card);
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
- activateClass.SetIsSecurityEffect(true);
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Security] Delete 1 of your opponent's Digimon with the lowest play cost.";
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
- {
- if (CardEffectCommons.IsMinCost(permanent, card.Owner.Enemy, true))
- {
- return true;
- }
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Destroy,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|