BT21_072.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. //BT21_072 Arresterdramon: Superior Mode
  6. namespace DCGO.CardEffects.BT21
  7. {
  8. public class BT21_072 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Alternative Digivolution Cost
  14. if (timing == EffectTiming.None)
  15. {
  16. bool validDigivolutionCondition(Permanent permanent)
  17. {
  18. return permanent.Level == 4 && (permanent.TopCard.EqualsTraits("Hero") || permanent.TopCard.HasSaveText);
  19. }
  20. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(validDigivolutionCondition, 3, false, card, null));
  21. }
  22. #endregion
  23. #region raid, piercing
  24. if (timing == EffectTiming.OnAllyAttack)
  25. {
  26. cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
  27. }
  28. if (timing == EffectTiming.OnDetermineDoSecurityCheck)
  29. {
  30. cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: null));
  31. }
  32. #endregion
  33. #region When Digivolving
  34. if (timing == EffectTiming.OnEnterFieldAnyone)
  35. {
  36. ActivateClass activateClass = new ActivateClass();
  37. activateClass.SetUpICardEffect("Attack with this Digimon without suspending", CanUseCondition, card);
  38. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  39. cardEffects.Add(activateClass);
  40. string EffectDescription()
  41. {
  42. return "[When Digivolving] This Digimon may attack without suspending.";
  43. }
  44. bool CanUseCondition(Hashtable hashtable)
  45. {
  46. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  47. }
  48. bool CanActivateCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. return card.PermanentOfThisCard().CanAttack(activateClass, withoutTap: true);
  53. }
  54. return false;
  55. }
  56. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  57. {
  58. if (CardEffectCommons.IsExistOnBattleArea(card))
  59. {
  60. if (card.PermanentOfThisCard().CanAttack(activateClass, withoutTap: true))
  61. {
  62. SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
  63. selectAttackEffect.SetUp(
  64. attacker: card.PermanentOfThisCard(),
  65. canAttackPlayerCondition: () => true,
  66. defenderCondition: (permanent) => true,
  67. cardEffect: activateClass);
  68. selectAttackEffect.SetWithoutTap();
  69. yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
  70. }
  71. }
  72. }
  73. }
  74. #endregion
  75. #region All Turns
  76. if (timing == EffectTiming.None)
  77. {
  78. int count()
  79. {
  80. if (CardEffectCommons.IsExistOnBattleArea(card))
  81. {
  82. return card.PermanentOfThisCard().DigivolutionCards.Count();
  83. }
  84. return 0;
  85. }
  86. bool condition()
  87. {
  88. if (CardEffectCommons.IsExistOnBattleArea(card))
  89. {
  90. if (count() >= 1)
  91. {
  92. return true;
  93. }
  94. }
  95. return false;
  96. }
  97. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  98. changeValue: 1000 * count(),
  99. isInheritedEffect: false,
  100. card: card,
  101. condition: condition));
  102. }
  103. #endregion
  104. #region inherit your turn +2k
  105. if(timing == EffectTiming.None)
  106. {
  107. bool condition()
  108. {
  109. return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card);
  110. }
  111. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: condition));
  112. }
  113. #endregion
  114. return cardEffects;
  115. }
  116. }
  117. }