BT19_006.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT19
  4. {
  5. public class BT19_006 : 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.OnDestroyedAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Return 1 level 3 purple Digimon card from your trash", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. activateClass.SetIsInheritedEffect(true);
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[On Deletion] If deleted other than by battle, return 1 level 3 purple Digimon card from your trash to the hand.";
  20. }
  21. bool PurpleLevelThree(CardSource source)
  22. {
  23. return source.HasCardColor(CardColor.Purple) &&
  24. source.IsLevel3;
  25. }
  26. bool CanUseCondition(Hashtable hashtable)
  27. {
  28. if (CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass))
  29. return !CardEffectCommons.IsByBattle(hashtable);
  30. return false;
  31. }
  32. bool CanActivateCondition(Hashtable hashtable)
  33. {
  34. if (CardEffectCommons.CanActivateOnDeletion(card, activateClass))
  35. return CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, PurpleLevelThree);
  36. return false;
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable hashtable)
  39. {
  40. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  41. selectCardEffect.SetUp(
  42. canTargetCondition: PurpleLevelThree,
  43. canTargetCondition_ByPreSelecetedList: null,
  44. canEndSelectCondition: null,
  45. canNoSelect: () => false,
  46. selectCardCoroutine: null,
  47. afterSelectCardCoroutine: null,
  48. message: "Select 1 purple level 3 digimon card to return to hand.",
  49. maxCount: 1,
  50. canEndNotMax: false,
  51. isShowOpponent: true,
  52. mode: SelectCardEffect.Mode.AddHand,
  53. root: SelectCardEffect.Root.Trash,
  54. customRootCardList: null,
  55. canLookReverseCard: true,
  56. selectPlayer: card.Owner,
  57. cardEffect: activateClass);
  58. selectCardEffect.SetUpCustomMessage("Select 1 purple level 3 digimon card to return to hand.", "The opponent is select 1 purple level 3 digimon card to return to hand.");
  59. yield return StartCoroutine(selectCardEffect.Activate());
  60. }
  61. }
  62. return cardEffects;
  63. }
  64. }
  65. }