SelectHandEffect.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using Photon.Pun;
  7. using System;
  8. public class SelectHandEffect : MonoBehaviourPunCallbacks
  9. {
  10. public void SetUp(
  11. Player selectPlayer,
  12. Func<CardSource, bool> canTargetCondition,
  13. Func<List<CardSource>, CardSource, bool> canTargetCondition_ByPreSelecetedList,
  14. Func<List<CardSource>, bool> canEndSelectCondition,
  15. int maxCount,
  16. bool canNoSelect,
  17. bool canEndNotMax,
  18. bool isShowOpponent,
  19. Func<CardSource, IEnumerator> selectCardCoroutine,
  20. Func<List<CardSource>, IEnumerator> afterSelectCardCoroutine,
  21. Mode mode,
  22. ICardEffect cardEffect)
  23. {
  24. _selectPlayer = selectPlayer;
  25. _canTargetCondition = canTargetCondition;
  26. _canTargetCondition_ByPreSelecetedList = canTargetCondition_ByPreSelecetedList;
  27. _canEndSelectCondition = canEndSelectCondition;
  28. _maxCount = maxCount;
  29. _canNoSelect = canNoSelect;
  30. _canEndNotMax = canEndNotMax;
  31. _isShowOpponent = isShowOpponent;
  32. _selectCardCoroutine = selectCardCoroutine;
  33. _afterSelectCardCoroutine = afterSelectCardCoroutine;
  34. _mode = mode;
  35. _cardEffect = cardEffect;
  36. _showCard = true;
  37. _digiXros = false;
  38. _customMessage_ShowCard = null;
  39. _customMessage = "";
  40. _customMessage_Enemy = "";
  41. _showOpponentMessage = true;
  42. _isLocal = false;
  43. _isFaceUp = false;
  44. }
  45. public void SetIsLocal()
  46. {
  47. _isLocal = true;
  48. }
  49. public void SetNotShowCard()
  50. {
  51. _showCard = false;
  52. }
  53. public void SetDigiXros()
  54. {
  55. _digiXros = true;
  56. }
  57. public void SetIsFaceup()
  58. {
  59. _isFaceUp = true;
  60. }
  61. public void SetReducedCostTuple((int reduceCost, Func<CardSource, bool> reduceCostCardCondition)? reduceCostTuple)
  62. {
  63. _reduceCostTuple = reduceCostTuple;
  64. }
  65. public void SetFixedCostTuple((int fixedCost, Func<CardSource, bool> fixedCostCardCondition)? fixedCostTuple)
  66. {
  67. _fixedCostTuple = fixedCostTuple;
  68. }
  69. public void SetUpCustomMessage_ShowCard(string CustomMessage_ShowCard)
  70. {
  71. _customMessage_ShowCard = CustomMessage_ShowCard;
  72. }
  73. public void SetUpCustomMessage(string CustomMessage, string CustomMessage_Enemy)
  74. {
  75. _customMessage = CustomMessage;
  76. _customMessage_Enemy = CustomMessage_Enemy;
  77. }
  78. public void SetNotShowOpponentMessage()
  79. {
  80. _showOpponentMessage = false;
  81. }
  82. //The player who selects the hand
  83. Player _selectPlayer;
  84. //Conditions of the cards that can be selected
  85. Func<CardSource, bool> _canTargetCondition = null;
  86. //Whether the card can be selected with the current selection list status
  87. Func<List<CardSource>, CardSource, bool> _canTargetCondition_ByPreSelecetedList = null;
  88. //Conditions under which a selection can be terminated (see list of selection termination points)
  89. Func<List<CardSource>, bool> _canEndSelectCondition = null;
  90. //Maximum number of sheets to be selected
  91. int _maxCount = 0;
  92. //Whether you can choose not to choose
  93. bool _canNoSelect = false;
  94. //Whether you can finish your selection with less than the maximum number
  95. bool _canEndNotMax = false;
  96. //Whether or not to show it to the other player
  97. bool _isShowOpponent = false;
  98. //(Limited to Mode.Custom) Processing to be performed by selecting
  99. Func<CardSource, IEnumerator> _selectCardCoroutine = null;
  100. //Processing to be done after selection
  101. Func<List<CardSource>, IEnumerator> _afterSelectCardCoroutine = null;
  102. //Classification of processing to be done by selection
  103. Mode _mode = Mode.Custom;
  104. //Skill in making card selections
  105. ICardEffect _cardEffect;
  106. bool _showCard = true;
  107. bool _digiXros = false;
  108. bool _isLocal = false;
  109. bool _isFaceUp = false;
  110. (int reduceCost, Func<CardSource, bool> reduceCostCardCondition)? _reduceCostTuple = null;
  111. (int fixedCost, Func<CardSource, bool> fixedCostCardCondition)? _fixedCostTuple = null;
  112. public enum Mode
  113. {
  114. Discard,
  115. PutLibraryTop,
  116. PutLibraryBottom,
  117. PutSecurityBottom,
  118. Custom
  119. }
  120. //Selected Hand Card List
  121. List<CardSource> _targetCards = new List<CardSource>();
  122. //No Selection Flag
  123. bool _noSelect = false;
  124. string _customMessage_ShowCard = null;
  125. string _customMessage = null;
  126. string _customMessage_Enemy = null;
  127. bool _showOpponentMessage = true;
  128. #region Whether choice is possible
  129. public bool active()
  130. {
  131. if (_maxCount <= 0) return false;
  132. if (_selectPlayer != null)
  133. {
  134. if (_selectPlayer.HandCards.Count((cardSource) => _canTargetCondition(cardSource)) > 0)
  135. {
  136. return true;
  137. }
  138. }
  139. return false;
  140. }
  141. #endregion
  142. public virtual IEnumerator Activate()
  143. {
  144. bool oldIsSelecting = GManager.instance.turnStateMachine.IsSelecting;
  145. List<PlayPermanentClass> playCharas = new List<PlayPermanentClass>();
  146. List<IDiscardHand> discardHands = new List<IDiscardHand>();
  147. List<CardSource> putClockCards = new List<CardSource>();
  148. _noSelect = false;
  149. if (active())
  150. {
  151. if (_maxCount == 0)
  152. {
  153. _canNoSelect = true;
  154. }
  155. _targetCards = new List<CardSource>();
  156. foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
  157. {
  158. GManager.instance.turnStateMachine.OffFieldCardTarget(player);
  159. GManager.instance.turnStateMachine.OffHandCardTarget(player);
  160. }
  161. if (_selectPlayer.isYou)
  162. {
  163. GManager.instance.sideBar.SetUpSideBar();
  164. GManager.instance.turnStateMachine.IsSelecting = true;
  165. #region Message Display
  166. if (!string.IsNullOrEmpty(_customMessage))
  167. {
  168. GManager.instance.commandText.OpenCommandText(_customMessage, _digiXros);
  169. }
  170. else
  171. {
  172. string message = "";
  173. switch (_mode)
  174. {
  175. case Mode.Discard:
  176. message = "Select cards to discard.";
  177. break;
  178. case Mode.PutLibraryTop:
  179. message = "Select cards to put on top of the deck.";
  180. break;
  181. case Mode.PutLibraryBottom:
  182. if (_maxCount >= 2)
  183. {
  184. message = "Select cards to put on bottom of the deck\n(cards will be placed back to the bottom of the deck so that cards with lower numbers are on top).";
  185. }
  186. else
  187. {
  188. message = "Select cards to put on bottom of the deck.";
  189. }
  190. break;
  191. case Mode.PutSecurityBottom:
  192. string str = _isFaceUp ? "faceup" : "facedown";
  193. message = $"Select card(s) to put on bottom of the security {str}.";
  194. break;
  195. case Mode.Custom:
  196. message = "Select cards in your hand.";
  197. break;
  198. }
  199. if (!string.IsNullOrEmpty(message))
  200. {
  201. GManager.instance.commandText.OpenCommandText(message, _digiXros);
  202. }
  203. }
  204. #endregion
  205. List<CardSource> PreSelectedHandCards = new List<CardSource>();
  206. foreach (HandCard handCard in _selectPlayer.HandCardObjects)
  207. {
  208. if (handCard != null)
  209. {
  210. if (_canTargetCondition(handCard.cardSource))
  211. {
  212. handCard.AddClickTarget(OnClickHandCard);
  213. }
  214. }
  215. }
  216. CheckEndSelect();
  217. #region Processing when a card in the hand is clicked
  218. void OnClickHandCard(HandCard handCard)
  219. {
  220. if (PreSelectedHandCards.Contains(handCard.cardSource))
  221. {
  222. PreSelectedHandCards.Remove(handCard.cardSource);
  223. }
  224. else
  225. {
  226. if (_canTargetCondition_ByPreSelecetedList != null)
  227. {
  228. List<CardSource> _PreSelectedList = new List<CardSource>();
  229. for (int i = 0; i < PreSelectedHandCards.Count; i++)
  230. {
  231. if (PreSelectedHandCards.Count >= _maxCount && i == PreSelectedHandCards.Count - 1)
  232. {
  233. continue;
  234. }
  235. _PreSelectedList.Add(PreSelectedHandCards[i]);
  236. }
  237. if (!_canTargetCondition_ByPreSelecetedList(_PreSelectedList, handCard.cardSource))
  238. {
  239. return;
  240. }
  241. }
  242. if (PreSelectedHandCards.Count < _maxCount)
  243. {
  244. PreSelectedHandCards.Add(handCard.cardSource);
  245. }
  246. else
  247. {
  248. if (PreSelectedHandCards.Count > 0)
  249. {
  250. PreSelectedHandCards.RemoveAt(PreSelectedHandCards.Count - 1);
  251. PreSelectedHandCards.Add(handCard.cardSource);
  252. }
  253. }
  254. if (!ContinuousController.instance.checkBeforeEndingSelection
  255. && !_canNoSelect
  256. && !_canEndNotMax
  257. && _maxCount == PreSelectedHandCards.Count)
  258. {
  259. EndSelect_RPC();
  260. return;
  261. }
  262. }
  263. CheckEndSelect();
  264. }
  265. #endregion
  266. void EndSelect_RPC()
  267. {
  268. foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
  269. {
  270. foreach (Permanent permanent in player.GetFieldPermanents())
  271. {
  272. permanent.ShowingPermanentCard.RemoveSelectEffect();
  273. permanent.ShowingPermanentCard.RemoveClickTarget();
  274. }
  275. foreach (HandCard handCard in player.HandCardObjects)
  276. {
  277. if (handCard != null)
  278. {
  279. handCard.RemoveClickTarget();
  280. handCard.RemoveSelectEffect();
  281. }
  282. }
  283. }
  284. List<int> CardIDs = new List<int>();
  285. foreach (CardSource cardSource in PreSelectedHandCards)
  286. {
  287. CardIDs.Add(cardSource.CardIndex);
  288. }
  289. if (!_isLocal)
  290. {
  291. photonView.RPC("SetTargetHandCards", RpcTarget.All, _selectPlayer.PlayerID, CardIDs.ToArray());
  292. }
  293. else
  294. {
  295. SetTargetHandCards(_selectPlayer.PlayerID, CardIDs.ToArray());
  296. }
  297. GManager.instance.BackButton.CloseSelectCommandButton();
  298. }
  299. #region Determines if selection can be terminated and displays UI
  300. void CheckEndSelect()
  301. {
  302. #region UI display depending on whether it can be terminated
  303. if (CanEndSelect(PreSelectedHandCards))
  304. {
  305. GManager.instance.selectCommandPanel.SetUpCommandButton(
  306. new List<Command_SelectCommand>()
  307. {
  308. new Command_SelectCommand("End Selection", EndSelect_RPC, 0)
  309. });
  310. }
  311. else
  312. {
  313. GManager.instance.selectCommandPanel.Off(false);
  314. GManager.instance.sideBar.SetUpSideBar();
  315. }
  316. #endregion
  317. #region Card UI display by selection list
  318. foreach (CardSource cardSource in _selectPlayer.HandCards)
  319. {
  320. if (cardSource.ShowingHandCard != null)
  321. {
  322. cardSource.ShowingHandCard.RemoveSelectEffect();
  323. cardSource.ShowingHandCard.OffSelectedIndexText();
  324. if (_canTargetCondition(cardSource))
  325. {
  326. if (PreSelectedHandCards.Contains(cardSource))
  327. {
  328. cardSource.ShowingHandCard.OnSelect();
  329. cardSource.ShowingHandCard.SetOrangeOutline();
  330. cardSource.ShowingHandCard.SetSelectedIndexText(PreSelectedHandCards.IndexOf(cardSource) + 1);
  331. }
  332. else
  333. {
  334. cardSource.ShowingHandCard.OnSelect();
  335. cardSource.ShowingHandCard.SetBlueOutline();
  336. if (_canTargetCondition_ByPreSelecetedList != null)
  337. {
  338. List<CardSource> _PreSelectedList = new List<CardSource>();
  339. for (int i = 0; i < PreSelectedHandCards.Count; i++)
  340. {
  341. if (PreSelectedHandCards.Count >= _maxCount && i == PreSelectedHandCards.Count - 1)
  342. {
  343. continue;
  344. }
  345. _PreSelectedList.Add(PreSelectedHandCards[i]);
  346. }
  347. if (!_canTargetCondition_ByPreSelecetedList(_PreSelectedList, cardSource))
  348. {
  349. cardSource.ShowingHandCard.RemoveSelectEffect();
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. #endregion
  357. if (PreSelectedHandCards.Count >= 1)
  358. {
  359. GManager.instance.BackButton.CloseSelectCommandButton();
  360. }
  361. else
  362. {
  363. if (_canNoSelect)
  364. {
  365. GManager.instance.BackButton.OpenSelectCommandButton("No Selection", () => NoSelect_RPC(), 0);
  366. void NoSelect_RPC()
  367. {
  368. if (!_isLocal)
  369. {
  370. photonView.RPC("SetTargetHandCards", RpcTarget.All, _selectPlayer.PlayerID, null);
  371. }
  372. else
  373. {
  374. SetTargetHandCards(_selectPlayer.PlayerID, null);
  375. }
  376. }
  377. }
  378. }
  379. }
  380. #endregion
  381. }
  382. else
  383. {
  384. #region Message Display
  385. if (_showOpponentMessage)
  386. {
  387. if (!string.IsNullOrEmpty(_customMessage_Enemy))
  388. {
  389. GManager.instance.commandText.OpenCommandText(_customMessage_Enemy, _digiXros);
  390. }
  391. else
  392. {
  393. GManager.instance.commandText.OpenCommandText("The opponent is selecting cards.", _digiXros);
  394. }
  395. }
  396. #endregion
  397. #region AI
  398. if (GManager.instance.IsAI)
  399. {
  400. List<CardSource> ValidCards = new List<CardSource>();
  401. foreach (CardSource cardSource in _selectPlayer.HandCards)
  402. {
  403. if (_canTargetCondition(cardSource))
  404. {
  405. ValidCards.Add(cardSource);
  406. }
  407. }
  408. if (_canEndNotMax)
  409. {
  410. _noSelect = true;
  411. for (int maxCount = 0; maxCount < _maxCount; maxCount++)
  412. {
  413. IList<int> indexList = Enumerable.Range(0, ValidCards.Count).ToList();
  414. List<int> CardIDs = null;
  415. if (ValidCards.Count >= maxCount)
  416. {
  417. for (int i = 0; i < 1000; i++)
  418. {
  419. List<int> GetIndexes = indexList.GetRandom(maxCount).ToList();
  420. List<CardSource> GetCards = new List<CardSource>();
  421. foreach (int index in GetIndexes)
  422. {
  423. GetCards.Add(ValidCards[index]);
  424. }
  425. if (CanEndSelect(GetCards))
  426. {
  427. CardIDs = new List<int>();
  428. foreach (CardSource cardSource in GetCards)
  429. {
  430. CardIDs.Add(cardSource.CardIndex);
  431. }
  432. break;
  433. }
  434. }
  435. }
  436. SetTargetHandCards(_selectPlayer.PlayerID, CardIDs != null ? CardIDs.ToArray() : null);
  437. }
  438. }
  439. else
  440. {
  441. IList<int> indexList = Enumerable.Range(0, ValidCards.Count).ToList();
  442. List<int> CardIDs = null;
  443. if (ValidCards.Count >= _maxCount)
  444. {
  445. for (int i = 0; i < 1000; i++)
  446. {
  447. List<int> GetIndexes = indexList.GetRandom(_maxCount).ToList();
  448. List<CardSource> GetCards = new List<CardSource>();
  449. foreach (int index in GetIndexes)
  450. {
  451. GetCards.Add(ValidCards[index]);
  452. }
  453. if (CanEndSelect(GetCards))
  454. {
  455. CardIDs = new List<int>();
  456. foreach (CardSource cardSource in GetCards)
  457. {
  458. CardIDs.Add(cardSource.CardIndex);
  459. }
  460. break;
  461. }
  462. }
  463. }
  464. SetTargetHandCards(_selectPlayer.PlayerID, CardIDs != null ? CardIDs.ToArray() : null);
  465. }
  466. }
  467. #endregion
  468. }
  469. #region Determine if you can exit
  470. bool CanEndSelect(List<CardSource> PreSelectedHandCards)
  471. {
  472. //If the number of cards does not meet the requirements
  473. if (!(PreSelectedHandCards.Count == _maxCount || (PreSelectedHandCards.Count <= _maxCount && _canEndNotMax)))
  474. {
  475. return false;
  476. }
  477. //Failure to meet specified conditions
  478. if (_canEndSelectCondition != null)
  479. {
  480. if (!_canEndSelectCondition(PreSelectedHandCards))
  481. {
  482. return false;
  483. }
  484. }
  485. return true;
  486. }
  487. #endregion
  488. //Wait for selection to be completed
  489. yield return new WaitUntil(() => _selectPlayer.HasPlayerSelection());
  490. CardSelection cardSeletion = _selectPlayer.DequeuePlayerSelection<CardSelection>();
  491. _targetCards = new List<CardSource>();
  492. if (cardSeletion != null)
  493. {
  494. _noSelect = cardSeletion.CardIDList == null;
  495. if (!_noSelect)
  496. {
  497. foreach (int CardID in cardSeletion.CardIDList)
  498. {
  499. _targetCards.Add(GManager.instance.turnStateMachine.gameContext.ActiveCardList[CardID]);
  500. }
  501. }
  502. else
  503. {
  504. GManager.instance.selectCommandPanel.CloseSelectCommandPanel();
  505. }
  506. }
  507. #region Reset
  508. foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players)
  509. {
  510. GManager.instance.turnStateMachine.OffFieldCardTarget(player);
  511. GManager.instance.turnStateMachine.OffHandCardTarget(player);
  512. foreach (Permanent chara in player.GetFieldPermanents())
  513. {
  514. chara.ShowingPermanentCard.RemoveSelectEffect();
  515. }
  516. foreach (HandCard handCard in player.HandCardObjects)
  517. {
  518. if (handCard != null)
  519. {
  520. handCard.RemoveClickTarget();
  521. handCard.RemoveSelectEffect();
  522. handCard.OffSelectedIndexText();
  523. }
  524. }
  525. }
  526. GManager.instance.commandText.CloseCommandText();
  527. yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
  528. GManager.instance.sideBar.OffSideBar();
  529. #endregion
  530. if (!_noSelect)
  531. {
  532. #region Show selected cards
  533. if (_targetCards.Count > 0 && _showCard)
  534. {
  535. if (_isShowOpponent || _selectPlayer.isYou)
  536. {
  537. if (!string.IsNullOrEmpty(_customMessage_ShowCard))
  538. {
  539. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, _customMessage_ShowCard, true, true));
  540. }
  541. else
  542. {
  543. switch (_mode)
  544. {
  545. case Mode.Discard:
  546. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Discarded cards", true, true));
  547. break;
  548. case Mode.PutLibraryTop:
  549. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Cards put on top of deck", true, true));
  550. break;
  551. case Mode.PutLibraryBottom:
  552. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Cards put on bottom of deck", true, true));
  553. break;
  554. case Mode.PutSecurityBottom:
  555. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Cards put on bottom of security", _isFaceUp, true));
  556. break;
  557. case Mode.Custom:
  558. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Selected cards", true, true));
  559. break;
  560. }
  561. }
  562. }
  563. }
  564. #endregion
  565. Hashtable hashtable = new Hashtable();
  566. if (_cardEffect != null)
  567. {
  568. hashtable.Add("CardEffect", _cardEffect);
  569. }
  570. string log = "";
  571. log += $"\nSelected Hand Card:";
  572. #region Processes the selected card
  573. foreach (CardSource cardSource in _targetCards)
  574. {
  575. log += $"\n{cardSource.BaseENGCardNameFromEntity}({cardSource.CardID})";
  576. if(_selectCardCoroutine != null)
  577. yield return StartCoroutine(_selectCardCoroutine(cardSource));
  578. }
  579. switch (_mode)
  580. {
  581. case Mode.Discard:
  582. discardHands = _targetCards.Map(cardSource => new IDiscardHand(cardSource, hashtable));
  583. break;
  584. case Mode.PutLibraryTop:
  585. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryTopCards(_targetCards));
  586. break;
  587. case Mode.PutLibraryBottom:
  588. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(_targetCards));
  589. break;
  590. case Mode.PutSecurityBottom:
  591. foreach (CardSource cardSource in _targetCards)
  592. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(cardSource,false, _isFaceUp));
  593. break;
  594. }
  595. #endregion
  596. if (discardHands.Count > 0)
  597. {
  598. yield return ContinuousController.instance.StartCoroutine(new IDiscardHands(discardHands, _cardEffect).DiscardHands());
  599. }
  600. #region ���O�lj�
  601. if (_isShowOpponent || _selectPlayer.isYou)
  602. {
  603. if (_targetCards.Count >= 1)
  604. {
  605. log += "\n";
  606. PlayLog.OnAddLog?.Invoke(log);
  607. }
  608. }
  609. #endregion
  610. }
  611. if (_afterSelectCardCoroutine != null)
  612. {
  613. yield return StartCoroutine(_afterSelectCardCoroutine(_targetCards));
  614. }
  615. }
  616. GManager.instance.turnStateMachine.IsSelecting = oldIsSelecting;
  617. }
  618. #region ƒJ[ƒh‘I‘ð‚ðŒˆ’è
  619. [PunRPC]
  620. public void SetTargetHandCards(int playerID, int[] CardIDs)
  621. {
  622. Player selectionPlayer = GManager.instance.GetPlayerFromID(playerID);
  623. if (selectionPlayer == null)
  624. {
  625. return;
  626. }
  627. selectionPlayer.QueuePlayerSelection(new CardSelection(CardIDs));
  628. }
  629. #endregion
  630. }