P_137.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.P
  4. {
  5. public class P_137 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Digivolution Condition
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.CardNames.Contains("Veemon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  18. permanentCondition: PermanentCondition,
  19. digivolutionCost: 2,
  20. ignoreDigivolutionRequirement: false,
  21. card: card,
  22. condition: null));
  23. }
  24. #endregion
  25. #region Armor Purge
  26. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  27. {
  28. cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card));
  29. }
  30. #endregion
  31. #region Raid
  32. if (timing == EffectTiming.OnAllyAttack)
  33. {
  34. cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
  35. }
  36. #endregion
  37. #region Your Turn
  38. if (timing == EffectTiming.OnAttackTargetChanged)
  39. {
  40. ActivateClass activateClass = new ActivateClass();
  41. activateClass.SetUpICardEffect("Your opponent adds the top card of their security stack to the hand", CanUseCondition, card);
  42. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  43. activateClass.SetHashString("AddOpponentSecurityToHand_P_0137");
  44. cardEffects.Add(activateClass);
  45. string EffectDiscription()
  46. {
  47. return "[Your Turn][Once Per Turn] When this Digimon's attack target is switched, your opponent adds the top card of their security stack to the hand.";
  48. }
  49. bool CanUseCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  52. {
  53. if (CardEffectCommons.CanTriggerOnAttackTargetSwitch(hashtable, card))
  54. {
  55. if (CardEffectCommons.IsOwnerTurn(card))
  56. {
  57. return true;
  58. }
  59. }
  60. }
  61. return false;
  62. }
  63. bool CanActivateCondition(Hashtable hashtable)
  64. {
  65. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  66. {
  67. return true;
  68. }
  69. return false;
  70. }
  71. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  72. {
  73. if (card.Owner.Enemy.SecurityCards.Count >= 1)
  74. {
  75. CardSource topCard = card.Owner.Enemy.SecurityCards[0];
  76. yield return ContinuousController.instance.StartCoroutine(
  77. CardObjectController.AddHandCards(new List<CardSource>() { topCard }, false, activateClass));
  78. yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
  79. player: card.Owner.Enemy,
  80. refSkillInfos: ref ContinuousController.instance.nullSkillInfos,
  81. activateClass).ReduceSecurity());
  82. }
  83. }
  84. }
  85. #endregion
  86. return cardEffects;
  87. }
  88. }
  89. }