Training.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System;
  5. public class TrainingClass
  6. {
  7. public TrainingClass(ICardEffect activateClass)
  8. {
  9. _activateClass = activateClass;
  10. }
  11. ICardEffect _activateClass = null;
  12. public IEnumerator Training()
  13. {
  14. if (_activateClass == null) yield break;
  15. if (_activateClass.EffectSourceCard == null) yield break;
  16. CardSource card = _activateClass.EffectSourceCard;
  17. Permanent thisPermanent = card.PermanentOfThisCard();
  18. if (thisPermanent.IsSuspended || !thisPermanent.CanSuspend) yield break;
  19. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
  20. new List<Permanent>() { thisPermanent },
  21. CardEffectCommons.CardEffectHashtable(_activateClass)).Tap());
  22. yield return ContinuousController.instance.StartCoroutine(thisPermanent.AddDigivolutionCardsBottom(
  23. new List<CardSource> { card.Owner.LibraryCards[0] }, _activateClass, isFacedown: true));
  24. }
  25. }