Commit 12965e0c authored by keyongyu's avatar keyongyu

5 types

parent f285997d
......@@ -73,11 +73,12 @@ public enum CardType : long
public static class CardTypes{
public static readonly CardType[] TYPE1 = {
CardType.TYPE_LINK,
CardType.TYPE_RITUAL,
CardType.TYPE_FUSION,
CardType.TYPE_XYZ,
CardType.TYPE_SYNCHRO,
CardType.TYPE_PENDULUM,
CardType.TYPE_RITUAL,
CardType.TYPE_FUSION,
CardType.TYPE_SPIRIT,
CardType.TYPE_UNION,
CardType.TYPE_DUAL,
......@@ -85,8 +86,10 @@ public static class CardTypes{
CardType.TYPE_TOON,
};
public static readonly CardType[] TYPE2 = {
CardType.TYPE_PENDULUM,
CardType.TYPE_XYZ,
CardType.TYPE_SYNCHRO,
CardType.TYPE_PENDULUM,
CardType.TYPE_SPIRIT,
CardType.TYPE_UNION,
CardType.TYPE_DUAL,
......@@ -94,17 +97,27 @@ public static class CardTypes{
CardType.TYPE_TOON
};
public static readonly CardType[] TYPE3 ={
CardType.TYPE_SYNCHRO,
CardType.TYPE_PENDULUM,
CardType.TYPE_SPIRIT,
CardType.TYPE_UNION,
CardType.TYPE_DUAL,
CardType.TYPE_FLIP,
CardType.TYPE_TOON,
};
public static readonly CardType[] TYPE4 ={
CardType.TYPE_TUNER,
CardType.TYPE_EFFECT
};
public static CardType[] GetMonsterTypes(long type){
var list = new List<CardType>(4);
var typeList=new List<CardType[]>(4);
var list = new List<CardType>(5);
var typeList=new List<CardType[]>(5);
typeList.Add(TYPE1);
typeList.Add(TYPE2);
typeList.Add(TYPE3);
typeList.Add(TYPE3);
typeList.Add(TYPE3);
typeList.Add(TYPE4);
typeList.Add(TYPE4);
int count = typeList.Count;
for(int i=0;i<count;i++){
CardType[] types = typeList[i];
......
......@@ -277,20 +277,22 @@ public string GetType(CardType ctype)
public string[] GetTypes(Card c)
{
//卡片类型,效果1,效果2,效果3
string[] types = {MseCardType.CARD_NORMAL, "", "", "", "",""};
int MAX_TYPE= 5;
var types = new string[MAX_TYPE+1];
types[0] = MseCardType.CARD_NORMAL;
for(int i=1;i<types.Length;i++){
types[i]="";
}
if (c.IsType(CardType.TYPE_MONSTER))
{
CardType[] cardTypes = CardTypes.GetMonsterTypes(c.type);
int count = cardTypes.Length;
for(int i=0; i<count && i<4; i++){
for(int i=0; i<count && i<MAX_TYPE; i++){
types[i+1] = GetType(cardTypes[i]);
}
if(cardTypes.Length>0){
if(c.IsType(CardType.TYPE_LINK)){
types[0] = MseCardType.CARD_LINK;
}else if (c.IsType(CardType.TYPE_XYZ))
{
types[0] = MseCardType.CARD_XYZ;
}
else if (c.IsType(CardType.TYPE_TOKEN))
{
......@@ -310,6 +312,10 @@ public string[] GetTypes(Card c)
{
types[0] = MseCardType.CARD_SYNCHRO;
}
else if (c.IsType(CardType.TYPE_XYZ))
{
types[0] = MseCardType.CARD_XYZ;
}
else if (c.IsType(CardType.TYPE_EFFECT))
{
types[0] = MseCardType.CARD_EFFECT;
......
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