Train lines that grow, station yards, a cab to ride, a wagon per upgrade; autopilot unloads where it can

- The grass train lays on to the next station by itself once its newest stretch is mown as far as the cutters reach,
  rounding each station at the edge of its yard, until no station is left within reach; it runs three times as fast
  over the stretches already mown.
- Every station on a line has a yard at the end of the rails: machines (the autopilot too) unload there, the train
  picks it up as it passes and it is paid when the train gets home. With nothing left to cut it carries for the yards.
- E on the locomotive puts you in the cab: W on up the line, S back home, E to get off; it carries on by itself after.
- Three wagons, one more per upgrade (six at Mk IV), 2 t each; the heaps grow as they fill. The upgrade text says so.
- The autopilot only drives to places a machine can unload (garage pads, unload bays, the yard, train yards), not to
  drone pads, binders or catchers, where it used to stop and stand; at a spot that won't take it, it tries the next.
  The HUD unload markers skip those too.
- -demotrain checks the line growing, a yard filling and emptying, the cab ride and six wagons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-11-10 22:31:45 +06:00
parent e186a7e883
commit 86c8403c2a
22 changed files with 776 additions and 154 deletions

View File

@ -709,7 +709,8 @@ namespace GrassCutter
if (!s_yard) { var d = GameObject.Find("DockZone"); s_yard = d ? d.transform : null; }
if (s_yard) _dropSpots.Add((s_yard.position, Loc.T("Yard")));
foreach (var pad in SiloPiece.Pads)
if (pad && pad.IsSpawned && _dropSpots.Count < 12) _dropSpots.Add((pad.PadSpot, pad.PadName));
if (pad && pad.IsSpawned && pad.OnPad(pad.PadSpot) && _dropSpots.Count < 12) _dropSpots.Add((pad.PadSpot, pad.PadName));
Train.Yards(_dropSpots);
// only the nearest one may sit on the screen edge; the rest show only when in view
var from = v.transform.position;
_dropSpots.Sort((x, y) => (x.at - from).sqrMagnitude.CompareTo((y.at - from).sqrMagnitude));

View File

@ -53,14 +53,14 @@ namespace GrassCutter
var row = UIK.El("tune-row", _body);
var names = UIK.El("tune-names", row);
UIK.Text($"{GameDefs.TierName(tier)}", "t-small t-dark", names, false);
UIK.Text(tier == 0 ? Loc.T("As built.") : Loc.F("Now {0}.", GameDefs.TierEffect(kind, tier)), "tune-effect", names, false);
UIK.Text(tier == 0 ? Loc.T("As built.") : Loc.F("Now {0}.", GameDefs.TierEffect(_p.piece, kind, tier)), "tune-effect", names, false);
if (tier < GameDefs.MaxTier)
{
double price = GameDefs.UpgradePrice(_p, tier);
var up = UIK.El("tune-row", _body);
var upNames = UIK.El("tune-names", up);
UIK.Text(Loc.F("Upgrade to {0}", GameDefs.TierName(tier + 1)), "t-small t-dark", upNames, false);
UIK.Text(Loc.F("{0}.", Cap(GameDefs.TierEffect(kind, tier + 1))), "tune-effect", upNames, false);
UIK.Text(Loc.F("{0}.", Cap(GameDefs.TierEffect(_p.piece, kind, tier + 1))), "tune-effect", upNames, false);
UIK.Costs(UIK.Btn(UIK.Money(price), () =>
{
if (!UIK.CanPay(price)) { Sfx.Play("error", 0.7f); return; }