ST3_01.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class ST3_01 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OnDestroyedAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("DP +1000", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  18. activateClass.SetIsInheritedEffect(true);
  19. activateClass.SetHashString("DP+1000_ST3_01");
  20. cardEffects.Add(activateClass);
  21. string EffectDiscription()
  22. {
  23. return "[Your Turn][Once Per Turn] When an opponent's Digimon is deleted by dropping to 0 DP, this Digimon gets +1000 DP for the turn.";
  24. }
  25. bool PermanentCondition(Permanent permanent)
  26. {
  27. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  28. }
  29. bool CanUseCondition(Hashtable hashtable)
  30. {
  31. if (CardEffectCommons.IsExistOnBattleArea(card))
  32. {
  33. if (CardEffectCommons.IsOwnerTurn(card))
  34. {
  35. if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
  36. {
  37. if (CardEffectCommons.IsDPZeroDelete(hashtable))
  38. {
  39. return true;
  40. }
  41. }
  42. }
  43. }
  44. return false;
  45. }
  46. bool CanActivateCondition(Hashtable hashtable)
  47. {
  48. if (CardEffectCommons.IsExistOnBattleArea(card))
  49. {
  50. return true;
  51. }
  52. return false;
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  57. targetPermanent: card.PermanentOfThisCard(),
  58. changeValue: 1000,
  59. effectDuration: EffectDuration.UntilEachTurnEnd,
  60. activateClass: activateClass));
  61. }
  62. }
  63. return cardEffects;
  64. }
  65. }