ShoutmonX4B_BT10_012.cs 33 KB

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