diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-22 10:14:31 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-22 10:14:31 +0800 |
| commit | b377e750a6a3f35c5d64a29f14ac3fbd87d4a752 (patch) | |
| tree | 8baac5fca38fdcecda4a00eed7a58b1031ab9dca /src/LivingVillage.Desktop.Tests/DesktopTests.fs | |
| parent | d36e86ac637ccc477479f88bea511c49b0a6a67c (diff) | |
| parent | 5f12e63f2d2203267c30666f1559e06ec637b91c (diff) | |
| download | living-village-b377e750a6a3f35c5d64a29f14ac3fbd87d4a752.tar.gz | |
merge: P26 美术整改(民居第二变体/河岸装饰/夜月光/HUD 双景可读)— Hermes 复验通过
Diffstat (limited to 'src/LivingVillage.Desktop.Tests/DesktopTests.fs')
| -rw-r--r-- | src/LivingVillage.Desktop.Tests/DesktopTests.fs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/DesktopTests.fs b/src/LivingVillage.Desktop.Tests/DesktopTests.fs index b78f4e0..7e4a849 100644 --- a/src/LivingVillage.Desktop.Tests/DesktopTests.fs +++ b/src/LivingVillage.Desktop.Tests/DesktopTests.fs @@ -160,6 +160,30 @@ type DesktopTests () = Assert.IsTrue(noon.Background.B > noon.Background.R) [<TestMethod>] + member _.MoonlightVeilIsCoolAndOnlyAtNight () = + let noonTick = 12L * Sim.ticksPerDay / 24L + let midnightTick = 0L + let deepNightTick = 23L * Sim.ticksPerDay / 24L + Assert.IsTrue(M6Presentation.moonlightVeilAlpha noonTick = 0, "daytime must have no moonlight") + + let moon = M6Presentation.moonlightVeilAlpha midnightTick + Assert.IsTrue(moon > 0, "deep night must get a cool moonlight wash") + Assert.AreEqual<int>(moon, M6Presentation.moonlightVeilAlpha deepNightTick) + Assert.IsTrue(moon <= 72, "moonlight veil stays a low alpha so the scene is not washed out") + + let r, g, b = M6Presentation.moonlightRgb + Assert.IsTrue(b > g && g > r, "moonlight must be cool: blue-dominant channels") + + // Dusk is owned by the warm golden veil, so moonlight is suppressed there. + let duskTick = M6Presentation.startTickForHour 20.75 + Assert.IsTrue(M6Presentation.moonlightVeilAlpha duskTick < moon, "dusk is warmed, not moonlit") + + // Premultiplied premultiply of this colour never saturates to white. + let veiled = VillageArt.premultiply r g b moon + Assert.IsTrue(int veiled.B <= int veiled.A) + Assert.IsTrue(int (max veiled.R (max veiled.G veiled.B)) < 250) + + [<TestMethod>] member _.DaylightAutoplayBootstrapStartsAtDawnAndPreservesDefaultStart () = let dawnTick = 6L * Sim.ticksPerDay / 24L let daylightWorld = WorldBootstrap.initialWorldForDaylight true 42UL Sim.npcCount |
