| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.BT19
- {
- public class BT19_028 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Security Attack +1, Blocker
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(
- changeValue: 1,
- isInheritedEffect: false,
- card: card,
- condition: null));
- cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
- isInheritedEffect: false,
- card: card,
- condition: null));
- }
- #endregion
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect(
- "Unsuspend 1 Digimon, then place 1 of your other digimon into digivolution cards to get 3 memory.",
- CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[When Digivolving] Unsuspend 1 of your Digimon. Then, by placing 1 of your other Digimon with [Aqua]/[Sea Animal] in one of its traits as this Digimon's bottom digivolution card, gain 3 memory.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- bool CanSelectYourSuspendedDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
- }
- bool CanSelectAquaDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
- permanent != card.PermanentOfThisCard() &&
- permanent.TopCard.HasAquaTraits;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- (CardEffectCommons.HasMatchConditionPermanent(CanSelectYourSuspendedDigimon) ||
- CardEffectCommons.HasMatchConditionPermanent(CanSelectAquaDigimon));
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectYourSuspendedDigimon))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition_ByPreSelecetedList: null,
- canTargetCondition: CanSelectYourSuspendedDigimon,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.UnTap,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to unsuspend.",
- "The opponent is selecting 1 Digimon to unsuspend.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectAquaDigimon))
- {
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect =
- GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectAquaDigimon,
- 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 card to place on bottom of digivolution cards.",
- "The opponent is selecting 1 card to place on bottom of digivolution cards.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
-
- yield return null;
- }
- if (selectedPermanent != null)
- {
- yield return ContinuousController.instance.StartCoroutine(new IPlacePermanentToDigivolutionCards(
- new List<Permanent[]>() { new[] { selectedPermanent, card.PermanentOfThisCard() } },
- false,
- activateClass).PlacePermanentToDigivolutionCards());
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(3, activateClass));
- }
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|