mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 23:29:27 +08:00
完善临界计算
This commit is contained in:
parent
112ce4c4ef
commit
a47a56aed5
@ -806,6 +806,7 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
|||||||
): CriticalDamageDelta[] {
|
): CriticalDamageDelta[] {
|
||||||
// todo: 可以优化,根据之前的计算可以直接确定下一个临界的范围
|
// todo: 可以优化,根据之前的计算可以直接确定下一个临界的范围
|
||||||
if (!isFinite(seckill)) return [];
|
if (!isFinite(seckill)) return [];
|
||||||
|
|
||||||
const res: CriticalDamageDelta[] = [];
|
const res: CriticalDamageDelta[] = [];
|
||||||
const def = hero.def!;
|
const def = hero.def!;
|
||||||
const precision =
|
const precision =
|
||||||
@ -816,7 +817,6 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
|||||||
let start = curr;
|
let start = curr;
|
||||||
let end = seckill;
|
let end = seckill;
|
||||||
let ori = origin.damage;
|
let ori = origin.damage;
|
||||||
if (start >= end) return [];
|
|
||||||
|
|
||||||
const calDam = () => {
|
const calDam = () => {
|
||||||
return this.calEnemyDamageOf({ atk: curr, def }, enemy, x, y)
|
return this.calEnemyDamageOf({ atk: curr, def }, enemy, x, y)
|
||||||
@ -866,6 +866,18 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.length === 0) {
|
||||||
|
curr = hero.atk!;
|
||||||
|
const dam = calDam();
|
||||||
|
res.push({
|
||||||
|
damage: dam,
|
||||||
|
atkDelta: 0,
|
||||||
|
dir: origin.dir,
|
||||||
|
delta: dam - min,
|
||||||
|
dirDelta: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user