BT12_022.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT12
  4. {
  5. public class BT12_022 : 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.BeforePayCost)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. activateClass.SetHashString("Memory+1_BT12_022");
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[Your Turn] If this Digimon would DNA digivolve into a green Digimon card, gain 1 memory.";
  20. }
  21. bool CanUseCondition(Hashtable hashtable)
  22. {
  23. if (CardEffectCommons.IsExistOnBattleArea(card))
  24. {
  25. if (CardEffectCommons.IsOwnerTurn(card))
  26. {
  27. bool CardCondition(CardSource cardSource)
  28. {
  29. if (cardSource.HasCardColor(CardColor.Green))
  30. {
  31. if (cardSource.IsDigimon)
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. if (CardEffectCommons.CanTriggerWhenPermanentWouldDigivolveOfCard(hashtable, CardCondition, card))
  39. {
  40. if (CardEffectCommons.IsJogress(hashtable))
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. }
  47. return false;
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. if (card.Owner.CanAddMemory(activateClass))
  54. {
  55. return true;
  56. }
  57. }
  58. return false;
  59. }
  60. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  61. {
  62. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  63. }
  64. }
  65. if (timing == EffectTiming.None)
  66. {
  67. bool Condition()
  68. {
  69. if (CardEffectCommons.IsExistOnBattleArea(card))
  70. {
  71. if (CardEffectCommons.IsOwnerTurn(card))
  72. {
  73. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Imperialdramon"))
  74. {
  75. return true;
  76. }
  77. if (card.PermanentOfThisCard().TopCard.CardTraits.Contains("Free"))
  78. {
  79. return true;
  80. }
  81. }
  82. }
  83. return false;
  84. }
  85. cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: true, card: card, condition: Condition));
  86. }
  87. return cardEffects;
  88. }
  89. }
  90. }