| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace DCGO.CardEffects.P
- {
- public class P_135 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("1 Opponent's Digimon can't attack Digimon, and gain <Security A. -1>", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[When Digivolving] Until the end of your opponent's turn, 1 of their Digimon can't attack Digimon and gain <Security A. -1>.";
- }
- bool SelectDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: SelectDigimon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectedPermanent,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectedPermanent(Permanent permanent)
- {
- bool DefenderCondition(Permanent defender)
- {
- return defender != null;
- }
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(
- targetPermanent: permanent,
- defenderCondition: DefenderCondition,
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
- activateClass: activateClass,
- effectName: "Can't Attack Digimon"));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(
- targetPermanent: permanent,
- changeValue: -1,
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
- activateClass: activateClass));
- yield return null;
- }
- }
- }
- #endregion
- #region Your Turn - Jamming
- if (timing == EffectTiming.None)
- {
- bool HasArisaKinosaki(Permanent permanent)
- {
- return permanent.TopCard.CardNames.Contains("Arisa Kinosaki");
- }
- bool JammingCondition()
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasArisaKinosaki))
- {
- return true;
- }
- }
- return false;
- }
- cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(
- isInheritedEffect: false,
- card: card,
- condition: JammingCondition));
- }
- #endregion
- #region When Attacking - ESS
- if (timing == EffectTiming.OnAllyAttack)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Opponent's Digimon gets -2000 DP for the turn", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("ChangeDP_P_135");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[When Attacking] [Once Per Turn] 1 of your opponent's Digimon gets -2000 DP for the turn.";
- }
- bool SelectOpponentsDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: SelectOpponentsDigimon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
- targetPermanent: permanent,
- changeValue: -2000,
- effectDuration: EffectDuration.UntilEachTurnEnd,
- activateClass: activateClass));
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|