CardEffectCommons.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  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 Play 1 [Gyuukimon] Token
  158. public static IEnumerator PlayGyuukimonToken(ICardEffect activateClass)
  159. {
  160. yield return ContinuousController.instance.StartCoroutine(PlayToken(
  161. tokenData: ContinuousController.instance.GyuukimonToken,
  162. activateClass: activateClass,
  163. isOwnerPermanent: true,
  164. isTapped: false
  165. ));
  166. }
  167. #endregion
  168. #region Security effect of "add this card to hand"
  169. public static IEnumerator AddThisCardToHand(CardSource card1, ICardEffect activateClass)
  170. {
  171. yield return new WaitForSeconds(0.5f);
  172. yield return ContinuousController.instance.StartCoroutine(card1.Owner.brainStormObject.CloseBrainstrorm(card1));
  173. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { card1 }, false, activateClass));
  174. }
  175. #endregion
  176. #region Delete target permanents, and the effect determines whether the permanent has been deleted or not
  177. public static IEnumerator DeletePeremanentAndProcessAccordingToResult(List<Permanent> targetPermanents, ICardEffect activateClass, Func<List<Permanent>, IEnumerator> successProcess, Func<IEnumerator> failureProcess)
  178. {
  179. DestroyPermanentsClass destroyPermanentsClass = new DestroyPermanentsClass(targetPermanents, CardEffectHashtable(activateClass));
  180. yield return ContinuousController.instance.StartCoroutine(destroyPermanentsClass.Destroy());
  181. if (targetPermanents.Some((permanent) => destroyPermanentsClass.IsDestroyed(permanent)))
  182. {
  183. if (successProcess != null)
  184. {
  185. yield return ContinuousController.instance.StartCoroutine(successProcess(destroyPermanentsClass.DestroyedPermanents));
  186. }
  187. }
  188. else
  189. {
  190. if (failureProcess != null)
  191. {
  192. yield return ContinuousController.instance.StartCoroutine(failureProcess());
  193. }
  194. }
  195. }
  196. #endregion
  197. #region Bounce target 1 permanent, and the effect determines whether the permanent has been bounced or not
  198. public static IEnumerator BouncePeremanentAndProcessAccordingToResult(List<Permanent> targetPermanents, ICardEffect activateClass, IEnumerator successProcess, IEnumerator failureProcess)
  199. {
  200. HandBounceClaass bouncePermanentClass = new HandBounceClaass(targetPermanents, CardEffectHashtable(activateClass));
  201. yield return ContinuousController.instance.StartCoroutine(bouncePermanentClass.Bounce());
  202. if (targetPermanents.Some((permanent) => bouncePermanentClass.IsBounced(permanent)))
  203. {
  204. if (successProcess != null)
  205. {
  206. yield return ContinuousController.instance.StartCoroutine(successProcess);
  207. }
  208. }
  209. else
  210. {
  211. if (failureProcess != null)
  212. {
  213. yield return ContinuousController.instance.StartCoroutine(failureProcess);
  214. }
  215. }
  216. }
  217. #endregion
  218. #region Deck Bounce target 1 permanent, and the effect determines whether the permanent has been bounced or not
  219. public static IEnumerator DeckBouncePeremanentAndProcessAccordingToResult(List<Permanent> targetPermanents, ICardEffect activateClass, IEnumerator successProcess, IEnumerator failureProcess)
  220. {
  221. DeckBottomBounceClass deckBounceClass = new DeckBottomBounceClass(targetPermanents, CardEffectHashtable(activateClass));
  222. yield return ContinuousController.instance.StartCoroutine(deckBounceClass.DeckBounce());
  223. if (targetPermanents.Some((permanent) => deckBounceClass.IsDeckBounced(permanent)))
  224. {
  225. if (successProcess != null)
  226. {
  227. yield return ContinuousController.instance.StartCoroutine(successProcess);
  228. }
  229. }
  230. else
  231. {
  232. if (failureProcess != null)
  233. {
  234. yield return ContinuousController.instance.StartCoroutine(failureProcess);
  235. }
  236. }
  237. }
  238. #endregion
  239. #region Trash digivolution cards from top or bottom
  240. public static IEnumerator TrashDigivolutionCardsFromTopOrBottom(Permanent targetPermanent, int trashCount, bool isFromTop, ICardEffect activateClass)
  241. {
  242. if (activateClass == null) yield break;
  243. if (targetPermanent == null) yield break;
  244. if (targetPermanent.TopCard == null) yield break;
  245. if (targetPermanent.DigivolutionCards.Count((cardSource) => !cardSource.CanNotTrashFromDigivolutionCards(activateClass)) == 0) yield break;
  246. if (targetPermanent.TopCard.CanNotBeAffected(activateClass)) yield break;
  247. if (trashCount <= 0) yield break;
  248. List<CardSource> trashTargetCards = new List<CardSource>();
  249. for (int i = 0; i < trashCount; i++)
  250. {
  251. if (targetPermanent.DigivolutionCards.Count >= i + 1)
  252. {
  253. int index = isFromTop ? i : targetPermanent.DigivolutionCards.Count - 1 - i;
  254. CardSource trashTargetCard = targetPermanent.DigivolutionCards[index];
  255. trashTargetCards.Add(trashTargetCard);
  256. }
  257. }
  258. yield return ContinuousController.instance.StartCoroutine(new ITrashDigivolutionCards(targetPermanent, trashTargetCards, activateClass).TrashDigivolutionCards());
  259. }
  260. #endregion
  261. #region this Option card's Main effect
  262. public static ActivateClass OptionMainEffect(CardSource card) => card.EffectList(EffectTiming.OptionSkill).Find(cardEffect => cardEffect != null && cardEffect is ActivateClass && cardEffect.EffectDiscription.Contains("[Main]")) as ActivateClass;
  263. #endregion
  264. #region Add Option's Security effect that "Activate this card's Main effect" to cardEffects
  265. public static void AddActivateMainOptionSecurityEffect(CardSource card, ref List<ICardEffect> cardEffects, string effectName, string effectDiscription = "", Func<ICardEffect, IEnumerator> afterMainEffect = null)
  266. {
  267. if (OptionMainEffect(card) == null) return;
  268. cardEffects.Add(CardEffectFactory.ActivateMainOptionSecurityEffect(card, effectName, effectDiscription, afterMainEffect));
  269. }
  270. #endregion
  271. #region Target permanent Digivolves into Digimon card from hand or trash
  272. public static IEnumerator DigivolveIntoHandOrTrashCard(
  273. Permanent targetPermanent,
  274. Func<CardSource, bool> cardCondition,
  275. bool payCost,
  276. (int reduceCost, Func<CardSource, bool> reduceCostCardCondition)? reduceCostTuple,
  277. (int fixedCost, Func<CardSource, bool> fixedCostCardCondition)? fixedCostTuple,
  278. int ignoreDigivolutionRequirementFixedCost,
  279. bool isHand,
  280. ICardEffect activateClass,
  281. IEnumerator successProcess,
  282. bool ignoreLevel = false)
  283. {
  284. if (targetPermanent == null) yield break;
  285. if (targetPermanent.TopCard == null) yield break;
  286. if (activateClass == null) yield break;
  287. if (activateClass.EffectSourceCard == null) yield break;
  288. Player owner = targetPermanent.TopCard.Owner;
  289. SelectCardEffect.Root root = isHand ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
  290. bool ignoreDigivolutionRequirement = ignoreDigivolutionRequirementFixedCost >= 0;
  291. int fixedCost = -1;
  292. if (fixedCostTuple != null)
  293. {
  294. fixedCost = fixedCostTuple.Value.fixedCost;
  295. }
  296. if (ignoreDigivolutionRequirement)
  297. {
  298. fixedCost = ignoreDigivolutionRequirementFixedCost;
  299. }
  300. bool CanSelectCardCondition(CardSource cardSource)
  301. {
  302. if (cardSource.IsDigimon)
  303. {
  304. if (cardCondition == null || cardCondition(cardSource))
  305. {
  306. if (!cardSource.CanNotEvolve(targetPermanent))
  307. {
  308. if (ignoreLevel
  309. || cardSource.CanPlayCardTargetFrame(
  310. frame: targetPermanent.PermanentFrame,
  311. PayCost: payCost,
  312. cardEffect: activateClass,
  313. root: root,
  314. fixedCost: fixedCost))
  315. {
  316. return true;
  317. }
  318. }
  319. }
  320. }
  321. return false;
  322. }
  323. #region reduce cost
  324. Func<EffectTiming, ICardEffect> getChangeCostEffect = null;
  325. if (reduceCostTuple != null)
  326. {
  327. bool PermanentCondition(Permanent permanent)
  328. {
  329. return permanent == targetPermanent;
  330. }
  331. bool CardCondition(CardSource cardSource)
  332. {
  333. if (cardSource != null)
  334. {
  335. if (cardSource.Owner == owner)
  336. {
  337. if (reduceCostTuple.Value.reduceCostCardCondition == null || reduceCostTuple.Value.reduceCostCardCondition(cardSource))
  338. {
  339. return true;
  340. }
  341. }
  342. }
  343. return false;
  344. }
  345. getChangeCostEffect = ChangeDigivolutionCostPlayerEffect(
  346. permanentCondition: PermanentCondition,
  347. cardCondition: CardCondition,
  348. rootCondition: null,
  349. changeValue: -reduceCostTuple.Value.reduceCost,
  350. activateClass: activateClass,
  351. setFixedCost: false);
  352. if (getChangeCostEffect != null)
  353. {
  354. AddEffectToPlayer(
  355. effectDuration: EffectDuration.UntilCalculateFixedCost,
  356. card: targetPermanent.TopCard,
  357. cardEffect: null,
  358. timing: EffectTiming.None,
  359. getCardEffect: getChangeCostEffect);
  360. }
  361. }
  362. #endregion
  363. #region set fixed cost
  364. Func<EffectTiming, ICardEffect> getFixedCostEffect = null;
  365. if (fixedCostTuple != null)
  366. {
  367. bool PermanentCondition(Permanent permanent)
  368. {
  369. return permanent == targetPermanent;
  370. }
  371. bool CardCondition(CardSource cardSource)
  372. {
  373. if (cardSource != null)
  374. {
  375. if (cardSource.Owner == owner)
  376. {
  377. if (fixedCostTuple.Value.fixedCostCardCondition == null || fixedCostTuple.Value.fixedCostCardCondition(cardSource))
  378. {
  379. return true;
  380. }
  381. }
  382. }
  383. return false;
  384. }
  385. getFixedCostEffect = ChangeDigivolutionCostPlayerEffect(
  386. permanentCondition: PermanentCondition,
  387. cardCondition: CardCondition,
  388. rootCondition: null,
  389. changeValue: fixedCost,
  390. activateClass: activateClass,
  391. setFixedCost: true);
  392. if (getChangeCostEffect != null)
  393. {
  394. AddEffectToPlayer(
  395. effectDuration: EffectDuration.UntilCalculateFixedCost,
  396. card: targetPermanent.TopCard,
  397. cardEffect: null,
  398. timing: EffectTiming.None,
  399. getCardEffect: getFixedCostEffect);
  400. }
  401. }
  402. #endregion
  403. #region ignore digivolution requirement
  404. Func<EffectTiming, ICardEffect> getIgnoreDigivolutionRequirementEffect = null;
  405. if (ignoreDigivolutionRequirement)
  406. {
  407. bool PermanentCondition(Permanent permanent)
  408. {
  409. return permanent == targetPermanent;
  410. }
  411. bool CardCondition(CardSource cardSource)
  412. {
  413. if (cardSource == null)
  414. {
  415. return false;
  416. }
  417. if (cardSource.Owner != owner)
  418. {
  419. return false;
  420. }
  421. if (cardCondition == null || cardCondition(cardSource))
  422. {
  423. return true;
  424. }
  425. return false;
  426. }
  427. getIgnoreDigivolutionRequirementEffect = GainIgnoreDigivolutionRequirementPlayerEffect(
  428. permanentCondition: PermanentCondition,
  429. cardCondition: CardCondition,
  430. ignoreDigivolutionRequirement: ignoreDigivolutionRequirement,
  431. digivolutionCost: fixedCost,
  432. activateClass: activateClass);
  433. if (getIgnoreDigivolutionRequirementEffect != null)
  434. {
  435. AddEffectToPlayer(
  436. effectDuration: EffectDuration.UntilCalculateFixedCost,
  437. card: targetPermanent.TopCard,
  438. cardEffect: null,
  439. timing: EffectTiming.None,
  440. getCardEffect: getIgnoreDigivolutionRequirementEffect);
  441. }
  442. }
  443. #endregion
  444. List<CardSource> selectedCards = new List<CardSource>();
  445. IEnumerator SelectCardCoroutine(CardSource cardSource)
  446. {
  447. selectedCards.Add(cardSource);
  448. yield return null;
  449. }
  450. if (isHand)
  451. {
  452. if (owner.HandCards.Count(CanSelectCardCondition) >= 1)
  453. {
  454. int maxCount = 1;
  455. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  456. selectHandEffect.SetUp(
  457. selectPlayer: owner,
  458. canTargetCondition: CanSelectCardCondition,
  459. canTargetCondition_ByPreSelecetedList: null,
  460. canEndSelectCondition: null,
  461. maxCount: maxCount,
  462. canNoSelect: true,
  463. canEndNotMax: false,
  464. isShowOpponent: true,
  465. selectCardCoroutine: SelectCardCoroutine,
  466. afterSelectCardCoroutine: null,
  467. mode: SelectHandEffect.Mode.Custom,
  468. cardEffect: activateClass);
  469. selectHandEffect.SetUpCustomMessage("Select 1 card to digivolve.", "The opponent is selecting 1 card to digivolve.");
  470. selectHandEffect.SetUpCustomMessage_ShowCard("Selected Card");
  471. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  472. }
  473. }
  474. else
  475. {
  476. if (HasMatchConditionOwnersCardInTrash(targetPermanent.TopCard, CanSelectCardCondition))
  477. {
  478. int maxCount = 1;
  479. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  480. selectCardEffect.SetUp(
  481. canTargetCondition: CanSelectCardCondition,
  482. canTargetCondition_ByPreSelecetedList: null,
  483. canEndSelectCondition: null,
  484. canNoSelect: () => true,
  485. selectCardCoroutine: SelectCardCoroutine,
  486. afterSelectCardCoroutine: null,
  487. message: "Select 1 card to digivolve.",
  488. maxCount: maxCount,
  489. canEndNotMax: false,
  490. isShowOpponent: true,
  491. mode: SelectCardEffect.Mode.Custom,
  492. root: SelectCardEffect.Root.Trash,
  493. customRootCardList: null,
  494. canLookReverseCard: true,
  495. selectPlayer: owner,
  496. cardEffect: activateClass);
  497. selectCardEffect.SetUpCustomMessage("Select 1 card to digivolve.", "The opponent is selecting 1 card to digivolve.");
  498. selectCardEffect.SetUpCustomMessage_ShowCard("Selected Card");
  499. yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
  500. }
  501. }
  502. PlayCardClass playCardClass = new PlayCardClass(
  503. cardSources: selectedCards,
  504. hashtable: CardEffectHashtable(activateClass),
  505. payCost: payCost,
  506. targetPermanent: targetPermanent,
  507. isTapped: false,
  508. root: root,
  509. activateETB: true);
  510. if (ignoreLevel) playCardClass.SetIgnoreLevel();
  511. if (!ignoreDigivolutionRequirement && fixedCost >= 0) playCardClass.SetFixedCost(fixedCost);
  512. yield return ContinuousController.instance.StartCoroutine(playCardClass.PlayCard());
  513. #region release effect
  514. if (getChangeCostEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getChangeCostEffect);
  515. #endregion
  516. #region release effect
  517. if (getFixedCostEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getFixedCostEffect);
  518. #endregion
  519. #region release effect
  520. if (getIgnoreDigivolutionRequirementEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getIgnoreDigivolutionRequirementEffect);
  521. #endregion
  522. if (selectedCards.Count >= 1)
  523. {
  524. if (IsDigivolvedByTheEffect(targetPermanent, selectedCards[0], activateClass))
  525. {
  526. if (successProcess != null)
  527. {
  528. yield return ContinuousController.instance.StartCoroutine(successProcess);
  529. }
  530. }
  531. }
  532. }
  533. #endregion
  534. #region Get the effect given by EffectTiming
  535. public static Func<EffectTiming, ICardEffect> GetCardEffectByEffectTiming(EffectTiming timing, ICardEffect cardEffect) => (_timing) => _timing == timing ? cardEffect : null;
  536. #endregion
  537. }