Commit d8033b10 authored by mercury233's avatar mercury233 Committed by Unicorn369

sync YGOSharp

parent f3f87c63
......@@ -1831,7 +1831,7 @@ public class Ocgcore : ServantWithCardDescription
//printDuelLog(derectattack);
}
break;
case GameMessage.AttackDiabled:
case GameMessage.AttackDisabled:
ES_hint = InterString.Get("攻击被无效时");
//printDuelLog(InterString.Get("攻击被无效"));
break;
......@@ -3403,7 +3403,7 @@ public class Ocgcore : ServantWithCardDescription
gameField.setHint(InterString.Get("请选择卡片。") + " " + ES_min.ToString() + "-" + ES_max.ToString());
}
break;
case GameMessage.SelectUnselectCard:
case GameMessage.SelectUnselect:
if (inIgnoranceReplay() || inTheWorld())
{
break;
......@@ -5109,7 +5109,7 @@ public class Ocgcore : ServantWithCardDescription
Sleep(40);
}
break;
case GameMessage.AttackDiabled:
case GameMessage.AttackDisabled:
//removeAttackHandler();
break;
case GameMessage.DamageStepStart:
......@@ -5889,7 +5889,7 @@ public class Ocgcore : ServantWithCardDescription
}
}
}
else if (currentMessage != GameMessage.SelectUnselectCard)
else if (currentMessage != GameMessage.SelectUnselect)
{
gameInfo.removeHashedButton("sendSelected");
}
......@@ -5901,7 +5901,7 @@ public class Ocgcore : ServantWithCardDescription
private void getSelectableCards()
{
if (currentMessage == GameMessage.SelectCard || currentMessage == GameMessage.SelectUnselectCard)
if (currentMessage == GameMessage.SelectCard || currentMessage == GameMessage.SelectUnselect)
{
for (int i = 0; i < allCardsInSelectMessage.Count; i++)
{
......@@ -6210,7 +6210,7 @@ public class Ocgcore : ServantWithCardDescription
switch (currentMessage)
{
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectUnselect:
case GameMessage.SelectTribute:
int c = ES_min;
if (cardsSelectable.Count < c)
......@@ -6250,11 +6250,11 @@ public class Ocgcore : ServantWithCardDescription
switch (currentMessage)
{
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectUnselect:
case GameMessage.SelectTribute:
case GameMessage.SelectSum:
m = new BinaryMaster();
if (currentMessage == GameMessage.SelectUnselectCard && cardsSelected.Count == 0)
if (currentMessage == GameMessage.SelectUnselect && cardsSelected.Count == 0)
{
m.writer.Write((Int32)(-1));
sendReturn(m.get());
......@@ -6815,10 +6815,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang - 1, curLie - 1];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.youshang) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.TopRight))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.zuoxia) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.BottomLeft))
lighted = true;
}
......@@ -6827,10 +6827,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang, curLie - 1];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.you) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Right))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.zuo) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Left))
lighted = true;
}
if (curLie - 1 >= 0)
......@@ -6838,10 +6838,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang + 1, curLie - 1];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.youxia) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.BottomRight))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.zuoshang) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.TopLeft))
lighted = true;
}
if (curHang - 1 >= 0)
......@@ -6849,10 +6849,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang - 1, curLie];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.shang) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Top))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.xia) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Bottom))
lighted = true;
}
......@@ -6860,10 +6860,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang + 1, curLie];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.xia) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Bottom))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.shang) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Top))
lighted = true;
}
if (curHang - 1 >= 0)
......@@ -6871,10 +6871,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang - 1, curLie + 1];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.zuoshang) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.TopLeft))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.youxia) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.BottomRight))
lighted = true;
}
......@@ -6882,10 +6882,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang, curLie + 1];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.zuo) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Left))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.you) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.Right))
lighted = true;
}
......@@ -6893,10 +6893,10 @@ public class Ocgcore : ServantWithCardDescription
{
gameCard card = vvv[curHang + 1, curLie + 1];
if (card.p.controller == 0)
if ((card.get_data().rDefense & CardFac.zuoxia) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.BottomLeft))
lighted = true;
if (card.p.controller == 1)
if ((card.get_data().rDefense & CardFac.youshang) > 0)
if (card.get_data().HasLinkMarker(CardLinkMarker.TopRight))
lighted = true;
}
......@@ -8247,7 +8247,7 @@ public class Ocgcore : ServantWithCardDescription
break;
case GameMessage.SelectCard:
break;
case GameMessage.SelectUnselectCard:
case GameMessage.SelectUnselect:
break;
case GameMessage.SelectChain:
break;
......@@ -8319,7 +8319,7 @@ public class Ocgcore : ServantWithCardDescription
case GameMessage.SelectEffectYn:
case GameMessage.SelectYesNo:
case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectUnselect:
case GameMessage.SelectTribute:
case GameMessage.SelectChain:
clearAllShowedB = true;
......@@ -8538,7 +8538,7 @@ public class Ocgcore : ServantWithCardDescription
realizeCardsForSelect();
}
break;
case GameMessage.SelectUnselectCard:
case GameMessage.SelectUnselect:
if (card.forSelect)
{
cardsSelected.Add(card);
......
......@@ -755,11 +755,11 @@ public class DeckManager : ServantWithCardDescription
}
if (ifType(GameStringManager.get_unsafe(1075)))
{
returnValue |= (UInt32)CardType.Monster + (UInt32)CardType.sp;
returnValue |= (UInt32)CardType.Monster + (UInt32)CardType.SpSummon;
}
if (ifType(GameStringManager.get_unsafe(1076)))
{
returnValue |= (UInt32)CardType.Monster + (UInt32)CardType.link;
returnValue |= (UInt32)CardType.Monster + (UInt32)CardType.Link;
}
}
if (UIPopupList_main.value == GameStringManager.get_unsafe(1313))
......@@ -1383,7 +1383,7 @@ public class DeckManager : ServantWithCardDescription
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.link) > 0
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0
)
{
deck.IExtra.Add(MonoCardInDeckManager_);
......@@ -1427,7 +1427,7 @@ public class DeckManager : ServantWithCardDescription
||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0
||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.link) > 0
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0
)
{
deck.IExtra.Add(card);
......@@ -1619,7 +1619,7 @@ public class DeckManager : ServantWithCardDescription
||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0
||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.link) > 0
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0
)
{
deck.IExtra.Add(deckTemp[i]);
......
......@@ -100,9 +100,14 @@ namespace YGOSharp
return ((Type & (int)type) != 0);
}
public bool HasLinkMarker(CardLinkMarker dir)
{
return (rDefense & (int)dir) != 0;
}
public bool IsExtraCard()
{
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));
}
internal Card(IDataRecord reader)
......
namespace YGOSharp.OCGWrapper.Enums
{
public enum CardLinkMarker
{
BottomLeft = 0x01,
Bottom = 0x02,
BottomRight = 0x04,
Left = 0x08,
Right = 0x20,
TopLeft = 0x40,
Top = 0x80,
TopRight = 0x100
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 15d8ac695c446594ea28abe34e500bf1
timeCreated: 1554560396
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -12,16 +12,3 @@
Defence = 0xC
}
}
class CardFac
{
public static int zuoxia = 1 << (1 - 1);
public static int xia = 1 << (2 - 1);
public static int youxia = 1 << (3 - 1);
public static int zuo = 1 << (4 - 1);
public static int you = 1 << (6 - 1);
public static int zuoshang = 1 << (7 - 1);
public static int shang = 1 << (8 - 1);
public static int youshang = 1 << (9 - 1);
}
\ No newline at end of file
......@@ -23,6 +23,8 @@
SeaSerpent = 0x40000,
Reptile = 0x80000,
Psycho = 0x100000,
DivineBeast = 0x200000
DivineBeast = 0x200000,
Wyrm = 0x800000,
Cyberse = 0x1000000
}
}
\ No newline at end of file
......@@ -25,7 +25,7 @@
Toon = 0x400000,
Xyz = 0x800000,
Pendulum = 0x1000000,
sp = 0x2000000,
link = 0x4000000,
SpSummon = 0x2000000,
Link = 0x4000000
}
}
\ No newline at end of file
......@@ -25,7 +25,7 @@
SelectSum = 23,
SelectDisfield = 24,
SortCard = 25,
SelectUnselectCard = 26,
SelectUnselect = 26,
ConfirmDecktop = 30,
ConfirmCards = 31,
ShuffleDeck = 32,
......@@ -73,7 +73,7 @@
RemoveCounter = 102,
Attack = 110,
Battle = 111,
AttackDiabled = 112,
AttackDisabled = 112,
DamageStepStart = 113,
DamageStepEnd = 114,
MissedEffect = 120,
......
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