From 78891869790e1efb95c2114ebf06c1e6544a14a1 Mon Sep 17 00:00:00 2001 From: UCPr <2032385471@qq.com> Date: Tue, 28 Oct 2025 16:48:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B1=95=E6=9F=9C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9C=9F=E6=96=97=E9=9D=A2=E6=9D=BF=E6=8A=A5=E9=94=99=EF=BC=9B?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9C=9F=E6=96=97=E8=AF=84=E5=88=86=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/Enka/formater.js | 14 ++++++++++++ model/Enka/formater.ts | 15 +++++++++++++ model/damage/Calculator.js | 42 +++++++++++++++++------------------ model/damage/Calculator.ts | 42 +++++++++++++++++------------------ resources/map/EquipScore.json | 4 ++++ resources/panel/card.html | 4 ++-- resources/panel/damage.html | 4 ++-- 7 files changed, 79 insertions(+), 46 deletions(-) diff --git a/model/Enka/formater.js b/model/Enka/formater.js index 7db9c60..1895039 100644 --- a/model/Enka/formater.js +++ b/model/Enka/formater.js @@ -519,5 +519,19 @@ const special = { final: 2 }; } + }, + 1441: { + id: 1441, + name: '狛野真斗', + initial_after_format: (properties) => { + special[1371].initial_after_format(properties, {}); + properties[20] = { + property_name: '闪能自动累积', + property_id: 20, + base: 0, + add: 0, + final: 0 + }; + } } }; diff --git a/model/Enka/formater.ts b/model/Enka/formater.ts index f82f9ad..d746750 100644 --- a/model/Enka/formater.ts +++ b/model/Enka/formater.ts @@ -603,5 +603,20 @@ const special: Record { + // 贯穿力处理与仪玄相同 + special[1371].initial_after_format!(properties, {} as any) + properties[20] = { + property_name: '闪能自动累积', + property_id: 20, + base: 0, + add: 0, + final: 0 + } + } } } \ No newline at end of file diff --git a/model/damage/Calculator.js b/model/damage/Calculator.js index 9b1bf5d..213a422 100644 --- a/model/damage/Calculator.js +++ b/model/damage/Calculator.js @@ -495,7 +495,7 @@ export class Calculator { } get_ATK(skill, usefulBuffs) { let ATK = this.get('攻击力', this.initial_properties.ATK, skill, usefulBuffs, true); - ATK = min_max(0, 10000, ATK); + ATK = this.min_max(0, 10000, ATK); logger.debug(`攻击力:${ATK}`); return ATK; } @@ -506,37 +506,37 @@ export class Calculator { } get_CRITRate(skill, usefulBuffs) { let CRITRate = this.get('暴击率', this.initial_properties.CRITRate, skill, usefulBuffs); - CRITRate = min_max(0, 1, CRITRate); + CRITRate = this.min_max(0, 1, CRITRate); logger.debug(`暴击率:${CRITRate}`); return CRITRate; } get_CRITDMG(skill, usefulBuffs) { let CRITDMG = this.get('暴击伤害', this.initial_properties.CRITDMG, skill, usefulBuffs); - CRITDMG = min_max(0, 5, CRITDMG); + CRITDMG = this.min_max(0, 5, CRITDMG); logger.debug(`暴击伤害:${CRITDMG}`); return CRITDMG; } get_BoostArea(skill, usefulBuffs) { let BoostArea = this.get('增伤', 1, skill, usefulBuffs); - BoostArea = min_max(0, 6, BoostArea); + BoostArea = this.min_max(0, 6, BoostArea); logger.debug(`增伤区:${BoostArea}`); return BoostArea; } get_VulnerabilityArea(skill, usefulBuffs) { let VulnerabilityArea = this.get('易伤', 1, skill, usefulBuffs); - VulnerabilityArea = min_max(0.2, 2, VulnerabilityArea); + VulnerabilityArea = this.min_max(0.2, 2, VulnerabilityArea); logger.debug(`易伤区:${VulnerabilityArea}`); return VulnerabilityArea; } get_StunVulnerabilityArea(skill, usefulBuffs) { let StunVulnerabilityArea = this.get('失衡易伤', 1, skill, usefulBuffs); - StunVulnerabilityArea = min_max(0.2, 5, StunVulnerabilityArea); + StunVulnerabilityArea = this.min_max(0.2, 5, StunVulnerabilityArea); StunVulnerabilityArea !== 1 && logger.debug(`失衡易伤区:${StunVulnerabilityArea}`); return StunVulnerabilityArea; } get_ResistanceArea(skill, usefulBuffs) { let ResistanceArea = this.get('无视抗性', 1 - this.enemy.resistance, skill, usefulBuffs); - ResistanceArea = min_max(0, 2, ResistanceArea); + ResistanceArea = this.min_max(0, 2, ResistanceArea); logger.debug(`抗性区:${ResistanceArea}`); return ResistanceArea; } @@ -566,7 +566,7 @@ export class Calculator { const PenRatio = this.get_PenRatio(skill, usefulBuffs); const defence = DEF * (1 - IgnoreDEF); const effective_defence = Math.max(0, defence * (1 - PenRatio) - Pen); - const DefenceArea = min_max(0, 1, base / (effective_defence + base)); + const DefenceArea = this.min_max(0, 1, base / (effective_defence + base)); logger.debug(`防御区:${DefenceArea}`); return DefenceArea; } @@ -582,31 +582,31 @@ export class Calculator { } get_AnomalyMastery(skill, usefulBuffs) { let AnomalyMastery = this.get('异常掌控', this.initial_properties.AnomalyMastery, skill, usefulBuffs, true); - AnomalyMastery = min_max(0, 1000, AnomalyMastery); + AnomalyMastery = this.min_max(0, 1000, AnomalyMastery); logger.debug(`异常掌控:${AnomalyMastery}`); return AnomalyMastery; } get_AnomalyProficiencyArea(skill, usefulBuffs) { const AnomalyProficiency = this.get_AnomalyProficiency(skill, usefulBuffs); - const AnomalyProficiencyArea = min_max(0, 10, AnomalyProficiency / 100); + const AnomalyProficiencyArea = this.min_max(0, 10, AnomalyProficiency / 100); logger.debug(`异常精通区:${AnomalyProficiencyArea}`); return AnomalyProficiencyArea; } get_AnomalyBoostArea(skill, usefulBuffs) { let AnomalyBoostArea = this.get('异常增伤', 1, skill, usefulBuffs); - AnomalyBoostArea = min_max(0, 3, AnomalyBoostArea); + AnomalyBoostArea = this.min_max(0, 3, AnomalyBoostArea); AnomalyBoostArea !== 1 && logger.debug(`异常增伤区:${AnomalyBoostArea}`); return AnomalyBoostArea; } get_AnomalyCRITRate(skill, usefulBuffs) { let AnomalyCRITRate = this.get('异常暴击率', 0, skill, usefulBuffs); - AnomalyCRITRate = min_max(0, 1, AnomalyCRITRate); + AnomalyCRITRate = this.min_max(0, 1, AnomalyCRITRate); AnomalyCRITRate && logger.debug(`异常暴击率:${AnomalyCRITRate}`); return AnomalyCRITRate; } get_AnomalyCRITDMG(skill, usefulBuffs) { let AnomalyCRITDMG = this.get('异常暴击伤害', 0, skill, usefulBuffs); - AnomalyCRITDMG = min_max(0, 5, AnomalyCRITDMG); + AnomalyCRITDMG = this.min_max(0, 5, AnomalyCRITDMG); AnomalyCRITDMG && logger.debug(`异常暴击伤害:${AnomalyCRITDMG}`); return AnomalyCRITDMG; } @@ -617,36 +617,36 @@ export class Calculator { } get_HP(skill, usefulBuffs) { let HP = this.get('生命值', this.initial_properties.HP, skill, usefulBuffs, true); - HP = min_max(0, 100000, HP); + HP = this.min_max(0, 100000, HP); logger.debug(`生命值:${HP}`); return HP; } get_DEF(skill, usefulBuffs) { let DEF = this.get('防御力', this.initial_properties.DEF, skill, usefulBuffs, true); - DEF = min_max(0, 1000, DEF); + DEF = this.min_max(0, 1000, DEF); logger.debug(`防御力:${DEF}`); return DEF; } get_Impact(skill, usefulBuffs) { let Impact = this.get('冲击力', this.initial_properties.Impact, skill, usefulBuffs, true); - Impact = min_max(0, 1000, Impact); + Impact = this.min_max(0, 1000, Impact); logger.debug(`冲击力:${Impact}`); return Impact; } get_SheerForce(skill, usefulBuffs) { let SheerForce = Math.trunc(this.get_ATK(skill, usefulBuffs) * 0.3); SheerForce = this.get('贯穿力', SheerForce, skill, usefulBuffs, true); - SheerForce = min_max(0, 10000, SheerForce); + SheerForce = this.min_max(0, 10000, SheerForce); logger.debug(`贯穿力:${SheerForce}`); return SheerForce; } get_SheerBoostArea(skill, usefulBuffs) { let SheerBoostArea = this.get('贯穿增伤', 1, skill, usefulBuffs); - SheerBoostArea = min_max(0.2, 9, SheerBoostArea); + SheerBoostArea = this.min_max(0.2, 9, SheerBoostArea); SheerBoostArea !== 1 && logger.debug(`贯穿增伤区:${SheerBoostArea}`); return SheerBoostArea; } -} -function min_max(min, max, value) { - return Math.min(Math.max(value, min), max); + min_max(min, max, value) { + return Math.min(Math.max(value, min), max); + } } diff --git a/model/damage/Calculator.ts b/model/damage/Calculator.ts index 681d452..deb60c0 100644 --- a/model/damage/Calculator.ts +++ b/model/damage/Calculator.ts @@ -758,7 +758,7 @@ export class Calculator { /** 攻击力 */ get_ATK(skill?: skill, usefulBuffs?: buff[]) { let ATK = this.get('攻击力', this.initial_properties.ATK, skill, usefulBuffs, true) - ATK = min_max(0, 10000, ATK) + ATK = this.min_max(0, 10000, ATK) logger.debug(`攻击力:${ATK}`) return ATK } @@ -773,7 +773,7 @@ export class Calculator { /** 暴击率 */ get_CRITRate(skill?: skill, usefulBuffs?: buff[]) { let CRITRate = this.get('暴击率', this.initial_properties.CRITRate, skill, usefulBuffs) - CRITRate = min_max(0, 1, CRITRate) + CRITRate = this.min_max(0, 1, CRITRate) logger.debug(`暴击率:${CRITRate}`) return CRITRate } @@ -781,7 +781,7 @@ export class Calculator { /** 暴击伤害 */ get_CRITDMG(skill?: skill, usefulBuffs?: buff[]) { let CRITDMG = this.get('暴击伤害', this.initial_properties.CRITDMG, skill, usefulBuffs) - CRITDMG = min_max(0, 5, CRITDMG) + CRITDMG = this.min_max(0, 5, CRITDMG) logger.debug(`暴击伤害:${CRITDMG}`) return CRITDMG } @@ -789,7 +789,7 @@ export class Calculator { /** 增伤区 */ get_BoostArea(skill?: skill, usefulBuffs?: buff[]) { let BoostArea = this.get('增伤', 1, skill, usefulBuffs) - BoostArea = min_max(0, 6, BoostArea) + BoostArea = this.min_max(0, 6, BoostArea) logger.debug(`增伤区:${BoostArea}`) return BoostArea } @@ -797,7 +797,7 @@ export class Calculator { /** (减)易伤区 */ get_VulnerabilityArea(skill?: skill, usefulBuffs?: buff[]) { let VulnerabilityArea = this.get('易伤', 1, skill, usefulBuffs) - VulnerabilityArea = min_max(0.2, 2, VulnerabilityArea) + VulnerabilityArea = this.min_max(0.2, 2, VulnerabilityArea) logger.debug(`易伤区:${VulnerabilityArea}`) return VulnerabilityArea } @@ -805,7 +805,7 @@ export class Calculator { /** 失衡易伤区 */ get_StunVulnerabilityArea(skill?: skill, usefulBuffs?: buff[]) { let StunVulnerabilityArea = this.get('失衡易伤', 1, skill, usefulBuffs) - StunVulnerabilityArea = min_max(0.2, 5, StunVulnerabilityArea) + StunVulnerabilityArea = this.min_max(0.2, 5, StunVulnerabilityArea) StunVulnerabilityArea !== 1 && logger.debug(`失衡易伤区:${StunVulnerabilityArea}`) return StunVulnerabilityArea } @@ -813,7 +813,7 @@ export class Calculator { /** 抗性区 */ get_ResistanceArea(skill?: skill, usefulBuffs?: buff[]) { let ResistanceArea = this.get('无视抗性', 1 - this.enemy.resistance, skill, usefulBuffs) - ResistanceArea = min_max(0, 2, ResistanceArea) + ResistanceArea = this.min_max(0, 2, ResistanceArea) logger.debug(`抗性区:${ResistanceArea}`) return ResistanceArea } @@ -855,7 +855,7 @@ export class Calculator { const defence = DEF * (1 - IgnoreDEF) /** 有效防御 */ const effective_defence = Math.max(0, defence * (1 - PenRatio) - Pen) - const DefenceArea = min_max(0, 1, base / (effective_defence + base)) + const DefenceArea = this.min_max(0, 1, base / (effective_defence + base)) logger.debug(`防御区:${DefenceArea}`) return DefenceArea } @@ -877,7 +877,7 @@ export class Calculator { /** 异常掌控 */ get_AnomalyMastery(skill?: skill, usefulBuffs?: buff[]) { let AnomalyMastery = this.get('异常掌控', this.initial_properties.AnomalyMastery, skill, usefulBuffs, true) - AnomalyMastery = min_max(0, 1000, AnomalyMastery) + AnomalyMastery = this.min_max(0, 1000, AnomalyMastery) logger.debug(`异常掌控:${AnomalyMastery}`) return AnomalyMastery } @@ -885,7 +885,7 @@ export class Calculator { /** 异常精通区 */ get_AnomalyProficiencyArea(skill?: skill, usefulBuffs?: buff[]) { const AnomalyProficiency = this.get_AnomalyProficiency(skill, usefulBuffs) - const AnomalyProficiencyArea = min_max(0, 10, AnomalyProficiency / 100) + const AnomalyProficiencyArea = this.min_max(0, 10, AnomalyProficiency / 100) logger.debug(`异常精通区:${AnomalyProficiencyArea}`) return AnomalyProficiencyArea } @@ -893,7 +893,7 @@ export class Calculator { /** 异常增伤区 */ get_AnomalyBoostArea(skill?: skill, usefulBuffs?: buff[]) { let AnomalyBoostArea = this.get('异常增伤', 1, skill, usefulBuffs) - AnomalyBoostArea = min_max(0, 3, AnomalyBoostArea) + AnomalyBoostArea = this.min_max(0, 3, AnomalyBoostArea) AnomalyBoostArea !== 1 && logger.debug(`异常增伤区:${AnomalyBoostArea}`) return AnomalyBoostArea } @@ -901,7 +901,7 @@ export class Calculator { /** 异常暴击率 */ get_AnomalyCRITRate(skill?: skill, usefulBuffs?: buff[]) { let AnomalyCRITRate = this.get('异常暴击率', 0, skill, usefulBuffs) - AnomalyCRITRate = min_max(0, 1, AnomalyCRITRate) + AnomalyCRITRate = this.min_max(0, 1, AnomalyCRITRate) AnomalyCRITRate && logger.debug(`异常暴击率:${AnomalyCRITRate}`) return AnomalyCRITRate } @@ -909,7 +909,7 @@ export class Calculator { /** 异常暴击伤害 */ get_AnomalyCRITDMG(skill?: skill, usefulBuffs?: buff[]) { let AnomalyCRITDMG = this.get('异常暴击伤害', 0, skill, usefulBuffs) - AnomalyCRITDMG = min_max(0, 5, AnomalyCRITDMG) + AnomalyCRITDMG = this.min_max(0, 5, AnomalyCRITDMG) AnomalyCRITDMG && logger.debug(`异常暴击伤害:${AnomalyCRITDMG}`) return AnomalyCRITDMG } @@ -924,7 +924,7 @@ export class Calculator { /** 生命值 */ get_HP(skill?: skill, usefulBuffs?: buff[]) { let HP = this.get('生命值', this.initial_properties.HP, skill, usefulBuffs, true) - HP = min_max(0, 100000, HP) + HP = this.min_max(0, 100000, HP) logger.debug(`生命值:${HP}`) return HP } @@ -932,7 +932,7 @@ export class Calculator { /** 防御力 */ get_DEF(skill?: skill, usefulBuffs?: buff[]) { let DEF = this.get('防御力', this.initial_properties.DEF, skill, usefulBuffs, true) - DEF = min_max(0, 1000, DEF) + DEF = this.min_max(0, 1000, DEF) logger.debug(`防御力:${DEF}`) return DEF } @@ -940,7 +940,7 @@ export class Calculator { /** 冲击力 */ get_Impact(skill?: skill, usefulBuffs?: buff[]) { let Impact = this.get('冲击力', this.initial_properties.Impact, skill, usefulBuffs, true) - Impact = min_max(0, 1000, Impact) + Impact = this.min_max(0, 1000, Impact) logger.debug(`冲击力:${Impact}`) return Impact } @@ -950,7 +950,7 @@ export class Calculator { // 默认取 攻击力*0.3 let SheerForce = Math.trunc(this.get_ATK(skill, usefulBuffs) * 0.3) SheerForce = this.get('贯穿力', SheerForce, skill, usefulBuffs, true) - SheerForce = min_max(0, 10000, SheerForce) + SheerForce = this.min_max(0, 10000, SheerForce) logger.debug(`贯穿力:${SheerForce}`) return SheerForce } @@ -958,13 +958,13 @@ export class Calculator { /** 贯穿增伤区 */ get_SheerBoostArea(skill?: skill, usefulBuffs?: buff[]) { let SheerBoostArea = this.get('贯穿增伤', 1, skill, usefulBuffs) - SheerBoostArea = min_max(0.2, 9, SheerBoostArea) + SheerBoostArea = this.min_max(0.2, 9, SheerBoostArea) SheerBoostArea !== 1 && logger.debug(`贯穿增伤区:${SheerBoostArea}`) return SheerBoostArea } -} + min_max(min: number, max: number, value: number) { + return Math.min(Math.max(value, min), max) + } -function min_max(min: number, max: number, value: number) { - return Math.min(Math.max(value, min), max) } \ No newline at end of file diff --git a/resources/map/EquipScore.json b/resources/map/EquipScore.json index 6ee0301..d56c8d1 100644 --- a/resources/map/EquipScore.json +++ b/resources/map/EquipScore.json @@ -76,5 +76,9 @@ "异常精通": 0, "异常掌控": 0, "属性伤害加成": 0 + }, + "狛野真斗": { + "rules": ["命破·双爆"], + "生命值百分比": 0.5 } } \ No newline at end of file diff --git a/resources/panel/card.html b/resources/panel/card.html index 2c02d67..b408c4b 100644 --- a/resources/panel/card.html +++ b/resources/panel/card.html @@ -85,12 +85,12 @@
贯穿力
-
{{basic_properties.sheerforce.final}}
+
{{basic_properties.sheerforce ? basic_properties.sheerforce.final : 0}}
闪能累积
-
{{basic_properties.adrenalineaccumulate.final}}
+
{{basic_properties.adrenalineaccumulate ? basic_properties.adrenalineaccumulate.final : 0}}
{{else}} diff --git a/resources/panel/damage.html b/resources/panel/damage.html index 8e76d62..8bd4f2e 100644 --- a/resources/panel/damage.html +++ b/resources/panel/damage.html @@ -85,12 +85,12 @@
贯穿力
-
{{basic_properties.sheerforce.final}}
+
{{basic_properties.sheerforce ? basic_properties.sheerforce.final : 0}}
闪能累积
-
{{basic_properties.adrenalineaccumulate.final}}
+
{{basic_properties.adrenalineaccumulate ? basic_properties.adrenalineaccumulate.final : 0}}
{{else}}