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
85d368619f
commit
2d1ed8e528
7 changed files with 162 additions and 18 deletions
|
|
@ -11,12 +11,16 @@ export var elementEnum;
|
|||
})(elementEnum || (elementEnum = {}));
|
||||
export var anomalyEnum;
|
||||
(function (anomalyEnum) {
|
||||
// 伤害异常
|
||||
anomalyEnum[anomalyEnum["\u5F3A\u51FB"] = 0] = "\u5F3A\u51FB";
|
||||
anomalyEnum[anomalyEnum["\u707C\u70E7"] = 1] = "\u707C\u70E7";
|
||||
anomalyEnum[anomalyEnum["\u788E\u51B0"] = 2] = "\u788E\u51B0";
|
||||
anomalyEnum[anomalyEnum["\u611F\u7535"] = 3] = "\u611F\u7535";
|
||||
anomalyEnum[anomalyEnum["\u4FB5\u8680"] = 4] = "\u4FB5\u8680";
|
||||
anomalyEnum[anomalyEnum["\u7D0A\u4E71"] = 5] = "\u7D0A\u4E71";
|
||||
// 状态异常(异常持续时间buff应作用于对应的状态异常)
|
||||
anomalyEnum[anomalyEnum["\u754F\u7F29"] = 6] = "\u754F\u7F29";
|
||||
anomalyEnum[anomalyEnum["\u971C\u5BD2"] = 7] = "\u971C\u5BD2";
|
||||
})(anomalyEnum || (anomalyEnum = {}));
|
||||
export var buffTypeEnum;
|
||||
(function (buffTypeEnum) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ export enum elementEnum {
|
|||
}
|
||||
|
||||
export enum anomalyEnum {
|
||||
强击, 灼烧, 碎冰, 感电, 侵蚀, 紊乱
|
||||
// 伤害异常
|
||||
强击, 灼烧, 碎冰, 感电, 侵蚀, 紊乱,
|
||||
// 状态异常(异常持续时间buff应作用于对应的状态异常)
|
||||
畏缩, 霜寒
|
||||
}
|
||||
|
||||
/** 属性类型 */
|
||||
|
|
|
|||
|
|
@ -107,13 +107,13 @@ export class Calculator {
|
|||
areas.AnomalyProficiencyArea ??= this.get_AnomalyProficiencyArea(skill, usefulBuffs);
|
||||
areas.AnomalyBoostArea ??= this.get_AnomalyBoostArea(skill, usefulBuffs);
|
||||
areas.LevelArea ??= this.get_LevelArea();
|
||||
this.get_AnomalyCRITRate(skill, usefulBuffs);
|
||||
this.get_AnomalyCRITDMG(skill, usefulBuffs);
|
||||
props.异常暴击率 = this.get_AnomalyCRITRate(skill, usefulBuffs);
|
||||
props.异常暴击伤害 = this.get_AnomalyCRITDMG(skill, usefulBuffs);
|
||||
areas.CriticalArea ??= 1 + props.异常暴击率 * (props.异常暴击伤害 - 1);
|
||||
}
|
||||
else {
|
||||
this.get_CRITRate(skill, usefulBuffs);
|
||||
this.get_CRITDMG(skill, usefulBuffs);
|
||||
props.暴击率 = this.get_CRITRate(skill, usefulBuffs);
|
||||
props.暴击伤害 = this.get_CRITDMG(skill, usefulBuffs);
|
||||
areas.CriticalArea ??= 1 + props.暴击率 * (props.暴击伤害 - 1);
|
||||
}
|
||||
logger.debug(`暴击期望:${areas.CriticalArea}`);
|
||||
|
|
@ -237,7 +237,7 @@ export class Calculator {
|
|||
const times = Math.floor((AnomalyDuration * 10) / (anomalyData.interval * 10));
|
||||
const discover = anomalyData.discover;
|
||||
const Multiplier = discover.fixed_multiplier + times * discover.multiplier;
|
||||
logger.debug(`${anomalyData.name}紊乱 倍率:${Multiplier}`);
|
||||
logger.debug(`${anomalyData.name}紊乱倍率:${Multiplier}`);
|
||||
return Multiplier;
|
||||
}
|
||||
calc_value(value, buff) {
|
||||
|
|
|
|||
|
|
@ -236,12 +236,12 @@ export class Calculator {
|
|||
areas.AnomalyProficiencyArea ??= this.get_AnomalyProficiencyArea(skill, usefulBuffs)
|
||||
areas.AnomalyBoostArea ??= this.get_AnomalyBoostArea(skill, usefulBuffs)
|
||||
areas.LevelArea ??= this.get_LevelArea()
|
||||
this.get_AnomalyCRITRate(skill, usefulBuffs)
|
||||
this.get_AnomalyCRITDMG(skill, usefulBuffs)
|
||||
props.异常暴击率 = this.get_AnomalyCRITRate(skill, usefulBuffs)
|
||||
props.异常暴击伤害 = this.get_AnomalyCRITDMG(skill, usefulBuffs)
|
||||
areas.CriticalArea ??= 1 + props.异常暴击率! * (props.异常暴击伤害! - 1)
|
||||
} else {
|
||||
this.get_CRITRate(skill, usefulBuffs)
|
||||
this.get_CRITDMG(skill, usefulBuffs)
|
||||
props.暴击率 = this.get_CRITRate(skill, usefulBuffs)
|
||||
props.暴击伤害 = this.get_CRITDMG(skill, usefulBuffs)
|
||||
areas.CriticalArea ??= 1 + props.暴击率! * (props.暴击伤害! - 1)
|
||||
}
|
||||
logger.debug(`暴击期望:${areas.CriticalArea}`)
|
||||
|
|
@ -373,7 +373,7 @@ export class Calculator {
|
|||
const times = Math.floor((AnomalyDuration * 10) / (anomalyData.interval * 10))
|
||||
const discover = anomalyData.discover!
|
||||
const Multiplier = discover.fixed_multiplier + times * discover.multiplier
|
||||
logger.debug(`${anomalyData.name}紊乱 倍率:${Multiplier}`)
|
||||
logger.debug(`${anomalyData.name}紊乱倍率:${Multiplier}`)
|
||||
return Multiplier
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
### 认识buff
|
||||
|
||||
每个buff由各项[buff参数](./BuffManager.ts#L46)组成,重要参数:
|
||||
每个buff由各项[buff参数](./BuffManager.ts#L49)组成,重要参数:
|
||||
|
||||
```js
|
||||
{
|
||||
|
|
@ -59,9 +59,9 @@
|
|||
|
||||
- **name**:Buff名称。可重复
|
||||
|
||||
- **source**:Buff来源。用于管理buff、简化参数、判断生效条件等。查看[buff来源](./BuffManager.ts#L30)
|
||||
- **source**:Buff来源。用于管理buff、简化参数、判断生效条件等。查看[buff来源](./BuffManager.ts#L33)
|
||||
|
||||
- **type**:Buff增益的类型。查看[增益类型](./BuffManager.ts#L32)
|
||||
- **type**:Buff增益的类型。查看[增益类型](./BuffManager.ts#L35)
|
||||
|
||||
- **value**:Buff增益值。具体解释如上述
|
||||
|
||||
|
|
@ -216,9 +216,9 @@ Buff来源可分为三大类:武器、套装、角色(影画、核心被动
|
|||
> - 影画中的技能各不相同,自行定义即可
|
||||
|
||||
> - 属性异常(特殊)
|
||||
> - 强击
|
||||
> - 强击 畏缩
|
||||
> - 灼烧
|
||||
> - 碎冰
|
||||
> - 碎冰 霜寒
|
||||
> - 感电
|
||||
> - 侵蚀
|
||||
> - 紊乱
|
||||
|
|
@ -265,6 +265,8 @@ buff作用范围将以技能类型命名为依据向后覆盖。以上述[艾莲
|
|||
|
||||
[点此查看](./character/艾莲/calc.js#L24)艾莲实际伤害计算文件
|
||||
|
||||
注意事项:属性异常中**强击**和**碎冰**没有持续时间的概念,总倍率不受持续时间的影响也无法结算紊乱。因此对于作用于**异常持续时间**的buff,其buff.range应填写异常对应的**状态异常**(**畏缩**和**霜寒**),灼烧等既是伤害异常也是状态异常则无需区分。
|
||||
|
||||
### 技能倍率
|
||||
|
||||
[点此查看模板技能倍率](./character/模板/data.json)
|
||||
|
|
@ -376,7 +378,7 @@ export function calc(buffM, calc, avatar) {
|
|||
|
||||
请在对[伤害计算]有一定了解的基础上再进行伤害计算的修改
|
||||
|
||||
新增角色伤害计算的一般步骤为:
|
||||
**新增**角色伤害计算的一般步骤为:
|
||||
|
||||
1. 复制一份[模板](./character/模板/)文件夹,重命名为对应角色名
|
||||
|
||||
|
|
@ -390,7 +392,7 @@ export function calc(buffM, calc, avatar) {
|
|||
|
||||
6. 填写[技能倍率](#技能倍率)、[天赋倍率](#角色buff)
|
||||
|
||||
修改现有角色伤害计算的一般步骤为:
|
||||
**修改**现有角色伤害计算的一般步骤为:
|
||||
|
||||
1. 复制一份该角色对应的calc.js文件重命名为calc_user.js
|
||||
|
||||
|
|
|
|||
99
model/damage/character/简/calc.js
Normal file
99
model/damage/character/简/calc.js
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
/** @type {import('../../BuffManager.ts').BuffManager['buffs']} */
|
||||
export const buffs = [
|
||||
{
|
||||
name: '1影',
|
||||
type: '增伤',
|
||||
value: ({ calc }) => {
|
||||
const AnomalyProficiency = calc.get_AnomalyProficiency()
|
||||
return Math.min(0.3, Math.floor(AnomalyProficiency) / 1000)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '2影',
|
||||
type: '无视防御',
|
||||
value: 0.15
|
||||
},
|
||||
{
|
||||
name: '2影',
|
||||
type: '异常暴击伤害',
|
||||
value: 0.5,
|
||||
range: ['强击']
|
||||
},
|
||||
{
|
||||
name: '4影',
|
||||
type: '异常增伤',
|
||||
value: 0.18
|
||||
},
|
||||
{
|
||||
name: '6影',
|
||||
type: '暴击率',
|
||||
value: 0.2
|
||||
},
|
||||
{
|
||||
name: '6影',
|
||||
type: '暴击伤害',
|
||||
value: 0.4
|
||||
},
|
||||
{
|
||||
name: '核心被动:洞察',
|
||||
type: '异常持续时间',
|
||||
value: 5,
|
||||
range: ['畏缩']
|
||||
},
|
||||
{
|
||||
name: '核心被动:洞察',
|
||||
type: '异常暴击率',
|
||||
value: ({ calc }) => {
|
||||
const base = calc.calc_value('T1')
|
||||
const extra = calc.calc_value('T2')
|
||||
const AnomalyProficiency = calc.get_AnomalyProficiency()
|
||||
return base + extra * Math.floor(AnomalyProficiency)
|
||||
},
|
||||
range: ['强击']
|
||||
},
|
||||
{
|
||||
name: '核心被动:洞察',
|
||||
type: '异常暴击伤害',
|
||||
value: 0.5,
|
||||
range: ['强击']
|
||||
},
|
||||
{
|
||||
name: '技能:狂热',
|
||||
type: '攻击力',
|
||||
value: ({ calc }) => {
|
||||
const AnomalyProficiency = calc.get_AnomalyProficiency()
|
||||
if (!AnomalyProficiency > 120) return 0
|
||||
return Math.min(600, Math.floor(AnomalyProficiency - 120) * 2)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
/** @type {import('../../Calculator.ts').Calculator['skills']} */
|
||||
export const skills = [
|
||||
{ name: '强击', type: '强击' },
|
||||
{ name: '紊乱', type: '紊乱' },
|
||||
{ name: '普攻:跳步刃舞六段(狂热)', type: 'AP6' },
|
||||
{ name: '普攻:萨霍夫跳0', type: 'AX0', isHide: true },
|
||||
{ name: '普攻:萨霍夫跳', type: 'AX', after: ({ damage }) => damage.add('AX0') },
|
||||
{
|
||||
name: '闪避反击:疾影',
|
||||
type: 'CFP',
|
||||
before: ({ usefulBuffs }) => {
|
||||
const i = usefulBuffs.findIndex(buff => buff.name === '技能:狂热')
|
||||
if (i !== -1) usefulBuffs.splice(i, 1)
|
||||
}
|
||||
},
|
||||
{ name: '闪避反击:疾影连舞(狂热)', type: 'CFQ' },
|
||||
{ name: '强化特殊技:掠空-横扫', type: 'EQ' },
|
||||
{ name: '连携技:罪孽生花', type: 'RL' },
|
||||
{ name: '终结技:终幕演出', type: 'RZ' },
|
||||
{
|
||||
name: '6影强击暴击额外攻击',
|
||||
type: 'Y6',
|
||||
check: ({ avatar }) => avatar.rank >= 6,
|
||||
before: ({ calc, areas }) => {
|
||||
const AnomalyProficiency = calc.get_AnomalyProficiency()
|
||||
areas.BasicArea = AnomalyProficiency * 16
|
||||
}
|
||||
}
|
||||
]
|
||||
36
model/damage/character/简/data.json
Normal file
36
model/damage/character/简/data.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"skill": {
|
||||
"AP6": [
|
||||
2.913,3.178,3.443,3.708,3.973,4.238,4.503,4.768,5.033,5.298,5.563,5.828,6.093,6.358,6.623,6.888
|
||||
],
|
||||
"AX0": [
|
||||
3.008,3.282,3.556,3.83,4.104,4.378,4.652,4.926,5.2,5.474,5.748,6.022,6.296,6.57,6.844,7.118
|
||||
],
|
||||
"AX": [
|
||||
1.613,1.76,1.907,2.054,2.201,2.348,2.495,2.642,2.789,2.936,3.083,3.23,3.377,3.524,3.671,3.818
|
||||
],
|
||||
"CFP": [
|
||||
3.412,3.723,4.034,4.345,4.656,4.967,5.278,5.589,5.9,6.211,6.522,6.833,7.144,7.455,7.766,8.076
|
||||
],
|
||||
"CFQ": [
|
||||
3.87,4.222,4.574,4.926,5.278,5.63,5.982,6.334,6.686,7.038,7.39,7.742,8.094,8.446,8.798,9.15
|
||||
],
|
||||
"EQ": [
|
||||
5.747,6.27,6.793,7.316,7.839,8.362,8.885,9.408,9.931,10.454,10.977,11.5,12.023,12.546,13.069,13.592
|
||||
],
|
||||
"RL": [
|
||||
6.326,6.902,7.478,8.054,8.63,9.206,9.782,10.358,10.934,11.51,12.086,12.662,13.238,13.814,14.39,14.966
|
||||
],
|
||||
"RZ": [
|
||||
14.706,16.042,17.38,18.717,20.054,21.391,22.728,24.065,25.402,26.739,28.076,29.413,30.75,32.087,33.424,34.761
|
||||
]
|
||||
},
|
||||
"buff": {
|
||||
"T1": [
|
||||
0.2,0.25,0.28,0.31,0.34,0.37,0.4
|
||||
],
|
||||
"T2": [
|
||||
0.001,0.0011,0.0012,0.0013,0.0014,0.0015,0.0016
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue