SelectCardEffect.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon.Pun;
  6. using System;
  7. public class SelectCardEffect : MonoBehaviourPunCallbacks
  8. {
  9. public void SetUp(
  10. Func<CardSource, bool> canTargetCondition,
  11. Func<List<CardSource>, CardSource, bool> canTargetCondition_ByPreSelecetedList,
  12. Func<List<CardSource>, bool> canEndSelectCondition,
  13. Func<bool> canNoSelect,
  14. Func<CardSource, IEnumerator> selectCardCoroutine,
  15. Func<List<CardSource>, IEnumerator> afterSelectCardCoroutine,
  16. string message,
  17. int maxCount,
  18. bool canEndNotMax,
  19. bool isShowOpponent,
  20. Mode mode,
  21. Root root,
  22. List<CardSource> customRootCardList,
  23. bool canLookReverseCard,
  24. Player selectPlayer,
  25. ICardEffect cardEffect)
  26. {
  27. _canTargetCondition = canTargetCondition;
  28. _canTargetCondition_ByPreSelecetedList = canTargetCondition_ByPreSelecetedList;
  29. _canEndSelectCondition = canEndSelectCondition;
  30. _canNoSelect = canNoSelect;
  31. _selectCardCoroutine = selectCardCoroutine;
  32. _afterSelectCardCoroutine = afterSelectCardCoroutine;
  33. _message = message;
  34. _maxCount = maxCount;
  35. _canEndNotMax = canEndNotMax;
  36. _isShowOpponent = isShowOpponent;
  37. _mode = mode;
  38. _root = root;
  39. _customRootCardList = customRootCardList;
  40. _canLookReverseCard = canLookReverseCard;
  41. _selectPlayer = selectPlayer;
  42. _cardEffect = cardEffect;
  43. _isLocal = false;
  44. _customMessage = null;
  45. _customMessage_Enemy = null;
  46. _customMessage_ShowCard = null;
  47. _customCountText = null;
  48. _showReverseCard = true;
  49. _showCard = true;
  50. _isDigiXros = false;
  51. _isDeckBottom = false;
  52. _isDeckTop = false;
  53. _notAddLog = false;
  54. _isSecurity = false;
  55. _skillInfos = new List<SkillInfo>();
  56. _afterSelectIndexCoroutine = null;
  57. }
  58. public void SetIsLocal()
  59. {
  60. _isLocal = true;
  61. }
  62. public void SetIsDeckBottom()
  63. {
  64. _isDeckBottom = true;
  65. }
  66. public void SetIsDeckTop()
  67. {
  68. _isDeckTop = true;
  69. }
  70. public void SetNotShowCard()
  71. {
  72. _showCard = false;
  73. }
  74. public void SetNotAddLog()
  75. {
  76. _notAddLog = true;
  77. }
  78. public void SetDigiXros()
  79. {
  80. _isDigiXros = true;
  81. }
  82. public void SetIsSecurity()
  83. {
  84. _isSecurity = true;
  85. }
  86. public void SetUpSkillInfos(List<SkillInfo> skillInfos)
  87. {
  88. _skillInfos = skillInfos.Clone();
  89. }
  90. public void SetUpCustomMessage(string CustomMessage, string CustomMessage_Enemy)
  91. {
  92. _customMessage = CustomMessage;
  93. _customMessage_Enemy = CustomMessage_Enemy;
  94. }
  95. public void SetUpCustomMessage_ShowCard(string CustomMessage_ShowCard)
  96. {
  97. _customMessage_ShowCard = CustomMessage_ShowCard;
  98. }
  99. public void SetUpCustomCountText(string CustomCountText)
  100. {
  101. _customCountText = CustomCountText;
  102. }
  103. public void SetShowReverseCard()
  104. {
  105. _showReverseCard = false;
  106. }
  107. Func<CardSource, bool> _canTargetCondition = null;
  108. Func<List<CardSource>, CardSource, bool> _canTargetCondition_ByPreSelecetedList = null;
  109. Func<List<CardSource>, bool> _canEndSelectCondition = null;
  110. Func<bool> _canNoSelect = null;
  111. List<CardSource> _targetCards = new List<CardSource>();
  112. Func<CardSource, IEnumerator> _selectCardCoroutine = null;
  113. Func<List<CardSource>, IEnumerator> _afterSelectCardCoroutine = null;
  114. string _message = "";
  115. int _maxCount = 0;
  116. bool _canEndNotMax = false;
  117. bool _isShowOpponent = false;
  118. bool _canLookReverseCard = false;
  119. List<CardSource> _customRootCardList { get; set; } = new List<CardSource>();
  120. Player _selectPlayer = null;
  121. ICardEffect _cardEffect = null;
  122. bool _isLocal = false;
  123. bool _showReverseCard = true;
  124. bool _showCard = true;
  125. bool _notAddLog = false;
  126. bool _isDigiXros = false;
  127. bool _isSecurity = false;
  128. public enum Mode
  129. {
  130. AddHand,
  131. Discard,
  132. // PutLibraryTop,
  133. // PutLibraryBottom,
  134. Custom,
  135. }
  136. Mode _mode;
  137. public enum Root
  138. {
  139. Library,
  140. Trash,
  141. Clock,
  142. Security,
  143. Custom,
  144. Hand,
  145. Recollection,
  146. Execution,
  147. DigivolutionCards,
  148. None,
  149. }
  150. Root _root;
  151. bool _endSelect = false;
  152. bool _isDeckBottom = false;
  153. bool _isDeckTop = false;
  154. string _customMessage = null;
  155. string _customMessage_Enemy = null;
  156. string _customMessage_ShowCard = null;
  157. string _customCountText = null;
  158. List<SkillInfo> _skillInfos = new List<SkillInfo>();
  159. List<int> _slectedInexesInList = new List<int>();
  160. Func<List<int>, IEnumerator> _afterSelectIndexCoroutine = null;
  161. public void SetUpAfterSelectIndexCoroutine(Func<List<int>, IEnumerator> AfterSelectIndexCoroutine)
  162. {
  163. _afterSelectIndexCoroutine = AfterSelectIndexCoroutine;
  164. }
  165. public virtual List<CardSource> RootCardList()
  166. {
  167. List<CardSource> RootCardList = new List<CardSource>();
  168. switch (_root)
  169. {
  170. case Root.Library:
  171. foreach (CardSource cardSource in _selectPlayer.LibraryCards)
  172. {
  173. RootCardList.Add(cardSource);
  174. }
  175. break;
  176. case Root.Trash:
  177. foreach (CardSource cardSource in _selectPlayer.TrashCards)
  178. {
  179. RootCardList.Add(cardSource);
  180. }
  181. break;
  182. case Root.Security:
  183. foreach (CardSource cardSource in _selectPlayer.SecurityCards)
  184. {
  185. RootCardList.Add(cardSource);
  186. }
  187. break;
  188. case Root.Recollection:
  189. foreach (CardSource cardSource in _selectPlayer.LostCards)
  190. {
  191. RootCardList.Add(cardSource);
  192. }
  193. break;
  194. case Root.Custom:
  195. foreach (CardSource cardSource in _customRootCardList)
  196. {
  197. RootCardList.Add(cardSource);
  198. }
  199. break;
  200. }
  201. return RootCardList;
  202. }
  203. public bool active()
  204. {
  205. if (RootCardList().Count > 0)
  206. {
  207. if (_root != Root.Library && _root != Root.Security && _root != Root.Custom)
  208. {
  209. if (RootCardList().Count((cardSource) => _canTargetCondition(cardSource)) > 0)
  210. {
  211. return true;
  212. }
  213. }
  214. else
  215. {
  216. return true;
  217. }
  218. }
  219. return false;
  220. }
  221. public virtual IEnumerator Activate()
  222. {
  223. bool oldIsSelecting = GManager.instance.turnStateMachine.IsSelecting;
  224. List<CardSource> handCards = new List<CardSource>();
  225. _targetCards = new List<CardSource>();
  226. _slectedInexesInList = new List<int>();
  227. if (!_isLocal)
  228. {
  229. yield return GManager.instance.photonWaitController.StartWait("SelectCardEffect");
  230. }
  231. bool oldIsActiveOutline_AttackingPermanent = false;
  232. if (GManager.instance.attackProcess.AttackingPermanent != null)
  233. {
  234. if (GManager.instance.attackProcess.AttackingPermanent.ShowingPermanentCard != null)
  235. {
  236. oldIsActiveOutline_AttackingPermanent = GManager.instance.attackProcess.AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.activeSelf;
  237. }
  238. }
  239. foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
  240. {
  241. GManager.instance.turnStateMachine.OffFieldCardTarget(player);
  242. GManager.instance.turnStateMachine.OffHandCardTarget(player);
  243. }
  244. if (GManager.instance.attackProcess.AttackingPermanent != null)
  245. {
  246. if (GManager.instance.attackProcess.AttackingPermanent.ShowingPermanentCard != null)
  247. {
  248. GManager.instance.attackProcess.AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(oldIsActiveOutline_AttackingPermanent);
  249. }
  250. }
  251. if (_maxCount == 0)
  252. {
  253. _canNoSelect = () => true;
  254. }
  255. if (_root == Root.Security)
  256. {
  257. SetIsSecurity();
  258. }
  259. if (active())
  260. {
  261. if (_isSecurity)
  262. {
  263. GManager.instance.turnStateMachine.gameContext.IsSecurityLooking = true;
  264. }
  265. if (_selectPlayer.isYou)
  266. {
  267. if ((_isDeckBottom && ContinuousController.instance.autoDeckBottomOrder)
  268. || (_isDeckTop && ContinuousController.instance.autoDeckTopOrder))
  269. {
  270. AutoSelect();
  271. }
  272. else
  273. {
  274. List<int> targetCardIDs = new List<int>();
  275. GManager.instance.turnStateMachine.IsSelecting = true;
  276. #region Message Display
  277. if (!string.IsNullOrEmpty(_customMessage))
  278. {
  279. GManager.instance.commandText.OpenCommandText(_customMessage, _isDigiXros);
  280. }
  281. else
  282. {
  283. string message = "";
  284. switch (_mode)
  285. {
  286. case Mode.AddHand:
  287. message = "Select cards to add to your hand.";
  288. break;
  289. case Mode.Discard:
  290. message = "Select cards to trash.";
  291. break;
  292. case Mode.Custom:
  293. message = "Select cards.";
  294. break;
  295. }
  296. if (!string.IsNullOrEmpty(message))
  297. {
  298. GManager.instance.commandText.OpenCommandText(message, _isDigiXros);
  299. }
  300. }
  301. #endregion
  302. List<CardSource> RootCards = new List<CardSource>();
  303. foreach (CardSource cardSource in RootCardList())
  304. {
  305. RootCards.Add(cardSource);
  306. }
  307. #region Sort
  308. if (_root == Root.Library || _root == Root.Trash)
  309. {
  310. RootCards = DeckData.SortedCardsList(RootCards);
  311. List<CardSource> matchConditionCards = new List<CardSource>();
  312. List<CardSource> notMatchConditionCards = new List<CardSource>();
  313. foreach (CardSource cardSource in RootCards)
  314. {
  315. if (_canTargetCondition != null)
  316. {
  317. if (_canTargetCondition(cardSource))
  318. {
  319. matchConditionCards.Add(cardSource);
  320. }
  321. else
  322. {
  323. notMatchConditionCards.Add(cardSource);
  324. }
  325. }
  326. }
  327. RootCards = new List<CardSource>();
  328. foreach (CardSource cardSource in matchConditionCards)
  329. {
  330. RootCards.Add(cardSource);
  331. }
  332. foreach (CardSource cardSource in notMatchConditionCards)
  333. {
  334. RootCards.Add(cardSource);
  335. }
  336. }
  337. #endregion
  338. #region Effect in progress/waiting to be activated
  339. if (_cardEffect != null)
  340. {
  341. if (_cardEffect.EffectSourceCard != null)
  342. {
  343. if (_skillInfos.Count == 0)
  344. {
  345. if (_root == Root.Trash)
  346. {
  347. SkillInfo[] skillInfoArray = new SkillInfo[RootCards.Count];
  348. for (int i = 0; i < skillInfoArray.Length; i++)
  349. {
  350. if (0 <= i && i <= RootCards.Count - 1)
  351. {
  352. if (RootCards[i] == _cardEffect.EffectSourceCard)
  353. {
  354. ICardEffect cardEffect = new ChangeBaseDPClass();
  355. cardEffect.SetUpICardEffect("Effect Processing", null, RootCards[i]);
  356. skillInfoArray[i] = new SkillInfo(cardEffect, null, EffectTiming.None);
  357. }
  358. else
  359. {
  360. if (GManager.instance.autoProcessing.executingMultipleSkills != null)
  361. {
  362. bool isEffectWaiting(SkillInfo skillInfo)
  363. {
  364. if (skillInfo != null)
  365. {
  366. if (skillInfo.CardEffect != null)
  367. {
  368. if (skillInfo.CardEffect.EffectSourceCard != null)
  369. {
  370. if (skillInfo.CardEffect.EffectSourceCard == RootCards[i])
  371. {
  372. return true;
  373. }
  374. }
  375. }
  376. }
  377. return false;
  378. }
  379. if (GManager.instance.autoProcessing.executingMultipleSkills.StackedSkillInfos.Count(isEffectWaiting) >= 1)
  380. {
  381. ICardEffect cardEffect = new ChangeBaseDPClass();
  382. cardEffect.SetUpICardEffect("Effect Waiting", null, RootCards[i]);
  383. skillInfoArray[i] = new SkillInfo(cardEffect, null, EffectTiming.None);
  384. }
  385. }
  386. }
  387. }
  388. }
  389. _skillInfos = skillInfoArray.ToList();
  390. }
  391. }
  392. }
  393. }
  394. #endregion
  395. GManager.instance.selectCardPanel._customCountText = _customCountText;
  396. yield return StartCoroutine(GManager.instance.selectCardPanel.OpenSelectCardPanel(
  397. Message: _message,
  398. RootCardSources: RootCards,
  399. _CanTargetCondition: _canTargetCondition,
  400. _CanTargetCondition_ByPreSelecetedList: _canTargetCondition_ByPreSelecetedList,
  401. _CanEndSelectCondition: _canEndSelectCondition,
  402. _MaxCount: _maxCount,
  403. _CanEndNotMax: _canEndNotMax,
  404. _CanNoSelect: _canNoSelect,
  405. CanLookReverseCard: _canLookReverseCard,
  406. skillInfos: _skillInfos,
  407. root: _root));
  408. foreach (CardSource selectedCard in GManager.instance.selectCardPanel.SelectedList)
  409. {
  410. targetCardIDs.Add(selectedCard.CardIndex);
  411. }
  412. foreach (int selectedIndex in GManager.instance.selectCardPanel.SelectedIndex)
  413. {
  414. _slectedInexesInList.Add(selectedIndex);
  415. }
  416. photonView.RPC("SetTargetCard", RpcTarget.All, targetCardIDs.ToArray());
  417. }
  418. }
  419. else
  420. {
  421. if (!string.IsNullOrEmpty(_customMessage_Enemy))
  422. {
  423. GManager.instance.commandText.OpenCommandText(_customMessage_Enemy, _isDigiXros);
  424. }
  425. else
  426. {
  427. GManager.instance.commandText.OpenCommandText("The opponent is selecting cards.", _isDigiXros);
  428. }
  429. #region AI
  430. if (GManager.instance.IsAI)
  431. {
  432. AutoSelect();
  433. }
  434. #endregion
  435. }
  436. void AutoSelect()
  437. {
  438. List<CardSource> ValidCards = new List<CardSource>();
  439. foreach (CardSource cardSource in RootCardList())
  440. {
  441. if (_canTargetCondition(cardSource))
  442. {
  443. ValidCards.Add(cardSource);
  444. }
  445. }
  446. IList<int> indexList = Enumerable.Range(0, ValidCards.Count).ToList();
  447. if (ValidCards.Count >= _maxCount)
  448. {
  449. for (int i = 0; i < 1000; i++)
  450. {
  451. List<int> GetIndexes = indexList.GetRandom(_maxCount).ToList();
  452. List<CardSource> GetCards = new List<CardSource>();
  453. foreach (int index in GetIndexes)
  454. {
  455. GetCards.Add(ValidCards[index]);
  456. }
  457. if (_canEndSelectCondition != null)
  458. {
  459. if (!_canEndSelectCondition(GetCards))
  460. {
  461. continue;
  462. }
  463. }
  464. List<int> CardIDs = new List<int>();
  465. foreach (CardSource cardSource in GetCards)
  466. {
  467. CardIDs.Add(cardSource.CardIndex);
  468. }
  469. if (GManager.instance.IsAI)
  470. {
  471. SetTargetCard(CardIDs.ToArray());
  472. }
  473. else
  474. {
  475. photonView.RPC("SetTargetCard", RpcTarget.All, CardIDs.ToArray());
  476. }
  477. break;
  478. }
  479. }
  480. if (GManager.instance.IsAI)
  481. {
  482. _endSelect = true;
  483. }
  484. }
  485. yield return new WaitWhile(() => !_endSelect);
  486. _endSelect = false;
  487. GManager.instance.commandText.CloseCommandText();
  488. yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
  489. #region Show selected card
  490. if (_targetCards.Count > 0 && _showCard)
  491. {
  492. if (_targetCards.Count((cardSource) => cardSource.IsFlipped) > 0 && !_showReverseCard)
  493. {
  494. //表示しない
  495. }
  496. else
  497. {
  498. if (_isShowOpponent || (_selectPlayer.isYou && _targetCards.Count((cardSource) => cardSource.Owner == _selectPlayer) > 0))
  499. {
  500. if (!string.IsNullOrEmpty(_customMessage_ShowCard))
  501. {
  502. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, _customMessage_ShowCard, true, true));
  503. }
  504. else
  505. {
  506. switch (_mode)
  507. {
  508. case Mode.AddHand:
  509. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Cards added to hand", true, true));
  510. break;
  511. case Mode.Discard:
  512. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Cards put on the trash", true, true));
  513. break;
  514. case Mode.Custom:
  515. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Selected Cards", true, true));
  516. break;
  517. }
  518. }
  519. }
  520. }
  521. }
  522. #endregion
  523. Hashtable hashtable = CardEffectCommons.CardEffectHashtable(_cardEffect);
  524. string log = "";
  525. if (_mode == Mode.AddHand)
  526. {
  527. log += $"\nCard{Utils.PluralFormSuffix(_targetCards.Count)} added to hand:";
  528. }
  529. else if (_mode == Mode.AddHand)
  530. {
  531. log += $"\nTrash Card{Utils.PluralFormSuffix(_targetCards.Count)}:";
  532. }
  533. else
  534. {
  535. log += $"\nSelected Card{Utils.PluralFormSuffix(_targetCards.Count)}:";
  536. }
  537. if (_root == Root.Library)
  538. {
  539. yield return ContinuousController.instance.StartCoroutine(CardObjectController.Shuffle(_selectPlayer));
  540. }
  541. foreach (CardSource cardSource in _targetCards)
  542. {
  543. log += $"\n{cardSource.BaseENGCardNameFromEntity}({cardSource.CardID})";
  544. }
  545. switch (_mode)
  546. {
  547. case Mode.AddHand:
  548. foreach (CardSource cardSource in _targetCards)
  549. {
  550. cardSource.SetFace();
  551. if (cardSource.IsDigiEgg) yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(new List<CardSource> { cardSource }));
  552. else
  553. {
  554. if (cardSource.PermanentOfThisCard() != null)
  555. {
  556. if (cardSource.PermanentOfThisCard().DigivolutionCards.Contains(cardSource))
  557. {
  558. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().RemoveDigivolveRootEffect(cardSource, cardSource.PermanentOfThisCard()));
  559. }
  560. }
  561. handCards.Add(cardSource);
  562. }
  563. }
  564. break;
  565. case Mode.Discard:
  566. foreach (CardSource cardSource in _targetCards)
  567. {
  568. if (CardEffectCommons.IsExistOnHand(cardSource))
  569. {
  570. List<IDiscardHand> discardHands = _targetCards.Map(cardSource => new IDiscardHand(cardSource, hashtable));
  571. yield return ContinuousController.instance.StartCoroutine(new IDiscardHands(discardHands, _cardEffect).DiscardHands());
  572. }
  573. else if (CardEffectCommons.IsExistLinked(cardSource))
  574. {
  575. yield return ContinuousController.instance.StartCoroutine(cardSource.PermanentOfThisCard().RemoveLinkedCard(cardSource));
  576. }
  577. else
  578. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddTrashCard(cardSource));
  579. }
  580. break;
  581. case Mode.Custom:
  582. if (_selectCardCoroutine != null)
  583. {
  584. foreach (CardSource cardSource in _targetCards)
  585. {
  586. yield return StartCoroutine(_selectCardCoroutine(cardSource));
  587. }
  588. }
  589. break;
  590. }
  591. if (handCards.Count >= 1)
  592. {
  593. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(handCards, false, _cardEffect));
  594. }
  595. #region ログ追加
  596. if (!_notAddLog)
  597. {
  598. if (_isShowOpponent || _selectPlayer.isYou)
  599. {
  600. if (_targetCards.Count >= 1)
  601. {
  602. log += "\n";
  603. PlayLog.OnAddLog?.Invoke(log);
  604. }
  605. }
  606. }
  607. #endregion
  608. }
  609. if (_afterSelectCardCoroutine != null)
  610. {
  611. yield return StartCoroutine(_afterSelectCardCoroutine(_targetCards));
  612. }
  613. if (_afterSelectIndexCoroutine != null)
  614. {
  615. yield return StartCoroutine(_afterSelectIndexCoroutine(_slectedInexesInList));
  616. }
  617. GManager.instance.turnStateMachine.gameContext.IsSecurityLooking = false;
  618. GManager.instance.turnStateMachine.IsSelecting = oldIsSelecting;
  619. }
  620. [PunRPC]
  621. public void SetTargetCard(int[] CardIDs)
  622. {
  623. _targetCards = new List<CardSource>();
  624. foreach (int CardID in CardIDs)
  625. {
  626. _targetCards.Add(GManager.instance.turnStateMachine.gameContext.ActiveCardList[CardID]);
  627. }
  628. _endSelect = true;
  629. }
  630. }