summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Kernel/Occupation.fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/LivingVillage.Kernel/Occupation.fs')
-rw-r--r--src/LivingVillage.Kernel/Occupation.fs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/LivingVillage.Kernel/Occupation.fs b/src/LivingVillage.Kernel/Occupation.fs
index 2168c4e..8ce5060 100644
--- a/src/LivingVillage.Kernel/Occupation.fs
+++ b/src/LivingVillage.Kernel/Occupation.fs
@@ -241,3 +241,34 @@ module Occupation =
/// Sim.quotePrice 的输出经职业偏置映射;None(无报价)原样穿透。
let biasedQuote (kind: Kind option) (playerIsBuyer: bool) (baseQuote: float32 option) : float32 option =
baseQuote |> Option.map (fun price -> price * quoteBiasOf kind playerIsBuyer)
+
+ // ---- 对话分支倾向(design §5 / P-d):村民对玩家职业的确定性回应偏差 ----
+ // 全部为纯函数重映射:基底仍走 Sim.responseFor 的人格口径,偏差不引入随机。
+ // 无职业(None)= 原回应逐字节不变。
+ // 规则(各自只作用于签名意图,其余意图原样穿透):
+ // 农夫 AskHelp:Refused → Helpful(老实人家,求助不落空);
+ // 渔夫 SmallTalk:Reserved → Friendly(聊的是天气鱼汛,冷场变热络);
+ // 货郎 SmallTalk:Reserved → Bargaining(三句不离买卖,更易进讨价还价);
+ // 书生 Joke:完全覆盖为 Reserved(读过书的人讲笑话,众人反而拘谨)——
+ // 与 personality 相反时采用完全覆盖语义而非概率偏向,确定性可测(design §5 反差感)。
+ let private remapResponse
+ (kind: Kind)
+ (intent: Sim.DialogueIntent)
+ (baseResponse: Sim.DialogueResponse)
+ : Sim.DialogueResponse =
+ match kind, intent, baseResponse with
+ | Farmer, Sim.AskHelp, Sim.Refused -> Sim.Helpful
+ | Fisher, Sim.SmallTalk, Sim.Reserved -> Sim.Friendly
+ | Peddler, Sim.SmallTalk, Sim.Reserved -> Sim.Bargaining
+ | Scholar, Sim.Joke, _ -> Sim.Reserved
+ | _ -> baseResponse
+
+ let biasResponse
+ (kind: Kind option)
+ (intent: Sim.DialogueIntent)
+ (personality: Sim.Personality)
+ : Sim.DialogueResponse =
+ let baseResponse = Sim.responseFor intent personality
+ match kind with
+ | None -> baseResponse
+ | Some kind -> remapResponse kind intent baseResponse