CardEffectCommons.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. using UnityEngine;
  6. using UnityEditor;
  7. public partial class CardEffectCommons
  8. {
  9. #region Play cards as new permanents
  10. public static IEnumerator PlayPermanentCards(List<CardSource> cardSources, ICardEffect activateClass, bool payCost, bool isTapped, SelectCardEffect.Root root, bool activateETB, bool isBreedingArea = false)
  11. {
  12. if (cardSources == null) yield break;
  13. cardSources = cardSources
  14. .Filter(cardSource => cardSource != null)
  15. .Filter(cardSource => CanPlayAsNewPermanent(
  16. cardSource: cardSource,
  17. payCost: payCost,
  18. cardEffect: activateClass,
  19. isBreedingArea: isBreedingArea));
  20. if (cardSources.Count == 0) yield break;
  21. PlayCardClass playCardClass = new PlayCardClass(
  22. cardSources: cardSources,
  23. hashtable: CardEffectHashtable(activateClass),
  24. payCost: payCost,
  25. targetPermanent: null,
  26. isTapped: isTapped,
  27. root: root,
  28. activateETB: activateETB);
  29. if (isBreedingArea)
  30. {
  31. playCardClass.SetIsBreedingArea();
  32. }
  33. yield return ContinuousController.instance.StartCoroutine(playCardClass.PlayCard());
  34. }
  35. #endregion
  36. #region Play option cards
  37. public static IEnumerator PlayOptionCards(List<CardSource> cardSources, ICardEffect activateClass, bool payCost, SelectCardEffect.Root root,
  38. bool setAddSecurityEndOption = false)
  39. {
  40. if (cardSources == null) yield break;
  41. cardSources = cardSources
  42. .Filter(cardSource => cardSource != null)
  43. .Filter(cardSource => !cardSource.CanNotPlayThisOption);
  44. if (cardSources.Count == 0) yield break;
  45. PlayCardClass playCard = new PlayCardClass(
  46. cardSources: cardSources,
  47. hashtable: CardEffectHashtable(activateClass),
  48. payCost: payCost,
  49. targetPermanent: null,
  50. isTapped: false,
  51. root: root,
  52. activateETB: true);
  53. if (activateClass != null)
  54. {
  55. playCard.SetShowEffect();
  56. }
  57. if (setAddSecurityEndOption)
  58. {
  59. playCard.SetAddSecurityEndOption();
  60. }
  61. yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
  62. }
  63. #endregion
  64. #region Play Delay Option cards as new permanents
  65. public static IEnumerator PlaceDelayOptionCards(CardSource card, ICardEffect cardEffect, SelectCardEffect.Root root = SelectCardEffect.Root.Execution)
  66. {
  67. if (CanPlayAsNewPermanent(cardSource: card, payCost: false, cardEffect: cardEffect, isPlayOption: true))
  68. {
  69. PlayPermanentClass playPermanent = new PlayPermanentClass(
  70. cardSources: new List<CardSource>() { card },
  71. hashtable: CardEffectHashtable(cardEffect),
  72. targetPermanent: null,
  73. isTapped: false,
  74. root: root,
  75. ActivateETB: true);
  76. playPermanent.SetISPlayOption();
  77. yield return ContinuousController.instance.StartCoroutine(playPermanent.PlayPermanent());
  78. if (IsExistOnBattleArea(card))
  79. {
  80. card.PermanentOfThisCard().IsPlayedOptionPermanent = true;
  81. }
  82. }
  83. }
  84. #endregion
  85. #region Play 1 Token
  86. public static IEnumerator PlayToken(CEntity_Base tokenData, ICardEffect activateClass, bool isOwnerPermanent, bool isTapped)
  87. {
  88. if (activateClass == null) yield break;
  89. if (activateClass.EffectSourceCard == null) yield break;
  90. if (tokenData == null) yield break;
  91. CardSource card = activateClass.EffectSourceCard;
  92. Player player = isOwnerPermanent ? card.Owner : card.Owner.Enemy;
  93. if (card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame() && frame.IsBattleAreaFrame()) >= 1)
  94. {
  95. CardSource tokenCard = CardObjectController.CreateCardSource(
  96. player.PlayerID,
  97. tokenData,
  98. true);
  99. if (CanPlayAsNewPermanent(cardSource: tokenCard, payCost: false, cardEffect: activateClass))
  100. {
  101. yield return ContinuousController.instance.StartCoroutine(new PlayCardClass(
  102. cardSources: new List<CardSource>() { tokenCard },
  103. hashtable: CardEffectHashtable(activateClass),
  104. payCost: false,
  105. targetPermanent: null,
  106. isTapped: isTapped,
  107. root: SelectCardEffect.Root.None,
  108. activateETB: true).PlayCard());
  109. }
  110. }
  111. }
  112. #endregion
  113. #region Play 1 [Diaboromon] Token
  114. public static IEnumerator PlayDiaboromonToken(ICardEffect activateClass)
  115. {
  116. yield return ContinuousController.instance.StartCoroutine(PlayToken(
  117. tokenData: ContinuousController.instance.DiaboromonToken,
  118. activateClass: activateClass,
  119. isOwnerPermanent: true,
  120. isTapped: false
  121. ));
  122. }
  123. #endregion
  124. #region Play 1 [Amon of Crimson Flame] Token
  125. public static IEnumerator PlayAmonToken(ICardEffect activateClass)
  126. {
  127. yield return ContinuousController.instance.StartCoroutine(PlayToken(
  128. tokenData: ContinuousController.instance.AmonToken,
  129. activateClass: activateClass,
  130. isOwnerPermanent: true,
  131. isTapped: false
  132. ));
  133. }
  134. #endregion
  135. #region Play 1 [Umon of Blue Thunder] Token
  136. public static IEnumerator PlayUmonToken(ICardEffect activateClass)
  137. {
  138. yield return ContinuousController.instance.StartCoroutine(PlayToken(
  139. tokenData: ContinuousController.instance.UmonToken,
  140. activateClass: activateClass,
  141. isOwnerPermanent: true,
  142. isTapped: false
  143. ));
  144. }
  145. #endregion
  146. #region Play 1 [Fujitsumon] Token
  147. public static IEnumerator PlayFujitsumonToken(ICardEffect activateClass, bool isOwnerPermanent)
  148. {
  149. yield return ContinuousController.instance.StartCoroutine(PlayToken(
  150. tokenData: ContinuousController.instance.FujitsumonToken,
  151. activateClass: activateClass,
  152. isOwnerPermanent: isOwnerPermanent,
  153. isTapped: true
  154. ));
  155. }
  156. #endregion
  157. #region Security effect of "add this card to hand"
  158. public static IEnumerator AddThisCardToHand(CardSource card1, ICardEffect activateClass)
  159. {
  160. yield return new WaitForSeconds(0.5f);
  161. yield return ContinuousController.instance.StartCoroutine(card1.Owner.brainStormObject.CloseBrainstrorm(card1));
  162. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { card1 }, false, activateClass));
  163. }
  164. #endregion
  165. #region Delete target permanents, and the effect determines whether the permanent has been deleted or not
  166. public static IEnumerator DeletePeremanentAndProcessAccordingToResult(List<Permanent> targetPermanents, ICardEffect activateClass, Func<List<Permanent>, IEnumerator> successProcess, Func<IEnumerator> failureProcess)
  167. {
  168. DestroyPermanentsClass destroyPermanentsClass = new DestroyPermanentsClass(targetPermanents, CardEffectHashtable(activateClass));
  169. yield return ContinuousController.instance.StartCoroutine(destroyPermanentsClass.Destroy());
  170. if (targetPermanents.Some((permanent) => destroyPermanentsClass.IsDestroyed(permanent)))
  171. {
  172. if (successProcess != null)
  173. {
  174. yield return ContinuousController.instance.StartCoroutine(successProcess(destroyPermanentsClass.DestroyedPermanents));
  175. }
  176. }
  177. else
  178. {
  179. if (failureProcess != null)
  180. {
  181. yield return ContinuousController.instance.StartCoroutine(failureProcess());
  182. }
  183. }
  184. }
  185. #endregion
  186. #region Bounce target 1 permanent, and the effect determines whether the permanent has been bounced or not
  187. public static IEnumerator BouncePeremanentAndProcessAccordingToResult(List<Permanent> targetPermanents, ICardEffect activateClass, IEnumerator successProcess, IEnumerator failureProcess)
  188. {
  189. HandBounceClaass bouncePermanentClass = new HandBounceClaass(targetPermanents, CardEffectHashtable(activateClass));
  190. yield return ContinuousController.instance.StartCoroutine(bouncePermanentClass.Bounce());
  191. if (targetPermanents.Some((permanent) => bouncePermanentClass.IsBounced(permanent)))
  192. {
  193. if (successProcess != null)
  194. {
  195. yield return ContinuousController.instance.StartCoroutine(successProcess);
  196. }
  197. }
  198. else
  199. {
  200. if (failureProcess != null)
  201. {
  202. yield return ContinuousController.instance.StartCoroutine(failureProcess);
  203. }
  204. }
  205. }
  206. #endregion
  207. #region Deck Bounce target 1 permanent, and the effect determines whether the permanent has been bounced or not
  208. public static IEnumerator DeckBouncePeremanentAndProcessAccordingToResult(List<Permanent> targetPermanents, ICardEffect activateClass, IEnumerator successProcess, IEnumerator failureProcess)
  209. {
  210. DeckBottomBounceClass deckBounceClass = new DeckBottomBounceClass(targetPermanents, CardEffectHashtable(activateClass));
  211. yield return ContinuousController.instance.StartCoroutine(deckBounceClass.DeckBounce());
  212. if (targetPermanents.Some((permanent) => deckBounceClass.IsDeckBounced(permanent)))
  213. {
  214. if (successProcess != null)
  215. {
  216. yield return ContinuousController.instance.StartCoroutine(successProcess);
  217. }
  218. }
  219. else
  220. {
  221. if (failureProcess != null)
  222. {
  223. yield return ContinuousController.instance.StartCoroutine(failureProcess);
  224. }
  225. }
  226. }
  227. #endregion
  228. #region Trash digivolution cards from top or bottom
  229. public static IEnumerator TrashDigivolutionCardsFromTopOrBottom(Permanent targetPermanent, int trashCount, bool isFromTop, ICardEffect activateClass)
  230. {
  231. if (activateClass == null) yield break;
  232. if (targetPermanent == null) yield break;
  233. if (targetPermanent.TopCard == null) yield break;
  234. if (targetPermanent.DigivolutionCards.Count((cardSource) => !cardSource.CanNotTrashFromDigivolutionCards(activateClass)) == 0) yield break;
  235. if (targetPermanent.TopCard.CanNotBeAffected(activateClass)) yield break;
  236. if (trashCount <= 0) yield break;
  237. List<CardSource> trashTargetCards = new List<CardSource>();
  238. for (int i = 0; i < trashCount; i++)
  239. {
  240. if (targetPermanent.DigivolutionCards.Count >= i + 1)
  241. {
  242. int index = isFromTop ? i : targetPermanent.DigivolutionCards.Count - 1 - i;
  243. CardSource trashTargetCard = targetPermanent.DigivolutionCards[index];
  244. trashTargetCards.Add(trashTargetCard);
  245. }
  246. }
  247. yield return ContinuousController.instance.StartCoroutine(new ITrashDigivolutionCards(targetPermanent, trashTargetCards, activateClass).TrashDigivolutionCards());
  248. }
  249. #endregion
  250. #region this Option card's Main effect
  251. public static ActivateClass OptionMainEffect(CardSource card) => card.EffectList(EffectTiming.OptionSkill).Find(cardEffect => cardEffect != null && cardEffect is ActivateClass && cardEffect.EffectDiscription.Contains("[Main]")) as ActivateClass;
  252. #endregion
  253. #region this Option card's Security effect
  254. public static ActivateClass OptionSecurityEffect(CardSource card) => card.EffectList(EffectTiming.SecuritySkill).Find(cardEffect => cardEffect != null && cardEffect is ActivateClass && cardEffect.EffectDiscription.Contains("[Security]")) as ActivateClass;
  255. #endregion
  256. #region Add Option's Security effect that "Activate this card's Main effect" to cardEffects
  257. public static void AddActivateMainOptionSecurityEffect(CardSource card, ref List<ICardEffect> cardEffects, string effectName, string effectDiscription = "", Func<ICardEffect, IEnumerator> afterMainEffect = null)
  258. {
  259. if (OptionMainEffect(card) == null) return;
  260. cardEffects.Add(CardEffectFactory.ActivateMainOptionSecurityEffect(card, effectName, effectDiscription, afterMainEffect));
  261. }
  262. #endregion
  263. #region Target permanent Digivolves into Digimon card from hand or trash
  264. public static IEnumerator DigivolveIntoHandOrTrashCard(
  265. Permanent targetPermanent,
  266. Func<CardSource, bool> cardCondition,
  267. bool payCost,
  268. (int reduceCost, Func<CardSource, bool> reduceCostCardCondition)? reduceCostTuple,
  269. (int fixedCost, Func<CardSource, bool> fixedCostCardCondition)? fixedCostTuple,
  270. int ignoreDigivolutionRequirementFixedCost,
  271. bool isHand,
  272. ICardEffect activateClass,
  273. IEnumerator successProcess,
  274. bool ignoreLevel = false)
  275. {
  276. if (targetPermanent == null) yield break;
  277. if (targetPermanent.TopCard == null) yield break;
  278. if (activateClass == null) yield break;
  279. if (activateClass.EffectSourceCard == null) yield break;
  280. Player owner = targetPermanent.TopCard.Owner;
  281. SelectCardEffect.Root root = isHand ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
  282. bool ignoreDigivolutionRequirement = ignoreDigivolutionRequirementFixedCost >= 0;
  283. int fixedCost = -1;
  284. if (fixedCostTuple != null)
  285. {
  286. fixedCost = fixedCostTuple.Value.fixedCost;
  287. }
  288. if (ignoreDigivolutionRequirement)
  289. {
  290. fixedCost = ignoreDigivolutionRequirementFixedCost;
  291. }
  292. bool CanSelectCardCondition(CardSource cardSource)
  293. {
  294. if (cardSource.IsDigimon)
  295. {
  296. if (cardCondition == null || cardCondition(cardSource))
  297. {
  298. if (!cardSource.CanNotEvolve(targetPermanent))
  299. {
  300. if (ignoreLevel
  301. || cardSource.CanPlayCardTargetFrame(
  302. frame: targetPermanent.PermanentFrame,
  303. PayCost: payCost,
  304. cardEffect: activateClass,
  305. root: root,
  306. fixedCost: fixedCost))
  307. {
  308. return true;
  309. }
  310. }
  311. }
  312. }
  313. return false;
  314. }
  315. #region reduce cost
  316. Func<EffectTiming, ICardEffect> getChangeCostEffect = null;
  317. if (reduceCostTuple != null)
  318. {
  319. bool PermanentCondition(Permanent permanent)
  320. {
  321. return permanent == targetPermanent;
  322. }
  323. bool CardCondition(CardSource cardSource)
  324. {
  325. if (cardSource != null)
  326. {
  327. if (cardSource.Owner == owner)
  328. {
  329. if (reduceCostTuple.Value.reduceCostCardCondition == null || reduceCostTuple.Value.reduceCostCardCondition(cardSource))
  330. {
  331. return true;
  332. }
  333. }
  334. }
  335. return false;
  336. }
  337. getChangeCostEffect = ChangeDigivolutionCostPlayerEffect(
  338. permanentCondition: PermanentCondition,
  339. cardCondition: CardCondition,
  340. rootCondition: null,
  341. changeValue: -reduceCostTuple.Value.reduceCost,
  342. activateClass: activateClass,
  343. setFixedCost: false);
  344. if (getChangeCostEffect != null)
  345. {
  346. AddEffectToPlayer(
  347. effectDuration: EffectDuration.UntilCalculateFixedCost,
  348. card: targetPermanent.TopCard,
  349. cardEffect: null,
  350. timing: EffectTiming.None,
  351. getCardEffect: getChangeCostEffect);
  352. }
  353. }
  354. #endregion
  355. #region set fixed cost
  356. Func<EffectTiming, ICardEffect> getFixedCostEffect = null;
  357. if (fixedCostTuple != null)
  358. {
  359. bool PermanentCondition(Permanent permanent)
  360. {
  361. return permanent == targetPermanent;
  362. }
  363. bool CardCondition(CardSource cardSource)
  364. {
  365. if (cardSource != null)
  366. {
  367. if (cardSource.Owner == owner)
  368. {
  369. if (fixedCostTuple.Value.fixedCostCardCondition == null || fixedCostTuple.Value.fixedCostCardCondition(cardSource))
  370. {
  371. return true;
  372. }
  373. }
  374. }
  375. return false;
  376. }
  377. getFixedCostEffect = ChangeDigivolutionCostPlayerEffect(
  378. permanentCondition: PermanentCondition,
  379. cardCondition: CardCondition,
  380. rootCondition: null,
  381. changeValue: fixedCost,
  382. activateClass: activateClass,
  383. setFixedCost: true);
  384. if (getChangeCostEffect != null)
  385. {
  386. AddEffectToPlayer(
  387. effectDuration: EffectDuration.UntilCalculateFixedCost,
  388. card: targetPermanent.TopCard,
  389. cardEffect: null,
  390. timing: EffectTiming.None,
  391. getCardEffect: getFixedCostEffect);
  392. }
  393. }
  394. #endregion
  395. #region ignore digivolution requirement
  396. Func<EffectTiming, ICardEffect> getIgnoreDigivolutionRequirementEffect = null;
  397. if (ignoreDigivolutionRequirement)
  398. {
  399. bool PermanentCondition(Permanent permanent)
  400. {
  401. return permanent == targetPermanent;
  402. }
  403. bool CardCondition(CardSource cardSource)
  404. {
  405. if (cardSource == null)
  406. {
  407. return false;
  408. }
  409. if (cardSource.Owner != owner)
  410. {
  411. return false;
  412. }
  413. if (cardCondition == null || cardCondition(cardSource))
  414. {
  415. return true;
  416. }
  417. return false;
  418. }
  419. getIgnoreDigivolutionRequirementEffect = GainIgnoreDigivolutionRequirementPlayerEffect(
  420. permanentCondition: PermanentCondition,
  421. cardCondition: CardCondition,
  422. ignoreDigivolutionRequirement: ignoreDigivolutionRequirement,
  423. digivolutionCost: fixedCost,
  424. activateClass: activateClass);
  425. if (getIgnoreDigivolutionRequirementEffect != null)
  426. {
  427. AddEffectToPlayer(
  428. effectDuration: EffectDuration.UntilCalculateFixedCost,
  429. card: targetPermanent.TopCard,
  430. cardEffect: null,
  431. timing: EffectTiming.None,
  432. getCardEffect: getIgnoreDigivolutionRequirementEffect);
  433. }
  434. }
  435. #endregion
  436. List<CardSource> selectedCards = new List<CardSource>();
  437. IEnumerator SelectCardCoroutine(CardSource cardSource)
  438. {
  439. selectedCards.Add(cardSource);
  440. yield return null;
  441. }
  442. if (isHand)
  443. {
  444. if (owner.HandCards.Count(CanSelectCardCondition) >= 1)
  445. {
  446. int maxCount = 1;
  447. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  448. selectHandEffect.SetUp(
  449. selectPlayer: owner,
  450. canTargetCondition: CanSelectCardCondition,
  451. canTargetCondition_ByPreSelecetedList: null,
  452. canEndSelectCondition: null,
  453. maxCount: maxCount,
  454. canNoSelect: true,
  455. canEndNotMax: false,
  456. isShowOpponent: true,
  457. selectCardCoroutine: SelectCardCoroutine,
  458. afterSelectCardCoroutine: null,
  459. mode: SelectHandEffect.Mode.Custom,
  460. cardEffect: activateClass);
  461. selectHandEffect.SetUpCustomMessage("Select 1 card to digivolve.", "The opponent is selecting 1 card to digivolve.");
  462. selectHandEffect.SetUpCustomMessage_ShowCard("Selected Card");
  463. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  464. }
  465. }
  466. else
  467. {
  468. if (HasMatchConditionOwnersCardInTrash(targetPermanent.TopCard, CanSelectCardCondition))
  469. {
  470. int maxCount = 1;
  471. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  472. selectCardEffect.SetUp(
  473. canTargetCondition: CanSelectCardCondition,
  474. canTargetCondition_ByPreSelecetedList: null,
  475. canEndSelectCondition: null,
  476. canNoSelect: () => true,
  477. selectCardCoroutine: SelectCardCoroutine,
  478. afterSelectCardCoroutine: null,
  479. message: "Select 1 card to digivolve.",
  480. maxCount: maxCount,
  481. canEndNotMax: false,
  482. isShowOpponent: true,
  483. mode: SelectCardEffect.Mode.Custom,
  484. root: SelectCardEffect.Root.Trash,
  485. customRootCardList: null,
  486. canLookReverseCard: true,
  487. selectPlayer: owner,
  488. cardEffect: activateClass);
  489. selectCardEffect.SetUpCustomMessage("Select 1 card to digivolve.", "The opponent is selecting 1 card to digivolve.");
  490. selectCardEffect.SetUpCustomMessage_ShowCard("Selected Card");
  491. yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
  492. }
  493. }
  494. PlayCardClass playCardClass = new PlayCardClass(
  495. cardSources: selectedCards,
  496. hashtable: CardEffectHashtable(activateClass),
  497. payCost: payCost,
  498. targetPermanent: targetPermanent,
  499. isTapped: false,
  500. root: root,
  501. activateETB: true);
  502. if (ignoreLevel) playCardClass.SetIgnoreLevel();
  503. if (!ignoreDigivolutionRequirement && fixedCost >= 0) playCardClass.SetFixedCost(fixedCost);
  504. yield return ContinuousController.instance.StartCoroutine(playCardClass.PlayCard());
  505. #region release effect
  506. if (getChangeCostEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getChangeCostEffect);
  507. #endregion
  508. #region release effect
  509. if (getFixedCostEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getFixedCostEffect);
  510. #endregion
  511. #region release effect
  512. if (getIgnoreDigivolutionRequirementEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getIgnoreDigivolutionRequirementEffect);
  513. #endregion
  514. if (selectedCards.Count >= 1)
  515. {
  516. if (IsDigivolvedByTheEffect(targetPermanent, selectedCards[0], activateClass))
  517. {
  518. if (successProcess != null)
  519. {
  520. yield return ContinuousController.instance.StartCoroutine(successProcess);
  521. }
  522. }
  523. }
  524. }
  525. #endregion
  526. #region Get the effect given by EffectTiming
  527. public static Func<EffectTiming, ICardEffect> GetCardEffectByEffectTiming(EffectTiming timing, ICardEffect cardEffect) => (_timing) => _timing == timing ? cardEffect : null;
  528. #endregion
  529. }