BT12_084.cs 35 KB

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