SelectCardEffect.cs 27 KB

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