添加几个语言的基本排序

This commit is contained in:
枫谷剑仙 2020-03-01 00:39:34 +08:00
parent ac0d06e1a2
commit a35a459d05
8 changed files with 86 additions and 11 deletions

41
json_data.js Normal file
View File

@ -0,0 +1,41 @@
//类型允许的潜觉杀,前面的数字是官方数据的类型编号,后面的杀是自己做的图片中的潜觉序号
const type_allowable_latent = {
"0":[], //0进化
"12":[], //12觉醒
"14":[], //14强化
"15":[], //15卖钱
"9":[],//特殊保护
"1":[17,18,19,20,21,22,23,24], //1平衡
"2":[20,24],//2体力
"3":[18,22],//3回复
"4":[20,24],//4龙
"5":[19],//5神
"6":[19,23],//6攻击
"7":[17],//7恶魔
"8":[17,20,21,24],//8机械
};
//等效觉醒列表
const equivalent_awoken = [
{small:10,big:52,times:2}, //防封
{small:11,big:68,times:5}, //防暗
{small:12,big:69,times:5}, //防废
{small:13,big:70,times:5}, //防毒
{small:19,big:53,times:2}, //手指
{small:21,big:56,times:2}, //SB
];
//排序程序列表
const sort_function_list = [
{tag:"sort_none",name:"无",function:()=>0},
{tag:"sort_id",name:"怪物ID",function:(a,b)=>a.id-b.id},
{tag:"sort_evoRootId",name:"进化树",function:(a,b)=>a.evoRootId-b.evoRootId},
{tag:"sort_skillLv1",name:"技能最大冷却时间",function:(a,b)=>Skills[a.activeSkillId].initialCooldown-Skills[b.activeSkillId].initialCooldown},
{tag:"sort_skillLvMax",name:"技能最小冷却时间",function:(a,b)=>{
const skill_a = Skills[a.activeSkillId],skill_b = Skills[b.activeSkillId];
return (skill_a.initialCooldown - skill_a.maxLevel) - (skill_b.initialCooldown - skill_b.maxLevel)
}},
{tag:"sort_hpMax110",name:"最大HP(Lv110)",function:(a,b)=>a.hp.max * (1 + a.limitBreakIncr/100) - b.hp.max * (1 + b.limitBreakIncr/100)},
{tag:"sort_atkMax110",name:"最大攻击(Lv110)",function:(a,b)=>a.atk.max * (1 + a.limitBreakIncr/100) - b.atk.max * (1 + b.limitBreakIncr/100)},
{tag:"sort_rcvMax110",name:"最大回复(Lv110)",function:(a,b)=>a.rcv.max * (1 + a.limitBreakIncr/100) - b.rcv.max * (1 + b.limitBreakIncr/100)},
{tag:"sort_rarity",name:"稀有度",function:(a,b)=>a.rarity-b.rarity},
{tag:"sort_cost",name:"消耗",function:(a,b)=>a.cost-b.cost},
];

View File

@ -6,6 +6,13 @@
sort_none: "Nope",
sort_id: "Cards Id",
sort_evoRootId: "Cards Evolution Root",
sort_skillLv1: "Maximum Skill Turn",
sort_skillLvMax: "Minimum Skill Turn",
sort_hpMax110: "Max HP (Lv110)",
sort_atkMax110: "Max ATK (Lv110)",
sort_rcvMax110: "Max RCV (Lv110)",
sort_rarity: "Rarity",
sort_cost: "Cost",
},
}

View File

@ -3,9 +3,16 @@
title_blank: "入力タイトル",
detail_blank: "入力詳細",
sort_name:{
sort_none: "Nope",
sort_id: "Cards Id",
sort_evoRootId: "Cards Evolution Root",
sort_none: "いいえ",
sort_id: "カード ID",
sort_evoRootId: "カード進化ルート",
sort_skillLv1: "最大スキルターン",
sort_skillLvMax: "最小スキルターン",
sort_hpMax110: "最大HP (Lv110)",
sort_atkMax110: "最大攻撃 (Lv110)",
sort_rcvMax110: "最大回復 (Lv110)",
sort_rarity: "レアリティ",
sort_cost: "コスト",
},
}

View File

@ -3,9 +3,16 @@
title_blank: "입력 제목",
detail_blank: "입력 내용",
sort_name:{
sort_none: "Nope",
sort_id: "Cards Id",
sort_evoRootId: "Cards Evolution Root",
sort_none: "없음",
sort_id: "카드 ID",
sort_evoRootId: "카드 진화 루트",
sort_skillLv1: "최대 스킬 턴",
sort_skillLvMax: "최소 스킬 턴",
sort_hpMax110: "최대 HP (Lv110)",
sort_atkMax110: "최대 공격 (Lv110)",
sort_rcvMax110: "최대 회복 (Lv110)",
sort_rarity: "래리티",
sort_cost: "비용",
},
}

View File

@ -3,9 +3,16 @@
title_blank: "輸入隊伍標題",
detail_blank: "輸入說明",
sort_name:{
sort_none: "Nope",
sort_id: "Cards Id",
sort_evoRootId: "Cards Evolution Root",
sort_none: "無",
sort_id: "怪物ID",
sort_evoRootId: "進化樹",
sort_skillLv1: "技能最大冷卻時間",
sort_skillLvMax: "技能最小冷卻時間",
sort_hpMax110: "最大HP(Lv110)",
sort_atkMax110: "最大攻擊(Lv110)",
sort_rcvMax110: "最大回復(Lv110)",
sort_rarity: "稀有度",
sort_cost: "消耗",
},
}

View File

@ -915,8 +915,9 @@ function initialize()
const sortIndex = parseInt(s_sortList.value,10);
const reverse = s_sortReverse.checked;
const sortFunction = sort_function_list[sortIndex].function;
searchArr.sort((card_a,card_b)=>{
let sortNumber = sort_function_list[sortIndex].function(card_a,card_b);
let sortNumber = sortFunction(card_a,card_b);
if (reverse) sortNumber *= -1;
return sortNumber;
});

View File

@ -899,6 +899,11 @@ ul{
.setting-box .row-mon-id .open-search{
float: right;
}
.can-assist-label,
.sort-reverse-label
{
margin-left: 5px;
}
.edit-box .setting-row{
width: 100%;

View File

@ -312,7 +312,7 @@ function calculateAbility(member = null, assist = null, solo = true)
//搜索卡片用
function searchCards(cards,attr1,attr2,fixMainColor,types,awokens,sawokens,equalAk,incSawoken)
{
let cardsRange = cards;
let cardsRange = cards.concat(); //这里需要复制一份原来的数组不然若无筛选后面的排序会改变初始Cards
//属性
if (attr1 != null && attr1 === attr2)
{ //当两个颜色相同时,主副一样颜色的只需判断一次