EX4_035.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX4
  4. {
  5. public class EX4_035 : 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.None)
  11. {
  12. bool PermanentCondition(Permanent targetPermanent)
  13. {
  14. return (targetPermanent.TopCard.ContainsCardName("Terriermon") || targetPermanent.TopCard.ContainsCardName("Lopmon")) && targetPermanent.TopCard.HasLevel && targetPermanent.Level == 3;
  15. }
  16. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
  17. }
  18. if (timing == EffectTiming.OnAllyAttack)
  19. {
  20. cardEffects.Add(CardEffectFactory.AllianceSelfEffect(isInheritedEffect: false, card: card, condition: null));
  21. }
  22. if (timing == EffectTiming.OnTappedAnyone)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("DP +2000", CanUseCondition, card);
  26. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  27. activateClass.SetIsInheritedEffect(true);
  28. activateClass.SetHashString("DP+2000_EX4_035");
  29. cardEffects.Add(activateClass);
  30. string EffectDiscription()
  31. {
  32. return "[Your Turn] [Once Per Turn] When an effect suspends another Digimon, this Digimon gets +2000 DP until the end of your opponent's turn.";
  33. }
  34. bool PermanentCondition(Permanent permanent)
  35. {
  36. if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
  37. {
  38. if (permanent.IsDigimon)
  39. {
  40. if (permanent != card.PermanentOfThisCard())
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48. bool CanUseCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (CardEffectCommons.IsOwnerTurn(card))
  53. {
  54. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  55. {
  56. if (CardEffectCommons.IsByEffect(hashtable, null))
  57. {
  58. return true;
  59. }
  60. }
  61. }
  62. }
  63. return false;
  64. }
  65. bool CanActivateCondition(Hashtable hashtable)
  66. {
  67. return CardEffectCommons.IsExistOnBattleArea(card);
  68. }
  69. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  70. {
  71. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: card.PermanentOfThisCard(), changeValue: 2000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  72. }
  73. }
  74. return cardEffects;
  75. }
  76. }
  77. }