MediaWiki:Dbck.js:修订间差异

无编辑摘要
无编辑摘要
 
(未显示同一用户的19个中间版本)
第1行: 第1行:




// var percent_up_50 = 0.8;
// var percent_up_45 = 0.4;
// var percent_other_50 = 1.2;
// var percent_other_45 = 1.6;
// var percent_40 = 18;
// var percent_35 = 40;
// var percent_30 = 38;
var percent_up_50 = 0.8;
var percent_up_50 = 0.8;
var percent_up_45 = 0.4;
var percent_up_45 = 0.4;
var percent_other_50 = 0.6;
var percent_other_50 = 0.6;
var percent_other_45 = 1.4;
var percent_other_45 = 0.2;
var percent_other_2_50 = 0.6;
var percent_other_2_50 = 0.6;
var percent_other_2_45 = 0.2;
var percent_other_2_45 = 1.4;
var percent_40 = 96;
var percent_40 = 96;
var percent_35 = 0;
var percent_35 = 0;
第20行: 第13行:


var arr_star_3 = [
var arr_star_3 = [
{ name:'马努埃尔',img:"./role/3/UiTX_Ply_0064_J08_1024.png" ,star:3},
{ name:'马努埃尔',star:3},
{ name:'伊布林',img:"./role/3/UiTX_Ply_0063_J08_1024.png" ,star:3},
{ name:'伊布林',star:3},
{ name:'哈利',img:"./role/3/UiTX_Ply_0062_J08_1024.png" ,star:3},
{ name:'哈利',star:3},
{ name:'霍尔赫',img:"./role/3/UiTX_Ply_0061_J02_1024.png" ,star:3},
{ name:'霍尔赫',star:3},
{ name:'萨莉亚',img:"./role/3/UiTX_Ply_0060_J02_1024.png" ,star:3},
{ name:'萨莉亚',star:3},
{ name:'佩妮',img:"./role/3/UiTX_Ply_0059_J02_1024.png" ,star:3},
{ name:'佩妮',star:3},
{ name:'迪艾格',img:"./role/3/UiTX_Ply_0058_J03_1024.png" ,star:3},
{ name:'迪艾格',star:3},
{ name:'费丽妮',img:"./role/3/UiTX_Ply_0057_J03_1024.png" ,star:3},
{ name:'费丽妮',star:3},
{ name:'比利',img:"./role/3/UiTX_Ply_0056_J03_1024.png" ,star:3},
{ name:'比利',star:3},
{ name:'赫塞',img:"./role/3/UiTX_Ply_0055_J05_1024.png" ,star:3},
{ name:'赫塞',star:3},
{ name:'帕尔',img:"./role/3/UiTX_Ply_0054_J05_1024.png" ,star:3},
{ name:'帕尔',star:3},
{ name:'特利',img:"./role/3/UiTX_Ply_0053_J05_1024.png" ,star:3},
{ name:'特利',star:3},
{ name:'弗昂',img:"./role/3/UiTX_Ply_0052_J07_1024.png" ,star:3},
{ name:'弗昂',star:3},
{ name:'卡萝尔',img:"./role/3/UiTX_Ply_0051_J07_1024.png" ,star:3},
{ name:'卡萝尔',star:3},
{ name:'科妮',img:"./role/3/UiTX_Ply_0050_J07_1024.png" ,star:3},
{ name:'科妮',star:3},
{ name:'古提',img:"./role/3/UiTX_Ply_0049_J06_1024.png" ,star:3},
{ name:'古提',star:3},
{ name:'薇薇安',img:"./role/3/UiTX_Ply_0048_J06_1024.png" ,star:3},
{ name:'薇薇安',star:3},
{ name:'萨妮',img:"./role/3/UiTX_Ply_0047_J06_1024.png" ,star:3},
{ name:'萨妮',star:3},
{ name:'伍格',img:"./role/3/UiTX_Ply_0046_J01_1024.png" ,star:3},
{ name:'伍格',star:3},
{ name:'南娜',img:"./role/3/UiTX_Ply_0045_J01_1024.png" ,star:3},
{ name:'南娜',star:3},
{ name:'梅妮',img:"./role/3/UiTX_Ply_0044_J01_1024.png" ,star:3},
{ name:'梅妮',star:3},
{ name:'弗利欧',img:"./role/3/UiTX_Ply_0043_J04_1024.png" ,star:3},
{ name:'弗利欧',star:3},
{ name:'尤妮丝',img:"./role/3/UiTX_Ply_0042_J04_1024.png" ,star:3},
{ name:'尤妮丝',star:3},
{ name:'多利',img:"./role/3/UiTX_Ply_0041_J04_1024.png" ,star:3},
{ name:'多利',star:3},
];
];
var arr_star_4 = [
var arr_star_4 = [
{ name:'普利基特',img:"./role/4/UiTX_Ply_0090_J05_1024.png",star:4 },
{ name:'普利基特',star:4 },
{ name:'洛洛',img:"./role/4/UiTX_Ply_0110_J06_1024.png",star:4 },
{ name:'洛洛',star:4 },
{ name:'雪娜',img:"./role/4/UiTX_Ply_0120_J07_1024.png",star:4 },
{ name:'雪娜',star:4 },
{ name:'约伦',img:"./role/4/UiTX_Ply_0137_J01_1024.png",star:4 },
{ name:'约伦',star:4 },
{ name:'勒凡',img:"./role/4/UiTX_Ply_0104_J04_1024.png",star:4 },
{ name:'勒凡',star:4 },
{ name:'波拉',img:"./role/4/UiTX_Ply_0101_J08_1024.png",star:4 },
{ name:'波拉',star:4 },
{ name:'艾弗伦',img:"./role/4/UiTX_Ply_0115_J05_1024.png",star:4 },
{ name:'艾弗伦',star:4 },
{ name:'肯尼斯',img:"./role/4/UiTX_Ply_0119_J04_1024.png",star:4 },
{ name:'肯尼斯',star:4 },
{ name:'科尔尼利亚',img:"./role/4/UiTX_Ply_0065_J02_1024.png",star:4 },
{ name:'科尔尼利亚',star:4 },
{ name:'杜兰',img:"./role/4/UiTX_Ply_0096_J03_1024.png",star:4 },
{ name:'杜兰',star:4 },
{ name:'纳尔',img:"./role/4/UiTX_Ply_0095_J06_1024.png",star:4 },
{ name:'纳尔',star:4 },
{ name:'梅贝儿',img:"./role/4/UiTX_Ply_0039_J08_1024.png",star:4 },
{ name:'梅贝儿',star:4 },
{ name:'伊利斯',img:"./role/4/UiTX_Ply_0038_J08_1024.png",star:4 },
{ name:'伊利斯',star:4 },
{ name:'法维欧',img:"./role/4/UiTX_Ply_0037_J08_1024.png",star:4 },
{ name:'法维欧',star:4 },
{ name:'莉塔',img:"./role/4/UiTX_Ply_0036_J02_1024.png",star:4 },
{ name:'莉塔',star:4 },
{ name:'歇尔薇',img:"./role/4/UiTX_Ply_0035_J02_1024.png",star:4 },
{ name:'歇尔薇',star:4 },
{ name:'罗迪恩',img:"./role/4/UiTX_Ply_0034_J02_1024.png",star:4 },
{ name:'罗迪恩',star:4 },
{ name:'玛德蕾妮',img:"./role/4/UiTX_Ply_0032_J05_1024.png",star:4 },
{ name:'玛德蕾妮',star:4 },
{ name:'诺艾尔',img:"./role/4/UiTX_Ply_0031_J04_1024.png",star:4 },
{ name:'诺艾尔',star:4 },
{ name:'塞德里克',img:"./role/4/UiTX_Ply_0030_J05_1024.png",star:4 },
{ name:'塞德里克',star:4 },
{ name:'梅诺',img:"./role/4/UiTX_Ply_0029_J05_1024.png",star:4 },
{ name:'梅诺',star:4 },
{ name:'巴拉德',img:"./role/4/UiTX_Ply_0028_J07_1024.png",star:4 },
{ name:'巴拉德',star:4 },
{ name:'贝尔加',img:"./role/4/UiTX_Ply_0026_J07_1024.png",star:4 },
{ name:'贝尔加',star:4 },
{ name:'阿孜莱特',img:"./role/4/UiTX_Ply_0025_J03_1024.png",star:4 },
{ name:'阿孜莱特',star:4 },
{ name:'卡米拉',img:"./role/4/UiTX_Ply_0024_J06_1024.png",star:4 },
{ name:'卡米拉',star:4 },
{ name:'迈尔斯',img:"./role/4/UiTX_Ply_0022_J01_1024.png",star:4 },
{ name:'迈尔斯',star:4 },
{ name:'贝尔特朗',img:"./role/4/UiTX_Ply_0021_J06_1024.png",star:4 },
{ name:'贝尔特朗',star:4 },
{ name:'洁卡莉特',img:"./role/4/UiTX_Ply_0019_J01_1024.png",star:4 },
{ name:'洁卡莉特',star:4 },
{ name:'塔希尔',img:"./role/4/UiTX_Ply_0018_J01_1024.png",star:4 },
{ name:'塔希尔',star:4 },
{ name:'特里休',img:"./role/4/UiTX_Ply_0017_J01_1024.png",star:4 },
{ name:'特里休',star:4 },
{ name:'阿什兰',img:"./role/4/UiTX_Ply_0016_J06_1024.png",star:4 },
{ name:'阿什兰',star:4 },
{ name:'劳拉',img:"./role/4/UiTX_Ply_0015_J04_1024.png",star:4 },
{ name:'劳拉',star:4 },
{ name:'佩雷迪尔',img:"./role/4/UiTX_Ply_0014_J04_1024.png",star:4 },
{ name:'佩雷迪尔',star:4 },
{ name:'米娜',img:"./role/4/UiTX_Ply_0040_J08_1024.png",star:4 },
{ name:'米娜',star:4 },
{ name:'卢塞塔',img:"./role/4/UiTX_Ply_0023_J06_1024.png",star:4 },
{ name:'卢塞塔',star:4 },
{ name:'拉莫纳',img:"./role/4/UiTX_Ply_0020_J05_1024.png",star:4 },
{ name:'拉莫纳',star:4 },
{ name:'梅蕾特',img:"./role/4/UiTX_Ply_0033_J02_1024.png",star:4 },
{ name:'梅蕾特',star:4 },
{ name:'皮雅',img:"./role/4/UiTX_Ply_0027_J07_1024.png",star:4 },
{ name:'皮雅',star:4 },
{ name:'哈因茨',img:"./role/4/UiTX_Ply_0013_J04_1024.png",star:4 },
{ name:'哈因茨',star:4 },
{ name:'德文',img:"./role/4/UiTX_Ply_0012_J07_1024.png",star:4 },
{ name:'德文',star:4 },
{ name:'克雷斯',img:"./role/4/UiTX_Ply_0010_J03_1024.png",star:4 },
{ name:'克雷斯',star:4 },
{ name:'卡尔茨',img:"./role/4/UiTX_Ply_0011_J03_1024.png",star:4 },
{ name:'卡尔茨',star:4 },
{ name:'温格特',img:"./role/4/UiTX_Ply_0009_J03_1024.png",star:4 }
{ name:'温格特',star:4 }
];
];
var arr_star_5_up = [
var arr_star_5_up = [
{ name:'奥黛特',img:"./role/5/UiTX_Ply_0099_J01_1024.png",num:0.075 * 16,star:5 },
{ name:'奥黛特',star:5 },
];
];
var arr_star_5_other = [
var arr_star_5_other = [
{ name:'多萝德娅',img:"./role/5/UiTX_Ply_0099_J01_1024.png",num:0.075 * 16,star:5 },
{ name:'多萝德娅',star:5 },
];
];
var arr_star_5_other_2 = [
var arr_star_5_other_2 = [
{ name:'洁卡莉特',num:0.8,star:5 },
{ name:'洁卡莉特Ex',star:5 },
{ name:'亚芬',num:0.8,star:5 },
{ name:'亚芬',star:5 },
{ name:'乌·鲁代',num:0.8,star:5 },
{ name:'乌·鲁代',star:5 },
{ name:'泰蕾兹',num:0.8,star:5 },
{ name:'泰蕾兹',star:5 },
{ name:'莱欧尼尔',num:0.8,star:5 },
{ name:'莱欧尼尔',star:5 },
{ name:'海茵特',num:0.8,star:5 },
{ name:'海茵特',star:5 },
{ name:'普里姆萝洁',num:0.8,star:5 },
{ name:'普里姆萝洁',star:5 },
{ name:'赛拉斯',num:0.8,star:5 },
{ name:'赛拉斯',star:5 },
{ name:'斯凯亚克罗',num:0.8,star:5 },
{ name:'斯凯亚克罗',star:5 },
{ name:'菲欧儿',num:0.8,star:5 },
{ name:'菲欧儿',star:5 },
{ name:'米罗德',num:0.8,star:5 },
{ name:'米罗德',star:5 },
{ name:'薇欧拉',num:0.8,star:5 },
{ name:'薇欧拉',star:5 },
{ name:'莉妮特',num:0.8,star:5 },
{ name:'莉妮特',star:5 },
{ name:'吉尔德罗伊',num:0.8,star:5 },
{ name:'吉尔德罗伊',star:5 },
{ name:'特欧',num:0.8,star:5 },
{ name:'特欧',star:5 },
{ name:'索菲亚',num:0.8,star:5 },
{ name:'索菲亚',star:5 },
{ name:'拉斯',num:0.8,star:5 },
{ name:'拉斯',star:5 },
{ name:'塞西莉',num:0.8,star:5 },
{ name:'赛西莉',star:5 },
{ name:'莲见',num:0.8,star:5 },
{ name:'莲见',star:5 },
{ name:'尼兰娜拉',num:0.8,star:5 },
{ name:'尼兰娜拉',star:5 },
{ name:'欧尔贝克',num:0.8,star:5 },
{ name:'欧尔贝克',star:5 },
{ name:'欧菲莉亚',num:0.8,star:5 },
{ name:'欧菲莉亚',star:5 },
{ name:'希斯科特',num:0.8,star:5 },
{ name:'希斯柯特',star:5 },
{ name:'哈雷',num:0.8,star:5 },
{ name:'哈雷',star:5 },
];
];
第159行: 第152行:
}
}


