Rampage/World/TownProps.cs

The prop and town-shape definitions for the Rampage town. TownShape stores a list of coloured boxes, can bake them into one shared model per colour, or merge copies into larger street meshes. PropCatalogue lists every prop kind with its health, score, weight class, quirk, body colours and box geometry, from cars and lampposts to a tank.

using System;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// The look of one kind of thing, as a list of coloured boxes standing on the origin. Baked once
/// into one model per colour and shared by every copy; far away, the same boxes are merged
/// straight into a street's worth of mesh instead.
/// </summary>
public sealed class TownShape
{
	public struct Part
	{
		public Vector3 Centre, Size;
		public Rotation Turn;
		public Color Colour;
		/// <summary>Painted in the copy's own colour (a car's bodywork) instead of a fixed one.</summary>
		public bool Body;
	}

	public readonly List<Part> Parts = new();
	public Vector3 Mins = new( float.MaxValue ), Maxs = new( float.MinValue );

	/// <summary>One model per colour, with its tint and whether it takes the copy's own colour.</summary>
	public Model[] Models = Array.Empty<Model>();
	public Color[] Tints = Array.Empty<Color>();
	public bool[] IsBody = Array.Empty<bool>();
	TownKit _bakedFor;

	public Vector3 Centre => (Mins + Maxs) * 0.5f;
	public Vector3 Size => Maxs - Mins;
	public float Radius => Size.Length * 0.5f;
	public float Height => Maxs.z;

	/// <summary>A box: the middle of its underside (x, y, z), then its full size, colour and yaw in degrees.</summary>
	public TownShape Box( float x, float y, float z, float sx, float sy, float sz, Color colour, float yaw = 0f )
		=> Add( new Vector3( x, y, z + sz * 0.5f ), new Vector3( sx, sy, sz ), colour, yaw == 0f ? Rotation.Identity : Rotation.FromYaw( yaw ), false );

	/// <summary>The same, painted in each copy's own colour.</summary>
	public TownShape Body( float x, float y, float z, float sx, float sy, float sz, float yaw = 0f )
		=> Add( new Vector3( x, y, z + sz * 0.5f ), new Vector3( sx, sy, sz ), Color.White, yaw == 0f ? Rotation.Identity : Rotation.FromYaw( yaw ), true );

	/// <summary>A box by its centre, turned any way (a dish, a sloping sign).</summary>
	public TownShape Tilted( Vector3 centre, Vector3 size, Color colour, Rotation turn ) => Add( centre, size, colour, turn, false );

	/// <summary>A fat round post: two square posts, one turned an eighth, which reads as a drum.</summary>
	public TownShape Drum( float x, float y, float z, float width, float height, Color colour )
		=> Box( x, y, z, width, width, height, colour ).Box( x, y, z, width, width, height, colour, 45f );

	TownShape Add( Vector3 centre, Vector3 size, Color colour, Rotation turn, bool body )
	{
		Parts.Add( new Part { Centre = centre, Size = size, Colour = colour, Turn = turn, Body = body } );
		var h = size * 0.5f;
		for ( int i = 0; i < 8; i++ )
		{
			var corner = centre + turn * new Vector3( (i & 1) == 0 ? -h.x : h.x, (i & 2) == 0 ? -h.y : h.y, (i & 4) == 0 ? -h.z : h.z );
			Mins = Vector3.Min( Mins, corner );
			Maxs = Vector3.Max( Maxs, corner );
		}
		_bakedFor = null;
		return this;
	}

	/// <summary>Makes the shared models, if this kit has not made them already.</summary>
	public void Bake( TownKit kit )
	{
		if ( _bakedFor == kit ) return;
		_bakedFor = kit;

		var groups = new Dictionary<int, TownMesh>();
		var order = new List<int>();
		foreach ( var part in Parts )
		{
			int key = part.Body ? -1 : Tone.Key( part.Colour );
			if ( !groups.TryGetValue( key, out var mesh ) )
			{
				mesh = new TownMesh { Tint = part.Colour };
				groups[key] = mesh;
				order.Add( key );
			}
			mesh.Box( part.Centre, part.Size, part.Turn );
		}

		Models = order.Select( k => kit.Make( groups[k] ) ).ToArray();
		Tints = order.Select( k => groups[k].Tint ).ToArray();
		IsBody = order.Select( k => k == -1 ).ToArray();
	}

	/// <summary>Adds this shape, standing somewhere in the world, to a set of meshes grouped by colour.</summary>
	public void MergeInto( Dictionary<int, TownMesh> meshes, Vector3 position, Rotation rotation, Color body )
	{
		foreach ( var part in Parts )
		{
			var colour = part.Body ? body : part.Colour;
			int key = Tone.Key( colour );
			if ( !meshes.TryGetValue( key, out var mesh ) )
			{
				mesh = new TownMesh { Tint = colour };
				meshes[key] = mesh;
			}
			mesh.Box( position + rotation * part.Centre, part.Size, rotation * part.Turn );
		}
	}

