Commit 684dff98 authored by SherryChaos's avatar SherryChaos

fix bugs

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