diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-21 23:03:16 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-21 23:03:16 +0800 |
| commit | 6ce29c5e87d32e49dfe92b398fe45ef0b9de6cdf (patch) | |
| tree | 859a902d27e069e0e087579b6ea38dec76dc4bf3 /src/LivingVillage.Desktop/WorldBootstrap.fs | |
| parent | 11a2a1d8786a660d0f370a46f5ee0c69c108f823 (diff) | |
| parent | 50875bb65cc4cdba92f6745d2430a92d85474872 (diff) | |
| download | living-village-6ce29c5e87d32e49dfe92b398fe45ef0b9de6cdf.tar.gz | |
merge: P15 职业玩法收口——开局职业选择/货郎书生模板/CJK补字/全链路回归(独立复验全绿)
Diffstat (limited to 'src/LivingVillage.Desktop/WorldBootstrap.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/WorldBootstrap.fs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop/WorldBootstrap.fs b/src/LivingVillage.Desktop/WorldBootstrap.fs index 0e8ea30..f8ba775 100644 --- a/src/LivingVillage.Desktop/WorldBootstrap.fs +++ b/src/LivingVillage.Desktop/WorldBootstrap.fs @@ -18,6 +18,23 @@ module WorldBootstrap = let private daylightStartTick = 6L * Sim.ticksPerDay / 24L + /// 新档职业状态:按世界 seed 与职业种子生成 nowTick 所属日的 Offered 任务(design §3)。 + let occupationStateFor (seed: uint64) (kind: Occupation.Kind) (nowTick: int64) : Occupation.State = + let baseState = Occupation.stateOf kind + { baseState with + Today = Occupation.dailyTaskOf seed (Occupation.occupationSeedOf kind) (Occupation.dayIndexOf nowTick) kind } + + /// 跨日刷新当日任务;同日(含 Done/Failed 终态)原样保留。 + let refreshOccupationToday (seed: uint64) (state: Occupation.State) (nowTick: int64) : Occupation.State = + { state with + Today = + Occupation.refreshToday + seed + (Occupation.occupationSeedOf state.Profile.Kind) + state.Profile.Kind + nowTick + state.Today } + let initialWorldWithOccupation (startAtDaylight: bool) (seed: uint64) (count: int) (occupation: Occupation.State option) : World = if count < 0 || count > npcSpawnTiles.Length then invalidArg (nameof count) "Desktop bootstrap supports at most 30 NPCs." |
