Commit 2cf7a1d3 authored by mercury233's avatar mercury233 Committed by nanahira

add basic support for cant check grave (#18)

parent ebfc2c37
...@@ -147,7 +147,11 @@ public class Book : WindowServant2D ...@@ -147,7 +147,11 @@ public class Book : WindowServant2D
} }
} }
opString += master.managedString.TrimEnd('\n'); opString += master.managedString.TrimEnd('\n');
if (master.strings.Count > 0) if (Program.I().ocgcore.cantCheckGrave)
{
labop.text = InterString.Get("不能查看对手使用过的卡");
}
else if (master.strings.Count > 0)
{ {
labop.text = InterString.Get("[ff5555]对手使用过:@n[?][-]", opString); labop.text = InterString.Get("[ff5555]对手使用过:@n[?][-]", opString);
} }
......
...@@ -59,6 +59,11 @@ public class gameHiddenButton : OCGobject ...@@ -59,6 +59,11 @@ public class gameHiddenButton : OCGobject
void showAll() void showAll()
{ {
if (location == CardLocation.Grave && Program.I().ocgcore.cantCheckGrave)
{
Program.I().cardDescription.RMSshow_none(InterString.Get("不能确认墓地里的卡"));
return;
}
bool allShow = true; bool allShow = true;
for (int i = 0; i < Program.I().ocgcore.cards.Count; i++) if (Program.I().ocgcore.cards[i].gameObject.activeInHierarchy) for (int i = 0; i < Program.I().ocgcore.cards.Count; i++) if (Program.I().ocgcore.cards[i].gameObject.activeInHierarchy)
{ {
...@@ -151,6 +156,10 @@ public class gameHiddenButton : OCGobject ...@@ -151,6 +156,10 @@ public class gameHiddenButton : OCGobject
void excite() void excite()
{ {
excited = true; excited = true;
if (location == CardLocation.Grave && Program.I().ocgcore.cantCheckGrave)
{
return;
}
YGOSharp.Card data = null; YGOSharp.Card data = null;
string tailString = ""; string tailString = "";
uint con = 0; uint con = 0;
......
...@@ -528,6 +528,11 @@ public class Ocgcore : ServantWithCardDescription ...@@ -528,6 +528,11 @@ public class Ocgcore : ServantWithCardDescription
} }
if (condition == Condition.duel) if (condition == Condition.duel)
{ {
if (cantCheckGrave)
{
RMSshow_none(InterString.Get("不能确认墓地里的卡,无法跨越时间线!"));
return;
}
if (gameInfo.amIdanger()) if (gameInfo.amIdanger())
{ {
RMSshow_none(InterString.Get("您的时间不足无法使用ReadingSteiner!")); RMSshow_none(InterString.Get("您的时间不足无法使用ReadingSteiner!"));
...@@ -712,6 +717,11 @@ public class Ocgcore : ServantWithCardDescription ...@@ -712,6 +717,11 @@ public class Ocgcore : ServantWithCardDescription
void on_stop() void on_stop()
{ {
if (cantCheckGrave)
{
RMSshow_none(InterString.Get("不能确认墓地里的卡,无法跨越时间线!"));
return;
}
if (paused == false) if (paused == false)
{ {
destroy(waitObject, 0, false, true); destroy(waitObject, 0, false, true);
...@@ -1228,6 +1238,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -1228,6 +1238,7 @@ public class Ocgcore : ServantWithCardDescription
} }
autoForceChainHandlerType autoForceChainHandler = autoForceChainHandlerType.manDoAll; autoForceChainHandlerType autoForceChainHandler = autoForceChainHandlerType.manDoAll;
bool deckReserved = false; bool deckReserved = false;
public bool cantCheckGrave = false;
public int turns = 0; public int turns = 0;
public List<string> confirmedCards = new List<string>(); public List<string> confirmedCards = new List<string>();
void logicalizeMessage(Package p) void logicalizeMessage(Package p)
...@@ -1282,6 +1293,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -1282,6 +1293,7 @@ public class Ocgcore : ServantWithCardDescription
break; break;
case GameMessage.Win: case GameMessage.Win:
deckReserved = false; deckReserved = false;
cantCheckGrave = false;
player = localPlayer(r.ReadByte()); player = localPlayer(r.ReadByte());
int winType = r.ReadByte(); int winType = r.ReadByte();
keys.Insert(0, currentMessageIndex); keys.Insert(0, currentMessageIndex);
...@@ -1329,6 +1341,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -1329,6 +1341,7 @@ public class Ocgcore : ServantWithCardDescription
Program.I().room.joinWithReconnect = false; Program.I().room.joinWithReconnect = false;
turns = 0; turns = 0;
deckReserved = false; deckReserved = false;
cantCheckGrave = false;
keys.Insert(0, currentMessageIndex); keys.Insert(0, currentMessageIndex);
RMSshow_clear(); RMSshow_clear();
md5Maker = 0; md5Maker = 0;
...@@ -2031,6 +2044,10 @@ public class Ocgcore : ServantWithCardDescription ...@@ -2031,6 +2044,10 @@ public class Ocgcore : ServantWithCardDescription
int ptype = r.ReadByte(); int ptype = r.ReadByte();
int pvalue = r.ReadInt32(); int pvalue = r.ReadInt32();
string valstring = GameStringManager.get(pvalue); string valstring = GameStringManager.get(pvalue);
if (pvalue == 38723936)
{
valstring = InterString.Get("不能确认墓地里的卡");
}
if (ptype == 6) if (ptype == 6)
{ {
if (controller==0) if (controller==0)
...@@ -5310,6 +5327,21 @@ public class Ocgcore : ServantWithCardDescription ...@@ -5310,6 +5327,21 @@ public class Ocgcore : ServantWithCardDescription
int ptype = r.ReadByte(); int ptype = r.ReadByte();
int pvalue = r.ReadInt32(); int pvalue = r.ReadInt32();
string valstring = GameStringManager.get(pvalue); string valstring = GameStringManager.get(pvalue);
if (pvalue == 38723936)
{
valstring = InterString.Get("不能确认墓地里的卡");
if (player == 0)
{
if (ptype == 6)
{
clearAllShowed();
Program.I().cardDescription.setData(YGOSharp.CardsManager.Get(38723936), GameTextureManager.opBack, "", true);
cantCheckGrave = true;
}
if (ptype == 7)
cantCheckGrave = false;
}
}
if (ptype == 6) if (ptype == 6)
{ {
if (player == 0) if (player == 0)
...@@ -8169,6 +8201,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8169,6 +8201,7 @@ public class Ocgcore : ServantWithCardDescription
} }
} }
deckReserved = false; deckReserved = false;
cantCheckGrave = false;
surrended = false; surrended = false;
Program.I().room.duelEnded = false; Program.I().room.duelEnded = false;
gameInfo.swaped = false; gameInfo.swaped = false;
...@@ -8193,6 +8226,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8193,6 +8226,7 @@ public class Ocgcore : ServantWithCardDescription
cardsForConfirm.Clear(); cardsForConfirm.Clear();
logicalClearChain(); logicalClearChain();
deckReserved = false; deckReserved = false;
cantCheckGrave = false;
if (isShowed) if (isShowed)
{ {
clearResponse(); clearResponse();
...@@ -8977,7 +9011,10 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8977,7 +9011,10 @@ public class Ocgcore : ServantWithCardDescription
{ {
if (Program.I().setting.setting.spyer.value) if (Program.I().setting.setting.spyer.value)
{ {
Program.I().cardDescription.shiftCardShower(false); if (cantCheckGrave)
RMSshow_none(InterString.Get("不能确认墓地里的卡,监控全局卡片功能暂停使用。"));
else
Program.I().cardDescription.shiftCardShower(false);
} }
if (gameInfo.queryHashedButton("hide_all_card") == true) if (gameInfo.queryHashedButton("hide_all_card") == true)
{ {
......
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