fix: 评级

This commit is contained in:
bietiaop 2024-07-29 12:17:07 +08:00
parent 39b84180bf
commit b7600d3f76
4 changed files with 23 additions and 19 deletions

View file

@ -414,22 +414,22 @@ export class ZZZAvatarInfo {
/** @type {'C'|'B'|'A'|'S'|'SS'|'SSS'|'ACE'|false} */ /** @type {'C'|'B'|'A'|'S'|'SS'|'SSS'|'ACE'|false} */
get equip_comment() { get equip_comment() {
if (this.equip_score <= 130) { if (this.equip_score < 90) {
return 'C'; return 'C';
} }
if (this.equip_score <= 150) { if (this.equip_score >= 90) {
return 'B'; return 'B';
} }
if (this.equip_score <= 170) { if (this.equip_score >= 120) {
return 'A'; return 'A';
} }
if (this.equip_score <= 190) { if (this.equip_score >= 150) {
return 'S'; return 'S';
} }
if (this.equip_score <= 210) { if (this.equip_score >= 180) {
return 'SS'; return 'SS';
} }
if (this.equip_score <= 240) { if (this.equip_score >= 210) {
return 'SSS'; return 'SSS';
} }
if (this.equip_score > 240) { if (this.equip_score > 240) {

View file

@ -4,6 +4,7 @@ import {
getEquipPropertyBaseScore, getEquipPropertyBaseScore,
getEquipPropertyEnhanceCount, getEquipPropertyEnhanceCount,
getEquipPropertyScore, getEquipPropertyScore,
hasScoreData,
} from '../lib/score.js'; } from '../lib/score.js';
/** /**
@ -32,6 +33,8 @@ export class EquipProperty {
this.property_name = property_name; this.property_name = property_name;
this.property_id = property_id; this.property_id = property_id;
this.base = base; this.base = base;
/** @type {number | false} */
this.score = false;
this.classname = property.idToClassName(property_id); this.classname = property.idToClassName(property_id);
} }
@ -42,10 +45,11 @@ export class EquipProperty {
* @returns {number} * @returns {number}
*/ */
get_score(charID) { get_score(charID) {
/** @type {number} */ if (hasScoreData(charID)) {
this.score = getEquipPropertyScore(charID, this.property_id, this.base); this.score = getEquipPropertyScore(charID, this.property_id, this.base);
/** @type {number} */ /** @type {number} */
this.base_score = getEquipPropertyBaseScore(charID, this.property_id); this.base_score = getEquipPropertyBaseScore(charID, this.property_id);
}
return this.score; return this.score;
} }
@ -241,25 +245,25 @@ export class Equip {
/** @type {'C'|'B'|'A'|'S'|'SS'|'SSS'|'ACE'|false} */ /** @type {'C'|'B'|'A'|'S'|'SS'|'SSS'|'ACE'|false} */
get comment() { get comment() {
if (this.score <= 8) { if (this.score < 8) {
return 'C'; return 'C';
} }
if (this.score <= 13) { if (this.score >= 8) {
return 'B'; return 'B';
} }
if (this.score <= 18) { if (this.score >= 13) {
return 'A'; return 'A';
} }
if (this.score <= 23) { if (this.score >= 18) {
return 'S'; return 'S';
} }
if (this.score <= 28) { if (this.score >= 23) {
return 'SS'; return 'SS';
} }
if (this.score <= 33) { if (this.score >= 28) {
return 'SSS'; return 'SSS';
} }
if (this.score > 33) { if (this.score >= 33) {
return 'ACE'; return 'ACE';
} }
return false; return false;

View file

@ -695,7 +695,7 @@
aspect-ratio: 1; aspect-ratio: 1;
border-right: 0.1em solid rgb(255, 255, 255); border-right: 0.1em solid rgb(255, 255, 255);
border-top: 0.1em solid rgb(255, 255, 255); border-top: 0.1em solid rgb(255, 255, 255);
rotate: 45deg; transform: rotate(45deg);
margin-left: -0.15em; margin-left: -0.15em;
} }
.card .equip-list .box .property-list .properties .label { .card .equip-list .box .property-list .properties .label {

View file

@ -658,7 +658,7 @@
aspect-ratio: 1; aspect-ratio: 1;
border-right: 0.1em solid rgb(255, 255, 255); border-right: 0.1em solid rgb(255, 255, 255);
border-top: 0.1em solid rgb(255, 255, 255); border-top: 0.1em solid rgb(255, 255, 255);
rotate: 45deg; transform: rotate(45deg);
margin-left: -0.15em; margin-left: -0.15em;
} }
} }