Commit 7a4df5c8 authored by SherryChaos's avatar SherryChaos

bug fix

parent 8eefb38f
This diff is collapsed.
using MDPro3.YGOSharp;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using UnityEngine; using UnityEngine;
namespace MDPro3 namespace MDPro3
...@@ -9,6 +11,7 @@ namespace MDPro3 ...@@ -9,6 +11,7 @@ namespace MDPro3
[CreateAssetMenu] [CreateAssetMenu]
public class Items : ScriptableObject public class Items : ScriptableObject
{ {
public static string nullString = "coming soon";
[Serializable] [Serializable]
public struct Item public struct Item
{ {
...@@ -147,15 +150,60 @@ namespace MDPro3 ...@@ -147,15 +150,60 @@ namespace MDPro3
{ {
names.TryGetValue(code, out var returnValue); names.TryGetValue(code, out var returnValue);
if (string.IsNullOrEmpty(returnValue)) if (string.IsNullOrEmpty(returnValue))
returnValue = "coming soon"; returnValue = nullString;
return returnValue; return returnValue;
} }
string GetDescription(int code) string GetDescription(int code)
{ {
descriptions.TryGetValue(code, out var returnValue); descriptions.TryGetValue(code, out var returnValue);
return returnValue; if (string.IsNullOrEmpty(returnValue))
return nullString;
returnValue = returnValue.Replace(" get=\'name\'", string.Empty);
string pattern = @"<card mrk='(\d+)'/>";
return Regex.Replace(returnValue, pattern, EvaluatorGetNameFromNumber);
}
string EvaluatorGetNameFromNumber(Match match)
{
string numberString = match.Groups[1].Value;
int cardCode = 0;
switch (numberString)
{
case "18799":
cardCode = 27015862;
break;
case "14648":
cardCode = 40441990;
break;
case "15250":
cardCode = 20129614;
break;
case "13670":
cardCode = 26077387;
break;
case "19196":
cardCode = 80845034;
break;
case "13982":
cardCode = 79698395;
break;
case "10191":
cardCode = 14001430;
break;
case "10793":
cardCode = 99795159;
break;
case "15573":
cardCode = 34572613;
break;
case "18003":
cardCode = 25550531;
break;
case "16200":
cardCode = 24639891;
break;
}
return CardsManager.Get(cardCode).Name;
} }
public string WallpaperCodeToPath(string code) public string WallpaperCodeToPath(string code)
{ {
......
...@@ -1716,7 +1716,7 @@ namespace MDPro3 ...@@ -1716,7 +1716,7 @@ namespace MDPro3
} }
} }
public void AnimationConfirm() public void AnimationConfirm(int id)
{ {
if (!ThisLocationShouldHaveModel(p)) if (!ThisLocationShouldHaveModel(p))
{ {
...@@ -1724,15 +1724,16 @@ namespace MDPro3 ...@@ -1724,15 +1724,16 @@ namespace MDPro3
ModelAt(p); ModelAt(p);
} }
inAnimation = true; inAnimation = true;
AudioManager.PlaySE("SE_CARDVIEW_02");
var offset = manager.GetElement<Transform>("Offset"); var offset = manager.GetElement<Transform>("Offset");
var offsetPosition = offset.localPosition; var offsetPosition = offset.localPosition;
var turn = manager.GetElement<Transform>("Turn"); var turn = manager.GetElement<Transform>("Turn");
var turnEulerAngles = turn.localEulerAngles; var turnEulerAngles = turn.localEulerAngles;
var sequence = DOTween.Sequence(); var sequence = DOTween.Sequence();
sequence.Append(offset.DOLocalMove(new Vector3(0, 2, 3), 0.1f)); sequence.AppendInterval(id);
sequence.Append(offset.DOLocalMove(new Vector3(0, 2, 3), 0.1f).OnStart(() =>
{
AudioManager.PlaySE("SE_CARDVIEW_02");
}));
sequence.Join(turn.DOLocalRotate(Vector3.zero, 0.1f).OnComplete(() => sequence.Join(turn.DOLocalRotate(Vector3.zero, 0.1f).OnComplete(() =>
{ {
var highlight = ABLoader.LoadFromFile("Effects/other/fxp_card_decide_001", true); var highlight = ABLoader.LoadFromFile("Effects/other/fxp_card_decide_001", true);
......
...@@ -1540,8 +1540,8 @@ namespace MDPro3 ...@@ -1540,8 +1540,8 @@ namespace MDPro3
var length_of_message = r.BaseStream.Length; var length_of_message = r.BaseStream.Length;
BinaryMaster binaryMaster; BinaryMaster binaryMaster;
List<string> selections; List<string> selections;
//if ((GameMessage)p.Function != GameMessage.UpdateData) if ((GameMessage)p.Function != GameMessage.UpdateData)
// Debug.Log("----------" + (GameMessage)p.Function); Debug.Log("----------" + (GameMessage)p.Function);
//else //else
// Debug.Log("----------" + (GameMessage)p.Function); // Debug.Log("----------" + (GameMessage)p.Function);
switch ((GameMessage)p.Function) switch ((GameMessage)p.Function)
...@@ -3490,10 +3490,10 @@ namespace MDPro3 ...@@ -3490,10 +3490,10 @@ namespace MDPro3
{ {
card.SetCode(code); card.SetCode(code);
description.Show(card, null); description.Show(card, null);
card.AnimationConfirm(); card.AnimationConfirm(i);
} }
} }
Sleep(100); Sleep(100 * count);
break; break;
case GameMessage.DeckTop: case GameMessage.DeckTop:
player = LocalPlayer(r.ReadByte()); player = LocalPlayer(r.ReadByte());
......
...@@ -340,13 +340,8 @@ namespace MDPro3.UI ...@@ -340,13 +340,8 @@ namespace MDPro3.UI
case GameMessage.SortCard: case GameMessage.SortCard:
case GameMessage.SortChain: case GameMessage.SortChain:
var bytes = new byte[monos.Count]; var bytes = new byte[monos.Count];
foreach (var mono in monos) for(int i = 0; i < monos.Count; i++)
for (int i = 0; i < cards.Count; i++) bytes[i] = (byte)(monos[i].GetOrder() - 1);
if (mono.card == cards[i])
{
bytes[i] = (byte)i;
break;
}
binaryMaster = new BinaryMaster(); binaryMaster = new BinaryMaster();
binaryMaster.writer.Write(bytes); binaryMaster.writer.Write(bytes);
Program.I().ocgcore.SendReturn(binaryMaster.Get()); Program.I().ocgcore.SendReturn(binaryMaster.Get());
......
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