AttackProcess.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Photon.Pun;
  5. using System;
  6. using System.Linq;
  7. using UnityEngine.UI;
  8. public class AttackProcess : MonoBehaviourPunCallbacks
  9. {
  10. public Permanent AttackingPermanent { get; private set; } = null;
  11. public Permanent DefendingPermanent { get; private set; } = null;
  12. public int AttackCount { get; set; } = 0;
  13. public bool IsAttacking { get; set; } = false;
  14. public bool HasDefender { get; set; } = false;
  15. public bool IsBlocking { get; set; } = false;
  16. public CardSource SecurityDigimon { get; set; } = null;
  17. public bool DoSecurityCheck { get; set; } = false;
  18. public bool IsEndAttack { get; set; } = false;
  19. public bool UsedBlitz { get; set; } = false;
  20. void SetAttackerDefender(Permanent attackingPermanent, Permanent defendingPermanent)
  21. {
  22. AttackingPermanent = attackingPermanent;
  23. DefendingPermanent = defendingPermanent;
  24. if (defendingPermanent != null)
  25. HasDefender = true;
  26. }
  27. public IEnumerator Attack(Permanent attackingPermanent, Permanent defendingPermanent, ICardEffect attackEffect, bool withoutTap = false, Func<IEnumerator> beforeOnAttackCoroutine = null)
  28. {
  29. if (IsAttacking)
  30. {
  31. if (beforeOnAttackCoroutine != null)
  32. {
  33. yield return ContinuousController.instance.StartCoroutine(beforeOnAttackCoroutine());
  34. }
  35. yield break;
  36. }
  37. AttackingPermanent = null;
  38. DefendingPermanent = null;
  39. DoSecurityCheck = false;
  40. IsBlocking = false;
  41. SecurityDigimon = null;
  42. IsAttacking = false;
  43. HasDefender = false;
  44. IsEndAttack = false;
  45. SetAttackerDefender(attackingPermanent, defendingPermanent);
  46. Hashtable effectHashtable = CardEffectCommons.OnAttackCheckHashtableOfPermanent(AttackingPermanent, attackEffect);
  47. Hashtable counterEffectHashtable = CardEffectCommons.OnAttackCheckHashtableOfPermanent(new Permanent(AttackingPermanent.cardSources), attackEffect);
  48. IsAttacking = true;
  49. // check timing
  50. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
  51. GManager.instance.turnStateMachine.IsSelecting = true;
  52. // force to end attack
  53. if (IsEndAttack)
  54. {
  55. goto EndAttack;
  56. }
  57. UnityEngine.Debug.Log($"ATTACK PROCESS: {AttackingPermanent}");
  58. UnityEngine.Debug.Log($"ATTACK PROCESS: {CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(AttackingPermanent)}");
  59. #region Attack Process
  60. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(AttackingPermanent))
  61. {
  62. AttackCount++;
  63. GManager.instance.turnStateMachine.IsSelecting = true;
  64. if (DefendingPermanent != null)
  65. {
  66. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent))
  67. {
  68. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  69. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  70. GManager.instance.turnStateMachine.gameContext.NonTurnPlayer.securityObject.securityBreakGlass.gameObject.SetActive(false);
  71. }
  72. }
  73. else
  74. {
  75. if (GManager.instance.turnStateMachine.gameContext.NonTurnPlayer.SecurityCards.Count >= 1)
  76. {
  77. GManager.instance.turnStateMachine.gameContext.NonTurnPlayer.securityObject.securityBreakGlass.ShowBlueMatarial();
  78. }
  79. }
  80. AttackingPermanent.ShowingPermanentCard.SetOrangeOutline();
  81. AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  82. // add log
  83. string log = $"\nAttack:\n{AttackingPermanent.TopCard.BaseENGCardNameFromEntity}({AttackingPermanent.TopCard.CardID})";
  84. if (DefendingPermanent != null)
  85. {
  86. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent))
  87. log += $"\n�«\n{DefendingPermanent.TopCard.BaseENGCardNameFromEntity}({DefendingPermanent.TopCard.CardID})\n";
  88. }
  89. else
  90. {
  91. log += $"\n�«\nSecurity\n";
  92. }
  93. PlayLog.OnAddLog?.Invoke(log);
  94. List<SkillInfo> stackedSkillInfos = new List<SkillInfo>();
  95. if (GManager.instance.autoProcessing.executingMultipleSkills != null)
  96. {
  97. if (GManager.instance.autoProcessing.executingMultipleSkills.StackedSkillInfos.Count >= 1)
  98. {
  99. foreach (SkillInfo skillInfo in GManager.instance.autoProcessing.executingMultipleSkills.StackedSkillInfos)
  100. {
  101. stackedSkillInfos.Add(skillInfo);
  102. }
  103. }
  104. foreach (SkillInfo skillInfo in stackedSkillInfos)
  105. {
  106. GManager.instance.autoProcessing.executingMultipleSkills.StackedSkillInfos.Remove(skillInfo);
  107. }
  108. }
  109. // suspend
  110. if (!withoutTap)
  111. {
  112. Hashtable attackerTapHashtable = new Hashtable()
  113. {
  114. {"IsAttack", true}
  115. };
  116. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
  117. new List<Permanent>() { AttackingPermanent },
  118. attackerTapHashtable).Tap());
  119. }
  120. // target arrow
  121. if (DefendingPermanent == null)
  122. {
  123. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent))
  124. {
  125. yield return GManager.instance.OnTargetArrow(
  126. AttackingPermanent.PermanentFrame.GetLocalCanvasPosition() + AttackingPermanent.TopCard.Owner.playerUIObjectParent.localPosition,
  127. GManager.instance.turnStateMachine.gameContext.NonTurnPlayer.SecurityAttackLocalCanvasPosition + GManager.instance.turnStateMachine.gameContext.NonTurnPlayer.playerUIObjectParent.localPosition,
  128. null,
  129. null);
  130. }
  131. }
  132. else
  133. {
  134. yield return GManager.instance.OnTargetArrow(
  135. AttackingPermanent.PermanentFrame.GetLocalCanvasPosition() + AttackingPermanent.TopCard.Owner.playerUIObjectParent.localPosition,
  136. DefendingPermanent.PermanentFrame.GetLocalCanvasPosition() + DefendingPermanent.TopCard.Owner.playerUIObjectParent.localPosition,
  137. null,
  138. null);
  139. }
  140. // activate cutin effects
  141. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.RuleProcess());
  142. //yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.TriggeredSkillProcess(true, null));
  143. // callback that is processed before [On Attack]
  144. if (beforeOnAttackCoroutine != null)
  145. {
  146. yield return ContinuousController.instance.StartCoroutine(beforeOnAttackCoroutine());
  147. }
  148. // trigger [On Attack] effect
  149. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.StackSkillInfos(
  150. effectHashtable,
  151. EffectTiming.OnAllyAttack));
  152. // activate cutin effects
  153. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.RuleProcess());
  154. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.TriggeredSkillProcess(true, null));
  155. if (stackedSkillInfos.Count >= 1)
  156. {
  157. foreach (SkillInfo skillInfo in stackedSkillInfos)
  158. {
  159. GManager.instance.autoProcessing.PutStackedSkill(skillInfo);
  160. }
  161. }
  162. GManager.instance.turnStateMachine.IsSelecting = true;
  163. if (AttackingPermanent.TopCard != null)
  164. {
  165. AttackingPermanent.ShowingPermanentCard.SetOrangeOutline();
  166. AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  167. }
  168. if (DefendingPermanent != null)
  169. {
  170. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent))
  171. {
  172. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  173. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  174. }
  175. }
  176. // check timing
  177. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
  178. //End Turn Check
  179. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.EndTurnCheck());
  180. GManager.instance.turnStateMachine.IsSelecting = true;
  181. // force to end attack
  182. if (IsEndAttack)
  183. {
  184. goto EndAttack;
  185. }
  186. if (AttackingPermanent.TopCard != null)
  187. {
  188. AttackingPermanent.ShowingPermanentCard.SetOrangeOutline();
  189. AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  190. }
  191. if (DefendingPermanent != null)
  192. {
  193. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent))
  194. {
  195. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  196. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  197. }
  198. }
  199. // trigger effects when counter timing (except [Counter] effects)
  200. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.StackSkillInfos(
  201. counterEffectHashtable,
  202. EffectTiming.OnCounterTiming,
  203. cardEffect => !cardEffect.IsCounterEffect));
  204. // activate cutin effects
  205. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.RuleProcess());
  206. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.TriggeredSkillProcess(true, null));
  207. GManager.instance.turnStateMachine.IsSelecting = true;
  208. // force to end attack
  209. if (IsEndAttack)
  210. {
  211. goto EndAttack;
  212. }
  213. // trigger effects when counter timing ([Counter] effects)
  214. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.StackSkillInfos(
  215. counterEffectHashtable,
  216. EffectTiming.OnCounterTiming,
  217. cardEffect => cardEffect.IsCounterEffect));
  218. bool HasCounterEffect(List<SkillInfo> skillInfos, SkillInfo skillInfo)
  219. {
  220. return skillInfos.Count((skillInfo1) => skillInfo1.CardEffect.IsCounterEffect) >= 1;
  221. }
  222. // activate cutin effects
  223. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.RuleProcess());
  224. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.TriggeredSkillProcess(true, HasCounterEffect));
  225. GManager.instance.turnStateMachine.IsSelecting = true;
  226. // force to end attack
  227. if (IsEndAttack)
  228. {
  229. goto EndAttack;
  230. }
  231. if (AttackingPermanent.TopCard == null)
  232. {
  233. goto EndAttack;
  234. }
  235. AttackingPermanent.ShowingPermanentCard.SetOrangeOutline();
  236. AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  237. if (DefendingPermanent != null)
  238. {
  239. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent))
  240. {
  241. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  242. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  243. }
  244. }
  245. #region select blocker
  246. bool CanSelectBlockerCondition(Permanent permanent)
  247. {
  248. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, AttackingPermanent.TopCard))
  249. {
  250. if (permanent != DefendingPermanent)
  251. {
  252. if (permanent.HasBlocker && permanent.CanBlock(AttackingPermanent))
  253. {
  254. return true;
  255. }
  256. }
  257. }
  258. return false;
  259. }
  260. if (AttackingPermanent.TopCard.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectBlockerCondition) >= 1)
  261. {
  262. int maxCount = 1;
  263. Permanent selectedPermanent = null;
  264. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  265. selectPermanentEffect.SetUp(
  266. selectPlayer: AttackingPermanent.TopCard.Owner.Enemy,
  267. canTargetCondition: CanSelectBlockerCondition,
  268. canTargetCondition_ByPreSelecetedList: null,
  269. canEndSelectCondition: null,
  270. maxCount: maxCount,
  271. canNoSelect: (!IsBlocking),
  272. canEndNotMax: false,
  273. selectPermanentCoroutine: SelectPermanentCoroutine,
  274. afterSelectPermanentCoroutine: null,
  275. mode: SelectPermanentEffect.Mode.Custom,
  276. cardEffect: null);
  277. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will block.", "The opponent is selecting 1 Digimon that will block.");
  278. if(!IsBlocking)
  279. selectPermanentEffect.SetUpCustomBackButtonMessage("Not Block");
  280. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  281. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  282. {
  283. selectedPermanent = permanent;
  284. yield return null;
  285. }
  286. if (selectedPermanent != null)
  287. {
  288. yield return ContinuousController.instance.StartCoroutine(SwitchDefender(null, true, selectedPermanent));
  289. }
  290. }
  291. #endregion
  292. GManager.instance.turnStateMachine.IsSelecting = true;
  293. //end attack
  294. if (IsEndAttack)
  295. {
  296. goto EndAttack;
  297. }
  298. if (AttackingPermanent.TopCard == null)
  299. {
  300. goto EndAttack;
  301. }
  302. AttackingPermanent.ShowingPermanentCard.SetOrangeOutline();
  303. AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  304. if (DefendingPermanent != null)
  305. {
  306. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent))
  307. {
  308. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  309. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  310. }
  311. }
  312. #region there is no Defending Permanent
  313. if (DefendingPermanent == null)
  314. {
  315. if (AttackingPermanent.Strike >= 1)
  316. {
  317. //if there is no security, end the game
  318. if (AttackingPermanent.TopCard.Owner.Enemy.SecurityCards.Count == 0)
  319. {
  320. GManager.instance.turnStateMachine.EndGame(AttackingPermanent.TopCard.Owner, false);
  321. yield break;
  322. }
  323. }
  324. DoSecurityCheck = true;
  325. }
  326. #endregion
  327. #region there is Defending Permanent
  328. else
  329. {
  330. if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent) || CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(AttackingPermanent))
  331. {
  332. goto EndAttack;
  333. }
  334. DefendingPermanent.TopCard.Owner.securityObject.securityBreakGlass.gameObject.SetActive(false);
  335. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  336. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  337. // battle
  338. IBattle battle = new IBattle(AttackingPermanent: AttackingPermanent, DefendingPermanent: DefendingPermanent, null);
  339. yield return ContinuousController.instance.StartCoroutine(battle.Battle());
  340. /*#region effect when determine whether to do security check
  341. Hashtable hashtable = new Hashtable()
  342. {
  343. {"battle", battle}
  344. };
  345. List<SkillInfo> skillInfos_Pierce = AutoProcessing.GetSkillInfos(hashtable, EffectTiming.OnDetermineDoSecurityCheck)
  346. .Filter(skillInfo => skillInfo.CardEffect != null && skillInfo.CardEffect.CanActivate(skillInfo.Hashtable));
  347. if (skillInfos_Pierce.Count >= 1)
  348. {
  349. GManager.instance.autoProcessing.PutStackedSkill(skillInfos_Pierce[0]);
  350. }
  351. #endregion*/
  352. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.TriggeredSkillProcess(true, null));
  353. GManager.instance.turnStateMachine.IsSelecting = true;
  354. }
  355. #endregion
  356. if (AttackingPermanent.TopCard == null)
  357. {
  358. goto EndAttack;
  359. }
  360. #region do security check
  361. if (DoSecurityCheck && AttackingPermanent.TopCard.Owner.Enemy.SecurityCards.Count >= 1)
  362. {
  363. //security check process
  364. yield return ContinuousController.instance.StartCoroutine(new ISecurityCheck(
  365. AttackingPermanent: AttackingPermanent,
  366. player: GManager.instance.turnStateMachine.gameContext.NonTurnPlayer).SecurityCheck());
  367. }
  368. #endregion
  369. }
  370. else
  371. {
  372. if (beforeOnAttackCoroutine != null)
  373. {
  374. yield return ContinuousController.instance.StartCoroutine(beforeOnAttackCoroutine());
  375. }
  376. }
  377. #endregion
  378. #region End Attack
  379. EndAttack:;
  380. // [On End Attack] effect
  381. if (AttackingPermanent != null && AttackingPermanent.TopCard != null)
  382. {
  383. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(effectHashtable, EffectTiming.OnEndAttack));
  384. }
  385. #region reset effects which continues until the end of attack
  386. foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
  387. {
  388. foreach (Permanent permanent in player.GetFieldPermanents())
  389. {
  390. permanent.UntilEndAttackEffects = new List<Func<EffectTiming, ICardEffect>>();
  391. }
  392. }
  393. #endregion
  394. GManager.instance.turnStateMachine.IsSelecting = true;
  395. #endregion
  396. DoSecurityCheck = false;
  397. IsBlocking = false;
  398. SecurityDigimon = null;
  399. IsAttacking = false;
  400. IsEndAttack = false;
  401. }
  402. public IEnumerator SwitchDefender(ICardEffect cardEffect, bool isBlock, Permanent newDefendingPermanent)
  403. {
  404. if (AttackingPermanent == null) yield break;
  405. if (AttackingPermanent.TopCard == null) yield break;
  406. if (newDefendingPermanent != null && newDefendingPermanent.TopCard == null) yield break;
  407. if (!AttackingPermanent.CanSwitchAttackTarget) yield break;
  408. Permanent oldDefendingPermanent = DefendingPermanent;
  409. DefendingPermanent = newDefendingPermanent;
  410. IsBlocking = isBlock;
  411. if (DefendingPermanent != null)
  412. {
  413. if (DefendingPermanent.ShowingPermanentCard != null)
  414. {
  415. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  416. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  417. }
  418. }
  419. Hashtable hashtable = new Hashtable(){
  420. {"AttackingPermanent", AttackingPermanent},
  421. {"DefendingPermanent", DefendingPermanent},
  422. {"CardEffect", cardEffect}
  423. };
  424. if (isBlock)
  425. {
  426. hashtable.Add("IsBlock", isBlock);
  427. }
  428. if (isBlock)
  429. {
  430. if (DefendingPermanent != null)
  431. {
  432. // add log
  433. string log1 = $"\nBlock:\n{DefendingPermanent.TopCard.BaseENGCardNameFromEntity}({DefendingPermanent.TopCard.CardID})\n";
  434. PlayLog.OnAddLog?.Invoke(log1);
  435. // suspend
  436. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { DefendingPermanent }, hashtable).Tap());
  437. // the effects when blocking
  438. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(
  439. hashtable,
  440. EffectTiming.OnBlockAnyone));
  441. }
  442. }
  443. if (AttackingPermanent != null)
  444. {
  445. if (AttackingPermanent.TopCard == null)
  446. {
  447. IsBlocking = false;
  448. yield break;
  449. }
  450. }
  451. if (DefendingPermanent != null)
  452. {
  453. if (DefendingPermanent.TopCard == null)
  454. {
  455. IsBlocking = false;
  456. yield break;
  457. }
  458. }
  459. if (AttackingPermanent != null)
  460. {
  461. // target arrow
  462. for (int i = 0; i < 3; i++)
  463. {
  464. GManager.instance.OffTargetArrow();
  465. yield return null;
  466. }
  467. if (DefendingPermanent != null)
  468. {
  469. DefendingPermanent.ShowingPermanentCard.SetOrangeOutline();
  470. DefendingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  471. yield return GManager.instance.OnTargetArrow(
  472. AttackingPermanent.PermanentFrame.GetLocalCanvasPosition() + AttackingPermanent.TopCard.Owner.playerUIObjectParent.localPosition,
  473. DefendingPermanent.PermanentFrame.GetLocalCanvasPosition() + DefendingPermanent.TopCard.Owner.playerUIObjectParent.localPosition,
  474. null,
  475. null);
  476. }
  477. else
  478. {
  479. yield return GManager.instance.OnTargetArrow(
  480. AttackingPermanent.PermanentFrame.GetLocalCanvasPosition() + AttackingPermanent.TopCard.Owner.playerUIObjectParent.localPosition,
  481. GManager.instance.turnStateMachine.gameContext.NonTurnPlayer.SecurityAttackLocalCanvasPosition + GManager.instance.turnStateMachine.gameContext.NonTurnPlayer.playerUIObjectParent.localPosition,
  482. null,
  483. null);
  484. }
  485. AttackingPermanent.ShowingPermanentCard.SetOrangeOutline();
  486. AttackingPermanent.ShowingPermanentCard.Outline_Select.gameObject.SetActive(true);
  487. }
  488. if (newDefendingPermanent != oldDefendingPermanent)
  489. {
  490. // the effects when attack target switched
  491. yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(
  492. hashtable,
  493. EffectTiming.OnAttackTargetChanged));
  494. }
  495. }
  496. }