コード例 #1
0
        //一键按职业给予符合等级的全技能
        private void button11_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("请确保游戏不处于运行状态!", "", MessageBoxButtons.OKCancel);

            if (dr != DialogResult.OK)//如果点击“确定”按钮
            {
                return;
            }
            //获取所有猛将、豪杰、军师、方士
            List <AccAttr> player_jobWarload = CPlayerCtrl.LoadAllWarloadIndexDesc();
            List <AccAttr> player_jobLeader  = CPlayerCtrl.LoadAllLeaderIndexDesc();
            List <AccAttr> player_jobAdvisor = CPlayerCtrl.LoadAllAdvisorIndexDesc();
            List <AccAttr> player_jobWizard  = CPlayerCtrl.LoadAllWizardIndexDesc();

            //构建按职业的List<int> skills
            List <Magic_JobLimit_Str> skill_jobWarload = CSkillCtrl.LoadAllWarloadSkillsDesc();
            List <Magic_JobLimit_Str> skill_jobLeader  = CSkillCtrl.LoadAllLeaderSkillsDesc();
            List <Magic_JobLimit_Str> skill_jobAdvisor = CSkillCtrl.LoadAllAdvisorSkillsDesc();
            List <Magic_JobLimit_Str> skill_jobWizard  = CSkillCtrl.LoadAllWizardSkillsDesc();

            CSkillCtrl.AddSubSkills(player_jobWarload, skill_jobWarload, true);
            CSkillCtrl.AddSubSkills(player_jobLeader, skill_jobLeader, true);
            CSkillCtrl.AddSubSkills(player_jobAdvisor, skill_jobAdvisor, true);
            CSkillCtrl.AddSubSkills(player_jobWizard, skill_jobWizard, true);

            CSkillCtrl.SaveSkillsData(txt_svrForder.Text + "\\DataBase\\saves\\skill.dat");
            MessageBox.Show("DONE!");
        }
コード例 #2
0
        private void LoadSkillMrgInfos()
        {
            CPlayerCtrl.LoadPlayerInfos(txt_svrForder.Text + "\\DataBase\\saves\\players.dat");
            FillPlayerLstView();

            CSkillCtrl.LoadSkillsData(txt_svrForder.Text + "\\DataBase\\saves\\skill.dat");
            FillSkillLstView();
        }
コード例 #3
0
        private void button7_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("请确保游戏不处于运行状态!", "", MessageBoxButtons.OKCancel);

            if (dr != DialogResult.OK)//如果点击“确定”按钮
            {
                return;
            }

            CSkillCtrl.ClearAllSoulSkills(txt_svrForder.Text);
            CSkillCtrl.SaveSkillsData(txt_svrForder.Text + "\\DataBase\\saves\\skill.dat");

            MessageBox.Show("完成");
        }
コード例 #4
0
        private void FillSkillLstView()
        {
            string allSkillDefines    = CSkillCtrl.load_Skill_Defines(System.AppDomain.CurrentDomain.BaseDirectory + "profile");
            var    allSkillDefinesArr = allSkillDefines.Replace("\t", "").Split(';');

            this.lsv_skillDef.Items.Clear();
            foreach (var _def in allSkillDefinesArr)
            {
                var _nameWithIdarr = _def.Split(',');
                if (_nameWithIdarr.Length > 1)
                {
                    string       _name = _nameWithIdarr[0];
                    string       _id   = _nameWithIdarr[1];
                    ListViewItem lvi   = new ListViewItem();
                    //lvi.ImageIndex = i;     //通过与imageList绑定,显示imageList中第i项图标
                    lvi.Text = _id.Replace("\t", "");
                    //lvi.SubItems.Add(_id);
                    lvi.SubItems.Add(_name);
                    this.lsv_skillDef.Items.Add(lvi);
                }
            }
            this.lsv_skillDef.EndUpdate();  //结束数据处理,UI界面一次性绘制
        }
コード例 #5
0
        private void button14_Click(object sender, EventArgs e)
        {
            if (!m_Active)
            {
                MessageBox.Show("软件尚未激活! 请联系软件发布人给予激活!");
                return;
            }
            try
            {
                DialogResult dr = MessageBox.Show("请确保游戏不处于运行状态!", "", MessageBoxButtons.OKCancel);
                if (dr != DialogResult.OK)//如果点击“确定”按钮
                {
                    return;
                }

                if (cbx_skillsAll.Checked)
                {
                    if (rdb_playersAll.Checked)
                    {
                        //增加 || 删除
                        if (rdb_skillAdd.Checked)
                        {
                            CSkillCtrl.AddAllPlayersAllSkills();
                        }
                        else if (rdb_skillDel.Checked)
                        {
                            CSkillCtrl.ClearAllPlayersAllSkills();
                        }
                    }
                    else if (rdb_playersSub.Checked)
                    {
                        //players
                        List <int> players = new List <int>();
                        if (txt_handleSkills.Text != "")
                        {
                            var tmp = txt_handlePlayers.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (var item in tmp)
                            {
                                string  name = item.Split(';')[1];
                                AccAttr attr = CPlayerCtrl.GetAttrByName(name);

                                players.Add((int)attr.nIndex);
                            }
                        }

                        //增加 || 删除
                        if (rdb_skillAdd.Checked)
                        {
                            CSkillCtrl.AddPlayerAllSkills(players);
                        }
                        else if (rdb_skillDel.Checked)
                        {
                            CSkillCtrl.ClearPlayerAllSkills(players);
                        }
                    }
                }
                else
                {
                    //skills
                    List <int> skills = new List <int>();
                    if (txt_handleSkills.Text != "")
                    {
                        var tmp = txt_handleSkills.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (var item in tmp)
                        {
                            int skillid = int.Parse(item.Split(';')[0]);
                            skills.Add(skillid);
                        }
                    }

                    if (rdb_playersAll.Checked)
                    {
                        //增加 || 删除
                        if (rdb_skillAdd.Checked)
                        {
                            CSkillCtrl.AddAllPlayersSkills(skills);
                        }
                        else if (rdb_skillDel.Checked)
                        {
                            CSkillCtrl.ClearAllPlayersSkills(skills);
                        }
                    }
                    else if (rdb_playersSub.Checked)
                    {
                        //players
                        List <int> players = new List <int>();
                        if (txt_handleSkills.Text != "")
                        {
                            var tmp = txt_handlePlayers.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (var item in tmp)
                            {
                                string  name = item.Split(';')[1];
                                AccAttr attr = CPlayerCtrl.GetAttrByName(name);

                                players.Add((int)attr.nIndex);
                            }
                        }

                        //增加 || 删除
                        if (rdb_skillAdd.Checked)
                        {
                            CSkillCtrl.AddSubSkills(players, skills);
                        }
                        else if (rdb_skillDel.Checked)
                        {
                            CSkillCtrl.ClearSubSkills(players, skills);
                        }
                    }
                }
                CSkillCtrl.SaveSkillsData(txt_svrForder.Text + "\\DataBase\\saves\\skill.dat");
                MessageBox.Show("DONE!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #6
0
 private void button17_Click(object sender, EventArgs e)
 {
     CSkillCtrl.LoadSkillsData(txt_svrForder.Text + "\\DataBase\\saves\\skill.dat");
     FillSkillLstView();
 }