| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Medusamon
- namespace DCGO.CardEffects.BT21
- {
- public class BT21_029 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Static Effects
- #region Progress
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.ProgressSelfStaticEffect(false, card, null));
- }
- #endregion
- #region Sec +1
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(
- changeValue: 1,
- isInheritedEffect: false,
- card: card,
- condition: null));
- }
- #endregion
- #endregion
- #region When Digivolving/End of Attack Shared
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
- {
- if (CardEffectCommons.IsMinDP(permanent, card.Owner.Enemy))
- {
- return true;
- }
- }
- return false;
- }
- IEnumerator WDAndEoAActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- 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
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete lowest DP Digimon", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, hashtable => WDAndEoAActivateCoroutine(hashtable, activateClass), 1, true, EffectDiscription());
- activateClass.SetHashString("Delete_BT21_029");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- => "[When Digivolving] [Once Per Turn] You may delete 1 of your opponent's lowest DP Digimon.";
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- return true;
- }
- return false;
- }
- }
- #endregion
- #region End of Attack
- if (timing == EffectTiming.OnEndAttack)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete lowest DP Digimon", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, hashtable => WDAndEoAActivateCoroutine(hashtable, activateClass), 1, true, EffectDiscription());
- activateClass.SetHashString("Delete_BT21_029");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- => "[End of Attack] [Once Per Turn] You may delete 1 of your opponent's lowest DP Digimon.";
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerOnEndAttack(hashtable, card))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- return true;
- }
- return false;
- }
- }
- #endregion
- #region All Turns Shared
- IEnumerator AllTurnsSharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPetrificationToken(activateClass));
- }
- #endregion
- #region All Turns - When Opponent Digimon Deleted
- if (timing == EffectTiming.OnDestroyedAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Play 1 [Petrification Token]", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, hashtable => AllTurnsSharedActivateCoroutine(hashtable, activateClass), 1, false, EffectDiscription());
- activateClass.SetHashString("PlayToken_BT21_029");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[All Turns] [Once Per Turn] When any of your opponent's Digimon are deleted, they play 1 [Petrification] Token";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- return true;
- }
- return false;
- }
- bool PermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
- {
- return true;
- }
- return false;
- }
- }
- #endregion
- #region All Turns - When Opponent Security Stack Removed
- if (timing == EffectTiming.OnLoseSecurity)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Play 1 [Petrification Token]", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, hashtable => AllTurnsSharedActivateCoroutine(hashtable, activateClass), 1, false, EffectDiscription());
- activateClass.SetHashString("PlayToken_BT21_029");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[All Turns] [Once Per Turn] When opponents security stack is removed from, they play 1 [Petrification] Token";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, PlayerCondition))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- return true;
- }
- return false;
- }
- bool PlayerCondition(Player player)
- {
- if (player == card.Owner.Enemy)
- {
- return true;
- }
- return false;
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|