Commit 8b9ec0a2 authored by nanahira's avatar nanahira

merge

parents e72f147e d62de4db
......@@ -6,6 +6,7 @@
*
*/
using System;
using System.Collections.Generic;
namespace DataEditorX.Core.Info
{
......@@ -14,56 +15,178 @@ namespace DataEditorX.Core.Info
/// </summary>
public enum CardType : long
{
///<summary>怪兽卡</summary>
///<summary>怪兽卡</summary>
TYPE_MONSTER =0x1 ,
///<summary>魔法卡</summary>
///<summary>魔法卡</summary>
TYPE_SPELL =0x2 ,
///<summary>陷阱卡</summary>
///<summary>陷阱卡</summary>
TYPE_TRAP =0x4 ,
///<summary>通常</summary>
///<summary>通常</summary>
TYPE_NORMAL =0x10 ,
///<summary>效果</summary>
///<summary>效果</summary>
TYPE_EFFECT =0x20 ,
///<summary>融合</summary>
///<summary>融合</summary>
TYPE_FUSION =0x40 ,
///<summary>仪式</summary>
///<summary>仪式</summary>
TYPE_RITUAL =0x80 ,
///<summary>陷阱怪兽</summary>
///<summary>陷阱怪兽</summary>
TYPE_TRAPMONSTER =0x100 ,
///<summary>灵魂</summary>
///<summary>灵魂</summary>
TYPE_SPIRIT =0x200 ,
///<summary>同盟</summary>
///<summary>同盟</summary>
TYPE_UNION =0x400 ,
///<summary>二重</summary>
///<summary>二重</summary>
TYPE_DUAL =0x800 ,
///<summary>调整</summary>
///<summary>调整</summary>
TYPE_TUNER =0x1000 ,
///<summary>同调</summary>
///<summary>同调</summary>
TYPE_SYNCHRO =0x2000 ,
///<summary>衍生物</summary>
///<summary>衍生物</summary>
TYPE_TOKEN =0x4000 ,
///<summary>速攻</summary>
///<summary>速攻</summary>
TYPE_QUICKPLAY =0x10000 ,
///<summary>永续</summary>
///<summary>永续</summary>
TYPE_CONTINUOUS =0x20000 ,
///<summary>装备</summary>
///<summary>装备</summary>
TYPE_EQUIP =0x40000 ,
///<summary>场地</summary>
///<summary>场地</summary>
TYPE_FIELD =0x80000 ,
///<summary>反击</summary>
///<summary>反击</summary>
TYPE_COUNTER =0x100000 ,
///<summary>反转</summary>
///<summary>反转</summary>
TYPE_FLIP =0x200000 ,
///<summary>卡通</summary>
///<summary>卡通</summary>
TYPE_TOON =0x400000 ,
///<summary>超量</summary>
///<summary>超量</summary>
TYPE_XYZ =0x800000 ,
///<summary>灵摆</summary>
///<summary>灵摆</summary>
TYPE_PENDULUM =0x1000000 ,
///<summary>特殊召唤</summary>
///<summary>特殊召唤</summary>
TYPE_SPSUMMON =0x2000000 ,
///<summary>连接</summary>
///<summary>连接</summary>
TYPE_LINK =0x4000000 ,
}
}
public static class CardTypes{
public static readonly CardType[] TYPE1 = {
CardType.TYPE_TOKEN,
CardType.TYPE_LINK,
CardType.TYPE_RITUAL,
CardType.TYPE_FUSION,
CardType.TYPE_XYZ,
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[] TYPE1_10 = {
CardType.TYPE_TOKEN,
CardType.TYPE_LINK,
CardType.TYPE_RITUAL,
CardType.TYPE_FUSION,
CardType.TYPE_XYZ,
CardType.TYPE_SYNCHRO,
CardType.TYPE_PENDULUM,
CardType.TYPE_SPIRIT,
CardType.TYPE_UNION,
CardType.TYPE_DUAL,
CardType.TYPE_FLIP,
CardType.TYPE_TOON,
CardType.TYPE_SPSUMMON,
};
public static readonly CardType[] TYPE2 = {
CardType.TYPE_XYZ,
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[] TYPE2_10 = {
CardType.TYPE_XYZ,
CardType.TYPE_SYNCHRO,
CardType.TYPE_PENDULUM,
CardType.TYPE_SPIRIT,
CardType.TYPE_UNION,
CardType.TYPE_DUAL,
CardType.TYPE_FLIP,
CardType.TYPE_TOON,
CardType.TYPE_SPSUMMON,
};
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[] TYPE3_10 ={
CardType.TYPE_SYNCHRO,
CardType.TYPE_PENDULUM,
CardType.TYPE_SPIRIT,
CardType.TYPE_UNION,
CardType.TYPE_DUAL,
CardType.TYPE_FLIP,
CardType.TYPE_TOON,
CardType.TYPE_SPSUMMON,
};
public static readonly CardType[] TYPE4 ={
CardType.TYPE_TUNER,
CardType.TYPE_EFFECT,
// CardType.TYPE_NORMAL,
};
public static readonly CardType[] TYPE4_10 ={
CardType.TYPE_TUNER,
CardType.TYPE_EFFECT,
CardType.TYPE_NORMAL,
};
public static CardType[] GetMonsterTypes(long type,bool no10=false){
var list = new List<CardType>(5);
var typeList=new List<CardType[]>(5);
if(no10){
typeList.Add(TYPE1_10);
typeList.Add(TYPE2_10);
typeList.Add(TYPE3_10);
typeList.Add(TYPE4_10);
typeList.Add(TYPE4_10);
}else{
typeList.Add(TYPE1);
typeList.Add(TYPE2);
typeList.Add(TYPE3);
typeList.Add(TYPE4);
typeList.Add(TYPE4);
}
int count = typeList.Count;
for(int i=0;i<count;i++){
CardType[] types = typeList[i];
foreach(var t in types){
if((type & (long)t)==(long)t){
if(!list.Contains(t)){
list.Add(t);
break;
}
}
}
}
return list.ToArray();
}
}
}
......@@ -49,6 +49,10 @@ public class MSEConfig
public const string TAG_IMAGE = "imagepath";
public const string TAG_REPALCE = "replace";
public const string TAG_TEXT = "text";
public const string TAG_NO_TEN = "no10";
public const string TAG_NO_START_CARDS="no_star_cards";
public const string TAG_REP = "%%";
public const string SEP_LINE = " ";
......@@ -109,6 +113,19 @@ public void SetConfig(string config, string path)
else if (line.StartsWith(TAG_PEND_HEIGHT)){
pheight=ConfHelper.getIntegerValue(line,0);
}
else if(line.StartsWith(TAG_NO_TEN)){
no10 = ConfHelper.getBooleanValue(line);
}else if(line.StartsWith(TAG_NO_START_CARDS)){
string val = ConfHelper.getValue(line);
string[] cs = val.Split(',');
noStartCards=new long[cs.Length];
int i=0;
foreach(string str in cs){
long l = 0;
long.TryParse(str, out l);
noStartCards[i++] = l;
}
}
else if (line.StartsWith(TAG_IMAGE))
{
//如果路径不合法,则为后面的路径
......@@ -169,6 +186,10 @@ public void init(string path)
public int pwidth;
public int pheight;
//没星星的卡
public long[] noStartCards;
//第10期
public bool no10;
//每个存档最大数
public int maxcount;
//图片路径
......
......@@ -277,105 +277,63 @@ public string GetType(CardType ctype)
public string[] GetTypes(Card c)
{
//卡片类型,效果1,效果2,效果3
string[] types = new string[] {
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))
{//卡片类型和第1效果
if(c.IsType(CardType.TYPE_LINK)){
types[0] = MseCardType.CARD_LINK;
}else if (c.IsType(CardType.TYPE_XYZ))
{
types[0] = MseCardType.CARD_XYZ;
types[1] = GetType(CardType.TYPE_XYZ);
}
else if (c.IsType(CardType.TYPE_TOKEN))
{
types[0] = (c.race == 0) ?
MseCardType.CARD_TOKEN2
: MseCardType.CARD_TOKEN;
types[1] = GetType(CardType.TYPE_TOKEN);
}
else if (c.IsType(CardType.TYPE_RITUAL))
{
types[0] = MseCardType.CARD_RITUAL;
types[1] = GetType(CardType.TYPE_RITUAL);
}
else if (c.IsType(CardType.TYPE_FUSION))
{
types[0] = MseCardType.CARD_FUSION;
types[1] = GetType(CardType.TYPE_FUSION);
}
else if (c.IsType(CardType.TYPE_SYNCHRO))
{
types[0] = MseCardType.CARD_SYNCHRO;
types[1] = GetType(CardType.TYPE_SYNCHRO);
}
else if (c.IsType(CardType.TYPE_EFFECT))
{
types[0] = MseCardType.CARD_EFFECT;
}
else
types[0] = MseCardType.CARD_NORMAL;
//同调
if (types[0] == MseCardType.CARD_SYNCHRO
|| types[0] == MseCardType.CARD_TOKEN)
{
if (c.IsType(CardType.TYPE_TUNER)
&& c.IsType(CardType.TYPE_EFFECT))
{//调整效果
types[2] = GetType(CardType.TYPE_TUNER);
types[3] = GetType(CardType.TYPE_EFFECT);
{
CardType[] cardTypes = CardTypes.GetMonsterTypes(c.type, cfg.no10);
int count = cardTypes.Length;
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_TUNER))
else if (c.IsType(CardType.TYPE_TOKEN))
{
types[2] = GetType(CardType.TYPE_TUNER);
types[0] = (c.race == 0) ?
MseCardType.CARD_TOKEN2
: MseCardType.CARD_TOKEN;
}
else if (c.IsType(CardType.TYPE_EFFECT))
else if (c.IsType(CardType.TYPE_RITUAL))
{
types[2] = GetType(CardType.TYPE_EFFECT);
types[0] = MseCardType.CARD_RITUAL;
}
}
else if (types[0] == MseCardType.CARD_NORMAL)
{
if (c.IsType(CardType.TYPE_PENDULUM))//灵摆
types[1] = GetType(CardType.TYPE_PENDULUM);
else if (c.IsType(CardType.TYPE_TUNER))//调整
types[1] = GetType(CardType.TYPE_TUNER);
}
else if (types[0] != MseCardType.CARD_EFFECT)
{//效果
if (c.IsType(CardType.TYPE_EFFECT))
types[2] = GetType(CardType.TYPE_EFFECT);
}
else
{//效果怪兽
types[2] = GetType(CardType.TYPE_EFFECT);
if (c.IsType(CardType.TYPE_PENDULUM))
types[1] = GetType(CardType.TYPE_PENDULUM);
else if (c.IsType(CardType.TYPE_TUNER))
types[1] = GetType(CardType.TYPE_TUNER);
else if (c.IsType(CardType.TYPE_SPIRIT))
types[1] = GetType(CardType.TYPE_SPIRIT);
else if (c.IsType(CardType.TYPE_TOON))
types[1] = GetType(CardType.TYPE_TOON);
else if (c.IsType(CardType.TYPE_UNION))
types[1] = GetType(CardType.TYPE_UNION);
else if (c.IsType(CardType.TYPE_DUAL))
types[1] = GetType(CardType.TYPE_DUAL);
else if (c.IsType(CardType.TYPE_FLIP))
types[1] = GetType(CardType.TYPE_FLIP);
else
else if (c.IsType(CardType.TYPE_FUSION))
{
types[0] = MseCardType.CARD_FUSION;
}
else if (c.IsType(CardType.TYPE_SYNCHRO))
{
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[1] = GetType(CardType.TYPE_EFFECT);
types[2] = "";
types[0] = MseCardType.CARD_EFFECT;
}
else{
types[0] = MseCardType.CARD_NORMAL;
if(cardTypes.Length==1){
//xxx/通常
}
}
}
}
if (c.race == 0)//如果没有种族
{
types[1] = "";
types[2] = "";
types[3] = "";
types[4] = "";
}
return types;
}
......@@ -434,7 +392,18 @@ string getMonster(Card c, string img,CardPack cardpack=null,bool rarity=true)
sb.AppendLine(GetLine(TAG_CARDTYPE, types[0]));
sb.AppendLine(GetLine(TAG_NAME, reItalic(c.name)));
sb.AppendLine(GetLine(TAG_ATTRIBUTE, GetAttribute(c.attribute)));
sb.AppendLine(GetLine(TAG_LEVEL, GetStar(c.level)));
bool noStar = false;
if(cfg.noStartCards != null){
foreach(long id in cfg.noStartCards){
if(c.alias == id || c.id == id){
noStar = true;
break;
}
}
}
if(!noStar){
sb.AppendLine(GetLine(TAG_LEVEL, GetStar(c.level)));
}
sb.AppendLine(GetLine(TAG_IMAGE, img));
sb.AppendLine(GetLine(TAG_TYPE1, cn2tw(race)));
sb.AppendLine(GetLine(TAG_TYPE2, cn2tw(types[1])));
......
......@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.4.3.1")]
[assembly: AssemblyVersion("2.4.3.6")]
★更新历史
2.4.3.6
UI位置调整
2.4.3.5
图片显示
2.4.3.4
修复导出衍生物bug
2.4.3.3
data/mse 类型翻译
2.4.3.2
卡片种族/分类算法,如果有问题记得反馈
MSE导出,支持不显示星星的卡
2.4.3.1
pack.db更新
2.4.3.0
......
......@@ -36,7 +36,9 @@ monster-text = [果|介|述|報]】\n([\S\s]*)
replace = ([鮟|鱇]) <i>$1</i>
#replace = [:space:] <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
###########################
########################### no.10's card
no10 = true
no_star_cards = 1686814,52653092,65305468
##race
race 0x1 战士族
race 0x2 魔法师族
......
......@@ -36,7 +36,9 @@ monster-text = [果|介|述|報]】\n([\S\s]*)
replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
###########################
########################### no.10's card
no10 = false
no_star_cards = 1686814,52653092,65305468
##race
race 0x1 戰士族
race 0x2 魔法師族
......
......@@ -27,7 +27,9 @@ monster-text = (?:Monster Effect|Flavor Text) \]\s*\n([\S\s]*)
########################### Replace
#replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
###########################
########################### no.10's card
no10 = false
no_star_cards = 1686814,52653092,65305468
##race
race 0x1 Warrior
race 0x2 Spellcaster
......@@ -81,5 +83,6 @@ type 0x200000 Flip
type 0x400000 Toon
type 0x800000 Xyz
type 0x1000000 Pendulum
type 0x2000000 Special Summon
type 0x4000000 Link
##########################
\ No newline at end of file
......@@ -36,7 +36,9 @@ replace = ([·]) ・
#replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
###########################
########################### no.10's card
no10 = false
no_star_cards = 1686814,52653092,65305468
##race
race 0x1 戦士族
race 0x2 魔法使い族
......
★更新历史
2.4.3.6
UI位置调整
2.4.3.5
图片显示
2.4.3.4
修复导出衍生物bug
2.4.3.3
data/mse 类型翻译
2.4.3.2
卡片种族/分类算法,如果有问题记得反馈
MSE导出,支持不显示星星的卡
2.4.3.1
pack.db更新
2.4.3.0
......
[DataEditorX]2.4.3.1[DataEditorX]
[DataEditorX]2.4.3.6[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment)
......
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