| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // PlatinumNumemon
- namespace DCGO.CardEffects.BT22
- {
- public class BT22_065 : 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.IsLevel5
- && targetPermanent.TopCard.HasCSTraits;
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 3,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null)
- );
- }
- #endregion
- #region OP/WD Shared
- bool SharedOpponentDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- Permanent selectedPermanent = null;
- #region Select Permanent
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOpponentsPermanentCount(card, SharedOpponentDigimon));
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: SharedOpponentDigimon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- selectPermanentEffect.SetUpCustomMessage("Select 1 digimon to -8K DP", "The opponent is selecting 1 Digimon to -8K DP");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- #endregion
- if (selectedPermanent != null) yield return ContinuousController.instance.StartCoroutine(
- CardEffectCommons.ChangeDigimonDP(selectedPermanent, -8000, EffectDuration.UntilEachTurnEnd, activateClass));
- }
- #endregion
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("-8K DP", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[On Play] 1 of your opponent's Digimon gets -8000 DP for the turn.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.HasMatchConditionOpponentsPermanent(card, SharedOpponentDigimon);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return SharedActivateCoroutine(hashtable, activateClass);
- }
- }
- #endregion
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("-8K DP", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[When Digivolving] 1 of your opponent's Digimon gets -8000 DP for the turn.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.HasMatchConditionOpponentsPermanent(card, SharedOpponentDigimon);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return SharedActivateCoroutine(hashtable, activateClass);
- }
- }
- #endregion
- #region Your Turn
- if (timing == EffectTiming.OnDestroyedAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Digivolve 1 [CS] digimon", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
- activateClass.SetHashString("BT22_065_Digivolve");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Your Turn] [Once Per Turn] When any of your opponent's Digimon are deleted, 1 of your other Digimon with the [CS] trait may digivolve into a Digimon card with the [CS] trait in the hand without paying the cost.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, IsOpponentDigimon, activateClass);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.IsOwnerTurn(card)
- && CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsCSOnBoard);
- }
- bool IsOpponentDigimon(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.Owner != card.Owner;
- }
- bool IsCSOnBoard(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
- permanent != card.PermanentOfThisCard() &&
- permanent.TopCard.HasCSTraits;
- }
- bool IsCSOnHand(CardSource cardSource, Permanent selectedPermanent)
- {
- return CardEffectCommons.IsExistOnHand(cardSource)
- && cardSource.HasCSTraits
- && cardSource.CanPlayCardTargetFrame(selectedPermanent.PermanentFrame, false, activateClass);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsCSOnBoard))
- {
- Permanent selectedPermanent = null;
- #region Select Permanent
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersPermanentCount(card, IsCSOnBoard));
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: IsCSOnBoard,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: true,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- selectPermanentEffect.SetUpCustomMessage("Select 1 digimon to digivolve", "The opponent is selecting 1 Digimon to digivolve");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- #endregion
- if (selectedPermanent != null) yield return ContinuousController.instance.StartCoroutine(
- CardEffectCommons.DigivolveIntoHandOrTrashCard(
- targetPermanent: selectedPermanent,
- cardCondition: card => IsCSOnHand(card, selectedPermanent),
- payCost: false,
- reduceCostTuple: null,
- fixedCostTuple: null,
- ignoreDigivolutionRequirementFixedCost: -1,
- isHand: true,
- activateClass: activateClass,
- successProcess: null));
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|