BT19_079.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT19
  4. {
  5. public class BT19_079 : 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 Turn
  11. if (timing == EffectTiming.OnStartTurn)
  12. {
  13. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  14. }
  15. #endregion
  16. #region All Turns
  17. if (timing == EffectTiming.BeforePayCost)
  18. {
  19. ActivateClass activateClass = new ActivateClass();
  20. activateClass.SetUpICardEffect("Can select DigiXros cards from Tamer's digivolution cards", CanUseCondition, card);
  21. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  22. activateClass.SetHashString("CanSelectDigiXrosFromTamer_BT19_079");
  23. cardEffects.Add(activateClass);
  24. string EffectDescription()
  25. {
  26. return
  27. "[All Turns] When any of your [Xros Heart] trait Digimon cards with DigiXros requirements would be played, by suspending this Tamer, you may place cards from under your Tamers as digivolution cards for a DigiXros.";
  28. }
  29. bool CardCondition(CardSource cardSource)
  30. {
  31. return cardSource.Owner == card.Owner && cardSource.IsDigimon &&
  32. cardSource.EqualsTraits("Xros Heart") && cardSource.HasDigiXros;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.IsExistOnBattleArea(card) &&
  37. CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, CardCondition) &&
  38. CardEffectCommons.IsOnly1CardPlayed(hashtable);
  39. }
  40. bool CanActivateCondition(Hashtable hashtable)
  41. {
  42. return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.CanActivateSuspendCostEffect(card);
  43. }
  44. IEnumerator ActivateCoroutine(Hashtable hashtable)
  45. {
  46. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
  47. new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  48. ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
  49. AddMaxUnderTamerCountDigiXrosClass addMaxTamerCountDigiXrosClass = new AddMaxUnderTamerCountDigiXrosClass();
  50. addMaxTamerCountDigiXrosClass.SetUpICardEffect("Can select DigiXros cards from Tamer's digivolution cards",
  51. CanUseCondition1, card);
  52. addMaxTamerCountDigiXrosClass.SetUpAddMaxUnderTamerCountDigiXrosClass(getMaxUnderTamerCount: GetCount);
  53. card.Owner.UntilCalculateFixedCostEffect.Add(_ => addMaxTamerCountDigiXrosClass);
  54. bool CanUseCondition1(Hashtable conHashtable)
  55. {
  56. return true;
  57. }
  58. int GetCount(CardSource cardSource)
  59. {
  60. if (CardSourceCondition(cardSource))
  61. {
  62. return 100;
  63. }
  64. return 0;
  65. }
  66. bool CardSourceCondition(CardSource cardSource)
  67. {
  68. if (cardSource.Owner == card.Owner)
  69. {
  70. if (cardSource.HasDigiXros)
  71. {
  72. return true;
  73. }
  74. }
  75. return false;
  76. }
  77. }
  78. }
  79. #endregion
  80. #region Security Effect
  81. if (timing == EffectTiming.SecuritySkill)
  82. {
  83. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  84. }
  85. #endregion
  86. return cardEffects;
  87. }
  88. }
  89. }