Commit c2f6d2fe authored by SherryChaos's avatar SherryChaos

bug fix

parent e4cecdb1
......@@ -966,18 +966,22 @@ namespace MDPro3.Duel
{
card.effects.Clear();
card.ClearButtons();
if ((card.p.location & (uint)CardLocation.Deck) > 0)
if (card.forSelect)
{
if (deckReserved)
card.forSelect = false;
if (card.p.InLocation(CardLocation.Deck))
{
if (card.p.controller == 0 && card.p.sequence != myMaxDeck - 1)
card.EraseData();
if (card.p.controller == 1 && card.p.sequence != opMaxDeck - 1)
if (deckReserved)
{
if (card.p.controller == 0 && card.p.sequence != myMaxDeck - 1)
card.EraseData();
if (card.p.controller == 1 && card.p.sequence != opMaxDeck - 1)
card.EraseData();
}
else
{
card.EraseData();
}
else
{
card.EraseData();
}
}
}
}
......@@ -1689,15 +1693,14 @@ namespace MDPro3.Duel
// 闪刀起动-交闪
else if (code == 63166095 || code == 63166096)
{
int code2 = 0;
nextMoveActionDuration = 2.2f + 5f;
nextMoveAction = () =>
nextMoveNeedCode = true;
nextMoveAction = (code2) =>
{
effect = GetCardEffectPrefab(code == 63166095 ? "Ef13671" : "Ef03434");
var manager = effect.GetComponent<ElementObjectManager>();
nextMoveManager = manager;
var renderer = manager.GetElement<Renderer>("SummonPosDummy");
code2 = Program.instance.ocgcore.GetNextConfirmedCardCode();
_ = Program.instance.texture_.LoadCardToRendererWithMaterialAsync(renderer, code2, true);
UnityEngine.Object.Destroy(effect, 2.2f);
};
......@@ -1709,7 +1712,6 @@ namespace MDPro3.Duel
var target = nextMoveManager.GetElement<Transform>("DummyCard01");
var card = lastMoveCard;
card.SetCode(code2);
card.model.SetActive(true);
card.ResetModelRotation();
card.model.transform.position = target.position;
......
......@@ -830,15 +830,18 @@ namespace Percy
int cs = raw[10];
int cp = raw[11];
//if (!Convert.ToBoolean(cl & ((int)CardLocation.Grave + (int)CardLocation.Overlay)) &&
// Convert.ToBoolean(cl & ((int)CardLocation.Deck + (int)CardLocation.Hand))
// || Convert.ToBoolean(cp & (int)CardPosition.FaceDown))
//{
// raw[0] = 0;
// raw[1] = 0;
// raw[2] = 0;
// raw[3] = 0;
//}
if (!OcgCore.nextMoveNeedCode)
{
if (!Convert.ToBoolean(cl & ((int)CardLocation.Grave + (int)CardLocation.Overlay)) &&
Convert.ToBoolean(cl & ((int)CardLocation.Deck + (int)CardLocation.Hand))
|| Convert.ToBoolean(cp & (int)CardPosition.FaceDown))
{
raw[0] = 0;
raw[1] = 0;
raw[2] = 0;
raw[3] = 0;
}
}
currentWriter.Write(raw);
break;
case GameMessage.PosChange:
......
......@@ -113,12 +113,13 @@ namespace MDPro3
public int levelForSelect_2 = 0;
public int counterCanCount = 0;
public int counterSelected = 0;
public List<GameCard> targets = new List<GameCard>();
public List<GameCard> effectTargets = new List<GameCard>();
public List<GameCard> overlays = new List<GameCard>();
public List<GameCard> targets = new();
public List<GameCard> effectTargets = new();
public List<GameCard> overlays = new();
public GameCard overlayParent;
public GameCard equipedCard;
public List<Effect> effects = new();
public bool forSelect;
public int overFatherCount;
private const float closeupLineColorIntensity = 1.5f;
......@@ -1034,7 +1035,13 @@ namespace MDPro3
if ( nextMoveAction != null)
{
model.SetActive(false);
nextMoveAction.Invoke();
var code = data.Id;
if (code == 0)
{
code = Program.instance.ocgcore.GetNextConfirmedCardCode();
SetCode(code);
}
nextMoveAction.Invoke(code);
await UniTask.WaitForSeconds(nextMoveActionDuration);
return;
}
......@@ -1258,7 +1265,7 @@ namespace MDPro3
model.transform.position = fx.transform.position;
model.transform.localEulerAngles = fx.transform.localEulerAngles;
sequence.Pause();
if(data.Id == 0)
if (data.Id == 0)
{
var code = Program.instance.ocgcore.GetUpdateDataIdByGameCard(this);
SetCode(code);
......
......@@ -720,6 +720,7 @@ namespace MDPro3.Duel
lastMoveCard = card;
card.SetCode(code);
to.reason = reason;
nextMoveNeedCode = false;
if(CanSyncNextMove(from, to))
_ = card.MoveAsync(to);
......
......@@ -122,7 +122,7 @@ namespace MDPro3.Servant
private static bool noMoreWait;
public static Action endingAction;
public static Action nextMoveAction;
public static Action<int> nextMoveAction;
public static float nextMoveActionDuration;
public static ElementObjectManager nextMoveManager;
public static Action nextEventAction;
......@@ -148,6 +148,8 @@ namespace MDPro3.Servant
public static int movingToOpExclude = 0;
public static uint nextMoveMessageController;
public static bool nextMoveNeedCode;
#region Config Params
public static readonly Vector3 myPosition = new(0, 15, -25);
......@@ -939,7 +941,7 @@ namespace MDPro3.Servant
currentMessage = (GameMessage)currentPackage.Function;
//if (currentMessage != GameMessage.UpdateData)
// Debug.Log($"GameMessage: {currentMessage}");
//Debug.Log($"GameMessage: {currentMessage}");
try
{
......
......@@ -36,18 +36,19 @@ namespace MDPro3.UI
public PopupDuelSelectCard manager;
public GameCard card;
static Color opColor = new Color(0.9f, 0, 0, 1);
private static Color opColor = new(0.9f, 0, 0, 1);
public bool selected;
public bool unselectable;
static Color unselectableColor = new Color(0.5f, 0.5f, 0.5f, 1f);
private static Color unselectableColor = new(0.5f, 0.5f, 0.5f, 1f);
public bool preselected;
static float doubleClickTime = 0.2f;
private static readonly float doubleClickTime = 0.2f;
private void Start()
{
_ = RefreshCard(card.GetValidData().Id);
_ = RefreshCard(card.GetData().Id);
card.forSelect = true;
if ((card.p.location & (uint)CardLocation.Search) > 0)
{
......
......@@ -140,7 +140,7 @@ PlayerSettings:
loadStoreDebugModeEnabled: 0
visionOSBundleVersion: 1.0
tvOSBundleVersion: 1.0
bundleVersion: 1.3.8.1
bundleVersion: 1.3.8.2
preloadedAssets:
- {fileID: 11400000, guid: 5fb02d2098f52054b89ce4a9f63ba9ee, type: 2}
- {fileID: -944628639613478452, guid: a916821eb5eea2842a69be6041bcdb82, type: 3}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment