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:
@ -525,6 +525,33 @@ namespace GrassCutter
|
||||
return false;
|
||||
}
|
||||
|
||||
static readonly List<Port> s_belted = new List<Port>();
|
||||
|
||||
/// <summary>Does a belt leave any of this piece's hatches?</summary>
|
||||
public static bool Belted(BuildPiece piece)
|
||||
{
|
||||
if (!piece) return false;
|
||||
s_belted.Clear();
|
||||
piece.Ports(s_belted);
|
||||
foreach (var p in s_belted)
|
||||
if (!p.input && Nearest(p.at, true, Joined, piece, out var next, out _, out _) && next.GetComponentInChildren<Conveyor>()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server: a silo with no belt out sends what it holds straight to Earth, a batch every few seconds (one payment
|
||||
/// and one message per batch, not one per kilo). A belt is for more money (bales, bricks), never a must.
|
||||
/// </summary>
|
||||
public static void Ship(NetworkVariable<float> silo, Vector3 at, ref float next)
|
||||
{
|
||||
if (silo.Value < 1f || Time.time < next) return;
|
||||
next = Time.time + 3f;
|
||||
var ts = TeamState.Instance;
|
||||
if (!ts) return;
|
||||
ts.ServerDeposit(silo.Value, CargoKind.Grass, at);
|
||||
silo.Value = 0f;
|
||||
}
|
||||
|
||||
/// <summary>Does a belt already end here?</summary>
|
||||
public static bool Taken(Vector3 at)
|
||||
{
|
||||
|
||||
@ -7,12 +7,14 @@ namespace GrassCutter
|
||||
/// <summary>
|
||||
/// A pad of fetching drones. Bundles of grass lying loose within <see cref="Range"/> of it (thrown down, dropped off the
|
||||
/// end of a belt, flung by a twister) are flown in, one per drone per trip, and go into the pad's silo, which puts them
|
||||
/// on the belts like any other silo. A trip is one synced value per drone (where to, when it left), and every peer flies
|
||||
/// on the belts like any other silo, or with no belt out sends them straight to Earth: tie a bundle, drop it, the drones
|
||||
/// do the walking. A trip is one synced value per drone (where to, when it left), and every peer flies
|
||||
/// the drone along the same plan from it: up, across, down, grab, up, back, down onto the pad.
|
||||
/// </summary>
|
||||
public class DronePad : SiloPiece
|
||||
{
|
||||
public const float Range = 40f;
|
||||
/// <summary>How far the drones go from a Mk I pad; every upgrade adds <see cref="RangePerTier"/>.</summary>
|
||||
public const float Range = 70f, RangePerTier = 25f;
|
||||
const float Room = 60f, Cruise = 7f, Climb = 3f, Speed = 6f, Hover = 1.35f, GrabTime = 0.8f, Carry = 1f, Look = 0.5f;
|
||||
const int Most = 4;
|
||||
/// <summary>A drone at rest on the pad.</summary>
|
||||
@ -41,6 +43,8 @@ namespace GrassCutter
|
||||
/// <summary>Two drones at Mk I, one more per upgrade, four at most.</summary>
|
||||
int Count => Mathf.Min(Most, 2 + (Piece ? Piece.Tier.Value : 0));
|
||||
float Fly => Speed * Mathf.Sqrt(Piece ? Piece.TierMul : 1f);
|
||||
float Reach => Range + RangePerTier * (Piece ? Piece.Tier.Value : 0);
|
||||
float _shipAt;
|
||||
double Now => NetworkManager ? NetworkManager.ServerTime.Time : Time.timeAsDouble;
|
||||
|
||||
public override string Prompt
|
||||
@ -49,7 +53,8 @@ namespace GrassCutter
|
||||
{
|
||||
int out_ = 0;
|
||||
for (int i = 0; i < Count; i++) if (Trip(i).Value.w >= 0f) out_++;
|
||||
return Loc.F("Drone Pad: {0} drones, {1} out · {2} of {3}", Count, out_, GameDefs.Kilos(Silo.Value), GameDefs.Kilos(Room));
|
||||
return Loc.F("Drone Pad: {0} drones, {1} out · {2} of {3}", Count, out_, GameDefs.Kilos(Silo.Value), GameDefs.Kilos(Room))
|
||||
+ " · " + (BeltNet.Belted(Piece) ? Loc.T("onto the belt") : Loc.F("straight to Earth, {0} m around", Mathf.RoundToInt(Reach)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,8 +164,11 @@ namespace GrassCutter
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
if (Belted()) base.Update();
|
||||
bool belted = Belted();
|
||||
if (belted) base.Update();
|
||||
if (!IsServer || !IsSpawned) return;
|
||||
// no belt out: what the drones bring goes straight to Earth, so they never stand idle on a full silo
|
||||
if (!belted) BeltNet.Ship(Silo, transform.position, ref _shipAt);
|
||||
double now = Now;
|
||||
bool look = Time.time >= _nextLook;
|
||||
if (look) _nextLook = Time.time + Look;
|
||||
@ -224,7 +232,7 @@ namespace GrassCutter
|
||||
for (int k = 0; k < Most; k++) if (Trip(k).Value.w >= 0f) out_++;
|
||||
if (Silo.Value + (out_ + 1) * GameDefs.BundleKg > Room) return;
|
||||
Cargo best = null;
|
||||
float bestD = Range * Range;
|
||||
float bestD = Reach * Reach;
|
||||
var here = transform.position;
|
||||
foreach (var c in Cargo.All)
|
||||
{
|
||||
|
||||
@ -36,7 +36,7 @@ namespace GrassCutter
|
||||
public enum PieceCat : byte { Services, Logistics, Production, Power, Structures, Decor, Count }
|
||||
|
||||
public enum PieceId : byte { Depot, Belt, Splitter, Merger, Square, Hex, Dryer, Press, SolarS, SolarM, SolarL, Garage, Binder, RobotI, RobotII, Reaper, Catcher, Pole, BatteryS, BatteryL, UnloadBay, DronePad, Intake,
|
||||
Wall, WindowWall, DoorWall, Railing, Fence, Floor, FlatRoof, Roof, Stairs, Steps, Pillar, Planter, Lamppost, Bench, Crates, Flagpole, Count }
|
||||
Wall, WindowWall, DoorWall, Railing, Fence, Floor, FlatRoof, Roof, Stairs, Steps, Pillar, Planter, Lamppost, Bench, Crates, Flagpole, SkyMower, Count }
|
||||
|
||||
/// <summary>How a structure finds its place: anywhere, on the edge of a deck, or on top of the walls (a storey up).</summary>
|
||||
public enum Fit : byte { Free, Edge, Top }
|
||||
@ -135,6 +135,8 @@ namespace GrassCutter
|
||||
public string name { get => Loc.T(nameEn); set => nameEn = value; }
|
||||
public int reach;
|
||||
public float width, speed, hopper;
|
||||
/// <summary>Flies this high over the grass (0: drives on it).</summary>
|
||||
public float hover;
|
||||
}
|
||||
|
||||
public class PanelDef
|
||||
@ -311,9 +313,9 @@ namespace GrassCutter
|
||||
new PieceDef { id = PieceId.Binder, cat = PieceCat.Logistics, name = Loc.N("Binder"), icon = "icon_piece_binder", model = "SM_Binder", prefab = "Piece_Binder", price = 100, sizeX = 2, sizeZ = 2,
|
||||
desc = Loc.N("E hands it what's in your tool. It ties the grass into bundles and puts them on the belt at its front.") },
|
||||
new PieceDef { id = PieceId.RobotI, cat = PieceCat.Services, name = Loc.N("Robot Mk I"), icon = "icon_piece_robot", model = "SM_RobotDock", prefab = "Piece_RobotI", price = 250, sizeX = 3, sizeZ = 3,
|
||||
desc = Loc.N("Mows the 19 sectors around its dock. The dock ties what it brings into bundles for the belt.") },
|
||||
desc = Loc.N("Mows the sectors around its dock, then further out once they are done. With a belt the dock sends bundles down it, without one it ships the grass to Earth itself.") },
|
||||
new PieceDef { id = PieceId.RobotII, cat = PieceCat.Services, name = Loc.N("Robot Mk II"), icon = "icon_piece_robot2", model = "SM_RobotDock", prefab = "Piece_RobotII", price = 500, sizeX = 3, sizeZ = 3,
|
||||
desc = Loc.N("37 sectors, a wider cut and a bigger hopper.") },
|
||||
desc = Loc.N("Starts with 37 sectors, a wider cut and a bigger hopper.") },
|
||||
new PieceDef { id = PieceId.Reaper, cat = PieceCat.Services, name = Loc.N("Reaper"), icon = "icon_piece_reaper", model = "SM_Reaper", prefab = "Piece_Reaper", price = 20000, sizeX = 3, sizeZ = 4,
|
||||
desc = Loc.N("Goes from sector to sector on its own and shoots every bundle into a Bundle Catcher, from anywhere on the planet.") },
|
||||
new PieceDef { id = PieceId.Catcher, cat = PieceCat.Services, name = Loc.N("Bundle Catcher"), icon = "icon_piece_catcher", model = "SM_BundleCatcher", prefab = "Piece_Catcher", price = 1500, sizeX = 3, sizeZ = 3,
|
||||
@ -327,7 +329,7 @@ namespace GrassCutter
|
||||
new PieceDef { id = PieceId.UnloadBay, cat = PieceCat.Logistics, name = Loc.N("Unload Bay"), icon = "icon_piece_unloadbay", model = "SM_UnloadBay", prefab = "Piece_UnloadBay", price = 150, sizeX = 4, sizeZ = 7,
|
||||
desc = Loc.N("Drive a mower onto the grate and it empties into the bin. Two hatches at the back put it on belts as bundles.") },
|
||||
new PieceDef { id = PieceId.DronePad, cat = PieceCat.Logistics, name = Loc.N("Drone Pad"), icon = "icon_piece_dronepad", model = "SM_DronePad", prefab = "Piece_DronePad", price = 600, sizeX = 3, sizeZ = 3, scale = 3.2f,
|
||||
desc = Loc.N("Its drones fly out to bundles of grass lying loose within 40 m and bring them in. The front hatch puts them on a belt. Two drones, one more per upgrade.") },
|
||||
desc = Loc.N("Its drones fly out to bundles of grass lying loose within 70 m (25 m more per upgrade) and bring them in. With a belt on the front hatch they go down it, without one straight to Earth. Two drones, one more per upgrade.") },
|
||||
new PieceDef { id = PieceId.Intake, cat = PieceCat.Services, company = true, name = Loc.N("Base Intake"), icon = "icon_piece_hopper", model = "SM_BaseIntake", prefab = "Piece_Intake", sizeX = 3, sizeZ = 2,
|
||||
desc = Loc.N("A low hopper against the side of the base: drop grass in or run a belt to it, and it's paid and on its way to Earth.") },
|
||||
|
||||
@ -364,6 +366,9 @@ namespace GrassCutter
|
||||
desc = Loc.N("Company crates, stacked two high.") },
|
||||
new PieceDef { id = PieceId.Flagpole, cat = PieceCat.Decor, name = Loc.N("Flagpole"), icon = "icon_piece_flagpole", model = "SM_Flagpole", prefab = "Piece_Flagpole", price = 5, sizeX = 1, sizeZ = 1,
|
||||
desc = Loc.N("The crew's own flag, four metres up.") },
|
||||
// (appended: the list follows PieceId, and saves keep the ids)
|
||||
new PieceDef { id = PieceId.SkyMower, cat = PieceCat.Services, name = Loc.N("Sky Mower"), icon = "icon_piece_skymower", model = "SM_DronePad", prefab = "Piece_SkyMower", price = 4000, sizeX = 3, sizeZ = 3, scale = 3.2f,
|
||||
desc = Loc.N("A big mowing drone. It flies over rocks and hills, works 91 sectors around its pad and goes further out once they are mown. No belt needed: the pad sends the grass to Earth.") },
|
||||
};
|
||||
|
||||
public static PieceDef Piece(PieceId id) => Pieces[(int)id];
|
||||
@ -379,7 +384,7 @@ namespace GrassCutter
|
||||
{
|
||||
case PieceId.Belt: case PieceId.Splitter: case PieceId.Merger: return UpgradeKind.Belt;
|
||||
case PieceId.Dryer: case PieceId.Press: case PieceId.Binder: return UpgradeKind.Machine;
|
||||
case PieceId.RobotI: case PieceId.RobotII: case PieceId.Reaper: return UpgradeKind.Robot;
|
||||
case PieceId.RobotI: case PieceId.RobotII: case PieceId.Reaper: case PieceId.SkyMower: return UpgradeKind.Robot;
|
||||
case PieceId.Garage: case PieceId.UnloadBay: case PieceId.Catcher: case PieceId.DronePad: return UpgradeKind.Silo;
|
||||
default: return UpgradeKind.None;
|
||||
}
|
||||
@ -498,9 +503,10 @@ namespace GrassCutter
|
||||
|
||||
public static readonly RobotDef[] Robots =
|
||||
{
|
||||
new RobotDef { piece = PieceId.RobotI, name = Loc.N("Robot Mk I"), reach = 2, width = 0.9f, speed = 1.6f, hopper = 20f },
|
||||
new RobotDef { piece = PieceId.RobotII, name = Loc.N("Robot Mk II"), reach = 3, width = 1.2f, speed = 2.2f, hopper = 50f },
|
||||
new RobotDef { piece = PieceId.RobotI, name = Loc.N("Robot Mk I"), reach = 2, width = 0.9f, speed = 1.6f, hopper = 60f },
|
||||
new RobotDef { piece = PieceId.RobotII, name = Loc.N("Robot Mk II"), reach = 3, width = 1.2f, speed = 2.2f, hopper = 150f },
|
||||
new RobotDef { piece = PieceId.Reaper, name = Loc.N("Reaper"), width = 1.8f, speed = 3f, hopper = 40f },
|
||||
new RobotDef { piece = PieceId.SkyMower, name = Loc.N("Sky Mower"), reach = 5, width = 2f, speed = 4f, hopper = 300f, hover = 2.4f },
|
||||
};
|
||||
|
||||
public static RobotDef Robot(PieceId id)
|
||||
|
||||
@ -16,7 +16,7 @@ namespace GrassCutter
|
||||
/// <summary>The demo's fast forward, on the server.</summary>
|
||||
public static float Haste = 1f;
|
||||
|
||||
const float Tick = 0.2f, Overrun = 0.6f, IdleWait = 5f;
|
||||
const float Tick = 0.2f, Overrun = 0.6f, IdleWait = 5f, TravelMul = 2.5f;
|
||||
const float EngineVolume = 0.16f;
|
||||
const int SearchLimit = 4000;
|
||||
|
||||
@ -104,8 +104,9 @@ namespace GrassCutter
|
||||
All.Add(this);
|
||||
if (IsServer) Seat(Planet.Up(transform.position));
|
||||
_shown = _from = _to = At.Value;
|
||||
_bobPhase = Random.value * 6.28f;
|
||||
At.OnValueChanged += Heard;
|
||||
_engine = Sfx.Loop("robot_mower_loop", Body, 0f);
|
||||
_engine = Sfx.Loop(Def.hover > 0f ? "drone_loop" : "robot_mower_loop", Body, 0f);
|
||||
}
|
||||
|
||||
public override void OnNetworkDespawn()
|
||||
@ -202,7 +203,14 @@ namespace GrassCutter
|
||||
var turn = Quaternion.Slerp(was, Quaternion.LookRotation(flat * nose, up), 1f - Mathf.Exp(-6f * Time.deltaTime));
|
||||
// it glides: no shake, no bob, the moving parts do the living
|
||||
bool going = _leg < 1f && (_to - _from).sqrMagnitude > 1e-4f;
|
||||
body.SetPositionAndRotation(_shown, turn);
|
||||
// a flyer hangs over the grass, bobbing a little, and leans into the way it goes
|
||||
var at = _shown;
|
||||
if (Def.hover > 0f)
|
||||
{
|
||||
at += up * (Def.hover + Mathf.Sin(Time.time * 1.9f + _bobPhase) * 0.15f);
|
||||
turn *= Quaternion.Euler((going ? 8f : 0f) * -nose, 0f, Mathf.Sin(Time.time * 1.3f + _bobPhase) * 2f);
|
||||
}
|
||||
body.SetPositionAndRotation(at, turn);
|
||||
Animate(body, Vector3.SignedAngle(was * Vector3.forward, turn * Vector3.forward, up) / Mathf.Max(1e-3f, Time.deltaTime), going);
|
||||
}
|
||||
|
||||
@ -218,6 +226,7 @@ namespace GrassCutter
|
||||
float _roll, _level;
|
||||
bool _parts;
|
||||
float _spun, _nextBlink = 2f, _blinkAt = -1f, _swayX, _swayV, _wasGoing, _go;
|
||||
float _bobPhase;
|
||||
|
||||
void Animate(Transform body, float turnRate, bool going)
|
||||
{
|
||||
@ -226,7 +235,7 @@ namespace GrassCutter
|
||||
_parts = true;
|
||||
foreach (var c in body.GetComponentsInChildren<Transform>(true))
|
||||
{
|
||||
if (c.name.StartsWith("Spin")) _spin.Add((c, BaseRot.LocalAxisFor(c, body.up)));
|
||||
if (c.name.StartsWith("Spin") || c.name.StartsWith("Rotor")) _spin.Add((c, BaseRot.LocalAxisFor(c, body.up)));
|
||||
else if (c.name.StartsWith("Blink")) _blink.Add((c, BaseRot.LocalAxisFor(c, body.up), c.localScale));
|
||||
else if (c.name.StartsWith("Sway")) _sway.Add(c);
|
||||
else if (c.name.StartsWith("Wheel_"))
|
||||
@ -238,7 +247,8 @@ namespace GrassCutter
|
||||
if (c != body) BaseRot.Of(c);
|
||||
}
|
||||
}
|
||||
_spun += Time.deltaTime * (Mowing.Value ? 1400f : 0f);
|
||||
// a flyer's rotors never stop: it would fall out of the sky
|
||||
_spun += Time.deltaTime * (Def.hover > 0f ? 1900f : Mowing.Value ? 1400f : 0f);
|
||||
foreach (var (t, axis) in _spin)
|
||||
t.localRotation = BaseRot.Of(t) * Quaternion.AngleAxis(_spun, axis == 0 ? Vector3.right : axis == 1 ? Vector3.up : Vector3.forward);
|
||||
// the wheels roll with the ground going by, the clippings rise in the hopper
|
||||
@ -291,7 +301,8 @@ namespace GrassCutter
|
||||
var from = Planet.OnSurface(Dir);
|
||||
// not RotateTowards: it calls anything under a tenth of a degree "there already", and that is 4 m on this ball
|
||||
var gap = goal - Dir;
|
||||
float step = Def.speed * Boost * dt / Planet.Radius;
|
||||
// on the way somewhere (to a sector, home to unload) it goes faster than it mows
|
||||
float step = Def.speed * Boost * (Homing || _travel ? TravelMul : 1f) * dt / Planet.Radius;
|
||||
if (gap.magnitude > step) Dir = (Dir + gap.normalized * step).normalized;
|
||||
else
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +79,8 @@ namespace GrassCutter
|
||||
public override void OnNetworkSpawn()
|
||||
{
|
||||
Instance = this;
|
||||
Money.OnValueChanged += (a, b) => { MoneyChanged?.Invoke(a, b); Changed?.Invoke(); };
|
||||
// the wallet has its own event: cards that rebuilt on every coin lost their scroll and their clicks
|
||||
Money.OnValueChanged += (a, b) => MoneyChanged?.Invoke(a, b);
|
||||
Perks.OnListChanged += _ => Changed?.Invoke();
|
||||
Opened.OnListChanged += _ => Changed?.Invoke();
|
||||
Tiles.OnListChanged += _ => { TilesChanged?.Invoke(); Changed?.Invoke(); };
|
||||
|
||||
@ -341,7 +341,7 @@ namespace GrassCutter
|
||||
if (overMeadow && !onDeck && Tank.Value < Capacity && driving)
|
||||
{
|
||||
mowing = true;
|
||||
float kg = MowMap.Cut(_hasCut ? _lastCut : ip, ip, CutWidth) * GameDefs.GrassDensity;
|
||||
float kg = MowMap.Cut(_hasCut ? _lastCut : ip, ip, CutWidth, blade: true) * GameDefs.GrassDensity;
|
||||
Tank.Value = Mathf.Min(Capacity, Tank.Value + kg);
|
||||
if (Tank.Value >= Capacity - 0.01f) { Sfx.Play("tank_full", 0.8f); Assistant.Say("asst_hopper"); Hud.Toast(Loc.F("{0} hopper full: unload at the base yard, a garage pad or an Unload Bay (follow the UNLOAD markers)", Def.name), Hud.ToastKind.Warn); }
|
||||
_lastCut = ip;
|
||||
@ -511,7 +511,7 @@ namespace GrassCutter
|
||||
// someone else's machine: mow the same strip here
|
||||
if (!IsOwner)
|
||||
{
|
||||
MowMap.Cut(_seenCut ? _seenAt : ip, ip, CutWidth);
|
||||
MowMap.Cut(_seenCut ? _seenAt : ip, ip, CutWidth, blade: true);
|
||||
_seenAt = ip;
|
||||
_seenCut = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user