コード例 #1
0
ファイル: Gacha.cs プロジェクト: RyanFu/BH3rdGachaSimulator
        public void Read_Kuochong()
        {
            string path = $@"{cq.CQApi.AppDirectory}\概率\扩充概率.txt";

            Probablity_KC角色卡          = Convert.ToDouble(INIhelper.IniRead("综合概率", "角色卡", "15.00", path).Replace("%", ""));
            Probablity_KC角色碎片         = Convert.ToDouble(INIhelper.IniRead("综合概率", "角色碎片", "26.25", path).Replace("%", ""));
            Probablity_KC材料           = Convert.ToDouble(INIhelper.IniRead("综合概率", "材料", "58.75", path).Replace("%", ""));
            Probablity_UpS            = Convert.ToDouble(INIhelper.IniRead("详细概率", "UpS角色", "1.50", path).Replace("%", ""));
            Probablity_UpA            = Convert.ToDouble(INIhelper.IniRead("详细概率", "UpA角色", "4.50", path).Replace("%", ""));
            Probablity_A              = Convert.ToDouble(INIhelper.IniRead("详细概率", "A角色", "3.00", path).Replace("%", ""));
            Probablity_Adebris        = Convert.ToDouble(INIhelper.IniRead("详细概率", "UpA角色碎片", "15.00", path).Replace("%", ""));
            Probablity_Sdebris        = Convert.ToDouble(INIhelper.IniRead("详细概率", "UpS角色碎片", "2.25", path).Replace("%", ""));
            Probablity_Material技能材料   = Convert.ToDouble(INIhelper.IniRead("详细概率", "技能材料", "10.00", path).Replace("%", ""));
            Probablity_Material反应炉    = Convert.ToDouble(INIhelper.IniRead("详细概率", "低星装备材料", "26.41", path).Replace("%", ""));
            Probablity_Material紫色角色经验 = Convert.ToDouble(INIhelper.IniRead("详细概率", "角色经验", "11.17", path).Replace("%", ""));
            Probablity_Material吼咪宝藏   = Convert.ToDouble(INIhelper.IniRead("详细概率", "吼咪宝藏", "2.232", path).Replace("%", ""));
            Probablity_Material吼美宝藏   = Convert.ToDouble(INIhelper.IniRead("详细概率", "吼美宝藏", "3.334", path).Replace("%", ""));
            Probablity_Material吼姆宝藏   = Convert.ToDouble(INIhelper.IniRead("详细概率", "吼姆宝藏", "5.556", path).Replace("%", ""));

            Text_UpS = INIhelper.IniRead("详情", "UpS", "S角色卡", path);
            Text_UpA = INIhelper.IniRead("详情", "UpA", "UpA角色卡", path);
            Text_A1  = INIhelper.IniRead("详情", "Item0", "A角色卡1", path);
            Text_A2  = INIhelper.IniRead("详情", "Item1", "A角色卡2", path);
            Text_A3  = INIhelper.IniRead("详情", "Item2", "A角色卡3", path);
        }
コード例 #2
0
        private void ExtraConfig_Load(object sender, EventArgs e)
        {
            string path = CQSave.AppDirectory + "Config.ini";

            checkBox_TextGacha.Checked = (INIhelper.IniRead("ExtraConfig", "TextGacha", "0", path)) == "1" ? true : false;
            checkBox_Sql.Checked       = (INIhelper.IniRead("ExtraConfig", "ExecuteSql", "0", path)) == "1" ? true : false;
            radioButton_Picjpg.Checked = (INIhelper.IniRead("ExtraConfig", "ImageFormat", "jpg", path) == "jpg") ? true : false;
            radioButton_Picpng.Checked = (INIhelper.IniRead("ExtraConfig", "ImageFormat", "jpg", path) == "png") ? true : false;

            checkBox_SwBP1.Checked        = (INIhelper.IniRead("ExtraConfig", "SwitchBP1", "1", path) == "1") ? true : false;
            checkBox_SwBP10.Checked       = (INIhelper.IniRead("ExtraConfig", "SwitchBP10", "1", path) == "1") ? true : false;
            checkBox_SwJZA1.Checked       = (INIhelper.IniRead("ExtraConfig", "SwitchJZA1", "1", path) == "1") ? true : false;
            checkBox_SwJZA10.Checked      = (INIhelper.IniRead("ExtraConfig", "SwitchJZA10", "1", path) == "1") ? true : false;
            checkBox_SwJZB1.Checked       = (INIhelper.IniRead("ExtraConfig", "SwitchJZB1", "1", path) == "1") ? true : false;
            checkBox_SwJZB10.Checked      = (INIhelper.IniRead("ExtraConfig", "SwitchJZB10", "1", path) == "1") ? true : false;
            checkBox_SwKC1.Checked        = (INIhelper.IniRead("ExtraConfig", "SwitchKC1", "1", path) == "1") ? true : false;
            checkBox_SwKC10.Checked       = (INIhelper.IniRead("ExtraConfig", "SwitchKC10", "1", path) == "1") ? true : false;
            checkBox_SwQueDiamond.Checked = (INIhelper.IniRead("ExtraConfig", "SwitchQueDiamond", "1", path) == "1") ? true : false;
            checkBox_SwResSign.Checked    = (INIhelper.IniRead("ExtraConfig", "SwitchResSign", "1", path) == "1") ? true : false;
            checkBox_SwGetHelp.Checked    = (INIhelper.IniRead("ExtraConfig", "SwitchGetHelp", "1", path) == "1") ? true : false;
            checkBox_SwGetPool.Checked    = (INIhelper.IniRead("ExtraConfig", "SwitchGetPool", "1", path) == "1") ? true : false;
            checkBox_SwKaKin.Checked      = (INIhelper.IniRead("ExtraConfig", "SwitchKaKin", "1", path) == "1") ? true : false;
            checkBox_SwOpenGroup.Checked  = (INIhelper.IniRead("ExtraConfig", "SwitchOpenGroup", "1", path) == "1") ? true : false;
            checkBox_SwCloseGroup.Checked = (INIhelper.IniRead("ExtraConfig", "SwitchCloseGroup", "1", path) == "1") ? true : false;
            checkBox_SwOpenAdmin.Checked  = (INIhelper.IniRead("ExtraConfig", "SwitchOpenAdmin", "1", path) == "1") ? true : false;

            flag = true;
        }
