BT11_014.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT11
  4. {
  5. public class BT11_014 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnAllyAttack)
  11. {
  12. cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
  13. }
  14. if (timing == EffectTiming.OnAttackTargetChanged)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Trash the top card of opponent's security", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  19. activateClass.SetIsInheritedEffect(true);
  20. activateClass.SetHashString("TrashSecurity_BT11_014");
  21. cardEffects.Add(activateClass);
  22. string EffectDiscription()
  23. {
  24. return "[Your Turn][Once Per Turn] When this Digimon's attack target is switched, trash the top card of your opponent's security stack.";
  25. }
  26. bool CanUseCondition(Hashtable hashtable)
  27. {
  28. if (CardEffectCommons.IsExistOnBattleArea(card))
  29. {
  30. if (CardEffectCommons.CanTriggerOnAttackTargetSwitch(hashtable, card))
  31. {
  32. if (CardEffectCommons.IsOwnerTurn(card))
  33. {
  34. return true;
  35. }
  36. }
  37. }
  38. return false;
  39. }
  40. bool CanActivateCondition(Hashtable hashtable)
  41. {
  42. if (CardEffectCommons.IsExistOnBattleArea(card))
  43. {
  44. return true;
  45. }
  46. return false;
  47. }
  48. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  49. {
  50. yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
  51. player: card.Owner.Enemy,
  52. destroySecurityCount: 1,
  53. cardEffect: activateClass,
  54. fromTop: true).DestroySecurity());
  55. }
  56. }
  57. return cardEffects;
  58. }
  59. }
  60. }