mirror of
https://github.com/motajs/template.git
synced 2026-10-01 08:00:17 +08:00
fix(07-01): #06-01-1 align critical info with the yielded next value
- move targetInfo assignment into the damage < referenceDamage branch so the reported critical info matches the yielded next value - un-skip the correct-expectation case in damage.test.ts (#06-01-1)
This commit is contained in:
parent
7ae08c6920
commit
9e96df4c3b
@ -575,8 +575,8 @@ describe('DamageContext critical generation', () => {
|
||||
expect(locatorResult.info).toHaveLength(0);
|
||||
});
|
||||
|
||||
// 疑似 bug:产出的 info 应与 nextValue 对应,详见 06-TEST-FINDINGS.md #06-01-1,修复后取消 skip
|
||||
it.skip('reports the damage info matching the yielded critical value', () => {
|
||||
// 验证产出的 info 与 nextValue 同源,即临界点伤害信息对应该属性值
|
||||
it('reports the damage info matching the yielded critical value', () => {
|
||||
const fixture = createFixture();
|
||||
const context = new modules.DamageContext(
|
||||
fixture.context,
|
||||
|
||||
@ -228,9 +228,9 @@ export class DamageContext<TEnemy, THero> implements IDamageContext<
|
||||
|
||||
if (middleInfo.damage < referenceDamage) {
|
||||
right = middle;
|
||||
targetInfo = middleInfo;
|
||||
} else {
|
||||
left = middle;
|
||||
targetInfo = middleInfo;
|
||||
}
|
||||
if (right - left <= 1) break;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user