// var obj_ring = document.getElementById("ring");
 
// obj_ring.style = "display:none;"
$("#ring").css("display","none");
$("#ring").css("display","none");




if (max_result_level == 5) {
if (max_result_level == 5) {
// var obj_ring_2 = document.getElementById("ring_2");
// obj_ring_2.style = "display:block;"
$("#ring_2").css("display","block")
$("#ring_2").css("display","block")
} else if (max_result_level == 4) {
} else if (max_result_level == 4) {
// var obj_ring_1 = document.getElementById("ring_1");
// obj_ring_1.style = "display:block;"
$("#ring_1").css("display","block")
$("#ring_1").css("display","block")
} else {
} else {
// var obj_ring_0 = document.getElementById("ring_0");
// obj_ring_0.style = "display:block;"
$("#ring_0").css("display","block")
$("#ring_0").css("display","block")
}
}
第185行: 第171行:
var result_num = Math.floor(Math.random() * 1000)/10.0;
var result_num = Math.floor(Math.random() * 1000)/10.0;
console.log(result_num)
var result_role = {};
var result_role = {};
var star_curr_num = 3;
var star_curr_num = 3;
if(result_num < percent_up_50) {
if(result_num < percent_up_50.toFixed(2)) {
result_role = getRole("up_50");
result_role = getRole("up_50");
} else if(result_num < percent_up_50 + percent_up_45) {
} else if(result_num < (percent_up_50 + percent_up_45).toFixed(2)) {
result_role = getRole("up_45");
result_role = getRole("up_45");
} else if(result_num < percent_up_50 + percent_up_45 + percent_other_50) {
} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50).toFixed(2)) {
result_role = getRole("other_50");
result_role = getRole("other_50");
} else if(result_num < percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45) {
} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45).toFixed(2)) {
result_role = getRole("other_45");
result_role = getRole("other_45");
} else if(result_num < percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_other_2_50) {
} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_other_2_50).toFixed(2)) {
result_role = getRole("other_2_50");
result_role = getRole("other_2_50");
} else if(result_num < percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_other_2_50 + percent_other_2_45) {
} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_other_2_50 + percent_other_2_45).toFixed(2)) {
result_role = getRole("other_2_45");
result_role = getRole("other_2_45");
} else {
} else {
result_role = getRole("40");
result_role = getRole("40");
}
}
//  else if(result_num < percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_40) {
 
