fix: 展柜更新真斗面板报错;更新真斗评分规则

This commit is contained in:
UCPr 2025-10-28 16:48:14 +08:00
parent 715b3f88f4
commit 7889186979
7 changed files with 79 additions and 46 deletions

View file

@ -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
};
}
}
};

View file

@ -603,5 +603,20 @@ const special: Record<number, {
final: 2
}
}
},
1441: {
id: 1441,
name: '狛野真斗',
initial_after_format: (properties) => {
// 贯穿力处理与仪玄相同
special[1371].initial_after_format!(properties, {} as any)
properties[20] = {
property_name: '闪能自动累积',
property_id: 20,
base: 0,
add: 0,
final: 0
}
}
}
}

View file

@ -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) {
min_max(min, max, value) {
return Math.min(Math.max(value, min), max);
}
}

View file

@ -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
}
}
function min_max(min: number, max: number, value: number) {
min_max(min: number, max: number, value: number) {
return Math.min(Math.max(value, min), max)
}
}

View file

@ -76,5 +76,9 @@
"异常精通": 0,
"异常掌控": 0,
"属性伤害加成": 0
},
"狛野真斗": {
"rules": ["命破·双爆"],
"生命值百分比": 0.5
}
}

View file

@ -85,12 +85,12 @@
<div class="properties">
<div class="prop-icon sheerforce"></div>
<div class="label yellow">贯穿力</div>
<div class="value">{{basic_properties.sheerforce.final}}</div>
<div class="value">{{basic_properties.sheerforce ? basic_properties.sheerforce.final : 0}}</div>
</div>
<div class="properties">
<div class="prop-icon sprecover"></div>
<div class="label white">闪能累积</div>
<div class="value">{{basic_properties.adrenalineaccumulate.final}}</div>
<div class="value">{{basic_properties.adrenalineaccumulate ? basic_properties.adrenalineaccumulate.final : 0}}</div>
</div>
</div>
{{else}}

View file

@ -85,12 +85,12 @@
<div class="properties">
<div class="prop-icon sheerforce"></div>
<div class="label yellow">贯穿力</div>
<div class="value">{{basic_properties.sheerforce.final}}</div>
<div class="value">{{basic_properties.sheerforce ? basic_properties.sheerforce.final : 0}}</div>
</div>
<div class="properties">
<div class="prop-icon sprecover"></div>
<div class="label white">闪能累积</div>
<div class="value">{{basic_properties.adrenalineaccumulate.final}}</div>
<div class="value">{{basic_properties.adrenalineaccumulate ? basic_properties.adrenalineaccumulate.final : 0}}</div>
</div>
{{else}}
<div class="properties">