Publimon_LM_007.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.LM
  4. {
  5. public class Publimon_LM_007 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region End Of Attack
  11. if(timing == EffectTiming.OnEndAttack)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Place top card of this Digimon to security", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[End of Attack] Place this Digimon on top of your security stack.";
  20. }
  21. bool CanUseCondition(Hashtable hashtable)
  22. {
  23. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  24. }
  25. bool CanActivateCondition(Hashtable hashtable)
  26. {
  27. if (CardEffectCommons.IsExistOnBattleArea(card))
  28. {
  29. if (card.Owner.CanAddSecurity(activateClass))
  30. {
  31. return true;
  32. }
  33. }
  34. return false;
  35. }
  36. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  37. {
  38. if (CardEffectCommons.IsExistOnBattleArea(card))
  39. {
  40. yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(card.PermanentOfThisCard(), CardEffectCommons.CardEffectHashtable(activateClass), toTop: true).PutSecurity());
  41. }
  42. }
  43. }
  44. #endregion
  45. //Security Effect
  46. if (timing == EffectTiming.SecuritySkill)
  47. {
  48. cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card));
  49. }
  50. return cardEffects;
  51. }
  52. }
  53. }