|
|
@@ -2,13 +2,14 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
using System.Linq;
|
|
|
-using Photon;
|
|
|
using Photon.Pun;
|
|
|
using System;
|
|
|
-using UnityEngine.Events;
|
|
|
|
|
|
public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
{
|
|
|
+ private static WaitForSeconds _waitForSeconds0_4 = new WaitForSeconds(0.4f);
|
|
|
+ private static WaitForSeconds _waitForSeconds0_3 = new WaitForSeconds(0.3f);
|
|
|
+
|
|
|
public List<CardSource> selectedDigicrossCards { get; private set; } = new List<CardSource>();
|
|
|
public List<AddDigivolutionCardsInfo> addDigivolutionCardInfos { get; private set; } = new List<AddDigivolutionCardsInfo>();
|
|
|
public List<CardSource> excludedCards { get; private set; } = new List<CardSource>();
|
|
|
@@ -387,8 +388,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
|
|
|
if (_endSelectDigiXros)
|
|
|
{
|
|
|
- _endSelectDigiXros = false;
|
|
|
- //break; TODO: Removed for not triggering digixros in all situations
|
|
|
+ _endSelectDigiXros = false;//Reset here in case of leftover from previous digixros
|
|
|
}
|
|
|
|
|
|
bool canSelectHand = false;
|
|
|
@@ -425,11 +425,11 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Func<IEnumerator> _SelectHandCard = () => SelectHandCard(digiXrosCondition, element, card);
|
|
|
- Func<IEnumerator> _SelectBattleAreaDigimon = () => SelectBattleAreaPermanent(digiXrosCondition, element, card);
|
|
|
- Func<IEnumerator> _SelectTrashCard = () => SelectTrashCard(digiXrosCondition, element, card);
|
|
|
- Func<IEnumerator> _SelectTamerDigivolutionCard = () => SelectTamerDigivolutionCard(digiXrosCondition, element, card);
|
|
|
- Func<IEnumerator> _EndSelectDigiXros = () => EndSelectDigiXros();
|
|
|
+ IEnumerator _SelectHandCard() => SelectHandCard(digiXrosCondition, element, card);
|
|
|
+ IEnumerator _SelectBattleAreaDigimon() => SelectBattleAreaPermanent(digiXrosCondition, element, card);
|
|
|
+ IEnumerator _SelectTrashCard() => SelectTrashCard(digiXrosCondition, element, card);
|
|
|
+ IEnumerator _SelectTamerDigivolutionCard() => SelectTamerDigivolutionCard(digiXrosCondition, element, card);
|
|
|
+ IEnumerator _EndSelectDigiXros() => EndSelectDigiXros();
|
|
|
|
|
|
List<Func<IEnumerator>> actions = new List<Func<IEnumerator>>() { _SelectHandCard, _SelectBattleAreaDigimon, _SelectTrashCard, _SelectTamerDigivolutionCard, _EndSelectDigiXros };
|
|
|
|
|
|
@@ -470,7 +470,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- else if (canSelectActions.Count == 2 && digiXrosCondition.CanTargetCondition_ByPreSelecetedList == null && !element.skipAllIfNoSelect)
|
|
|
+ else if (canSelectActions.Count == 2 && !element.skipAllIfNoSelect)
|
|
|
{
|
|
|
SetTargetDigiXrossIndex(card.Owner.PlayerID, actions.IndexOf(canSelectActions[0]));
|
|
|
}
|
|
|
@@ -554,9 +554,14 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
{
|
|
|
yield return ContinuousController.instance.StartCoroutine(actions[_targetIndex]());
|
|
|
|
|
|
+ if (_endSelectDigiXros)
|
|
|
+ {
|
|
|
+ break;//Perform here where the value will only just have been set by the above routine
|
|
|
+ }
|
|
|
+
|
|
|
if (!card.Owner.isYou && GManager.instance.IsAI)
|
|
|
{
|
|
|
- yield return new WaitForSeconds(0.3f);
|
|
|
+ yield return _waitForSeconds0_3;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -565,7 +570,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
|
|
|
if (selectedDigicrossCards.Count >= 1)
|
|
|
{
|
|
|
- yield return new WaitForSeconds(0.4f);
|
|
|
+ yield return _waitForSeconds0_4;
|
|
|
}
|
|
|
|
|
|
GManager.instance.GetComponent<Effects>().OffShowCard2();
|
|
|
@@ -619,7 +624,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
{
|
|
|
if (digiXrosCondition.CanTargetCondition_ByPreSelecetedList != null || element.skipAllIfNoSelect)
|
|
|
{
|
|
|
- EndSelectDigiXros();
|
|
|
+ StartCoroutine(EndSelectDigiXros());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -677,7 +682,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
{
|
|
|
if (digiXrosCondition.CanTargetCondition_ByPreSelecetedList != null || element.skipAllIfNoSelect)
|
|
|
{
|
|
|
- EndSelectDigiXros();
|
|
|
+ StartCoroutine(EndSelectDigiXros());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -739,7 +744,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
{
|
|
|
if (digiXrosCondition.CanTargetCondition_ByPreSelecetedList != null || element.skipAllIfNoSelect)
|
|
|
{
|
|
|
- EndSelectDigiXros();
|
|
|
+ StartCoroutine(EndSelectDigiXros());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -794,7 +799,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
{
|
|
|
if (digiXrosCondition.CanTargetCondition_ByPreSelecetedList != null || element.skipAllIfNoSelect)
|
|
|
{
|
|
|
- EndSelectDigiXros();
|
|
|
+ StartCoroutine(EndSelectDigiXros());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -859,7 +864,7 @@ public class SelectDigiXrosClass : MonoBehaviourPunCallbacks
|
|
|
{
|
|
|
if (digiXrosCondition.CanTargetCondition_ByPreSelecetedList != null || element.skipAllIfNoSelect)
|
|
|
{
|
|
|
- EndSelectDigiXros();
|
|
|
+ StartCoroutine(EndSelectDigiXros());
|
|
|
}
|
|
|
}
|
|
|
}
|