BT1_027.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace DCGO.CardEffects.BT1
  5. {
  6. public class BT1_027 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.OnDeclaration)
  12. {
  13. cardEffects.Add(CardEffectFactory.LinkEffect(card, 1, 2000));
  14. }
  15. if(timing == EffectTiming.WhenLinked)
  16. {
  17. ActivateClass activateClass = new ActivateClass();
  18. activateClass.SetUpICardEffect("Testing When Linked", CanUseCondition, card);
  19. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  20. activateClass.SetIsLinkedEffect(true);
  21. cardEffects.Add(activateClass);
  22. string EffectDiscription()
  23. {
  24. return "[When linked] Testing Log";
  25. }
  26. bool CanUseCondition(Hashtable hashtable)
  27. {
  28. return CardEffectCommons.CanTriggerWhenLinked(hashtable, null, card);
  29. }
  30. bool CanActivateCondition(Hashtable hashtable)
  31. {
  32. return isExistOnField(card);
  33. }
  34. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  35. {
  36. UnityEngine.Debug.Log("CARD SUCCESSFULLY LINKED");
  37. yield return null;
  38. }
  39. }
  40. if(timing == EffectTiming.None)
  41. {
  42. bool CanUseCondition()
  43. {
  44. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  45. }
  46. cardEffects.Add(CardEffectFactory.BlockerStaticEffect(permanentCondition: null, isInheritedEffect: true, card: card, condition: CanUseCondition));
  47. }
  48. if (timing == EffectTiming.None)
  49. {
  50. bool Condition()
  51. {
  52. if (CardEffectCommons.IsExistOnBattleArea(card))
  53. {
  54. return true;
  55. }
  56. return false;
  57. }
  58. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(
  59. changeValue: 1,
  60. isInheritedEffect: true,
  61. card: card,
  62. condition: Condition));
  63. }
  64. return cardEffects;
  65. }
  66. }
  67. }