BT5_024.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 BT5_024 : 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.OnEnterFieldAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect($"Memory +1", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[When Digivolving] If this Digimon has [Gabumon] in its digivolution cards, gain 1 memory.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  26. }
  27. bool CanActivateCondition(Hashtable hashtable)
  28. {
  29. if (CardEffectCommons.IsExistOnBattleArea(card))
  30. {
  31. if (card.Owner.CanAddMemory(activateClass))
  32. {
  33. if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Gabumon")) >= 1)
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  42. {
  43. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  44. }
  45. }
  46. if (timing == EffectTiming.None)
  47. {
  48. bool Condition()
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Omnimon") || card.PermanentOfThisCard().TopCard.HasGarurumonName)
  53. {
  54. return true;
  55. }
  56. }
  57. return false;
  58. }
  59. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  60. }
  61. return cardEffects;
  62. }
  63. }