set viridian to night time lighting

This commit is contained in:
DramaticShape
2026-07-29 22:27:25 -04:00
parent 9c263f0937
commit 99e18f7b5b
4 changed files with 40 additions and 2 deletions
+6 -1
View File
@@ -102,7 +102,12 @@
**Outdoors only**, by the same `Map.isOutdoor` test the sky already rests **Outdoors only**, by the same `Map.isOutdoor` test the sky already rests
on: indoors keeps the noon rig, the neutral tint and no sky -- a cave at on: indoors keeps the noon rig, the neutral tint and no sky -- a cave at
midnight is exactly as dark as a cave at noon. A battle staged on an midnight is exactly as dark as a cave at noon. Viridian Forest is the case
between, a CANOPY map (DayNight.CANOPY): there is no sky to paint and no
sun to see, so the shadow rig stays the mod's fixed noon light -- all that
ever filtered through the leaves -- but night still FALLS in a forest, so
of everything the clock does, exactly one thing reaches it: the hour's
tint, in free-roam and staged battles alike. A battle staged on an
outdoor map fights under the hour: the night sky behind the arena, the outdoor map fights under the hour: the night sky behind the arena, the
tint on the mons, the sunset taking the arena's shadows with it; an indoor tint on the mons, the sunset taking the arena's shadows with it; an indoor
arena is untouched. The engine's own `world.tod` hook is answered arena is untouched. The engine's own `world.tod` hook is answered
+4 -1
View File
@@ -114,7 +114,10 @@ the sun, the shadow map and the hour's tint. The lamps come on through dusk,
burn all night, and are mostly out again by dawn. burn all night, and are mostly out again by dawn.
**Outdoors only.** Indoors keeps the noon rig, the neutral tint and no sky: **Outdoors only.** Indoors keeps the noon rig, the neutral tint and no sky:
a cave at midnight is exactly as dark as a cave at noon. A battle staged on a cave at midnight is exactly as dark as a cave at noon. Viridian Forest is
the case between — a **canopy** map: no sky and the light through the
leaves stays at the mod's fixed noon angle, but the hour's *tint* still
falls through, so night reaches the forest floor. A battle staged on
an outdoor map fights under the hour — night void behind the arena, tinted an outdoor map fights under the hour — night void behind the arena, tinted
mons, sunset taking the arena's shadows with it — and an indoor arena is mons, sunset taking the arena's shadows with it — and an indoor arena is
untouched. The engine's `world.tod` hook is answered untouched. The engine's `world.tod` hook is answered
+12
View File
@@ -92,6 +92,18 @@ return function(game)
U.shot(game, DIR .. "/50_indoor_at_night.png") U.shot(game, DIR .. "/50_indoor_at_night.png")
end end
-- ------- the forest, where only the TINT of it reaches: night falls
-- through the canopy, but there is no sky and the noon light stays put
setTime("night")
if game.data.maps.VIRIDIAN_FOREST then
U.teleport(game, "VIRIDIAN_FOREST", 17, 20, "up")
U.wait(120)
U.shot(game, DIR .. "/51_forest_night.png")
setTime("day")
U.wait(30)
U.shot(game, DIR .. "/52_forest_day.png")
end
setTime("day") setTime("day")
U.log("done -- " .. DIR) U.log("done -- " .. DIR)
end end
+18
View File
@@ -2106,6 +2106,24 @@ Voxel3D.tint = { 1, 1, 1 }
Voxel3D.vp = nil Voxel3D.vp = nil
end end
-- ------- night falls in the forest
--
-- Viridian Forest is not outdoor (no sky, and the light through the leaves
-- has no direction to swing) and not a sealed room either. Of everything
-- the clock does, exactly one thing reaches a canopy map: the hour's tint.
-- The scenes wire it as tint(outdoor or isCanopy(map)) over the unchanged
-- noon rig, so what is checked here is the classification itself.
do
local DayNight = run.loader.exports.DRAMATIC_SHAPE.lib.require("DayNight")
T.check(DayNight.isCanopy({ id = "VIRIDIAN_FOREST" }),
"Viridian Forest stands under a canopy")
T.check(not DayNight.isCanopy({ id = "MT_MOON_1F" }),
"a cave does not -- midnight there is exactly as dark as noon")
T.check(not DayNight.isCanopy({ id = "PALLET_TOWN" }),
"and an outdoor town is already the clock's in full")
T.check(not DayNight.isCanopy(nil), "no map, no canopy")
end
-- ------- a shadow keeps hold of the feet that throw it -- ------- a shadow keeps hold of the feet that throw it
-- --
-- The depth compare forgives `slack` world pixels so lit ground does not -- The depth compare forgives `slack` world pixels so lit ground does not