Skip to content

Commit

Permalink
解决有多个类型技能在一起时,无法正确显示追打和+C的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Mapaler committed Aug 30, 2024
1 parent 72ad957 commit a71382d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
72 changes: 37 additions & 35 deletions script-universal_function.js
Original file line number Diff line number Diff line change
Expand Up @@ -1568,45 +1568,47 @@ function henshinBase(cardid, firstId)
//计算卡片队长技+C
function getSkillAddCombo(card) {
const searchTypeArray = [192, 194, 206, 209, 210, 219, 220, 235];
const skill = getCardLeaderSkills(card, searchTypeArray)[0];
if (!skill) return 0;
switch (skill.type) {
case 192:
case 194:
return skill.params[3] ?? 0;
case 206:
return skill.params[6] ?? 0;
case 209:
return skill.params[0] ?? 0;
case 210:
case 219:
return skill.params[2] ?? 0;
case 220:
return skill.params[1] ?? 0;
case 235:
return skill.params[5] ?? 0;
default:
return 0;
}
const skills = getCardLeaderSkills(card, searchTypeArray);
return skills.map(skill=>{
switch (skill.type) {
case 192:
case 194:
return skill.params[3] ?? 0;
case 206:
return skill.params[6] ?? 0;
case 209:
return skill.params[0] ?? 0;
case 210:
case 219:
return skill.params[2] ?? 0;
case 220:
return skill.params[1] ?? 0;
case 235:
return skill.params[5] ?? 0;
default:
return 0;
}
}).reduce((p,v)=>p+v, 0);
}
//计算卡片队长技追打
function getSkillFixedDamage(card) {
const searchTypeArray = [199, 200, 201, 223, 235];
const skill = getCardLeaderSkills(card, searchTypeArray)[0];
if (!skill) return 0;
switch (skill.type) {
case 199:
case 200:
return skill.params[2] ?? 0;
case 201:
return skill.params[5] ?? 0;
case 223:
return skill.params[1] ?? 0;
case 235:
return skill.params[6] ?? 0;
default:
return 0;
}
const skills = getCardLeaderSkills(card, searchTypeArray);
return skills.map(skill=>{
switch (skill.type) {
case 199:
case 200:
return skill.params[2] ?? 0;
case 201:
return skill.params[5] ?? 0;
case 223:
return skill.params[1] ?? 0;
case 235:
return skill.params[6] ?? 0;
default:
return 0;
}
}).reduce((p,v)=>p+v, 0);
}
function tIf_Effect(leader1id, leader2id, leader1id_original,leader2id_original) {
let effect = {
Expand Down
2 changes: 1 addition & 1 deletion service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -33599,7 +33599,7 @@ const cachesMap = new Map([
],
[
"script-universal_function.js",
"0ae4adef70dab8dd183d393f431a528e"
"f01a8abf20339eed9bbed18881a84dbf"
],
[
"script.js",
Expand Down

0 comments on commit a71382d

Please sign in to comment.