Commit 61c70af7 authored by mercury233's avatar mercury233

test add SelectUnselectCard

parent cbfa365b
......@@ -40,3 +40,8 @@ deck/
pack/
texture/
config/
bin/
Release/
AI_core_vs2017solution/core.VC.db
AI_core_vs2017solution/core.VC.VC.opendb
AI_core_vs2017solution/System.Servicemodel.Faltexception.dll
......@@ -103,6 +103,7 @@ namespace Percy
SelectSum = 23,
SelectDisfield = 24,
SortCard = 25,
SelectUnselectCard = 26,
ConfirmDecktop = 30,
ConfirmCards = 31,
ShuffleDeck = 32,
......@@ -112,8 +113,10 @@ namespace Percy
ShuffleSetCard = 36,
ReverseDeck = 37,
DeckTop = 38,
ShuffleExtra = 39,
NewTurn = 40,
NewPhase = 41,
ConfirmExtratop = 42,
Move = 50,
PosChange = 53,
Set = 54,
......@@ -157,6 +160,8 @@ namespace Percy
ReleaseRelation = 123,
TossCoin = 130,
TossDice = 131,
RockPaperScissors = 132,
HandResult = 133,
AnnounceRace = 140,
AnnounceAttrib = 141,
AnnounceCard = 142,
......@@ -167,7 +172,7 @@ namespace Percy
ReloadField = 162,
AiName = 163,
ShowHint = 164,
PlayerHint=165,
PlayerHint = 165,
MatchKill = 170,
CustomMsg = 180,
DuelWinner = 200,
......@@ -1016,6 +1021,30 @@ namespace Percy
}
returnValue = true;
break;
case GameMessage.SelectUnselectCard:
player = move(1);
int buttonok = move(1);
move(3);
int count1 = move(1);
for (int i = 0; i < count1; i++)
{
int code = currentReader.ReadInt32();
int p = currentReader.ReadByte();
currentWriter.Write(((int)(p == player ? code : 0)));
currentWriter.Write((byte)p);
move(3);
}
int count2 = move(1);
for (int i = 0; i < count2; i++)
{
int code = currentReader.ReadInt32();
int p = currentReader.ReadByte();
//currentWriter.Write(((int)(p == player ? code : 0)));
//currentWriter.Write((byte)p);
move(3);
}
returnValue = true;
break;
case GameMessage.SelectChain:
move(1);
count = move(1);
......
......@@ -3,18 +3,32 @@ guid: 73132aa60cb2f2a4fb89f09c6777b7f5
timeCreated: 1476610278
licenseType: Pro
PluginImporter:
serializedVersion: 1
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
Editor:
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
......@@ -3373,6 +3373,68 @@ public class Ocgcore : ServantWithCardDescription
gameField.setHint(InterString.Get("请选择卡片。") + " " + ES_min.ToString() + "-" + ES_max.ToString());
}
break;
case GameMessage.SelectUnselectCard:
if (inIgnoranceReplay() || inTheWorld())
{
break;
}
if (condition == Condition.record)
{
Sleep(60);
}
destroy(waitObject, 0, false, true);
player = localPlayer(r.ReadByte());
bool finish = (r.ReadByte() != 0);
cancalable = (r.ReadByte() != 0);
ES_min = r.ReadByte();
ES_max = r.ReadByte();
ES_min = 1; // SelectUnselectCard can actually always select 1 card
ES_max = 1; // SelectUnselectCard can actually always select 1 card
ES_level = 0;
count = r.ReadByte();
for (int i = 0; i < count; i++)
{
code = r.ReadInt32();
gps = r.ReadGPS();
card = GCS_cardGet(gps, false);
if (card != null)
{
card.set_code(code);
card.prefered = true;
card.forSelect = true;
card.selectPtr = i;
allCardsInSelectMessage.Add(card);
}
}
count = r.ReadByte();
for (int i = 0; i < count; i++)
{
code = r.ReadInt32();
gps = r.ReadGPS();
/*card = GCS_cardGet(gps, false);
if (card != null)
{
card.set_code(code);
card.prefered = true;
card.forSelect = true;
card.selectPtr = i;
allCardsInSelectMessage.Add(card);
}*/
}
if (cancalable)
{
gameInfo.addHashedButton("cancleSelected", -1, superButtonType.no, InterString.Get("取消选择@ui"));
}
realizeCardsForSelect();
if (ES_selectHint != "")
{
gameField.setHint(ES_selectHint + " " + ES_min.ToString() + "-" + ES_max.ToString());
}
else
{
gameField.setHint(InterString.Get("请选择卡片。") + " " + ES_min.ToString() + "-" + ES_max.ToString());
}
break;
case GameMessage.SelectChain:
if (inIgnoranceReplay() || inTheWorld())
{
......@@ -5542,6 +5604,7 @@ public class Ocgcore : ServantWithCardDescription
}
break;
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
if (cardsSelectable.Count <= ES_min)
{
autoSendCards();
......@@ -5713,6 +5776,18 @@ public class Ocgcore : ServantWithCardDescription
real_send = true;
}
}
if (currentMessage == GameMessage.SelectUnselectCard)
{
if (cardsSelected.Count >= ES_min)
{
sendable = true;
}
if (cardsSelected.Count == ES_max || cardsSelected.Count == cardsSelectable.Count)
{
sendable = true;
real_send = true;
}
}
if (currentMessage == GameMessage.SelectTribute)
{
int all = 0;
......@@ -5771,7 +5846,7 @@ public class Ocgcore : ServantWithCardDescription
private void getSelectableCards()
{
if (currentMessage == GameMessage.SelectCard)
if (currentMessage == GameMessage.SelectCard || currentMessage == GameMessage.SelectUnselectCard)
{
for (int i = 0; i < allCardsInSelectMessage.Count; i++)
{
......@@ -6080,6 +6155,7 @@ public class Ocgcore : ServantWithCardDescription
switch (currentMessage)
{
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectTribute:
int c = ES_min;
if (cardsSelectable.Count < c)
......@@ -6119,6 +6195,7 @@ public class Ocgcore : ServantWithCardDescription
switch (currentMessage)
{
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectTribute:
case GameMessage.SelectSum:
m = new BinaryMaster();
......@@ -8108,6 +8185,8 @@ public class Ocgcore : ServantWithCardDescription
break;
case GameMessage.SelectCard:
break;
case GameMessage.SelectUnselectCard:
break;
case GameMessage.SelectChain:
break;
case GameMessage.SelectPlace:
......@@ -8178,6 +8257,7 @@ public class Ocgcore : ServantWithCardDescription
case GameMessage.SelectEffectYn:
case GameMessage.SelectYesNo:
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectTribute:
case GameMessage.SelectChain:
clearAllShowedB = true;
......@@ -8356,6 +8436,7 @@ public class Ocgcore : ServantWithCardDescription
}
break;
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectTribute:
case GameMessage.SelectSum:
if (card.forSelect)
......
......@@ -25,6 +25,7 @@
SelectSum = 23,
SelectDisfield = 24,
SortCard = 25,
SelectUnselectCard = 26,
ConfirmDecktop = 30,
ConfirmCards = 31,
ShuffleDeck = 32,
......@@ -34,8 +35,10 @@
ShuffleSetCard = 36,
ReverseDeck = 37,
DeckTop = 38,
ShuffleExtra = 39,
NewTurn = 40,
NewPhase = 41,
ConfirmExtratop = 42,
Move = 50,
PosChange = 53,
Set = 54,
......@@ -79,6 +82,8 @@
ReleaseRelation = 123,
TossCoin = 130,
TossDice = 131,
RockPaperScissors = 132,
HandResult = 133,
AnnounceRace = 140,
AnnounceAttrib = 141,
AnnounceCard = 142,
......
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