| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace DCGO.CardEffects
- {
- public class Wanyamon_BT18_003 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
-
- if (timing == EffectTiming.OnAllyAttack)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("DP -2000 when yellow tamer in play", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- activateClass.SetIsInheritedEffect(true);
- cardEffects.Add(activateClass);
-
- string EffectDiscription()
- {
- return "[When Attacking] If you have a yellow Tamer, 1 of your opponent's Digimon gets -2000 DP for the turn.";
- }
-
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
-
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
- }
-
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- if (card.Owner.GetBattleAreaPermanents().Count(
- (permanent) => permanent.TopCard.CardColors.Contains(CardColor.Yellow) && permanent.IsTamer) >= 1)
- return true;
- }
- }
-
- return false;
- }
-
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- 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: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
-
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -2000.",
- "The opponent is selecting 1 Digimon that will get DP -2000.");
-
- 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));
- }
- }
- }
-
- return cardEffects;
- }
- }
- }
|