fix:修复无穷体力、体力上限、护甲显示

This commit is contained in:
lieren2023 2024-03-23 08:51:03 +08:00 committed by GitHub
parent 1d845e574b
commit 1aa4f340d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 29 additions and 7 deletions

View File

@ -322,24 +322,46 @@ export class Get extends Uninstantable {
}
static infoHp(hp) {
if (typeof hp == 'number') return hp;
else if (typeof hp == 'string' && hp.includes('/')) {
const num = hp.split('/')[0];
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
else if (typeof hp == 'string') {
if (hp.includes('/')) {
const num = hp.split('/')[0];
if (num) {
if (num == 'Infinity' || num == '∞') {
return Infinity;
} else {
return parseInt(num);
}
}
} else if (hp == 'Infinity' || hp == '∞') return Infinity;
}
return 0;
}
static infoMaxHp(hp) {
if (typeof hp == 'number') return hp;
else if (typeof hp == 'string' && hp.includes('/')) {
const num = hp.split('/')[1];
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
else if (typeof hp == 'string') {
if (hp.includes('/')) {
const num = hp.split('/')[1];
if (num) {
if (num == 'Infinity' || num == '∞') {
return Infinity;
} else {
return parseInt(num);
}
}
} else if (hp == 'Infinity' || hp == '∞') return Infinity;
}
return 0;
}
static infoHujia(hp) {
if (typeof hp == 'string' && hp.includes('/')) {
const num = hp.split('/')[2];
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
if (num) {
if (num == 'Infinity' || num == '∞') {
return Infinity;
} else {
return parseInt(num);
}
}
}
return 0;
}