WhenUseDigiBurst.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. using UnityEngine;
  6. public partial class CardEffectCommons
  7. {
  8. #region Can trigger "When permanent uses Digi-Burst" effects
  9. public static bool CanTriggerWhenUseDigiBurst(Hashtable hashtable, Func<Permanent, bool> permanentCondition, Func<ICardEffect, bool> cardEffectCondition)
  10. {
  11. Permanent permanent = GetPermanentFromHashtable(hashtable);
  12. if (permanent != null)
  13. {
  14. if (permanent.TopCard != null)
  15. {
  16. if (permanentCondition == null || permanentCondition(permanent))
  17. {
  18. ICardEffect CardEffect = GetCardEffectFromHashtable(hashtable);
  19. if (CardEffect != null)
  20. {
  21. if (cardEffectCondition == null || cardEffectCondition(CardEffect))
  22. {
  23. return true;
  24. }
  25. }
  26. }
  27. }
  28. }
  29. return false;
  30. }
  31. #endregion
  32. }