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

refactor enums

parent d8033b10
......@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using YGOSharp.OCGWrapper.Enums;
public class Book : WindowServant2D
{
......@@ -102,15 +103,15 @@ public class Book : WindowServant2D
}
foreach (var item in Program.I().ocgcore.cards)
{
if (item.p.location == (UInt32)game_location.search)
if (item.p.location == (UInt32)CardLocation.Search)
{
continue;
}
if (item.p.location == (UInt32)game_location.LOCATION_UNKNOWN)
if (item.p.location == (UInt32)CardLocation.Unknown)
{
continue;
}
if (item.p.location == (UInt32)game_location.LOCATION_DECK)
if (item.p.location == (UInt32)CardLocation.Deck)
{
continue;
}
......@@ -132,7 +133,7 @@ public class Book : WindowServant2D
master = new MultiStringMaster();
foreach (var item in Program.I().ocgcore.cards)
{
if (item.p.location == (UInt32)game_location.search)
if (item.p.location == (UInt32)CardLocation.Search)
{
continue;
}
......@@ -169,11 +170,11 @@ public class Book : WindowServant2D
bool died = false;
foreach (var item in Program.I().ocgcore.cards)
{
if (item.p.location == (UInt32)game_location.search)
if (item.p.location == (UInt32)CardLocation.Search)
{
continue;
}
if (item.p.location == (UInt32)game_location.LOCATION_UNKNOWN)
if (item.p.location == (UInt32)CardLocation.Unknown)
{
continue;
}
......@@ -181,15 +182,15 @@ public class Book : WindowServant2D
{
if (item.p.controller == i)
{
if (item.p.location == (UInt32)game_location.LOCATION_MZONE || item.p.location == (UInt32)game_location.LOCATION_SZONE)
if (item.p.location == (UInt32)CardLocation.MonsterZone || item.p.location == (UInt32)CardLocation.SpellZone)
{
fieldCards[i]++;
}
if (item.p.location == (UInt32)game_location.LOCATION_HAND)
if (item.p.location == (UInt32)CardLocation.Hand)
{
handCards[i]++;
}
if (item.p.location == (UInt32)game_location.LOCATION_GRAVE || item.p.location == (UInt32)game_location.LOCATION_REMOVED)
if (item.p.location == (UInt32)CardLocation.Grave || item.p.location == (UInt32)CardLocation.Removed)
{
resourceCards[i]++;
}
......
using UnityEngine;
using System;
using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums;
public class CardDescription : Servant
{
......@@ -251,30 +252,30 @@ public class CardDescription : Servant
{
if (gps.controller == 0)
{
if ((gps.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if ((gps.location & (UInt32)CardLocation.Grave) > 0)
{
myGrave.Add(curCard);
}
if ((gps.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if ((gps.location & (UInt32)CardLocation.Removed) > 0)
{
myBanished.Add(curCard);
}
if ((gps.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if ((gps.location & (UInt32)CardLocation.Extra) > 0)
{
myExtra.Add(curCard);
}
}
else
{
if ((gps.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if ((gps.location & (UInt32)CardLocation.Grave) > 0)
{
opGrave.Add(curCard);
}
if ((gps.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if ((gps.location & (UInt32)CardLocation.Removed) > 0)
{
opBanished.Add(curCard);
}
if ((gps.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if ((gps.location & (UInt32)CardLocation.Extra) > 0)
{
opExtra.Add(curCard);
}
......
......@@ -105,72 +105,72 @@ public static class TcpHelper
{
MemoryStream memoryStream = new MemoryStream(datas[i]);
BinaryReader r = new BinaryReader(memoryStream);
var ms = (YGOSharp.Network.Enums.StocMessage)(r.ReadByte());
var ms = (StocMessage)(r.ReadByte());
switch (ms)
{
case YGOSharp.Network.Enums.StocMessage.GameMsg:
((Room)Program.I().room).StocMessage_GameMsg(r);
case StocMessage.GameMsg:
Program.I().room.StocMessage_GameMsg(r);
break;
case YGOSharp.Network.Enums.StocMessage.ErrorMsg:
((Room)Program.I().room).StocMessage_ErrorMsg(r);
case StocMessage.ErrorMsg:
Program.I().room.StocMessage_ErrorMsg(r);
break;
case YGOSharp.Network.Enums.StocMessage.SelectHand:
((Room)Program.I().room).StocMessage_SelectHand(r);
case StocMessage.SelectHand:
Program.I().room.StocMessage_SelectHand(r);
break;
case YGOSharp.Network.Enums.StocMessage.SelectTp:
((Room)Program.I().room).StocMessage_SelectTp(r);
case StocMessage.SelectTp:
Program.I().room.StocMessage_SelectTp(r);
break;
case YGOSharp.Network.Enums.StocMessage.HandResult:
((Room)Program.I().room).StocMessage_HandResult(r);
case StocMessage.HandResult:
Program.I().room.StocMessage_HandResult(r);
break;
case YGOSharp.Network.Enums.StocMessage.TpResult:
((Room)Program.I().room).StocMessage_TpResult(r);
case StocMessage.TpResult:
Program.I().room.StocMessage_TpResult(r);
break;
case YGOSharp.Network.Enums.StocMessage.ChangeSide:
((Room)Program.I().room).StocMessage_ChangeSide(r);
case StocMessage.ChangeSide:
Program.I().room.StocMessage_ChangeSide(r);
TcpHelper.SaveRecord();
break;
case YGOSharp.Network.Enums.StocMessage.WaitingSide:
((Room)Program.I().room).StocMessage_WaitingSide(r);
case StocMessage.WaitingSide:
Program.I().room.StocMessage_WaitingSide(r);
TcpHelper.SaveRecord();
break;
case YGOSharp.Network.Enums.StocMessage.CreateGame:
((Room)Program.I().room).StocMessage_CreateGame(r);
case StocMessage.CreateGame:
Program.I().room.StocMessage_CreateGame(r);
break;
case YGOSharp.Network.Enums.StocMessage.JoinGame:
((Room)Program.I().room).StocMessage_JoinGame(r);
case StocMessage.JoinGame:
Program.I().room.StocMessage_JoinGame(r);
break;
case YGOSharp.Network.Enums.StocMessage.TypeChange:
((Room)Program.I().room).StocMessage_TypeChange(r);
case StocMessage.TypeChange:
Program.I().room.StocMessage_TypeChange(r);
break;
case YGOSharp.Network.Enums.StocMessage.LeaveGame:
((Room)Program.I().room).StocMessage_LeaveGame(r);
case StocMessage.LeaveGame:
Program.I().room.StocMessage_LeaveGame(r);
break;
case YGOSharp.Network.Enums.StocMessage.DuelStart:
((Room)Program.I().room).StocMessage_DuelStart(r);
case StocMessage.DuelStart:
Program.I().room.StocMessage_DuelStart(r);
break;
case YGOSharp.Network.Enums.StocMessage.DuelEnd:
((Room)Program.I().room).StocMessage_DuelEnd(r);
case StocMessage.DuelEnd:
Program.I().room.StocMessage_DuelEnd(r);
TcpHelper.SaveRecord();
break;
case YGOSharp.Network.Enums.StocMessage.Replay:
((Room)Program.I().room).StocMessage_Replay(r);
case StocMessage.Replay:
Program.I().room.StocMessage_Replay(r);
TcpHelper.SaveRecord();
break;
case YGOSharp.Network.Enums.StocMessage.TimeLimit:
((Ocgcore)Program.I().ocgcore).StocMessage_TimeLimit(r);
case StocMessage.TimeLimit:
Program.I().ocgcore.StocMessage_TimeLimit(r);
break;
case YGOSharp.Network.Enums.StocMessage.Chat:
((Room)Program.I().room).StocMessage_Chat(r);
case StocMessage.Chat:
Program.I().room.StocMessage_Chat(r);
break;
case YGOSharp.Network.Enums.StocMessage.HsPlayerEnter:
((Room)Program.I().room).StocMessage_HsPlayerEnter(r);
case StocMessage.HsPlayerEnter:
Program.I().room.StocMessage_HsPlayerEnter(r);
break;
case YGOSharp.Network.Enums.StocMessage.HsPlayerChange:
((Room)Program.I().room).StocMessage_HsPlayerChange(r);
case StocMessage.HsPlayerChange:
Program.I().room.StocMessage_HsPlayerChange(r);
break;
case YGOSharp.Network.Enums.StocMessage.HsWatchChange:
((Room)Program.I().room).StocMessage_HsWatchChange(r);
case StocMessage.HsWatchChange:
Program.I().room.StocMessage_HsWatchChange(r);
break;
case YGOSharp.Network.Enums.StocMessage.RoomList:
((Room)Program.I().room).StocMessage_RoomList(r);
......@@ -273,21 +273,21 @@ public static class TcpHelper
deck = deckFor;
Package message = new Package();
message.Fuction = (int)CtosMessage.UpdateDeck;
message.Data.writer.Write((int)deckFor.Main.Count + deckFor.Extra.Count);
message.Data.writer.Write((int)deckFor.Side.Count);
message.Data.writer.Write(deckFor.Main.Count + deckFor.Extra.Count);
message.Data.writer.Write(deckFor.Side.Count);
for (int i = 0; i < deckFor.Main.Count; i++)
{
message.Data.writer.Write((int)deckFor.Main[i]);
var c = YGOSharp.CardsManager.Get((int)deckFor.Main[i]);
message.Data.writer.Write(deckFor.Main[i]);
var c = YGOSharp.CardsManager.Get(deckFor.Main[i]);
deckStrings.Add(c.Name);
}
for (int i = 0; i < deckFor.Extra.Count; i++)
{
message.Data.writer.Write((int)deckFor.Extra[i]);
message.Data.writer.Write(deckFor.Extra[i]);
}
for (int i = 0; i < deckFor.Side.Count; i++)
{
message.Data.writer.Write((int)deckFor.Side[i]);
message.Data.writer.Write(deckFor.Side[i]);
}
Send(message);
}
......@@ -337,7 +337,7 @@ public static class TcpHelper
message.Data.writer.Write((Int16)Config.ClientVersion);
message.Data.writer.Write((byte)204);
message.Data.writer.Write((byte)204);
message.Data.writer.Write((Int32)0);
message.Data.writer.Write(0);
message.Data.writer.WriteUnicode(psw, 20);
Send(message);
}
......@@ -471,12 +471,12 @@ public static class TcpHelper
i++;
try
{
if (item.Fuction == (int)YGOSharp.OCGWrapper.Enums.GameMessage.Start)
if (item.Fuction == (int)GameMessage.Start)
{
write = true;
startI = i;
}
if (item.Fuction == (int)YGOSharp.OCGWrapper.Enums.GameMessage.ReloadField)
if (item.Fuction == (int)GameMessage.ReloadField)
{
write = true;
startI = i;
......@@ -645,7 +645,7 @@ public static class BinaryExtensions
a.controller = (UInt32)Program.I().ocgcore.localPlayer(reader.ReadByte());
a.location = reader.ReadByte();
a.sequence = reader.ReadByte();
a.position = (int)game_position.POS_FACEUP_ATTACK;
a.position = (int)CardPosition.FaceUpAttack;
return a;
}
......
......@@ -4,6 +4,8 @@ using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public static class UIHelper
{
[DllImport("user32")]
......@@ -980,31 +982,31 @@ public static class UIHelper
{
res += InterString.Get("对方");
}
if ((p1.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((p1.location & (UInt32)CardLocation.Deck) > 0)
{
res += InterString.Get("卡组");
}
if ((p1.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if ((p1.location & (UInt32)CardLocation.Extra) > 0)
{
res += InterString.Get("额外");
}
if ((p1.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if ((p1.location & (UInt32)CardLocation.Grave) > 0)
{
res += InterString.Get("墓地");
}
if ((p1.location & (UInt32)game_location.LOCATION_HAND) > 0)
if ((p1.location & (UInt32)CardLocation.Hand) > 0)
{
res += InterString.Get("手牌");
}
if ((p1.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((p1.location & (UInt32)CardLocation.MonsterZone) > 0)
{
res += InterString.Get("前场");
}
if ((p1.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if ((p1.location & (UInt32)CardLocation.Removed) > 0)
{
res += InterString.Get("除外");
}
if ((p1.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((p1.location & (UInt32)CardLocation.SpellZone) > 0)
{
res += InterString.Get("后场");
}
......@@ -1014,41 +1016,41 @@ public static class UIHelper
//internal static string getGPSstringPosition(GPS p1)
//{
// string res = "";
// if ((p1.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
// if ((p1.location & (UInt32)CardLocation.Overlay) > 0)
// {
// res += InterString.Get("(被叠放)");
// }
// else
// {
// if ((p1.position & (UInt32)game_position.POS_FACEUP_ATTACK) > 0)
// if ((p1.position & (UInt32)CardPosition.FaceUpAttack) > 0)
// {
// res += InterString.Get("(表侧攻击)");
// }
// else if ((p1.position & (UInt32)game_position.POS_FACEUP_DEFENSE) > 0)
// else if ((p1.position & (UInt32)CardPosition.FaceUp_DEFENSE) > 0)
// {
// res += InterString.Get("(表侧防御)");
// }
// else if ((p1.position & (UInt32)game_position.POS_FACEDOWN_ATTACK) > 0)
// else if ((p1.position & (UInt32)CardPosition.FaceDownAttack) > 0)
// {
// res += InterString.Get("(里侧攻击)");
// }
// else if ((p1.position & (UInt32)game_position.POS_FACEDOWN_DEFENSE) > 0)
// else if ((p1.position & (UInt32)CardPosition.FaceDown_DEFENSE) > 0)
// {
// res += InterString.Get("(里侧防御)");
// }
// else if ((p1.position & (UInt32)game_position.POS_ATTACK) > 0)
// else if ((p1.position & (UInt32)CardPosition.Attack) > 0)
// {
// res += InterString.Get("(攻击)");
// }
// else if ((p1.position & (UInt32)game_position.POS_DEFENSE) > 0)
// else if ((p1.position & (UInt32)CardPosition.POS_DEFENSE) > 0)
// {
// res += InterString.Get("(防御)");
// }
// else if ((p1.position & (UInt32)game_position.POS_FACEUP) > 0)
// else if ((p1.position & (UInt32)CardPosition.FaceUp) > 0)
// {
// res += InterString.Get("(表侧)");
// }
// else if ((p1.position & (UInt32)game_position.POS_DEFENSE) > 0)
// else if ((p1.position & (UInt32)CardPosition.POS_DEFENSE) > 0)
// {
// res += InterString.Get("(里侧)");
// }
......
......@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public enum gameCardCondition
{
......@@ -288,7 +289,7 @@ public class gameCard : OCGobject
Vector3 worldposition = Camera.main.ScreenToWorldPoint(new Vector3(screenposition.x, screenposition.y, screenposition.z - 5));
obj_number.transform.position = worldposition;
}
if (disabled == true && (((p.location & (UInt32)game_location.LOCATION_MZONE) > 0) || ((p.location & (UInt32)game_location.LOCATION_SZONE) > 0)))
if (disabled == true && (((p.location & (UInt32)CardLocation.MonsterZone) > 0) || ((p.location & (UInt32)CardLocation.SpellZone) > 0)))
{
if (nagaSign == null)
{
......@@ -566,7 +567,7 @@ public class gameCard : OCGobject
if (opMonsterWithBackGroundCard)
{
Vector3 vector_of_begin = Vector3.zero;
if ((p.position & (UInt32)game_position.POS_ATTACK) > 0)
if ((p.position & (UInt32)CardPosition.Attack) > 0)
{
vector_of_begin = gameObject_face.transform.position + new Vector3(0, 0, -2f);
}
......@@ -598,7 +599,7 @@ public class gameCard : OCGobject
if (VerticleCollider == null)
{
Vector3 vector_of_begin;
if ((p.position & (UInt32)game_position.POS_ATTACK) > 0)
if ((p.position & (UInt32)CardPosition.Attack) > 0)
{
vector_of_begin = gameObject_face.transform.position + new Vector3(0, 0, 2);
}
......@@ -772,13 +773,13 @@ public class gameCard : OCGobject
{
TweenTo(gived_position, gived_rotation);
if (
Program.I().ocgcore.currentMessage == YGOSharp.OCGWrapper.Enums.GameMessage.Move
Program.I().ocgcore.currentMessage == GameMessage.Move
||
Program.I().ocgcore.currentMessage == YGOSharp.OCGWrapper.Enums.GameMessage.Swap
Program.I().ocgcore.currentMessage == GameMessage.Swap
||
Program.I().ocgcore.currentMessage == YGOSharp.OCGWrapper.Enums.GameMessage.PosChange
Program.I().ocgcore.currentMessage == GameMessage.PosChange
||
Program.I().ocgcore.currentMessage == YGOSharp.OCGWrapper.Enums.GameMessage.FlipSummoning
Program.I().ocgcore.currentMessage == GameMessage.FlipSummoning
)
{
Program.I().ocgcore.Sleep((int)(30f * time));
......@@ -910,11 +911,11 @@ public class gameCard : OCGobject
private void UA_reloadCardHintPosition()
{
if ((p.location & (UInt32)game_location.LOCATION_MZONE) > 0 && (p.location & (UInt32)game_location.LOCATION_OVERLAY) == 0)
if ((p.location & (UInt32)CardLocation.MonsterZone) > 0 && (p.location & (UInt32)CardLocation.Overlay) == 0)
{
if (p.controller == 0)
{
if ((p.position & (UInt32)game_position.POS_ATTACK) > 0)
if ((p.position & (UInt32)CardPosition.Attack) > 0)
{
cardHint.gameObject.transform.localPosition = new Vector3(0, 0, -2.5f);
cardHint.gameObject.transform.localEulerAngles = new Vector3(60, 0, 0);
......@@ -927,7 +928,7 @@ public class gameCard : OCGobject
}
else
{
if ((p.position & (UInt32)game_position.POS_ATTACK) > 0)
if ((p.position & (UInt32)CardPosition.Attack) > 0)
{
cardHint.gameObject.transform.localPosition = new Vector3(0, 0, 2.5f);
cardHint.gameObject.transform.localEulerAngles = new Vector3(40, 180, 0);
......@@ -1036,35 +1037,35 @@ public class gameCard : OCGobject
loaded_controller = (int)p.controller;
loaded_location = (int)p.location;
set_text("");
if (p.controller == 0 && (p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if (p.controller == 0 && (p.location & (UInt32)CardLocation.Deck) > 0)
{
set_text(GameStringHelper.kazu);
}
if (p.controller == 0 && (p.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if (p.controller == 0 && (p.location & (UInt32)CardLocation.Extra) > 0)
{
set_text(GameStringHelper.ewai);
}
if (p.controller == 0 && (p.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if (p.controller == 0 && (p.location & (UInt32)CardLocation.Grave) > 0)
{
set_text(GameStringHelper.mudi);
}
if (p.controller == 0 && (p.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if (p.controller == 0 && (p.location & (UInt32)CardLocation.Removed) > 0)
{
set_text(GameStringHelper.chuwai);
}
if (p.controller == 1 && (p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if (p.controller == 1 && (p.location & (UInt32)CardLocation.Deck) > 0)
{
set_text("<#ff8888>" + GameStringHelper.kazu + "</color>");
}
if (p.controller == 1 && (p.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if (p.controller == 1 && (p.location & (UInt32)CardLocation.Extra) > 0)
{
set_text("<#ff8888>" + GameStringHelper.ewai + "</color>");
}
if (p.controller == 1 && (p.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if (p.controller == 1 && (p.location & (UInt32)CardLocation.Grave) > 0)
{
set_text("<#ff8888>" + GameStringHelper.mudi + "</color>");
}
if (p.controller == 1 && (p.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if (p.controller == 1 && (p.location & (UInt32)CardLocation.Removed) > 0)
{
set_text("<#ff8888>" + GameStringHelper.chuwai + "</color>");
}
......@@ -1097,7 +1098,7 @@ public class gameCard : OCGobject
Vector3 screenposition = Program.camera_game_main.WorldToScreenPoint(gameObject.transform.position);
game_object_monster_cloude.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(screenposition.x, screenposition.y, screenposition.z + 3));
game_object_monster_cloude_ParticleSystem.startSize = UnityEngine.Random.Range(3f, 3f + (20f - 3f) * (float)(Mathf.Clamp(data.Attack,0,3000)) / 3000f);
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_EARTH))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Earth))
{
game_object_monster_cloude_ParticleSystem.startColor =
new Color(
......@@ -1105,7 +1106,7 @@ public class gameCard : OCGobject
80f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f),
0f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f));
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_WATER))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Water))
{
game_object_monster_cloude_ParticleSystem.startColor =
new Color(
......@@ -1113,7 +1114,7 @@ public class gameCard : OCGobject
0f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f),
255f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f));
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_FIRE))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Fire))
{
game_object_monster_cloude_ParticleSystem.startColor =
new Color(
......@@ -1121,7 +1122,7 @@ public class gameCard : OCGobject
0f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f),
0f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f));
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_WIND))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Wind))
{
game_object_monster_cloude_ParticleSystem.startColor =
new Color(
......@@ -1129,7 +1130,7 @@ public class gameCard : OCGobject
140f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f),
0f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f));
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_DARK))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Dark))
{
game_object_monster_cloude_ParticleSystem.startColor =
new Color(
......@@ -1137,7 +1138,7 @@ public class gameCard : OCGobject
0f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f),
158f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f));
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_LIGHT))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Light))
{
game_object_monster_cloude_ParticleSystem.startColor =
new Color(
......@@ -1145,7 +1146,7 @@ public class gameCard : OCGobject
140f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f),
0f / 255f + UnityEngine.Random.Range(-0.2f, 0.2f));
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_DEVINE))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Divine))
{
game_object_monster_cloude_ParticleSystem.startColor =
new Color(
......@@ -1274,16 +1275,16 @@ public class gameCard : OCGobject
int color = 0;
if ((data.Type & (int)game_type.TYPE_TUNER) > 0)
if ((data.Type & (int)CardType.Tuner) > 0)
{
color = 1;
}
if ((data.Type & (int)game_type.TYPE_XYZ) > 0)
if ((data.Type & (int)CardType.Xyz) > 0)
{
color = 2;
}
if ((data.Type & (int)game_type.link) > 0)
if ((data.Type & (int)CardType.Link) > 0)
{
color = 3;
data.Level = 0;
......@@ -1365,7 +1366,7 @@ public class gameCard : OCGobject
loaded_verticaldef = data.Defense;
loaded_verticalpos = p.position;
loaded_verticalcon = (int)p.controller;
if ((data.Type&(uint)game_type.link)>0)
if ((data.Type&(uint)CardType.Link)>0)
{
string raw = "";
YGOSharp.Card data_raw = YGOSharp.CardsManager.Get(data.Id);
......@@ -1391,7 +1392,7 @@ public class gameCard : OCGobject
{
string raw = "";
YGOSharp.Card data_raw = YGOSharp.CardsManager.Get(data.Id);
if ((loaded_verticalpos & (int)game_position.POS_ATTACK) > 0)
if ((loaded_verticalpos & (int)CardPosition.Attack) > 0)
{
if (data.Attack > data_raw.Attack)
{
......@@ -1458,7 +1459,7 @@ public class gameCard : OCGobject
//{
// if (condition== gameCardCondition.verticle_clickable)
// {
// if ((p.position & (UInt32)game_position.POS_ATTACK) > 0)
// if ((p.position & (UInt32)CardPosition.Attack) > 0)
// {
// ability = data.Attack;
// }
......@@ -1588,16 +1589,16 @@ public class gameCard : OCGobject
}
}
int special_hint = 0;
if ((p.position & (int)game_position.POS_FACEDOWN) > 0)
if ((p.position & (int)CardPosition.FaceDown) > 0)
{
if ((p.location & (int)game_location.LOCATION_REMOVED) > 0)
if ((p.location & (int)CardLocation.Removed) > 0)
{
special_hint = 1;
}
}
if ((p.position & (int)game_position.POS_FACEUP) > 0)
if ((p.position & (int)CardPosition.FaceUp) > 0)
{
if ((p.location & (int)game_location.LOCATION_EXTRA) > 0)
if ((p.location & (int)CardLocation.Extra) > 0)
{
special_hint = 2;
}
......@@ -1657,19 +1658,19 @@ public class gameCard : OCGobject
public bool isHided()
{
if ((p.location & (int)game_location.LOCATION_DECK) > 0)
if ((p.location & (int)CardLocation.Deck) > 0)
{
return true;
}
if ((p.location & (int)game_location.LOCATION_EXTRA) > 0)
if ((p.location & (int)CardLocation.Extra) > 0)
{
return true;
}
if ((p.location & (int)game_location.LOCATION_REMOVED) > 0)
if ((p.location & (int)CardLocation.Removed) > 0)
{
return true;
}
if ((p.location & (int)game_location.LOCATION_GRAVE) > 0)
if ((p.location & (int)CardLocation.Grave) > 0)
{
return true;
}
......@@ -1686,31 +1687,31 @@ public class gameCard : OCGobject
{
int re = 0;
//
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_EARTH))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Earth))
{
re = 0;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_WATER))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Water))
{
re = 3;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_FIRE))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Fire))
{
re = 5;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_WIND))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Wind))
{
re = 2;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_DARK))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Dark))
{
re = 4;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_LIGHT))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Light))
{
re = 1;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_DEVINE))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Divine))
{
re = 1;
}
......@@ -1936,27 +1937,27 @@ public class gameCard : OCGobject
public void add_one_overlay_light()
{
GameObject mod = Program.I().mod_ocgcore_ol_light;
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_EARTH))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Earth))
{
mod = Program.I().mod_ocgcore_ol_earth;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_WATER))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Water))
{
mod = Program.I().mod_ocgcore_ol_water;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_FIRE))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Fire))
{
mod = Program.I().mod_ocgcore_ol_fire;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_WIND))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Wind))
{
mod = Program.I().mod_ocgcore_ol_wind;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_DARK))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Dark))
{
mod = Program.I().mod_ocgcore_ol_dark;
}
if (GameStringHelper.differ(data.Attribute, (long)game_attributes.ATTRIBUTE_LIGHT))
if (GameStringHelper.differ(data.Attribute, (long)CardAttribute.Light))
{
mod = Program.I().mod_ocgcore_ol_light;
}
......
......@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class GameField : OCGobject
{
......@@ -90,14 +91,14 @@ public class GameField : OCGobject
Program.I().ocgcore.AddUpdateAction_s(Update);
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_DECK, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_EXTRA, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_GRAVE, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_REMOVED, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_DECK, 1));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_EXTRA, 1));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_GRAVE, 1));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_REMOVED, 1));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Deck, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Extra, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Grave, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Removed, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Deck, 1));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Extra, 1));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Grave, 1));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Removed, 1));
LOCATION_DECK_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_EXTRA_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
......@@ -260,15 +261,15 @@ public class GameField : OCGobject
rightT.transform.localScale = new Vector3(1f / Program.fieldSize, 1f / Program.fieldSize, 1f / Program.fieldSize);
rightT.transform.localPosition = new Vector3(((1f - 1f / Program.fieldSize) * (float)(rightT.width)) / 3.5f, 0, 0);
relocateTextMesh(LOCATION_DECK_0, 0, game_location.LOCATION_DECK, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_0, 0, game_location.LOCATION_EXTRA, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_0, 0, game_location.LOCATION_REMOVED, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_0, 0, game_location.LOCATION_GRAVE, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_DECK_0, 0, CardLocation.Deck, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_0, 0, CardLocation.Extra, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_0, 0, CardLocation.Removed, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_0, 0, CardLocation.Grave, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_DECK_1, 1, game_location.LOCATION_DECK, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_1, 1, game_location.LOCATION_EXTRA, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_1, 1, game_location.LOCATION_REMOVED, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_1, 1, game_location.LOCATION_GRAVE, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_DECK_1, 1, CardLocation.Deck, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_1, 1, CardLocation.Extra, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_1, 1, CardLocation.Removed, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_1, 1, CardLocation.Grave, new Vector3(0, 0, -3f));
label.transform.localPosition = new Vector3(-5f * (Program.fieldSize - 1), 0, -15.5f * Program.fieldSize);
......@@ -277,7 +278,7 @@ public class GameField : OCGobject
prelong = isLong;
for (int i = 0; i < field_disabled_containers.Count; i++)
{
if (field_disabled_containers[i].p.location == (UInt32)game_location.LOCATION_SZONE)
if (field_disabled_containers[i].p.location == (UInt32)CardLocation.SpellZone)
{
if (field_disabled_containers[i].p.controller == 1)
{
......@@ -400,7 +401,7 @@ public class GameField : OCGobject
}
private static void relocateTextMesh(TMPro.TextMeshPro obj, uint con, game_location loc, Vector3 poi)
private static void relocateTextMesh(TMPro.TextMeshPro obj, uint con, CardLocation loc, Vector3 poi)
{
obj.transform.position = UIHelper.getCamGoodPosition(Program.I().ocgcore.get_point_worldposition(new GPS
{
......@@ -610,7 +611,7 @@ public class GameField : OCGobject
if (Program.I().ocgcore.MasterRule >= 4)
{
if (gps.location == (int)game_location.LOCATION_SZONE)
if (gps.location == (int)CardLocation.SpellZone)
{
if (gps.position == 0 || gps.position == 4)
{
......
using System;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class gameHiddenButton : OCGobject
{
public game_location location;
public CardLocation location;
public int player;
......@@ -11,7 +12,7 @@ public class gameHiddenButton : OCGobject
GPS ps;
public gameHiddenButton(game_location l, int p)
public gameHiddenButton(CardLocation l, int p)
{
ps = new GPS();
ps.controller = (UInt32)p;
......@@ -107,7 +108,7 @@ public class gameHiddenButton : OCGobject
{
if (player == 0)
{
if (location == game_location.LOCATION_DECK)
if (location == CardLocation.Deck)
{
if (Program.I().book.lab != null)
{
......@@ -120,7 +121,7 @@ public class gameHiddenButton : OCGobject
}
if (player == 1)
{
if (location == game_location.LOCATION_DECK)
if (location == CardLocation.Deck)
{
if (Program.I().book.labop != null)
{
......@@ -173,7 +174,7 @@ public class gameHiddenButton : OCGobject
{
if (player == 0)
{
if (location == game_location.LOCATION_DECK)
if (location == CardLocation.Deck)
{
if (Program.I().book.lab != null)
{
......@@ -201,7 +202,7 @@ public class gameHiddenButton : OCGobject
if (player == 1)
{
if (location == game_location.LOCATION_DECK)
if (location == CardLocation.Deck)
{
if (Program.I().book.labop != null)
{
......
......@@ -77,39 +77,39 @@ public class Ocgcore : ServantWithCardDescription
gameCardCondition get_point_worldcondition(GPS p)
{
gameCardCondition return_value = gameCardCondition.floating_clickable;
if ((p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((p.location & (UInt32)CardLocation.Deck) > 0)
{
return_value = gameCardCondition.still_unclickable;
}
if ((p.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if ((p.location & (UInt32)CardLocation.Extra) > 0)
{
return_value = gameCardCondition.still_unclickable;
}
if ((p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
return_value = gameCardCondition.floating_clickable;
if ((p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((p.position & (UInt32)CardPosition.FaceUp) > 0)
{
return_value = gameCardCondition.verticle_clickable;
}
}
if ((p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((p.location & (UInt32)CardLocation.SpellZone) > 0)
{
return_value = gameCardCondition.floating_clickable;
}
if ((p.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if ((p.location & (UInt32)CardLocation.Grave) > 0)
{
return_value = gameCardCondition.still_unclickable;
}
if ((p.location & (UInt32)game_location.LOCATION_HAND) > 0)
if ((p.location & (UInt32)CardLocation.Hand) > 0)
{
return_value = gameCardCondition.floating_clickable;
}
if ((p.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if ((p.location & (UInt32)CardLocation.Removed) > 0)
{
return_value = gameCardCondition.still_unclickable;
}
if ((p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((p.location & (UInt32)CardLocation.Overlay) > 0)
{
return_value = gameCardCondition.still_unclickable;
}
......@@ -120,7 +120,7 @@ public class Ocgcore : ServantWithCardDescription
{
Vector3 return_value = Vector3.zero;
float real = (Program.fieldSize - 1) * 0.9f + 1f;
if ((p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((p.location & (UInt32)CardLocation.Deck) > 0)
{
if (p.controller==0)
{
......@@ -132,7 +132,7 @@ public class Ocgcore : ServantWithCardDescription
}
return_value.y += p.sequence * 0.03f;
}
if ((p.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if ((p.location & (UInt32)CardLocation.Extra) > 0)
{
if (p.controller == 0)
{
......@@ -144,7 +144,7 @@ public class Ocgcore : ServantWithCardDescription
}
return_value.y += p.sequence * 0.03f;
}
if ((p.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if ((p.location & (UInt32)CardLocation.Grave) > 0)
{
if (MasterRule >= 4)
{
......@@ -171,7 +171,7 @@ public class Ocgcore : ServantWithCardDescription
return_value.y += p.sequence * 0.03f;
}
if ((p.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if ((p.location & (UInt32)CardLocation.Removed) > 0)
{
if (MasterRule >= 4)
{
......@@ -198,7 +198,7 @@ public class Ocgcore : ServantWithCardDescription
return_value.y += p.sequence * 0.03f;
}
if ((p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
UInt32 realIndex = p.sequence;
if (p.controller==0)
......@@ -252,7 +252,7 @@ public class Ocgcore : ServantWithCardDescription
}
return_value.x *= real;
}
if ((p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((p.location & (UInt32)CardLocation.SpellZone) > 0)
{
if (p.sequence < 5 || ((p.sequence == 6 || p.sequence == 7) && MasterRule >= 4))
{
......@@ -367,7 +367,7 @@ public class Ocgcore : ServantWithCardDescription
}
}
}
if ((p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((p.location & (UInt32)CardLocation.Overlay) > 0)
{
if (c != null)
{
......@@ -409,10 +409,10 @@ public class Ocgcore : ServantWithCardDescription
Program.go(1, () =>
{
MHS_creatBundle(60, localPlayer(0), game_location.LOCATION_DECK);
MHS_creatBundle(15, localPlayer(0), game_location.LOCATION_EXTRA);
MHS_creatBundle(60, localPlayer(1), game_location.LOCATION_DECK);
MHS_creatBundle(15, localPlayer(1), game_location.LOCATION_EXTRA);
MHS_creatBundle(60, localPlayer(0), CardLocation.Deck);
MHS_creatBundle(15, localPlayer(0), CardLocation.Extra);
MHS_creatBundle(60, localPlayer(1), CardLocation.Deck);
MHS_creatBundle(15, localPlayer(1), CardLocation.Extra);
for (int i = 0; i < cards.Count; i++)
{
cards[i].hide();
......@@ -1195,7 +1195,7 @@ public class Ocgcore : ServantWithCardDescription
public void forceMSquit()
{
Package p = new Package();
p.Fuction = (int)YGOSharp.OCGWrapper.Enums.GameMessage.sibyl_quit;
p.Fuction = (int)GameMessage.sibyl_quit;
Packages.Add(p);
}
......@@ -1312,7 +1312,7 @@ public class Ocgcore : ServantWithCardDescription
md5Maker = 0;
for (int i = 0; i < cards.Count; i++)
{
cards[i].p.location = (UInt32)game_location.LOCATION_UNKNOWN;
cards[i].p.location = (UInt32)CardLocation.Unknown;
}
int playertype = r.ReadByte();
isFirst = ((playertype & 0xf) > 0) ? false : true;
......@@ -1336,10 +1336,10 @@ public class Ocgcore : ServantWithCardDescription
}
}
cookie_matchKill = 0;
MHS_creatBundle(r.ReadInt16(), localPlayer(0), game_location.LOCATION_DECK);
MHS_creatBundle(r.ReadInt16(), localPlayer(0), game_location.LOCATION_EXTRA);
MHS_creatBundle(r.ReadInt16(), localPlayer(1), game_location.LOCATION_DECK);
MHS_creatBundle(r.ReadInt16(), localPlayer(1), game_location.LOCATION_EXTRA);
MHS_creatBundle(r.ReadInt16(), localPlayer(0), CardLocation.Deck);
MHS_creatBundle(r.ReadInt16(), localPlayer(0), CardLocation.Extra);
MHS_creatBundle(r.ReadInt16(), localPlayer(1), CardLocation.Deck);
MHS_creatBundle(r.ReadInt16(), localPlayer(1), CardLocation.Extra);
gameField.clearDisabled();
if (Program.I().room.mode == 0)
{
......@@ -1380,7 +1380,7 @@ public class Ocgcore : ServantWithCardDescription
md5Maker = 0;
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
cards[i].p.location = (UInt32)game_location.LOCATION_UNKNOWN;
cards[i].p.location = (UInt32)CardLocation.Unknown;
}
cookie_matchKill = 0;
......@@ -1418,7 +1418,7 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_MZONE,
location = (UInt32)CardLocation.MonsterZone,
position = (int)r.ReadByte(),
sequence = (UInt32)i,
};
......@@ -1426,7 +1426,7 @@ public class Ocgcore : ServantWithCardDescription
val = r.ReadByte();
for (int xyz = 0; xyz < val; ++xyz)
{
gps.location |= (UInt32)game_location.LOCATION_OVERLAY;
gps.location |= (UInt32)CardLocation.Overlay;
gps.position = xyz;
GCS_cardCreate(gps);
}
......@@ -1440,7 +1440,7 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_SZONE,
location = (UInt32)CardLocation.SpellZone,
position = (int)r.ReadByte(),
sequence = (UInt32)i,
};
......@@ -1453,8 +1453,8 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_DECK,
position = (int)game_position.POS_FACEDOWN_ATTACK,
location = (UInt32)CardLocation.Deck,
position = (int)CardPosition.FaceDownAttack,
sequence = (UInt32)i,
};
GCS_cardCreate(gps);
......@@ -1465,8 +1465,8 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_HAND,
position = (int)game_position.POS_FACEDOWN_ATTACK,
location = (UInt32)CardLocation.Hand,
position = (int)CardPosition.FaceDownAttack,
sequence = (UInt32)i,
};
GCS_cardCreate(gps);
......@@ -1477,8 +1477,8 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_GRAVE,
position = (int)game_position.POS_FACEUP_ATTACK,
location = (UInt32)CardLocation.Grave,
position = (int)CardPosition.FaceUpAttack,
sequence = (UInt32)i,
};
GCS_cardCreate(gps);
......@@ -1489,8 +1489,8 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_REMOVED,
position = (int)game_position.POS_FACEUP_ATTACK,
location = (UInt32)CardLocation.Removed,
position = (int)CardPosition.FaceUpAttack,
sequence = (UInt32)i,
};
GCS_cardCreate(gps);
......@@ -1502,8 +1502,8 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_EXTRA,
position = (int)game_position.POS_FACEDOWN_ATTACK,
location = (UInt32)CardLocation.Extra,
position = (int)CardPosition.FaceDownAttack,
sequence = (UInt32)i,
};
GCS_cardCreate(gps);
......@@ -1513,8 +1513,8 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_EXTRA,
position = (int)game_position.POS_FACEUP_ATTACK,
location = (UInt32)CardLocation.Extra,
position = (int)CardPosition.FaceUpAttack,
sequence = (UInt32)(val + i),
};
GCS_cardCreate(gps);
......@@ -1844,7 +1844,7 @@ public class Ocgcore : ServantWithCardDescription
if (card != null)
{
card.set_code(code);
card.p.position = (int)game_position.POS_FACEUP_ATTACK;
card.p.position = (int)CardPosition.FaceUpAttack;
card.refreshData();
ES_hint = InterString.Get("「[?]」反转召唤宣言时", card.get_data().Name);
if (card.p.controller == 0)
......@@ -1901,24 +1901,24 @@ public class Ocgcore : ServantWithCardDescription
ES_hint = InterString.Get("玩家抽卡时");
controller = localPlayer(r.ReadByte());
count = r.ReadByte();
int deckCC = MHS_getBundle(controller, (int)game_location.LOCATION_DECK).Count;
int deckCC = MHS_getBundle(controller, (int)CardLocation.Deck).Count;
for (int isa = 0; isa < count; isa++)
{
card = GCS_cardMove(
new GPS
{
controller = (UInt32)controller,
location = (UInt32)game_location.LOCATION_DECK,
location = (UInt32)CardLocation.Deck,
sequence = (UInt32)(deckCC - 1 - isa),
position = (int)game_position.POS_FACEDOWN_ATTACK,
position = (int)CardPosition.FaceDownAttack,
}
,
new GPS
{
controller = (UInt32)controller,
location = (UInt32)game_location.LOCATION_HAND,
location = (UInt32)CardLocation.Hand,
sequence = (UInt32)(1000),
position = (int)game_position.POS_FACEDOWN_ATTACK,
position = (int)CardPosition.FaceDownAttack,
}
, false);
card.set_code(r.ReadInt32() & 0x7fffffff);
......@@ -1958,12 +1958,12 @@ public class Ocgcore : ServantWithCardDescription
}
}
int mcount = r.ReadByte();
var cardsInDeck = MHS_resizeBundle(mcount, controller, game_location.LOCATION_DECK);
var cardsInDeck = MHS_resizeBundle(mcount, controller, CardLocation.Deck);
int ecount = r.ReadByte();
var cardsInExtra = MHS_resizeBundle(ecount, controller, game_location.LOCATION_EXTRA);
var cardsInExtra = MHS_resizeBundle(ecount, controller, CardLocation.Extra);
int pcount = r.ReadByte();
int hcount = r.ReadByte();
var cardsInHand = MHS_resizeBundle(hcount, controller, game_location.LOCATION_HAND);
var cardsInHand = MHS_resizeBundle(hcount, controller, CardLocation.Hand);
if (cardsInDeck.Count > 0)
{
cardsInDeck[cardsInDeck.Count - 1].set_code(r.ReadInt32());
......@@ -1980,7 +1980,7 @@ public class Ocgcore : ServantWithCardDescription
{
if (cardsInExtra.Count - 1 - i > 0)
{
cardsInExtra[cardsInExtra.Count - 1 - i].p.position = (int)game_position.POS_FACEUP_ATTACK;
cardsInExtra[cardsInExtra.Count - 1 - i].p.position = (int)CardPosition.FaceUpAttack;
}
}
if (controller == 0)
......@@ -2197,7 +2197,7 @@ public class Ocgcore : ServantWithCardDescription
case GameMessage.ConfirmDecktop:
player = localPlayer(r.ReadByte());
count = r.ReadByte();
int countOfDeck = countLocation(player, game_location.LOCATION_DECK);
int countOfDeck = countLocation(player, CardLocation.Deck);
for (int i = 0; i < count; i++)
{
code = r.ReadInt32();
......@@ -2205,7 +2205,7 @@ public class Ocgcore : ServantWithCardDescription
card = GCS_cardGet(new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_DECK,
location = (UInt32)CardLocation.Deck,
sequence = (UInt32)(countOfDeck - 1 - i),
}, false);
if (card != null)
......@@ -2242,11 +2242,11 @@ public class Ocgcore : ServantWithCardDescription
break;
case GameMessage.DeckTop:
player = localPlayer(r.ReadByte());
int countOfDeck_ = countLocation(player, game_location.LOCATION_DECK);
int countOfDeck_ = countLocation(player, CardLocation.Deck);
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_DECK,
location = (UInt32)CardLocation.Deck,
sequence = (UInt32)(countOfDeck_ - 1 - r.ReadByte()),
};
code = r.ReadInt32();
......@@ -2270,7 +2270,7 @@ public class Ocgcore : ServantWithCardDescription
}
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Deck) > 0)
{
if (cards[i].p.controller == player)
{
......@@ -2283,7 +2283,7 @@ public class Ocgcore : ServantWithCardDescription
player = localPlayer(r.ReadByte());
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_HAND) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Hand) > 0)
{
if (cards[i].p.controller == player)
{
......@@ -2298,18 +2298,18 @@ public class Ocgcore : ServantWithCardDescription
{
if (cards[i].p.controller == player)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Deck) > 0)
{
if (cards[i].p.controller == player)
{
cards[i].p.location = (UInt32)game_location.LOCATION_GRAVE;
cards[i].p.location = (UInt32)CardLocation.Grave;
}
}
else if ((cards[i].p.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
else if ((cards[i].p.location & (UInt32)CardLocation.Grave) > 0)
{
if (cards[i].p.controller == player)
{
cards[i].p.location = (UInt32)game_location.LOCATION_DECK;
cards[i].p.location = (UInt32)CardLocation.Deck;
}
}
}
......@@ -2346,7 +2346,7 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)localPlayer(0),
location = (UInt32)game_location.LOCATION_MZONE,
location = (UInt32)CardLocation.MonsterZone,
sequence = (UInt32)i
};
if ((selectable_field & filter) > 0)
......@@ -2364,7 +2364,7 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)localPlayer(0),
location = (UInt32)game_location.LOCATION_SZONE,
location = (UInt32)CardLocation.SpellZone,
sequence = (UInt32)i
};
if ((selectable_field & filter) > 0)
......@@ -2382,7 +2382,7 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)localPlayer(1),
location = (UInt32)game_location.LOCATION_MZONE,
location = (UInt32)CardLocation.MonsterZone,
sequence = (UInt32)i
};
if ((selectable_field & filter) > 0)
......@@ -2400,7 +2400,7 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)localPlayer(1),
location = (UInt32)game_location.LOCATION_SZONE,
location = (UInt32)CardLocation.SpellZone,
sequence = (UInt32)i
};
if ((selectable_field & filter) > 0)
......@@ -2481,7 +2481,7 @@ public class Ocgcore : ServantWithCardDescription
public Package getNamePacket()
{
Package p__ = new Package();
p__.Fuction = (int)YGOSharp.OCGWrapper.Enums.GameMessage.sibyl_name;
p__.Fuction = (int)GameMessage.sibyl_name;
p__.Data = new BinaryMaster();
p__.Data.writer.WriteUnicode(name_0, 50);
p__.Data.writer.WriteUnicode(name_0_tag, 50);
......@@ -2498,7 +2498,7 @@ public class Ocgcore : ServantWithCardDescription
Program.I().book.add(toPrint);
}
private int countLocation(int player, game_location location_)
private int countLocation(int player, CardLocation location_)
{
int re = 0;
......@@ -2516,7 +2516,7 @@ public class Ocgcore : ServantWithCardDescription
return re;
}
private int countLocationSequence(int player, game_location location_)
private int countLocationSequence(int player, CardLocation location_)
{
int re = 0;
......@@ -2904,8 +2904,8 @@ public class Ocgcore : ServantWithCardDescription
card = GCS_cardGet(new GPS
{
controller = (UInt32)0,
location = (UInt32)game_location.LOCATION_DECK,
position = (int)game_position.POS_FACEDOWN_ATTACK,
location = (UInt32)CardLocation.Deck,
position = (int)CardPosition.FaceDownAttack,
sequence = (UInt32)0,
}, false);
if (card != null)
......@@ -2953,8 +2953,8 @@ public class Ocgcore : ServantWithCardDescription
card = GCS_cardGet(new GPS
{
controller = (UInt32)0,
location = (UInt32)game_location.LOCATION_HAND,
position = (int)game_position.POS_FACEDOWN_ATTACK,
location = (UInt32)CardLocation.Hand,
position = (int)CardPosition.FaceDownAttack,
sequence = (UInt32)0,
}, false);
if (card != null)
......@@ -3903,7 +3903,7 @@ public class Ocgcore : ServantWithCardDescription
if (card.levelForSelect_2 == 0)
{
card.levelForSelect_2 = card.levelForSelect_1;
if ((card.get_data().Type & (int)game_type.link) > 0)
if ((card.get_data().Type & (int)CardType.Link) > 0)
{
card.levelForSelect_2 = 1;
}
......@@ -3930,7 +3930,7 @@ public class Ocgcore : ServantWithCardDescription
if (card.levelForSelect_2 == 0)
{
card.levelForSelect_2 = card.levelForSelect_1;
if ((card.get_data().Type & (int)game_type.link) > 0)
if ((card.get_data().Type & (int)CardType.Link) > 0)
{
card.levelForSelect_2 = 1;
}
......@@ -4172,7 +4172,7 @@ public class Ocgcore : ServantWithCardDescription
case GameMessage.ConfirmDecktop:
player = localPlayer(r.ReadByte());
count = r.ReadByte();
int countOfDeck = countLocation(player, game_location.LOCATION_DECK);
int countOfDeck = countLocation(player, CardLocation.Deck);
for (int i = 0; i < count; i++)
{
code = r.ReadInt32();
......@@ -4180,7 +4180,7 @@ public class Ocgcore : ServantWithCardDescription
gps = new GPS
{
controller = (UInt32)player,
location = (UInt32)game_location.LOCATION_DECK,
location = (UInt32)CardLocation.Deck,
sequence = (UInt32)(countOfDeck - 1 - i),
};
card = GCS_cardGet(gps, false);
......@@ -4209,7 +4209,7 @@ public class Ocgcore : ServantWithCardDescription
}
else
{
if (gps.location != (int)game_location.LOCATION_HAND)
if (gps.location != (int)CardLocation.Hand)
{
showC = true;
}
......@@ -4230,13 +4230,13 @@ public class Ocgcore : ServantWithCardDescription
if (card != null)
{
if (
(card.p.location & (UInt32)game_location.LOCATION_DECK) > 0
(card.p.location & (UInt32)CardLocation.Deck) > 0
||
(card.p.location & (UInt32)game_location.LOCATION_GRAVE) > 0
(card.p.location & (UInt32)CardLocation.Grave) > 0
||
(card.p.location & (UInt32)game_location.LOCATION_EXTRA) > 0
(card.p.location & (UInt32)CardLocation.Extra) > 0
||
(card.p.location & (UInt32)game_location.LOCATION_REMOVED) > 0
(card.p.location & (UInt32)CardLocation.Removed) > 0
)
{
card.currentKuang = gameCard.kuangType.selected;
......@@ -4252,7 +4252,7 @@ public class Ocgcore : ServantWithCardDescription
}
else if (card.condition != gameCardCondition.verticle_clickable)
{
if ((card.p.location & (UInt32)game_location.LOCATION_HAND) > 0)
if ((card.p.location & (UInt32)CardLocation.Hand) > 0)
{
if (i==0)
{
......@@ -4300,7 +4300,7 @@ public class Ocgcore : ServantWithCardDescription
player = localPlayer(r.ReadByte());
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Deck) > 0)
{
if (cards[i].p.controller == player)
{
......@@ -4405,7 +4405,7 @@ public class Ocgcore : ServantWithCardDescription
GPS from = r.ReadGPS();
GPS to = r.ReadGPS();
card = GCS_cardGet(to, false);
if ((to.location == ((UInt32)game_location.LOCATION_OVERLAY | (UInt32)game_location.LOCATION_EXTRA)) && ((from.location & (UInt32)game_location.LOCATION_OVERLAY) == 0) && Program.I().setting.setting.Vxyz.value == true)
if ((to.location == ((UInt32)CardLocation.Overlay | (UInt32)CardLocation.Extra)) && ((from.location & (UInt32)CardLocation.Overlay) == 0) && Program.I().setting.setting.Vxyz.value == true)
{
Vector3 vDarkHole = Vector3.zero;
float real = (Program.fieldSize - 1) * 0.9f + 1f;
......@@ -4425,22 +4425,22 @@ public class Ocgcore : ServantWithCardDescription
}
if (card != null)
{
if ((to.position & (int)game_position.POS_FACEDOWN) > 0)
if ((to.position & (int)CardPosition.FaceDown) > 0)
{
if (to.location == (UInt32)game_location.LOCATION_MZONE || to.location == (UInt32)game_location.LOCATION_SZONE)
if (to.location == (UInt32)CardLocation.MonsterZone || to.location == (UInt32)CardLocation.SpellZone)
{
if (Program.I().setting.setting.Vset.value == true)
card.positionEffect(Program.I().mod_ocgcore_decoration_card_setted);
UIHelper.playSound("set", 1f);
}
}
if (to.location == (UInt32)game_location.LOCATION_GRAVE)
if (to.location == (UInt32)CardLocation.Grave)
{
if ((from.location & (UInt32)game_location.LOCATION_MZONE) > 0) UIHelper.playSound("destroyed", 1f);
if ((from.location & (UInt32)CardLocation.MonsterZone) > 0) UIHelper.playSound("destroyed", 1f);
if (Program.I().setting.setting.Vmove.value == true)
MonoBehaviour.Destroy((GameObject)MonoBehaviour.Instantiate(Program.I().mod_ocgcore_decoration_tograve, card.gameObject.transform.position, Quaternion.identity), 5f);
}
if (to.location == (UInt32)game_location.LOCATION_REMOVED)
if (to.location == (UInt32)CardLocation.Removed)
{
UIHelper.playSound("destroyed", 1f);
if (Program.I().setting.setting.Vmove.value == true)
......@@ -4490,21 +4490,21 @@ public class Ocgcore : ServantWithCardDescription
if (Program.I().setting.setting.Vspsum.value==true)
{
GameObject mod = Program.I().mod_ocgcore_ss_summon_light;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_EARTH))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Earth))
mod = Program.I().mod_ocgcore_ss_summon_earth;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_DARK))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Dark))
mod = Program.I().mod_ocgcore_ss_summon_dark;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_DEVINE))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Divine))
mod = Program.I().mod_ocgcore_ss_summon_light;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_FIRE))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Fire))
mod = Program.I().mod_ocgcore_ss_summon_fire;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_LIGHT))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Light))
mod = Program.I().mod_ocgcore_ss_summon_light;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_WATER))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Water))
mod = Program.I().mod_ocgcore_ss_summon_water;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_WIND))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Wind))
mod = Program.I().mod_ocgcore_ss_summon_wind;
if (GameStringHelper.differ(card.get_data().Type, (long)game_type.TYPE_FUSION))
if (GameStringHelper.differ(card.get_data().Type, (long)CardType.Fusion))
{
if (Program.I().setting.setting.Vfusion.value == true)
{
......@@ -4512,7 +4512,7 @@ public class Ocgcore : ServantWithCardDescription
}
UIHelper.playSound("specialsummon2", 1f);
}
else if (GameStringHelper.differ(card.get_data().Type, (long)game_type.TYPE_SYNCHRO))
else if (GameStringHelper.differ(card.get_data().Type, (long)CardType.Synchro))
{
if (Program.I().setting.setting.Vsync.value == true)
{
......@@ -4521,7 +4521,7 @@ public class Ocgcore : ServantWithCardDescription
UIHelper.playSound("specialsummon2", 1f);
}
else if (GameStringHelper.differ(card.get_data().Type, (long)game_type.TYPE_RITUAL))
else if (GameStringHelper.differ(card.get_data().Type, (long)CardType.Ritual))
{
if (Program.I().setting.setting.Vrution.value == true)
{
......@@ -4529,7 +4529,7 @@ public class Ocgcore : ServantWithCardDescription
}
UIHelper.playSound("specialsummon2", 1f);
}
else if (GameStringHelper.differ(card.get_data().Type, (long)game_type.link))
else if (GameStringHelper.differ(card.get_data().Type, (long)CardType.Link))
{
if (Program.I().setting.setting.Vlink.value == true)
{
......@@ -4550,15 +4550,15 @@ public class Ocgcore : ServantWithCardDescription
}
else
{
if (GameStringHelper.differ(card.get_data().Type, (long)game_type.TYPE_FUSION))
if (GameStringHelper.differ(card.get_data().Type, (long)CardType.Fusion))
{
UIHelper.playSound("specialsummon2", 1f);
}
else if (GameStringHelper.differ(card.get_data().Type, (long)game_type.TYPE_SYNCHRO))
else if (GameStringHelper.differ(card.get_data().Type, (long)CardType.Synchro))
{
UIHelper.playSound("specialsummon2", 1f);
}
else if (GameStringHelper.differ(card.get_data().Type, (long)game_type.TYPE_RITUAL))
else if (GameStringHelper.differ(card.get_data().Type, (long)CardType.Ritual))
{
UIHelper.playSound("specialsummon2", 1f);
}
......@@ -4602,32 +4602,32 @@ public class Ocgcore : ServantWithCardDescription
card.set_code(code);
UIHelper.playSound("activate", 1);
card.animation_show_off( false);
if ((card.get_data().Type & (int)game_type.TYPE_MONSTER) > 0)
if ((card.get_data().Type & (int)CardType.Monster) > 0)
{
if (Program.I().setting.setting.Vactm.value == true)
{
GameObject mod = Program.I().mod_ocgcore_cs_mon_light;
if ((card.get_data().Attribute & (int)game_attributes.ATTRIBUTE_EARTH) > 0)
if ((card.get_data().Attribute & (int)CardAttribute.Earth) > 0)
{
mod = Program.I().mod_ocgcore_cs_mon_earth;
}
if ((card.get_data().Attribute & (int)game_attributes.ATTRIBUTE_WATER) > 0)
if ((card.get_data().Attribute & (int)CardAttribute.Water) > 0)
{
mod = Program.I().mod_ocgcore_cs_mon_water;
}
if ((card.get_data().Attribute & (int)game_attributes.ATTRIBUTE_FIRE) > 0)
if ((card.get_data().Attribute & (int)CardAttribute.Fire) > 0)
{
mod = Program.I().mod_ocgcore_cs_mon_fire;
}
if ((card.get_data().Attribute & (int)game_attributes.ATTRIBUTE_WIND) > 0)
if ((card.get_data().Attribute & (int)CardAttribute.Wind) > 0)
{
mod = Program.I().mod_ocgcore_cs_mon_wind;
}
if ((card.get_data().Attribute & (int)game_attributes.ATTRIBUTE_LIGHT) > 0)
if ((card.get_data().Attribute & (int)CardAttribute.Light) > 0)
{
mod = Program.I().mod_ocgcore_cs_mon_light;
}
if ((card.get_data().Attribute & (int)game_attributes.ATTRIBUTE_DARK) > 0)
if ((card.get_data().Attribute & (int)CardAttribute.Dark) > 0)
{
mod = Program.I().mod_ocgcore_cs_mon_dark;
}
......@@ -4635,14 +4635,14 @@ public class Ocgcore : ServantWithCardDescription
card.fast_decoration(mod);
}
}
if ((card.get_data().Type & (int)game_type.TYPE_SPELL) > 0)
if ((card.get_data().Type & (int)CardType.Spell) > 0)
{
if (Program.I().setting.setting.Vacts.value == true)
{
card.positionEffect(Program.I().mod_ocgcore_decoration_magic_activated);
}
}
if ((card.get_data().Type & (int)game_type.TYPE_TRAP) > 0)
if ((card.get_data().Type & (int)CardType.Trap) > 0)
{
if (Program.I().setting.setting.Vactt.value == true)
{
......@@ -4728,7 +4728,7 @@ public class Ocgcore : ServantWithCardDescription
card = GCS_cardGet(gps, false);
if (card != null)
{
if (card.p.location == (UInt32)game_location.LOCATION_SZONE)
if (card.p.location == (UInt32)CardLocation.SpellZone)
{
if (card.p.sequence == 6 || card.p.sequence == 7)
{
......@@ -4746,9 +4746,9 @@ public class Ocgcore : ServantWithCardDescription
{
if (cardsInSelectAnimation.Count == 2)
{
if (cardsInSelectAnimation[0].p.location == (UInt32)game_location.LOCATION_SZONE)
if (cardsInSelectAnimation[0].p.location == (UInt32)CardLocation.SpellZone)
{
if (cardsInSelectAnimation[1].p.location == (UInt32)game_location.LOCATION_SZONE)
if (cardsInSelectAnimation[1].p.location == (UInt32)CardLocation.SpellZone)
{
if (cardsInSelectAnimation[1].p.sequence == 6 || cardsInSelectAnimation[1].p.sequence == 7)
{
......@@ -4797,11 +4797,11 @@ public class Ocgcore : ServantWithCardDescription
card = GCS_cardGet(gps, false);
if (card != null)
{
if ((card.p.location == (UInt32)game_location.LOCATION_SZONE) && (card.p.sequence == 6 || card.p.sequence == 7))
if ((card.p.location == (UInt32)CardLocation.SpellZone) && (card.p.sequence == 6 || card.p.sequence == 7))
{
targetTime += 0;
}
else if ((card.p.location & (UInt32)game_location.LOCATION_ONFIELD) > 0)
else if ((card.p.location & (UInt32)CardLocation.Onfield) > 0)
{
targetTime += 30;
}
......@@ -4820,9 +4820,9 @@ public class Ocgcore : ServantWithCardDescription
{
if (cardsInSelectAnimation.Count == 2)
{
if (cardsInSelectAnimation[0].p.location == (UInt32)game_location.LOCATION_SZONE)
if (cardsInSelectAnimation[0].p.location == (UInt32)CardLocation.SpellZone)
{
if (cardsInSelectAnimation[1].p.location == (UInt32)game_location.LOCATION_SZONE)
if (cardsInSelectAnimation[1].p.location == (UInt32)CardLocation.SpellZone)
{
if (cardsInSelectAnimation[1].p.sequence == 6 || cardsInSelectAnimation[1].p.sequence == 7)
{
......@@ -5091,7 +5091,7 @@ public class Ocgcore : ServantWithCardDescription
VectorAttackTarget = get_point_worldposition(gpsAttacked);
VectorAttackTarget += (VectorAttackTarget - VectorAttackCard) * 0.3f;
}
if ((attackedCard != null && gpsAttacked.location != 0) && (attackedCard.p.position & (UInt32)game_position.POS_FACEUP_ATTACK) > 0)
if ((attackedCard != null && gpsAttacked.location != 0) && (attackedCard.p.position & (UInt32)CardPosition.FaceUpAttack) > 0)
{
if (attackCard.get_data().Attack > attackedCard.get_data().Attack)
{
......@@ -5231,7 +5231,7 @@ public class Ocgcore : ServantWithCardDescription
player = localPlayer(r.ReadByte());
ES_searchCode.Clear();
ES_searchCode.Add(r.ReadInt32());
ES_searchCode.Add((int)YGOSharp.OCGWrapper.Enums.searchCode.OPCODE_ISTYPE);
ES_searchCode.Add((int)searchCode.OPCODE_ISTYPE);
RMSshow_input("AnnounceCard", InterString.Get("请输入关键字。"),"");
break;
case GameMessage.AnnounceCardFilter:
......@@ -5375,11 +5375,11 @@ public class Ocgcore : ServantWithCardDescription
placs.data[1] = resp[1];
placs.data[2] = resp[2];
placeSelectors.Add(placs);
if (location == (uint)game_location.LOCATION_MZONE && Program.I().setting.setting.hand.value == false)
if (location == (uint)CardLocation.MonsterZone && Program.I().setting.setting.hand.value == false)
{
ES_placeSelected(placs);
}
if (location == (uint)game_location.LOCATION_SZONE && Program.I().setting.setting.handm.value == false)
if (location == (uint)CardLocation.SpellZone && Program.I().setting.setting.handm.value == false)
{
ES_placeSelected(placs);
}
......@@ -5389,7 +5389,7 @@ public class Ocgcore : ServantWithCardDescription
{
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_HAND) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Hand) > 0)
{
if (cards[i].p.controller == player)
{
......@@ -5508,7 +5508,7 @@ public class Ocgcore : ServantWithCardDescription
return cardsInLocation;
}
void MHS_creatBundle(int count, int player, game_location location)
void MHS_creatBundle(int count, int player, CardLocation location)
{
for (int i = 0; i < count; i++)
{
......@@ -5516,13 +5516,13 @@ public class Ocgcore : ServantWithCardDescription
{
controller = (UInt32)player,
location = (UInt32)location,
position = (int)game_position.POS_FACEDOWN_ATTACK,
position = (int)CardPosition.FaceDownAttack,
sequence = (UInt32)i,
});
}
}
List<gameCard> MHS_resizeBundle(int count, int player, game_location location)
List<gameCard> MHS_resizeBundle(int count, int player, CardLocation location)
{
List<gameCard> cardBow = new List<gameCard>();
List<gameCard> waterOutOfBow = new List<gameCard>();
......@@ -5555,14 +5555,14 @@ public class Ocgcore : ServantWithCardDescription
{
controller = (UInt32)player,
location = (UInt32)location,
position = (int)game_position.POS_FACEDOWN_ATTACK,
position = (int)CardPosition.FaceDownAttack,
sequence = (UInt32)(cardBow.Count),
}));
}
for (int i = 0; i < cardBow.Count; i++)
{
cardBow[i].erase_data();
cardBow[i].p.position = (int)game_position.POS_FACEDOWN_ATTACK;
cardBow[i].p.position = (int)CardPosition.FaceDownAttack;
}
return cardBow;
}
......@@ -5614,19 +5614,19 @@ public class Ocgcore : ServantWithCardDescription
GameObject prewarmAttackEffect(gameCard card, Vector3 from, Vector3 to)
{
GameObject mod = Program.I().mod_ocgcore_bs_atk_line_earth;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_EARTH))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Earth))
mod = Program.I().mod_ocgcore_bs_atk_line_earth;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_WATER))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Water))
mod = Program.I().mod_ocgcore_bs_atk_line_water;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_FIRE))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Fire))
mod = Program.I().mod_ocgcore_bs_atk_line_fire;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_WIND))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Wind))
mod = Program.I().mod_ocgcore_bs_atk_line_wind;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_DARK))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Dark))
mod = Program.I().mod_ocgcore_bs_atk_line_dark;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_LIGHT))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Light))
mod = Program.I().mod_ocgcore_bs_atk_line_light;
if (GameStringHelper.differ(card.get_data().Attribute, (long)game_attributes.ATTRIBUTE_DEVINE))
if (GameStringHelper.differ(card.get_data().Attribute, (long)CardAttribute.Divine))
mod = Program.I().mod_ocgcore_bs_atk_line_light;
mod.transform.GetChild(0).localPosition = to;
mod.transform.GetChild(1).localPosition = from;
......@@ -5946,7 +5946,7 @@ public class Ocgcore : ServantWithCardDescription
if (cards.Count > 0)
{
UInt32 loc = cards[0].p.location;
if (loc != (UInt32)game_location.LOCATION_DECK)
if (loc != (UInt32)CardLocation.Deck)
{
return false;
}
......@@ -6287,7 +6287,7 @@ public class Ocgcore : ServantWithCardDescription
flagForTimeConfirm = false;
flagForCancleChain = false;
//Package p = new Package();
//p.Fuction = (int)YGOSharp.OCGWrapper.Enums.GameMessage.sibyl_clear;
//p.Fuction = (int)GameMessage.sibyl_clear;
//TcpHelper.AddRecordLine(p);
if (clearTimeFlag)
{
......@@ -6311,7 +6311,7 @@ public class Ocgcore : ServantWithCardDescription
clearAllSelectPlace();
int myMaxDeck = countLocationSequence(0, game_location.LOCATION_DECK);
int myMaxDeck = countLocationSequence(0, CardLocation.Deck);
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
......@@ -6325,7 +6325,7 @@ public class Ocgcore : ServantWithCardDescription
{
cards[i].forSelect = false;
cards[i].isShowed = false;
if ((cards[i].p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Deck) > 0)
{
if (deckReserved == false || cards[i].p.controller != 0 || cards[i].p.sequence != myMaxDeck)
{
......@@ -6341,7 +6341,7 @@ public class Ocgcore : ServantWithCardDescription
cards[i].isShowed = false;
}
}
if (cards[i].p.location == (uint)game_location.LOCATION_DECK)
if (cards[i].p.location == (uint)CardLocation.Deck)
{
cards[i].isShowed = false;
}
......@@ -6356,7 +6356,7 @@ public class Ocgcore : ServantWithCardDescription
List<gameCard> to_clear = new List<gameCard>();
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if (cards[i].p.location == (uint)game_location.search)
if (cards[i].p.location == (uint)CardLocation.Search)
{
to_clear.Add(cards[i]);
}
......@@ -6365,7 +6365,7 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < to_clear.Count; i++)
{
to_clear[i].hide();
to_clear[i].p.location = (UInt32)game_location.LOCATION_UNKNOWN;
to_clear[i].p.location = (UInt32)CardLocation.Unknown;
}
gameInfo.removeAll();
RMSshow_clear();
......@@ -6452,7 +6452,7 @@ public class Ocgcore : ServantWithCardDescription
List<gameCard> to_clear = new List<gameCard>();
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if (cards[i].p.location == (uint)game_location.LOCATION_UNKNOWN)
if (cards[i].p.location == (uint)CardLocation.Unknown)
{
to_clear.Add(cards[i]);
}
......@@ -6488,18 +6488,18 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
if (cards[i].cookie_cared == false)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) == 0)
if ((cards[i].p.location & (UInt32)CardLocation.Overlay) == 0)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.SpellZone) > 0)
{
cards[i].isShowed = false;
}
if ((cards[i].p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
cards[i].isShowed = false;
}
}
if ((((cards[i].p.location & (UInt32)game_location.LOCATION_HAND) > 0) && (cards[i].p.controller == 0)) || ((cards[i].p.location & (UInt32)game_location.LOCATION_UNKNOWN) > 0))
if ((((cards[i].p.location & (UInt32)CardLocation.Hand) > 0) && (cards[i].p.controller == 0)) || ((cards[i].p.location & (UInt32)CardLocation.Unknown) > 0))
{
cards[i].isShowed = true;
}
......@@ -6514,7 +6514,7 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if (cards[i].p.location == (uint)game_location.search)
if (cards[i].p.location == (uint)CardLocation.Search)
{
cards[i].isShowed = true;
}
......@@ -6602,13 +6602,13 @@ public class Ocgcore : ServantWithCardDescription
{
if (cards[i].p.controller == 1)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) == 0)
if ((cards[i].p.location & (UInt32)CardLocation.Overlay) == 0)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
op_m.Add(cards[i]);
}
if ((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.SpellZone) > 0)
{
op_s.Add(cards[i]);
}
......@@ -6617,7 +6617,7 @@ public class Ocgcore : ServantWithCardDescription
}
for (int m = 0; m < op_m.Count; m++)
{
if ((op_m[m].p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((op_m[m].p.position & (UInt32)CardPosition.FaceUp) > 0)
{
for (int s = 0; s < op_s.Count; s++)
{
......@@ -6646,13 +6646,13 @@ public class Ocgcore : ServantWithCardDescription
}
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) == 0)
if ((cards[i].p.location & (UInt32)CardLocation.Overlay) == 0)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
if (cards[i].p.sequence >= 0 && cards[i].p.sequence <= 6)
{
if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((cards[i].p.position & (UInt32)CardPosition.FaceUp) > 0)
{
if (cards[i].p.controller == 1)
{
......@@ -6713,15 +6713,15 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) == 0)
if ((cards[i].p.location & (UInt32)CardLocation.Overlay) == 0)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
if (cards[i].p.sequence >= 0 && cards[i].p.sequence <= 6)
{
if ((cards[i].get_data().Type & (UInt32)game_type.link) > 0)
if ((cards[i].get_data().Type & (UInt32)CardType.Link) > 0)
{
if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((cards[i].p.position & (UInt32)CardPosition.FaceUp) > 0)
{
if (cards[i].p.controller == 1)
{
......@@ -6771,7 +6771,7 @@ public class Ocgcore : ServantWithCardDescription
//if (vvv[curHang, curLie] != null)
{
GPS currentGPS = new GPS();
currentGPS.location = (int)game_location.LOCATION_MZONE;
currentGPS.location = (int)CardLocation.MonsterZone;
if (curHang == 4)
{
currentGPS.controller = 1;
......@@ -6963,7 +6963,7 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
if (cards[i].cookie_cared == false)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_HAND) > 0 && cards[i].p.controller == 1)
if ((cards[i].p.location & (UInt32)CardLocation.Hand) > 0 && cards[i].p.controller == 1)
{
line.Add(cards[i]);
}
......@@ -7007,7 +7007,7 @@ public class Ocgcore : ServantWithCardDescription
int overC = 0;
if (Program.getVerticalTransparency() > 0.5f)
{
if ((cards[i].p.position & (Int32)game_position.POS_FACEUP) > 0 && (cards[i].p.location & (Int32)game_location.LOCATION_ONFIELD) > 0)
if ((cards[i].p.position & (Int32)CardPosition.FaceUp) > 0 && (cards[i].p.location & (Int32)CardLocation.Onfield) > 0)
{
overC = overlayed_cards.Count;
}
......@@ -7024,7 +7024,7 @@ public class Ocgcore : ServantWithCardDescription
}
foreach (var item in cards[i].target)
{
if ((item.p.location & (UInt32)game_location.LOCATION_SZONE) > 0 || (item.p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((item.p.location & (UInt32)CardLocation.SpellZone) > 0 || (item.p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
animation_thunder(item.gameObject, cards[i].gameObject);
}
......@@ -7058,11 +7058,11 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
if (cards[i].cookie_cared == false)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.SpellZone) > 0)
{
if (cards[i].p.sequence == 0 || cards[i].p.sequence == 4)
{
if ((cards[i].get_data().Type & (int)game_type.TYPE_PENDULUM) > 0)
if ((cards[i].get_data().Type & (int)CardType.Pendulum) > 0)
{
if (cards[i].p.controller == 0)
{
......@@ -7195,7 +7195,7 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
if (cards[i].cookie_cared == false)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.SpellZone) > 0)
{
if (cards[i].p.sequence == 6 || cards[i].p.sequence == 7)
{
......@@ -7240,9 +7240,9 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
if (cards[i].cookie_cared == false)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Overlay) > 0)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Extra) > 0)
{
cards[i].cookie_cared = true;
cards[i].UA_give_condition(get_point_worldcondition(cards[i].p));
......@@ -7272,11 +7272,11 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if (((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) > 0) && cards[i].p.sequence == 5)
if (((cards[i].p.location & (UInt32)CardLocation.SpellZone) > 0) && cards[i].p.sequence == 5)
{
if (cards[i].p.controller == 0)
{
if ((cards[i].p.position & (Int32)game_position.POS_FACEUP) > 0)
if ((cards[i].p.position & (Int32)CardPosition.FaceUp) > 0)
{
code = cards[i].get_data().Id;
}
......@@ -7290,11 +7290,11 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if (((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) > 0) && cards[i].p.sequence == 5)
if (((cards[i].p.location & (UInt32)CardLocation.SpellZone) > 0) && cards[i].p.sequence == 5)
{
if (cards[i].p.controller == 1)
{
if ((cards[i].p.position & (Int32)game_position.POS_FACEUP) > 0)
if ((cards[i].p.position & (Int32)CardPosition.FaceUp) > 0)
{
code = cards[i].get_data().Id;
}
......@@ -7360,14 +7360,14 @@ public class Ocgcore : ServantWithCardDescription
}
animation_count(gameField.LOCATION_DECK_0, game_location.LOCATION_DECK, 0);
animation_count(gameField.LOCATION_EXTRA_0, game_location.LOCATION_EXTRA, 0);
animation_count(gameField.LOCATION_GRAVE_0, game_location.LOCATION_GRAVE, 0);
animation_count(gameField.LOCATION_REMOVED_0, game_location.LOCATION_REMOVED, 0);
animation_count(gameField.LOCATION_DECK_1, game_location.LOCATION_DECK, 1);
animation_count(gameField.LOCATION_EXTRA_1, game_location.LOCATION_EXTRA, 1);
animation_count(gameField.LOCATION_GRAVE_1, game_location.LOCATION_GRAVE, 1);
animation_count(gameField.LOCATION_REMOVED_1, game_location.LOCATION_REMOVED, 1);
animation_count(gameField.LOCATION_DECK_0, CardLocation.Deck, 0);
animation_count(gameField.LOCATION_EXTRA_0, CardLocation.Extra, 0);
animation_count(gameField.LOCATION_GRAVE_0, CardLocation.Grave, 0);
animation_count(gameField.LOCATION_REMOVED_0, CardLocation.Removed, 0);
animation_count(gameField.LOCATION_DECK_1, CardLocation.Deck, 1);
animation_count(gameField.LOCATION_EXTRA_1, CardLocation.Extra, 1);
animation_count(gameField.LOCATION_GRAVE_1, CardLocation.Grave, 1);
animation_count(gameField.LOCATION_REMOVED_1, CardLocation.Removed, 1);
gameField.realize();
Program.notGo(gameInfo.realize);
Program.go(50,gameInfo.realize);
......@@ -7414,7 +7414,7 @@ public class Ocgcore : ServantWithCardDescription
Vector3 get_world_rotation(gameCard card)
{
cardRuleComdition r = cardRuleComdition.meUpAtk;
if ((card.p.location & (UInt32)game_location.LOCATION_DECK) > 0)
if ((card.p.location & (UInt32)CardLocation.Deck) > 0)
{
if (card.get_data().Id > 0)
{
......@@ -7425,13 +7425,13 @@ public class Ocgcore : ServantWithCardDescription
r = cardRuleComdition.meDownAtk;
}
}
if ((card.p.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
if ((card.p.location & (UInt32)CardLocation.Grave) > 0)
{
r = cardRuleComdition.meUpAtk;
}
if ((card.p.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
if ((card.p.location & (UInt32)CardLocation.Removed) > 0)
{
if ((card.p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((card.p.position & (UInt32)CardPosition.FaceUp) > 0)
{
r = cardRuleComdition.meUpAtk;
}
......@@ -7440,9 +7440,9 @@ public class Ocgcore : ServantWithCardDescription
r = cardRuleComdition.meDownAtk;
}
}
if ((card.p.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
if ((card.p.location & (UInt32)CardLocation.Extra) > 0)
{
if ((card.p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((card.p.position & (UInt32)CardPosition.FaceUp) > 0)
{
r = cardRuleComdition.meUpAtk;
}
......@@ -7451,28 +7451,28 @@ public class Ocgcore : ServantWithCardDescription
r = cardRuleComdition.meDownAtk;
}
}
if ((card.p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
if ((card.p.location & (UInt32)CardLocation.MonsterZone) > 0)
{
if ((card.p.position & (UInt32)game_position.POS_FACEDOWN_DEFENSE) > 0)
if ((card.p.position & (UInt32)CardPosition.FaceDownDefence) > 0)
{
r = cardRuleComdition.meDownDef;
}
if ((card.p.position & (UInt32)game_position.POS_FACEUP_DEFENSE) > 0)
if ((card.p.position & (UInt32)CardPosition.FaceUpDefence) > 0)
{
r = cardRuleComdition.meUpDef;
}
if ((card.p.position & (UInt32)game_position.POS_FACEDOWN_ATTACK) > 0)
if ((card.p.position & (UInt32)CardPosition.FaceDownAttack) > 0)
{
r = cardRuleComdition.meDownAtk;
}
if ((card.p.position & (UInt32)game_position.POS_FACEUP_ATTACK) > 0)
if ((card.p.position & (UInt32)CardPosition.FaceUpAttack) > 0)
{
r = cardRuleComdition.meUpAtk;
}
}
if ((card.p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
if ((card.p.location & (UInt32)CardLocation.SpellZone) > 0)
{
if ((card.p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((card.p.position & (UInt32)CardPosition.FaceUp) > 0)
{
r = cardRuleComdition.meUpAtk;
}
......@@ -7481,7 +7481,7 @@ public class Ocgcore : ServantWithCardDescription
r = cardRuleComdition.meDownAtk;
}
}
if ((card.p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((card.p.location & (UInt32)CardLocation.Overlay) > 0)
{
r = cardRuleComdition.meUpAtk;
}
......@@ -7534,7 +7534,7 @@ public class Ocgcore : ServantWithCardDescription
//private Vector3 get_real_rotation(int i)
//{
// Vector3 r = get_point_worldrotation(cards[i].p);
// if ((cards[i].p.location & (UInt32)game_location.LOCATION_DECK) > 0)
// if ((cards[i].p.location & (UInt32)CardLocation.Deck) > 0)
// {
// if (cards[i].get_data().Id > 0)
// {
......@@ -7545,51 +7545,51 @@ public class Ocgcore : ServantWithCardDescription
// r = new Vector3(-90, 0, 0);
// }
// }
// if ((cards[i].p.location & (UInt32)game_location.LOCATION_MZONE) > 0)
// if ((cards[i].p.location & (UInt32)CardLocation.MonsterZone) > 0)
// {
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEDOWN_DEFENSE) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceDown_DEFENSE) > 0)
// {
// r = new Vector3(-90, 0, 90);
// }
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP_DEFENSE) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceUp_DEFENSE) > 0)
// {
// r = new Vector3(90, 0, 90);
// }
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEDOWN_ATTACK) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceDownAttack) > 0)
// {
// r = new Vector3(-90, 0, 0);
// }
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP_ATTACK) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceUpAttack) > 0)
// {
// r = new Vector3(90, 0, 0);
// }
// }
// if ((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) > 0)
// if ((cards[i].p.location & (UInt32)CardLocation.SpellZone) > 0)
// {
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEDOWN_DEFENSE) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceDown_DEFENSE) > 0)
// {
// r = new Vector3(-90, 0, 90);
// }
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP_DEFENSE) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceUp_DEFENSE) > 0)
// {
// r = new Vector3(90, 0, 90);
// }
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEDOWN_ATTACK) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceDownAttack) > 0)
// {
// r = new Vector3(-90, 0, 0);
// }
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP_ATTACK) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceUpAttack) > 0)
// {
// r = new Vector3(90, 0, 0);
// }
// }
// if ((cards[i].p.location & (UInt32)game_location.LOCATION_GRAVE) > 0)
// if ((cards[i].p.location & (UInt32)CardLocation.Grave) > 0)
// {
// r = new Vector3(90, 0, 0);
// }
// if ((cards[i].p.location & (UInt32)game_location.LOCATION_REMOVED) > 0)
// if ((cards[i].p.location & (UInt32)CardLocation.Removed) > 0)
// {
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceUp) > 0)
// {
// r = new Vector3(90, 0, 0);
// }
......@@ -7598,9 +7598,9 @@ public class Ocgcore : ServantWithCardDescription
// r = new Vector3(-90, 0, 0);
// }
// }
// if ((cards[i].p.location & (UInt32)game_location.LOCATION_EXTRA) > 0)
// if ((cards[i].p.location & (UInt32)CardLocation.Extra) > 0)
// {
// if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP) > 0)
// if ((cards[i].p.position & (UInt32)CardPosition.FaceUp) > 0)
// {
// r = new Vector3(90, 0, 0);
// }
......@@ -7609,7 +7609,7 @@ public class Ocgcore : ServantWithCardDescription
// r = new Vector3(-90, 0, 0);
// }
// }
// if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
// if ((cards[i].p.location & (UInt32)CardLocation.Overlay) > 0)
// {
// r = new Vector3(90, 0, 0);
// }
......@@ -7621,7 +7621,7 @@ public class Ocgcore : ServantWithCardDescription
// return r;
//}
private void animation_count(TMPro.TextMeshPro textmesh, game_location location, int player)
private void animation_count(TMPro.TextMeshPro textmesh, CardLocation location, int player)
{
int count = 0;
int countU = 0;
......@@ -7632,7 +7632,7 @@ public class Ocgcore : ServantWithCardDescription
if ((cards[i].p.location & (UInt32)location) > 0)
{
count++;
if ((cards[i].p.position & (UInt32)game_position.POS_FACEUP) > 0)
if ((cards[i].p.position & (UInt32)CardPosition.FaceUp) > 0)
{
countU++;
}
......@@ -7645,7 +7645,7 @@ public class Ocgcore : ServantWithCardDescription
}
else
{
if (location== game_location.LOCATION_EXTRA)
if (location== CardLocation.Extra)
{
textmesh.text = count.ToString()+"("+ countU .ToString()+ ")";
}
......@@ -7708,7 +7708,7 @@ public class Ocgcore : ServantWithCardDescription
public gameCard GCS_cardGet(GPS p, bool create)
{
gameCard c = null;
if ((p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((p.location & (UInt32)CardLocation.Overlay) > 0)
{
for (int i = 0; i < cards.Count; i++)
{
......@@ -7770,13 +7770,13 @@ public class Ocgcore : ServantWithCardDescription
List<gameCard> cas = new List<gameCard>();
if (c != null)
{
if ((c.p.location & (UInt32)game_location.LOCATION_OVERLAY) == 0)
if ((c.p.location & (UInt32)CardLocation.Overlay) == 0)
{
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Overlay) > 0)
if (cards[i].p.controller == c.p.controller)
if ((cards[i].p.location | (UInt32)game_location.LOCATION_OVERLAY) == (c.p.location | (UInt32)game_location.LOCATION_OVERLAY))
if ((cards[i].p.location | (UInt32)CardLocation.Overlay) == (c.p.location | (UInt32)CardLocation.Overlay))
if (cards[i].p.sequence == c.p.sequence)
cas.Add(cards[i]);
}
......@@ -7824,7 +7824,7 @@ public class Ocgcore : ServantWithCardDescription
if (swap == false)
{
if ((p1.location != p2.location) || ((p2.position & (int)game_position.POS_FACEDOWN) > 0))
if ((p1.location != p2.location) || ((p2.position & (int)CardPosition.FaceDown) > 0))
{
card_from.target.Clear();
for (int i = 0; i < cards.Count; i++) if (cards[i].gameObject.activeInHierarchy)
......@@ -7836,7 +7836,7 @@ public class Ocgcore : ServantWithCardDescription
}
}
if ((p2.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((p2.location & (UInt32)CardLocation.Overlay) > 0)
{
card_from.p_beforeOverLayed = p1;
}
......@@ -7869,9 +7869,9 @@ public class Ocgcore : ServantWithCardDescription
}
else
{
if ((card_to.p.location & (UInt32)game_location.LOCATION_OVERLAY) == 0)
if ((card_to.p.location & (UInt32)CardLocation.Overlay) == 0)
{
if (((card_to.p.location & (UInt32)game_location.LOCATION_MZONE) > 0) || ((card_to.p.location & (UInt32)game_location.LOCATION_SZONE) > 0))
if (((card_to.p.location & (UInt32)CardLocation.MonsterZone) > 0) || ((card_to.p.location & (UInt32)CardLocation.SpellZone) > 0))
{
if (card_from != null)
card_from.p = p2;
......@@ -7905,7 +7905,7 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < overlayed_cards_of_cardFrom.Count; i++)
{
overlayed_cards_of_cardFrom[i].p.controller = card_from.p.controller;
overlayed_cards_of_cardFrom[i].p.location = card_from.p.location | (UInt32)game_location.LOCATION_OVERLAY;
overlayed_cards_of_cardFrom[i].p.location = card_from.p.location | (UInt32)CardLocation.Overlay;
overlayed_cards_of_cardFrom[i].p.sequence = card_from.p.sequence;
overlayed_cards_of_cardFrom[i].p.position += 1000;
}
......@@ -7916,7 +7916,7 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < overlayed_cards_of_cardTo.Count; i++)
{
overlayed_cards_of_cardTo[i].p.controller = card_to.p.controller;
overlayed_cards_of_cardTo[i].p.location = card_to.p.location | (UInt32)game_location.LOCATION_OVERLAY;
overlayed_cards_of_cardTo[i].p.location = card_to.p.location | (UInt32)CardLocation.Overlay;
overlayed_cards_of_cardTo[i].p.sequence = card_to.p.sequence;
overlayed_cards_of_cardTo[i].p.position += 1000;
}
......@@ -7978,21 +7978,21 @@ public class Ocgcore : ServantWithCardDescription
}
else
{
if (left.p.location == (UInt32)game_location.LOCATION_HAND && right.p.location != (UInt32)game_location.LOCATION_HAND)
if (left.p.location == (UInt32)CardLocation.Hand && right.p.location != (UInt32)CardLocation.Hand)
{
a = -1;
}
else if (left.p.location != (UInt32)game_location.LOCATION_HAND && right.p.location == (UInt32)game_location.LOCATION_HAND)
else if (left.p.location != (UInt32)CardLocation.Hand && right.p.location == (UInt32)CardLocation.Hand)
{
a = 1;
}
else
{
if ((left.p.location | (UInt32)game_location.LOCATION_OVERLAY) > (right.p.location | (UInt32)game_location.LOCATION_OVERLAY))
if ((left.p.location | (UInt32)CardLocation.Overlay) > (right.p.location | (UInt32)CardLocation.Overlay))
{
a = -1;
}
else if ((left.p.location | (UInt32)game_location.LOCATION_OVERLAY) < (right.p.location | (UInt32)game_location.LOCATION_OVERLAY))
else if ((left.p.location | (UInt32)CardLocation.Overlay) < (right.p.location | (UInt32)CardLocation.Overlay))
{
a = 1;
}
......@@ -8008,11 +8008,11 @@ public class Ocgcore : ServantWithCardDescription
}
else
{
if ((left.p.location & (UInt32)game_location.LOCATION_OVERLAY) > (right.p.location & (UInt32)game_location.LOCATION_OVERLAY))
if ((left.p.location & (UInt32)CardLocation.Overlay) > (right.p.location & (UInt32)CardLocation.Overlay))
{
a = -1;
}
else if ((left.p.location & (UInt32)game_location.LOCATION_OVERLAY) < (right.p.location & (UInt32)game_location.LOCATION_OVERLAY))
else if ((left.p.location & (UInt32)CardLocation.Overlay) < (right.p.location & (UInt32)CardLocation.Overlay))
{
a = 1;
}
......@@ -8048,7 +8048,7 @@ public class Ocgcore : ServantWithCardDescription
{
sequenceWriter = 0;
}
if ((preLocation | (UInt32)game_location.LOCATION_OVERLAY) != (cards[i].p.location | (UInt32)game_location.LOCATION_OVERLAY))
if ((preLocation | (UInt32)CardLocation.Overlay) != (cards[i].p.location | (UInt32)CardLocation.Overlay))
{
sequenceWriter = 0;
}
......@@ -8057,15 +8057,15 @@ public class Ocgcore : ServantWithCardDescription
positionWriter = 0;
}
if ((cards[i].p.location & (UInt32)game_location.LOCATION_MZONE) == 0)
if ((cards[i].p.location & (UInt32)CardLocation.MonsterZone) == 0)
{
if ((cards[i].p.location & (UInt32)game_location.LOCATION_SZONE) == 0)
if ((cards[i].p.location & (UInt32)CardLocation.SpellZone) == 0)
{
cards[i].p.sequence = sequenceWriter;
}
}
if ((cards[i].p.location & (UInt32)game_location.LOCATION_OVERLAY) > 0)
if ((cards[i].p.location & (UInt32)CardLocation.Overlay) > 0)
{
cards[i].p.position = positionWriter;
positionWriter++;
......@@ -8752,7 +8752,7 @@ public class Ocgcore : ServantWithCardDescription
GPS p = new GPS
{
controller = 0,
location = (UInt32)game_location.search,
location = (UInt32)CardLocation.Search,
sequence = (UInt32)i,
position = 0,
};
......
using System;
using YGOSharp;
using YGOSharp.OCGWrapper.Enums;
public class GameStringHelper
{
public static string fen = "/";
......@@ -149,27 +150,27 @@ public class GameStringHelper
{
}
if (differ(card.Attribute,(int)game_attributes.ATTRIBUTE_EARTH))
if (differ(card.Attribute, (int)CardAttribute.Earth))
{
re = "[F4A460]" + re + "[-]";
}
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_WATER))
if (differ(card.Attribute, (int)CardAttribute.Water))
{
re = "[D1EEEE]" + re + "[-]";
}
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_FIRE))
if (differ(card.Attribute, (int)CardAttribute.Fire))
{
re = "[F08080]" + re + "[-]";
}
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_WIND))
if (differ(card.Attribute, (int)CardAttribute.Wind))
{
re = "[B3EE3A]" + re + "[-]";
}
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_LIGHT))
if (differ(card.Attribute, (int)CardAttribute.Light))
{
re = "[EEEE00]" + re + "[-]";
}
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_DARK))
if (differ(card.Attribute, (int)CardAttribute.Dark))
{
re = "[FF00FF]" + re + "[-]";
}
......@@ -182,9 +183,9 @@ public class GameStringHelper
string re = "";
try
{
if (differ(card.Type, (long)game_type.TYPE_MONSTER)) re += "[ff8000]" + mainType(card.Type);
else if (differ(card.Type, (long)game_type.TYPE_SPELL)) re += "[7FFF00]" + mainType(card.Type);
else if (differ(card.Type, (long)game_type.TYPE_TRAP)) re += "[dda0dd]" + mainType(card.Type);
if (differ(card.Type, (long)CardType.Monster)) re += "[ff8000]" + mainType(card.Type);
else if (differ(card.Type, (long)CardType.Spell)) re += "[7FFF00]" + mainType(card.Type);
else if (differ(card.Type, (long)CardType.Trap)) re += "[dda0dd]" + mainType(card.Type);
else re += "[ff8000]" + mainType(card.Type);
re += "[-]";
}
......@@ -206,9 +207,9 @@ public class GameStringHelper
re += "[ff8000]";
re += "["+secondType(data.Type)+"]";
if ((data.Type & (int)game_type.link) == 0)
if ((data.Type & (int)CardType.Link) == 0)
{
if ((data.Type & (int)game_type.TYPE_XYZ) > 0)
if ((data.Type & (int)CardType.Xyz) > 0)
{
re += " " + race(data.Race) + fen + attribute(data.Attribute) + fen + data.Level.ToString() + "[sup]☆[/sup]";
}
......@@ -251,7 +252,7 @@ public class GameStringHelper
re += "[sup]ATK[/sup]" + data.Attack.ToString() + " ";
}
}
if ((data.Type & (int)game_type.link) == 0)
if ((data.Type & (int)CardType.Link) == 0)
{
if (data.Defense < 0)
{
......
......@@ -5,7 +5,8 @@ using System.Collections.Generic;
using System.IO;
using System.Threading;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public enum GameTextureType
{
card_picture = 0,
......@@ -219,7 +220,7 @@ public class GameTextureManager
pic = waitLoadStack.Pop();
try
{
pic.pCard = (YGOSharp.CardsManager.Get((int)pic.code).Type & (int)game_type.TYPE_PENDULUM) > 0;
pic.pCard = (YGOSharp.CardsManager.Get((int)pic.code).Type & (int)CardType.Pendulum) > 0;
}
catch (Exception e)
{
......
......@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using YGOSharp.Network.Enums;
public class Room : WindowServantSP
{
......@@ -256,30 +257,30 @@ public class Room : WindowServantSP
p.Data = new BinaryMaster();
p.Data.writer.WriteUnicode(res, res.Length + 1);
TcpHelper.AddRecordLine(p);
switch ((YGOSharp.Network.Enums.PlayerType)player)
switch ((PlayerType)player)
{
case YGOSharp.Network.Enums.PlayerType.Red:
case PlayerType.Red:
result = "[FF3030]" + result + "[-]";
break;
case YGOSharp.Network.Enums.PlayerType.Green:
case PlayerType.Green:
result = "[7CFC00]" + result + "[-]";
break;
case YGOSharp.Network.Enums.PlayerType.Blue:
case PlayerType.Blue:
result = "[4876FF]" + result + "[-]";
break;
case YGOSharp.Network.Enums.PlayerType.BabyBlue:
case PlayerType.BabyBlue:
result = "[63B8FF]" + result + "[-]";
break;
case YGOSharp.Network.Enums.PlayerType.Pink:
case PlayerType.Pink:
result = "[EED2EE]" + result + "[-]";
break;
case YGOSharp.Network.Enums.PlayerType.Yellow:
case PlayerType.Yellow:
result = "[EEEE00]" + result + "[-]";
break;
case YGOSharp.Network.Enums.PlayerType.White:
case PlayerType.White:
result = "[FAF0E6]" + result + "[-]";
break;
case YGOSharp.Network.Enums.PlayerType.Gray:
case PlayerType.Gray:
result = "[CDC9C9]" + result + "[-]";
break;
}
......
......@@ -109,11 +109,6 @@ public class RoomList : WindowServantSP
string portString = UIHelper.getByName<UIInput>(Program.I().selectServer.gameObject, "port_").value;
string pswString = roomPsw;
string versionString = UIHelper.getByName<UIInput>(Program.I().selectServer.gameObject, "version_").value;
if (versionString == "")
{
UIHelper.getByName<UIInput>(Program.I().selectServer.gameObject, "version_").value = "0x1349";
versionString = "0x1349";
}
Program.I().roomList.hide();
Program.I().selectServer.KF_onlineGame(Name, ipString, portString, versionString, pswString);
}
......
......@@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class selectDeck : WindowServantSP
{
......@@ -318,15 +320,15 @@ public class selectDeck : WindowServantSP
{
mainAll++;
YGOSharp.Card c = YGOSharp.CardsManager.Get(item);
if ((c.Type & (UInt32)game_type.TYPE_MONSTER) > 0)
if ((c.Type & (UInt32)CardType.Monster) > 0)
{
mainMonster++;
}
if ((c.Type & (UInt32)game_type.TYPE_SPELL) > 0)
if ((c.Type & (UInt32)CardType.Spell) > 0)
{
mainSpell++;
}
if ((c.Type & (UInt32)game_type.TYPE_TRAP) > 0)
if ((c.Type & (UInt32)CardType.Trap) > 0)
{
mainTrap++;
}
......@@ -349,15 +351,15 @@ public class selectDeck : WindowServantSP
{
sideAll++;
YGOSharp.Card c = YGOSharp.CardsManager.Get(item);
if ((c.Type & (UInt32)game_type.TYPE_MONSTER) > 0)
if ((c.Type & (UInt32)CardType.Monster) > 0)
{
sideMonster++;
}
if ((c.Type & (UInt32)game_type.TYPE_SPELL) > 0)
if ((c.Type & (UInt32)CardType.Spell) > 0)
{
sideSpell++;
}
if ((c.Type & (UInt32)game_type.TYPE_TRAP) > 0)
if ((c.Type & (UInt32)CardType.Trap) > 0)
{
sideTrap++;
}
......@@ -379,19 +381,19 @@ public class selectDeck : WindowServantSP
{
extraAll++;
YGOSharp.Card c = YGOSharp.CardsManager.Get(item);
if ((c.Type & (UInt32)game_type.TYPE_FUSION) > 0)
if ((c.Type & (UInt32)CardType.Fusion) > 0)
{
extraFusion++;
}
if ((c.Type & (UInt32)game_type.TYPE_SYNCHRO) > 0)
if ((c.Type & (UInt32)CardType.Synchro) > 0)
{
extraSync++;
}
if ((c.Type & (UInt32)game_type.TYPE_XYZ) > 0)
if ((c.Type & (UInt32)CardType.Xyz) > 0)
{
extraXyz++;
}
if ((c.Type & (UInt32)game_type.link) > 0)
if ((c.Type & (UInt32)CardType.Link) > 0)
{
extraLink++;
}
......
......@@ -1308,7 +1308,7 @@ public class DeckManager : ServantWithCardDescription
{
if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id))
{
if ((cardPicLoader_.data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Token) == 0)
if ((cardPicLoader_.data.Type & (UInt32)CardType.Token) == 0)
{
MonoCardInDeckManager card = createCard();
card.transform.position = card.getGoodPosition(4);
......@@ -1377,13 +1377,13 @@ public class DeckManager : ServantWithCardDescription
if (isSide)
{
if (
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Fusion) > 0
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Fusion) > 0
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Synchro) > 0
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Synchro) > 0
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Xyz) > 0
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Link) > 0
)
{
deck.IExtra.Add(MonoCardInDeckManager_);
......@@ -1421,13 +1421,13 @@ public class DeckManager : ServantWithCardDescription
deck.Side.Add(card.cardData.Id);
}
else if (
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Fusion) > 0
(data.Type & (UInt32)CardType.Fusion) > 0
||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Synchro) > 0
(data.Type & (UInt32)CardType.Synchro) > 0
||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0
(data.Type & (UInt32)CardType.Xyz) > 0
||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0
(data.Type & (UInt32)CardType.Link) > 0
)
{
deck.IExtra.Add(card);
......@@ -1496,13 +1496,13 @@ public class DeckManager : ServantWithCardDescription
default:
{
YGOSharp.Card card = YGOSharp.CardsManager.Get(code);
if ((card.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Fusion) > 0
if ((card.Type & (UInt32)CardType.Fusion) > 0
||
(card.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Synchro) > 0
(card.Type & (UInt32)CardType.Synchro) > 0
||
(card.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0
(card.Type & (UInt32)CardType.Xyz) > 0
||
(card.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.link) > 0)
(card.Type & (UInt32)CardType.Link) > 0)
{
deck.Extra.Add(code);
deck.Deck_O.Extra.Add(code);
......@@ -1613,13 +1613,13 @@ public class DeckManager : ServantWithCardDescription
if (p.z > -8)
{
if (
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Fusion) > 0
(deckTemp[i].cardData.Type & (UInt32)CardType.Fusion) > 0
||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Synchro) > 0
(deckTemp[i].cardData.Type & (UInt32)CardType.Synchro) > 0
||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0
(deckTemp[i].cardData.Type & (UInt32)CardType.Xyz) > 0
||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0
(deckTemp[i].cardData.Type & (UInt32)CardType.Link) > 0
)
{
deck.IExtra.Add(deckTemp[i]);
......
......@@ -4,7 +4,8 @@ using Mono.Data.Sqlite;
using System;
using System.IO;
using System.Text.RegularExpressions;
using YGOSharp.OCGWrapper.Enums;
namespace YGOSharp
{
internal static class CardsManager
......@@ -117,7 +118,7 @@ namespace YGOSharp
foreach (var item in _cards)
{
Card card = item.Value;
if ((card.Type & (uint)game_type.TYPE_TOKEN) == 0)
if ((card.Type & (uint)CardType.Token) == 0)
{
if (getName == ""
|| Regex.Replace(card.Name, getName,"miaowu", RegexOptions.IgnoreCase) != card.Name
......@@ -231,7 +232,7 @@ namespace YGOSharp
{
switch (getsearchCode[i])
{
case (int)OCGWrapper.Enums.searchCode.OPCODE_ADD:
case (int)searchCode.OPCODE_ADD:
if (stack.Count >= 2)
{
int rhs = stack.Pop();
......@@ -239,7 +240,7 @@ namespace YGOSharp
stack.Push(lhs + rhs);
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_SUB:
case (int)searchCode.OPCODE_SUB:
if (stack.Count >= 2)
{
int rhs = stack.Pop();
......@@ -247,7 +248,7 @@ namespace YGOSharp
stack.Push(lhs - rhs);
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_MUL:
case (int)searchCode.OPCODE_MUL:
if (stack.Count >= 2)
{
int rhs = stack.Pop();
......@@ -255,7 +256,7 @@ namespace YGOSharp
stack.Push(lhs * rhs);
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_DIV:
case (int)searchCode.OPCODE_DIV:
if (stack.Count >= 2)
{
int rhs = stack.Pop();
......@@ -263,7 +264,7 @@ namespace YGOSharp
stack.Push(lhs / rhs);
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_AND:
case (int)searchCode.OPCODE_AND:
if (stack.Count >= 2)
{
int rhs = stack.Pop();
......@@ -280,7 +281,7 @@ namespace YGOSharp
}
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_OR:
case (int)searchCode.OPCODE_OR:
if (stack.Count >= 2)
{
int rhs = stack.Pop();
......@@ -297,14 +298,14 @@ namespace YGOSharp
}
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_NEG:
case (int)searchCode.OPCODE_NEG:
if (stack.Count >= 1)
{
int rhs = stack.Pop();
stack.Push(-rhs);
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_NOT:
case (int)searchCode.OPCODE_NOT:
if (stack.Count >= 1)
{
int rhs = stack.Pop();
......@@ -319,7 +320,7 @@ namespace YGOSharp
}
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISCODE:
case (int)searchCode.OPCODE_ISCODE:
if (stack.Count >= 1)
{
int code = stack.Pop();
......@@ -334,7 +335,7 @@ namespace YGOSharp
}
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISSETCARD:
case (int)searchCode.OPCODE_ISSETCARD:
if (stack.Count >= 1)
{
if (IfSetCard(stack.Pop(), card.Setcode))
......@@ -347,7 +348,7 @@ namespace YGOSharp
}
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISTYPE:
case (int)searchCode.OPCODE_ISTYPE:
if (stack.Count >= 1)
{
if ((stack.Pop() & card.Type) > 0)
......@@ -360,7 +361,7 @@ namespace YGOSharp
}
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISRACE:
case (int)searchCode.OPCODE_ISRACE:
if (stack.Count >= 1)
{
if ((stack.Pop() & card.Race) > 0)
......@@ -373,7 +374,7 @@ namespace YGOSharp
}
}
break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISATTRIBUTE:
case (int)searchCode.OPCODE_ISATTRIBUTE:
if (stack.Count >= 1)
{
if ((stack.Pop() & card.Attribute) > 0)
......@@ -394,13 +395,13 @@ namespace YGOSharp
if (stack.Count != 1 || stack.Pop() == 0)
return false;
return
card.Id == (int)YGOSharp.OCGWrapper.Enums.Sp.CARD_MARINE_DOLPHIN
card.Id == (int)TwoNameCards.CARD_MARINE_DOLPHIN
||
card.Id == (int)YGOSharp.OCGWrapper.Enums.Sp.CARD_TWINKLE_MOSS
card.Id == (int)TwoNameCards.CARD_TWINKLE_MOSS
||
(!(card.Alias != 0)
&& ((card.Type & ((int)YGOSharp.OCGWrapper.Enums.CardType.Monster + (int)YGOSharp.OCGWrapper.Enums.CardType.Token)))
!= ((int)YGOSharp.OCGWrapper.Enums.CardType.Monster + (int)YGOSharp.OCGWrapper.Enums.CardType.Token));
&& ((card.Type & ((int)CardType.Monster + (int)CardType.Token)))
!= ((int)CardType.Monster + (int)CardType.Token));
}
public static bool IfSetCard(int setCodeToAnalyse, long setCodeFromCard)
......
......@@ -11,7 +11,7 @@
Divine = 0x40,
}
public enum Sp
public enum TwoNameCards
{
CARD_MARINE_DOLPHIN = 78734254,
CARD_TWINKLE_MOSS = 13857930,
......
......@@ -10,6 +10,9 @@
Removed = 0x20,
Extra = 0x40,
Overlay = 0x80,
Onfield = 0x0C
Onfield = 0x0C,
Unknown = 0,
Search = 0x800
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: f327885de3e94cd4187a9a4e91544c1f
folderAsset: yes
timeCreated: 1469172510
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//using Mono.Data.Sqlite;
//using System;
//using System.Collections.Generic;
//using System.IO;
//using SQLiteConnection = Mono.Data.Sqlite.SqliteConnection;
//using SQLiteCommand = Mono.Data.Sqlite.SqliteCommand;
//using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
//public class CardDataManager
//{
// List<CardData> CardDatas;
// public CardDataManager()
// {
// CardDatas = new List<CardData>();
// DirectoryInfo TheFolder = new DirectoryInfo("data_card");
// FileInfo[] fileInfo = TheFolder.GetFiles();
// foreach (FileInfo NextFile in fileInfo)
// {
// string path = "data_card\\" + NextFile.Name;
// load(path);
// }
// }
// public void load(string path)
// {
// using (SQLiteConnection connection = new SQLiteConnection("Data Source=" + path))
// {
// connection.Open();
// using (SQLiteCommand command = new SQLiteCommand("SELECT datas.*, texts.* FROM datas,texts WHERE datas.id=texts.id;",
// connection))
// {
// using (SQLiteDataReader reader = command.ExecuteReader())
// {
// while (reader.Read())
// {
// try
// {
// CardData c = new CardData();
// c.Str = new string[16];
// c.code = reader.GetInt64(0);
// c.Ot = reader.GetInt32(1);
// c.Alias = reader.GetInt64(2);
// c.SetCode = reader.GetInt64(3);
// c.Type = reader.GetInt64(4);
// c.Attack = reader.GetInt32(5);
// c.Defense = reader.GetInt32(6);
// long Level_raw = reader.GetInt64(7);
// c.Level = Level_raw & 0xff;
// c.LeftScale = (Level_raw >> 0x18) & 0xff;
// c.RightScale = (Level_raw >> 0x10) & 0xff;
// c.Race = reader.GetInt32(8);
// c.Attribute = reader.GetInt32(9);
// c.Category = reader.GetInt64(10);
// c.Name = reader.GetString(12);
// c.Desc = reader.GetString(13);
// c.tail = "";
// for (int ii = 0; ii < 0x10; ii++)
// {
// c.Str[ii] = reader.GetString(14 + ii);
// }
// CardDatas.Add(c);
// }
// catch (Exception e)
// {
// }
// }
// }
// }
// }
// /////////////////////////////////////////////////////
// //string text_all = System.IO.File.ReadAllText(path);
// //string[] card_strings = text_all.Split(new string[] { "/*/*/*/" }, StringSplitOptions.RemoveEmptyEntries);
// //foreach (string one_card_string in card_strings)
// //{
// // try
// // {
// // CardData c = new CardData();
// // c.Str = new string[16];
// // string[] elements = one_card_string.Split(new string[] { "|-" }, StringSplitOptions.RemoveEmptyEntries);
// // c.code = long.Parse(elements[0]);
// // c.Ot = int.Parse(elements[1]);
// // c.Alias = long.Parse(elements[2]);
// // c.SetCode = int.Parse(elements[3]);
// // c.Type = int.Parse(elements[4]);
// // c.Attack = int.Parse(elements[5]);
// // c.Defense = int.Parse(elements[6]);
// // c.Level = int.Parse(elements[7]);
// // c.LeftScale = int.Parse(elements[8]);
// // c.RightScale = int.Parse(elements[9]);
// // c.Race = int.Parse(elements[10]);
// // c.Attribute = int.Parse(elements[11]);
// // c.Name = elements[12];
// // c.Desc = elements[13];
// // for (int i = 0; i < 16;i++ )
// // {
// // if (elements.Length > 14 + i)
// // c.Str[i] = elements[14 + i];
// // }
// // CardDatas.Add(c);
// // }
// // catch(Exception e)
// // {
// // }
// //}
// }
// public CardData GetById(long id)
// {
// CardData card = new CardData();
// card.code = 0;
// card.Name = "预留广告位";
// card.Desc = "预留广告位 \n联系作者qq:914847518";
// if (id > 0) for (int i = 0; i < 10; i++)
// {
// foreach (CardData one_CardData in CardDatas)
// {
// if (one_CardData.code == id - i)
// {
// card = one_CardData;
// break;
// }
// }
// if (card.code > 0) break;
// }
// return card;
// }
// public List<CardData> search(UInt32 type, string str)
// {
// List<CardData> return_valse = new List<CardData>();
// if (str!="")
// {
// foreach (CardData one_CardData in CardDatas)
// {
// if (one_CardData.Name.Replace(str, "") != one_CardData.Name)
// {
// if ((one_CardData.Type | type) > 0)
// {
// return_valse.Add(one_CardData);
// }
// }
// }
// }
// return return_valse;
// }
// public List<CardData> search_advanced
// (
// UInt32 fil_type_temp,
// UInt32 fil_type_race_temp,
// UInt32 fil_type_attribute_temp,
// UInt32 fil_type_catagory_temp,
// string str,
// int atk=-233,
// int def=-233,
// int star=-233
// )
// {
// //if (fil_type_temp==0)
// //{
// // if (fil_type_race_temp == 0)
// // {
// // if (fil_type_attribute_temp == 0)
// // {
// // if (fil_type_catagory_temp == 0)
// // {
// // if (str=="")
// // {
// // if (atk==-233)
// // {
// // if (def == -233)
// // {
// // if (star == -233)
// // {
// // return new List<CardData>();
// // }
// // }
// // }
// // }
// // }
// // }
// // }
// //}
// UInt32 fil_type = fil_type_temp;
// if (fil_type == 0)
// {
// //fil_type = 0xffffffff;
// }
// UInt32 fil_type_race = fil_type_race_temp;
// if (fil_type_race == 0)
// {
// //fil_type_race = 0xffffffff;
// }
// UInt32 fil_type_attribute = fil_type_attribute_temp;
// if (fil_type_attribute == 0)
// {
// //fil_type_attribute = 0xffffffff;
// }
// UInt32 fil_type_catagory = fil_type_catagory_temp;
// if (fil_type_catagory == 0)
// {
// // fil_type_catagory = 0xffffffff;
// }
// List<CardData> return_valse = new List<CardData>();
// //if (str != "")
// {
// foreach (CardData one_CardData in CardDatas)
// {
// string string_name = one_CardData.Name;
// if (str == "" || string_name.Replace(str, "") != string_name || one_CardData.code.ToString() == str)
// {
// if ((one_CardData.Type & fil_type) == fil_type || (fil_type == 0))
// {
// if ((one_CardData.Race & fil_type_race) == fil_type_race || (fil_type_race == 0))
// {
// if (((UInt32)one_CardData.Attribute & fil_type_attribute) == fil_type_attribute || (fil_type_attribute == 0))
// {
// if ((one_CardData.Category & fil_type_catagory) == fil_type_catagory || (fil_type_catagory == 0))
// {
// if (one_CardData.Attack == atk || (atk == -233))
// {
// if (one_CardData.Defense == def || (def == -233))
// {
// if (one_CardData.Level == star || (star == -233))
// {
// return_valse.Add(one_CardData);
// }
// }
// }
// }
// }
// }
// }
// }
// }
// }
// return_valse.Sort(comparisonOfCard());
// return return_valse;
// }
// private static Comparison<CardData> comparisonOfCard()
// {
// return (left, right) =>
// {
// int a = 1;
// if ((left.Type & 7) < (right.Type & 7))
// {
// a = -1;
// }
// else if ((left.Type & 7) > (right.Type & 7))
// {
// a = 1;
// }
// else
// {
// if (left.Level > right.Level)
// {
// a = -1;
// }
// else if (left.Level < right.Level)
// {
// a = 1;
// }
// else
// {
// if (left.Attack > right.Attack)
// {
// a = -1;
// }
// else if (left.Attack < right.Attack)
// {
// a = 1;
// }
// else
// {
// if ((left.Type >> 3) > (right.Type >> 3))
// {
// a = 1;
// }
// else if ((left.Type >> 3) < (right.Type >> 3))
// {
// a = -1;
// }
// else
// {
// if (left.Attribute > right.Attribute)
// {
// a = 1;
// }
// else if (left.Attribute < right.Attribute)
// {
// a = -1;
// }
// else
// {
// if (left.Race > right.Race)
// {
// a = 1;
// }
// else if (left.Race < right.Race)
// {
// a = -1;
// }
// else
// {
// if (left.Category > right.Category)
// {
// a = 1;
// }
// else if (left.Category < right.Category)
// {
// a = -1;
// }
// }
// }
// }
// }
// }
// }
// return a;
// };
// }
// public string get_description(UInt32 l)
// {
// string re = "";
// UInt32 code = l >> 4;
// UInt32 index = l & 0xf;
// try
// {
// re += GetById(code).Str[index];
// }
// catch (Exception e)
// {
// }
// return re;
// }
//}
fileFormatVersion: 2
guid: 94fe09e18fbcd1946af542ce761a3470
timeCreated: 1480605655
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
fileFormatVersion: 2
guid: 0c4a0e6dafcb7be4d9579cc54c1a3547
timeCreated: 1469113965
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
public enum game_function
{
MSG_RETRY = 1,
MSG_HINT = 2,
MSG_WAITING = 3,
MSG_START = 4,
MSG_WIN = 5,
MSG_UPDATE_DATA = 6,
MSG_UPDATE_CARD = 7,
MSG_REQUEST_DECK = 8,
MSG_SELECT_BATTLECMD = 10,
MSG_SELECT_IDLECMD = 11,
MSG_SELECT_EFFECTYN = 12,
MSG_SELECT_YESNO = 13,
MSG_SELECT_OPTION = 14,
MSG_SELECT_CARD = 15,
MSG_SELECT_CHAIN = 16,
MSG_SELECT_PLACE = 18,
MSG_SELECT_POSITION = 19,
MSG_SELECT_TRIBUTE = 20,
MSG_SORT_CHAIN = 21,
MSG_SELECT_COUNTER = 22,
MSG_SELECT_SUM = 23,
MSG_SELECT_DISFIELD = 24,
MSG_SORT_CARD = 25,
MSG_CONFIRM_DECKTOP = 30,
MSG_CONFIRM_CARDS = 31,
MSG_SHUFFLE_DECK = 32,
MSG_SHUFFLE_HAND = 33,
MSG_REFRESH_DECK = 34,
MSG_SWAP_GRAVE_DECK = 35,
MSG_SHUFFLE_SET_CARD = 36,
MSG_REVERSE_DECK = 37,
MSG_DECK_TOP = 38,
MSG_NEW_TURN = 40,
MSG_NEW_PHASE = 41,
MSG_MOVE = 50,
MSG_POS_CHANGE = 53,
MSG_SET = 54,
MSG_SWAP = 55,
MSG_FIELD_DISABLED = 56,
MSG_SUMMONING = 60,
MSG_SUMMONED = 61,
MSG_SPSUMMONING = 62,
MSG_SPSUMMONED = 63,
MSG_FLIPSUMMONING = 64,
MSG_FLIPSUMMONED = 65,
MSG_CHAINING = 70,
MSG_CHAINED = 71,
MSG_CHAIN_SOLVING = 72,
MSG_CHAIN_SOLVED = 73,
MSG_CHAIN_END = 74,
MSG_CHAIN_NEGATED = 75,
MSG_CHAIN_DISABLED = 76,
MSG_CARD_SELECTED = 80,
MSG_RANDOM_SELECTED = 81,
MSG_BECOME_TARGET = 83,
MSG_DRAW = 90,
MSG_DAMAGE = 91,
MSG_RECOVER = 92,
MSG_EQUIP = 93,
MSG_LPUPDATE = 94,
MSG_UNEQUIP = 95,
MSG_CARD_TARGET = 96,
MSG_CANCEL_TARGET = 97,
MSG_PAY_LPCOST = 100,
MSG_ADD_COUNTER = 101,
MSG_REMOVE_COUNTER = 102,
MSG_ATTACK = 110,
MSG_BATTLE = 111,
MSG_ATTACK_DISABLED = 112,
MSG_DAMAGE_STEP_START = 113,
MSG_DAMAGE_STEP_END = 114,
MSG_MISSED_EFFECT = 120,
MSG_BE_CHAIN_TARGET = 121,
MSG_CREATE_RELATION = 122,
MSG_RELEASE_RELATION = 123,
MSG_TOSS_COIN = 130,
MSG_TOSS_DICE = 131,
MSG_ANNOUNCE_RACE = 140,
MSG_ANNOUNCE_ATTRIB = 141,
MSG_ANNOUNCE_CARD = 142,
MSG_ANNOUNCE_NUMBER = 143,
MSG_CARD_HINT = 160,
MSG_TAG_SWAP = 161,
MSG_RELOAD_FIELD = 162,
MSG_AI_NAME = 163,
MSG_SHOW_HINT = 164,
MSG_MATCH_KILL = 170,
MSG_CUSTOM_MSG = 180,
MSG_HINT_EVENT = 190,
MSG_HINT_MESSAGE = 191,
MSG_HINT_SELECTMSG = 192,
MSG_HINT_OPSELECTED = 193,
MSG_HINT_EFFECT = 194,
MSG_HINT_RACE = 195,
MSG_HINT_ATTRIB = 196,
MSG_HINT_CODE = 197,
MSG_HINT_NUMBER = 198,
MSG_HINT_CARD = 199,
MSG_CHINT_TURN = 200,
MSG_CHINT_CARD = 201,
MSG_CHINT_RACE = 202,
MSG_CHINT_ATTRIBUTE = 203,
MSG_CHINT_NUMBER = 204,
MSG_CHINT_DESC_ADD = 205,
MSG_CHINT_DESC_REMOVE = 206,
MSG_QUERY_CODE = 210,
MSG_QUERY_POSITION = 211,
MSG_QUERY_ALIAS = 212,
MSG_QUERY_TYPE = 213,
MSG_QUERY_LEVEL = 214,
MSG_QUERY_RANK = 215,
MSG_QUERY_ATTRIBUTE = 216,
MSG_QUERY_RACE = 217,
MSG_QUERY_ATTACK = 218,
MSG_QUERY_DEFENSE = 219,
MSG_QUERY_BASE_ATTACK = 220,
MSG_QUERY_BASE_DEFENSE = 221,
MSG_QUERY_REASON = 222,
MSG_QUERY_REASON_CARD = 223,
MSG_QUERY_EQUIP_CARD = 224,
MSG_QUERY_TARGET_CARD = 225,
MSG_QUERY_OVERLAY_CARD = 226,
MSG_QUERY_COUNTERS = 227,
MSG_QUERY_OWNER = 228,
MSG_QUERY_IS_DISABLED = 229,
MSG_QUERY_IS_PUBLIC = 230,
MSG_QUERY_LSCALE = 231,
MSG_QUERY_RSCALE = 232,
}
public enum game_position
{
POS_FACEUP_ATTACK = 0x1,
POS_FACEDOWN_ATTACK = 0x2,
POS_FACEUP_DEFENSE = 0x4,
POS_FACEDOWN_DEFENSE = 0x8,
POS_FACEUP = 0x5,
POS_FACEDOWN = 0xa,
POS_ATTACK = 0x3,
POS_DEFENSE = 0xc,
}
public enum game_location
{
LOCATION_UNKNOWN=0x00,
LOCATION_DECK = 0x01,
LOCATION_HAND = 0x02,
LOCATION_MZONE = 0x04,
LOCATION_SZONE = 0x08,
LOCATION_GRAVE = 0x10,
LOCATION_REMOVED = 0x20,
LOCATION_EXTRA = 0x40,
LOCATION_OVERLAY = 0x80,
LOCATION_ONFIELD = 0x0c,
LOCATION_FZONE = 0x100,
LOCATION_PZONE = 0x200,
search = 0x800,
}
public enum game_race
{
RACE_WARRIOR = 0x1,
RACE_SPELLCASTER = 0x2,
RACE_FAIRY = 0x4,
RACE_FIEND = 0x8,
RACE_ZOMBIE = 0x10,
RACE_MACHINE = 0x20,
RACE_AQUA = 0x40,
RACE_PYRO = 0x80,
RACE_ROCK = 0x100,
RACE_WINDBEAST = 0x200,
RACE_PLANT = 0x400,
RACE_INSECT = 0x800,
RACE_THUNDER = 0x1000,
RACE_DRAGON = 0x2000,
RACE_BEAST = 0x4000,
RACE_BEASTWARRIOR = 0x8000,
RACE_DINOSAUR = 0x10000,
RACE_FISH = 0x20000,
RACE_SEASERPENT = 0x40000,
RACE_REPTILE = 0x80000,
RACE_PSYCHO = 0x100000,
RACE_DEVINE = 0x200000,
RACE_CREATORGOD = 0x400000,
RACE_PHANTOMDRAGON = 0x800000,
}
public enum game_attributes
{
ATTRIBUTE_EARTH = 0x01,
ATTRIBUTE_WATER = 0x02,
ATTRIBUTE_FIRE = 0x04,
ATTRIBUTE_WIND = 0x08,
ATTRIBUTE_LIGHT = 0x10,
ATTRIBUTE_DARK = 0x20,
ATTRIBUTE_DEVINE = 0x40,
}
public enum game_type
{
TYPE_MONSTER = 0x1,
TYPE_SPELL = 0x2,
TYPE_TRAP = 0x4,
TYPE_NORMAL = 0x10,
TYPE_EFFECT = 0x20,
TYPE_FUSION = 0x40,
TYPE_RITUAL = 0x80,
TYPE_TRAPMONSTER = 0x100,
TYPE_SPIRIT = 0x200,
TYPE_UNION = 0x400,
TYPE_DUAL = 0x800,
TYPE_TUNER = 0x1000,
TYPE_SYNCHRO = 0x2000,
TYPE_TOKEN = 0x4000,
TYPE_QUICKPLAY = 0x10000,
TYPE_CONTINUOUS = 0x20000,
TYPE_EQUIP = 0x40000,
TYPE_FIELD = 0x80000,
TYPE_COUNTER = 0x100000,
TYPE_FLIP = 0x200000,
TYPE_TOON = 0x400000,
TYPE_XYZ = 0x800000,
TYPE_PENDULUM = 0x1000000,
link = 0x4000000,
}
public enum servant_type
{
OCGCORE_DEBUG = 0,
}
public enum game_phrases
{
PHASE_DRAW = 0x01,
PHASE_STANDBY = 0x02,
PHASE_MAIN1 = 0x04,
PHASE_BATTLE_START = 0x08,
PHASE_BATTLE_STEP = 0x10,
PHASE_DAMAGE = 0x20,
PHASE_DAMAGE_CAL = 0x40,
PHASE_BATTLE = 0x80,
PHASE_MAIN2 = 0x100,
PHASE_END = 0x200,
}
public enum TypeOfDuel
{
Normal = 0x01,
TAG = 0x20,
};
public enum StocMessage
{
GameMsg = 0x1,
ErrorMsg = 0x2,
SelectHand = 0x3,
SelectTp = 0x4,
HandResult = 0x5,
TpResult = 0x6,
ChangeSide = 0x7,
WaitingSide = 0x8,
CreateGame = 0x11,
JoinGame = 0x12,
TypeChange = 0x13,
LeaveGame = 0x14,
DuelStart = 0x15,
DuelEnd = 0x16,
Replay = 0x17,
TimeLimit = 0x18,
Chat = 0x19,
HsPlayerEnter = 0x20,
HsPlayerChange = 0x21,
HsWatchChange = 0x22,
jinglai=0x23,
chuqu=0x24
}
public enum CtosMessage
{
Response = 0x1,
UpdateDeck = 0x2,
HandResult = 0x3,
TpResult = 0x4,
PlayerInfo = 0x10,
CreateGame = 0x11,
JoinGame = 0x12,
LeaveGame = 0x13,
Surrender = 0x14,
TimeConfirm = 0x15,
Chat = 0x16,
HsToDuelist = 0x20,
HsToObserver = 0x21,
HsReady = 0x22,
HsNotReady = 0x23,
HsKick = 0x24,
HsStart = 0x25
}
public enum PlayerChange
{
Observe = 0x8,
Ready = 0x9,
NotReady = 0xA,
Leave = 0xB
}
\ No newline at end of file
fileFormatVersion: 2
guid: ea6ed957719c1004a8fe5cb92cdce947
timeCreated: 1480605666
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//using System;
//using System.IO;
//using UnityEngine;
//public struct point
//{
// public bool me;
// public game_location location;
// public int index;
// public game_position position;
// public int overlay_index;
// public point(bool m, game_location l, int i, game_position p = game_position.POS_FACEDOWN_ATTACK, int o = 0)
// {
// me = m;
// location = l;
// index = i;
// position = p;
// overlay_index = o;
// }
//}
//public struct CardData
//{
// public Int64 code;
// public Int32 Ot;
// public Int64 Alias;
// public Int64 SetCode;
// public Int64 Type;
// public Int32 Attack;
// public Int32 Defense;
// public Int64 Level;
// public Int64 Race;
// public Int32 Attribute;
// public Int64 Category;
// public string Name;
// public string Desc;
// public string tail;
// public string[] Str;
// public long LeftScale;
// public long RightScale;
// public CardData(int a = 0)
// {
// code = 0;
// Ot = 0;
// Alias = 0;
// SetCode = 0;
// Type = 0;
// Attack = 0;
// Defense = 0;
// Level = 0;
// Race = 0;
// Attribute = 0;
// Category = 0;
// Name = "";
// Desc = "";
// Str = new string[0];
// LeftScale = 0;
// RightScale = 0;
// tail = "";
// }
//}
fileFormatVersion: 2
guid: 34feabd62902b19489d8e3e2fe27d886
timeCreated: 1469113965
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -10,30 +10,30 @@
// public static string get_attribute_string(long a)
// {
// string r = "";
// if (differ(a, (long)game_attributes.ATTRIBUTE_EARTH)) r += "地";
// if (differ(a, (long)game_attributes.ATTRIBUTE_WATER)) r += "水";
// if (differ(a, (long)game_attributes.ATTRIBUTE_FIRE)) r += "炎";
// if (differ(a, (long)game_attributes.ATTRIBUTE_WIND)) r += "风";
// if (differ(a, (long)game_attributes.ATTRIBUTE_DARK)) r += "暗";
// if (differ(a, (long)game_attributes.ATTRIBUTE_LIGHT)) r += "光";
// if (differ(a, (long)game_attributes.ATTRIBUTE_DEVINE)) r += "神";
// if (differ(a, (long)CardAttribute.Earth)) r += "地";
// if (differ(a, (long)CardAttribute.Water)) r += "水";
// if (differ(a, (long)CardAttribute.Fire)) r += "炎";
// if (differ(a, (long)CardAttribute.Wind)) r += "风";
// if (differ(a, (long)CardAttribute.Dark)) r += "暗";
// if (differ(a, (long)CardAttribute.Light)) r += "光";
// if (differ(a, (long)CardAttribute.Devine)) r += "神";
// r += "属性";
// return r;
// }
// public static string get_type_string(int a)
// {
// string r = "";
// if (differ(a, (long)game_type.TYPE_MONSTER)) r += "怪物卡";
// if (differ(a, (long)game_type.TYPE_SPELL)) r += "魔法卡";
// if (differ(a, (long)game_type.TYPE_TRAP)) r += "陷阱卡";
// if (differ(a, (long)CardType.Monster)) r += "怪物卡";
// if (differ(a, (long)CardType.Spell)) r += "魔法卡";
// if (differ(a, (long)CardType.Trap)) r += "陷阱卡";
// return r;
// }
// public static string get_detailed_type_string(int a)
// {
// string r = "";
// if (differ(a, (long)game_type.TYPE_MONSTER)) r += "怪物卡";
// if (differ(a, (long)game_type.TYPE_SPELL)) r += "魔法卡";
// if (differ(a, (long)game_type.TYPE_TRAP)) r += "陷阱卡";
// if (differ(a, (long)CardType.Monster)) r += "怪物卡";
// if (differ(a, (long)CardType.Spell)) r += "魔法卡";
// if (differ(a, (long)CardType.Trap)) r += "陷阱卡";
// return r;
// }
// public static string get_race_string(long a)
......@@ -79,25 +79,25 @@
// }
// switch (p.location)
// {
// case game_location.LOCATION_DECK:
// case CardLocation.Deck:
// re += "卡组中的";
// break;
// case game_location.LOCATION_EXTRA:
// case CardLocation.Extra:
// re += "额外卡组中的";
// break;
// case game_location.LOCATION_GRAVE:
// case CardLocation.Grave:
// re += "墓地中的";
// break;
// case game_location.LOCATION_HAND:
// case CardLocation.Hand:
// re += "手上的";
// break;
// case game_location.LOCATION_MZONE:
// case CardLocation.MonsterZone:
// re += "前场的";
// break;
// case game_location.LOCATION_REMOVED:
// case CardLocation.Hand:
// re += "被除外的";
// break;
// case game_location.LOCATION_SZONE:
// case CardLocation.SpellZone:
// re += "后场的";
// break;
// }
......@@ -108,28 +108,28 @@
// }
// switch (p.position)
// {
// case game_position.POS_FACEDOWN_ATTACK:
// case CardPosition.FaceDownAttack:
// re += "(里攻)";
// break;
// case game_position.POS_FACEDOWN_DEFENSE:
// case CardPosition.FaceDown_DEFENSE:
// re += "(里守)";
// break;
// case game_position.POS_FACEUP_ATTACK:
// case CardPosition.FaceUpAttack:
// re += "(表攻)";
// break;
// case game_position.POS_FACEUP_DEFENSE:
// case CardPosition.FaceUp_DEFENSE:
// re += "(表守)";
// break;
// }
// if (p.location == game_location.LOCATION_UNKNOWN) re = "(未知区域)";
// if (p.location == CardLocation.Unknown) re = "(未知区域)";
// return re;
// }
// public static string get_name_string(CardData data)
// {
// string re = "";
// if (differ(data.Type, (long)game_type.TYPE_MONSTER)) re += "[ff8000]"+data.Name;
// else if (differ(data.Type, (long)game_type.TYPE_SPELL)) re += "[7FFF00]" + data.Name;
// else if (differ(data.Type, (long)game_type.TYPE_TRAP)) re += "[dda0dd]" + data.Name;
// if (differ(data.Type, (long)CardType.Monster)) re += "[ff8000]"+data.Name;
// else if (differ(data.Type, (long)CardType.Spell)) re += "[7FFF00]" + data.Name;
// else if (differ(data.Type, (long)CardType.Trap)) re += "[dda0dd]" + data.Name;
// else re += "[ff8000]" + data.Name;
// re += "[-]";
// return re;
......
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