	/// <summary>The colour of a random box of it, for the pieces it breaks into.</summary>
	public Color RandomColour( Color body )
	{
		if ( Parts.Count == 0 ) return body;
		var part = Parts[Game.Random.Next( Parts.Count )];
		return part.Body ? body : part.Colour;
	}
}

/// <summary>How heavy a prop is: what it takes to shift it, and whether the lizard can just run through it.</summary>
public enum PropWeight { Light, Medium, Heavy, Huge }

/// <summary>What else happens when a prop breaks.</summary>
public enum PropQuirk { None, Hydrant, Pump, Transformer, Siren }

/// <summary>One kind of prop: its look, how tough it is, what it scores and what it is called.</summary>
public sealed class PropKind
{
	public string Name;
	/// <summary>What the score popup says. One is picked for each copy.</summary>
	public string[] Labels;
	public float Health, Points;
	public PropWeight Weight;
	public PropQuirk Quirk;
	/// <summary>Colours a copy's bodywork may be.</summary>
	public Color[] BodyColours = { Tone.White };
	public readonly TownShape Shape = new();
	public bool Shadows = true;

	/// <summary>Mass of its rigid body.</summary>
	public float Mass => Weight switch { PropWeight.Light => 12f, PropWeight.Medium => 70f, PropWeight.Heavy => 500f, _ => 2500f };
	/// <summary>How much of a hit's speed it takes up.</summary>
	public float Give => Weight switch { PropWeight.Light => 1f, PropWeight.Medium => 0.85f, PropWeight.Heavy => 0.7f, _ => 0.4f };
	/// <summary>How many pieces it breaks into.</summary>
	public int Pieces => Weight switch { PropWeight.Light => 3, PropWeight.Medium => 5, PropWeight.Heavy => 8, _ => 12 };
	/// <summary>How hard it hurts what it lands on, per unit of speed.</summary>
	public float Clout => Weight switch { PropWeight.Light => 0.01f, PropWeight.Medium => 0.05f, PropWeight.Heavy => 0.35f, _ => 0.9f };
}

/// <summary>Every kind of prop in the town. Sizes are inches; a person is about 70 tall, the lizard 50.</summary>
public sealed class PropCatalogue
{
	public readonly List<PropKind> All = new();

	public PropKind Car, Taxi, Van, Pickup, Bus, PoliceCar, NewsVan, IceCreamVan, Tanker, Tractor;
	public PropKind Lamppost, Mailbox, Hydrant, Bin, Bench, Tree, Hedge, Fence, ChainFence, PhoneBox, HotDogStand, Cone,
		TrafficLight, StopSign, ParkingMeter, NewsStand, BusShelter, Dumpster, Trolley, CafeTable, Statue, ManholeCover;
	public PropKind HouseMailbox, Gnome, Flamingo, Barbecue, Shed, PaddlingPool;
	public PropKind HayBale, Corn, Scarecrow;
	public PropKind Barrel, BarrierGate, Pump, PriceSign, Transformer, Portaloo;
	public PropKind SirenPole, Barricade, Sandbags, ArmyTruck, Tank;

	PropKind Kind( string name, PropWeight weight, float health, float points, params string[] labels )
	{
		var kind = new PropKind { Name = name, Weight = weight, Health = health, Points = points, Labels = labels.Length > 0 ? labels : new[] { name.ToUpperInvariant() } };
		kind.Shadows = weight != PropWeight.Light;
		All.Add( kind );
		return kind;
	}

	/// <summary>Four wheels under a vehicle of this length and width.</summary>
	static void Wheels( TownShape s, float length, float width, float size = 24f )
	{
		foreach ( float x in new[] { -0.32f, 0.32f } )
			foreach ( float y in new[] { -0.5f, 0.5f } )
				s.Box( x * length, y * (width - 6f), 0f, size, 10f, size, Tone.Dark );
	}

