Ejemplo n.º 1
0
    public static string zone(long data)
    {
        List <string> strs = new List <string>();

        for (long filter = 0x1L; filter <= (0x1L << 32); filter <<= 1)
        {
            string str = "";
            long   s   = filter & data;
            if (s != 0)
            {
                if ((s & 0x60) != 0)
                {
                    str  += GameStringManager.get_unsafe(1081);
                    data &= ~0x600000;
                }
                else if ((s & 0xffff) != 0)
                {
                    str += GameStringManager.get_unsafe(102);
                }
                else if ((s & 0xffff0000) != 0)
                {
                    str += GameStringManager.get_unsafe(103);
                    s  >>= 16;
                }
                if ((s & 0x1f) != 0)
                {
                    str += GameStringManager.get_unsafe(1002);
                }
                else if ((s & 0xff00) != 0)
                {
                    s >>= 8;
                    if ((s & 0x1f) != 0)
                    {
                        str += GameStringManager.get_unsafe(1003);
                    }
                    else if ((s & 0x20) != 0)
                    {
                        str += GameStringManager.get_unsafe(1008);
                    }
                    else if ((s & 0xc0) != 0)
                    {
                        str += GameStringManager.get_unsafe(1009);
                    }
                }
                int seq = 1;
                for (int i = 0x1; i < 0x100; i <<= 1)
                {
                    if ((s & i) != 0)
                    {
                        break;
                    }
                    ++seq;
                }
                str += "(" + seq.ToString() + ")";
                strs.Add(str);
            }
        }
        return(String.Join(", ", strs.ToArray()));
    }
Ejemplo n.º 2
0
    public void StocMessage_ErrorMsg(BinaryReader r)
    {
        int msg  = r.ReadByte();
        int code = 0;

        switch (msg)
        {
        case 1:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            switch (code)
            {
            case 0:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1403), null);
                break;

            case 1:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1404), null);
                break;

            case 2:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1405), null);
                break;
            }
            break;

        case 2:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            switch (code)
            {
            case 1:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1406), null);
                break;

            default:
                RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name), null);
                break;
            }
            break;

        case 3:
            RMSshow_onlyYes("", InterString.Get("更换副卡组失败,请检查卡片张数是否一致。"), null);
            break;

        case 4:
            RMSshow_none(InterString.Get("你输入的版本号和服务器不一致。"));
            break;

        default:
            break;
        }
    }
Ejemplo n.º 3
0
    public static string mainType(long a)
    {
        string r         = "";
        bool   passFirst = false;

        for (int i = 0; i < 3; i++)
        {
            if ((a & (1 << i)) > 0)
            {
                if (passFirst)
                {
                    r += fen;
                }
                r        += GameStringManager.get_unsafe(1050 + i);
                passFirst = true;
            }
        }
        return(r);
    }
Ejemplo n.º 4
0
    public static string LinkMarker(YGOSharp.Card data)
    {
        string LinkMarker = "\n" + GameStringManager.get_unsafe(1374) + ":";

        if (data.HasLinkMarker(CardLinkMarker.TopLeft))
        {
            LinkMarker += " [\u2196]";  //↖
        }
        if (data.HasLinkMarker(CardLinkMarker.Top))
        {
            LinkMarker += " [\u2191]";  //↑
        }
        if (data.HasLinkMarker(CardLinkMarker.TopRight))
        {
            LinkMarker += " [\u2197]";  //↗
        }
        if (data.HasLinkMarker(CardLinkMarker.Left))
        {
            LinkMarker += " [\u2190]";  //←
        }
        if (data.HasLinkMarker(CardLinkMarker.Right))
        {
            LinkMarker += " [\u2192]";  //→
        }
        if (data.HasLinkMarker(CardLinkMarker.BottomLeft))
        {
            LinkMarker += " [\u2199]";  //↙
        }
        if (data.HasLinkMarker(CardLinkMarker.Bottom))
        {
            LinkMarker += " [\u2193]";  //↓
        }
        if (data.HasLinkMarker(CardLinkMarker.BottomRight))
        {
            LinkMarker += " [\u2198]";  //↘
        }
        return(LinkMarker);
    }
Ejemplo n.º 5
0
    public static string secondType(long a)
    {
        string r         = "";
        bool   passFirst = false;

        for (int i = 4; i < 27; i++)
        {
            if ((a & (1 << i)) > 0)
            {
                if (passFirst)
                {
                    r += fen;
                }
                r        += GameStringManager.get_unsafe(1050 + i);
                passFirst = true;
            }
        }
        if (r == "")
        {
            r += GameStringManager.get_unsafe(1054);
        }
        return(r);
    }
