BT10_026.cs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. namespace DCGO.CardEffects.BT10
  9. {
  10. public class BT10_026 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  16. {
  17. cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card));
  18. }
  19. if (timing == EffectTiming.OnEnterFieldAnyone)
  20. {
  21. ActivateClass activateClass = new ActivateClass();
  22. activateClass.SetUpICardEffect("Place 1 card to digivolution cards and opponent's 1 Digimon can't attack and block", CanUseCondition, card);
  23. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  24. cardEffects.Add(activateClass);
  25. string EffectDiscription()
  26. {
  27. return "[On Play] You may place 1 Digimon card with [Blue Flare] in its traits from your hand or from under one of your Tamers under this Digimon as its bottom digivolution card. Then, if [Deckerdramon] is in this Digimon's digivolution cards, 1 of your opponent's Digimon can't attack or block until the end of your opponent's turn.";
  28. }
  29. bool CanSelectCardCondition(CardSource cardSource)
  30. {
  31. if (cardSource.IsDigimon)
  32. {
  33. if (cardSource.CardTraits.Contains("Blue Flare"))
  34. {
  35. return true;
  36. }
  37. if (cardSource.CardTraits.Contains("BlueFlare"))
  38. {
  39. return true;
  40. }
  41. }
  42. return false;
  43. }
  44. bool CanSelectPermanentCondition(Permanent permanent)
  45. {
  46. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  47. {
  48. if (permanent.IsTamer)
  49. {
  50. if (permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
  51. {
  52. return true;
  53. }
  54. }
  55. }
  56. return false;
  57. }
  58. bool CanSelectPermanentCondition1(Permanent permanent)
  59. {
  60. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  61. }
  62. bool CanUseCondition(Hashtable hashtable)
  63. {
  64. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  65. }
  66. bool CanActivateCondition(Hashtable hashtable)
  67. {
  68. if (CardEffectCommons.IsExistOnBattleArea(card))
  69. {
  70. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1 || card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  71. {
  72. return true;
  73. }
  74. if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Deckerdramon")) >= 1)
  75. {
  76. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  77. {
  78. return true;
  79. }
  80. }
  81. }
  82. return false;
  83. }
  84. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  85. {
  86. if (CardEffectCommons.IsExistOnBattleArea(card))
  87. {
  88. bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
  89. bool canSelectTamer = card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1;
  90. if (canSelectHand || canSelectTamer)
  91. {
  92. if (canSelectHand && canSelectTamer)
  93. {
  94. List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
  95. {
  96. new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
  97. new SelectionElement<bool>(message: $"Under Tamer", value : false, spriteIndex: 1),
  98. };
  99. string selectPlayerMessage = "From which area do you select a card?";
  100. string notSelectPlayerMessage = "The opponent is choosing from which area to select a card.";
  101. GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
  102. }
  103. else
  104. {
  105. GManager.instance.userSelectionManager.SetBool(canSelectHand);
  106. }
  107. yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
  108. bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
  109. if (fromHand)
  110. {
  111. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  112. {
  113. List<CardSource> selectedCards = new List<CardSource>();
  114. int maxCount = 1;
  115. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  116. selectHandEffect.SetUp(
  117. selectPlayer: card.Owner,
  118. canTargetCondition: CanSelectCardCondition,
  119. canTargetCondition_ByPreSelecetedList: null,
  120. canEndSelectCondition: null,
  121. maxCount: maxCount,
  122. canNoSelect: true,
  123. canEndNotMax: false,
  124. isShowOpponent: true,
  125. selectCardCoroutine: SelectCardCoroutine,
  126. afterSelectCardCoroutine: null,
  127. mode: SelectHandEffect.Mode.Custom,
  128. cardEffect: activateClass);
  129. selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards.");
  130. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  131. yield return StartCoroutine(selectHandEffect.Activate());
  132. IEnumerator SelectCardCoroutine(CardSource cardSource)
  133. {
  134. selectedCards.Add(cardSource);
  135. yield return null;
  136. }
  137. if (selectedCards.Count >= 1)
  138. {
  139. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(selectedCards, activateClass));
  140. }
  141. }
  142. }
  143. else
  144. {
  145. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  146. {
  147. Permanent selectedPermanent = null;
  148. int maxCount = Math.Min(1, card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
  149. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  150. selectPermanentEffect.SetUp(
  151. selectPlayer: card.Owner,
  152. canTargetCondition: CanSelectPermanentCondition,
  153. canTargetCondition_ByPreSelecetedList: null,
  154. canEndSelectCondition: null,
  155. maxCount: maxCount,
  156. canNoSelect: true,
  157. canEndNotMax: false,
  158. selectPermanentCoroutine: SelectPermanentCoroutine,
  159. afterSelectPermanentCoroutine: null,
  160. mode: SelectPermanentEffect.Mode.Custom,
  161. cardEffect: activateClass);
  162. selectPermanentEffect.SetUpCustomMessage("Select a Tamer.", "The opponent is selecting a Tamer.");
  163. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  164. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  165. {
  166. selectedPermanent = permanent;
  167. yield return null;
  168. }
  169. if (selectedPermanent != null)
  170. {
  171. if (selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
  172. {
  173. maxCount = Math.Min(1, selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition));
  174. List<CardSource> selectedCards = new List<CardSource>();
  175. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  176. selectCardEffect.SetUp(
  177. canTargetCondition: CanSelectCardCondition,
  178. canTargetCondition_ByPreSelecetedList: null,
  179. canEndSelectCondition: null,
  180. canNoSelect: () => true,
  181. selectCardCoroutine: SelectCardCoroutine,
  182. afterSelectCardCoroutine: null,
  183. message: "Select 1 digivolution card.",
  184. maxCount: maxCount,
  185. canEndNotMax: false,
  186. isShowOpponent: true,
  187. mode: SelectCardEffect.Mode.Custom,
  188. root: SelectCardEffect.Root.Custom,
  189. customRootCardList: selectedPermanent.DigivolutionCards,
  190. canLookReverseCard: true,
  191. selectPlayer: card.Owner,
  192. cardEffect: activateClass);
  193. selectCardEffect.SetUpCustomMessage("Select 1 digivolution card.", "The opponent is selecting 1 digivolution card.");
  194. selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  195. yield return StartCoroutine(selectCardEffect.Activate());
  196. IEnumerator SelectCardCoroutine(CardSource cardSource)
  197. {
  198. selectedCards.Add(cardSource);
  199. yield return null;
  200. }
  201. if (selectedCards.Count >= 1)
  202. {
  203. foreach (CardSource selectedCard in selectedCards)
  204. {
  205. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().RemoveDigivolveRootEffect(selectedCard, selectedPermanent));
  206. }
  207. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(selectedCards, activateClass));
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. if (CardEffectCommons.IsExistOnBattleArea(card))
  216. {
  217. if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Deckerdramon")) >= 1)
  218. {
  219. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  220. {
  221. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1));
  222. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  223. selectPermanentEffect.SetUp(
  224. selectPlayer: card.Owner,
  225. canTargetCondition: CanSelectPermanentCondition1,
  226. canTargetCondition_ByPreSelecetedList: null,
  227. canEndSelectCondition: null,
  228. maxCount: maxCount,
  229. canNoSelect: false,
  230. canEndNotMax: false,
  231. selectPermanentCoroutine: SelectPermanentCoroutine,
  232. afterSelectPermanentCoroutine: null,
  233. mode: SelectPermanentEffect.Mode.Custom,
  234. cardEffect: activateClass);
  235. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects.");
  236. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  237. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  238. {
  239. Permanent selectedPermanent = permanent;
  240. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(targetPermanent: selectedPermanent, defenderCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Attack"));
  241. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBlock(targetPermanent: selectedPermanent, attackerCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Block"));
  242. }
  243. }
  244. }
  245. }
  246. }
  247. }
  248. if (timing == EffectTiming.OnEnterFieldAnyone)
  249. {
  250. ActivateClass activateClass = new ActivateClass();
  251. activateClass.SetUpICardEffect("Place 1 card to digivolution cards and opponent's 1 Digimon can't attack and block", CanUseCondition, card);
  252. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  253. cardEffects.Add(activateClass);
  254. string EffectDiscription()
  255. {
  256. return "[When Digivolving] You may place 1 Digimon card with [Blue Flare] in its traits from your hand or from under one of your Tamers under this Digimon as its bottom digivolution card. Then, if [Deckerdramon] is in this Digimon's digivolution cards, 1 of your opponent's Digimon can't attack or block until the end of your opponent's turn.";
  257. }
  258. bool CanSelectCardCondition(CardSource cardSource)
  259. {
  260. if (cardSource.IsDigimon)
  261. {
  262. if (cardSource.CardTraits.Contains("Blue Flare"))
  263. {
  264. return true;
  265. }
  266. if (cardSource.CardTraits.Contains("BlueFlare"))
  267. {
  268. return true;
  269. }
  270. }
  271. return false;
  272. }
  273. bool CanSelectPermanentCondition(Permanent permanent)
  274. {
  275. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  276. {
  277. if (permanent.IsTamer)
  278. {
  279. if (permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
  280. {
  281. return true;
  282. }
  283. }
  284. }
  285. return false;
  286. }
  287. bool CanSelectPermanentCondition1(Permanent permanent)
  288. {
  289. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  290. }
  291. bool CanUseCondition(Hashtable hashtable)
  292. {
  293. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  294. }
  295. bool CanActivateCondition(Hashtable hashtable)
  296. {
  297. if (CardEffectCommons.IsExistOnBattleArea(card))
  298. {
  299. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1 || card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  300. {
  301. return true;
  302. }
  303. if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Deckerdramon")) >= 1)
  304. {
  305. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  306. {
  307. return true;
  308. }
  309. }
  310. }
  311. return false;
  312. }
  313. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  314. {
  315. if (CardEffectCommons.IsExistOnBattleArea(card))
  316. {
  317. bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
  318. bool canSelectTamer = card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1;
  319. if (canSelectHand || canSelectTamer)
  320. {
  321. if (canSelectHand && canSelectTamer)
  322. {
  323. List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
  324. {
  325. new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
  326. new SelectionElement<bool>(message: $"Under Tamer", value : false, spriteIndex: 1),
  327. };
  328. string selectPlayerMessage = "From which area do you select a card?";
  329. string notSelectPlayerMessage = "The opponent is choosing from which area to select a card.";
  330. GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
  331. }
  332. else
  333. {
  334. GManager.instance.userSelectionManager.SetBool(canSelectHand);
  335. }
  336. yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
  337. bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
  338. if (fromHand)
  339. {
  340. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  341. {
  342. List<CardSource> selectedCards = new List<CardSource>();
  343. int maxCount = 1;
  344. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  345. selectHandEffect.SetUp(
  346. selectPlayer: card.Owner,
  347. canTargetCondition: CanSelectCardCondition,
  348. canTargetCondition_ByPreSelecetedList: null,
  349. canEndSelectCondition: null,
  350. maxCount: maxCount,
  351. canNoSelect: true,
  352. canEndNotMax: false,
  353. isShowOpponent: true,
  354. selectCardCoroutine: SelectCardCoroutine,
  355. afterSelectCardCoroutine: null,
  356. mode: SelectHandEffect.Mode.Custom,
  357. cardEffect: activateClass);
  358. selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards.");
  359. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  360. yield return StartCoroutine(selectHandEffect.Activate());
  361. IEnumerator SelectCardCoroutine(CardSource cardSource)
  362. {
  363. selectedCards.Add(cardSource);
  364. yield return null;
  365. }
  366. if (selectedCards.Count >= 1)
  367. {
  368. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(selectedCards, activateClass));
  369. }
  370. }
  371. }
  372. else
  373. {
  374. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  375. {
  376. Permanent selectedPermanent = null;
  377. int maxCount = Math.Min(1, card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
  378. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  379. selectPermanentEffect.SetUp(
  380. selectPlayer: card.Owner,
  381. canTargetCondition: CanSelectPermanentCondition,
  382. canTargetCondition_ByPreSelecetedList: null,
  383. canEndSelectCondition: null,
  384. maxCount: maxCount,
  385. canNoSelect: true,
  386. canEndNotMax: false,
  387. selectPermanentCoroutine: SelectPermanentCoroutine,
  388. afterSelectPermanentCoroutine: null,
  389. mode: SelectPermanentEffect.Mode.Custom,
  390. cardEffect: activateClass);
  391. selectPermanentEffect.SetUpCustomMessage("Select a Tamer.", "The opponent is selecting a Tamer.");
  392. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  393. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  394. {
  395. selectedPermanent = permanent;
  396. yield return null;
  397. }
  398. if (selectedPermanent != null)
  399. {
  400. if (selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
  401. {
  402. maxCount = Math.Min(1, selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition));
  403. List<CardSource> selectedCards = new List<CardSource>();
  404. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  405. selectCardEffect.SetUp(
  406. canTargetCondition: CanSelectCardCondition,
  407. canTargetCondition_ByPreSelecetedList: null,
  408. canEndSelectCondition: null,
  409. canNoSelect: () => true,
  410. selectCardCoroutine: SelectCardCoroutine,
  411. afterSelectCardCoroutine: null,
  412. message: "Select 1 digivolution card.",
  413. maxCount: maxCount,
  414. canEndNotMax: false,
  415. isShowOpponent: true,
  416. mode: SelectCardEffect.Mode.Custom,
  417. root: SelectCardEffect.Root.Custom,
  418. customRootCardList: selectedPermanent.DigivolutionCards,
  419. canLookReverseCard: true,
  420. selectPlayer: card.Owner,
  421. cardEffect: activateClass);
  422. selectCardEffect.SetUpCustomMessage("Select 1 digivolution card.", "The opponent is selecting 1 digivolution card.");
  423. selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  424. yield return StartCoroutine(selectCardEffect.Activate());
  425. IEnumerator SelectCardCoroutine(CardSource cardSource)
  426. {
  427. selectedCards.Add(cardSource);
  428. yield return null;
  429. }
  430. if (selectedCards.Count >= 1)
  431. {
  432. foreach (CardSource selectedCard in selectedCards)
  433. {
  434. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().RemoveDigivolveRootEffect(selectedCard, selectedPermanent));
  435. }
  436. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(selectedCards, activateClass));
  437. }
  438. }
  439. }
  440. }
  441. }
  442. }
  443. }
  444. if (CardEffectCommons.IsExistOnBattleArea(card))
  445. {
  446. if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Deckerdramon")) >= 1)
  447. {
  448. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  449. {
  450. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1));
  451. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  452. selectPermanentEffect.SetUp(
  453. selectPlayer: card.Owner,
  454. canTargetCondition: CanSelectPermanentCondition1,
  455. canTargetCondition_ByPreSelecetedList: null,
  456. canEndSelectCondition: null,
  457. maxCount: maxCount,
  458. canNoSelect: false,
  459. canEndNotMax: false,
  460. selectPermanentCoroutine: SelectPermanentCoroutine,
  461. afterSelectPermanentCoroutine: null,
  462. mode: SelectPermanentEffect.Mode.Custom,
  463. cardEffect: activateClass);
  464. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects.");
  465. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  466. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  467. {
  468. Permanent selectedPermanent = permanent;
  469. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(targetPermanent: selectedPermanent, defenderCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Attack"));
  470. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBlock(targetPermanent: selectedPermanent, attackerCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Block"));
  471. }
  472. }
  473. }
  474. }
  475. }
  476. }
  477. if (timing == EffectTiming.None)
  478. {
  479. AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
  480. addDigiXrosConditionClass.SetUpICardEffect($"DigiXros", CanUseCondition, card);
  481. addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros);
  482. addDigiXrosConditionClass.SetNotShowUI(true);
  483. cardEffects.Add(addDigiXrosConditionClass);
  484. bool CanUseCondition(Hashtable hashtable)
  485. {
  486. return true;
  487. }
  488. DigiXrosCondition GetDigiXros(CardSource cardSource)
  489. {
  490. if (cardSource == card)
  491. {
  492. DigiXrosConditionElement element = new DigiXrosConditionElement(CanSelectCardCondition, "MetalGreymon");
  493. bool CanSelectCardCondition(CardSource cardSource)
  494. {
  495. if (cardSource != null)
  496. {
  497. if (cardSource.Owner == card.Owner)
  498. {
  499. if (cardSource.IsDigimon)
  500. {
  501. if (cardSource.CardNames_DigiXros.Contains("MetalGreymon"))
  502. {
  503. return true;
  504. }
  505. }
  506. }
  507. }
  508. return false;
  509. }
  510. DigiXrosConditionElement element1 = new DigiXrosConditionElement(CanSelectCardCondition1, "Deckerdramon");
  511. bool CanSelectCardCondition1(CardSource cardSource)
  512. {
  513. if (cardSource != null)
  514. {
  515. if (cardSource.Owner == card.Owner)
  516. {
  517. if (cardSource.IsDigimon)
  518. {
  519. if (cardSource.CardNames_DigiXros.Contains("Deckerdramon"))
  520. {
  521. return true;
  522. }
  523. }
  524. }
  525. }
  526. return false;
  527. }
  528. List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>() { element, element1 };
  529. DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 2);
  530. return digiXrosCondition;
  531. }
  532. return null;
  533. }
  534. }
  535. return cardEffects;
  536. }
  537. }
  538. }