# game.rules — ASHEN VIGIL's constants and rules
The one sheet of paper every slice of ASHEN VIGIL argues from.
`require("game.rules")` gives the game's constants — the title and the
art-direction sentence, the palette in linear RGB, the sun, the three stats and
what a level buys, the soul cost curve, the flask, every combat timing (light,
heavy, roll, guard, the turn rates, poise), movement and stamina, lock-on,
grace, death, the boss and the common foe, and the names of the five slice
mounts the scene makes.
It also carries the four pure rules the slices share rather than duplicate:
`levelCost(level)`, `statsAt(levels)`, `inArc(swingYaw, hitYaw, arcDegrees)`,
and the `SLICES` list.
It touches no engine API and reads no scene state: it is data and arithmetic,
so it can be called from a component, a scene build, a tool or a test with the
same answer. A number that lives in two slices is a bug — it lives here
instead.
Who reads it: every slice (`game.vigil`, `game.valley`, `game.foes`,
`game.screens`, `game.sound`) and `scenes/main.scene/build.luau`.
# game.valley — the `valley` slice
The Ashen Valley: the ground everything stands on and its surfaces, the
rain-slick road, the ruined chapel with the site of grace, the broken
watchtower, the standing stones and the drowned trees — and the atmosphere
(fog, sun, sky) the whole game is seen through. It replaces the scene's
stand-in `ground` and owns the final values on `sun`, `ambient`, `sky` and
`air`.
Owns `/zero/source/game/valley.module/` and `/zero/source/game/valley/`.
Hangs its components on the mount entity `Game/valley`.
References it must match: `design/references/06-the-ashen-valley.png` and
`design/references/04-site-of-grace.png`.
Read `design/spec.md` for the interface and what "done" means.
# game.vigil — the `vigil` slice
The thing the player is. The Vigil's body — battered grey plate, tattered
ash-grey cloak, great helm with a narrow horizontal visor slit, a straight
longsword — its locomotion and stamina, and every verb of the fight: light
swing, heavy swing, guard with a parry window, dodge-roll with invulnerability
frames, and lock-on. It also owns the camera those verbs are played through,
on the scene's `PlayerSetups/DefaultSocialPlayer/CameraRig`.
Owns `/zero/source/game/vigil.module/` and `/zero/source/game/vigil/`.
Hangs its components on the mount entity `Game/vigil`.
References it must match: `design/references/03-the-vigil.png` and
`design/references/01-in-play.png`.
Read `design/spec.md` for the interface and what "done" means.
# game.foes — the `foes` slice
What waits in the valley. The hollow soldiers: their bodies, their AI (notice,
close, wind up, strike, recover, stagger, die), the damage they do and take,
and the souls they leave where they fall. Then the Ash Warden: its poise, its
three phases, its telegraphed attacks, and its death.
Owns `/zero/source/game/foes.module/` and `/zero/source/game/foes/`.
Hangs its components on the mount entity `Game/foes`; every lockable enemy is
an entity beneath it.
References it must match: `design/references/05-the-ash-warden.png` and
`design/references/01-in-play.png`.
Read `design/spec.md` for the interface and what "done" means.
# game.screens — the `screens` slice
Every screen between the player and the valley: the authored HUD (health,
stamina, the Ashen Flask count, the soul count, the locked enemy's bar and the
boss's poise meter), the title card, the grace menu the souls are spent at, and
the death card.
Owns `/zero/source/game/screens.module/` and `/zero/source/game/screens/`.
Hangs its components on the mount entity `Game/screens`.
References it must match: `design/references/01-in-play.png` and
`design/references/02-title-screen.png`.
Read `design/spec.md` for the interface and what "done" means.
# game.sound — the `sound` slice
The game heard: the valley's wind and ash and rain on stone, the fight's own
swings and impacts, the boss theme, and the sting the Ash Warden's rise gets.
Owns `/zero/source/game/sound.module/` and `/zero/source/game/sound/`.
Hangs its components on the mount entity `Game/sound`.
The world's one `AudioListener` is on the player's camera rig and is the
scene's — this slice never adds one, and every spatial sound it makes is
inaudible without it.
Reference for tone: `design/references/01-in-play.png` — cold, low,
wind-driven, not heroic.
Read `design/spec.md` for the interface and what "done" means.