// result_role = getRole("40");
// } else if(result_num < percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_40 + percent_35) {
// result_role = getRole("35");
// } else {
// result_role = getRole("30");
// }
if(max_result_level < result_role.star) {
if(max_result_level < result_role.star) {
max_result_level = result_role.star;
max_result_level = result_role.star;
第218行: 第200行:
}
}
function getRole( str_star = "30") {
function getRole( str_star = "30") {
var thisArr = [];
var thisArr = [];
var star_num = 3;
var star_num = 3;
第273行: 第256行:
result.star = star_num;
result.star = star_num;
result.half = half;
result.half = half;
console.log(str_star)
console.log(result)
return result;
return result;
第286行: 第271行:
setTimeout(()=>{
setTimeout(()=>{
obj_result_area.style = "display:flex;background-image: url(https://i.17173cdn.com/g8bz6k/octopathsp/5/58/db_ck_bg.png?20240904091141);"
obj_result_area.style = "display:flex;background-image: url(https://i.17173cdn.com/g8bz6k/octopathsp/5/58/db_ck_bg.png?20240904091141);background-color:transparent;"
$(".img_ring").each(function(){
$(this).css("display","none")
})
var obj_all_result = document.getElementsByClassName("all_Result")[0];
var obj_all_result = document.getElementsByClassName("all_Result")[0];
obj_all_result.innerHTML = "<div>" +  "本次抽卡" + total_num + "次,消费" + total_num * 30 + "钻石" + "</div><div>" + "抽到5星当期UP角色" + up_num + "次,4.5星当期UP角色" + up_half_num + "次</div><div>其他5星角色" + other_num  + '次,其他4.5星角色' + other_half_num + '次' + "</div>";
obj_all_result.innerHTML = "<div>" +  "本次抽卡" + total_num + "次,消费" + total_num * 30 + "钻石" + "</div><div>" + "抽到5星当期UP角色" + up_num + "次,4.5星当期UP角色" + up_half_num + "次</div><div>其他5星角色" + other_num  + '次,其他4.5星角色' + other_half_num + '次' + "</div>";
第310行: 第297行:
}
}
var str_xs = extractContentBetweenStrings(objThis.img,"UiTX_Ply_","_1024.png")
var url_xs = "./role_xs/ChrTX_Chd_Ply_" +  str_xs + "_N.png";
var roleData = getRoleDataWithRoleName(objThis.name);
var roleData = getRoleDataWithRoleName(objThis.name);
第318行: 第303行:
str_html = str_html + "</div>" + "<img src='" + img_lh + "'/>" + "<img class='img_xs' src='" + img_xs + "' />" + "</div>"
str_html = str_html + "</div>" + "<img class='img' src='" + img_lh + "'/>" + "<img class='img_xs' src='" + img_xs + "' />" + "</div>"
}
}
// var obj_result_area = document.getElementsByClassName("result_area")[0];
// obj_result_area.innerHTML = str_html;
第335行: 第318行:
function clickStart( count = 1) {
function clickStart( count = 1) {
console.log(count)
 
if(step != 0) return
if(step != 0) return
step = 1;
step = 1;
第343行: 第326行:
total_num = total_num + count;
total_num = total_num + count;
var rings = document.getElementsByClassName("img_ring");
setTimeout(function(){
for(var i = 0;i < rings.length;i++) {
$("#window_area").css("background-color","transparent");
var obj_this = rings[i];
},1000)
obj_this.style = "display:none;";
}
var obj_result_area = document.getElementsByClassName("result_area")[0];
var obj_result_area = document.getElementsByClassName("result_area")[0];
obj_result_area.style = "display:none;"
obj_result_area.style = "display:none;background-color:#FFFFFF;"
obj_result_area.innerHTML = "";
obj_result_area.innerHTML = "";
第358行: 第339行:
}
}


function initFunc() {
function initFunc() {
 
$(document).ready(function() {
$(document).ready(function() {
$('#btn_start_1').on("click",function() {
$('#btn_start_1').on("click",function() {

2024年9月6日 (五) 11:16的最新版本

		
		var percent_up_50 = 0.8;
		var percent_up_45 = 0.4;
		var percent_other_50 = 0.6;
		var percent_other_45 = 0.2;
		var percent_other_2_50 = 0.6;
		var percent_other_2_45 = 1.4;
		var percent_40 = 96;
		var percent_35 = 0;
		var percent_30 = 0;

		var arr_star_3 = [
		{ name:'马努埃尔',star:3},
		{ name:'伊布林',star:3},
		{ name:'哈利',star:3},
		{ name:'霍尔赫',star:3},
		{ name:'萨莉亚',star:3},
		{ name:'佩妮',star:3},
		{ name:'迪艾格',star:3},
		{ name:'费丽妮',star:3},
		{ name:'比利',star:3},
		{ name:'赫塞',star:3},
		{ name:'帕尔',star:3},
		{ name:'特利',star:3},
		{ name:'弗昂',star:3},
		{ name:'卡萝尔',star:3},
		{ name:'科妮',star:3},
		{ name:'古提',star:3},
		{ name:'薇薇安',star:3},
		{ name:'萨妮',star:3},
		{ name:'伍格',star:3},
		{ name:'南娜',star:3},
		{ name:'梅妮',star:3},
		{ name:'弗利欧',star:3},
		{ name:'尤妮丝',star:3},
		{ name:'多利',star:3},
		];
		var arr_star_4 = [
		{ name:'普利基特',star:4 },
		{ name:'洛洛',star:4 },
		{ name:'雪娜',star:4 },
		{ name:'约伦',star:4 },
		{ name:'勒凡',star:4 },
		{ name:'波拉',star:4 },
		{ name:'艾弗伦',star:4 },
		{ name:'肯尼斯',star:4 },
		{ name:'科尔尼利亚',star:4 },
		{ name:'杜兰',star:4 },
		{ name:'纳尔',star:4 },
		{ name:'梅贝儿',star:4 },
		{ name:'伊利斯',star:4 },
		{ name:'法维欧',star:4 },
		{ name:'莉塔',star:4 },
		{ name:'歇尔薇',star:4 },
		{ name:'罗迪恩',star:4 },
		{ name:'玛德蕾妮',star:4 },
		{ name:'诺艾尔',star:4 },
		{ name:'塞德里克',star:4 },
		{ name:'梅诺',star:4 },
		{ name:'巴拉德',star:4 },
		{ name:'贝尔加',star:4 },
		{ name:'阿孜莱特',star:4 },
		{ name:'卡米拉',star:4 },
		{ name:'迈尔斯',star:4 },
		{ name:'贝尔特朗',star:4 },
		{ name:'洁卡莉特',star:4 },
		{ name:'塔希尔',star:4 },
		{ name:'特里休',star:4 },
		{ name:'阿什兰',star:4 },
		{ name:'劳拉',star:4 },
		{ name:'佩雷迪尔',star:4 },
		{ name:'米娜',star:4 },
		{ name:'卢塞塔',star:4 },
		{ name:'拉莫纳',star:4 },
		{ name:'梅蕾特',star:4 },
		{ name:'皮雅',star:4 },
		{ name:'哈因茨',star:4 },
		{ name:'德文',star:4 },
		{ name:'克雷斯',star:4 },
		{ name:'卡尔茨',star:4 },
		{ name:'温格特',star:4 }
		];
		var arr_star_5_up = [
			{ name:'奥黛特',star:5 },
		];
		var arr_star_5_other = [
			{ name:'多萝德娅',star:5 },
		];
		var arr_star_5_other_2 = [
		{ name:'洁卡莉特Ex',star:5 },
		{ name:'亚芬',star:5 },
		{ name:'乌·鲁代',star:5 },
		{ name:'泰蕾兹',star:5 },
		{ name:'莱欧尼尔',star:5 },
		{ name:'海茵特',star:5 },
		{ name:'普里姆萝洁',star:5 },
		{ name:'赛拉斯',star:5 },
		{ name:'斯凯亚克罗',star:5 },
		{ name:'菲欧儿',star:5 },
		{ name:'米罗德',star:5 },
		{ name:'薇欧拉',star:5 },
		{ name:'莉妮特',star:5 },
		{ name:'吉尔德罗伊',star:5 },
		{ name:'特欧',star:5 },
		{ name:'索菲亚',star:5 },
		{ name:'拉斯',star:5 },
		{ name:'赛西莉',star:5 },
		{ name:'莲见',star:5 },
		{ name:'尼兰娜拉',star:5 },
		{ name:'欧尔贝克',star:5 },
		{ name:'欧菲莉亚',star:5 },
		{ name:'希斯柯特',star:5 },
		{ name:'哈雷',star:5 },
		];
		
		
		
		var arr_result = [];
		var max_result_level = 3;
		var step = 0;

		
		var total_num = 0;
		var up_num = 0;
		var up_half_num = 0;
		var other_num = 0;
		var other_half_num = 0;
		
		// 截取字符串
		function extractContentBetweenStrings(text, start, end) {
		    var pattern = new RegExp(start + '((.*?)(?=' + end + '))', 'gm');
		    var matches = text.match(pattern);
		    if (matches) {
		        return matches[0].replace(start, '');
		    }
		    return null;
		}
		
		function ringMoveIn(count = 1) {
			var obj_ring = document.getElementById("ring");
			obj_ring.style = "display: block;"
			setTimeout(()=>{
				getRoles(count);
				
			},3500)
		}
		function getRoles(count = 1) {
			for (var i = 0; i < count; i++) {
				cardResult();
			}


			$("#ring").css("display","none");


			if (max_result_level == 5) {
				$("#ring_2").css("display","block")
			} else if (max_result_level == 4) {
				$("#ring_1").css("display","block")
			} else {
				$("#ring_0").css("display","block")
			}

			step = 2;

		}
		function cardResult() {
			
			
			var result_num = Math.floor(Math.random() * 1000)/10.0;
			
			console.log(result_num)
			var result_role = {};
			var star_curr_num = 3;
			if(result_num < percent_up_50.toFixed(2)) {
				result_role = getRole("up_50");
			} else if(result_num < (percent_up_50 + percent_up_45).toFixed(2)) {
				result_role = getRole("up_45");
			} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50).toFixed(2)) {
				result_role = getRole("other_50");
			} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45).toFixed(2)) {
				result_role = getRole("other_45");
			} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_other_2_50).toFixed(2)) {
				result_role = getRole("other_2_50");
			} else if(result_num < (percent_up_50 + percent_up_45 + percent_other_50 + percent_other_45 + percent_other_2_50 + percent_other_2_45).toFixed(2)) {
				result_role = getRole("other_2_45");
			} else {
				result_role = getRole("40");
			}

			if(max_result_level < result_role.star) {
				max_result_level = result_role.star;
			}
			arr_result.push(result_role);
			

			
		}
		function getRole( str_star = "30") {
			
			var thisArr = [];
			var star_num = 3;
			var half = false;
			if(str_star == "30") {
				thisArr = arr_star_3;
				star_num = 3;
				half = false;
			} else if(str_star == "35") {
				thisArr = arr_star_4;
				star_num = 3;
				half = true;
			} else if( str_star == "40") {
				thisArr = arr_star_4;
				star_num = 4;
				half = false;
			} else if(str_star == "other_2_45") {
				thisArr = arr_star_5_other_2;
				other_half_num ++;
				star_num = 4;
				half = true;
			} else if(str_star == "other_2_50") {
				thisArr = arr_star_5_other_2;
				other_num ++;
				star_num = 5;
				half = false;
			} else if(str_star == "other_45") {
				thisArr = arr_star_5_other;
				other_half_num ++;
				star_num = 4;
				half = true;
			} else if(str_star == "other_50") {
				thisArr = arr_star_5_other;
				other_num ++;
				star_num = 5;
				half = false;
			} else if(str_star == "up_45") {
				thisArr = arr_star_5_up;
				up_half_num ++;
				star_num = 4;
				half = true;
			} else if(str_star == "up_50") {
				thisArr = arr_star_5_up;
				up_num ++;
				star_num = 5;
				half = false;
			} else {
				return { name:"",img:"" }
			}


			var arr_length = thisArr.length;
			var random_num = Math.floor(Math.random() * arr_length);
			var result = thisArr[random_num];
			result.star = star_num;
			result.half = half;
			console.log(str_star)
			console.log(result)
			return result;
			
		}
		function clickWindow() {
			if(step != 2) return;
			step = 3;
			
			var obj_result_area = document.getElementsByClassName("result_area")[0];
			obj_result_area.style = "display:flex;"
			
			// 正常流程
			setTimeout(()=>{
				
				obj_result_area.style = "display:flex;background-image: url(https://i.17173cdn.com/g8bz6k/octopathsp/5/58/db_ck_bg.png?20240904091141);background-color:transparent;"
				$(".img_ring").each(function(){
					$(this).css("display","none")
				})
				var obj_all_result = document.getElementsByClassName("all_Result")[0];
				obj_all_result.innerHTML = "<div>" +  "本次抽卡" + total_num + "次,消费" + total_num * 30 + "钻石" + "</div><div>" + "抽到5星当期UP角色" + up_num + "次,4.5星当期UP角色" + up_half_num + "次</div><div>其他5星角色" + other_num  + '次,其他4.5星角色' + other_half_num + '次' + "</div>";
				showResults();
			},2500)
			
			
			
		}
		function showResults() {
			var str_html = "";
			for (var i = 0; i < arr_result.length; i++) {
				var objThis = arr_result[i];
				str_html = str_html + "<div class='role_area'>" 
					+ "<div class='text'>" + objThis.name + "</div>"
					+ "<div class='text'>";
				for(var j = 0; j < objThis.star ; j ++) {
					str_html = str_html + "★"
				}
				if(objThis.half) {
					str_html = str_html + "☆"
				}
						
				
				var roleData = getRoleDataWithRoleName(objThis.name);
				var img_lh = "https://wiki.17173.com/octopathsp/thumb.php?f=角色立绘-角色编号" + roleData[0] + ".png&width=200x";
				var img_xs = "https://wiki.17173.com/octopathsp/thumb.php?f=" + roleData[2] + ".png&width=100x";
			
				
				str_html = str_html + "</div>" + "<img class='img' src='" + img_lh + "'/>" + "<img class='img_xs' src='" + img_xs + "' />" + "</div>"
			}
			
			
			$(".result_area").each(function(){
				
				$(this).html(str_html).load()
			})
			
			setTimeout(()=>{
				step = 0;
			},1000)
		}
		
		function clickStart( count = 1) {

			if(step != 0) return
			step = 1;
			max_result_level = 3;
			arr_result = [];
			
			total_num = total_num + count;
			
			setTimeout(function(){
				$("#window_area").css("background-color","transparent");
			},1000)
			
			var obj_result_area = document.getElementsByClassName("result_area")[0];
			obj_result_area.style = "display:none;background-color:#FFFFFF;"
			obj_result_area.innerHTML = "";
			

			getRoles(count);

		}

		function initFunc() {
			$(document).ready(function() {
				$('#btn_start_1').on("click",function() {
					console.log('clickStart(1)');
					clickStart(1)
					
				});
				$('#btn_start_2').on("click",()=>{
					console.log('clickStart(10)');
					clickStart(10)
				});
				$('#window_area').on("click",()=>{
					clickWindow()
				});
			});

		}

		initFunc()