MediaWiki:Ck main.js:修订间差异

无编辑摘要
无编辑摘要
第1行: 第1行:
var roles_3 = [{
var roles_3 = [{
name: '马努埃尔',
    name: '马努埃尔',
},
},
{
{
name: '伊布林',
    name: '伊布林',
},
},
{
{
name: '哈利',
    name: '哈利',
},
},
{
{
name: '霍尔赫',
    name: '霍尔赫',
},
},
{
{
name: '萨莉亚',
    name: '萨莉亚',
},
},
{
{
name: '佩妮',
    name: '佩妮',
},
},
{
{
name: '迪艾格',
    name: '迪艾格',
},
},
{
{
name: '费丽妮',
    name: '费丽妮',
},
},
{
{
name: '比利',
    name: '比利',
},
},
{
{
name: '赫塞',
    name: '赫塞',
},
},
{
{
name: '帕尔',
    name: '帕尔',
},
},
{
{
name: '特利',
    name: '特利',
},
},
{
{
name: '弗昂',
    name: '弗昂',
},
},
{
{
name: '卡萝尔',
    name: '卡萝尔',
},
},
{
{
name: '科妮',
    name: '科妮',
},
},
{
{
name: '古提',
    name: '古提',
},
},
{
{
name: '薇薇安',
    name: '薇薇安',
},
},
{
{
name: '萨妮',
    name: '萨妮',
},
},
{
{
name: '伍格',
    name: '伍格',
},
},
{
{
name: '南娜',
    name: '南娜',
},
},
{
{
name: '梅妮',
    name: '梅妮',
},
},
{
{
name: '弗利欧',
    name: '弗利欧',
},
},
{
{
name: '尤妮丝',
    name: '尤妮丝',
},
},
{
{
name: '多利',
    name: '多利',
},
},
];
];
var roles_4 = [{
var roles_4 = [{
name: '普利基特',
    name: '普利基特',
},
},
{
{
name: '洛洛',
    name: '洛洛',
},
},
{
{
name: '雪娜',
    name: '雪娜',
},
},
{
{
name: '约伦',
    name: '约伦',
},
},
{
{
name: '勒凡',
    name: '勒凡',
},
},
{
{
name: '波拉',
    name: '波拉',
},
},
{
{
name: '艾弗伦',
    name: '艾弗伦',
},
},
{
{
name: '肯尼斯',
    name: '肯尼斯',
},
},
{
{
name: '科尔尼利亚',
    name: '科尔尼利亚',
},
},
{
{
name: '杜兰',
    name: '杜兰',
},
},
{
{
name: '纳尔',
    name: '纳尔',
},
},
{
{
name: '梅贝儿',
    name: '梅贝儿',
},
},
{
{
name: '伊利斯',
    name: '伊利斯',
},
},
{
{
name: '法维欧',
    name: '法维欧',
},
},
{
{
name: '莉塔',
    name: '莉塔',
},
},
{
{
name: '歇尔薇',
    name: '歇尔薇',
},
},
{
{
name: '罗迪恩',
    name: '罗迪恩',
},
},
{
{
name: '玛德蕾妮',
    name: '玛德蕾妮',
},
},
{
{
name: '诺艾尔',
    name: '诺艾尔',
},
},
{
{
name: '塞德里克',
    name: '塞德里克',
},
},
{
{
name: '梅诺',
    name: '梅诺',
},
},
{
{
name: '巴拉德',
    name: '巴拉德',
},
},
{
{
name: '贝尔加',
    name: '贝尔加',
},
},
{
{
name: '阿孜莱特',
    name: '阿孜莱特',
},
},
{
{
name: '卡米拉',
    name: '卡米拉',
},
},
{
{
name: '迈尔斯',
    name: '迈尔斯',
},
},
{
{
name: '贝尔特朗',
    name: '贝尔特朗',
},
},
{
{
name: '洁卡莉特',
    name: '洁卡莉特',
},
},
{
{
name: '塔希尔',
    name: '塔希尔',
},
},
{
{
name: '特里休',
    name: '特里休',
},
},
{
{
name: '阿什兰',
    name: '阿什兰',
},
},
{
{
name: '劳拉',
    name: '劳拉',
},
},
{
{
name: '佩雷迪尔',
    name: '佩雷迪尔',
},
},
{
{
name: '米娜',
    name: '米娜',
},
},
{
{
name: '卢塞塔',
    name: '卢塞塔',
},
},
{
{
name: '拉莫纳',
    name: '拉莫纳',
},
},
{
{
name: '梅蕾特',
    name: '梅蕾特',
},
},
{
{
name: '皮雅',
    name: '皮雅',
},
},
{
{
name: '哈因茨',
    name: '哈因茨',
},
},
{
{
name: '德文',
    name: '德文',
},
},
{
{
name: '克雷斯',
    name: '克雷斯',
},
},
{
{
name: '卡尔茨',
    name: '卡尔茨',
},
},
{
{
name: '温格特',
    name: '温格特',
}
}
];
];
var roles_5 = [{
var roles_5 = [{
name: '洁卡莉特Ex'
    name: '洁卡莉特Ex'
},
},
{
{
name: '亚芬'
    name: '亚芬'
},
},
{
{
name: '乌·鲁代'
    name: '乌·鲁代'
},
},
{
{
name: '泰蕾兹'
    name: '泰蕾兹'
},
},
{
{
name: '莱欧尼尔'
    name: '莱欧尼尔'
},
},
{
{
name: '海茵特'
    name: '海茵特'
},
},
{
{
name: '普里姆萝洁'
    name: '普里姆萝洁'
},
},
{
{
name: '赛拉斯'
    name: '赛拉斯'
},
},
{
{
name: '斯凯亚克罗'
    name: '斯凯亚克罗'
},
},
{
{
name: '菲欧儿'
    name: '菲欧儿'
},
},
{
{
name: '米罗德'
    name: '米罗德'
},
},
{
{
name: '薇欧拉'
    name: '薇欧拉'
},
},
{
{
name: '莉妮特'
    name: '莉妮特'
},
},
{
{
name: '吉尔德罗伊'
    name: '吉尔德罗伊'
},
},
{
{
name: '特欧'
    name: '特欧'
},
},
{
{
name: '索菲亚'
    name: '索菲亚'
},
},
{
{
name: '拉斯'
    name: '拉斯'
},
},
{
{
name: '赛西莉'
    name: '赛西莉'
},
},
{
{
name: '莲见'
    name: '莲见'
},
},
{
{
name: '尼兰娜拉'
    name: '尼兰娜拉'
},
},
{
{
name: '欧尔贝克'
    name: '欧尔贝克'
},
},
{
{
name: '欧菲莉亚'
    name: '欧菲莉亚'
},
},
{
{
name: '希斯柯特'
    name: '希斯柯特'
},
},
{
{
name: '哈雷'
    name: '哈雷'
},
},
];
];
 
