예제 #1
0
        //魔法陷阱
        string getSpellTrap(Card c, string img, bool isSpell, CardPack cardpack = null, bool rarity = true)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(TAG_CARD + ":");
            sb.AppendLine(this.GetLine(TAG_CARDTYPE, isSpell ? "spell card" : "trap card"));
            sb.AppendLine(this.GetLine(TAG_NAME, this.ReItalic(c.name)));
            sb.AppendLine(this.GetLine(TAG_ATTRIBUTE, isSpell ? "spell" : "trap"));
            sb.AppendLine(this.GetLine(TAG_LEVEL, this.GetSpellTrapSymbol(c, isSpell)));
            sb.AppendLine(this.GetLine(TAG_IMAGE, img));
            if (cardpack != null)
            {
                sb.AppendLine(this.GetLine(TAG_NUMBER, cardpack.pack_id));
                if (rarity)
                {
                    sb.AppendLine(this.GetLine(TAG_RARITY, cardpack.GetMseRarity()));
                }
            }
            sb.AppendLine("	" + TAG_TEXT + ":");
            sb.AppendLine("		"+ this.ReText(this.ReItalic(c.desc)));
            sb.AppendLine(this.GetLine(TAG_CODE, c.IdString));
            return(sb.ToString());
        }
예제 #2
0
        //怪兽,pendulum怪兽
        string getMonster(Card c, string img, CardPack cardpack = null, bool rarity = true)
        {
            StringBuilder sb = new StringBuilder();

            string[] types = this.GetTypes(c);
            string   race  = this.GetRace(c.race);

            sb.AppendLine(TAG_CARD + ":");
            sb.AppendLine(this.GetLine(TAG_CARDTYPE, types[0]));
            sb.AppendLine(this.GetLine(TAG_NAME, this.ReItalic(c.name)));
            sb.AppendLine(this.GetLine(TAG_ATTRIBUTE, GetAttribute(c.attribute)));
            bool noStar = false;

            if (this.cfg.noStartCards != null)
            {
                foreach (long id in this.cfg.noStartCards)
                {
                    if (c.alias == id || c.id == id)
                    {
                        noStar = true;
                        break;
                    }
                }
            }
            if (!noStar)
            {
                sb.AppendLine(this.GetLine(TAG_LEVEL, GetStar(c.level)));
            }
            sb.AppendLine(this.GetLine(TAG_IMAGE, img));
            sb.AppendLine(this.GetLine(TAG_TYPE1, this.CN2TW(race)));
            sb.AppendLine(this.GetLine(TAG_TYPE2, this.CN2TW(types[1])));
            sb.AppendLine(this.GetLine(TAG_TYPE3, this.CN2TW(types[2])));
            sb.AppendLine(this.GetLine(TAG_TYPE4, this.CN2TW(types[3])));
            sb.AppendLine(this.GetLine(TAG_TYPE5, this.CN2TW(types[4])));
            if (cardpack != null)
            {
                sb.AppendLine(this.GetLine(TAG_NUMBER, cardpack.pack_id));
                if (rarity)
                {
                    sb.AppendLine(this.GetLine(TAG_RARITY, cardpack.GetMseRarity()));
                }
            }
            if (c.IsType(CardType.TYPE_LINK))
            {
                if (CardLink.IsLink(c.def, CardLink.DownLeft))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_DL, "yes"));
                }
                if (CardLink.IsLink(c.def, CardLink.Down))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_Down, "yes"));
                }
                if (CardLink.IsLink(c.def, CardLink.DownRight))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_DR, "yes"));
                }
                if (CardLink.IsLink(c.def, CardLink.UpLeft))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_UL, "yes"));
                }
                if (CardLink.IsLink(c.def, CardLink.Up))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_Up, "yes"));
                }
                if (CardLink.IsLink(c.def, CardLink.UpRight))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_UR, "yes"));
                }
                if (CardLink.IsLink(c.def, CardLink.Left))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_Left, "yes"));
                }
                if (CardLink.IsLink(c.def, CardLink.Right))
                {
                    sb.AppendLine(this.GetLine(TAG_Link_Marker_Right, "yes"));
                }
                sb.AppendLine(this.GetLine(TAG_Link_Number, "" + this.getLinkNumber(c.def)));
                sb.AppendLine("	" + TAG_TEXT + ":");
                sb.AppendLine("		"+ this.ReText(this.ReItalic(c.desc)));
            }
            else
            {
                if (c.IsType(CardType.TYPE_PENDULUM))                //P怪兽
                {
                    string text = GetDesc(c.desc, this.cfg.regx_monster);
                    if (string.IsNullOrEmpty(text))
                    {
                        text = c.desc;
                    }

                    sb.AppendLine("	" + TAG_TEXT + ":");
                    //sb.AppendLine(cfg.regx_monster + ":" + cfg.regx_pendulum);
                    sb.AppendLine("		"+ this.ReText(this.ReItalic(text)));
                    sb.AppendLine(this.GetLine(TAG_PENDULUM, "medium"));
                    sb.AppendLine(this.GetLine(TAG_PSCALE1, ((c.level >> 0x18) & 0xff).ToString()));
                    sb.AppendLine(this.GetLine(TAG_PSCALE2, ((c.level >> 0x10) & 0xff).ToString()));
                    sb.AppendLine("	" + TAG_PEND_TEXT + ":");
                    sb.AppendLine("		"+ this.ReText(this.ReItalic(GetDesc(c.desc, this.cfg.regx_pendulum))));
                }
                else                 //一般怪兽
                {
                    sb.AppendLine("	" + TAG_TEXT + ":");
                    sb.AppendLine("		"+ this.ReText(this.ReItalic(c.desc)));
                }
                sb.AppendLine(this.GetLine(TAG_DEF, (c.def < 0) ? UNKNOWN_ATKDEF : c.def.ToString()));
            }
            sb.AppendLine(this.GetLine(TAG_ATK, (c.atk < 0) ? UNKNOWN_ATKDEF : c.atk.ToString()));

            sb.AppendLine(this.GetLine(TAG_CODE, c.IdString));
            return(sb.ToString());
        }