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:
@ -38,6 +38,7 @@ namespace GrassCutter
|
||||
if (id < 0 || id >= HexGrid.Cells || !MowMap.Claim(id)) return;
|
||||
double pay = GameDefs.SectorBonus(Level(PerkId.RegionBonus)) * Crops.Pays(Crops.At(id));
|
||||
Money.Value += pay;
|
||||
Earned.Value += pay;
|
||||
Closed.Value++;
|
||||
SectorClosedRpc(id, pay);
|
||||
}
|
||||
@ -49,11 +50,18 @@ namespace GrassCutter
|
||||
SectorClosed?.Invoke(id, pay);
|
||||
}
|
||||
|
||||
/// <summary>What the crew has mown; the whole planet once the last sector with grass on it is done.</summary>
|
||||
static double MownNow()
|
||||
{
|
||||
double area = MowMap.MownArea();
|
||||
return MowMap.Left == 0 ? GameDefs.PlanetArea : System.Math.Min(area, GameDefs.PlanetArea * 0.99998d);
|
||||
}
|
||||
|
||||
void TickSectors()
|
||||
{
|
||||
if (Time.time < _mownAt) return;
|
||||
_mownAt = Time.time + 1f;
|
||||
Mown.Value = MowMap.MownArea();
|
||||
Mown.Value = MownNow();
|
||||
}
|
||||
|
||||
// ───────────────────────── stakes & survey points ─────────────────────────
|
||||
@ -67,6 +75,7 @@ namespace GrassCutter
|
||||
double pay = Landmarks.Pay(id);
|
||||
Found.Add(id);
|
||||
Money.Value += pay;
|
||||
Earned.Value += pay;
|
||||
MarkFoundRpc(who.DisplayName, id, pay);
|
||||
}
|
||||
|
||||
|
||||
@ -202,6 +202,7 @@ namespace GrassCutter
|
||||
_ufoPaid = true;
|
||||
double tip = System.Math.Round(System.Math.Max(150d, Shipped.Value * 0.03d));
|
||||
Money.Value += tip;
|
||||
Earned.Value += tip;
|
||||
AnnounceRpc(Loc.Pack("The visitors liked the meadow: they left {0} by their crop circle.", UIK.Money(tip)));
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user