v0.1.33a: 物品闭环——符箓生效/幽灵物归位/灾年接入
【符箓闭环】talismanWarPrep 返回类型,开战消耗 1 张;风符全队×1.12/山符×1.15+受创减半(零 rng) 【符箓坊】建筑耗符纸×2+灵木×2/级,月造风符1枚;坊3级另出山符(消耗式零 rng) 【幽灵物品归位】and灵丹/虚元丹/玉澜刃补 ITEMS 定义(含 icon/价格/战力)+craftPill/forgeArtifact union 扩键+ARTIFACT_POWER 补玉澜刃 0.4 【灾年生效】farmFactor/mineFactor 从算而未用→真正乘入灵田/药园/矿场/灵果/木坊产量(旱灾×0.7等) 【金钟罩】0.1.33 基线重算(符箓/灾年/新丹受控变更),RAW+RES 共 18 值 【测试】+3(economy-loop-0.1.33 闭环矩阵) 全绿
This commit is contained in:
@@ -82,7 +82,7 @@ describe('审计回归:P0 修复固化', () => {
|
||||
})
|
||||
|
||||
it('防御性修补后金钟罩不变(行为等价确认)', () => {
|
||||
expect(stateFingerprint(longRun('bell-seed-1').state)).toBe('778d1488')
|
||||
expect(stateFingerprint(longRun('bell-seed-3').state)).toBe('00ac5fa4')
|
||||
expect(stateFingerprint(longRun('bell-seed-1').state)).toBe('0a76a33f')
|
||||
expect(stateFingerprint(longRun('bell-seed-3').state)).toBe('03184a16')
|
||||
})
|
||||
})
|
||||
|
||||
+8
-8
@@ -7,20 +7,20 @@ import { World } from '../src/renderer/game/engine/runtime/World'
|
||||
* 任何改动(重构日程/调平衡/加系统)若改变了确定性序列或结果,此测试立刻报红。
|
||||
* 更新规则:仅当**有意**变更序列逻辑时,三枚 seed 指纹同版更新并注明原因。
|
||||
*/
|
||||
// 0.1.32 万宝琳琅基线:物品六类化/新材料(灵玉灵木兽皮灵果入池)/
|
||||
// 生产泛化(produceTable 全键)/武备符箓/灵酿回气/材料相关漂移后固化。
|
||||
// 0.1.33 闭环·止血基线:符箓开战生效(战力乘量+山符减伤)/灾年因子真正接入/
|
||||
// 幽灵物品归位(新丹方/玉澜刃)+ 符箓坊(消耗式产符)后固化。
|
||||
const GOLDEN: Record<string, Record<number, string>> = {
|
||||
'bell-seed-1': { 560: '778d1488', 1200: 'a098f660', 2160: 'bc511374' },
|
||||
'bell-seed-2': { 560: 'dfab016c', 1200: 'dc3d843f', 2160: '7096cf66' },
|
||||
'bell-seed-3': { 560: '00ac5fa4', 1200: 'e2278a35', 2160: '173d2770' }
|
||||
'bell-seed-1': { 560: '0a76a33f', 1200: 'c9407e76', 2160: '4bc550bd' },
|
||||
'bell-seed-2': { 560: 'b1b4d35b', 1200: 'fcc6e262', 2160: '1af450b7' },
|
||||
'bell-seed-3': { 560: '03184a16', 1200: 'c73bb4b1', 2160: 'fca9a59f' }
|
||||
}
|
||||
|
||||
/** 第二金钟罩:自动 resolve 长跑("现实"世界——每 tick 处理待决事件;
|
||||
* 锁事件闸/事件流全程,防"冻结世界"指纹漏锁)。 */
|
||||
const GOLDEN_RESOLVED: Record<string, Record<number, string>> = {
|
||||
'bell-seed-1': { 560: '9c603274', 1200: 'e8ada769', 2160: '3e632c02' },
|
||||
'bell-seed-2': { 560: '3c952764', 1200: '48e457fd', 2160: '6caa2e3e' },
|
||||
'bell-seed-3': { 560: 'de77eb9f', 1200: '2d4a1039', 2160: '41cf5c22' }
|
||||
'bell-seed-1': { 560: '4b0f1f81', 1200: '430d6281', 2160: 'ba0d3816' },
|
||||
'bell-seed-2': { 560: '8865b178', 1200: 'bba0d797', 2160: '6205c6f1' },
|
||||
'bell-seed-3': { 560: 'fa736e3c', 1200: '819b9def', 2160: 'a624ced8' }
|
||||
}
|
||||
|
||||
const TIERS = [
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { World } from '../src/renderer/game/engine/runtime/World'
|
||||
import { ITEMS, ARTIFACT_POWER } from '../src/renderer/game/data/items'
|
||||
import { resolveEncounter } from '../src/renderer/game/engine/runtime/Systems/combat'
|
||||
import { productionTick } from '../src/renderer/game/engine/runtime/Systems/production'
|
||||
|
||||
function mk(seed: string): World {
|
||||
return World.create({ seed, surname: '钟', familyName: '钟家', motto: 'm', difficulty: 'normal' })
|
||||
}
|
||||
|
||||
describe('0.1.33 物品闭环:符箓生效/幽灵物归位/灾年生效', () => {
|
||||
it('幽灵物品归位:丹方/铸器产出物均可命中物品表且可炼成', () => {
|
||||
const w = mk('c33-ghost')
|
||||
w.state.family.stones = 100000
|
||||
w.state.family.inventory['lingcao'] = 1000
|
||||
w.state.family.inventory['beastcore'] = 100
|
||||
w.state.family.inventory['lingkuang'] = 500
|
||||
w.state.family.buildings['danfang'] = 5
|
||||
let ok = false
|
||||
for (let i = 0; i < 30 && !ok; i++) ok = w.craftPill('heling') || w.craftPill('xudan') || w.forgeArtifact('weapon-yu')
|
||||
expect(ok).toBe(true)
|
||||
expect(ITEMS['pill-heling']).toBeTruthy()
|
||||
expect(ITEMS['pill-xudan']).toBeTruthy()
|
||||
expect(ITEMS['weapon-yu']).toBeTruthy()
|
||||
expect(ARTIFACT_POWER['weapon-yu']).toBe(0.4)
|
||||
expect((w.state.family.inventory['pill-heling'] ?? 0) + (w.state.family.inventory['pill-xudan'] ?? 0) + (w.state.family.inventory['weapon-yu'] ?? 0) >= 1).toBe(true)
|
||||
})
|
||||
|
||||
it('符箓开战生效:消耗 1 张且战报记武备先声', () => {
|
||||
const w = mk('c33-fu')
|
||||
w.state.family.inventory['talisman-feng'] = 2
|
||||
const crew = w.aliveMembers().slice(0, 3)
|
||||
const res = resolveEncounter(w, {
|
||||
title: '试锋', enemy: { id: 'z', name: '妖兽', realm: 'qi', strength: 0.4, desc: '野怪' },
|
||||
risk: 0.2, team: crew, kind: 'war', year: w.state.year, month: w.state.month
|
||||
})
|
||||
expect(w.state.family.inventory['talisman-feng']).toBe(1)
|
||||
expect(res.lines.some((l) => l.includes('武备先声'))).toBe(true)
|
||||
})
|
||||
|
||||
it('灾年生效:同一世界无灾×0.7 减产(旱灾)实际作用', () => {
|
||||
const w = mk('c33-cal-a')
|
||||
w.state.family.buildings['lingtian'] = 2
|
||||
w.state.family.inventory['lingcao'] = 0
|
||||
w.advanceMonth()
|
||||
if (w.state.worldSim) w.state.worldSim.calamity = '旱灾'
|
||||
const before = w.state.family.inventory['lingcao'] ?? 0
|
||||
productionTick(w)
|
||||
const gain = (w.state.family.inventory['lingcao'] ?? 0) - before
|
||||
expect(gain).toBeGreaterThan(0)
|
||||
if (w.state.worldSim) w.state.worldSim.calamity = undefined
|
||||
const before2 = w.state.family.inventory['lingcao'] ?? 0
|
||||
productionTick(w)
|
||||
const gain2 = (w.state.family.inventory['lingcao'] ?? 0) - before2
|
||||
expect(gain).toBeLessThan(gain2)
|
||||
expect(Math.abs(gain - gain2 * 0.7)).toBeLessThanOrEqual(1)
|
||||
})
|
||||
})
|
||||
@@ -170,7 +170,7 @@ describe('GameFacade 门面', () => {
|
||||
|
||||
it('默认配置金钟罩不受门面化影响', () => {
|
||||
PACK.reset()
|
||||
expect(stateFingerprint(longRun('bell-seed-1').state)).toBe('778d1488')
|
||||
expect(stateFingerprint(longRun('bell-seed-3').state)).toBe('00ac5fa4')
|
||||
expect(stateFingerprint(longRun('bell-seed-1').state)).toBe('0a76a33f')
|
||||
expect(stateFingerprint(longRun('bell-seed-3').state)).toBe('03184a16')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user