稀有度星级不同/相同的变化

This commit is contained in:
枫谷剑仙 2022-11-19 00:56:30 +08:00
parent 47ef2d5ea5
commit e88b37d009
5 changed files with 82 additions and 47 deletions

View File

@ -135,7 +135,7 @@
compo_type_series: tp`隊員組成全為 ${'ids'} 合作時`,
compo_type_evolution: tp`隊員組成全為 ${'ids'} 進化時`,
compo_type_team_total_rarity: tp`隊伍的總★稀有度 ≤${'rarity'}`,
compo_type_team_rarity_different: tp`隊伍的稀有度各不相同`,
compo_type_team_same_rarity: tp`隊伍的稀有度都為${'rarity'}`,
stage_less_or_equal: tp`${'stage'}${'max'}`, //地下城层数
stage_greater_or_equal: tp`${'stage'}${'min'}`,
@ -214,6 +214,8 @@
affix_awakening: tp`${'cotent'}覺醒`, //詞綴-覺醒
affix_exclude: tp`${'cotent'}以外`, //詞綴-屬性
each_time: tp`每一次`,
different: tp`不同`,
same: tp`相同`,
},
attrs: {
[0]: tp`${'icon'}`,

View File

@ -135,7 +135,7 @@
compo_type_series: tp`队员组成全为 ${'ids'} 合作时`,
compo_type_evolution: tp`队员组成全为 ${'ids'} 进化时`,
compo_type_team_total_rarity: tp`队伍的总★稀有度 ≤${'rarity'}`,
compo_type_team_rarity_different: tp`队伍的稀有度各不相同`,
compo_type_team_same_rarity: tp`队伍的稀有度都为${'rarity'}`,
stage_less_or_equal: tp`${'stage'}${'max'}`, //地下城层数
stage_greater_or_equal: tp`${'stage'}${'min'}`,
@ -215,6 +215,8 @@
affix_awakening: tp`${'cotent'}觉醒`, //词缀-觉醒
affix_exclude: tp`${'cotent'}以外`, //词缀-属性
each_time: tp`每一次`,
different: tp`不同`,
same: tp`相同`,
},
attrs: {
[0]: tp`${'icon'}`,

View File

@ -151,7 +151,7 @@ let localTranslating = {
compo_type_series: tp`When all subs from ${'ids'} collab (Needs at least 1 sub), `,
compo_type_evolution: tp`When all monsters in team are ${'ids'}, `,
compo_type_team_total_rarity: tp`When the total ★ rarity of the team is ≤${'rarity'}, `,
compo_type_team_rarity_different: tp`When the team's rarity is different, `,
compo_type_team_same_rarity: tp`When the ★ rarity of the team is ${'rarity'}, `,
stage_less_or_equal: tp`When ${'stage'}${'max'}, `,
stage_greater_or_equal: tp`When ${'stage'}${'min'}, `,
@ -231,6 +231,8 @@ let localTranslating = {
affix_awakening: tp`${'cotent'} awoken`,
affix_exclude: tp`, exclude ${'cotent'}`,
each_time: tp`each time`,
different: tp`different`,
same: tp`the same`,
},
attrs: {
[0]: tp`${'icon'}Fire`,
@ -3248,12 +3250,26 @@ const specialSearchFunctions = (function() {
return `★≤${sk[0]}`;
}
},
{name:"Team's rarity required different",otLangName:{chs:"要求队员稀有度各不相同",cht:"要求隊員稀有度各不相同"},
{name:"Team's rarity required different",otLangName:{chs:"要求队员稀有度相同/各不相同",cht:"要求隊員稀有度相同/各不相同"},
function:cards=>cards.filter(card=>{
const searchTypeArray = [245];
const skill = getCardLeaderSkill(card, searchTypeArray);
return skill;
})
}),
addition:card=>{
const searchTypeArray = [245];
const skill = getCardLeaderSkill(card, searchTypeArray);
if (!skill) return;
const sk = skill.params;
switch (sk[0]) {
case -1:
return `★各不相同`;
case -2:
return `★全部相同`;
default:
return `★全为${sk[0]}`;
}
}
},
]},
{group:true,name:"-----Extra Effects-----",otLangName:{chs:"-----附加效果-----",cht:"-----附加效果-----"}, functions: [

View File

@ -1098,7 +1098,7 @@ const parsers = {
[58](attr, min, max) { return damageEnemy('all', attr, v.randomATK(min, max)); },
[59](attr, min, max) { return damageEnemy('single', attr, v.randomATK(min, max)); },
[60](turns, mul, attr) { return activeTurns(turns, counterAttack(attr, v.percent(100), v.percent(mul))); },
[61](attrs, min, base, bonus, max) { return powerUp(null, null, p.scaleAttrs(flags(attrs), min, max ?? min, [base, 100], [bonus, 0])); },
[61](attrs, min, base, bonus, stage) { return powerUp(null, null, p.scaleAttrs(flags(attrs), min, min + (stage ?? 0), [base, 100], [bonus, 0])); },
[62](type, mul) { return powerUp(null, [type], p.mul({ hp: mul, atk: mul })); },
[63](type, mul) { return powerUp(null, [type], p.mul({ hp: mul, rcv: mul })); },
[64](type, mul) { return powerUp(null, [type], p.mul({ atk: mul, rcv: mul })); },
@ -1582,8 +1582,8 @@ const parsers = {
}
return activeTurns(turns, boardSizeChange(width, height));
},
[245](_1, _2, _3, hp, atk, rcv) { //全员满足某种情况,现在是全部星级不一样
return powerUp(null, null, p.mul({ hp: hp || 100, atk: atk || 100, rcv: rcv || 100 }), c.compo('team-rarity-diffrent', flags(_2)));
[245](rarity, _2, _3, hp, atk, rcv) { //全员满足某种情况,现在是全部星级不一样
return powerUp(flags(_2), null, p.mul({ hp: hp || 100, atk: atk || 100, rcv: rcv || 100 }), c.compo('team-same-rarity', rarity));
},
[1000](type, pos, ...ids) {
const posType = (type=>{
@ -1598,40 +1598,6 @@ const parsers = {
},
};
//将内容添加到代码片段
DocumentFragment.prototype.ap = function(...args)
{
args.forEach(arg=>{
if (Array.isArray(arg)) //数组,递归自身
{
arg.forEach(item=>this.ap(item));
}
else //其他内容的转换为文字添加
{
this.append(arg);
}
}, this);
return this;
}
//将数组和分隔符添加到一个代码片段类似join
Array.prototype.nodeJoin = function(separator)
{
const frg = document.createDocumentFragment();
this.forEach((item, idx, arr)=>{
frg.ap(item);
if (idx < (arr.length - 1) && separator !== undefined)
frg.ap(separator instanceof Node ? separator.cloneNode(true) : separator);
});
return frg;
}
//按住Ctrl点击技能在控制台输出技能的对象
function showParsedSkill(event) {
if (event.ctrlKey) {
//const skillId = parseInt(this.getAttribute("data-skill-id"));
console.log(this.skill);
}
}
function renderSkillTitle(skillId) {
const skill = Skills[skillId];
@ -1656,6 +1622,13 @@ function renderSkillTitle(skillId) {
function renderSkillEntry(skills)
{
//按住Ctrl点击技能在控制台输出技能的对象
function showParsedSkill(event) {
if (event.ctrlKey) {
//const skillId = parseInt(this.getAttribute("data-skill-id"));
console.log(this.skill);
}
}
const ul = document.createElement("ul");
ul.className = "card-skill-list";
skills.forEach(skill=>{
@ -2803,8 +2776,19 @@ function renderCondition(cond) {
frg.ap(tsp.cond.compo_type_team_total_rarity(dict));
break;
}
case 'team-rarity-diffrent':{
frg.ap(tsp.cond.compo_type_team_rarity_different(dict));
case 'team-same-rarity':{
let rarity = cond.compo.ids;
switch (rarity) {
case -1:
dict.rarity = tsp.word.different();
break;
case -2:
dict.rarity = tsp.word.same();
break;
default:
dict.rarity = rarity;
}
frg.ap(tsp.cond.compo_type_team_same_rarity(dict));
break;
}
}

View File

@ -132,6 +132,33 @@ Array.prototype.groupBy = function(func) {
}, []);
return groups;
}
//将内容添加到代码片段
DocumentFragment.prototype.ap = function(...args)
{
args.forEach(arg=>{
if (Array.isArray(arg)) //数组,递归自身
{
arg.forEach(item=>this.ap(item));
}
else //其他内容的转换为文字添加
{
this.append(arg);
}
}, this);
return this;
}
//将数组和分隔符添加到一个代码片段类似join
Array.prototype.nodeJoin = function(separator)
{
const frg = document.createDocumentFragment();
this.forEach((item, idx, arr)=>{
frg.ap(item);
if (idx < (arr.length - 1) && separator !== undefined)
frg.ap(separator instanceof Node ? separator.cloneNode(true) : separator);
});
return frg;
}
Math.randomInteger = function(max, min = 0) {
return this.floor(this.random() * (max - min + 1) + min);
@ -871,7 +898,6 @@ function descriptionToHTML(str)
latent.setAttribute("data-latent-hole", 1);
return latent;
});
return nodeArr.nodeJoin();
}
//默认的技能解释的显示行为
@ -1027,9 +1053,14 @@ function countTeamHp(team, leader1id, leader2id, solo, noAwoken = false) {
break;
}
case 245: { //全员满足某种情况,不包括好友队长,现在是全部星级不一样
let cardsRarity = memberArr.slice(0, 5).filter(m => m.id > 0).map(m => m.card.rarity); //所有的卡片星级
if (new Set(cardsRarity).size === cardsRarity.length) //如果星级去重后数量一致,即各不相同
const cardsRarity = memberArr.slice(0, 5).filter(m => m.id > 0).map(m => m.card.rarity); //所有的卡片星级
const distinctRarity = cardsRarity.concat().distinct(); //数组拷贝去重
if (sk[0] == -1 && distinctRarity.length === cardsRarity.length || //全部不同
sk[0] == -2 && distinctRarity.length === 1 || //全部相同
sk[0] > 0 && distinctRarity.length === 1 && distinctRarity[0] === sk[0] //指定稀有度
) {
scale = sk[3] / 100;
}
break;
}
case 138: //调用其他队长技