Ejemplo n.º 6
0
    public void StocMessage_ErrorMsg(BinaryReader r)
    {
        int msg  = r.ReadByte();
        int code = 0;

        switch (msg)
        {
        case 1:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            switch (code)
            {
            case 0:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1403), null);
                break;

            case 1:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1404), null);
                break;

            case 2:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1405), null);
                break;
            }
            break;

        case 2:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            int flag = code >> 28;
            code = code & 0xFFFFFFF;
            switch (flag)
            {
            case 1:         // DECKERROR_LFLIST
                RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name) + "\r\n" + InterString.Get("(数量不符合禁限卡表)"), null);
                break;

            case 2:         // DECKERROR_OCGONLY
                RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name) + "\r\n" + InterString.Get("(OCG独有卡,不能在当前设置使用)"), null);
                break;

            case 3:         // DECKERROR_TCGONLY
                RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name) + "\r\n" + InterString.Get("(TCG独有卡,不能在当前设置使用)"), null);
                break;

            case 4:         // DECKERROR_UNKNOWNCARD
                if (code < 100000000)
                {
                    RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name) + "\r\n" + InterString.Get("(服务器无法识别此卡,可能是服务器未更新)"), null);
                }
                else
                {
                    RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name) + "\r\n" + InterString.Get("(服务器无法识别此卡,可能是服务器不支持先行卡或此先行卡已正式更新)"), null);
                }
                break;

            case 5:         // DECKERROR_CARDCOUNT
                RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name) + "\r\n" + InterString.Get("(数量过多)"), null);
                break;

            case 6:         // DECKERROR_MAINCOUNT
                RMSshow_onlyYes("", InterString.Get("主卡组数量应为40-60张"), null);
                break;

            case 7:         // DECKERROR_EXTRACOUNT
                RMSshow_onlyYes("", InterString.Get("额外卡组数量应为0-15张"), null);
                break;

            case 8:         // DECKERROR_SIDECOUNT
                RMSshow_onlyYes("", InterString.Get("副卡组数量应为0-15"), null);
                break;

            default:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1406), null);
                break;
            }
            break;

        case 3:
            RMSshow_onlyYes("", InterString.Get("更换副卡组失败,请检查卡片张数是否一致。"), null);
            break;

        case 4:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            //string hexOutput = "0x"+String.Format("{0:X}", code);
            //Program.I().selectServer.set_version(hexOutput);
            //RMSshow_none(InterString.Get("你输入的版本号和服务器不一致,[7CFC00]YGOPro2已经智能切换版本号[-],请重新连接。"));
            break;

        default:
            break;
        }
    }
Ejemplo n.º 7
0
    public void StocMessage_ErrorMsg(BinaryReader r)
    {
        int msg  = r.ReadByte();
        int code = 0;

        switch (msg)
        {
        case 1:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            switch (code)
            {
            case 0:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1403), null);
                break;

            case 1:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1404), null);
                break;

            case 2:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1405), null);
                break;
            }
            break;

        case 2:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            switch (code)
            {
            case 1:
                RMSshow_onlyYes("", GameStringManager.get_unsafe(1406), null);
                break;

            default:
                RMSshow_onlyYes("", InterString.Get("卡组非法,请检查:[?]", YGOSharp.CardsManager.Get(code).Name), null);
                break;
            }
            break;

        case 3:
            RMSshow_onlyYes("", InterString.Get("更换副卡组失败,请检查卡片张数是否一致。"), null);
            break;

        case 4:
            r.ReadByte();
            r.ReadByte();
            r.ReadByte();
            code = r.ReadInt32();
            string hexOutput = "0x" + String.Format("{0:X}", code);
            Program.I().selectServer.set_version(hexOutput);
            RMSshow_none(InterString.Get("你输入的版本号和服务器不一致,[7CFC00]YGOPro2已经智能切换版本号[-],请重新链接。"));
            break;

        default:
            break;
        }
    }
Ejemplo n.º 8
0
    public static string getName(YGOSharp.Card card)
    {
        string limitot = "";

        switch (card.Ot)
        {
        case 1:
            limitot = GameStringManager.get_unsafe(1240);
            break;

        case 2:
            limitot = GameStringManager.get_unsafe(1241);
            break;

        case 3:
            limitot = GameStringManager.get_unsafe(1242);
            break;

        case 4:
            limitot = GameStringManager.get_unsafe(1243);
            break;
        }
        string re = "";

        try
        {
            re += "[b]" + card.Name + "[/b]";
            re += "\n";
            re += "[sup][" + limitot + "] [/sup]";
            re += "\n";
            re += "[sup]" + card.Id.ToString() + "[/sup]";
            re += "\n";
        }
        catch (Exception e)
        {
        }

        if (differ(card.Attribute, (int)CardAttribute.Earth))
        {
            re = "[F4A460]" + re + "[-]";
        }
        if (differ(card.Attribute, (int)CardAttribute.Water))
        {
            re = "[D1EEEE]" + re + "[-]";
        }
        if (differ(card.Attribute, (int)CardAttribute.Fire))
        {
            re = "[F08080]" + re + "[-]";
        }
        if (differ(card.Attribute, (int)CardAttribute.Wind))
        {
            re = "[B3EE3A]" + re + "[-]";
        }
        if (differ(card.Attribute, (int)CardAttribute.Light))
        {
            re = "[EEEE00]" + re + "[-]";
        }
        if (differ(card.Attribute, (int)CardAttribute.Dark))
        {
            re = "[FF00FF]" + re + "[-]";
        }

        return(re);
    }