BT19_007.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT19
  4. {
  5. public class BT19_007 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Start of Your Main Phase
  11. if (timing == EffectTiming.OnStartMainPhase)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Gain 1 memory", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[Start of Your Main Phase] If you have [Takato Matsuki]/[Calumon], gain 1 memory.";
  20. }
  21. bool HasPermanentsCondition(Permanent permanent)
  22. {
  23. if (permanent.TopCard.EqualsCardName("Calumon") || permanent.TopCard.EqualsCardName("Takato Matsuki"))
  24. return true;
  25. return false;
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  30. {
  31. if (CardEffectCommons.IsOwnerTurn(card))
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  41. CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasPermanentsCondition);
  42. }
  43. IEnumerator ActivateCoroutine(Hashtable hashtable)
  44. {
  45. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  46. }
  47. }
  48. #endregion
  49. #region Inherit
  50. if (timing == EffectTiming.None)
  51. {
  52. ChangeDPDeleteEffectMaxDPClass changeDPDeleteEffectMaxDPClass = new ChangeDPDeleteEffectMaxDPClass();
  53. changeDPDeleteEffectMaxDPClass.SetUpICardEffect("Maximum DP of DP-based deletion effects gets +2000 DP if 0 or less memory", CanUseCondition, card);
  54. changeDPDeleteEffectMaxDPClass.SetUpChangeDPDeleteEffectMaxDPClass(changeMaxDP: ChangeMaxDP);
  55. changeDPDeleteEffectMaxDPClass.SetIsInheritedEffect(true);
  56. cardEffects.Add(changeDPDeleteEffectMaxDPClass);
  57. bool CanUseCondition(Hashtable hashtable)
  58. {
  59. if (isExistOnField(card))
  60. {
  61. if (card.Owner.MemoryForPlayer <= 0)
  62. {
  63. if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
  64. {
  65. return true;
  66. }
  67. }
  68. }
  69. return false;
  70. }
  71. int ChangeMaxDP(int maxDP, ICardEffect cardEffect)
  72. {
  73. if (cardEffect != null)
  74. {
  75. if (cardEffect.EffectSourceCard != null)
  76. {
  77. if (cardEffect.EffectSourceCard.Owner == card.Owner)
  78. {
  79. if (cardEffect.EffectSourceCard.PermanentOfThisCard() == card.PermanentOfThisCard()) maxDP += 2000;
  80. }
  81. }
  82. }
  83. return maxDP;
  84. }
  85. }
  86. #endregion
  87. return cardEffects;
  88. }
  89. }
  90. }