summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-21 11:15:49 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-21 11:15:49 +0800
commit7f0c40dc89672d218f10ba3f81a0ee235da30969 (patch)
treeefa2e3884c4d1443854c17248bad8ddc027feb2f /src
parent326575888b9c8edf0ded1dcf1c01f5c78d3eca84 (diff)
downloadliving-village-7f0c40dc89672d218f10ba3f81a0ee235da30969.tar.gz
feat(desktop): 村民五套服饰帽饰区分
人物图集扩至五套变体(1280x48):靛蓝袍配布巾、褐衫配发髻马甲、翠衫配发簪红巾、灰袍配瓜皮帽,主角专属斗笠独立第五套;村民按 id 取模四种服饰轮转,永不与主角同装,四向两帧动画保持。
Diffstat (limited to 'src')
-rw-r--r--src/LivingVillage.Desktop.Tests/PrototypeTests.fs18
-rw-r--r--src/LivingVillage.Desktop/Assets/jiangnan-characters.pngbin1892 -> 2539 bytes
-rw-r--r--src/LivingVillage.Desktop/VillageArt.fs11
3 files changed, 25 insertions, 4 deletions
diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
index 4d698ad..3e15272 100644
--- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
+++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
@@ -223,6 +223,24 @@ type PrototypeTests () =
Assert.AreEqual<AnimationFrame>(FrameOne, (VillageArt.animationFrame 8L))
[<TestMethod>]
+ member _.VillagersUseFourDistinctVariantsDistinctFromTheAvatar () =
+ let npcVariants = [ 0 .. 63 ] |> List.map (fun id -> npcVisualVariant (NpcId id)) |> Set.ofList
+
+ Assert.AreEqual<int>(4, npcVariants.Count)
+ Assert.IsFalse(npcVariants.Contains StrawHat)
+ Assert.AreEqual<NpcVisualVariant>(StrawHat, (avatarSpriteSpec SouthFacing 0L).Variant)
+
+ let variantXes =
+ npcVariants
+ |> Set.toList
+ |> List.map (fun variant ->
+ let rect = characterSourceRectangle { Variant = variant; Direction = SouthFacing; Frame = FrameOne }
+ rect.X)
+ |> Set.ofList
+ Assert.AreEqual<int>(4, variantXes.Count)
+ Assert.AreEqual<int>(1280, VillageArt.characterAtlasWidth)
+
+ [<TestMethod>]
member _.ChineseCopyProvidesFormalSceneTimeMenuAndStatusLabels () =
let labels =
[ sceneLabel VillageScene
diff --git a/src/LivingVillage.Desktop/Assets/jiangnan-characters.png b/src/LivingVillage.Desktop/Assets/jiangnan-characters.png
index ffe6f66..cbbe570 100644
--- a/src/LivingVillage.Desktop/Assets/jiangnan-characters.png
+++ b/src/LivingVillage.Desktop/Assets/jiangnan-characters.png
Binary files differ
diff --git a/src/LivingVillage.Desktop/VillageArt.fs b/src/LivingVillage.Desktop/VillageArt.fs
index 151c73a..3b948e5 100644
--- a/src/LivingVillage.Desktop/VillageArt.fs
+++ b/src/LivingVillage.Desktop/VillageArt.fs
@@ -72,6 +72,7 @@ module VillageArt =
| IndigoRobe
| OchreVest
| JadeSash
+ | GreyCap
| StrawHat
type FacingDirection =
@@ -239,10 +240,11 @@ module VillageArt =
if remainder < 0 then remainder + divisor else remainder
let npcVisualVariant (NpcId npcId) : NpcVisualVariant =
- match positiveModulo 3 npcId with
+ match positiveModulo 4 npcId with
| 0 -> IndigoRobe
| 1 -> OchreVest
- | _ -> JadeSash
+ | 2 -> JadeSash
+ | _ -> GreyCap
let private positiveModulo64 divisor value =
let remainder = value % divisor
@@ -289,7 +291,8 @@ module VillageArt =
| IndigoRobe -> 0
| OchreVest -> 1
| JadeSash -> 2
- | StrawHat -> 3
+ | GreyCap -> 3
+ | StrawHat -> 4
let directionIndex =
match spec.Direction with
| NorthFacing -> 0
@@ -317,7 +320,7 @@ module VillageArt =
let worldTileCount = 21
let worldAtlasWidth = Sim.tilePixels * worldTileCount
let worldAtlasHeight = Sim.tilePixels
- let characterAtlasWidth = 32 * 4 * 4 * 2
+ let characterAtlasWidth = 32 * 5 * 4 * 2
let characterAtlasHeight = 48
let interiorAtlasWidth = 392
let interiorAtlasHeight = 96