Commit a7121ec6 authored by mercury233's avatar mercury233 Committed by nanahira

update SC ot

parent a4bcd6b6
...@@ -170,27 +170,14 @@ public class GameStringHelper ...@@ -170,27 +170,14 @@ public class GameStringHelper
public static string getName(YGOSharp.Card card) public static string getName(YGOSharp.Card card)
{ {
string limitot = ""; string limitot = "";
switch(card.Ot) if ((card.Ot & 0x1) > 0)
{ limitot += "[OCG]";
case 1: if ((card.Ot & 0x2) > 0)
limitot = GameStringManager.get_unsafe(1240); limitot += "[TCG]";
break; if ((card.Ot & 0x4) > 0)
case 2: limitot += "[Custom]";
limitot = GameStringManager.get_unsafe(1241); if ((card.Ot & 0x8) > 0)
break; limitot += InterString.Get("[简中]");
case 3:
limitot = GameStringManager.get_unsafe(1242);
break;
case 4:
limitot = GameStringManager.get_unsafe(1243);
break;
case 0x9:
limitot = GameStringManager.get_unsafe(1249);
break;
case 0xb:
limitot = GameStringManager.get_unsafe(1249) + "|" + GameStringManager.get_unsafe(1241);
break;
}
string re = ""; string re = "";
try try
{ {
......
...@@ -915,6 +915,18 @@ public class Room : WindowServantSP ...@@ -915,6 +915,18 @@ public class Room : WindowServantSP
description += InterString.Get("(TCG卡池)") + "\r\n"; description += InterString.Get("(TCG卡池)") + "\r\n";
} }
if (rule == 2) if (rule == 2)
{
description += InterString.Get("(简中卡池)") + "\r\n";
}
if (rule == 3)
{
description += InterString.Get("(自制卡卡池)") + "\r\n";
}
if (rule == 4)
{
description += InterString.Get("(无独有卡卡池)") + "\r\n";
}
if (rule == 5)
{ {
description += InterString.Get("(混合卡池)") + "\r\n"; description += InterString.Get("(混合卡池)") + "\r\n";
} }
......
...@@ -101,11 +101,11 @@ public class DeckManager : ServantWithCardDescription ...@@ -101,11 +101,11 @@ public class DeckManager : ServantWithCardDescription
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1316)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1316));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1317)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1317));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1318)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1318));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1240)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1481));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1241)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1482));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1242)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1483));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1249)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1484));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1243)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1485));
clearAll(); clearAll();
UIHelper.registEvent(UIPopupList_main.gameObject, onUIPopupList_main); UIHelper.registEvent(UIPopupList_main.gameObject, onUIPopupList_main);
UIHelper.registEvent(UIPopupList_second.gameObject, onUIPopupList_second); UIHelper.registEvent(UIPopupList_second.gameObject, onUIPopupList_second);
...@@ -860,26 +860,26 @@ public class DeckManager : ServantWithCardDescription ...@@ -860,26 +860,26 @@ public class DeckManager : ServantWithCardDescription
int getOT() int getOT()
{ {
int returnValue = -233; int returnValue = -233;
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1240)) // ocg if (UIPopupList_ban.value == GameStringManager.get_unsafe(1481))
{
returnValue = 0;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1241)) // tcg
{ {
returnValue = 1; returnValue = 1;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1242)) // ocg + tcg if (UIPopupList_ban.value == GameStringManager.get_unsafe(1482))
{ {
returnValue = 2; returnValue = 2;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1243)) // custom if (UIPopupList_ban.value == GameStringManager.get_unsafe(1483))
{ {
returnValue = 3; returnValue = 8;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1249)) // ccg if (UIPopupList_ban.value == GameStringManager.get_unsafe(1484))
{ {
returnValue = 4; returnValue = 4;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1485))
{
returnValue = 3;
}
return returnValue; return returnValue;
} }
......
...@@ -113,39 +113,12 @@ namespace YGOSharp ...@@ -113,39 +113,12 @@ namespace YGOSharp
} }
public bool IsCanPlayInRule(int hostInfoRule) { public bool IsCanPlayInRule(int hostInfoRule) {
if(hostInfoRule == -233) if(hostInfoRule == -233 || hostInfoRule == 5)
return true; return true;
int cardOt = this.Ot; // TODO
if(hostInfoRule != 4) { // non-CCG
bool allow_ocg = hostInfoRule == 0 || hostInfoRule == 2; // OCG can be used in OCG and OT duels
bool allow_tcg = hostInfoRule == 1 || hostInfoRule == 2; // TCG can be used in TCG and OT duels
if(!allow_ocg && ((cardOt & 0x3) == 0x1))
return false;
if(!allow_tcg && ((cardOt & 0x3) == 0x2))
return false;
} else if(!(cardOt & 0x8) && !!(cardOt & 0x3)) { // in CCG duels, cards labeled with ither OCG or TCG, but not CCG, would not be allowed.
return false;
}
return true; return true;
} }
public bool IsCanSearchInRule(int hostInfoRule) {
if(hostInfoRule == -233)
return true;
int cardOt = this.Ot;
if(hostInfoRule == 0 && (cardOt & 0x3) != 0x1) // ocg
return false;
if(hostInfoRule == 1 && (cardOt & 0x3) != 0x2) // tcg
return false;
if(hostInfoRule == 2 && (cardOt & 0x3) != 0x3) // ot
return false;
if(hostInfoRule == 3 && (cardOt & 0x4) != 0x4) // DIY
return false;
if(hostInfoRule == 4 && (cardOt & 0x8) != 0x8) // ccg
return false;
return true;
}
internal Card(IDataRecord reader) internal Card(IDataRecord reader)
{ {
this.Str = new string[16]; this.Str = new string[16];
......
...@@ -165,7 +165,7 @@ namespace YGOSharp ...@@ -165,7 +165,7 @@ namespace YGOSharp
{ {
if (getBAN == -233 || banlist == null || banlist.GetQuantity(card.Id) == getBAN) if (getBAN == -233 || banlist == null || banlist.GetQuantity(card.Id) == getBAN)
{ {
if (card.IsCanSearchInRule(getOT)) if (getOT == -233 || (getOT & card.Ot) == getOT)
{ {
if (getPack == "" || card.packFullName == getPack) if (getPack == "" || card.packFullName == getPack)
{ {
......
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