	public PropCatalogue()
	{
		// ---- Vehicles: they point along +X ----
		Car = Kind( "Car", PropWeight.Heavy, 260f, 60f, "CAR", "SENSIBLE HATCHBACK", "SOMEBODY'S NO-CLAIMS BONUS", "LEASED SALOON", "CAR (TWO PAYMENTS LEFT)" );
		Car.BodyColours = Tone.Cars;
		Car.Shape.Body( 0f, 0f, 10f, 170f, 70f, 28f ).Box( -8f, 0f, 38f, 90f, 62f, 24f, Tone.Glass ).Box( -8f, 0f, 62f, 84f, 58f, 3f, Tone.Dark );
		Wheels( Car.Shape, 170f, 70f );

		Taxi = Kind( "Taxi", PropWeight.Heavy, 260f, 70f, "TAXI (METER STILL RUNNING)", "TAXI" );
		Taxi.BodyColours = new[] { Tone.Yellow };
		Taxi.Shape.Body( 0f, 0f, 10f, 170f, 70f, 28f ).Box( -8f, 0f, 38f, 90f, 62f, 24f, Tone.Glass ).Box( -8f, 0f, 62f, 26f, 40f, 10f, Tone.White );
		Wheels( Taxi.Shape, 170f, 70f );

		Van = Kind( "Van", PropWeight.Heavy, 300f, 80f, "WHITE VAN", "DELIVERY VAN (YOU WERE OUT)", "PLUMBER'S VAN" );
		Van.BodyColours = new[] { Tone.White, Tone.Cars[1], Tone.Cars[6] };
		Van.Shape.Body( -20f, 0f, 12f, 160f, 78f, 74f ).Body( 78f, 0f, 12f, 44f, 76f, 36f ).Box( 72f, 0f, 48f, 34f, 70f, 30f, Tone.Glass );
		Wheels( Van.Shape, 200f, 78f );

		Pickup = Kind( "Pickup", PropWeight.Heavy, 280f, 70f, "PICKUP TRUCK", "FARM TRUCK (MUDDY)" );
		Pickup.BodyColours = new[] { Tone.Cars[0], Tone.Cars[4], Tone.Cars[5] };
		Pickup.Shape.Body( 0f, 0f, 14f, 190f, 74f, 22f ).Body( 30f, 0f, 36f, 60f, 70f, 30f ).Box( 30f, 0f, 44f, 62f, 66f, 16f, Tone.Glass )
			.Body( -60f, 34f, 36f, 70f, 5f, 16f ).Body( -60f, -34f, 36f, 70f, 5f, 16f ).Body( -93f, 0f, 36f, 5f, 70f, 16f );
		Wheels( Pickup.Shape, 190f, 74f, 28f );

		Bus = Kind( "Bus", PropWeight.Huge, 600f, 220f, "THE NUMBER 9 BUS (LATE ANYWAY)", "BUS", "REPLACEMENT BUS SERVICE" );
		Bus.BodyColours = new[] { Tone.Red, Tone.Cars[4] };
		Bus.Shape.Body( 0f, 0f, 14f, 420f, 100f, 50f ).Box( 0f, 0f, 64f, 414f, 96f, 40f, Tone.Glass ).Body( 0f, 0f, 104f, 420f, 100f, 12f );
		Wheels( Bus.Shape, 420f, 100f, 34f );

		PoliceCar = Kind( "Police Car", PropWeight.Heavy, 280f, 90f, "POLICE CAR", "POLICE CAR (DOUGHNUTS INSIDE)" );
		PoliceCar.Quirk = PropQuirk.Siren;
		PoliceCar.BodyColours = new[] { Tone.Red };
		PoliceCar.Shape.Box( 0f, 0f, 10f, 170f, 70f, 28f, Tone.White ).Box( 0f, 0f, 20f, 60f, 72f, 14f, Tone.Blue ).Box( -8f, 0f, 38f, 90f, 62f, 24f, Tone.Glass )
			.Body( -8f, 0f, 62f, 12f, 44f, 9f );
		Wheels( PoliceCar.Shape, 170f, 70f );

		NewsVan = Kind( "News Van", PropWeight.Heavy, 320f, 120f, "NEWS VAN", "OUTSIDE BROADCAST VAN (LIVE)" );
		NewsVan.Shape.Box( -20f, 0f, 12f, 160f, 78f, 74f, Tone.White ).Box( 78f, 0f, 12f, 44f, 76f, 36f, Tone.White ).Box( 72f, 0f, 48f, 34f, 70f, 30f, Tone.Glass )
			.Box( -20f, 0f, 30f, 162f, 80f, 14f, Tone.Red ).Box( -40f, 0f, 86f, 6f, 6f, 40f, Tone.Metal )
			.Tilted( new Vector3( -40f, 0f, 132f ), new Vector3( 50f, 50f, 6f ), Tone.White, Rotation.FromPitch( -40f ) );
		Wheels( NewsVan.Shape, 200f, 78f );

		IceCreamVan = Kind( "Ice Cream Van", PropWeight.Heavy, 300f, 100f, "ICE CREAM VAN", "ICE CREAM VAN (JINGLE STILL PLAYING)" );
		IceCreamVan.Shape.Box( -20f, 0f, 12f, 160f, 78f, 74f, Tone.Pink ).Box( 78f, 0f, 12f, 44f, 76f, 36f, Tone.White ).Box( 72f, 0f, 48f, 34f, 70f, 30f, Tone.Glass )
			.Box( -20f, 0f, 86f, 20f, 20f, 34f, Tone.Sand ).Box( -20f, 0f, 120f, 28f, 28f, 24f, Tone.White );
		Wheels( IceCreamVan.Shape, 200f, 78f );

		Tanker = Kind( "Fuel Tanker", PropWeight.Huge, 360f, 300f, "FUEL TANKER (FULL)", "FUEL TANKER" );
		Tanker.Quirk = PropQuirk.Pump;
		Tanker.Shape.Box( 150f, 0f, 14f, 80f, 90f, 80f, Tone.Red ).Box( 170f, 0f, 60f, 44f, 84f, 28f, Tone.Glass )
			.Box( -40f, 0f, 30f, 280f, 86f, 76f, Tone.Metal ).Box( -40f, 0f, 22f, 270f, 70f, 92f, Tone.Metal ).Box( -40f, 0f, 60f, 282f, 88f, 10f, Tone.Orange );
		Wheels( Tanker.Shape, 380f, 90f, 34f );

		Tractor = Kind( "Tractor", PropWeight.Heavy, 320f, 80f, "TRACTOR", "TRACTOR (VINTAGE, APPARENTLY)" );
		Tractor.Shape.Box( 20f, 0f, 30f, 110f, 44f, 34f, Tone.Green ).Box( -30f, 0f, 64f, 50f, 50f, 46f, Tone.Glass ).Box( -30f, 0f, 110f, 56f, 56f, 4f, Tone.Green )
			.Box( -34f, 34f, 0f, 62f, 16f, 62f, Tone.Dark ).Box( -34f, -34f, 0f, 62f, 16f, 62f, Tone.Dark )
			.Box( 56f, 28f, 0f, 30f, 10f, 30f, Tone.Dark ).Box( 56f, -28f, 0f, 30f, 10f, 30f, Tone.Dark ).Box( 60f, 0f, 64f, 5f, 5f, 30f, Tone.Dark );

		// ---- The street ----
		Lamppost = Kind( "Lamppost", PropWeight.Medium, 45f, 15f, "LAMPPOST", "LAMPPOST (COUNCIL PROPERTY)" );
		Lamppost.Shape.Box( 0f, 0f, 0f, 12f, 12f, 8f, Tone.Slate ).Box( 0f, 0f, 8f, 6f, 6f, 170f, Tone.Slate ).Box( 16f, 0f, 174f, 38f, 5f, 4f, Tone.Slate ).Box( 30f, 0f, 166f, 18f, 9f, 8f, Tone.Line );

		Mailbox = Kind( "Mailbox", PropWeight.Light, 12f, 10f, "MAILBOX", "MAILBOX (FULL OF BILLS)", "MAILBOX (FINAL NOTICES)" );
		Mailbox.Shape.Box( 0f, 0f, 0f, 6f, 6f, 16f, Tone.Dark ).Box( 0f, 0f, 16f, 22f, 22f, 30f, Tone.Blue ).Box( 0f, 0f, 46f, 22f, 16f, 5f, Tone.Blue );

		Hydrant = Kind( "Hydrant", PropWeight.Light, 14f, 15f, "FIRE HYDRANT", "HYDRANT (DOG'S FAVOURITE)" );
		Hydrant.Quirk = PropQuirk.Hydrant;
		Hydrant.Shape.Box( 0f, 0f, 0f, 14f, 14f, 22f, Tone.Red ).Box( 0f, 0f, 22f, 10f, 10f, 6f, Tone.Red ).Box( 0f, 0f, 12f, 22f, 6f, 6f, Tone.Red );

		Bin = Kind( "Bin", PropWeight.Light, 8f, 5f, "BIN", "BIN (IT WAS BIN DAY)", "RECYCLING (SORTED WRONG)" );
		Bin.Shape.Box( 0f, 0f, 0f, 20f, 20f, 32f, Tone.Green ).Box( 0f, 0f, 32f, 23f, 23f, 4f, Tone.Dark );

		Bench = Kind( "Bench", PropWeight.Light, 18f, 10f, "PARK BENCH", "MEMORIAL BENCH (SORRY, DOREEN)" );
		Bench.Shape.Box( 0f, 0f, 14f, 70f, 20f, 4f, Tone.Wood ).Box( 0f, -9f, 18f, 70f, 4f, 20f, Tone.Wood ).Box( -30f, 0f, 0f, 5f, 18f, 14f, Tone.Slate ).Box( 30f, 0f, 0f, 5f, 18f, 14f, Tone.Slate );

		Tree = Kind( "Tree", PropWeight.Medium, 70f, 20f, "TREE", "PROTECTED OAK", "TREE (HAD A PRESERVATION ORDER)" );
		Tree.Shape.Box( 0f, 0f, 0f, 14f, 14f, 90f, Tone.Wood ).Drum( 0f, 0f, 80f, 90f, 70f, Tone.Leaf ).Box( 0f, 0f, 146f, 56f, 56f, 34f, Tone.Leaf );

		Hedge = Kind( "Hedge", PropWeight.Light, 20f, 15f, "SOMEBODY'S PRIZED HEDGE", "HEDGE", "TOPIARY (WAS A SWAN)" );
		Hedge.Shape.Box( 0f, 0f, 0f, 120f, 30f, 42f, Tone.Leaf );

		Fence = Kind( "Fence", PropWeight.Light, 8f, 5f, "PICKET FENCE", "FENCE (FRESHLY PAINTED)" );
		Fence.Shadows = false;
		Fence.Shape.Box( 0f, 0f, 10f, 96f, 3f, 5f, Tone.White ).Box( 0f, 0f, 26f, 96f, 3f, 5f, Tone.White );
		for ( int i = 0; i < 6; i++ ) Fence.Shape.Box( -40f + i * 16f, 0f, 0f, 8f, 4f, 38f, Tone.White );

		ChainFence = Kind( "Security Fence", PropWeight.Light, 15f, 10f, "SECURITY FENCE (SECURE)", "SECURITY FENCE", "FENCE (AUTHORISED PERSONNEL ONLY)" );
		ChainFence.Shadows = false;
		ChainFence.Shape.Box( -58f, 0f, 0f, 5f, 5f, 96f, Tone.Metal ).Box( 58f, 0f, 0f, 5f, 5f, 96f, Tone.Metal ).Box( 0f, 0f, 84f, 120f, 3f, 4f, Tone.Metal )
			.Box( 0f, 0f, 44f, 120f, 3f, 4f, Tone.Metal ).Box( 0f, 0f, 6f, 120f, 3f, 4f, Tone.Metal ).Box( 0f, 0f, 90f, 120f, 8f, 3f, Tone.Dark );

		PhoneBox = Kind( "Phone Box", PropWeight.Medium, 50f, 30f, "PHONE BOX", "PHONE BOX (NOBODY'S USED IT SINCE 2004)" );
		PhoneBox.Shape.Box( 0f, 0f, 0f, 34f, 34f, 8f, Tone.Red ).Box( 0f, 0f, 8f, 30f, 30f, 70f, Tone.Glass ).Box( 0f, 0f, 78f, 34f, 34f, 12f, Tone.Red )
			.Box( -15f, -15f, 8f, 4f, 4f, 70f, Tone.Red ).Box( 15f, -15f, 8f, 4f, 4f, 70f, Tone.Red ).Box( -15f, 15f, 8f, 4f, 4f, 70f, Tone.Red ).Box( 15f, 15f, 8f, 4f, 4f, 70f, Tone.Red );

		HotDogStand = Kind( "Hot Dog Stand", PropWeight.Medium, 40f, 40f, "HOT DOG STAND", "HOT DOGS (NOW COLD)", "HOT DOG STAND (NO PERMIT)" );
		HotDogStand.Shape.Box( 0f, 0f, 10f, 70f, 36f, 32f, Tone.Metal ).Box( 0f, 0f, 42f, 74f, 40f, 3f, Tone.Red ).Box( 0f, 0f, 45f, 4f, 4f, 50f, Tone.Slate )
			.Box( 0f, 0f, 92f, 80f, 80f, 6f, Tone.Yellow ).Box( 0f, 0f, 98f, 40f, 40f, 6f, Tone.Red ).Box( -26f, 0f, 0f, 14f, 40f, 14f, Tone.Dark ).Box( 26f, 0f, 0f, 14f, 40f, 14f, Tone.Dark );

		Cone = Kind( "Cone", PropWeight.Light, 4f, 2f, "TRAFFIC CONE", "CONE" );
		Cone.Shadows = false;
		Cone.Shape.Box( 0f, 0f, 0f, 16f, 16f, 3f, Tone.Orange ).Box( 0f, 0f, 3f, 10f, 10f, 12f, Tone.Orange ).Box( 0f, 0f, 15f, 6f, 6f, 10f, Tone.Line );

		TrafficLight = Kind( "Traffic Light", PropWeight.Medium, 45f, 20f, "TRAFFIC LIGHT", "TRAFFIC LIGHT (IT WAS RED)" );
		TrafficLight.Shape.Box( 0f, 0f, 0f, 6f, 6f, 120f, Tone.Slate ).Box( 0f, 0f, 120f, 14f, 14f, 40f, Tone.Dark ).Box( 7f, 0f, 148f, 3f, 8f, 8f, Tone.Red )
			.Box( 7f, 0f, 136f, 3f, 8f, 8f, Tone.Yellow ).Box( 7f, 0f, 124f, 3f, 8f, 8f, Tone.Green );

		StopSign = Kind( "Stop Sign", PropWeight.Light, 10f, 8f, "STOP SIGN (IGNORED)", "STOP SIGN" );
		StopSign.Shadows = false;
		StopSign.Shape.Box( 0f, 0f, 0f, 4f, 4f, 80f, Tone.Metal ).Box( 0f, 0f, 80f, 3f, 26f, 26f, Tone.Red );

		ParkingMeter = Kind( "Parking Meter", PropWeight.Light, 8f, 8f, "PARKING METER", "PARKING METER (EXPIRED)" );
		ParkingMeter.Shadows = false;
		ParkingMeter.Shape.Box( 0f, 0f, 0f, 4f, 4f, 44f, Tone.Metal ).Box( 0f, 0f, 44f, 9f, 9f, 14f, Tone.Slate );

		NewsStand = Kind( "Newspaper Stand", PropWeight.Light, 12f, 10f, "NEWSPAPER STAND", "TOMORROW'S HEADLINE", "LOCAL PAPER (LIZARD ON PAGE 1)" );
		NewsStand.Shape.Box( 0f, 0f, 0f, 20f, 18f, 40f, Tone.Yellow ).Box( 6f, 0f, 22f, 10f, 16f, 14f, Tone.Glass );

		BusShelter = Kind( "Bus Shelter", PropWeight.Medium, 60f, 40f, "BUS SHELTER", "BUS SHELTER (NEXT BUS: NEVER)" );
		BusShelter.Shape.Box( 0f, -22f, 0f, 140f, 4f, 86f, Tone.Glass ).Box( -68f, 0f, 0f, 4f, 44f, 86f, Tone.Slate ).Box( 68f, 0f, 0f, 4f, 44f, 86f, Tone.Slate )
			.Box( 0f, 0f, 86f, 148f, 52f, 5f, Tone.Slate ).Box( 0f, -10f, 16f, 90f, 14f, 4f, Tone.Wood );

		Dumpster = Kind( "Dumpster", PropWeight.Medium, 90f, 30f, "DUMPSTER", "DUMPSTER (ON FIRE BEFORE YOU GOT HERE)" );
		Dumpster.Shape.Box( 0f, 0f, 6f, 90f, 50f, 46f, Tone.Green ).Box( 0f, 0f, 52f, 94f, 54f, 5f, Tone.Dark ).Box( -36f, 0f, 0f, 8f, 44f, 6f, Tone.Dark ).Box( 36f, 0f, 0f, 8f, 44f, 6f, Tone.Dark );

		Trolley = Kind( "Trolley", PropWeight.Light, 6f, 5f, "SHOPPING TROLLEY", "TROLLEY (WONKY WHEEL)" );
		Trolley.Shadows = false;
		Trolley.Shape.Box( 0f, 0f, 14f, 34f, 20f, 18f, Tone.Metal ).Box( -18f, 0f, 30f, 3f, 22f, 10f, Tone.Red ).Box( 0f, 0f, 0f, 30f, 16f, 5f, Tone.Dark );

		CafeTable = Kind( "Cafe Table", PropWeight.Light, 10f, 10f, "CAFE TABLE", "BRUNCH", "AL FRESCO DINING" );
		CafeTable.Shape.Box( 0f, 0f, 0f, 4f, 4f, 28f, Tone.Metal ).Box( 0f, 0f, 28f, 34f, 34f, 3f, Tone.White ).Box( 0f, 0f, 31f, 3f, 3f, 50f, Tone.Metal )
			.Box( 0f, 0f, 78f, 70f, 70f, 5f, Tone.Red ).Box( 30f, 0f, 0f, 14f, 14f, 18f, Tone.Wood ).Box( -30f, 0f, 0f, 14f, 14f, 18f, Tone.Wood );

		Statue = Kind( "Statue", PropWeight.Heavy, 200f, 150f, "STATUE OF THE MAYOR", "STATUE (NOBODY KNEW WHO)" );
		Statue.Shape.Box( 0f, 0f, 0f, 70f, 70f, 50f, Tone.Stone ).Box( 0f, 0f, 50f, 26f, 20f, 70f, Tone.Metal ).Box( 0f, 0f, 120f, 18f, 18f, 18f, Tone.Metal )
			.Box( 14f, 14f, 96f, 34f, 8f, 8f, Tone.Metal );

		ManholeCover = Kind( "Manhole Cover", PropWeight.Light, 30f, 5f, "MANHOLE COVER" );
		ManholeCover.Shadows = false;
		ManholeCover.Shape.Drum( 0f, 0f, 0f, 44f, 4f, Tone.Slate );

		// ---- Gardens ----
		HouseMailbox = Kind( "House Mailbox", PropWeight.Light, 6f, 8f, "MAILBOX", "MAILBOX (JUNK MAIL ONLY)" );
		HouseMailbox.Shadows = false;
		HouseMailbox.Shape.Box( 0f, 0f, 0f, 4f, 4f, 38f, Tone.Wood ).Box( 0f, 0f, 38f, 20f, 10f, 10f, Tone.Metal ).Box( 6f, 6f, 42f, 2f, 2f, 10f, Tone.Red );

		Gnome = Kind( "Gnome", PropWeight.Light, 3f, 25f, "GARDEN GNOME", "SOMEBODY'S PRIZED GNOME", "GNOME (HE SAW EVERYTHING)" );
		Gnome.Shadows = false;
		Gnome.Shape.Box( 0f, 0f, 0f, 9f, 9f, 10f, Tone.Blue ).Box( 0f, 0f, 10f, 7f, 7f, 6f, Tone.Sand ).Box( 0f, 0f, 16f, 6f, 6f, 9f, Tone.Red );

		Flamingo = Kind( "Flamingo", PropWeight.Light, 3f, 10f, "LAWN FLAMINGO", "PLASTIC FLAMINGO" );
		Flamingo.Shadows = false;
		Flamingo.Shape.Box( 0f, 0f, 0f, 2f, 2f, 22f, Tone.Dark ).Box( 0f, 0f, 22f, 16f, 7f, 9f, Tone.Pink ).Box( 9f, 0f, 30f, 3f, 3f, 14f, Tone.Pink );

		Barbecue = Kind( "Barbecue", PropWeight.Light, 10f, 15f, "BARBECUE", "BARBECUE (SAUSAGES STILL ON)" );
		Barbecue.Shape.Box( 0f, 0f, 0f, 4f, 20f, 26f, Tone.Slate ).Box( 0f, 0f, 26f, 30f, 24f, 12f, Tone.Dark ).Box( 0f, 0f, 38f, 30f, 24f, 3f, Tone.Red );

		Shed = Kind( "Shed", PropWeight.Medium, 60f, 50f, "GARDEN SHED", "SHED (HIS ONLY REFUGE)", "SHED" );
		Shed.Shape.Box( 0f, 0f, 0f, 90f, 70f, 70f, Tone.Wood ).Box( 0f, 0f, 70f, 100f, 80f, 6f, Tone.Slate ).Box( 46f, 0f, 0f, 2f, 28f, 56f, Tone.Dark );

		PaddlingPool = Kind( "Paddling Pool", PropWeight.Light, 8f, 12f, "PADDLING POOL", "PADDLING POOL (WARM)" );
		PaddlingPool.Shadows = false;
		PaddlingPool.Shape.Drum( 0f, 0f, 0f, 70f, 12f, Tone.Blue ).Drum( 0f, 0f, 9f, 60f, 4f, Tone.Water );

		// ---- The farm ----
		HayBale = Kind( "Hay Bale", PropWeight.Light, 15f, 8f, "HAY BALE" );
		HayBale.Shape.Box( 0f, 0f, 0f, 60f, 36f, 34f, Tone.Hay );

		Corn = Kind( "Corn", PropWeight.Light, 3f, 2f, "CORN", "CORN (ORGANIC)", "MAIZE, TECHNICALLY" );
		Corn.Shadows = false;
		Corn.Shape.Box( -30f, 10f, 0f, 8f, 8f, 76f, Tone.Leaf ).Box( 20f, -24f, 0f, 8f, 8f, 84f, Tone.Leaf ).Box( 28f, 30f, 0f, 8f, 8f, 70f, Tone.Leaf )
			.Box( -30f, 10f, 50f, 12f, 12f, 16f, Tone.Corn ).Box( 20f, -24f, 56f, 12f, 12f, 16f, Tone.Corn ).Box( -10f, -36f, 0f, 8f, 8f, 66f, Tone.Leaf );

		Scarecrow = Kind( "Scarecrow", PropWeight.Light, 8f, 20f, "SCARECROW (UNSCARED)", "SCARECROW" );
		Scarecrow.Shape.Box( 0f, 0f, 0f, 4f, 4f, 80f, Tone.Wood ).Box( 0f, 0f, 46f, 8f, 70f, 6f, Tone.Wood ).Box( 0f, 0f, 36f, 12f, 24f, 30f, Tone.Brick ).Box( 0f, 0f, 70f, 14f, 14f, 14f, Tone.Hay )
			.Box( 0f, 0f, 84f, 24f, 24f, 3f, Tone.Wood );

		// ---- The lab, the forecourt and odds and ends ----
		Barrel = Kind( "Barrel", PropWeight.Light, 10f, 10f, "MYSTERY BARREL", "BARREL (DO NOT OPEN)", "BARREL OF SOMETHING GREEN" );
		Barrel.Shape.Drum( 0f, 0f, 0f, 24f, 38f, Tone.Green ).Box( 0f, 0f, 16f, 30f, 30f, 6f, Tone.Yellow );

		BarrierGate = Kind( "Barrier", PropWeight.Light, 12f, 15f, "BARRIER (DOWN)", "CHECKPOINT BARRIER" );
		BarrierGate.Shape.Box( -70f, 0f, 0f, 10f, 10f, 44f, Tone.Slate ).Box( 0f, 0f, 36f, 150f, 5f, 6f, Tone.Red ).Box( 30f, 0f, 36f, 30f, 6f, 6f, Tone.White );

		Pump = Kind( "Petrol Pump", PropWeight.Medium, 30f, 80f, "PETROL PUMP", "PETROL PUMP (UNLEADED)", "PUMP NUMBER FOUR" );
		Pump.Quirk = PropQuirk.Pump;
		Pump.Shape.Box( 0f, 0f, 0f, 30f, 20f, 60f, Tone.Red ).Box( 0f, 0f, 60f, 34f, 24f, 14f, Tone.White ).Box( 10f, 0f, 34f, 12f, 16f, 14f, Tone.Dark );

		PriceSign = Kind( "Price Sign", PropWeight.Medium, 50f, 30f, "PETROL PRICES (TOO HIGH)", "PRICE SIGN" );
		PriceSign.Shape.Box( 0f, 0f, 0f, 8f, 8f, 150f, Tone.Slate ).Box( 0f, 0f, 150f, 10f, 80f, 90f, Tone.White ).Box( 0f, 0f, 216f, 12f, 82f, 24f, Tone.Red );

		Transformer = Kind( "Transformer", PropWeight.Medium, 60f, 60f, "TRANSFORMER", "TRANSFORMER (DANGER OF DEATH)", "SUBSTATION" );
		Transformer.Quirk = PropQuirk.Transformer;
		Transformer.Shape.Box( 0f, 0f, 0f, 60f, 44f, 64f, Tone.Metal ).Box( -16f, 0f, 64f, 8f, 8f, 20f, Tone.Stone ).Box( 16f, 0f, 64f, 8f, 8f, 20f, Tone.Stone )
			.Box( 31f, 0f, 30f, 2f, 20f, 20f, Tone.Yellow );

		Portaloo = Kind( "Portaloo", PropWeight.Medium, 30f, 45f, "PORTALOO (OCCUPIED)", "PORTALOO", "PORTALOO (HE'S FINE)" );
		Portaloo.Shape.Box( 0f, 0f, 0f, 44f, 44f, 86f, Tone.Blue ).Box( 0f, 0f, 86f, 48f, 48f, 6f, Tone.White ).Box( 23f, 0f, 4f, 2f, 28f, 70f, Tone.White );

		// ---- The town's answer, tier by tier ----
		SirenPole = Kind( "Siren", PropWeight.Medium, 40f, 40f, "AIR RAID SIREN", "SIREN (STILL GOING)" );
		SirenPole.Quirk = PropQuirk.Siren;
		SirenPole.BodyColours = new[] { Tone.Red };
		SirenPole.Shape.Box( 0f, 0f, 0f, 16f, 16f, 10f, Tone.Slate ).Box( 0f, 0f, 10f, 7f, 7f, 150f, Tone.Slate ).Body( 0f, 0f, 160f, 26f, 26f, 22f ).Box( 0f, 0f, 182f, 30f, 30f, 4f, Tone.Slate );

		Barricade = Kind( "Barricade", PropWeight.Light, 15f, 15f, "POLICE BARRICADE", "POLICE LINE (CROSSED)" );
		Barricade.Shape.Box( 0f, 0f, 22f, 110f, 4f, 16f, Tone.Blue ).Box( 0f, 0f, 26f, 60f, 5f, 8f, Tone.White ).Box( -46f, 0f, 0f, 5f, 26f, 22f, Tone.Slate ).Box( 46f, 0f, 0f, 5f, 26f, 22f, Tone.Slate );

		Sandbags = Kind( "Sandbags", PropWeight.Medium, 60f, 20f, "SANDBAGS", "SANDBAGS (OPTIMISTIC)" );
		Sandbags.Shape.Box( 0f, 0f, 0f, 130f, 34f, 16f, Tone.Sand ).Box( 0f, 0f, 16f, 116f, 30f, 14f, Tone.Sand ).Box( 0f, 0f, 30f, 100f, 26f, 12f, Tone.Sand );

		ArmyTruck = Kind( "Army Truck", PropWeight.Huge, 600f, 200f, "ARMY TRUCK", "ARMY TRUCK (RATIONS INSIDE)" );
		ArmyTruck.Shape.Box( 0f, 0f, 16f, 260f, 90f, 24f, Tone.Army ).Box( 90f, 0f, 40f, 70f, 86f, 50f, Tone.Army ).Box( 104f, 0f, 60f, 44f, 80f, 24f, Tone.Glass )
			.Box( -40f, 0f, 40f, 170f, 88f, 70f, Tone.Shade( Tone.Army, 0.8f ) );
		Wheels( ArmyTruck.Shape, 260f, 90f, 36f );

		Tank = Kind( "Tank", PropWeight.Huge, 1200f, 400f, "TANK", "TANK (EXPENSIVE)", "TANK (THE TAXPAYER'S)" );
		Tank.Shape.Box( 0f, 44f, 0f, 250f, 34f, 40f, Tone.Dark ).Box( 0f, -44f, 0f, 250f, 34f, 40f, Tone.Dark ).Box( 0f, 0f, 16f, 240f, 100f, 40f, Tone.Army )
			.Drum( -10f, 0f, 56f, 90f, 30f, Tone.Shade( Tone.Army, 0.85f ) ).Box( 90f, 0f, 64f, 150f, 12f, 12f, Tone.Shade( Tone.Army, 0.7f ) );
	}
}