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:
2026-08-23 21:31:19 +08:00
parent fa477fb3ef
commit bce50b6e2b
11 changed files with 127 additions and 31 deletions
@@ -59,11 +59,18 @@ const DRAW_DESC = [
'僵持半晌,天入暮色,双方收阵戒备而退。'
]
/** R4 符箓开战:家族武备库存有风符/山符时,开战消耗 1 张(全体战力 +6%) */
function talismanWarPrep(w: World): void {
/** 0.1.33 符箓开战(零 rng):消耗 1 张并返回其类型——风符全体战力+12%,山符+15%且受创减半 */
function talismanWarPrep(w: World): 'feng' | 'shan' | null {
const inv = w.state.family.inventory
const id = (inv['talisman-feng'] ?? 0) > 0 ? 'talisman-feng' : (inv['talisman-shan'] ?? 0) > 0 ? 'talisman-shan' : null
if (id) inv[id] = inv[id]! - 1
if ((inv['talisman-feng'] ?? 0) > 0) {
inv['talisman-feng'] = inv['talisman-feng']! - 1
return 'feng'
}
if ((inv['talisman-shan'] ?? 0) > 0) {
inv['talisman-shan'] = inv['talisman-shan']! - 1
return 'shan'
}
return null
}
export function resolveEncounter(
@@ -80,8 +87,11 @@ export function resolveEncounter(
}
): EncounterResult {
const form = formationById(opts.formation)
const talisman = opts.kind === 'war' ? talismanWarPrep(w) : null
const talismMult = talisman === 'feng' ? 1.12 : talisman === 'shan' ? 1.15 : 1
let team = 0
for (const c of opts.team) team += combatPowerOf(w, c)
team *= talismMult
const enemy = Math.round(enemyPowerOf(opts.enemy, opts.risk) * form.def)
const jitter = w.rng.between(0.88, 1.12)
const teamFinal = Math.round(team * form.atk * jitter)
@@ -115,7 +125,7 @@ export function resolveEncounter(
loss.push(`${c.name} 陨落`)
w.chronicle('death', `${c.name} 战殁于${opts.enemy.name},一身所学俱付尘烟。`, c.id, true)
} else if (severity < 0.45) {
const woundAmt = Math.round((40 + w.rng.int(0, 25)) * form.retreatWound)
const woundAmt = Math.round((40 + w.rng.int(0, 25)) * form.retreatWound * (talisman === 'shan' ? 0.5 : 1))
c.health = Math.max(1, c.health - woundAmt)
c.state = 'wounded'
loss.push(`${c.name} 重伤`)
@@ -138,7 +148,7 @@ export function resolveEncounter(
lines.push(`此战缴获:${Object.entries(loot).map(([k, v]) => `${itemName(k)} ×${v}`).join('、')}`)
}
if (opts.kind === 'war') talismanWarPrep(w)
if (talisman) lines.push(`武备先声:${talisman === 'feng' ? '风符化翼' : '山符镇阵'},家士气为之振。`)
if (win && opts.kind === 'war') w.emitFx('blade', 'battle')
const result: EncounterResult = { win, draw, lines, loot, losses: loss }
const log: BattleLog = {