summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Kernel/Sim.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-21 17:18:11 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-21 17:18:11 +0800
commitcf214889490a62ba4fe84fb0055bc2133776e8a2 (patch)
tree0408fbd82e95ed55f39f8da3ccd3d2259e999313 /src/LivingVillage.Kernel/Sim.fs
parent87bdfe273555c5ae5f698b3b89fa6c39d84d0c33 (diff)
downloadliving-village-cf214889490a62ba4fe84fb0055bc2133776e8a2.tar.gz
feat(occupation): 职业系统第一片 — Kernel 结构 / bootstrap 注入 / 存档 v3
Occupation.fs(Kind/Profile/State + 农夫/渔夫/货郎/书生 中文名常量,按设计 §1 表给初始 Money/Energy/Inventory);ItemKind 扩出 Fish/Spice/Scroll(basePrice 分支补齐,Food 10.0f 数值路径不变 → 无职业 digest 不动);WorldBootstrap.initialWorldWithOccupation 默认 None = 旧行为(Money/Energy 覆盖,库存字段先留数据侧、物理挂接留交易单——取舍见 design §2-C 反对加字段);WorldSave: v3 头仅在有职业时写入(保存 saveToFileWith / loadFromFileWith,v1/v2/v3 无职业类型默认,token 顺序 version|w|h|kind|task|story|…),默认路径 save 输出逐字节等同现行 v2;P10 测试 5 例(§1 表值、v3 round-trip、v1/v2 不吞档、双 seed 逐字节、中文名);Kernel.Tests 引用 Desktop 以驱动 WorldBootstrap(取舍:不做测试专用 shim)。TaskToken/StoryStage 为 v3 占位(任务系统后续单实现)。
Diffstat (limited to 'src/LivingVillage.Kernel/Sim.fs')
-rw-r--r--src/LivingVillage.Kernel/Sim.fs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/LivingVillage.Kernel/Sim.fs b/src/LivingVillage.Kernel/Sim.fs
index 9da7c46..5445e7d 100644
--- a/src/LivingVillage.Kernel/Sim.fs
+++ b/src/LivingVillage.Kernel/Sim.fs
@@ -39,6 +39,9 @@ module Sim =
type ItemKind =
| Food
+ | Fish
+ | Spice
+ | Scroll
type NpcActionKind =
| Eat
@@ -529,6 +532,9 @@ module Sim =
let basePrice =
match request.Item with
| Food -> 10.0f
+ | Fish -> 12.0f
+ | Spice -> 8.0f
+ | Scroll -> 15.0f
let buyerUrgency = clamp ((100.0f - buyer.Mind.Needs.Hunger) / 100.0f) 0.0f 1.0f
let stockPressure =
1.0f - clamp (float32 (inventoryQuantity request.Item seller.Inventory) / 20.0f) 0.0f 1.0f