Commit 5cf7bf28 authored by keyongyu's avatar keyongyu

2.4.1.1

parent 95e53e76
...@@ -228,3 +228,4 @@ pip-log.txt ...@@ -228,3 +228,4 @@ pip-log.txt
#Mr Developer #Mr Developer
.mr.developer.cfg .mr.developer.cfg
/win32/*.cdb
...@@ -246,12 +246,16 @@ public static Area readArea(string key) ...@@ -246,12 +246,16 @@ public static Area readArea(string key)
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
public static bool readBoolean(string key) public static bool readBoolean(string key,bool def=false)
{ {
if (readString(key).ToLower() == "true") string val= readString(key);
return true; if("true".Equals(val, StringComparison.OrdinalIgnoreCase)){
else return true;
return false; }
if("false".Equals(val, StringComparison.OrdinalIgnoreCase)){
return false;
}
return def;
} }
#endregion #endregion
......
...@@ -492,5 +492,34 @@ public static string GetDeleteSQL(Card c) ...@@ -492,5 +492,34 @@ public static string GetDeleteSQL(Card c)
sw.Close(); sw.Close();
} }
} }
public static CardPack findPack(string db, long id){
CardPack cardpack=null;
if ( File.Exists(db) && id>=0)
{
using ( SQLiteConnection sqliteconn = new SQLiteConnection(@"Data Source=" + db) )
{
sqliteconn.Open();
using ( SQLiteCommand sqlitecommand = new SQLiteCommand(sqliteconn) )
{
sqlitecommand.CommandText = "select id,pack_id,pack,rarity,date from pack where id="+id+" order by date desc";
using ( SQLiteDataReader reader = sqlitecommand.ExecuteReader() )
{
if(reader.Read())
{
cardpack=new CardPack(id);
cardpack.pack_id=reader.GetString(1);
cardpack.pack_name=reader.GetString(2);
cardpack.rarity=reader.GetString(3);
cardpack.date=reader.GetString(4);
}
reader.Close();
}
}
sqliteconn.Close();
}
}
return cardpack;
}
} }
} }
/*
* 由SharpDevelop创建。
* 用户: Hasee
* 日期: 2016/2/27
* 时间: 7:55
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
namespace DataEditorX.Core
{
/// <summary>
/// Description of CardPack.
/// </summary>
public class CardPack
{
public CardPack(long id)
{
this.card_id=id;
}
public long card_id{
get;
private set;
}
public string pack_id;
public string pack_name;
public string rarity;
public string date;
public string getMseRarity(){
if(rarity==null)
return "common";
rarity=rarity.Trim().ToLower();
if(rarity.Equals("common")){
return "common";
}
if(rarity.Equals("rare")){
return "rare";
}
if(rarity.Equals("super") ||rarity.Equals("super rare")){
return "super rare";
}
if(rarity.Contains("secret")){
return "secret rare";
}
if(rarity.Contains("parallel")){
return "parallel rare";
}
if(rarity.Contains("ultimate")){
return "ultimate rare";
}
if(rarity.Contains("ultra")){
return "ultra rare";
}
if(rarity.Contains("gold")){
return "gold tech";
}
if(rarity.Contains("promo")){
return "promo";
}
return "common";
}
}
}
...@@ -45,6 +45,8 @@ public class MseMaker ...@@ -45,6 +45,8 @@ public class MseMaker
public const string TAG_TEXT = "rule text"; public const string TAG_TEXT = "rule text";
public const string TAG_ATK = "attack"; public const string TAG_ATK = "attack";
public const string TAG_DEF = "defense"; public const string TAG_DEF = "defense";
public const string TAG_NUMBER = "number";
public const string TAG_RARITY = "rarity";
public const string TAG_PENDULUM = "pendulum"; public const string TAG_PENDULUM = "pendulum";
public const string TAG_PSCALE1 = "pendulum scale 1"; public const string TAG_PSCALE1 = "pendulum scale 1";
public const string TAG_PSCALE2 = "pendulum scale 2"; public const string TAG_PSCALE2 = "pendulum scale 2";
...@@ -368,7 +370,7 @@ public string[] GetTypes(Card c) ...@@ -368,7 +370,7 @@ public string[] GetTypes(Card c)
#region 写存档 #region 写存档
//写存档 //写存档
public Dictionary<Card, string> WriteSet(string file, Card[] cards) public Dictionary<Card, string> WriteSet(string file, Card[] cards,string cardpack_db,bool rarity=true)
{ {
// MessageBox.Show(""+cfg.replaces.Keys[0]+"/"+cfg.replaces[cfg.replaces.Keys[0]]); // MessageBox.Show(""+cfg.replaces.Keys[0]+"/"+cfg.replaces[cfg.replaces.Keys[0]]);
Dictionary<Card, string> list = new Dictionary<Card, string>(); Dictionary<Card, string> list = new Dictionary<Card, string>();
...@@ -386,10 +388,11 @@ public string[] GetTypes(Card c) ...@@ -386,10 +388,11 @@ public string[] GetTypes(Card c)
list.Add(c, jpg); list.Add(c, jpg);
jpg = Path.GetFileName(jpg); jpg = Path.GetFileName(jpg);
} }
CardPack cardpack=DataBase.findPack(cardpack_db, c.id);
if (c.IsType(CardType.TYPE_SPELL) || c.IsType(CardType.TYPE_TRAP)) if (c.IsType(CardType.TYPE_SPELL) || c.IsType(CardType.TYPE_TRAP))
sw.WriteLine(getSpellTrap(c, jpg, c.IsType(CardType.TYPE_SPELL))); sw.WriteLine(getSpellTrap(c, jpg, c.IsType(CardType.TYPE_SPELL), cardpack,rarity));
else else
sw.WriteLine(getMonster(c, jpg, c.IsType(CardType.TYPE_PENDULUM))); sw.WriteLine(getMonster(c, jpg, c.IsType(CardType.TYPE_PENDULUM),cardpack,rarity));
} }
sw.WriteLine(cfg.end); sw.WriteLine(cfg.end);
sw.Close(); sw.Close();
...@@ -398,7 +401,7 @@ public string[] GetTypes(Card c) ...@@ -398,7 +401,7 @@ public string[] GetTypes(Card c)
return list; return list;
} }
//怪兽,pendulum怪兽 //怪兽,pendulum怪兽
string getMonster(Card c, string img, bool isPendulum) string getMonster(Card c, string img, bool isPendulum,CardPack cardpack=null,bool rarity=true)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
string[] types = GetTypes(c); string[] types = GetTypes(c);
...@@ -413,6 +416,12 @@ string getMonster(Card c, string img, bool isPendulum) ...@@ -413,6 +416,12 @@ string getMonster(Card c, string img, bool isPendulum)
sb.AppendLine(GetLine(TAG_TYPE2, cn2tw(types[1]))); sb.AppendLine(GetLine(TAG_TYPE2, cn2tw(types[1])));
sb.AppendLine(GetLine(TAG_TYPE3, cn2tw(types[2]))); sb.AppendLine(GetLine(TAG_TYPE3, cn2tw(types[2])));
sb.AppendLine(GetLine(TAG_TYPE4, cn2tw(types[3]))); sb.AppendLine(GetLine(TAG_TYPE4, cn2tw(types[3])));
if(cardpack!=null){
sb.AppendLine(GetLine(TAG_NUMBER, cardpack.pack_id));
if(rarity){
sb.AppendLine(GetLine(TAG_RARITY, cardpack.getMseRarity()));
}
}
if (isPendulum)//P怪兽 if (isPendulum)//P怪兽
{ {
string text = GetDesc(c.desc, cfg.regx_monster); string text = GetDesc(c.desc, cfg.regx_monster);
...@@ -439,7 +448,7 @@ string getMonster(Card c, string img, bool isPendulum) ...@@ -439,7 +448,7 @@ string getMonster(Card c, string img, bool isPendulum)
return sb.ToString(); return sb.ToString();
} }
//魔法陷阱 //魔法陷阱
string getSpellTrap(Card c, string img, bool isSpell) string getSpellTrap(Card c, string img, bool isSpell,CardPack cardpack=null,bool rarity=true)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.AppendLine(TAG_CARD + ":"); sb.AppendLine(TAG_CARD + ":");
...@@ -448,6 +457,12 @@ string getSpellTrap(Card c, string img, bool isSpell) ...@@ -448,6 +457,12 @@ string getSpellTrap(Card c, string img, bool isSpell)
sb.AppendLine(GetLine(TAG_ATTRIBUTE, isSpell ? "spell" : "trap")); sb.AppendLine(GetLine(TAG_ATTRIBUTE, isSpell ? "spell" : "trap"));
sb.AppendLine(GetLine(TAG_LEVEL, GetSpellTrapSymbol(c, isSpell))); sb.AppendLine(GetLine(TAG_LEVEL, GetSpellTrapSymbol(c, isSpell)));
sb.AppendLine(GetLine(TAG_IMAGE, img)); sb.AppendLine(GetLine(TAG_IMAGE, img));
if(cardpack!=null){
sb.AppendLine(GetLine(TAG_NUMBER, cardpack.pack_id));
if(rarity){
sb.AppendLine(GetLine(TAG_RARITY, cardpack.getMseRarity()));
}
}
sb.AppendLine(" " + TAG_TEXT + ":"); sb.AppendLine(" " + TAG_TEXT + ":");
sb.AppendLine(" " + ReText(reItalic(c.desc))); sb.AppendLine(" " + ReText(reItalic(c.desc)));
sb.AppendLine(GetLine(TAG_CODE, c.idString)); sb.AppendLine(GetLine(TAG_CODE, c.idString));
......
This diff is collapsed.
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
<Compile Include="Config\DataManager.cs" /> <Compile Include="Config\DataManager.cs" />
<Compile Include="Config\ImageSet.cs" /> <Compile Include="Config\ImageSet.cs" />
<Compile Include="Core\LuaFunction.cs" /> <Compile Include="Core\LuaFunction.cs" />
<Compile Include="Core\Mse\CardPack.cs" />
<Compile Include="Core\Mse\MSECons.cs" /> <Compile Include="Core\Mse\MSECons.cs" />
<Compile Include="Core\Mse\MseMaker.cs" /> <Compile Include="Core\Mse\MseMaker.cs" />
<Compile Include="Core\Mse\MSEConfig.cs" /> <Compile Include="Core\Mse\MSEConfig.cs" />
......
...@@ -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.1.0")] [assembly: AssemblyVersion("2.4.1.1")]
...@@ -46,5 +46,7 @@ ...@@ -46,5 +46,7 @@
<!-- MSE path--> <!-- MSE path-->
<add key="mse_path" value="./MagicSetEditor2/mse.exe"/> <add key="mse_path" value="./MagicSetEditor2/mse.exe"/>
<add key="mse_exprotpath" value="./exprot"/> <add key="mse_exprotpath" value="./exprot"/>
<add key="mse_auto_rarity" value="true"/>
<add key="pack_db" value="./pack.cdb"/>
</appSettings> </appSettings>
</configuration> </configuration>
\ No newline at end of file
★更新历史 ★更新历史
2.4.1.1
新增卡包数据库,支持导出带卡包信息和rarity
2.4.1.0 2.4.1.0
更新数据 更新数据
2.4.0.9 2.4.0.9
......
[DataEditorX]2.4.1.0[DataEditorX] [DataEditorX]2.4.1.1[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)
......
No preview for this file type
...@@ -46,5 +46,7 @@ ...@@ -46,5 +46,7 @@
<!-- MSE path--> <!-- MSE path-->
<add key="mse_path" value="./MagicSetEditor2/mse.exe"/> <add key="mse_path" value="./MagicSetEditor2/mse.exe"/>
<add key="mse_exprotpath" value="./exprot"/> <add key="mse_exprotpath" value="./exprot"/>
<add key="mse_auto_rarity" value="true"/>
<add key="pack_db" value="./pack.cdb"/>
</appSettings> </appSettings>
</configuration> </configuration>
\ No newline at end of file
★更新历史 ★更新历史
2.4.1.1
新增卡包数据库,支持导出带卡包信息和rarity
2.4.1.0 2.4.1.0
更新数据 更新数据
2.4.0.9 2.4.0.9
......
# database history
D:\code\a.cdb
D:\code\italian.cdb
# script history
\ No newline at end of file
[DataEditorX]2.4.1.0[DataEditorX] [DataEditorX]2.4.1.1[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)
......
No preview for this file type
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