var roles_5_new = [{
    name: '索蕾犹'
},{
    name: '爱丽莎'
},{
    name: '泰里翁'
},{
    name: '莫露露'
},{
    name: '贝兹'
},{
    name: '闪达'
}]


// 亚芬、海茵特混池
// 亚芬、海茵特混池
var roles_hc_5 = [{
var roles_hc_5 = [{
name: "亚芬",
name: "亚芬",
isUp: true,
isUp: true,
weight: 1
weight: 1
}, {
}, {
name: "海茵特",
name: "海茵特",
isUp: true,
isUp: true,
weight: 1
weight: 1
}];
}];
// 卡杰斯
// 卡杰斯
var role_sg_5 = [{
var role_sg_5 = [{
name: "卡杰斯",
name: "卡杰斯",
isUp: true,
isUp: true,
weight: 1
weight: 1
}]
}]
// 尼尔
// 尼尔
var roles_nier_5 = [{
var roles_nier_5 = [{
name: "A2",
name: "A2",
isUp: true,
isUp: true,
weight: 1
weight: 1
}, {
}, {
name: "2B",
name: "2B",
isUp: true,
isUp: true,
weight: 1
weight: 1
}, {
}, {
name: "9S",
name: "9S",
isUp: true,
isUp: true,
weight: 1
weight: 1
}];
// 追忆 雷比娜
var roles_zy_5 = [{
    name: "雷比娜",
    isUp: true,
    weight: 1
}];
}];
var roles_zy_5_other = [{
    name: "利夏尔",
    isUp:  false,
    weight: 1
}];
var roles_zy_5_step = [{
    name: "雷比娜",
    isUp: true,
    weight: 1
}, {
    name: "利夏尔",
    isUp: false,
    weight: 1
}];
// 卢米斯
var role_sg_5_2 = [{
    name: "卢米斯",
    isUp: true,
    weight: 1
}]


