BT18_073.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace DCGO.CardEffects.BT18
  6. {
  7. public class BT18_073 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternate Digivolution Requirement
  13. if (timing == EffectTiming.None)
  14. {
  15. bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. if (targetPermanent.TopCard.EqualsTraits("Composite"))
  18. {
  19. if (targetPermanent.TopCard.HasLevel)
  20. {
  21. if (targetPermanent.Level == 5)
  22. {
  23. return true;
  24. }
  25. }
  26. }
  27. return false;
  28. }
  29. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
  30. }
  31. #endregion
  32. #region Cost Reduction
  33. bool HasCompositeTraitInPlay(Permanent permanent)
  34. {
  35. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent,card))
  36. return permanent.TopCard.EqualsTraits("Composite");
  37. return false;
  38. }
  39. #region Before Pay Cost - Condition Effect
  40. if (timing == EffectTiming.BeforePayCost)
  41. {
  42. ActivateClass activateClass = new ActivateClass();
  43. activateClass.SetUpICardEffect("Delete 1 of your [Composite] trait digimon to get Play Cost -4", CanUseCondition, card);
  44. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  45. activateClass.SetHashString("PlayCost-4_BT18_073");
  46. cardEffects.Add(activateClass);
  47. string EffectDiscription()
  48. {
  49. return "When this card would be played, by deleting 1 of your Digimon with the [Composite] trait, reduce the play cost by 4.";
  50. }
  51. bool CardCondition(CardSource cardSource)
  52. {
  53. return (cardSource == card);
  54. }
  55. bool CanNoSelect(CardSource cardSource)
  56. {
  57. if (cardSource != null)
  58. {
  59. if (cardSource.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: false) > cardSource.Owner.MaxMemoryCost)
  60. {
  61. return false;
  62. }
  63. }
  64. return true;
  65. }
  66. bool CanUseCondition(Hashtable hashtable)
  67. {
  68. return CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, CardCondition);
  69. }
  70. bool CanActivateCondition(Hashtable hashtable)
  71. {
  72. return CardEffectCommons.HasMatchConditionPermanent(HasCompositeTraitInPlay);
  73. }
  74. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  75. {
  76. Permanent deletedCard = null;
  77. bool noSelect = CanNoSelect(CardEffectCommons.GetCardFromHashtable(_hashtable));
  78. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  79. selectPermanentEffect.SetUp(
  80. selectPlayer: card.Owner,
  81. canTargetCondition: HasCompositeTraitInPlay,
  82. canTargetCondition_ByPreSelecetedList: null,
  83. canEndSelectCondition: null,
  84. maxCount: 1,
  85. canNoSelect: true,
  86. canEndNotMax: false,
  87. selectPermanentCoroutine: SelectPermanentCoroutine,
  88. afterSelectPermanentCoroutine: null,
  89. mode: SelectPermanentEffect.Mode.Custom,
  90. cardEffect: activateClass);
  91. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  92. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  93. {
  94. deletedCard = permanent;
  95. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { deletedCard }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
  96. }
  97. IEnumerator SuccessProcess()
  98. {
  99. if (card.Owner.CanReduceCost(null, card))
  100. {
  101. ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
  102. }
  103. ChangeCostClass changeCostClass = new ChangeCostClass();
  104. changeCostClass.SetUpICardEffect("Play Cost -1", CanUseCondition1, card);
  105. changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
  106. card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
  107. bool CanUseCondition1(Hashtable hashtable)
  108. {
  109. return true;
  110. }
  111. int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
  112. {
  113. if (CardSourceCondition(cardSource))
  114. {
  115. if (RootCondition(root))
  116. {
  117. if (PermanentsCondition(targetPermanents))
  118. {
  119. Cost -= 4;
  120. }
  121. }
  122. }
  123. return Cost;
  124. }
  125. bool PermanentsCondition(List<Permanent> targetPermanents)
  126. {
  127. if (targetPermanents == null)
  128. {
  129. return true;
  130. }
  131. else
  132. {
  133. if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
  134. {
  135. return true;
  136. }
  137. }
  138. return false;
  139. }
  140. bool CardSourceCondition(CardSource cardSource)
  141. {
  142. return cardSource == card;
  143. }
  144. bool RootCondition(SelectCardEffect.Root root)
  145. {
  146. return true;
  147. }
  148. bool isUpDown()
  149. {
  150. return true;
  151. }
  152. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
  153. }
  154. }
  155. }
  156. #endregion
  157. #region Reduce Play Cost - Not Shown
  158. if (timing == EffectTiming.None)
  159. {
  160. ChangeCostClass changeCostClass = new ChangeCostClass();
  161. changeCostClass.SetUpICardEffect("Play Cost -4", CanUseCondition, card);
  162. changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => true, isChangePayingCost: () => true);
  163. changeCostClass.SetNotShowUI(true);
  164. cardEffects.Add(changeCostClass);
  165. bool CanUseCondition(Hashtable hashtable)
  166. {
  167. ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Delete 1 of your [Composite] trait digimon to get Play Cost -4");
  168. if (activateClass != null)
  169. {
  170. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasCompositeTraitInPlay))
  171. {
  172. return true;
  173. }
  174. }
  175. return false;
  176. }
  177. int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
  178. {
  179. if (CardSourceCondition(cardSource))
  180. {
  181. if (RootCondition(root))
  182. {
  183. if (PermanentsCondition(targetPermanents))
  184. {
  185. int targetCount = 0;
  186. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasCompositeTraitInPlay))
  187. targetCount += 4;
  188. Cost -= targetCount;
  189. }
  190. }
  191. }
  192. return Cost;
  193. }
  194. bool PermanentsCondition(List<Permanent> targetPermanents)
  195. {
  196. if (targetPermanents == null)
  197. {
  198. return true;
  199. }
  200. else
  201. {
  202. if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
  203. {
  204. return true;
  205. }
  206. }
  207. return false;
  208. }
  209. bool CardSourceCondition(CardSource cardSource)
  210. {
  211. if (cardSource != null)
  212. {
  213. if (cardSource == card)
  214. {
  215. return true;
  216. }
  217. }
  218. return false;
  219. }
  220. bool RootCondition(SelectCardEffect.Root root)
  221. {
  222. return true;
  223. }
  224. bool isUpDown()
  225. {
  226. return true;
  227. }
  228. }
  229. #endregion
  230. #endregion
  231. #region On Play
  232. if (timing == EffectTiming.OnEnterFieldAnyone)
  233. {
  234. ActivateClass activateClass = new ActivateClass();
  235. activateClass.SetUpICardEffect("De-Digivolve 1 all opponents digimon", CanUseCondition, card);
  236. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  237. cardEffects.Add(activateClass);
  238. string EffectDiscription()
  239. {
  240. return "[On Play] <De-Digivolve 1> all of your opponent's Digimon.";
  241. }
  242. bool CanSelectPermanentCondition(Permanent permanent)
  243. {
  244. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  245. !permanent.TopCard.CanNotBeAffected(activateClass);
  246. }
  247. bool CanUseCondition(Hashtable hashtable)
  248. {
  249. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  250. }
  251. bool CanActivateCondition(Hashtable hashtable)
  252. {
  253. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  254. card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1;
  255. }
  256. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  257. {
  258. foreach (Permanent permanent in card.Owner.Enemy.GetBattleAreaDigimons())
  259. {
  260. if (CanSelectPermanentCondition(permanent))
  261. {
  262. yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
  263. }
  264. }
  265. }
  266. }
  267. #endregion
  268. #region When Digivolving
  269. if (timing == EffectTiming.OnEnterFieldAnyone)
  270. {
  271. ActivateClass activateClass = new ActivateClass();
  272. activateClass.SetUpICardEffect("De-Digivolve 1 all opponents digimon", CanUseCondition, card);
  273. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  274. cardEffects.Add(activateClass);
  275. string EffectDiscription()
  276. {
  277. return "[When Digivolving] <De-Digivolve 1> all of your opponent's Digimon.";
  278. }
  279. bool CanSelectPermanentCondition(Permanent permanent)
  280. {
  281. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  282. !permanent.TopCard.CanNotBeAffected(activateClass);
  283. }
  284. bool CanUseCondition(Hashtable hashtable)
  285. {
  286. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  287. CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  288. }
  289. bool CanActivateCondition(Hashtable hashtable)
  290. {
  291. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  292. card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1;
  293. }
  294. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  295. {
  296. foreach (Permanent permanent in card.Owner.Enemy.GetBattleAreaDigimons())
  297. {
  298. if (CanSelectPermanentCondition(permanent))
  299. {
  300. yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
  301. }
  302. }
  303. }
  304. }
  305. #endregion
  306. #region On Deletion
  307. if (timing == EffectTiming.OnDestroyedAnyone)
  308. {
  309. ActivateClass activateClass = new ActivateClass();
  310. activateClass.SetUpICardEffect("DNA into [Millenniummon]", CanUseCondition, card);
  311. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  312. cardEffects.Add(activateClass);
  313. string EffectDiscription()
  314. {
  315. return "[On Deletion] 1 of your [Kimeramon] in play and 1 [Machinedramon] in the trash may DNA Digivolve into [Millenniummon] in the hand.";
  316. }
  317. bool HasKimeramon(Permanent permanent)
  318. {
  319. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  320. permanent.TopCard.EqualsCardName("Kimeramon");
  321. }
  322. bool HasMachinedramon(CardSource source)
  323. {
  324. return CardEffectCommons.IsExistOnTrash(source) &&
  325. source.EqualsCardName("Machinedramon");
  326. }
  327. bool HasMillenniummon(CardSource source)
  328. {
  329. return CardEffectCommons.IsExistOnHand(source) &&
  330. source.EqualsCardName("Millenniummon") &&
  331. source.jogressCondition != null;
  332. }
  333. bool CanUseCondition(Hashtable hashtable)
  334. {
  335. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
  336. }
  337. bool CanActivateCondition(Hashtable hashtable)
  338. {
  339. return CardEffectCommons.CanActivateOnDeletion(card) &&
  340. CardEffectCommons.HasMatchConditionPermanent(HasKimeramon) &&
  341. CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasMachinedramon) &&
  342. CardEffectCommons.HasMatchConditionOwnersHand(card, HasMillenniummon);
  343. }
  344. IEnumerator ActivateCoroutine(Hashtable hashtable)
  345. {
  346. CardSource dnaTarget = null;
  347. Permanent selectedPermanent = null;
  348. CardSource selectedCardSource = null;
  349. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  350. selectHandEffect.SetUp(
  351. selectPlayer: card.Owner,
  352. canTargetCondition: HasMillenniummon,
  353. canTargetCondition_ByPreSelecetedList: null,
  354. canEndSelectCondition: null,
  355. maxCount: 1,
  356. canNoSelect: false,
  357. canEndNotMax: false,
  358. isShowOpponent: true,
  359. selectCardCoroutine: SelectDNACardCoroutine,
  360. afterSelectCardCoroutine: null,
  361. mode: SelectHandEffect.Mode.Custom,
  362. cardEffect: activateClass);
  363. selectHandEffect.SetUpCustomMessage("Select 1 Digimon to DNA digivolve.", "The opponent is selecting 1 Digimon to DNA digivolve.");
  364. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  365. IEnumerator SelectDNACardCoroutine(CardSource source)
  366. {
  367. dnaTarget = source;
  368. yield return null;
  369. }
  370. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  371. selectPermanentEffect.SetUp(
  372. selectPlayer: card.Owner,
  373. canTargetCondition: HasKimeramon,
  374. canTargetCondition_ByPreSelecetedList: null,
  375. canEndSelectCondition: null,
  376. maxCount: 1,
  377. canNoSelect: false,
  378. canEndNotMax: false,
  379. selectPermanentCoroutine: SelectPermanentCoroutine,
  380. afterSelectPermanentCoroutine: null,
  381. mode: SelectPermanentEffect.Mode.Custom,
  382. cardEffect: activateClass);
  383. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to DNA digivolve.", "The opponent is selecting 1 Digimon to DNA digivolve.");
  384. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  385. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  386. {
  387. selectedPermanent = permanent;
  388. yield return null;
  389. }
  390. if(selectedPermanent != null)
  391. {
  392. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  393. selectCardEffect.SetUp(
  394. canTargetCondition: HasMachinedramon,
  395. canTargetCondition_ByPreSelecetedList: null,
  396. canEndSelectCondition: null,
  397. canNoSelect: () => false,
  398. selectCardCoroutine: SelectCardCoroutine,
  399. afterSelectCardCoroutine: null,
  400. message: "Select 1 Digimon to DNA digivolve.",
  401. maxCount: 1,
  402. canEndNotMax: false,
  403. isShowOpponent: false,
  404. mode: SelectCardEffect.Mode.Custom,
  405. root: SelectCardEffect.Root.Trash,
  406. customRootCardList: null,
  407. canLookReverseCard: true,
  408. selectPlayer: card.Owner,
  409. cardEffect: activateClass);
  410. selectCardEffect.SetNotShowCard();
  411. selectCardEffect.SetNotAddLog();
  412. yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
  413. }
  414. IEnumerator SelectCardCoroutine(CardSource cardSource)
  415. {
  416. selectedCardSource = cardSource;
  417. yield return null;
  418. }
  419. if(selectedCardSource != null)
  420. {
  421. #region play card from trash
  422. Permanent playedPermanent = null;
  423. int frameID = -1;
  424. foreach (FieldCardFrame fieldCardFrame in selectedCardSource.Owner.fieldCardFrames)
  425. {
  426. if (card.CanPlayCardTargetFrame(fieldCardFrame, false, null))
  427. {
  428. if (fieldCardFrame.IsEmptyFrame())
  429. {
  430. frameID = fieldCardFrame.FrameID;
  431. break;
  432. }
  433. }
  434. }
  435. if (0 <= frameID && frameID < card.Owner.fieldCardFrames.Count)
  436. {
  437. playedPermanent = new Permanent(new List<CardSource>() { selectedCardSource }) { IsSuspended = false };
  438. yield return ContinuousController.instance.StartCoroutine(CardObjectController.CreateNewPermanent(playedPermanent, frameID));
  439. }
  440. #endregion
  441. int[] JogressEvoRootsFrameIDs = { selectedPermanent.PermanentFrame.FrameID, playedPermanent.PermanentFrame.FrameID };
  442. if (dnaTarget.CanPlayJogress(true))
  443. {
  444. PlayCardClass playCard = new PlayCardClass(
  445. cardSources: new List<CardSource>() { dnaTarget },
  446. hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
  447. payCost: true,
  448. targetPermanent: null,
  449. isTapped: false,
  450. root: SelectCardEffect.Root.Hand,
  451. activateETB: true);
  452. playCard.SetJogress(JogressEvoRootsFrameIDs);
  453. yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
  454. }
  455. else
  456. {
  457. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddTrashCard(selectedCardSource));
  458. }
  459. }
  460. }
  461. }
  462. #endregion
  463. #region Opponents Turn - ESS
  464. if (timing == EffectTiming.OnAllyAttack)
  465. {
  466. ActivateClass activateClass = new ActivateClass();
  467. activateClass.SetUpICardEffect("Switch attack target", CanUseCondition, card);
  468. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  469. activateClass.SetHashString("SwitchTarget_BT18-073");
  470. activateClass.SetIsInheritedEffect(true);
  471. cardEffects.Add(activateClass);
  472. string EffectDiscription()
  473. {
  474. return "[Opponent's Turn] [Once Per Turn] When any of your opponent's Digimon attack, you may change the attack target to 1 of your Digimon with the [Composite] or [Wicked God] trait.";
  475. }
  476. bool CanSelectPermanentCondition(Permanent permanent)
  477. {
  478. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  479. (permanent.TopCard.EqualsTraits("Composite") || permanent.TopCard.EqualsTraits("Wicked God"));
  480. }
  481. bool PermanentCondition(Permanent permanent)
  482. {
  483. return CardEffectCommons.IsOpponentPermanent(permanent, card);
  484. }
  485. bool CanUseCondition(Hashtable hashtable)
  486. {
  487. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  488. {
  489. if (CardEffectCommons.IsOpponentTurn(card))
  490. {
  491. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  492. {
  493. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  494. {
  495. return true;
  496. }
  497. }
  498. }
  499. }
  500. return false;
  501. }
  502. bool CanActivateCondition(Hashtable hashtable)
  503. {
  504. if (CardEffectCommons.IsExistOnBattleArea(card))
  505. {
  506. if (GManager.instance.attackProcess.IsAttacking)
  507. {
  508. if (GManager.instance.attackProcess.AttackingPermanent.CanSwitchAttackTarget)
  509. {
  510. return true;
  511. }
  512. }
  513. }
  514. return false;
  515. }
  516. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  517. {
  518. if (CardEffectCommons.IsExistOnBattleArea(card))
  519. {
  520. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(GManager.instance.attackProcess.AttackingPermanent, card))
  521. {
  522. if (GManager.instance.attackProcess.IsAttacking)
  523. {
  524. if (GManager.instance.attackProcess.AttackingPermanent.CanSwitchAttackTarget)
  525. {
  526. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  527. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  528. selectPermanentEffect.SetUp(
  529. selectPlayer: card.Owner,
  530. canTargetCondition: CanSelectPermanentCondition,
  531. canTargetCondition_ByPreSelecetedList: null,
  532. canEndSelectCondition: null,
  533. maxCount: maxCount,
  534. canNoSelect: false,
  535. canEndNotMax: false,
  536. selectPermanentCoroutine: SelectPermanentCoroutine,
  537. afterSelectPermanentCoroutine: null,
  538. mode: SelectPermanentEffect.Mode.Custom,
  539. cardEffect: activateClass);
  540. selectPermanentEffect.SetUpCustomMessage(
  541. "Select 1 Digimon to switch the attack to.",
  542. "The opponent is selecting 1 Digimon to switch the attack to.");
  543. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  544. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  545. {
  546. yield return ContinuousController.instance.StartCoroutine(GManager.instance.attackProcess.SwitchDefender(
  547. activateClass,
  548. false,
  549. permanent));
  550. }
  551. }
  552. }
  553. }
  554. }
  555. }
  556. }
  557. #endregion
  558. return cardEffects;
  559. }
  560. }
  561. }