Commit 8b9ec0a2 authored by nanahira's avatar nanahira

merge

parents e72f147e d62de4db
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* *
*/ */
using System; using System;
using System.Collections.Generic;
namespace DataEditorX.Core.Info namespace DataEditorX.Core.Info
{ {
...@@ -20,6 +21,7 @@ public enum CardType : long ...@@ -20,6 +21,7 @@ public enum CardType : long
TYPE_SPELL =0x2 , TYPE_SPELL =0x2 ,
///<summary>陷阱卡</summary> ///<summary>陷阱卡</summary>
TYPE_TRAP =0x4 , TYPE_TRAP =0x4 ,
///<summary>通常</summary> ///<summary>通常</summary>
TYPE_NORMAL =0x10 , TYPE_NORMAL =0x10 ,
///<summary>效果</summary> ///<summary>效果</summary>
...@@ -42,6 +44,7 @@ public enum CardType : long ...@@ -42,6 +44,7 @@ public enum CardType : long
TYPE_SYNCHRO =0x2000 , TYPE_SYNCHRO =0x2000 ,
///<summary>衍生物</summary> ///<summary>衍生物</summary>
TYPE_TOKEN =0x4000 , TYPE_TOKEN =0x4000 ,
///<summary>速攻</summary> ///<summary>速攻</summary>
TYPE_QUICKPLAY =0x10000 , TYPE_QUICKPLAY =0x10000 ,
///<summary>永续</summary> ///<summary>永续</summary>
...@@ -52,6 +55,7 @@ public enum CardType : long ...@@ -52,6 +55,7 @@ public enum CardType : long
TYPE_FIELD =0x80000 , TYPE_FIELD =0x80000 ,
///<summary>反击</summary> ///<summary>反击</summary>
TYPE_COUNTER =0x100000 , TYPE_COUNTER =0x100000 ,
///<summary>反转</summary> ///<summary>反转</summary>
TYPE_FLIP =0x200000 , TYPE_FLIP =0x200000 ,
///<summary>卡通</summary> ///<summary>卡通</summary>
...@@ -66,4 +70,123 @@ public enum CardType : long ...@@ -66,4 +70,123 @@ public enum CardType : long
TYPE_LINK =0x4000000 , 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();
}
}
} }
...@@ -50,6 +50,10 @@ public class MSEConfig ...@@ -50,6 +50,10 @@ public class MSEConfig
public const string TAG_REPALCE = "replace"; public const string TAG_REPALCE = "replace";
public const string TAG_TEXT = "text"; 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 TAG_REP = "%%";
public const string SEP_LINE = " "; public const string SEP_LINE = " ";
//默认的配置 //默认的配置
...@@ -109,6 +113,19 @@ public void SetConfig(string config, string path) ...@@ -109,6 +113,19 @@ public void SetConfig(string config, string path)
else if (line.StartsWith(TAG_PEND_HEIGHT)){ else if (line.StartsWith(TAG_PEND_HEIGHT)){
pheight=ConfHelper.getIntegerValue(line,0); 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)) else if (line.StartsWith(TAG_IMAGE))
{ {
//如果路径不合法,则为后面的路径 //如果路径不合法,则为后面的路径
...@@ -169,6 +186,10 @@ public void init(string path) ...@@ -169,6 +186,10 @@ public void init(string path)
public int pwidth; public int pwidth;
public int pheight; public int pheight;
//没星星的卡
public long[] noStartCards;
//第10期
public bool no10;
//每个存档最大数 //每个存档最大数
public int maxcount; public int maxcount;
//图片路径 //图片路径
......
...@@ -277,105 +277,63 @@ public string GetType(CardType ctype) ...@@ -277,105 +277,63 @@ public string GetType(CardType ctype)
public string[] GetTypes(Card c) public string[] GetTypes(Card c)
{ {
//卡片类型,效果1,效果2,效果3 //卡片类型,效果1,效果2,效果3
string[] types = new string[] { int MAX_TYPE= 5;
MseCardType.CARD_NORMAL, "", "", "", ""}; 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)) if (c.IsType(CardType.TYPE_MONSTER))
{//卡片类型和第1效果 {
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)){ if(c.IsType(CardType.TYPE_LINK)){
types[0] = MseCardType.CARD_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)) else if (c.IsType(CardType.TYPE_TOKEN))
{ {
types[0] = (c.race == 0) ? types[0] = (c.race == 0) ?
MseCardType.CARD_TOKEN2 MseCardType.CARD_TOKEN2
: MseCardType.CARD_TOKEN; : MseCardType.CARD_TOKEN;
types[1] = GetType(CardType.TYPE_TOKEN);
} }
else if (c.IsType(CardType.TYPE_RITUAL)) else if (c.IsType(CardType.TYPE_RITUAL))
{ {
types[0] = MseCardType.CARD_RITUAL; types[0] = MseCardType.CARD_RITUAL;
types[1] = GetType(CardType.TYPE_RITUAL);
} }
else if (c.IsType(CardType.TYPE_FUSION)) else if (c.IsType(CardType.TYPE_FUSION))
{ {
types[0] = MseCardType.CARD_FUSION; types[0] = MseCardType.CARD_FUSION;
types[1] = GetType(CardType.TYPE_FUSION);
} }
else if (c.IsType(CardType.TYPE_SYNCHRO)) else if (c.IsType(CardType.TYPE_SYNCHRO))
{ {
types[0] = MseCardType.CARD_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);
} }
else if (c.IsType(CardType.TYPE_TUNER)) else if (c.IsType(CardType.TYPE_XYZ))
{ {
types[2] = GetType(CardType.TYPE_TUNER); types[0] = MseCardType.CARD_XYZ;
} }
else if (c.IsType(CardType.TYPE_EFFECT)) else if (c.IsType(CardType.TYPE_EFFECT))
{ {
types[2] = GetType(CardType.TYPE_EFFECT); types[0] = MseCardType.CARD_EFFECT;
}
} }
else if (types[0] == MseCardType.CARD_NORMAL) else{
{ types[0] = MseCardType.CARD_NORMAL;
if (c.IsType(CardType.TYPE_PENDULUM))//灵摆 if(cardTypes.Length==1){
types[1] = GetType(CardType.TYPE_PENDULUM); //xxx/通常
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
{
types[1] = GetType(CardType.TYPE_EFFECT);
types[2] = "";
} }
} }
}
if (c.race == 0)//如果没有种族 if (c.race == 0)//如果没有种族
{ {
types[1] = ""; types[1] = "";
types[2] = ""; types[2] = "";
types[3] = "";
types[4] = "";
} }
return types; return types;
} }
...@@ -434,7 +392,18 @@ string getMonster(Card c, string img,CardPack cardpack=null,bool rarity=true) ...@@ -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_CARDTYPE, types[0]));
sb.AppendLine(GetLine(TAG_NAME, reItalic(c.name))); sb.AppendLine(GetLine(TAG_NAME, reItalic(c.name)));
sb.AppendLine(GetLine(TAG_ATTRIBUTE, GetAttribute(c.attribute))); sb.AppendLine(GetLine(TAG_ATTRIBUTE, GetAttribute(c.attribute)));
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_LEVEL, GetStar(c.level)));
}
sb.AppendLine(GetLine(TAG_IMAGE, img)); sb.AppendLine(GetLine(TAG_IMAGE, img));
sb.AppendLine(GetLine(TAG_TYPE1, cn2tw(race))); sb.AppendLine(GetLine(TAG_TYPE1, cn2tw(race)));
sb.AppendLine(GetLine(TAG_TYPE2, cn2tw(types[1]))); sb.AppendLine(GetLine(TAG_TYPE2, cn2tw(types[1])));
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // 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 2.4.3.1
pack.db更新 pack.db更新
2.4.3.0 2.4.3.0
......
...@@ -36,7 +36,9 @@ monster-text = [果|介|述|報]】\n([\S\s]*) ...@@ -36,7 +36,9 @@ monster-text = [果|介|述|報]】\n([\S\s]*)
replace = ([鮟|鱇]) <i>$1</i> replace = ([鮟|鱇]) <i>$1</i>
#replace = [:space:] <sym-auto>^</sym-auto> #replace = [:space:] <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i> #replace = ([A-Z]) <i>$1</i>
########################### ########################### no.10's card
no10 = true
no_star_cards = 1686814,52653092,65305468
##race ##race
race 0x1 战士族 race 0x1 战士族
race 0x2 魔法师族 race 0x2 魔法师族
......
...@@ -36,7 +36,9 @@ monster-text = [果|介|述|報]】\n([\S\s]*) ...@@ -36,7 +36,9 @@ monster-text = [果|介|述|報]】\n([\S\s]*)
replace = ([鮟|鱇|・|·]) <i>$1</i> replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto> #replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i> #replace = ([A-Z]) <i>$1</i>
########################### ########################### no.10's card
no10 = false
no_star_cards = 1686814,52653092,65305468
##race ##race
race 0x1 戰士族 race 0x1 戰士族
race 0x2 魔法師族 race 0x2 魔法師族
......
...@@ -27,7 +27,9 @@ monster-text = (?:Monster Effect|Flavor Text) \]\s*\n([\S\s]*) ...@@ -27,7 +27,9 @@ monster-text = (?:Monster Effect|Flavor Text) \]\s*\n([\S\s]*)
########################### Replace ########################### Replace
#replace = \s <sym-auto>^</sym-auto> #replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i> #replace = ([A-Z]) <i>$1</i>
########################### ########################### no.10's card
no10 = false
no_star_cards = 1686814,52653092,65305468
##race ##race
race 0x1 Warrior race 0x1 Warrior
race 0x2 Spellcaster race 0x2 Spellcaster
...@@ -81,5 +83,6 @@ type 0x200000 Flip ...@@ -81,5 +83,6 @@ type 0x200000 Flip
type 0x400000 Toon type 0x400000 Toon
type 0x800000 Xyz type 0x800000 Xyz
type 0x1000000 Pendulum type 0x1000000 Pendulum
type 0x2000000 Special Summon
type 0x4000000 Link type 0x4000000 Link
########################## ##########################
\ No newline at end of file
...@@ -36,7 +36,9 @@ replace = ([·]) ・ ...@@ -36,7 +36,9 @@ replace = ([·]) ・
#replace = ([鮟|鱇|・|·]) <i>$1</i> #replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto> #replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i> #replace = ([A-Z]) <i>$1</i>
########################### ########################### no.10's card
no10 = false
no_star_cards = 1686814,52653092,65305468
##race ##race
race 0x1 戦士族 race 0x1 戦士族
race 0x2 魔法使い族 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 2.4.3.1
pack.db更新 pack.db更新
2.4.3.0 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] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment) ★运行环境(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