| @@ -487,6 +487,16 @@ var formation = new Formation(teamsCount,5); | |||
| <!--<li><input type="checkbox" class="type-check" name="types" value="9" id="search-type-9" /><label class="display-none" data-type-icon="9" for="search-type-9"></label></li>--><!--特别保护--> | |||
| </ul> | |||
| <input type="checkbox" class="config-checkbox-ipt" name="type-and-or" id="type-and-or" checked><label class="config-checkbox-lbl type-and-or-label" for="type-and-or"><div class="config-checkbox-lbl-cicle"></div></label> | |||
| <ul class="latent-list"> | |||
| <li class="latent-icon" data-latent-icon="20"></li><!--神杀--> | |||
| <li class="latent-icon" data-latent-icon="21"></li><!--龙杀--> | |||
| <li class="latent-icon" data-latent-icon="22"></li><!--恶魔杀--> | |||
| <li class="latent-icon" data-latent-icon="23"></li><!--机械杀--> | |||
| <li class="latent-icon" data-latent-icon="24"></li><!--平衡杀--> | |||
| <li class="latent-icon" data-latent-icon="25"></li><!--攻击杀--> | |||
| <li class="latent-icon" data-latent-icon="26"></li><!--体力杀--> | |||
| <li class="latent-icon" data-latent-icon="27"></li><!--回复杀--> | |||
| </ul> | |||
| </div> | |||
| <div class="awoken-div"><!--觉醒--> | |||
| <button class="awoken-clear" ></button> | |||
| @@ -28,15 +28,16 @@ const typekiller_for_type = [ | |||
| {type:3,awoken:38,latent:27,typeKiller:[4,6]}, //3回复 | |||
| {type:9,awoken:null,latent:null,typeKiller:[]}, //特殊保护 | |||
| ]; | |||
| typekiller_for_type.forEach(t=> | |||
| t.typeKiller.push(0,12,14,15) //补充4种特殊杀 | |||
| ); | |||
| //类型允许的潜觉杀 | |||
| const type_allowable_latent = []; | |||
| typekiller_for_type.forEach(t=> | |||
| type_allowable_latent[t.type] = t.typeKiller.map(tn=> | |||
| typekiller_for_type.find(_t=>_t.type == tn).latent | |||
| ) | |||
| { | |||
| t.allowableLatent = t.typeKiller.concat([0,12,14,15]) //补充4种特殊杀 | |||
| .map(tn=> | |||
| typekiller_for_type.find(_t=>_t.type == tn).latent | |||
| ); | |||
| type_allowable_latent[t.type] = t.allowableLatent; | |||
| } | |||
| ); | |||
| //等效觉醒列表 | |||
| const equivalent_awoken = [ | |||
| @@ -835,16 +835,55 @@ function initialize() { | |||
| const s_typesLi = Array.from(s_typesUl.querySelectorAll("li")); | |||
| const s_typesCheckBox = s_typesLi.map(li=>li.querySelector(".type-check")); | |||
| s_typesCheckBox.forEach(checkBox=> | |||
| checkBox.onchange = function(){ | |||
| const newClassName = `type-killer-${this.value}`; | |||
| if (this.checked && s_typeAndOr.checked) | |||
| s_typesUl.classList.add(newClassName); | |||
| else | |||
| s_typesUl.classList.remove(newClassName); | |||
| { | |||
| checkBox.onchange = function(){ | |||
| const newClassName = `type-killer-${this.value}`; | |||
| if (this.checked && s_typeAndOr.checked) //and的时候才生效 | |||
| s_typesUl.classList.add(newClassName); | |||
| else | |||
| s_typesUl.classList.remove(newClassName); | |||
| } | |||
| } | |||
| ); | |||
| const s_types_latentUl = s_typesDiv.querySelector(".latent-list"); | |||
| const s_types_latentli = Array.from(s_types_latentUl.querySelectorAll("li")); | |||
| s_types_latentli.forEach(latent=> | |||
| { | |||
| latent.onclick = function(){ | |||
| const latenttype = parseInt(this.getAttribute("data-latent-icon")); | |||
| const killerTypes = typekiller_for_type.filter(o=>o.allowableLatent.includes(latenttype)).map(o=>o.type); | |||
| s_typesCheckBox.forEach(checkbox=>{ | |||
| const type = parseInt(checkbox.value); | |||
| checkbox.checked = killerTypes.includes(type); | |||
| }); | |||
| }; | |||
| }); | |||
| /* const s_typesCheckBoxIcon = s_typesLi.map(li=>li.querySelector(".type-icon")); | |||
| s_typesCheckBoxIcon.forEach(icon=> | |||
| { | |||
| icon.onclick = function(e){ | |||
| console.log(e,s_typeAndOr.checked); | |||
| if (!s_typeAndOr.checked) //or的时候才生效 | |||
| { | |||
| const type = parseInt(this.getAttribute("data-type-icon")); | |||
| const killerTypes = typekiller_for_type.filter(o=>o.typeKiller.includes(type)).map(o=>o.type); | |||
| console.log(killerTypes); | |||
| s_typesCheckBox.forEach(checkbox=>{ | |||
| const type = parseInt(checkbox.value); | |||
| checkbox.checked = killerTypes.includes(type); | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| ); | |||
| */ | |||
| s_typeAndOr.onchange = function(){ | |||
| s_typesCheckBox.forEach(checkBox=>checkBox.onchange()); | |||
| if (this.checked) | |||
| s_types_latentUl.classList.add(className_displayNone); | |||
| else | |||
| s_types_latentUl.classList.remove(className_displayNone); | |||
| }; | |||
| s_typeAndOr.onchange(); | |||
| @@ -437,6 +437,16 @@ var formation = new Formation(teamsCount,6); | |||
| <!--<li><input type="checkbox" class="type-check" name="types" value="9" id="search-type-9" /><label class="display-none" data-type-icon="9" for="search-type-9"></label></li>--><!--特别保护--> | |||
| </ul> | |||
| <input type="checkbox" class="config-checkbox-ipt" name="type-and-or" id="type-and-or" checked><label class="config-checkbox-lbl type-and-or-label" for="type-and-or"><div class="config-checkbox-lbl-cicle"></div></label> | |||
| <ul class="latent-list"> | |||
| <li class="latent-icon" data-latent-icon="20"></li><!--神杀--> | |||
| <li class="latent-icon" data-latent-icon="21"></li><!--龙杀--> | |||
| <li class="latent-icon" data-latent-icon="22"></li><!--恶魔杀--> | |||
| <li class="latent-icon" data-latent-icon="23"></li><!--机械杀--> | |||
| <li class="latent-icon" data-latent-icon="24"></li><!--平衡杀--> | |||
| <li class="latent-icon" data-latent-icon="25"></li><!--攻击杀--> | |||
| <li class="latent-icon" data-latent-icon="26"></li><!--体力杀--> | |||
| <li class="latent-icon" data-latent-icon="27"></li><!--回复杀--> | |||
| </ul> | |||
| </div> | |||
| <div class="awoken-div"><!--觉醒--> | |||
| <button class="awoken-clear" ></button> | |||
| @@ -989,6 +989,18 @@ ul{ | |||
| { | |||
| display: block; | |||
| } | |||
| .types-div .latent-list .latent-icon | |||
| { | |||
| cursor: pointer; | |||
| box-shadow: none; | |||
| } | |||
| .types-div .latent-list .latent-icon:before | |||
| { | |||
| margin-left: -23px; | |||
| margin-right: -25px; | |||
| margin-top: -3px; | |||
| margin-bottom: -5px; | |||
| } | |||
| /*.search-box .awoken-div::before{ | |||
| content: "觉醒"; | |||
| }*/ | |||
| @@ -1132,6 +1132,16 @@ var formation = new Formation(teamsCount,6); | |||
| <!--<li><input type="checkbox" class="type-check" name="types" value="9" id="search-type-9" /><label class="display-none" data-type-icon="9" for="search-type-9"></label></li>--><!--特别保护--> | |||
| </ul> | |||
| <input type="checkbox" class="config-checkbox-ipt" name="type-and-or" id="type-and-or" checked><label class="config-checkbox-lbl type-and-or-label" for="type-and-or"><div class="config-checkbox-lbl-cicle"></div></label> | |||
| <ul class="latent-list"> | |||
| <li class="latent-icon" data-latent-icon="20"></li><!--神杀--> | |||
| <li class="latent-icon" data-latent-icon="21"></li><!--龙杀--> | |||
| <li class="latent-icon" data-latent-icon="22"></li><!--恶魔杀--> | |||
| <li class="latent-icon" data-latent-icon="23"></li><!--机械杀--> | |||
| <li class="latent-icon" data-latent-icon="24"></li><!--平衡杀--> | |||
| <li class="latent-icon" data-latent-icon="25"></li><!--攻击杀--> | |||
| <li class="latent-icon" data-latent-icon="26"></li><!--体力杀--> | |||
| <li class="latent-icon" data-latent-icon="27"></li><!--回复杀--> | |||
| </ul> | |||
| </div> | |||
| <div class="awoken-div"><!--觉醒--> | |||
| <button class="awoken-clear" ></button> | |||