Feedback round: bots that keep working, Sky Mower, calmer HUD, faster menus, new map
- Robot docks and drone pads with no belt ship straight to Earth; robots widen their rings up to 4x once everything in reach is mown, travel 2.5x faster empty, hoppers 60/150 kg. Drone reach 70 m + 25 m per upgrade. - New Sky Mower: a big mowing drone on a pad, 91 sectors, flies over the grass. - Cut paint follows the blade as a strip, no disc ahead of the machine. - Sector toasts aggregate, chimes and till sounds throttled, toasts moved and narrowed. - Menus no longer rebuild on every money change (price tint follows the wallet), scroll position kept. - Map drawn as one mesh, opens near the player, ME / + / - / GLOBE, scale bar. - Key-art still (x_key) and -shotsize for the store stills; -demobots test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -4,7 +4,11 @@ using UnityEngine;
|
||||
|
||||
namespace GrassCutter
|
||||
{
|
||||
/// <summary>A robot mower and its dock: it works the rings of sectors around the dock, and the dock ties what it brings into bundles for the belt.</summary>
|
||||
/// <summary>
|
||||
/// A robot mower and its dock: it works the rings of sectors around the dock, and the dock ties what it brings into
|
||||
/// bundles for the belt, or with no belt sends it straight to Earth. When everything in its rings is mown it takes the
|
||||
/// next ring out, up to four times its first reach, so a dock keeps working for a long time without being moved.
|
||||
/// </summary>
|
||||
public class RobotDock : Mowbot, IPorts
|
||||
{
|
||||
const float SiloRoom = 100f, UnloadRate = 5f;
|
||||
@ -13,12 +17,14 @@ namespace GrassCutter
|
||||
public readonly NetworkVariable<float> Silo = new NetworkVariable<float>();
|
||||
|
||||
bool _unloading;
|
||||
int _turn, _area;
|
||||
int _turn, _area, _reach;
|
||||
float _shipAt;
|
||||
|
||||
protected override Transform Body => bot;
|
||||
protected override bool NoseOnBack => true;
|
||||
protected override Vector3 Origin => transform.position;
|
||||
protected override int Reach => Def.reach;
|
||||
protected override int Reach => _reach > 0 ? _reach : Def.reach;
|
||||
int MaxReach => Def.reach * 4;
|
||||
protected override Vector3 HomeDir => Planet.Up(transform.position);
|
||||
|
||||
public override string Prompt
|
||||
@ -26,17 +32,19 @@ namespace GrassCutter
|
||||
get
|
||||
{
|
||||
if (_area == 0) _area = Area();
|
||||
return Loc.F("{0}: {1}, {2} of {3}, {4} sectors, dock holds {5}", Def.name, MoodText, GameDefs.Kilos(Hopper.Value), GameDefs.Kilos(HopperCap), _area, GameDefs.Kilos(Silo.Value));
|
||||
return Loc.F("{0}: {1}, {2} of {3}, {4} sectors, dock holds {5}", Def.name, MoodText, GameDefs.Kilos(Hopper.Value), GameDefs.Kilos(HopperCap), _area, GameDefs.Kilos(Silo.Value))
|
||||
+ " · " + (BeltNet.Belted(GetComponent<BuildPiece>()) ? Loc.T("onto the belt") : Loc.T("straight to Earth"));
|
||||
}
|
||||
}
|
||||
|
||||
public override float[] State
|
||||
{
|
||||
get => new[] { Hopper.Value, Dir.x, Dir.y, Dir.z, Silo.Value };
|
||||
get => new[] { Hopper.Value, Dir.x, Dir.y, Dir.z, Silo.Value, Reach };
|
||||
set
|
||||
{
|
||||
base.State = value;
|
||||
if (value != null && value.Length > 4) Silo.Value = value[4];
|
||||
if (value != null && value.Length > 5) _reach = Mathf.Clamp((int)value[5], Def.reach, MaxReach);
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +55,9 @@ namespace GrassCutter
|
||||
|
||||
protected override bool Stay(float dt)
|
||||
{
|
||||
BeltNet.Drain(GetComponent<BuildPiece>(), Silo, ref _turn);
|
||||
var piece = GetComponent<BuildPiece>();
|
||||
if (BeltNet.Belted(piece)) BeltNet.Drain(piece, Silo, ref _turn);
|
||||
else BeltNet.Ship(Silo, transform.position, ref _shipAt);
|
||||
if (_unloading)
|
||||
{
|
||||
float give = Mathf.Min(Hopper.Value, UnloadRate * dt, SiloRoom - Silo.Value);
|
||||
@ -58,7 +68,8 @@ namespace GrassCutter
|
||||
}
|
||||
if (Hopper.Value >= 0.01f)
|
||||
{
|
||||
Mood.Value = (byte)(give > 0f ? RobotMood.Unloading : RobotMood.Waiting);
|
||||
// with no belt the dock ships every few seconds: that is unloading, not waiting for a belt
|
||||
Mood.Value = (byte)(give > 0f || !BeltNet.Belted(piece) ? RobotMood.Unloading : RobotMood.Waiting);
|
||||
return true;
|
||||
}
|
||||
Hopper.Value = 0f;
|
||||
@ -72,8 +83,23 @@ namespace GrassCutter
|
||||
|
||||
protected override void NoWork()
|
||||
{
|
||||
// its rings are done: one more ring out, and look again
|
||||
if (Reach < MaxReach)
|
||||
{
|
||||
_reach = Reach + 1;
|
||||
_area = 0;
|
||||
Mood.Value = (byte)RobotMood.Travelling;
|
||||
return;
|
||||
}
|
||||
if (Vector3.Dot(Dir, HomeDir) < 0.9999999f || Hopper.Value > 0f) GoHome();
|
||||
else Mood.Value = (byte)RobotMood.Finished;
|
||||
}
|
||||
|
||||
public override void Moved(Vector3 at)
|
||||
{
|
||||
base.Moved(at);
|
||||
_reach = Def.reach;
|
||||
_area = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user