Commit c956015b authored by nanahira's avatar nanahira

CCG support

parent 43f0260f
Pipeline #4260 failed with stages
in 1 minute and 41 seconds
......@@ -338,7 +338,7 @@ public class Program : MonoBehaviour
#elif UNITY_IPHONE //iPhone
string GamePaths = Application.persistentDataPath + "/ygopro2/";
if (!File.Exists(GamePaths + "updates/version-1.035.2-Trackmaker.txt"))
if (!File.Exists(GamePaths + "updates/version-1.035.2-B.B.K.K.B.K.K.txt"))
{
string filePath = Application.streamingAssetsPath + "/ygopro2-data.zip";
ExtractZipFile(System.IO.File.ReadAllBytes(filePath), GamePaths);
......@@ -1116,7 +1116,7 @@ public class Program : MonoBehaviour
string FPS = m_FPS.ToString();
try { FPS = FPS.Substring(0, 5); } catch{}
GUI.Label(new Rect(10, 5, 200, 200), "[Ver 1.035.2-Trackmaker] " + "FPS: " + FPS);
GUI.Label(new Rect(10, 5, 200, 200), "[Ver 1.035.2-B.B.K.K.B.K.K] " + "FPS: " + FPS);
}
void Update()
......
......@@ -136,6 +136,12 @@ public class GameStringHelper
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 = "";
try
......
......@@ -921,6 +921,14 @@ public class Room : WindowServantSP
{
description += InterString.Get("(混合卡池)") + "\r\n";
}
if (rule == 3)
{
description += InterString.Get("(专有卡禁止)") + "\r\n";
}
if (rule == 4)
{
description += InterString.Get("(简中卡池)") + "\r\n";
}
if (no_check_deck)
{
description += InterString.Get("*不检查卡组") + "\r\n";
......
......@@ -105,6 +105,7 @@ public class DeckManager : ServantWithCardDescription
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1241));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1242));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1243));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1249));
clearAll();
UIHelper.registEvent(UIPopupList_main.gameObject, onUIPopupList_main);
UIHelper.registEvent(UIPopupList_second.gameObject, onUIPopupList_second);
......@@ -859,22 +860,26 @@ public class DeckManager : ServantWithCardDescription
int getOT()
{
int returnValue = -233;
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1240))
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1240)) // ocg
{
returnValue = 1;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1241))
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1241)) // tcg
{
returnValue = 2;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1242))
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1242)) // ocg + tcg
{
returnValue = 3;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1243))
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1243)) // custom
{
returnValue = 4;
}
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1249)) // ccg
{
returnValue = 5;
}
return returnValue;
}
......
......@@ -112,6 +112,23 @@ namespace YGOSharp
return (HasType(CardType.Fusion) || HasType(CardType.Synchro) || HasType(CardType.Xyz) || HasType(CardType.Link));
}
public bool IsCanPlayInRule(int hostInfoRule) {
if(hostInfoRule == -233)
return true;
const int cardOt = this.Ot;
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
bool allow_ccg = hostInfoRule == 0 || hostInfoRule == 4 || hostInfoRule == 2; // CCG can be used in OCG, CCG and OT duels
if(!allow_ocg && (cardOt & 0x3 == 0x1))
return false;
if(!allow_tcg && (cardOt & 0x3 == 0x2))
return false;
if(hostInfoRule == 4 && !(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;
}
internal Card(IDataRecord reader)
{
this.Str = new string[16];
......@@ -188,4 +205,4 @@ namespace YGOSharp
// }
// }
//}
}
\ No newline at end of file
}
......@@ -156,7 +156,7 @@ namespace YGOSharp
{
if (getBAN == -233 || banlist == null || banlist.GetQuantity(card.Id) == getBAN)
{
if (getOT == -233 || getOT == card.Ot)
if (card.IsCanPlayInRule(getOT))
{
if (getPack == "" || card.packFullName == getPack)
{
......
......@@ -113,7 +113,7 @@ namespace YGOSharp
}
}
public int Check(Banlist ban, bool ocg, bool tcg)
public int Check(Banlist ban, int allowRule)
{
if (Main.Count < 40 ||
Main.Count > 60 ||
......@@ -130,7 +130,7 @@ namespace YGOSharp
{
Card card = Card.Get(id);
AddToCards(cards, card);
if (!ocg && card.Ot == 1 || !tcg && card.Ot == 2)
if (!card.IsCanPlayInRule(allowRule))
return id;
if (card.HasType(CardType.Token))
return id;
......@@ -298,4 +298,4 @@ namespace YGOSharp
}
}
\ No newline at end of file
}
......@@ -1417,7 +1417,7 @@ MonoBehaviour:
keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0}
mText: KoishiPro2 iOS 1.035.2-Trackmaker
mText: KoishiPro2 iOS 1.035.2-B.B.K.K.B.K.K
mFontSize: 18
mFontStyle: 0
mAlignment: 1
......
......@@ -123,7 +123,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.035.2-Trackmaker
bundleVersion: 1.035.2-B.B.K.K.B.K.K
preloadedAssets: []
metroInputSource: 0
m_HolographicPauseOnTrackingLoss: 1
......
......@@ -243,6 +243,8 @@ AI脚本->AI脚本
(OCG卡池)->(OCG卡池)
(TCG卡池)->(TCG卡池)
(混合卡池)->(混合卡池)
(简中卡池)->(简中卡池)
(专有卡禁止)->(专有卡禁止)
*允许优先权->*允许优先权
*不检查卡组->*不检查卡组
*不洗牌->*不洗牌
......
KoishiPro2 iOS Version 1.035.2-Trackmaker
KoishiPro2 iOS Version 1.035.2-B.B.K.K.B.K.K
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