Ending: the Director's call, flyovers into orbit, Earth turning green, credits

When the planet is mown the ending plays by itself: G.R.A.S.S.A. calls, the
camera skims the stubble into the base, circles it and rises without a cut
into orbit over the bald planet (title, the crew's results). Then a jump
across space to a scorched, dried-out Earth: a rocket from Herbaria-7 passes
the lens and lands in Africa, and the green spreads from there over the whole
globe (seed pods, a glowing front, clouds and blue air coming back). The
credits roll over the green Earth (PlayWay credited as publisher), then THE
END and a card to keep mowing, leave a review or go to the menu. Space, Enter
or Esc skips to the green Earth and the card.

- EndingCinematic, EndingEarth (globe, air shell, rocket, seeds), SpaceSky
  (split out of the intro), EarthGlobe/EarthAir shaders and Earth maps in
  Resources/Ending
- the far meadow shows as stubble once the planet is mown
- "all of it" mown now means no sector with grass left (MowMap.Left); mown
  area summed in double
- the crew's total pay and play time are counted and saved for the results
- the "ending" cheat; -ending previews it in a test world; the -ending bot
  shoots every stage
- loc for the new lines in all 11 languages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bonchellon
2026-11-28 01:52:24 +03:00
parent 5e30bd4c26
commit 3ee5956694
43 changed files with 2405 additions and 72 deletions

View File

@ -20,7 +20,7 @@ namespace GrassCutter
/// <summary>The trailer films it without the "Space: skip" in the corner.</summary>
public static bool NoSkipHint;
/// <summary>A game starting now could open on the film (not under a dev bot unless it asked).</summary>
public static bool MightRun => Force || !CommandLine.Has("-autodemo");
public static bool MightRun => Force || (!CommandLine.Has("-autodemo") && !EndingCinematic.Preview);
/// <summary>Whether the film plays has been decided for this game and it isn't playing: until then nobody talks.</summary>
public static bool Settled { get; private set; }
@ -56,7 +56,7 @@ namespace GrassCutter
{
_tried = true;
bool fresh = ts.Shipped.Value <= 0d && ts.Mown.Value <= 0d;
bool bot = CommandLine.Has("-autodemo");
bool bot = CommandLine.Has("-autodemo") || EndingCinematic.Preview;
if ((fresh && !bot) || Force) _run = StartCoroutine(Run());
else { UIRoot.I?.ReleaseFade(0.6f); Settled = true; }
}
@ -240,62 +240,7 @@ namespace GrassCutter
// ───────── out in space: black sky and stars instead of the day's blue ─────────
ParticleSystem _stars;
CameraClearFlags _clear;
Color _clearColour;
bool _inSpace;
void Space(bool on, Vector3 eye)
{
var cam = CameraFx.Cam;
if (!cam || on == _inSpace) return;
_inSpace = on;
if (on)
{
_clear = cam.clearFlags;
_clearColour = cam.backgroundColor;
cam.clearFlags = CameraClearFlags.SolidColor;
cam.backgroundColor = new Color(0.008f, 0.012f, 0.03f);
if (!_stars)
{
var go = new GameObject("IntroStars");
_stars = go.AddComponent<ParticleSystem>();
_stars.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
var main = _stars.main;
main.playOnAwake = false; main.loop = false;
main.startLifetime = 60f; main.startSpeed = 0f;
main.simulationSpace = ParticleSystemSimulationSpace.World;
main.maxParticles = 2000;
var em = _stars.emission; em.enabled = false;
var sh = _stars.shape; sh.enabled = false;
var r = go.GetComponent<ParticleSystemRenderer>();
r.sharedMaterial = AssetBank.I.Mat("FX_Sparkle") ?? AssetBank.I.Mat("FX_Soft");
r.maxParticleSize = 0.02f;
r.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
_stars.Play();
}
_stars.Clear();
for (int i = 0; i < 1400; i++)
{
var d = Random.onUnitSphere;
float far = 30000f;
var ep = new ParticleSystem.EmitParams
{
position = eye + d * far,
startSize = far * Random.Range(0.0012f, 0.0034f),
startColor = Color.Lerp(new Color(0.75f, 0.85f, 1f), new Color(1f, 0.92f, 0.8f), Random.value) * Random.Range(0.55f, 1f),
applyShapeToPosition = false,
};
_stars.Emit(ep, 1);
}
}
else
{
cam.clearFlags = _clear;
cam.backgroundColor = _clearColour;
if (_stars) _stars.Clear();
}
}
static void Space(bool on, Vector3 eye) => SpaceSky.Set(on, eye);
// ───────── the screen ─────────