fix: a barbarian village's ground wears less than its buildings, so it still sits in the grass

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fabian @ Blax Software 2026-11-03 11:04:00 +01:00
parent f47d2b7d11
commit 1c3ed09089
1 changed files with 4 additions and 2 deletions

View File

@ -181,10 +181,12 @@ export function mapTileDrawing(look: MapLook): MapTileDrawing {
const Rv = halfWidth / Math.SQRT2 - U * 0.25
const Rc = Rv + U * 0.15
const recolor = (p: Poly): Poly => (look.worn ? { ...p, fill: worn(p.fill), stroke: worn(p.stroke) } : p)
// The ground wears less than the buildings, so a barbarian village still sits in the grass.
const recolorGround = (p: Poly): Poly => (look.worn ? { ...p, fill: mix(p.fill, worn(p.fill), 0.5), stroke: mix(p.stroke, worn(p.stroke), 0.5) } : p)
const keep = (p: Poly) => !(look.worn && bannerOrFire(p.fill))
const inside = (r: number) => r <= Rc * 0.98
// The steps fade into the grass whatever the village; only its own ground wears.
const clearing = look.worn ? mix(CLEARING, worn(CLEARING), 0.6) : CLEARING
const clearing = look.worn ? mix(CLEARING, worn(CLEARING), 0.35) : CLEARING
const steps = [
{ r: Rc + U * 0.7, fill: mix(clearing, MEADOW, 0.7) },
{ r: Rc + U * 0.35, fill: mix(clearing, MEADOW, 0.38) },
@ -202,7 +204,7 @@ export function mapTileDrawing(look: MapLook): MapTileDrawing {
return {
steps,
clip: steps[2]!.points,
ground: scene.decals.filter((p) => keep(p) && !ROADS.has(p.fill)).map(recolor),
ground: scene.decals.filter((p) => keep(p) && !ROADS.has(p.fill)).map(recolorGround),
objects,
units: (Math.max(...ring(Rc + U * 0.7, 11).map(([x]) => Math.abs(x))) * 2) / FILL[look.tier],
}