var pools = [{
var pools = [{
name: "尼尔机械纪元:A2 2B 9S",
    name: "追忆的旅人:雷比娜",
btn_1: true,
    btn_1: true,
btn_10: true,
    btn_10: true,
step: false,
    step: false,
stepRole: [],
    stepRole: [],
stepCount: [],
    stepCount: [],
roleType: [{
    roleType: [{
// 5 A2 2B 9S
            // 5 雷比娜
num: 1,
            num: 0.8,
maxStar: 5,
            maxStar: 5,
thisStar: 5,
            thisStar: 5,
isUp: true,
            isUp: true,
roles: roles_nier_5
            roles: roles_zy_5
},
        },
{
        {
// 4.5 A2 2B 9S
            // 4.5 雷比娜
num: 1,
            num: 0.4,
maxStar: 5,
            maxStar: 5,
thisStar: 4,
            thisStar: 4,
isUp: true,
            isUp: true,
roles: roles_nier_5
            roles: roles_zy_5
},
        },{
{
            // 5 利夏尔
// 5其他
            num: 0.2,
num: 1,
            maxStar: 5,
maxStar: 5,
            thisStar: 5,
thisStar: 5,
            isUp: false,
isUp: false,
            roles: roles_zy_5_other
roles: roles_5
        },
},
        {
{
            // 4.5 利夏尔
// 4.5其他
            num: 0.6,
num: 1,
            maxStar: 5,
maxStar: 5,
            thisStar: 4,
thisStar: 4,
            isUp: false,
isUp: false,
            roles: roles_zy_5_other
roles: roles_5
        },
},
        {
{
            // 5其他
// 4星
            num: 1,
num: 18,
            maxStar: 5,
maxStar: 4,
            thisStar: 5,
thisStar: 4,
            isUp: false,
isUp: false,
            roles: roles_5.concat(roles_5_new)
roles: roles_4
        },
},
        {
{
            // 4.5其他
// 3.5星
            num: 1,
num: 40,
            maxStar: 5,
maxStar: 4,
            thisStar: 4,
thisStar: 3,
            isUp: false,
isUp: false,
            roles: roles_5.concat(roles_5_new)
roles: roles_4
        },
},
        {
{
            // 4星
// 3星
            num: 18,
num: 38,
            maxStar: 4,
maxStar: 3,
            thisStar: 4,
thisStar: 3,
            isUp: false,
isUp: false,
            roles: roles_4
roles: roles_3
        },
}
        {
]
            // 3.5星
},
            num: 40,
{
            maxStar: 4,
name: "尼尔机械纪元(阶梯):A2 2B 9S",
            thisStar: 3,
btn_1: false,
            isUp: false,
btn_10: true,
            roles: roles_4
step: true,
        },
stepRole: roles_nier_5,
        {
stepCount: [7, 8, 10, 10, 10],
            // 3星
roleType: [{
            num: 38,
// 5 A2 2B 9S
            maxStar: 3,
num: 1,
            thisStar: 3,
maxStar: 5,
            isUp: false,
thisStar: 5,
            roles: roles_3
isUp: true,
        }
roles: roles_nier_5
    ]
},
},{
{
    name: "追忆的旅人(阶梯):雷比娜",
// 4.5 A2 2B 9S
    btn_1: false,
num: 1,
    btn_10: true,
maxStar: 5,
    step: true,
thisStar: 4,
    stepRole: roles_zy_5_step,
isUp: true,
    stepCount: [7,8,10,10,10],
roles: roles_nier_5
    roleType: [{
},
            // 5 雷比娜
{
            num: 0.8,
// 5其他
            maxStar: 5,
num: 1,
            thisStar: 5,
maxStar: 5,
            isUp: true,
thisStar: 5,
            roles: roles_zy_5
isUp: false,
        },
roles: roles_5
        {
},
            // 4.5 雷比娜
{
            num: 0.4,
// 4.5其他
            maxStar: 5,
num: 1,
            thisStar: 4,
maxStar: 5,
            isUp: true,
thisStar: 4,
            roles: roles_zy_5
isUp: false,
        },{
roles: roles_5
            // 5 利夏尔
},
            num: 0.2,
{
            maxStar: 5,
// 4星
            thisStar: 5,
num: 18,
            isUp: true,
maxStar: 4,
            roles: roles_zy_5_other
thisStar: 4,
        },
isUp: false,
        {
roles: roles_4
            // 4.5 利夏尔
},
            num: 0.6,
{
            maxStar: 5,
// 3.5星
            thisStar: 4,
num: 40,
            isUp: true,
maxStar: 4,
            roles: roles_zy_5_other
thisStar: 3,
        },
isUp: false,
        {
roles: roles_4
            // 5其他
},
            num: 1,
{
            maxStar: 5,
// 3星
            thisStar: 5,
num: 38,
            isUp: false,
maxStar: 3,
            roles: roles_5.concat(roles_5_new)
thisStar: 3,
        },
isUp: false,
        {
roles: roles_3
            // 4.5其他
}
            num: 1,
]
            maxStar: 5,
},
            thisStar: 4,
{
            isUp: false,
name: "闪光的旅人:卡杰斯",
            roles: roles_5.concat(roles_5_new)
btn_1: true,
        },
btn_10: true,
        {
step: false,
            // 4星
stepRole: [],
            num: 18,
stepCount: [],
            maxStar: 4,
roleType: [{
            thisStar: 4,
// 5卡杰斯
            isUp: false,
num: 0.8,
            roles: roles_4
maxStar: 5,
        },
thisStar: 5,
        {
isUp: true,
            // 3.5星
roles: role_sg_5
            num: 40,
},
            maxStar: 4,
{
            thisStar: 3,
// 4.5亚芬、海茵特
            isUp: false,
num: 0.4,
            roles: roles_4
maxStar: 5,
        },
thisStar: 4,
        {
isUp: true,
            // 3星
roles: role_sg_5
            num: 38,
},
            maxStar: 3,
{
            thisStar: 3,
// 5其他
            isUp: false,
num: 1.2,
            roles: roles_3
maxStar: 5,
        }
thisStar: 5,
    ]
isUp: false,
},{
roles: roles_5
    name: "闪光的旅人:卢米斯",
},
    btn_1: true,
{
    btn_10: true,
// 4.5其他
    step: false,
num: 1.6,
    stepRole: [],
maxStar: 5,
    stepCount: [],
thisStar: 4,
    roleType: [{
isUp: false,
            // 5卢米斯
roles: roles_5
            num: 0.8,
},
            maxStar: 5,
{
            thisStar: 5,
// 4星
            isUp: true,
num: 18,
            roles: role_sg_5_2
maxStar: 4,
        },
thisStar: 4,
        {
isUp: false,
            // 4.5卢米斯
roles: roles_4
            num: 0.4,
},
            maxStar: 5,
{
            thisStar: 4,
// 3.5星
            isUp: true,
num: 40,
            roles: role_sg_5_2
maxStar: 4,
        },
thisStar: 3,
        {
isUp: false,
            // 5其他
roles: roles_4
            num: 1.2,
},
            maxStar: 5,
{
            thisStar: 5,
// 3星
            isUp: false,
num: 38,
            roles: roles_5.concat(roles_5_new)
maxStar: 3,
        },
thisStar: 3,
        {
isUp: false,
            // 4.5其他
roles: roles_3
            num: 1.6,
}
            maxStar: 5,
]
            thisStar: 4,
},
            isUp: false,
{
            roles: roles_5.concat(roles_5_new)
name: "被选中的旅人:亚芬、海茵特",
        },
btn_1: true,
        {
btn_10: true,
            // 4星
step: false,
            num: 18,
stepRole: [],
            maxStar: 4,
stepCount: [],
            thisStar: 4,
roleType: [{
            isUp: false,
// 5亚芬、海茵特
            roles: roles_4
num: 1,
        },
maxStar: 5,
        {
thisStar: 5,
            // 3.5星
isUp: true,
            num: 40,
roles: roles_hc_5
            maxStar: 4,
},
            thisStar: 3,
{
            isUp: false,
// 4.5亚芬、海茵特
            roles: roles_4
num: 1,
        },
maxStar: 5,
        {
thisStar: 4,
            // 3星
isUp: true,
            num: 38,
roles: roles_hc_5
            maxStar: 3,
},
            thisStar: 3,
{
            isUp: false,
// 5其他
            roles: roles_3
num: 1,
        }
maxStar: 5,
    ]
thisStar: 5,
},{
isUp: false,
    name: "尼尔机械纪元:A2 2B 9S",
roles: roles_5
    btn_1: true,
},
    btn_10: true,
{
    step: false,
// 4.5其他
    stepRole: [],
num: 1,
    stepCount: [],
maxStar: 5,
    roleType: [{
thisStar: 4,
            // 5 A2 2B 9S
isUp: false,
            num: 1,
roles: roles_5
            maxStar: 5,
},
            thisStar: 5,
{
            isUp: true,
// 4星
            roles: roles_nier_5
num: 18,
        },
maxStar: 4,
        {
thisStar: 4,
            // 4.5 A2 2B 9S
isUp: false,
            num: 1,
roles: roles_4
            maxStar: 5,
},
            thisStar: 4,
{
            isUp: true,
// 3.5星
            roles: roles_nier_5
num: 40,
        },
maxStar: 4,
        {
thisStar: 3,
            // 5其他
isUp: false,
            num: 1,
roles: roles_4
            maxStar: 5,
},
            thisStar: 5,
{
            isUp: false,
// 3星
            roles: roles_5
num: 38,
        },
maxStar: 3,
        {
thisStar: 3,
            // 4.5其他
isUp: false,
            num: 1,
roles: roles_3
            maxStar: 5,
}
            thisStar: 4,
]
            isUp: false,
},
            roles: roles_5
{
        },
name: "邂逅的旅人们",
        {
btn_1: true,
            // 4星
btn_10: true,
            num: 18,
step: false,
            maxStar: 4,
stepRole: [],
            thisStar: 4,
stepCount: [],
            isUp: false,
roleType: [{
            roles: roles_4
// 5其他
        },
num: 2,
        {
maxStar: 5,
            // 3.5星
thisStar: 5,
            num: 40,
isUp: false,
            maxStar: 4,
roles: roles_5
            thisStar: 3,
},
            isUp: false,
{
            roles: roles_4
// 4.5其他
        },
num: 2,
        {
maxStar: 5,
            // 3星
thisStar: 4,
            num: 38,
isUp: false,
            maxStar: 3,
roles: roles_5
            thisStar: 3,
},
            isUp: false,
{
            roles: roles_3
// 4星
        }
num: 18,
    ]
maxStar: 4,
},
thisStar: 4,
{
isUp: false,
    name: "尼尔机械纪元(阶梯):A2 2B 9S",
roles: roles_4
    btn_1: false,
},
    btn_10: true,
{
    step: true,
// 3.5星
    stepRole: roles_nier_5,
num: 40,
    stepCount: [7, 8, 10, 10, 10],
maxStar: 4,
    roleType: [{
thisStar: 3,
            // 5 A2 2B 9S
isUp: false,
            num: 1,
roles: roles_4
            maxStar: 5,
},
            thisStar: 5,
{
            isUp: true,
// 3星
            roles: roles_nier_5
num: 38,
        },
maxStar: 3,
        {
thisStar: 3,
            // 4.5 A2 2B 9S
isUp: false,
            num: 1,
roles: roles_3
            maxStar: 5,
}
            thisStar: 4,
]
            isUp: true,
},
            roles: roles_nier_5
{
        },
name: "历战的旅人们",
        {
btn_1: true,
            // 5其他
btn_10: false,
            num: 1,
step: false,
            maxStar: 5,
stepRole: [],
            thisStar: 5,
stepCount: [],
            isUp: false,
roleType: [{
            roles: roles_5
// 5其他
        },
num: 100,
        {
maxStar: 5,
            // 4.5其他
thisStar: 5,
            num: 1,
isUp: true,
            maxStar: 5,
roles: roles_5
            thisStar: 4,
}]
            isUp: false,
}
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "闪光的旅人:卡杰斯",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5卡杰斯
            num: 0.8,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: role_sg_5
        },
        {
            // 4.5亚芬、海茵特
            num: 0.4,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: role_sg_5
        },
        {
            // 5其他
            num: 1.2,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 1.6,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "被选中的旅人:亚芬、海茵特",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5亚芬、海茵特
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: roles_hc_5
        },
        {
            // 4.5亚芬、海茵特
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: roles_hc_5
        },
        {
            // 5其他
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "邂逅的旅人们",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5其他
            num: 2,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 2,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "历战的旅人们",
    btn_1: true,
    btn_10: false,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
        // 5其他
        num: 100,
        maxStar: 5,
        thisStar: 5,
        isUp: true,
        roles: roles_5
    }]
}
];
];


