BT4_094.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 BT4_094 : 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. if (CardEffectCommons.IsExistOnBattleArea(card))
  18. {
  19. if (CardEffectCommons.IsOwnerTurn(card))
  20. {
  21. if (card.Owner.SecurityCards.Count <= 3)
  22. {
  23. return true;
  24. }
  25. }
  26. }
  27. return false;
  28. }
  29. bool PermanentCondition(Permanent permanent)
  30. {
  31. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  32. {
  33. return true;
  34. }
  35. return false;
  36. }
  37. cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
  38. permanentCondition: PermanentCondition,
  39. changeValue: 1000,
  40. isInheritedEffect: false,
  41. card: card,
  42. condition: Condition,
  43. effectName: () => "Your Digimon gain DP +1000"));
  44. }
  45. if (timing == EffectTiming.OnDestroyedAnyone)
  46. {
  47. ActivateClass activateClass = new ActivateClass();
  48. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  49. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  50. cardEffects.Add(activateClass);
  51. string EffectDiscription()
  52. {
  53. return "[Your Turn] When an opponent's Digimon is deleted by dropping to 0 DP, you may suspend this Tamer to gain 1 memory.";
  54. }
  55. bool PermanentCondition(Permanent permanent)
  56. {
  57. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  58. }
  59. bool CanUseCondition(Hashtable hashtable)
  60. {
  61. if (CardEffectCommons.IsExistOnBattleArea(card))
  62. {
  63. if (CardEffectCommons.IsOwnerTurn(card))
  64. {
  65. if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
  66. {
  67. if (CardEffectCommons.IsDPZeroDelete(hashtable))
  68. {
  69. return true;
  70. }
  71. }
  72. }
  73. }
  74. return false;
  75. }
  76. bool CanActivateCondition(Hashtable hashtable)
  77. {
  78. if (CardEffectCommons.IsExistOnBattleArea(card))
  79. {
  80. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  81. {
  82. return true;
  83. }
  84. }
  85. return false;
  86. }
  87. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  88. {
  89. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
  90. new List<Permanent>() { card.PermanentOfThisCard() },
  91. CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  92. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  93. }
  94. }
  95. if (timing == EffectTiming.SecuritySkill)
  96. {
  97. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  98. }
  99. return cardEffects;
  100. }
  101. }