Round 6 fixes: held tools, headlamp glare, ladder openings, level horizon, roof hulls, rain hits, idle motion, belt packs, meadow variety

- Held tools sit lower and further right; the hammer faces forward and strikes about the camera's right
- Headlamp leaves held items, treats and vending machines alone (rendering layer NoLamp); other lights keep lighting them
- Hay grounded on the floor in world space (it floated)
- Deck fence opens at each ladder, rail colliders split around it; ladders moved to 2 m off the edge middle, clear of the intakes; climbing goes over a rail only if one is in the way
- Crew stand to the soil's up (Planet.Level): flat round the base, the ball's up past it, so the horizon stays level on a small planet
- Convex roof hulls for the crew cabin, garage, pitched roof and windmill tower; cabin box lowered to the eaves
- Rain and acid rain hits differ by surface: soil, grass, wood, metal
- Idle motion: dishes pan, sways sway, sensors turn, eyes blink, windmill turns in the breeze, reels and parked rotors tick over
- Belt: take tools off at the supply wall; hold E at a vending machine for a pack of 3 on the belt, LMB has one
- New meadow pieces: boulders, slab stones, crystals, mushrooms, stump, bulb plants
- -demofix checks for all of the above; loc rows in all 11 tables

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-12-01 22:52:05 +06:00
parent fd20af06ae
commit 36e4bb2a10
88 changed files with 7588 additions and 4926 deletions

View File

@ -99,6 +99,7 @@ namespace GrassCutter
public override void OnNetworkSpawn()
{
All.Add(this);
IdleMotion.Attach(gameObject);
_run = GetComponentInChildren<BeltRun>();
if (_run) _run.Lay(transform.position, To.Value);
// grass doesn't grow through a machine

View File

@ -155,7 +155,7 @@ namespace GrassCutter
float lean = leg == 1 || leg == 5 ? Mathf.Sin(k * Mathf.PI) * 14f : 0f;
float sway = trip.w >= 0f ? Mathf.Sin(Time.time * 2.1f + i) * 2.5f : 0f;
d.SetPositionAndRotation(at, face * Quaternion.Euler(lean, 0f, sway));
float spin = trip.w >= 0f ? 1900f : 0f;
float spin = trip.w >= 0f ? 1900f : 70f;
foreach (var r in _rotors[i]) if (r) r.Rotate(up, spin * Time.deltaTime, Space.World);
if (_hum[i]) _hum[i].volume = trip.w >= 0f ? 0.3f * Sfx.SfxVolume : 0f;
}

View File

