private void button15_Click(object sender, EventArgs e) { for (int i = 0; i < checkedListBox22.Items.Count; i++) { if (checkedListBox22.GetItemChecked(i)) { checkedListBox2.SetItemChecked(i, true); } else { checkedListBox2.SetItemChecked(i, false); } } //try //{ string name = ""; foreach (string names in checkedListBox2.CheckedItems) { name += names; } //读取武功 string midname = Convert.ToString(al[50]); loaddat ld = new loaddat(); kungfuwear kw = new kungfuwear(); kw.kfoff(al, ld.loadkungfu(midname)); ArrayList kf = new ArrayList(); kf = ld.loadkungfu(name); for (int i = 200; i < 400; i++) { if (Convert.ToString(al[i]) == name) { if (Convert.ToString(kf[12]) == "def") { kw.kfwear(al, kf); } else { MessageBox.Show("所选武功不是心法。"); } break; } } f5(); //} //catch (Exception) //{ // MessageBox.Show("你没有学习这个武功或者没有选择!"); //} }
private void button14_Click(object sender, EventArgs e) { //解除内功 string midname = Convert.ToString(al[50]); loaddat ld = new loaddat(); kungfuwear kw = new kungfuwear(); kw.kfoff(al, ld.loadkungfu(midname)); f5(); }
private void button13_Click(object sender, EventArgs e) { //解除装备 string midname = Convert.ToString(al[23]); loaddat ld = new loaddat(); shoptrade st = new shoptrade(); equipmentwear ew = new equipmentwear(); ew.equioff(al, ld.loadweapon(midname), 23); st.getsomething(al, ld.loadweapon(midname), 1); f5(); }
private void button8_Click(object sender, EventArgs e) { for (int i = 0; i < checkedListBox22.Items.Count; i++) { if (checkedListBox22.GetItemChecked(i)) { checkedListBox2.SetItemChecked(i, true); } else { checkedListBox2.SetItemChecked(i, false); } } try { string name = ""; foreach (string names in checkedListBox2.CheckedItems) { name += names; } //读取武功 ArrayList kf = new ArrayList(); loaddat ld = new loaddat(); kf = ld.loadkungfu(name); for (int i = 200; i < 400; i++) { if (Convert.ToString(al[i]) == name) { if (Convert.ToString(kf[12]) == "atk") { al[18] = al[i]; al[19] = al[i + 200]; al[107] = kf[50]; } else { MessageBox.Show("所选武功不是攻击套路。"); } break; } } f5(); } catch (Exception) { MessageBox.Show("你没有学习这个武功或者没有选择!"); } }
private void button10_Click(object sender, EventArgs e) { string name = ""; name = textBox50.Text; //读取武功 string midname = Convert.ToString(al[50]); loaddat ld = new loaddat(); kungfuwear kw = new kungfuwear(); kw.kfoff(al, ld.loadkungfu(midname)); ArrayList kf = new ArrayList(); kf = ld.loadkungfu(name); al[200] = textBox50.Text; al[400] = textBox51.Text; for (int i = 200; i < 400; i++) { if (Convert.ToString(al[i]) == name) { if (Convert.ToString(kf[12]) == "def") { kw.kfwear(al, kf); } else { MessageBox.Show("所选武功不是心法。"); } break; } } f5(); //} //catch (Exception) //{ // MessageBox.Show("你没有学习这个武功或者没有选择!"); //} }
private void button11_Click(object sender, EventArgs e) { try { int i; string midname = Convert.ToString(al[23]); i = listBox2.SelectedIndex; listBox3.SelectedIndex = i; loaddat ld = new loaddat(); shoptrade st = new shoptrade(); equipmentwear ew = new equipmentwear(); ew.equioff(al, ld.loadweapon(midname), 23); st.getsomething(al, ld.loadweapon(midname), 1); ew.equiwear(al, ld.loadweapon(listBox3.Text), 23); if (Convert.ToString(al[23]) != "0") { st.destroysomething(al, ld.loadweapon(listBox3.Text), 1); MessageBox.Show("你成功装备了" + weaponIDtostr(Convert.ToString(listBox3.Text)) + "。"); } else { //ew.equiwear(al, ld.loadweapon(midname), 23); //st.destroysomething(al, ld.loadweapon(midname), 1); MessageBox.Show("装备" + weaponIDtostr(Convert.ToString(listBox3.Text)) + "失败。"); } f5(); } catch (Exception) { MessageBox.Show("请选择一个要装备的物品!"); } }