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:
@@ -5,7 +5,7 @@ export interface BuildingDef {
|
||||
desc: string
|
||||
kind: 'produce' | 'function'
|
||||
maxLevel: number
|
||||
produceTable?: (level: number) => { stone?: number; lingcao?: number; lingkuang?: number; beastcore?: number; lingyu?: number; lingmu?: number; shoupi?: number; lingguo?: number }
|
||||
produceTable?: (level: number) => { stone?: number; lingcao?: number; lingkuang?: number; beastcore?: number; lingyu?: number; lingmu?: number; shoupi?: number; lingguo?: number; 'talisman-feng'?: number; 'talisman-shan'?: number }
|
||||
upgradeCost: (level: number) => { stones: number; lingkuang: number }
|
||||
extra?: Record<string, string>
|
||||
}
|
||||
@@ -88,6 +88,12 @@ export const BUILDINGS: Record<string, BuildingDef> = {
|
||||
produceTable: (l) => ({ lingguo: 3 * l }),
|
||||
upgradeCost: (l) => ({ stones: 100 * Math.pow(1.7, l - 1), lingkuang: 10 * l })
|
||||
},
|
||||
fuzhifang: {
|
||||
id: 'fuzhifang', name: '符箓坊', icon: '符',
|
||||
desc: '符纸灵木入炉——月耗符纸灵木各贰,出风符一枚;坊叁级另出山符。',
|
||||
kind: 'produce', maxLevel: 3,
|
||||
upgradeCost: (l) => ({ stones: 120 * Math.pow(1.7, l - 1), lingkuang: 10 * l })
|
||||
},
|
||||
lingmufang: {
|
||||
id: 'lingmufang', name: '灵木坊', icon: '木',
|
||||
desc: '伐百年灵木——月产灵木,符纸之基。',
|
||||
|
||||
@@ -34,14 +34,20 @@ export const ITEMS: Record<string, ItemDef> = {
|
||||
'weapon-fan': { id: 'weapon-fan', name: '凡器', kind: 'artifact', basePrice: 120, desc: '普通铁器,聊胜于无。', icon: '凡' },
|
||||
'weapon-qi': { id: 'weapon-qi', name: '法器', kind: 'artifact', basePrice: 450, desc: '蕴灵之器,可引动灵力。', icon: '法' },
|
||||
'weapon-ling': { id: 'weapon-ling', name: '灵器', kind: 'artifact', basePrice: 1400, desc: '有灵之器,锋芒隐露。', icon: '灵' },
|
||||
'weapon-fa': { id: 'weapon-fa', name: '法宝', kind: 'artifact', basePrice: 3600, desc: '罕世法宝,非金丹不能驾驭。', icon: '宝' }
|
||||
'weapon-fa': { id: 'weapon-fa', name: '法宝', kind: 'artifact', basePrice: 3600, desc: '罕世法宝,非金丹不能驾驭。', icon: '宝' },
|
||||
|
||||
// 0.1.33 闭环:丹方/铸器产出物归位(此前仅存于配方,物品表无定义——幽灵物品)
|
||||
'pill-heling': { id: 'pill-heling', name: '和灵丹', kind: 'pill', basePrice: 120, desc: '和理灵机,金丹以下均可服。', icon: '和' },
|
||||
'pill-xudan': { id: 'pill-xudan', name: '虚元丹', kind: 'pill', basePrice: 320, desc: '丹中朱砂,元婴以下服之可提元。', icon: '虚' },
|
||||
'weapon-yu': { id: 'weapon-yu', name: '玉澜刃', kind: 'artifact', basePrice: 950, desc: '温润如玉,锋芒内敛的灵木之刃。', icon: '澜' }
|
||||
}
|
||||
|
||||
export const ARTIFACT_POWER: Record<string, number> = {
|
||||
'weapon-fan': 0.1,
|
||||
'weapon-qi': 0.25,
|
||||
'weapon-ling': 0.5,
|
||||
'weapon-fa': 0.9
|
||||
'weapon-fa': 0.9,
|
||||
'weapon-yu': 0.4
|
||||
}
|
||||
|
||||
export function itemById(id: string): ItemDef {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -36,11 +36,12 @@ export function productionTick(w: World): void {
|
||||
parts.push(`${def!.name}+${prod}${itemNameOf(k)}`)
|
||||
}
|
||||
}
|
||||
produceAll('lingtian', lingtian, 1 + fielders * 0.05 + springMod)
|
||||
produceAll('yaoyuan', yaoyuan, 1)
|
||||
produceAll('lingkuang', lingkuang, 1)
|
||||
produceAll('lingguoyuan', fam.buildings['lingguoyuan'] ?? 0, 1)
|
||||
produceAll('lingmufang', fam.buildings['lingmufang'] ?? 0, 1)
|
||||
// 0.1.33 灾年真正生效(此前 farmFactor/mineFactor 算而未用——生产零体感)
|
||||
produceAll('lingtian', lingtian, (1 + fielders * 0.05 + springMod) * farmFactor)
|
||||
produceAll('yaoyuan', yaoyuan, farmFactor)
|
||||
produceAll('lingkuang', lingkuang, mineFactor)
|
||||
produceAll('lingguoyuan', fam.buildings['lingguoyuan'] ?? 0, farmFactor)
|
||||
produceAll('lingmufang', fam.buildings['lingmufang'] ?? 0, farmFactor)
|
||||
const autumnMod = w.sysEnabled('season') ? seasonMod(w.state.month, 'market') : 0
|
||||
if (fangshi > 0) {
|
||||
const v = Math.round(55 * fangshi * (1 + w.postBonus('marketIncome') + merchants * 0.03 + autumnMod))
|
||||
@@ -51,6 +52,21 @@ export function productionTick(w: World): void {
|
||||
inv.beastcore = (inv.beastcore ?? 0) + 1
|
||||
parts.push('灵兽园+1兽核')
|
||||
}
|
||||
// 0.1.33 符箓坊(消耗式:符纸×2+灵木×2/级 → 风符;叁级追加山符)
|
||||
const fuzhiLvl = lvl('fuzhifang')
|
||||
if (fuzhiLvl > 0) {
|
||||
const need = 2 * fuzhiLvl
|
||||
if ((inv['fuzhi'] ?? 0) >= need && (inv['lingmu'] ?? 0) >= need) {
|
||||
inv['fuzhi'] -= need
|
||||
inv['lingmu'] -= need
|
||||
inv['talisman-feng'] = (inv['talisman-feng'] ?? 0) + 1
|
||||
parts.push(`符箓坊-符纸${need}灵木${need}+风符1`)
|
||||
if (fuzhiLvl >= 3) {
|
||||
inv['talisman-shan'] = (inv['talisman-shan'] ?? 0) + 1
|
||||
parts.push('符箓坊+山符1')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void parts
|
||||
|
||||
|
||||
@@ -798,7 +798,7 @@ export class World {
|
||||
return true
|
||||
}
|
||||
|
||||
craftPill(kind: 'qiyuan' | 'ningyuan' | 'pojing'): boolean {
|
||||
craftPill(kind: 'qiyuan' | 'ningyuan' | 'pojing' | 'heling' | 'xudan'): boolean {
|
||||
const fam = this.state.family
|
||||
const lvl = fam.buildings['danfang']
|
||||
const r = pillRecipeByOutput(`pill-${kind}`)
|
||||
@@ -825,7 +825,7 @@ export class World {
|
||||
return false
|
||||
}
|
||||
|
||||
forgeArtifact(kind: 'weapon-qi' | 'weapon-ling' | 'weapon-fa'): boolean {
|
||||
forgeArtifact(kind: 'weapon-qi' | 'weapon-ling' | 'weapon-fa' | 'weapon-yu'): boolean {
|
||||
const fam = this.state.family
|
||||
const r = forgeRecipeByOutput(kind)
|
||||
if (!r) return false
|
||||
|
||||
Reference in New Issue
Block a user