BT10_088.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. namespace DCGO.CardEffects.BT10
  9. {
  10. public class BT10_088 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. if (timing == EffectTiming.OnStartTurn)
  16. {
  17. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  18. }
  19. if (timing == EffectTiming.BeforePayCost)
  20. {
  21. ActivateClass activateClass = new ActivateClass();
  22. activateClass.SetUpICardEffect("Can select DigiXros cards from Tamer's digivolution cards", CanUseCondition, card);
  23. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  24. activateClass.SetHashString("CanSelectDigiXrosFromTamer_BT10_088");
  25. cardEffects.Add(activateClass);
  26. string EffectDiscription()
  27. {
  28. return "[Your Turn] When you play 1 Digimon with DigiXros requirements, by suspending this Tamer, you may place cards from under one of your Tamers as digivolution cards for a DigiXros.";
  29. }
  30. bool CardCondition(CardSource cardSource)
  31. {
  32. if (cardSource.Owner == card.Owner)
  33. {
  34. if (cardSource.IsDigimon)
  35. {
  36. if (cardSource.HasDigiXros)
  37. {
  38. return true;
  39. }
  40. }
  41. }
  42. return false;
  43. }
  44. bool CanUseCondition(Hashtable hashtable)
  45. {
  46. if (CardEffectCommons.IsExistOnBattleArea(card))
  47. {
  48. if (CardEffectCommons.IsOwnerTurn(card))
  49. {
  50. if (CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, CardCondition))
  51. {
  52. if (CardEffectCommons.IsOnly1CardPlayed(hashtable))
  53. {
  54. return true;
  55. }
  56. }
  57. }
  58. }
  59. return false;
  60. }
  61. bool CanActivateCondition(Hashtable hashtable)
  62. {
  63. if (CardEffectCommons.IsExistOnBattleArea(card))
  64. {
  65. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  66. {
  67. return true;
  68. }
  69. }
  70. return false;
  71. }
  72. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  73. {
  74. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  75. ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
  76. AddMaxUnderTamerCountDigiXrosClass addMaxTamerCountDigiXrosClass = new AddMaxUnderTamerCountDigiXrosClass();
  77. addMaxTamerCountDigiXrosClass.SetUpICardEffect("Can select DigiXros cards from Tamer's digivolution cards", CanUseCondition1, card);
  78. addMaxTamerCountDigiXrosClass.SetUpAddMaxUnderTamerCountDigiXrosClass(getMaxUnderTamerCount: GetCount);
  79. card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => addMaxTamerCountDigiXrosClass);
  80. bool CanUseCondition1(Hashtable hashtable)
  81. {
  82. return true;
  83. }
  84. int GetCount(CardSource cardSource)
  85. {
  86. if (CardSourceCondition(cardSource))
  87. {
  88. return 100;
  89. }
  90. return 0;
  91. }
  92. bool CardSourceCondition(CardSource cardSource)
  93. {
  94. if (cardSource.Owner == card.Owner)
  95. {
  96. if (cardSource.HasDigiXros)
  97. {
  98. return true;
  99. }
  100. }
  101. return false;
  102. }
  103. }
  104. }
  105. if (timing == EffectTiming.SecuritySkill)
  106. {
  107. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  108. }
  109. return cardEffects;
  110. }
  111. }
  112. }