EX1_031.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX1
  4. {
  5. public class EX1_031 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[When Digivolving] Trigger <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
  19. }
  20. bool CanUseCondition(Hashtable hashtable)
  21. {
  22. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  23. }
  24. bool CanActivateCondition(Hashtable hashtable)
  25. {
  26. if (CardEffectCommons.IsExistOnBattleArea(card))
  27. {
  28. if (card.Owner.LibraryCards.Count >= 1)
  29. {
  30. if (card.Owner.CanAddSecurity(activateClass))
  31. {
  32. return true;
  33. }
  34. }
  35. }
  36. return false;
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  39. {
  40. yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
  41. }
  42. }
  43. if (timing == EffectTiming.None)
  44. {
  45. bool CardCondition(CardSource cardSource)
  46. {
  47. return cardSource.Owner == card.Owner;
  48. }
  49. bool Condition()
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. if (CardEffectCommons.IsOpponentTurn(card))
  54. {
  55. if (card.PermanentOfThisCard().IsSuspended)
  56. {
  57. return true;
  58. }
  59. }
  60. }
  61. return false;
  62. }
  63. cardEffects.Add(CardEffectFactory.ChangeSecurityDigimonCardDPStaticEffect(
  64. cardCondition: CardCondition,
  65. changeValue: 5000,
  66. isInheritedEffect: false,
  67. card: card,
  68. condition: Condition,
  69. effectName: "Your Security Digimon gains DP +5000"));
  70. }
  71. return cardEffects;
  72. }
  73. }
  74. }