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

@ -700,11 +700,31 @@ namespace GrassCutter
/// <summary>How much of a sector is mown, 0..1.</summary>
public static float Cleared(int id) => s_masks.TryGetValue(id, out var m) ? Cleared(m) : 0f;
/// <summary>Square metres mown on the whole planet, as this peer knows it.</summary>
public static float MownArea()
/// <summary>
/// Sectors that still have grass standing, as of the last <see cref="MownArea"/>. The base, the rocks and a few sectors
/// with no grass at all keep the mown area a little under the planet's (99.8% with everything cut), so "all of it"
/// is this reaching 0, not the area reaching the planet's.
/// </summary>
public static int Left { get; private set; } = int.MaxValue;
/// <summary>Square metres mown on the whole planet, as this peer knows it (and <see cref="Left"/> on the way).</summary>
public static double MownArea()
{
float sum = 0f;
foreach (var m in s_masks.Values) sum += m.mown;
double sum = 0d;
int missing = HexGrid.Cells - s_masks.Count, left = missing;
foreach (var m in s_masks.Values)
{
sum += m.mown;
if (!m.done && m.total > 0f) left++;
}
// the last few sectors nobody has set foot in: open them to see whether there is any grass there at all
if (missing > 0 && missing <= 64)
{
left -= missing;
for (int id = 0; id < HexGrid.Cells; id++)
if (!s_masks.ContainsKey(id) && Total(id) > 0f) left++;
}
Left = left;
return sum;
}

View File

@ -45,6 +45,8 @@ namespace GrassCutter
if (_night) _dark = (_dark + 1) % Nights.Length;
else _day = (_day + 1) % Days.Length;
}
// the ending plays its own tune under the planet
if (EndingCinematic.Running) return;
Sfx.Music(WeatherFx.Storm > 0.5f ? "music_storm_loop" : _night ? Nights[_dark] : Days[_day], 4f);
}
}