From b7600d3f762aebbd4dfacffbe4a1cda9398d8399 Mon Sep 17 00:00:00 2001 From: bietiaop <1527109126@qq.com> Date: Mon, 29 Jul 2024 12:17:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=84=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/avatar.js | 12 ++++++------ model/equip.js | 26 +++++++++++++++----------- resources/panel/card.css | 2 +- resources/panel/card.scss | 2 +- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/model/avatar.js b/model/avatar.js index 3d7ba9c..0b278d5 100644 --- a/model/avatar.js +++ b/model/avatar.js @@ -414,22 +414,22 @@ export class ZZZAvatarInfo { /** @type {'C'|'B'|'A'|'S'|'SS'|'SSS'|'ACE'|false} */ get equip_comment() { - if (this.equip_score <= 130) { + if (this.equip_score < 90) { return 'C'; } - if (this.equip_score <= 150) { + if (this.equip_score >= 90) { return 'B'; } - if (this.equip_score <= 170) { + if (this.equip_score >= 120) { return 'A'; } - if (this.equip_score <= 190) { + if (this.equip_score >= 150) { return 'S'; } - if (this.equip_score <= 210) { + if (this.equip_score >= 180) { return 'SS'; } - if (this.equip_score <= 240) { + if (this.equip_score >= 210) { return 'SSS'; } if (this.equip_score > 240) { diff --git a/model/equip.js b/model/equip.js index dd695df..256fdb9 100644 --- a/model/equip.js +++ b/model/equip.js @@ -4,6 +4,7 @@ import { getEquipPropertyBaseScore, getEquipPropertyEnhanceCount, getEquipPropertyScore, + hasScoreData, } from '../lib/score.js'; /** @@ -32,6 +33,8 @@ export class EquipProperty { this.property_name = property_name; this.property_id = property_id; this.base = base; + /** @type {number | false} */ + this.score = false; this.classname = property.idToClassName(property_id); } @@ -42,10 +45,11 @@ export class EquipProperty { * @returns {number} */ get_score(charID) { - /** @type {number} */ - this.score = getEquipPropertyScore(charID, this.property_id, this.base); - /** @type {number} */ - this.base_score = getEquipPropertyBaseScore(charID, this.property_id); + if (hasScoreData(charID)) { + this.score = getEquipPropertyScore(charID, this.property_id, this.base); + /** @type {number} */ + this.base_score = getEquipPropertyBaseScore(charID, this.property_id); + } return this.score; } @@ -241,25 +245,25 @@ export class Equip { /** @type {'C'|'B'|'A'|'S'|'SS'|'SSS'|'ACE'|false} */ get comment() { - if (this.score <= 8) { + if (this.score < 8) { return 'C'; } - if (this.score <= 13) { + if (this.score >= 8) { return 'B'; } - if (this.score <= 18) { + if (this.score >= 13) { return 'A'; } - if (this.score <= 23) { + if (this.score >= 18) { return 'S'; } - if (this.score <= 28) { + if (this.score >= 23) { return 'SS'; } - if (this.score <= 33) { + if (this.score >= 28) { return 'SSS'; } - if (this.score > 33) { + if (this.score >= 33) { return 'ACE'; } return false; diff --git a/resources/panel/card.css b/resources/panel/card.css index 21793bd..eacce55 100644 --- a/resources/panel/card.css +++ b/resources/panel/card.css @@ -695,7 +695,7 @@ aspect-ratio: 1; border-right: 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; } .card .equip-list .box .property-list .properties .label { diff --git a/resources/panel/card.scss b/resources/panel/card.scss index ba9ae7d..9668e37 100644 --- a/resources/panel/card.scss +++ b/resources/panel/card.scss @@ -658,7 +658,7 @@ aspect-ratio: 1; border-right: 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; } }