コード例 #3
0
        private void button_Save_Click(object sender, EventArgs e)
        {
            string path = CQSave.AppDirectory + "Config.ini";

            INIhelper.IniWrite("ExtraConfig", "TextGacha", (checkBox_TextGacha.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "ExecuteSql", (checkBox_Sql.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "ImageFormat", (radioButton_Picjpg.Checked) ? "jpg" : "png", path);

            INIhelper.IniWrite("ExtraConfig", "SwitchBP1", (checkBox_SwBP1.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchBP10", (checkBox_SwBP10.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchJZA1", (checkBox_SwJZA1.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchJZA10", (checkBox_SwJZA10.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchJZB1", (checkBox_SwJZB1.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchJZB10", (checkBox_SwJZB10.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchKC1", (checkBox_SwKC1.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchKC10", (checkBox_SwKC10.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchQueDiamond", (checkBox_SwQueDiamond.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchResSign", (checkBox_SwResSign.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchGetHelp", (checkBox_SwGetHelp.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchGetPool", (checkBox_SwGetPool.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchKaKin", (checkBox_SwKaKin.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchOpenGroup", (checkBox_SwOpenGroup.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchCloseGroup", (checkBox_SwCloseGroup.Checked) ? "1" : "0", path);
            INIhelper.IniWrite("ExtraConfig", "SwitchOpenAdmin", (checkBox_SwOpenAdmin.Checked) ? "1" : "0", path);

            MessageBox.Show("更改已保存");
        }
コード例 #4
0
 private void button_Save_Click(object sender, EventArgs e)
 {
     INIhelper.IniWrite("ExtraConfig", "TextGacha", (checkBox_TextGacha.Checked) ? "1" : "0", CQSave.cq_menu.CQApi.AppDirectory + "Config.ini");
     INIhelper.IniWrite("ExtraConfig", "ExecuteSql", (checkBox_Sql.Checked) ? "1" : "0", CQSave.cq_menu.CQApi.AppDirectory + "Config.ini");
     INIhelper.IniWrite("ExtraConfig", "ImageFormat", (radioButton_Picjpg.Checked) ? "jpg" : "png", CQSave.cq_menu.CQApi.AppDirectory + "Config.ini");
     MessageBox.Show("更改已保存");
 }
コード例 #5
0
 private void ExtraConfig_Load(object sender, EventArgs e)
 {
     checkBox_TextGacha.Checked = (INIhelper.IniRead("ExtraConfig", "TextGacha", "0", CQSave.cq_menu.CQApi.AppDirectory + "Config.ini")) == "1"?true:false;
     checkBox_Sql.Checked       = (INIhelper.IniRead("ExtraConfig", "ExecuteSql", "0", CQSave.cq_menu.CQApi.AppDirectory + "Config.ini")) == "1" ? true : false;
     radioButton_Picjpg.Checked = (INIhelper.IniRead("ExtraConfig", "ImageFormat", "jpg", CQSave.cq_menu.CQApi.AppDirectory + "Config.ini") == "jpg") ? true : false;
     radioButton_Picpng.Checked = (INIhelper.IniRead("ExtraConfig", "ImageFormat", "jpg", CQSave.cq_menu.CQApi.AppDirectory + "Config.ini") == "png") ? true : false;
     flag = true;
 }
コード例 #6
0
        private void button_Save_Click(object sender, EventArgs e)
        {
            string path = $@"{CQSave.cq_menu.CQApi.AppDirectory}Config.ini";

            INIhelper.IniWrite("Order", "KC1", textBox_OrderKC1.Text, path);
            INIhelper.IniWrite("Order", "KC10", textBox_OrderKC10.Text, path);
            INIhelper.IniWrite("Order", "JZA1", textBox_OrderJZA1.Text, path);
            INIhelper.IniWrite("Order", "JZA10", textBox_OrderJZA10.Text, path);
            INIhelper.IniWrite("Order", "JZB1", textBox_OrderJZB1.Text, path);
            INIhelper.IniWrite("Order", "JZB10", textBox_OrderJZB10.Text, path);
            INIhelper.IniWrite("Order", "BP1", textBox_OrderBP1.Text, path);
            INIhelper.IniWrite("Order", "BP10", textBox_OrderBP10.Text, path);

            INIhelper.IniWrite("Order", "Register", textBox_OrderRegiter.Text, path);
            INIhelper.IniWrite("Order", "Sign", textBox_OrderSign.Text, path);
            INIhelper.IniWrite("Order", "SignReset", textBox_OrderSignReset.Text, path);
            INIhelper.IniWrite("Order", "QueryDiamond", textBox_OrderQueryDiamond.Text, path);
            INIhelper.IniWrite("Order", "Help", textBox_OrderHelp.Text, path);
            INIhelper.IniWrite("Order", "GetPool", textBox_OrderGetPool.Text, path);
            INIhelper.IniWrite("Order", "OpenGacha", textBox_OrderOpenGacha.Text, path);
            INIhelper.IniWrite("Order", "CloseGacha", textBox_OrderCloseGacha.Text, path);

            INIhelper.IniWrite("Answer", "KC1", textBox_AnsKC1.Text, path);
            INIhelper.IniWrite("Answer", "KC10", textBox_AnsKC10.Text, path);
            INIhelper.IniWrite("Answer", "JZA1", textBox_AnsJZA1.Text, path);
            INIhelper.IniWrite("Answer", "JZA10", textBox_AnsJZA10.Text, path);
            INIhelper.IniWrite("Answer", "JZB1", textBox_AnsJZB1.Text, path);
            INIhelper.IniWrite("Answer", "JZB10", textBox_AnsJZB10.Text, path);
            INIhelper.IniWrite("Answer", "BP1", textBox_AnsBP1.Text, path);
            INIhelper.IniWrite("Answer", "BP10", textBox_AnsBP10.Text, path);

            INIhelper.IniWrite("Answer", "Register", textBox_AnsRegister.Text, path);
            INIhelper.IniWrite("Answer", "MutiRegister", textBox_AnsMutiRegister.Text, path);
            INIhelper.IniWrite("Answer", "Sign1", textBox_AnsSign1.Text, path);
            INIhelper.IniWrite("Answer", "Sign2", textBox_AnsSign2.Text, path);
            INIhelper.IniWrite("Answer", "MutiSign", textBox_AnsMutiSign.Text, path);
            INIhelper.IniWrite("Answer", "QueryDiamond", textBox_AnsQueryDiamond.Text, path);
            INIhelper.IniWrite("Answer", "NoReg", textBox_AnsNoReg.Text, path);
            INIhelper.IniWrite("Answer", "LowDiamond", textBox_AnsLowDiamond.Text, path);

            INIhelper.IniWrite("Answer", "Reset1", textBox_SignReset1.Text, path);
            INIhelper.IniWrite("Answer", "Reset2", textBox_SignReset2.Text, path);
            INIhelper.IniWrite("Answer", "Reset3", textBox_SignReset3.Text, path);
            INIhelper.IniWrite("Answer", "Reset4", textBox_SignReset4.Text, path);
            INIhelper.IniWrite("Answer", "Reset5", textBox_SignReset5.Text, path);
            INIhelper.IniWrite("Answer", "Reset6", textBox_SignReset6.Text, path);

            INIhelper.IniWrite("Answer", "Help", @textBox_AnsHelp.Text, path);

            INIhelper.IniWrite("GetDiamond", "RegisterMin", textBox_ResisterMin.Text, path);
            INIhelper.IniWrite("GetDiamond", "RegisterMax", textBox_RegisterMax.Text, path);
            INIhelper.IniWrite("GetDiamond", "SignMin", textBox_SignMin.Text, path);
            INIhelper.IniWrite("GetDiamond", "SignMax", textBox_SignMax.Text, path);

            MessageBox.Show("更改已保存");
        }
コード例 #7
0
        private void AnswerDIY_Load(object sender, EventArgs e)
        {
            string path = $@"{CQSave.cq_menu.CQApi.AppDirectory}Config.ini";

            textBox_OrderKC1.Text          = INIhelper.IniRead("Order", "KC1", "#扩充单抽", path);
            textBox_OrderKC10.Text         = INIhelper.IniRead("Order", "KC10", "#扩充十连", path);
            textBox_OrderJZ1.Text          = INIhelper.IniRead("Order", "JZ1", "#精准单抽", path);
            textBox_OrderJZ10.Text         = INIhelper.IniRead("Order", "JZ10", "#精准十连", path);
            textBox_OrderRegiter.Text      = INIhelper.IniRead("Order", "Register", "#抽卡注册", path);
            textBox_OrderSign.Text         = INIhelper.IniRead("Order", "Sign", "#打扫甲板", path);
            textBox_OrderSignReset.Text    = INIhelper.IniRead("Order", "SignReset", "#甲板积灰", path);
            textBox_OrderQueryDiamond.Text = INIhelper.IniRead("Order", "QueryDiamond", "#我的水晶", path);
            textBox_OrderHelp.Text         = INIhelper.IniRead("Order", "Help", "#抽卡帮助", path);
            textBox_OrderGetPool.Text      = INIhelper.IniRead("Order", "GetPool", "#获取池子", path);

            textBox_AnsKC1.Text          = INIhelper.IniRead("Answer", "KC1", "少女祈祷中……", path);
            textBox_AnsKC10.Text         = INIhelper.IniRead("Answer", "KC10", "少女祈祷中……", path);
            textBox_AnsJZ1.Text          = INIhelper.IniRead("Answer", "JZ1", "少女祈祷中……", path);
            textBox_AnsJZ10.Text         = INIhelper.IniRead("Answer", "JZ10", "少女祈祷中……", path);
            textBox_AnsRegister.Text     = INIhelper.IniRead("Answer", "Register", "<@>欢迎上舰,这是你的初始资源(<#>)水晶", path);
            textBox_AnsMutiRegister.Text = INIhelper.IniRead("Answer", "MutiRegister", "重复注册是不行的哦", path);
            textBox_AnsSign1.Text        = INIhelper.IniRead("Answer", "Sign1", "大姐你回来了,天气这么好一起多逛逛吧", path);
            textBox_AnsSign2.Text        = INIhelper.IniRead("Answer", "Sign2", "<@>这是你今天清扫甲板的报酬,拿好(<#>水晶)", path);
            textBox_AnsMutiSign.Text     = INIhelper.IniRead("Answer", "MutiSign", "今天的甲板挺亮的,擦一遍就行了", path);
            textBox_AnsQueryDiamond.Text = INIhelper.IniRead("Answer", "QueryDiamond", "<@>你手头还有<#>水晶", path);
            textBox_AnsNoReg.Text        = INIhelper.IniRead("Answer", "NoReg", "<@>不是清洁工吧?来输入#抽卡注册 来上舰", path);
            textBox_AnsLowDiamond.Text   = INIhelper.IniRead("Answer", "LowDiamond", "<@>水晶不足,无法进行抽卡,你还剩余<#>水晶", path);
            IniObject iObject = IniObject.Load(path, Encoding.Unicode);     // 从指定的文件中读取 Ini 配置项, 参数1: 文件路径, 参数2: 编码格式 [默认: ANSI]

            try
            {
                IniValue value1 = iObject["Answer"]["Help"];
                textBox_AnsHelp.Text = value1.ToString();
            }
            catch
            {
                textBox_AnsHelp.Text = "";
            }
            if (textBox_AnsHelp.Text == "")
            {
                textBox_AnsHelp.Text = @"水银抽卡人 给你抽卡的自信(~ ̄▽ ̄)~ \n合成图片以及发送图片需要一些时间,请耐心等待\n单抽是没有保底的\n#抽卡注册\n#我的水晶\n#打扫甲板(签到)\n#甲板积灰(重置签到,管理员限定)\n#获取池子\n\n#精准单抽\n#扩充单抽\n#精准十连\n#扩充十连";
            }
            textBox_SignReset1.Text = INIhelper.IniRead("Answer", "Reset1", "贝贝龙来甲板找女王♂van,把甲板弄脏了,大家又得打扫一遍", path);
            textBox_SignReset2.Text = INIhelper.IniRead("Answer", "Reset2", "草履虫非要给鸭子做饭,厨房爆炸了,黑紫色的东西撒了一甲板,把甲板弄脏了,大家又得打扫一遍", path);
            textBox_SignReset3.Text = INIhelper.IniRead("Answer", "Reset3", "你和女武神们被从深渊扔了回来,来自深渊的炉灰把甲板弄脏了,大家又得打扫一遍", path);
            textBox_SignReset4.Text = INIhelper.IniRead("Answer", "Reset4", "由于神秘东方村庄的诅咒,你抽卡的泪水把甲板弄脏了,大家又得打扫一遍", path);
            textBox_SignReset5.Text = INIhelper.IniRead("Answer", "Reset5", "理律疯狂在甲板上逮虾户,把甲板弄脏了,大家又得打扫一遍", path);
            textBox_SignReset6.Text = INIhelper.IniRead("Answer", "Reset6", "希儿到处找不到鸭子,里人格暴走,把甲板弄脏了,大家又得打扫一遍", path);

            textBox_ResisterMin.Text = INIhelper.IniRead("GetDiamond", "RegisterMin", "0", path);
            textBox_RegisterMax.Text = INIhelper.IniRead("GetDiamond", "RegisterMax", "14000", path);
            textBox_SignMin.Text     = INIhelper.IniRead("GetDiamond", "SignMin", "0", path);
            textBox_SignMax.Text     = INIhelper.IniRead("GetDiamond", "SignMax", "14000", path);
        }
コード例 #8
0
        private void ImportGroupList_Load(object sender, EventArgs e)
        {
            cq = CQSave.cq_menu;

            List <Native.Sdk.Cqp.Model.GroupInfo> ls = cq.CQApi.GetGroupList();

            foreach (var item in ls)
            {
                dataGridView1.Rows.Add(item.Group.Id, item.Name.ToString());
            }
            Label_Status.Text = "就绪     |";
            Label_Text.Text   = $"已载入{ls.Count}个群...       ";

            int count = Convert.ToInt32(INIhelper.IniRead("群控", "Count", "0", cq.CQApi.AppDirectory + "\\Config.ini"));

            for (int i = 0; i < count; i++)
            {
                listBox_Group.Items.Add(INIhelper.IniRead("群控", $"Item{i}", "0", cq.CQApi.AppDirectory + "\\Config.ini"));
            }
            label_Count.Text = $"计数:{listBox_Group.Items.Count}个";
        }
コード例 #9
0
ファイル: Gacha.cs プロジェクト: RyanFu/BH3rdGachaSimulator
        public void Read_Jingzhun()
        {
            string path = $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt";

            Probablity_Weapon4Total   = Convert.ToDouble(INIhelper.IniRead("综合概率", "4星武器", "4.958", path).Replace("%", ""));
            Probablity_Stigmata4Total = Convert.ToDouble(INIhelper.IniRead("综合概率", "4星圣痕", "7.437", path).Replace("%", ""));
            Probablity_Weapon3Total   = Convert.ToDouble(INIhelper.IniRead("综合概率", "3星武器", "11.231", path).Replace("%", ""));
            Probablity_Stigmata3Total = Convert.ToDouble(INIhelper.IniRead("综合概率", "3星圣痕", "33.694", path).Replace("%", ""));
            Probablity_JZ通用进化材料       = Convert.ToDouble(INIhelper.IniRead("综合概率", "通用进化材料", "17.072", path).Replace("%", ""));
            Probablity_JZ装备经验         = Convert.ToDouble(INIhelper.IniRead("综合概率", "装备经验", "17.072", path).Replace("%", ""));
            Probablity_JZGold         = Convert.ToDouble(INIhelper.IniRead("综合概率", "金币", "8.536", path).Replace("%", ""));

            Probablity_JZUpWeapon4    = Convert.ToDouble(INIhelper.IniRead("详细概率", "Up武器", "2.479", path).Replace("%", ""));
            Probablity_JZUpStigmata4  = Convert.ToDouble(INIhelper.IniRead("详细概率", "Up圣痕单件", "1.240", path).Replace("%", ""));
            Probablity_JZWeapon4      = Convert.ToDouble(INIhelper.IniRead("详细概率", "四星武器", "0.413", path).Replace("%", ""));
            Probablity_JZStigmata4    = Convert.ToDouble(INIhelper.IniRead("详细概率", "四星圣痕单件", "0.310", path).Replace("%", ""));
            Probablity_Weapon3        = Convert.ToDouble(INIhelper.IniRead("详细概率", "三星武器", "0.511", path).Replace("%", ""));
            Probablity_Stigmata3      = Convert.ToDouble(INIhelper.IniRead("详细概率", "三星圣痕单件", "0.936", path).Replace("%", ""));
            Probablity_Material镜面     = Convert.ToDouble(INIhelper.IniRead("详细概率", "镜面", "6.828", path).Replace("%", ""));
            Probablity_Material反应炉    = Convert.ToDouble(INIhelper.IniRead("详细概率", "反应炉", "10.242", path).Replace("%", ""));
            Probablity_Material紫色经验材料 = Convert.ToDouble(INIhelper.IniRead("详细概率", "紫色经验材料", "8.536", path).Replace("%", ""));
            Probablity_Material蓝色经验材料 = Convert.ToDouble(INIhelper.IniRead("详细概率", "蓝色经验材料", "8.536", path).Replace("%", ""));
            Probablity_Material吼咪宝藏   = Convert.ToDouble(INIhelper.IniRead("详细概率", "吼咪宝藏", "1.707", path).Replace("%", ""));
            Probablity_Material吼美宝藏   = Convert.ToDouble(INIhelper.IniRead("详细概率", "吼美宝藏", "2.561", path).Replace("%", ""));
            Probablity_Material吼姆宝藏   = Convert.ToDouble(INIhelper.IniRead("详细概率", "吼姆宝藏", "4.267", path).Replace("%", ""));

            Text_UpWeapon   = INIhelper.IniRead("详情", "UpWeapon", "Up四星武器", path);
            Text_UpStigmata = INIhelper.IniRead("详情", "UpStigmata", "Up四星圣痕", path);
            Text_Weapon1    = INIhelper.IniRead("详情", "Weapon_Item0", "四星武器1", path);
            Text_Weapon2    = INIhelper.IniRead("详情", "Weapon_Item1", "四星武器2", path);
            Text_Weapon3    = INIhelper.IniRead("详情", "Weapon_Item2", "四星武器3", path);
            Text_Weapon4    = INIhelper.IniRead("详情", "Weapon_Item3", "四星武器4", path);
            Text_Weapon5    = INIhelper.IniRead("详情", "Weapon_Item4", "四星武器5", path);
            Text_Weapon6    = INIhelper.IniRead("详情", "Weapon_Item5", "四星武器6", path);
            Text_Stigmata1  = INIhelper.IniRead("详情", "Stigmata_Item0", "四星圣痕1", path);
            Text_Stigmata2  = INIhelper.IniRead("详情", "Stigmata_Item1", "四星圣痕2", path);
            Text_Stigmata3  = INIhelper.IniRead("详情", "Stigmata_Item2", "四星圣痕3", path);
            Text_Stigmata4  = INIhelper.IniRead("详情", "Stigmata_Item3", "四星圣痕4", path);
        }
コード例 #10
0
ファイル: Gacha.cs プロジェクト: RyanFu/BH3rdGachaSimulator
        public GachaResult JZ_GachaMain()
        {
            Random rd    = new Random(GetRandomSeed());
            double pro_1 = rd.Next(0, 10000000) / (double)100000;

            Count_JZ++;
            GachaResult gr = new GachaResult();

            if (Count_JZ < 10)
            {
                if (pro_1 < Probablity_Weapon4Total)
                {
                    GetTargetItem = true;
                    Count_JZ      = 0;
                    double pro_2 = rd.Next(0, Convert.ToInt32((Probablity_Weapon4Total) * 100000)) / (double)100000;
                    if (pro_2 < Probablity_JZUpWeapon4)
                    {
                        gr.name       = Text_UpWeapon;;
                        gr.value      = 28000;
                        gr.count      = 1;
                        gr.level      = 10;
                        gr.type       = TypeS.Weapon.ToString();
                        gr.quality    = 2;
                        gr.evaluation = 4;
                        return(gr);
                    }
                    else
                    {
                        double pro_3 = rd.Next(0, 6);
                        gr.value      = 27000;
                        gr.count      = 1;
                        gr.level      = 1;
                        gr.type       = TypeS.Weapon.ToString();
                        gr.quality    = 2;
                        gr.evaluation = 4;

                        switch (pro_3)
                        {
                        case 0:
                            gr.name = Text_Weapon1;
                            break;

                        case 1:
                            gr.name = Text_Weapon2;
                            break;

                        case 2:
                            gr.name = Text_Weapon3;
                            break;

                        case 3:
                            gr.name = Text_Weapon4;
                            break;

                        case 4:
                            gr.name = Text_Weapon5;
                            break;

                        case 5:
                            gr.name = Text_Weapon6;
                            break;
                        }
                        return(gr);
                    }
                }
                else if (pro_1 < Probablity_Stigmata4Total + Probablity_Weapon4Total)
                {
                    GetTargetItem = true;
                    Count_JZ      = 0;
                    rd            = new Random(GetRandomSeed());
                    double pro_2 = rd.Next(0, Convert.ToInt32((Probablity_JZUpStigmata4 + Probablity_JZStigmata4) * 100000)) / (double)100000;
                    if (pro_2 < Probablity_JZUpStigmata4)
                    {
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = Text_UpStigmata + "上";
                            break;

                        case 1:
                            gr.name = Text_UpStigmata + "中";
                            break;

                        case 2:
                            gr.name = Text_UpStigmata + "下";
                            break;
                        }
                        gr.value      = 2800;
                        gr.count      = 1;
                        gr.type       = TypeS.Stigmata.ToString();
                        gr.level      = 10;
                        gr.quality    = 2;
                        gr.evaluation = 4;

                        return(gr);
                    }
                    else
                    {
                        string temp = "";
                        switch (rd.Next(0, 4))
                        {
                        case 0:
                            temp = Text_Stigmata1;
                            break;

                        case 1:
                            temp = Text_Stigmata2;
                            break;

                        case 2:
                            temp = Text_Stigmata3;
                            break;

                        case 3:
                            temp = Text_Stigmata4;
                            break;
                        }
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = temp + "上";
                            break;

                        case 1:
                            gr.name = temp + "中";
                            break;

                        case 2:
                            gr.name = temp + "下";
                            break;
                        }
                        gr.value      = 2700;
                        gr.count      = 1;
                        gr.type       = TypeS.Stigmata.ToString();
                        gr.level      = 1;
                        gr.quality    = 2;
                        gr.evaluation = 4;

                        return(gr);
                    }
                }
                else if (pro_1 < Probablity_Weapon3Total + Probablity_Weapon4Total + Probablity_Stigmata4Total)
                {
                    int count = Convert.ToInt32(INIhelper.IniRead("详情", "Count_Weapon3", "0", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt"));
                    gr.name       = INIhelper.IniRead("详情", $"Weapon3_Item{rd.Next(0, count)}", "3星武器", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                    gr.count      = 1;
                    gr.type       = TypeS.Weapon.ToString();
                    gr.value      = 26000;
                    gr.level      = 1;
                    gr.quality    = 1;
                    gr.evaluation = 3;

                    return(gr);
                }
                else if (pro_1 < Probablity_Stigmata3Total + Probablity_Weapon3Total + Probablity_Weapon4Total + Probablity_Stigmata4Total)
                {
                    int count = Convert.ToInt32(INIhelper.IniRead("详情", "Count_Stigmata3", "0", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt"));
                    gr.name = INIhelper.IniRead("详情", $"Stigmata3_Item{rd.Next(0, count)}", "3星圣痕", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                    switch (rd.Next(0, 3))
                    {
                    case 0:
                        gr.name += "上";
                        break;

                    case 1:
                        gr.name += "中";
                        break;

                    case 2:
                        gr.name += "下";
                        break;
                    }
                    gr.count      = 1;
                    gr.type       = TypeS.Stigmata.ToString();
                    gr.value      = 2600;
                    gr.level      = 1;
                    gr.quality    = 1;
                    gr.evaluation = 3;

                    return(gr);
                }
                else
                {
                    double pro_0 = rd.Next(0, 10000) / (double)100;
                    if (pro_0 <= 50)
                    {
                        int count = Convert.ToInt32(INIhelper.IniRead("详情", "Count_Weapon2", "0", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt"));
                        gr.name       = INIhelper.IniRead("详情", $"Weapon2_Item{rd.Next(0, count)}", "2星武器", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                        gr.value      = 25000;
                        gr.count      = 1;
                        gr.type       = TypeS.Weapon.ToString();
                        gr.level      = 1;
                        gr.quality    = 1;
                        gr.evaluation = 2;

                        return(gr);
                    }
                    else
                    {
                        int count = Convert.ToInt32(INIhelper.IniRead("详情", "Count_Stigmata2", "0", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt"));
                        gr.name = INIhelper.IniRead("详情", $"Stigmata2_Item{rd.Next(0, count)}", "2星圣痕", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name += "上";
                            break;

                        case 1:
                            gr.name += "中";
                            break;

                        case 2:
                            gr.name += "下";
                            break;
                        }
                        gr.value      = 2500;
                        gr.count      = 1;
                        gr.type       = TypeS.Stigmata.ToString();
                        gr.level      = 1;
                        gr.quality    = 1;
                        gr.evaluation = 2;

                        return(gr);
                    }
                }
            }
            else
            {
                Count_JZ      = 0;
                GetTargetItem = false;
                double pro_0 = rd.Next(0, Convert.ToInt32((Probablity_Weapon4Total + Probablity_Stigmata4Total) * 1000000)) / (double)1000000;
                if (pro_0 < Probablity_Weapon4Total)
                {
                    double pro_2 = rd.Next(0, Convert.ToInt32((Probablity_Weapon4Total) * 1000000)) / (double)1000000;
                    if (pro_2 < Probablity_JZUpWeapon4)
                    {
                        gr.name       = Text_UpWeapon;;
                        gr.value      = 28000;
                        gr.count      = 1;
                        gr.type       = TypeS.Weapon.ToString();
                        gr.level      = 10;
                        gr.quality    = 2;
                        gr.evaluation = 4;

                        return(gr);
                    }
                    else
                    {
                        double pro_3 = rd.Next(0, 6);
                        gr.value      = 27000;
                        gr.count      = 1;
                        gr.type       = TypeS.Weapon.ToString();
                        gr.level      = 1;
                        gr.quality    = 2;
                        gr.evaluation = 4;

                        switch (pro_3)
                        {
                        case 0:
                            gr.name = Text_Weapon1;
                            break;

                        case 1:
                            gr.name = Text_Weapon2;
                            break;

                        case 2:
                            gr.name = Text_Weapon3;
                            break;

                        case 3:
                            gr.name = Text_Weapon4;
                            break;

                        case 4:
                            gr.name = Text_Weapon5;
                            break;

                        case 5:
                            gr.name = Text_Weapon6;
                            break;
                        }
                        return(gr);
                    }
                }
                else
                {
                    if (rd.Next(0, Convert.ToInt32((Probablity_Stigmata4Total) * 1000000)) / (double)1000000 < Probablity_JZUpWeapon4)
                    {
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = Text_UpStigmata + "上";
                            break;

                        case 1:
                            gr.name = Text_UpStigmata + "中";
                            break;

                        case 2:
                            gr.name = Text_UpStigmata + "下";
                            break;
                        }
                        gr.value      = 20000;
                        gr.count      = 1;
                        gr.type       = TypeS.Stigmata.ToString();
                        gr.level      = 10;
                        gr.quality    = 2;
                        gr.evaluation = 4;

                        return(gr);
                    }
                    else
                    {
                        string temp = "";
                        switch (rd.Next(0, 4))
                        {
                        case 0:
                            temp = Text_Stigmata1;
                            break;

                        case 1:
                            temp = Text_Stigmata2;
                            break;

                        case 2:
                            temp = Text_Stigmata3;
                            break;

                        case 3:
                            temp = Text_Stigmata4;
                            break;
                        }
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = temp + "上";
                            break;

                        case 1:
                            gr.name = temp + "中";
                            break;

                        case 2:
                            gr.name = temp + "下";
                            break;
                        }
                        gr.value      = 19000;
                        gr.count      = 1;
                        gr.type       = TypeS.Stigmata.ToString();
                        gr.level      = 1;
                        gr.quality    = 2;
                        gr.evaluation = 4;

                        return(gr);
                    }
                }
            }
        }
コード例 #11
0
ファイル: Gacha.cs プロジェクト: RyanFu/BH3rdGachaSimulator
        public GachaResult KC_GachaSub()
        {
            GachaResult gr    = new GachaResult();
            Random      rd    = new Random(GetRandomSeed());
            double      pro_2 = rd.Next(0, 100000) / (double)1000;

            if (pro_2 < Probablity_Material技能材料)
            {
                gr.name       = "高级技能材料";
                gr.value      = 1000;
                gr.count      = rd.Next(2, 4);
                gr.type       = TypeS.Material.ToString();
                gr.quality    = 2;
                gr.evaluation = 4;
                return(gr);
            }
            else if (pro_2 < Probablity_Material反应炉 + Probablity_Material技能材料)
            {
                gr.name       = "超小型反应炉";
                gr.value      = 800;
                gr.count      = rd.Next(2, 4);
                gr.type       = TypeS.Material.ToString();
                gr.quality    = 1;
                gr.evaluation = 3;

                return(gr);
            }
            else if (pro_2 < Probablity_Material紫色角色经验 + Probablity_Material反应炉 + Probablity_Material技能材料)
            {
                double pro_4 = rd.NextDouble();
                if (pro_4 <= 0.33)
                {
                    gr.name       = "特级学习材料";
                    gr.value      = 900;
                    gr.count      = rd.Next(3, 6);
                    gr.type       = TypeS.Material.ToString();
                    gr.quality    = 2;
                    gr.evaluation = 4;

                    return(gr);
                }
                else
                {
                    gr.name       = "高级学习材料";
                    gr.value      = 800;
                    gr.count      = rd.Next(3, 6);
                    gr.type       = TypeS.Material.ToString();
                    gr.quality    = 1;
                    gr.evaluation = 3;

                    return(gr);
                }
            }
            else if (pro_2 < Probablity_Material吼咪宝藏 + Probablity_Material紫色角色经验 + Probablity_Material反应炉 + Probablity_Material技能材料)
            {
                gr.name       = "吼咪宝藏";
                gr.value      = 700;
                gr.count      = 1;
                gr.type       = TypeS.Material.ToString();
                gr.quality    = 2;
                gr.evaluation = 4;

                return(gr);
            }
            else if (pro_2 < Probablity_Material吼美宝藏 + Probablity_Material吼咪宝藏 + Probablity_Material紫色角色经验 + Probablity_Material反应炉 + Probablity_Material技能材料)
            {
                gr.name       = "吼美宝藏";
                gr.value      = 600;
                gr.count      = 1;
                gr.type       = TypeS.Material.ToString();
                gr.quality    = 2;
                gr.evaluation = 4;

                return(gr);
            }
            else if (pro_2 < Probablity_Material吼姆宝藏 + Probablity_Material吼美宝藏 + Probablity_Material吼咪宝藏 + Probablity_Material紫色角色经验 + Probablity_Material反应炉 + Probablity_Material技能材料)
            {
                gr.name       = "吼里宝藏";
                gr.value      = 500;
                gr.count      = 1;
                gr.type       = TypeS.Material.ToString();
                gr.quality    = 1;
                gr.evaluation = 3;
                return(gr);
            }
            else
            {
                double pro_0 = rd.Next(0, 10000) / (double)100;
                if (pro_0 <= 50)
                {
                    int count = Convert.ToInt32(INIhelper.IniRead("详情", "Count_Weapon2", "0", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt"));
                    gr.name       = INIhelper.IniRead("详情", $"Weapon2_Item{rd.Next(0, count)}", "2星武器", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                    gr.value      = 2500;
                    gr.count      = 1;
                    gr.type       = TypeS.Weapon.ToString();
                    gr.level      = 1;
                    gr.quality    = 1;
                    gr.evaluation = 2;

                    return(gr);
                }
                else
                {
                    int count = Convert.ToInt32(INIhelper.IniRead("详情", "Count_Stigmata2", "0", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt"));
                    gr.name = INIhelper.IniRead("详情", $"Stigmata2_Item{rd.Next(0, count)}", "2星圣痕", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                    switch (rd.Next(0, 3))
                    {
                    case 0:
                        gr.name += "上";
                        break;

                    case 1:
                        gr.name += "中";
                        break;

                    case 2:
                        gr.name += "下";
                        break;
                    }
                    gr.value      = 2400;
                    gr.count      = 1;
                    gr.type       = TypeS.Stigmata.ToString();
                    gr.level      = 1;
                    gr.quality    = 1;
                    gr.evaluation = 2;

                    return(gr);
                }
            }
        }
コード例 #12
0
        public Image GenerateCard(int fullstar, int emptystar, Gacha.GachaResult gr)
        {
            Image background = (gr.quality == 1) ? Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\框蓝.png") : Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\框.png");
            Image main       = null;

            try
            {
                switch (gr.type)
                {
                case "Character":
                    main       = Image.FromFile($@"{CQSave.AppDirectory}装备卡\角色卡\{gr.name}.png");
                    background = CombinImage(background, main, 5, 14, 196, 172);
                    break;

                case "debri":
                    main       = Image.FromFile($@"{CQSave.AppDirectory}装备卡\碎片\{gr.name}.png");
                    background = CombinImage(background, main, 5, 14, 196, 172);
                    break;

                case "Stigmata":
                    main       = Image.FromFile($@"{CQSave.AppDirectory}装备卡\圣痕卡\{gr.name}.png");
                    background = CombinImage(background, main, 5, 14, 196, 172);

                    break;

                case "Material":
                    main       = Image.FromFile($@"{CQSave.AppDirectory}装备卡\材料\{gr.name}.png");
                    background = CombinImage(background, main, 26, 17, 178, 170);
                    break;

                case "Weapon":
                    main       = Image.FromFile($@"{CQSave.AppDirectory}装备卡\武器\{gr.name}.png");
                    background = CombinImage(background, main, 5, 14, 196, 172);
                    break;
                }
            }
            catch
            {
                main       = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\ItemEmpty #1004496.png");
                background = CombinImage(background, main, 48, 13, 119, 172);
                long controlgroup = Convert.ToInt64(INIhelper.IniRead("后台群", "Id", "0", CQSave.AppDirectory + "Config.ini"));
                if (controlgroup != 0)
                {
                    cq.CQApi.SendGroupMessage(controlgroup, $"发现图片缺失,请排查是否为命名错误 type={gr.type} name={gr.name}");
                }
            }

            if (gr.type == 抽卡.TypeS.Character.ToString())
            {
                Image img = null;
                switch (gr.class_)
                {
                case "SSS":
                    img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Star_Avatar_5M.png");
                    break;

                case "SS":
                    img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Star_Avatar_4M.png");
                    break;

                case "S":
                    img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Star_Avatar_3M.png");
                    break;

                case "A":
                    img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Star_Avatar_2M.png");
                    break;

                case "B":
                    img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Star_Avatar_1M.png");
                    break;
                }
                //Image img = Image.FromFile((gr.class_ == "S") ? $@"{CQSave.AppDirectory}装备卡\框\Star_Avatar_3M.png" : $@"{CQSave.AppDirectory}装备卡\框\Star_Avatar_2M.png");
                background = CombinImage(background, img, 53, 160, 106, 91);
                return(background);
            }
            if (gr.type == 抽卡.TypeS.Material.ToString() || gr.type == 抽卡.TypeS.debri.ToString())
            {
                //Point p = new Point(106, 225);
                Point p     = new Point((gr.count.ToString().Length == 1) ? 88 : 85, 225);
                Font  font  = new Font("Impact", 25F);
                Color color = Color.FromArgb(67, 67, 67);
                background = AddSlimText2Image(background, "×", p, font, color, 0);
                p          = new Point((gr.count.ToString().Length == 1) ? 106 : 108, 228);
                font       = new Font("方正兰亭粗黑_GBK", 25F);
                background = AddSlimText2Image(background, $"{gr.count}", p, font, color, 0);
            }
            else
            {
                Point p     = new Point((gr.level.ToString().Length == 1) ? 94 : 92, 225);
                Font  font  = new Font("Impact", 25F);
                Color color = Color.FromArgb(67, 67, 67);
                background = AddText2Image(background, "Lv.", p, font, color, 0);
                p          = new Point((gr.level.ToString().Length == 1) ? 113 : 117, 228);
                font       = new Font("方正兰亭粗黑_GBK", 25F);
                background = AddSlimText2Image(background, $"{gr.level}", p, font, color, 0);
            }
            string str = "";

            for (int i = 0; i < fullstar; i++)
            {
                str += "1";
            }
            for (int i = 0; i < emptystar; i++)
            {
                str += "0";
            }
            if (gr.type == 抽卡.TypeS.debri.ToString())
            {
                return(background);
            }
            char[] ch   = str.ToCharArray();
            int    trap = 26;

            if (str.Length % 2 == 0)
            {
                int   x = 103 - (str.Length / 2) * trap; int y = 171;
                Image img = null;
                for (int i = 0; i < str.Length; i++)
                {
                    if (ch[i] == '1')
                    {
                        img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\StarBig #1916506.png");
                    }
                    else
                    {
                        img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\StarBigGray.png");
                    }
                    background = CombinImage(background, img, x, y, 33, 33);
                    x         += trap;
                }
            }
            else
            {
                int   x = 90 - (str.Length / 2) * trap; int y = 171;
                Image img = null;
                for (int i = 0; i < str.Length; i++)
                {
                    if (ch[i] == '1')
                    {
                        img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\StarBig #1916506.png");
                    }
                    else
                    {
                        img = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\StarBigGray.png");
                    }
                    background = CombinImage(background, img, x, y, 33, 33);
                    x         += trap;
                }
            }
            return(background);
        }
コード例 #13
0
        /// <summary>
        /// 合成子模块
        /// </summary>
        /// <param name="ls">抽卡结果数组</param>
        /// <param name="region">来源:0 扩充,1 精准,2标配</param>
        /// <param name="JZPos">精准池来源:1 A池,2 B池</param>
        /// <param name="count">单抽与十连</param>
        /// <param name="Diamond">水晶数目</param>
        /// <returns></returns>
        public string Gacha(List <Gacha.GachaResult> ls, int region, int JZPos, int count, int Diamond)
        {
            try
            {
                int x, y;
                x = 160;
                y = 190;
                Image  background = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\抽卡背景.png");
                Image  img = null;
                Random rd = new Random();
                long   temp1, temp2;
                if (cq != null)
                {
                    temp1 = cq.FromGroup.Id;
                    temp2 = cq.FromQQ.Id;
                }
                else
                {
                    temp1 = -1;
                    temp2 = CQSave.cq_private.FromQQ.Id;
                }
                ls = ItemExistInRepositories(ls, temp1, temp2);
                foreach (var item in ls)
                {
                    img        = GenerateCard(item.evaluation, 1, item);
                    background = CombinImage(background, img, x, y, -1, false);
                    //x + 133,y - 17
                    if (item.isnew)
                    {
                        img        = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\New!.png");
                        background = CombinImage(background, img, x + 133, y - 17, img.Width, img.Height);
                    }
                    if (item.type == 抽卡.TypeS.Stigmata.ToString())
                    {
                        switch (item.name.Substring(item.name.Length - 1))
                        {
                        case "上":
                            img        = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Stigmata1.png");
                            background = CombinImage(background, img, x - 18, y - 18, 65, 65);
                            break;

                        case "中":
                            img        = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Stigmata2.png");
                            background = CombinImage(background, img, x - 18, y - 18, 65, 65);
                            break;

                        case "下":
                            img        = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\Stigmata3.png");
                            background = CombinImage(background, img, x - 18, y - 18, 65, 65);
                            break;
                        }
                    }
                    if (x < 1960)
                    {
                        x += 300;
                    }
                    else
                    {
                        if (y == 190)
                        {
                            x = 160;
                            y = 530;
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                int   money = rd.Next(100000, 100000000);
                Image img_1 = Money(money);
                Width_Gold = 1620 + (164 - img_1.Width) / 2;
                background = CombinImage(background, img_1, Width_Gold, Height_1, -1, false);
                //int Diamond = rd.Next(0, 30000);
                Image img_2 = diamond(Diamond);
                Width_Diamond = 1975 + (111 - img_2.Width) / 2;
                background    = CombinImage(background, img_2, Width_Diamond, Height_1, -1, false);
                int   ap_Max = rd.Next(154, 165);
                int   ap     = rd.Next(0, ap_Max);
                Image img_3  = AP(ap, ap_Max);
                Width_AP   = 1319 + (127 - img_3.Width) / 2;
                background = CombinImage(background, img_3, Width_AP, Height_1, -1, false);
                string name = GetDate();
                switch (region)
                {
                case 0:
                    if (count == 1)
                    {
                        img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\扩充单抽.png");
                    }
                    else
                    {
                        img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\扩充十连.png");
                    }
                    background = CombinImage(background, img_3, 126, 960, -1, false);
                    break;

                case 1:
                    switch (JZPos)
                    {
                    case 1:
                        if (count == 1)
                        {
                            img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\精准A单抽.png");
                        }
                        else
                        {
                            img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\精准A十连.png");
                        }
                        break;

                    case 2:
                        if (count == 2)
                        {
                            img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\精准B单抽.png");
                        }
                        else
                        {
                            img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\精准B十连.png");
                        }
                        break;
                    }
                    background = CombinImage(background, img_3, 126, 960, -1, false);
                    break;

                case 2:
                    if (count == 1)
                    {
                        img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\标配单抽.png");
                    }
                    else
                    {
                        img_3 = Image.FromFile($@"{CQSave.AppDirectory}装备卡\框\标配十连.png");
                    }
                    background = CombinImage(background, img_3, 126, 960, -1, false);
                    break;
                }
                if (!Directory.Exists($@"{CQSave.ImageDirectory}\装备结果"))
                {
                    Directory.CreateDirectory($@"{CQSave.ImageDirectory}\装备结果");
                }
                Point p     = new Point(1471, 813);
                Font  font  = new Font("汉仪丫丫体简", 15F);
                Color color = Color.FromArgb(0, 0, 0);
                background = AddText2Image(background, "Powered by @水银之翼", p, font, color, 0);
                if (INIhelper.IniRead("ExtraConfig", "ImageFormat", "jpg", CQSave.AppDirectory + "Config.ini") == "jpg")
                {
                    if (!Directory.Exists($@"{CQSave.ImageDirectory}\装备结果"))
                    {
                        Directory.CreateDirectory($@"{CQSave.ImageDirectory}\装备结果");
                    }
                    //cq.CQLog.Info($@"{GetAppImageDirectory(CQSave.AppDirectory)}\装备结果\{name}.jpg");
                    background.Save($@"{CQSave.ImageDirectory}\装备结果\{name}.jpg", ImageFormat.Jpeg);
                    background.Dispose();
                    img.Dispose();
                    img_1.Dispose();
                    img_2.Dispose();
                    img_3.Dispose();
                    return($"装备结果\\{name}.jpg");
                }
                else
                {
                    if (!Directory.Exists($@"{CQSave.ImageDirectory}\装备结果"))
                    {
                        Directory.CreateDirectory($@"{CQSave.ImageDirectory}\装备结果");
                    }
                    //cq.CQLog.Info($@"{GetAppImageDirectory(CQSave.AppDirectory)}\装备结果\{name}.jpg");
                    background.Save($@"{CQSave.ImageDirectory}\装备结果\{name}.png");
                    background.Dispose();
                    img.Dispose();
                    img_1.Dispose();
                    img_2.Dispose();
                    img_3.Dispose();
                    return($"装备结果\\{name}.png");
                }
            }
            catch (Exception e)
            {
                cq.CQLog.Error($"图片合成错误,错误信息{e.Message}");
                return(null);
            }
        }
コード例 #14
0
        public GachaResult JZ_GachaMain()
        {
            Random rd = new Random(GetRandomSeed());
            //初始概率1 初始值0-100.00000
            double pro_1 = rd.Next(0, 10000000) / (double)100000;

            Count_JZ++;
            GachaResult gr = new GachaResult();

            //保底标志为false且保底次数小于10
            if (Count_JZ < 10)
            {
                //概率1命中四星武器
                if (pro_1 < Probablity_Weapon4Total)
                {
                    //保底标志为真 保底次数归零
                    GetTargetItem = true;
                    Count_JZ      = 0;
                    rd            = new Random(GetRandomSeed());
                    //初始概率2 初始值0-四星武器概率(4.95800)
                    double pro_2 = rd.Next(0, Convert.ToInt32((Probablity_Weapon4Total) * 100000)) / (double)100000;
                    //概率2命中up武器(2.479)
                    if (pro_2 < Probablity_JZUpWeapon4)
                    {
                        gr.name  = Text_UpWeapon;;
                        gr.value = 28000;
                        gr.count = 1;
                        gr.type  = TypeS.Weapon.ToString();
                        return(gr);
                    }
                    //概率2命中up外武器4.958-2.479=2.479 2.479/6=0.413
                    else
                    {
                        //概率3初始化
                        double pro_3 = rd.Next(0, 6);
                        gr.value = 27000;
                        gr.count = 1;
                        gr.type  = TypeS.Weapon.ToString();
                        switch (pro_3)
                        {
                        case 0:
                            gr.name = Text_Weapon1;
                            break;

                        case 1:
                            gr.name = Text_Weapon2;
                            break;

                        case 2:
                            gr.name = Text_Weapon3;
                            break;

                        case 3:
                            gr.name = Text_Weapon4;
                            break;

                        case 4:
                            gr.name = Text_Weapon5;
                            break;

                        case 5:
                            gr.name = Text_Weapon6;
                            break;
                        }
                        return(gr);
                    }
                }
                //概率1命中四星圣痕 7.437+4.958=12.395   4.958-12.395
                else if (pro_1 < Probablity_Stigmata4Total + Probablity_Weapon4Total)
                {
                    //保底标志为真 保底次数归零
                    GetTargetItem = true;
                    Count_JZ      = 0;
                    rd            = new Random(GetRandomSeed());
                    //概率2初始化 0-(1.24000+0.31000=1.55000)
                    double pro_2 = rd.Next(0, Convert.ToInt32((Probablity_JZUpStigmata4 + Probablity_JZStigmata4) * 100000)) / (double)100000;
                    //概率2命中Up圣痕单件(1.240) 1.240*3=3.72 7.437-3.72=3.717 3.717/12=0.30975
                    //与乘以三应该相同
                    if (pro_2 < Probablity_JZUpStigmata4)
                    {
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = Text_UpStigmata + " 上";
                            break;

                        case 1:
                            gr.name = Text_UpStigmata + " 中";
                            break;

                        case 2:
                            gr.name = Text_UpStigmata + " 下";
                            break;
                        }
                        gr.value = 2800;
                        gr.count = 1;
                        gr.type  = TypeS.Stigmata.ToString();
                        return(gr);
                    }
                    //概率2命中普通圣痕单件(0.310)
                    else
                    {
                        string temp = "";
                        switch (rd.Next(0, 4))
                        {
                        case 0:
                            temp = Text_Stigmata1;
                            break;

                        case 1:
                            temp = Text_Stigmata2;
                            break;

                        case 2:
                            temp = Text_Stigmata3;
                            break;

                        case 3:
                            temp = Text_Stigmata4;
                            break;
                        }
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = temp + " 上";
                            break;

                        case 1:
                            gr.name = temp + " 中";
                            break;

                        case 2:
                            gr.name = temp + " 下";
                            break;
                        }
                        gr.value = 2700;
                        gr.count = 1;
                        gr.type  = TypeS.Stigmata.ToString();
                        return(gr);
                    }
                }
                //概率1命中三星武器 4.958+7.437+11.231=23.626 12.395-23.626
                else if (pro_1 < Probablity_Weapon3Total + Probablity_Weapon4Total + Probablity_Stigmata4Total)
                {
                    gr.name  = INIhelper.IniRead("详情", $"Weapon3_Item{rd.Next(0, 18)}", "3星武器", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                    gr.count = 1;
                    gr.type  = TypeS.Weapon.ToString();
                    gr.value = 26000;
                    return(gr);
                }
                //概率1命中三星圣痕 4.958+7.437+11.231+33.694=57.32 23.626-57.32
                else if (pro_1 < Probablity_Stigmata3Total + Probablity_Weapon3Total + Probablity_Weapon4Total + Probablity_Stigmata4Total)
                {
                    gr.name = INIhelper.IniRead("详情", $"Stigmata3_Item{rd.Next(0, 12)}", "3星圣痕", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                    switch (rd.Next(0, 3))
                    {
                    case 0:
                        gr.name += "上";
                        break;

                    case 1:
                        gr.name += "中";
                        break;

                    case 2:
                        gr.name += "下";
                        break;
                    }
                    gr.count = 1;
                    gr.type  = TypeS.Stigmata.ToString();
                    gr.value = 2600;
                    return(gr);
                }
                //逻辑1命中二星装备与二星圣痕 4.958+7.437+11.231+33.694+17.072+17.072+8.536=100
                //感觉逻辑上没什么问题……
                else
                {
                    rd = new Random(GetRandomSeed());
                    double pro_0 = rd.Next(0, 10000) / (double)100;
                    if (pro_0 <= 50)
                    {
                        gr.name  = INIhelper.IniRead("详情", $"Weapon2_Item{rd.Next(0, 20)}", "2星武器", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                        gr.value = 25000;
                        gr.count = 1;
                        gr.type  = TypeS.Weapon.ToString();
                        return(gr);
                    }
                    else
                    {
                        gr.name = INIhelper.IniRead("详情", $"Stigmata2_Item{rd.Next(0, 5)}", "2星圣痕", $@"{cq.CQApi.AppDirectory}\概率\精准概率.txt");
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name += "上";
                            break;

                        case 1:
                            gr.name += "中";
                            break;

                        case 2:
                            gr.name += "下";
                            break;
                        }
                        gr.value = 2500;
                        gr.count = 1;
                        gr.type  = TypeS.Stigmata.ToString();
                        return(gr);
                    }
                }
            }
            //
            else
            {
                //保底
                Count_JZ      = 0;
                GetTargetItem = false;
                rd            = new Random(GetRandomSeed());
                //概率0初始化 0-(4星武器+4星圣痕)
                double pro_0 = rd.Next(0, Convert.ToInt32((Probablity_Weapon4Total + Probablity_Stigmata4Total) * 1000000)) / (double)1000000;
                //概率0命中四星武器
                if (pro_0 < Probablity_Weapon4Total)
                {
                    double pro_2 = rd.Next(0, Convert.ToInt32((Probablity_Weapon4Total) * 1000000)) / (double)1000000;
                    if (pro_2 < Probablity_JZUpWeapon4)
                    {
                        gr.name  = Text_UpWeapon;;
                        gr.value = 28000;
                        gr.count = 1;
                        gr.type  = TypeS.Weapon.ToString();
                        return(gr);
                    }
                    else
                    {
                        double pro_3 = rd.Next(0, 6);
                        gr.value = 27000;
                        gr.count = 1;
                        gr.type  = TypeS.Chararcter.ToString();
                        switch (pro_3)
                        {
                        case 0:
                            gr.name = Text_Weapon1;
                            break;

                        case 1:
                            gr.name = Text_Weapon2;
                            break;

                        case 2:
                            gr.name = Text_Weapon3;
                            break;

                        case 3:
                            gr.name = Text_Weapon4;
                            break;

                        case 4:
                            gr.name = Text_Weapon5;
                            break;

                        case 5:
                            gr.name = Text_Weapon6;
                            break;
                        }
                        return(gr);
                    }
                }
                else
                {
                    rd = new Random(GetRandomSeed());
                    if (rd.Next(0, Convert.ToInt32((Probablity_Stigmata4Total) * 1000000)) / (double)1000000 < Probablity_JZUpWeapon4 * 3)
                    {
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = Text_UpStigmata + " 上";
                            break;

                        case 1:
                            gr.name = Text_UpStigmata + " 中";
                            break;

                        case 2:
                            gr.name = Text_UpStigmata + " 下";
                            break;
                        }
                        gr.value = 20000;
                        gr.count = 1;
                        gr.type  = TypeS.Stigmata.ToString();
                        return(gr);
                    }
                    else
                    {
                        string temp = "";
                        switch (rd.Next(0, 4))
                        {
                        case 0:
                            temp = Text_Stigmata1;
                            break;

                        case 1:
                            temp = Text_Stigmata2;
                            break;

                        case 2:
                            temp = Text_Stigmata3;
                            break;

                        case 3:
                            temp = Text_Stigmata4;
                            break;
                        }
                        switch (rd.Next(0, 3))
                        {
                        case 0:
                            gr.name = temp + " 上";
                            break;

                        case 1:
                            gr.name = temp + " 中";
                            break;

                        case 2:
                            gr.name = temp + " 下";
                            break;
                        }
                        gr.value = 19000;
                        gr.count = 1;
                        gr.type  = TypeS.Stigmata.ToString();
                        return(gr);
                    }
                }
            }
        }
コード例 #15
0
        private void button_Save_Click(object sender, EventArgs e)
        {
            long admin = 0;

            try
            {
                if (!string.IsNullOrEmpty(textBox_Admin.Text))
                {
                    admin = Convert.ToInt64(textBox_Admin.Text);
                }
            }
            catch
            {
                MessageBox.Show("数字输入格式有误");
                return;
            }
            string path = cq.CQApi.AppDirectory + "\\Config.ini";

            if (listBox_Group.Items.Count == 0)
            {
                if (MessageBox.Show("当前没有群在配置中,是否继续保存?", "提示", MessageBoxButtons.YesNo) == DialogResult.Cancel)
                {
                    return;
                }
            }
            INIhelper.IniWrite("群控", "Count", listBox_Group.Items.Count.ToString(), path);
            for (int i = 0; i < listBox_Group.Items.Count; i++)
            {
                INIhelper.IniWrite("群控", $"Item{i}", listBox_Group.Items[i].ToString(), path);
            }
            if (!string.IsNullOrEmpty(textBox_Admin.Text))
            {
                foreach (var item in listBox_Group.Items)
                {
                    string groupid = item.ToString();
                    if (INIhelper.IniRead(groupid, "Count", "0", path) != "0")
                    {
                        if (checkBox_CoverSetting.Checked)
                        {
                            if (!string.IsNullOrEmpty(textBox_Admin.Text))
                            {
                                INIhelper.IniWrite(groupid, "Count", "1", path);
                                INIhelper.IniWrite(groupid, $"Index0", textBox_Admin.Text, path);
                            }
                            else
                            {
                                INIhelper.IniWrite(groupid, "Count", "0", path);
                            }
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(textBox_Admin.Text))
                        {
                            INIhelper.IniWrite(groupid, "Count", "1", path);
                            INIhelper.IniWrite(groupid, $"Index0", textBox_Admin.Text, path);
                        }
                        else
                        {
                            INIhelper.IniWrite(groupid, "Count", "0", path);
                        }
                    }
                }
            }
            MessageBox.Show("更改已保存");
        }