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

@ -9,6 +9,113 @@ namespace GrassCutter
/// -demofix: close looks at the base furniture people asked about: a deck ladder where it meets the railing, the hay
/// bale on the deck, the foot of the loading ramp and the back of the upgrade console.
/// </summary>
/// <summary>The second round: intakes beside the ladders, a body dropped on the roofs, the new meadow pieces, a pack on
/// the belt, acid rain on the deck and the meadow, and the headlamp at night on a tool in hand and on a vending machine.</summary>
IEnumerator FixMore()
{
// the north side from the meadow: ladders in their openings, intakes clear of them
Me.Teleport(new Vector3(-4f, 1.4f - 1.6f, 16f));
yield return new WaitForSeconds(0.6f);
Me.LookAt(new Vector3(-4f, 0.4f, 9.5f));
yield return new WaitForSeconds(0.6f);
yield return Shot("fix_intakes_n");
Me.Teleport(new Vector3(12f, 1.4f - 1.6f, -14f));
yield return new WaitForSeconds(0.6f);
Me.LookAt(new Vector3(4f, 0.4f, -9.5f));
yield return new WaitForSeconds(0.6f);
yield return Shot("fix_intakes_s");
// dropped from above the crew cabin's ridge: where does the body come to rest?
Me.SetFlying(false);
foreach (var probe in new[] { new Vector3(-6f, 9f, 7f), new Vector3(-6.8f, 9f, 6.2f) })
{
Me.Teleport(probe);
yield return new WaitForSeconds(3f);
Log($"roof probe from {probe}: rests at y {Me.transform.position.y:0.00}, grounded {Me.Grounded}");
foreach (var h in Physics.RaycastAll(probe + Vector3.up * 5f, Vector3.down, 20f, ~0, QueryTriggerInteraction.Ignore))
Log($" ray hits {h.collider.name} ({h.collider.GetType().Name}, layer {h.collider.gameObject.layer}, enabled {h.collider.enabled}) at y {h.point.y:0.00}");
}
Me.SetFlying(true);
// the new meadow pieces, the nearest of each
var ground = FindAnyObjectByType<Ground>();
if (ground)
{
foreach (var kind in new[] { "SM_Boulders", "SM_SlabStones", "SM_Crystals", "SM_Shrooms", "SM_Stump", "SM_BulbPlants" })
{
Transform best = null;
float bd = float.MaxValue;
foreach (var t in ground.GetComponentsInChildren<Transform>(true))
{
if (!t.name.StartsWith(kind) || t.parent == null || t.parent.name.StartsWith("SM_")) continue;
float d = (t.position - Me.transform.position).sqrMagnitude;
if (d < bd) { bd = d; best = t; }
}
if (!best) { Log($"no {kind} on the ball"); continue; }
var up = Planet.Up(best.position);
var side = Vector3.Cross(up, Vector3.forward).normalized;
Me.Teleport(best.position + side * 7f + up * 1.2f);
yield return new WaitForSeconds(1.2f);
Me.LookAt(best.position + up * 1f);
yield return new WaitForSeconds(0.8f);
yield return Shot("fix_decor_" + kind.Substring(3).ToLowerInvariant());
}
}
// a pack on the belt, in hand, and one had from it
Me.BeltSlots.Value = 4;
Cheats.Run("tool all");
yield return new WaitForSeconds(0.5f);
Me.Tools.Unequip(ToolId.Hammer);
Me.Tools.Unequip(ToolId.LongScythe);
Me.Tools.AddPack(TreatId.Beer, Treats.PackSize);
Me.Teleport(new Vector3(2f, 0.05f, 2f));
yield return new WaitForSeconds(0.5f);
Me.LookAt(new Vector3(2f, 1.2f, 12f));
Me.Tools.Select(ToolId.BeerPack);
yield return new WaitForSeconds(0.6f);
yield return Shot("fix_pack_belt");
Ctl.BotUsePressed = true;
yield return null;
Ctl.BotUsePressed = false;
yield return new WaitForSeconds(1.4f);
yield return Shot("fix_pack_drink");
Log($"pack: {Me.Tools.PackLeft(TreatId.Beer)} left, belt {string.Join(", ", Me.Tools.Belt)}");
yield return new WaitForSeconds(3f);
// acid rain on the deck rail, a machine and the meadow
Cheats.Run("weather acidrain 5");
yield return new WaitForSeconds(9f);
Me.Teleport(new Vector3(-2f, 0.05f, 6f));
yield return new WaitForSeconds(0.5f);
Me.LookAt(new Vector3(-2f, -0.4f, 11f));
yield return new WaitForSeconds(1.5f);
yield return Shot("fix_acid_edge");
Me.LookAt(new Vector3(0f, 0f, 3f));
yield return new WaitForSeconds(1.5f);
yield return Shot("fix_acid_deck");
Cheats.Run("weather clear");
// night: the headlamp on the tool in hand, and on a vending machine's own lights
float pinned = Sun.Pinned;
Sun.Pinned = Mathf.Repeat(pinned + 0.5f, 1f);
yield return new WaitForSeconds(4f);
Me.Tools.Select(ToolId.Scythe);
Me.LookAt(Me.transform.position + Me.transform.forward * 5f - Me.transform.up * 1.5f);
yield return new WaitForSeconds(1f);
yield return Shot("fix_night_tool");
var vm = VendingMachine.All.Count > 0 ? VendingMachine.All[0] : null;
if (vm)
{
Me.Teleport(vm.transform.position + vm.transform.forward * 1.6f + Vector3.up * 0.05f);
yield return new WaitForSeconds(0.6f);
Me.LookAt(vm.transform.position + Vector3.up * 1.1f);
yield return new WaitForSeconds(1f);
yield return Shot("fix_night_vending");
}
Sun.Pinned = pinned;
}
IEnumerator FixLook()
{
BotCapture.From = null;
@ -20,10 +127,10 @@ namespace GrassCutter
Me.SetFlying(true);
var spots = new (string name, Vector3 eye, Vector3 at)[]
{
("fix_ladder_a", new Vector3(-1.5f + 0.0f, 1.2f, 0f), new Vector3(-1.5f, 0.2f, 9f)),
("fix_ladder_b", new Vector3(-0.5f, 0.6f, 12f), new Vector3(-1.5f, 0.3f, 9f)),
("fix_ladder_c", new Vector3(-3.5f, 1.8f, 11.5f), new Vector3(-1.5f, 0f, 9f)),
("fix_ladder_d", new Vector3(-1.5f, -0.6f, 10.5f), new Vector3(-1.5f, 0.9f, 9f)),
("fix_ladder_a", new Vector3(-2f, 1.2f, 0f), new Vector3(-2f, 0.2f, 9f)),
("fix_ladder_b", new Vector3(-1f, 0.6f, 12f), new Vector3(-2f, 0.3f, 9f)),
("fix_ladder_c", new Vector3(-4f, 1.8f, 11.5f), new Vector3(-2f, 0f, 9f)),
("fix_ladder_d", new Vector3(-2f, -0.6f, 10.5f), new Vector3(-2f, 0.9f, 9f)),
("fix_hay", new Vector3(5.5f, 1.4f, -5.2f), new Vector3(7.8f, 0.2f, -7.6f)),
("fix_hay_side", new Vector3(10.5f, 0.3f, -7.6f), new Vector3(7.8f, 0.1f, -7.6f)),
("fix_yard", new Vector3(0f, 2.2f, -9f), new Vector3(0f, -1.2f, -20f)),
@ -40,6 +147,7 @@ namespace GrassCutter
yield return new WaitForSeconds(0.6f);
yield return Shot(s.name);
}
yield return FixMore();
Log("demofix done");
Application.Quit();
}

