BT3_019.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. public class BT3_019 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.None)
  14. {
  15. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
  16. }
  17. if (timing == EffectTiming.None)
  18. {
  19. cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  20. }
  21. if (timing == EffectTiming.OnEnterFieldAnyone)
  22. {
  23. ActivateClass activateClass = new ActivateClass();
  24. activateClass.SetUpICardEffect("Place 1 card to digivolution cards to gain Memory +3", CanUseCondition, card);
  25. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  26. cardEffects.Add(activateClass);
  27. string EffectDiscription()
  28. {
  29. return "[When Digivolving] You may place 1 [Durandamon] or [BryweLudramon] from your hand on top of this card's digivolution cards to gain 3 memory.";
  30. }
  31. bool CanSelectCardCondition(CardSource cardSource)
  32. {
  33. if (cardSource != null)
  34. {
  35. if (cardSource.Owner == card.Owner)
  36. {
  37. if (cardSource.CardNames.Contains("Durandamon"))
  38. {
  39. return true;
  40. }
  41. if (cardSource.CardNames.Contains("BryweLudramon"))
  42. {
  43. return true;
  44. }
  45. }
  46. }
  47. return false;
  48. }
  49. bool CanUseCondition(Hashtable hashtable)
  50. {
  51. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  52. }
  53. bool CanActivateCondition(Hashtable hashtable)
  54. {
  55. if (CardEffectCommons.IsExistOnBattleArea(card))
  56. {
  57. if (card.Owner.HandCards.Count >= 1)
  58. {
  59. return true;
  60. }
  61. }
  62. return false;
  63. }
  64. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  65. {
  66. if (isExistOnField(card))
  67. {
  68. if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
  69. {
  70. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  71. {
  72. List<CardSource> selectedCards = new List<CardSource>();
  73. int maxCount = 1;
  74. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  75. selectHandEffect.SetUp(
  76. selectPlayer: card.Owner,
  77. canTargetCondition: CanSelectCardCondition,
  78. canTargetCondition_ByPreSelecetedList: null,
  79. canEndSelectCondition: null,
  80. maxCount: maxCount,
  81. canNoSelect: true,
  82. canEndNotMax: false,
  83. isShowOpponent: true,
  84. selectCardCoroutine: SelectCardCoroutine,
  85. afterSelectCardCoroutine: null,
  86. mode: SelectHandEffect.Mode.Custom,
  87. cardEffect: activateClass);
  88. selectHandEffect.SetUpCustomMessage("Select 1 card to place on top of digivolution cards.", "The opponent is selecting 1 card to place on top of digivolution cards.");
  89. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  90. yield return StartCoroutine(selectHandEffect.Activate());
  91. IEnumerator SelectCardCoroutine(CardSource cardSource)
  92. {
  93. selectedCards.Add(cardSource);
  94. yield return null;
  95. }
  96. if (selectedCards.Count >= 1)
  97. {
  98. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsTop(selectedCards, activateClass));
  99. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(3, activateClass));
  100. }
  101. }
  102. }
  103. }
  104. }
  105. }
  106. return cardEffects;
  107. }
  108. }