Commit c956015b authored by nanahira's avatar nanahira

CCG support

parent 43f0260f
...@@ -338,7 +338,7 @@ public class Program : MonoBehaviour ...@@ -338,7 +338,7 @@ public class Program : MonoBehaviour
#elif UNITY_IPHONE //iPhone #elif UNITY_IPHONE //iPhone
string GamePaths = Application.persistentDataPath + "/ygopro2/"; 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"; string filePath = Application.streamingAssetsPath + "/ygopro2-data.zip";
ExtractZipFile(System.IO.File.ReadAllBytes(filePath), GamePaths); ExtractZipFile(System.IO.File.ReadAllBytes(filePath), GamePaths);
...@@ -1116,7 +1116,7 @@ public class Program : MonoBehaviour ...@@ -1116,7 +1116,7 @@ public class Program : MonoBehaviour
string FPS = m_FPS.ToString(); string FPS = m_FPS.ToString();
try { FPS = FPS.Substring(0, 5); } catch{} 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() void Update()
......
...@@ -136,6 +136,12 @@ public class GameStringHelper ...@@ -136,6 +136,12 @@ public class GameStringHelper
case 4: case 4:
limitot = GameStringManager.get_unsafe(1243); limitot = GameStringManager.get_unsafe(1243);
break; 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
......
...@@ -921,6 +921,14 @@ public class Room : WindowServantSP ...@@ -921,6 +921,14 @@ public class Room : WindowServantSP
{ {
description += InterString.Get("(混合卡池)") + "\r\n"; 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) if (no_check_deck)
{ {
description += InterString.Get("*不检查卡组") + "\r\n"; description += InterString.Get("*不检查卡组") + "\r\n";
......
...@@ -105,6 +105,7 @@ public class DeckManager : ServantWithCardDescription ...@@ -105,6 +105,7 @@ public class DeckManager : ServantWithCardDescription
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1241)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1241));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1242)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1242));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1243)); UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1243));
UIPopupList_ban.AddItem(GameStringManager.get_unsafe(1249));
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);
...@@ -859,22 +860,26 @@ public class DeckManager : ServantWithCardDescription ...@@ -859,22 +860,26 @@ public class DeckManager : ServantWithCardDescription
int getOT() int getOT()
{ {
int returnValue = -233; int returnValue = -233;
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1240)) if (UIPopupList_ban.value == GameStringManager.get_unsafe(1240)) // ocg
{ {
returnValue = 1; returnValue = 1;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1241)) if (UIPopupList_ban.value == GameStringManager.get_unsafe(1241)) // tcg
{ {
returnValue = 2; returnValue = 2;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1242)) if (UIPopupList_ban.value == GameStringManager.get_unsafe(1242)) // ocg + tcg
{ {
returnValue = 3; returnValue = 3;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1243)) if (UIPopupList_ban.value == GameStringManager.get_unsafe(1243)) // custom
{ {
returnValue = 4; returnValue = 4;
} }
if (UIPopupList_ban.value == GameStringManager.get_unsafe(1249)) // ccg
{
returnValue = 5;
}
return returnValue; return returnValue;
} }
......
...@@ -112,6 +112,23 @@ namespace YGOSharp ...@@ -112,6 +112,23 @@ namespace YGOSharp
return (HasType(CardType.Fusion) || HasType(CardType.Synchro) || HasType(CardType.Xyz) || HasType(CardType.Link)); 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) internal Card(IDataRecord reader)
{ {
this.Str = new string[16]; this.Str = new string[16];
......
...@@ -156,7 +156,7 @@ namespace YGOSharp ...@@ -156,7 +156,7 @@ namespace YGOSharp
{ {
if (getBAN == -233 || banlist == null || banlist.GetQuantity(card.Id) == getBAN) 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) if (getPack == "" || card.packFullName == getPack)
{ {
......
...@@ -113,7 +113,7 @@ namespace YGOSharp ...@@ -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 || if (Main.Count < 40 ||
Main.Count > 60 || Main.Count > 60 ||
...@@ -130,7 +130,7 @@ namespace YGOSharp ...@@ -130,7 +130,7 @@ namespace YGOSharp
{ {
Card card = Card.Get(id); Card card = Card.Get(id);
AddToCards(cards, card); AddToCards(cards, card);
if (!ocg && card.Ot == 1 || !tcg && card.Ot == 2) if (!card.IsCanPlayInRule(allowRule))
return id; return id;
if (card.HasType(CardType.Token)) if (card.HasType(CardType.Token))
return id; return id;
......
...@@ -1417,7 +1417,7 @@ MonoBehaviour: ...@@ -1417,7 +1417,7 @@ MonoBehaviour:
keepCrispWhenShrunk: 1 keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3} mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0} 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 mFontSize: 18
mFontStyle: 0 mFontStyle: 0
mAlignment: 1 mAlignment: 1
......
...@@ -123,7 +123,7 @@ PlayerSettings: ...@@ -123,7 +123,7 @@ PlayerSettings:
16:10: 1 16:10: 1
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 1.035.2-Trackmaker bundleVersion: 1.035.2-B.B.K.K.B.K.K
preloadedAssets: [] preloadedAssets: []
metroInputSource: 0 metroInputSource: 0
m_HolographicPauseOnTrackingLoss: 1 m_HolographicPauseOnTrackingLoss: 1
......
...@@ -243,6 +243,8 @@ AI脚本->AI脚本 ...@@ -243,6 +243,8 @@ AI脚本->AI脚本
(OCG卡池)->(OCG卡池) (OCG卡池)->(OCG卡池)
(TCG卡池)->(TCG卡池) (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