mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
fix: 展柜更新真斗面板报错;更新真斗评分规则
This commit is contained in:
parent
715b3f88f4
commit
7889186979
7 changed files with 79 additions and 46 deletions
|
|
@ -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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue