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