BT14_001.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT14
  4. {
  5. public class BT14_001 : 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.OnLoseSecurity)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  15. activateClass.SetIsInheritedEffect(true);
  16. activateClass.SetHashString("Draw1_BT14_001");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[Your Turn][Once Per Turn] When a card is removed from your opponent's security stack, <Draw 1>.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. if (CardEffectCommons.IsExistOnBattleArea(card))
  25. {
  26. if (CardEffectCommons.IsOwnerTurn(card))
  27. {
  28. if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => player == card.Owner.Enemy))
  29. {
  30. return true;
  31. }
  32. }
  33. }
  34. return false;
  35. }
  36. bool CanActivateCondition(Hashtable hashtable)
  37. {
  38. if (CardEffectCommons.IsExistOnBattleArea(card))
  39. {
  40. return true;
  41. }
  42. return false;
  43. }
  44. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  45. {
  46. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  47. }
  48. }
  49. return cardEffects;
  50. }
  51. }
  52. }