|
|
(未显示同一用户的2个中间版本) |
第1行: |
第1行: |
| var roles_3 = [
| | <div class="ck_main_area"> |
| { | | <div class="title" id="pool_title"></div> |
| name: '马努埃尔',
| | <div class="window_area" id="window_area"> |
| },
| | <div class="img_ring ring_0" id="ring_0">[[File:db_ck_ring0.jpg|link=]]</div> |
| {
| | <div class="img_ring ring_1" id="ring_1">[[File:db_ck_ring1.jpg|link=]]</div> |
| name: '伊布林',
| | <div class="img_ring ring_2" id="ring_2">[[File:db_ck_ring2.jpg|link=]]</div> |
| },
| | <div class="result_area"> |
| {
| | </div> |
| name: '哈利',
| | </div> |
| },
| | <div class="btns_area"> |
| {
| | <div class="btn_start" id="btn_start_1">抽卡</div> |
| name: '霍尔赫',
| | <div class="btn_start" id="btn_start_10">抽卡*10</div> |
| },
| | </div> |
| {
| | <div class="all_Result"></div> |
| name: '萨莉亚',
| | <div class="tips"><div class="tips">当前功能为测试版</div><div class="tips">实际抽卡概率请以游戏内为准</div></div> |
| },
| | <div class="">切换至其他卡池</div> |
| {
| | <div class="change_pool"></div> |
| name: '佩妮',
| | </div> |
| },
| | |
| {
| | {{#css: |
| name: '迪艾格',
| | |
| },
| | .ck_main_area * { |
| {
| | margin: 0; |
| name: '费丽妮',
| | padding: 0; |
| },
| | color: #000000; |
| {
| | } |
| name: '比利',
| | |
| },
| | .ck_main_area { |
| {
| | width: 100%; |
| name: '赫塞',
| | margin: auto; |
| },
| | padding: 0; |
| {
| | color: #000000; |
| name: '帕尔',
| | max-width: 800px; |
| },
| | min-width: 350px; |
| {
| | min-height: 220px; |
| name: '特利',
| | } |
| },
| | .ck_main_area .title{ |
| {
| | text-align: center; |
| name: '弗昂',
| | } |
| },
| | .ck_main_area .change_pool{ |
| {
| | cursor:pointer; |
| name: '卡萝尔',
| | text-decoration: underline; |
| },
| | } |
| {
| | |
| name: '科妮',
| | |
| },
| | .ck_main_area * { |
| {
| | box-sizing: border-box; |
| name: '古提',
| | } |
| },
| | |
| {
| | .ck_main_area .window_area { |
| name: '薇薇安',
| | width: 100%; |
| },
| | aspect-ratio: 800/ 500; |
| {
| | background-color: #000000; |
| name: '萨妮',
| | position: relative; |
| },
| | } |
| {
| | |
| name: '伍格',
| | .ck_main_area .window_area .img_ring { |
| },
| | width: 100%; |
| {
| | height: 100%; |
| name: '南娜',
| | position: absolute; |
| },
| | left: 0; |
| {
| | top: 0; |
| name: '梅妮',
| | display: none; |
| },
| | } |
| {
| | |
| name: '弗利欧',
| | .ck_main_area .window_area .img_ring.ring { |
| },
| | animation: ring_in; |
| {
| | animation-duration: 3s; |
| name: '尤妮丝',
| | /* animation-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1); */ |
| },
| | animation-timing-function: linear; |
| {
| | animation-fill-mode: forwards; |
| name: '多利',
| | position: absolute; |
| },
| | left: 0; |
| ];
| | top: 65px; |
| var roles_4 = [
| | display: none; |
| {
| | } |
| name: '普利基特',
| | |
| },
| | .ck_main_area .window_area .img_ring img { |
| {
| | width: 100%; |
| name: '洛洛',
| | aspect-ratio: 800 / 500; |
| },
| | } |
| {
| | |
| name: '雪娜',
| | .ck_main_area .window_area .result_area { |
| },
| | width: 100%; |
| {
| | height: 100%; |
| name: '约伦',
| | padding: 0 20px 20px 20px; |
| },
| | background-color: #FFFFFF; |
| {
| | background-size: 100% 100%; |
| name: '勒凡',
| | background-repeat: no-repeat; |
| },
| | animation: window_white; |
| {
| | animation-duration: 2s; |
| name: '波拉',
| | animation-timing-function: linear; |
| },
| | animation-fill-mode: forwards; |
| {
| | display: none; |
| name: '艾弗伦',
| | flex-direction: row; |
| },
| | align-items: center; |
| {
| | flex-wrap: wrap; |
| name: '肯尼斯',
| | justify-content: center; |
| },
| | overflow: hidden; |
| {
| | } |
| name: '科尔尼利亚',
| | |
| },
| | .ck_main_area .window_area .result_area .role_area { |
| {
| | width: 18%; |
| name: '杜兰',
| | aspect-ratio: 130 / 190; |
| },
| | padding-top: 10px; |
| {
| | margin: 2px; |
| name: '纳尔',
| | text-align: center; |
| },
| | font-size: 12px; |
| {
| | line-height: 20px; |
| name: '梅贝儿',
| | position: relative; |
| },
| | } |
| {
| | |
| name: '伊利斯',
| | .ck_main_area .window_area .result_area .role_area .text { |
| },
| | text-align: left; |
| {
| | margin-left: 10px; |
| name: '法维欧',
| | white-space: nowrap; |
| },
| | overflow: hidden; |
| {
| | text-overflow: ellipsis; |
| name: '莉塔',
| | line-height: 16px; |
| },
| | } |
| {
| | |
| name: '歇尔薇',
| | .ck_main_area .window_area .result_area .role_area .img { |
| },
| | width: 100%; |
| {
| | aspect-ratio: 1; |
| name: '罗迪恩',
| | } |
| },
| | |
| {
| | .ck_main_area .window_area .result_area .role_area .img_xs { |
| name: '玛德蕾妮',
| | position: absolute; |
| },
| | right: 0; |
| {
| | bottom: 0; |
| name: '诺艾尔',
| | width: 50%; |
| },
| | height: auto; |
| {
| | } |
| name: '塞德里克',
| | |
| },
| | .ck_main_area .btns_area { |
| {
| | display: flex; |
| name: '梅诺',
| | flex-direction: row; |
| },
| | justify-content: space-around; |
| {
| | } |
| name: '巴拉德',
| | |
| },
| | .ck_main_area .btns_area .btn_start { |
| {
| | cursor: pointer; |
| name: '贝尔加',
| | width: 120px; |
| },
| | text-align: center; |
| {
| | padding: 4px 0; |
| name: '阿孜莱特',
| | margin-bottom: 10px; |
| },
| | margin-top: 10px; |
| {
| | border: 4px solid #000000; |
| 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: '哈雷'
| |
| },
| |
| {
| |
| name: '索蕾犹'
| |
| },
| |
| {
| |
| name: '爱丽莎'
| |
| },
| |
| {
| |
| name: '泰里翁'
| |
| },
| |
| {
| |
| name: '莫露露'
| |
| },
| |
| {
| |
| name: '贝兹'
| |
| },
| |
| {
| |
| name: '闪达'
| |
| }
| |
| ];
| |
| var roles_5_new = []
| |
| var step_count = [7,8,10,10,10]
| |
| | |
| // 卢米斯 | |
| var role_sg_5_2 = [{
| |
| name: "卢米斯",
| |
| isUp: true,
| |
| weight: 1
| |
| }]
| |
| // 江连
| |
| var role_sg_5 = [{
| |
| name: "江连",
| |
| isUp: true,
| |
| weight: 1
| |
| }]
| |
| // 追忆 克拉乌泽 | |
| var roles_zy_5_2 = [{
| |
| name: "克拉乌泽",
| |
| isUp: true,
| |
| weight: 1
| |
| }];
| |
| var roles_zy_5_other_2 = [{
| |
| name: "利夏尔",
| |
| isUp: false,
| |
| weight: 1
| |
| },{
| |
| name: "雷比娜",
| |
| isUp: false,
| |
| weight: 1
| |
| }];
| |
| var roles_zy_5_step_2 = [{
| |
| name: "克拉乌泽",
| |
| isUp: true,
| |
| weight: 2
| |
| },{
| |
| name: "雷比娜",
| |
| isUp: false,
| |
| weight: 1
| |
| }, {
| |
| name: "利夏尔",
| |
| isUp: false,
| |
| weight: 1
| |
| }];
| |
| // 圣炎:泽妮亚 | |
| var roles_sy_5 = [
| |
| {
| |
| name: "泽妮亚",
| |
| isUp: true,
| |
| weight: 1
| |
| }
| |
| ]
| |
| var roles_sy_5_other = [
| |
| {
| |
| name: "奥黛特",
| |
| isUp: false, | |
| weight: 1 | |
| },
| |
| {
| |
| name: "多萝德娅",
| |
| isUp: false, | |
| weight: 1
| |
| }
| |
| ]
| |
| var roles_sy_5_step = [
| |
| {
| |
| name: "泽妮亚",
| |
| isUp: true,
| |
| weight: 2
| |
| },
| |
| {
| |
| name: "奥黛特",
| |
| isUp: false,
| |
| weight: 1
| |
| },
| |
| {
| |
| name: "多萝德娅",
| |
| isUp: false,
| |
| weight: 1
| |
| }
| |
| ]
| |
| // 联动:三角战略 | |
| var roles_sj_5 = [
| |
| {
| |
| name: "芙蕾德丽卡",
| |
| keyName: "芙德丽卡",
| |
| isUp: true, | |
| weight: 1 | |
| },
| |
| { | |
| 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_sj_5
| |
| }, | |
| {
| |
| // 4.5 芙蕾德丽卡 罗兰
| |
| num: 0.4,
| |
| maxStar: 5,
| |
| thisStar: 4,
| |
| isUp: true,
| |
| roles: roles_sj_5
| |
| },
| |
| {
| |
| // 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: "联动:三角战略(阶梯)", | |
| btn_1: false,
| |
| btn_10: true, | |
| step: true,
| |
| stepRole: roles_sj_5, | |
| stepCount: step_count,
| |
| roleType: [{
| |
| // 5 芙蕾德丽卡 罗兰
| |
| num: 0.8,
| |
| maxStar: 5,
| |
| thisStar: 5,
| |
| isUp: true,
| |
| roles: roles_sj_5
| |
| },
| |
| { | |
| // 4.5 芙蕾德丽卡 罗兰
| |
| num: 0.4,
| |
| maxStar: 5,
| |
| thisStar: 4,
| |
| isUp: true,
| |
| roles: roles_sj_5
| |
| }, | |
| {
| |
| // 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: "圣炎的引导:泽妮亚", | |
| btn_1: true,
| |
| btn_10: true,
| |
| step: false,
| |
| stepRole: [],
| |
| stepCount: [],
| |
| roleType: [
| |
| { | |
| // 5 泽妮亚
| |
| num: 0.8,
| |
| maxStar: 5,
| |
| thisStar: 5,
| |
| isUp: true,
| |
| roles: roles_sy_5
| |
| },
| |
| { | |
| // 4.5 泽妮亚
| |
| num: 0.4,
| |
| maxStar: 5,
| |
| thisStar: 4,
| |
| isUp: true,
| |
| roles: roles_sy_5
| |
| },{
| |
| // 5 其他圣炎
| |
| num: 0.2,
| |
| maxStar: 5,
| |
| thisStar: 5,
| |
| isUp: false,
| |
| roles: roles_sy_5_other
| |
| },
| |
| {
| |
| // 4.5 其他圣炎
| |
| num: 0.6,
| |
| maxStar: 5,
| |
| thisStar: 4,
| |
| isUp: false,
| |
| roles: roles_sy_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: 96,
| |
| maxStar: 4,
| |
| thisStar: 4,
| |
| isUp: false,
| |
| roles: roles_4
| |
| }
| |
| ] | |
| },
| |
| { | |
| 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.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: "闪光的旅人:卢米斯", | |
| 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 | |
| } | | } |
| ] | | |
| },
| | .ck_main_area .all_Result { |
| {
| | width: 100%; |
| name: "邂逅的旅人们",
| | font-size: 12px; |
| btn_1: true,
| | text-align: center; |
| btn_10: true,
| | min-height: 54px; |
| step: false,
| |
| stepRole: [],
| |
| stepCount: [],
| |
| roleType: [{
| |
| // 5其他
| |
| num: 2,
| |
| maxStar: 5,
| |
| thisStar: 5,
| |
| isUp: false,
| |
| roles: roles_5.concat(roles_5_new)
| |
| },
| |
| { | |
| // 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 | |
| } | | } |
| ] | | |
| },
| | .ck_main_area .tips { |
| {
| | color: gray; |
| name: "历战的旅人们",
| | font-size: 12px; |
| btn_1: true,
| | text-align: center; |
| btn_10: false,
| |
| step: false,
| |
| stepRole: [],
| |
| stepCount: [],
| |
| roleType: [{
| |
| // 5其他 | |
| num: 100,
| |
| maxStar: 5,
| |
| thisStar: 5,
| |
| isUp: true,
| |
| roles: roles_5.concat(roles_5_new)
| |
| }]
| |
| }
| |
| ];
| |
| | |
| var updateDate = "2024年10月10日";
| |
| 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]));
| | @keyframes ring_in { |
| result.maxStar = 5;
| | 0% { |
| result.thisStar = 5;
| | left: 0px; |
| if (max_result_level < 5) {
| | scale: 0; |
| 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)
| | 100% { |
| | | left: 140px; |
| if (roleTypeThis.isUp && result.maxStar == 5 && result.thisStar == 5) { | | scale: 1; |
| 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
| |
|
| |
| } | | } |
| } | | |
| }
| | @keyframes window_white { |
| | | 0% { |
| | | opacity: 0; |
| | |
| }
| |
| | |
| 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 = [];
| | 100% { |
| var arrNotUpRolesData = [];
| | opacity: 1; |
| 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 + "钻石" +
| | @media screen and (max-width: 600px) { |
| "</div>" +
| | .ck_main_area .window_area .result_area .role_area .text { |
| "<div>" + strUps + "</div>" +
| | font-size: 8px !important; |
| // "抽到5星当期UP角色" + up_num + "次,4.5星当期UP角色" + up_half_num + "次</div>" +
| | margin-left:0; |
| // "<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.keyName || 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);
| |
| } | | } |
| | | }} |
| | | |
| | | {{ResourceLoader|MediaWiki:Db_role_data.js|isModuleES6=true}} |
| $('#btn_start_1').on("click", function() { | | {{ResourceLoader|MediaWiki:Ck_main_dev.js|isModuleES6=true}} |
| clickStart(1)
| |
| | |
| }); | |
| $('#btn_start_10').on("click", () => { | |
| clickStart(10)
| |
| });
| |
| $('#window_area').on("click", () => { | |
| clickWindow()
| |
| });
| |
| }); | |
| | |
| }
| |
| | |
| initFunc()
| |