var updateDate = "2024年10月3日";
var currPool = {};
var currPool = {};
var poolName = "";
var poolName = "";
第651行: 第912行:
var up_num = 0;
var up_num = 0;
var arr_ups = [];
var arr_ups = [];
var arr_not_ups = [];
var up_half_num = 0;
var up_half_num = 0;
var other_num = 0;
var other_num = 0;
第657行: 第919行:
// 截取字符串
// 截取字符串
function extractContentBetweenStrings(text, start, end) {
function extractContentBetweenStrings(text, start, end) {
var pattern = new RegExp(start + '((.*?)(?=' + end + '))', 'gm');
var pattern = new RegExp(start + '((.*?)(?=' + end + '))', 'gm');
var matches = text.match(pattern);
var matches = text.match(pattern);
if (matches) {
if (matches) {
return matches[0].replace(start, '');
    return matches[0].replace(start, '');
}
}
return null;
return null;
}
}


function getRoles(count = 1) {
function getRoles(count = 1) {
for (var i = 0; i < count; i++) {
for (var i = 0; i < count; i++) {
cardResult(i);
    cardResult(i);
}
}




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




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


step = 2;
step = 2;


}
}
第688行: 第950行:
function cardResult(index) {
function cardResult(index) {


if (stepPoolIndex == 5 && index == 9) {
if (stepPoolIndex == 5 && index == 9) {
var arrRolesThis = currPool.stepRole;
    var arrRolesThis = currPool.stepRole;
var stepRoleTotalNum = 0;
    var stepRoleTotalNum = 0;
arrRolesThis.forEach(item => {
    arrRolesThis.forEach(item => {
stepRoleTotalNum = stepRoleTotalNum + item.weight;
        stepRoleTotalNum = stepRoleTotalNum + item.weight;
})
    })
var random_index = Math.floor(Math.random() * stepRoleTotalNum);
    var random_index = Math.floor(Math.random() * stepRoleTotalNum);
for (var i = 0; i < arrRolesThis.length; i++) {
    for (var i = 0; i < arrRolesThis.length; i++) {
var objThis = arrRolesThis[i];
        var objThis = arrRolesThis[i];
if (random_index < objThis.weight) {
        if (random_index < objThis.weight) {
var result = JSON.parse(JSON.stringify(objThis));
            var result = JSON.parse(JSON.stringify(objThis));
break;
            break;
} else {
        } else {
random_index = random_index - objThis.weight;
            random_index = random_index - objThis.weight;
}
        }
    }
    // var result = JSON.parse(JSON.stringify(arrRolesThis[random_index]));
    result.maxStar = 5;
    result.thisStar = 5;
    if (max_result_level < 5) {
        max_result_level = 5;
    }
    arr_result.push(result);
    if (result.isUp) {
        up_num = up_num + 1;
        arr_ups.push(result)
    } else {
        other_num = other_num + 1;
        arr_not_ups.push(result);
    }
} else {
    var result_num = Math.floor(Math.random() * 1000) / 10.0;
    for (var i = 0; i < numStep.length; i++) {
        var thisStep = numStep[i];
        if (result_num < thisStep) {
            var roleTypeThis = poolRoleTyels[i];
            var arrRolesThis = roleTypeThis.roles;
            var random_index = Math.floor(Math.random() * arrRolesThis.length);
            var result = JSON.parse(JSON.stringify(arrRolesThis[random_index]));
            result.maxStar = roleTypeThis.maxStar;
            result.thisStar = roleTypeThis.thisStar;
            if (max_result_level < roleTypeThis.thisStar) {
                max_result_level = roleTypeThis.thisStar;
            }
            arr_result.push(result);
            console.log(result)


}
            if (roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 5) {
// var result = JSON.parse(JSON.stringify(arrRolesThis[random_index]));
                up_num = up_num + 1;
result.maxStar = 5;
                arr_ups.push(result)
result.thisStar = 5;
            } else if (!roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 5) {
if (max_result_level < 5) {
                other_num = other_num + 1;
max_result_level = 5;
                arr_not_ups.push(result)
}
            } else if (roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 4) {
arr_result.push(result);
                up_half_num = up_half_num + 1;
if (result.isUp) {
                arr_ups.push(result)
up_num = up_num + 1;
            } else if (!roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 4) {
arr_ups.push(result)
                other_half_num = other_half_num + 1;
} else {
                arr_not_ups.push(result)
other_num = other_num + 1;
            }
}
} else {
var result_num = Math.floor(Math.random() * 1000) / 10.0;
for (var i = 0; i < numStep.length; i++) {
var thisStep = numStep[i];
if (result_num < thisStep) {
var roleTypeThis = poolRoleTyels[i];
var arrRolesThis = roleTypeThis.roles;
var random_index = Math.floor(Math.random() * arrRolesThis.length);
var result = JSON.parse(JSON.stringify(arrRolesThis[random_index]));
result.maxStar = roleTypeThis.maxStar;
result.thisStar = roleTypeThis.thisStar;
if (max_result_level < roleTypeThis.thisStar) {
max_result_level = roleTypeThis.thisStar;
}
arr_result.push(result);
console.log(result)


if (roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 5) {
            break
up_num = up_num + 1;
arr_ups.push(result)
} else if (!roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 5) {
other_num = other_num + 1;
} else if (roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 4) {
up_half_num = up_half_num + 1;
arr_ups.push(result)
} else if (!roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 4) {
other_half_num = other_half_num + 1;
}


break
        }
 
    }
}
}
}
}




第758行: 第1,022行:


function clickWindow() {
function clickWindow() {
if (step != 2) return;
if (step != 2) return;
step = 3;
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];
    if (currPool.name == '邂逅的旅人们') {
        obj_all_result.innerHTML = "<div>" + "本次抽卡" + total_num + "次,消费" + total_diamond_num + "钻石" +
            "</div>" +
            "<div>" + "抽到5星角色" + other_num + '次,4.5星角色' + other_half_num + '次' + "</div>";
    } else if (currPool.name == '历战的旅人们') {
        obj_all_result.innerHTML = "<div></div>"
    } else {
        var arrUpRoles = [];
        var arrUpRolesData = [];
        arr_ups.forEach(item => {
            var name = item.name;
            var indexThis = arrUpRoles.indexOf(name);
            if (indexThis >= 0) {
                arrUpRolesData[indexThis].count++
            } else {
                arrUpRoles.push(name);
                arrUpRolesData.push({
                    name: name,
                    count: 1
                })
            }
        })
        var arrNotUpRoles = [];
        var arrNotUpRolesData = [];
        arr_not_ups.forEach(item => {
            var name = item.name;
            var indexThis = arrNotUpRoles.indexOf(name);
            if (indexThis >= 0) {
                arrNotUpRolesData[indexThis].count++
            } else {
                arrNotUpRoles.push(name);
                arrNotUpRolesData.push({
                    name: name,
                    count: 1
                })
            }
        })


var obj_result_area = document.getElementsByClassName("result_area")[0];
        console.log(arrUpRoles)
obj_result_area.style = "display:flex;"
        console.log(arrUpRolesData)
console.log('1', arr_ups)
        console.log(arrNotUpRoles)
// 正常流程
        console.log(arrNotUpRolesData)
setTimeout(() => {


obj_result_area.style =
        var strUps = ""
"display:flex;background-image: url(https://i.17173cdn.com/g8bz6k/octopathsp/5/58/db_ck_bg.png?20240904091141);background-color:transparent;"
        arrUpRolesData.forEach(item => {
$(".img_ring").each(function() {
            strUps = strUps + ',' + item.name + ' ' + item.count + ''
$(this).css("display", "none")
        })
})
        if (strUps.length > 0) {
var obj_all_result = document.getElementsByClassName("all_Result")[0];
            strUps = '抽到 ' + strUps.substring(1);
if (currPool.name == '邂逅的旅人们') {
        } else {
obj_all_result.innerHTML = "<div>" + "本次抽卡" + total_num + "次,消费" + total_diamond_num + "钻石" +
            strUps = '暂未抽到当期UP角色';
"</div>" +
        }
"<div>" + "抽到5星角色" + other_num + ',4.5星角色' + other_half_num + '' + "</div>";
        var strNotUps = ""
} else if (currPool.name == '历战的旅人们') {
        arrNotUpRolesData.forEach(item => {
obj_all_result.innerHTML = "<div></div>"
            strNotUps = strNotUps + ',' + item.name + ' ' + item.count + '个'
} else {
        })
var arrUpRoles = [];
        if (strNotUps.length > 0) {
var arrUpRolesData = [];
            strNotUps = '其他5星角色  ' + strNotUps.substring(1) + ' 共计' + (other_num + other_half_num) + '个';
arr_ups.forEach(item => {
        } else {
var name = item.name;
            strNotUps = '暂未抽到其他5星角色';
var indexThis = arrUpRoles.indexOf(name);
        }
if (indexThis >= 0) {
        obj_all_result.innerHTML = "<div>" + "本次抽卡" + total_num + "次,消费" + total_diamond_num + "钻石" +
arrUpRolesData[indexThis].count++
            "</div>" +
} else {
            "<div>" + strUps + "</div>" +
arrUpRoles.push(name);
            // "抽到5星当期UP角色" + up_num + "次,4.5星当期UP角色" + up_half_num + "次</div>" +  
arrUpRolesData.push({
            // "<div>其他5星角色" +
name: name,
            // other_num + '次,其他4.5星角色' + other_half_num + '次' + "</div>" +
count: 1
            "<div>" + strNotUps + "</div>";
})
    }
}
    showResults();
})
}, 2500)
console.log(arrUpRoles)
console.log(arrUpRolesData)
var strUps = ""
arrUpRolesData.forEach(item => {
strUps = strUps + ',' + item.name + ' ' + item.count + '个'
})
if (strUps.length > 0) {
strUps = '抽到 ' + strUps.substring(1);
} else {
strUps = '暂未抽到当期UP角色';
}
obj_all_result.innerHTML = "<div>" + "本次抽卡" + total_num + "次,消费" + total_diamond_num + "钻石" +
"</div>" +
"<div>" + strUps + "</div>" +
// "抽到5星当期UP角色" + up_num + "次,4.5星当期UP角色" + up_half_num + "次</div>" +  
"<div>其他5星角色" +
other_num + '次,其他4.5星角色' + other_half_num + '次' + "</div>";
}
showResults();
}, 2500)




第821行: 第1,113行:


function showResults() {
function showResults() {
var str_html = "";
var str_html = "";
for (var i = 0; i < arr_result.length; i++) {
for (var i = 0; i < arr_result.length; i++) {
var objThis = arr_result[i];
    var objThis = arr_result[i];
str_html = str_html + "<div class='role_area'>" +
    str_html = str_html + "<div class='role_area'>" +
"<div class='text'>" + objThis.name + "</div>" +
        "<div class='text'>" + objThis.name + "</div>" +
"<div class='text'>";
        "<div class='text'>";
for (var j = 0; j < objThis.thisStar; j++) {
    for (var j = 0; j < objThis.thisStar; j++) {
str_html = str_html + "★"
        str_html = str_html + "★"
}
    }
if (objThis.maxStar > objThis.thisStar) {
    if (objThis.maxStar > objThis.thisStar) {
str_html = str_html + "☆"
        str_html = str_html + "☆"
}
    }




var roleData = getRoleDataWithRoleName(objThis.name);
    var roleData = getRoleDataWithRoleName(objThis.name);
var img_lh = "https://wiki.17173.com/octopathsp/thumb.php?f=角色立绘-角色编号" + roleData[0] + ".png&width=200x";
    if(roleData[0] == undefined || roleData[2] == undefined) {
var img_xs = "https://wiki.17173.com/octopathsp/thumb.php?f=" + roleData[2] + ".png&width=90x";
        console.log(roleData)
        debugger
    }
    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=90x";




str_html = str_html + "</div>" + "<img class='img' src='" + img_lh + "'/>" + "<img class='img_xs' src='" +
    str_html = str_html + "</div>" + "<img class='img' src='" + img_lh + "'/>" + "<img class='img_xs' src='" +
img_xs + "' />" + "</div>"
        img_xs + "' />" + "</div>"
}
}




$(".result_area").each(function() {
$(".result_area").each(function() {


$(this).html(str_html).load()
    $(this).html(str_html).load()
})
})


setTimeout(() => {
setTimeout(() => {
step = 0;
    step = 0;
}, 1000)
}, 1000)
}
}


function clickStart(count = 1) {
function clickStart(count = 1) {


if (step != 0) return
if (step != 0) return
step = 1;
step = 1;
max_result_level = 3;
max_result_level = 3;
arr_result = [];
arr_result = [];


if (currPool.step) {
if (currPool.step) {
if (stepPoolIndex >= currPool.stepCount.length) {
    if (stepPoolIndex >= currPool.stepCount.length) {
stepPoolIndex = 0
        stepPoolIndex = 0
}
    }
var countThis = currPool.stepCount[stepPoolIndex];
    var countThis = currPool.stepCount[stepPoolIndex];
total_num = total_num + count;
    total_num = total_num + count;
total_diamond_num = total_diamond_num + countThis * 30;
    total_diamond_num = total_diamond_num + countThis * 30;
stepPoolIndex = stepPoolIndex + 1;
    stepPoolIndex = stepPoolIndex + 1;




} else {
} else {
total_num = total_num + count;
    total_num = total_num + count;
total_diamond_num = total_diamond_num + count * 30;
    total_diamond_num = total_diamond_num + count * 30;
}
}




setTimeout(function() {
setTimeout(function() {
$("#window_area").css("background-color", "transparent");
    $("#window_area").css("background-color", "transparent");
}, 1000)
}, 1000)


var obj_result_area = document.getElementsByClassName("result_area")[0];
var obj_result_area = document.getElementsByClassName("result_area")[0];
obj_result_area.style = "display:none;background-color:#FFFFFF;"
obj_result_area.style = "display:none;background-color:#FFFFFF;"
obj_result_area.innerHTML = "";
obj_result_area.innerHTML = "";




getRoles(count);
getRoles(count);


}
}


function initPool(index) {
function initPool(index) {
try {
try {
if (pools.length > index) {
    if (pools.length > index) {
currPool = pools[index];
        currPool = pools[index];
} else {
    } else {
currPool = pools[0];
        currPool = pools[0];
}
    }
} catch (e) {
} catch (e) {
if (e.message == 'pools is not defined') {
    if (e.message == 'pools is not defined') {
setTimeout(() => {
        setTimeout(() => {
initPool(index)
            initPool(index)
}, 1000)
        }, 1000)
}
    }
}
}


poolName = currPool.name;
poolName = currPool.name;
poolRoleTyels = currPool.roleType;
poolRoleTyels = currPool.roleType;
numStep = [];
numStep = [];
stepPoolIndex = 0;
stepPoolIndex = 0;


var numCurr = 0;
var numCurr = 0;
poolRoleTyels.forEach(item => {
poolRoleTyels.forEach(item => {
numCurr = numCurr + item.num;
    numCurr = numCurr + item.num;
numStep.push(numCurr.toFixed(2))
    numStep.push(numCurr.toFixed(2))
})
})


$('#pool_title').html(poolName);
$('#pool_title').html(poolName);


if (currPool.btn_1) {
if (currPool.btn_1) {
$('#btn_start_1').css("display", "block")
    $('#btn_start_1').css("display", "block")
} else {
} else {
$('#btn_start_1').css("display", "none")
    $('#btn_start_1').css("display", "none")
}
}


if (currPool.btn_10) {
if (currPool.btn_10) {
$('#btn_start_10').css("display", "block")
    $('#btn_start_10').css("display", "block")
} else {
} else {
$('#btn_start_10').css("display", "none")
    $('#btn_start_10').css("display", "none")
}
}
}
}


function initFunc() {
function initFunc() {


$(document).ready(function() {
$(document).ready(function() {


var queryString = window.location.search;
    var queryString = window.location.search;
var urlParams = new URLSearchParams(queryString);
    var urlParams = new URLSearchParams(queryString);
var poolIndex = urlParams.get("index") || 0;
    var poolIndex = urlParams.get("index") || 0;
initPool(poolIndex)
    initPool(poolIndex)


for (var i = 0; i < pools.length; i++) {
    for (var i = 0; i < pools.length; i++) {
var poolThis = pools[i];
        var poolThis = pools[i];
var $button = $('<div>', {
        var $button = $('<div>', {
class: 'btn_change_pool',
            class: 'btn_change_pool',
text: poolThis.name,
            text: poolThis.name,
"index": i
            "index": i
}).on('click', function() {
        }).on('click', function() {
var dataIndex = $(this).attr("data-index");
            var dataIndex = $(this).attr("data-index");
var url = new URL(window.location.href);
            var url = new URL(window.location.href);
url.searchParams.set("index", dataIndex);
            url.searchParams.set("index", dataIndex);
window.location.href = url.href;
            window.location.href = url.href;
});
        });
$button.attr("data-index", i);
        $button.attr("data-index", i);
$('.change_pool').append($button);
        $('.change_pool').append($button);
}
    }






$('#btn_start_1').on("click", function() {
    $('#btn_start_1').on("click", function() {
clickStart(1)
        clickStart(1000)


});
    });
$('#btn_start_10').on("click", () => {
    $('#btn_start_10').on("click", () => {
clickStart(10)
        clickStart(10)
});
    });
$('#window_area').on("click", () => {
    $('#window_area').on("click", () => {
clickWindow()
        clickWindow()
});
    });
});
});


}
}


initFunc()
initFunc()

2024年10月1日 (二) 21:25的版本

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

// 亚芬、海茵特混池
var roles_hc_5 = [{
name: "亚芬",
isUp: true,
weight: 1
}, {
name: "海茵特",
isUp: true,
weight: 1
}];
// 卡杰斯
var role_sg_5 = [{
name: "卡杰斯",
isUp: true,
weight: 1
}]
// 尼尔
var roles_nier_5 = [{
name: "A2",
isUp: true,
weight: 1
}, {
name: "2B",
isUp: true,
weight: 1
}, {
name: "9S",
isUp: true,
weight: 1
}];
// 追忆 雷比娜
var roles_zy_5 = [{
    name: "雷比娜",
    isUp: true,
    weight: 1
}];
var roles_zy_5_other = [{
    name: "利夏尔",
    isUp:  false,
    weight: 1
}];
var roles_zy_5_step = [{
    name: "雷比娜",
    isUp: true,
    weight: 1
}, {
    name: "利夏尔",
    isUp: false,
    weight: 1
}];
// 卢米斯
var role_sg_5_2 = [{
    name: "卢米斯",
    isUp: true,
    weight: 1
}]

var pools = [{
    name: "追忆的旅人:雷比娜",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5 雷比娜
            num: 0.8,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: roles_zy_5
        },
        {
            // 4.5 雷比娜
            num: 0.4,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: roles_zy_5
        },{
            // 5 利夏尔
            num: 0.2,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_zy_5_other
        },
        {
            // 4.5 利夏尔
            num: 0.6,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_zy_5_other
        },
        {
            // 5其他
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5.concat(roles_5_new)
        },
        {
            // 4.5其他
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5.concat(roles_5_new)
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},{
    name: "追忆的旅人(阶梯):雷比娜",
    btn_1: false,
    btn_10: true,
    step: true,
    stepRole: roles_zy_5_step,
    stepCount: [7,8,10,10,10],
    roleType: [{
            // 5 雷比娜
            num: 0.8,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: roles_zy_5
        },
        {
            // 4.5 雷比娜
            num: 0.4,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: roles_zy_5
        },{
            // 5 利夏尔
            num: 0.2,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: roles_zy_5_other
        },
        {
            // 4.5 利夏尔
            num: 0.6,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: roles_zy_5_other
        },
        {
            // 5其他
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5.concat(roles_5_new)
        },
        {
            // 4.5其他
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5.concat(roles_5_new)
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},{
    name: "闪光的旅人:卢米斯",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5卢米斯
            num: 0.8,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: role_sg_5_2
        },
        {
            // 4.5卢米斯
            num: 0.4,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: role_sg_5_2
        },
        {
            // 5其他
            num: 1.2,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5.concat(roles_5_new)
        },
        {
            // 4.5其他
            num: 1.6,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5.concat(roles_5_new)
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},{
    name: "尼尔机械纪元:A2 2B 9S",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5 A2 2B 9S
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: roles_nier_5
        },
        {
            // 4.5 A2 2B 9S
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: roles_nier_5
        },
        {
            // 5其他
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "尼尔机械纪元(阶梯):A2 2B 9S",
    btn_1: false,
    btn_10: true,
    step: true,
    stepRole: roles_nier_5,
    stepCount: [7, 8, 10, 10, 10],
    roleType: [{
            // 5 A2 2B 9S
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: roles_nier_5
        },
        {
            // 4.5 A2 2B 9S
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: roles_nier_5
        },
        {
            // 5其他
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "闪光的旅人:卡杰斯",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5卡杰斯
            num: 0.8,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: role_sg_5
        },
        {
            // 4.5亚芬、海茵特
            num: 0.4,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: role_sg_5
        },
        {
            // 5其他
            num: 1.2,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 1.6,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "被选中的旅人:亚芬、海茵特",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5亚芬、海茵特
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: true,
            roles: roles_hc_5
        },
        {
            // 4.5亚芬、海茵特
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: true,
            roles: roles_hc_5
        },
        {
            // 5其他
            num: 1,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 1,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "邂逅的旅人们",
    btn_1: true,
    btn_10: true,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
            // 5其他
            num: 2,
            maxStar: 5,
            thisStar: 5,
            isUp: false,
            roles: roles_5
        },
        {
            // 4.5其他
            num: 2,
            maxStar: 5,
            thisStar: 4,
            isUp: false,
            roles: roles_5
        },
        {
            // 4星
            num: 18,
            maxStar: 4,
            thisStar: 4,
            isUp: false,
            roles: roles_4
        },
        {
            // 3.5星
            num: 40,
            maxStar: 4,
            thisStar: 3,
            isUp: false,
            roles: roles_4
        },
        {
            // 3星
            num: 38,
            maxStar: 3,
            thisStar: 3,
            isUp: false,
            roles: roles_3
        }
    ]
},
{
    name: "历战的旅人们",
    btn_1: true,
    btn_10: false,
    step: false,
    stepRole: [],
    stepCount: [],
    roleType: [{
        // 5其他
        num: 100,
        maxStar: 5,
        thisStar: 5,
        isUp: true,
        roles: roles_5
    }]
}
];

var updateDate = "2024年10月3日";
var currPool = {};
var poolName = "";
var poolRoleTyels = [];
var numStep = [];

var stepPoolIndex = 0;

var arr_result = [];
var max_result_level = 3;
var step = 0;


var total_num = 0;
var total_diamond_num = 0;
var up_num = 0;
var arr_ups = [];
var arr_not_ups = [];
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 getRoles(count = 1) {
for (var i = 0; i < count; i++) {
    cardResult(i);
}


$("#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(index) {

if (stepPoolIndex == 5 && index == 9) {
    var arrRolesThis = currPool.stepRole;
    var stepRoleTotalNum = 0;
    arrRolesThis.forEach(item => {
        stepRoleTotalNum = stepRoleTotalNum + item.weight;
    })
    var random_index = Math.floor(Math.random() * stepRoleTotalNum);
    for (var i = 0; i < arrRolesThis.length; i++) {
        var objThis = arrRolesThis[i];
        if (random_index < objThis.weight) {
            var result = JSON.parse(JSON.stringify(objThis));
            break;
        } else {
            random_index = random_index - objThis.weight;
        }
    }
    // var result = JSON.parse(JSON.stringify(arrRolesThis[random_index]));
    result.maxStar = 5;
    result.thisStar = 5;
    if (max_result_level < 5) {
        max_result_level = 5;
    }
    arr_result.push(result);
    if (result.isUp) {
        up_num = up_num + 1;
        arr_ups.push(result)
    } else {
        other_num = other_num + 1;
        arr_not_ups.push(result);
    }
} else {
    var result_num = Math.floor(Math.random() * 1000) / 10.0;
    for (var i = 0; i < numStep.length; i++) {
        var thisStep = numStep[i];
        if (result_num < thisStep) {
            var roleTypeThis = poolRoleTyels[i];
            var arrRolesThis = roleTypeThis.roles;
            var random_index = Math.floor(Math.random() * arrRolesThis.length);
            var result = JSON.parse(JSON.stringify(arrRolesThis[random_index]));
            result.maxStar = roleTypeThis.maxStar;
            result.thisStar = roleTypeThis.thisStar;
            if (max_result_level < roleTypeThis.thisStar) {
                max_result_level = roleTypeThis.thisStar;
            }
            arr_result.push(result);
            console.log(result)

            if (roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 5) {
                up_num = up_num + 1;
                arr_ups.push(result)
            } else if (!roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 5) {
                other_num = other_num + 1;
                arr_not_ups.push(result)
            } else if (roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 4) {
                up_half_num = up_half_num + 1;
                arr_ups.push(result)
            } else if (!roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 4) {
                other_half_num = other_half_num + 1;
                arr_not_ups.push(result)
            }

            break

        }
    }
}



}

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];
    if (currPool.name == '邂逅的旅人们') {
        obj_all_result.innerHTML = "<div>" + "本次抽卡" + total_num + "次,消费" + total_diamond_num + "钻石" +
            "</div>" +
            "<div>" + "抽到5星角色" + other_num + '次,4.5星角色' + other_half_num + '次' + "</div>";
    } else if (currPool.name == '历战的旅人们') {
        obj_all_result.innerHTML = "<div></div>"
    } else {
        var arrUpRoles = [];
        var arrUpRolesData = [];
        arr_ups.forEach(item => {
            var name = item.name;
            var indexThis = arrUpRoles.indexOf(name);
            if (indexThis >= 0) {
                arrUpRolesData[indexThis].count++
            } else {
                arrUpRoles.push(name);
                arrUpRolesData.push({
                    name: name,
                    count: 1
                })
            }
        })
        var arrNotUpRoles = [];
        var arrNotUpRolesData = [];
        arr_not_ups.forEach(item => {
            var name = item.name;
            var indexThis = arrNotUpRoles.indexOf(name);
            if (indexThis >= 0) {
                arrNotUpRolesData[indexThis].count++
            } else {
                arrNotUpRoles.push(name);
                arrNotUpRolesData.push({
                    name: name,
                    count: 1
                })
            }
        })

        console.log(arrUpRoles)
        console.log(arrUpRolesData)
        console.log(arrNotUpRoles)
        console.log(arrNotUpRolesData)

        var strUps = ""
        arrUpRolesData.forEach(item => {
            strUps = strUps + ',' + item.name + ' ' + item.count + '个'
        })
        if (strUps.length > 0) {
            strUps = '抽到 ' + strUps.substring(1);
        } else {
            strUps = '暂未抽到当期UP角色';
        }
        var strNotUps = ""
        arrNotUpRolesData.forEach(item => {
            strNotUps = strNotUps + ',' + item.name + ' ' + item.count + '个'
        })
        if (strNotUps.length > 0) {
            strNotUps = '其他5星角色  ' + strNotUps.substring(1) + ' 共计' + (other_num + other_half_num) + '个';
        } else {
            strNotUps = '暂未抽到其他5星角色';
        }
        obj_all_result.innerHTML = "<div>" + "本次抽卡" + total_num + "次,消费" + total_diamond_num + "钻石" +
            "</div>" +
            "<div>" + strUps + "</div>" +
            // "抽到5星当期UP角色" + up_num + "次,4.5星当期UP角色" + up_half_num + "次</div>" + 
            // "<div>其他5星角色" +
            // other_num + '次,其他4.5星角色' + other_half_num + '次' + "</div>" +
            "<div>" + strNotUps + "</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.thisStar; j++) {
        str_html = str_html + "★"
    }
    if (objThis.maxStar > objThis.thisStar) {
        str_html = str_html + "☆"
    }


    var roleData = getRoleDataWithRoleName(objThis.name);
    if(roleData[0] == undefined || roleData[2] == undefined) {
        console.log(roleData)
        debugger
    }
    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=90x";


    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 = [];

if (currPool.step) {
    if (stepPoolIndex >= currPool.stepCount.length) {
        stepPoolIndex = 0
    }
    var countThis = currPool.stepCount[stepPoolIndex];
    total_num = total_num + count;
    total_diamond_num = total_diamond_num + countThis * 30;
    stepPoolIndex = stepPoolIndex + 1;


} else {
    total_num = total_num + count;
    total_diamond_num = total_diamond_num + count * 30;
}


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 initPool(index) {
try {
    if (pools.length > index) {
        currPool = pools[index];
    } else {
        currPool = pools[0];
    }
} catch (e) {
    if (e.message == 'pools is not defined') {
        setTimeout(() => {
            initPool(index)
        }, 1000)
    }
}

poolName = currPool.name;
poolRoleTyels = currPool.roleType;
numStep = [];
stepPoolIndex = 0;

var numCurr = 0;
poolRoleTyels.forEach(item => {
    numCurr = numCurr + item.num;
    numStep.push(numCurr.toFixed(2))
})

$('#pool_title').html(poolName);

if (currPool.btn_1) {
    $('#btn_start_1').css("display", "block")
} else {
    $('#btn_start_1').css("display", "none")
}

if (currPool.btn_10) {
    $('#btn_start_10').css("display", "block")
} else {
    $('#btn_start_10').css("display", "none")
}
}

function initFunc() {

$(document).ready(function() {

    var queryString = window.location.search;
    var urlParams = new URLSearchParams(queryString);
    var poolIndex = urlParams.get("index") || 0;
    initPool(poolIndex)

    for (var i = 0; i < pools.length; i++) {
        var poolThis = pools[i];
        var $button = $('<div>', {
            class: 'btn_change_pool',
            text: poolThis.name,
            "index": i
        }).on('click', function() {
            var dataIndex = $(this).attr("data-index");
            var url = new URL(window.location.href);
            url.searchParams.set("index", dataIndex);
            window.location.href = url.href;
        });
        $button.attr("data-index", i);
        $('.change_pool').append($button);
    }



    $('#btn_start_1').on("click", function() {
        clickStart(1000)

    });
    $('#btn_start_10').on("click", () => {
        clickStart(10)
    });
    $('#window_area').on("click", () => {
        clickWindow()
    });
});

}

initFunc()