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,6 +20,10 @@ namespace GrassCutter
public readonly NetworkVariable<double> Mown = new NetworkVariable<double>();
/// <summary>Sectors mown clean.</summary>
public readonly NetworkVariable<int> Closed = new NetworkVariable<int>();
/// <summary>Every coin the crew has ever been paid (grass, sectors, stakes, tips), spent or not.</summary>
public readonly NetworkVariable<double> Earned = new NetworkVariable<double>();
/// <summary>Seconds this world has been running, over every session.</summary>
public readonly NetworkVariable<double> Played = new NetworkVariable<double>();
public NetworkList<byte> Perks;
public NetworkList<int> Tiles;
/// <summary>Stakes and survey points the crew has done.</summary>
@ -49,6 +53,8 @@ namespace GrassCutter
/// <summary>Which set of planet sizes (<see cref="Difficulties.NewGen"/>): 0 for every save from before.</summary>
public int sizeGen;
public double money, shipped, mown;
/// <summary>All money ever paid in, and seconds played (0 in saves from before they were counted).</summary>
public double earned, played;
/// <summary>Time of day: the first morning begins here.</summary>
public float day = 0.75f;
public int[] perks;
@ -130,6 +136,8 @@ namespace GrassCutter
}
public double Mown01 => Mown.Value / GameDefs.PlanetArea;
/// <summary>Whole days (sunrise to sunrise) this world has run.</summary>
public int Days => (int)(Played.Value / GameDefs.DayLength);
public float ToolCap(ToolId t) => GameDefs.IsBlade(t) ? GameDefs.ToolCap(t, GameDefs.HasBinPerk(t) ? Level(GameDefs.BinPerk(t)) : 0, Level(PerkId.Compactor)) : 0f;
@ -171,6 +179,7 @@ namespace GrassCutter
if (!IsServer || kg <= 0f) return 0d;
double pay = kg * GameDefs.PerKg(kind) * PayoutMul;
Money.Value += pay;
Earned.Value += pay;
Shipped.Value += kg;
DepositedRpc(at, pay, kg);
return pay;
@ -318,6 +327,7 @@ namespace GrassCutter
void Update()
{
if (!IsServer || !IsSpawned) return;
Played.Value += Time.unscaledDeltaTime;
TickSectors();
TickWeather();
_powerTimer += Time.deltaTime;
@ -340,7 +350,7 @@ namespace GrassCutter
public void Save()
{
if (!IsServer) return;
var d = new SaveData { ver = 6, level = (int)Difficulties.Current, sizeGen = Difficulties.Gen, money = Money.Value, shipped = Shipped.Value, mown = Mown.Value, crew = _crew, day = Sun.Phase, vehicles = PackVehicles(), banned = _banned };
var d = new SaveData { ver = 6, level = (int)Difficulties.Current, sizeGen = Difficulties.Gen, money = Money.Value, shipped = Shipped.Value, mown = Mown.Value, earned = Earned.Value, played = Played.Value, crew = _crew, day = Sun.Phase, vehicles = PackVehicles(), banned = _banned };
d.perks = new int[Perks.Count];
for (int i = 0; i < Perks.Count; i++) d.perks[i] = Perks[i];
d.tiles = new int[Tiles.Count];
@ -377,8 +387,11 @@ namespace GrassCutter
if (!fresh) LoadMow();
Money.Value = d.money;
Shipped.Value = d.shipped;
// saves from before the crew's pay was counted start from what they have shipped
Earned.Value = d.earned > 0d ? d.earned : d.money;
Played.Value = d.played;
ServerSetPhase(d.day);
Mown.Value = MowMap.MownArea();
Mown.Value = MownNow();
MowMap.Count();
Closed.Value = MowMap.Finished;
if (d.found != null) foreach (int id in d.found) Found.Add(id);