reformat again

This commit is contained in:
Spmario233 2024-04-23 14:51:52 +08:00
parent b21516fe67
commit 48add72a16
1 changed files with 155 additions and 168 deletions

View File

@ -58,12 +58,11 @@ export class Character {
this.skills = get.copy(data[3] || []); this.skills = get.copy(data[3] || []);
this.trashBin = get.copy(data[4] || []); this.trashBin = get.copy(data[4] || []);
Character.convertTrashToProperties(this, this.trashBin); Character.convertTrashToProperties(this, this.trashBin);
} } else if (get.is.object(data)) {
else if (get.is.object(data)) {
Object.assign(this, data); Object.assign(this, data);
if (typeof this.maxHp !== 'number') this.maxHp = this.hp; if (typeof this.maxHp !== "number") this.maxHp = this.hp;
}
} }
};
/** /**
* @param { Character } character * @param { Character } character
* @param { Array } trash * @param { Array } trash
@ -73,64 +72,52 @@ export class Character {
let item = trash[i]; let item = trash[i];
if (i === 0 && lib.group.includes(item)) { if (i === 0 && lib.group.includes(item)) {
character.groupInGuozhan = item; character.groupInGuozhan = item;
} } else if (item === "zhu") {
else if (item === 'zhu') {
character.isZhugong = true; character.isZhugong = true;
} } else if (item === "unseen") {
else if (item === 'unseen') {
character.isUnseen = true; character.isUnseen = true;
} } else if (item === "minskin") {
else if (item === 'minskin') {
character.isMinskin = true; character.isMinskin = true;
} } else if (item === "boss") {
else if (item === 'boss') {
character.isBoss = true; character.isBoss = true;
} } else if (item === "bossallowed") {
else if (item === 'bossallowed') {
character.isBossAllowed = true; character.isBossAllowed = true;
} } else if (item === "hiddenBoss") {
else if (item === 'hiddenBoss') {
character.isHiddenBoss = true; character.isHiddenBoss = true;
} } else if (item === "forbidai") {
else if (item === 'forbidai') {
character.isAiForbidden = true; character.isAiForbidden = true;
} } else if (item === "stonehidden") {
else if (item === 'stonehidden') {
character.isHiddenInStoneMode = true; character.isHiddenInStoneMode = true;
} } else if (item === "hiddenSkill") {
else if (item === 'hiddenSkill') {
character.hasHiddenSkill = true; character.hasHiddenSkill = true;
} } else if (item.startsWith("border:")) {
else if (item.startsWith('border:')) {
character.groupBorder = item.slice(7); character.groupBorder = item.slice(7);
} } else if (item.startsWith("dualside:")) {
else if (item.startsWith('dualside:')) {
character.dualSideCharacter = item.slice(9); character.dualSideCharacter = item.slice(9);
} } else if (item.startsWith("doublegroup:")) {
else if (item.startsWith('doublegroup:')) { character.doubleGroup = item.slice(12).split(":");
character.doubleGroup = item.slice(12).split(":") }
} }
} }
};
/** /**
* @deprecated * @deprecated
*/ */
get 0() { get 0() {
return this.sex; return this.sex;
}; }
set 0(sex) { set 0(sex) {
this.sex = sex; this.sex = sex;
}; }
/** /**
* @deprecated * @deprecated
*/ */
get 1() { get 1() {
return this.group; return this.group;
}; }
set 1(group) { set 1(group) {
this.group = group; this.group = group;
}; }
/** /**
* @deprecated * @deprecated
@ -139,30 +126,30 @@ export class Character {
if (this.hujia > 0) return `${this.hp}/${this.maxHp}/${this.hujia}`; if (this.hujia > 0) return `${this.hp}/${this.maxHp}/${this.hujia}`;
else if (this.hp !== this.maxHp) return `${this.hp}/${this.maxHp}`; else if (this.hp !== this.maxHp) return `${this.hp}/${this.maxHp}`;
return this.hp; return this.hp;
}; }
set 2(hp) { set 2(hp) {
this.hp = get.infoHp(hp); this.hp = get.infoHp(hp);
this.maxHp = get.infoMaxHp(hp); this.maxHp = get.infoMaxHp(hp);
this.hujia = get.infoHujia(hp); this.hujia = get.infoHujia(hp);
}; }
/** /**
* @deprecated * @deprecated
*/ */
get 3() { get 3() {
return this.skills; return this.skills;
}; }
set 3(skills) { set 3(skills) {
this.skills = skills; this.skills = skills;
}; }
/** /**
* @deprecated * @deprecated
*/ */
get 4() { get 4() {
return this.trashBin; return this.trashBin;
}; }
set 4(trashBin) { set 4(trashBin) {
this.trashBin = trashBin; this.trashBin = trashBin;
}; }
} }