Commit 787dfd6d authored by DailyShana's avatar DailyShana

add TYPE_LINK

parent ced927d6
...@@ -36,6 +36,7 @@ public void InitMember(string conf) ...@@ -36,6 +36,7 @@ public void InitMember(string conf)
dicCardRules = new Dictionary<long, string>(); dicCardRules = new Dictionary<long, string>();
dicSetnames = new Dictionary<long, string>(); dicSetnames = new Dictionary<long, string>();
dicCardTypes = new Dictionary<long, string>(); dicCardTypes = new Dictionary<long, string>();
dicLinkMarkers = new Dictionary<long, string>();
dicCardcategorys = new Dictionary<long, string>(); dicCardcategorys = new Dictionary<long, string>();
dicCardAttributes = new Dictionary<long, string>(); dicCardAttributes = new Dictionary<long, string>();
dicCardRaces = new Dictionary<long, string>(); dicCardRaces = new Dictionary<long, string>();
...@@ -47,6 +48,7 @@ public void InitMember(string conf) ...@@ -47,6 +48,7 @@ public void InitMember(string conf)
dicCardRules = DataManager.Read(text, MyConfig.TAG_RULE); dicCardRules = DataManager.Read(text, MyConfig.TAG_RULE);
dicSetnames = DataManager.Read(text, MyConfig.TAG_SETNAME); dicSetnames = DataManager.Read(text, MyConfig.TAG_SETNAME);
dicCardTypes = DataManager.Read(text, MyConfig.TAG_TYPE); dicCardTypes = DataManager.Read(text, MyConfig.TAG_TYPE);
dicLinkMarkers = DataManager.Read(text, MyConfig.TAG_MARKER);
dicCardcategorys = DataManager.Read(text, MyConfig.TAG_CATEGORY); dicCardcategorys = DataManager.Read(text, MyConfig.TAG_CATEGORY);
dicCardAttributes = DataManager.Read(text, MyConfig.TAG_ATTRIBUTE); dicCardAttributes = DataManager.Read(text, MyConfig.TAG_ATTRIBUTE);
dicCardRaces = DataManager.Read(text, MyConfig.TAG_RACE); dicCardRaces = DataManager.Read(text, MyConfig.TAG_RACE);
...@@ -78,6 +80,10 @@ public void InitMember(string conf) ...@@ -78,6 +80,10 @@ public void InitMember(string conf)
/// </summary> /// </summary>
public Dictionary<long, string> dicCardTypes = null; public Dictionary<long, string> dicCardTypes = null;
/// <summary> /// <summary>
/// 连接标志
/// </summary>
public Dictionary<long, string> dicLinkMarkers = null;
/// <summary>
/// 效果类型 /// 效果类型
/// </summary> /// </summary>
public Dictionary<long, string> dicCardcategorys = null; public Dictionary<long, string> dicCardcategorys = null;
......
...@@ -165,8 +165,12 @@ public class MyConfig : XMLReader ...@@ -165,8 +165,12 @@ public class MyConfig : XMLReader
/// 系列名 /// 系列名
/// </summary> /// </summary>
public const string TAG_SETNAME = "setname"; public const string TAG_SETNAME = "setname";
/// <summary>
/// 连接标志
/// </summary>
public const string TAG_MARKER = "link marker";
#endregion #endregion
#region 读取内容 #region 读取内容
/// <summary> /// <summary>
/// 读取字符串值 /// 读取字符串值
......
...@@ -123,11 +123,11 @@ public void SetSetCode(params string[] setcodes) ...@@ -123,11 +123,11 @@ public void SetSetCode(params string[] setcodes)
} }
public long GetLeftScale() public long GetLeftScale()
{ {
return (this.level >> 0x18) & 0xff; return (this.level >> 24) & 0xff;
} }
public long GetRightScale() public long GetRightScale()
{ {
return (this.level >> 0x10) & 0xff; return (this.level >> 16) & 0xff;
} }
#endregion #endregion
......
...@@ -342,7 +342,11 @@ public static string GetSelectSQL(Card c) ...@@ -342,7 +342,11 @@ public static string GetSelectSQL(Card c)
sb.Append(" and datas.attribute = "+c.attribute.ToString()); sb.Append(" and datas.attribute = "+c.attribute.ToString());
if ((c.level & 0xff) > 0) if ((c.level & 0xff) > 0)
sb.Append(" and (datas.level & 255) = "+toInt(c.level & 0xff)); sb.Append(" and (datas.level & 255) = "+toInt(c.level & 0xff));
if(c.race>0) if ((c.level & 0xff000000) > 0)
sb.Append(" and (datas.level & 4278190080) = " + toInt(c.level & 0xff000000));
if ((c.level & 0xff0000) > 0)
sb.Append(" and (datas.level & 16711680) = " + toInt(c.level & 0xff0000));
if (c.race>0)
sb.Append(" and datas.race = "+toInt(c.race)); sb.Append(" and datas.race = "+toInt(c.race));
if(c.type>0) if(c.type>0)
sb.Append(" and datas.type & "+toInt(c.type)+" = "+toInt(c.type)); sb.Append(" and datas.type & "+toInt(c.type)+" = "+toInt(c.type));
...@@ -353,11 +357,17 @@ public static string GetSelectSQL(Card c) ...@@ -353,11 +357,17 @@ public static string GetSelectSQL(Card c)
sb.Append(" and datas.type & 1 = 1 and datas.atk = 0"); sb.Append(" and datas.type & 1 = 1 and datas.atk = 0");
else if(c.atk<0 || c.atk>0) else if(c.atk<0 || c.atk>0)
sb.Append(" and datas.atk = "+c.atk.ToString()); sb.Append(" and datas.atk = "+c.atk.ToString());
if (c.IsType(Info.CardType.TYPE_LINK))
if(c.def==-1) {
sb.Append(" and datas.type & 1 = 1 and datas.def = 0"); sb.Append(" and datas.def &" + c.def.ToString() + "=" + c.def.ToString());
else if(c.def<0 || c.def>0) }
sb.Append(" and datas.def = "+c.def.ToString()); else
{
if (c.def == -1)
sb.Append(" and datas.type & 1 = 1 and datas.def = 0");
else if (c.def < 0 || c.def > 0)
sb.Append(" and datas.def = " + c.def.ToString());
}
if(c.id>0 && c.alias>0) if(c.id>0 && c.alias>0)
sb.Append(" and datas.id BETWEEN "+c.alias.ToString()+" and "+c.id.ToString()); sb.Append(" and datas.id BETWEEN "+c.alias.ToString()+" and "+c.id.ToString());
......
...@@ -63,5 +63,7 @@ public enum CardRace : long ...@@ -63,5 +63,7 @@ public enum CardRace : long
RACE_CREATORGOD = 0x400000, RACE_CREATORGOD = 0x400000,
///<summary>幻龙</summary> ///<summary>幻龙</summary>
RACE_WYRM = 0x800000, RACE_WYRM = 0x800000,
///<summary>电子界</summary>
RACE_CYBERSE = 0x1000000,
} }
} }
...@@ -52,14 +52,18 @@ public enum CardType : long ...@@ -52,14 +52,18 @@ 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>
TYPE_TOON =0x400000 , TYPE_TOON =0x400000 ,
///<summary>超量</summary> ///<summary>超量</summary>
TYPE_XYZ =0x800000 , TYPE_XYZ =0x800000 ,
///<summary>摇摆</summary> ///<summary>灵摆</summary>
TYPE_PENDULUM =0x1000000 , TYPE_PENDULUM =0x1000000 ,
///<summary>特殊召唤</summary>
TYPE_SPSUMMON =0x2000000 ,
///<summary>连接</summary>
TYPE_LINK =0x4000000 ,
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -266,6 +266,9 @@ public void InitControl(DataConfig datacfg) ...@@ -266,6 +266,9 @@ public void InitControl(DataConfig datacfg)
InitComboBox(cb_cardlevel, datacfg.dicCardLevels); InitComboBox(cb_cardlevel, datacfg.dicCardLevels);
//卡片类型 //卡片类型
InitCheckPanel(pl_cardtype, datacfg.dicCardTypes); InitCheckPanel(pl_cardtype, datacfg.dicCardTypes);
//连接标记
InitCheckPanel(pl_markers, datacfg.dicLinkMarkers);
SetEnabled(pl_markers, false);
//效果类型 //效果类型
InitCheckPanel(pl_category, datacfg.dicCardcategorys); InitCheckPanel(pl_category, datacfg.dicCardcategorys);
//系列名 //系列名
...@@ -290,14 +293,29 @@ void InitCheckPanel(FlowLayoutPanel fpanel, Dictionary<long, string> dic) ...@@ -290,14 +293,29 @@ void InitCheckPanel(FlowLayoutPanel fpanel, Dictionary<long, string> dic)
_cbox.Text = dic[key]; _cbox.Text = dic[key];
_cbox.AutoSize = true; _cbox.AutoSize = true;
_cbox.Margin = fpanel.Margin; _cbox.Margin = fpanel.Margin;
_cbox.CheckedChanged += _cbox_CheckedChanged;
//_cbox.Click += PanelOnCheckClick; //_cbox.Click += PanelOnCheckClick;
fpanel.Controls.Add(_cbox); fpanel.Controls.Add(_cbox);
} }
fpanel.ResumeLayout(false); fpanel.ResumeLayout(false);
fpanel.PerformLayout(); fpanel.PerformLayout();
} }
//初始化ComboBox
void InitComboBox(ComboBox cb, Dictionary<long, string> tempdic) private void _cbox_CheckedChanged(object sender, EventArgs e)
{
CheckBox cbox = (CheckBox)sender;
if(cbox.Parent== pl_cardtype)
{
if ((long)cbox.Tag == (long)Core.Info.CardType.TYPE_LINK)
{
SetEnabled(pl_markers, cbox.Checked);
tb_def.ReadOnly = cbox.Checked;
}
}
}
//初始化ComboBox
void InitComboBox(ComboBox cb, Dictionary<long, string> tempdic)
{ {
InitComboBox(cb, DataManager.GetKeys(tempdic), InitComboBox(cb, DataManager.GetKeys(tempdic),
DataManager.GetValues(tempdic)); DataManager.GetValues(tempdic));
...@@ -357,6 +375,14 @@ void SetCheck(FlowLayoutPanel fpl, long number) ...@@ -357,6 +375,14 @@ void SetCheck(FlowLayoutPanel fpl, long number)
} }
//return strType; //return strType;
} }
void SetEnabled(FlowLayoutPanel fpl, bool set)
{
foreach (Control c in fpl.Controls)
{
CheckBox cbox=(CheckBox)c;
cbox.Enabled = set;
}
}
//设置combobox //设置combobox
void SetSelect(ComboBox cb, long k) void SetSelect(ComboBox cb, long k)
{ {
...@@ -482,13 +508,20 @@ public void SetCard(Card c) ...@@ -482,13 +508,20 @@ public void SetCard(Card c)
tb_setcode4.Text = setcodes[3].ToString("x"); tb_setcode4.Text = setcodes[3].ToString("x");
//type,category //type,category
SetCheck(pl_cardtype, c.type); SetCheck(pl_cardtype, c.type);
SetCheck(pl_category, c.category); if (c.IsType(Core.Info.CardType.TYPE_LINK))
SetCheck(pl_markers, c.def);
else
SetCheck(pl_markers, 0);
SetCheck(pl_category, c.category);
//Pendulum //Pendulum
tb_pleft.Text = ((c.level >> 0x18) & 0xff).ToString(); tb_pleft.Text = ((c.level >> 24) & 0xff).ToString();
tb_pright.Text = ((c.level >> 0x10) & 0xff).ToString(); tb_pright.Text = ((c.level >> 16) & 0xff).ToString();
//atk,def //atk,def
tb_atk.Text = (c.atk < 0) ? "?" : c.atk.ToString(); tb_atk.Text = (c.atk < 0) ? "?" : c.atk.ToString();
tb_def.Text = (c.def < 0) ? "?" : c.def.ToString(); if (c.IsType(Core.Info.CardType.TYPE_LINK))
tb_def.Text = "0";
else
tb_def.Text = (c.def < 0) ? "?" : c.def.ToString();
tb_cardcode.Text = c.id.ToString(); tb_cardcode.Text = c.id.ToString();
tb_cardalias.Text = c.alias.ToString(); tb_cardalias.Text = c.alias.ToString();
SetImage(c.id.ToString()); SetImage(c.id.ToString());
...@@ -520,21 +553,28 @@ public Card GetCard() ...@@ -520,21 +553,28 @@ public Card GetCard()
c.category = GetCheck(pl_category); c.category = GetCheck(pl_category);
int.TryParse(tb_pleft.Text, out temp); int.TryParse(tb_pleft.Text, out temp);
c.level += (temp << 0x18); c.level += (temp << 24);
int.TryParse(tb_pright.Text, out temp); int.TryParse(tb_pright.Text, out temp);
c.level += (temp << 0x10); c.level += (temp << 16);
if (tb_atk.Text == "?" || tb_atk.Text == "?") if (tb_atk.Text == "?" || tb_atk.Text == "?")
c.atk = -2; c.atk = -2;
else if (tb_atk.Text == ".") else if (tb_atk.Text == ".")
c.atk = -1; c.atk = -1;
else else
int.TryParse(tb_atk.Text, out c.atk); int.TryParse(tb_atk.Text, out c.atk);
if (tb_def.Text == "?" || tb_def.Text == "?") if (c.IsType(Core.Info.CardType.TYPE_LINK))
c.def = -2; {
else if (tb_def.Text == ".") c.def = (int)GetCheck(pl_markers);
c.def = -1; }
else else
int.TryParse(tb_def.Text, out c.def); {
if (tb_def.Text == "?" || tb_def.Text == "?")
c.def = -2;
else if (tb_def.Text == ".")
c.def = -1;
else
int.TryParse(tb_def.Text, out c.def);
}
long.TryParse(tb_cardcode.Text, out c.id); long.TryParse(tb_cardcode.Text, out c.id);
long.TryParse(tb_cardalias.Text, out c.alias); long.TryParse(tb_cardalias.Text, out c.alias);
...@@ -633,16 +673,12 @@ public bool Open(string file) ...@@ -633,16 +673,12 @@ public bool Open(string file)
return true; return true;
} }
//setcode, 灵摆刻度的搜索 //setcode的搜索
public bool CardFilter(Card c, Card sc) public bool CardFilter(Card c, Card sc)
{ {
bool res = true; bool res = true;
if (sc.setcode != 0) if (sc.setcode != 0)
res &= c.IsSetCode(sc.setcode & 0xffff); res &= c.IsSetCode(sc.setcode & 0xffff);
if (sc.GetLeftScale() != 0 )
res &= (c.GetLeftScale() == sc.GetLeftScale());
if (sc.GetRightScale() != 0 )
res &= (c.GetRightScale() == sc.GetRightScale());
return res; return res;
} }
//设置卡片列表的结果 //设置卡片列表的结果
...@@ -678,7 +714,7 @@ public void SetCards(Card[] cards, bool isfresh) ...@@ -678,7 +714,7 @@ public void SetCards(Card[] cards, bool isfresh)
tb_pagenum.Text = pageNum.ToString(); tb_pagenum.Text = pageNum.ToString();
cardlist.Clear(); cardlist.Clear();
lv_cardlist.Items.Clear(); lv_cardlist.Items.Clear();
SetCard(new Card(0)); //SetCard(new Card(0));
} }
} }
//搜索卡片 //搜索卡片
......
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
0xb 11★ 0xb 11★
0xc 12★ 0xc 12★
0xd 13★ 0xd 13★
##link marker
0x1 ↙
0x2 ↓
0x4 ↘
0x8 ←
0x20 →
0x40 ↖
0x80 ↑
0x100 ↗
##category ##category
0x1 魔陷破坏 0x1 魔陷破坏
0x2 怪兽破坏 0x2 怪兽破坏
...@@ -92,30 +101,31 @@ ...@@ -92,30 +101,31 @@
##type ##type
0x1 怪兽 0x1 怪兽
0x2 魔法 0x2 魔法
0x4 陷阱 0x4 陷阱
0x8 N/A 0x8 N/A
0x10 通常 0x10 通常
0x20 效果 0x20 效果
0x40 融合 0x40 融合
0x80 仪式 0x80 仪式
0x100 N/A 0x100 N/A
0x200 灵魂 0x200 灵魂
0x400 同盟 0x400 同盟
0x800 二重 0x800 二重
0x1000 调整 0x1000 调整
0x2000 同调 0x2000 同调
0x4000 衍生物 0x4000 衍生物
0x8000 N/A 0x8000 N/A
0x10000 速攻 0x10000 速攻
0x20000 永续 0x20000 永续
0x40000 装备 0x40000 装备
0x80000 场地 0x80000 场地
0x100000 反击 0x100000 反击
0x200000 反转 0x200000 反转
0x400000 卡通 0x400000 卡通
0x800000 超量 0x800000 超量
0x1000000 灵摆 0x1000000 灵摆
0x2000000 特殊召唤 0x2000000 特殊召唤
0x4000000 连接
##setname ##setname
-1 自定义 -1 自定义
0x0 系列 0x0 系列
......
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
0xb 11★ 0xb 11★
0xc 12★ 0xc 12★
0xd 13★ 0xd 13★
##link marker
0x1 ↙
0x2 ↓
0x4 ↘
0x8 ←
0x20 →
0x40 ↖
0x80 ↑
0x100 ↗
##category ##category
0x1 S/T Destroy 0x1 S/T Destroy
0x2 Destroy Monster 0x2 Destroy Monster
...@@ -116,6 +125,7 @@ ...@@ -116,6 +125,7 @@
0x800000 Xyz 0x800000 Xyz
0x1000000 Pendulum 0x1000000 Pendulum
0x2000000 SPSummon 0x2000000 SPSummon
0x4000000 Link
##setname ##setname
-1 Custom -1 Custom
0x0 Archetype 0x0 Archetype
......
...@@ -15,6 +15,7 @@ CodeEditForm.mainMenu.menuitem_about 关于 ...@@ -15,6 +15,7 @@ CodeEditForm.mainMenu.menuitem_about 关于
# #
DataEditForm.btn_img 导入图片 DataEditForm.btn_img 导入图片
DataEditForm.lb_types 卡片类型 DataEditForm.lb_types 卡片类型
DataEditForm.lb_markers 连接标记
DataEditForm.lb_tiptexts 脚本提示文字 DataEditForm.lb_tiptexts 脚本提示文字
DataEditForm.lb_categorys 效果分类 DataEditForm.lb_categorys 效果分类
DataEditForm.lb_cardcode 卡片密码 DataEditForm.lb_cardcode 卡片密码
......
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