Decompiled source of Battle Arena v1.0.0

plugins/BattleArena.dll

Decompiled 5 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BattleArena.Api;
using BattleArena.Core;
using BattleArena.Dev;
using BattleArena.Gameplay;
using BattleArena.UI;
using BattleArena.Visual;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using Splatform;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("assembly_utils")]
[assembly: IgnoresAccessChecksTo("assembly_valheim")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BattleArena
{
	public static class Cfg
	{
		public static ConfigEntry<float> CountdownSeconds;

		public static ConfigEntry<float> LinkRange;

		public static ConfigEntry<float> ResultSeconds;

		public static ConfigEntry<float> ReturnSeconds;

		public static ConfigEntry<float> OutOfFieldSeconds;

		public static ConfigEntry<float> DefaultRoomRadius;

		public static ConfigEntry<bool> HealAfterFight;

		public static ConfigEntry<bool> ProtectBuildings;

		public static ConfigEntry<bool> ProtectSpectators;

		public static ConfigEntry<bool> QuietDuringFight;

		public static ConfigEntry<float> BrawlDamage;

		public static ConfigEntry<float> EnterSeconds;

		public static ConfigEntry<string> ShieldFuel;

		public static ConfigEntry<bool> ArenaXp;

		public static ConfigEntry<float> XpFactor;

		public static ConfigEntry<float> DailyBudget;

		public static ConfigEntry<float> SkillPerPoint;

		public static ConfigEntry<bool> Betting;

		public static ConfigEntry<float> BetSeconds;

		public static ConfigEntry<int> MaxStake;

		public static ConfigEntry<int> BonusStakeCap;

		public static ConfigEntry<float> FuelPerGenerator;

		public static ConfigEntry<float> DamagePerFuel;

		public static ConfigEntry<float> GeneratorReach;

		public static ConfigEntry<float> RingShieldHeight;

		public static readonly Dictionary<string, ConfigEntry<string>> Recipes = new Dictionary<string, ConfigEntry<string>>();

		public static readonly Dictionary<string, ConfigEntry<string>> Stations = new Dictionary<string, ConfigEntry<string>>();

		public static ConfigEntry<bool> ShowHud;

		public static ConfigEntry<bool> ShowSideRings;

		public static ConfigEntry<bool> ShowRoomsWithHammer;

		public static ConfigEntry<bool> ShowFighterList;

		public static ConfigEntry<bool> ShowFighterBars;

		public static ConfigEntry<bool> MapPins;

		public static ConfigEntry<bool> AutoSpectateWhenDown;

		public static ConfigEntry<bool> GhostWatch;

		public static ConfigEntry<KeyCode> SpectateKey;

		public static ConfigEntry<MessagePlace> FightMessages;

		public static event Action RecipesChanged;

		public static void Bind(ConfigFile c)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Expected O, but got Unknown
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Expected O, but got Unknown
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Expected O, but got Unknown
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Expected O, but got Unknown
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Expected O, but got Unknown
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Expected O, but got Unknown
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Expected O, but got Unknown
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Expected O, but got Unknown
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Expected O, but got Unknown
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Expected O, but got Unknown
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Expected O, but got Unknown
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Expected O, but got Unknown
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Expected O, but got Unknown
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Expected O, but got Unknown
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Expected O, but got Unknown
			//IL_045a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Expected O, but got Unknown
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Expected O, but got Unknown
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Expected O, but got Unknown
			//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Expected O, but got Unknown
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Expected O, but got Unknown
			//IL_056e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Expected O, but got Unknown
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Expected O, but got Unknown
			//IL_0608: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Expected O, but got Unknown
			ConfigurationManagerAttributes val = new ConfigurationManagerAttributes
			{
				IsAdminOnly = true
			};
			CountdownSeconds = c.Bind<float>("1 - Arena", "CountdownSeconds", 10f, new ConfigDescription("Seconds from the horn until the gates open.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f), new object[1] { val }));
			LinkRange = c.Bind<float>("1 - Arena", "LinkRange", 50f, new ConfigDescription("Banners and gates within this many metres of a desk belong to its arena (the nearest desk wins).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(10f, 150f), new object[1] { val }));
			DefaultRoomRadius = c.Bind<float>("1 - Arena", "DefaultRoomRadius", 4f, new ConfigDescription("Radius in metres of the room around a newly built banner (changed at the banner).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.5f, 16f), new object[1] { val }));
			ResultSeconds = c.Bind<float>("1 - Arena", "ResultSeconds", 8f, new ConfigDescription("Seconds the result is shown before the fighters go back to their rooms.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 60f), new object[1] { val }));
			ReturnSeconds = c.Bind<float>("1 - Arena", "ReturnSeconds", 45f, new ConfigDescription("Seconds the gates stay open at most for the fighters to walk back to their rooms.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 300f), new object[1] { val }));
			OutOfFieldSeconds = c.Bind<float>("1 - Arena", "OutOfFieldSeconds", 15f, new ConfigDescription("A player who stays outside the field this long during a fight gives up.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 120f), new object[1] { val }));
			EnterSeconds = c.Bind<float>("1 - Arena", "EnterSeconds", 10f, new ConfigDescription("A fight started with 'when I am in my room': seconds of count after its starter has stepped into a room.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f), new object[1] { val }));
			HealAfterFight = c.Bind<bool>("1 - Arena", "HealAfterFight", true, new ConfigDescription("Everyone who fought is healed to full health once back in a room.", (AcceptableValueBase)null, new object[1] { val }));
			ProtectBuildings = c.Bind<bool>("1 - Arena", "ProtectBuildings", true, new ConfigDescription("Fighters do not damage buildings within the arena (a troll would tear down the walls).", (AcceptableValueBase)null, new object[1] { val }));
			ProtectSpectators = c.Bind<bool>("1 - Arena", "ProtectSpectators", true, new ConfigDescription("Fighters and onlookers cannot hurt each other: no help from the stands, no stray blows into the crowd.", (AcceptableValueBase)null, new object[1] { val }));
			QuietDuringFight = c.Bind<bool>("1 - Arena", "QuietDuringFight", true, new ConfigDescription("No wild creatures spawn within the arena while a fight is on.", (AcceptableValueBase)null, new object[1] { val }));
			BrawlDamage = c.Bind<float>("2 - Brawling", "BrawlDamage", 1f, new ConfigDescription("Multiplies the blows of creatures that never attack on their own (deer ram, hares kick, hens peck).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), new object[1] { val }));
			ShieldFuel = c.Bind<string>("6 - Shields", "Fuel", "BoneFragments", new ConfigDescription("What the shield generators burn (an item's prefab name), like the game's own shield generator.", (AcceptableValueBase)null, new object[1] { val }));
			FuelPerGenerator = c.Bind<float>("6 - Shields", "FuelPerGenerator", 50f, new ConfigDescription("How much fuel one generator holds. More generators on one dome or ring make it last longer.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1000f), new object[1] { val }));
			DamagePerFuel = c.Bind<float>("6 - Shields", "DamagePerFuel", 50f, new ConfigDescription("Damage a shield stops for one piece of fuel.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10000f), new object[1] { val }));
			GeneratorReach = c.Bind<float>("6 - Shields", "GeneratorReach", 20f, new ConfigDescription("A generator feeds the nearest dome core, ring adapter or arena desk within this many metres.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f), new object[1] { val }));
			RingShieldHeight = c.Bind<float>("6 - Shields", "RingShieldHeight", 14f, new ConfigDescription("Height of the ring shield's wall and roof above the field: flying fighters stay below it.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(4f, 60f), new object[1] { val }));
			ArenaXp = c.Bind<bool>("7 - Experience", "ArenaXp", true, new ConfigDescription("Arena fights give experience: players the Holmgang skill, creatures their own mod's experience (Pig Riding, Bear Riding, Cluck Fighters, Wolfborn).", (AcceptableValueBase)null, new object[1] { val }));
			XpFactor = c.Bind<float>("7 - Experience", "XpFactor", 0.5f, new ConfigDescription("Multiplies all arena experience (kept low: the arena is no farm).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), new object[1] { val }));
			DailyBudget = c.Bind<float>("7 - Experience", "DailyBudget", 30f, new ConfigDescription("Points a fighter gets in full each game day; beyond it every further point counts less and less.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 1000f), new object[1] { val }));
			SkillPerPoint = c.Bind<float>("7 - Experience", "SkillPerPoint", 1f, new ConfigDescription("How much one point raises a player's Holmgang skill.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), new object[1] { val }));
			Betting = c.Bind<bool>("8 - Betting", "Betting", true, new ConfigDescription("A betting board at an arena takes bets in coins during the countdown.", (AcceptableValueBase)null, new object[1] { val }));
			BetSeconds = c.Bind<float>("8 - Betting", "BetSeconds", 30f, new ConfigDescription("With a betting board at the arena the countdown lasts at least this long, to leave time for the bets.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 300f), new object[1] { val }));
			MaxStake = c.Bind<int>("8 - Betting", "MaxStake", 1000, new ConfigDescription("Most coins one player may bet on a round.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100000), new object[1] { val }));
			BonusStakeCap = c.Bind<int>("8 - Betting", "BonusStakeCap", 100, new ConfigDescription("Only this much of each stake counts for the house bonus (5 % with one bettor and two fighters, more with more fighters, bettors and onlookers, at most 40 %), so a big stake is no gold mine.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100000), new object[1] { val }));
			foreach (PieceInfo basis in ArenaPieces.Bases)
			{
				Recipes[basis.Prefab] = c.Bind<string>("3 - Recipes", basis.Prefab, basis.DefaultRecipe, new ConfigDescription("Cost of this piece in its first material; the other materials swap the wood (or stone) for dark wood (fine wood), stone, black marble or grausten.", (AcceptableValueBase)null, new object[1] { val }));
				Stations[basis.Prefab] = c.Bind<string>("3 - Recipes", basis.Prefab + "_Station", basis.DefaultStation, new ConfigDescription("The station it is built near (prefab name).", (AcceptableValueBase)null, new object[1] { val }));
			}
			ShowHud = c.Bind<bool>("4 - Client", "ShowHud", true, "Show the sides, the time and the score at the top of the screen near a fight.");
			ShowSideRings = c.Bind<bool>("4 - Client", "ShowSideRings", true, "Draw a ring in the side's colour on the ground under every fighter.");
			ShowRoomsWithHammer = c.Bind<bool>("4 - Client", "ShowRoomsWithHammer", true, "Mark the rooms and the field on the ground while the hammer is in your hand.");
			SpectateKey = c.Bind<KeyCode>("5 - Watching", "SpectateKey", (KeyCode)107, "Key to watch a fight near you (and to stop watching). While watching: A/D next fighter, 1 overview, 2 follow, 3 through its eyes, mouse to turn, wheel to zoom, Esc back.");
			FightMessages = c.Bind<MessagePlace>("5 - Watching", "FightMessages", MessagePlace.Center, "Where the calls of a fight appear (\"the wolf brings down the boar\"): in the middle of the screen, top left, or not at all.");
			ShowFighterList = c.Bind<bool>("5 - Watching", "ShowFighterList", true, "Show every fighter with a health bar on the right of the screen near a fight.");
			ShowFighterBars = c.Bind<bool>("5 - Watching", "ShowFighterBars", true, "Show the health bar over every fighter on the field (not only within 10 m), its name in its side's colour.");
			MapPins = c.Bind<bool>("5 - Watching", "MapPins", true, "Mark the fighters on the map during a fight.");
			AutoSpectateWhenDown = c.Bind<bool>("5 - Watching", "AutoSpectateWhenDown", true, "When you fall in a spared fight, watch your side until the fight is over.");
			GhostWatch = c.Bind<bool>("5 - Watching", "GhostWatch", true, "Killed in a fight to the death, stay as a ghost and watch it to the end before you wake up in your bed (the spectate key wakes you at once).");
			c.SettingChanged += delegate(object _, SettingChangedEventArgs a)
			{
				if (a != null)
				{
					ConfigEntryBase changedSetting = a.ChangedSetting;
					if (((changedSetting != null) ? new bool?(changedSetting.Definition.Section.StartsWith("3")) : ((bool?)null)) == true)
					{
						Cfg.RecipesChanged?.Invoke();
					}
				}
			};
			SynchronizationManager.OnConfigurationSynchronized += delegate
			{
				Cfg.RecipesChanged?.Invoke();
			};
		}
	}
	public static class Lang
	{
		private static readonly (string key, string en, string de)[] Texts = new(string, string, string)[271]
		{
			("jotunn_cat_arena", "Arena", "Arena"),
			("ba_desk", "Arena moderator", "Arena-Moderator"),
			("ba_desk_desc", "The holmgang desk of the arena moderator: set the rules, make announcements, start the fight now, on a timer or when you stand in your room. The horn sounds, the gates open, the sides fight.", "Das Holmgang-Pult des Arena-Moderators: Regeln einstellen, Ansagen machen, den Kampf sofort, per Timer oder beim Betreten des Lagers starten. Das Horn erklingt, die Tore öffnen sich, die Seiten kämpfen."),
			("ba_banner", "Side banner", "Lagerbanner"),
			("ba_banner_desc", "Makes the ground around it a room. Everything in a room is calm; at the horn it fights for the banner's colour.", "Macht den Boden um sich zu einem Raum. Alles im Raum bleibt ruhig; beim Horn kämpft es für die Farbe des Banners."),
			("ba_chamber", "Chamber post", "Kammerpfahl"),
			("ba_chamber_desc", "Makes a small room a free-for-all chamber: whoever waits in it fights alone, against everyone. One to a chamber – with two in it its gate stays shut and they sit out the round.", "Macht einen kleinen Raum zur Einzelkammer: Wer darin wartet, kämpft allein gegen alle. Einer pro Kammer – sind zwei darin, bleibt ihr Tor zu und sie setzen die Runde aus."),
			("ba_chamber_room", "Chamber: {0} m around the post", "Kammer: {0} m um den Pfahl"),
			("ba_chamber_rule", "Free-for-all: one fighter to a chamber (a rider and his mount are one)", "Jeder gegen jeden: ein Kämpfer pro Kammer (Reiter und Reittier zählen als einer)"),
			("ba_chamber_shut", "More than one inside: shut this round", "Mehr als einer darin: diese Runde geschlossen"),
			("ba_betboard", "Betting board", "Wetttafel"),
			("ba_betboard_desc", "Takes bets in coins on the fight of the nearest arena during the countdown (it lasts longer then). The right bet shares the pot and a little from the house, more the more fighters, bettors and onlookers there are; and a crowd makes the fighters learn more.", "Nimmt während des Countdowns Wetten in Münzen auf den Kampf der nächsten Arena an (er dauert dann länger). Wer richtig wettet, teilt den Topf und bekommt etwas vom Haus dazu, mehr, je mehr Kämpfer, Wettende und Zuschauer da sind; und vor vollen Rängen lernen die Kämpfer mehr."),
			("ba_gate_s", "Portcullis (small)", "Fallgatter (klein)"),
			("ba_gate_s_desc", "An iron grid on a winch, 2.6 m wide, 3.2 m high: players, wolves, boars, Dvergr. The desk opens it.", "Ein Eisengitter an einer Winde, 2,6 m breit, 3,2 m hoch: Spieler, Wölfe, Eber, Dverger. Das Pult öffnet es."),
			("ba_gate_m", "Portcullis (large)", "Fallgatter (groß)"),
			("ba_gate_m_desc", "An iron grid on a winch, 4.2 m wide, 5.2 m high: bears, lox, Fenrir. The desk opens it.", "Ein Eisengitter an einer Winde, 4,2 m breit, 5,2 m hoch: Bären, Lox, Fenris. Das Pult öffnet es."),
			("ba_gate_l", "Arena gate", "Arenator"),
			("ba_gate_l_desc", "Two timber wings, 7 m wide, 8.6 m high: trolls, golems, moose. The desk opens it.", "Zwei Torflügel aus Holz, 7 m breit, 8,6 m hoch: Trolle, Golems, Elche. Das Pult öffnet es."),
			("ba_gate_xl", "Great arena gate", "Großes Arenator"),
			("ba_gate_xl_desc", "Two timber wings, 11 m wide, 14 m high: dragons and the great beasts. The desk opens it.", "Zwei Torflügel aus Holz, 11 m breit, 14 m hoch: Drachen und die großen Bestien. Das Pult öffnet es."),
			("ba_net", "Rope net", "Seilnetz"),
			("ba_net_desc", "A 4 x 4 m net of knotted rope. Spread over the arena it keeps bats, drakes and dragons in.", "Ein Netz aus geknotetem Seil, 4 × 4 m. Über die Arena gespannt hält es Fledermäuse, Drachen und Drakes drinnen."),
			("ba_barrier", "Arena barrier", "Arenabande"),
			("ba_barrier_desc", "Timber barrier, 4 m long and chest high: a field's edge to watch over.", "Holzbande, 4 m lang und brusthoch: der Rand des Kampfplatzes, über den man schauen kann."),
			("ba_barrier_tall", "Arena barrier (tall)", "Arenabande (hoch)"),
			("ba_barrier_tall_desc", "Timber barrier, 4 m long and 3 m high: walls for the rooms.", "Holzbande, 4 m lang und 3 m hoch: Wände für die Räume."),
			("ba_board", "Roll of honour", "Ehrentafel"),
			("ba_skill", "Holmgang", "Holmgang"),
			("ba_skill_desc", "Fighting in the arena. Each level spends 0.2 % less stamina in arena fights.", "Kämpfen in der Arena. Jede Stufe spart in Arenakämpfen 0,2 % Ausdauer."),
			("jotunn_cat_arenakit", "Arena building", "Arenabau"),
			("ba_seat", "Seat", "Sitzplatz"),
			("ba_ground", "Ground stake", "Kampfboden-Pflock"),
			("ba_ground_desc", "Levels the ground around it and treads it down to bare earth: the floor of a field.", "Ebnet den Boden um sich herum und tritt ihn zu blanker Erde fest: der Boden eines Kampfplatzes."),
			("ba_ground_radius", "Radius: {0} m", "Radius: {0} m"),
			("ba_key_radius", "Radius", "Radius"),
			("ba_key_level", "Level and tread down the ground", "Boden ebnen und festtreten"),
			("ba_msg_levelled", "The ground is levelled {0} m around the stake", "Der Boden ist im Umkreis von {0} m geebnet"),
			("ba_vebond", "Vébönd (hazel post and rope)", "Vébönd (Haselpfahl mit Seil)"),
			("ba_vebond_desc", "Hazel posts with a rope between them: how the old holmgang marked its field. Each post holds the rope to the next, 4 m on.", "Haselpfähle mit Seil dazwischen: So steckte der alte Holmgang seinen Platz ab. Jeder Pfahl hält das Seil zum nächsten, 4 m weiter."),
			("ba_bench", "Arena bench", "Arenabank"),
			("ba_bench_desc", "A 4 m bench, four seats.", "Eine Bank, 4 m lang, vier Plätze."),
			("ba_bench_back", "Arena bench with back", "Arenabank mit Lehne"),
			("ba_bench_back_desc", "A 4 m bench with a back, four seats.", "Eine Bank mit Lehne, 4 m lang, vier Plätze."),
			("ba_stand_straight", "Stand (straight)", "Tribüne (gerade)"),
			("ba_stand_straight_desc", "Three rows of seats, 4 m wide, rising away from the field.", "Drei Sitzreihen, 4 m breit, vom Platz weg ansteigend."),
			("ba_gang_s", "Gangway (small)", "Gang (klein)"),
			("ba_gang_s_desc", "A roofed gangway, 4 m long, as wide as the small portcullis.", "Ein überdachter Gang, 4 m lang, so breit wie das kleine Fallgatter."),
			("ba_gang_s_corner", "Gangway corner (small)", "Gang-Ecke (klein)"),
			("ba_gang_s_corner_desc", "A roofed corner for the small gangway.", "Eine überdachte Ecke für den kleinen Gang."),
			("ba_gang_m", "Gangway (large)", "Gang (groß)"),
			("ba_gang_m_desc", "A roofed gangway, 4 m long, as wide as the large portcullis.", "Ein überdachter Gang, 4 m lang, so breit wie das große Fallgatter."),
			("ba_gang_m_corner", "Gangway corner (large)", "Gang-Ecke (groß)"),
			("ba_gang_m_corner_desc", "A roofed corner for the large gangway.", "Eine überdachte Ecke für den großen Gang."),
			("ba_ring_wood_low_8", "Ring wall, wood, low (8 m)", "Ringbande, Holz, niedrig (8 m)"),
			("ba_ring_wood_low_8_desc", "A sixteenth of a round arena wall of 8 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 8 m Radius: sechzehn schließen den Ring."),
			("ba_ring_wood_tall_8", "Ring wall, wood, tall (8 m)", "Ringbande, Holz, hoch (8 m)"),
			("ba_ring_wood_tall_8_desc", "A sixteenth of a round arena wall of 8 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 8 m Radius: sechzehn schließen den Ring."),
			("ba_ring_wood_low_12", "Ring wall, wood, low (12 m)", "Ringbande, Holz, niedrig (12 m)"),
			("ba_ring_wood_low_12_desc", "A sixteenth of a round arena wall of 12 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 12 m Radius: sechzehn schließen den Ring."),
			("ba_ring_wood_tall_12", "Ring wall, wood, tall (12 m)", "Ringbande, Holz, hoch (12 m)"),
			("ba_ring_wood_tall_12_desc", "A sixteenth of a round arena wall of 12 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 12 m Radius: sechzehn schließen den Ring."),
			("ba_ring_wood_low_16", "Ring wall, wood, low (16 m)", "Ringbande, Holz, niedrig (16 m)"),
			("ba_ring_wood_low_16_desc", "A sixteenth of a round arena wall of 16 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 16 m Radius: sechzehn schließen den Ring."),
			("ba_ring_wood_tall_16", "Ring wall, wood, tall (16 m)", "Ringbande, Holz, hoch (16 m)"),
			("ba_ring_wood_tall_16_desc", "A sixteenth of a round arena wall of 16 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 16 m Radius: sechzehn schließen den Ring."),
			("ba_ring_wood_low_24", "Ring wall, wood, low (24 m)", "Ringbande, Holz, niedrig (24 m)"),
			("ba_ring_wood_low_24_desc", "A sixteenth of a round arena wall of 24 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 24 m Radius: sechzehn schließen den Ring."),
			("ba_ring_wood_tall_24", "Ring wall, wood, tall (24 m)", "Ringbande, Holz, hoch (24 m)"),
			("ba_ring_wood_tall_24_desc", "A sixteenth of a round arena wall of 24 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 24 m Radius: sechzehn schließen den Ring."),
			("ba_ringgate_wood_12", "Ring gate, wood (12 m)", "Ring-Tor, Holz (12 m)"),
			("ba_ringgate_wood_12_desc", "A piece of the 12 m ring wall with a small portcullis in it (2.6 x 3.2 m). The desk opens it.", "Ein Stück der 12-m-Ringbande mit kleinem Fallgatter (2,6 × 3,2 m). Das Pult öffnet es."),
			("ba_ringgate_wood_16", "Ring gate, wood (16 m)", "Ring-Tor, Holz (16 m)"),
			("ba_ringgate_wood_16_desc", "A piece of the 16 m ring wall with a small portcullis in it (2.6 x 3.2 m). The desk opens it.", "Ein Stück der 16-m-Ringbande mit kleinem Fallgatter (2,6 × 3,2 m). Das Pult öffnet es."),
			("ba_ringgate_wood_24", "Ring gate, wood (24 m)", "Ring-Tor, Holz (24 m)"),
			("ba_ringgate_wood_24_desc", "A piece of the 24 m ring wall with a small portcullis in it (2.6 x 3.2 m). The desk opens it.", "Ein Stück der 24-m-Ringbande mit kleinem Fallgatter (2,6 × 3,2 m). Das Pult öffnet es."),
			("ba_ring_stone_low_8", "Ring wall, stone, low (8 m)", "Ringbande, Stein, niedrig (8 m)"),
			("ba_ring_stone_low_8_desc", "A sixteenth of a round arena wall of 8 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 8 m Radius: sechzehn schließen den Ring."),
			("ba_ring_stone_tall_8", "Ring wall, stone, tall (8 m)", "Ringbande, Stein, hoch (8 m)"),
			("ba_ring_stone_tall_8_desc", "A sixteenth of a round arena wall of 8 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 8 m Radius: sechzehn schließen den Ring."),
			("ba_ring_stone_low_12", "Ring wall, stone, low (12 m)", "Ringbande, Stein, niedrig (12 m)"),
			("ba_ring_stone_low_12_desc", "A sixteenth of a round arena wall of 12 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 12 m Radius: sechzehn schließen den Ring."),
			("ba_ring_stone_tall_12", "Ring wall, stone, tall (12 m)", "Ringbande, Stein, hoch (12 m)"),
			("ba_ring_stone_tall_12_desc", "A sixteenth of a round arena wall of 12 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 12 m Radius: sechzehn schließen den Ring."),
			("ba_ring_stone_low_16", "Ring wall, stone, low (16 m)", "Ringbande, Stein, niedrig (16 m)"),
			("ba_ring_stone_low_16_desc", "A sixteenth of a round arena wall of 16 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 16 m Radius: sechzehn schließen den Ring."),
			("ba_ring_stone_tall_16", "Ring wall, stone, tall (16 m)", "Ringbande, Stein, hoch (16 m)"),
			("ba_ring_stone_tall_16_desc", "A sixteenth of a round arena wall of 16 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 16 m Radius: sechzehn schließen den Ring."),
			("ba_ring_stone_low_24", "Ring wall, stone, low (24 m)", "Ringbande, Stein, niedrig (24 m)"),
			("ba_ring_stone_low_24_desc", "A sixteenth of a round arena wall of 24 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 24 m Radius: sechzehn schließen den Ring."),
			("ba_ring_stone_tall_24", "Ring wall, stone, tall (24 m)", "Ringbande, Stein, hoch (24 m)"),
			("ba_ring_stone_tall_24_desc", "A sixteenth of a round arena wall of 24 m radius: sixteen close the ring.", "Ein Sechzehntel einer runden Arenawand mit 24 m Radius: sechzehn schließen den Ring."),
			("ba_ringgate_stone_12", "Ring gate, stone (12 m)", "Ring-Tor, Stein (12 m)"),
			("ba_ringgate_stone_12_desc", "A piece of the 12 m ring wall with a small portcullis in it (2.6 x 3.2 m). The desk opens it.", "Ein Stück der 12-m-Ringbande mit kleinem Fallgatter (2,6 × 3,2 m). Das Pult öffnet es."),
			("ba_ringgate_stone_16", "Ring gate, stone (16 m)", "Ring-Tor, Stein (16 m)"),
			("ba_ringgate_stone_16_desc", "A piece of the 16 m ring wall with a small portcullis in it (2.6 x 3.2 m). The desk opens it.", "Ein Stück der 16-m-Ringbande mit kleinem Fallgatter (2,6 × 3,2 m). Das Pult öffnet es."),
			("ba_ringgate_stone_24", "Ring gate, stone (24 m)", "Ring-Tor, Stein (24 m)"),
			("ba_ringgate_stone_24_desc", "A piece of the 24 m ring wall with a small portcullis in it (2.6 x 3.2 m). The desk opens it.", "Ein Stück der 24-m-Ringbande mit kleinem Fallgatter (2,6 × 3,2 m). Das Pult öffnet es."),
			("ba_stand_8", "Stand, curved (8 m)", "Tribüne, gebogen (8 m)"),
			("ba_stand_8_desc", "Three rows of seats behind the 8 m ring wall, a sixteenth of the ring.", "Drei Sitzreihen hinter der 8-m-Ringbande, ein Sechzehntel des Rings."),
			("ba_stand_12", "Stand, curved (12 m)", "Tribüne, gebogen (12 m)"),
			("ba_stand_12_desc", "Three rows of seats behind the 12 m ring wall, a sixteenth of the ring.", "Drei Sitzreihen hinter der 12-m-Ringbande, ein Sechzehntel des Rings."),
			("ba_stand_16", "Stand, curved (16 m)", "Tribüne, gebogen (16 m)"),
			("ba_stand_16_desc", "Three rows of seats behind the 16 m ring wall, a sixteenth of the ring.", "Drei Sitzreihen hinter der 16-m-Ringbande, ein Sechzehntel des Rings."),
			("ba_stand_24", "Stand, curved (24 m)", "Tribüne, gebogen (24 m)"),
			("ba_stand_24_desc", "Three rows of seats behind the 24 m ring wall, a sixteenth of the ring.", "Drei Sitzreihen hinter der 24-m-Ringbande, ein Sechzehntel des Rings."),
			("ba_board_desc", "Shows the last ten fights of the nearest arena.", "Zeigt die letzten zehn Kämpfe der nächsten Arena."),
			("ba_board_empty", "No fights yet", "Noch keine Kämpfe"),
			("ba_board_line", "Day {0} · {1} · {2} · {3} fighters", "Tag {0} · {1} · {2} · {3} Kämpfer"),
			("ba_board_draw", "Draw", "Unentschieden"),
			("ba_board_aborted", "Stopped", "Abgebrochen"),
			("ba_color_red", "Red", "Rot"),
			("ba_color_blue", "Blue", "Blau"),
			("ba_color_green", "Green", "Grün"),
			("ba_color_gold", "Gold", "Gold"),
			("ba_color_white", "White", "Weiß"),
			("ba_color_black", "Black", "Schwarz"),
			("ba_color_purple", "Purple", "Purpur"),
			("ba_color_orange", "Orange", "Orange"),
			("ba_mode_none", "No fight", "Kein Kampf"),
			("ba_mode_teams", "Team against team", "Mannschaft gegen Mannschaft"),
			("ba_mode_duel", "Duel", "Zweikampf"),
			("ba_mode_lords", "Each with his animals", "Jeder mit seinen Tieren"),
			("ba_mode_freeforall", "Everyone for themselves", "Jeder gegen jeden"),
			("ba_death_spare", "Spared", "Schonkampf"),
			("ba_death_beastsdie", "Beasts to the death", "Tiere auf Leben und Tod"),
			("ba_death_alldie", "All to the death", "Alle auf Leben und Tod"),
			("ba_time_none", "none", "keins"),
			("ba_time_min", "{0} min", "{0} Min."),
			("ba_rounds_one", "One round", "Eine Runde"),
			("ba_rounds_bestof", "Best of {0}", "Bester aus {0}"),
			("ba_round", "Round {0} of {1}", "Runde {0} von {1}"),
			("ba_rules_line", "{0} · time limit {1} · {2} round(s)", "{0} · Zeitlimit {1} · {2} Runde(n)"),
			("ba_key_panel", "Desk", "Pult"),
			("ba_key_lever", "Pull the lever: start the fight", "Hebel ziehen: Kampf beginnen"),
			("ba_key_abort", "Pull the lever: stop the fight", "Hebel ziehen: Kampf abbrechen"),
			("ba_key_colour", "Next colour", "Nächste Farbe"),
			("ba_key_roomsize", "Size of the room", "Größe des Raums"),
			("ba_banner_room", "Room: {0} m around the banner", "Raum: {0} m um das Banner"),
			("ba_banner_nodesk", "No desk within {0} m: a calm room, but no fights", "Kein Pult in {0} m: ein ruhiger Raum, aber keine Kämpfe"),
			("ba_gate_nodesk", "No desk within {0} m: it stays shut", "Kein Pult in {0} m: es bleibt zu"),
			("ba_gate_open", "Open", "Offen"),
			("ba_gate_shut", "Shut", "Geschlossen"),
			("ba_gate_chamber", "Gate of a free-for-all chamber", "Tor einer Einzelkammer"),
			("ba_gate_chamber_shut", "Its chamber held more than one: shut this round", "Seine Kammer war mehrfach belegt: diese Runde zu"),
			("ba_status_crowded", "{0} chamber(s) with more than one: they sit out", "{0} Kammer(n) mehrfach belegt: sie setzen aus"),
			("ba_ann_crowded", "More than one in a chamber ({0}): its gate stays shut, they sit out this round", "Mehr als einer in einer Kammer ({0}): Ihr Tor bleibt zu, sie setzen diese Runde aus"),
			("ba_ui_chambers", "Chambers {0}/{1}", "Kammern {0}/{1}"),
			("ba_key_bet", "Place a bet", "Wette abschließen"),
			("ba_bet_off", "Betting is switched off on this server", "Wetten sind auf diesem Server abgeschaltet"),
			("ba_bet_open", "Bets open: {0} s left · pot {1} coins", "Wetten offen: noch {0} s · Topf {1} Münzen"),
			("ba_bet_running", "The fight is on: no more bets", "Der Kampf läuft: keine Wetten mehr"),
			("ba_bet_wait", "Bets are taken from the horn until the gates open", "Wetten werden vom Horn bis zum Öffnen der Tore angenommen"),
			("ba_bet_yours", "Your bet: {0} on {1}", "Deine Wette: {0} auf {1}"),
			("ba_bet_owed", "{0} coins wait for you (they come when you are near the arena)", "{0} Münzen warten auf dich (sie kommen, wenn du bei der Arena bist)"),
			("ba_bet_closed", "Bets are closed", "Die Wetten sind geschlossen"),
			("ba_bet_oneside", "You have bet on {0} already: one side per round", "Du hast schon auf {0} gewettet: eine Seite pro Runde"),
			("ba_bet_own", "A fighter bets only on his own side", "Ein Kämpfer wettet nur auf die eigene Seite"),
			("ba_bet_max", "At most {0} coins per round", "Höchstens {0} Münzen pro Runde"),
			("ba_bet_nocoins", "You do not carry that many coins", "So viele Münzen hast du nicht dabei"),
			("ba_bet_refused", "Bet refused: the coins come back", "Wette abgelehnt: Die Münzen kommen zurück"),
			("ba_bet_placed", "Bet: {0} coins on {1}", "Wette: {0} Münzen auf {1}"),
			("ba_bet_paid", "The betting board pays you {0} coins", "Die Wetttafel zahlt dir {0} Münzen"),
			("ba_bet_note", "Last round: pot {0} + {1} from the house, {2} winner(s)", "Letzte Runde: Topf {0} + {1} vom Haus, {2} Gewinner"),
			("ba_bet_note_back", "Last round: {0} coins back to the bettors", "Letzte Runde: {0} Münzen zurück an die Wettenden"),
			("ba_bet_note_lost", "Last round: nobody was right, the house keeps {0}", "Letzte Runde: Keiner lag richtig, das Haus behält {0}"),
			("ba_ann_betsclosed", "Bets are closed: {0} coins from {1} bettor(s)", "Die Wetten sind geschlossen: {0} Münzen von {1} Wettenden"),
			("ba_ann_betspaid", "The betting board pays {0} coins to {1} winner(s)", "Die Wetttafel zahlt {0} Münzen an {1} Gewinner"),
			("ba_ann_betsback", "No winner: {0} coins go back to the bettors", "Kein Sieger: {0} Münzen gehen zurück an die Wettenden"),
			("ba_ann_betslost", "Nobody bet on the winner: the house keeps {0} coins", "Keiner hat auf den Sieger gewettet: Das Haus behält {0} Münzen"),
			("ba_betui_side", "On whom?", "Auf wen?"),
			("ba_betui_stake", "How much?", "Wie viel?"),
			("ba_betui_now", "{0} coins on {1}", "{0} Münzen auf {1}"),
			("ba_betui_purse", "You carry {0} coins", "Du trägst {0} Münzen"),
			("ba_betui_place", "Place the bet", "Wette abschließen"),
			("ba_status_nobanner", "No banner near: put up a banner for every side", "Kein Banner in der Nähe: Stell für jede Seite ein Banner auf"),
			("ba_status_idle", "{0} room(s), {1} waiting: not enough for a fight", "{0} Raum/Räume, {1} wartend: zu wenig für einen Kampf"),
			("ba_status_ready", "Ready: {0}, {1} sides, {2} fighters", "Bereit: {0}, {1} Seiten, {2} Kämpfer"),
			("ba_status_countdown", "The gates open in {0} s · {1}", "Die Tore öffnen sich in {0} s · {1}"),
			("ba_status_fight", "Fight: {0} · {1}", "Kampf: {0} · {1}"),
			("ba_call_holmgang", "Holmgang!", "Holmgang!"),
			("ba_call_fight", "Fight!", "Kämpft!"),
			("ba_result_win", "{0} wins", "{0} gewinnt"),
			("ba_result_round", "{0} wins round {1} ({2})", "{0} gewinnt Runde {1} ({2})"),
			("ba_result_match", "{0} wins the holmgang ({1})", "{0} gewinnt den Holmgang ({1})"),
			("ba_result_draw", "Draw: nobody is left standing", "Unentschieden: niemand steht mehr"),
			("ba_result_aborted", "The fight was stopped at the desk", "Der Kampf wurde am Pult abgebrochen"),
			("ba_msg_nobanner", "No banner belongs to this desk", "Zu diesem Pult gehört kein Banner"),
			("ba_msg_toofew", "Nobody to fight: bring at least two into the rooms", "Niemand zum Kämpfen: Bring mindestens zwei in die Räume"),
			("ba_msg_oneside", "Everyone in the rooms is on one side", "Alle in den Räumen gehören zu einer Seite"),
			("ba_msg_running", "Not while a fight is on", "Nicht während eines Kampfes"),
			("ba_msg_wait", "Wait until everyone is back in the rooms", "Warte, bis alle wieder in den Räumen sind"),
			("ba_msg_down", "You are down. You stay out of this fight.", "Du liegst am Boden. Dieser Kampf ist für dich vorbei."),
			("ba_key_spectate", "Watch the fight", "Kampf zuschauen"),
			("ba_ui_spectate", "Watch", "Zuschauen"),
			("ba_view_overview", "Overview", "Überblick"),
			("ba_view_follow", "Following", "Folgen"),
			("ba_view_eyes", "Through its eyes", "Mit seinen Augen"),
			("ba_spectate_line", "Watching · {0} · {1}", "Zuschauen · {0} · {1}"),
			("ba_spectate_keys", "A/D next fighter · 1 overview · 2 follow · 3 its eyes · mouse turns, wheel zooms · {0} or Esc: back", "A/D nächster Kämpfer · 1 Überblick · 2 Folgen · 3 seine Augen · Maus dreht, Rad zoomt · {0} oder Esc: zurück"),
			("ba_ghost", "You are dead. Your spirit stays until the fight is over.", "Du bist tot. Dein Geist bleibt, bis der Kampf vorbei ist."),
			("ba_news_down", "{0} brings down {1}", "{0} streckt {1} nieder"),
			("ba_news_fell", "{0} goes down", "{0} geht zu Boden"),
			("ba_news_killed", "{0} kills {1}", "{0} tötet {1}"),
			("ba_news_died", "{0} dies", "{0} stirbt"),
			("ba_news_outcold", "{0} is out cold – out of the fight", "{0} ist bewusstlos – raus aus dem Kampf"),
			("ba_news_countedout", "{0} left the field and is out", "{0} hat den Platz verlassen und ist raus"),
			("ba_msg_moderated", "{0} moderates this arena", "{0} moderiert diese Arena"),
			("ba_ann_moderator", "{0} moderates the arena", "{0} moderiert jetzt die Arena"),
			("ba_ann_cancelled", "The start is called off", "Der Start ist abgesagt"),
			("ba_ann_waitfor", "The fight starts as soon as {0} steps into a room", "Der Kampf beginnt, sobald {0} ein Lager betritt"),
			("ba_ann_timer", "The holmgang begins in {0}", "Der Holmgang beginnt in {0}"),
			("ba_ann_entered", "{0} is in the room – the fight begins in {1}", "{0} ist im Lager – der Kampf beginnt in {1}"),
			("ba_ann_nostart", "The fight could not begin: not enough fighters in the rooms", "Der Kampf konnte nicht beginnen: zu wenige Kämpfer in den Lagern"),
			("ba_ann_speaker", "{0} announces:", "{0} verkündet:"),
			("ba_ann_soon", "The holmgang begins in {0} s", "Der Holmgang beginnt in {0} s"),
			("ba_status_startin", "The fight begins in {0}", "Der Kampf beginnt in {0}"),
			("ba_status_waitfor", "Waiting for {0} to step into a room", "Warte, bis {0} ein Lager betritt"),
			("ba_ui_start", "Start", "Start"),
			("ba_ui_now", "Now", "Sofort"),
			("ba_ui_in", "In {0} min", "In {0} Min."),
			("ba_ui_whenin", "When I stand in my room", "Wenn ich im Lager stehe"),
			("ba_ui_cancel", "Call off", "Absagen"),
			("ba_ui_moderation", "Moderation", "Moderation"),
			("ba_ui_nomoderator", "No moderator: everyone allowed by the ward works the desk", "Kein Moderator: Jeder, den die Schutzrune lässt, bedient das Pult"),
			("ba_ui_moderator", "Moderator: {0}", "Moderator: {0}"),
			("ba_ui_take", "Take the desk", "Moderation übernehmen"),
			("ba_ui_release", "Give up the desk", "Moderation abgeben"),
			("ba_ui_text", "Announcement…", "Ansage…"),
			("ba_ui_announce", "Announce", "Ansagen"),
			("ba_quick_ready", "Get ready!", "Macht euch bereit!"),
			("ba_quick_quiet", "Quiet in the stands!", "Ruhe auf den Rängen!"),
			("ba_quick_last", "Last round!", "Letzte Runde!"),
			("ba_shield_gen", "Shield generator", "Schildgenerator"),
			("ba_shield_gen_desc", "Burns bones for a shield. It feeds the nearest dome core, ring adapter or arena moderator within 20 m; several on one shield make it last longer.", "Verbrennt Knochen für einen Schild. Er speist den nächsten Kuppelkern, Ringschild-Adapter oder Arena-Moderator in 20 m; mehrere an einem Schild machen ihn haltbarer."),
			("ba_dome_core", "Dome core", "Kuppelkern"),
			("ba_dome_core_desc", "The middle of the arena dome. With charged generators around it no building inside the dome takes damage and no missile from outside gets in.", "Die Mitte der Arenakuppel. Mit geladenen Generatoren nimmt kein Bauwerk in der Kuppel Schaden, und kein Geschoss von außen kommt hinein."),
			("ba_ring_adapter", "Ring shield adapter", "Ringschild-Adapter"),
			("ba_ring_adapter_desc", "Set on the ring wall: the adapters around an arena give its ring shield its shape (at least three). Without them only a round arena of ring walls gets a ring shield.", "Wird auf die Ringbande gesetzt: Die Adapter rund um eine Arena geben ihrem Ringschild die Form (mindestens drei). Ohne sie bekommt nur eine runde Arena aus Ringbande einen Ringschild."),
			("ba_gen_link_dome", "Feeds the arena dome", "Speist die Arenakuppel"),
			("ba_gen_link_ring", "Feeds the ring shield", "Speist den Ringschild"),
			("ba_gen_link_none", "Nothing to feed within {0} m", "Nichts zu speisen in {0} m"),
			("ba_key_fuel", "Add {0}", "{0} nachlegen"),
			("ba_key_fuel10", "Add ten", "Zehn nachlegen"),
			("ba_msg_gen_full", "The generator is full", "Der Generator ist voll"),
			("ba_msg_gen_nofuel", "You have no {0}", "Du hast keine {0}"),
			("ba_msg_gen_added", "{0} {1} in the generator", "{0} {1} im Generator"),
			("ba_dome_off", "Switched off", "Ausgeschaltet"),
			("ba_dome_empty", "No charge: feed its generators", "Keine Ladung: Generatoren befüllen"),
			("ba_dome_on", "Up · charge {0} from {1} generator(s)", "Steht · Ladung {0} aus {1} Generator(en)"),
			("ba_key_dome_on", "Switch on", "Einschalten"),
			("ba_key_dome_off", "Switch off", "Ausschalten"),
			("ba_adapter_ring", "{0} adapters shape the ring shield", "{0} Adapter formen den Ringschild"),
			("ba_adapter_few", "{0} adapter(s): at least three give the ring its shape", "{0} Adapter: mindestens drei geben dem Ring die Form"),
			("ba_ring_charge", "Ring shield: charge {0} from {1} generator(s)", "Ringschild: Ladung {0} aus {1} Generator(en)"),
			("ba_ui_mode", "Sides", "Seiten"),
			("ba_choice_auto", "From the rooms", "Aus den Räumen"),
			("ba_choice_rooms", "One team per colour", "Je Farbe ein Team"),
			("ba_choice_alone", "Everyone alone", "Jeder für sich"),
			("ba_ui_death", "Death", "Tod"),
			("ba_ui_time", "Time limit", "Zeitlimit"),
			("ba_ui_rounds", "Rounds", "Runden"),
			("ba_ui_field", "Field", "Kampfplatz"),
			("ba_ui_field_auto", "Auto", "Auto"),
			("ba_ui_field_m", "{0} m around the middle", "{0} m um die Mitte"),
			("ba_ui_field_autom", "{0} m (from the banners)", "{0} m (aus den Bannern)"),
			("ba_ui_nofight", "Not enough for a fight yet", "Noch zu wenig für einen Kampf"),
			("ba_ui_lever", "Pull the lever", "Hebel ziehen"),
			("ba_ui_abort", "Stop the fight", "Kampf abbrechen"),
			("ba_ui_gates_open", "Open the gates", "Tore öffnen"),
			("ba_ui_gates_shut", "Shut the gates", "Tore schließen"),
			("ba_ui_close", "Close", "Schließen")
		};

		private static readonly (string key, string en, string de)[] MaterialNames = new(string, string, string)[5]
		{
			("wood", "wood", "Holz"),
			("darkwood", "dark wood", "Dunkelholz"),
			("stone", "stone", "Stein"),
			("marble", "black marble", "Schwarzmarmor"),
			("grausten", "grausten", "Grausten")
		};

		public static void Register()
		{
			CustomLocalization localization = LocalizationManager.Instance.GetLocalization();
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
			(string, string, string)[] texts = Texts;
			for (int i = 0; i < texts.Length; i++)
			{
				(string, string, string) tuple = texts[i];
				dictionary[tuple.Item1] = tuple.Item2;
				dictionary2[tuple.Item1] = tuple.Item3;
			}
			float[] radii = ArcMath.Radii;
			foreach (float num in radii)
			{
				dictionary[$"ba_ring_low_{num:0}"] = $"Ring wall, chest high ({num:0} m)";
				dictionary2[$"ba_ring_low_{num:0}"] = $"Ringbande, brusthoch ({num:0} m)";
				dictionary[$"ba_ring_tall_{num:0}"] = $"Ring wall, tall ({num:0} m)";
				dictionary2[$"ba_ring_tall_{num:0}"] = $"Ringbande, hoch ({num:0} m)";
				string[] array = new string[2] { "low", "tall" };
				foreach (string arg in array)
				{
					dictionary[$"ba_ring_{arg}_{num:0}_desc"] = $"A sixteenth of a round arena wall of {num:0} m radius: sixteen close the ring.";
					dictionary2[$"ba_ring_{arg}_{num:0}_desc"] = $"Ein Sechzehntel einer runden Arenawand mit {num:0} m Radius: sechzehn schließen den Ring.";
				}
				dictionary[$"ba_ringgate_{num:0}"] = $"Ring gate ({num:0} m)";
				dictionary2[$"ba_ringgate_{num:0}"] = $"Ring-Tor ({num:0} m)";
				dictionary[$"ba_ringgate_{num:0}_desc"] = $"A piece of the {num:0} m ring wall with a small portcullis in it (2.6 x 3.2 m). The desk opens it.";
				dictionary2[$"ba_ringgate_{num:0}_desc"] = $"Ein Stück der {num:0}-m-Ringbande mit kleinem Fallgatter (2,6 × 3,2 m). Das Pult öffnet es.";
			}
			foreach (PieceInfo p in ArenaPieces.All)
			{
				if (!(p.Prefab == p.BaseToken))
				{
					(string, string, string) tuple2 = Array.Find(MaterialNames, ((string key, string en, string de) x) => x.key == p.Material);
					if (dictionary.TryGetValue(p.BaseToken, out var value))
					{
						dictionary[p.Prefab] = value + " (" + tuple2.Item2 + ")";
					}
					if (dictionary2.TryGetValue(p.BaseToken, out var value2))
					{
						dictionary2[p.Prefab] = value2 + " (" + tuple2.Item3 + ")";
					}
					if (dictionary.TryGetValue(p.BaseToken + "_desc", out var value3))
					{
						dictionary[p.Prefab + "_desc"] = value3;
					}
					if (dictionary2.TryGetValue(p.BaseToken + "_desc", out var value4))
					{
						dictionary2[p.Prefab + "_desc"] = value4;
					}
				}
			}
			dictionary["jotunn_cat_arenatimber"] = "Arena timber";
			dictionary2["jotunn_cat_arenatimber"] = "Arenabau Holz";
			dictionary["jotunn_cat_arenastone"] = "Arena stone";
			dictionary2["jotunn_cat_arenastone"] = "Arenabau Stein";
			foreach (KeyValuePair<string, string> item in dictionary)
			{
				string text = "English";
				string key = item.Key;
				localization.AddTranslation(ref text, ref key, item.Value);
			}
			foreach (KeyValuePair<string, string> item2 in dictionary2)
			{
				string text = "German";
				string key = item2.Key;
				localization.AddTranslation(ref text, ref key, item2.Value);
			}
		}

		public static string T(string token, params object[] args)
		{
			string text = ((Localization.instance != null) ? Localization.instance.Localize("$" + token) : token);
			if (args == null || args.Length == 0)
			{
				return text;
			}
			try
			{
				return string.Format(text, args);
			}
			catch (FormatException)
			{
				return text;
			}
		}

		public static string L(string token)
		{
			if (Localization.instance == null)
			{
				return token;
			}
			return Localization.instance.Localize(token);
		}
	}
	[BepInPlugin("zap.battlearena", "BattleArena", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class BattleArenaPlugin : BaseUnityPlugin
	{
		public const string PluginGuid = "zap.battlearena";

		public const string PluginName = "BattleArena";

		public const string PluginVersion = "1.0.0";

		private Harmony _harmony;

		public static BattleArenaPlugin Instance { get; private set; }

		public static string PluginDir { get; private set; }

		public static ManualLogSource Log { get; private set; }

		public static string AssetPath(string fileName)
		{
			return Path.Combine(PluginDir ?? "", "Assets", fileName);
		}

		private void Awake()
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			Instance = this;
			Log = ((BaseUnityPlugin)this).Logger;
			PluginDir = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			Cfg.Bind(((BaseUnityPlugin)this).Config);
			Lang.Register();
			Experience.RegisterSkill();
			Prefabs.Init();
			_harmony = new Harmony("zap.battlearena");
			_harmony.PatchAll(typeof(BattleArenaPlugin).Assembly);
			CluckCompat.Patch(_harmony);
			SelfTest.TryStart(((Component)this).gameObject);
		}

		private void Update()
		{
			if (!((Object)(object)ZNetScene.instance == (Object)null))
			{
				Contender.Scan();
				if ((Object)(object)Player.m_localPlayer != (Object)null)
				{
					ArenaHud.Ensure();
					Spectator.Ensure();
					FighterBoard.Ensure();
				}
			}
		}

		private void OnDestroy()
		{
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
}
namespace BattleArena.Visual
{
	public sealed class BrawlAnim : MonoBehaviour
	{
		private Contender _k;

		private Transform _visual;

		private Transform _head;

		private Transform _neck;

		private Vector3 _visualPos;

		private Quaternion _visualRot;

		private Quaternion _headBase;

		private Quaternion _headSet;

		private Quaternion _neckBase;

		private Quaternion _neckSet;

		private Blow _blow;

		private float _start = -99f;

		private float _lie;

		private float _height = 1f;

		private float _radius = 0.5f;

		private bool _touched;

		public bool HasSleep { get; private set; }

		public bool HasWakeup { get; private set; }

		private void Start()
		{
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			_k = ((Component)this).GetComponent<Contender>();
			Animator componentInChildren = ((Component)this).GetComponentInChildren<Animator>();
			if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.runtimeAnimatorController != (Object)null)
			{
				AnimatorControllerParameter[] parameters = componentInChildren.parameters;
				foreach (AnimatorControllerParameter val in parameters)
				{
					if (val.name == "sleeping" && (int)val.type == 4)
					{
						HasSleep = true;
					}
					if (val.name == "wakeup")
					{
						HasWakeup = true;
					}
				}
			}
			_visual = ((Component)this).transform.Find("Visual") ?? (((Object)(object)componentInChildren != (Object)null && (Object)(object)((Component)componentInChildren).transform != (Object)(object)((Component)this).transform) ? ((Component)componentInChildren).transform : null);
			if ((Object)(object)_visual != (Object)null)
			{
				_visualPos = _visual.localPosition;
				_visualRot = _visual.localRotation;
			}
			Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(true);
			foreach (Transform val2 in componentsInChildren)
			{
				string text = ((Object)val2).name.ToLowerInvariant();
				if ((Object)(object)_head == (Object)null && (text == "head" || text.EndsWith(":head") || text == "def-head"))
				{
					_head = val2;
				}
				if ((Object)(object)_neck == (Object)null && (text.StartsWith("neck") || text.EndsWith(":neck")))
				{
					_neck = val2;
				}
			}
			if ((Object)(object)_head != (Object)null)
			{
				_headBase = (_headSet = _head.localRotation);
			}
			if ((Object)(object)_neck != (Object)null)
			{
				_neckBase = (_neckSet = _neck.localRotation);
			}
			Character component = ((Component)this).GetComponent<Character>();
			if ((Object)(object)component != (Object)null)
			{
				_height = Mathf.Max(0.3f, component.GetHeight());
				_radius = Mathf.Max(0.2f, component.GetRadius());
			}
		}

		public void Play(Blow b)
		{
			_blow = b;
			_start = Time.time;
		}

		private static float Duration(Blow b)
		{
			return b switch
			{
				Blow.Bite => 0.45f, 
				Blow.Kick => 0.6f, 
				Blow.Peck => 0.35f, 
				_ => 0.7f, 
			};
		}

		private static float Bump(float u, float peak)
		{
			if (!(u <= 0f) && !(u >= 1f))
			{
				if (!(u < peak))
				{
					return Mathf.SmoothStep(1f, 0f, (u - peak) / (1f - peak));
				}
				return Mathf.SmoothStep(0f, 1f, u / peak);
			}
			return 0f;
		}

		private void LateUpdate()
		{
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Unknown result type (might be due to invalid IL or missing references)
			//IL_049d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_k == (Object)null || (Object)(object)_visual == (Object)null)
			{
				return;
			}
			float num = (Time.time - _start) / Duration(_blow);
			bool flag = _k.Status.What == Standing.Down && !HasSleep;
			bool flag2 = (num >= 0f && num < 1f) || flag || _lie > 0f;
			if (!flag2 && !_touched)
			{
				return;
			}
			_touched = flag2;
			if ((Object)(object)_head != (Object)null)
			{
				if (Quaternion.Angle(_head.localRotation, _headSet) > 0.01f)
				{
					_headBase = _head.localRotation;
				}
				_head.localRotation = _headBase;
			}
			if ((Object)(object)_neck != (Object)null)
			{
				if (Quaternion.Angle(_neck.localRotation, _neckSet) > 0.01f)
				{
					_neckBase = _neck.localRotation;
				}
				_neck.localRotation = _neckBase;
			}
			float num2 = (Time.time - _start) / Duration(_blow);
			float num3 = 0f;
			float num4 = 0f;
			float num5 = 0f;
			float num6 = 0f;
			if (num2 >= 0f && num2 < 1f)
			{
				switch (_blow)
				{
				case Blow.Ram:
					num3 = 0.45f * Bump(num2, 0.55f);
					num4 = 10f * Bump(num2, 0.5f);
					num5 = 40f * Bump(num2, 0.45f);
					break;
				case Blow.Peck:
					num3 = 0.12f * Bump(num2, 0.45f);
					num4 = 14f * Bump(num2, 0.45f);
					num5 = 55f * Bump(num2, 0.4f);
					break;
				case Blow.Kick:
					num6 = 0.35f * Mathf.Sin((float)Math.PI * num2);
					num4 = -25f * Bump(num2, 0.5f) + 20f * Bump(num2, 0.8f);
					num3 = 0.15f * Bump(num2, 0.6f);
					break;
				case Blow.Bite:
					num3 = 0.25f * Bump(num2, 0.5f);
					num5 = -20f * Bump(num2, 0.25f) + 30f * Bump(num2, 0.55f);
					break;
				}
			}
			bool flag3 = _k.Status.What == Standing.Down && !HasSleep;
			_lie = Mathf.MoveTowards(_lie, flag3 ? 1f : 0f, Time.deltaTime * 2.5f);
			float num7 = Mathf.Max(0.01f, ((Component)this).transform.localScale.y);
			Vector3 val = Vector3.forward * num3 * _radius * 2f + Vector3.up * num6 * _height * 0.4f;
			_visual.localPosition = _visualPos + (val + Vector3.down * _lie * _radius * 0.5f) / num7;
			_visual.localRotation = _visualRot * Quaternion.Euler(num4, 0f, 82f * _lie);
			if (num5 != 0f)
			{
				Vector3 right = ((Component)this).transform.right;
				Transform val2 = (((Object)(object)_neck != (Object)null) ? _neck : _head);
				if ((Object)(object)val2 != (Object)null)
				{
					val2.rotation = Quaternion.AngleAxis(num5 * (((Object)(object)_neck != (Object)null) ? 0.6f : 1f), right) * val2.rotation;
				}
				if ((Object)(object)_neck != (Object)null && (Object)(object)_head != (Object)null)
				{
					_head.rotation = Quaternion.AngleAxis(num5 * 0.4f, right) * _head.rotation;
				}
			}
			if ((Object)(object)_head != (Object)null)
			{
				_headSet = _head.localRotation;
			}
			if ((Object)(object)_neck != (Object)null)
			{
				_neckSet = _neck.localRotation;
			}
		}
	}
	internal static class KitModels
	{
		public const float StepRise = 0.42f;

		public const float StepDepth = 0.85f;

		public const float StandGap = 0.4f;

		private const int Steps = 3;

		public static GameObject Build(PieceInfo p)
		{
			switch (p.Kind)
			{
			case PieceKind.RingWall:
				return RingWall(p.Radius, p.Height, p.Material, 0f);
			case PieceKind.RingGate:
				return RingGate(p.Radius, p.Material);
			case PieceKind.Stand:
				if (!(p.Radius > 0f))
				{
					return StraightStand(p.Width, p.Material);
				}
				return CurvedStand(p.Radius, p.Material);
			case PieceKind.Bench:
				return Bench(p.Width, p.Variant, p.Material);
			case PieceKind.Gangway:
				if (!p.Variant)
				{
					return GangStraight(p.Width, p.Height, p.Material);
				}
				return GangCorner(p.Width, p.Height, p.Material);
			case PieceKind.Ground:
				return GroundStake();
			default:
				return Vebond(p.Width);
			}
		}

		private static (Vector3 pos, Quaternion rot) OnRing(float ring, float r, float deg, float y)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			var (num, num2) = ArcMath.Point(ring, r, deg);
			return (pos: new Vector3(num, y, num2), rot: Quaternion.Euler(0f, 0f - deg, 0f));
		}

		private static void Collider(Transform parent, Vector3 center, Vector3 size, Quaternion rot)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("col");
			val.transform.SetParent(parent, false);
			val.transform.localPosition = center;
			val.transform.localRotation = rot;
			val.AddComponent<BoxCollider>().size = size;
		}

		private static void Seat(Transform parent, Vector3 pos, Quaternion rot, float width)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("seat");
			val.transform.SetParent(parent, false);
			val.transform.localPosition = pos;
			val.transform.localRotation = rot;
			BoxCollider obj = val.AddComponent<BoxCollider>();
			obj.center = new Vector3(0f, -0.05f, 0f);
			obj.size = new Vector3(width, 0.1f, 0.45f);
			GameObject val2 = new GameObject("attach");
			val2.transform.SetParent(val.transform, false);
			val2.transform.localPosition = new Vector3(0f, 0.02f, 0.05f);
			Chair obj2 = val.AddComponent<Chair>();
			obj2.m_name = "$ba_seat";
			obj2.m_attachPoint = val2.transform;
			obj2.m_useDistance = 2.5f;
			obj2.m_detachOffset = new Vector3(0f, 0.5f, 0.6f);
		}

		public static GameObject RingWall(float ring, float h, string mat, float gapHalf)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0443: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_0456: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04db: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0501: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_ring_model");
			PartSet partSet = new PartSet();
			bool num = ArenaPieces.IsStone(mat);
			int num2 = ArcMath.Slices(ring);
			float step = 22.5f / (float)num2;
			float num3 = 2f * ring * Mathf.Sin(step / 2f * ((float)Math.PI / 180f)) + 0.02f;
			float num4 = (num ? 0.5f : 0.12f);
			if (num)
			{
				int num5 = Mathf.Max(2, Mathf.RoundToInt((h - 0.12f) / 0.45f));
				float num6 = (h - 0.12f) / (float)num5;
				for (int i = 0; i < num5; i++)
				{
					for (int j = ((i % 2 != 0) ? (-1) : 0); j < num2; j += 2)
					{
						int num7 = Mathf.Max(0, j);
						int num8 = Mathf.Min(num2, j + 2);
						if (num8 <= num7)
						{
							continue;
						}
						bool flag = false;
						for (int k = num7; k < num8; k++)
						{
							flag |= Skip(k);
						}
						if (flag)
						{
							if (!Skip(num7))
							{
								num8 = num7 + 1;
							}
							else
							{
								if (Skip(num8 - 1))
								{
									continue;
								}
								num7 = num8 - 1;
							}
						}
						float num9 = -11.25f + (float)num7 * step;
						float num10 = -11.25f + (float)num8 * step;
						(Vector3 pos, Quaternion rot) tuple = OnRing(ring, ring, (num9 + num10) / 2f, num6 * ((float)i + 0.5f));
						Vector3 item = tuple.pos;
						Quaternion item2 = tuple.rot;
						float num11 = 2f * ring * Mathf.Sin((num10 - num9) / 2f * ((float)Math.PI / 180f)) - 0.03f;
						MeshKit.Box(partSet[Mats.Block(mat)], item, new Vector3(num11, num6 - 0.025f, num4 - (float)(i % 3) * 0.02f), item2, 1.2f);
					}
				}
				for (int l = 0; l < num2; l++)
				{
					if (!Skip(l))
					{
						var (center, rot) = OnRing(ring, ring, -11.25f + ((float)l + 0.5f) * step, h - 0.06f);
						MeshKit.Box(partSet[Mats.Block(mat)], center, new Vector3(num3, 0.12f, num4 + 0.1f), rot, 1.2f);
					}
				}
			}
			else
			{
				int num12 = Mathf.Max(3, Mathf.RoundToInt((h - 0.1f) / 0.3f));
				float num13 = (h - 0.1f) / (float)num12;
				for (int m = 0; m < num2; m++)
				{
					if (!Skip(m))
					{
						float deg = -11.25f + ((float)m + 0.5f) * step;
						for (int n = 0; n < num12; n++)
						{
							var (center2, rot2) = OnRing(ring, ring, deg, 0.05f + num13 * ((float)n + 0.5f));
							MeshKit.Box(partSet[Mats.Panel(mat)], center2, new Vector3(num3, num13 - 0.012f, num4), rot2, 0.8f);
						}
						var (center3, rot3) = OnRing(ring, ring, deg, h + 0.03f);
						MeshKit.Box(partSet[Mats.Frame(mat)], center3, new Vector3(num3, 0.08f, 0.2f), rot3, 0.8f);
					}
				}
				float[] array = new float[3] { -11.25f, 0f, 11.25f };
				foreach (float deg2 in array)
				{
					if (!(gapHalf > 0f) || !(Mathf.Abs(ArcMath.Point(ring, ring, deg2).x) < gapHalf))
					{
						var (center4, rot4) = OnRing(ring, ring, deg2, (h + 0.15f) / 2f);
						MeshKit.Box(partSet[Mats.Frame(mat)], center4, new Vector3(0.2f, h + 0.15f, 0.2f), rot4, 1f);
					}
				}
			}
			partSet.Emit(val.transform, "ring");
			for (int num15 = 0; num15 < num2; num15++)
			{
				if (!Skip(num15))
				{
					var (center5, rot5) = OnRing(ring, ring, -11.25f + ((float)num15 + 0.5f) * step, h / 2f);
					Collider(val.transform, center5, new Vector3(num3, h, num4 + 0.05f), rot5);
				}
			}
			return val;
			bool Skip(int num16)
			{
				float deg3 = -11.25f + ((float)num16 + 0.5f) * step;
				if (gapHalf > 0f)
				{
					return Mathf.Abs(ArcMath.Point(ring, ring, deg3).x) < gapHalf;
				}
				return false;
			}
		}

		private static GameObject RingGate(float ring, string mat)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			float num = 2.6f;
			float num2 = 3.2f;
			GameObject val = RingWall(ring, 3f, mat, num / 2f + 0.45f + 0.05f);
			GameObject obj = Models.Gate(new PieceInfo
			{
				Width = num,
				Height = num2,
				Style = GateStyle.Portcullis,
				Material = mat
			});
			obj.transform.SetParent(val.transform, false);
			float num3 = Models.PortcullisFrameHeight(num2);
			float num4 = num / 2f + 0.225f;
			Collider(val.transform, new Vector3(0f - num4, num3 / 2f, 0f), new Vector3(0.45f, num3, 0.55f), Quaternion.identity);
			Collider(val.transform, new Vector3(num4, num3 / 2f, 0f), new Vector3(0.45f, num3, 0.55f), Quaternion.identity);
			Collider(val.transform, new Vector3(0f, num2 + 0.25f, 0f), new Vector3(num + 0.9f, 0.4f, 0.55f), Quaternion.identity);
			Transform[] componentsInChildren = obj.GetComponentsInChildren<Transform>(true);
			foreach (Transform val2 in componentsInChildren)
			{
				if (((Object)val2).name == "ba_grid")
				{
					Collider(val2, new Vector3(0f, num2 / 2f, 0f), new Vector3(num, num2, 0.16f), Quaternion.identity);
				}
			}
			return val;
		}

		private static GameObject CurvedStand(float ring, string mat)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_stand_model");
			PartSet partSet = new PartSet();
			int num = ArcMath.Slices(ring);
			float num2 = 22.5f / (float)num;
			for (int i = 0; i < 3; i++)
			{
				float num3 = ring + 0.4f + (float)i * 0.85f;
				float num4 = num3 + 0.425f;
				float num5 = 0.42f * (float)(i + 1);
				for (int j = 0; j < num; j++)
				{
					float deg = -11.25f + ((float)j + 0.5f) * num2;
					float num6 = 2f * num4 * Mathf.Sin(num2 / 2f * ((float)Math.PI / 180f)) + 0.02f;
					var (center, rot) = OnRing(ring, num4, deg, num5 - 0.04f);
					MeshKit.Box(partSet[Mats.Panel(mat)], center, new Vector3(num6, 0.08f, 0.83000004f), rot, 0.8f);
					var (center2, rot2) = OnRing(ring, num3, deg, num5 - 0.21f - 0.04f);
					MeshKit.Box(partSet[Mats.Panel(mat)], center2, new Vector3(2f * num3 * Mathf.Sin(num2 / 2f * ((float)Math.PI / 180f)) + 0.02f, 0.42f, 0.05f), rot2, 0.8f);
					Collider(val.transform, OnRing(ring, num4, deg, num5 / 2f).pos, new Vector3(num6, num5, 0.85f), rot);
					if (j % 2 == 0)
					{
						var (center3, rot3) = OnRing(ring, num3 + 0.1f, deg, num5 / 2f);
						MeshKit.Box(partSet[Mats.Frame(mat)], center3, new Vector3(0.12f, num5, 0.12f), rot3, 1f);
					}
					if (j % 2 == 1 || num == 1)
					{
						var (pos, rot4) = OnRing(ring, num3 + 0.3f, deg, num5);
						Seat(val.transform, pos, rot4, 0.7f);
					}
				}
			}
			float num7 = ring + 0.4f + 2.5500002f;
			for (int k = 0; k < num; k++)
			{
				float deg2 = -11.25f + ((float)k + 0.5f) * num2;
				float num8 = 2f * num7 * Mathf.Sin(num2 / 2f * ((float)Math.PI / 180f)) + 0.02f;
				var (center4, rot5) = OnRing(ring, num7, deg2, 1.76f);
				MeshKit.Box(partSet[Mats.Frame(mat)], center4, new Vector3(num8, 0.08f, 0.1f), rot5, 0.8f);
				Collider(val.transform, OnRing(ring, num7, deg2, 0.93f).pos, new Vector3(num8, 1.86f, 0.12f), rot5);
				if (k % 2 == 0)
				{
					var (center5, rot6) = OnRing(ring, num7, deg2, 0.905f);
					MeshKit.Box(partSet[Mats.Frame(mat)], center5, new Vector3(0.12f, 1.81f, 0.12f), rot6, 1f);
				}
			}
			partSet.Emit(val.transform, "stand");
			return val;
		}

		private static GameObject StraightStand(float w, string mat)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_stand_model");
			PartSet partSet = new PartSet();
			float[] array;
			for (int i = 0; i < 3; i++)
			{
				float num = 0f - (0.4f + (float)i * 0.85f + 0.425f);
				float num2 = 0.42f * (float)(i + 1);
				MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(0f, num2 - 0.04f, num), new Vector3(w, 0.08f, 0.83000004f), Quaternion.identity, 0.8f);
				MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(0f, num2 - 0.21f - 0.04f, num + 0.425f), new Vector3(w, 0.42f, 0.05f), Quaternion.identity, 0.8f);
				array = new float[3]
				{
					(0f - w) / 2f + 0.1f,
					0f,
					w / 2f - 0.1f
				};
				foreach (float num3 in array)
				{
					MeshKit.Box(partSet[Mats.Frame(mat)], new Vector3(num3, num2 / 2f, num + 0.425f - 0.1f), new Vector3(0.12f, num2, 0.12f), Quaternion.identity, 1f);
				}
				Collider(val.transform, new Vector3(0f, num2 / 2f, num), new Vector3(w, num2, 0.85f), Quaternion.identity);
				for (int k = 0; k < 3; k++)
				{
					Seat(val.transform, new Vector3((0f - w) / 3f + (float)k * w / 3f, num2, num + 0.425f - 0.3f), Quaternion.identity, 0.9f);
				}
			}
			float num4 = -2.9500003f;
			MeshKit.Box(partSet[Mats.Frame(mat)], new Vector3(0f, 1.76f, num4), new Vector3(w, 0.08f, 0.1f), Quaternion.identity, 0.8f);
			array = new float[2]
			{
				(0f - w) / 2f + 0.06f,
				w / 2f - 0.06f
			};
			foreach (float num5 in array)
			{
				MeshKit.Box(partSet[Mats.Frame(mat)], new Vector3(num5, 0.905f, num4), new Vector3(0.12f, 1.81f, 0.12f), Quaternion.identity, 1f);
			}
			Collider(val.transform, new Vector3(0f, 0.93f, num4), new Vector3(w, 1.86f, 0.12f), Quaternion.identity);
			partSet.Emit(val.transform, "stand");
			return val;
		}

		private static GameObject Bench(float w, bool back, string mat)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_bench_model");
			PartSet partSet = new PartSet();
			MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(0f, 0.44f, 0f), new Vector3(w, 0.07f, 0.4f), Quaternion.identity, 0.8f);
			float[] array = new float[3]
			{
				(0f - w) / 2f + 0.25f,
				0f,
				w / 2f - 0.25f
			};
			foreach (float num in array)
			{
				MeshKit.Box(partSet[Mats.Frame(mat)], new Vector3(num, 0.2f, 0f), new Vector3(0.1f, 0.4f, 0.32f), Quaternion.identity, 1f);
				if (back)
				{
					MeshKit.Box(partSet[Mats.Frame(mat)], new Vector3(num, 0.7f, -0.2f), new Vector3(0.08f, 0.6f, 0.06f), Quaternion.Euler(-10f, 0f, 0f), 1f);
				}
			}
			if (back)
			{
				MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(0f, 0.75f, -0.22f), new Vector3(w, 0.16f, 0.04f), Quaternion.Euler(-10f, 0f, 0f), 0.8f);
				MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(0f, 0.95f, -0.25f), new Vector3(w, 0.12f, 0.04f), Quaternion.Euler(-10f, 0f, 0f), 0.8f);
			}
			partSet.Emit(val.transform, "bench");
			Collider(val.transform, new Vector3(0f, 0.22f, 0f), new Vector3(w, 0.42f, 0.4f), Quaternion.identity);
			for (int j = 0; j < 4; j++)
			{
				Seat(val.transform, new Vector3((0f - w) * 3f / 8f + (float)j * w / 4f, 0.48f, 0f), Quaternion.identity, w / 4f - 0.05f);
			}
			return val;
		}

		private static GameObject GangStraight(float w, float h, string mat)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_gang_model");
			PartSet partSet = new PartSet();
			float[] array = new float[2] { -1f, 1f };
			foreach (float num in array)
			{
				float num2 = num * (w / 2f + 0.06f);
				int num3 = Mathf.RoundToInt(h / 0.32f);
				for (int j = 0; j < num3; j++)
				{
					MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(num2, ((float)j + 0.5f) * h / (float)num3, 0f), new Vector3(0.1f, h / (float)num3 - 0.012f, 4f), Quaternion.identity, 0.8f);
				}
				float[] array2 = new float[2] { -1.9f, 1.9f };
				foreach (float num4 in array2)
				{
					MeshKit.Box(partSet[Mats.Frame(mat)], new Vector3(num * (w / 2f + 0.16f), h / 2f + 0.1f, num4), new Vector3(0.22f, h + 0.2f, 0.22f), Quaternion.identity, 1f);
				}
				Collider(val.transform, new Vector3(num2, h / 2f, 0f), new Vector3(0.14f, h, 4f), Quaternion.identity);
			}
			Roof(partSet, val.transform, w, h, 4f, 0f, mat);
			partSet.Emit(val.transform, "gang");
			return val;
		}

		private static void Roof(PartSet set, Transform root, float w, float h, float len, float zc, string mat)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			int num = Mathf.RoundToInt(len / 0.3f);
			for (int i = 0; i < num; i++)
			{
				MeshKit.Box(set[Mats.Panel(mat)], new Vector3(0f, h + 0.06f, zc - len / 2f + ((float)i + 0.5f) * len / (float)num), new Vector3(w + 0.5f, 0.06f, len / (float)num - 0.01f), Quaternion.identity, 0.8f);
			}
			float[] array = new float[3]
			{
				zc - len / 2f + 0.1f,
				zc,
				zc + len / 2f - 0.1f
			};
			foreach (float num2 in array)
			{
				MeshKit.Box(set[Mats.Frame(mat)], new Vector3(0f, h - 0.06f, num2), new Vector3(w + 0.5f, 0.16f, 0.18f), Quaternion.identity, 1f);
			}
			Collider(root, new Vector3(0f, h + 0.06f, zc), new Vector3(w + 0.5f, 0.12f, len), Quaternion.identity);
		}

		private static GameObject GangCorner(float w, float h, string mat)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_gang_model");
			PartSet partSet = new PartSet();
			float num = w + 0.4f;
			int num2 = Mathf.RoundToInt(h / 0.32f);
			for (int i = 0; i < num2; i++)
			{
				float num3 = ((float)i + 0.5f) * h / (float)num2;
				float num4 = h / (float)num2 - 0.012f;
				MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(0f - (w / 2f + 0.06f), num3, 0f), new Vector3(0.1f, num4, num), Quaternion.identity, 0.8f);
				MeshKit.Box(partSet[Mats.Panel(mat)], new Vector3(0f, num3, w / 2f + 0.06f), new Vector3(num, num4, 0.1f), Quaternion.identity, 0.8f);
			}
			Vector3[] array = (Vector3[])(object)new Vector3[3]
			{
				new Vector3(0f - (w / 2f + 0.16f), 0f, w / 2f + 0.16f),
				new Vector3(0f - (w / 2f + 0.16f), 0f, (0f - num) / 2f + 0.1f),
				new Vector3(num / 2f - 0.1f, 0f, w / 2f + 0.16f)
			};
			foreach (Vector3 val2 in array)
			{
				MeshKit.Box(partSet[Mats.Frame(mat)], val2 + Vector3.up * (h / 2f + 0.1f), new Vector3(0.22f, h + 0.2f, 0.22f), Quaternion.identity, 1f);
			}
			Collider(val.transform, new Vector3(0f - (w / 2f + 0.06f), h / 2f, 0f), new Vector3(0.14f, h, num), Quaternion.identity);
			Collider(val.transform, new Vector3(0f, h / 2f, w / 2f + 0.06f), new Vector3(num, h, 0.14f), Quaternion.identity);
			Roof(partSet, val.transform, num - 0.5f, h, num, 0f, mat);
			partSet.Emit(val.transform, "gang");
			return val;
		}

		private static GameObject GroundStake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_ground_model");
			PartSet partSet = new PartSet();
			MeshKit.Cylinder(partSet[Mats.DarkWood], new Vector3(0f, -0.3f, 0f), new Vector3(0f, 0.9f, 0f), 0.06f, 0.05f, 8, capA: false);
			MeshKit.Cylinder(partSet[Mats.DarkWood], new Vector3(0f, 0.9f, 0f), new Vector3(0f, 1f, 0f), 0.05f, 0.01f, 8, capA: false);
			for (int i = 0; i < 5; i++)
			{
				MeshKit.Torus(partSet[Mats.Rope], new Vector3(0f, 0.35f + (float)i * 0.03f, 0f), Quaternion.Euler(0f, (float)i * 31f, (i % 2 == 0) ? 5f : (-5f)), 0.12f, 0.016f, 18, 6, 4f);
			}
			partSet.Emit(val.transform, "stake");
			Collider(val.transform, new Vector3(0f, 0.45f, 0f), new Vector3(0.3f, 0.9f, 0.3f), Quaternion.identity);
			return val;
		}

		private static GameObject Vebond(float span)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ba_vebond_model");
			PartSet partSet = new PartSet();
			Material hazel = Mats.Hazel;
			MeshKit.Cylinder(partSet[hazel], new Vector3(0f, -0.3f, 0f), new Vector3(0.02f, 0.75f, 0f), 0.045f, 0.04f, 7, capA: false, capB: false);
			MeshKit.Cylinder(partSet[hazel], new Vector3(0.02f, 0.75f, 0f), new Vector3(-0.01f, 1.3f, 0.01f), 0.04f, 0.033f, 7, capA: false);
			MeshKit.Cylinder(partSet[hazel], new Vector3(0f, 1.2f, 0f), new Vector3(0.09f, 1.42f, 0f), 0.02f, 0.012f, 6, capA: false);
			MeshKit.Cylinder(partSet[hazel], new Vector3(-0.01f, 1.3f, 0.01f), new Vector3(-0.05f, 1.45f, 0f), 0.025f, 0.012f, 6, capA: false);
			Vector3 a = default(Vector3);
			((Vector3)(ref a))..ctor(0.03f, 1.28f, 0f);
			Vector3 val2 = default(Vector3);
			for (int i = 1; i <= 10; i++)
			{
				float num = (float)i / 10f;
				((Vector3)(ref val2))..ctor(0.03f + num * (span - 0.03f), 1.28f - 0.88f * num * (1f - num), 0f);
				MeshKit.Cylinder(partSet[Mats.Rope], a, val2, 0.014f, 5, caps: false, 1f, 3f);
				a = val2;
			}
			MeshKit.Torus(partSet[Mats.Rope], new Vector3(0f, 1.28f, 0f), Quaternion.identity, 0.05f, 0.012f, 12, 5);
			partSet.Emit(val.transform, "vebond");
			Collider(val.transform, new Vector3(0f, 0.6f, 0f), new Vector3(0.12f, 1.4f, 0.12f), Quaternion.identity);
			return val;
		}
	}
	public class DeskLook : MonoBehaviour
	{
		private Desk _desk;

		private Transform _lever;

		private Transform _hourglass;

		private readonly Transform[] _dials = (Transform[])(object)new Transform[3];

		private float _pullUntil;

		private float _hourAngle;

		private RadiusRing _ring;

		private void Start()
		{
			_desk = ((Component)this).GetComponent<Desk>();
			Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(true);
			foreach (Transform val in componentsInChildren)
			{
				int result;
				if (((Object)val).name == "ba_lever")
				{
					_lever = val;
				}
				else if (((Object)val).name == "ba_hourglass")
				{
					_hourglass = val;
				}
				else if (((Object)val).name.StartsWith("ba_dial_") && int.TryParse(((Object)val).name.Substring(8), out result) && result >= 0 && result < 3)
				{
					_dials[result] = val;
				}
			}
			_ring = RadiusRing.Attach(((Component)this).gameObject);
		}

		public void Pull()
		{
			_pullUntil = Time.time + 1.2f;
		}

		private void Update()
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (m