- 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>
48 lines
2.2 KiB
C#
48 lines
2.2 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace GrassCutter
|
|
{
|
|
public enum TreatId : byte { Beer = 0, Cigar = 1 }
|
|
|
|
/// <summary>
|
|
/// What the two vending machines on the deck sell for a kilo of grass, and the boost each one gives the one who had it.
|
|
/// Personal and kept on this machine only: everyone buys their own, and a boost is gone when the match ends.
|
|
/// </summary>
|
|
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;
|
|
/// <summary>Herb Cigar: you walk and run this much faster.</summary>
|
|
public const float CigarMove = 1.3f;
|
|
|
|
static float _beerUntil = -1f, _cigarUntil = -1f;
|
|
|
|
public static event Action<TreatId> Started;
|
|
|
|
public static float Left(TreatId t) => Mathf.Max(0f, (t == TreatId.Beer ? _beerUntil : _cigarUntil) - Time.time);
|
|
public static bool On(TreatId t) => Left(t) > 0f;
|
|
public static float MowMul => On(TreatId.Beer) ? BeerMow : 1f;
|
|
public static float MoveMul => On(TreatId.Cigar) ? CigarMove : 1f;
|
|
|
|
public static string Name(TreatId t) => t == TreatId.Beer ? Loc.T("Grass Beer") : Loc.T("Herb Cigar");
|
|
public static string Boost(TreatId t) => t == TreatId.Beer ? Loc.T("Liquid Courage") : Loc.T("Second Wind");
|
|
public static string Effect(TreatId t) => t == TreatId.Beer ? Loc.T("+40% cutting width") : Loc.T("+30% walking speed");
|
|
public static string Icon(TreatId t) => t == TreatId.Beer ? "icon_treat_beer" : "icon_treat_cigar";
|
|
|
|
/// <summary>The boost starts (or starts over: a second can doesn't stack, it tops the clock back up).</summary>
|
|
public static void Begin(TreatId t)
|
|
{
|
|
if (t == TreatId.Beer) _beerUntil = Time.time + Seconds;
|
|
else _cigarUntil = Time.time + Seconds;
|
|
Started?.Invoke(t);
|
|
}
|
|
|
|
public static void Clear() { _beerUntil = _cigarUntil = -1f; }
|
|
}
|
|
}
|