@ -5,7 +5,9 @@ namespace GrassCutter
{
/// <summary>What a player can hold: six hand tools from nail scissors to the two-handed scythe, each with its own
/// grass container, and the hammer that opens the build menu.</summary>
public enum ToolId : byte { NailScissors = 0, GardenShears = 1, Sickle = 2, Scythe = 3, LongScythe = 4, WideScythe = 5, Hammer = 6, LawnMower = 7, None = 255 }
public enum ToolId : byte { NailScissors = 0, GardenShears = 1, Sickle = 2, Scythe = 3, LongScythe = 4, WideScythe = 5, Hammer = 6, LawnMower = 7,
/// <summary>Not tools: a pack of treats from a vending machine, taking up a belt slot until it is used up.</summary>
BeerPack = 100, CigarPack = 101, None = 255 }
/// <summary>Personal gear on the supply wall; shares the owned mask with the tools.</summary>
public enum GearId : byte { Jetpack = 8, Boots = 9, NightVision = 10 }
@ -206,6 +208,10 @@ namespace GrassCutter
public static bool IsBlade(ToolId t) => t <= ToolId.WideScythe || t == ToolId.LawnMower;
/// <summary>Pushed along the ground instead of swung: cuts under its deck while you walk.</summary>
public static bool IsMower(ToolId t) => t == ToolId.LawnMower;
public static bool IsPack(ToolId t) => t == ToolId.BeerPack || t == ToolId.CigarPack;
public static bool IsTool(ToolId t) => (int)t < ToolCount;
public static TreatId PackTreat(ToolId t) => t == ToolId.BeerPack ? TreatId.Beer : TreatId.Cigar;
public static ToolId PackOf(TreatId k) => k == TreatId.Beer ? ToolId.BeerPack : ToolId.CigarPack;
/// <summary>Scythes and shears have a basket perk each; the mower's bag only grows with the compactor.</summary>
public static bool HasBinPerk(ToolId t) => t <= ToolId.WideScythe;
public static PerkId BinPerk(ToolId t) => (PerkId)((int)PerkId.BinScissors + (int)t);

View File

@ -18,6 +18,7 @@ namespace GrassCutter
go.transform.SetParent(transform, false);
go.transform.localPosition = new Vector3(0f, 2.35f, 0f);
_light = go.AddComponent<Light>();
_light.renderingLayerMask = -1;
_light.type = LightType.Point;
_light.color = Warm;
_light.range = 9f;

View File

@ -168,7 +168,8 @@ namespace GrassCutter
if (spin)
{
if (_spinAxis < 0) _spinAxis = BaseRot.LocalAxisFor(spin, transform.forward);
_spun += _pace * 300f * Time.deltaTime;
float idle = Piece.piece == PieceId.Dryer ? 18f + WeatherFx.Wind * 140f : 10f;
_spun += (_pace * 300f + idle * (1f - Mathf.Clamp01(_pace * 4f))) * Time.deltaTime;
var axis = _spinAxis == 0 ? Vector3.right : _spinAxis == 1 ? Vector3.up : Vector3.forward;
spin.localRotation = BaseRot.Of(spin) * Quaternion.Euler(axis * _spun);
}

View File

@ -57,9 +57,9 @@ namespace GrassCutter
void LateUpdate()
{
if (!reel || !Mowing.Value) return;
if (!reel) return;
if (_reelAxis < 0) _reelAxis = BaseRot.LocalAxisFor(reel, transform.right);
_spun += ReelSpeed * Time.deltaTime;
_spun += (Mowing.Value ? ReelSpeed : 14f) * Time.deltaTime;
var axis = _reelAxis == 0 ? Vector3.right : _reelAxis == 1 ? Vector3.up : Vector3.forward;
reel.localRotation = BaseRot.Of(reel) * Quaternion.Euler(axis * _spun);
}

View File

@ -6,6 +6,8 @@ namespace GrassCutter
public class StationTerminal : MonoBehaviour, IInteractable
{
public string Prompt => Loc.T("Travel terminal");
void Start() => IdleMotion.Attach(gameObject);
public bool CanInteract => TeamState.Instance;
public void Interact()

View File

@ -12,6 +12,8 @@ namespace GrassCutter
public static class Treats
{
public const float CostKg = 1f;
/// <summary>A pack for the belt: this many at once (for as many kilos), and a slot holds at most PackMost.</summary>
public const int PackSize = 3, PackMost = 6;
public const float Seconds = 150f;
/// <summary>Grass Beer: the blade cuts this much wider.</summary>
public const float BeerMow = 1.4f;

View File

@ -521,7 +521,7 @@ namespace GrassCutter
if (reel)
{
if (_reelAxis < 0) _reelAxis = BaseRot.LocalAxisFor(reel, transform.right);
reel.localRotation = BaseRot.Of(reel) * Quaternion.Euler(Axis(_reelAxis) * (Time.time * (slurp ? 260f : HasDriver ? 90f : 0f)));
reel.localRotation = BaseRot.Of(reel) * Quaternion.Euler(Axis(_reelAxis) * (Time.time * (slurp ? 260f : HasDriver ? 90f : 9f)));
}
if (wheels != null && wheels.Length > 0)
{

View File

@ -30,7 +30,15 @@ namespace GrassCutter
static readonly Color BeerGlow = new Color(1f, 0.82f, 0.32f), CigarGlow = new Color(1f, 0.55f, 0.22f), Deny = new Color(1f, 0.15f, 0.1f);
public string Prompt => Loc.F("{0}: 1 kg of grass from your tool. {1}, {2} for 2½ minutes", Treats.Name(kind), Treats.Boost(kind), Treats.Effect(kind));
public string Prompt
{
get
{
var line = Loc.F("{0}: 1 kg of grass from your tool. {1}, {2} for 2½ minutes", Treats.Name(kind), Treats.Boost(kind), Treats.Effect(kind));
var me = PlayerAgent.Local;
return me && me.Tools.PackRoom(kind) ? line + "\n" + Loc.F("Hold {0}: a pack of {1} for your belt ({1} kg)", Binds.Cap(Act.Interact), Treats.PackSize) : line;
}
}
public bool CanInteract => TeamState.Instance && !_busy && !TreatHand.Busy;
void OnEnable() => All.Add(this);
@ -38,6 +46,8 @@ namespace GrassCutter
void Start()
{
// its own lit sign and display: the headlamp on top of them only burnt them out
DayNight.KeepOutOfLamp(gameObject);
_mpb = new MaterialPropertyBlock();
_signBase = kind == TreatId.Beer ? new Color(0.25f, 1f, 0.5f) : CigarGlow;
_displayBase = kind == TreatId.Beer ? new Color(0.45f, 1f, 0.55f) : new Color(1f, 0.72f, 0.4f);
@ -64,12 +74,40 @@ namespace GrassCutter
Hud.Toast(Loc.T("Bring 1 kg of grass in your tool: mow a little first"), Hud.ToastKind.Warn);
return;
}
StartCoroutine(Choose(me));
}
/// <summary>A tap has it now; held a moment, it's a pack for the belt (if there's room and grass enough).</summary>
IEnumerator Choose(PlayerAgent me)
{
_busy = true;
float held = 0f;
while (Ctl.InteractHeld && held < 0.4f) { held += Time.deltaTime; yield return null; }
_busy = false;
var from = me.Tools.Nozzle;
if (held >= 0.4f && me.Tools.PackRoom(kind))
{
float cost = Treats.CostKg * Treats.PackSize;
if (me.Tools.Carried < cost - 0.001f)
{
_deny = 1f;
Sfx.PlayAt("error", transform.position, 0.7f);
Hud.Toast(Loc.F("A pack takes {0} kg of grass from your tools", Treats.PackSize), Hud.ToastKind.Warn);
yield break;
}
me.Tools.Spend(cost);
me.TreatRpc((byte)kind, transform.position, from);
_pack = true;
Play(true, from);
yield break;
}
me.Tools.Spend(Treats.CostKg);
me.TreatRpc((byte)kind, transform.position, from);
Play(true, from);
}
bool _pack;
/// <summary>Run the machine's show: for the buyer it ends with the treat in their hand, for everyone else it's just the show.</summary>
public void Play(bool mine, Vector3 from)
{
@ -168,7 +206,18 @@ namespace GrassCutter
yield return null;
}
Destroy(item.gameObject);
TreatHand.I?.Play(kind);
if (_pack)
{
_pack = false;
var me = PlayerAgent.Local;
if (me && me.Tools.AddPack(kind, Treats.PackSize))
{
Sfx.Play("plastic_grab", 0.6f, 0.9f);
Hud.Toast(Loc.F("{0} ×{1} on your belt: pick the slot and click to have one", Treats.Name(kind), me.Tools.PackLeft(kind)), Hud.ToastKind.Info);
}
else TreatHand.I?.Play(kind);
}
else TreatHand.I?.Play(kind);
}
else if (item)
{