BT3_111.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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_111 : 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. bool Condition()
  16. {
  17. return card.Owner.HandCards.Contains(card);
  18. }
  19. bool PermanentCondition(Permanent targetPermanent)
  20. {
  21. if (targetPermanent != null)
  22. {
  23. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(targetPermanent, card))
  24. {
  25. if (targetPermanent.TopCard.CardNames.Contains("Paildramon"))
  26. {
  27. return true;
  28. }
  29. if (targetPermanent.TopCard.CardNames.Contains("Dinobeemon"))
  30. {
  31. return true;
  32. }
  33. }
  34. }
  35. return false;
  36. }
  37. bool CardSourceCondition(CardSource cardSource)
  38. {
  39. return cardSource == card && cardSource.Owner.HandCards.Contains(cardSource);
  40. }
  41. bool RootCondition(SelectCardEffect.Root root)
  42. {
  43. return root == SelectCardEffect.Root.Hand;
  44. }
  45. cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect(
  46. changeValue: -2,
  47. permanentCondition: PermanentCondition,
  48. cardCondition: CardSourceCondition,
  49. rootCondition: RootCondition,
  50. isInheritedEffect: false,
  51. card: card,
  52. condition: Condition,
  53. setFixedCost: false));
  54. }
  55. if (timing == EffectTiming.OnDetermineDoSecurityCheck)
  56. {
  57. cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: null));
  58. }
  59. if (timing == EffectTiming.OnEndBattle)
  60. {
  61. ActivateClass activateClass = new ActivateClass();
  62. activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
  63. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  64. activateClass.SetHashString("Unsuspend_BT3_111");
  65. cardEffects.Add(activateClass);
  66. string EffectDiscription()
  67. {
  68. return "[Your Turn][Once Per Turn] When this Digimon deletes an opponent's Digimon in battle and survives, unsuspend this Digimon.";
  69. }
  70. bool CanUseCondition(Hashtable hashtable)
  71. {
  72. if (CardEffectCommons.IsExistOnBattleArea(card))
  73. {
  74. if (CardEffectCommons.IsOwnerTurn(card))
  75. {
  76. bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
  77. bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card);
  78. if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(hashtable: hashtable, winnerCondition: WinnerCondition, loserCondition: LoserCondition, isOnlyWinnerSurvive: true))
  79. {
  80. return true;
  81. }
  82. }
  83. }
  84. return false;
  85. }
  86. bool CanActivateCondition(Hashtable hashtable)
  87. {
  88. if (CardEffectCommons.IsExistOnBattleArea(card))
  89. {
  90. return true;
  91. }
  92. return false;
  93. }
  94. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  95. {
  96. Permanent selectedPermanent = card.PermanentOfThisCard();
  97. yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
  98. }
  99. }
  100. return cardEffects;
  101. }
  102. }