Commit ef185576 authored by SherryChaos's avatar SherryChaos

bug fix

parent 97105cdd
...@@ -5,7 +5,7 @@ MDPro3 v1.3.1更新: ...@@ -5,7 +5,7 @@ MDPro3 v1.3.1更新:
2.修复Linux端决斗中需要显示“解放怪兽”特效时,游戏卡死的问题。 2.修复Linux端决斗中需要显示“解放怪兽”特效时,游戏卡死的问题。
3.*修复Mac端非Apple Silicon芯片的设备无法本地决斗的错误。 3.*修复Mac端非Apple Silicon芯片的设备无法本地决斗的错误。
4.*修复非Windows端无法导入、导出文件的错误。 4.*修复非Windows端无法导入、导出文件的错误。
5.修复安卓端和Linux端中,外观设置中CrossDuel的宠物选项不显示的错误。 5.修复安卓端和Linux端中,外观设置中CrossDuel的宠物选项不显示图标的错误。
6.修复游戏启动后不同步在线卡组的错误。 6.修复游戏启动后不同步在线卡组的错误。
7.修复观战时,若服务器已经断连,保存或放弃当前局录像后会直接退出,无法继续观战下一局的错误。 7.修复观战时,若服务器已经断连,保存或放弃当前局录像后会直接退出,无法继续观战下一局的错误。
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6579,7 +6579,7 @@ Transform: ...@@ -6579,7 +6579,7 @@ Transform:
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9, y: 1, z: 0.9} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 4677657357444967} - {fileID: 4677657357444967}
......
...@@ -21222,7 +21222,7 @@ MonoBehaviour: ...@@ -21222,7 +21222,7 @@ MonoBehaviour:
m_faceColor: m_faceColor:
serializedVersion: 2 serializedVersion: 2
rgba: 4294967295 rgba: 4294967295
m_fontSize: 27.8 m_fontSize: 28.35
m_fontSizeBase: 30 m_fontSizeBase: 30
m_fontWeight: 400 m_fontWeight: 400
m_enableAutoSizing: 1 m_enableAutoSizing: 1
...@@ -38215,10 +38215,10 @@ RectTransform: ...@@ -38215,10 +38215,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 3783410452220043591} m_Father: {fileID: 3783410452220043591}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 34, y: -23} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 40, y: 40} m_SizeDelta: {x: 0, y: 40}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3530886934732816922 --- !u!222 &3530886934732816922
CanvasRenderer: CanvasRenderer:
...@@ -71171,10 +71171,10 @@ RectTransform: ...@@ -71171,10 +71171,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 3783410452220043591} m_Father: {fileID: 3783410452220043591}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 74, y: -23} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 40, y: 40} m_SizeDelta: {x: 0, y: 40}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8953983579549377767 --- !u!222 &8953983579549377767
CanvasRenderer: CanvasRenderer:
...@@ -36,7 +36,7 @@ namespace MDPro3 ...@@ -36,7 +36,7 @@ namespace MDPro3
private Card data = new (); private Card data = new ();
private Card cachedData = new(); private Card cachedData = new();
public GPS p; public GPS p;
bool m_disabled; private bool m_disabled;
public bool Disabled public bool Disabled
{ {
get get
...@@ -63,24 +63,26 @@ namespace MDPro3 ...@@ -63,24 +63,26 @@ namespace MDPro3
public List<GameCard> overlays = new List<GameCard>(); public List<GameCard> overlays = new List<GameCard>();
public GameCard overlayParent; public GameCard overlayParent;
public GameCard equipedCard; public GameCard equipedCard;
public List<Effect> effects = new List<Effect>(); public List<Effect> effects = new();
public int overFatherCount; public int overFatherCount;
private const float closeupLineColorIntensity = 1.5f;
public GameObject model; public GameObject model;
public ElementObjectManager manager; public ElementObjectManager manager;
float closeupLineColorIntensity = 1.5f; public GPS cacheP;
private bool inAnimation;
private bool clicked;
private bool hover;
private bool hoving;
public void Dispose() public void Dispose()
{ {
Destroy(model); Destroy(model);
Destroy(this); Destroy(this);
} }
bool clicked;
bool hover;
bool hoving;
private void LateUpdate() private void LateUpdate()
{ {
if (model != null) if (model != null)
...@@ -286,7 +288,8 @@ namespace MDPro3 ...@@ -286,7 +288,8 @@ namespace MDPro3
return go; return go;
} }
} }
IEnumerator SetFace()
private IEnumerator SetFace()
{ {
Renderer cardFace = manager.GetElement<Transform>("CardModel"). Renderer cardFace = manager.GetElement<Transform>("CardModel").
GetChild(1).GetComponent<Renderer>(); GetChild(1).GetComponent<Renderer>();
...@@ -312,12 +315,14 @@ namespace MDPro3 ...@@ -312,12 +315,14 @@ namespace MDPro3
{ {
return data; return data;
} }
public Card CacheData() public Card CacheData()
{ {
if(data.Id > 0) if(data.Id > 0)
cachedData = data.Clone(); cachedData = data.Clone();
return cachedData; return cachedData;
} }
public Card GetCachedData() public Card GetCachedData()
{ {
return cachedData; return cachedData;
...@@ -397,6 +402,7 @@ namespace MDPro3 ...@@ -397,6 +402,7 @@ namespace MDPro3
if (!effectTargets.Contains(card)) if (!effectTargets.Contains(card))
effectTargets.Add(card); effectTargets.Add(card);
} }
public void RemoveEffectTarget(GameCard card) public void RemoveEffectTarget(GameCard card)
{ {
effectTargets.Remove(card); effectTargets.Remove(card);
...@@ -612,6 +618,7 @@ namespace MDPro3 ...@@ -612,6 +618,7 @@ namespace MDPro3
} }
return returnValue; return returnValue;
} }
public static Vector3 GetCardRotation(GPS p, int code = 0) public static Vector3 GetCardRotation(GPS p, int code = 0)
{ {
var condition = CardRuleCondition.MeUpAtk; var condition = CardRuleCondition.MeUpAtk;
...@@ -791,6 +798,7 @@ namespace MDPro3 ...@@ -791,6 +798,7 @@ namespace MDPro3
return Vector3.zero; return Vector3.zero;
} }
} }
public static Vector3 GetEffectRotaion(GPS p) public static Vector3 GetEffectRotaion(GPS p)
{ {
if ((p.controller == 0)) if ((p.controller == 0))
...@@ -808,6 +816,7 @@ namespace MDPro3 ...@@ -808,6 +816,7 @@ namespace MDPro3
return new Vector3(0, 90, 0); return new Vector3(0, 90, 0);
} }
} }
public static Vector3 GetCardScale(GPS p) public static Vector3 GetCardScale(GPS p)
{ {
if ((p.location & (uint)CardLocation.SpellZone) > 0) if ((p.location & (uint)CardLocation.SpellZone) > 0)
...@@ -815,7 +824,8 @@ namespace MDPro3 ...@@ -815,7 +824,8 @@ namespace MDPro3
else else
return Vector3.one; return Vector3.one;
} }
bool ThisLocationShouldHaveModel(GPS p)
private bool ThisLocationShouldHaveModel(GPS p)
{ {
if ((p.location & (uint)CardLocation.Hand) > 0) if ((p.location & (uint)CardLocation.Hand) > 0)
return true; return true;
...@@ -891,9 +901,6 @@ namespace MDPro3 ...@@ -891,9 +901,6 @@ namespace MDPro3
return true; return true;
} }
public GPS cacheP;
bool inAnimation;
public float Move(GPS gps, bool rush = false, float wait = 0f, float overrideMoveTime = 0) public float Move(GPS gps, bool rush = false, float wait = 0f, float overrideMoveTime = 0)
{ {
Program.instance.ocgcore.lastMoveCard = this; Program.instance.ocgcore.lastMoveCard = this;
...@@ -1448,6 +1455,7 @@ namespace MDPro3 ...@@ -1448,6 +1455,7 @@ namespace MDPro3
return moveTime + timePassed + 0.1f; return moveTime + timePassed + 0.1f;
} }
} }
public float Move_Backup(GPS gps, bool rush = false, float wait = 0f, float overrideMoveTime = 0) public float Move_Backup(GPS gps, bool rush = false, float wait = 0f, float overrideMoveTime = 0)
{ {
Program.instance.ocgcore.lastMoveCard = this; Program.instance.ocgcore.lastMoveCard = this;
...@@ -1993,7 +2001,7 @@ namespace MDPro3 ...@@ -1993,7 +2001,7 @@ namespace MDPro3
SequenceStrongSummon(sequence, position, rotaion, interval); SequenceStrongSummon(sequence, position, rotaion, interval);
} }
void SequenceStrongSummon(Sequence sequence, Vector3 position, Vector3 angle, float interval, float timeBefore = 0) private void SequenceStrongSummon(Sequence sequence, Vector3 position, Vector3 angle, float interval, float timeBefore = 0)
{ {
sequence.AppendInterval(interval); sequence.AppendInterval(interval);
sequence.Append(manager.transform.DOMove(position, 0.2f).OnStart(() => sequence.Append(manager.transform.DOMove(position, 0.2f).OnStart(() =>
...@@ -2024,7 +2032,8 @@ namespace MDPro3 ...@@ -2024,7 +2032,8 @@ namespace MDPro3
OcgCore.messagePass = true; OcgCore.messagePass = true;
}); });
} }
void SequenceNormalSummon(Sequence sequence, Vector3 position, Vector3 angle, float interval, float timeBefore = 0)
private void SequenceNormalSummon(Sequence sequence, Vector3 position, Vector3 angle, float interval, float timeBefore = 0)
{ {
sequence.AppendInterval(interval); sequence.AppendInterval(interval);
sequence.Append(model.transform.DOMove(position, 0.2f)); sequence.Append(model.transform.DOMove(position, 0.2f));
...@@ -2050,7 +2059,7 @@ namespace MDPro3 ...@@ -2050,7 +2059,7 @@ namespace MDPro3
}); });
} }
float SequenceFromGrave(Sequence sequence, GPS p) private float SequenceFromGrave(Sequence sequence, GPS p)
{ {
var dummy = ABLoader.LoadFromFile("MasterDuel/Timeline/DuelCardMove/DuelFromGrave01", true); var dummy = ABLoader.LoadFromFile("MasterDuel/Timeline/DuelCardMove/DuelFromGrave01", true);
dummy.transform.position = GetCardPosition(p); dummy.transform.position = GetCardPosition(p);
...@@ -2076,7 +2085,8 @@ namespace MDPro3 ...@@ -2076,7 +2085,8 @@ namespace MDPro3
return time; return time;
} }
float SequenceFromGrave_Backup(Sequence sequence, GPS p)
private float SequenceFromGrave_Backup(Sequence sequence, GPS p)
{ {
var timeUp = 0.3f; var timeUp = 0.3f;
var timeStay = 0.2f; var timeStay = 0.2f;
...@@ -2092,7 +2102,8 @@ namespace MDPro3 ...@@ -2092,7 +2102,8 @@ namespace MDPro3
Program.instance.ocgcore.GraveBgEffect(p, false); Program.instance.ocgcore.GraveBgEffect(p, false);
return timeUp + timeStay; return timeUp + timeStay;
} }
float SequenceToGrave(Sequence sequence, GPS p)
private float SequenceToGrave(Sequence sequence, GPS p)
{ {
var count = OcgCore.movingToGrave; var count = OcgCore.movingToGrave;
if (count > 5) if (count > 5)
...@@ -2125,7 +2136,8 @@ namespace MDPro3 ...@@ -2125,7 +2136,8 @@ namespace MDPro3
return time; return time;
} }
float SequenceToGrave_Backup(Sequence sequence, GPS p)
private float SequenceToGrave_Backup(Sequence sequence, GPS p)
{ {
var timeDown = 0.3f; var timeDown = 0.3f;
var timeStay = 0.2f; var timeStay = 0.2f;
...@@ -2143,7 +2155,8 @@ namespace MDPro3 ...@@ -2143,7 +2155,8 @@ namespace MDPro3
sequence.Join(pivot.DOLocalMove(new Vector3(0, -5, 0), timeDown).SetEase(Ease.OutCubic)); sequence.Join(pivot.DOLocalMove(new Vector3(0, -5, 0), timeDown).SetEase(Ease.OutCubic));
return timeDown + timeStay; return timeDown + timeStay;
} }
float SequenceToExclude(Sequence sequence, GPS p)
private float SequenceToExclude(Sequence sequence, GPS p)
{ {
var count = OcgCore.movingToExclude; var count = OcgCore.movingToExclude;
if(count > 5) if(count > 5)
...@@ -2176,7 +2189,8 @@ namespace MDPro3 ...@@ -2176,7 +2189,8 @@ namespace MDPro3
return time; return time;
} }
void ResetModelPositon()
private void ResetModelPositon()
{ {
if (model == null) if (model == null)
return; return;
...@@ -2207,8 +2221,11 @@ namespace MDPro3 ...@@ -2207,8 +2221,11 @@ namespace MDPro3
#region Animation #region Animation
public static float handAngle = -10f; public static float handAngle = -10f;
private bool handDefault;
private bool appealed = false;
private float cardShakeTimeOffset = 0.01f;
void ModelAt(GPS gps, GameObject model = null) private void ModelAt(GPS gps, GameObject model = null)
{ {
ElementObjectManager manager; ElementObjectManager manager;
if (model == null) if (model == null)
...@@ -2277,12 +2294,12 @@ namespace MDPro3 ...@@ -2277,12 +2294,12 @@ namespace MDPro3
}); });
} }
bool handDefault;
public float HandOffsetRotationByX(float x) public float HandOffsetRotationByX(float x)
{ {
var abs = x > 0 ? x : -x; var abs = x > 0 ? x : -x;
return x * (abs * -0.006f + 1.2f) * ((p.controller == 0) ? 1 : -1); return x * (abs * -0.006f + 1.2f) * ((p.controller == 0) ? 1 : -1);
} }
public float HandOffsetPositionByX(float x) public float HandOffsetPositionByX(float x)
{ {
var abs = x > 0 ? x : -x; var abs = x > 0 ? x : -x;
...@@ -2315,6 +2332,7 @@ namespace MDPro3 ...@@ -2315,6 +2332,7 @@ namespace MDPro3
else else
turn.DOLocalRotate(Vector3.zero, time); turn.DOLocalRotate(Vector3.zero, time);
} }
public void SetHandToDefault() public void SetHandToDefault()
{ {
if (model == null || (p.location & (uint)CardLocation.Hand) == 0 || inAnimation) if (model == null || (p.location & (uint)CardLocation.Hand) == 0 || inAnimation)
...@@ -2323,6 +2341,7 @@ namespace MDPro3 ...@@ -2323,6 +2341,7 @@ namespace MDPro3
clicked = false; clicked = false;
handDefault = false; handDefault = false;
} }
public void SetHandDefault() public void SetHandDefault()
{ {
if (model == null || (p.location & (uint)CardLocation.Hand) == 0) if (model == null || (p.location & (uint)CardLocation.Hand) == 0)
...@@ -2335,7 +2354,8 @@ namespace MDPro3 ...@@ -2335,7 +2354,8 @@ namespace MDPro3
manager.GetElement<Transform>("Offset").localEulerAngles = new Vector3(0, HandOffsetRotationByX(x), handAngle); manager.GetElement<Transform>("Offset").localEulerAngles = new Vector3(0, HandOffsetRotationByX(x), handAngle);
manager.GetElement<Transform>("Turn").localEulerAngles = new Vector3(0, 0, (data.Id == 0) ? 180 : 0); manager.GetElement<Transform>("Turn").localEulerAngles = new Vector3(0, 0, (data.Id == 0) ? 180 : 0);
} }
void AnimationHandHover()
private void AnimationHandHover()
{ {
if (inAnimation) if (inAnimation)
return; return;
...@@ -2343,7 +2363,6 @@ namespace MDPro3 ...@@ -2343,7 +2363,6 @@ namespace MDPro3
offset.DOLocalMove(new Vector3(0, 2, 1), 0.1f); offset.DOLocalMove(new Vector3(0, 2, 1), 0.1f);
} }
bool appealed = false;
public void AnimationHandAppeal() public void AnimationHandAppeal()
{ {
if (appealed || inAnimation) if (appealed || inAnimation)
...@@ -2354,6 +2373,7 @@ namespace MDPro3 ...@@ -2354,6 +2373,7 @@ namespace MDPro3
manager.GetElement<Transform>("Offset").DOLocalMove(Vector3.zero, 0.1f); manager.GetElement<Transform>("Offset").DOLocalMove(Vector3.zero, 0.1f);
AudioManager.PlaySE("SE_CARD_MOVE_0" + UnityEngine.Random.Range(1, 5)); AudioManager.PlaySE("SE_CARD_MOVE_0" + UnityEngine.Random.Range(1, 5));
} }
public void AnimationNegate() public void AnimationNegate()
{ {
Program.instance.ocgcore.nextNegateAction?.Invoke(); Program.instance.ocgcore.nextNegateAction?.Invoke();
...@@ -2454,6 +2474,7 @@ namespace MDPro3 ...@@ -2454,6 +2474,7 @@ namespace MDPro3
}); });
} }
} }
public void AnimationActivate() public void AnimationActivate()
{ {
AudioManager.PlaySE("SE_CARDVIEW_01"); AudioManager.PlaySE("SE_CARDVIEW_01");
...@@ -2594,6 +2615,7 @@ namespace MDPro3 ...@@ -2594,6 +2615,7 @@ namespace MDPro3
ShowFaceDownCardOrNot(NeedShowFaceDownCard()); ShowFaceDownCardOrNot(NeedShowFaceDownCard());
}); });
} }
public void AnimationPositon(float delay = 0) public void AnimationPositon(float delay = 0)
{ {
if (model == null) if (model == null)
...@@ -2627,6 +2649,7 @@ namespace MDPro3 ...@@ -2627,6 +2649,7 @@ namespace MDPro3
sequence.Append(positionManager.GetElement<SpriteRenderer>("Defense").DOFade(0, 0.3f).SetEase(Ease.InCubic)); sequence.Append(positionManager.GetElement<SpriteRenderer>("Defense").DOFade(0, 0.3f).SetEase(Ease.InCubic));
} }
} }
public void AnimationTarget() public void AnimationTarget()
{ {
AudioManager.PlaySE("SE_CEMETERY_CARD"); AudioManager.PlaySE("SE_CEMETERY_CARD");
...@@ -2656,7 +2679,6 @@ namespace MDPro3 ...@@ -2656,7 +2679,6 @@ namespace MDPro3
Destroy(fx, 1f); Destroy(fx, 1f);
} }
private float cardShakeTimeOffset = 0.01f;
public void AnimationLandShake(GameCard card, bool huge) public void AnimationLandShake(GameCard card, bool huge)
{ {
if (card == this) if (card == this)
...@@ -2751,8 +2773,11 @@ namespace MDPro3 ...@@ -2751,8 +2773,11 @@ namespace MDPro3
public string hint; public string hint;
public ButtonType type; public ButtonType type;
} }
public List<DuelButtonInfo> buttons = new List<DuelButtonInfo>();
List<DuelButton> buttonObjs = new List<DuelButton>(); private bool hightYellow = false;
public List<DuelButtonInfo> buttons = new();
private readonly List<DuelButton> buttonObjs = new();
public void AddButton(int response, string hint, ButtonType type) public void AddButton(int response, string hint, ButtonType type)
{ {
...@@ -2766,7 +2791,6 @@ namespace MDPro3 ...@@ -2766,7 +2791,6 @@ namespace MDPro3
if (!exist) if (!exist)
buttons.Add(new DuelButtonInfo() { response = new List<int>() { response }, hint = hint, type = type }); buttons.Add(new DuelButtonInfo() { response = new List<int>() { response }, hint = hint, type = type });
} }
bool hightYellow = false;
public void CreateButtons() public void CreateButtons()
{ {
if (model == null || buttons.Count == 0) if (model == null || buttons.Count == 0)
...@@ -2820,25 +2844,29 @@ namespace MDPro3 ...@@ -2820,25 +2844,29 @@ namespace MDPro3
manager.GetElement("EffectHighlightYellowSelect").SetActive(false); manager.GetElement("EffectHighlightYellowSelect").SetActive(false);
} }
#endregion #endregion
#region Label #region Label
public bool labelShowing = false; public bool labelShowing = false;
static readonly string upColor = "<color=#00FFFF>"; private const string upColor = "<color=#00FFFF>";
static readonly string upGrayColor = "<color=#009999>"; private const string upGrayColor = "<color=#009999>";
static readonly string normalColor = "<color=#FFFFFF>"; private const string normalColor = "<color=#FFFFFF>";
static readonly string normalGrayColor = "<color=#999999>"; private const string normalGrayColor = "<color=#999999>";
static readonly string downColor = "<color=#FF0000>"; private const string downColor = "<color=#FF0000>";
static readonly string downGrayColor = "<color=#990000>"; private const string downGrayColor = "<color=#990000>";
static readonly string smallSize = "<size=20>"; private const string smallSize = "<size=20>";
static readonly string normalSize = "<size=25>"; private const string normalSize = "<size=25>";
int attack = 0; private int attack = 0;
int defense = 0; private int defense = 0;
float changeTime = 0.6f; private float changeTime = 0.6f;
int lastAttribute; private int lastAttribute;
int lastRace; private int lastRace;
private bool closeupShowing;
private int setTurn = 0;
public bool setOverTurn;
public void RefreshLabel() public void RefreshLabel()
{ {
if(model == null) if(model == null)
...@@ -3389,7 +3417,6 @@ namespace MDPro3 ...@@ -3389,7 +3417,6 @@ namespace MDPro3
ShowLabel(); ShowLabel();
} }
bool closeupShowing;
public void ShowLabel() public void ShowLabel()
{ {
labelShowing = true; labelShowing = true;
...@@ -3415,6 +3442,7 @@ namespace MDPro3 ...@@ -3415,6 +3442,7 @@ namespace MDPro3
HideHiddenLabel(); HideHiddenLabel();
} }
public void HideLabel() public void HideLabel()
{ {
labelShowing = false; labelShowing = false;
...@@ -3437,6 +3465,7 @@ namespace MDPro3 ...@@ -3437,6 +3465,7 @@ namespace MDPro3
foreach (var sr in linkMarker.GetComponentsInChildren<SpriteRenderer>(true)) foreach (var sr in linkMarker.GetComponentsInChildren<SpriteRenderer>(true))
sr.sortingLayerName = "CardStatus"; sr.sortingLayerName = "CardStatus";
} }
public void HideHiddenLabel() public void HideHiddenLabel()
{ {
if (model == null || !labelShowing) if (model == null || !labelShowing)
...@@ -3462,7 +3491,7 @@ namespace MDPro3 ...@@ -3462,7 +3491,7 @@ namespace MDPro3
sr.sortingLayerName = "Default"; sr.sortingLayerName = "Default";
} }
void SetDisabled() private void SetDisabled()
{ {
if (model == null) if (model == null)
return; return;
...@@ -3486,7 +3515,7 @@ namespace MDPro3 ...@@ -3486,7 +3515,7 @@ namespace MDPro3
} }
} }
bool NeedShowCloseup() private bool NeedShowCloseup()
{ {
if (model == null) if (model == null)
return false; return false;
...@@ -3501,7 +3530,7 @@ namespace MDPro3 ...@@ -3501,7 +3530,7 @@ namespace MDPro3
return true; return true;
} }
bool CloseupConfig() private bool CloseupConfig()
{ {
if (OcgCore.condition == OcgCore.Condition.Duel && Config.Get("DuelCloseup", "1") == "0") if (OcgCore.condition == OcgCore.Condition.Duel && Config.Get("DuelCloseup", "1") == "0")
return false; return false;
...@@ -3534,8 +3563,6 @@ namespace MDPro3 ...@@ -3534,8 +3563,6 @@ namespace MDPro3
return true; return true;
} }
int setTurn = 0;
public bool setOverTurn;
public void ShowFaceDownCardOrNot(bool show) public void ShowFaceDownCardOrNot(bool show)
{ {
if (model == null) if (model == null)
...@@ -3570,6 +3597,7 @@ namespace MDPro3 ...@@ -3570,6 +3597,7 @@ namespace MDPro3
manager.GetElement("EffectDisquiet").SetActive(false); manager.GetElement("EffectDisquiet").SetActive(false);
} }
} }
public void ShowDisquiet() public void ShowDisquiet()
{ {
if (model == null) if (model == null)
...@@ -3590,7 +3618,9 @@ namespace MDPro3 ...@@ -3590,7 +3618,9 @@ namespace MDPro3
#endregion #endregion
#region CardCounter #region CardCounter
Dictionary<int, int> cardCounters = new Dictionary<int, int>(); Dictionary<int, int> cardCounters = new Dictionary<int, int>();
public void AddCounter(int counter, int count) public void AddCounter(int counter, int count)
{ {
AudioManager.PlaySE("SE_CARD_COUNTER"); AudioManager.PlaySE("SE_CARD_COUNTER");
...@@ -3611,6 +3641,7 @@ namespace MDPro3 ...@@ -3611,6 +3641,7 @@ namespace MDPro3
AddStringTail(counterName); AddStringTail(counterName);
RefreshLabel(); RefreshLabel();
} }
public void RemoveCounter(int counter, int count) public void RemoveCounter(int counter, int count)
{ {
AudioManager.PlaySE("SE_CARD_COUNTER"); AudioManager.PlaySE("SE_CARD_COUNTER");
...@@ -3624,41 +3655,51 @@ namespace MDPro3 ...@@ -3624,41 +3655,51 @@ namespace MDPro3
RemoveStringTail(counterName); RemoveStringTail(counterName);
RefreshLabel(); RefreshLabel();
} }
public void ClearCounter() public void ClearCounter()
{ {
cardCounters.Clear(); cardCounters.Clear();
} }
public int GetCounterCount(int type) public int GetCounterCount(int type)
{ {
cardCounters.TryGetValue(type, out var count); cardCounters.TryGetValue(type, out var count);
return count; return count;
} }
#endregion #endregion
#region String Tail #region String Tail
public MultiStringMaster tails = new MultiStringMaster();
public MultiStringMaster tails = new();
public void AddStringTail(string tail) public void AddStringTail(string tail)
{ {
tails.Add(tail); tails.Add(tail);
} }
public void RemoveStringTail(string tail, bool all = false) public void RemoveStringTail(string tail, bool all = false)
{ {
tails.Remove(tail, all); tails.Remove(tail, all);
} }
public void ClearAllTails() public void ClearAllTails()
{ {
ClearCounter(); ClearCounter();
tails.Clear(); tails.Clear();
} }
#endregion #endregion
#region Chain #region Chain
public class Chain public class Chain
{ {
public int i; public int i;
public DuelChainSpot chainSpot; public DuelChainSpot chainSpot;
} }
public List<Chain> chains = new List<Chain>();
public List<Chain> chains = new();
public void AddChain(int i) public void AddChain(int i)
{ {
...@@ -3668,6 +3709,7 @@ namespace MDPro3 ...@@ -3668,6 +3709,7 @@ namespace MDPro3
bool turn = (p.location & (uint)CardLocation.MonsterZone) > 0 && (p.position & (uint)CardPosition.Defence) > 0; bool turn = (p.location & (uint)CardLocation.MonsterZone) > 0 && (p.position & (uint)CardPosition.Defence) > 0;
chains[chains.Count - 1].chainSpot.Play(i, p.location, model != null, turn, GetCardPosition(p, this), i == 1); chains[chains.Count - 1].chainSpot.Play(i, p.location, model != null, turn, GetCardPosition(p, this), i == 1);
} }
public void ResolveChain(int i) public void ResolveChain(int i)
{ {
foreach (var chain in chains) foreach (var chain in chains)
...@@ -3679,6 +3721,7 @@ namespace MDPro3 ...@@ -3679,6 +3721,7 @@ namespace MDPro3
} }
} }
} }
public void RemoveChain(int i) public void RemoveChain(int i)
{ {
foreach (var chain in chains) foreach (var chain in chains)
...@@ -3692,21 +3735,25 @@ namespace MDPro3 ...@@ -3692,21 +3735,25 @@ namespace MDPro3
} }
} }
} }
public void RemoveAllChain() public void RemoveAllChain()
{ {
foreach (var chain in chains) foreach (var chain in chains)
Destroy(chain.chainSpot.gameObject, 1f); Destroy(chain.chainSpot.gameObject, 1f);
chains.Clear(); chains.Clear();
} }
#endregion #endregion
#region enum #region enum
public enum Condition public enum Condition
{ {
None, None,
Chaining, Chaining,
Selected Selected
} }
private enum CardRuleCondition private enum CardRuleCondition
{ {
MeUpAtk, MeUpAtk,
...@@ -3738,6 +3785,9 @@ namespace MDPro3 ...@@ -3738,6 +3785,9 @@ namespace MDPro3
OpUpHand, OpUpHand,
OpDownHand OpDownHand
} }
#endregion #endregion
} }
} }
...@@ -175,6 +175,7 @@ namespace MDPro3 ...@@ -175,6 +175,7 @@ namespace MDPro3
int currentKey = 0; int currentKey = 0;
List<string> currentValue = null; List<string> currentValue = null;
bool notNeed = false;
foreach (var line in lines) foreach (var line in lines)
{ {
...@@ -184,10 +185,18 @@ namespace MDPro3 ...@@ -184,10 +185,18 @@ namespace MDPro3
targetDic.Add(currentKey, string.Join(Environment.NewLine, currentValue)); targetDic.Add(currentKey, string.Join(Environment.NewLine, currentValue));
currentKey = key; currentKey = key;
currentValue = new List<string>(); currentValue = new List<string>();
notNeed = false;
}
else if (line.StartsWith("[IDS_ITEM."))// [IDS_ITEM.CATEGORY_0001] [IDS_ITEM.SPCATEGORY_0003]
{
notNeed = true;
} }
else else
{
if(!notNeed)
currentValue?.Add(line); currentValue?.Add(line);
} }
}
if (currentValue != null) if (currentValue != null)
{ {
......
...@@ -548,7 +548,7 @@ namespace MDPro3.UI ...@@ -548,7 +548,7 @@ namespace MDPro3.UI
hintObj = ABLoader.LoadFromFile("MasterDuel/Effects/Hitghlight/fxp_HL_EXdeck_001", true); hintObj = ABLoader.LoadFromFile("MasterDuel/Effects/Hitghlight/fxp_HL_EXdeck_001", true);
hintObj.transform.SetParent(transform, false); hintObj.transform.SetParent(transform, false);
int cardCount = Program.instance.ocgcore.GetLocationCardCount((CardLocation)location, controller); int cardCount = Program.instance.ocgcore.GetLocationCardCount((CardLocation)location, controller);
hintObj.transform.localScale = new Vector3(1.1f, cardCount * 0.1f, 1.1f); hintObj.transform.localScale = new Vector3(1f, cardCount * 0.1f, 1f);
} }
} }
......
...@@ -414,8 +414,7 @@ namespace MDPro3.UI ...@@ -414,8 +414,7 @@ namespace MDPro3.UI
{ {
SpellTrapType.SetActive(true); SpellTrapType.SetActive(true);
IconSpellTrapType.sprite = TextureManager.container.GetCardSpellTrapTypeIcon(data); IconSpellTrapType.sprite = TextureManager.container.GetCardSpellTrapTypeIcon(data);
TextSpellTrapType.text TextSpellTrapType.text = data.GetSpellTrapType();
= StringHelper.SecondType(data.Type) + StringHelper.MainType(data.Type);
IconAtk.gameObject.SetActive(false); IconAtk.gameObject.SetActive(false);
IconDef.gameObject.SetActive(false); IconDef.gameObject.SetActive(false);
......
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