get.character相关修复

This commit is contained in:
157 2024-05-02 17:15:29 +08:00
parent aa19a08668
commit 1eee5903c1
3 changed files with 8 additions and 20 deletions

View File

@ -1472,7 +1472,7 @@ export class Game {
if (result) return result;
if (!name) return result;
if (filter(name)) return name;
let tempname = ((get.character(name) || {}).trashBin || []).find(tag => tag.startsWith("tempname:"));
let tempname = (get.character(name).trashBin || []).find(tag => tag.startsWith("tempname:"));
if (!tempname) return result;
tempname = tempname
.split(":")

View File

@ -621,7 +621,7 @@ export class Get {
if (num === 3 || num === 4) return [];
return;
}
return info;
return info || {};
}
characterInitFilter(name) {
const info = get.character(name);
@ -1332,17 +1332,7 @@ export class Get {
if (name == _status.lord) return num ? Math.round((7 * (num - 1)) / 8 + 1) : "ap";
var rank = lib.rank;
if (lib.characterPack.standard[name] || lib.characterPack.shenhua[name]) {
var skills;
if (lib.character[name]) {
skills = lib.character[name][3];
} else {
var tmpinfo = get.character(name);
if (tmpinfo) {
skills = tmpinfo[3];
} else {
skills = [];
}
}
var skills = get.character(name, 3);
for (var i = 0; i < skills.length; i++) {
if (skills[i].alter && !lib.config.vintageSkills.includes(skills[i])) {
name = lib.rank.a[0];
@ -2933,8 +2923,7 @@ export class Get {
}
skillintro(name, learn, learn2) {
var str = "";
var infoitem = get.character(name);
var skills = infoitem[3];
var skills = get.character(name, 3);
var opacity;
for (var i = 0; i < skills.length; i++) {
if (lib.translate[skills[i]] && lib.translate[skills[i] + "_info"] && lib.skill[skills[i]]) {
@ -4145,8 +4134,7 @@ export class Get {
).style.marginTop = "-10px";
ui.create.div(".placeholder.slim", uiintro.content);
} else {
var infoitem = get.character(character);
var skills = infoitem[3];
var skills = get.character(character, 3);
for (i = 0; i < skills.length; i++) {
if (lib.translate[skills[i] + "_info"]) {
if (lib.translate[skills[i] + "_ab"]) translation = lib.translate[skills[i] + "_ab"];

View File

@ -2455,7 +2455,7 @@ export class Player extends HTMLDivElement {
if (typeof map == "function") {
return map(this, name);
}
if (typeof map.skill == "string" && (get.character(this[i], 3) || []).includes(map.skill)) return true;
if (typeof map.skill == "string" && get.character(this[i], 3).includes(map.skill)) return true;
if (typeof map.characterName == "string" && this[i] == map.characterName) return true;
if (typeof map.characterSkinName == "string" && this.skin[name] == map.characterSkinName) return true;
if (typeof map.source == "string" && name == map.source) return true;
@ -2643,10 +2643,10 @@ export class Player extends HTMLDivElement {
//修改性别
if (!player.isUnseen(1)) {
player.name = player.name1;
player.sex = get.character(player.name1)[0];
player.sex = get.character(player.name1, 0);
} else if (!player.isUnseen(2)) {
player.name = player.name2;
player.sex = get.character(player.name2)[0];
player.sex = get.character(player.name2, 0);
}
}
$reinit12(newPairs) {