View File

@ -2355,6 +2355,17 @@ namespace GrassCutter
Me.LookAt(at + new Vector3(-6f, 1.4f, 9f));
yield return new WaitForSeconds(1f);
yield return Shot($"{i}_{tool}_rest");
if (tool == ToolId.Hammer)
{
// which way the head faces, turned about the handle a quarter at a time
for (int q = 1; q < 4; q++)
{
ViewModel.Spin(tool, q * 90f);
yield return new WaitForSeconds(0.3f);
yield return Shot($"{i}_{tool}_spin{q * 90}");
}
ViewModel.Spin(tool, 0f);
}
Me.LookAt(ground);
yield return new WaitForSeconds(0.6f);
yield return Shot($"{i}_{tool}_rest_down");

View File

@ -303,6 +303,51 @@ namespace GrassCutter
Emit(i._drops, pos + side * s * 0.5f, (side * s * 1.8f + Planet.LocalUp * 2.4f) * (0.6f + speed01), Random.Range(0.05f, 0.09f), Clip(), 0.8f);
}
public enum Surface { Ground, Grass, Wood, Metal }
/// <summary>
/// A raindrop landing, as the thing it lands on takes it. Soil throws up a brown fleck and a dull ring; grass shakes off
/// a spray of beads; wood beads up; metal rings out with a hard bright bounce. Acid adds its own: a fizz of steam on
/// metal, a thin brown smoke off wood, scorched flecks and a yellow puff off grass, a yellow froth on soil.
/// </summary>
public static void RainHit(Vector3 pos, Vector3 up, Surface on, Color tint, float acid)
{
var i = I;
if (!i || !i.Budget(1)) return;
var drop = new Color(tint.r, tint.g, tint.b, 0.55f);
switch (on)
{
case Surface.Ground:
Emit(i._ring, pos + up * 0.03f, Vector3.zero, Random.Range(0.12f, 0.22f), new Color(0.42f, 0.33f, 0.22f, 0.5f), 0.6f);
for (int k = 0; k < 2; k++)
Emit(i._drops, pos + up * 0.03f, up * Random.Range(1.2f, 2f) + Random.insideUnitSphere * 0.9f, Random.Range(0.025f, 0.04f), new Color(0.36f, 0.27f, 0.17f, 1f), 0.35f);
if (acid > 0.5f) Emit(i._puff, pos + up * 0.04f, up * 0.25f, Random.Range(0.1f, 0.18f), new Color(0.85f, 0.9f, 0.35f, 0.5f), 0.9f);
break;
case Surface.Grass:
for (int k = 0; k < 3; k++)
Emit(i._drops, pos + up * 0.25f + Random.insideUnitSphere * 0.1f, up * Random.Range(0.8f, 1.6f) + Random.insideUnitSphere * 1.2f, Random.Range(0.02f, 0.035f),
acid > 0.5f ? new Color(0.55f, 0.5f, 0.15f, 1f) : new Color(0.7f, 0.9f, 0.75f, 0.9f), 0.4f);
if (acid > 0.5f && Random.value < 0.4f) Emit(i._puff, pos + up * 0.3f, up * 0.35f, Random.Range(0.12f, 0.2f), new Color(0.8f, 0.85f, 0.4f, 0.4f), 1.1f);
break;
case Surface.Wood:
Emit(i._puff, pos + up * 0.02f, up * 0.3f, Random.Range(0.06f, 0.1f), drop, 0.4f);
for (int k = 0; k < 2; k++)
Emit(i._drops, pos + up * 0.02f, up * Random.Range(0.8f, 1.4f) + Random.insideUnitSphere * 0.6f, Random.Range(0.02f, 0.03f), drop, 0.3f);
if (acid > 0.5f && Random.value < 0.5f) Emit(i._puff, pos + up * 0.05f, up * Random.Range(0.4f, 0.7f), Random.Range(0.15f, 0.25f), new Color(0.35f, 0.3f, 0.2f, 0.45f), 1.4f);
break;
case Surface.Metal:
for (int k = 0; k < 4; k++)
Emit(i._drops, pos + up * 0.02f, up * Random.Range(2.2f, 3.4f) + Random.insideUnitSphere * 1.6f, Random.Range(0.018f, 0.028f), new Color(0.9f, 0.95f, 1f, 1f), 0.3f);
Emit(i._sparkle, pos + up * 0.03f, up * 0.4f, Random.Range(0.06f, 0.1f), new Color(1f, 1f, 1f, 0.8f), 0.25f);
if (acid > 0.5f)
{
Emit(i._steam, pos + up * 0.05f, up * Random.Range(0.6f, 1f), Random.Range(0.12f, 0.2f), new Color(0.88f, 1f, 0.6f, 0.45f), 0.5f);
if (Random.value < 0.25f) Emit(i._sparkle, pos + up * 0.05f, up * 1.2f + Random.insideUnitSphere, 0.05f, new Color(0.8f, 1f, 0.3f, 1f), 0.3f);
}
break;
}
}
/// <summary>Vaporizer / hot vent: big soft white billows.</summary>
public static void Steam(Vector3 pos, float amount)
{