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

update SC ot

parent a4bcd6b6
......@@ -170,27 +170,14 @@ public class GameStringHelper
public static string getName(YGOSharp.Card card)
{
string limitot = "";
switch(card.Ot)
{
case 1:
limitot = GameStringManager.get_unsafe(1240);
break;
case 2:
limitot = GameStringManager.get_unsafe(1241);
break;
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;
}
if ((card.Ot & 0x1) > 0)
limitot += "[OCG]";
if ((card.Ot & 0x2) > 0)
limitot += "[TCG]";
if ((card.Ot & 0x4) > 0)
limitot += "[Custom]";
if ((card.Ot & 0x8) > 0)
limitot += InterString.Get("[简中]");
string re = "";
try
{
......
......@@ -915,6 +915,18 @@ public class Room : WindowServantSP
description += InterString.Get("(TCG卡池)") + "\r\n";
}
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";
}
......
......@@ -101,11 +101,11 @@ public class DeckManager : ServantWithCardDescription
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1316));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1317));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1318));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1240));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1241));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1242));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1249));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1243));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1481));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1482));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1483));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1484));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1485));
clearAll();
UIHelper.registEvent(UIPopupList_main.gameObject, onUIPopupList_main);
UIHelper.registEvent(UIPopupList_second.gameObject, onUIPopupList_second);
......@@ -860,26 +860,26 @@ public class DeckManager : ServantWithCardDescription
int getOT()
{
int returnValue = -233;
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1240)) // ocg
{
returnValue = 0;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1241)) // tcg
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1481))
{
returnValue = 1;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1242)) // ocg + tcg
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1482))
{
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;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1485))
{
returnValue = 3;
}
return returnValue;
}
......
......@@ -113,39 +113,12 @@ namespace YGOSharp
}
public bool IsCanPlayInRule(int hostInfoRule) {
if(hostInfoRule == -233)
return true;
int cardOt = this.Ot;
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;
}
if(hostInfoRule == -233 || hostInfoRule == 5)
return true;
// TODO
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)
{
this.Str = new string[16];
......
......@@ -165,7 +165,7 @@ namespace YGOSharp
{
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)
{
......
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