예제 #1
0
        private void Frm_Wear_Load(object sender, EventArgs e)
        {
            Equipment primary_equipment = PlayerValue.Player.Equipments.GetEquipment(tybe);
            string    tem_str;

            if (primary_equipment != null)
            {
                tem_str = primary_equipment.Name + "\n";
                for (int i = 0; i < 6; i++)
                {
                    AttributeValue value = AttributeName.GetAttributeValue(i);
                    if (primary_equipment.GetAdditive(value) != 0)
                    {
                        tem_str += AttributeName.GetAttributeName(value) + Function.GetValueSymbol(primary_equipment.GetAdditive(value)) + "\n";
                    }
                }
            }
            else
            {
                tem_str = "未装备";
            }
            lab_PrimaryEquipment.Text = tem_str;
            tem_str = equipment.Name + "\n";
            for (int i = 0; i < 6; i++)
            {
                var value = AttributeName.GetAttributeValue(i);
                if (equipment.GetAdditive(value) != 0)
                {
                    tem_str += AttributeName.GetAttributeName(value) + Function.GetValueSymbol(equipment.GetAdditive(value)) + "\n";
                }
            }
            lab_NowEquipment.Text = tem_str;
        }
예제 #2
0
        private void Rad_Equipments_Click(object sender, EventArgs e)
        {
            int index = 0;

            foreach (RadioButton tem in rad_Equipments)
            {
                if (tem == sender)
                {
                    break;
                }
                index++;
            }
            if (rad_Equipments[index].Checked)
            {
                if (PlayerValue.Player.Equipments.GetEquipment(EquipmentName.GetEquipmentTybe(index)) == null)
                {
                    but_TakeOffEquipment.Visible = false;
                    lab_EquipmentInfo.Text       = EquipmentName.Text[index] +
                                                   "\r\n" + "未装备";
                }
                else
                {
                    but_TakeOffEquipment.Visible = true;
                    string tem_str = EquipmentName.Text[index] + "\r\n" +
                                     PlayerValue.Player.Equipments.GetEquipment(EquipmentName.GetEquipmentTybe(index)).Name + "\r\n";
                    for (int i = 0; i < 6; i++)
                    {
                        int value = PlayerValue.Player.Equipments.GetEquipment(EquipmentName.GetEquipmentTybe(index)).
                                    GetAdditive(AttributeName.GetAttributeValue(i));
                        if (value != 0)
                        {
                            tem_str += AttributeName.GetAttributeName(AttributeName.GetAttributeValue(i)) +
                                       Function.GetValueSymbol(value) + "\r\n";
                        }
                    }
                    lab_EquipmentInfo.Text = tem_str;
                }
            }
            else
            {
                lab_EquipmentInfo.Text       = "";
                but_TakeOffEquipment.Visible = false;
            }
        }