Commit 684dff98 authored by SherryChaos's avatar SherryChaos

fix bugs

parent 06fbaaca
...@@ -1194,6 +1194,7 @@ namespace MDPro3 ...@@ -1194,6 +1194,7 @@ namespace MDPro3
public List<GameCard> materialCards = new List<GameCard>(); public List<GameCard> materialCards = new List<GameCard>();
public List<GameCard> cardsInChain = new List<GameCard>(); public List<GameCard> cardsInChain = new List<GameCard>();
public List<int> codesInChain = new List<int>();
public List<GameCard> cardsBeTarget = new List<GameCard>(); public List<GameCard> cardsBeTarget = new List<GameCard>();
public List<GameCard> cardsInSelection = new List<GameCard>(); public List<GameCard> cardsInSelection = new List<GameCard>();
public List<GameCard> cardsMustBeSelected = new List<GameCard>(); public List<GameCard> cardsMustBeSelected = new List<GameCard>();
...@@ -1236,6 +1237,7 @@ namespace MDPro3 ...@@ -1236,6 +1237,7 @@ namespace MDPro3
lastHandOffset = 0; lastHandOffset = 0;
materialCards.Clear(); materialCards.Clear();
cardsInChain.Clear(); cardsInChain.Clear();
codesInChain.Clear();
cardsBeTarget.Clear(); cardsBeTarget.Clear();
cardsInSelection.Clear(); cardsInSelection.Clear();
cardsMustBeSelected.Clear(); cardsMustBeSelected.Clear();
...@@ -2256,6 +2258,7 @@ namespace MDPro3 ...@@ -2256,6 +2258,7 @@ namespace MDPro3
card.SetCode(code); card.SetCode(code);
card.AnimationActivate(); card.AnimationActivate();
cardsInChain.Add(card); cardsInChain.Add(card);
codesInChain.Add(code);
Sleep(100); Sleep(100);
ES_hint = InterString.Get("「[?]」被发动时", card.GetData().Name); ES_hint = InterString.Get("「[?]」被发动时", card.GetData().Name);
} }
...@@ -2285,6 +2288,9 @@ namespace MDPro3 ...@@ -2285,6 +2288,9 @@ namespace MDPro3
{ {
card = cardsInChain[id - 1]; card = cardsInChain[id - 1];
card.ResolveChain(id); card.ResolveChain(id);
if (card.GetData().Id != codesInChain[id - 1])
//Hand Shuffle
break;
if (card.disabled || card.negated) if (card.disabled || card.negated)
break; break;
...@@ -2577,6 +2583,7 @@ namespace MDPro3 ...@@ -2577,6 +2583,7 @@ namespace MDPro3
} }
cardsBeTarget.Clear(); cardsBeTarget.Clear();
cardsInChain.Clear(); cardsInChain.Clear();
codesInChain.Clear();
materialCards.Clear(); materialCards.Clear();
break; break;
case GameMessage.ChainNegated: case GameMessage.ChainNegated:
......
...@@ -155,20 +155,44 @@ namespace MDPro3.UI ...@@ -155,20 +155,44 @@ namespace MDPro3.UI
highlight.SetActive(false); highlight.SetActive(false);
} }
void OnClick() void OnClick()
{ {
if (selecting) if (selecting)
{ {
AudioManager.PlaySE("SE_DUEL_SELECT"); AudioManager.PlaySE("SE_DUEL_SELECT");
if (!selected)
{
selected = true; selected = true;
var response = new byte[3]; select.SetActive(false);
response[0] = Program.I().ocgcore.isFirst ? (byte)p.controller : (byte)(1 - p.controller); selectPush.SetActive(false);
response[1] = (byte)p.location; selectPush.SetActive(true);
response[2] = (byte)p.sequence; }
else
{
selected = false;
select.SetActive(true);
}
var selectedCount = 0;
foreach(var place in Program.I().ocgcore.places)
if(place.selected)
selectedCount++;
if (selectedCount == Program.I().ocgcore.ES_min)
{
var binaryMaster = new BinaryMaster(); var binaryMaster = new BinaryMaster();
foreach (var place in Program.I().ocgcore.places)
if (place.selected)
{
var response = new byte[3];
response[0] = Program.I().ocgcore.isFirst ? (byte)place.p.controller : (byte)(1 - place.p.controller);
response[1] = (byte)place.p.location;
response[2] = (byte)place.p.sequence;
binaryMaster.writer.Write(response); binaryMaster.writer.Write(response);
}
Program.I().ocgcore.SendReturn(binaryMaster.Get()); Program.I().ocgcore.SendReturn(binaryMaster.Get());
} }
}
else if (cardSelecting) else if (cardSelecting)
{ {
AudioManager.PlaySE("SE_DUEL_SELECT"); AudioManager.PlaySE("SE_DUEL_SELECT");
......
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