Smaller planets, 93% sectors, dearer late game, automation perks, autopilot, grass train

Not yet tried in the game: Unity could not get a licence (Unity Hub isn't
running), so this was only type-checked with Roslyn.

- Planets by area: the hard one half the old whole planet, normal a third of
  that, easy a sixth. Saves keep the size set they were made on (sizeGen 0).
- A sector closes at 93% mown.
- Mid and late prices go up (perks, machines, vehicles, tunes); the early
  game stays as it was.
- AUTOMATION perk tree: Long Leash (robot reach), Overdrive Motors, Bigger
  Hoppers, Long-Range Drones and Hive Mind.
- Autopilot, a garage tune for mowers: C hands the machine over. It mows the
  fields around in strokes, unloads at the nearest pad or the base yard and
  comes back. Getting in takes it back; it carries on after a load.
- Grass Train: lays its own track to a station next door, mowing under it,
  then runs back and forth cutting wider each run. Models in gc_train.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-11-10 11:39:02 +06:00
parent 5b14fd6635
commit df55b5e417
37 changed files with 1690 additions and 328 deletions

View File

@ -46,6 +46,8 @@ namespace GrassCutter
public int ver;
/// <summary>How big the ball is: 0 the whole planet (every save from before there was a choice), 1 half, 2 a third.</summary>
public int level;
/// <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>Time of day: the first morning begins here.</summary>
public float day = 0.75f;
@ -86,7 +88,7 @@ namespace GrassCutter
Tiles.OnListChanged += _ => { TilesChanged?.Invoke(); Changed?.Invoke(); };
if (!IsServer)
{
Difficulties.Apply((Difficulty)Size.Value);
Difficulties.ApplyWire(Size.Value);
MowMap.Reset(); // the host sends what has been cut
}
WatchSectors();
@ -140,6 +142,15 @@ namespace GrassCutter
public float BundleSeconds => GameDefs.BundleSeconds(Level(PerkId.QuickTwine), Level(PerkId.ExpressDepot));
/// <summary>Rings a robot starts further out, from Long Leash.</summary>
public int BotReachRings => Level(PerkId.BotReach);
/// <summary>How far out a robot may roam, against its own limit.</summary>
public float BotRoamMul => 1f + Level(PerkId.BotReach) * 0.25f;
public float BotSpeedMul => (1f + Level(PerkId.BotSpeed) * 0.12f) * (Has(PerkId.HiveMind) ? 1.2f : 1f);
public float BotHopperMul => 1f + Level(PerkId.BotHopper) * 0.25f;
public float DroneReachAdd => Level(PerkId.DroneRange) * GameDefs.DroneReachStep;
public float DroneSpeedMul => Has(PerkId.HiveMind) ? 1.2f : 1f;
public float PayoutMul => GameDefs.PayoutMul(Level(PerkId.EarthPrices), Level(PerkId.GreenExchange));
public double ToolPrice(ToolDef d) => d.id == ToolId.Hammer ? d.price : Math.Round(d.price * (double)GameDefs.ToolPriceMul(Level(PerkId.SupplyDeals)), 2);
@ -325,7 +336,7 @@ namespace GrassCutter
public void Save()
{
if (!IsServer) return;
var d = new SaveData { ver = 6, level = Size.Value, 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, 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];
@ -356,8 +367,8 @@ namespace GrassCutter
// the ball first: the mow map, the stakes and every piece go down on it
var level = fresh ? Difficulties.Chosen : (Difficulty)d.level;
if (fresh && CommandLine.Get("-difficulty") is string forced && byte.TryParse(forced, out byte f)) level = (Difficulty)f;
Difficulties.Apply(level);
Size.Value = (byte)Difficulties.Current;
Difficulties.Apply(level, fresh ? Difficulties.NewGen : d.sizeGen);
Size.Value = Difficulties.Wire;
MowMap.Reset();
if (!fresh) LoadMow();
Money.Value = d.money;