P_191.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. using Photon.Pun;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using UnityEngine;
  7. // Apollomon
  8. namespace DCGO.CardEffects.P
  9. {
  10. public class P_191 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. #region Alternate Digivolution
  16. if (timing == EffectTiming.None)
  17. {
  18. bool PermanentCondition(Permanent targetPermanent)
  19. {
  20. return targetPermanent.TopCard.IsLevel5 &&
  21. targetPermanent.TopCard.HasLightFangOrNightClawTraits;
  22. }
  23. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
  24. }
  25. #endregion
  26. #region BlastDigivolve
  27. if (timing == EffectTiming.OnCounterTiming)
  28. {
  29. cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
  30. }
  31. #endregion
  32. #region On Play
  33. if (timing == EffectTiming.OnEnterFieldAnyone)
  34. {
  35. ActivateClass activateClass = new ActivateClass();
  36. activateClass.SetUpICardEffect($"-{DPChangeValue()}DP to 1 digimon for the turn, then delete up to 7k worth of digimon", CanUseCondition, card);
  37. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  38. cardEffects.Add(activateClass);
  39. string EffectDiscription()
  40. {
  41. return "[On Play] To 1 of your opponent’s Digimon, give -4000 DP for the turn for each of your Digimon with the [Olympos XII] trait. Then, delete up to 7000 DP total worth of their Digimon.";
  42. }
  43. bool CanUseCondition(Hashtable hashtable)
  44. {
  45. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  46. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  47. }
  48. bool CanActivateCondition(Hashtable hashtable)
  49. {
  50. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  51. }
  52. bool CanSelectPermanentCondition(Permanent permanent)
  53. {
  54. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  55. }
  56. int DPChangeValue() => card.Owner.GetBattleAreaDigimons().Filter(x => x.TopCard.EqualsTraits("Olympos XII")).Count * 4000;
  57. int DeletionMaxDP() => 7000;
  58. bool CanSelectDeletePermanentCondition(Permanent permanent)
  59. {
  60. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  61. {
  62. if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass))
  63. {
  64. return true;
  65. }
  66. }
  67. return false;
  68. }
  69. IEnumerator ActivateCoroutine(Hashtable hashtable)
  70. {
  71. if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanentCondition))
  72. {
  73. Permanent selectedPermanent = null;
  74. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  75. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  76. selectPermanentEffect.SetUp(
  77. selectPlayer: card.Owner,
  78. canTargetCondition: CanSelectPermanentCondition,
  79. canTargetCondition_ByPreSelecetedList: null,
  80. canEndSelectCondition: null,
  81. maxCount: maxCount,
  82. canNoSelect: false,
  83. canEndNotMax: false,
  84. selectPermanentCoroutine: SelectPermanentCoroutine,
  85. afterSelectPermanentCoroutine: null,
  86. mode: SelectPermanentEffect.Mode.Custom,
  87. cardEffect: activateClass);
  88. selectPermanentEffect.SetUpCustomMessage(customMessageArray: CardEffectCommons.customPermanentMessageArray_ChangeDP(changeValue: -DPChangeValue(), maxCount: maxCount));
  89. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  90. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  91. {
  92. selectedPermanent = permanent;
  93. yield return null;
  94. }
  95. if (selectedPermanent != null)
  96. {
  97. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: selectedPermanent, changeValue: -DPChangeValue(), effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  98. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectDeletePermanentCondition))
  99. {
  100. int maxCount1 = Math.Min(card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectDeletePermanentCondition),
  101. CardEffectCommons.MatchConditionPermanentCount(CanSelectDeletePermanentCondition));
  102. SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
  103. selectPermanentEffect1.SetUp(
  104. selectPlayer: card.Owner,
  105. canTargetCondition: CanSelectDeletePermanentCondition,
  106. canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
  107. canEndSelectCondition: CanEndSelectCondition,
  108. maxCount: maxCount1,
  109. canNoSelect: false,
  110. canEndNotMax: true,
  111. selectPermanentCoroutine: null,
  112. afterSelectPermanentCoroutine: null,
  113. mode: SelectPermanentEffect.Mode.Destroy,
  114. cardEffect: activateClass);
  115. selectPermanentEffect.SetUpCustomMessage("Choose digimon to delete", "Opponent is choosing digimon to delete");
  116. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  117. bool CanEndSelectCondition(List<Permanent> permanents)
  118. {
  119. if (permanents.Count <= 0)
  120. {
  121. return false;
  122. }
  123. int sumDP = 0;
  124. foreach (Permanent permanent in permanents)
  125. {
  126. sumDP += permanent.DP;
  127. }
  128. if (sumDP > card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass))
  129. {
  130. return false;
  131. }
  132. return true;
  133. }
  134. bool CanTargetConditionByPreSelectedList(List<Permanent> permanents, Permanent permanent)
  135. {
  136. int sumDP = 0;
  137. foreach (Permanent permanent1 in permanents)
  138. {
  139. sumDP += permanent1.DP;
  140. }
  141. sumDP += permanent.DP;
  142. if (sumDP > card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass))
  143. {
  144. return false;
  145. }
  146. return true;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. }
  153. #endregion
  154. #region When Digivolving
  155. if (timing == EffectTiming.OnEnterFieldAnyone)
  156. {
  157. ActivateClass activateClass = new ActivateClass();
  158. activateClass.SetUpICardEffect($"-{DPChangeValue()}DP to 1 digimon for the turn, then delete up to 7k worth of digimon", CanUseCondition, card);
  159. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  160. cardEffects.Add(activateClass);
  161. string EffectDiscription()
  162. {
  163. return "[When Digivolving] To 1 of your opponent’s Digimon, give -4000 DP for the turn for each of your Digimon with the [Olympos XII] trait. Then, delete up to 7000 DP total worth of their Digimon.";
  164. }
  165. bool CanUseCondition(Hashtable hashtable)
  166. {
  167. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  168. && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  169. }
  170. bool CanActivateCondition(Hashtable hashtable)
  171. {
  172. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  173. }
  174. bool CanSelectPermanentCondition(Permanent permanent)
  175. {
  176. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  177. }
  178. int DPChangeValue() => card.Owner.GetBattleAreaDigimons().Filter(x => x.TopCard.EqualsTraits("Olympos XII")).Count * 4000;
  179. int DeletionMaxDP() => 7000;
  180. bool CanSelectDeletePermanentCondition(Permanent permanent)
  181. {
  182. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  183. {
  184. if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass))
  185. {
  186. return true;
  187. }
  188. }
  189. return false;
  190. }
  191. IEnumerator ActivateCoroutine(Hashtable hashtable)
  192. {
  193. if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanentCondition))
  194. {
  195. Permanent selectedPermanent = null;
  196. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  197. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  198. selectPermanentEffect.SetUp(
  199. selectPlayer: card.Owner,
  200. canTargetCondition: CanSelectPermanentCondition,
  201. canTargetCondition_ByPreSelecetedList: null,
  202. canEndSelectCondition: null,
  203. maxCount: maxCount,
  204. canNoSelect: false,
  205. canEndNotMax: false,
  206. selectPermanentCoroutine: SelectPermanentCoroutine,
  207. afterSelectPermanentCoroutine: null,
  208. mode: SelectPermanentEffect.Mode.Custom,
  209. cardEffect: activateClass);
  210. selectPermanentEffect.SetUpCustomMessage(customMessageArray: CardEffectCommons.customPermanentMessageArray_ChangeDP(changeValue: -DPChangeValue(), maxCount: maxCount));
  211. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  212. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  213. {
  214. selectedPermanent = permanent;
  215. yield return null;
  216. }
  217. if (selectedPermanent != null)
  218. {
  219. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: selectedPermanent, changeValue: -DPChangeValue(), effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  220. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectDeletePermanentCondition))
  221. {
  222. int maxCount1 = Math.Min(card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectDeletePermanentCondition),
  223. CardEffectCommons.MatchConditionPermanentCount(CanSelectDeletePermanentCondition));
  224. SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
  225. selectPermanentEffect1.SetUp(
  226. selectPlayer: card.Owner,
  227. canTargetCondition: CanSelectDeletePermanentCondition,
  228. canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
  229. canEndSelectCondition: CanEndSelectCondition,
  230. maxCount: maxCount1,
  231. canNoSelect: false,
  232. canEndNotMax: true,
  233. selectPermanentCoroutine: null,
  234. afterSelectPermanentCoroutine: null,
  235. mode: SelectPermanentEffect.Mode.Destroy,
  236. cardEffect: activateClass);
  237. selectPermanentEffect.SetUpCustomMessage("Choose digimon to delete", "Opponent is choosing digimon to delete");
  238. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  239. bool CanEndSelectCondition(List<Permanent> permanents)
  240. {
  241. if (permanents.Count <= 0)
  242. {
  243. return false;
  244. }
  245. int sumDP = 0;
  246. foreach (Permanent permanent in permanents)
  247. {
  248. sumDP += permanent.DP;
  249. }
  250. if (sumDP > card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass))
  251. {
  252. return false;
  253. }
  254. return true;
  255. }
  256. bool CanTargetConditionByPreSelectedList(List<Permanent> permanents, Permanent permanent)
  257. {
  258. int sumDP = 0;
  259. foreach (Permanent permanent1 in permanents)
  260. {
  261. sumDP += permanent1.DP;
  262. }
  263. sumDP += permanent.DP;
  264. if (sumDP > card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass))
  265. {
  266. return false;
  267. }
  268. return true;
  269. }
  270. }
  271. }
  272. }
  273. }
  274. }
  275. #endregion
  276. #region End of Your Turn
  277. if (timing == EffectTiming.OnEndTurn)
  278. {
  279. ActivateClass activateClass = new ActivateClass();
  280. activateClass.SetUpICardEffect("DNA into [GraceNovamon]", CanUseCondition, card);
  281. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  282. cardEffects.Add(activateClass);
  283. string EffectDiscription()
  284. {
  285. return "[End of Your Turn] 2 of your Digimon may DNA digivolve into [GraceNovamon] in the hand. Then, 1 of your Digimon may attack.";
  286. }
  287. bool CanSelectDNACardCondition(CardSource cardSource)
  288. {
  289. return cardSource.IsDigimon &&
  290. cardSource.EqualsCardName("GraceNovamon") &&
  291. cardSource.CanPlayJogress(true);
  292. }
  293. bool IsYourAttackingDigimon(Permanent permanent)
  294. {
  295. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  296. permanent.CanAttack(activateClass);
  297. }
  298. bool CanUseCondition(Hashtable hashtable)
  299. {
  300. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  301. CardEffectCommons.IsOwnerTurn(card);
  302. }
  303. bool CanActivateCondition(Hashtable hashtable)
  304. {
  305. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  306. }
  307. IEnumerator ActivateCoroutine(Hashtable hashtable)
  308. {
  309. if (card.Owner.GetBattleAreaDigimons().Count >= 2 && card.Owner.HandCards.Exists(CanSelectDNACardCondition))
  310. {
  311. List<CardSource> selectedDNACards = new List<CardSource>();
  312. SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
  313. selectDNAEffect.SetUp(
  314. selectPlayer: card.Owner,
  315. canTargetCondition: CanSelectDNACardCondition,
  316. canTargetCondition_ByPreSelecetedList: null,
  317. canEndSelectCondition: null,
  318. maxCount: 1,
  319. canNoSelect: true,
  320. canEndNotMax: false,
  321. isShowOpponent: true,
  322. selectCardCoroutine: SelectDNACoroutine,
  323. afterSelectCardCoroutine: null,
  324. mode: SelectHandEffect.Mode.Custom,
  325. cardEffect: activateClass);
  326. selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
  327. "The opponent is selecting 1 card to DNA digivolve.");
  328. selectDNAEffect.SetNotShowCard();
  329. yield return StartCoroutine(selectDNAEffect.Activate());
  330. IEnumerator SelectDNACoroutine(CardSource cardSource)
  331. {
  332. selectedDNACards.Add(cardSource);
  333. yield return null;
  334. }
  335. if (selectedDNACards.Count >= 1)
  336. {
  337. foreach (CardSource selectedCard in selectedDNACards)
  338. {
  339. if (selectedCard.CanPlayJogress(true))
  340. {
  341. _jogressEvoRootsFrameIDs = new int[0];
  342. yield return GManager.instance.photonWaitController.StartWait("Apollomon_P_191");
  343. if (card.Owner.isYou || GManager.instance.IsAI)
  344. {
  345. GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
  346. (card: selectedCard,
  347. isLocal: true,
  348. isPayCost: true,
  349. canNoSelect: true,
  350. endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
  351. noSelectCoroutine: null);
  352. yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
  353. .SelectDigivolutionRoots());
  354. IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
  355. {
  356. if (permanents.Count == 2)
  357. {
  358. _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
  359. .Map(permanent => permanent.PermanentFrame.FrameID);
  360. }
  361. yield return null;
  362. }
  363. photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
  364. }
  365. else
  366. {
  367. GManager.instance.commandText.OpenCommandText(
  368. "The opponent is choosing a card to DNA digivolve.");
  369. }
  370. yield return new WaitWhile(() => !_endSelect);
  371. _endSelect = false;
  372. GManager.instance.commandText.CloseCommandText();
  373. yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
  374. if (_jogressEvoRootsFrameIDs.Length == 2)
  375. {
  376. yield return ContinuousController.instance.StartCoroutine(GManager.instance
  377. .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
  378. "Played Card", true, true));
  379. PlayCardClass playCard = new PlayCardClass(
  380. cardSources: new List<CardSource>() { selectedCard },
  381. hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
  382. payCost: true,
  383. targetPermanent: null,
  384. isTapped: false,
  385. root: SelectCardEffect.Root.Hand,
  386. activateETB: true);
  387. playCard.SetJogress(_jogressEvoRootsFrameIDs);
  388. yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
  389. }
  390. }
  391. }
  392. }
  393. }
  394. if (CardEffectCommons.HasMatchConditionPermanent(IsYourAttackingDigimon))
  395. {
  396. Permanent selectedPermanent = null;
  397. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  398. selectPermanentEffect.SetUp(
  399. selectPlayer: card.Owner,
  400. canTargetCondition: IsYourAttackingDigimon,
  401. canTargetCondition_ByPreSelecetedList: null,
  402. canEndSelectCondition: null,
  403. maxCount: 1,
  404. canNoSelect: true,
  405. canEndNotMax: false,
  406. selectPermanentCoroutine: SelectPermanentCoroutine,
  407. afterSelectPermanentCoroutine: null,
  408. mode: SelectPermanentEffect.Mode.Custom,
  409. cardEffect: activateClass);
  410. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to attack.", "The opponent is selecting 1 Digimon to attack.");
  411. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  412. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  413. {
  414. selectedPermanent = permanent;
  415. yield return null;
  416. }
  417. if (selectedPermanent != null)
  418. {
  419. SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
  420. selectAttackEffect.SetUp(
  421. attacker: selectedPermanent,
  422. canAttackPlayerCondition: () => true,
  423. defenderCondition: _ => true,
  424. cardEffect: activateClass);
  425. yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
  426. }
  427. }
  428. }
  429. }
  430. #endregion
  431. #region ESS
  432. if (timing == EffectTiming.OnEndTurn)
  433. {
  434. ActivateClass activateClass = new ActivateClass();
  435. activateClass.SetUpICardEffect("1 digimon may attack", CanUseCondition, card);
  436. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  437. activateClass.SetIsInheritedEffect(true);
  438. activateClass.SetHashString("P_191_EndOfYourTurn");
  439. cardEffects.Add(activateClass);
  440. string EffectDiscription()
  441. {
  442. return "[End of Your Turn] [Once Per Turn] 1 of your Digimon may attack.";
  443. }
  444. bool CanUseCondition(Hashtable hashtable)
  445. {
  446. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  447. CardEffectCommons.IsOwnerTurn(card);
  448. }
  449. bool CanActivateCondition(Hashtable hashtable)
  450. {
  451. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  452. }
  453. bool IsYourAttackingDigimon(Permanent permanent)
  454. {
  455. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  456. permanent.CanAttack(activateClass);
  457. }
  458. IEnumerator ActivateCoroutine(Hashtable hashtable)
  459. {
  460. if (CardEffectCommons.HasMatchConditionPermanent(IsYourAttackingDigimon))
  461. {
  462. Permanent selectedPermanent = null;
  463. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  464. selectPermanentEffect.SetUp(
  465. selectPlayer: card.Owner,
  466. canTargetCondition: IsYourAttackingDigimon,
  467. canTargetCondition_ByPreSelecetedList: null,
  468. canEndSelectCondition: null,
  469. maxCount: 1,
  470. canNoSelect: true,
  471. canEndNotMax: false,
  472. selectPermanentCoroutine: SelectPermanentCoroutine,
  473. afterSelectPermanentCoroutine: null,
  474. mode: SelectPermanentEffect.Mode.Custom,
  475. cardEffect: activateClass);
  476. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to attack.", "The opponent is selecting 1 Digimon to attack.");
  477. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  478. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  479. {
  480. selectedPermanent = permanent;
  481. yield return null;
  482. }
  483. if (selectedPermanent != null)
  484. {
  485. SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
  486. selectAttackEffect.SetUp(
  487. attacker: selectedPermanent,
  488. canAttackPlayerCondition: () => true,
  489. defenderCondition: _ => true,
  490. cardEffect: activateClass);
  491. yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
  492. }
  493. }
  494. }
  495. }
  496. #endregion
  497. return cardEffects;
  498. }
  499. #region End of your turn DNA required
  500. private bool _endSelect = false;
  501. private int[] _jogressEvoRootsFrameIDs = new int[0];
  502. [PunRPC]
  503. public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
  504. {
  505. this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
  506. _endSelect = true;
  507. }
  508. #endregion
  509. }
  510. }