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.Cryptography; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using FishNet; using FishNet.Broadcast; using FishNet.Connection; using FishNet.Managing; using FishNet.Managing.Client; using FishNet.Managing.Object; using FishNet.Object; using FishNet.Object.Synchronizing; using FishNet.Serializing; using FishNet.Transporting; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.UI; using UnityEngine.Localization; using UnityEngine.Localization.Settings; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HtfFortress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+39ba155bb154ed0c951a0d5b38f2a4fe7895825e")] [assembly: AssemblyProduct("HtfFortress")] [assembly: AssemblyTitle("HtfFortress")] [assembly: AssemblyVersion("1.0.0.0")] [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 HtfFortress { public class Weapons : MonoBehaviour { private class Gun { public Gear Gear; public float ReadyAt; public float Heat; public float LastTick = -10f; public float RampStart; public float NextState; public float NumberDmg; public float NextNumber; public float Rounds; public bool Overheated; } private class Cloud { public Vector3 At; public float Radius; public float Until; public float Dps; public int Owner; public bool Legend; } private class Poison { public int Stacks; public int Owner; public float Until; public float NextStack; public float Dps; public bool Legend; } private class Vortex { public Vector3 At; public float Until; public float Dps; public int Owner; public bool Legend; } private class Shark { public int Id; public int Owner; public Vector3 Pos; public Vector3 Face; public float Until; public float NextBite; public float Dmg; public float Sight = 14f; } private class Jelly { public Vector3 At; public float Radius; public float Until; public float Dps; public int Owner; public bool Legend; } private class Fling { public Item Item; public Player By; public float Dmg; public float Until; public int Left; public readonly HashSet Hit = new HashSet(); } private class BeamView { public Transform Beam; public Transform Core; public Transform Hit; public Transform HaloIn; public Transform HaloOut; public Transform[] Streaks; public Transform[] Bands; public Material Sheath; public Material Glow; public Material HaloInMat; public Material HaloOutMat; public Material[] BandMats; public Vector3 A; public Vector3 B; public float Width; public float Until; public float NextFlash; public float NextSmoke; public float Heat; } private class GasShown { public Vector3 At; public float Radius; public float Until; public bool Burst; } private class Shot { public Transform T; public Vector3 A; public Vector3 B; public float Start; } public const float SuckRange = 8f; public const float SuckAngle = 30f; public const float SuckEvery = 0.5f; public const float AbsorberBoost = 2.5f; public const byte RightDown = 3; public const byte RightHeld = 4; public const byte RightUp = 5; public const byte SpitKey = 6; private readonly Dictionary _nextSuck = new Dictionary(); private readonly Dictionary _nextSuckFx = new Dictionary(); private static readonly Vector3 DomeAt; private const float DomeR = 0.055f; private static Material _glass; private readonly Dictionary _chambers = new Dictionary(); private Image _absTop; private TextMeshProUGUI _absTopText; private bool _rightHeld; private float _nextRight; private Transform _castRing; private Transform _castMark; private Transform _castMark2; private Transform _castCone; private Material _castRingMat; private Material _castMarkMat; private int _coneHalf = -1; public static Weapons Instance; public static ConfigEntry NetKey; public static ConfigEntry DamageMultiplier; public const float LaserRange = 30f; public const float LaserRadius = 0.8f; public const float LaserRampSeconds = 2f; public const float LaserMaxRamp = 3f; public const float OverheatLock = 2f; public const float HeatCoolPerSecond = 0.35f; public static readonly float[] LaserHeatSeconds; public const float GasRange = 24f; public const float GasRadius = 3f; public const float GasLife = 6f; public const float PoisonLinger = 4f; public const float LobFlight = 0.6f; public const int MaxPoisonStacks = 5; public const float BoomerangRange = 18f; public const float BoomerangLeg = 0.55f; public const float BoomerangHitRadius = 1.3f; public const float BoomerangSlow = 0.4f; public static readonly float[] SharkLife; public const float SharkSpeed = 7f; public const float SharkBiteEvery = 1.2f; public const float SharkReach = 2.6f; public const float SharkSight = 14f; public const float SeaRing = 27.5f; public const float ShotRange = 25f; public const float ShotRadius = 0.8f; public const float LobRadius = 1.2f; public const float WhirlRange = 24f; public const float WhirlRadius = 6f; public const float WhirlDps = 5f; public const float WhirlBurst = 40f; public const float ConchRange = 10f; public const float ConchHalfAngle = 30f; public const float ConchDamage = 10f; public const float BubblePop = 20f; public const float NetRange = 24f; public const float NetRadius = 3.5f; public const float NetDamage = 8f; public const float NettedMult = 1.3f; public const float JellyRange = 24f; public const float JellyRadius = 3f; public const float JellyLife = 6f; public const float JellySlow = 0.35f; public const float JellyHover = 1.3f; public const float WaterRange = 15f; public const float WaterRadius = 1.3f; public const float WaterHurt = 0.6f; public const float WaterPushMax = 25f; public static readonly float[] WaterTankSeconds; public const float PufferRange = 24f; public const float PufferRadius = 3.5f; public const float PufferFuse = 1.2f; public static readonly int[] StarCount; public const float StarRange = 25f; public const float StarSpread = 9f; public const float ClawRange = 12f; public const float ClawAim = 1.1f; public const float ClawClose = 3.5f; public const float ClawCone = 60f; public const float ClawSpeed = 60f; public const float ClawMiss = 0.5f; public const float ClawThrow = 8f; public const float ClawFlight = 0.5f; public const float ClawSplash = 2.5f; public const float RocketRange = 40f; public const float RocketRadius = 3f; public const float RocketSpeed = 32f; public const float RocketSpread = 14f; public const float GatlingRange = 30f; public const float GatlingRate = 12f; public const float GatlingSpinUp = 1.2f; public const float GatlingSpinDown = 1.5f; public const float GatlingFloor = 0.25f; public const float GatlingBounce = 6f; private NetworkManager _registeredOn; private readonly Dictionary<(int, Gear), Gun> _guns = new Dictionary<(int, Gear), Gun>(); private readonly List _clouds = new List(); private readonly Dictionary _poison = new Dictionary(); private readonly List _vortices = new List(); private readonly List _sharks = new List(); private readonly List _jellies = new List(); private readonly Dictionary _netted = new Dictionary(); private readonly Dictionary _hooked = new Dictionary(); private readonly List _flung = new List(); public const float FlingSpeed = 30f; public const float FlingRadius = 1.2f; private int _nextShark = 1; private float _nextHalfSecond; private float _nextSharkSend; private bool _wasActive; private static readonly FieldRef> Wild; private static readonly Dictionary BossBoxes; public const int BeamTop = 20; public const float WetSeconds = 5f; public const float WetMult = 1.5f; private readonly Dictionary _wet = new Dictionary(); private bool _drawn; private bool _wasHolding; private bool _handEmptied; private Item _heldAtDraw; private static readonly MethodInfo OpenSlotMethod; private float _kick; private float _nextSend; private readonly List _hidden = new List(); private Item _hiddenItem; private static MethodInfo _toolHands; private Item _heldModelOf; private Transform _heldModel; private Vector3 _heldModelHome; private readonly Dictionary _mine = new Dictionary(); private Image _hud; private Image _hudPic; private TextMeshProUGUI _hudText; private Hud.Bar _hudBar; private const float HudPic = 64f; private readonly Dictionary _beams = new Dictionary(); private readonly Dictionary _sharkViews = new Dictionary(); private float _nextBeamSound; private float _nextWake; public const float RainbowHeat = 5f; private static readonly Color[] HeatStops; public const int BeamStreaks = 3; public const float StreakSpeed = 160f; public const float StreakLength = 3f; public const int RainbowBands = 12; private readonly List _gasShown = new List(); private float _nextStarSound; private float _nextSpraySound; private int _onHook; public const float BulletSpeed = 240f; public const float BulletLength = 2.5f; private const int MaxBullets = 40; private readonly List _shots = new List(); private int _nextShot; private float _nextGatlingSound; private float _mySpin; private readonly Dictionary _spins = new Dictionary(); private bool _net; private GameObject _netView; private Transform _bag; private Transform _contents; private readonly List<(GameObject go, Mesh baked)> _catch = new List<(GameObject, Mesh)>(); private float _swing; private float _nextSwing; private const int MaxShownFish = 12; private static readonly Vector3 NetHoop; private static readonly Vector3 NetHang; internal Vector3 DebugCastMark { get { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_castMark) || !((Component)_castMark).gameObject.activeSelf) { return Vector3.zero; } return _castMark.position; } } internal Vector3 DebugLastShark { get { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (_sharks.Count <= 0) { return Vector3.zero; } return _sharks[_sharks.Count - 1].Pos; } } public static bool Drawn { get { if (Object.op_Implicit((Object)(object)Instance)) { return Instance._drawn; } return false; } } public static bool NetOut { get { if (Object.op_Implicit((Object)(object)Instance) && Instance._drawn) { return Instance._net; } return false; } } internal static float Scale => ((Object.op_Implicit((Object)(object)FortressPlugin.Instance) && Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.ServerActive) ? FortressPlugin.Instance.WaveHpMult : 1f) * (DamageMultiplier?.Value ?? 1f); public static float BeamMaxBite => WeaponMods.PowerMult(20) * (3f + WeaponMods.TraitAdd(Gear.Laser, 20)) / WeaponMods.TimeMult(20); public bool ClientHasWeapon => WeaponItems.Carries(Player.LocalPlayer); private static Material LaserMat => WeaponFx.Emissive("Laser", new Color(0.35f, 0.9f, 1f), 5f); private static bool HoldsAbsorber(Player p) { if (Object.op_Implicit((Object)(object)p) && WeaponItems.Held(p, out var g, out var _)) { return g == Gear.Absorber; } return false; } public static float ShotMult(int worth) { return 1f + Mathf.Log(1f + (float)Mathf.Max(0, worth) / 50f, 2f); } public static float MoveSeconds(EnemyKind boss) { return boss switch { EnemyKind.Warden => 2.5f, EnemyKind.Urchin => 2.6f, EnemyKind.Angler => 6f, EnemyKind.Steed => 3.5f, EnemyKind.Stonefish => 3.5f, EnemyKind.Skyfish => 5f, EnemyKind.Kraken => 6f, EnemyKind.Voxel => 7f, EnemyKind.Koi => 5f, _ => 8f, }; } public static float MoveMult(EnemyKind boss) { return boss switch { EnemyKind.Warden => 6f, EnemyKind.Urchin => 1.6f, EnemyKind.Angler => 4f, EnemyKind.Steed => 5f, EnemyKind.Stonefish => 2.5f, EnemyKind.Skyfish => 2.5f, EnemyKind.Kraken => 1.5f, EnemyKind.Voxel => 5f, EnemyKind.Koi => 1f, _ => 6f, }; } private Gun GunOf(Player who, Gear g) { if (!_guns.TryGetValue((((NetworkBehaviour)who).ObjectId, g), out var value)) { Dictionary<(int, Gear), Gun> guns = _guns; (int, Gear) key = (((NetworkBehaviour)who).ObjectId, g); Gun obj = new Gun { Gear = g }; Gun result = obj; guns[key] = obj; return result; } return value; } public void DebugReady(Player who) { foreach (KeyValuePair<(int, Gear), Gun> item in _guns.Where((KeyValuePair<(int, Gear), Gun> kv) => kv.Key.Item1 == ((NetworkBehaviour)who).ObjectId)) { item.Value.ReadyAt = 0f; } _nextSuck.Remove(((NetworkBehaviour)who).ObjectId); } internal static bool Copies(Item prefab, out Gear g, out Rarity r) { if (WeaponItems.Is(prefab, out g, out r) && !GearCatalog.IsGameGun(g)) { return !GearCatalog.IsSpecial(g); } return false; } public static Rarity CopyRarity(Rarity copied, Rarity absorber) { return (Rarity)Mathf.Max((int)copied, (int)absorber); } private static bool Wields(Player who, Gear g) { if (!WeaponItems.Held(who, out var g2, out var r)) { return false; } if (g2 == g) { return true; } StoredItem storedItem = ((g2 == Gear.Absorber && Object.op_Implicit((Object)(object)Loot.Instance)) ? Loot.Instance.Vault.AbsorbedOf(Loot.KeyOf(who)) : null); if (storedItem != null && Copies(GameInfo.GetSpawnable(storedItem.Id), out var g3, out r)) { return g3 == g; } return false; } private void AbsorberFire(Player who, byte phase, Vector3 o, Vector3 d, Rarity r) { //IL_0060: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0090: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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) VaultData vault = Loot.Instance.Vault; ulong num = Loot.KeyOf(who); StoredItem storedItem = vault.AbsorbedOf(num); switch (phase) { case 6: if (storedItem != null) { vault.Absorbed.Remove(num); SpitOut(who, storedItem, Muzzle(o, d), d, r); Loot.Instance.SaveVault(); } return; default: if (storedItem != null || phase > 1) { break; } goto case 3; case 3: case 4: Suck(who, num, o, d, r, storedItem); return; } if (phase >= 5 || storedItem == null) { return; } Item spawnable = GameInfo.GetSpawnable(storedItem.Id); if (Copies(spawnable, out var g, out var r2)) { FireAs(who, phase, o, d, g, CopyRarity(r2, r)); if (phase == 0) { AutoTest.Count("absorber_copy_" + g); } return; } Gun gun = GunOf(who, Gear.Absorber); if (phase != 2 && !(Time.time < gun.ReadyAt)) { float v = vault.WeaponValue(num, Gear.Absorber, r) * Scale; EnemyKind k; float num2 = (BossTrophies.Is(spawnable, out k) ? TrophyMove(k, who, o, d, v) : ItemShot(who, storedItem, o, d, v)); gun.ReadyAt = Time.time + num2 * GearCatalog.Cooldown(Gear.Absorber, r) / GearCatalog.Cooldown(Gear.Absorber, Rarity.Common) * WeaponMods.TimeMult(vault.ModOf(num, Gear.Absorber, 1)); SendState(who, gun); AutoTest.Count(BossTrophies.Is(spawnable, out var _) ? ("absorber_move_" + k) : "absorber_shot"); } } private void Suck(Player who, ulong key, Vector3 o, Vector3 d, Rarity r, StoredItem held) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; VaultData vault = Loot.Instance.Vault; float num = SuckReach(vault, key); float cone = 30f + WeaponMods.TraitAdd(Gear.Absorber, vault.ModOf(key, Gear.Absorber, 2)); Vector3 val = Muzzle(o, d); if (!_nextSuckFx.TryGetValue(((NetworkBehaviour)who).ObjectId, out var value) || time >= value) { _nextSuckFx[((NetworkBehaviour)who).ObjectId] = time + 0.25f; AbsFx("suck", val, val + d * num, who); } if (_nextSuck.TryGetValue(((NetworkBehaviour)who).ObjectId, out var value2) && time < value2) { return; } Item val2 = SuckTarget(o, d, num, cone, who); SavedItem val3 = (Object.op_Implicit((Object)(object)val2) ? Loot.SavedOf(val2) : null); if (val3 != null) { _nextSuck[((NetworkBehaviour)who).ObjectId] = time + 0.5f; vault.Absorbed[key] = new StoredItem { Saved = val3, Dead = (Object.op_Implicit((Object)(object)val2.Creature) && val2.Creature.IsDead), Worth = val2.TotalWorth }; Swallow.Server(val2, val, Gulp.Absorber); if (held != null) { SpitOut(who, held, val, d, r); } Loot.Instance.SaveVault(); AutoTest.Count("absorbed"); } } private static float SuckReach(VaultData vault, ulong key) { return 8f * WeaponMods.ReachMult(vault.ModOf(key, Gear.Absorber, 3)); } private Item SuckTarget(Vector3 o, Vector3 d, float reach, float cone, Player who) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) Item result = null; float num = float.MaxValue; Collider[] array = Physics.OverlapSphere(o, reach, -1, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { Item val = ItemManager.Get(array[i]); if (!Object.op_Implicit((Object)(object)val) || !Hookable(val, who) || (WeaponItems.Is(val, out var g, out var _) && GearCatalog.IsSpecial(g))) { continue; } Vector3 val2 = ((Component)val).transform.position - o; float num2 = Vector3.Angle(d, val2); if (!(((Vector3)(ref val2)).magnitude > reach) && !(num2 > cone)) { float num3 = num2 + ((Vector3)(ref val2)).magnitude * 2f; if (num3 < num) { result = val; num = num3; } } } return result; } private void SpitOut(Player who, StoredItem s, Vector3 muzzle, Vector3 d, Rarity r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Item val = Loot.Spawn(s, muzzle + d * 0.4f); AutoTest.Count("absorber_spat"); if (Object.op_Implicit((Object)(object)val)) { float dmg = Loot.Instance.Vault.WeaponValue(Loot.KeyOf(who), Gear.Absorber, r) * Scale; ((MonoBehaviour)this).StartCoroutine(SpitNext(who, val, muzzle, d, dmg, r == Rarity.Legendary)); } } private IEnumerator SpitNext(Player who, Item it, Vector3 from, Vector3 d, float dmg, bool legend) { //IL_001c: 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_0025: Unknown result type (might be due to invalid IL or missing references) yield return null; if (Object.op_Implicit((Object)(object)it) && Object.op_Implicit((Object)(object)it.Rig) && Object.op_Implicit((Object)(object)it.RigidbodySync) && Object.op_Implicit((Object)(object)who)) { it.RigidbodySync.StartSimulateLocal(default(Vector3), default(Quaternion)); FlingOut(who, it, from, d, dmg, legend); } } private float ItemShot(Player who, StoredItem held, Vector3 o, Vector3 d, float v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Reach(o, d, 25f); Creature val2 = Along(o, val, 1f).FirstOrDefault(); AbsFx("shot", Muzzle(o, d), Object.op_Implicit((Object)(object)val2) ? Body(val2) : val, who, held.Id); if (Object.op_Implicit((Object)(object)val2)) { HitNumber(val2, Hurt(val2, v * ShotMult(held.Worth), who)); if (!IsBoss(val2)) { Siege instance = Siege.Instance; Vector3 val3 = d.Flat(); instance.ServerPush(val2, ((Vector3)(ref val3)).normalized * 2.5f); } } return GearCatalog.Cooldown(Gear.Absorber, Rarity.Common); } private static int MaxOf(Creature c) { if (!Object.op_Implicit((Object)(object)FortressPlugin.Instance) || !FortressPlugin.Instance.MaxHpOf.TryGetValue(c, out var value)) { return c.MaxHp; } return value; } private static Vector3 Ground(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(p + Vector3.up * 20f, Vector3.down, ref val, 60f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { p = ((RaycastHit)(ref val)).point; } p.y = Mathf.Max(p.y, WaterManager.GetWaterHeight(p)); return p; } private List Within(Vector3 at, float r) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return Targets().Where(delegate(Creature c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (((Component)c).transform.position - at).Flat(); return ((Vector3)(ref val)).sqrMagnitude <= r * r; }).ToList(); } private void Envenom(Creature c, int stacks, float dmg, Player who) { float time = Time.time; if (!_poison.TryGetValue(c, out var value)) { value = (_poison[c] = new Poison()); } value.Stacks = Mathf.Min(5, value.Stacks + stacks); value.Until = time + 4f; value.NextStack = time + 1f; value.Dps = Mathf.Max(value.Dps, dmg * 0.04f / Mathf.Max(0.01f, Scale)); value.Owner = (Object.op_Implicit((Object)(object)who) ? ((NetworkBehaviour)who).ObjectId : 0); } private float TrophyMove(EnemyKind boss, Player who, Vector3 o, Vector3 d, float v) { //IL_001c: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_00b4: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_01a7: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //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_032a: 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_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_07ce: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_07ee: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_080b: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_081c: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_0888: Unknown result type (might be due to invalid IL or missing references) //IL_088d: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_08b6: Unknown result type (might be due to invalid IL or missing references) //IL_08b9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_08eb: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_0900: 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_01e8: 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_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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_0960: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_09f0: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Muzzle(o, d); Vector3 val2 = d.Flat(); Vector3 normalized; if (!(((Vector3)(ref val2)).sqrMagnitude > 0.0001f)) { val2 = who.Transform.forward.Flat(); normalized = ((Vector3)(ref val2)).normalized; } else { val2 = d.Flat(); normalized = ((Vector3)(ref val2)).normalized; } Vector3 fwd = normalized; float hit = v * MoveMult(boss); switch (boss) { case EnemyKind.Warden: { Vector3 val4 = Reach(o, d, 16f); Creature val5 = Along(o, val4, 1f).FirstOrDefault(); AbsFx("warden", val, Object.op_Implicit((Object)(object)val5) ? Body(val5) : val4, who); if (!Object.op_Implicit((Object)(object)val5)) { return 1f; } HitNumber(val5, Hurt(val5, hit, who)); if (Object.op_Implicit((Object)(object)val5) && val5._hp.Value > 0 && !IsBoss(val5) && val5._hp.Value * 3 < MaxOf(val5)) { HitNumber(val5, Hurt(val5, val5._hp.Value, who)); } break; } case EnemyKind.Urchin: { Vector3 at = who.Transform.position + Vector3.up; for (int num = 0; num < 12; num++) { Vector3 val3 = Quaternion.AngleAxis(360f * (float)num / 12f, Vector3.up) * fwd; Vector3 end2 = at + val3 * 14f; foreach (Creature item in (from c in Targets() where DistToSegment(((Component)c).transform.position.Flat(), at.Flat(), end2.Flat()) <= 1f select c).OrderBy(delegate(Creature c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val10 = (((Component)c).transform.position - at).Flat(); return ((Vector3)(ref val10)).sqrMagnitude; }).Take(2)) { HitNumber(item, Hurt(item, hit, who)); } } AbsFx("urchin", at, at + fwd, who, 12); break; } case EnemyKind.Angler: { Vector3 at3 = Land(o, d, 20f); AbsFx("angler", val, at3, who); foreach (Creature item2 in from c in Within(at3, 10f) where !IsBoss(c) select c) { Vector3 val9 = (((Component)item2).transform.position - at3).Flat(); if (((Vector3)(ref val9)).magnitude > 1.8f) { Siege.Instance.ServerPull(item2, at3 + ((Vector3)(ref val9)).normalized * 1.8f, 0.6f); } } ((MonoBehaviour)this).StartCoroutine(After(0.8f, delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) foreach (Creature item3 in Within(at3, 5f)) { HitNumber(item3, Hurt(item3, hit, who)); Siege.Instance.Slow(item3, IsBoss(item3) ? 0.5f : 1f, 1.5f); } })); break; } case EnemyKind.Steed: { Vector3 val7 = Land(o, d, 18f); AbsFx("steed", val7, val7, who); foreach (Creature item4 in Within(val7, 5f)) { HitNumber(item4, Hurt(item4, hit, who)); Vector3 val8 = (((Component)item4).transform.position - val7).Flat(); if (!IsBoss(item4)) { Siege.Instance.ServerPush(item4, ((((Vector3)(ref val8)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val8)).normalized : fwd) * 7f); } } break; } case EnemyKind.Stonefish: { Vector3 a = Ground(who.Transform.position + fwd * 1.5f); Vector3 b = Ground(a + fwd * 14f); AbsFx("stone", a, b, who); foreach (Creature item5 in from c in Targets() where DistToSegment(((Component)c).transform.position.Flat(), a.Flat(), b.Flat()) <= 1.8f select c) { HitNumber(item5, Hurt(item5, hit, who)); Envenom(item5, 3, hit, who); } break; } case EnemyKind.Skyfish: { List list = (from i in Enumerable.Range(0, 6) select Ground(who.Transform.position + fwd * (5f + 4f * (float)i))).ToList(); AbsFx("sky", list[0] + Vector3.up * 6f, list[5] + Vector3.up * 6f, who); for (int num2 = 0; num2 < list.Count; num2++) { Vector3 p = list[num2]; ((MonoBehaviour)this).StartCoroutine(After(0.35f + 0.12f * (float)num2, delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) AbsFx("bomb", p, p, who); foreach (Creature item6 in Targets().Where(delegate(Creature c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val10 = Body(c) - p; return ((Vector3)(ref val10)).sqrMagnitude <= 9f; })) { HitNumber(item6, Hurt(item6, hit, who)); } })); } break; } case EnemyKind.Kraken: { Vector3 val6 = Land(o, d, 18f); AbsFx("kraken", val6 - fwd * 3f, val6, who); foreach (Creature item7 in Within(val6, 5f)) { Siege.Instance.Slow(item7, IsBoss(item7) ? 0.5f : 1f, 3f); } _vortices.Add(new Vortex { At = val6, Until = Time.time + 3f, Dps = hit / Mathf.Max(0.01f, Scale), Owner = ((NetworkBehaviour)who).ObjectId }); break; } case EnemyKind.Voxel: { Vector3 at2 = Land(o, d, 20f); Vector3 side = Vector3.Cross(Vector3.up, fwd); AbsFx("voxel", at2, at2 + fwd, who, Mathf.RoundToInt(400f)); ((MonoBehaviour)this).StartCoroutine(After(0.8f, delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) AbsFx("voxelDelete", at2, at2 + fwd, who, Mathf.RoundToInt(400f)); foreach (Creature item8 in Targets()) { Vector3 val10 = (((Component)item8).transform.position - at2).Flat(); if (!(Mathf.Abs(Vector3.Dot(val10, fwd)) > 4f) && !(Mathf.Abs(Vector3.Dot(val10, side)) > 4f)) { if (!IsBoss(item8) && (float)item8._hp.Value <= v * 10f) { HitNumber(item8, Hurt(item8, item8._hp.Value, who)); } else { HitNumber(item8, Hurt(item8, hit, who)); } } } })); break; } case EnemyKind.Koi: { Vector3 position = who.Transform.position; AbsFx("koi", val + fwd * 1.5f, val + fwd * 12f, who, 0, 1500); ((MonoBehaviour)this).StartCoroutine(Breathe(position, fwd, hit, who)); break; } default: { Vector3 end = Reach(o, d, 45f); foreach (Creature item9 in Along(o, end, 1.6f)) { HitNumber(item9, Hurt(item9, hit, who)); } AbsFx("eye", val, end, who); foreach (Creature item10 in Targets().OrderBy(delegate(Creature c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val10 = ((Component)c).transform.position - end; return ((Vector3)(ref val10)).sqrMagnitude; }).Take(5).ToList()) { Creature t = item10; AbsFx("spear", ((Component)t).transform.position, ((Component)t).transform.position, who); ((MonoBehaviour)this).StartCoroutine(After(0.55f, delegate { if (Object.op_Implicit((Object)(object)t)) { HitNumber(t, Hurt(t, v * 2f, who)); } })); } break; } } return MoveSeconds(boss); } private IEnumerator Breathe(Vector3 from, Vector3 fwd, float hit, Player who) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 6; i++) { foreach (Creature item in Targets()) { Vector3 val = (((Component)item).transform.position - from).Flat(); if (((Vector3)(ref val)).sqrMagnitude <= 144f && Vector3.Angle(fwd, val) <= 25f) { HitNumber(item, Hurt(item, hit, who)); } } yield return (object)new WaitForSeconds(0.25f); } } private static void AbsFx(string key, Vector3 a, Vector3 b, Player who, int pieceId = 0, int arg = 0) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(new FxEvent { Kind = FxKind.Absorber, Key = key, From = a, To = b, PieceId = pieceId, Arg = arg, Who = (Object.op_Implicit((Object)(object)who) ? ((NetworkBehaviour)who).ObjectId : 0) }, true, (Channel)0); } } private void AbsorberViews() { //IL_0165: Unknown result type (might be due to invalid IL or missing references) VaultData vaultData = (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.ClientVault : null); HashSet hashSet = new HashSet(); if (vaultData != null) { foreach (Player player in PlayerManager.Players) { Item item = ((Object.op_Implicit((Object)(object)player) && Object.op_Implicit((Object)(object)player.Holding)) ? player.Holding.HeldItem : null); if (WeaponItems.Is(item, out var g, out var _) && g == Gear.Absorber) { Transform val = WeaponItems.ModelOf(item); if (val != null) { hashSet.Add(val); Show(val, vaultData.AbsorbedOf(Loot.KeyOf(player))?.Id ?? 0); } } } } foreach (Transform item2 in _chambers.Keys.ToList()) { if (!Object.op_Implicit((Object)(object)item2)) { _chambers.Remove(item2); continue; } if (!hashSet.Contains(item2)) { Show(item2, 0); } if (Object.op_Implicit((Object)(object)_chambers[item2].root)) { Transform val2 = _chambers[item2].root.Find("Look"); if (val2 != null) { val2.localRotation = Quaternion.Euler(15f, Time.time * 80f, 0f); } } } } private void Show(Transform model, byte id) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (_chambers.TryGetValue(model, out (byte, Transform) value) && value.Item1 == id && Object.op_Implicit((Object)(object)value.Item2)) { return; } if (Object.op_Implicit((Object)(object)value.Item2)) { Object.Destroy((Object)(object)((Component)value.Item2).gameObject); } Transform transform = new GameObject("AbsorberChamber").transform; transform.SetParent(model, false); transform.localPosition = DomeAt; if (!Object.op_Implicit((Object)(object)_glass)) { _glass = BossVfx.Wash(new Color(0.75f, 0.92f, 1f, 0.2f)); } WeaponFx.Piece(WeaponFx.Ball, _glass, transform).localScale = Vector3.one * 0.055f * 2f; if (id != 0) { Transform val = LookOf(id, 0.082499996f); if (val != null) { val.SetParent(transform, false); ((Object)val).name = "Look"; } } Transform[] componentsInChildren = ((Component)transform).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.layer = ((Component)model).gameObject.layer; } _chambers[model] = (id, transform); } internal static Transform LookOf(byte id, float size) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) Item spawnable = GameInfo.GetSpawnable(id); if (!Object.op_Implicit((Object)(object)spawnable)) { return null; } Transform transform = new GameObject("AbsorbedLook").transform; Transform transform2 = new GameObject("Inner").transform; transform2.SetParent(transform, false); Matrix4x4 worldToLocalMatrix = ((Component)spawnable).transform.worldToLocalMatrix; Bounds val = default(Bounds); bool flag = false; Renderer[] componentsInChildren = ((Component)spawnable).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { if (!val2.enabled || val2 is ParticleSystemRenderer || val2 is LineRenderer || val2 is TrailRenderer) { continue; } SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)(object)((val2 is SkinnedMeshRenderer) ? val2 : null); object obj; if (val3 == null) { MeshFilter component = ((Component)val2).GetComponent(); obj = ((component != null) ? component.sharedMesh : null); } else { obj = val3.sharedMesh; } Mesh val4 = (Mesh)obj; if (!Object.op_Implicit((Object)(object)val4)) { continue; } Matrix4x4 val5 = worldToLocalMatrix * ((Component)val2).transform.localToWorldMatrix; Transform transform3 = new GameObject("Part", new Type[2] { typeof(MeshFilter), typeof(MeshRenderer) }).transform; transform3.SetParent(transform2, false); transform3.localPosition = Vector4.op_Implicit(((Matrix4x4)(ref val5)).GetColumn(3)); transform3.localRotation = ((Matrix4x4)(ref val5)).rotation; transform3.localScale = ((Matrix4x4)(ref val5)).lossyScale; ((Component)transform3).GetComponent().sharedMesh = val4; MeshRenderer component2 = ((Component)transform3).GetComponent(); ((Renderer)component2).sharedMaterials = val2.sharedMaterials; ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; Bounds bounds = val4.bounds; for (int j = 0; j < 8; j++) { Vector3 val6 = ((Matrix4x4)(ref val5)).MultiplyPoint3x4(((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1))))); if (flag) { ((Bounds)(ref val)).Encapsulate(val6); continue; } ((Bounds)(ref val))..ctor(val6, Vector3.zero); flag = true; } } if (!flag) { Object.Destroy((Object)(object)((Component)transform).gameObject); return null; } float num = size / Mathf.Max(0.01f, Mathf.Max(((Bounds)(ref val)).size.x, Mathf.Max(((Bounds)(ref val)).size.y, ((Bounds)(ref val)).size.z))); transform2.localScale = Vector3.one * num; transform2.localPosition = -((Bounds)(ref val)).center * num; return transform; } private string AbsorberLines(Rarity r, out string banner) { VaultData clientVault = Loot.Instance.ClientVault; ulong myKey = Loot.MyKey; StoredItem storedItem = clientVault.AbsorbedOf(myKey); Siege instance = Siege.Instance; float num = ((Object.op_Implicit((Object)(object)instance) && instance.ViewActive) ? FortressPlugin.HpMult(instance.View.Wave) : 1f); int num2 = Mathf.RoundToInt(clientVault.WeaponValue(myKey, Gear.Absorber, r) * num); if (storedItem == null) { banner = L10n.T("absorberEmpty"); return L10n.T("absorberEmptyHow", SuckReach(clientVault, myKey).ToString("0.#")); } Item spawnable = GameInfo.GetSpawnable(storedItem.Id); string text = (Object.op_Implicit((Object)(object)spawnable) ? spawnable.GetName() : ("#" + storedItem.Id)); string text2; if (!Copies(spawnable, out var g, out var r2)) { text2 = ((!BossTrophies.Is(spawnable, out var k)) ? L10n.T("absorberShot", Mathf.RoundToInt((float)num2 * ShotMult(storedItem.Worth)), storedItem.Worth.ToString("N0"), ShotMult(storedItem.Worth).ToString("0.#")) : ("" + L10n.T("absMove" + k) + ":" + L10n.T("absMoveFx" + k, Mathf.RoundToInt((float)num2 * MoveMult(k))))); } else { Rarity r3 = CopyRarity(r2, r); text = GearCatalog.Label(g, r2); text2 = L10n.T("absorberCopy", GearCatalog.Label(g, r3)) + "\n" + clientVault.EffectFor(myKey, g, r3); } banner = L10n.T("absorberIn", text) + "\u3000" + text2.Split('\n')[0] + ""; return text2 + "\n" + L10n.T("absorberBoost", 2.5f.ToString("0.#")) + "\n" + L10n.T("absorberSpit", FlingMult(storedItem.Worth).ToString("0.#")); } private void AbsorberTop(string banner) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (banner == null) { if (Object.op_Implicit((Object)(object)_absTop)) { ((Component)_absTop).gameObject.SetActive(false); } return; } if (!Object.op_Implicit((Object)(object)_absTop)) { _absTop = Hud.Box(Hud.Root, new Vector2(0.5f, 1f), new Vector2(0f, -150f), new Vector2(600f, 46f), Hud.Panel, 16f); _absTopText = Hud.Label(((Component)_absTop).transform, "", 22f, new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(1400f, 40f), (TextAlignmentOptions)514); } ((Component)_absTop).gameObject.SetActive(true); if (!(((TMP_Text)_absTopText).text == banner)) { ((TMP_Text)_absTopText).text = banner; ((Graphic)_absTop).rectTransform.sizeDelta = new Vector2(((TMP_Text)_absTopText).GetPreferredValues(banner).x + 48f, 46f); } } private static Gear BarGear(Gear g) { StoredItem storedItem = ((g == Gear.Absorber && Object.op_Implicit((Object)(object)Loot.Instance)) ? Loot.Instance.ClientVault.AbsorbedOf(Loot.MyKey) : null); if (storedItem == null || !Copies(GameInfo.GetSpawnable(storedItem.Id), out var g2, out var _)) { return g; } return g2; } private void AbsorberKeys(bool can) { Mouse current = Mouse.current; bool flag = can && current != null && current.rightButton.isPressed; if (flag && (!_rightHeld || Time.time >= _nextRight)) { Send((byte)(_rightHeld ? 4 : 3)); _nextRight = Time.time + 0.1f; } else if (!flag && _rightHeld) { Send(5); } _rightHeld = flag; Keyboard current2 = Keyboard.current; if (can && current2 != null && ((ButtonControl)current2.rKey).wasPressedThisFrame) { Send(6); } } private static bool Lobbed(Gear g) { if (g != Gear.PoisonGas && g != Gear.Whirlpool && g != Gear.NetLauncher && g != Gear.JellyGun) { return g == Gear.PufferBomb; } return true; } private static bool Aimed(Gear g) { if (g != Gear.BubbleGun && g != Gear.Hook && g != Gear.StarThrower && g != Gear.Boomerang) { return g == Gear.LobsterClaw; } return true; } private void CastIndicator(Gear? held, Rarity r) { //IL_012d: 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_0327: 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_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: 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_034e: 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_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036d: 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_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_0779: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) Gear? obj; if (held.HasValue) { Gear valueOrDefault = held.GetValueOrDefault(); obj = BarGear(valueOrDefault); } else { obj = null; } Gear? gear = obj; Camera curCamera = GameInfo.CurCamera; Player localPlayer = Player.LocalPlayer; bool ready; float pulse; bool past; Transform[] array; if (gear.HasValue) { Gear valueOrDefault2 = gear.GetValueOrDefault(); if ((valueOrDefault2 == Gear.SharkWhistle || valueOrDefault2 == Gear.Rocket || valueOrDefault2 == Gear.Conch || Lobbed(valueOrDefault2) || Aimed(valueOrDefault2)) && Object.op_Implicit((Object)(object)curCamera) && Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Transform) && !_drawn && !Hud.ModalOpen && !BuildSystem.Building) { if (!Object.op_Implicit((Object)(object)_castRing)) { _castRingMat = BossVfx.Wash(Color.white); _castMarkMat = BossVfx.Wash(Color.white); _castRing = WeaponFx.Piece(BossVfx.Ring(0f), _castRingMat); _castMark = WeaponFx.Piece(BossVfx.Ring(0.35f), _castMarkMat); _castMark2 = WeaponFx.Piece(BossVfx.Ring(0.35f), _castMarkMat); _castCone = WeaponFx.Piece(Sector(30), _castRingMat); _coneHalf = 30; array = (Transform[])(object)new Transform[4] { _castRing, _castMark, _castMark2, _castCone }; foreach (Transform obj2 in array) { ((Object)obj2).name = "FortressCastIndicator"; Object.DontDestroyOnLoad((Object)(object)((Component)obj2).gameObject); } } Gear value = gear.Value; VaultData vaultData = (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.ClientVault : null); Gear? gear2 = held; Gear g = Gear.Absorber; StoredItem storedItem = ((gear2 == g && vaultData != null) ? vaultData.AbsorbedOf(Loot.MyKey) : null); Rarity r2; bool flag = ((storedItem != null && Copies(GameInfo.GetSpawnable(storedItem.Id), out g, out r2)) ? CopyRarity(r2, r) : r) == Rarity.Legendary; float num = WeaponMods.ReachMult(vaultData?.ModOf(Loot.MyKey, value, 3) ?? 0); float num2 = WeaponMods.TraitAdd(value, vaultData?.ModOf(Loot.MyKey, value, 2) ?? 0); _mine.TryGetValue(value, out (float, float, float) value2); ready = Time.time >= value2.Item2; pulse = 0.5f + 0.5f * Mathf.Sin(Time.time * 6f); Vector3 position = ((Component)curCamera).transform.position; Vector3 forward = ((Component)curCamera).transform.forward; past = false; Vector3 val5; if (value == Gear.SharkWhistle) { Vector3 val = Reach(position, forward, 30f); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 0.5f, Vector3.down, ref val2, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { val = ((RaycastHit)(ref val2)).point; } Vector3 at = OnSea(val); Disc(at, 14f * num); Mark(_castMark, at, 1.3f); ((Component)_castMark2).gameObject.SetActive(flag); if (flag) { Transform castMark = _castMark2; Vector3 val3 = val; Quaternion val4 = Quaternion.Euler(0f, 90f, 0f); val5 = forward.Flat(); Mark(castMark, OnSea(val3 + val4 * ((Vector3)(ref val5)).normalized * 4f), 1.3f); } Off((Transform[])(object)new Transform[1] { _castCone }); } else if (Lobbed(value)) { Vector3 at2 = Land(position, forward, RangeOf(value) * num); Disc(at2, value switch { Gear.NetLauncher => (3.5f + num2) * (flag ? 1.5f : 1f), Gear.JellyGun => 3f, Gear.Whirlpool => 6f, Gear.PoisonGas => 3f, _ => 3.5f + num2, }); Mark(_castMark, at2, 0.8f); Off((Transform[])(object)new Transform[2] { _castMark2, _castCone }); } else { switch (value) { case Gear.Rocket: { Vector3 val7 = Reach(position, forward, 40f * num); Creature val8 = Along(position, val7, 1.2f).FirstOrDefault(); Vector3 at3 = (Object.op_Implicit((Object)(object)val8) ? ((Component)val8).transform.position : Grounded(val7)); Disc(at3, 3f + num2); Mark(_castMark, at3, 0.8f); Off((Transform[])(object)new Transform[2] { _castMark2, _castCone }); break; } case Gear.Conch: { int num5 = Mathf.RoundToInt(Mathf.Min(80f, 30f + num2)); if (num5 != _coneHalf) { MeshFilter component = ((Component)_castCone).GetComponent(); Object.Destroy((Object)(object)component.sharedMesh); component.sharedMesh = Sector(num5); _coneHalf = num5; } float num6 = 10f * num; Put(_castCone, Grounded(localPlayer.Transform.position + Vector3.up) + Vector3.up * 0.08f, new Vector3(num6, 1f, num6)); Vector3 val9 = forward.Flat(); if (((Vector3)(ref val9)).sqrMagnitude > 0.001f) { _castCone.rotation = Quaternion.LookRotation(val9); } Off((Transform[])(object)new Transform[3] { _castRing, _castMark, _castMark2 }); break; } default: { float num3 = RangeOf(value) * num; Vector3 val6 = Reach(position, forward, num3); List list = Along(position, val6, value switch { Gear.Boomerang => 1.3f, Gear.LobsterClaw => 1.1f, _ => 0.8f, }); int num4; if (list.Count == 0) { val5 = val6 - position; num4 = ((((Vector3)(ref val5)).sqrMagnitude >= (num3 - 0.05f) * (num3 - 0.05f)) ? 1 : 0); } else { num4 = 0; } past = (byte)num4 != 0; Mark(_castMark, (list.Count > 0) ? ((Component)list[0]).transform.position : Grounded(val6), 1.1f); Off((Transform[])(object)new Transform[3] { _castRing, _castMark2, _castCone }); break; } } } Color val10 = Tint(); _castRingMat.color = new Color(val10.r, val10.g, val10.b, ready ? 0.42f : 0.24f); _castMarkMat.color = new Color(val10.r, val10.g, val10.b, (ready ? 0.55f : 0.3f) + 0.3f * pulse); return; } } array = (Transform[])(object)new Transform[4] { _castRing, _castMark, _castMark2, _castCone }; foreach (Transform val11 in array) { if (Object.op_Implicit((Object)(object)val11) && ((Component)val11).gameObject.activeSelf) { ((Component)val11).gameObject.SetActive(false); } } void Disc(Vector3 val12, float radius) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Put(_castRing, val12 + Vector3.up * 0.08f, new Vector3(radius, 1f, radius)); } void Mark(Transform t, Vector3 val12, float size) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) Put(t, val12 + Vector3.up * 0.1f, Vector3.one * size * (1f + 0.2f * pulse)); } static void Off(params Transform[] ts) { foreach (Transform val12 in ts) { if (((Component)val12).gameObject.activeSelf) { ((Component)val12).gameObject.SetActive(false); } } } Color Tint() { //IL_0049: 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) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (!past) { if (!ready) { return new Color(0.62f, 0.64f, 0.68f); } return new Color(0.35f, 0.85f, 1f); } return new Color(1f, 0.42f, 0.3f); } } private static void Put(Transform t, Vector3 at, Vector3 scale) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!((Component)t).gameObject.activeSelf) { ((Component)t).gameObject.SetActive(true); } t.position = at; t.localScale = scale; } private static Vector3 Grounded(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(p + Vector3.up * 0.5f, Vector3.down, ref val, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { p = ((RaycastHit)(ref val)).point; } p.y = Mathf.Max(p.y, WaterManager.GetWaterHeight(p)); return p; } private static Mesh Sector(int half) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00a6: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00df: Expected O, but got Unknown List list = new List { Vector3.zero }; List list2 = new List { new Color(1f, 1f, 1f, 0f) }; List list3 = new List(); for (int i = 0; i <= 24; i++) { float num = MathF.PI / 180f * Mathf.Lerp((float)(-half), (float)half, (float)i / 24f); list.Add(new Vector3(Mathf.Sin(num), 0f, Mathf.Cos(num))); list2.Add(Color.white); if (i > 0) { list3.AddRange(new int[3] { 0, i, i + 1 }); } } Mesh val = new Mesh { name = "FortressCone" + half }; val.SetVertices(list); val.SetColors(list2); val.SetTriangles(list3, 0); val.RecalculateBounds(); return val; } public static float[] BoomerangFan(Rarity r) { return r switch { Rarity.Rare => new float[2] { -6f, 6f }, Rarity.Epic => new float[3] { -10f, 0f, 10f }, Rarity.Legendary => new float[4] { -15f, -5f, 5f, 15f }, _ => new float[1], }; } public static float RangeOf(Gear g) { switch (g) { case Gear.Laser: return 30f; case Gear.Rocket: return 40f; case Gear.BubbleGun: case Gear.Hook: return 25f; case Gear.StarThrower: return 25f; case Gear.PoisonGas: return 24f; case Gear.Whirlpool: return 24f; case Gear.NetLauncher: return 24f; case Gear.JellyGun: return 24f; case Gear.PufferBomb: return 24f; case Gear.Boomerang: return 18f; case Gear.Conch: return 10f; case Gear.WaterCannon: return 15f; case Gear.LobsterClaw: return 12f; case Gear.SharkWhistle: return 14f; case Gear.Absorber: return 8f; case Gear.Gatling: return 30f; default: return 0f; } } public static string ModelName(Gear g) { return g switch { Gear.Laser => "LaserGun", Gear.PoisonGas => "GasGun", Gear.Boomerang => "Boomerang", Gear.SharkWhistle => "SharkWhistle", Gear.BubbleGun => "BubbleGun", Gear.Hook => "HookGun", Gear.Whirlpool => "WhirlCannon", Gear.Conch => "Conch", _ => g.ToString(), }; } public static float LaserRamp(float seconds, float max = 3f) { return Mathf.Min(max, 1f + Mathf.Max(0f, seconds) / 2f * (max - 1f)); } public static float GatlingShots(float spin, float rate = 12f) { return rate * Mathf.Lerp(0.25f, 1f, Mathf.Clamp01(spin)); } public static Vector3 BoomerangAt(Vector3 a, Vector3 b, float t) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (t <= 0.55f) { return Vector3.Lerp(a, b, Mathf.Sin(Mathf.Clamp01(t / 0.55f) * MathF.PI * 0.5f)); } return Vector3.Lerp(b, a, 1f - Mathf.Cos(Mathf.Clamp01((t - 0.55f) / 0.55f) * MathF.PI * 0.5f)); } public static int ClawPick(Vector3 o, Vector3 end, IList bodies) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b1: Unknown result type (might be due to invalid IL or missing references) int num = -1; float num2 = float.MaxValue; Vector3 val = end - o; Vector3 normalized = ((Vector3)(ref val)).normalized; for (int i = 0; i < bodies.Count; i++) { float num3 = Vector3.Dot(bodies[i] - o, normalized); if (num3 > 0f && num3 < num2 && DistToSegment(bodies[i], o, end) <= 1.1f) { num2 = num3; num = i; } } if (num >= 0) { return num; } val = normalized.Flat(); Vector3 normalized2 = ((Vector3)(ref val)).normalized; float num4 = 12.25f; for (int j = 0; j < bodies.Count; j++) { Vector3 val2 = (bodies[j] - o).Flat(); if (((Vector3)(ref val2)).sqrMagnitude <= num4 && Vector3.Angle(normalized2, val2) < 60f) { num4 = ((Vector3)(ref val2)).sqrMagnitude; num = j; } } return num; } public static float DistToSegment(Vector3 p, Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; float num = Mathf.Clamp01(Vector3.Dot(p - a, val) / Mathf.Max(0.0001f, ((Vector3)(ref val)).sqrMagnitude)); Vector3 val2 = a + val * num - p; return ((Vector3)(ref val2)).magnitude; } private void Awake() { Instance = this; } static Weapons() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00dc: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) DomeAt = new Vector3(0f, 0.21f, 0.02f); LaserHeatSeconds = new float[4] { 4.5f, 5.5f, 6.5f, 8f }; SharkLife = new float[4] { 15f, 17f, 20f, 25f }; WaterTankSeconds = new float[4] { 3.5f, 4f, 4.5f, 5.5f }; StarCount = new int[4] { 3, 3, 4, 5 }; Wild = AccessTools.FieldRefAccess>("_aliveCreatures"); BossBoxes = new Dictionary(); OpenSlotMethod = AccessTools.Method(typeof(PlayerInventory), "GetOpenSlot", (Type[])null, (Type[])null); HeatStops = (Color[])(object)new Color[5] { new Color(1f, 0.22f, 0.18f), new Color(0.3f, 1f, 0.35f), new Color(0.3f, 0.55f, 1f), new Color(0.75f, 0.35f, 1f), Color.white }; NetHoop = new Vector3(0f, -0.12f, 0.962f); Vector3 val = new Vector3(0f, -0.954f, -0.301f); NetHang = ((Vector3)(ref val)).normalized; GenericWriter.SetWrite((Action)delegate(Writer w, WeaponFire v) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) w.WriteByte(v.Phase); w.WriteVector3(v.Origin); w.WriteVector3(v.Dir); }); GenericReader.SetRead((Func)((Reader r) => new WeaponFire { Phase = r.ReadByte(), Origin = r.ReadVector3(), Dir = r.ReadVector3() })); GenericWriter.SetWrite((Action)delegate(Writer w, WeaponState v) { w.WriteInt32(v.PlayerId); w.WriteByte((byte)v.Gear); w.WriteSingle(v.Heat); w.WriteSingle(v.ReadyIn); }); GenericReader.SetRead((Func)((Reader r) => new WeaponState { PlayerId = r.ReadInt32(), Gear = (Gear)r.ReadByte(), Heat = r.ReadSingle(), ReadyIn = r.ReadSingle() })); } private void Update() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, WeaponFire f, Channel ch) { Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); if (Object.op_Implicit((Object)(object)val)) { ServerFire(val, f); } }), true); networkManager.ClientManager.RegisterBroadcast((Action)delegate(WeaponState s, Channel ch) { OnState(s); }); networkManager.ClientManager.OnClientConnectionState += delegate(ClientConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { ClearViews(); } }; } if (InstanceFinder.IsServerStarted) { ServerTick(); } ClientTick(); } public static float FlingMult(int worth) { return 1f + Mathf.Sqrt((float)Mathf.Max(0, worth) / 50f); } public static bool OnLine(Item it) { if (Object.op_Implicit((Object)(object)Instance) && Object.op_Implicit((Object)(object)it)) { if (!Instance._hooked.ContainsValue(it)) { return Instance._flung.Any((Fling f) => (Object)(object)f.Item == (Object)(object)it); } return true; } return false; } private static Player PlayerById(int id) { return ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).ObjectId == id)); } private static List Targets() { IEnumerable enumerable = FortressPlugin.Alive; if (Object.op_Implicit((Object)(object)CreatureManager.Instance)) { enumerable = enumerable.Concat(Wild.Invoke(CreatureManager.Instance)); } return enumerable.Where((Creature c) => Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned && c._hp.Value > 0 && !Object.op_Implicit((Object)(object)((Item)c).Holder) && !Siege.Instance.IsHidden(c) && !Bosses.Entering(c)).Distinct().ToList(); } private static Vector3 Body(Creature c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return ((Component)c).transform.position + Vector3.up * 0.5f; } private static float SizeOf(Creature c) { if (!Object.op_Implicit((Object)(object)Enemies.Instance) || !Enemies.Instance.TryGet(c, out var tag)) { return 1f; } return Mathf.Max(1f, Enemies.StatsOf(tag).Scale); } private static bool IsBoss(Creature c) { if (Enemies.Instance.TryGet(c, out var tag)) { return EnemyCatalog.IsBoss(tag.Kind); } return false; } private static bool IsSpitter(Creature c) { if (Enemies.Instance.TryGet(c, out var tag)) { return tag.Kind == EnemyKind.Spitter; } return false; } private static List Along(Vector3 a, Vector3 b, float radius) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return (from c in Targets() where Touches(c, a, b, radius) select c).OrderBy(delegate(Creature c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Body(c) - a; return ((Vector3)(ref val)).sqrMagnitude; }).ToList(); } private static float Girth(Creature c) { return 0.45f * (SizeOf(c) - 1f); } private static Bounds BoxOf(Creature c, float radius) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (!BossBoxes.TryGetValue(c, out (float, Bounds) value) || Time.time > value.Item1) { if (BossBoxes.Count > 20) { BossBoxes.Clear(); } value = (BossBoxes[c] = (Time.time + 1f, BossLooks.WorldBounds(((Component)c).transform))); } Bounds item = value.Item2; ((Bounds)(ref item)).Expand(radius * 2f); return item; } private static bool Touches(Creature c, Vector3 a, Vector3 b, float radius) { //IL_0025: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (!IsBoss(c)) { return DistToSegment(Body(c), a, b) <= radius + Girth(c); } Bounds val = BoxOf(c, radius); Vector3 val2 = b - a; float magnitude = ((Vector3)(ref val2)).magnitude; if (!((Bounds)(ref val)).Contains(a)) { float num = default(float); if (magnitude > 0.0001f && ((Bounds)(ref val)).IntersectRay(new Ray(a, val2 / magnitude), ref num)) { return num <= magnitude; } return false; } return true; } private static bool Touches(Creature c, Vector3 p, float radius) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!IsBoss(c)) { Vector3 val = Body(c) - p; return ((Vector3)(ref val)).sqrMagnitude <= (radius + Girth(c)) * (radius + Girth(c)); } Bounds val2 = BoxOf(c, radius); return ((Bounds)(ref val2)).Contains(p); } public static Vector3 Reach(Vector3 o, Vector3 d, float range) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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) foreach (RaycastHit item in from h in Physics.RaycastAll(o, d, range, LayerMask.op_Implicit(GameInfo.LevelLayer)) orderby ((RaycastHit)(ref h)).distance select h) { RaycastHit current = item; string name = ((Object)((Component)((RaycastHit)(ref current)).collider).gameObject).name; if (!name.StartsWith("FortressPiece") && !(name == "FortressCore") && !Object.op_Implicit((Object)(object)ItemManager.Get(((RaycastHit)(ref current)).collider))) { return ((RaycastHit)(ref current)).point; } } return o + d * range; } private static Vector3 Land(Vector3 o, Vector3 d, float range) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_002e: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Reach(o, d, range); Creature val2 = Along(o, val, 1.2f).FirstOrDefault(); if (Object.op_Implicit((Object)(object)val2)) { val = ((Component)val2).transform.position; } RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 0.5f, Vector3.down, ref val3, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { val = ((RaycastHit)(ref val3)).point; } val.y = Mathf.Max(val.y, WaterManager.GetWaterHeight(val)); return val; } private static Vector3 Muzzle(Vector3 o, Vector3 d) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) return o + d * 0.6f + Vector3.down * 0.25f; } private static int Hurt(Creature c, float dmg, Player by) { if (!Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0) { return 0; } if (Object.op_Implicit((Object)(object)by)) { Stats.HandHit(c, by); } dmg *= 1f + Perks.Of(by, Gear.Gauntlet); if (!IsBoss(c) && HoldsAbsorber(by)) { dmg *= 2.5f; } if (Siege.Instance.IsBubbled(c)) { dmg *= 1.5f; } if (IsNetted(c)) { dmg *= 1.3f; } int num = Mathf.Max(1, Mathf.RoundToInt(dmg)); c.ServerChangeHp(num); return num; } private static void HitNumber(Creature c, int dmg) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)c) && dmg > 0) { Fx.Send(FxKind.WeaponHit, Body(c), Body(c), 0, dmg); } } public void ServerFire(Player who, WeaponFire f) { //IL_0039: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_009f: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00c3: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)who) && Object.op_Implicit((Object)(object)who.Transform) && PlayerManager.AlivePlayers.Contains(who) && WeaponItems.Held(who, out var g, out var r) && !GearCatalog.IsGameGun(g) && Finite(f.Origin) && Finite(f.Dir)) { Vector3 val = f.Origin; Vector3 d = ((((Vector3)(ref f.Dir)).sqrMagnitude > 0.01f) ? ((Vector3)(ref f.Dir)).normalized : who.Transform.forward); Vector3 val2 = (Object.op_Implicit((Object)(object)who.CamObject) ? who.CamObject.position : (who.Transform.position + Vector3.up * 1.6f)); Vector3 val3 = val - val2; if (((Vector3)(ref val3)).sqrMagnitude > 9f) { val = val2; } if (g == Gear.Absorber) { AbsorberFire(who, f.Phase, val, d, r); } else if (f.Phase <= 2) { FireAs(who, f.Phase, val, d, g, r); } } } private void FireAs(Player who, byte phase, Vector3 o, Vector3 d, Gear g, Rarity r) { //IL_0060: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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) VaultData vault = Loot.Instance.Vault; ulong player = Loot.KeyOf(who); float num = vault.WeaponValue(player, g, r); int num2 = vault.ModOf(player, g, 1); int num3 = vault.ModOf(player, g, 2); float reach = WeaponMods.ReachMult(vault.ModOf(player, g, 3)); bool legend = r == Rarity.Legendary; Gun gun = GunOf(who, g); switch (g) { case Gear.Laser: LaserTick(who, gun, phase, o, d, num, legend, r, num2, num3, reach); return; case Gear.WaterCannon: WaterTick(who, gun, phase, o, d, num, legend, r, num2, num3, reach); return; case Gear.Gatling: GatlingTick(who, gun, phase, o, d, num, legend, num2, num3, reach); return; } if (phase != 2 && !(Time.time < gun.ReadyAt)) { if (WeaponMods.Lingers(g)) { num /= WeaponMods.TimeMult(num2); } float num4 = Fire(g, who, o, d, num, legend, r, WeaponMods.TraitAdd(g, num3), reach); if (!(num4 < 0f)) { gun.ReadyAt = Time.time + num4 * WeaponMods.TimeMult(num2); SendState(who, gun); AutoTest.Count("weapon_" + g); } } } private static bool Finite(Vector3 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!float.IsNaN(v.x + v.y + v.z)) { return !float.IsInfinity(v.x + v.y + v.z); } return false; } private static void SendState(Player who, Gun gun) { InstanceFinder.ServerManager.Broadcast(((NetworkBehaviour)who).Owner, new WeaponState { PlayerId = ((NetworkBehaviour)who).ObjectId, Gear = gun.Gear, Heat = gun.Heat, ReadyIn = Mathf.Max(0f, gun.ReadyAt - Time.time) }, true, (Channel)0); } private float Fire(Gear g, Player who, Vector3 o, Vector3 d, float v, bool legend, Rarity r, float trait, float reach) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0094: 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_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_00c4: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_0ddc: Unknown result type (might be due to invalid IL or missing references) //IL_0dde: Unknown result type (might be due to invalid IL or missing references) //IL_0de3: Unknown result type (might be due to invalid IL or missing references) //IL_0de7: Unknown result type (might be due to invalid IL or missing references) //IL_0dec: Unknown result type (might be due to invalid IL or missing references) //IL_0e08: Unknown result type (might be due to invalid IL or missing references) //IL_0e09: Unknown result type (might be due to invalid IL or missing references) //IL_0e0a: Unknown result type (might be due to invalid IL or missing references) //IL_0e0e: Unknown result type (might be due to invalid IL or missing references) //IL_0e13: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0828: Unknown result type (might be due to invalid IL or missing references) //IL_0829: Unknown result type (might be due to invalid IL or missing references) //IL_0833: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_08c1: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_08d1: Unknown result type (might be due to invalid IL or missing references) //IL_08d8: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_0a83: Unknown result type (might be due to invalid IL or missing references) //IL_0a84: Unknown result type (might be due to invalid IL or missing references) //IL_0a8e: Unknown result type (might be due to invalid IL or missing references) //IL_0a93: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0a99: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Unknown result type (might be due to invalid IL or missing references) //IL_0aa2: Unknown result type (might be due to invalid IL or missing references) //IL_0aa7: Unknown result type (might be due to invalid IL or missing references) //IL_0aac: Unknown result type (might be due to invalid IL or missing references) //IL_0aad: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_0796: Unknown result type (might be due to invalid IL or missing references) //IL_0799: Unknown result type (might be due to invalid IL or missing references) //IL_042d: 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_0e51: Unknown result type (might be due to invalid IL or missing references) //IL_0e56: Unknown result type (might be due to invalid IL or missing references) //IL_0e57: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Unknown result type (might be due to invalid IL or missing references) //IL_0e61: Unknown result type (might be due to invalid IL or missing references) //IL_0228: 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) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_0e74: Unknown result type (might be due to invalid IL or missing references) //IL_0e76: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_0973: Unknown result type (might be due to invalid IL or missing references) //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Unknown result type (might be due to invalid IL or missing references) //IL_097d: Unknown result type (might be due to invalid IL or missing references) //IL_0987: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_098f: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b03: Unknown result type (might be due to invalid IL or missing references) //IL_0cac: Unknown result type (might be due to invalid IL or missing references) //IL_0cb1: Unknown result type (might be due to invalid IL or missing references) //IL_0cb6: Unknown result type (might be due to invalid IL or missing references) //IL_0cb8: Unknown result type (might be due to invalid IL or missing references) //IL_0cbd: Unknown result type (might be due to invalid IL or missing references) //IL_0cbf: Unknown result type (might be due to invalid IL or missing references) //IL_0cc0: Unknown result type (might be due to invalid IL or missing references) //IL_0cca: Unknown result type (might be due to invalid IL or missing references) //IL_0ccf: Unknown result type (might be due to invalid IL or missing references) //IL_0cd1: Unknown result type (might be due to invalid IL or missing references) //IL_0cd2: Unknown result type (might be due to invalid IL or missing references) //IL_0ce5: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0b13: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_0b18: Unknown result type (might be due to invalid IL or missing references) //IL_0d01: Unknown result type (might be due to invalid IL or missing references) //IL_0cf8: Unknown result type (might be due to invalid IL or missing references) //IL_0cfd: Unknown result type (might be due to invalid IL or missing references) //IL_0dbc: Unknown result type (might be due to invalid IL or missing references) //IL_0dbd: Unknown result type (might be due to invalid IL or missing references) //IL_0dc4: Unknown result type (might be due to invalid IL or missing references) //IL_0dc9: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0ebf: Unknown result type (might be due to invalid IL or missing references) //IL_0eb9: Unknown result type (might be due to invalid IL or missing references) //IL_0d3b: Unknown result type (might be due to invalid IL or missing references) //IL_0d3d: Unknown result type (might be due to invalid IL or missing references) //IL_0d3e: Unknown result type (might be due to invalid IL or missing references) //IL_0d43: Unknown result type (might be due to invalid IL or missing references) //IL_0d56: Unknown result type (might be due to invalid IL or missing references) //IL_0d57: Unknown result type (might be due to invalid IL or missing references) //IL_0d7f: Unknown result type (might be due to invalid IL or missing references) //IL_0d81: Unknown result type (might be due to invalid IL or missing references) //IL_0d0c: Unknown result type (might be due to invalid IL or missing references) //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d1b: Unknown result type (might be due to invalid IL or missing references) //IL_0d1d: Unknown result type (might be due to invalid IL or missing references) //IL_0d26: Unknown result type (might be due to invalid IL or missing references) //IL_0d2f: Unknown result type (might be due to invalid IL or missing references) //IL_0d34: Unknown result type (might be due to invalid IL or missing references) //IL_0d39: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_0ee1: Unknown result type (might be due to invalid IL or missing references) //IL_0a1f: Unknown result type (might be due to invalid IL or missing references) //IL_0bfb: Unknown result type (might be due to invalid IL or missing references) //IL_0bfd: Unknown result type (might be due to invalid IL or missing references) //IL_0bfe: Unknown result type (might be due to invalid IL or missing references) //IL_0c03: Unknown result type (might be due to invalid IL or missing references) //IL_0f1e: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0a2a: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_0c55: Unknown result type (might be due to invalid IL or missing references) float s = Scale; Vector3 val = Muzzle(o, d); Vector3 val2; switch (g) { case Gear.PoisonGas: { Vector3 at5 = Land(o, d, 24f * reach); float life2 = 6f + trait; Fx.Send(FxKind.Gas, val, at5, 0, Mathf.RoundToInt(life2 * 1000f), ((NetworkBehaviour)who).ObjectId); ((MonoBehaviour)this).StartCoroutine(After(0.6f, delegate { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) _clouds.Add(new Cloud { At = at5, Radius = 3f, Until = Time.time + life2, Dps = v, Owner = ((NetworkBehaviour)who).ObjectId, Legend = legend }); })); return GearCatalog.Cooldown(g, r); } case Gear.Boomerang: { float range = 18f * reach; Vector3 val12 = val; float[] array = BoomerangFan(r); foreach (float num6 in array) { Vector3 val13 = Reach(val12, Quaternion.Euler(0f, num6, 0f) * d, range); Fx.Send(FxKind.Boomerang, val12, val13, 0, 0, ((NetworkBehaviour)who).ObjectId); ((MonoBehaviour)this).StartCoroutine(BoomerangFlight(val12, val13, v, who, trait)); } return 1.25f; } case Gear.SharkWhistle: { Vector3 val16 = Land(o, d, 30f); for (int num8 = 0; num8 < ((!legend) ? 1 : 2); num8++) { Shark shark = new Shark { Id = _nextShark++, Owner = ((NetworkBehaviour)who).ObjectId, Until = Time.time + SharkLife[(uint)r] + trait, Dmg = v, Sight = 14f * reach }; Quaternion val17 = Quaternion.Euler(0f, 90f, 0f); val2 = d.Flat(); shark.Pos = OnSea(val16 + val17 * ((Vector3)(ref val2)).normalized * ((num8 == 0) ? 0f : 4f)); shark.Face = shark.Pos + d.Flat(); _sharks.Add(shark); SendShark(shark, alive: true); } return GearCatalog.Cooldown(g, r); } case Gear.BubbleGun: { Vector3 val7 = Reach(o, d, 25f * reach); Creature val8 = Along(o, val7, 0.8f).FirstOrDefault(); Fx.Send(FxKind.Bubble, val, Object.op_Implicit((Object)(object)val8) ? Body(val8) : val7, (Object.op_Implicit((Object)(object)val8) && !IsBoss(val8)) ? ((NetworkBehaviour)val8).ObjectId : 0, Mathf.RoundToInt(v * 1000f), ((NetworkBehaviour)who).ObjectId); float pop = (legend ? 20f : 0f) + trait; if (Object.op_Implicit((Object)(object)val8)) { Siege.Instance.ServerBubble(val8, v, (pop > 0f) ? ((Action)delegate(Vector3 at7) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) Pop(at7, pop * s, who, legend); }) : null); } return GearCatalog.Cooldown(g, r); } case Gear.Hook: { if (_hooked.TryGetValue(((NetworkBehaviour)who).ObjectId, out var value)) { _hooked.Remove(((NetworkBehaviour)who).ObjectId); if (Object.op_Implicit((Object)(object)value) && Hookable(value, who)) { FlingOut(who, value, val, d, v * s, legend); return GearCatalog.Cooldown(g, r); } } Vector3 val9 = Reach(o, d, 25f * reach); Creature c = Along(o, val9, 0.8f).FirstOrDefault(); float magnitude; if (!Object.op_Implicit((Object)(object)c)) { val2 = val9 - o; magnitude = ((Vector3)(ref val2)).magnitude; } else { val2 = Body(c) - o; magnitude = ((Vector3)(ref val2)).magnitude; } Item val10 = ItemAlong(o, d, magnitude, who); if (Object.op_Implicit((Object)(object)val10)) { Fx.Send(FxKind.Hook, val, ((Component)val10).transform.position, ((NetworkBehaviour)val10).ObjectId, 1, ((NetworkBehaviour)who).ObjectId); ((MonoBehaviour)this).StartCoroutine(ReelIn(who, val10)); AutoTest.Count("hooked_item"); return 0.6f; } Fx.Send(FxKind.Hook, val, Object.op_Implicit((Object)(object)c) ? Body(c) : val9, Object.op_Implicit((Object)(object)c) ? ((NetworkBehaviour)c).ObjectId : 0, 0, ((NetworkBehaviour)who).ObjectId); if (!Object.op_Implicit((Object)(object)c)) { return 0.5f; } Creature c2 = c; Player who2 = who; float dmg = v * s; Vector3 position = who.Transform.position; val2 = d.Flat(); HookFish(c2, who2, dmg, position + ((Vector3)(ref val2)).normalized * 2.5f, trait); if (legend) { Creature val11 = Targets().Where(delegate(Creature x) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)x != (Object)(object)c) { Vector3 val19 = ((Component)x).transform.position - ((Component)c).transform.position; return ((Vector3)(ref val19)).sqrMagnitude < 36f; } return false; }).OrderBy(delegate(Creature x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val19 = ((Component)x).transform.position - ((Component)c).transform.position; return ((Vector3)(ref val19)).sqrMagnitude; }).FirstOrDefault(); if (Object.op_Implicit((Object)(object)val11)) { Fx.Send(FxKind.Hook, Body(c), Body(val11), ((NetworkBehaviour)val11).ObjectId, 0, ((NetworkBehaviour)who).ObjectId); Player who3 = who; float dmg2 = v * s; Vector3 position2 = who.Transform.position; val2 = d.Flat(); HookFish(val11, who3, dmg2, position2 + ((Vector3)(ref val2)).normalized * 3.5f, trait); Perks.Proc(Gear.Hook, ((Component)val11).transform.position); } } return GearCatalog.Cooldown(g, r); } case Gear.Whirlpool: { Vector3 at6 = Land(o, d, 24f * reach); Fx.Send(FxKind.Whirl, val, at6, 0, Mathf.RoundToInt(v * 1000f), ((NetworkBehaviour)who).ObjectId); ((MonoBehaviour)this).StartCoroutine(After(0.6f, delegate { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) _vortices.Add(new Vortex { At = at6, Until = Time.time + v, Dps = 5f + trait, Owner = ((NetworkBehaviour)who).ObjectId, Legend = legend }); })); return GearCatalog.Cooldown(g, r); } case Gear.NetLauncher: { Vector3 at4 = Land(o, d, 24f * reach); float radius = (3.5f + trait) * (legend ? 1.5f : 1f); Fx.Send(FxKind.Net, val, at4, Mathf.RoundToInt(radius * 100f), Mathf.RoundToInt(v * 1000f) * ((!legend) ? 1 : (-1)), ((NetworkBehaviour)who).ObjectId); ((MonoBehaviour)this).StartCoroutine(After(0.6f, delegate { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) foreach (Creature item in Targets().Where(delegate(Creature x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val19 = (((Component)x).transform.position - at4).Flat(); return ((Vector3)(ref val19)).sqrMagnitude <= radius * radius; })) { HitNumber(item, Hurt(item, 8f * s, who)); Siege.Instance.Slow(item, IsBoss(item) ? 0.5f : 1f, v); if (legend) { _netted[item] = Time.time + v; Perks.Proc(Gear.NetLauncher, ((Component)item).transform.position); } } AutoTest.Count("netted"); })); return GearCatalog.Cooldown(g, r); } case Gear.JellyGun: { Vector3 at3 = Land(o, d, 24f * reach); float life = 6f + trait; Fx.Send(FxKind.Jelly, val, at3, 0, Mathf.RoundToInt(life * 1000f), ((NetworkBehaviour)who).ObjectId); ((MonoBehaviour)this).StartCoroutine(After(0.6f, delegate { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) _jellies.Add(new Jelly { At = at3, Radius = 3f, Until = Time.time + life, Dps = v, Owner = ((NetworkBehaviour)who).ObjectId, Legend = legend }); })); return GearCatalog.Cooldown(g, r); } case Gear.PufferBomb: { Vector3 at = Land(o, d, 24f * reach); Fx.Send(FxKind.Puffer, val, at, 0, Mathf.RoundToInt(1200f), ((NetworkBehaviour)who).ObjectId); ((MonoBehaviour)this).StartCoroutine(After(1.8000001f, delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) PufferBurst(at, v * s, who, legend ? 1 : 0, 3.5f + trait); })); return GearCatalog.Cooldown(g, r); } case Gear.StarThrower: { int num9 = StarCount[(uint)r]; int count = (legend ? 3 : 2) + Mathf.RoundToInt(trait); for (int num10 = 0; num10 < num9; num10++) { Vector3 d2 = Quaternion.AngleAxis(((float)num10 - (float)(num9 - 1) * 0.5f) * 9f, Vector3.up) * d; Vector3 val18 = Reach(o, d2, 25f * reach); List list2 = Along(o, val18, 0.8f).Take(count).ToList(); foreach (Creature item2 in list2) { HitNumber(item2, Hurt(item2, v * s, who)); } if (legend && list2.Count > 2) { Perks.Proc(Gear.StarThrower, ((Component)list2[2]).transform.position); } Fx.Send(FxKind.Star, val, (list2.Count > 0) ? Body(list2[list2.Count - 1]) : val18, 0, 0, ((NetworkBehaviour)who).ObjectId); } return GearCatalog.Cooldown(g, r); } case Gear.LobsterClaw: { List list = Targets(); Vector3 val14 = Reach(o, d, 12f * reach); val2 = d.Flat(); Vector3 fwd = ((Vector3)(ref val2)).normalized; int num7 = ClawPick(o, val14, list.Select(Body).ToList()); Creature first = ((num7 >= 0) ? list[num7] : null); Vector3 val15 = (Object.op_Implicit((Object)(object)first) ? Body(first) : val14); Fx.Send(FxKind.Claw, val, val15, Object.op_Implicit((Object)(object)first) ? ((NetworkBehaviour)first).ObjectId : 0, 0, ((NetworkBehaviour)who).ObjectId); if (!Object.op_Implicit((Object)(object)first)) { return 0.5f; } List grabbed = new List { first }; if (legend) { grabbed.AddRange(list.Where(delegate(Creature x) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)x != (Object)(object)first) { Vector3 val19 = ((Component)x).transform.position - ((Component)first).transform.position; return ((Vector3)(ref val19)).sqrMagnitude < 16f; } return false; }).OrderBy(delegate(Creature x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val19 = ((Component)x).transform.position - ((Component)first).transform.position; return ((Vector3)(ref val19)).sqrMagnitude; }).Take(2)); } float dmg3 = v * s; float splash = 2.5f + trait; val2 = val15 - val; ((MonoBehaviour)this).StartCoroutine(After(((Vector3)(ref val2)).magnitude / 60f, delegate { //IL_0023: Unknown result type (might be due to invalid IL or missing references) foreach (Creature item3 in grabbed) { ClawFling(item3, fwd, dmg3, who, splash); } })); if (legend && grabbed.Count > 1) { Perks.Proc(Gear.LobsterClaw, ((Component)first).transform.position); } return GearCatalog.Cooldown(g, r); } case Gear.Rocket: { float[] array = ((!legend) ? new float[1] : new float[3] { -14f, 0f, 14f }); foreach (float num4 in array) { Vector3 val4 = Quaternion.AngleAxis(num4, Vector3.up) * d; Vector3 val5 = Reach(o, val4, 40f * reach); Creature val6 = Along(o, val5, 1.2f).FirstOrDefault(); float waterHeight = WaterManager.GetWaterHeight(o); if (Object.op_Implicit((Object)(object)val6)) { val5 = Body(val6); } else if (val5.y < waterHeight && val4.y < -0.01f) { val5 = o + val4 * ((o.y - waterHeight) / (0f - val4.y)); } val2 = val5 - val; float num5 = ((Vector3)(ref val2)).magnitude / 32f; Fx.Send(FxKind.Rocket, val, val5, 0, Mathf.RoundToInt(num5 * 1000f), ((NetworkBehaviour)who).ObjectId); Vector3 at2 = val5; ((MonoBehaviour)this).StartCoroutine(After(num5, delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) RocketBlast(at2, v * s, who, 3f + trait); })); } if (legend) { Perks.Proc(Gear.Rocket, o + d * 6f); } return GearCatalog.Cooldown(g, r); } case Gear.Conch: { val2 = d.Flat(); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num = 10f * reach; float num2 = 30f + trait; Fx.Send(FxKind.Sonic, val, val + normalized * num, 0, Mathf.RoundToInt(num2), ((NetworkBehaviour)who).ObjectId); foreach (Creature item4 in Targets()) { Vector3 val3 = (((Component)item4).transform.position - o).Flat(); if (!(((Vector3)(ref val3)).sqrMagnitude > num * num) && !(Vector3.Angle(normalized, val3) > num2)) { HitNumber(item4, Hurt(item4, 10f * s, who)); Siege.Instance.ServerPush(item4, ((((Vector3)(ref val3)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val3)).normalized : normalized) * (IsBoss(item4) ? (v * 0.3f) : v)); Siege.Instance.Interrupt(item4); if (legend) { Siege.Instance.Slow(item4, 1f, 1.5f); Perks.Proc(Gear.Conch, ((Component)item4).transform.position); } } } return GearCatalog.Cooldown(g, r); } default: return -1f; } } private void ClawFling(Creature c, Vector3 fwd, float dmg, Player who, float splash) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00e0: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0) { return; } if (IsBoss(c)) { HitNumber(c, Hurt(c, dmg, who)); Siege.Instance.Slow(c, 0.5f, 1.5f); return; } Vector3 land = Reach(((Component)c).transform.position + Vector3.up * 1.5f, fwd, 8f); RaycastHit val = default(RaycastHit); if (Physics.Raycast(land + Vector3.up, Vector3.down, ref val, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { land = ((RaycastHit)(ref val)).point; } land.y = Mathf.Max(land.y, WaterManager.GetWaterHeight(land)); Siege.Instance.ServerPull(c, land, 0.5f); ((MonoBehaviour)this).StartCoroutine(After(0.5f, delegate { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)c)) { HitNumber(c, Hurt(c, dmg, who)); } foreach (Creature item in Targets().Where(delegate(Creature x) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)x != (Object)(object)c) { Vector3 val2 = ((Component)x).transform.position - land; return ((Vector3)(ref val2)).sqrMagnitude <= splash * splash; } return false; })) { HitNumber(item, Hurt(item, dmg * 0.5f, who)); } Fx.Send(FxKind.Dust, land, land); })); } private bool Hookable(Item it, Player who) { if (Object.op_Implicit((Object)(object)it) && Object.op_Implicit((Object)(object)it.Rig) && Object.op_Implicit((Object)(object)it.RigidbodySync) && !Object.op_Implicit((Object)(object)it.Holder) && !Object.op_Implicit((Object)(object)it.SyncedHolder) && !it.IsInInventory && ((NetworkBehaviour)it).IsSpawned && !it.IsDestroying && !((NetworkBehaviour)it).IsDeinitializing && !Object.op_Implicit((Object)(object)it.BirdHolder) && !Object.op_Implicit((Object)(object)it.AttachedRod) && !Object.op_Implicit((Object)(object)it.DeadPlayer) && !it.IsQuestItem && (!Object.op_Implicit((Object)(object)it.Creature) || it.Creature.IsDead) && !Swallow.IsGoing(it) && !_hooked.Any((KeyValuePair kv) => kv.Key != ((NetworkBehaviour)who).ObjectId && (Object)(object)kv.Value == (Object)(object)it)) { return !_flung.Any((Fling f) => (Object)(object)f.Item == (Object)(object)it); } return false; } private Item ItemAlong(Vector3 o, Vector3 d, float max, Player who) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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) foreach (RaycastHit item in from h in Physics.SphereCastAll(o, 0.35f, d, max, -1, (QueryTriggerInteraction)1) orderby ((RaycastHit)(ref h)).distance select h) { RaycastHit current = item; Item val = ItemManager.Get(((RaycastHit)(ref current)).collider); if (Object.op_Implicit((Object)(object)val) && Hookable(val, who)) { return val; } } return null; } public string DebugHookScan(Vector3 o, Vector3 d, Player who) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) return string.Join("; ", (from h in Physics.SphereCastAll(o, 0.35f, d, 25f, -1, (QueryTriggerInteraction)1) orderby ((RaycastHit)(ref h)).distance select h).Select(delegate(RaycastHit h) { Item val = ItemManager.Get(((RaycastHit)(ref h)).collider); return string.Format("{0} (layer {1}, {2:0.0} m{3})", ((Object)((RaycastHit)(ref h)).collider).name, ((Component)((RaycastHit)(ref h)).collider).gameObject.layer, ((RaycastHit)(ref h)).distance, Object.op_Implicit((Object)(object)val) ? $", item {((Object)val).name} hookable {Hookable(val, who)}: holder {Object.op_Implicit((Object)(object)val.Holder)} synced {Object.op_Implicit((Object)(object)val.SyncedHolder)} inv {val.IsInInventory} spawned {((NetworkBehaviour)val).IsSpawned} destroying {val.IsDestroying}/{((NetworkBehaviour)val).IsDeinitializing} bird {Object.op_Implicit((Object)(object)val.BirdHolder)} rod {Object.op_Implicit((Object)(object)val.AttachedRod)} dead {Object.op_Implicit((Object)(object)val.DeadPlayer)} quest {val.IsQuestItem} creature {Object.op_Implicit((Object)(object)val.Creature)} swallow {Swallow.IsGoing(val)}" : ""); })); } private static Vector3 HookHold(Player who) { //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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) Transform val = (Object.op_Implicit((Object)(object)who.CamObject) ? who.CamObject : who.Transform); return val.position + val.forward * 1.1f + val.right * 0.45f + Vector3.down * 0.35f; } private IEnumerator ReelIn(Player who, Item it) { it.RigidbodySync.StartSimulateLocal(default(Vector3), default(Quaternion)); it.RigidbodySync.SetKinematic(true); Vector3 from = ((Component)it).transform.position; for (float t = 0f; t < 0.35f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)it)) { break; } if (!Object.op_Implicit((Object)(object)who)) { break; } if (!Object.op_Implicit((Object)(object)who.Transform)) { break; } ((Component)it).transform.position = Vector3.Lerp(from, HookHold(who), t * t / 0.122499995f); Siege.Synced(it); yield return null; } if (Object.op_Implicit((Object)(object)it) && Object.op_Implicit((Object)(object)who)) { _hooked[((NetworkBehaviour)who).ObjectId] = it; } else if (Object.op_Implicit((Object)(object)it)) { it.RigidbodySync.SetKinematic(false); } } private void FlingOut(Player who, Item it, Vector3 from, Vector3 d, float dmg, bool legend) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) int totalWorth = it.TotalWorth; ((Component)it).transform.position = from + d * 0.5f; it.RigidbodySync.SetKinematic(false); it.Rig.linearVelocity = d * 30f + Vector3.up * 1.5f; it.Rig.angularVelocity = Random.insideUnitSphere * 12f; Siege.Synced(it); _flung.Add(new Fling { Item = it, By = who, Dmg = dmg * FlingMult(totalWorth), Until = Time.time + 3f, Left = ((!legend) ? 1 : 3) }); Fx.Send(FxKind.Hook, from, from + d, ((NetworkBehaviour)it).ObjectId, 2, ((NetworkBehaviour)who).ObjectId); AutoTest.Count("hook_flung"); } private void CatchTick() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: 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_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair item in _hooked.ToList()) { Player val = PlayerById(item.Key); Item value = item.Value; if (!Object.op_Implicit((Object)(object)value) || !Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.Transform) || !PlayerManager.AlivePlayers.Contains(val) || !Wields(val, Gear.Hook) || !Hookable(value, val)) { _hooked.Remove(item.Key); if (Object.op_Implicit((Object)(object)value) && Object.op_Implicit((Object)(object)value.RigidbodySync)) { value.RigidbodySync.SetKinematic(false); } } else { ((Component)value).transform.position = HookHold(val); Siege.Synced(value); } } foreach (Fling f in _flung.ToList()) { if (!Object.op_Implicit((Object)(object)f.Item) || Time.time > f.Until || f.Left <= 0) { _flung.Remove(f); continue; } Vector3 p = ((Component)f.Item).transform.position; foreach (Creature item2 in Targets().Where(delegate(Creature c) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!f.Hit.Contains(c)) { Vector3 val3 = Body(c) - p; return ((Vector3)(ref val3)).magnitude <= 1.2f * SizeOf(c); } return false; }).Take(f.Left)) { f.Hit.Add(item2); f.Left--; HitNumber(item2, Hurt(item2, f.Dmg, f.By)); float num = Mathf.Clamp(Object.op_Implicit((Object)(object)f.Item.Rig) ? (f.Item.Rig.mass * 1.5f) : 3f, 2f, 9f); if (!IsBoss(item2)) { Siege instance = Siege.Instance; Vector3 push; if (!Object.op_Implicit((Object)(object)f.Item.Rig)) { push = Vector3.zero; } else { Vector3 val2 = f.Item.Rig.linearVelocity.Flat(); push = ((Vector3)(ref val2)).normalized * num; } instance.ServerPush(item2, push); } Fx.Send(FxKind.Dust, p, p); AutoTest.Count("hook_fling_hit"); } } } private void RocketBlast(Vector3 at, float dmg, Player who, float radius) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) foreach (Creature item in Targets().Where(delegate(Creature x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Body(x) - at; return ((Vector3)(ref val)).sqrMagnitude <= radius * radius; })) { HitNumber(item, Hurt(item, dmg, who)); } AutoTest.Count("rocket_blast"); } private void PufferBurst(Vector3 at, float dmg, Player who, int again, float radius) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) foreach (Creature item in Targets().Where(delegate(Creature x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)x).transform.position - at; return ((Vector3)(ref val)).sqrMagnitude <= radius * radius; })) { HitNumber(item, Hurt(item, dmg, who)); Envenom(item, 2, dmg, who); } Fx.Send(FxKind.Puffer, at, at, 0, 0, Object.op_Implicit((Object)(object)who) ? ((NetworkBehaviour)who).ObjectId : 0); AutoTest.Count("puffer_burst"); if (again > 0) { Perks.Proc(Gear.PufferBomb, at); ((MonoBehaviour)this).StartCoroutine(After(1f, delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) PufferBurst(at, dmg, who, again - 1, radius); })); } } private void WaterTick(Player who, Gun gun, byte phase, Vector3 o, Vector3 d, float v, bool legend, Rarity r, int rate, int trait, float reach) { //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_01f3: 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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; switch (phase) { case 2: SendState(who, gun); return; case 0: AutoTest.Count("weapon_WaterCannon"); break; } float num = time - gun.LastTick; gun.LastTick = time; if (phase == 1 && num < 0.05f) { gun.LastTick = time - num; return; } if (phase == 0 || num > 1f) { gun.Heat = Mathf.Max(0f, gun.Heat - 0.35f * Mathf.Min(num, 10f)); num = 0.1f; } if (gun.Overheated) { if (time < gun.ReadyAt) { return; } gun.Overheated = false; gun.Heat = 0.3f; gun.RampStart = time; } num = Mathf.Min(num, 0.5f); gun.Heat += num / (WaterTankSeconds[(uint)r] + WeaponMods.TraitAdd(Gear.WaterCannon, trait)); if (gun.Heat >= 1f) { gun.Heat = 1f; gun.Overheated = true; gun.ReadyAt = time + 2f; SendState(who, gun); return; } Vector3 val = Reach(o, d, 15f * reach); Vector3 val2 = d.Flat(); Vector3 normalized = ((Vector3)(ref val2)).normalized; float scale = Scale; float num2 = 1f / WeaponMods.TimeMult(rate); float num3 = Mathf.Min(25f, v * num2 * (legend ? 1.5f : 1f)); foreach (Creature item in Along(o, val, 1.3f)) { _wet[item] = time + 5f; gun.NumberDmg += Hurt(item, v * num2 * 0.6f * scale * num, who); if (IsBoss(item)) { Siege.Instance.Slow(item, 0.3f, 0.4f); continue; } Siege.Instance.ServerPush(item, normalized * num3 * num * 2.5f); if (legend) { Siege.Instance.Slow(item, 0.5f, 0.5f); } } Fx.Send(FxKind.Water, Muzzle(o, d), val, 0, 0, ((NetworkBehaviour)who).ObjectId); if (time >= gun.NextState) { gun.NextState = time + 0.25f; SendState(who, gun); } } private static void Pop(Vector3 at, float dmg, Player who, bool legend) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) foreach (Creature item in Targets().Where(delegate(Creature x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)x).transform.position - at; return ((Vector3)(ref val)).sqrMagnitude <= 9f; })) { HitNumber(item, Hurt(item, dmg, who)); } Fx.Send(FxKind.Bubble, at, at, 0, 0, Object.op_Implicit((Object)(object)who) ? ((NetworkBehaviour)who).ObjectId : 0); if (legend) { Perks.Proc(Gear.BubbleGun, at); } } private void LaserTick(Player who, Gun gun, byte phase, Vector3 o, Vector3 d, float v, bool legend, Rarity r, int rate, int trait, float reach) { //IL_0101: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; switch (phase) { case 2: SendState(who, gun); return; case 0: AutoTest.Count("weapon_Laser"); break; } float num = time - gun.LastTick; gun.LastTick = time; if (phase == 1 && num < 0.05f) { gun.LastTick = time - num; return; } if (phase == 0 || num > 1f) { gun.Heat = Mathf.Max(0f, gun.Heat - 0.35f * Mathf.Min(num, 10f)); gun.RampStart = time; num = 0.1f; } if (gun.Overheated) { if (time < gun.ReadyAt) { return; } gun.Overheated = false; gun.Heat = 0.3f; } num = Mathf.Min(num, 1f); gun.Heat += num / LaserHeatSeconds[(uint)r]; if (gun.Heat >= 1f) { gun.Heat = 1f; gun.Overheated = true; gun.ReadyAt = time + 2f; SendState(who, gun); return; } Vector3 val = Reach(o, d, 30f * reach); List list = Along(o, val, 0.8f); Creature val2 = list.FirstOrDefault(); float num2 = 3f + WeaponMods.TraitAdd(Gear.Laser, trait); float num3 = LaserRamp(time - gun.RampStart, num2); float num4 = 1f / WeaponMods.TimeMult(rate); float dmg = v * Scale * num3 * num4 * num; IEnumerable enumerable; if (!legend) { enumerable = list.Take(1); } else { IEnumerable enumerable2 = list; enumerable = enumerable2; } foreach (Creature item in enumerable) { gun.NumberDmg += Hurt(item, dmg, who); if (legend && list.Count > 1) { Perks.Proc(Gear.Laser, ((Component)item).transform.position); } } float bite = v / GearCatalog.Value(Gear.Laser, r) * num3 * num4; Fx.Send(FxKind.Beam, Muzzle(o, d), (Object.op_Implicit((Object)(object)val2) && !legend) ? Body(val2) : val, Mathf.RoundToInt(BeamShown(r, bite, BeamMaxBite, num3 >= num2) * 100f), Mathf.RoundToInt(num3 * 100f), ((NetworkBehaviour)who).ObjectId); if (time >= gun.NextNumber && gun.NumberDmg > 0f && Object.op_Implicit((Object)(object)val2)) { HitNumber(val2, Mathf.RoundToInt(gun.NumberDmg)); gun.NumberDmg = 0f; gun.NextNumber = time + 0.5f; } if (time >= gun.NextState) { gun.NextState = time + 0.25f; SendState(who, gun); } } private void GatlingTick(Player who, Gun gun, byte phase, Vector3 o, Vector3 d, float v, bool legend, int rate, int trait, float reach) { //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: 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_02c7: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; float num = time - gun.LastTick; switch (phase) { case 2: gun.LastTick = time; SendState(who, gun); return; case 1: if (num < 0.05f) { return; } break; } gun.LastTick = time; if (phase == 0 || num > 1f) { gun.Heat = Mathf.Max(0f, gun.Heat - Mathf.Min(num, 10f) / 1.5f); if (num > 0.3f) { gun.Rounds = Mathf.Max(gun.Rounds, 1f); } num = 0.1f; AutoTest.Count("weapon_Gatling"); } num = Mathf.Min(num, 0.5f); gun.Heat = Mathf.Min(1f, gun.Heat + num / Mathf.Max(0.15f, 1.2f - WeaponMods.TraitAdd(Gear.Gatling, trait))); gun.Rounds += GatlingShots(gun.Heat) / WeaponMods.TimeMult(rate) * num; int num2 = (int)gun.Rounds; gun.Rounds -= num2; Vector3 val = Reach(o, d, 30f * reach); Creature val2 = null; Creature val3 = null; bool flag = false; if (num2 > 0) { List source = Along(o, val, 0.8f); float num3 = v * Scale; for (int i = 0; i < num2; i++) { Creature c = ((IEnumerable)source).FirstOrDefault((Func)((Creature x) => Object.op_Implicit((Object)(object)x) && x._hp.Value > 0)); if (!Object.op_Implicit((Object)(object)c)) { break; } if ((Object)(object)c != (Object)(object)val2) { val2 = c; val3 = (legend ? Targets().Where(delegate(Creature x) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)x != (Object)(object)c) { Vector3 val4 = ((Component)x).transform.position - ((Component)c).transform.position; return ((Vector3)(ref val4)).sqrMagnitude < 36f; } return false; }).OrderBy(delegate(Creature x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val4 = ((Component)x).transform.position - ((Component)c).transform.position; return ((Vector3)(ref val4)).sqrMagnitude; }).FirstOrDefault() : null); } gun.NumberDmg += Hurt(c, num3, who); if (Object.op_Implicit((Object)(object)val3) && val3._hp.Value > 0) { gun.NumberDmg += Hurt(val3, num3 * 0.5f, who); flag = true; } } } Fx.Send(FxKind.Gatling, Muzzle(o, d), Object.op_Implicit((Object)(object)val2) ? Body(val2) : val, num2, Mathf.RoundToInt(gun.Heat * 100f), ((NetworkBehaviour)who).ObjectId); if (flag && Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val3)) { Fx.Send(FxKind.Gatling, Body(val2), Body(val3), -1, 0, ((NetworkBehaviour)who).ObjectId); Perks.Proc(Gear.Gatling, ((Component)val3).transform.position); } if (time >= gun.NextNumber && gun.NumberDmg > 0f && Object.op_Implicit((Object)(object)val2)) { HitNumber(val2, Mathf.RoundToInt(gun.NumberDmg)); gun.NumberDmg = 0f; gun.NextNumber = time + 0.5f; } if (time >= gun.NextState) { gun.NextState = time + 0.25f; SendState(who, gun); } } private IEnumerator BoomerangFlight(Vector3 a, Vector3 b, float v, Player who, float slow) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) HashSet hit = new HashSet(); bool back = false; for (float t = 0f; t < 1.1f; t += Time.deltaTime) { if (!back && t > 0.55f) { back = true; hit.Clear(); } Vector3 p = BoomerangAt(a, b, t); foreach (Creature item in Targets()) { if (!hit.Contains(item) && Touches(item, p, 1.3f)) { hit.Add(item); HitNumber(item, Hurt(item, v * Scale, who)); if (slow > 0f) { Siege.Instance.Slow(item, 0.4f, slow); } } } yield return null; } } private static Vector3 OnSea(Vector3 p) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_001c: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_003e: 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_005c: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (Object.op_Implicit((Object)(object)instance) && instance.Exists) { Vector3 center = instance.Center; Vector3 val = (p - center).Flat(); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.forward; } p = center + ((Vector3)(ref val)).normalized * Mathf.Clamp(((Vector3)(ref val)).magnitude, 27.5f, 35.5f); } p.y = WaterManager.GetWaterHeight(p); return p; } private static void SendShark(Shark sh, bool alive) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Fx.Send(FxKind.Shark, sh.Pos, sh.Face, sh.Id, alive ? 1 : 0, sh.Owner); } private void SharkTick(float now) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) foreach (Shark sh in _sharks.ToList()) { if (now > sh.Until) { _sharks.Remove(sh); SendShark(sh, alive: false); continue; } Creature val = Targets().Where(delegate(Creature c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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) Vector3 val5 = (((Component)c).transform.position - sh.Pos).Flat(); if (((Vector3)(ref val5)).sqrMagnitude < sh.Sight * sh.Sight) { val5 = (OnSea(((Component)c).transform.position) - ((Component)c).transform.position).Flat(); return ((Vector3)(ref val5)).sqrMagnitude <= 6.7599993f; } return false; }).OrderBy(delegate(Creature c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val5 = (((Component)c).transform.position - sh.Pos).Flat(); return ((Vector3)(ref val5)).sqrMagnitude; }).FirstOrDefault(); if (Object.op_Implicit((Object)(object)val)) { Vector3 val2 = OnSea(((Component)val).transform.position); sh.Pos = Vector3.MoveTowards(sh.Pos, val2, 7f * Time.deltaTime); sh.Face = ((Component)val).transform.position; Vector3 val3 = (((Component)val).transform.position - sh.Pos).Flat(); if (((Vector3)(ref val3)).magnitude <= 2.6f && now >= sh.NextBite) { sh.NextBite = now + 1.2f; Player val4 = PlayerById(sh.Owner); HitNumber(val, Hurt(val, sh.Dmg * Scale * (IsSpitter(val) ? 3f : 1f), val4)); Fx.Send(FxKind.WeaponHit, sh.Pos, ((Component)val).transform.position, sh.Id, 0, sh.Owner); } } } if (!(now >= _nextSharkSend)) { return; } _nextSharkSend = now + 0.2f; foreach (Shark shark in _sharks) { SendShark(shark, alive: true); } } private static void HookFish(Creature c, Player who, float dmg, Vector3 to, float stun) { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) HitNumber(c, Hurt(c, dmg, who)); int num = Siege.Instance.ServerTakeCarried(c); if (num > 0) { Siege.Instance.ServerAddCoins(num); Fx.Announce("thiefHooked", num); AutoTest.Count("thief_hooked"); } if (IsBoss(c)) { Siege.Instance.Slow(c, 0.5f, 1f); return; } bool flag = IsSpitter(c); if (flag) { Vector3 position = ((Component)c).transform.position; Vector3 val = (to - position).Flat(); to = OnSea(position + ((Vector3)(ref val)).normalized * Mathf.Min(8f, ((Vector3)(ref val)).magnitude)); Siege.Instance.Slow(c, 1f, 2f); } Siege.Instance.ServerPull(c, to, 0.35f, flag); if (stun > 0f) { Siege.Instance.Slow(c, 1f, 0.35f + stun); } } private void HalfSecondTick(float now) { //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: 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_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_045d: 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_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0779: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) float scale = Scale; _clouds.RemoveAll((Cloud cloud3) => now > cloud3.Until); if (_clouds.Count > 0) { foreach (Creature c in Targets()) { Cloud cloud = _clouds.FirstOrDefault(delegate(Cloud x) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val4 = (((Component)c).transform.position - x.At).Flat(); return ((Vector3)(ref val4)).sqrMagnitude <= x.Radius * x.Radius; }); if (cloud != null) { if (!_poison.TryGetValue(c, out var value)) { value = (_poison[c] = new Poison()); } if (now >= value.NextStack) { value.Stacks = Mathf.Min(5, value.Stacks + 1); value.NextStack = now + 1f; } value.Until = now + 4f; value.Dps = Mathf.Max(value.Dps, cloud.Dps); value.Owner = cloud.Owner; value.Legend |= cloud.Legend; } } } foreach (KeyValuePair item in _poison.ToList()) { Creature key = item.Key; Poison value2 = item.Value; if (!Object.op_Implicit((Object)(object)key) || now > value2.Until) { _poison.Remove(key); continue; } if (key._hp.Value > 0) { Hurt(key, value2.Dps * (float)value2.Stacks * scale * 0.5f, PlayerById(value2.Owner)); } if (key._hp.Value > 0) { continue; } _poison.Remove(key); if (!value2.Legend) { continue; } Vector3 at = ((Component)key).transform.position; Cloud cloud2 = _clouds.FirstOrDefault(delegate(Cloud x) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!x.Legend) { Vector3 val4 = (at - x.At).Flat(); return ((Vector3)(ref val4)).sqrMagnitude <= x.Radius * x.Radius; } return false; }); if (cloud2 != null) { cloud2.Until = Mathf.Max(cloud2.Until, now + 3f); cloud2.Dps = Mathf.Max(cloud2.Dps, value2.Dps); } else { _clouds.Add(new Cloud { At = at, Radius = 2f, Until = now + 3f, Dps = value2.Dps, Owner = value2.Owner, Legend = false }); } Fx.Send(FxKind.Gas, at, at, 0, 3000, value2.Owner); Perks.Proc(Gear.PoisonGas, at); } foreach (Jelly j in _jellies.ToList()) { Player val = PlayerById(j.Owner); if (now > j.Until) { _jellies.Remove(j); if (j.Legend) { for (int num = 0; num < 3; num++) { Vector3 val2 = j.At + Quaternion.Euler(0f, (float)num * 120f, 0f) * Vector3.forward * 2.2f; _jellies.Add(new Jelly { At = val2, Radius = 1.9499999f, Until = now + 3f, Dps = j.Dps * 0.5f, Owner = j.Owner }); Fx.Send(FxKind.Jelly, j.At + Vector3.up * 1.3f, val2, 0, 3000, j.Owner); Perks.Proc(Gear.JellyGun, val2); } } continue; } foreach (Creature item2 in Targets().Where(delegate(Creature x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val4 = (((Component)x).transform.position - j.At).Flat(); return ((Vector3)(ref val4)).sqrMagnitude <= j.Radius * j.Radius; })) { Hurt(item2, j.Dps * scale * 0.5f * (IsWet(item2) ? 1.5f : 1f), val); Siege.Instance.Slow(item2, 0.35f, 0.7f); } } foreach (KeyValuePair item3 in _netted.Where((KeyValuePair kv) => !Object.op_Implicit((Object)(object)kv.Key) || now > kv.Value).ToList()) { _netted.Remove(item3.Key); } foreach (KeyValuePair item4 in _wet.Where((KeyValuePair kv) => !Object.op_Implicit((Object)(object)kv.Key) || now > kv.Value).ToList()) { _wet.Remove(item4.Key); } foreach (Creature key2 in _wet.Keys) { Fx.Send(FxKind.Drip, Body(key2), Body(key2)); } foreach (Vortex w in _vortices.ToList()) { List list = Targets().Where(delegate(Creature val5) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val4 = (((Component)val5).transform.position - w.At).Flat(); return ((Vector3)(ref val4)).sqrMagnitude <= 36f; }).ToList(); Player val3 = PlayerById(w.Owner); if (now > w.Until) { _vortices.Remove(w); if (!w.Legend) { continue; } foreach (Creature item5 in list) { HitNumber(item5, Hurt(item5, 40f * scale, val3)); } Fx.Send(FxKind.Blast, w.At, w.At); Perks.Proc(Gear.Whirlpool, w.At); continue; } foreach (Creature item6 in list) { Hurt(item6, w.Dps * scale * 0.5f, val3); if (IsBoss(item6)) { Siege.Instance.Slow(item6, 0.5f, 0.6f); } } } } public bool ServerPull(RunningFish fish, Rigidbody rig) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (_vortices.Count == 0) { return false; } Vector3 pos = ((Component)fish).transform.position; Vortex vortex = _vortices.FirstOrDefault(delegate(Vortex x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = (pos - x.At).Flat(); return ((Vector3)(ref val2)).sqrMagnitude <= 36f; }); if (vortex == null) { return false; } Vector3 val = (vortex.At - pos).Flat(); float num = ((((Vector3)(ref val)).magnitude < 0.8f) ? 0f : 4f); Vector3 linearVelocity = ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? (((Vector3)(ref val)).normalized * num) : Vector3.zero); linearVelocity.y = rig.linearVelocity.y; rig.linearVelocity = linearVelocity; rig.angularVelocity = Vector3.zero; ((Component)fish).transform.Rotate(0f, 360f * Time.deltaTime, 0f); Siege.Synced((Item)(object)fish); return true; } public static bool IsWet(Creature c) { if (Object.op_Implicit((Object)(object)Instance) && Object.op_Implicit((Object)(object)c) && Instance._wet.TryGetValue(c, out var value)) { return Time.time <= value; } return false; } public static bool IsNetted(Creature c) { if (Object.op_Implicit((Object)(object)Instance) && Object.op_Implicit((Object)(object)c) && Instance._netted.TryGetValue(c, out var value)) { return Time.time <= value; } return false; } public static bool IsPoisoned(Creature c) { if (Object.op_Implicit((Object)(object)Instance) && Object.op_Implicit((Object)(object)c) && Instance._poison.TryGetValue(c, out var value) && value.Stacks > 0) { return Time.time <= value.Until; } return false; } private void ServerTick() { bool flag = Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.ServerActive; if (!flag && _wasActive) { foreach (Shark shark in _sharks) { SendShark(shark, alive: false); } _sharks.Clear(); _clouds.Clear(); _poison.Clear(); _vortices.Clear(); _guns.Clear(); _jellies.Clear(); _netted.Clear(); } _wasActive = flag; float time = Time.time; if (_sharks.Count > 0) { SharkTick(time); } if (_hooked.Count > 0 || _flung.Count > 0) { CatchTick(); } if (time >= _nextHalfSecond) { _nextHalfSecond = time + 0.5f; HalfSecondTick(time); } } private static IEnumerator After(float seconds, Action then) { yield return (object)new WaitForSeconds(seconds); then(); } private static int OpenSlot(PlayerInventory inv) { try { return (OpenSlotMethod != null) ? ((int)OpenSlotMethod.Invoke(inv, new object[1] { -1 })) : (-1); } catch { return -1; } } private void ClientTick() { //IL_004f: 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) Player localPlayer = Player.LocalPlayer; bool flag = Object.op_Implicit((Object)(object)localPlayer) && PlayerManager.AlivePlayers.Contains(localPlayer); FortressIsland instance = FortressIsland.Instance; bool flag2 = Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Transform) && Object.op_Implicit((Object)(object)instance) && instance.Exists && instance.OnIsland(localPlayer.Transform.position, 42f); Item val = ((Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Holding)) ? localPlayer.Holding.HeldItem : null); if (_drawn && !Object.op_Implicit((Object)(object)val)) { _handEmptied = true; } if (_drawn && (!flag2 || !flag || Hud.ModalOpen || (Object.op_Implicit((Object)(object)val) && ((Object)(object)val != (Object)(object)_heldAtDraw || _handEmptied)))) { Holster(); } Keyboard current = Keyboard.current; if (current != null && !ChatManager.IsTyping && !Hud.ModalOpen && InstanceFinder.IsClientStarted && flag2 && NetKey != null && ((ButtonControl)current[NetKey.Value]).wasPressedThisFrame) { if (_drawn) { Holster(back: true); } else if (flag) { Draw(net: true); } } Gear g = Gear.Gunpowder; Rarity r = Rarity.Common; bool flag3 = !_drawn && InstanceFinder.IsClientStarted && flag && WeaponItems.Held(localPlayer, out g, out r); if (_drawn) { HideHeld(); if (Object.op_Implicit((Object)(object)localPlayer.Hands)) { localPlayer.Hands.ToggleHandMeshes(false); } UpdateNetView(); HandleNetMouse(); } else if (flag3 && !GearCatalog.IsGameGun(g)) { HandleMouse(g == Gear.Absorber); KickHeld(); } else if (_wasHolding) { Send(2); _wasHolding = false; } GatlingViews(flag3 && g == Gear.Gatling && _wasHolding); if (flag3 && GearCatalog.IsGameGun(g)) { Weapon val2 = (Weapon)(object)((val is Weapon) ? val : null); if (val2 != null) { WeaponMods.TopUp(val2); } } DrawHud(flag3 ? new(Gear, Rarity)?((g, r)) : (((Gear, Rarity)?)null)); CastIndicator(flag3 ? new Gear?(g) : ((Gear?)null), r); AbsorberViews(); AnimateViews(); } public void Draw(bool net) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (_drawn) { Stow(); } _net = true; _drawn = true; Player localPlayer = Player.LocalPlayer; _heldAtDraw = ((Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Holding)) ? localPlayer.Holding.HeldItem : null); _handEmptied = false; if (Object.op_Implicit((Object)(object)_heldAtDraw) && Object.op_Implicit((Object)(object)localPlayer.Inventory) && (localPlayer.Inventory.HasItemInInventory(_heldAtDraw) || OpenSlot(localPlayer.Inventory) >= 0)) { localPlayer.Inventory.LocalTrySelectSlot(-1); } if (Object.op_Implicit((Object)(object)BuildSystem.Instance)) { BuildSystem.Instance.StopBuilding(); } Fx.Sound("EquipItem", Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Transform.position : Vector3.zero, 0.7f, (AudioDistance)1); AutoTest.Count("weapon_drawn"); } public void Holster(bool back = false) { //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) if (!_drawn) { return; } Stow(); foreach (Renderer item in _hidden) { if (Object.op_Implicit((Object)(object)item)) { item.forceRenderingOff = false; } } _hidden.Clear(); _hiddenItem = null; RestoreHands(); Player localPlayer = Player.LocalPlayer; if (back && _handEmptied && Object.op_Implicit((Object)(object)_heldAtDraw) && Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Holding) && !Object.op_Implicit((Object)(object)localPlayer.Holding.HeldItem) && Object.op_Implicit((Object)(object)localPlayer.Inventory)) { foreach (KeyValuePair item2 in localPlayer.Inventory._items) { if ((Object)(object)item2.Value == (Object)(object)_heldAtDraw) { localPlayer.Inventory.LocalTrySelectSlot((int)item2.Key); break; } } } Fx.Sound("UnequipItem", Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Transform.position : Vector3.zero, 0.7f, (AudioDistance)1); } private static void RestoreHands() { Player localPlayer = Player.LocalPlayer; if (!Object.op_Implicit((Object)(object)localPlayer) || !Object.op_Implicit((Object)(object)localPlayer.Hands) || !PlayerManager.AlivePlayers.Contains(localPlayer)) { return; } if (_toolHands == null) { _toolHands = typeof(PlayerHands).GetMethod("ToggleToolHands", BindingFlags.Instance | BindingFlags.NonPublic); } try { if (_toolHands != null) { _toolHands.Invoke(localPlayer.Hands, new object[1] { true }); return; } } catch { } localPlayer.Hands.ToggleHandMeshes(true); } private void Stow() { _drawn = false; if (Object.op_Implicit((Object)(object)_netView)) { _netView.SetActive(false); } } private void HideHeld() { Player localPlayer = Player.LocalPlayer; Item val = ((Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Holding)) ? localPlayer.Holding.HeldItem : null); if ((Object)(object)val == (Object)(object)_hiddenItem) { return; } _hiddenItem = val; if (!Object.op_Implicit((Object)(object)val)) { return; } Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren(); foreach (Renderer val2 in componentsInChildren) { if (!val2.forceRenderingOff) { val2.forceRenderingOff = true; _hidden.Add(val2); } } } private void Send(byte phase) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera) && InstanceFinder.IsClientStarted) { InstanceFinder.ClientManager.Broadcast(new WeaponFire { Phase = phase, Origin = ((Component)curCamera).transform.position, Dir = ((Component)curCamera).transform.forward }, (Channel)0); } } private void HandleMouse(bool absorber) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 Mouse current = Mouse.current; bool flag = current != null && (int)Cursor.lockState == 1 && !ChatManager.IsTyping && !BuildSystem.Building && !Hud.ModalOpen; if (absorber) { AbsorberKeys(flag); } bool flag2 = flag && current.leftButton.isPressed; if (flag2 && (!_wasHolding || Time.time >= _nextSend)) { Send(_wasHolding ? ((byte)1) : ((byte)0)); _nextSend = Time.time + 0.1f; } else if (!flag2 && _wasHolding) { Send(2); } _wasHolding = flag2; } private Transform HeldModel() { //IL_0065: 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) Item val = ((Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Player.LocalPlayer.Holding)) ? Player.LocalPlayer.Holding.HeldItem : null); if ((Object)(object)val != (Object)(object)_heldModelOf) { _heldModelOf = val; _heldModel = WeaponItems.ModelOf(val); if (Object.op_Implicit((Object)(object)_heldModel)) { _heldModelHome = _heldModel.localPosition; } } return _heldModel; } private void KickHeld() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) Transform val = HeldModel(); _kick = Mathf.MoveTowards(_kick, 0f, Time.deltaTime * 5f); if (Object.op_Implicit((Object)(object)val)) { val.position = val.parent.TransformPoint(_heldModelHome) - val.forward * 0.06f * _kick; } } private Vector3 MyMuzzle(Vector3 fallback) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Transform val = HeldModel(); object obj; if (Object.op_Implicit((Object)(object)val)) { MeshFilter component = ((Component)val).GetComponent(); if (component != null) { obj = component.sharedMesh; goto IL_0022; } } obj = null; goto IL_0022; IL_0022: Mesh val2 = (Mesh)obj; if (!Object.op_Implicit((Object)(object)val2)) { return fallback; } Bounds bounds = val2.bounds; return val.TransformPoint(new Vector3(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).center.y, ((Bounds)(ref bounds)).max.z)); } private void OnState(WeaponState s) { if (Object.op_Implicit((Object)(object)Player.LocalPlayer) && s.PlayerId == ((NetworkBehaviour)Player.LocalPlayer).ObjectId) { _mine.TryGetValue(s.Gear, out (float, float, float) value); value.Item1 = s.Heat; if (s.ReadyIn > 0.05f) { value.Item2 = Time.time + s.ReadyIn; value.Item3 = s.ReadyIn; } _mine[s.Gear] = value; } } private void DrawHud((Gear g, Rarity r)? eq) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0151: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0644: 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_0448: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) int num; if ((_drawn || eq.HasValue) && Object.op_Implicit((Object)(object)Hud.Font) && !Hud.ModalOpen) { num = ((!BuildSystem.Building) ? 1 : 0); if (num != 0 && !_drawn && eq.Value.g == Gear.Absorber && Object.op_Implicit((Object)(object)Loot.Instance)) { goto IL_005d; } } else { num = 0; } AbsorberTop(null); goto IL_005d; IL_037d: object obj; object obj2; ((object[])obj)[4] = obj2; Rarity rarity; Gear gear; ((object[])obj)[5] = ((rarity == Rarity.Legendary) ? ("\n★ " + L10n.T("gearLegend" + gear) + "") : ""); string text = string.Concat((string?[])obj); if (gear == Gear.Hook && _onHook != 0) { Transform val = FishView(_onHook); Item val2 = ((val != null && Object.op_Implicit((Object)(object)val)) ? ((Component)val).GetComponent() : null); Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)curCamera)) { Vector3 val3 = ((Component)val2).transform.position - ((Component)curCamera).transform.position; if (!(((Vector3)(ref val3)).sqrMagnitude > 16f)) { text = text + "\n" + L10n.T("hookHolding", val2.GetName(), val2.TotalWorth.ToString("N0"), FlingMult(val2.TotalWorth).ToString("0.#")) + ""; goto IL_04f7; } } _onHook = 0; } goto IL_04f7; IL_005d: if (num == 0) { if (Object.op_Implicit((Object)(object)_hud)) { ((Component)_hud).gameObject.SetActive(false); } return; } if (!Object.op_Implicit((Object)(object)_hud)) { _hud = Hud.Box(Hud.Root, new Vector2(0.5f, 0f), new Vector2(0f, 232f), new Vector2(560f, 70f), Hud.Panel, 18f); _hudPic = Hud.PictureSlot(((Component)_hud).transform, new Vector2(0f, 0.5f), new Vector2(10f, 0f), new Vector2(58f, 58f)); _hudText = Hud.Label(((Component)_hud).transform, "", 21f, new Vector2(0.5f, 1f), new Vector2(32f, -8f), new Vector2(1200f, 32f), (TextAlignmentOptions)258); _hudBar = Hud.Bar.Make(((Component)_hud).transform, new Vector2(0.5f, 0f), new Vector2(32f, 12f), new Vector2(400f, 10f), Hud.Accent); } ((Component)_hud).gameObject.SetActive(true); if (_drawn) { Hud.ShowPicture(_hudPic, "GearBigNet"); NetHud(); return; } (gear, rarity) = eq.Value; Hud.ShowPicture(_hudPic, "Gear" + gear); VaultData vaultData = (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.ClientVault : null); string banner = null; obj = new string[6] { Hud.Keys("" + GearCatalog.Name(gear) + "\u3000" + L10n.T((gear == Gear.Absorber) ? "absorberKeys" : "weaponKeys")), "\n", (gear == Gear.Absorber && vaultData != null) ? AbsorberLines(rarity, out banner) : ((vaultData != null) ? vaultData.EffectFor(Loot.MyKey, gear, rarity) : GearCatalog.Effect(gear, rarity)), "", null, null }; if (vaultData != null) { string text2 = WeaponMods.Summary(vaultData, Loot.MyKey, gear); if (text2 != null && text2.Length > 0) { obj2 = "\n" + L10n.T("modCard", text2) + ""; goto IL_037d; } } obj2 = ""; goto IL_037d; IL_04f7: if (GearCatalog.IsGameGun(gear)) { Item heldItem = Player.LocalPlayer.Holding.HeldItem; Weapon val4 = (Weapon)(object)((heldItem is Weapon) ? heldItem : null); if (val4 != null) { Siege instance = Siege.Instance; float num2 = (float)WeaponMods.ShotDamage(val4) * WeaponItems.GunDamage(GearCatalog.Value(gear, rarity), gear, (Object.op_Implicit((Object)(object)instance) && instance.ViewActive) ? FortressPlugin.HpMult(instance.View.Wave) : 1f); text = text + "\n" + L10n.T("gunNow", Mathf.RoundToInt(num2)) + ""; } } if (gear == Gear.Absorber) { AbsorberTop(banner); } if (((TMP_Text)_hudText).text != text) { ((TMP_Text)_hudText).text = text; Vector2 preferredValues = ((TMP_Text)_hudText).GetPreferredValues(text); ((TMP_Text)_hudText).rectTransform.sizeDelta = new Vector2(1200f, preferredValues.y + 4f); ((Graphic)_hud).rectTransform.sizeDelta = new Vector2(Mathf.Max(460f, preferredValues.x + 48f) + 64f, Mathf.Max(70f, preferredValues.y + 36f)); } gear = BarGear(gear); _mine.TryGetValue(gear, out (float, float, float) value); float num3 = value.Item2 - Time.time; if (gear == Gear.Laser || gear == Gear.WaterCannon || gear == Gear.Gatling) { bool flag = num3 > 0f; Hud.Bar hudBar = _hudBar; float v; if (!flag) { (v, _, _) = value; } else { v = 1f; } hudBar.Set(v, flag ? Hud.Bad : Color.Lerp(Hud.Good, Hud.Gold, value.Item1)); } else { _hudBar.Set((num3 > 0f) ? (1f - num3 / Mathf.Max(0.1f, value.Item3)) : 1f, (num3 > 0f) ? Hud.Accent : Hud.Good); } } internal static Transform FishView(int objectId) { ClientManager clientManager = InstanceFinder.ClientManager; if (objectId == 0 || !((Object)(object)clientManager != (Object)null) || !((ManagedObjects)clientManager.Objects).Spawned.TryGetValue(objectId, out var value) || !Object.op_Implicit((Object)(object)value)) { return null; } return ((Component)value).transform; } public void PlayFx(FxEvent e) { //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07d0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00be: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_01f5: 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_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024b: 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_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: 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_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_0716: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_054f: 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_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) Camera curCamera = GameInfo.CurCamera; Vector3 dir; int num; if (Object.op_Implicit((Object)(object)Player.LocalPlayer) && e.Who == ((NetworkBehaviour)Player.LocalPlayer).ObjectId && e.Kind != FxKind.Shark && e.Kind != FxKind.WeaponHit && Object.op_Implicit((Object)(object)curCamera)) { dir = e.From - ((Component)curCamera).transform.position; num = ((((Vector3)(ref dir)).sqrMagnitude < 4f) ? 1 : 0); } else { num = 0; } bool fromMe = (byte)num != 0; if (fromMe) { _kick = ((e.Kind == FxKind.Beam || e.Kind == FxKind.Gatling) ? Mathf.Max(_kick, 0.3f) : 1f); } Vector3 from = (fromMe ? MyMuzzle(e.From) : e.From); Func muzzle = () => (!fromMe) ? from : MyMuzzle(from); switch (e.Kind) { case FxKind.Beam: Beam(e.Who, from, e.To, 0.07f + 0.04f * Mathf.Clamp((float)e.Arg / 100f - 1f, 0f, 2f), (float)e.PieceId / 100f); if (Time.time >= _nextBeamSound) { _nextBeamSound = Time.time + 0.3f; Fx.Sound("Ignite", from, 0.25f, (AudioDistance)1); } break; case FxKind.Gas: Fx.SoundRandom("PiranhaVomit_V", 1, 3, from, 0.7f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(GasView(from, e.To, (float)e.Arg / 1000f)); break; case FxKind.Boomerang: Fx.Sound("PunchSwoosh", from, 0.9f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(BoomerangView(from, e.To)); break; case FxKind.Shark: OnSharkFx(e); break; case FxKind.Bubble: if (e.Arg == 0) { Fx.SoundRandom("ItemHitWaterLight_V", 1, 3, e.To, 1f, (AudioDistance)2); Pop(e.To, 2f); } else { Fx.SoundRandom("BaitLeaveWater_V", 1, 3, from, 0.7f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(BubbleView(from, e.To, e.PieceId, (float)e.Arg / 1000f)); } break; case FxKind.Hook: { bool flag = Object.op_Implicit((Object)(object)Player.LocalPlayer) && e.Who == ((NetworkBehaviour)Player.LocalPlayer).ObjectId; if (e.Arg == 2) { Fx.Sound("PunchSwoosh", from, 1f, (AudioDistance)2); if (flag) { _onHook = 0; } break; } if (e.Arg == 1 && flag) { _onHook = e.PieceId; } Fx.SoundRandom("FishingrodCast_V", 1, 2, from, 0.8f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(HookView(muzzle, e.To, e.PieceId, e.Arg == 1)); break; } case FxKind.Whirl: Fx.Sound("BoatFire", from, 0.5f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(WhirlView(from, e.To, (float)e.Arg / 1000f)); break; case FxKind.Sonic: Fx.Sound("WhaleNoise_03", from, 0.55f, (AudioDistance)3); ((MonoBehaviour)this).StartCoroutine(SonicView(from, e.To, (e.Arg > 0) ? ((float)e.Arg) : 30f)); break; case FxKind.Net: Fx.Sound("BoatFire", from, 0.4f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(NetView(from, e.To, (float)Mathf.Abs(e.Arg) / 1000f, (float)e.PieceId / 100f)); break; case FxKind.Jelly: Fx.SoundRandom("BaitLeaveWater_V", 1, 3, from, 0.7f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(JellyView(from, e.To, (float)e.Arg / 1000f)); break; case FxKind.Water: WaterView(from, e.To); break; case FxKind.Drip: WeaponFx.Emit(WeaponFx.Drops, from + Random.insideUnitSphere * 0.3f, 3, Vector3.down); break; case FxKind.Gatling: if (e.PieceId < 0) { Bullet(e.From, e.To); break; } _spins[e.Who] = ((float)e.Arg / 100f, Time.time); if (e.PieceId != 0) { Vector3 val = e.To - from; for (int num2 = 0; num2 < Mathf.Min(e.PieceId, 3); num2++) { Bullet(from, e.To + Random.insideUnitSphere * ((Vector3)(ref val)).magnitude * 0.02f); } if (Time.time >= _nextGatlingSound) { _nextGatlingSound = Time.time + 0.07f; Fx.SoundRandom("SMGFireOutside_V", 1, 4, from, 0.5f, (AudioDistance)2); } WeaponFx.Game("PistolFire", from, ((Vector3)(ref val)).normalized); WeaponFx.Emit(WeaponFx.Sparks("Gold"), e.To, Mathf.Min(e.PieceId, 3), -((Vector3)(ref val)).normalized + Vector3.up * 0.5f); } break; case FxKind.Rocket: Fx.Sound("BoatFire", from, 0.55f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(RocketView(from, e.To, (float)e.Arg / 1000f)); break; case FxKind.Puffer: if (e.Arg == 0) { PufferBurstView(e.To); break; } Fx.Sound("PunchSwoosh", from, 0.7f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(PufferView(from, e.To, (float)e.Arg / 1000f)); break; case FxKind.Star: if (Time.time >= _nextStarSound) { _nextStarSound = Time.time + 0.05f; Fx.Sound("PunchSwoosh", from, 0.5f, (AudioDistance)2); } ((MonoBehaviour)this).StartCoroutine(StarView(from, e.To)); break; case FxKind.Claw: Fx.Sound("PunchSwoosh", from, 0.8f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(ClawView(muzzle, e.To, e.PieceId)); break; case FxKind.WeaponHit: if (e.Arg > 0) { try { PlayerUI.AddDamageNumber(e.To + Vector3.up * 0.8f, e.Arg, false); } catch { } WeaponFx.Emit(WeaponFx.Sparks("Gold"), e.To, 8, Vector3.up); WeaponFx.Game("BulletHit", e.To, Vector3.up); } else { Fx.SoundRandom("FishBite_V", 1, 3, e.To, 0.9f, (AudioDistance)2); Vector3 to = e.To; dir = default(Vector3); WeaponFx.Game("WaterSplash", to, dir); WeaponFx.Game("BloodSmall", e.To, Vector3.up); } break; case FxKind.Victory: case FxKind.Crash: case FxKind.Absorb: case FxKind.PieceLost: case FxKind.DeathMark: case FxKind.BossIntro: case FxKind.BossFx: case FxKind.Mend: case FxKind.Absorber: break; } } public static float BeamHeat(Rarity r, float bite, float maxBite) { return (float)(int)r + Mathf.Clamp01(Mathf.Log(Mathf.Max(1f, bite)) / Mathf.Log(Mathf.Max(1.01f, maxBite))); } public static float BeamShown(Rarity r, float bite, float maxBite, bool full) { if (!full || r != Rarity.Legendary) { return BeamHeat(r, bite, maxBite); } return 5f + 0.99f * (BeamHeat(r, bite, maxBite) - 3f); } private static Color HeatColour(float heat) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.FloorToInt(heat), 0, 3); return Color.Lerp(HeatStops[num], HeatStops[num + 1], Mathf.Clamp01(heat - (float)num)); } private static Material BeamMat() { //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) Material val = new Material(LaserMat); if (val.HasProperty("_BaseColorAddSubDiff")) { val.SetVector("_BaseColorAddSubDiff", Vector4.zero); } return val; } private static IEnumerable Parts(BeamView v) { return ((IEnumerable)(object)new Transform[5] { v.Beam, v.Core, v.Hit, v.HaloIn, v.HaloOut }).Concat(v.Streaks); } private void Beam(int who, Vector3 a, Vector3 b, float width, float heat) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (!_beams.TryGetValue(who, out var v) || !Object.op_Implicit((Object)(object)v.Beam)) { v = new BeamView { Sheath = BeamMat(), Glow = BeamMat(), HaloInMat = BossVfx.Wash(Color.white), HaloOutMat = BossVfx.Wash(Color.white) }; v.Beam = WeaponFx.Piece(WeaponFx.Cyl, v.Sheath); v.Core = WeaponFx.Piece(WeaponFx.Cyl, v.Glow); v.Hit = WeaponFx.Piece(WeaponFx.Cube, v.Glow); v.HaloIn = WeaponFx.Piece(WeaponFx.Cyl, v.HaloInMat); v.HaloOut = WeaponFx.Piece(WeaponFx.Cyl, v.HaloOutMat); v.Streaks = (from _ in Enumerable.Range(0, 3) select WeaponFx.Piece(WeaponFx.Cyl, v.Glow)).ToArray(); foreach (Transform item in Parts(v)) { Object.DontDestroyOnLoad((Object)(object)((Component)item).gameObject); } _beams[who] = v; } v.A = a; v.B = b; v.Width = width; v.Heat = heat; v.Until = Time.time + 0.22f; } private void AnimateBeams(float now) { //IL_0196: 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_01a1: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0293: 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_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0330: 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_0367: Unknown result type (might be due to invalid IL or missing references) //IL_039d: 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_03a2: 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_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_0799: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_07ce: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) foreach (BeamView value in _beams.Values) { if (!Object.op_Implicit((Object)(object)value.Beam)) { continue; } bool flag = now <= value.Until; float num = value.Heat - 5f; bool flag2 = flag && num >= 0f; if (flag2 && value.Bands == null) { value.BandMats = (from _ in Enumerable.Range(0, 12) select BeamMat()).ToArray(); value.Bands = value.BandMats.Select((Material m) => WeaponFx.Piece(WeaponFx.Cyl, m)).ToArray(); Transform[] bands = value.Bands; for (int num2 = 0; num2 < bands.Length; num2++) { Object.DontDestroyOnLoad((Object)(object)((Component)bands[num2]).gameObject); } } foreach (Transform item in Parts(value)) { ((Component)item).gameObject.SetActive(flag && (!flag2 || !((Object)(object)item == (Object)(object)value.Beam))); } if (value.Bands != null) { Transform[] bands = value.Bands; for (int num2 = 0; num2 < bands.Length; num2++) { ((Component)bands[num2]).gameObject.SetActive(flag2); } } if (!flag) { continue; } Vector3 val = value.B - value.A; Quaternion val2 = Quaternion.FromToRotation(Vector3.up, (((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? val : Vector3.up); float num3 = 1f + 0.3f * Mathf.Sin(now * 47f) + 0.15f * Mathf.Sin(now * 83f); value.Beam.SetPositionAndRotation(value.A, val2); value.Beam.localScale = new Vector3(value.Width * num3, ((Vector3)(ref val)).magnitude, value.Width * num3); value.Core.SetPositionAndRotation(value.A + ((Vector3)(ref val)).normalized * 0.02f, val2); value.Core.localScale = new Vector3(value.Width * 0.35f, ((Vector3)(ref val)).magnitude, value.Width * 0.35f); value.Hit.SetPositionAndRotation(value.B, Quaternion.Euler(now * 900f, now * 700f, 0f)); value.Hit.localScale = Vector3.one * value.Width * 2.4f * num3; value.HaloIn.SetPositionAndRotation(value.A, val2); value.HaloIn.localScale = new Vector3(value.Width * 2.2f * num3, ((Vector3)(ref val)).magnitude, value.Width * 2.2f * num3); value.HaloOut.SetPositionAndRotation(value.A, val2); value.HaloOut.localScale = new Vector3(value.Width * 4f * num3, ((Vector3)(ref val)).magnitude, value.Width * 4f * num3); Color val3 = (flag2 ? Color.HSVToRGB(Mathf.Repeat(now * 0.5f, 1f), 0.8f, 1f) : HeatColour(value.Heat)); Color val4 = (flag2 ? Color.white : Color.Lerp(val3, Color.white, 0.5f)); value.Sheath.SetColor("_BaseColor", val3 * 0.15f); value.Sheath.SetColor("_EmissionColor", val3 * 3.2f); value.Glow.SetColor("_BaseColor", val4 * 0.15f); value.Glow.SetColor("_EmissionColor", val4 * 4.5f); value.HaloInMat.color = new Color(val3.r, val3.g, val3.b, 0.28f); Color val5 = (flag2 ? Color.HSVToRGB(Mathf.Repeat(now * 0.5f + 0.5f, 1f), 0.8f, 1f) : val3); value.HaloOutMat.color = new Color(val5.r, val5.g, val5.b, 0.1f); Vector3 normalized = ((Vector3)(ref val)).normalized; if (flag2) { float num4 = ((Vector3)(ref val)).magnitude / 12f; float num5 = 0.55f + 0.4f * num; float num6 = 0.6f + 1.4f * num; float num7 = 3.2f + 1.5f * num; for (int num8 = 0; num8 < 12; num8++) { value.Bands[num8].SetPositionAndRotation(value.A + normalized * num4 * (float)num8, val2); value.Bands[num8].localScale = new Vector3(value.Width * num3, num4, value.Width * num3); Color val6 = Color.HSVToRGB(Mathf.Repeat((float)num8 / 12f - now * num6, 1f), num5, 1f); value.BandMats[num8].SetColor("_BaseColor", val6 * 0.15f); value.BandMats[num8].SetColor("_EmissionColor", val6 * num7); } } float magnitude = ((Vector3)(ref val)).magnitude; float num9 = Mathf.Min(3f, magnitude * 0.5f); float num10 = magnitude + num9; for (int num11 = 0; num11 < value.Streaks.Length; num11++) { float num12 = Mathf.Repeat(now * 160f + (float)num11 * num10 / (float)value.Streaks.Length, num10); float num13 = Mathf.Max(0f, num12 - num9); float num14 = Mathf.Min(magnitude, num12); Transform obj = value.Streaks[num11]; ((Component)obj).gameObject.SetActive(num14 - num13 > 0.02f); obj.SetPositionAndRotation(value.A + normalized * num13, val2); obj.localScale = new Vector3(value.Width * 0.5f, num14 - num13, value.Width * 0.5f); } string[] array = new string[4] { "Red", "Green", "Blue", "Violet" }; WeaponFx.Emit(WeaponFx.Sparks((value.Heat >= 3.5f) ? (new string[5] { "Red", "Gold", "Green", "Cyan", "Violet" })[(int)(now * 20f) % 5] : array[Mathf.Clamp(Mathf.RoundToInt(value.Heat), 0, 3)]), value.B, 2, -normalized + Vector3.up * 0.5f); if (now >= value.NextFlash) { value.NextFlash = now + 0.07f; WeaponFx.Game("PistolFire", value.A, normalized); } if (now >= value.NextSmoke) { value.NextSmoke = now + 0.3f; WeaponFx.Game("SmallSmoke", value.B); WeaponFx.Emit(WeaponFx.Dust, value.B, 1, Vector3.up); } } } private static void Pop(Vector3 at, float size) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00af: 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) for (int i = 0; i < 18; i++) { WeaponFx.Emit(WeaponFx.Bubbles, at, 1, default(Vector3), null, Random.Range(0.12f, 0.28f) * size, Random.onUnitSphere * Random.Range(1.5f, 3.5f) * size, Random.Range(0.4f, 0.8f)); } WeaponFx.Emit(WeaponFx.Drops, at, Mathf.RoundToInt(10f * size), Vector3.up); WeaponFx.Game("WaterSplash", at); } private IEnumerator Lob(Transform shell, Vector3 a, Vector3 b, Action trail, bool tumble = true) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float next = 0f; Vector3 val = Vector3.Cross(b - a, Vector3.up); Vector3 spinAxis = ((Vector3)(ref val)).normalized; for (float t = 0f; t < 0.6f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)shell)) { break; } float num = t / 0.6f; shell.position = Vector3.Lerp(a, b, num) + Vector3.up * Mathf.Sin(num * MathF.PI) * 2.5f; if (tumble) { shell.Rotate(spinAxis, -900f * Time.deltaTime, (Space)0); } if (t >= next) { next = t + 0.02f; trail(shell.position); } yield return null; } if (Object.op_Implicit((Object)(object)shell)) { Object.Destroy((Object)(object)((Component)shell).gameObject); } } private IEnumerator GasView(Vector3 a, Vector3 b, float life) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = a - b; if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { Transform transform = new GameObject("FortressGasCan").transform; Vector3 fallbackSize = new Vector3(0.18f, 0.36f, 0.18f); val = default(Vector3); Models.Attach("GasCanister", transform, fallbackSize, val).transform.localScale = Vector3.one * 1.4f; yield return Lob(transform, a, b, delegate(Vector3 p) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) WeaponFx.Emit(WeaponFx.Gas, p, 1, default(Vector3), null, Random.Range(0.35f, 0.6f), Random.insideUnitSphere * 0.4f, 0.7f); }); } Fx.SoundRandom("BaitHitWater_V", 1, 3, b, 0.6f, (AudioDistance)2); float radius = ((life > 4f) ? 3f : 2f); float k = radius / 3f; _gasShown.RemoveAll((GasShown x) => Time.time > x.Until); bool flag = life <= 4f; GasShown gasShown = (flag ? _gasShown.FirstOrDefault(delegate(GasShown x) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (x.Burst) { Vector3 val2 = (b - x.At).Flat(); return ((Vector3)(ref val2)).sqrMagnitude <= x.Radius * x.Radius; } return false; }) : null); bool flag2 = _gasShown.Count >= (ClientSettings.Reduced ? 3 : 8); int num = 0; for (int num2 = ((gasShown != null || flag2) ? 8 : 24); num < num2; num++) { ParticleSystem gas = WeaponFx.Gas; Vector3 at = b + Vector3.up * 0.3f; val = default(Vector3); Vector3 dir = val; float size = Random.Range(0.8f, 1.5f) * k; val = Random.onUnitSphere.Flat(); WeaponFx.Emit(gas, at, 1, dir, null, size, (((Vector3)(ref val)).normalized * Random.Range(1.5f, 3.5f) + Vector3.up * Random.Range(0.3f, 1.2f)) * k, Random.Range(0.9f, 1.4f)); } WeaponFx.Emit(WeaponFx.Sparks("Green"), b + Vector3.up * 0.2f, 12, Vector3.up); WeaponFx.Emit(WeaponFx.Dust, b, 6, Vector3.up); if (gasShown != null) { gasShown.Until = Mathf.Max(gasShown.Until, Time.time + life); } else { if (flag2) { yield break; } GasShown shown = new GasShown { At = b, Radius = radius, Until = Time.time + life, Burst = flag }; _gasShown.Add(shown); float nextPuff = 0f; float nextBubble = 0f; float nextSkull = 0.8f; float t = 0f; while (Time.time < shown.Until) { if (shown.Until - Time.time < 1.2f) { yield return null; } else { if (t >= nextPuff) { nextPuff = t + 0.05f; Vector3 at2 = b + (Random.insideUnitCircle * radius * 0.85f).X0Y() + Vector3.up * Random.Range(0.3f, 1.3f); ParticleSystem gas2 = WeaponFx.Gas; val = default(Vector3); WeaponFx.Emit(gas2, at2, 1, val, null, Random.Range(1.2f, 2.3f) * k, Random.insideUnitSphere * 0.25f, Random.Range(1.4f, 2.4f)); } if (t >= nextBubble) { nextBubble = t + 0.15f; ParticleSystem bubbles = WeaponFx.Bubbles; Vector3 at3 = b + (Random.insideUnitCircle * radius * 0.7f).X0Y() + Vector3.up * 0.1f; val = default(Vector3); WeaponFx.Emit(bubbles, at3, 1, val, (Color?)new Color(0.7f, 1f, 0.45f), Random.Range(0.15f, 0.3f), (Vector3?)(Vector3.up * Random.Range(0.6f, 1.4f)), 1.2f); } if (t >= nextSkull) { nextSkull = t + 1.6f; Vector3 at4 = b + (Random.insideUnitCircle * radius * 0.5f).X0Y() + Vector3.up * 0.8f; val = default(Vector3); WeaponFx.Game("Skull", at4, val); } yield return null; } t += Time.deltaTime; } } } private IEnumerator NetView(Vector3 a, Vector3 b, float hold, float radius) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("FortressNetBall").transform; Models.Attach("NetBall", transform, Vector3.one * 0.5f); yield return Lob(transform, a, b, delegate(Vector3 p) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) WeaponFx.Emit(WeaponFx.Dust, p, 1, default(Vector3), (Color?)new Color(0.8f, 0.7f, 0.5f), 0.15f, (Vector3?)Vector3.zero, 0.4f); }); Fx.SoundRandom("BaitHitWater_V", 1, 3, b, 0.7f, (AudioDistance)2); WeaponFx.Emit(WeaponFx.Dust, b, 10, Vector3.up); float across = 2f * ((radius > 0f) ? radius : 3.5f); Transform net = new GameObject("FortressNet").transform; Models.Attach("NetSpread", net, new Vector3(1f, 0.05f, 1f)); net.position = b + Vector3.up * 0.06f; net.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); for (float t = 0f; t < 0.2f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)net)) { break; } net.localScale = Vector3.one * across * Mathf.Lerp(0.2f, 1f, t / 0.2f); yield return null; } if (Object.op_Implicit((Object)(object)net)) { net.localScale = Vector3.one * across; } yield return (object)new WaitForSeconds(Mathf.Max(0f, hold - 0.6f)); for (float t = 0f; t < 0.4f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)net)) { break; } net.localScale = Vector3.one * across * (1f - t / 0.4f); yield return null; } if (Object.op_Implicit((Object)(object)net)) { Object.Destroy((Object)(object)((Component)net).gameObject); } } private IEnumerator JellyView(Vector3 a, Vector3 b, float life) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform jelly = new GameObject("FortressJelly").transform; float size = ((life > 4f) ? 1.3f : 0.85f); Vector3 fallbackSize = Vector3.one * 0.5f; Vector3 fallbackOffset = default(Vector3); Models.Attach("Jellyfish", jelly, fallbackSize, fallbackOffset).transform.localScale = Vector3.one * size; Vector3 hang = b + Vector3.up * 1.3f; yield return LobKeep(jelly, a, hang); float nextZap = 0f; for (float t = 0f; t < life; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)jelly)) { break; } float num = 1f + 0.12f * Mathf.Sin(t * 5f); jelly.localScale = new Vector3(num, 2f - num, num); jelly.position = hang + Vector3.up * 0.15f * Mathf.Sin(t * 1.7f); jelly.Rotate(0f, 25f * Time.deltaTime, 0f); if (t >= nextZap) { nextZap = t + 0.3f; Vector3 val = b + (Random.insideUnitCircle * 3f * size * 0.75f).X0Y() + Vector3.up * 0.2f; ParticleSystem ps = WeaponFx.Bolts("Pink"); Vector3 at = Vector3.Lerp(jelly.position, val, 0.5f); fallbackOffset = val - jelly.position; WeaponFx.Emit(ps, at, 3, ((Vector3)(ref fallbackOffset)).normalized); WeaponFx.Emit(WeaponFx.Sparks("Pink"), val, 3, Vector3.up); } if (t > life - 0.4f) { jelly.localScale *= Mathf.Max(0.01f, (life - t) / 0.4f); } yield return null; } if (Object.op_Implicit((Object)(object)jelly)) { Object.Destroy((Object)(object)((Component)jelly).gameObject); } } private IEnumerator LobKeep(Transform t, Vector3 a, Vector3 b) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) for (float k = 0f; k < 1f; k += Time.deltaTime / 0.6f) { if (!Object.op_Implicit((Object)(object)t)) { break; } t.position = Vector3.Lerp(a, b, k) + Vector3.up * Mathf.Sin(k * MathF.PI) * 1.6f; yield return null; } if (Object.op_Implicit((Object)(object)t)) { t.position = b; } } private void WaterView(Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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) Vector3 val = b - a; for (int i = 0; i < 6; i++) { float value = Random.value; WeaponFx.Emit(WeaponFx.Drops, a + val * value + Random.insideUnitSphere * 0.08f, 1, default(Vector3), null, Random.Range(0.08f, 0.16f), ((Vector3)(ref val)).normalized * Random.Range(8f, 14f) + Random.insideUnitSphere, 0.35f); } WeaponFx.Emit(WeaponFx.Foam, b + Vector3.up * 0.1f, 3, Vector3.up); if (Random.value < 0.3f) { WeaponFx.Game("WaterSplash", b); } if (Time.time >= _nextSpraySound) { _nextSpraySound = Time.time + 0.35f; Fx.SoundRandom("ItemHitWaterLight_V", 1, 3, b, 0.6f, (AudioDistance)2); } } private IEnumerator PufferView(Vector3 a, Vector3 b, float fuse) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform puff = new GameObject("FortressPuffer").transform; Models.Attach("PufferBomb", puff, Vector3.one * 0.25f).transform.localScale = Vector3.one * 1.3f; yield return LobKeep(puff, a, b + Vector3.up * 0.3f); Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, b, 0.6f, (AudioDistance)2); for (float t = 0f; t < fuse; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)puff)) { break; } float num = t / fuse; puff.localScale = Vector3.one * Mathf.Lerp(1f, 3.2f, num * num); puff.position = b + Vector3.up * (0.3f + 0.4f * num) + Random.insideUnitSphere * 0.04f * num; puff.Rotate(0f, 200f * Time.deltaTime, 0f); yield return null; } if (Object.op_Implicit((Object)(object)puff)) { Object.Destroy((Object)(object)((Component)puff).gameObject); } } private static void PufferBurstView(Vector3 at) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00fc: 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_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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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) WeaponFx.Game("SmallExplosion", at + Vector3.up * 0.5f, Vector3.up); Fx.Sound("Explosion", at, 0.6f, (AudioDistance)3); Vector3 val; for (int i = 0; i < 24; i++) { ParticleSystem ps = WeaponFx.Sparks("Gold"); Vector3 at2 = at + Vector3.up * 0.6f; val = default(Vector3); Vector3 dir = val; val = Random.onUnitSphere.Flat(); WeaponFx.Emit(ps, at2, 1, dir, null, 0.12f, ((Vector3)(ref val)).normalized * Random.Range(8f, 13f) + Vector3.up * Random.Range(0f, 3f), 0.35f); } for (int j = 0; j < 14; j++) { ParticleSystem gas = WeaponFx.Gas; Vector3 at3 = at + Vector3.up * 0.4f; val = default(Vector3); Vector3 dir2 = val; float size = Random.Range(0.6f, 1.1f); val = Random.onUnitSphere.Flat(); WeaponFx.Emit(gas, at3, 1, dir2, null, size, ((Vector3)(ref val)).normalized * Random.Range(1f, 3f) + Vector3.up * 0.6f, 1f); } } private IEnumerator RocketView(Vector3 a, Vector3 b, float flight) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform rocket = new GameObject("FortressRocket").transform; Vector3 fallbackSize = new Vector3(0.12f, 0.12f, 0.5f); Vector3 val = default(Vector3); Models.Attach("RocketShell", rocket, fallbackSize, val); val = b - a; Vector3 val2; if (!(((Vector3)(ref val)).sqrMagnitude > 0.01f)) { val2 = Vector3.forward; } else { val = b - a; val2 = ((Vector3)(ref val)).normalized; } Vector3 dir = val2; rocket.rotation = Quaternion.LookRotation(dir); float nextPuff = 0f; for (float t = 0f; t < flight; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)rocket)) { break; } rocket.position = Vector3.Lerp(a, b, t / flight); rocket.Rotate(0f, 0f, 720f * Time.deltaTime, (Space)1); if (t >= nextPuff) { nextPuff = t + 0.025f; Vector3 at = rocket.position - dir * 0.3f; WeaponFx.Emit(WeaponFx.Sparks("Orange"), at, 2, -dir); WeaponFx.Emit(WeaponFx.Dust, at, 1, -dir, (Color?)new Color(0.75f, 0.75f, 0.75f), Random.Range(0.35f, 0.6f), (Vector3?)(-dir * 0.6f + Random.insideUnitSphere * 0.4f), 0.9f); } yield return null; } if (Object.op_Implicit((Object)(object)rocket)) { Object.Destroy((Object)(object)((Component)rocket).gameObject); } WeaponFx.Game("SmallExplosion", b + Vector3.up * 0.3f, Vector3.up); Fx.Sound("Explosion", b, 0.55f, (AudioDistance)3); for (int i = 0; i < 16; i++) { ParticleSystem ps = WeaponFx.Sparks("Orange"); Vector3 at2 = b + Vector3.up * 0.4f; val = default(Vector3); WeaponFx.Emit(ps, at2, 1, val, null, 0.12f, Random.onUnitSphere * Random.Range(6f, 11f) + Vector3.up * 2f, 0.3f); } if (b.y <= WaterManager.GetWaterHeight(b) + 0.2f) { Vector3 at3 = b; val = default(Vector3); WeaponFx.Game("WaterSplash", at3, val); } } private IEnumerator StarView(Vector3 a, Vector3 b) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform star = new GameObject("FortressStar").transform; Vector3 fallbackSize = Vector3.one * 0.3f; Vector3 fallbackOffset = default(Vector3); Models.Attach("Starfish", star, fallbackSize, fallbackOffset).transform.localScale = Vector3.one * 1.4f; fallbackOffset = b - a; float time = Mathf.Clamp(((Vector3)(ref fallbackOffset)).magnitude / 40f, 0.08f, 0.4f); for (float t = 0f; t < time; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)star)) { break; } star.position = Vector3.Lerp(a, b, t / time); fallbackOffset = b - a; star.rotation = Quaternion.LookRotation(((Vector3)(ref fallbackOffset)).normalized) * Quaternion.Euler(90f, 0f, t * 2400f); yield return null; } if (Object.op_Implicit((Object)(object)star)) { Object.Destroy((Object)(object)((Component)star).gameObject); } WeaponFx.Emit(WeaponFx.Sparks("Orange"), b, 6, Vector3.up); } private IEnumerator ClawView(Func muzzle, Vector3 b, int fishId) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 a = muzzle(); Transform claw = new GameObject("FortressClawShot").transform; Vector3 fallbackSize = new Vector3(0.12f, 0.12f, 0.45f); Vector3 fallbackOffset = default(Vector3); Models.Attach("LobsterClaw", claw, fallbackSize, fallbackOffset).transform.localScale = Vector3.one * 1.6f; WeaponFx.Rope rope = new WeaponFx.Rope(18, 0.05f); rope.Start(a, a); fallbackOffset = b - a; float outTime = Mathf.Clamp(((Vector3)(ref fallbackOffset)).magnitude / 60f, 0.05f, 0.45f); for (float t = 0f; t < outTime; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)claw)) { break; } Vector3 val = Vector3.Lerp(a, b, t / outTime); claw.SetPositionAndRotation(val, Quaternion.LookRotation(b - a)); rope.Step(muzzle(), val - claw.forward * 0.25f, 0.1f); yield return null; } Fx.SoundRandom("KnifeHit_0", 1, 4, b, 0.9f, (AudioDistance)2); WeaponFx.Emit(WeaponFx.Sparks("Orange"), b, (fishId != 0) ? 10 : 4, Vector3.up); if (fishId != 0) { WeaponFx.Game("BloodSmall", b, Vector3.up); ((MonoBehaviour)this).StartCoroutine(FlungView(fishId)); } else { WeaponFx.Emit(WeaponFx.Dust, b, 3, Vector3.up); } for (float t = 0f; t < 0.2f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)claw)) { break; } rope.Step(b: (claw.position = Vector3.Lerp(b, muzzle(), t * t / 0.04f)) - claw.forward * 0.25f, a: muzzle(), slack: 0.2f); yield return null; } if (Object.op_Implicit((Object)(object)claw)) { Object.Destroy((Object)(object)((Component)claw).gameObject); } rope.Destroy(); } private IEnumerator FlungView(int fishId) { for (float t = 0f; t < 0.6f; t += 0.03f) { Transform val = FishView(fishId); if (Object.op_Implicit((Object)(object)val)) { WeaponFx.Emit(WeaponFx.Drops, val.position + Vector3.up * 0.5f, 2, Vector3.up); } yield return (object)new WaitForSeconds(0.03f); } } private IEnumerator BoomerangView(Vector3 a, Vector3 b) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) GameObject root = new GameObject("FortressBoomerang"); Models.Attach("Boomerang", root.transform, new Vector3(0.6f, 0.08f, 0.2f)); float next = 0f; for (float t = 0f; t < 1.1f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)root)) { break; } Vector3 val = BoomerangAt(a, b, t); root.transform.position = val; root.transform.rotation = Quaternion.Euler(0f, t * 1300f, 0f); if (t >= next) { next = t + 0.015f; Vector3 at = val + root.transform.right * 0.3f; Vector3 forward = root.transform.forward; WeaponFx.Emit(WeaponFx.Drops, at, 1, default(Vector3), null, -1f, forward * 3f + Vector3.up, 0.5f); WeaponFx.Emit(WeaponFx.Foam, val, 1, default(Vector3), null, Random.Range(0.18f, 0.3f), Vector3.zero, 0.25f); } yield return null; } if (Object.op_Implicit((Object)(object)root)) { Fx.Sound("PickupWhoosh", root.transform.position, 0.7f, (AudioDistance)2); WeaponFx.Emit(WeaponFx.Drops, root.transform.position, 10, Vector3.up); Object.Destroy((Object)(object)root); } } private IEnumerator BubbleView(Vector3 a, Vector3 b, int fishId, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform shot = WeaponFx.Billboard((Texture)(object)WeaponFx.BubbleTex, "Bubble", Color.white); float next = 0f; for (float t = 0f; t < 0.3f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)shot)) { break; } shot.position = Vector3.Lerp(a, b, t / 0.3f) + Vector3.up * Mathf.Sin(t * 26f) * 0.06f; WeaponFx.Face(shot); float num = Mathf.Sin(t * 38f) * 0.12f; shot.localScale = new Vector3(1f + num, 1f - num, 1f) * 0.55f; if (t >= next) { next = t + 0.02f; WeaponFx.Emit(WeaponFx.Bubbles, shot.position, 1, default(Vector3), null, Random.Range(0.1f, 0.2f), Random.insideUnitSphere * 0.6f + Vector3.up * 0.4f, 0.6f); } yield return null; } if (Object.op_Implicit((Object)(object)shot)) { Object.Destroy((Object)(object)((Component)shot).gameObject); } Transform fish = FishView(fishId); if (!Object.op_Implicit((Object)(object)fish)) { Pop(b, 0.6f); yield break; } float size = 2f * Mathf.Max(0.6f, fish.localScale.y); Transform bubble = WeaponFx.Billboard((Texture)(object)WeaponFx.BubbleTex, "Bubble", Color.white); next = 0f; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)fish)) { break; } if (!Object.op_Implicit((Object)(object)bubble)) { break; } bubble.position = fish.position + Vector3.up * 0.6f * fish.localScale.y; WeaponFx.Face(bubble); float num2 = Mathf.Sin(t * 5f) * 0.05f; bubble.localScale = new Vector3(1f + num2, 1f - num2, 1f) * size * Mathf.SmoothStep(0f, 1f, Mathf.Min(1f, t * 5f)); if (t >= next) { next = t + 0.2f; WeaponFx.Emit(WeaponFx.Bubbles, bubble.position + Random.insideUnitSphere * size * 0.4f, 1, default(Vector3), null, Random.Range(0.12f, 0.22f), Vector3.up * Random.Range(0.5f, 1f), 1.2f); } yield return null; } if (Object.op_Implicit((Object)(object)bubble)) { Fx.SoundRandom("ItemHitWaterLight_V", 1, 3, bubble.position, 0.8f, (AudioDistance)2); Pop(bubble.position, size * 0.6f); Object.Destroy((Object)(object)((Component)bubble).gameObject); } } private IEnumerator HookView(Func muzzle, Vector3 b, int fishId, bool item = false) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 a = muzzle(); Vector3 fallbackOffset = b - a; Vector3 val; if (!(((Vector3)(ref fallbackOffset)).sqrMagnitude > 0.0001f)) { val = Vector3.forward; } else { fallbackOffset = b - a; val = ((Vector3)(ref fallbackOffset)).normalized; } Vector3 dir = val; WeaponFx.Game("PistolFire", a, dir); Transform claw = new GameObject("FortressClaw").transform; Vector3 fallbackSize = new Vector3(0.12f, 0.12f, 0.4f); fallbackOffset = default(Vector3); Models.Attach("GrappleClaw", claw, fallbackSize, fallbackOffset).transform.localScale = Vector3.one * 1.5f; WeaponFx.Rope rope = new WeaponFx.Rope(18, 0.04f); rope.Start(a, a); Transform fish = FishView(fishId); Vector3 aim = (Object.op_Implicit((Object)(object)fish) ? (fish.position + Vector3.up * 0.5f) : b); fallbackOffset = aim - a; float outTime = Mathf.Clamp(((Vector3)(ref fallbackOffset)).magnitude / 60f, 0.1f, 0.35f); for (float t = 0f; t < outTime; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)claw)) { break; } Vector3 val2 = Vector3.Lerp(a, aim, t / outTime); claw.SetPositionAndRotation(val2, Quaternion.LookRotation(aim - a)); rope.Step(muzzle(), val2 - claw.forward * 0.3f, 0.12f); yield return null; } if (Object.op_Implicit((Object)(object)fish)) { Fx.Sound("CrabFishingRodReelIn", a, 0.8f, (AudioDistance)2); WeaponFx.Game("BulletHit", aim, -dir); if (!item) { WeaponFx.Game("BloodSmall", aim, Vector3.up); } WeaponFx.Emit(WeaponFx.Sparks("Gold"), aim, 10, -dir); for (float t = 0f; t < 0.75f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)fish)) { break; } if (!Object.op_Implicit((Object)(object)claw)) { break; } Vector3 val3 = fish.position + Vector3.up * 0.5f; claw.SetPositionAndRotation(val3, Quaternion.LookRotation(val3 - muzzle())); rope.Step(muzzle(), val3 - claw.forward * 0.3f, 0f); yield return null; } } else { WeaponFx.Game("BulletHit", aim, -dir); WeaponFx.Emit(WeaponFx.Sparks("Gold"), aim, 6, -dir); WeaponFx.Emit(WeaponFx.Dust, aim, 3, Vector3.up); for (float t = 0f; t < 0.12f; t += Time.deltaTime) { rope.Step(muzzle(), aim - claw.forward * 0.3f, 0.3f); yield return null; } for (float t = 0f; t < 0.35f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)claw)) { break; } rope.Step(b: (claw.position = Vector3.Lerp(aim, muzzle(), t * t / 0.122499995f)) - claw.forward * 0.3f, a: muzzle(), slack: 0.3f * (1f - t / 0.35f)); yield return null; } } if (Object.op_Implicit((Object)(object)claw)) { Object.Destroy((Object)(object)((Component)claw).gameObject); } rope.Destroy(); } private IEnumerator WhirlView(Vector3 a, Vector3 b, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 dir = b - a; Vector3 normalized = ((Vector3)(ref dir)).normalized; WeaponFx.Game("ShotgunFire", a, normalized); WeaponFx.Emit(WeaponFx.Drops, a, 10, normalized + Vector3.up * 0.3f); Transform transform = new GameObject("FortressWhirlOrb").transform; WeaponFx.Piece(WeaponFx.Ball, WeaponFx.Water("Orb", new Color(0.3f, 0.6f, 1f, 0.85f)), transform).localScale = Vector3.one * 0.45f; WeaponFx.Piece(WeaponFx.Cube, WeaponFx.Emissive("OrbCore", new Color(0.4f, 0.75f, 1f), 4f), transform).localScale = Vector3.one * 0.18f; yield return Lob(transform, a, b, delegate(Vector3 p) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) WeaponFx.Emit(WeaponFx.Drops, p, 1, default(Vector3), null, -1f, Random.insideUnitSphere * 1.5f); WeaponFx.Emit(WeaponFx.Foam, p, 1, default(Vector3), null, 0.25f, Vector3.zero, 0.3f); }); Fx.SoundRandom("ItemHitWaterHeavy_V", 1, 3, b, 0.9f, (AudioDistance)2); dir = default(Vector3); WeaponFx.Game("WaterExplosion", b, dir); dir = default(Vector3); WeaponFx.Game("WaterSplash", b, dir); Transform funnel = WeaponFx.Piece(WeaponFx.Funnel, WeaponFx.Water("Whirl", new Color(0.7f, 0.88f, 1f, 1f), (Texture)(object)WeaponFx.SpiralTex)); Transform inner = WeaponFx.Piece(WeaponFx.Funnel, WeaponFx.Water("WhirlInner", new Color(0.45f, 0.65f, 1f, 1f), (Texture)(object)WeaponFx.SpiralTex)); ParticleSystem foam = WeaponFx.Orbit(b + Vector3.up * 0.32f, 5.3999996f); float nextDrop = 0f; float spin = 0f; Vector3 val = default(Vector3); for (float t = 0f; t < seconds; t += Time.deltaTime) { float num = Mathf.SmoothStep(0f, 1f, Mathf.Min(1f, t * 2.5f)) * Mathf.SmoothStep(0f, 1f, Mathf.Min(1f, (seconds - t) * 2f)); spin += Time.deltaTime * 150f; if (Object.op_Implicit((Object)(object)funnel)) { funnel.SetPositionAndRotation(b + Vector3.up * 0.3f, Quaternion.Euler(0f, 0f - spin, 0f)); funnel.localScale = new Vector3(6f, 0.71999997f, 6f) * num; } if (Object.op_Implicit((Object)(object)inner)) { inner.SetPositionAndRotation(b + Vector3.up * 0.26f, Quaternion.Euler(0f, (0f - spin) * 1.7f + 40f, 0f)); inner.localScale = new Vector3(3.3000002f, 0.6f, 3.3000002f) * num; } if (Object.op_Implicit((Object)(object)foam)) { ((Component)foam).transform.localScale = Vector3.one * Mathf.Max(0.05f, num); } if (t > seconds - 0.6f && Object.op_Implicit((Object)(object)foam)) { EmissionModule emission = foam.emission; ((EmissionModule)(ref emission)).enabled = false; } if (t >= nextDrop && num > 0.5f) { nextDrop = t + 0.1f; float num2 = Random.value * MathF.PI * 2f; ((Vector3)(ref val))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); WeaponFx.Emit(WeaponFx.Drops, b + val * 6f * num + Vector3.up * 0.3f, 3, val + Vector3.up * 1.5f); } yield return null; } if (Object.op_Implicit((Object)(object)funnel)) { Object.Destroy((Object)(object)((Component)funnel).gameObject); } if (Object.op_Implicit((Object)(object)inner)) { Object.Destroy((Object)(object)((Component)inner).gameObject); } if (Object.op_Implicit((Object)(object)foam)) { Object.Destroy((Object)(object)((Component)foam).gameObject, 1.8f); } dir = default(Vector3); WeaponFx.Game("WaterSplash", b, dir); } private IEnumerator SonicView(Vector3 a, Vector3 b, float half) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (b - a).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; if (((Vector3)(ref dir)).sqrMagnitude < 0.01f) { yield break; } val = (b - a).Flat(); float reach = Mathf.Max(1f, ((Vector3)(ref val)).magnitude); float end = 2f * reach * Mathf.Tan(Mathf.Min(80f, half) * (MathF.PI / 180f)); WeaponFx.Emit(WeaponFx.Notes, a + dir * 0.4f, 12, dir); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(a, Vector3.down, ref val2, 3f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { for (int i = 1; i <= 4; i++) { WeaponFx.Emit(WeaponFx.Dust, ((RaycastHit)(ref val2)).point + dir * (float)i * 1.8f, 3, dir + Vector3.up); } } for (int j = 0; j < 4; j++) { WeaponFx.Emit(WeaponFx.Rings, a + dir * 0.4f, 1, dir, null, end, dir * (reach / 0.48f), 0.48f); yield return (object)new WaitForSeconds(0.07f); } } private void OnSharkFx(FxEvent e) { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_010e: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_0038: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (e.Arg == 0) { if (_sharkViews.TryGetValue(e.PieceId, out (Transform, Vector3, Vector3, float) value) && Object.op_Implicit((Object)(object)value.Item1)) { WeaponFx.Game("WaterSplash", value.Item1.position); WeaponFx.Emit(WeaponFx.Foam, value.Item1.position, 10, Vector3.up); ((MonoBehaviour)this).StartCoroutine(Dive(value.Item1)); } _sharkViews.Remove(e.PieceId); return; } if (!_sharkViews.TryGetValue(e.PieceId, out (Transform, Vector3, Vector3, float) value2) || !Object.op_Implicit((Object)(object)value2.Item1)) { Transform transform = new GameObject("FortressShark").transform; Object.DontDestroyOnLoad((Object)(object)((Component)transform).gameObject); Models.Attach("Shark", transform, new Vector3(0.5f, 0.6f, 2f)); transform.position = e.From; value2.Item1 = transform; Fx.Sound("FishCaught_Splash", e.From, 0.9f, (AudioDistance)3); WeaponFx.Game("WaterExplosion", e.From); WeaponFx.Game("WaterSplash", e.From); } _sharkViews[e.PieceId] = (value2.Item1, e.From, e.To, Time.time); } private static IEnumerator Dive(Transform t) { for (float k = 0f; k < 1f; k += Time.deltaTime / 0.6f) { if (!Object.op_Implicit((Object)(object)t)) { break; } t.position += Vector3.down * Time.deltaTime * 2.5f; yield return null; } if (Object.op_Implicit((Object)(object)t)) { Object.Destroy((Object)(object)((Component)t).gameObject); } } private void Bullet(Vector3 a, Vector3 b) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_0090: Unknown result type (might be due to invalid IL or missing references) Shot shot; if (_shots.Count < 40) { shot = new Shot { T = WeaponFx.Piece(WeaponFx.Cyl, WeaponFx.Emissive("GatlingBullet", new Color(1f, 0.82f, 0.4f), 6f)) }; Object.DontDestroyOnLoad((Object)(object)((Component)shot.T).gameObject); _shots.Add(shot); } else { shot = _shots[_nextShot = (_nextShot + 1) % 40]; } shot.A = a; shot.B = b; shot.Start = Time.time; ((Component)shot.T).gameObject.SetActive(true); } private void AnimateBullets(float now) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00ca: 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_0101: Unknown result type (might be due to invalid IL or missing references) foreach (Shot shot in _shots) { if (Object.op_Implicit((Object)(object)shot.T) && ((Component)shot.T).gameObject.activeSelf) { Vector3 val = shot.B - shot.A; float magnitude = ((Vector3)(ref val)).magnitude; float num = (now - shot.Start) * 240f; float num2 = Mathf.Max(0f, num - 2.5f); if (num2 >= magnitude) { ((Component)shot.T).gameObject.SetActive(false); continue; } shot.T.SetPositionAndRotation(shot.A + val / Mathf.Max(0.0001f, magnitude) * num2, Quaternion.FromToRotation(Vector3.up, (magnitude > 0.0001f) ? val : Vector3.up)); shot.T.localScale = new Vector3(0.035f, Mathf.Max(0.01f, Mathf.Min(magnitude, num) - num2), 0.035f); } } } private void GatlingViews(bool firing) { float deltaTime = Time.deltaTime; float num = Mathf.Max(0.15f, 1.2f - WeaponMods.TraitAdd(Gear.Gatling, (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.ClientVault : null)?.ModOf(Loot.MyKey, Gear.Gatling, 2) ?? 0)); _mySpin = (firing ? Mathf.Min(1f, _mySpin + deltaTime / num) : Mathf.Max(0f, _mySpin - deltaTime / 1.5f)); foreach (Player player in PlayerManager.Players) { Item item = ((Object.op_Implicit((Object)(object)player) && Object.op_Implicit((Object)(object)player.Holding)) ? player.Holding.HeldItem : null); if (!WeaponItems.Is(item, out var g, out var _) || g != Gear.Gatling) { continue; } Transform val = WeaponItems.ModelOf(item); if (val == null) { continue; } Transform val2 = val.Find("GatlingSpin"); if (val2 != null) { (float, float) value; float num2 = (((Object)(object)player == (Object)(object)Player.LocalPlayer) ? _mySpin : (_spins.TryGetValue(((NetworkBehaviour)player).ObjectId, out value) ? Mathf.Max(0f, value.Item1 - (Time.time - value.Item2) / 1.5f) : 0f)); if (num2 > 0f) { val2.Rotate(0f, 0f, num2 * 1100f * deltaTime, (Space)1); } } } } private void AnimateViews() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00d9: 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_010b: 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_0129: 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_0132: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_0188: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01ae: 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_01bd: 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_01d4: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0261: 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) float time = Time.time; AnimateBeams(time); AnimateBullets(time); bool flag = time >= _nextWake; if (flag) { _nextWake = time + 0.04f; } foreach (KeyValuePair item in _sharkViews.ToList()) { var (val, val2, val3, num) = item.Value; if (!Object.op_Implicit((Object)(object)val) || time - num > 2f) { if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val).gameObject); } _sharkViews.Remove(item.Key); continue; } Vector3 val4 = Vector3.MoveTowards(val.position, val2, Time.deltaTime * 7f * 1.5f); val4.y = WaterManager.GetWaterHeight(val4) + 0.1f + Mathf.Sin(time * 3f + (float)item.Key) * 0.06f; Vector3 dir = val4 - val.position; bool flag2 = ((Vector3)(ref dir)).sqrMagnitude > 1E-05f; val.position = val4; Vector3 val5 = (val3 - val4).Flat(); if (((Vector3)(ref val5)).sqrMagnitude > 0.01f) { val.rotation = Quaternion.Slerp(val.rotation, Quaternion.LookRotation(val5), Time.deltaTime * 6f); } if (flag && flag2) { Vector3 val6 = -val.forward; Vector3 right = val.right; for (int i = -1; i <= 1; i += 2) { ParticleSystem foam = WeaponFx.Foam; Vector3 at = val4 + val.forward * 0.6f + right * (float)i * 0.3f; dir = default(Vector3); WeaponFx.Emit(foam, at, 1, dir, null, Random.Range(0.4f, 0.7f), (val6 * 0.8f + right * (float)i) * 1.6f, 1.1f); } if (Random.value < 0.35f) { WeaponFx.Emit(WeaponFx.Drops, val4 + val.forward * 0.9f, 2, Vector3.up + right * Random.Range(-1f, 1f)); } } } } private void ClearViews() { foreach (BeamView value in _beams.Values) { Transform[] array = (Transform[])(object)new Transform[3] { value.Beam, value.Core, value.Hit }; foreach (Transform val in array) { if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } _beams.Clear(); foreach (var value2 in _sharkViews.Values) { if (Object.op_Implicit((Object)(object)value2.t)) { Object.Destroy((Object)(object)((Component)value2.t).gameObject); } } _sharkViews.Clear(); if (Object.op_Implicit((Object)(object)WeaponFx.Instance)) { WeaponFx.Instance.Clear(); } Holster(); } private void UpdateNetView() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_01e0: 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) Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera)) { if (!Object.op_Implicit((Object)(object)_netView)) { BuildNetView(); } if ((Object)(object)_netView.transform.parent != (Object)(object)((Component)curCamera).transform) { _netView.transform.SetParent(((Component)curCamera).transform, false); } _netView.SetActive(true); int num; int num2; if (Object.op_Implicit((Object)(object)FortressNet.Instance)) { (num, num2, _) = FortressNet.Instance.ClientNet; } else { num = 0; num2 = 5; } int num3 = ((num2 >= FortressNet.Capacity[2]) ? 2 : ((num2 >= FortressNet.Capacity[1]) ? 1 : 0)); float num4 = ((num2 > 0) ? Mathf.Clamp01((float)num / (float)num2) : 0f); _netView.transform.localScale = Vector3.one * (1f + 0.2f * (float)num3); _bag.localScale = new Vector3(1f + 0.08f * num4, 1f + 0.4f * num4, 1f + 0.08f * num4); while (_catch.Count > num) { DropCatch(_catch.Count - 1); } while (_catch.Count < Mathf.Min(num, 12)) { AddCatch(null); } _swing = Mathf.MoveTowards(_swing, 0f, Time.deltaTime * 3.2f); float num5 = Mathf.Sin(_swing * MathF.PI); float num6 = Mathf.Sin(Time.time * 2.2f) * 0.006f; _netView.transform.localPosition = new Vector3(0.3f, -0.3f + num6 - num5 * 0.12f, 0.45f + num5 * 0.25f); _netView.transform.localRotation = Quaternion.Euler(-10f + num5 * 55f, -12f, 0f); } } private void BuildNetView() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_008c: 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_00c8: 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) //IL_00e2: 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_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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) _netView = new GameObject("FortressNetView"); Object.DontDestroyOnLoad((Object)(object)_netView); Models.Attach("HandNet", _netView.transform, new Vector3(0.05f, 0.05f, 0.8f), new Vector3(0f, 0f, 0.4f)); GameObject obj = Models.Attach("HandNetBag", _netView.transform, new Vector3(0.4f, 0.4f, 0.35f), new Vector3(0f, -0.3f, 0.9f)); _bag = new GameObject("Bag").transform; _bag.SetParent(_netView.transform, false); _bag.localPosition = NetHoop; _bag.localRotation = Quaternion.FromToRotation(Vector3.down, NetHang); obj.transform.SetParent(_bag, true); _contents = new GameObject("Catch").transform; _contents.SetParent(_netView.transform, false); _contents.localPosition = NetHoop + NetHang * 0.22f; _contents.localRotation = _bag.localRotation; Renderer[] componentsInChildren = _netView.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].shadowCastingMode = (ShadowCastingMode)0; } } private void AddCatch(Transform source) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_contents) && _catch.Count < 12) { GameObject val = new GameObject("Fish"); val.transform.SetParent(_contents, false); Mesh val2 = null; SkinnedMeshRenderer val3 = (Object.op_Implicit((Object)(object)source) ? ((Component)source).GetComponentInChildren() : null); MeshFilter val4 = ((Object.op_Implicit((Object)(object)source) && !Object.op_Implicit((Object)(object)val3)) ? ((Component)source).GetComponentInChildren() : null); if (Object.op_Implicit((Object)(object)val3)) { val2 = new Mesh(); val3.BakeMesh(val2); Mount(val, val2, ((Renderer)val3).sharedMaterials); } else if (Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.sharedMesh) && Object.op_Implicit((Object)(object)((Component)val4).GetComponent())) { Mount(val, val4.sharedMesh, ((Renderer)((Component)val4).GetComponent()).sharedMaterials); } else { Models.Attach("NetFish", val.transform, new Vector3(0.06f, 0.05f, 0.2f)); } int count = _catch.Count; float num = (float)count * 137.5f * (MathF.PI / 180f); float num2 = 0.02f + 0.01f * (float)count; val.transform.localPosition = new Vector3(Mathf.Cos(num) * num2, -0.09f + 0.022f * (float)count, Mathf.Sin(num) * num2); val.transform.localRotation = Quaternion.Euler(Random.Range(-25f, 25f), Random.Range(0f, 360f), Random.Range(70f, 110f)); Renderer[] componentsInChildren = val.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].shadowCastingMode = (ShadowCastingMode)0; } _catch.Add((val, val2)); } } private static void Mount(GameObject go, Mesh mesh, Material[] mats) { //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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a2: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Mesh"); val.transform.SetParent(go.transform, false); val.AddComponent().sharedMesh = mesh; ((Renderer)val.AddComponent()).sharedMaterials = mats; Bounds bounds = mesh.bounds; float num = 0.18f / Mathf.Max(0.01f, Mathf.Max(((Bounds)(ref bounds)).size.x, Mathf.Max(((Bounds)(ref bounds)).size.y, ((Bounds)(ref bounds)).size.z))); val.transform.localScale = Vector3.one * num; val.transform.localPosition = -((Bounds)(ref bounds)).center * num; } private void DropCatch(int i) { var (val, val2) = _catch[i]; if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)val); } if (Object.op_Implicit((Object)(object)val2)) { Object.Destroy((Object)(object)val2); } _catch.RemoveAt(i); } private void HandleNetMouse() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) Mouse current = Mouse.current; if (current != null && current.leftButton.wasPressedThisFrame && (int)Cursor.lockState == 1 && !ChatManager.IsTyping && !(Time.time < _nextSwing)) { _nextSwing = Time.time + 0.45f; _swing = 1f; Fx.Sound("PunchSwoosh", Player.LocalPlayer.Transform.position, 0.6f, (AudioDistance)1); Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera) && InstanceFinder.IsClientStarted) { InstanceFinder.ClientManager.Broadcast(new NetSwing { Origin = ((Component)curCamera).transform.position, Dir = ((Component)curCamera).transform.forward }, (Channel)0); } } } public bool OnScoop(FxEvent e) { if (!Object.op_Implicit((Object)(object)Player.LocalPlayer) || e.Who != ((NetworkBehaviour)Player.LocalPlayer).ObjectId || !NetOut || !Object.op_Implicit((Object)(object)_contents)) { return false; } AddCatch(FishView(e.PieceId)); return true; } private void NetHud() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0132: 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) int num; int num2; int num3; if (Object.op_Implicit((Object)(object)FortressNet.Instance)) { (num, num2, num3) = FortressNet.Instance.ClientNet; } else { num = 0; num2 = 5; num3 = 0; } string text = Hud.Keys(string.Format("{0} {1}/{2} ${4}\u3000{5}", L10n.T("netTitle"), num, num2, Hud.Hex(Hud.Gold), num3, L10n.T("netKeys", NetKey.Value))); if (((TMP_Text)_hudText).text != text) { ((TMP_Text)_hudText).text = text; ((Graphic)_hud).rectTransform.sizeDelta = new Vector2(Mathf.Max(460f, ((TMP_Text)_hudText).GetPreferredValues(text).x + 48f) + 64f, 70f); } float v = ((num2 > 0) ? ((float)num / (float)num2) : 0f); _hudBar.Set(v, (num >= num2) ? Hud.Bad : Hud.Accent); } public string DebugState(Vector3 at) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return string.Format("clouds {0} [{1}], poisoned {2} [{3}], ", _clouds.Count, string.Join(", ", _clouds.Select(delegate(Cloud c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (c.At - at).Flat(); return $"{((Vector3)(ref val)).magnitude:F1}m"; })), _poison.Count, string.Join(", ", _poison.Values.Select((Poison p) => p.Stacks))) + string.Format("sharks {0} [{1}], vortices {2}", _sharks.Count, string.Join(", ", _sharks.Select(delegate(Shark s) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (s.Pos - at).Flat(); object arg = ((Vector3)(ref val)).magnitude; val = (s.Pos - (Object.op_Implicit((Object)(object)FortressIsland.Instance) ? FortressIsland.Instance.Center : Vector3.zero)).Flat(); return $"{arg:F1}m from, {((Vector3)(ref val)).magnitude:F1}m out"; })), _vortices.Count); } public void DebugNet(bool on) { if (on) { Draw(net: true); } else { Holster(back: true); } } public void DebugForgetHeld() { _heldModelOf = null; } } [HarmonyPatch(typeof(Weapon), "SecondaryInput")] internal static class AbsorberNoAim { private static bool Prefix(Weapon __instance) { if (WeaponItems.Is((Item)(object)__instance, out var g, out var _)) { return g != Gear.Absorber; } return true; } } internal static class BossMoves { private class Tentacle { private readonly BossVfx.Tube _tube = new BossVfx.Tube(BossVfx.Solid(new Color(0.55f, 0.06f, 0.12f))); private readonly List _suckers = new List(); private readonly Vector3[] _path = (Vector3[])(object)new Vector3[12]; public readonly float Length; public readonly float Seed; public Tentacle(float length) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) Length = length; Seed = Random.value * 10f; for (int i = 0; i < 6; i++) { Transform item = WeaponFx.Piece(WeaponFx.Ball, BossVfx.Solid(new Color(1f, 0.65f, 0.65f))); _suckers.Add(item); } } public void Pose(Vector3 root, Vector3 toward, float rise, float lash, float t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00d3: 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) //IL_00e2: 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_00ec: 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_010d: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_01db: 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) Vector3 val = (toward - root).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(Vector3.up, normalized); for (int i = 0; i < _path.Length; i++) { float num = (float)i / (float)(_path.Length - 1); float num2 = Mathf.Lerp(Mathf.Sin(num * MathF.PI * 0.55f) * Length * 0.85f, 0.4f + Mathf.Sin(num * MathF.PI) * 2f, lash); float num3 = Mathf.Lerp(num * Length * 0.25f - num * num * Length * 0.3f, num * Length, lash); Vector3 val3 = val2 * Mathf.Sin(t * 2.4f + Seed + num * 3f) * num * 1.2f; _path[i] = root + Vector3.up * (num2 * rise - (1f - rise) * 3f) + normalized * num3 + val3; } _tube.Set(_path, 0.75f, 0.06f); for (int j = 0; j < _suckers.Count; j++) { int num4 = 2 + j; Vector3 val4 = _path[num4]; val = Vector3.Cross(_path[num4 + 1] - val4, val2); Vector3 normalized2 = ((Vector3)(ref val)).normalized; _suckers[j].position = val4 + normalized2 * Mathf.Lerp(0.7f, 0.1f, (float)num4 / 11f); _suckers[j].localScale = Vector3.one * Mathf.Lerp(0.38f, 0.12f, (float)num4 / 11f); } } public void Destroy() { _tube.Destroy(); foreach (Transform sucker in _suckers) { if (Object.op_Implicit((Object)(object)sucker)) { Object.Destroy((Object)(object)((Component)sucker).gameObject); } } } } private static readonly Color[] Rainbow = (Color[])(object)new Color[5] { new Color(1f, 0.25f, 0.2f), new Color(1f, 0.75f, 0.2f), new Color(0.35f, 1f, 0.4f), new Color(0.3f, 0.6f, 1f), new Color(0.75f, 0.4f, 1f) }; private static BossFx H; private static readonly Color Sand = new Color(0.86f, 0.76f, 0.55f); private static readonly Color Basalt = new Color(0.2f, 0.21f, 0.19f); private static readonly Color Venom = new Color(0.5f, 1f, 0.3f); private static readonly Color Gold = new Color(1f, 0.8f, 0.3f); private static readonly Color Pink = new Color(1f, 0.35f, 0.85f); private static readonly Color Violet = new Color(0.22f, 0.06f, 0.28f); private static readonly Color Cyan = new Color(0.4f, 1f, 1f); private static readonly Color Crimson = new Color(0.62f, 0.05f, 0.12f); private static readonly Color Water = new Color(0.5f, 0.78f, 1f); private static readonly Color Fire = new Color(1f, 0.5f, 0.12f); private static readonly Color Blood = new Color(1f, 0.08f, 0.12f); private static readonly Color Shadow = new Color(0.35f, 0.02f, 0.16f); private static readonly Color Iron = new Color(0.32f, 0.32f, 0.34f); private static readonly Color Stone = new Color(0.55f, 0.55f, 0.52f); private static readonly Color Pixel = new Color(0.4f, 1f, 0.6f); private static readonly Dictionary Lanterns = new Dictionary(); private static readonly Dictionary Holding = new Dictionary(); public static bool PlayAbsorber(BossFx host, FxEvent e) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: 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_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) H = host; Vector3 a = e.From; Vector3 to = e.To; switch (e.Key) { case "suck": SuckIn(a, to); break; case "shot": Run(ItemShot(a, to, (byte)e.PieceId)); break; case "warden": Run(Streak(a - Vector3.up * 0.6f, to - Vector3.up * 0.6f, 0.1f, Iron, 0.18f)); BossVfx.Impact(to, 1.6f, Fire, Sand, scar: false); BossFx.Burst(to + Vector3.up * 0.4f, "Orange", 28, 0.12f); Sound("SpiderCrabSnip_V", 1, 3, to, 1f); Sound("MetallicItemImpact_V", 1, 3, to, 0.9f); Shake(to, 0.2f); break; case "urchin": Needles(a, to, Mathf.Max(1, e.PieceId)); break; case "angler": Run(Lantern(a, to)); break; case "steed": BossVfx.Impact(a, 2.4f, Gold, Sand); BossVfx.Shock(a, 5.5f, Gold, 0.55f, 0.85f); BossVfx.Spires(Circle(a, 3.6f, 10), 1.3f, Sand * 0.9f, new Color(0f, 0f, 0f, 0f), 0.6f, 0f); BossFx.Burst(a + Vector3.up, "Gold", 30, 0.14f); Sound("ItemImpactHeavy_V", 1, 3, a, 1f); Sound("BoatLandCollisionMedium_V", 1, 3, a, 0.7f); Shake(a, 0.35f); break; case "stone": BossVfx.Spires(Line(a, to, 1.2f, 0.4f), 2.2f, Basalt, Venom, 1.4f); BossVfx.Shock(a, 3f, Venom, 0.4f); Fx.Sound("LavaEruption_01", a, 0.7f, (AudioDistance)3); break; case "sky": { Run(Streak(a, to, 0.3f, Color.white, 0.7f)); ParticleSystem rings = WeaponFx.Rings; Vector3 at = a; Vector3 val = to - a; WeaponFx.Emit(rings, at, 1, ((Vector3)(ref val)).normalized, Color.white, 5f); Fx.Sound("PunchSwoosh", a, 1f, (AudioDistance)3); Sound("Seagull_V", 1, 11, a, 0.8f); break; } case "bomb": Explode(a, 2.6f); break; case "kraken": Run(Grasp(to, 3f)); break; case "voxel": Run(Selection(a, to, (float)e.PieceId / 100f, 0.8f)); Fx.Sound("TypingClick" + Random.Range(1, 4), a, 1f, (AudioDistance)3); break; case "voxelDelete": Run(Pixelate(a, to, (float)e.PieceId / 100f)); BossVfx.Flash(a + Vector3.up, 3f, Pixel, 0.2f); Fx.Sound("Error", a, 0.9f, (AudioDistance)3); break; case "koi": Run(Breath(a, to, (float)e.Arg / 1000f, 25)); Fx.Sound("FireLoop", a, 0.8f, (AudioDistance)3); break; case "eye": Run(Gaze(a, to)); break; case "spear": Run(Fly(a + Vector3.up * 30f + Random.insideUnitSphere.Flat() * 3f, a, BossVfx.Shard, BossVfx.Glow(Blood), new Vector3(0.6f, 2f, 0.6f), 0.55f, 0f, Blood, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) BossVfx.Impact(a, 1.4f, Blood, Basalt); Sound("ItemImpactHeavy_V", 1, 3, a, 0.7f); }, upright: true)); break; default: return false; } return true; } private static void SuckIn(Vector3 muzzle, Vector3 far) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) Vector3 val = far - muzzle; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude < 0.1f)) { val /= magnitude; Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; ParticleSystem ps = BossVfx.Sparks(new Color(0.85f, 0.95f, 1f)); for (int i = 0; i < 12; i++) { Vector3 val3 = muzzle + Quaternion.AngleAxis(Random.Range(-28f, 28f), Vector3.up) * Quaternion.AngleAxis(Random.Range(-18f, 18f), normalized) * val * Random.Range(1.2f, magnitude); Vector3 dir = muzzle - val3; Vector3? velocity = (muzzle - val3) / 0.3f; WeaponFx.Emit(ps, val3, 1, dir, null, 0.07f, velocity, 0.3f); } } } private static IEnumerator ItemShot(Vector3 a, Vector3 b, byte id) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform look = Weapons.LookOf(id, 0.55f); Vector3 val = b - a; float secs = Mathf.Max(0.08f, ((Vector3)(ref val)).magnitude / 35f); Fx.Sound("PunchSwoosh", a, 0.8f, (AudioDistance)2); for (float t = 0f; t < secs; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)look)) { break; } look.position = Vector3.Lerp(a, b, t / secs); look.rotation = Quaternion.Euler(t * 900f, t * 600f, 0f); yield return null; } if (Object.op_Implicit((Object)(object)look)) { Object.Destroy((Object)(object)((Component)look).gameObject); } BossFx.Burst(b, "Pink", 14, 0.08f); WeaponFx.Emit(WeaponFx.Dust, b, 4, Vector3.up); Sound("ItemImpactHeavy_V", 1, 3, b, 0.6f); } private static void Needles(Vector3 at, Vector3 ahead, int n) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (ahead - at).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; BossVfx.Flash(at, 2.4f, Pink, 0.2f); BossVfx.Shock(at - Vector3.up, 4f, Pink, 0.35f); Fx.Sound("Pufferfish", at, 1f, (AudioDistance)3); for (int i = 0; i < n; i++) { Vector3 end = at + Quaternion.AngleAxis(360f * (float)i / (float)n, Vector3.up) * normalized * 14f; Run(Fly(at, end, BossVfx.Spike, BossVfx.Glow(Pink, 3f), new Vector3(0.45f, 0.45f, 0.9f), 0.3f, 0.3f, Pink, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) BossVfx.Flash(end, 0.6f, Pink, 0.15f); })); } } private static IEnumerator Lantern(Vector3 from, Vector3 at) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 top = at + Vector3.up * 1.6f; Material mat = BossVfx.Glow(Cyan, 5f); yield return ((MonoBehaviour)H).StartCoroutine(Fly(from, top, WeaponFx.Ball, mat, Vector3.one * 0.45f, 0.35f, 1.5f, Cyan, null)); Transform lamp = WeaponFx.Piece(WeaponFx.Ball, mat); lamp.position = top; Fx.Sound("RadarPing", at, 1f, (AudioDistance)3); ParticleSystem motes = BossVfx.Sparks(Cyan); for (float t = 0f; t < 0.45f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)lamp)) { break; } lamp.localScale = Vector3.one * (0.45f + t * 1.2f); Vector3 val = at + Random.onUnitSphere * 7f; val.y = Mathf.Max(val.y, at.y + 0.3f); Vector3 at2 = val; Vector3 dir = top - val; Vector3? velocity = (top - val) * 2.5f; WeaponFx.Emit(motes, at2, 1, dir, null, 0.12f, velocity, 0.4f); yield return null; } if (Object.op_Implicit((Object)(object)lamp)) { Object.Destroy((Object)(object)((Component)lamp).gameObject); } BossVfx.Flash(top, 4f, Cyan, 0.35f); for (int i = 0; i < 3; i++) { WeaponFx.Emit(WeaponFx.Rings, top, 1, Random.onUnitSphere, Cyan, 5f + 3f * (float)i); } BossFx.Burst(top, "Cyan", 40, 0.14f); Fx.Sound("ShinyCreatureCaught_0" + Random.Range(1, 4), at, 1f, (AudioDistance)3); } private static IEnumerator Grasp(Vector3 at, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) List<(Tentacle t, Vector3 root)> arms = new List<(Tentacle, Vector3)>(); for (int i = 0; i < 3; i++) { Vector3 val = at + Quaternion.Euler(0f, (float)i * 120f + Random.Range(-15f, 15f), 0f) * Vector3.forward * 3.4f; val.y = BossFx.Ground(val) - 0.2f; arms.Add((new Tentacle(3.6f), val)); BossVfx.Impact(val, 1.2f, Crimson, Sand, scar: false); } BossVfx.Shock(at, 4.5f, Crimson, 0.45f); Sound("ItemHitWaterHeavy_V", 1, 3, at, 0.9f); for (float t = 0f; t < seconds + 0.5f; t += Time.deltaTime) { float rise = ((t < seconds) ? Mathf.Clamp01(t / 0.35f) : (1f - Mathf.Clamp01((t - seconds) / 0.5f))); float lash = Mathf.Clamp01((t - 0.3f) / 0.2f); foreach (var (tentacle, root) in arms) { tentacle.Pose(root, at, rise, lash, t); } yield return null; } foreach (var item in arms) { item.t.Destroy(); } } private static IEnumerator Gaze(Vector3 a, Vector3 b) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)H).StartCoroutine(Beam(a, b, Color.white, 0.45f, 0.7f)); Fx.Sound("Ignite", a, 1f, (AudioDistance)3); Fx.Sound("LavaWhaleNoise_0" + Random.Range(1, 5), b, 0.6f, (AudioDistance)3); Vector3 val = b - a; float len = ((Vector3)(ref val)).magnitude; for (int k = 0; k < 6; k++) { for (float num = 0f; num < len; num += 2.5f) { BossVfx.Burst(Vector3.Lerp(a, b, num / len) + Random.insideUnitSphere * 0.3f, Rainbow[(k + (int)(num / 2.5f)) % Rainbow.Length], 2, 0.08f); } yield return (object)new WaitForSeconds(0.1f); } BossVfx.Impact(b, 1.8f, Color.white, Basalt); } public static bool Play(BossFx host, FxEvent e) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_1681: Unknown result type (might be due to invalid IL or missing references) //IL_168d: Unknown result type (might be due to invalid IL or missing references) //IL_16a2: Unknown result type (might be due to invalid IL or missing references) //IL_16a9: Unknown result type (might be due to invalid IL or missing references) //IL_16be: Unknown result type (might be due to invalid IL or missing references) //IL_16d0: Unknown result type (might be due to invalid IL or missing references) //IL_16fa: Unknown result type (might be due to invalid IL or missing references) //IL_12a3: Unknown result type (might be due to invalid IL or missing references) //IL_12a9: Unknown result type (might be due to invalid IL or missing references) //IL_1979: Unknown result type (might be due to invalid IL or missing references) //IL_197f: Unknown result type (might be due to invalid IL or missing references) //IL_19b6: Unknown result type (might be due to invalid IL or missing references) //IL_19bb: Unknown result type (might be due to invalid IL or missing references) //IL_19c5: Unknown result type (might be due to invalid IL or missing references) //IL_19ca: Unknown result type (might be due to invalid IL or missing references) //IL_19cf: Unknown result type (might be due to invalid IL or missing references) //IL_19d4: Unknown result type (might be due to invalid IL or missing references) //IL_19de: Unknown result type (might be due to invalid IL or missing references) //IL_19e3: Unknown result type (might be due to invalid IL or missing references) //IL_19e9: Unknown result type (might be due to invalid IL or missing references) //IL_19f3: Unknown result type (might be due to invalid IL or missing references) //IL_1a11: Unknown result type (might be due to invalid IL or missing references) //IL_1a20: Unknown result type (might be due to invalid IL or missing references) //IL_0d4f: Unknown result type (might be due to invalid IL or missing references) //IL_0d60: Unknown result type (might be due to invalid IL or missing references) //IL_0d65: Unknown result type (might be due to invalid IL or missing references) //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d74: Unknown result type (might be due to invalid IL or missing references) //IL_14b9: Unknown result type (might be due to invalid IL or missing references) //IL_14be: Unknown result type (might be due to invalid IL or missing references) //IL_14c8: Unknown result type (might be due to invalid IL or missing references) //IL_14cd: Unknown result type (might be due to invalid IL or missing references) //IL_14e6: Unknown result type (might be due to invalid IL or missing references) //IL_1108: Unknown result type (might be due to invalid IL or missing references) //IL_183c: Unknown result type (might be due to invalid IL or missing references) //IL_107a: Unknown result type (might be due to invalid IL or missing references) //IL_1080: Unknown result type (might be due to invalid IL or missing references) //IL_108a: Unknown result type (might be due to invalid IL or missing references) //IL_1099: Unknown result type (might be due to invalid IL or missing references) //IL_10a3: Unknown result type (might be due to invalid IL or missing references) //IL_10b2: Unknown result type (might be due to invalid IL or missing references) //IL_10d6: Unknown result type (might be due to invalid IL or missing references) //IL_155f: Unknown result type (might be due to invalid IL or missing references) //IL_1565: Unknown result type (might be due to invalid IL or missing references) //IL_0d90: Unknown result type (might be due to invalid IL or missing references) //IL_0d9a: Unknown result type (might be due to invalid IL or missing references) //IL_0daf: Unknown result type (might be due to invalid IL or missing references) //IL_0dc7: Unknown result type (might be due to invalid IL or missing references) //IL_10eb: Unknown result type (might be due to invalid IL or missing references) //IL_13f9: Unknown result type (might be due to invalid IL or missing references) //IL_1403: Unknown result type (might be due to invalid IL or missing references) //IL_1434: Unknown result type (might be due to invalid IL or missing references) //IL_19a0: Unknown result type (might be due to invalid IL or missing references) //IL_0f06: Unknown result type (might be due to invalid IL or missing references) //IL_0f1e: Unknown result type (might be due to invalid IL or missing references) //IL_0f23: Unknown result type (might be due to invalid IL or missing references) //IL_0f38: Unknown result type (might be due to invalid IL or missing references) //IL_0f3e: Unknown result type (might be due to invalid IL or missing references) //IL_0f49: Unknown result type (might be due to invalid IL or missing references) //IL_0f60: Unknown result type (might be due to invalid IL or missing references) //IL_17d9: Unknown result type (might be due to invalid IL or missing references) //IL_17df: Unknown result type (might be due to invalid IL or missing references) //IL_17fb: Unknown result type (might be due to invalid IL or missing references) //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a69: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a7a: Unknown result type (might be due to invalid IL or missing references) //IL_0a91: Unknown result type (might be due to invalid IL or missing references) //IL_1856: Unknown result type (might be due to invalid IL or missing references) //IL_186a: Unknown result type (might be due to invalid IL or missing references) //IL_187b: Unknown result type (might be due to invalid IL or missing references) //IL_1894: Unknown result type (might be due to invalid IL or missing references) //IL_1899: Unknown result type (might be due to invalid IL or missing references) //IL_18c0: Unknown result type (might be due to invalid IL or missing references) //IL_0b8e: Unknown result type (might be due to invalid IL or missing references) //IL_0ba6: Unknown result type (might be due to invalid IL or missing references) //IL_0bbd: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_0a10: Unknown result type (might be due to invalid IL or missing references) //IL_144a: Unknown result type (might be due to invalid IL or missing references) //IL_1450: Unknown result type (might be due to invalid IL or missing references) //IL_0bfe: Unknown result type (might be due to invalid IL or missing references) //IL_1b13: Unknown result type (might be due to invalid IL or missing references) //IL_1b19: Unknown result type (might be due to invalid IL or missing references) //IL_0de2: Unknown result type (might be due to invalid IL or missing references) //IL_0de8: Unknown result type (might be due to invalid IL or missing references) //IL_0e00: Unknown result type (might be due to invalid IL or missing references) //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c40: Unknown result type (might be due to invalid IL or missing references) //IL_0c45: Unknown result type (might be due to invalid IL or missing references) //IL_0ccd: Unknown result type (might be due to invalid IL or missing references) //IL_0cd3: Unknown result type (might be due to invalid IL or missing references) //IL_0d01: Unknown result type (might be due to invalid IL or missing references) //IL_0d07: Unknown result type (might be due to invalid IL or missing references) //IL_12f7: Unknown result type (might be due to invalid IL or missing references) //IL_12fd: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_0f8f: Unknown result type (might be due to invalid IL or missing references) //IL_0f95: Unknown result type (might be due to invalid IL or missing references) //IL_134b: Unknown result type (might be due to invalid IL or missing references) //IL_0ed5: Unknown result type (might be due to invalid IL or missing references) //IL_0edb: Unknown result type (might be due to invalid IL or missing references) //IL_0aee: Unknown result type (might be due to invalid IL or missing references) //IL_0b03: Unknown result type (might be due to invalid IL or missing references) //IL_0b78: Unknown result type (might be due to invalid IL or missing references) //IL_150d: Unknown result type (might be due to invalid IL or missing references) //IL_151b: Unknown result type (might be due to invalid IL or missing references) //IL_1534: Unknown result type (might be due to invalid IL or missing references) //IL_1549: Unknown result type (might be due to invalid IL or missing references) //IL_161f: Unknown result type (might be due to invalid IL or missing references) //IL_1625: Unknown result type (might be due to invalid IL or missing references) //IL_1641: Unknown result type (might be due to invalid IL or missing references) //IL_1a42: Unknown result type (might be due to invalid IL or missing references) //IL_1a48: Unknown result type (might be due to invalid IL or missing references) //IL_1a5c: Unknown result type (might be due to invalid IL or missing references) //IL_1a6d: Unknown result type (might be due to invalid IL or missing references) //IL_1a72: Unknown result type (might be due to invalid IL or missing references) //IL_1a84: Unknown result type (might be due to invalid IL or missing references) //IL_1378: Unknown result type (might be due to invalid IL or missing references) //IL_1386: Unknown result type (might be due to invalid IL or missing references) //IL_1390: Unknown result type (might be due to invalid IL or missing references) //IL_13ba: Unknown result type (might be due to invalid IL or missing references) //IL_11dd: Unknown result type (might be due to invalid IL or missing references) //IL_11c0: Unknown result type (might be due to invalid IL or missing references) //IL_11f2: Unknown result type (might be due to invalid IL or missing references) //IL_11f8: Unknown result type (might be due to invalid IL or missing references) //IL_1811: Unknown result type (might be due to invalid IL or missing references) //IL_117b: Unknown result type (might be due to invalid IL or missing references) //IL_118c: Unknown result type (might be due to invalid IL or missing references) //IL_119c: Unknown result type (might be due to invalid IL or missing references) //IL_11a6: Unknown result type (might be due to invalid IL or missing references) //IL_1609: Unknown result type (might be due to invalid IL or missing references) //IL_0f75: Unknown result type (might be due to invalid IL or missing references) //IL_0f7f: Unknown result type (might be due to invalid IL or missing references) //IL_1362: Unknown result type (might be due to invalid IL or missing references) //IL_1582: Unknown result type (might be due to invalid IL or missing references) //IL_157b: Unknown result type (might be due to invalid IL or missing references) //IL_1334: Unknown result type (might be due to invalid IL or missing references) //IL_165c: Unknown result type (might be due to invalid IL or missing references) //IL_1661: Unknown result type (might be due to invalid IL or missing references) //IL_111d: Unknown result type (might be due to invalid IL or missing references) //IL_1123: Unknown result type (might be due to invalid IL or missing references) //IL_113e: Unknown result type (might be due to invalid IL or missing references) //IL_090a: Unknown result type (might be due to invalid IL or missing references) //IL_0910: Unknown result type (might be due to invalid IL or missing references) //IL_0922: Unknown result type (might be due to invalid IL or missing references) //IL_0937: Unknown result type (might be due to invalid IL or missing references) //IL_1467: Unknown result type (might be due to invalid IL or missing references) //IL_146d: Unknown result type (might be due to invalid IL or missing references) //IL_147e: Unknown result type (might be due to invalid IL or missing references) //IL_1483: Unknown result type (might be due to invalid IL or missing references) //IL_1488: Unknown result type (might be due to invalid IL or missing references) //IL_148e: Unknown result type (might be due to invalid IL or missing references) //IL_14a3: Unknown result type (might be due to invalid IL or missing references) //IL_1a99: Unknown result type (might be due to invalid IL or missing references) //IL_1a9f: Unknown result type (might be due to invalid IL or missing references) //IL_1aa9: Unknown result type (might be due to invalid IL or missing references) //IL_1abe: Unknown result type (might be due to invalid IL or missing references) //IL_1ac8: Unknown result type (might be due to invalid IL or missing references) //IL_1adc: Unknown result type (might be due to invalid IL or missing references) //IL_0fd6: Unknown result type (might be due to invalid IL or missing references) //IL_0fdc: Unknown result type (might be due to invalid IL or missing references) //IL_0ff5: Unknown result type (might be due to invalid IL or missing references) //IL_0ffa: Unknown result type (might be due to invalid IL or missing references) //IL_100f: Unknown result type (might be due to invalid IL or missing references) //IL_1019: Unknown result type (might be due to invalid IL or missing references) //IL_1033: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0fab: Unknown result type (might be due to invalid IL or missing references) //IL_0fc0: Unknown result type (might be due to invalid IL or missing references) //IL_115a: Unknown result type (might be due to invalid IL or missing references) //IL_1160: Unknown result type (might be due to invalid IL or missing references) //IL_1933: Unknown result type (might be due to invalid IL or missing references) //IL_1213: Unknown result type (might be due to invalid IL or missing references) //IL_1742: Unknown result type (might be due to invalid IL or missing references) //IL_1747: Unknown result type (might be due to invalid IL or missing references) //IL_1751: Unknown result type (might be due to invalid IL or missing references) //IL_1756: Unknown result type (might be due to invalid IL or missing references) //IL_175b: Unknown result type (might be due to invalid IL or missing references) //IL_1765: Unknown result type (might be due to invalid IL or missing references) //IL_176a: Unknown result type (might be due to invalid IL or missing references) //IL_1770: Unknown result type (might be due to invalid IL or missing references) //IL_1793: Unknown result type (might be due to invalid IL or missing references) //IL_179e: Unknown result type (might be due to invalid IL or missing references) //IL_17a8: Unknown result type (might be due to invalid IL or missing references) //IL_17b7: Unknown result type (might be due to invalid IL or missing references) //IL_13d0: Unknown result type (might be due to invalid IL or missing references) //IL_13e3: Unknown result type (might be due to invalid IL or missing references) //IL_1591: Unknown result type (might be due to invalid IL or missing references) //IL_159b: Unknown result type (might be due to invalid IL or missing references) //IL_15aa: Unknown result type (might be due to invalid IL or missing references) //IL_1671: Unknown result type (might be due to invalid IL or missing references) //IL_123e: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_0956: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Unknown result type (might be due to invalid IL or missing references) //IL_0971: Unknown result type (might be due to invalid IL or missing references) //IL_0976: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09bb: Unknown result type (might be due to invalid IL or missing references) //IL_0abc: Unknown result type (might be due to invalid IL or missing references) //IL_1319: Unknown result type (might be due to invalid IL or missing references) //IL_131f: Unknown result type (might be due to invalid IL or missing references) //IL_15dd: Unknown result type (might be due to invalid IL or missing references) //IL_15f3: Unknown result type (might be due to invalid IL or missing references) //IL_0be8: Unknown result type (might be due to invalid IL or missing references) //IL_1aea: Unknown result type (might be due to invalid IL or missing references) //IL_1af0: Unknown result type (might be due to invalid IL or missing references) //IL_1afb: Unknown result type (might be due to invalid IL or missing references) //IL_1065: Unknown result type (might be due to invalid IL or missing references) //IL_0b19: Unknown result type (might be due to invalid IL or missing references) //IL_0b1f: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: Unknown result type (might be due to invalid IL or missing references) //IL_0b47: Unknown result type (might be due to invalid IL or missing references) //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_195d: Unknown result type (might be due to invalid IL or missing references) //IL_1717: Unknown result type (might be due to invalid IL or missing references) //IL_172d: Unknown result type (might be due to invalid IL or missing references) //IL_1259: Unknown result type (might be due to invalid IL or missing references) //IL_125e: Unknown result type (might be due to invalid IL or missing references) //IL_1269: Unknown result type (might be due to invalid IL or missing references) //IL_1273: Unknown result type (might be due to invalid IL or missing references) //IL_128d: Unknown result type (might be due to invalid IL or missing references) //IL_0e15: Unknown result type (might be due to invalid IL or missing references) //IL_0e21: Unknown result type (might be due to invalid IL or missing references) //IL_0e26: Unknown result type (might be due to invalid IL or missing references) //IL_0e32: Unknown result type (might be due to invalid IL or missing references) //IL_0e3e: Unknown result type (might be due to invalid IL or missing references) //IL_0e53: Unknown result type (might be due to invalid IL or missing references) //IL_0e6b: Unknown result type (might be due to invalid IL or missing references) //IL_0e75: Unknown result type (might be due to invalid IL or missing references) //IL_0e8e: Unknown result type (might be due to invalid IL or missing references) //IL_0ea3: Unknown result type (might be due to invalid IL or missing references) //IL_0eba: Unknown result type (might be due to invalid IL or missing references) //IL_0c6f: Unknown result type (might be due to invalid IL or missing references) //IL_0c85: Unknown result type (might be due to invalid IL or missing references) //IL_0c8a: Unknown result type (might be due to invalid IL or missing references) //IL_0c95: Unknown result type (might be due to invalid IL or missing references) //IL_0c9a: Unknown result type (might be due to invalid IL or missing references) //IL_0ca4: Unknown result type (might be due to invalid IL or missing references) //IL_0ca9: Unknown result type (might be due to invalid IL or missing references) //IL_0cb3: Unknown result type (might be due to invalid IL or missing references) //IL_12cb: Unknown result type (might be due to invalid IL or missing references) //IL_12d1: Unknown result type (might be due to invalid IL or missing references) //IL_12dc: Unknown result type (might be due to invalid IL or missing references) //IL_1b2c: Unknown result type (might be due to invalid IL or missing references) H = host; Vector3 a = e.From; Vector3 b = e.To; float num = (float)e.Arg / 1000f; float num2 = (float)e.Who / 100f; Color c = BossFx.ColourOf(e.PieceId); switch (e.Key) { case "warden.rise": Erupt(a, num2, Sand); Sound("SpidercrabWalk_V", 1, 8, a, 1f); Sound("CrabSnip", a); break; case "warden.snap": BossVfx.Impact(a, 2.6f, Fire, Sand); BossFx.Burst(a + Vector3.up * 0.8f, "Orange", 40, 0.14f); Sound("MetallicItemImpact_V", 1, 3, a, 1f); Sound("SpiderCrabSnip_V", 1, 3, a, 1f); Shake(a, 0.4f); break; case "warden.swing": Sound("SpiderCrabSnip_V", 1, 3, a, 1f); break; case "warden.chain": Run(Chain(e.PieceId, e.Who, b, num)); Sound("MetallicItemImpact_V", 1, 3, b, 0.9f); break; case "warden.shell": Run(Shell(e.PieceId, num, c)); Sound("MetallicItemImpact_V", 1, 3, a, 1f); break; case "urchin.land": BossVfx.Impact(a, Mathf.Max(2f, num2 * 0.8f), Pink, Sand); Shake(a, 0.5f); Sound("ItemImpactHeavy_V", 1, 3, a, 1f); break; case "urchin.roll": Run(Roll(e.PieceId, num)); Fx.Sound("PufferfishRoll", a, 1f, (AudioDistance)3); break; case "urchin.bristle": Run(Throb(e.PieceId, num, 0.12f)); Run(Charge(e.PieceId, num, Pink)); Fx.Sound("Pufferfish", a, 1f, (AudioDistance)3); break; case "urchin.spike": Run(Fly(a, b, BossVfx.Spike, BossVfx.Glow(Pink, 3f), new Vector3(1.4f, 1.4f, 1.6f), 0.45f, 4f, Pink, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) BossVfx.Flash(b + Vector3.up * 0.3f, 0.8f, Pink, 0.2f); BossVfx.Debris(b, 4, Sand, 3f, 0.15f); })); break; case "urchin.caltrop": Run(Caltrops(a, num)); break; case "urchin.bloom": Run(Bloom(a, num2)); Sound("Slap_0", 1, 3, a, 1f); Sound("ItemImpactHeavy_V", 1, 3, a, 0.8f); break; case "angler.lure": Run(Lure(e.PieceId, num)); Fx.Sound("RadarPing", a, 1f, (AudioDistance)3); break; case "angler.flash": LureFlash(a); break; case "angler.lunge": Fx.Sound("Swallow", a, 1f, (AudioDistance)3); Run(Trail(e.PieceId, num, WeaponFx.Bubbles, 4)); WeaponFx.Game("WaterSplashWhite", a, Vector3.up); break; case "angler.gulp": Fx.Sound("Eat_V" + Random.Range(1, 4), a, 1f, (AudioDistance)2); WeaponFx.Game("BloodSmall", a, Vector3.up); BossVfx.Flash(a + Vector3.up * 0.6f, 1f, Cyan, 0.15f); break; case "steed.splash": WeaponFx.Emit(WeaponFx.Foam, a, 3, Vector3.up); WeaponFx.Emit(WeaponFx.Drops, a, 4, Vector3.up); break; case "steed.rear": Fx.Sound("BoatLandCollisionMedium_V" + Random.Range(1, 4), a, 1f, (AudioDistance)3); BossFx.Burst(a + Vector3.up * 3f, "Gold", 24, 0.14f); break; case "steed.land": BossVfx.Shock(a, 4f, Gold, 0.35f); BossVfx.Dust(a, 2f, 6); Sound("ItemImpactHeavy_V", 1, 3, a, 0.9f); break; case "steed.charge": Run(Charge(e.PieceId, a, b, num)); Sound("Footstep_Sand_V", 1, 5, a, 1f); break; case "steed.stomp": BossVfx.Impact(a, num2 * 0.5f, Gold, Sand); BossVfx.Shock(a, num2 * 1.1f, Gold, 0.6f, 0.85f); BossVfx.Spires(Circle(a, num2 * 0.75f, 12), 1.8f, Sand * 0.9f, new Color(0f, 0f, 0f, 0f), 0.8f, 0f); Shake(a, 0.6f); Sound("ItemImpactHeavy_V", 1, 3, a, 1f); break; case "steed.phantom": Run(Phantom(e.PieceId, a, b, num)); break; case "steed.golden": Run(GoldenSpin(e.PieceId)); break; case "stone.rise": BossVfx.Spires(Circle(a, num2 + 1.2f, 9), 2.4f, Basalt, Venom, 1.2f, 0.02f); Erupt(a, num2, Basalt); Shake(a, 0.5f); Sound("ItemImpactHeavy_V", 1, 3, a, 1f); break; case "stone.dig": Erupt(a, 3f, Basalt); break; case "stone.tunnel": Run(Tunnel(a, b, num)); break; case "stone.rumble": Shake(a, 0.3f); Fx.Sound("LavaEruption_01", a, 0.6f, (AudioDistance)3); break; case "stone.spires": BossVfx.Spires(Line(a, b, 1.4f, 0.5f), 2.8f, Basalt, Venom, 1.8f); BossVfx.Shock(a, 4f, Venom, 0.4f); Fx.Sound("LavaEruption_01", a, 0.8f, (AudioDistance)3); break; case "stone.spines": Run(Throb(e.PieceId, num, 0.08f)); Run(Charge(e.PieceId, num, Venom)); break; case "stone.spit": Run(Fly(a, b, WeaponFx.Ball, BossVfx.Glow(Venom, 2.5f), Vector3.one * 0.7f, 0.5f, 4f, Venom, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) BossVfx.Flash(b + Vector3.up * 0.3f, 1.2f, Venom, 0.2f); WeaponFx.Emit(WeaponFx.Gas, b, 4, Vector3.up); })); Sound("PiranhaVomit_V", 1, 3, a, 0.8f); break; case "stone.pool": Run(Pool(a, num2, num)); break; case "stone.eyes": Run(Eyes(e.PieceId, num, Venom)); break; case "stone.gaze": Run(Gaze(a, b, e.Who)); Fx.Sound("Ignite", a, 1f, (AudioDistance)3); break; case "stone.petrify": Run(Petrify(e.Who, a, b, num)); break; case "sky.pass": Fx.Sound("PunchSwoosh", a, 1f, (AudioDistance)3); Shake(a, 0.3f); BossVfx.Shock(a, 6f, Color.white, 0.4f); break; case "sky.bomb": Explode(a, 2.6f); break; case "sky.call": Sound("Seagull_V", 1, 11, a, 1f); break; case "sky.boom": Run(Boom(a, b, num)); break; case "sky.fall": Fx.Sound("AlbatrossScreamTakeDamage", a, 1f, (AudioDistance)3); Run(Smoke(e.PieceId, 0.8f)); break; case "kraken.rise": Run(SeaBurst(a, num)); break; case "kraken.dive": WeaponFx.Game("WaterExplosionWhite", a, Vector3.up); BossVfx.Shock(a, 7f, Water, 0.6f); Fx.Sound("ItemHitWaterHeavy_V1", a, 1f, (AudioDistance)3); break; case "kraken.tentacles": Run(Tentacles(a, b, num, Mathf.Max(2, e.Who))); break; case "kraken.sweep": Run(SweepFx(a, b, e.Who, Water)); break; case "kraken.reach": Run(Reach(e.Who, a, b, num)); break; case "kraken.grab": Run(Dragged(e.Who, a, b)); break; case "kraken.ink": Run(Ink(a, num2, num)); break; case "kraken.whirl": Run(Whirl(a, num2, num)); break; case "voxel.load": Run(Load(a, num)); break; case "voxel.in": Cubes(a, 50, inward: true); BossVfx.Flash(a, 2f, Pixel, 0.2f); Fx.Sound("TypingClick" + Random.Range(1, 4), a, 1f, (AudioDistance)3); break; case "voxel.out": Cubes(a, 50, inward: false); Fx.Sound("Error", a, 0.6f, (AudioDistance)3); break; case "voxel.copy": Run(Words(a, "Ctrl+C Ctrl+V", Pixel, num + 0.8f)); Fx.Sound("Typing" + Random.Range(1, 4), a, 1f, (AudioDistance)3); break; case "voxel.select": Run(Selection(a, b, num2, num)); break; case "voxel.delete": Run(Pixelate(a, b, num2)); BossVfx.Flash(a + Vector3.up, num2, Blood); Fx.Sound("Error", a, 1f, (AudioDistance)3); break; case "voxel.undo": Run(Words(a + Vector3.up * 6f, "Ctrl+Z", new Color(0.4f, 0.8f, 1f), num)); Run(Rewind(e.PieceId, num)); break; case "voxel.restored": Cubes(a, 70, inward: true); BossVfx.Flash(a, 3f, new Color(0.4f, 0.8f, 1f), 0.3f); Fx.Sound("QuestFinished", a, 0.7f, (AudioDistance)3); break; case "voxel.bolt": Run(Fly(a, b, WeaponFx.Cube, BossVfx.Glow((Random.value < 0.5f) ? Pixel : Pink), Vector3.one * 0.5f, 0.35f, 1.2f, Pixel, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Cubes(b, 14, inward: false); BossVfx.Shock(b, 2.5f, Pixel, 0.3f); })); break; case "voxel.fatal": H.Overlay(OverlayKind.Glitch, num); Fx.Sound("Error", a, 1f, (AudioDistance)3); Fx.Sound("RadioNoise_loop", a, 0.8f, (AudioDistance)3); break; case "koi.gate": Run(Gate(a, num)); break; case "koi.jet": Run(Jet(a, b, num, e.Who)); Fx.Sound("ItemHitWaterHeavy_V2", a, 1f, (AudioDistance)3); break; case "koi.splash": WeaponFx.Game("WaterExplosionWhite", a, Vector3.up); try { VFXManager.Play("WaterExplosion", a); } catch { } BossVfx.Shock(a, num2 * 2f, Water, 0.6f); BossVfx.Debris(a, 12, Sand, 7f); Ring(a, num2, WeaponFx.Foam, 3); Shake(a, 0.6f); Fx.Sound("WhaleLanding_0" + Random.Range(1, 4), a, 1f, (AudioDistance)3); break; case "koi.call": Sound("ItemHitWaterLight_V", 1, 3, a, 1f); Run(Charge(e.PieceId, num, Water)); break; case "koi.drop": Run(Fly(a + Vector3.up * 30f + Random.insideUnitSphere * 3f, a, WeaponFx.Ball, WeaponFx.Water("BossDrop", new Color(0.55f, 0.8f, 1f, 0.85f)), Vector3.one * 1.3f, 0.6f, 0f, Water, delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) WeaponFx.Game("WaterSplashWhite", a, Vector3.up); WeaponFx.Emit(WeaponFx.Drops, a, 12, Vector3.up); BossVfx.Shock(a, 3f, Water, 0.35f); })); break; case "koi.breath": Run(Breath(a, b, num, e.Who)); Fx.Sound("FireLoop", a, 1f, (AudioDistance)3); break; case "koi.burn": Run(Burning(a, num)); break; case "koi.charge": Run(Charge(e.PieceId, num, new Color(0.7f, 0.85f, 1f))); break; case "koi.thunder": ((MonoBehaviour)H).StartCoroutine(BossFx.Lightning(a, new Color(0.75f, 0.85f, 1f))); BossVfx.Impact(a, 2.6f, new Color(0.6f, 0.8f, 1f), Basalt); break; case "koi.dragon": Run(Dragon(e.PieceId, num)); break; case "eye.descend": Run(Descend(a, num)); break; case "eye.red": H.RedSky(e.Arg > 0); BossEye.Of(e.PieceId)?.Rage(e.Arg > 0); break; case "eye.open": { BossEye bossEye = BossEye.Of(e.PieceId); if (bossEye != null) { bossEye.Flare(num); } else { Run(Eyes(e.PieceId, num, Blood)); } Fx.Sound("LavaWhaleNoise_0" + Random.Range(1, 5), a, 1f, (AudioDistance)3); break; } case "eye.beam": Run(Gaze(e.PieceId, a, b, num, e.Who)); break; case "eye.spears": Fx.Sound("BowCharge", a, 1f, (AudioDistance)3); break; case "eye.spear": Run(Fly(a + Vector3.up * 35f + Random.insideUnitSphere.Flat() * 4f, a, BossVfx.Shard, BossVfx.Glow(Blood), new Vector3(0.9f, 3f, 0.9f), 0.55f, 0f, Blood, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) BossVfx.Impact(a, 1.6f, Blood, Basalt); }, upright: true)); break; case "eye.echo": BossVfx.Impact(a, num2, Shadow, new Color(0.1f, 0.05f, 0.1f)); WeaponFx.Game("BlackConfetti", a, Vector3.up); Sound("ItemImpactHeavy_V", 1, 3, a, 0.8f); break; case "eye.echoLane": Run(Streak(a, b, 0.5f, Shadow, 1.6f)); BossVfx.Impact(b, 2f, Shadow, new Color(0.1f, 0.05f, 0.1f)); break; case "eye.echoCone": Run(SweepFx(a, b, e.Who, Shadow)); break; case "eye.judgment": Run(Judgment(e.PieceId, a, b, num)); break; case "eye.verdict": Verdict(a); break; default: return false; } return true; } private static void Run(IEnumerator e) { ((MonoBehaviour)H).StartCoroutine(e); } private static void Sound(string prefix, int min, int max, Vector3 at, float vol) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) Fx.SoundRandom(prefix, min, max, at, vol, (AudioDistance)3); } private static void Sound(string clip, Vector3 at) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Fx.Sound(clip, at, 1f, (AudioDistance)3); } private static void Shake(Vector3 at, float amount) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.LocalPlayer; if (!Object.op_Implicit((Object)(object)localPlayer) || !Object.op_Implicit((Object)(object)localPlayer.Transform) || !Object.op_Implicit((Object)(object)localPlayer.ScreenShake)) { return; } try { localPlayer.ScreenShake.ShakeAt(at, 2, 900f * amount, 8f, 45f, default(Vector2)); } catch { } } private static void Ring(Vector3 at, float radius, ParticleSystem ps, int each) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 16; i++) { float num = (float)i * MathF.PI / 8f; WeaponFx.Emit(ps, at + new Vector3(Mathf.Cos(num), 0.2f, Mathf.Sin(num)) * radius, each, Vector3.up); } } private static void Erupt(Vector3 at, float radius, Color rock) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) BossVfx.Shock(at, radius * 2.2f, rock * 1.1f); BossVfx.Debris(at, 18, rock, 6f, 0.3f); BossVfx.Dust(at, radius, 14); } private static void Explode(Vector3 at, float r) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) WeaponFx.Game((r > 3f) ? "BigExplosion" : "SmallExplosion", at + Vector3.up * 0.3f, Vector3.up); BossVfx.Impact(at, r, Fire, Basalt); Fx.Sound("Explosion", at, 0.8f, (AudioDistance)3); Shake(at, 0.3f); } private static List Circle(Vector3 c, float r, int n) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return (from i in Enumerable.Range(0, n) select c + Quaternion.Euler(0f, (float)i * 360f / (float)n + Random.Range(-8f, 8f), 0f) * Vector3.forward * r * Random.Range(0.85f, 1.1f)).ToList(); } private static List Line(Vector3 a, Vector3 b, float step, float jitter) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_001e: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector3 val = (b - a).Flat(); float magnitude = ((Vector3)(ref val)).magnitude; val = (b - a).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(Vector3.up, normalized); for (float num = 1.2f; num < magnitude; num += step) { list.Add(a + normalized * num + val2 * Random.Range(0f - jitter, jitter)); } return list; } private static IEnumerator Fly(Vector3 from, Vector3 to, Mesh mesh, Material mat, Vector3 scale, float seconds, float height, Color tail, Action land, bool upright = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) Transform t = WeaponFx.Piece(mesh, mat); t.localScale = scale; LineRenderer line = WeaponFx.Line("BossTail", BossVfx.Glow(tail, 2f), 0.25f); line.positionCount = 6; Queue trail = new Queue(); Vector3 last = from; for (float s = 0f; s < seconds; s += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)t)) { break; } float num = s / seconds; Vector3 val = (t.position = Vector3.Lerp(from, to, num) + Vector3.up * height * 4f * num * (1f - num)); Vector3 val3; if (upright) { Vector3 up = Vector3.up; val3 = last - val; Vector3 val4; if (!(((Vector3)(ref val3)).sqrMagnitude > 1E-06f)) { val4 = Vector3.up; } else { val3 = last - val; val4 = ((Vector3)(ref val3)).normalized; } t.rotation = Quaternion.FromToRotation(up, val4) * Quaternion.Euler(0f, s * 400f, 0f); } else { val3 = val - last; if (((Vector3)(ref val3)).sqrMagnitude > 1E-06f) { t.rotation = Quaternion.LookRotation(val - last); } } trail.Enqueue(val); while (trail.Count > 6) { trail.Dequeue(); } Vector3[] array = trail.ToArray(); line.positionCount = array.Length; line.SetPositions(array); line.widthMultiplier = 0.25f * scale.x; last = val; yield return null; } if (Object.op_Implicit((Object)(object)t)) { Object.Destroy((Object)(object)((Component)t).gameObject); } if (Object.op_Implicit((Object)(object)line)) { Object.Destroy((Object)(object)((Component)line).gameObject); } land?.Invoke(); } private static IEnumerator Streak(Vector3 a, Vector3 b, float seconds, Color c, float width = 0.9f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) LineRenderer line = WeaponFx.Line("BossStreak", BossVfx.Glow(c, 3f), width); line.positionCount = 2; a += Vector3.up * 0.6f; b += Vector3.up * 0.6f; for (float t = 0f; t < seconds + 0.4f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)line)) { break; } line.SetPosition(0, Vector3.Lerp(a, b, Mathf.Clamp01((t - seconds) / 0.4f))); line.SetPosition(1, Vector3.Lerp(a, b, Mathf.Clamp01(t / Mathf.Max(0.05f, seconds)))); yield return null; } if (Object.op_Implicit((Object)(object)line)) { Object.Destroy((Object)(object)((Component)line).gameObject); } } private static IEnumerator Throb(int id, float seconds, float amount) { Transform body = BossFx.BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } Vector3 s0 = body.localScale; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)body)) { break; } body.localScale = s0 * (1f + amount * Mathf.Abs(Mathf.Sin(t * 14f))); yield return null; } if (Object.op_Implicit((Object)(object)body)) { body.localScale = s0; } } private static IEnumerator Charge(int id, float seconds, Color c) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform body = BossFx.BodyOf(id); ParticleSystem ps = BossVfx.Sparks(c); for (float t = 0f; t < seconds; t += 0.05f) { if (!Object.op_Implicit((Object)(object)body)) { break; } Bounds val = BossLooks.WorldBounds(body); Vector3 center = ((Bounds)(ref val)).center; for (int i = 0; i < 3; i++) { Vector3 val2 = center + Random.onUnitSphere * Random.Range(3f, 6f); Vector3 dir = center - val2; Vector3? velocity = (center - val2) * 2.2f; WeaponFx.Emit(ps, val2, 1, dir, null, 0.14f, velocity, 0.45f); } yield return (object)new WaitForSeconds(0.05f); } } private static IEnumerator Trail(int id, float seconds, ParticleSystem ps, int each) { Transform body = BossFx.BodyOf(id); for (float t = 0f; t < seconds; t += 0.05f) { if (!Object.op_Implicit((Object)(object)body)) { break; } WeaponFx.Emit(ps, new Vector3(body.position.x, BossFx.Ground(body.position) + 0.3f, body.position.z) + Random.insideUnitSphere * 1.5f, each, Vector3.up); yield return (object)new WaitForSeconds(0.05f); } } private static IEnumerator Eyes(int id, float seconds, Color c) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform body = BossFx.BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } Light light = new GameObject("BossEyes").AddComponent(); light.type = (LightType)2; light.color = c; light.range = 14f; light.shadows = (LightShadows)0; Transform l = WeaponFx.Piece(WeaponFx.Ball, BossVfx.Glow(c, 8f)); Transform r = WeaponFx.Piece(WeaponFx.Ball, BossVfx.Glow(c, 8f)); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)body)) { break; } Bounds val = BossLooks.WorldBounds(body); Vector3 val2 = body.forward.Flat(); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = Vector3.Cross(Vector3.up, normalized); Vector3 val4 = ((Bounds)(ref val)).center + normalized * Mathf.Max(((Bounds)(ref val)).extents.x, ((Bounds)(ref val)).extents.z) * 0.8f + Vector3.up * ((Bounds)(ref val)).extents.y * 0.3f; float num = Mathf.Clamp01(t / (seconds * 0.6f)); float num2 = (0.25f + 0.6f * num) * (1f + 0.15f * Mathf.Sin(t * 30f)); ((Component)light).transform.position = val4; light.intensity = 4f * num; l.position = val4 + val3 * Mathf.Max(0.4f, ((Bounds)(ref val)).extents.x * 0.25f); l.localScale = Vector3.one * num2; r.position = val4 - val3 * Mathf.Max(0.4f, ((Bounds)(ref val)).extents.x * 0.25f); r.localScale = Vector3.one * num2; yield return null; } Object.Destroy((Object)(object)((Component)light).gameObject); if (Object.op_Implicit((Object)(object)l)) { Object.Destroy((Object)(object)((Component)l).gameObject); } if (Object.op_Implicit((Object)(object)r)) { Object.Destroy((Object)(object)((Component)r).gameObject); } } private static Transform Ghost(Transform body, Material mat) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("BossGhost").transform; transform.SetPositionAndRotation(body.position, body.rotation); Renderer[] componentsInChildren = ((Component)body).GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (!val.enabled || val.forceRenderingOff || val is ParticleSystemRenderer || val is LineRenderer) { continue; } Mesh val2 = null; SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null); if (val3 != null) { val2 = new Mesh(); val3.BakeMesh(val2); } else { MeshFilter component = ((Component)val).GetComponent(); if (component != null) { val2 = component.sharedMesh; } } if (!Object.op_Implicit((Object)(object)val2)) { continue; } GameObject val4 = new GameObject("Part", new Type[2] { typeof(MeshFilter), typeof(MeshRenderer) }); val4.transform.SetPositionAndRotation(((Component)val).transform.position, ((Component)val).transform.rotation); val4.transform.localScale = ((val is SkinnedMeshRenderer) ? Vector3.one : ((Component)val).transform.lossyScale); val4.transform.SetParent(transform, true); val4.GetComponent().sharedMesh = val2; MeshRenderer component2 = val4.GetComponent(); if (Object.op_Implicit((Object)(object)mat)) { ((Renderer)component2).sharedMaterials = Enumerable.Repeat(mat, val2.subMeshCount).ToArray(); } else { ((Renderer)component2).sharedMaterials = val.sharedMaterials.Select((Material m) => (!Object.op_Implicit((Object)(object)m) || !Object.op_Implicit((Object)(object)m.shader) || !m.shader.isSupported || !(((Object)m.shader).name != "Hidden/InternalErrorShader")) ? BossVfx.Solid(Iron) : m).ToArray(); } ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; if (val is SkinnedMeshRenderer) { val4.AddComponent().Mesh = val2; } } return transform; } private static IEnumerator Chain(int bossId, int pieceId, Vector3 to, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform body = BossFx.BodyOf(bossId); Material mat = BossVfx.Solid(Iron); List links = new List(); for (int i = 0; i < 16; i++) { Transform val = WeaponFx.Piece(BossVfx.Link, mat); val.localScale = Vector3.zero; links.Add(val); } Transform lockRing = WeaponFx.Piece(BossVfx.Link, BossVfx.Glow(Fire, 3f)); lockRing.localScale = Vector3.zero; Vector3 top = to + Vector3.up * 1.3f; bool locked = false; for (float t = 0f; t < seconds; t += Time.deltaTime) { Vector3 val2 = (Object.op_Implicit((Object)(object)body) ? (body.position + Vector3.up * 1.2f) : to); float num = Mathf.Clamp01(t / 0.3f) * 16f; for (int j = 0; j < 16; j++) { float num2 = ((float)j + 0.5f) / 16f; Vector3 val3 = Vector3.Lerp(val2, top, num2) + Vector3.down * Mathf.Sin(num2 * MathF.PI) * (1.4f + 0.15f * Mathf.Sin(t * 2f + (float)j * 0.4f)); Vector3 val4 = Vector3.Lerp(val2, top, num2 + 0.0625f) + Vector3.down * Mathf.Sin((num2 + 0.0625f) * MathF.PI) * 1.4f; links[j].position = val3; Transform obj = links[j]; Vector3 val5 = val4 - val3; obj.rotation = Quaternion.LookRotation((((Vector3)(ref val5)).sqrMagnitude > 1E-06f) ? (val4 - val3) : Vector3.forward) * Quaternion.Euler(0f, 0f, (j % 2 == 0) ? 0f : 90f) * Quaternion.Euler(90f, 0f, 0f); links[j].localScale = (((float)j < num) ? (Vector3.one * 0.38f) : Vector3.zero); } if (t >= 0.3f && !locked) { locked = true; BossVfx.Flash(top, 1.2f, Fire, 0.2f); BossFx.Burst(top, "Orange", 24, 0.1f); Fx.SoundRandom("MetallicItemImpact_V", 1, 3, top, 1f, (AudioDistance)2); } if (locked) { lockRing.position = top + Vector3.up * 0.2f; lockRing.rotation = Quaternion.Euler(0f, t * 60f, 0f); lockRing.localScale = Vector3.one * (1.6f + 0.08f * Mathf.Sin(t * 8f)); } yield return null; } BossFx.Burst(top, "Orange", 20, 0.1f); BossVfx.Debris(top, 8, Iron, 4f, 0.15f); Fx.SoundRandom("MetallicItemImpact_V", 1, 3, top, 0.8f, (AudioDistance)2); for (float t = 0f; t < 0.6f; t += Time.deltaTime) { foreach (Transform item in links) { if (Object.op_Implicit((Object)(object)item)) { item.position += Vector3.down * 9f * t * Time.deltaTime; item.localScale *= 0.97f; } } yield return null; } foreach (Transform item2 in links) { if (Object.op_Implicit((Object)(object)item2)) { Object.Destroy((Object)(object)((Component)item2).gameObject); } } if (Object.op_Implicit((Object)(object)lockRing)) { Object.Destroy((Object)(object)((Component)lockRing).gameObject); } } private static IEnumerator Shell(int id, float seconds, Color c) { Transform body = BossFx.BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } Transform dome = WeaponFx.Piece(WeaponFx.Ball, BossVfx.Wash(new Color(1f, 0.6f, 0.2f, 0.22f))); Material mat = ((Renderer)((Component)dome).GetComponent()).sharedMaterial; List mats = (from m in (from r in ((Component)body).GetComponentsInChildren() where !(r is ParticleSystemRenderer) select r).SelectMany((Renderer r) => r.materials) where m.HasProperty("_MetallicMetallicness") select m).ToList(); List was = mats.Select((Material m) => m.GetFloat("_MetallicMetallicness")).ToList(); foreach (Material item in mats) { item.SetFloat("_MetallicMetallicness", 1f); } for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)body)) { break; } Bounds val = BossLooks.WorldBounds(body); dome.position = ((Bounds)(ref val)).center; dome.localScale = ((Bounds)(ref val)).size * 1.25f * (1f + 0.03f * Mathf.Sin(t * 6f)); mat.color = new Color(1f, 0.6f, 0.2f, 0.16f + 0.08f * Mathf.Sin(t * 6f)); if (Random.value < 0.15f) { Vector3 center = ((Bounds)(ref val)).center; Vector3 onUnitSphere = Random.onUnitSphere; Vector3 extents = ((Bounds)(ref val)).extents; BossFx.Burst(center + onUnitSphere * ((Vector3)(ref extents)).magnitude, "Orange", 2, 0.08f); } yield return null; } for (int num = 0; num < mats.Count; num++) { if (Object.op_Implicit((Object)(object)mats[num])) { mats[num].SetFloat("_MetallicMetallicness", was[num]); } } if (Object.op_Implicit((Object)(object)dome)) { BossVfx.Debris(dome.position, 16, new Color(1f, 0.6f, 0.25f), 6f, 0.2f); Object.Destroy((Object)(object)((Component)dome).gameObject); } Object.Destroy((Object)(object)mat); } private static IEnumerator Roll(int id, float seconds) { Transform body = BossFx.BodyOf(id); Vector3 lastMark = Vector3.zero; Vector3 val = default(Vector3); for (float t = 0f; t < seconds; t += 0.05f) { if (!Object.op_Implicit((Object)(object)body)) { break; } ((Vector3)(ref val))..ctor(body.position.x, BossFx.Ground(body.position), body.position.z); BossVfx.Dust(val, 1.5f, 2); if (Random.value < 0.6f) { BossFx.Burst(val + Vector3.up * 0.5f, "Pink", 2, 0.1f); } Vector3 val2 = val - lastMark; if (((Vector3)(ref val2)).sqrMagnitude > 6.25f) { lastMark = val; BossVfx.Scar(val, 1.8f, Pink, 4f); BossVfx.Debris(val, 3, Sand, 4f, 0.2f); } yield return (object)new WaitForSeconds(0.05f); } } private static IEnumerator Caltrops(Vector3 at, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) List spikes = new List(); for (int i = 0; i < 4; i++) { Transform val = WeaponFx.Piece(BossVfx.Spike, BossVfx.Solid(Violet)); Transform obj = WeaponFx.Piece(WeaponFx.Ball, BossVfx.Glow(Pink), val); obj.localPosition = new Vector3(0f, 0f, 1f); obj.localScale = Vector3.one * 0.18f; Vector3 val2 = at + Random.insideUnitSphere.Flat() * 0.8f; val2.y = BossFx.Ground(val2) - 0.15f; val.position = val2; val.rotation = Quaternion.LookRotation(Quaternion.Euler(Random.Range(-35f, 35f), Random.value * 360f, 0f) * Vector3.up); val.localScale = new Vector3(1.6f, 1.6f, 1.1f); spikes.Add(val); } yield return (object)new WaitForSeconds(Mathf.Max(0f, seconds - 0.5f)); for (float t = 0f; t < 0.5f; t += Time.deltaTime) { foreach (Transform item in spikes) { if (Object.op_Implicit((Object)(object)item)) { item.position += Vector3.down * Time.deltaTime * 2f; } } yield return null; } foreach (Transform item2 in spikes) { if (Object.op_Implicit((Object)(object)item2)) { Object.Destroy((Object)(object)((Component)item2).gameObject); } } } private static IEnumerator Bloom(Vector3 at, float radius) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) BossVfx.Flash(at + Vector3.up * 1.5f, 3f, Pink); BossVfx.Shock(at, radius * 1.1f, Pink, 0.45f); List<(Transform t, Vector3 v)> spikes = new List<(Transform, Vector3)>(); Material mat = BossVfx.Glow(Pink, 3f); for (int i = 0; i < 22; i++) { Quaternion val = Quaternion.Euler(0f, (float)i * 360f / 22f + Random.Range(-6f, 6f), 0f); Vector3 val2 = new Vector3(0f, Random.Range(0.05f, 0.35f), 1f); Vector3 val3 = val * ((Vector3)(ref val2)).normalized; Transform val4 = WeaponFx.Piece(BossVfx.Spike, mat); val4.position = at + Vector3.up * 1.5f + val3 * 1.5f; val4.rotation = Quaternion.LookRotation(val3); val4.localScale = new Vector3(1.4f, 1.4f, 1.6f); spikes.Add((val4, val3 * radius * 2.4f)); } for (float t = 0f; t < 0.5f; t += Time.deltaTime) { foreach (var (val5, val6) in spikes) { if (Object.op_Implicit((Object)(object)val5)) { val5.position += val6 * Time.deltaTime; val5.localScale *= 0.985f; } } yield return null; } foreach (var item2 in spikes) { Transform item = item2.t; if (Object.op_Implicit((Object)(object)item)) { BossFx.Burst(item.position, "Pink", 2, 0.08f); Object.Destroy((Object)(object)((Component)item).gameObject); } } } private static IEnumerator Lure(int id, float seconds) { Transform val = BossFx.BodyOf(id); if (!Object.op_Implicit((Object)(object)val)) { yield break; } if (!Lanterns.TryGetValue(id, out var l) || !Object.op_Implicit((Object)(object)l.ball)) { Transform val2 = WeaponFx.Piece(WeaponFx.Ball, BossVfx.Glow(Cyan, 7f)); Light val3 = new GameObject("BossLanternLight").AddComponent(); val3.type = (LightType)2; val3.color = Cyan; val3.shadows = (LightShadows)0; ((Component)val3).transform.SetParent(val2, false); Dictionary lanterns = Lanterns; (Transform, Light) value; l = (value = (val2, val3)); lanterns[id] = value; ((MonoBehaviour)H).StartCoroutine(Follow(id, val)); } ParticleSystem motes = BossVfx.Sparks(Cyan); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)l.ball)) { break; } float num = t / seconds; l.ball.localScale = Vector3.one * (0.6f + 1.6f * num * num) * (1f + 0.06f * Mathf.Sin(t * 25f)); l.light.intensity = 2f + 6f * num; l.light.range = 14f + 24f * num; if (Random.value < 0.6f) { Vector3 val4 = l.ball.position + Random.onUnitSphere * 5f; Vector3 dir = l.ball.position - val4; Vector3? velocity = (l.ball.position - val4) * 2.5f; WeaponFx.Emit(motes, val4, 1, dir, null, 0.12f, velocity, 0.4f); } yield return null; } if (Object.op_Implicit((Object)(object)l.ball)) { l.ball.localScale = Vector3.one * 0.6f; l.light.intensity = 2.5f; l.light.range = 16f; } } private static IEnumerator Follow(int id, Transform body) { (Transform, Light) value; while (Object.op_Implicit((Object)(object)body) && Lanterns.TryGetValue(id, out value) && Object.op_Implicit((Object)(object)value.Item1)) { Bounds val = BossLooks.WorldBounds(body); value.Item1.position = ((Bounds)(ref val)).center + body.forward * Mathf.Max(((Bounds)(ref val)).extents.x, ((Bounds)(ref val)).extents.z) * 0.95f + Vector3.up * ((Bounds)(ref val)).extents.y * 1.05f; yield return null; } if (Lanterns.TryGetValue(id, out (Transform, Light) value2) && Object.op_Implicit((Object)(object)value2.Item1)) { Object.Destroy((Object)(object)((Component)value2.Item1).gameObject); } Lanterns.Remove(id); } private static void LureFlash(Vector3 at) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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) BossVfx.Flash(at, 4f, Cyan, 0.35f); for (int i = 0; i < 3; i++) { WeaponFx.Emit(WeaponFx.Rings, at, 1, Random.onUnitSphere, Cyan, 8f + 5f * (float)i); } BossFx.Burst(at, "Cyan", 50, 0.15f); Player localPlayer = Player.LocalPlayer; Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)curCamera)) { Vector3 val = at - ((Component)curCamera).transform.position; bool flag = ((Vector3)(ref val)).magnitude < 45f && Vector3.Angle(((Component)curCamera).transform.forward, val) < 50f && !Physics.Linecast(((Component)curCamera).transform.position, at, LayerMask.op_Implicit(GameInfo.LevelLayer)); H.Overlay((!flag) ? OverlayKind.Glint : OverlayKind.White, flag ? 1.2f : 0.3f); Fx.Sound("ShinyCreatureCaught_0" + Random.Range(1, 4), at, 1f, (AudioDistance)3); } } private static IEnumerator Charge(int id, Vector3 a, Vector3 b, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform body = BossFx.BodyOf(id); ((MonoBehaviour)H).StartCoroutine(Streak(a, b, seconds, Gold, 1.2f)); Material ghostMat = BossVfx.Wash(new Color(1f, 0.85f, 0.4f, 0.4f)); List<(Transform t, float born)> ghosts = new List<(Transform, float)>(); float next = 0f; for (float t = 0f; t < seconds + 0.5f; t += Time.deltaTime) { if (Object.op_Implicit((Object)(object)body) && t < seconds && t >= next) { next = t + 0.08f; ghosts.Add((Ghost(body, ghostMat), t)); Vector3 val = new Vector3(body.position.x, BossFx.Ground(body.position), body.position.z); BossFx.Burst(val + Vector3.up * 0.3f, "Gold", 4, 0.1f); BossVfx.Dust(val, 1.2f, 2); } foreach (var (val2, num) in ghosts) { if (Object.op_Implicit((Object)(object)val2)) { val2.localScale = Vector3.one * (1f - Mathf.Clamp01((t - num) / 0.45f) * 0.3f); } } for (int num2 = ghosts.Count - 1; num2 >= 0; num2--) { if (t - ghosts[num2].born > 0.45f) { if (Object.op_Implicit((Object)(object)ghosts[num2].t)) { Object.Destroy((Object)(object)((Component)ghosts[num2].t).gameObject); } ghosts.RemoveAt(num2); } } yield return null; } foreach (var item2 in ghosts) { Transform item = item2.t; if (Object.op_Implicit((Object)(object)item)) { Object.Destroy((Object)(object)((Component)item).gameObject); } } Object.Destroy((Object)(object)ghostMat); } private static IEnumerator Phantom(int id, Vector3 a, Vector3 b, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform val = BossFx.BodyOf(id); Material mat = BossVfx.Wash(new Color(0.85f, 0.92f, 1f, 0.5f)); BossSteed steed = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); Transform ghost = (Object.op_Implicit((Object)(object)steed) ? steed.Phantom(mat) : (Object.op_Implicit((Object)(object)val) ? Ghost(val, mat) : null)); Vector3 val2 = (b - a).Flat(); Vector3 dir = ((Vector3)(ref val2)).normalized; Fx.Sound("Footstep_Sand_V" + Random.Range(1, 6), a, 1f, (AudioDistance)3); ((MonoBehaviour)H).StartCoroutine(Streak(a, b, seconds, new Color(0.7f, 0.85f, 1f), 0.6f)); if (Object.op_Implicit((Object)(object)ghost)) { Vector3 position = ghost.position; ghost.position = new Vector3(a.x, position.y, a.z); } float num; if (!Object.op_Implicit((Object)(object)ghost) || !Object.op_Implicit((Object)(object)val)) { num = 0f; } else { float y = val.position.y; Bounds val3 = BossLooks.WorldBounds(val); num = y - ((Bounds)(ref val3)).min.y; } float yOff = num; for (float t = 0f; t < seconds; t += Time.deltaTime) { Vector3 val4 = Vector3.Lerp(a, b, t / seconds); val4.y = BossFx.Ground(val4) + yOff + (Object.op_Implicit((Object)(object)steed) ? 0f : (Mathf.Abs(Mathf.Sin(t * 12f)) * 0.8f)); if (Object.op_Implicit((Object)(object)ghost)) { ghost.SetPositionAndRotation(val4, Quaternion.LookRotation(dir) * BossLooks.Turn(EnemyKind.Steed)); } if (Random.value < 0.5f) { BossFx.Burst(val4 + Vector3.up, "Cyan", 2, 0.1f); } BossVfx.Dust(val4, 0.6f, 1); mat.color = new Color(0.85f, 0.92f, 1f, 0.5f * Mathf.Min(1f, (seconds - t) / 0.3f)); yield return null; } if (Object.op_Implicit((Object)(object)ghost)) { Object.Destroy((Object)(object)((Component)ghost).gameObject); } Object.Destroy((Object)(object)mat); } private static IEnumerator GoldenSpin(int id) { Transform body = BossFx.BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } List rings = new List(); for (int i = 0; i < 3; i++) { rings.Add(WeaponFx.Piece(WeaponFx.Torus, BossVfx.Glow(Gold))); } BossVfx.Flash(body.position + Vector3.up * 2f, 5f, Gold, 0.4f); float t = 0f; while (Object.op_Implicit((Object)(object)body)) { Bounds val = BossLooks.WorldBounds(body); Vector3 extents; for (int j = 0; j < 3; j++) { rings[j].position = ((Bounds)(ref val)).center; rings[j].rotation = Quaternion.Euler(60f * (float)j + t * 40f, t * (120f + 40f * (float)j), 30f * (float)j); Transform obj = rings[j]; Vector3 one = Vector3.one; extents = ((Bounds)(ref val)).extents; obj.localScale = one * ((Vector3)(ref extents)).magnitude * (1.5f + 0.15f * (float)j); } if (Random.value < 0.3f) { Vector3 center = ((Bounds)(ref val)).center; Vector3 onUnitSphere = Random.onUnitSphere; extents = ((Bounds)(ref val)).extents; BossFx.Burst(center + onUnitSphere * ((Vector3)(ref extents)).magnitude, "Gold", 1, 0.12f); } yield return null; t += Time.deltaTime; } foreach (Transform item in rings) { if (Object.op_Implicit((Object)(object)item)) { Object.Destroy((Object)(object)((Component)item).gameObject); } } } private static IEnumerator Tunnel(Vector3 a, Vector3 b, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Shake(a, 0.2f); for (float t = 0f; t < seconds; t += 0.07f) { Vector3 val = Vector3.Lerp(a, b, t / seconds); val.y = BossFx.Ground(val); BossVfx.Dust(val, 1.2f, 2); BossVfx.Debris(val, 2, Basalt, 3.5f, 0.2f); if (Random.value < 0.2f) { Fx.SoundRandom("ItemImpactLight_V", 1, 3, val, 0.6f, (AudioDistance)2); } yield return (object)new WaitForSeconds(0.07f); } } private static IEnumerator Pool(Vector3 at, float r, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) GameObject go = BossFx.Decal("circle", at, at + Vector3.forward, r, 0, Venom); Mesh sharedMesh = go.GetComponent().sharedMesh; List list = new List(); sharedMesh.GetColors(list); for (int i = 0; i < list.Count; i++) { list[i] = ((list[i].a > 0.6f) ? new Color(0.7f, 1f, 0.45f, 0.95f) : new Color(0.3f, 0.75f, 0.15f, 0.7f)); } sharedMesh.SetColors(list); Material mat = ((Renderer)go.GetComponent()).sharedMaterial; BossVfx.Flash(at + Vector3.up * 0.3f, r, Venom); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } mat.color = new Color(1f, 1f, 1f, (0.75f + 0.15f * Mathf.Sin(t * 4f)) * Mathf.Clamp01((seconds - t) / 0.8f)); if (Random.value < 0.3f) { WeaponFx.Emit(WeaponFx.Bubbles, at + Random.insideUnitSphere.Flat() * r * 0.8f + Vector3.up * 0.1f, 1, Vector3.up, (Color?)new Color(0.6f, 1f, 0.4f), -1f, (Vector3?)null, -1f); } if (Random.value < 0.06f) { BossVfx.Burst(at + Random.insideUnitSphere.Flat() * r * 0.7f + Vector3.up * 0.15f, Venom, 5, 0.07f); } yield return null; } Object.Destroy((Object)(object)mat); Object.Destroy((Object)(object)go); } private static IEnumerator Gaze(Vector3 eye, Vector3 far, int half) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 a = default(Vector3); ((Vector3)(ref a))..ctor(eye.x, BossFx.Ground(eye), eye.z); GameObject go = BossFx.Decal("cone", a, far, 0f, half, Venom); Mesh sharedMesh = go.GetComponent().sharedMesh; List list = new List(); sharedMesh.GetColors(list); for (int i = 0; i < list.Count; i++) { list[i] = new Color(0.6f, 1f, 0.4f, (list[i].a > 0.6f) ? 0.9f : 0.45f); } sharedMesh.SetColors(list); Material mat = ((Renderer)go.GetComponent()).sharedMaterial; BossVfx.Flash(eye, 2.5f, Venom, 0.3f); for (float t = 0f; t < 0.6f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } mat.color = new Color(1f, 1f, 1f, 1f - t / 0.6f); yield return null; } Object.Destroy((Object)(object)mat); Object.Destroy((Object)(object)go); } private static IEnumerator Petrify(int pieceId, Vector3 at, Vector3 boss, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject piece = (Object.op_Implicit((Object)(object)BuildSystem.Instance) ? BuildSystem.Instance.PieceObject(pieceId) : null); Bounds bounds = (Bounds)(Object.op_Implicit((Object)(object)piece) ? BossLooks.WorldBounds(piece.transform) : new Bounds(at + Vector3.up, new Vector3(1.6f, 2f, 1.6f))); ((MonoBehaviour)H).StartCoroutine(Beam(boss + Vector3.up * 2f, ((Bounds)(ref bounds)).center, Venom, 0.3f, 0.5f)); yield return (object)new WaitForSeconds(0.12f); BossVfx.Flash(((Bounds)(ref bounds)).center, 2.6f, Venom, 0.3f); BossFx.Burst(((Bounds)(ref bounds)).center, "Green", 30, 0.12f); Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, at, 0.9f, (AudioDistance)2); Renderer[] rends = ((IEnumerable)(Object.op_Implicit((Object)(object)piece) ? ((Array)(from r in piece.GetComponentsInChildren() where r.enabled && !(r is ParticleSystemRenderer) && !(r is LineRenderer) select r).ToArray()) : ((Array)new Renderer[0]))).OrderBy(delegate(Renderer r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Bounds bounds3 = r.bounds; return ((Bounds)(ref bounds3)).min.y; }).ToArray(); Material[][] was = rends.Select((Renderer r) => r.sharedMaterials).ToArray(); Material stone = BossVfx.Solid(Stone); Color rock = new Color(0.42f, 0.43f, 0.4f); Material mat = BossVfx.Solid(rock); float w = Mathf.Max(0.5f, Mathf.Max(((Bounds)(ref bounds)).extents.x, ((Bounds)(ref bounds)).extents.z)); float h = Mathf.Max(1f, ((Bounds)(ref bounds)).size.y); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).min.y, ((Bounds)(ref bounds)).center.z); List<(Transform t, Vector3 size, float start)> crust = new List<(Transform, Vector3, float)>(); Vector3 val2 = default(Vector3); Vector3 item = default(Vector3); for (int num = 0; num < 9; num++) { float num2 = (float)num * MathF.PI * 2f / 9f + Random.Range(-0.15f, 0.15f); ((Vector3)(ref val2))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); Transform val3 = WeaponFx.Piece(BossVfx.Rock(num % 6), mat); val3.position = val + val2 * w * 0.85f + Vector3.down * 0.1f; val3.rotation = Quaternion.AngleAxis(Random.Range(18f, 32f), Vector3.Cross(Vector3.up, -val2)) * Quaternion.Euler(0f, Random.value * 360f, 0f); ((Vector3)(ref item))..ctor(w * Random.Range(0.6f, 0.85f), h * Random.Range(0.45f, 0.7f), w * Random.Range(0.55f, 0.8f)); val3.localScale = Vector3.zero; crust.Add((val3, item, Random.Range(0f, 0.15f))); if (num % 3 == 0) { Transform obj = WeaponFx.Piece(BossVfx.Shard, BossVfx.Glow(Venom, 3f), val3); obj.localPosition = new Vector3(0.18f, 0.5f, 0f); obj.localRotation = Quaternion.Euler(0f, 0f, -35f); obj.localScale = new Vector3(0.55f, 0.6f, 0.55f); } } int greyed = 0; for (float t = 0f; t < 0.8f; t += Time.deltaTime) { foreach (var (val4, val5, num3) in crust) { if (Object.op_Implicit((Object)(object)val4)) { float num4 = Mathf.Clamp01((t - num3) / 0.35f); val4.localScale = val5 * (1f - (1f - num4) * (1f - num4)); } } for (int num5 = Mathf.Min(rends.Length, Mathf.CeilToInt((float)rends.Length * Mathf.Clamp01((t - 0.1f) / 0.6f))); greyed < num5; greyed++) { Renderer val6 = rends[greyed]; if (Object.op_Implicit((Object)(object)val6)) { val6.sharedMaterials = Enumerable.Repeat(stone, val6.sharedMaterials.Length).ToArray(); if (greyed % 2 == 0) { Bounds bounds2 = val6.bounds; BossVfx.Debris(((Bounds)(ref bounds2)).center, 2, Stone, 1.5f, 0.1f); } } } yield return null; } Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, at, 0.7f, (AudioDistance)2); BossVfx.Dust(at, w * 1.2f, 8); for (float t = 0.8f; t < seconds - 0.3f; t += 0.25f) { if (Random.value < 0.4f) { BossVfx.Debris(((Bounds)(ref bounds)).center + Vector3.up * h * 0.3f, 1, Stone, 1.5f, 0.12f); } if (Random.value < 0.3f) { BossFx.Burst(((Bounds)(ref bounds)).center + Random.insideUnitSphere * w, "Green", 1, 0.06f); } yield return (object)new WaitForSeconds(0.25f); } BossVfx.Flash(((Bounds)(ref bounds)).center, 2f, Venom, 0.2f); foreach (var (val7, val8, _) in crust) { if (Object.op_Implicit((Object)(object)val7)) { BossVfx.Debris(val7.position + Vector3.up * val8.y * 0.4f, 4, rock, 6f, 0.26f); } } BossVfx.Debris(((Bounds)(ref bounds)).center, 12, Stone, 5f, 0.2f); BossVfx.Dust(at, w * 1.4f, 12); BossVfx.Shock(at, w * 3f, Stone, 0.4f); Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, at, 1f, (AudioDistance)2); foreach (var item3 in crust) { Transform item2 = item3.t; if (Object.op_Implicit((Object)(object)item2)) { Object.Destroy((Object)(object)((Component)item2).gameObject); } } for (int i = rends.Length - 1; i >= 0; i--) { if (Object.op_Implicit((Object)(object)rends[i])) { rends[i].sharedMaterials = was[i]; } if (i % 2 == 0) { yield return null; } } } private static IEnumerator Beam(Vector3 a, Vector3 b, Color c, float width, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) LineRenderer glow = WeaponFx.Line("BossBeam", BossVfx.Glow(c, 3f), width * 2.5f); LineRenderer core = WeaponFx.Line("BossBeamCore", BossVfx.Glow(Color.Lerp(c, Color.white, 0.6f), 6f), width); LineRenderer[] array = (LineRenderer[])(object)new LineRenderer[2] { glow, core }; foreach (LineRenderer obj in array) { obj.positionCount = 2; obj.SetPosition(0, a); obj.SetPosition(1, b); } for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)core)) { break; } float num = 1f - t / seconds; glow.widthMultiplier = width * 2.5f * num; core.widthMultiplier = width * num; yield return null; } if (Object.op_Implicit((Object)(object)glow)) { Object.Destroy((Object)(object)((Component)glow).gameObject); } if (Object.op_Implicit((Object)(object)core)) { Object.Destroy((Object)(object)((Component)core).gameObject); } } private static IEnumerator Boom(Vector3 a, Vector3 b, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)H).StartCoroutine(Streak(a, b, seconds, Color.white, 1.4f)); Fx.Sound("IntroCrash", Vector3.Lerp(a, b, 0.5f), 1f, (AudioDistance)3); for (int i = 0; i <= 10; i++) { Vector3 val = Vector3.Lerp(a, b, (float)i / 10f); Vector3 at = new Vector3(val.x, BossFx.Ground(val), val.z); ParticleSystem rings = WeaponFx.Rings; Vector3 val2 = b - a; WeaponFx.Emit(rings, val, 1, ((Vector3)(ref val2)).normalized, Color.white, 9f); BossVfx.Shock(at, 5f, Color.white, 0.4f); BossVfx.Dust(at, 3f, 5); BossVfx.Debris(at, 4, Sand, 6f, 0.2f); yield return (object)new WaitForSeconds(seconds / 10f); } Fx.Sound("Explosion", Vector3.Lerp(a, b, 0.5f), 1f, (AudioDistance)3); Shake(Vector3.Lerp(a, b, 0.5f), 0.8f); } private static IEnumerator Smoke(int id, float seconds) { Transform body = BossFx.BodyOf(id); for (float t = 0f; t < seconds; t += 0.05f) { if (!Object.op_Implicit((Object)(object)body)) { break; } WeaponFx.Emit(WeaponFx.Gas, body.position, 2, Vector3.up, (Color?)new Color(0.25f, 0.25f, 0.25f), -1f, (Vector3?)null, -1f); BossFx.Burst(body.position, "Orange", 2, 0.1f); yield return (object)new WaitForSeconds(0.05f); } } private static IEnumerator SeaBurst(Vector3 at, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) for (float t = 0f; t < seconds; t += 0.1f) { WeaponFx.Emit(WeaponFx.Bubbles, at + Random.insideUnitSphere.Flat() * 6f, 6, Vector3.up); if (Random.value < 0.3f) { WeaponFx.Game("BloodSmall", at + Random.insideUnitSphere.Flat() * 6f, Vector3.up); } if (Random.value < 0.15f) { BossVfx.Shock(at, 8f * Random.value + 3f, Crimson, 0.6f); } yield return (object)new WaitForSeconds(0.1f); } WeaponFx.Game("WaterExplosionWhite", at, Vector3.up); try { VFXManager.Play("WaterExplosion", at); } catch { } BossVfx.Shock(at, 12f, Water, 0.7f); Fx.Sound("LavaWhaleNoise_0" + Random.Range(1, 5), at, 1f, (AudioDistance)3); } private static IEnumerator Tentacles(Vector3 shore, Vector3 toward, float seconds, int n) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (toward - shore).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(Vector3.up, dir); List<(Tentacle t, Vector3 root)> arms = new List<(Tentacle, Vector3)>(); for (int i = 0; i < n; i++) { Vector3 val3 = shore + dir * 3f + val2 * (((float)i - (float)(n - 1) * 0.5f) * 3.6f); val3.y = WaterManager.GetWaterHeight(val3) - 0.3f; arms.Add((new Tentacle(Random.Range(8f, 10f)), val3)); WeaponFx.Game("WaterSplashWhite", val3, Vector3.up); BossVfx.Shock(val3, 3f, Water, 0.4f); } Fx.Sound("ItemHitWaterHeavy_V" + Random.Range(1, 4), shore, 1f, (AudioDistance)3); for (float t = 0f; t < seconds + 0.6f; t += Time.deltaTime) { float rise = Mathf.Clamp01(t / 0.5f); float num = Mathf.Clamp01((t - seconds) / 0.22f); foreach (var (tentacle, val4) in arms) { tentacle.Pose(val4, val4 + dir * 12f, rise, num, t); } if (num >= 1f && t - seconds < 0.25f + Time.deltaTime) { foreach (var item in arms) { Vector3 val5 = item.root + dir * 9f; val5.y = BossFx.Ground(val5); WeaponFx.Game("WaterExplosionWhite", val5, Vector3.up); BossVfx.Impact(val5, 2.2f, Crimson, Sand, scar: false); } } yield return null; } foreach (var item2 in arms) { item2.t.Destroy(); } } private static IEnumerator SweepFx(Vector3 apex, Vector3 far, int half, Color c) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) Vector3 val = (far - apex).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; val = (far - apex).Flat(); float range = ((Vector3)(ref val)).magnitude; Fx.Sound("WhaleLanding_0" + Random.Range(1, 4), apex, 1f, (AudioDistance)3); for (int i = 0; i <= 12; i++) { Vector3 val2 = apex + Quaternion.Euler(0f, Mathf.Lerp((float)(-half), (float)half, (float)i / 12f), 0f) * dir * range * 0.75f; val2.y = BossFx.Ground(val2); if (val2.y <= WaterManager.GetWaterHeight(val2) + 0.2f || i % 3 == 0) { WeaponFx.Game("WaterExplosionWhite", val2, Vector3.up); } BossVfx.Shock(val2, 3f, c, 0.35f); BossVfx.Debris(val2, 4, Sand, 5f, 0.2f); yield return (object)new WaitForSeconds(0.025f); } Shake(apex, 0.5f); } private static IEnumerator Reach(int pieceId, Vector3 at, Vector3 shore, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Tentacle arm = new Tentacle(9f); Holding[pieceId] = arm; Vector3 val = (at - shore).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 root = at - normalized * 2.2f; root.y = BossFx.Ground(root) - 0.4f; BossVfx.Debris(root, 10, Sand); BossVfx.Dust(root, 1.5f, 8); for (float t = 0f; t < seconds + 1.4f; t += Time.deltaTime) { if (!Holding.TryGetValue(pieceId, out var value)) { break; } if (value != arm) { break; } arm.Pose(root, at, Mathf.Clamp01(t / 0.4f), Mathf.Clamp01((t - 0.4f) / 0.5f) * 0.85f, t * 3f); yield return null; } if (Holding.TryGetValue(pieceId, out var value2) && value2 == arm) { Holding.Remove(pieceId); arm.Destroy(); } } private static IEnumerator Dragged(int pieceId, Vector3 at, Vector3 sea) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject val = (Object.op_Implicit((Object)(object)BuildSystem.Instance) ? BuildSystem.Instance.PieceObject(pieceId) : null); if (Holding.TryGetValue(pieceId, out var arm)) { Holding.Remove(pieceId); } else { arm = null; } Transform copy = null; if (Object.op_Implicit((Object)(object)val)) { copy = Ghost(val.transform, null); Renderer[] componentsInChildren = val.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } } Fx.SoundRandom("WoodItemImpact_V", 1, 3, at, 1f, (AudioDistance)2); BossVfx.Debris(at, 14, Sand, 7f); Vector3 start = (Object.op_Implicit((Object)(object)copy) ? copy.position : at); for (float t = 0f; t < 1.3f; t += Time.deltaTime) { float num = t / 1.3f; Vector3 val2 = Vector3.Lerp(start, sea + Vector3.down * 3f, num * num) + Vector3.up * Mathf.Sin(num * MathF.PI) * 6f; if (Object.op_Implicit((Object)(object)copy)) { copy.position = val2; copy.rotation = Quaternion.Euler(num * 200f, num * 120f, num * 60f); } arm?.Pose(sea, val2, 1f, 0.85f, t * 3f); yield return null; } WeaponFx.Game("WaterExplosionWhite", sea, Vector3.up); BossVfx.Shock(sea, 6f, Water); Fx.Sound("ItemHitWaterHeavy_V2", sea, 1f, (AudioDistance)3); arm?.Destroy(); if (Object.op_Implicit((Object)(object)copy)) { Object.Destroy((Object)(object)((Component)copy).gameObject); } } private static IEnumerator Ink(Vector3 at, float r, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Fx.Sound("PiranhaVomit_V" + Random.Range(1, 4), at, 1f, (AudioDistance)3); List<(GameObject go, Material m)> splats = new List<(GameObject, Material)>(); for (int i = 0; i < 6; i++) { Vector3 val = at + Random.insideUnitSphere.Flat() * r * 0.7f; GameObject val2 = BossFx.Decal("circle", val, val + Vector3.forward, Random.Range(1.2f, 2.6f), 0, new Color(0.05f, 0.02f, 0.08f)); Mesh sharedMesh = val2.GetComponent().sharedMesh; List list = new List(); sharedMesh.GetColors(list); for (int j = 0; j < list.Count; j++) { list[j] = new Color(0.03f, 0.01f, 0.05f, 0.85f); } sharedMesh.SetColors(list); splats.Add((val2, ((Renderer)val2.GetComponent()).sharedMaterial)); } bool blinded = false; for (float t = 0f; t < seconds; t += 0.1f) { for (int k = 0; k < 6; k++) { WeaponFx.Emit(WeaponFx.Gas, at + Random.insideUnitSphere.Flat() * r + Vector3.up * Random.Range(0.3f, 2.5f), 1, Vector3.up, (Color?)new Color(0.06f, 0.03f, 0.08f), -1f, (Vector3?)null, -1f); } foreach (var item2 in splats) { Material item = item2.m; if (Object.op_Implicit((Object)(object)item)) { item.color = new Color(1f, 1f, 1f, Mathf.Clamp01((seconds - t) / 1f)); } } Player localPlayer = Player.LocalPlayer; int num; if (Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Transform)) { Vector3 val3 = (localPlayer.Transform.position - at).Flat(); num = ((((Vector3)(ref val3)).magnitude < r) ? 1 : 0); } else { num = 0; } if (num != 0 && !blinded) { blinded = true; H.Overlay(OverlayKind.Ink, Mathf.Max(1.5f, seconds - t)); } yield return (object)new WaitForSeconds(0.1f); } foreach (var (val4, val5) in splats) { if (Object.op_Implicit((Object)(object)val5)) { Object.Destroy((Object)(object)val5); } if (Object.op_Implicit((Object)(object)val4)) { Object.Destroy((Object)(object)val4); } } } private static IEnumerator Whirl(Vector3 at, float r, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Transform funnel = WeaponFx.Piece(WeaponFx.Funnel, WeaponFx.Water("BossWhirl", new Color(0.45f, 0.12f, 0.22f, 0.8f), (Texture)(object)WeaponFx.SpiralTex)); funnel.position = at; ParticleSystem foam = WeaponFx.Orbit(at + Vector3.up * 0.1f, r * 0.7f); Fx.Sound("UnderwaterLoop", at, 1f, (AudioDistance)3); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)funnel)) { break; } float num = Mathf.Min(1f, t / 0.8f) * Mathf.Min(1f, (seconds - t) / 0.8f); funnel.localScale = new Vector3(r * 2f * num, 2.4f * num, r * 2f * num); funnel.rotation = Quaternion.Euler(0f, (0f - t) * 220f, 0f); if (Random.value < 0.1f) { BossVfx.Shock(at, r * Random.Range(0.6f, 1f), Water, 0.6f); } yield return null; } if (Object.op_Implicit((Object)(object)funnel)) { Object.Destroy((Object)(object)((Component)funnel).gameObject); } if (Object.op_Implicit((Object)(object)foam)) { Object.Destroy((Object)(object)((Component)foam).gameObject); } } private static void Cubes(Vector3 at, int n, bool inward) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_0028: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < n; i++) { ParticleSystem ps = BossVfx.Sparks((Random.value < 0.5f) ? Pink : Pixel); if (inward) { Vector3 val = at + Random.onUnitSphere * 4f; Vector3 dir = at - val; Vector3? velocity = (at - val) * 3f; WeaponFx.Emit(ps, val, 1, dir, null, 0.35f, velocity, 0.33f); } else { Vector3 onUnitSphere = Random.onUnitSphere; Vector3 at2 = at + onUnitSphere * 0.5f; Vector3? velocity = onUnitSphere * Random.Range(3f, 8f); WeaponFx.Emit(ps, at2, 1, onUnitSphere, null, 0.35f, velocity, 0.6f); } } } private static IEnumerator Load(Vector3 at, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) H.Overlay(OverlayKind.Glitch, 0.6f); Fx.Sound("RadioNoise_loop", at, 0.8f, (AudioDistance)3); ((MonoBehaviour)H).StartCoroutine(Words(at + Vector3.up * 7f, "NOW LOADING... 99%", Pixel, seconds + 0.4f)); for (float t = 0f; t < seconds; t += 0.06f) { Cubes(at, 8, inward: true); yield return (object)new WaitForSeconds(0.06f); } } private static IEnumerator Words(Vector3 at, string text, Color c, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Hud.Font)) { yield break; } GameObject go = new GameObject("BossWords"); TextMeshPro t = go.AddComponent(); ((TMP_Text)t).font = Hud.Font; ((TMP_Text)t).text = text; ((TMP_Text)t).fontSize = 14f; ((TMP_Text)t).alignment = (TextAlignmentOptions)514; ((Graphic)t).color = c; ((TMP_Text)t).fontStyle = (FontStyles)1; ((TMP_Text)t).outlineWidth = 0.2f; ((TMP_Text)t).outlineColor = new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue); go.transform.position = at; for (float s = 0f; s < seconds; s += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera)) { go.transform.rotation = Quaternion.LookRotation(go.transform.position - ((Component)curCamera).transform.position); } ((TMP_Text)t).alpha = Mathf.Clamp01(Mathf.Min(s / 0.15f, (seconds - s) / 0.25f)) * ((Random.value < 0.08f) ? 0.3f : 1f); yield return null; } Object.Destroy((Object)(object)go); } private static IEnumerator Selection(Vector3 c, Vector3 to, float half, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (to - c).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(Vector3.up, normalized); float num = BossFx.Ground(c); Vector3[] array = (Vector3[])(object)new Vector3[4] { c + normalized * half + val2 * half, c + normalized * half - val2 * half, c - normalized * half - val2 * half, c - normalized * half + val2 * half }; List lines = new List(); Material mat = BossVfx.Glow(new Color(1f, 0.3f, 0.3f)); for (int i = 0; i < 4; i++) { float[] array2 = new float[2] { 0.15f, 3.2f }; foreach (float num2 in array2) { LineRenderer val3 = WeaponFx.Line("BossSelect", mat, 0.1f); val3.positionCount = 2; val3.SetPosition(0, new Vector3(array[i].x, num + num2, array[i].z)); val3.SetPosition(1, new Vector3(array[(i + 1) % 4].x, num + num2, array[(i + 1) % 4].z)); lines.Add(val3); } } for (int k = 0; k < 4; k++) { LineRenderer val4 = WeaponFx.Line("BossSelect", mat, 0.1f); val4.positionCount = 2; val4.SetPosition(0, new Vector3(array[k].x, num + 0.15f, array[k].z)); val4.SetPosition(1, new Vector3(array[k].x, num + 3.2f, array[k].z)); lines.Add(val4); } ((MonoBehaviour)H).StartCoroutine(Words(c + Vector3.up * 4.2f, "DELETE?", new Color(1f, 0.3f, 0.3f), seconds)); for (float t = 0f; t < seconds; t += Time.deltaTime) { bool enabled = Mathf.Sin(t * Mathf.Lerp(6f, 30f, t / seconds)) > -0.3f; foreach (LineRenderer item in lines) { if (Object.op_Implicit((Object)(object)item)) { ((Renderer)item).enabled = enabled; } } yield return null; } foreach (LineRenderer item2 in lines) { if (Object.op_Implicit((Object)(object)item2)) { Object.Destroy((Object)(object)((Component)item2).gameObject); } } } private static IEnumerator Pixelate(Vector3 c, Vector3 to, float half) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (to - c).Flat(); Vector3 f = ((Vector3)(ref val)).normalized; Vector3 r = Vector3.Cross(Vector3.up, f); for (int i = 0; i < 8; i++) { for (int j = 0; j < 14; j++) { Vector3 val2 = c + f * Random.Range(0f - half, half) + r * Random.Range(0f - half, half); val2.y = BossFx.Ground(val2) + Random.Range(0.1f, 2.6f); ParticleSystem ps = BossVfx.Sparks((Color)((Random.value < 0.5f) ? new Color(1f, 0.3f, 0.3f) : Pixel)); Vector3 at = val2; Vector3 up = Vector3.up; Vector3? velocity = Vector3.up * Random.Range(2f, 6f) + Random.insideUnitSphere; WeaponFx.Emit(ps, at, 1, up, null, 0.35f, velocity, 0.9f); } yield return (object)new WaitForSeconds(0.05f); } } private static IEnumerator Rewind(int id, float seconds) { Transform body = BossFx.BodyOf(id); ParticleSystem ps = BossVfx.Sparks(new Color(0.4f, 0.8f, 1f)); for (float t = 0f; t < seconds; t += 0.05f) { if (!Object.op_Implicit((Object)(object)body)) { break; } Bounds val = BossLooks.WorldBounds(body); for (int i = 0; i < 4; i++) { float num = (0f - t) * 6f + (float)i * MathF.PI / 2f; Vector3 center = ((Bounds)(ref val)).center; Vector3 val2 = new Vector3(Mathf.Cos(num), Mathf.Sin(t * 3f + (float)i) * 0.3f, Mathf.Sin(num)); Vector3 extents = ((Bounds)(ref val)).extents; Vector3 at = center + val2 * (((Vector3)(ref extents)).magnitude + 1f); Vector3 up = Vector3.up; Vector3? velocity = Vector3.zero; WeaponFx.Emit(ps, at, 1, up, null, 0.3f, velocity, 0.5f); } yield return (object)new WaitForSeconds(0.05f); } } private static IEnumerator Gate(Vector3 at, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Material mat = BossVfx.Solid(new Color(0.8f, 0.12f, 0.08f)); Material mat2 = BossVfx.Glow(Gold, 2f); List<(Transform t, Vector3 pos, Vector3 size)> parts = new List<(Transform, Vector3, Vector3)>(); Vector3 up = Vector3.up; Vector3 val = (at - (Object.op_Implicit((Object)(object)FortressIsland.Instance) ? FortressIsland.Instance.Center : (at + Vector3.forward))).Flat(); Vector3 val2 = Vector3.Cross(up, ((Vector3)(ref val)).normalized); Part(WeaponFx.Cube, mat, val2 * 4f + Vector3.up * 5f, new Vector3(0.9f, 10f, 0.9f)); Part(WeaponFx.Cube, mat, -val2 * 4f + Vector3.up * 5f, new Vector3(0.9f, 10f, 0.9f)); Part(WeaponFx.Cube, mat, Vector3.up * 9.6f, new Vector3(11f, 0.7f, 1f)); Part(WeaponFx.Cube, mat2, Vector3.up * 10.2f, new Vector3(12f, 0.35f, 1.2f)); Part(WeaponFx.Cube, mat, Vector3.up * 8f, new Vector3(9f, 0.5f, 0.7f)); Transform col = WeaponFx.Piece(WeaponFx.Cyl, BossVfx.Wash(new Color(0.55f, 0.82f, 1f, 0.5f))); Material colMat = ((Renderer)((Component)col).GetComponent()).sharedMaterial; Fx.Sound("ItemHitWaterHeavy_V3", at, 1f, (AudioDistance)3); Quaternion turn = Quaternion.LookRotation(Vector3.Cross(val2, Vector3.up)); for (float t = 0f; t < seconds; t += Time.deltaTime) { float num = Mathf.Min(1f, t / 0.6f); float num2 = Mathf.Min(1f, (seconds - t) / 0.6f); float num3 = num * num2; foreach (var (val3, val4, localScale) in parts) { val3.position = at + val4 - Vector3.up * 11f * (1f - num3); val3.rotation = turn; val3.localScale = localScale; } if (Object.op_Implicit((Object)(object)col)) { col.position = at + Vector3.up * 9f * num3; col.localScale = new Vector3(3f, 9f * num3 + 0.01f, 3f); col.rotation = Quaternion.Euler(0f, t * 200f, 0f); } WeaponFx.Emit(WeaponFx.Foam, at + Random.insideUnitSphere.Flat() * 3f, 2, Vector3.up); if (Random.value < 0.5f) { WeaponFx.Emit(WeaponFx.Drops, at + Vector3.up * 18f * num3, 3, Vector3.up); } yield return null; } foreach (var item3 in parts) { Transform item = item3.t; if (Object.op_Implicit((Object)(object)item)) { Object.Destroy((Object)(object)((Component)item).gameObject); } } if (Object.op_Implicit((Object)(object)col)) { Object.Destroy((Object)(object)((Component)col).gameObject); } Object.Destroy((Object)(object)colMat); void Part(Mesh m, Material mat3, Vector3 pos, Vector3 size) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Transform item2 = WeaponFx.Piece(m, mat3); parts.Add((item2, pos, size)); } } private static IEnumerator Jet(Vector3 mouth, Vector3 far, float seconds, int sweep) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) LineRenderer outer = WeaponFx.Line("BossJet", WeaponFx.Water("BossJet", new Color(0.55f, 0.85f, 1f, 0.9f)), 1.6f); LineRenderer core = WeaponFx.Line("BossJetCore", BossVfx.Glow(new Color(0.85f, 0.95f, 1f), 3f), 0.45f); int positionCount = 2; core.positionCount = 2; outer.positionCount = positionCount; Vector3 g = new Vector3(mouth.x, BossFx.Ground(mouth), mouth.z); Vector3 val = (far - g).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; val = (far - g).Flat(); float range = ((Vector3)(ref val)).magnitude; Vector3 lastMark = Vector3.zero; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)outer)) { break; } Vector3 val2 = g + Quaternion.Euler(0f, Mathf.Lerp((float)(-sweep), (float)sweep, t / seconds), 0f) * dir * range; val2.y = BossFx.Ground(val2); outer.SetPosition(0, mouth); outer.SetPosition(1, val2); core.SetPosition(0, mouth); core.SetPosition(1, val2); outer.widthMultiplier = 1.6f + 0.2f * Mathf.Sin(t * 40f); WeaponFx.Emit(WeaponFx.Drops, val2, 6, Vector3.up); WeaponFx.Emit(WeaponFx.Foam, val2, 1, Vector3.up); val = val2 - lastMark; if (((Vector3)(ref val)).sqrMagnitude > 4f) { lastMark = val2; BossVfx.Scar(val2, 1.3f, Water, 3f); } yield return null; } if (Object.op_Implicit((Object)(object)outer)) { Object.Destroy((Object)(object)((Component)outer).gameObject); } if (Object.op_Implicit((Object)(object)core)) { Object.Destroy((Object)(object)((Component)core).gameObject); } } private static IEnumerator Breath(Vector3 mouth, Vector3 far, float seconds, int half) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 g = new Vector3(mouth.x, BossFx.Ground(mouth), mouth.z); Vector3 val = (far - g).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; val = (far - g).Flat(); float range = ((Vector3)(ref val)).magnitude; ParticleSystem fire = BossVfx.Sparks(Fire); ParticleSystem hot = BossVfx.Sparks(new Color(1f, 0.85f, 0.3f)); Light light = new GameObject("BossFireLight").AddComponent(); light.type = (LightType)2; light.color = Fire; light.range = range; light.shadows = (LightShadows)0; ((Component)light).transform.position = g + dir * range * 0.4f + Vector3.up * 2f; for (float t = 0f; t < seconds; t += 0.04f) { light.intensity = 2.5f + Random.value * 1.5f; for (int i = 0; i < 8; i++) { Vector3 val2 = Quaternion.Euler(0f, (float)Random.Range(-half, half), 0f) * dir; Vector3 val3 = g + val2 * range * Random.Range(0.3f, 1f) + Vector3.up * 0.5f; ParticleSystem ps = ((Random.value < 0.4f) ? hot : fire); Vector3 at = mouth; Vector3 dir2 = val3 - mouth; float size = Random.Range(0.3f, 0.6f); Vector3? velocity = (val3 - mouth) * 1.7f; WeaponFx.Emit(ps, at, 1, dir2, null, size, velocity, 0.6f); } if (Random.value < 0.35f) { Vector3 val4 = g + Quaternion.Euler(0f, (float)Random.Range(-half, half), 0f) * dir * range * Random.Range(0.3f, 1f); val4.y = BossFx.Ground(val4); WeaponFx.Game("LavaPoof", val4, Vector3.up); BossVfx.Scar(val4, 1.6f, Fire, 5f); } yield return (object)new WaitForSeconds(0.04f); } Object.Destroy((Object)(object)((Component)light).gameObject); } private static IEnumerator Burning(Vector3 at, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) for (float t = 0f; t < seconds; t += 0.2f) { ParticleSystem ps = BossVfx.Sparks(Fire); Vector3 at2 = at + Vector3.up * 0.8f + Random.insideUnitSphere * 0.6f; Vector3 up = Vector3.up; Vector3? velocity = Vector3.up * 2f; WeaponFx.Emit(ps, at2, 3, up, null, 0.18f, velocity, 0.6f); if (Random.value < 0.3f) { WeaponFx.Emit(WeaponFx.Gas, at + Vector3.up * 1.5f, 1, Vector3.up, (Color?)new Color(0.2f, 0.2f, 0.2f), -1f, (Vector3?)null, -1f); } yield return (object)new WaitForSeconds(0.2f); } } private static IEnumerator Dragon(int id, float seconds) { Transform body = BossFx.BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } for (int i = 0; i < 4; i++) { if (!Object.op_Implicit((Object)(object)body)) { yield break; } ((MonoBehaviour)H).StartCoroutine(BossFx.Lightning(body.position + Random.insideUnitSphere * 4f, new Color(1f, 0.85f, 0.4f))); BossFx.Burst(body.position, "Gold", 40, 0.2f); BossVfx.Flash(body.position, 4f + (float)i, Gold, 0.3f); yield return (object)new WaitForSeconds(seconds / 5f); } if (Object.op_Implicit((Object)(object)body)) { BossLooks.Dress(body, EnemyKind.Koi, second: true); BossVfx.Flash(body.position, 9f, Gold, 0.5f); for (int j = 0; j < 3; j++) { WeaponFx.Emit(WeaponFx.Rings, body.position, 1, Random.onUnitSphere, Gold, 14f + 6f * (float)j); } Fx.Sound("BossFightIntro", body.position, 1f, (AudioDistance)3); Fx.Sound("LavaWhaleNoise_03", body.position, 1f, (AudioDistance)3); } } private static IEnumerator Descend(Vector3 home, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) H.RedSky(on: true); Fx.Sound("LavaWhaleNoise_04", home, 1f, (AudioDistance)3); for (float t = 0f; t < seconds; t += 0.45f) { ((MonoBehaviour)H).StartCoroutine(BossFx.Lightning(home + Random.insideUnitSphere.Flat() * 18f + Vector3.down * 10f, new Color(1f, 0.25f, 0.25f))); yield return (object)new WaitForSeconds(0.45f); } yield return (object)new WaitForSeconds(2.5f); H.RedSky(on: false); } private static IEnumerator Gaze(int id, Vector3 eye, Vector3 far, float seconds, int sweep) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) LineRenderer glow = WeaponFx.Line("BossGaze", BossVfx.Glow(Blood, 6f), 2.6f); LineRenderer core = WeaponFx.Line("BossGazeCore", BossVfx.Glow(new Color(1f, 0.85f, 0.8f), 8f), 0.6f); int positionCount = 2; core.positionCount = 2; glow.positionCount = positionCount; Transform body = BossFx.BodyOf(id); Vector3 g = new Vector3(eye.x, BossFx.Ground(eye), eye.z); Vector3 val = (far - g).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; val = (far - g).Flat(); float range = ((Vector3)(ref val)).magnitude; Fx.Sound("SizzlingLoop", far, 1f, (AudioDistance)3); Vector3 lastMark = Vector3.zero; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)core)) { break; } Vector3 val2 = g + Quaternion.Euler(0f, Mathf.Lerp((float)(-sweep), (float)sweep, t / seconds), 0f) * dir * range; val2.y = BossFx.Ground(val2); BossEye bossEye = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent() : null); if (Object.op_Implicit((Object)(object)bossEye)) { bossEye.LookAt(val2, 0.2f); } Vector3 val3 = (Object.op_Implicit((Object)(object)bossEye) ? bossEye.Pupil : (Object.op_Implicit((Object)(object)body) ? body.position : eye)); glow.SetPosition(0, val3); glow.SetPosition(1, val2); core.SetPosition(0, val3); core.SetPosition(1, val2); glow.widthMultiplier = 2.2f + 0.5f * Mathf.Sin(t * 40f); WeaponFx.Emit(BossVfx.Sparks(Fire), val2, 4, Vector3.up, null, 0.14f); BossVfx.Dust(val2, 0.6f, 1); val = val2 - lastMark; if (((Vector3)(ref val)).sqrMagnitude > 3.2399998f) { lastMark = val2; BossVfx.Scar(val2, 1.2f, Blood); } yield return null; } if (Object.op_Implicit((Object)(object)glow)) { Object.Destroy((Object)(object)((Component)glow).gameObject); } if (Object.op_Implicit((Object)(object)core)) { Object.Destroy((Object)(object)((Component)core).gameObject); } } private static IEnumerator Judgment(int id, Vector3 eye, Vector3 core, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) H.RedSky(on: true); Fx.Sound("BossFightIntro", core, 1f, (AudioDistance)3); Transform sun = WeaponFx.Piece(WeaponFx.Ball, BossVfx.Glow(Blood, 5f)); LineRenderer beam = WeaponFx.Line("BossJudgment", BossVfx.Glow(Blood, 6f), 0.2f); beam.positionCount = 2; Transform body = BossFx.BodyOf(id); Vector3 over = core + Vector3.up * 9f; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)sun)) { break; } float num = t / seconds; sun.position = over; sun.localScale = Vector3.one * (0.5f + 6f * num * num) * (1f + 0.04f * Mathf.Sin(t * 30f)); BossEye bossEye = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent() : null); if (Object.op_Implicit((Object)(object)bossEye)) { bossEye.LookAt(over, 0.2f); } beam.SetPosition(0, Object.op_Implicit((Object)(object)bossEye) ? bossEye.Pupil : (Object.op_Implicit((Object)(object)body) ? body.position : eye)); beam.SetPosition(1, over); beam.widthMultiplier = 0.2f + 1.6f * num; if (Random.value < 0.08f + 0.3f * num) { ((MonoBehaviour)H).StartCoroutine(BossFx.Lightning(core + Random.insideUnitSphere.Flat() * 12f, new Color(1f, 0.2f, 0.2f))); } if (Random.value < 0.3f) { Vector3 val = over + Random.onUnitSphere * 10f; ParticleSystem ps = BossVfx.Sparks(Blood); Vector3 dir = over - val; Vector3? velocity = (over - val) * 2f; WeaponFx.Emit(ps, val, 1, dir, null, 0.2f, velocity, 0.5f); } yield return null; } if (Object.op_Implicit((Object)(object)sun)) { Object.Destroy((Object)(object)((Component)sun).gameObject); } if (Object.op_Implicit((Object)(object)beam)) { Object.Destroy((Object)(object)((Component)beam).gameObject); } } private static void Verdict(Vector3 core) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) try { VFXManager.Play("LavaExplosion", core); VFXManager.Play("VolcanoEruption", core); } catch { } WeaponFx.Game("BiggestExplosion", core + Vector3.up * 2f, Vector3.up); BossVfx.Impact(core, 6f, Blood, Basalt); BossVfx.Shock(core, 28f, Blood, 0.9f, 0.85f); Fx.Sound("LavaWhaleDeathExplosion", core, 1f, (AudioDistance)3); Shake(core, 1f); H.Overlay(OverlayKind.White, 0.6f); } } public struct ActiveUse : IBroadcast { public Gear Gear; } public struct ActiveState : IBroadcast { public int PlayerId; public float Cooldown; } public class Actives : MonoBehaviour { public static Actives Instance; public const Key UseKey = (Key)25; public const float Lock = 3f; private readonly Dictionary _readyAt = new Dictionary(); private float _myReadyAt; private float _myCooldown = 1f; private static Gear? _picked; private Image _panel; private Image _pic; private TextMeshProUGUI _label; private TextMeshProUGUI _count; private Hud.Bar _bar; private NetworkManager _registeredOn; public bool ClientHasActive { get { if (Object.op_Implicit((Object)(object)Loot.Instance)) { return Owned(Loot.Instance.ClientVault).Count > 0; } return false; } } static Actives() { GenericWriter.SetWrite((Action)delegate(Writer w, ActiveUse v) { w.WriteByte((byte)v.Gear); }); GenericReader.SetRead((Func)((Reader r) => new ActiveUse { Gear = (Gear)r.ReadByte() })); GenericWriter.SetWrite((Action)delegate(Writer w, ActiveState v) { w.WriteInt32(v.PlayerId); w.WriteSingle(v.Cooldown); }); GenericReader.SetRead((Func)((Reader r) => new ActiveState { PlayerId = r.ReadInt32(), Cooldown = r.ReadSingle() })); } private void Awake() { Instance = this; } public static List<(Gear g, Rarity r)> Owned(VaultData v) { List<(Gear, Rarity)> list = new List<(Gear, Rarity)>(); foreach (Gear item in GearCatalog.All.Where(GearCatalog.IsActive)) { for (int num = 3; num >= 0; num--) { if (v.Count(item, (Rarity)num) > 0) { list.Add((item, (Rarity)num)); break; } } } return list; } private static int PickedIndex(List<(Gear g, Rarity r)> owned) { Gear? picked = _picked; int num; if (picked.HasValue) { Gear p = picked.GetValueOrDefault(); num = owned.FindIndex(((Gear g, Rarity r) x) => x.g == p); } else { num = 0; } return Mathf.Max(0, num); } private void Update() { //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, ActiveUse u, Channel ch) { Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); if (Object.op_Implicit((Object)(object)val)) { ServerUse(val, u.Gear); } }), true); networkManager.ClientManager.RegisterBroadcast((Action)delegate(ActiveState s, Channel ch) { if (Object.op_Implicit((Object)(object)Player.LocalPlayer) && s.PlayerId == ((NetworkBehaviour)Player.LocalPlayer).ObjectId) { _myCooldown = Mathf.Max(0.1f, s.Cooldown); _myReadyAt = Time.time + s.Cooldown; } }); } Keyboard current = Keyboard.current; if (current != null && ((ButtonControl)current[(Key)25]).wasPressedThisFrame && !ChatManager.IsTyping && !Hud.ModalOpen && InstanceFinder.IsClientStarted) { List<(Gear, Rarity)> list = Owned(Loot.Instance.ClientVault); if (list.Count == 0) { Hud.Banner(Hud.Keys(L10n.T("activeNone")), 2.5f); } else if (((ButtonControl)current.leftShiftKey).isPressed || ((ButtonControl)current.rightShiftKey).isPressed) { int num = (PickedIndex(list) + 1) % list.Count; _picked = list[num].Item1; Hud.Banner(Hud.Keys(L10n.T("activePicked", GearCatalog.Label(list[num].Item1, list[num].Item2), num + 1, list.Count)), 1.5f); Fx.Sound("EquipItem", Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Transform.position : Vector3.zero, 0.6f, (AudioDistance)1); } else if (!Siege.Instance.ViewActive) { Hud.Banner(L10n.T("activeRoundOnly"), 2f); } else { InstanceFinder.ClientManager.Broadcast(new ActiveUse { Gear = list[PickedIndex(list)].Item1 }, (Channel)0); } } DrawHud(); } public bool ServerUse(Player who, Gear g) { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: 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_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) if (!Siege.Instance.ServerActive || !Object.op_Implicit((Object)(object)who) || !Object.op_Implicit((Object)(object)who.Transform) || !PlayerManager.AlivePlayers.Contains(who)) { return false; } int num = Owned(Loot.Instance.Vault).FindIndex(((Gear g, Rarity r) x) => x.g == g); if (num < 0) { return false; } Rarity item = Owned(Loot.Instance.Vault)[num].r; ulong key = Loot.KeyOf(who); if (_readyAt.TryGetValue(key, out var value) && Time.time < value) { return false; } float num2 = Loot.Instance.Vault.ValueOf(g, item); Vector3 position = who.Transform.position; Vector3 forward = who.Transform.forward; forward.y = 0f; switch (g) { case Gear.Overclock: Turrets.OverclockUntil = Mathf.Max(Turrets.OverclockUntil, Time.time + num2); Fx.Announce("activeOverclock", Mathf.RoundToInt(num2)); break; case Gear.FieldRepair: { List list = BuildSystem.Instance.ServerRepairArea(position, 10f, num2); Vector3 val = (Siege.Instance.CorePos - position).Flat(); if (((Vector3)(ref val)).magnitude <= 12f && Siege.Instance.ServerHealCore(num2 * 0.5f) > 0) { list.Add(Siege.Instance.CorePos + Vector3.up * 2f); } if (list.Count == 0) { return false; } foreach (Vector3 item2 in list) { Fx.Send(FxKind.Heal, position + Vector3.up, item2 + Vector3.up * 0.5f); } Fx.Send(FxKind.Sell, position, position); break; } case Gear.Decoy: Siege.Instance.ServerDecoy(position + ((((Vector3)(ref forward)).sqrMagnitude > 0.01f) ? ((Vector3)(ref forward)).normalized : Vector3.forward) * 2.5f, num2); break; case Gear.NetCannon: if (FortressNet.Instance.ServerNetCount(((NetworkBehaviour)who).ObjectId) >= FortressNet.Instance.ServerCapOf(((NetworkBehaviour)who).ObjectId)) { return false; } FortressNet.Instance.ServerScoopAround(who, num2); break; case Gear.Shockwave: if (Siege.Instance.ServerShockwave(position, 6f, num2, Mathf.RoundToInt(40f * FortressPlugin.Instance.WaveHpMult), who) == 0) { return false; } break; } Loot.Instance.Vault.Add(g, item, -1); Loot.Instance.SaveVault(); _readyAt[key] = Time.time + 3f; InstanceFinder.ServerManager.Broadcast(new ActiveState { PlayerId = ((NetworkBehaviour)who).ObjectId, Cooldown = 3f }, true, (Channel)0); AutoTest.Count("active_" + g); return true; } public void DebugResetCooldown(Player who) { _readyAt.Remove(Loot.KeyOf(who)); } private void DrawHud() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0157: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_026d: 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_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) List<(Gear, Rarity)> list = (List<(Gear, Rarity)>)((Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Loot.Instance)) ? ((IList)Owned(Loot.Instance.ClientVault)) : ((IList)new List<(Gear, Rarity)>())); if (list.Count <= 0 || !Object.op_Implicit((Object)(object)Siege.Instance) || !Siege.Instance.ViewActive || !Object.op_Implicit((Object)(object)Hud.Font)) { if (Object.op_Implicit((Object)(object)_panel)) { ((Component)_panel).gameObject.SetActive(false); } return; } if (!Object.op_Implicit((Object)(object)_panel)) { _panel = Hud.Box(Hud.Root, new Vector2(1f, 0f), new Vector2(-24f, 264f), new Vector2(320f, 62f), Hud.Panel, 16f); _pic = Hud.PictureSlot(((Component)_panel).transform, new Vector2(0f, 0.5f), new Vector2(6f, 0f), new Vector2(52f, 52f)); Transform transform = ((Component)_panel).transform; Vector2 anchor = new Vector2(0f, 1f); Vector2 pos = new Vector2(64f, -8f); Vector2 box = new Vector2(200f, 30f); Vector2? pivot = new Vector2(0f, 1f); _label = Hud.Label(transform, "", 21f, anchor, pos, box, (TextAlignmentOptions)257, null, bold: false, outline: false, pivot); ((TMP_Text)_label).enableWordWrapping = false; ((TMP_Text)_label).enableAutoSizing = true; ((TMP_Text)_label).fontSizeMin = 14f; ((TMP_Text)_label).fontSizeMax = 21f; _count = Hud.Label(((Component)_panel).transform, "", 16f, new Vector2(1f, 1f), new Vector2(-10f, -10f), new Vector2(50f, 26f), (TextAlignmentOptions)260, (Color?)Hud.Muted, bold: false, outline: false, (Vector2?)new Vector2(1f, 1f)); _bar = Hud.Bar.Make(((Component)_panel).transform, new Vector2(0f, 0f), new Vector2(64f, 12f), new Vector2(242f, 10f), Hud.Accent); } ((Component)_panel).gameObject.SetActive(true); int num = PickedIndex(list); var (g, r) = list[num]; ((TMP_Text)_count).text = ((list.Count > 1) ? $"{num + 1}/{list.Count}" : ""); Hud.ShowPicture(_pic, "Gear" + g); float num2 = _myReadyAt - Time.time; bool flag = num2 <= 0f; string text = (flag ? ("" + L10n.T("activeReady") + "") : $"{Mathf.CeilToInt(num2)}s"); int num3 = GearCatalog.Rarities.Sum((Rarity x) => Loot.Instance.ClientVault.Count(g, x)); ((TMP_Text)_label).text = Hud.Keys($"[K] {GearCatalog.Name(g)} ×{num3} {text}"); _bar.Set(flag ? 1f : (1f - num2 / _myCooldown), flag ? Hud.Good : Hud.Accent); } } public class AutoTest : MonoBehaviour { public static bool IgnorePlayers; public static bool SkipBossCamera; public static bool ForceGameItem; public static readonly Dictionary Counters = new Dictionary(); private readonly StringBuilder _report = new StringBuilder(); private string _scenario; private string _arg; private float _t0; private static readonly List<(PieceType type, float r, float sideOffset, int gap)> Plan = BuildPlan(); public static bool Running { get; private set; } private static string Root => Paths.BepInExRootPath; public static void Count(string key, int n = 1) { if (Running) { Counters.TryGetValue(key, out var value); Counters[key] = value + n; } } private void Start() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown string path = Path.Combine(Root, "fortress-autotest.txt"); if (File.Exists(path)) { string[] source = File.ReadAllLines(path); _scenario = source.FirstOrDefault()?.Trim() ?? "probe"; _arg = source.Skip(1).FirstOrDefault()?.Trim() ?? ""; File.Delete(path); Running = true; FortressIsland.ForceForTest = true; ((BaseUnityPlugin)FortressPlugin.Instance).Config.SaveOnConfigSet = false; Application.logMessageReceived += new LogCallback(OnLog); ((MonoBehaviour)this).StartCoroutine(Run()); } } private void Note(string line) { string text = $"[{Time.realtimeSinceStartup - _t0,6:0.0}s] {line}"; _report.AppendLine(text); BuildSystem.Log.LogInfo((object)("AutoTest " + text)); } private unsafe void OnLog(string msg, string stack, LogType type) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) if ((int)type == 4 || (int)type == 0) { Count("errors"); if (Counters["errors"] <= 15) { _report.AppendLine(" ! " + ((object)(*(LogType*)(&type))/*cast due to .constrained prefix*/).ToString() + ": " + msg.Split('\n')[0] + " @ " + stack.Split('\n').FirstOrDefault()); } } } private IEnumerator Until(Func cond, float timeout, string what) { float end = Time.realtimeSinceStartup + timeout; while (Time.realtimeSinceStartup < end) { bool flag; try { flag = cond(); } catch { flag = false; } if (flag) { yield break; } yield return (object)new WaitForSecondsRealtime(0.5f); } Note("TIMEOUT waiting for " + what); } private IEnumerator Run() { _t0 = Time.realtimeSinceStartup; Note("scenario = " + _scenario); yield return Until(() => (Object)(object)ConnectionManager.Instance != (Object)null && Time.realtimeSinceStartup - _t0 > 6f, 60f, "main menu"); try { SaveManager.LoadAllServers(); if (SaveManager.ServerSaves.Any((ServerSaveObject s) => s.Name == "FortressTest")) { SaveManager.SelectServer("FortressTest"); } else { SaveManager.CreateServer("FortressTest", false, false, (Difficulty)1); } ConnectionManager.Instance.CreateOfflineLobby(); SaveManager.OnServerLoaded(); Note("hosting offline lobby on save FortressTest"); } catch (Exception ex) { Note("FAILED to host: " + ex); } yield return Until(() => Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Player.LocalPlayer.Transform) && IslandManager.IsInitialized && !IslandManager.IsLoading && Object.op_Implicit((Object)(object)Island.CurIsland), 400f, "world + local player"); yield return (object)new WaitForSecondsRealtime(6f); Probe(); FortressPlugin.Shot("test_spawn"); yield return (object)new WaitForSecondsRealtime(2f); switch (_scenario) { case "siege": yield return SiegeScenario(); break; case "enemies": yield return EnemiesScenario(); break; case "build": yield return BuildScenario(); break; case "balance": yield return BalanceScenario(); break; case "boss": yield return BossScenario(); break; case "coop": yield return CoopScenario(); break; case "cheats": yield return CheatsScenario(); break; case "loot": yield return LootScenario(); break; case "gear": yield return GearScenario(); break; case "ui": yield return UiScenario(); break; case "construct": yield return ConstructScenario(); break; case "newfoes": yield return NewFoesScenario(); break; case "gear2": yield return Gear2Scenario(); break; case "tips": yield return TipsScenario(); break; case "gear3": yield return Gear3Scenario(); break; case "weapons": yield return WeaponsScenario(); break; case "fx": yield return FxScenario(); break; case "npc": yield return NpcScenario(); break; case "village": yield return VillageScenario(); break; case "towers": yield return TowersScenario(); break; case "lamps": yield return LampsScenario(); break; case "absorber": yield return AbsorberScenario(); break; case "people": yield return PeopleScenario(); break; case "shopref": yield return ShopRefScenario(); break; case "stall": yield return StallLookScenario(); break; case "branchwalk": yield return BranchWalkScenario(); break; case "sharkaim": yield return SharkAimScenario(); break; case "ladder": yield return LadderScenario(); break; case "bossprobe": yield return BossProbeScenario(); break; case "bosses": yield return BossesScenario(); break; case "loot2": yield return Loot2Scenario(); break; case "rarity": yield return RarityScenario(); break; case "reveal": yield return RevealScenario(); break; case "vault2": yield return Vault2Scenario(); break; case "bossintro": yield return BossIntroScenario(); break; case "bodies": yield return BodiesScenario(); break; case "bossfx": yield return BossFxScenario(); break; case "playtest": yield return PlaytestScenario(); break; case "guns": yield return GunsScenario(); break; case "helpers": yield return HelpersScenario(); break; case "helperlook": yield return HelperLookScenario(); break; case "npcref": yield return NpcRefScenario(); break; case "worldref": yield return WorldRefScenario(); break; case "townref": yield return TownRefScenario(); break; case "cabinref": yield return CabinRefScenario(); break; case "villagelook": yield return VillageLookScenario(); break; case "hotbardrag": yield return HotbarDragScenario(); break; case "mods": yield return ModsScenario(); break; case "bossguard": yield return BossGuardScenario(); break; case "batch8": yield return Batch8Scenario(); break; case "prices": yield return PricesScenario(); break; case "hook": _arg = "hook"; yield return Batch8Scenario(); break; default: yield return IslandScenario(); break; case "probe": break; } Finish(); } private void Probe() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) Vector3 position = Player.LocalPlayer.Transform.position; object[] obj = new object[4] { position, WaterManager.GetWaterHeight(position), null, null }; LayerMask levelLayer = GameInfo.LevelLayer; obj[2] = ((LayerMask)(ref levelLayer)).value; obj[3] = BuildSystem.PieceLayer; Note(string.Format("player at {0}, water there {1:0.00}, ground layer mask {2}, piece layer {3}", obj)); Note($"current island '{((Object)Island.CurIsland).name}' at {Island.IslandPos} size {Island.IslandSize}; CurIsland idx {OnlineIslandManager.CurIsland}, max unlocked {OnlineIslandManager.MaxIslandUnlocked}, total {IslandManager.TotalIslands}"); DumpGameFx(); IEnumerable values = (from f in Resources.FindObjectsOfTypeAll().Where(delegate(MeshFilter f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)f) && Object.op_Implicit((Object)(object)f.sharedMesh)) { Scene scene = ((Component)f).gameObject.scene; if (((Scene)(ref scene)).IsValid()) { return Regex.IsMatch(((Object)f).name + " " + ((Object)f.sharedMesh).name, "(?i)palm|tree|coconut|leaf|trunk"); } } return false; }) group f by ((Object)f.sharedMesh).name into g select $"{g.Key} x{g.Count()} (e.g. {PathOf(((Component)g.First()).transform)})").Take(15); Note("game trees: " + string.Join("; ", values)); for (int num = 0; num < 12; num++) { IslandInfo val = null; try { val = IslandManager.GetIslandInfo(num); } catch { } if (val == null) { break; } string text = ""; try { text = ((object)val.IslandPosition/*cast due to .constrained prefix*/).ToString(); } catch { text = "n/a"; } Note($" island info {num}: spawn {text}, archived {val.ArchivedIslandPosition}"); } Note("final boss killed: " + (Object.op_Implicit((Object)(object)NPCManager.Instance) ? NPCManager.Instance.FinalBossKilled.ToString() : "no NPCManager")); Models.Make(Color.white); IDictionary dictionary = AccessTools.Field(typeof(AudioManager), "_realClips")?.GetValue(null) as IDictionary; if (dictionary != null) { File.WriteAllText(Path.Combine(Root, "fortress-sounds.txt"), string.Join("\n", from object k in dictionary.Keys select k.ToString() into k orderby k select k)); } Note("sound clips: " + (dictionary?.Count ?? (-1))); IEnumerable values2 = from kv in (Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null) where Object.op_Implicit((Object)(object)kv.Value) && !Object.op_Implicit((Object)(object)((Component)kv.Value).GetComponent()) orderby kv.Key select string.Format("{0}|{1}|{2}|{3}", kv.Key, kv.Value.Type, kv.Value.DefaultWorth, string.Join(",", (from val4 in ((Component)kv.Value).GetComponents() select ((object)val4).GetType().Name into n where n != "Item" && !n.StartsWith("Network") select n).Distinct())); File.WriteAllText(Path.Combine(Root, "fortress-items.txt"), string.Join("\n", values2)); Item value; Item val2 = (((Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null)).TryGetValue("dripper", out value) ? value : null); if (Object.op_Implicit((Object)(object)val2)) { Renderer[] componentsInChildren = ((Component)val2).GetComponentsInChildren(true); foreach (Renderer val3 in componentsInChildren) { foreach (Material m in val3.sharedMaterials.Where((Material x) => Object.op_Implicit((Object)(object)x))) { Shader sh = m.shader; IEnumerable values3 = from i in Enumerable.Range(0, sh.GetPropertyCount()) select sh.GetPropertyName(i) + ":" + ((object)sh.GetPropertyType(i)/*cast due to .constrained prefix*/).ToString() + (((int)sh.GetPropertyType(i) == 4) ? ("=" + (Object.op_Implicit((Object)(object)m.GetTexture(sh.GetPropertyName(i))) ? ((Object)m.GetTexture(sh.GetPropertyName(i))).name : "null")) : ""); Note("dripper renderer " + ((Object)val3).name + " (" + ((object)val3).GetType().Name + ") material " + ((Object)m).name + " shader " + ((Object)sh).name + ": " + string.Join(", ", values3)); } } } IOrderedEnumerable second = from x in (from i in Resources.FindObjectsOfTypeAll() where Object.op_Implicit((Object)(object)i.sprite) select i).Select(delegate(Image i) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) object[] obj4 = new object[7] { ((Object)i.sprite).name, null, null, null, null, null, null }; Rect rect = i.sprite.rect; obj4[1] = ((Rect)(ref rect)).width; rect = i.sprite.rect; obj4[2] = ((Rect)(ref rect)).height; obj4[3] = i.sprite.border; obj4[4] = i.type; obj4[5] = ((Graphic)i).color; obj4[6] = PathOf(((Component)i).transform); return string.Format("{0}|{1}x{2}|border {3}|{4}|{5}|{6}", obj4); }).Distinct() orderby x select x; IEnumerable first = from f in Resources.FindObjectsOfTypeAll() select "FONT " + ((Object)f).name; File.WriteAllText(Path.Combine(Root, "fortress-ui.txt"), string.Join("\n", first.Concat(second))); static string PathOf(Transform t) { List list = new List(); while (Object.op_Implicit((Object)(object)t)) { list.Add(((Object)t).name); t = t.parent; } list.Reverse(); return string.Join("/", list); } } private IEnumerator SiegeScenario() { FortressPlugin plugin = FortressPlugin.Instance; plugin.StartRound(Player.LocalPlayer.Transform.position); yield return (object)new WaitForSecondsRealtime(1f); Vector3 corePos = Siege.Instance.CorePos; Note($"round started, core at {corePos}"); float num = 3f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor((Mathf.Floor(corePos.x / num) + 0.5f) * num, Mathf.Floor((corePos.y + 0.25f) / num) * num, (Mathf.Floor(corePos.z / num) + 0.5f) * num); int num2 = 0; for (int i = -1; i <= 1; i++) { num2 += (BuildSystem.Instance.ServerPlace(PieceType.Wall, val + new Vector3((float)i * num, num * 0.5f, 2.5f * num), 0f) ? 1 : 0); num2 += (BuildSystem.Instance.ServerPlace(PieceType.Wall, val + new Vector3((float)i * num, num * 0.5f, -1.5f * num), 0f) ? 1 : 0); num2 += (BuildSystem.Instance.ServerPlace(PieceType.Wall, val + new Vector3(2.5f * num, num * 0.5f, (float)i * num), 90f) ? 1 : 0); num2 += (BuildSystem.Instance.ServerPlace(PieceType.Wall, val + new Vector3(-1.5f * num, num * 0.5f, (float)i * num), 90f) ? 1 : 0); } num2 += (BuildSystem.Instance.ServerPlace(PieceType.Gun, val + new Vector3(num, 0.2f, 0f), 0f) ? 1 : 0); num2 += (BuildSystem.Instance.ServerPlace(PieceType.Cannon, val + new Vector3(0f - num, 0.2f, num), 0f) ? 1 : 0); Note($"placed {num2} pieces, coins left {Siege.Instance.ServerCoins}"); Player.LocalPlayer.LocalTeleport(corePos + new Vector3(0f, 0.5f, -9f), 0f, true); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("test_built"); plugin.SkipBuildTime(); float end = Time.realtimeSinceStartup + 150f; int lastWave = 0; while (Time.realtimeSinceStartup < end && plugin.Running) { if (plugin.Wave != lastWave) { lastWave = plugin.Wave; Note($"wave {lastWave} spawned: {FortressPlugin.Alive.Count} alive, core {Siege.Instance.CoreHp}"); } if (plugin.InBuildTime && plugin.Wave >= 3) { break; } if (plugin.InBuildTime) { plugin.SkipBuildTime(); } yield return (object)new WaitForSecondsRealtime(1f); if (Mathf.FloorToInt(Time.realtimeSinceStartup) % 12 == 0) { FortressPlugin.Shot("test_fight"); } } Note($"end of fight: wave {plugin.Wave}, alive {FortressPlugin.Alive.Count}, core {Siege.Instance.CoreHp}, coins {Siege.Instance.ServerCoins}, running {plugin.Running}"); FortressPlugin.Shot("test_end"); yield return (object)new WaitForSecondsRealtime(2f); } private IEnumerator Look(Vector3 pos, float yaw, string shot, float settle = 1.5f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Vector3(pos.x, pos.y + 40f, pos.z), Vector3.down, ref val, 80f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { pos.y = ((RaycastHit)(ref val)).point.y + 1.1f; } Player.LocalPlayer.LocalTeleport(pos, yaw, true); yield return (object)new WaitForSecondsRealtime(settle); if (shot != null) { FortressPlugin.Shot(shot); } yield return (object)new WaitForSecondsRealtime(0.5f); } private static float YawTo(Vector3 from, Vector3 to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = to - from; return Mathf.Atan2(val.x, val.z) * 57.29578f; } private void DumpView(string tag) { //IL_006b: 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_00f8: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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_0212: Unknown result type (might be due to invalid IL or missing references) Camera curCamera = GameInfo.CurCamera; if (!Object.op_Implicit((Object)(object)curCamera)) { Note(tag + ": no camera"); return; } Note(string.Format("{0}: camera {1} near {2:F2} fov {3:F0} mask {4:X} scale {5:F2}; cameras {6}", tag, ((Object)curCamera).name, curCamera.nearClipPlane, curCamera.fieldOfView, curCamera.cullingMask, ((Component)curCamera).transform.lossyScale.x, string.Join(", ", Camera.allCameras.Select((Camera c) => $"{((Object)c).name} d{c.depth} m{c.cullingMask:X}")))); Renderer[] array = Object.FindObjectsOfType(); foreach (Renderer val in array) { if (val.enabled && !val.forceRenderingOff && ((Component)val).gameObject.activeInHierarchy) { Bounds bounds = val.bounds; Vector3 val2 = ((Component)curCamera).transform.InverseTransformPoint(((Bounds)(ref bounds)).center); if (!(val2.z < -0.3f) && !(((Vector3)(ref val2)).magnitude > 2.5f)) { Vector3 val3 = curCamera.WorldToViewportPoint(((Bounds)(ref bounds)).center); Material sharedMaterial = val.sharedMaterial; object[] obj = new object[10] { PathOf(((Component)val).transform), ((object)val).GetType().Name, ((Component)val).gameObject.layer, val2, val3.x, val3.y, null, null, null, null }; Vector3 size = ((Bounds)(ref bounds)).size; obj[6] = ((Vector3)(ref size)).magnitude; obj[7] = ((Bounds)(ref bounds)).size; obj[8] = (Object.op_Implicit((Object)(object)sharedMaterial) ? $"{((Object)sharedMaterial).name}/{((Object)sharedMaterial.shader).name} q{sharedMaterial.renderQueue}" : "-"); obj[9] = val.shadowCastingMode; Note(string.Format(" {0} [{1} layer {2}] cam {3:F2} screen ({4:F2}, {5:F2}) size {6:F2} box {7:F2}, {8}, shadows {9}", obj)); } } } } private static string PathOf(Transform t) { if (!Object.op_Implicit((Object)(object)t.parent)) { return ((Object)t).name; } return PathOf(t.parent) + "/" + ((Object)t).name; } private static void Aim(float yaw, float pitch) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) PlayerCamera val = (Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Camera : null); FieldInfo fieldInfo = (Object.op_Implicit((Object)(object)val) ? AccessTools.Field(typeof(PlayerCamera), "_rot") : null); if (fieldInfo != null) { fieldInfo.SetValue(val, (object)new Vector3(pitch, yaw, 0f)); } } private static void ClearLooseWeapons() { Item[] array = Object.FindObjectsOfType(); foreach (Item val in array) { if (Object.op_Implicit((Object)(object)val) && ((NetworkBehaviour)val).IsSpawned && !Object.op_Implicit((Object)(object)val.Holder) && WeaponItems.Is(val, out var _, out var _)) { val.DestroyItem((byte)0, byte.MaxValue); } } } private static void SaveTexture(Texture tex, string path) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) RenderTexture temporary = RenderTexture.GetTemporary(tex.width, tex.height, 0, (RenderTextureFormat)0); Graphics.Blit(tex, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val = new Texture2D(tex.width, tex.height, (TextureFormat)4, false); val.ReadPixels(new Rect(0f, 0f, (float)tex.width, (float)tex.height), 0, 0); val.Apply(); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); File.WriteAllBytes(path, ImageConversion.EncodeToPNG(val)); Object.Destroy((Object)(object)val); } private void DumpGameFx() { //IL_0271: 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_0745: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Expected I4, but got Unknown //IL_083c: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_07c7: Unknown result type (might be due to invalid IL or missing references) try { if (AccessTools.Field(typeof(ParticleManager), "_particles").GetValue(null) is IDictionary dictionary) { foreach (DictionaryEntry item in dictionary) { object? value = AccessTools.Field(item.Value.GetType(), "ParticleSystem").GetValue(item.Value); ParticleSystem val = (ParticleSystem)((value is ParticleSystem) ? value : null); ParticleSystemRenderer val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); Note(string.Format("fx particle {0}: {1}, children {2}", item.Key, Object.op_Implicit((Object)(object)val2) ? string.Format("{0}, mesh {1}, {2}, trail {3}", val2.renderMode, Object.op_Implicit((Object)(object)val2.mesh) ? ((Object)val2.mesh).name : "-", Mat(((Renderer)val2).sharedMaterial), Mat(val2.trailMaterial)) : "-", Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponentsInChildren().Length : 0)); } } if (AccessTools.Field(typeof(VFXManager), "_allVfx").GetValue(null) is IDictionary dictionary2) { foreach (DictionaryEntry item2 in dictionary2) { object? obj = item2.Value?.GetType().GetProperty("visualEffectAsset")?.GetValue(item2.Value); Object val3 = (Object)((obj is Object) ? obj : null); Note(string.Format("fx vfx {0}: {1}", item2.Key, Object.op_Implicit(val3) ? val3.name : "-")); } } ProjectileType[] array = (Object.op_Implicit((Object)(object)ProjectileManager.Instance) ? (AccessTools.Field(typeof(ProjectileManager), "_types").GetValue(ProjectileManager.Instance) as ProjectileType[]) : null); if (array != null) { for (int i = 0; i < array.Length; i++) { Note($"fx projectile {i}: mesh {array[i].MeshInstance} x{array[i].MeshScale}, hitscan {array[i].IsHitScan} fade {array[i].HitScanLineFadeSpeed}, hit {array[i].HitParticle}, landed {array[i].LandedMeshInstance}, decal {array[i].LandedDecal}, width {array[i].WidthRadius}"); } } if (AccessTools.Field(typeof(InstanceManager), "_instanceTypeDic").GetValue(null) is Dictionary dictionary3) { Note("fx instances: " + string.Join("; ", dictionary3.Values.Select((InstanceType t) => t.Name + " (" + (Object.op_Implicit((Object)(object)t.Mesh) ? ((Object)t.Mesh).name : "-") + ", " + Mat(t.Material) + (t.UseParents ? ", parents" : "") + ")"))); } foreach (Item it in ((Dictionary)AccessTools.Field(typeof(GameInfo), "_allItems").GetValue(null)).Values.Where((Item val4) => val4 is Weapon)) { IEnumerable values = from f in ((object)it).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where f.FieldType == typeof(string) && f.GetValue(it) is string text3 && text3.Length > 0 select $"{f.Name}={f.GetValue(it)}"; Note("fx weapon " + ((Object)it).name + ": " + string.Join(", ", values)); } string[] array2 = new string[12] { "Universal Render Pipeline/Particles/Unlit", "Universal Render Pipeline/Particles/Simple Lit", "Universal Render Pipeline/Particles/Lit", "Universal Render Pipeline/Unlit", "Universal Render Pipeline/Lit", "Sprites/Default", "UI/Default", "Legacy Shaders/Particles/Additive", "Particles/Standard Unlit", "Unlit/Transparent", "Unlit/Color", "Hidden/Internal-Colored" }; foreach (string text in array2) { Note("fx shader " + text + ": " + (Object.op_Implicit((Object)(object)Shader.Find(text)) ? "yes" : "no")); } foreach (IGrouping item3 in (from m in Resources.FindObjectsOfTypeAll() where Object.op_Implicit((Object)(object)m) && m.renderQueue >= 2450 group m by (!Object.op_Implicit((Object)(object)m.shader)) ? "-" : ((Object)m.shader).name into g orderby g.Count() descending select g).Take(25)) { Note(string.Format("fx see-through {0} x{1}: {2}", item3.Key, item3.Count(), string.Join(", ", from m in item3.Take(8) select $"{((Object)m).name} q{m.renderQueue}"))); } IOrderedEnumerable values2 = from n in (from x in Resources.FindObjectsOfTypeAll() select ((Object)x).name into n where !n.StartsWith("Hidden/") select n).Distinct() orderby n select n; Note("fx shaders loaded: " + string.Join(", ", values2)); string text2 = Path.Combine(Paths.BepInExRootPath, "fortress-shots"); Directory.CreateDirectory(text2); foreach (Material item4 in from x in Resources.FindObjectsOfTypeAll() where Object.op_Implicit((Object)(object)x) && new string[10] { "DustParticles", "BloodParticle", "WaterParticle", "WaterParticleWhite", "SplashParticle", "EmissiveParticle", "ExplosionParticle", "AshesParticle", "PoopParticles", "SpitParticle" }.Contains(((Object)x).name) group x by ((Object)x).name into g select g.First()) { Shader shader = item4.shader; List list = new List(); for (int num2 = 0; num2 < shader.GetPropertyCount(); num2++) { string propertyName = shader.GetPropertyName(num2); ShaderPropertyType propertyType = shader.GetPropertyType(num2); switch ((int)propertyType) { case 4: { Texture texture = item4.GetTexture(propertyName); list.Add(propertyName + "=tex:" + (Object.op_Implicit((Object)(object)texture) ? $"{((Object)texture).name} {texture.width}x{texture.height} {texture.filterMode}" : "-")); if (Object.op_Implicit((Object)(object)texture)) { SaveTexture(texture, Path.Combine(text2, "tex_" + ((Object)item4).name + "_" + propertyName + ".png")); } break; } case 0: list.Add($"{propertyName}={item4.GetColor(propertyName)}"); break; case 1: list.Add($"{propertyName}={item4.GetVector(propertyName)}"); break; default: list.Add($"{propertyName}={item4.GetFloat(propertyName):0.##}"); break; } } Note("fx material " + ((Object)item4).name + " [" + ((Object)shader).name + "] keywords " + string.Join(" ", item4.shaderKeywords) + ": " + string.Join(", ", list)); } } catch (Exception ex) { Note("fx dump failed: " + ex); } static string Mat(Material m) { if (!Object.op_Implicit((Object)(object)m)) { return "-"; } return string.Format("{0}/{1} q{2}", ((Object)m).name, Object.op_Implicit((Object)(object)m.shader) ? ((Object)m.shader).name : "-", m.renderQueue); } } private static bool WallAt(Vector3 world, Vector3 outward) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) float num = 3f; int num2 = Mathf.FloorToInt(world.x / num); int num3 = Mathf.FloorToInt(world.z / num); float num4 = (float)Mathf.FloorToInt((world.y + 0.25f) / num) * num; if (Mathf.Abs(outward.x) >= Mathf.Abs(outward.z)) { return BuildSystem.Instance.ServerPlace(PieceType.Wall, new Vector3((float)(num2 + ((outward.x > 0f) ? 1 : 0)) * num, num4 + num * 0.5f, ((float)num3 + 0.5f) * num), 90f); } return BuildSystem.Instance.ServerPlace(PieceType.Wall, new Vector3(((float)num2 + 0.5f) * num, num4 + num * 0.5f, (float)(num3 + ((outward.z > 0f) ? 1 : 0)) * num), 0f); } private static bool TurretAt(PieceType t, Vector3 world) { //IL_0008: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) float num = 3f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor((Mathf.Floor(world.x / num) + 0.5f) * num, world.y + 5f, (Mathf.Floor(world.z / num) + 0.5f) * num); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, 12f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { val.y = ((RaycastHit)(ref val2)).point.y; } else { val.y = world.y; } return BuildSystem.Instance.ServerPlace(t, val, 0f); } private IEnumerator IslandScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); Note($"fortress island at {island.Center}, core {island.CorePos}"); GameObject obj = GameObject.Find("FortressIsland"); Renderer[] array = ((obj != null) ? obj.GetComponentsInChildren() : null); RaycastHit val = default(RaycastHit); bool flag = Physics.Raycast(island.Center + Vector3.up * 50f, Vector3.down, ref val, 100f, LayerMask.op_Implicit(GameInfo.LevelLayer)); AutoTest autoTest = this; object[] obj2 = new object[5] { (array != null) ? array.Length : (-1), (array != null && array.Length != 0) ? ((object)array[0].bounds/*cast due to .constrained prefix*/).ToString() : "-", array != null && array.Length != 0 && array[0].enabled, null, null }; GameObject obj3 = GameObject.Find("FortressIsland"); obj2[3] = ((obj3 != null) ? new int?(obj3.layer) : ((int?)null)); obj2[4] = (flag ? (((object)((RaycastHit)(ref val)).point/*cast due to .constrained prefix*/).ToString() + " on " + ((Object)((RaycastHit)(ref val)).collider).name) : "MISS"); autoTest.Note(string.Format("island renderers {0}, bounds {1}, enabled {2}, layer {3}, ground ray {4}", obj2)); Camera curCamera = GameInfo.CurCamera; Note($"camera cull mask {(Object.op_Implicit((Object)(object)curCamera) ? curCamera.cullingMask : 0)}, far {(Object.op_Implicit((Object)(object)curCamera) ? curCamera.farClipPlane : 0f)}"); Vector3 center = island.Center; PlayerManager.ToggleGodMode(); yield return Look(island.DockPos, YawTo(island.DockPos, center), "isl_dock", 3f); Vector3 high = center + new Vector3(24f, 0f, 0f); yield return Look(high, YawTo(high, center), "isl_overview", 2f); Player.LocalPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("isl_ready"); yield return Until(() => FortressPlugin.Instance.Running, 15f, "round start from ready circle"); Note("round running: " + FortressPlugin.Instance.Running); if (!FortressPlugin.Instance.Running) { yield break; } Siege.Instance.ServerAddCoins(Siege.Money(2000)); int num = 0; float[] gapAngles = FortressIsland.GapAngles; Vector3 val2 = default(Vector3); foreach (float num3 in gapAngles) { ((Vector3)(ref val2))..ctor(Mathf.Cos(num3 * (MathF.PI / 180f)), 0f, Mathf.Sin(num3 * (MathF.PI / 180f))); Vector3 val3 = Vector3.Cross(Vector3.up, val2); for (int num4 = -1; num4 <= 1; num4++) { num += (WallAt(center + val2 * 15f + val3 * ((float)num4 * 3f) + Vector3.up * 1.2f, val2) ? 1 : 0); } num += (TurretAt(PieceType.Gun, center + val2 * 9f + Vector3.up * 1.2f) ? 1 : 0); } num += (TurretAt(PieceType.Cannon, center + new Vector3(4f, 1.45f, 3f)) ? 1 : 0); Note($"placed {num} pieces, coins {Siege.Instance.ServerCoins}"); yield return Look(high, YawTo(high, center), "isl_built", 2f); float num5 = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(Mathf.Cos(num5), 0f, Mathf.Sin(num5)); Vector3 val5 = center + val4 * 9.5f; BuildSystem.Instance.DebugSetBuilding(on: true, PieceType.Harpoon); yield return Look(val5, YawTo(val5, center + val4 * 15f), "isl_buildmode"); BuildSystem.Instance.DebugSetBuilding(on: false, PieceType.Wall); Vector3 val6 = island.CounterPos + new Vector3(-3f, 0f, -1.5f); yield return Look(val6, YawTo(val6, island.CounterPos), "isl_crate", 1.2f); FortressPlugin plugin = FortressPlugin.Instance; plugin.SkipBuildTime(); float end = Time.realtimeSinceStartup + 200f; int lastWave = 0; int view = 0; while (Time.realtimeSinceStartup < end && plugin.Running) { if (plugin.Wave != lastWave) { lastWave = plugin.Wave; Note($"wave {lastWave}: {FortressPlugin.Alive.Count} enemies, core {Siege.Instance.CoreHp}"); } if (plugin.InBuildTime && plugin.Wave >= 3) { break; } if (plugin.InBuildTime) { plugin.SkipBuildTime(); } float num6 = FortressIsland.GapAngles[view++ % 3] * (MathF.PI / 180f); Vector3 val7 = center + new Vector3(Mathf.Cos(num6), 0f, Mathf.Sin(num6)) * 6f; yield return Look(val7, YawTo(val7, center + new Vector3(Mathf.Cos(num6), 0f, Mathf.Sin(num6)) * 25f), "isl_fight", 6f); } Note($"fight over: wave {plugin.Wave}, enemies {FortressPlugin.Alive.Count}, core {Siege.Instance.CoreHp}, running {plugin.Running}"); if (plugin.Running) { Siege.Instance.ServerDamageCoreForTest(100000); yield return (object)new WaitForSecondsRealtime(1.5f); } yield return Look(center + new Vector3(0f, 2.5f, -12f), 0f, "isl_results", 2f); } private IEnumerator EnemiesScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); Vector3 center = island.Center; Player.LocalPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => FortressPlugin.Instance.Running, 15f, "round start"); if (!FortressPlugin.Instance.Running) { yield break; } Siege.Instance.ServerAddCoins(Siege.Money(5000)); float[] gapAngles = FortressIsland.GapAngles; Vector3 val = default(Vector3); foreach (float num2 in gapAngles) { ((Vector3)(ref val))..ctor(Mathf.Cos(num2 * (MathF.PI / 180f)), 0f, Mathf.Sin(num2 * (MathF.PI / 180f))); Vector3 val2 = Vector3.Cross(Vector3.up, val); for (int num3 = -1; num3 <= 1; num3++) { WallAt(center + val * 15f + val2 * ((float)num3 * 3f) + Vector3.up * 1.2f, val); } } FortressPlugin plugin = FortressPlugin.Instance; Vector3 row = center + new Vector3(0f, FortressIsland.CoreLocal.y + 0.3f, 4.5f); (EnemyKind, bool)[] array = new(EnemyKind, bool)[6] { (EnemyKind.Runner, false), (EnemyKind.Charger, false), (EnemyKind.Spitter, false), (EnemyKind.Bomber, false), (EnemyKind.Tank, false), (EnemyKind.Runner, true) }; List shown = new List(); for (int num4 = 0; num4 < array.Length; num4++) { shown.Add(plugin.DebugShowcase(array[num4].Item1, array[num4].Item2, row + new Vector3(((float)num4 - 2.5f) * 1.6f, 0f, 0f), 180f)); } yield return (object)new WaitForSecondsRealtime(0.8f); yield return Look(row + new Vector3(0f, 0.3f, 3.6f), 180f, "gallery", 0.6f); foreach (Creature item in shown) { if (Object.op_Implicit((Object)(object)item)) { item.ServerChangeHp(1000000); } } yield return (object)new WaitForSecondsRealtime(1f); HashSet seen = new HashSet(); int[] array2 = new int[5] { 3, 5, 6, 8, 10 }; foreach (int w in array2) { Siege.Instance.DamageCore(-100000); plugin.DebugJumpToWave(w); yield return (object)new WaitForSecondsRealtime(5f); Note($"wave {w}: {FortressPlugin.Alive.Count} enemies, boss hp {Siege.Instance.View.BossHp}/{Siege.Instance.View.BossMax}"); foreach (KeyValuePair item2 in Enemies.Instance.ServerAll.ToList()) { string text = item2.Value.Kind.ToString() + (item2.Value.Elite ? "_elite" : ""); if (!seen.Contains(text) && Object.op_Implicit((Object)(object)item2.Key)) { seen.Add(text); Vector3 position = ((Component)item2.Key).transform.position; Vector3 val3 = position - center; val3.y = 0f; Vector3 val4 = position - ((Vector3)(ref val3)).normalized * (EnemyCatalog.IsBoss(item2.Value.Kind) ? 14f : 4f); Note(string.Format(" {0} at {1}, scale {2:0.00}, gear {3}", text, position, ((Component)item2.Key).transform.localScale.x, ((Component)item2.Key).GetComponentsInChildren().Count((Transform x) => ((Object)x).name.EndsWith("Gear")))); yield return Look(val4, YawTo(val4, position), "enemy_" + text, 1.2f); } } yield return (object)new WaitForSecondsRealtime(4f); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(2f); } Note("core " + Siege.Instance.CoreHp); } private IEnumerator BuildScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); Vector3 center = island.Center; Player.LocalPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => FortressPlugin.Instance.Running, 15f, "round start"); if (!FortressPlugin.Instance.Running) { yield break; } Siege.Instance.ServerAddCoins(Siege.Money(20000)); PieceType[] array = new PieceType[5] { PieceType.Gun, PieceType.Cannon, PieceType.Harpoon, PieceType.Mortar, PieceType.Tesla }; int num = 0; Vector3 val = default(Vector3); for (int num2 = 0; num2 < FortressIsland.GapAngles.Length; num2++) { float num3 = FortressIsland.GapAngles[num2]; ((Vector3)(ref val))..ctor(Mathf.Cos(num3 * (MathF.PI / 180f)), 0f, Mathf.Sin(num3 * (MathF.PI / 180f))); Vector3 val2 = Vector3.Cross(Vector3.up, val); for (int num4 = -1; num4 <= 1; num4++) { num += (WallAt(center + val * 15f + val2 * ((float)num4 * 3f) + Vector3.up * 1.2f, val) ? 1 : 0); } num += (TurretAt(PieceType.Spikes, center + val * 19f) ? 1 : 0); num += (TurretAt(array[num2], center + val * 10f + val2 * 2f) ? 1 : 0); num += (TurretAt(array[(num2 + 3) % array.Length], center + val * 10f - val2 * 2.5f) ? 1 : 0); } Note($"placed {num}"); int num5 = 0; int num6 = 1; foreach (int item in (from p in BuildSystem.Instance.ServerPieces where Catalog.IsTurret(p.Type) select p.Id).ToList()) { BuildSystem.Instance.ServerUpgrade(item, 0); BuildSystem.Instance.ServerUpgrade(item, num6); num6 = 3 - num6; num5++; } PieceState pieceState = BuildSystem.Instance.ServerPieces.FirstOrDefault((PieceState p) => p.Type == PieceType.Wall); BuildSystem.Instance.ServerDamageArea(pieceState.Pos, 0.5f, 60); BuildSystem.Instance.ServerUpgrade(pieceState.Id, 0, repair: true); Note($"upgraded {num5}; branches: " + string.Join(", ", from p in BuildSystem.Instance.ServerPieces where Catalog.IsTurret(p.Type) select p.Type.ToString() + "L" + p.Level + "b" + p.Branch)); yield return (object)new WaitForSecondsRealtime(2f); foreach (PieceState item2 in (from p in BuildSystem.Instance.ServerPieces where Catalog.IsTurret(p.Type) group p by p.Type into gq select gq.First()).ToList()) { Vector3 pos = item2.Pos; Vector3 val3 = (center - item2.Pos).Flat(); Vector3 val4 = pos + ((Vector3)(ref val3)).normalized * 3.2f; AutoTest autoTest = this; float yaw = YawTo(val4, item2.Pos); PieceType type = item2.Type; yield return autoTest.Look(val4, yaw, "turret_" + type, 1f); } FortressPlugin plugin = FortressPlugin.Instance; int[] array2 = new int[3] { 4, 6, 8 }; for (int num7 = 0; num7 < array2.Length; num7++) { int w = array2[num7]; Siege.Instance.DamageCore(-100000); plugin.DebugJumpToWave(w); for (int i = 0; i < 4; i++) { float num8 = FortressIsland.GapAngles[i % 3] * (MathF.PI / 180f); Vector3 val5 = center + new Vector3(Mathf.Cos(num8), 0f, Mathf.Sin(num8)) * 6f; yield return Look(val5, YawTo(val5, center + new Vector3(Mathf.Cos(num8), 0f, Mathf.Sin(num8)) * 25f), "build_w" + w, 3f); } Note($"wave {w}: alive {FortressPlugin.Alive.Count}, core {Siege.Instance.CoreHp}"); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1.5f); } } private IEnumerator BalanceScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); Loot.Instance.ServerWipeVaultForTest(); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Vector3 center = island.Center; Player.LocalPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => FortressPlugin.Instance.Running, 15f, "round start"); if (!FortressPlugin.Instance.Running) { yield break; } FortressPlugin plugin = FortressPlugin.Instance; if (Siege.Instance.ServerCoins < Siege.Money(150)) { Siege.Instance.ServerAddCoins(Siege.Money(150) - Siege.Instance.ServerCoins); } int lastWave = -1; Note("dripper game max hp: " + (BuildPoolProbe() ?? "?")); float end = Time.realtimeSinceStartup + 900f; while (plugin.Running && Time.realtimeSinceStartup < end && plugin.Wave < 15) { if (plugin.InBuildTime) { SpendLikeAPlayer(center); yield return (object)new WaitForSecondsRealtime(1f); plugin.SkipBuildTime(); } if (plugin.Wave != lastWave) { lastWave = plugin.Wave; Note($"wave {plugin.Wave}: core {Siege.Instance.CoreHp}, coins {Siege.Instance.ServerCoins}, pieces {BuildSystem.Instance.ServerPieces.Count()}, enemies {FortressPlugin.Alive.Count}"); if (plugin.Wave % 3 == 0) { Vector3 pos = center + new Vector3(0f, 0f, -6f); yield return Look(pos, 0f, "bal_w" + plugin.Wave, 0.5f); } } Player me = Player.LocalPlayer; Vector3? val = (from p in FortressNet.Instance.ServerCorpsePositions() where island.OnIsland(p, 26f) select p).OrderBy(delegate(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = p - me.Transform.position; return ((Vector3)(ref val2)).sqrMagnitude; }).Cast().FirstOrDefault(); if (FortressNet.Instance.ServerNetCount(((NetworkBehaviour)me).ObjectId) >= 5 || (!val.HasValue && FortressNet.Instance.ServerNetCount(((NetworkBehaviour)me).ObjectId) > 0)) { me.LocalTeleport(island.CounterPos + new Vector3(-1.2f, 0.3f, 0f), 0f, true); } else if (val.HasValue) { me.LocalTeleport(val.Value + Vector3.up * 0.5f, 0f, true); } yield return (object)new WaitForSecondsRealtime(1f); FortressNet.Instance.ServerScoopAround(me, 2.5f); FortressNet.Instance.ServerSell(me); } Note($"balance result: reached wave {plugin.Wave}, running {plugin.Running}, core {Siege.Instance.CoreHp}"); } private IEnumerator BossScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); Vector3 center = island.Center; Player.LocalPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => FortressPlugin.Instance.Running, 15f, "round start"); if (!FortressPlugin.Instance.Running) { yield break; } Siege.Instance.ServerAddCoins(Siege.Money(1200)); SpendLikeAPlayer(center); FortressPlugin plugin = FortressPlugin.Instance; plugin.DebugJumpToWave(10); float start = Time.realtimeSinceStartup; int shots = 0; while (Time.realtimeSinceStartup - start < 260f && plugin.Running) { Creature key = Enemies.Instance.ServerAll.FirstOrDefault((KeyValuePair kv) => EnemyCatalog.IsBoss(kv.Value.Kind)).Key; if (Time.realtimeSinceStartup - start > 6f && !Object.op_Implicit((Object)(object)key)) { Note($"boss dead after {Time.realtimeSinceStartup - start:0}s, core {Siege.Instance.CoreHp}"); break; } if (Object.op_Implicit((Object)(object)key) && shots < 4 && (int)(Time.realtimeSinceStartup - start) % 20 == 0) { shots++; AutoTest autoTest = this; object arg = ((Component)key).transform.position; object arg2 = key._hp.Value; Vector3 val = (((Component)key).transform.position - Siege.Instance.CorePos).Flat(); autoTest.Note($"boss at {arg} hp {arg2}, dist to core {((Vector3)(ref val)).magnitude:0.0}"); Vector3 position = ((Component)key).transform.position; val = (center - position).Flat(); Vector3 val2 = position + ((Vector3)(ref val)).normalized * 10f; yield return Look(val2, YawTo(val2, position), "boss_" + shots, 0.8f); } yield return (object)new WaitForSecondsRealtime(1f); } Note($"boss test end: wave {plugin.Wave}, building {plugin.InBuildTime}, core {Siege.Instance.CoreHp}"); } private IEnumerator CoopScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); Vector3 center = island.Center; Player.LocalPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => FortressPlugin.Instance.Running, 15f, "round start"); if (!FortressPlugin.Instance.Running) { yield break; } Siege.Instance.ServerAddCoins(Siege.Money(250)); SpendLikeAPlayer(center); FortressPlugin plugin = FortressPlugin.Instance; plugin.SkipBuildTime(); float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gapDir = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); float end = Time.realtimeSinceStartup + 240f; bool shotBite = false; while (Time.realtimeSinceStartup < end && plugin.Running) { if (plugin.InBuildTime) { SpendLikeAPlayer(center); plugin.SkipBuildTime(); } Player me = Player.LocalPlayer; if (PlayerManager.AlivePlayers.Contains(me)) { Vector3? val = (from q in FortressNet.Instance.ServerCorpsePositions() where island.OnIsland(q, 26f) select q).Cast().FirstOrDefault(); if (FortressNet.Instance.ServerNetCount(((NetworkBehaviour)me).ObjectId) >= 5) { me.LocalTeleport(island.CounterPos + new Vector3(-1.2f, 0.3f, 0f), 0f, true); yield return (object)new WaitForSecondsRealtime(0.5f); FortressNet.Instance.ServerSell(me); } else if (val.HasValue && Random.value < 0.5f) { me.LocalTeleport(val.Value + Vector3.up * 0.5f, 0f, true); yield return (object)new WaitForSecondsRealtime(0.3f); FortressNet.Instance.ServerScoopAround(me, 2.5f); } else { Vector3 val2 = center + gapDir * 18f; me.LocalTeleport(val2, YawTo(val2, center + gapDir * 26f), true); } } if (!shotBite && Counters.TryGetValue("player_hits", out var value) && value > 0) { shotBite = true; FortressPlugin.Shot("coop_bitten"); } yield return (object)new WaitForSecondsRealtime(1.5f); } Note($"coop end: wave {plugin.Wave}, running {plugin.Running}, my hp {Player.LocalPlayer.Vitals.Health}, alive {PlayerManager.AlivePlayers.Count}"); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("coop_dead"); if (!PlayerManager.AlivePlayers.Contains(Player.LocalPlayer)) { AccessTools.Method(typeof(PlayerDying), "LocalRespawn", (Type[])null, (Type[])null).Invoke(Player.LocalPlayer.Dying, null); } yield return Until(() => PlayerManager.AlivePlayers.Contains(Player.LocalPlayer), 15f, "respawn"); yield return (object)new WaitForSecondsRealtime(2f); float num2 = (Object.op_Implicit((Object)(object)BoatManager.Boat) ? Vector3.Distance(BoatManager.Boat.HiddenPhysicsRig.position, island.DockPos) : (-1f)); Note($"respawn: {Vector3.Distance(Player.LocalPlayer.Transform.position, island.RespawnPos):F1} m from the respawn spot (y {Player.LocalPlayer.Transform.position.y:F1}, water {WaterManager.GetWaterHeight(Player.LocalPlayer.Transform.position):F1}), boat {num2:F1} m from dock"); FortressPlugin.Shot("coop_results"); yield return (object)new WaitForSecondsRealtime(1f); } private IEnumerator Gear3Scenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); loot.ServerWipeVaultForTest(); Tips.Show.Value = false; PlayerManager.ToggleGodMode(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; VaultData vault = loot.Vault; loot.ServerGive(Gear.SharkArmor, Rarity.Legendary); loot.ServerGive(Gear.BigNet, Rarity.Common, 5); loot.ServerGive(Gear.Gunpowder, Rarity.Common); loot.ServerGive(Gear.Scope, Rarity.Epic); loot.ServerGive(Gear.Rebar, Rarity.Legendary); Do(VaultAction.Salvage, Gear.SharkArmor, Rarity.Legendary); for (int num = 0; num < 5; num++) { Do(VaultAction.Salvage, Gear.BigNet, Rarity.Common); } Note($"salvage: scales {vault.Scales} (expect 25), big nets left {vault.Count(Gear.BigNet, Rarity.Common)}"); Do(VaultAction.Ascend, Gear.Gunpowder, Rarity.Common); Note($"rank up: gunpowder common {vault.Count(Gear.Gunpowder, Rarity.Common)} rare {vault.Count(Gear.Gunpowder, Rarity.Rare)}, scales {vault.Scales} (expect 21)"); Do(VaultAction.Ascend, Gear.Scope, Rarity.Epic); Note($"epic -> legendary by scales refused: scope epic {vault.Count(Gear.Scope, Rarity.Epic)} legendary {vault.Count(Gear.Scope, Rarity.Legendary)}"); float num2 = vault.ValueOf(Gear.Rebar, Rarity.Legendary); Do(VaultAction.Enhance, Gear.Rebar, Rarity.Legendary); Note($"enhance: rebar +{vault.EnhanceOf(Gear.Rebar)}, value {num2:F2} -> {vault.ValueOf(Gear.Rebar, Rarity.Legendary):F2}, scales {vault.Scales} (expect 6)"); Vector3 vaultDoor = island.VaultDoor; me.LocalTeleport(vaultDoor + Vector3.up * 0.5f, YawTo(vaultDoor, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(1f); VaultUI.Instance.Open(); VaultUI.Instance.DebugSelect(Gear.Rebar, Rarity.Legendary); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("gear3_vault"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Close(); Gear[] array = new Gear[3] { Gear.Gunpowder, Gear.Scope, Gear.Rebar }; foreach (Gear g in array) { loot.DebugEquip(me, g, Rarity.Legendary); } loot.DebugEquip(me, Gear.SharkArmor, Rarity.Epic); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(300f); Siege.Instance.ServerAddCoins(Siege.Money(2000)); SpendLikeAPlayer(center); float num4 = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num4), 0f, Mathf.Sin(num4)); Vector3 val = Vector3.Cross(Vector3.up, gd); Vector3 val2 = Ground(center + gd * 6f - val * 4f) + Vector3.up * 1.8f; me.LocalTeleport(val2, YawTo(val2, center + gd * 15f), true); for (int num5 = 0; num5 < 8; num5++) { plugin.ServerSpawnMinion(EnemyKind.Runner, center + gd * 21f + val * ((float)num5 - 3.5f) * 1.2f + Vector3.up * 3f); } yield return Until(() => C("proc_Gunpowder") > 0 || C("proc_Scope") > 0, 25f, "a legendary flash"); FortressPlugin.Shot("gear3_proc"); yield return (object)new WaitForSecondsRealtime(0.5f); Note("flashes: " + string.Join(", ", from kv in Counters where kv.Key.StartsWith("proc_") select kv.Key.Substring(5) + " " + kv.Value)); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); Vector3 here = me.Transform.position; loot.DebugDrop(Gear.Incendiary, Rarity.Epic, here + gd * 1.5f); yield return (object)new WaitForSecondsRealtime(0.4f); me.LocalTeleport(here + gd * 1.5f + Vector3.up * 0.3f, YawTo(here, center + gd * 15f), true); yield return (object)new WaitForSecondsRealtime(1.2f); loot.ServerSpawnChest(10); Vector3 chest = loot.ServerChestPos ?? center; yield return (object)new WaitForSecondsRealtime(0.5f); me.LocalTeleport(chest + Vector3.up * 0.5f, 0f, true); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("gear3_cards"); yield return (object)new WaitForSecondsRealtime(0.5f); int drops = C("loot_dropped"); loot.ServerNewRound(); plugin.DebugJumpToWave(2); yield return Until(() => plugin.Wave == 2, 5f, "wave 2"); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(0.5f); Creature one = plugin.ServerSpawnMinion(EnemyKind.Runner, center + gd * 10f + Vector3.up * 3f); yield return (object)new WaitForSecondsRealtime(0.5f); if (Object.op_Implicit((Object)(object)one)) { one.ServerChangeHp(100000); } yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("first kill of wave 2 dropped: {0}", C("loot_dropped") - drops >= 1)); Tips.Show.Value = true; static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } void Do(VaultAction a, Gear gear, Rarity r) { loot.ServerRequest(me, new VaultRequest { Action = a, Gear = gear, Rarity = r, Count = (byte)((a != VaultAction.Enhance) ? 1u : ((uint)loot.Vault.EnhanceOf(gear))) }); } static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val3, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val3)).point; } return w; } } private IEnumerator TipsScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); Tips.Reset.Value = true; PlayerManager.ToggleGodMode(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; Vector3 val = Ground(island.DockPos + Vector3.forward * 4f) + Vector3.up * 1f; me.LocalTeleport(val, 0f, true); yield return Until(() => C("tip_island") > 0, 10f, "island tip"); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("tips_island"); yield return (object)new WaitForSecondsRealtime(0.5f); Tips.Instance.ToggleHelp(); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot("tips_help"); yield return (object)new WaitForSecondsRealtime(0.5f); Tips.Instance.ToggleHelp(); Note(string.Format("help panel toggled: opened {0}, open now {1}", C("help_opened"), Tips.Instance.HelpOpen)); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(300f); yield return Until(() => C("tip_start") > 0, 10f, "start tip"); yield return (object)new WaitForSecondsRealtime(8f); Vector3 spot = Ground(center + new Vector3(0f, 0f, -12f)) + Vector3.up * 1f; me.LocalTeleport(spot, 0f, true); for (int num = 0; num < 6; num++) { plugin.ServerSpawnMinion(EnemyKind.Runner, spot + new Vector3((float)num - 2.5f, 2f, 4f)); } yield return (object)new WaitForSecondsRealtime(1f); plugin.DebugKillAll(); yield return Until(() => C("tip_net") > 0, 15f, "net tip"); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("tips_net"); yield return (object)new WaitForSecondsRealtime(8f); foreach (Vector3 item in FortressNet.Instance.ServerCorpsePositions().ToList()) { me.LocalTeleport(item + Vector3.up * 0.4f, 0f, true); yield return (object)new WaitForSecondsRealtime(0.4f); } yield return Until(() => C("tip_netFull") > 0, 10f, "net-full tip"); me.LocalTeleport(spot, YawTo(spot, island.CounterPos), true); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("tips_netfull"); yield return (object)new WaitForSecondsRealtime(9f); plugin.ServerSpawnMinion(EnemyKind.Thief, spot + new Vector3(0f, 2f, 6f)); yield return Until(() => C("tip_foeThief") > 0, 10f, "thief tip"); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("tips_thief"); yield return (object)new WaitForSecondsRealtime(0.5f); Note("tips shown: " + string.Join(", ", from kv in Counters where kv.Key.StartsWith("tip_") select kv.Key.Substring(4))); plugin.DebugKillAll(); Tips.Reset.Value = true; yield return (object)new WaitForSecondsRealtime(0.5f); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val2, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val2)).point; } return w; } } private IEnumerator Gear2Scenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); loot.ServerWipeVaultForTest(); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); float num2 = FortressIsland.GapAngles[1] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 gd2 = new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); Vector3 side = Vector3.Cross(Vector3.up, gd); bool flag = loot.ServerUnlockRandom(me); bool flag2 = loot.ServerUnlockRandom(me); bool flag3 = loot.ServerUnlockRandom(me); bool flag4 = loot.ServerUnlockRandom(me); Note(string.Format("blueprints: {0} {1} {2} then {3} (expect true true true false), unlocked [{4}]", flag, flag2, flag3, flag4, string.Join(",", loot.Vault.Unlocked))); Gear[] array = new Gear[4] { Gear.Gunpowder, Gear.Scope, Gear.FrostCore, Gear.Rebar }; foreach (Gear g in array) { loot.DebugEquip(me, g, Rarity.Legendary); } me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(300f); Siege.Instance.ServerAddCoins(Siege.Money(3000)); for (int num4 = -2; num4 <= 2; num4++) { WallAt(center + gd * 15f + side * ((float)num4 * 3f) + Vector3.up * 1.2f, gd); } for (int num5 = -1; num5 <= 1; num5++) { WallAt(center + gd2 * 15f + Vector3.Cross(Vector3.up, gd2) * ((float)num5 * 3f) + Vector3.up * 1.2f, gd2); } bool flag5 = TurretAt(PieceType.Flame, center + gd * 12f + Vector3.up * 1.2f); bool flag6 = TurretAt(PieceType.Sniper, center + gd * 6f + side * 3f + Vector3.up * 1.2f); bool flag7 = TurretAt(PieceType.Bubble, center + gd * 11f + side * 3f + Vector3.up * 1.2f); Note($"placed flame {flag5}, sniper {flag6}, bubble {flag7}"); Vector3 val = Ground(center + gd * 6f - side * 5f) + Vector3.up * 1.8f; yield return Look(val, YawTo(val, center + gd * 12f + side * 1.5f), "gear2_turrets", 1.2f); PieceState covered = BuildSystem.Instance.ServerPieces.Where((PieceState p) => p.Type == PieceType.Wall).OrderBy(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Vector3 val3 = p.Pos - (center + gd * 15f); return ((Vector3)(ref val3)).sqrMagnitude; }).First(); PieceState bare = BuildSystem.Instance.ServerPieces.Where((PieceState p) => p.Type == PieceType.Wall).OrderBy(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Vector3 val3 = p.Pos - (center + gd2 * 15f); return ((Vector3)(ref val3)).sqrMagnitude; }).First(); BuildSystem.Instance.ServerDamageArea(covered.Pos, 0.5f, 100); BuildSystem.Instance.ServerDamageArea(bare.Pos, 0.5f, 100); int num6 = covered.Hp - BuildSystem.Instance.ServerPieces.First((PieceState p) => p.Id == covered.Id).Hp; int num7 = bare.Hp - BuildSystem.Instance.ServerPieces.First((PieceState p) => p.Id == bare.Id).Hp; Note($"bubble: wall under the bubble lost {num6}, bare wall lost {num7} (expect 70 / 100)"); Vector3 beach = center + gd * 21f + Vector3.up * 3f; for (int num8 = 0; num8 < 6; num8++) { plugin.ServerSpawnMinion((num8 == 0) ? EnemyKind.Tank : EnemyKind.Runner, beach + side * ((float)num8 - 2.5f) * 1.2f); } Vector3 val2 = Ground(center + gd * 7f - side * 4f) + Vector3.up * 1.8f; me.LocalTeleport(val2, YawTo(val2, center + gd * 16f), true); yield return Until(() => C("shots_Flame") > 3 && C("shots_Sniper") > 0, 25f, "flame and sniper fire"); FortressPlugin.Shot("gear2_fight"); yield return Until(() => !FortressPlugin.Alive.Any(delegate(Creature c) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)c) && c._hp.Value > 0) { Vector3 val3 = ((Component)c).transform.position - beach; return ((Vector3)(ref val3)).sqrMagnitude < 900f; } return false; }), 30f, "fight over"); Note(string.Format("turrets: flame shots {0}, sniper shots {1}; legendary: bursts {2}, crits {3}, freezes {4}, thorns {5}", C("shots_Flame"), C("shots_Sniper"), C("legend_bursts"), C("legend_crits"), C("legend_freezes"), C("legend_thorns"))); Vector3 spot = Ground(center + gd * 9f) + Vector3.up * 1f; me.LocalTeleport(spot, YawTo(spot, center + gd * 20f), true); yield return (object)new WaitForSecondsRealtime(0.5f); loot.DebugEquip(me, Gear.Overclock, Rarity.Legendary); bool flag8 = Actives.Instance.ServerUse(me, Gear.Overclock); Note($"overclock: used {flag8}, turrets overclocked for {Turrets.OverclockUntil - Time.time:F1}s; used again right away {Actives.Instance.ServerUse(me, Gear.Overclock)} (expect false: cooldown)"); foreach (PieceState item in BuildSystem.Instance.ServerPieces.Where(delegate(PieceState p) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (p.Type == PieceType.Wall) { Vector3 val3 = p.Pos - spot; return ((Vector3)(ref val3)).sqrMagnitude < 81f; } return false; }).ToList()) { BuildSystem.Instance.ServerDamageArea(item.Pos, 0.3f, 120); } int num9 = BuildSystem.Instance.ServerPieces.Where((PieceState p) => p.Type == PieceType.Wall).Sum((PieceState p) => p.Hp); loot.DebugEquip(me, Gear.FieldRepair, Rarity.Legendary); Actives.Instance.DebugResetCooldown(me); Actives.Instance.ServerUse(me, Gear.FieldRepair); Note($"field repair: wall health {num9} -> {BuildSystem.Instance.ServerPieces.Where((PieceState p) => p.Type == PieceType.Wall).Sum((PieceState p) => p.Hp)}"); loot.DebugEquip(me, Gear.Decoy, Rarity.Legendary); Actives.Instance.DebugResetCooldown(me); Actives.Instance.ServerUse(me, Gear.Decoy); for (int num10 = 0; num10 < 3; num10++) { plugin.ServerSpawnMinion(EnemyKind.Runner, spot + gd * 6f + side * (float)(num10 - 1) * 1.5f + Vector3.up * 2f); } yield return Until(() => C("decoyed") > 0, 12f, "fish chase the duck"); FortressPlugin.Shot("gear2_decoy"); Note(string.Format("decoy: pecks {0}", C("decoyed"))); loot.DebugEquip(me, Gear.Shockwave, Rarity.Legendary); Actives.Instance.DebugResetCooldown(me); int num11 = Siege.Instance.ServerShockwave(me.Transform.position, 99f, 0f, 0); Actives.Instance.ServerUse(me, Gear.Shockwave); Note(string.Format("shockwave: used {0}, fish in range {1}", C("active_Shockwave"), num11)); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1.5f); loot.DebugEquip(me, Gear.NetCannon, Rarity.Legendary); Actives.Instance.DebugResetCooldown(me); int num12 = FortressNet.Instance.ServerNetCount(((NetworkBehaviour)me).ObjectId); Actives.Instance.ServerUse(me, Gear.NetCannon); Note($"fish cannon: net {num12} -> {FortressNet.Instance.ServerNetCount(((NetworkBehaviour)me).ObjectId)}"); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("gear2_hud"); yield return (object)new WaitForSecondsRealtime(0.5f); plugin.TestKey((Key)102, shift: false); yield return (object)new WaitForSecondsRealtime(2f); array = new Gear[3] { Gear.Overclock, Gear.Decoy, Gear.Shockwave }; foreach (Gear g2 in array) { loot.ServerGive(g2, Rarity.Rare); } Vector3 vaultDoor = island.VaultDoor; me.LocalTeleport(vaultDoor + Vector3.up * 0.5f, YawTo(vaultDoor, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(1f); VaultUI.Instance.Open(); VaultUI.Instance.DebugSelect(Gear.Overclock, Rarity.Rare); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("gear2_vault"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Close(); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val3, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val3)).point; } return w; } } private IEnumerator WeaponsScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); loot.ServerWipeVaultForTest(); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 side = Vector3.Cross(Vector3.up, gd); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(900f); Vector3 val2; foreach (Gear g in GearCatalog.All.Where(GearCatalog.IsWeapon)) { plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); float num2 = ((g == Gear.SharkWhistle) ? 26f : 20f); float num3 = ((g == Gear.Conch) ? 15f : 9f); Vector3 eye = Ground(center + gd * num3) + Vector3.up * 1.7f; Vector3 mid = Ground(center + gd * num2); me.LocalTeleport(eye - Vector3.up * 1.6f, YawTo(eye, mid), true); List fish = new List(); for (int num4 = 0; num4 < 4; num4++) { fish.Add(plugin.ServerSpawnMinion(EnemyKind.Runner, mid + side * ((float)num4 - 1.5f) * 1.4f + Vector3.up * 1.5f)); } foreach (Creature item in fish) { if (Object.op_Implicit((Object)(object)item)) { Siege.Instance.Slow(item, 1f, 60f); } } Item weapon = WeaponItems.ServerSpawn(g, Rarity.Legendary, eye + gd * 0.6f); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)weapon)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(weapon, me, (Item)null); } yield return (object)new WaitForSecondsRealtime(1.1f); Note(string.Format(" holding {0} (item id {1})", Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing", Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.ID : 0)); int hp0 = fish.Sum((Creature c) => Object.op_Implicit((Object)(object)c) ? Mathf.Max(0, c._hp.Value) : 0); Vector3 from0 = (Object.op_Implicit((Object)(object)fish[0]) ? ((Component)fish[0]).transform.position : mid); Vector3 val; switch (g) { default: val = mid; break; case Gear.BubbleGun: case Gear.Hook: val = from0; break; case Gear.SharkWhistle: val = center + gd * 30f; break; } Vector3 p = val; if (g == Gear.Laser || g == Gear.WaterCannon) { for (int t = 0; t <= 20; t++) { Weapons.Instance.ServerFire(me, At(from0, (t != 0) ? ((byte)1) : ((byte)0))); yield return (object)new WaitForSecondsRealtime(0.1f); } Weapons.Instance.ServerFire(me, At(from0, 2)); } else { Weapons.Instance.ServerFire(me, At(p, 0)); } FortressPlugin.Shot("weapon_" + g, (g == Gear.Laser) ? 0f : 0.7f); if (g != Gear.Laser) { FortressPlugin.Shot("weapon_" + g.ToString() + "_fly", 0.22f); } yield return (object)new WaitForSecondsRealtime(1.2f); Note(" 1.2 s after: " + Weapons.Instance.DebugState(mid) + "; fish " + string.Join(", ", fish.Where((Creature c) => Object.op_Implicit((Object)(object)c)).Select(delegate(Creature c) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val7 = (((Component)c).transform.position - mid).Flat(); return $"{((Vector3)(ref val7)).magnitude:F1}m/{c._hp.Value}hp"; }))); float num5; switch (g) { default: num5 = 1.3f; break; case Gear.PoisonGas: case Gear.Whirlpool: num5 = 4.8f; break; case Gear.SharkWhistle: num5 = 10.8f; break; } yield return (object)new WaitForSecondsRealtime(num5); int num6 = fish.Sum((Creature c) => Object.op_Implicit((Object)(object)c) ? Mathf.Max(0, c._hp.Value) : 0); int num7 = fish.Count((Creature c) => !Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0); float num8; if (!Object.op_Implicit((Object)(object)fish[0]) || fish[0]._hp.Value <= 0) { num8 = -1f; } else { val2 = ((Component)fish[0]).transform.position - from0; num8 = ((Vector3)(ref val2)).magnitude; } float num9 = num8; Note(string.Format("weapon {0}: fired {1}, fish health {2} -> {3}, dead {4}/4, first fish moved {5:F1} m; bubbled {6}", g, C("weapon_" + g), hp0, num6, num7, num9, C("bubbled"))); WeaponFire At(Vector3 val8, byte phase) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) WeaponFire result = new WeaponFire { Phase = phase, Origin = eye }; Vector3 val7 = val8 + Vector3.up * 0.5f - eye; result.Dir = ((Vector3)(ref val7)).normalized; return result; } } Note(WeaponItems.DescribeBase()); plugin.DebugKillAll(); FortressNet.Instance.ServerReset(); yield return (object)new WaitForSecondsRealtime(0.5f); Vector3 stand = Ground(center + gd * 11f) + Vector3.up * 0.2f; me.LocalTeleport(stand, YawTo(stand, center + gd * 30f), true); Item shown = WeaponItems.ServerSpawn(Gear.Laser, Rarity.Epic, stand + Vector3.up * 1.5f); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)shown)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(shown, me, (Item)null); } yield return (object)new WaitForSecondsRealtime(1.5f); DumpView("holding a weapon"); FortressPlugin.Shot("weapon_view"); yield return (object)new WaitForSecondsRealtime(0.5f); Item heldItem = me.Holding.HeldItem; Weapon aimed = (Weapon)(object)((heldItem is Weapon) ? heldItem : null); if (aimed != null) { ((Item)aimed).SecondaryInput(default(CallbackContext)); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot("weapon_ads"); yield return (object)new WaitForSecondsRealtime(0.4f); ((Item)aimed).SecondaryInput(default(CallbackContext)); yield return (object)new WaitForSecondsRealtime(0.6f); } Item inHand = me.Holding.HeldItem; Transform model = WeaponItems.ModelOf(inHand); if (Object.op_Implicit((Object)(object)model) && Object.op_Implicit((Object)(object)inHand.HandModelRight)) { (string, float, Vector3)[] array = new(string, float, Vector3)[5] { ("a", 0.27f, new Vector3(0f, 0f, 0f)), ("b", 0.27f, new Vector3(0f, 0f, 0.05f)), ("c", 0.27f, new Vector3(-0.03f, 0.02f, 0.06f)), ("d", 0.22f, new Vector3(-0.03f, 0.03f, 0.05f)), ("e", 0.32f, new Vector3(0f, -0.02f, 0.09f)) }; (string tag, float longest, Vector3 from)[] array2 = array; for (int hp0 = 0; hp0 < array2.Length; hp0++) { var (tag, longest, fromHand) = array2[hp0]; WeaponItems.Place(model, inHand.HandModelRight, ((Component)inHand).transform, new WeaponItems.Grip { Longest = longest, FromHand = fromHand }); Weapons.Instance.DebugForgetHeld(); yield return (object)new WaitForSecondsRealtime(0.4f); FortressPlugin.Shot("held_" + tag); yield return (object)new WaitForSecondsRealtime(0.4f); } WeaponItems.Place(model, inHand.HandModelRight, ((Component)inHand).transform, WeaponItems.InHand); Weapons.Instance.DebugForgetHeld(); } Item pistol = ItemManager.Instance.SpawnNewItem(GameInfo.GetSpawnable("pistol"), stand + Vector3.up * 1.5f, Quaternion.identity); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)pistol)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(pistol, me, (Item)null); } yield return (object)new WaitForSecondsRealtime(1.5f); DumpView("holding the game's pistol"); FortressPlugin.Shot("pistol_view"); yield return (object)new WaitForSecondsRealtime(0.5f); me.Inventory.LocalTrySelectSlot(0); yield return (object)new WaitForSecondsRealtime(1.5f); Note(" slot 1: holding " + (Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing")); FortressPlugin.Shot("weapon_slot1"); yield return (object)new WaitForSecondsRealtime(0.5f); Weapons.Instance.DebugNet(on: true); yield return (object)new WaitForSecondsRealtime(1.5f); Note(" net out: holding " + (Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing")); DumpView("net out"); FortressPlugin.Shot("net_view"); List prey = new List(); for (int num10 = 0; num10 < 4; num10++) { Creature val3 = plugin.ServerSpawnMinion(EnemyKind.Runner, stand + gd * 2.2f + side * ((float)num10 - 1.5f) * 0.6f + Vector3.up * 0.5f); if (Object.op_Implicit((Object)(object)val3)) { Siege.Instance.Slow(val3, 1f, 60f); prey.Add(val3); } } yield return (object)new WaitForSecondsRealtime(1.5f); foreach (Creature item2 in prey) { if (Object.op_Implicit((Object)(object)item2)) { item2.ServerChangeHp(item2._hp.Value); } } yield return (object)new WaitForSecondsRealtime(1f); Note(" bodies before the swing: " + string.Join(", ", FortressNet.Instance.ServerCorpsePositions().Select(delegate(Vector3 val8) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) Vector3 val7 = (val8 - me.Transform.position).Flat(); return $"{((Vector3)(ref val7)).magnitude:F1}m at {Vector3.Angle(gd, (val8 - me.Transform.position).Flat()):F0}deg"; }))); FortressNet.Instance.ServerSwing(me, stand + Vector3.up * 1.6f, gd); yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("hand net: scooped {0}, in the net {1}", C("net_scooped"), FortressNet.Instance.ServerNetCount(((NetworkBehaviour)me).ObjectId))); FortressPlugin.Shot("net_full"); yield return (object)new WaitForSecondsRealtime(0.5f); Weapons.Instance.DebugNet(on: false); yield return (object)new WaitForSecondsRealtime(1.5f); Note(" net away: holding " + (Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing")); plugin.TestKey((Key)102, shift: false); yield return (object)new WaitForSecondsRealtime(2f); Dictionary dictionary = (Dictionary)AccessTools.Field(typeof(GameInfo), "_allItems").GetValue(null); List wildKinds = dictionary.Values.Where(delegate(Item i) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Creature val7 = (Creature)(object)((i is Creature) ? i : null); return val7 != null && (int)val7.BossType == 0 && !(i is RunningFish); }).Take(3).ToList(); List wild = new List(); for (int num11 = 0; num11 < 4; num11++) { if (wildKinds.Count <= 0) { break; } Item obj = ItemManager.Instance.SpawnNewItem(wildKinds[num11 % wildKinds.Count], stand + gd * 6f + side * ((float)num11 - 1.5f) * 1.2f + Vector3.up * 0.5f, Quaternion.identity); Creature val4 = (Creature)(object)((obj is Creature) ? obj : null); if (val4 != null) { wild.Add(val4); } } yield return (object)new WaitForSecondsRealtime(1.5f); int wild2 = wild.Sum((Creature c) => Object.op_Implicit((Object)(object)c) ? Mathf.Max(0, c._hp.Value) : 0); Note(string.Format(" wild fish ({0}): {1} spawned, health {2}, round running {3}", string.Join(", ", wildKinds.Select((Item k) => ((Object)k).name)), wild.Count, wild2, Siege.Instance.ServerActive)); Gear[] array3 = new Gear[2] { Gear.Boomerang, Gear.Hook }; foreach (Gear g2 in array3) { Item weapon = WeaponItems.ServerSpawn(g2, Rarity.Legendary, stand + Vector3.up * 1.5f); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)weapon)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(weapon, me, (Item)null); } yield return (object)new WaitForSecondsRealtime(0.8f); Creature val5 = ((IEnumerable)wild).FirstOrDefault((Func)((Creature c) => Object.op_Implicit((Object)(object)c) && c._hp.Value > 0)); Vector3 val6 = me.Transform.position + Vector3.up * 1.6f; if (Object.op_Implicit((Object)(object)val5)) { Weapons instance = Weapons.Instance; Player who = me; WeaponFire f = new WeaponFire { Phase = 0, Origin = val6 }; val2 = ((Component)val5).transform.position + Vector3.up * 0.3f - val6; f.Dir = ((Vector3)(ref val2)).normalized; instance.ServerFire(who, f); } yield return (object)new WaitForSecondsRealtime(2f); } int num12 = wild.Sum((Creature c) => Object.op_Implicit((Object)(object)c) ? Mathf.Max(0, c._hp.Value) : 0); Note($"weapons outside a round: wild fish health {wild2} -> {num12}, dead {wild.Count((Creature c) => !Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0)}/{wild.Count}"); FortressPlugin.Shot("weapon_wild"); yield return (object)new WaitForSecondsRealtime(0.5f); loot.ServerGive(Gear.Gunpowder, Rarity.Rare); Vector3 vaultDoor = island.VaultDoor; me.LocalTeleport(vaultDoor + Vector3.up * 0.5f, YawTo(vaultDoor, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(1f); VaultUI.Instance.Open(); VaultUI.Instance.DebugSelect(Gear.Gunpowder, Rarity.Rare); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("weapon_vault"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Close(); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val7 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val7, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val7)).point; } return w; } } private IEnumerator FxScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Vector3 center = island.Center; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 side = Vector3.Cross(Vector3.up, gd); ClearLooseWeapons(); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(900f); yield return (object)new WaitForSecondsRealtime(3f); for (int i = 0; i < 5; i++) { if (!Object.op_Implicit((Object)(object)me.Holding.HeldItem)) { break; } me.Inventory.LocalTrySelectSlot(-1); yield return (object)new WaitForSecondsRealtime(0.5f); } Note("fx view: holding " + (Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? ((Object)me.Holding.HeldItem).name : "nothing")); Vector3 val = Ground(center + gd * 6f) + Vector3.up * 0.2f; float yaw = YawTo(val, center + gd * 20f); me.LocalTeleport(val, yaw, true); yield return null; Aim(yaw, 6f); yield return (object)new WaitForSecondsRealtime(1.5f); Vector3 left = Ground(center + gd * 14f - side * 5f) + Vector3.up * 1.4f; Vector3 right = Ground(center + gd * 14f + side * 5f); Vector3 mid = Ground(center + gd * 14f); Creature fishA = plugin.ServerSpawnMinion(EnemyKind.Runner, right + Vector3.up * 1f); Creature val2 = plugin.ServerSpawnMinion(EnemyKind.Runner, mid + Vector3.up * 1f); Creature[] array = (Creature[])(object)new Creature[2] { fishA, val2 }; foreach (Creature val3 in array) { if (Object.op_Implicit((Object)(object)val3)) { Siege.Instance.Slow(val3, 1f, 300f); val3.ServerChangeHp(-100000); } } yield return (object)new WaitForSecondsRealtime(1.5f); Weapons W = Weapons.Instance; Vector3 target = (Object.op_Implicit((Object)(object)fishA) ? (((Component)fishA).transform.position + Vector3.up * 0.5f) : (right + Vector3.up)); for (int i = 0; i < 14; i++) { Play(FxKind.Beam, left, target, 0, 150); if (i == 8) { FortressPlugin.Shot("fx_laser"); } yield return (object)new WaitForSecondsRealtime(0.08f); } yield return (object)new WaitForSecondsRealtime(0.6f); Play(FxKind.Gas, left, right, 0, 6000); yield return Shots("gas", new float[4] { 0.3f, 0.75f, 1.6f, 3.5f }); yield return (object)new WaitForSecondsRealtime(3f); Play(FxKind.Boomerang, left, right + Vector3.up); yield return Shots("boomerang", new float[3] { 0.2f, 0.45f, 0.8f }); Play(FxKind.Bubble, left, target, Object.op_Implicit((Object)(object)fishA) ? ((NetworkBehaviour)fishA).ObjectId : 0, 3000); yield return Shots("bubble", new float[4] { 0.15f, 0.6f, 1.5f, 3.2f }); Play(FxKind.Hook, left, target, Object.op_Implicit((Object)(object)fishA) ? ((NetworkBehaviour)fishA).ObjectId : 0); yield return Shots("hook", new float[3] { 0.08f, 0.2f, 0.5f }); Play(FxKind.Hook, left, mid + side * 2f + Vector3.up * 0.3f); yield return Shots("hookmiss", new float[3] { 0.1f, 0.25f, 0.4f }); Play(FxKind.Whirl, left, mid, 0, 5000); yield return Shots("whirl", new float[4] { 0.3f, 0.7f, 1.4f, 3f }); yield return (object)new WaitForSecondsRealtime(2f); Play(FxKind.Sonic, left, left + side * 8f); yield return Shots("conch", new float[3] { 0.1f, 0.25f, 0.45f }); Play(FxKind.WeaponHit, target, target, 0, 25); yield return Shots("hit", new float[2] { 0.05f, 0.2f }); Vector3 beach = Ground(center + gd * 19f) + Vector3.up * 0.2f; me.LocalTeleport(beach, YawTo(beach, center + gd * 30f), true); yield return null; Aim(YawTo(beach, center + gd * 30f), 10f); yield return (object)new WaitForSecondsRealtime(1f); Vector3 sea = center + gd * 27f; sea.y = WaterManager.GetWaterHeight(sea); for (int i = 0; i < 16; i++) { Vector3 val4 = sea - side * 6f + side * ((float)i * 0.8f); Play(FxKind.Shark, val4, val4 + side, 77, 1); if (i == 0 || i == 8) { FortressPlugin.Shot($"fx_shark_{i}"); } yield return (object)new WaitForSecondsRealtime(0.15f); } Play(FxKind.Shark, sea, sea, 77); yield return Shots("sharkdive", new float[2] { 0.1f, 0.4f }); Play(FxKind.Bubble, mid + Vector3.up, mid + Vector3.up); yield return Shots("bubblepop", new float[2] { 0.1f, 0.3f }); static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val5, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val5)).point; } return w; } void Play(FxKind k, Vector3 from, Vector3 to, int piece = 0, int arg = 0) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) W.PlayFx(new FxEvent { Kind = k, From = from, To = to, PieceId = piece, Arg = arg, Who = 0 }); } static IEnumerator Shots(string tag, params float[] at) { float num3 = 0f; foreach (float t in at) { yield return (object)new WaitForSecondsRealtime(t - num3); num3 = t; FortressPlugin.Shot($"fx_{tag}_{t:0.00}"); } yield return (object)new WaitForSecondsRealtime(0.4f); } } private IEnumerator RarityScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); Tips.Show.Value = false; ClearLooseWeapons(); Player me = Player.LocalPlayer; Vector3 center = island.Center; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 val = Vector3.Cross(Vector3.up, gd); Gear[] array = new Gear[3] { Gear.Laser, Gear.Hook, Gear.BubbleGun }; Item legend = null; for (int num2 = 0; num2 < array.Length; num2++) { for (int num3 = 0; num3 < 4; num3++) { Item val2 = WeaponItems.ServerSpawn(array[num2], (Rarity)num3, center + gd * (8f + 1.4f * (float)num2) + val * ((float)num3 - 1.5f) * 1.1f + Vector3.up * 2.5f); if (num2 == 0 && num3 == 3) { legend = val2; } } } yield return (object)new WaitForSecondsRealtime(3f); Vector3 eye = center + gd * 5.2f + Vector3.up * 2.3000002f; me.LocalTeleport(eye, YawTo(eye, center + gd * 9.4f), true); yield return null; Aim(YawTo(eye, center + gd * 9.4f), 22f); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("rarity_ground"); yield return (object)new WaitForSecondsRealtime(0.6f); if (Object.op_Implicit((Object)(object)legend)) { legend.PickUp(me, true, true); yield return (object)new WaitForSecondsRealtime(1f); Aim(YawTo(eye, center + gd * 20f), 0f); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("rarity_held_legendary"); yield return (object)new WaitForSecondsRealtime(0.6f); } } private IEnumerator Loot2Scenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Vector3 center = island.Center; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(3000f); yield return (object)new WaitForSecondsRealtime(3f); float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 val = Vector3.Cross(Vector3.up, gd); (Gear, Rarity)[] array = new(Gear, Rarity)[6] { (Gear.Gunpowder, Rarity.Common), (Gear.Scope, Rarity.Rare), (Gear.SharkArmor, Rarity.Epic), (Gear.LuckyCharm, Rarity.Legendary), (Gear.WarChest, Rarity.Rare), (Gear.Overclock, Rarity.Epic) }; for (int num2 = 0; num2 < array.Length; num2++) { loot.DebugDrop(array[num2].Item1, array[num2].Item2, center + gd * 10f + val * ((float)num2 - 2.5f) * 1.6f + Vector3.up * 2f); } yield return (object)new WaitForSecondsRealtime(1.5f); Vector3 eye = center + gd * 6.5f + Vector3.up * 2.3000002f; me.LocalTeleport(eye, YawTo(eye, center + gd * 10f), true); yield return null; Aim(YawTo(eye, center + gd * 10f), 12f); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("loot_drops"); yield return (object)new WaitForSecondsRealtime(0.6f); LootGrab grab = Object.FindObjectsOfType().OrderBy(delegate(LootGrab x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = ((Component)x).transform.position - me.Transform.position; return ((Vector3)(ref val2)).sqrMagnitude; }).FirstOrDefault(); if (Object.op_Implicit((Object)(object)grab)) { Vector3 near = ((Component)grab).transform.position - gd * 1.8f; near.y = ((Component)grab).transform.position.y + 0.6f; me.LocalTeleport(near, YawTo(near, ((Component)grab).transform.position), true); yield return null; Aim(YawTo(near, ((Component)grab).transform.position), 25f); yield return (object)new WaitForSecondsRealtime(1f); object hovering = AccessTools.Field(((object)me.Holding).GetType(), "_interactable")?.GetValue(me.Holding); FortressPlugin.Shot("loot_hover"); yield return (object)new WaitForSecondsRealtime(0.6f); int before = loot.Vault.Count(grab.Gear, grab.Rarity); ((Interactable)grab).Interact(me); yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("E on a drop: hovering {0}, {1} {2} in the vault {3} -> {4}, picked {5}", (hovering != null) ? hovering.GetType().Name : "nothing", grab.Gear, grab.Rarity, before, loot.Vault.Count(grab.Gear, grab.Rarity), C("loot_picked"))); } loot.Vault.Add(Gear.Incendiary, Rarity.Epic, -loot.Vault.Count(Gear.Incendiary, Rarity.Epic)); while (!loot.Vault.VaultFull) { loot.ServerGive(Gear.Rebar, Rarity.Common, 50); } int scales0 = loot.Vault.Scales; loot.DebugDrop(Gear.Incendiary, Rarity.Epic, me.Transform.position + Vector3.up); yield return (object)new WaitForSecondsRealtime(1.5f); Note(string.Format("full vault ({0}/{1} slots): scales {2} -> {3} (expect +8), overflow {4}", loot.Vault.SlotsUsed, loot.Vault.StorageSlots, scales0, loot.Vault.Scales, C("overflow_salvaged"))); plugin.DebugStopRound(); yield return Until(() => !plugin.Running, 10f, "round over"); yield return (object)new WaitForSecondsRealtime(2f); FortressIsland.Instance.CloseResults(); loot.DebugBest(32); loot.Vault.Scales = 500; loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Salvage, Gear = Gear.Rebar, Rarity = Rarity.Common }); yield return (object)new WaitForSecondsRealtime(0.5f); Vector3 vaultDoor = island.VaultDoor; me.LocalTeleport(vaultDoor + Vector3.up * 1.1f, YawTo(vaultDoor, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(1f); VaultUI.Instance.Open(); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot("loot_vault_slots"); yield return (object)new WaitForSecondsRealtime(0.6f); Expansion[] array2 = new Expansion[6] { Expansion.TeamSlot, Expansion.TeamSlot, Expansion.TeamSlot, Expansion.PersonalSlot, Expansion.Storage, Expansion.Storage }; foreach (Expansion expansion in array2) { loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Expand, Slot = (byte)expansion, Count = (byte)loot.Vault.BoughtOf(expansion) }); yield return (object)new WaitForSecondsRealtime(0.3f); } yield return (object)new WaitForSecondsRealtime(1f); VaultData vault = loot.Vault; Note($"expanded: team {vault.SlotsOf(0)} (expect 6: the 7th wants 50 waves), personal {vault.SlotsOf(1)}, vault {vault.StorageSlots} slots, scales left {vault.Scales}"); FortressPlugin.Shot("loot_vault_expanded"); yield return (object)new WaitForSecondsRealtime(0.6f); VaultUI.Instance.Close(); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } } private IEnumerator BossIntroScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player.LocalPlayer.LocalTeleport(island.Center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); int w; for (w = 10; w <= 100; w += 10) { EnemyKind kind = EnemyCatalog.BossFor(w); yield return Until(() => plugin.InBuildTime, 30f, "build time before wave " + w); plugin.DebugJumpToWave(w); yield return Until(() => plugin.Wave == w && !plugin.InBuildTime, 20f, "wave " + w); float started = Time.realtimeSinceStartup; Creature boss = null; EnemyTag tag; yield return Until(() => (Object)(object)(boss = ((IEnumerable)FortressPlugin.Alive).FirstOrDefault((Func)((Creature x) => Object.op_Implicit((Object)(object)x) && Enemies.Instance.TryGet(x, out tag) && tag.Kind == kind))) != (Object)null, Reveal.BossSeconds(w) + 6f, kind.ToString() + " to turn up"); float came = Time.realtimeSinceStartup - started; yield return (object)new WaitForSecondsRealtime(0.9f); Vector3 p0 = (Object.op_Implicit((Object)(object)boss) ? ((Component)boss).transform.position : Vector3.zero); yield return (object)new WaitForSecondsRealtime(1.2f); float num = (Object.op_Implicit((Object)(object)boss) ? Vector3.Distance(p0, ((Component)boss).transform.position) : (-1f)); Note(string.Format("wave {0}: {1}'s entrance {2}; it came after {3:0.0} s (due at {4:0.0}), moved {5:0.00} m while it stood for its entrance, others alive then {6}", w, kind, C("boss_intro_" + kind), came, Reveal.BossSpawnAt(w), num, FortressPlugin.Alive.Count((Creature x) => Object.op_Implicit((Object)(object)x) && (Object)(object)x != (Object)(object)boss))); yield return Until(() => !Reveal.Playing, 10f, "the entrance to end"); yield return (object)new WaitForSecondsRealtime(1f); for (int i = 0; i < 20; i++) { if (!plugin.Running) { break; } if (plugin.Wave != w) { break; } if (plugin.InBuildTime) { break; } plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); } } Note("entrances played: " + string.Join(", ", EnemyCatalog.BossOrder.Select((EnemyKind k) => k.ToString() + " " + C("boss_intro_" + k)))); plugin.DebugStopRound(); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } } private IEnumerator BossesScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; SkipBossCamera = true; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 center = island.Center; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); Siege.Instance.ServerAddCoins(Siege.Money(1000000)); List only = ((_arg.Length > 0) ? (from x in _arg.Split(',') select (EnemyKind)Enum.Parse(typeof(EnemyKind), x, ignoreCase: true)).ToList() : EnemyCatalog.BossOrder.ToList()); for (int i = 0; i < EnemyCatalog.BossOrder.Length; i++) { EnemyKind kind = EnemyCatalog.BossOrder[i]; if (!only.Contains(kind)) { continue; } int gap = i % 3; int wave = (i + 1) * 10; Fort(center); Siege.Instance.DamageCore(-Siege.Instance.CoreMax); int pieces0 = C("pieces_destroyed"); Creature c = plugin.ServerSpawnBoss(kind, 25f, gap, wave, 3f); if (!Object.op_Implicit((Object)(object)c)) { Note($"{kind}: did not spawn"); continue; } BossBrain brain = Bosses.Of(c); Vector3 g = FortressPlugin.BossSpot(kind, gap); Vector3 val = (center - g).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 eye = g + normalized * 16f + Vector3.Cross(Vector3.up, normalized) * 6f; eye.y = BossFx.Ground(eye) + 3f; me.LocalTeleport(eye, YawTo(eye, g), true); yield return null; Aim(YawTo(eye, g), (EnemyCatalog.BodyOf(kind) == EnemyCatalog.Body.Sky) ? (-12f) : 4f); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("boss_" + kind.ToString() + "_entrance"); yield return (object)new WaitForSecondsRealtime(2.5f); AutoTest autoTest = this; object[] obj = new object[5] { kind, ((Component)c).transform.localScale.x, null, null, null }; val = (((Component)c).transform.position - center).Flat(); obj[2] = ((Vector3)(ref val)).magnitude; obj[3] = ((Component)c).transform.position.y - BossFx.Ground(((Component)c).transform.position); obj[4] = c._hp.Value; autoTest.Note(string.Format("{0}: {1:F1}x, at {2:F1} m out, {3:F1} m up, hp {4}", obj)); FortressPlugin.Shot("boss_" + kind.ToString() + "_look"); for (int s = 0; s < 6; s++) { if (!Object.op_Implicit((Object)(object)c)) { break; } if (c._hp.Value <= 0) { break; } yield return (object)new WaitForSecondsRealtime(5f); if (!Object.op_Implicit((Object)(object)c)) { break; } Vector3 at = ((Component)c).transform.position; Vector3 val2 = (at - center).Flat(); Vector3 normalized2; if (!(((Vector3)(ref val2)).magnitude > 3f)) { val = (g - center).Flat(); normalized2 = ((Vector3)(ref val)).normalized; } else { normalized2 = ((Vector3)(ref val2)).normalized; } val2 = normalized2; Vector3 cam = at + val2 * 17f + Vector3.Cross(Vector3.up, val2) * 5f + Vector3.up * 7f; cam.y = Mathf.Max(cam.y, BossFx.Ground(cam) + 3f); me.LocalTeleport(cam, YawTo(cam, at), true); yield return null; Aim(YawTo(cam, at), 12f); yield return (object)new WaitForSecondsRealtime(0.4f); FortressPlugin.Shot($"boss_{kind}_{s}"); } Note(string.Format("{0}: moves {1}; pieces destroyed {2}; core {3}/{4}", kind, Moves(kind), C("pieces_destroyed") - pieces0, Siege.Instance.CoreHp, Siege.Instance.CoreMax)); if (Object.op_Implicit((Object)(object)c)) { c.ServerChangeHp(c._hp.Value - plugin.MaxHpOf[c] * 45 / 100); } yield return Until(() => !Object.op_Implicit((Object)(object)c) || C("boss_phase2_" + kind) > 0, 5f, kind.ToString() + " second form"); yield return (object)new WaitForSecondsRealtime(3f); if (Object.op_Implicit((Object)(object)c)) { FortressPlugin.Shot($"boss_{kind}_second"); } yield return Until(() => !Object.op_Implicit((Object)(object)c) || (brain != null && brain.Winding), 25f, kind.ToString() + " winding up a move"); if (Object.op_Implicit((Object)(object)c)) { Bosses.Instance.Interrupt(c); yield return (object)new WaitForSecondsRealtime(0.5f); FortressPlugin.Shot($"boss_{kind}_broken"); } yield return (object)new WaitForSecondsRealtime(6f); Note(string.Format("{0}: second form {1}, broken {2}, moves {3}", kind, C("boss_phase2_" + kind), C("boss_broken_" + kind), Moves(kind))); if (Object.op_Implicit((Object)(object)c)) { c.ServerChangeHp(1000000); } yield return (object)new WaitForSecondsRealtime(2.5f); Note(string.Format("{0}: died {1}, alive left {2}, trophy dropped {3}", kind, C("boss_died_" + kind), FortressPlugin.Alive.Count((Creature x) => Object.op_Implicit((Object)(object)x) && x._hp.Value > 0), C("trophy_dropped_" + kind))); EnemyKind k; Item trophy = ((IEnumerable)Object.FindObjectsOfType()).FirstOrDefault((Func)((Item x) => Object.op_Implicit((Object)(object)x) && ((NetworkBehaviour)x).IsSpawned && BossTrophies.Is(x, out k) && k == kind)); if (Object.op_Implicit((Object)(object)trophy)) { Vector3 cam = ((Component)trophy).transform.position; Vector3 val3 = cam; val = (center - cam).Flat(); Vector3 at = val3 + ((Vector3)(ref val)).normalized * 3f + Vector3.up * 1.6f; me.LocalTeleport(at, YawTo(at, cam), true); yield return null; Aim(YawTo(at, cam), 25f); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot($"boss_{kind}_trophy"); int s = Siege.Instance.ServerCoins; int stored0 = Loot.Instance.Vault.CountItem(BossTrophies.IdOf(kind)); if (i % 2 == 0) { FortressNet.Instance.ServerSellThrown(trophy, island.CounterPos + Vector3.up); } else { Loot.Instance.ServerStoreThrown(trophy, island.VaultPos + Vector3.up); } yield return (object)new WaitForSecondsRealtime(1f); Note($"{kind}: trophy '{trophy.GetName()}' worth {trophy.TotalWorth}: money {s} -> {Siege.Instance.ServerCoins}, in the vault {stored0} -> {Loot.Instance.Vault.CountItem(BossTrophies.IdOf(kind))}"); } foreach (Creature item in FortressPlugin.Alive.ToList()) { if (Object.op_Implicit((Object)(object)item)) { item.ServerChangeHp(1000000); } } yield return (object)new WaitForSecondsRealtime(1f); } if (_arg.Length > 0) { plugin.DebugStopRound(); yield break; } Siege.Instance.DamageCore(-Siege.Instance.CoreMax); int coreBefore = Siege.Instance.CoreHp; Creature late = plugin.ServerSpawnBoss(EnemyKind.Warden, 25f, 1, 10, 1f); yield return (object)new WaitForSecondsRealtime(2f); Bosses.Instance.DebugAge(199f); yield return (object)new WaitForSecondsRealtime(2.5f); Note(string.Format("crash: core {0} -> {1} (expect about -35%), boss gone {2}, crashes {3}", coreBefore, Siege.Instance.CoreHp, (Object)(object)late == (Object)null || !((NetworkBehaviour)late).IsSpawned || ((Item)late).IsDestroying, C("boss_crashed"))); Siege.Instance.DamageCore(-Siege.Instance.CoreMax); plugin.DebugJumpToWave(100); yield return Until(() => plugin.Wave == 100 && !plugin.InBuildTime, 20f, "wave 100"); yield return (object)new WaitForSecondsRealtime(Reveal.BossSeconds(100) + 3f); EnemyTag tag; Creature eyeBoss = ((IEnumerable)FortressPlugin.Alive).FirstOrDefault((Func)((Creature x) => Enemies.Instance.TryGet(x, out tag) && tag.Kind == EnemyKind.Eye)); if (Object.op_Implicit((Object)(object)eyeBoss)) { Vector3 eye = center + new Vector3(0f, 2.3000002f, 4f); me.LocalTeleport(eye, YawTo(eye, ((Component)eyeBoss).transform.position), true); yield return null; Aim(YawTo(eye, ((Component)eyeBoss).transform.position), -15f); } yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("boss_wave100"); Note(string.Format("wave 100: {0} enemies, the eye {1}", FortressPlugin.Alive.Count(), Object.op_Implicit((Object)(object)eyeBoss) ? "here" : "missing")); Siege.Instance.DamageCore(-Siege.Instance.CoreMax); for (int i = 0; i < 20; i++) { if (!plugin.Running) { break; } plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); } yield return (object)new WaitForSecondsRealtime(3f); Note(string.Format("after wave 100: running {0}, victory {1}, victory camera {2}, playing {3}", plugin.Running, C("victory"), C("victory_camera"), Reveal.Playing)); yield return Until(() => !Reveal.Playing && FortressIsland.Instance.ResultsShowing, 25f, "the results after the victory camera"); yield return (object)new WaitForSecondsRealtime(1f); Note($"results up {FortressIsland.Instance.ResultsShowing}, own camera back {(Object)(object)GameInfo.CurCamera == (Object)(object)me.Camera.Cam}"); FortressPlugin.Shot("boss_victory_results"); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } static string Moves(EnemyKind k) { return string.Join(", ", from kv in Counters where kv.Key.StartsWith(Prefix(k)) select kv.Key.Substring(Prefix(k).Length) + " " + kv.Value); } static string Prefix(EnemyKind k) { return k switch { EnemyKind.Skyfish => "skyfish_", EnemyKind.Stonefish => "stone_", EnemyKind.Steed => "steed_", _ => k.ToString().ToLower() + "_", }; } } private static void Fort(Vector3 center) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00b4: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00e6: 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_00ee: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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) PieceType[] array = new PieceType[6] { PieceType.Gun, PieceType.Cannon, PieceType.Harpoon, PieceType.Tesla, PieceType.Sniper, PieceType.Flame }; int num = 0; float[] gapAngles = FortressIsland.GapAngles; Vector3 val = default(Vector3); foreach (float num2 in gapAngles) { ((Vector3)(ref val))..ctor(Mathf.Cos(num2 * (MathF.PI / 180f)), 0f, Mathf.Sin(num2 * (MathF.PI / 180f))); Vector3 val2 = Vector3.Cross(Vector3.up, val); for (int j = -1; j <= 1; j++) { WallAt(center + val * 15f + val2 * ((float)j * 3f) + Vector3.up * 1.2f, val); } TurretAt(array[num % array.Length], center + val * 10f + val2 * 2f); TurretAt(array[(num + 3) % array.Length], center + val * 10f - val2 * 2.5f); num++; } TurretAt(PieceType.Cannon, center + new Vector3(4f, 1.45f, 3f)); } private IEnumerator BossFxScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; SkipBossCamera = true; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player localPlayer = Player.LocalPlayer; Vector3 center = island.Center; localPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); Siege.Instance.ServerAddCoins(Siege.Money(1000000)); if (_arg == "shaders") { string[] array = new string[8] { "Sprites/Default", "UI/Default", "Universal Render Pipeline/Particles/Unlit", "Universal Render Pipeline/Unlit", "Universal Render Pipeline/Particles/Lit", "Legacy Shaders/Particles/Alpha Blended", "Unlit/Transparent", "Unlit/Color" }; Vector3 val = center + new Vector3(-7f, 0f, 7f); for (int num = 0; num < array.Length; num++) { Shader val2 = Shader.Find(array[num]); Note("shader '" + array[num] + "': " + ((!Object.op_Implicit((Object)(object)val2)) ? "missing" : (val2.isSupported ? "found" : "found, unsupported"))); if (!Object.op_Implicit((Object)(object)val2)) { continue; } bool[] array2 = new bool[2] { true, false }; foreach (bool flag in array2) { Vector3 val3 = val + new Vector3((float)num * 2f, 0f, flag ? 0f : 2.2f); GameObject obj = BossFx.Decal("circle", val3, val3 + Vector3.forward, 0.9f, 0, Color.green); Material val4 = new Material(val2) { renderQueue = 3010 }; if (!flag) { val4.color = new Color(1f, 0.1f, 0.1f, 0.7f); if (val4.HasProperty("_BaseColor")) { val4.SetColor("_BaseColor", new Color(1f, 0.1f, 0.1f, 0.7f)); } } if (val4.HasProperty("_Surface")) { val4.SetFloat("_Surface", 1f); val4.SetFloat("_Blend", 0f); val4.SetInt("_SrcBlend", 5); val4.SetInt("_DstBlend", 10); val4.SetInt("_ZWrite", 0); val4.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); } ((Renderer)obj.GetComponent()).sharedMaterial = val4; } } Reveal.Instance.TestView(val + new Vector3(7f, 6f, -5f), val + new Vector3(7f, 0f, 1f)); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("fx_shaders"); Reveal.Instance.TestViewEnd(); plugin.DebugStopRound(); yield break; } List only = ((_arg.Length > 0) ? (from x in _arg.Split(',') select (EnemyKind)Enum.Parse(typeof(EnemyKind), x, ignoreCase: true)).ToList() : EnemyCatalog.BossOrder.ToList()); foreach (EnemyKind item in EnemyCatalog.BossOrder.Where(only.Contains)) { EnemyKind kind = item; int num3 = Array.IndexOf(EnemyCatalog.BossOrder, kind); int gap = 0; int wave = (num3 + 1) * 10; Fort(center); Creature c = plugin.ServerSpawnBoss(kind, 50f, gap, wave, 2.5f); if (!Object.op_Implicit((Object)(object)c)) { Note($"{kind}: no body"); continue; } BossBrain brain = Bosses.Of(c); for (float w = 0f; w < 25f; w += Time.unscaledDeltaTime) { if (!Object.op_Implicit((Object)(object)c)) { break; } if (brain == null) { break; } if (brain.IsLive) { break; } yield return null; } FortressPlugin.Frozen = true; yield return (object)new WaitForSecondsRealtime(0.4f); if (kind == only[0]) { Note(string.Format("sky: sun {0}, ambient {1}, fog {2} {3} {4} ({5}-{6}), skybox {7}", Object.op_Implicit((Object)(object)RenderSettings.sun) ? (((Object)RenderSettings.sun).name + " " + RenderSettings.sun.intensity) : "none", RenderSettings.ambientMode, RenderSettings.fog, RenderSettings.fogMode, RenderSettings.fogDensity, RenderSettings.fogStartDistance, RenderSettings.fogEndDistance, Object.op_Implicit((Object)(object)RenderSettings.skybox) ? ((Object)RenderSettings.skybox.shader).name : "none")); } Vector3 B = ((Component)c).transform.position; Vector3 g = new Vector3(B.x, BossFx.Ground(B), B.z); Vector3 val5 = (center - g).Flat(); Vector3 inward = ((Vector3)(ref val5)).normalized; Vector3 side = Vector3.Cross(Vector3.up, inward); Bounds bb = BossLooks.WorldBounds(((Component)c).transform); val5 = ((Bounds)(ref bb)).extents; float r = Mathf.Max(3f, ((Vector3)(ref val5)).magnitude); Vector3 val6 = ((Component)c).transform.rotation * Quaternion.Inverse(BossLooks.Turn(kind)) * Vector3.forward; string text = string.Join("; ", (from x in ((Component)c).GetComponentsInChildren() where ((Renderer)x).enabled select x).Select(delegate(SkinnedMeshRenderer x) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) string name = ((Object)x).name; Bounds localBounds = ((Renderer)x).localBounds; object arg = ((Bounds)(ref localBounds)).size; object arg2; if (!Object.op_Implicit((Object)(object)x.rootBone)) { arg2 = "-"; } else { Quaternion val15 = Quaternion.Inverse(((Component)c).transform.rotation) * x.rootBone.rotation; Vector3 eulerAngles = ((Quaternion)(ref val15)).eulerAngles; arg2 = ((Vector3)(ref eulerAngles)).ToString("F0"); } return $"{name} local {arg:F2} root {arg2}"; })); AutoTest autoTest = this; object[] obj2 = new object[8] { kind, null, null, null, null, null, null, null }; val5 = (B - center).Flat(); obj2[1] = ((Vector3)(ref val5)).magnitude; obj2[2] = ((Bounds)(ref bb)).min.y - BossFx.Ground(((Bounds)(ref bb)).center); obj2[3] = ((Bounds)(ref bb)).size; obj2[4] = ((Bounds)(ref bb)).center - B; obj2[5] = val6; obj2[6] = Vector3.Angle(val6.Flat(), inward); obj2[7] = text; autoTest.Note(string.Format("{0}: at {1:F1} m out, its feet {2:F1} m over the ground under it, box {3:F1} centred {4:F1}, facing {5:F2} (toward the middle {6:F0} degrees off); {7}", obj2)); LineRenderer arrow = WeaponFx.Line("TestArrow", BossVfx.Glow(Color.yellow, 2f), 0.3f); arrow.positionCount = 2; arrow.SetPosition(0, ((Bounds)(ref bb)).center); arrow.SetPosition(1, ((Bounds)(ref bb)).center + val6 * r * 1.6f); val5 = val6.Flat(); Vector3 val7; if (!(((Vector3)(ref val5)).sqrMagnitude > 0.01f)) { val7 = inward; } else { val5 = val6.Flat(); val7 = ((Vector3)(ref val5)).normalized; } Vector3 flatFwd = val7; Vector3 flatSide = Vector3.Cross(Vector3.up, flatFwd); View(Eye(((Bounds)(ref bb)).center, flatFwd * 2f + flatSide * 0.8f, r * 2.2f, r * 0.4f), ((Bounds)(ref bb)).center); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot($"fx_{kind}_look"); View(Eye(((Bounds)(ref bb)).center, flatSide, r * 2.4f, r * 0.3f), ((Bounds)(ref bb)).center); yield return (object)new WaitForSecondsRealtime(0.4f); FortressPlugin.Shot($"fx_{kind}_side"); if (Object.op_Implicit((Object)(object)arrow)) { Object.Destroy((Object)(object)((Component)arrow).gameObject); } Vector3 look = ((Bounds)(ref bb)).center + Vector3.up * ((Bounds)(ref bb)).extents.y * 0.3f; View(Eye(look, flatFwd - flatSide * 0.6f, r * 1.6f, 0f, low: true), look); yield return (object)new WaitForSecondsRealtime(0.4f); FortressPlugin.Shot($"fx_{kind}_low"); Vector3 front = g + inward * (r + 4f); front.y = BossFx.Ground(front); int turret = TurretFor(front + side * 2f); Vector3 tp = (from p in BuildSystem.Instance.ServerPieces where p.Id == turret select p.Pos).DefaultIfEmpty(front).First(); switch (kind) { case EnemyKind.Warden: Fx("w.circle", front, front, 1300, 260); yield return Shot("warn", front, 0.6f); yield return Pause(0.8f); Fx("warden.snap", front, B); yield return Shot("snap", front, 0.08f); yield return Shot("snap2", front, 0.35f); Fx("warden.chain", B, tp, 3000, turret); yield return Shot("chain", Vector3.Lerp(g, tp, 0.5f), 0.8f, 16f, 9f); yield return Pause(2.8f); Fx("warden.shell", B, B, 3000); yield return Shot("shell", ((Bounds)(ref bb)).center, 1f, r * 2.4f + 4f, r * 0.5f); break; case EnemyKind.Urchin: { Fx("urchin.bristle", B, B, 1000); yield return Shot("bristle", ((Bounds)(ref bb)).center, 0.6f, r * 2.4f + 4f, r * 0.5f); List spots = (from k in Enumerable.Range(0, 10) select g + Quaternion.Euler(0f, (float)k * 36f, 0f) * Vector3.forward * Random.Range(6f, 12f)).ToList(); foreach (Vector3 item2 in spots) { Fx("urchin.spike", B + Vector3.up * r * 0.5f, item2); } yield return Shot("spikes", g, 0.25f, 18f, 10f); yield return Pause(0.3f); foreach (Vector3 item3 in spots) { Fx("urchin.caltrop", item3, item3, 4000); } yield return Shot("caltrops", spots[0], 0.5f, 9f, 5f); Fx("urchin.bloom", B, B, 0, Mathf.RoundToInt((r + 4f) * 100f)); yield return Shot("bloom", g, 0.15f, 20f, 10f); yield return Shot("bloom2", g, 0.25f, 20f, 10f); break; } case EnemyKind.Angler: Fx("angler.lure", B, B, 1700); yield return Shot("lure", ((Bounds)(ref bb)).center, 1.5f, r * 2.4f + 4f, r * 0.4f); yield return Pause(0.2f); Fx("angler.flash", ((Bounds)(ref bb)).center + Vector3.up * ((Bounds)(ref bb)).extents.y + inward * ((Bounds)(ref bb)).extents.z, B); yield return Shot("flash", ((Bounds)(ref bb)).center, 0.1f, r * 2.4f + 4f, r * 0.4f); yield return Pause(1.4f); Fx("dark", B, B, 1); yield return Shot("dark", center, 2.2f, 20f, 11f); yield return Shot("dark2", ((Bounds)(ref bb)).center, 1.2f, r * 2.4f + 6f, r * 0.5f); Fx("dark", B, B); yield return Pause(1.8f); break; case EnemyKind.Steed: { Fx("steed.stomp", g, g, 0, 750); yield return Shot("stomp", g, 0.12f, 18f, 9f); yield return Shot("stomp2", g, 0.35f, 18f, 9f); for (int num7 = -1; num7 <= 1; num7++) { Vector3 val9 = center + side * (float)num7 * 6.5f - inward * 26f; Vector3 val10 = center + side * (float)num7 * 6.5f + inward * 26f; val9.y = BossFx.Ground(val9); val10.y = BossFx.Ground(val10); Fx("steed.phantom", val9, val10, 1100); } yield return Shot("phantoms", center, 0.45f, 22f, 12f); yield return Pause(1f); Fx("steed.golden", B, B); yield return Shot("golden", ((Bounds)(ref bb)).center, 1f, r * 2.4f + 4f, r * 0.5f); break; } case EnemyKind.Stonefish: { for (int num5 = -1; num5 <= 1; num5++) { Fx("stone.spires", g, g + Quaternion.Euler(0f, (float)num5 * 30f, 0f) * inward * 18f); } yield return Shot("spires", g + inward * 8f, 0.6f, 18f, 10f); yield return Pause(2.4f); Fx("stone.pool", front + side * 4f, front, 4000, 240); Fx("stone.pool", front - side * 3f, front, 4000, 240); yield return Shot("pools", front, 0.8f, 14f); yield return Pause(3.6f); Fx("stone.gaze", B + Vector3.up * r * 0.5f, g + inward * 22f, 0, 35); Fx("stone.petrify", tp, B, 3500, turret); yield return Shot("gaze", tp, 0.15f, 12f, 6f); yield return Close("petrify", 0.75f, 7f, 3f); yield return Close("petrified", 1.2f, 6f, 2f); yield return Pause(1.35f); yield return Close("unpetrify", 0.1f, 7f, 3f); yield return Close("unpetrify2", 0.4f, 7f, 3f); break; } case EnemyKind.Skyfish: { for (int num9 = 0; num9 < 6; num9++) { Fx("sky.bomb", front + side * ((float)num9 - 2.5f) * 3f, front); } yield return Shot("bombs", front, 0.15f, 16f); yield return Pause(1.5f); Vector3 val11 = center - side * 28f; Vector3 val12 = center + side * 28f; val11.y = BossFx.Ground(val11) + 7f; val12.y = BossFx.Ground(val12) + 7f; Fx("sky.boom", val11, val12, 600); yield return Shot("boom", center, 0.35f, 24f, 12f); break; } case EnemyKind.Kraken: { Vector3 shore = new Vector3(B.x, WaterManager.GetWaterHeight(B), B.z); Fx("kraken.tentacles", shore, shore + inward * 21f, 1400, 3); yield return Shot("tentacles", shore + inward * 4f, 1f, 18f); yield return Shot("lash", shore + inward * 9f, 0.6f, 16f, 7f); yield return Pause(1f); Fx("kraken.reach", tp, shore, 2000, turret); yield return Shot("reach", tp, 1.2f, 10f, 5f); GameObject val13 = BuildSystem.Instance.PieceObject(turret); if (Object.op_Implicit((Object)(object)val13)) { Note("turret parts: " + string.Join("; ", from x in val13.GetComponentsInChildren() where x.enabled select ((object)x).GetType().Name + " " + ((Object)x).name + ": " + string.Join(",", x.sharedMaterials.Select((Material m) => (!Object.op_Implicit((Object)(object)m)) ? "null" : (((Object)m).name + "/" + (Object.op_Implicit((Object)(object)m.shader) ? ((Object)m.shader).name : "-")))))); } Fx("kraken.grab", tp, shore, 0, turret); BuildSystem.Instance.ServerTakePiece(turret); yield return Shot("grab", Vector3.Lerp(tp, shore, 0.5f) + Vector3.up * 3f, 0.5f, 18f); yield return Pause(1f); Fx("kraken.ink", front, shore, 4000, 700); yield return Shot("ink", front, 1f, 14f, 9f); Fx("kraken.whirl", shore + inward * 4f, shore, 4000, 1500); yield return Shot("whirl", shore + inward * 4f, 1.5f, 14f, 9f); break; } case EnemyKind.Voxel: { Fx("voxel.select", front, front + side, 1600, 400); yield return Shot("select", front, 0.8f, 14f); yield return Pause(0.8f); Fx("voxel.delete", front, front + side, 0, 400); yield return Shot("delete", front, 0.25f, 14f); yield return Pause(1f); for (int num8 = 0; num8 < 6; num8++) { Fx("voxel.bolt", B, front + Random.insideUnitSphere.Flat() * 5f); } yield return Shot("bolts", Vector3.Lerp(g, front, 0.5f), 0.2f, 16f); yield return Pause(1f); Fx("voxel.undo", B, B, 2000); yield return Shot("undo", ((Bounds)(ref bb)).center, 1f, r * 2.4f + 4f, r * 0.4f); break; } case EnemyKind.Koi: { val5 = (g - center).Flat(); Vector3 val8 = center + ((Vector3)(ref val5)).normalized * 38f; val8.y = WaterManager.GetWaterHeight(val8); Fx("koi.gate", val8, val8, 2200); yield return Shot("gate", val8 + Vector3.up * 5f, 1f, 22f, 6f); Fx("koi.jet", B + inward * r * 0.8f, g + inward * 24f, 1300, 28); yield return Shot("jet", g + inward * 12f, 0.6f, 16f, 9f); yield return Pause(1f); Fx("koi.splash", front, front, 0, 550); yield return Shot("splash", front, 0.15f, 16f, 9f); yield return Pause(1f); Fx("koi.breath", B + inward * r * 0.8f, g + inward * 21f, 1200, 30); yield return Shot("breath", g + inward * 10f, 0.6f, 16f, 9f); yield return Pause(0.8f); for (int num6 = 0; num6 < 4; num6++) { Fx("koi.thunder", front + Random.insideUnitSphere.Flat() * 8f, front); } yield return Shot("thunder", front, 0.06f, 18f, 10f); yield return Pause(1f); Fx("koi.dragon", B, B, 2600); yield return Shot("dragon", ((Bounds)(ref bb)).center, 2.8f, r * 2.4f + 4f, r * 0.5f); break; } default: { Fx("eye.open", B, B, 1600); Fx("eye.beam", B, g + inward * 34f, 2400, 32); yield return Shot("beam", g + inward * 16f, 1.2f, 22f, 12f); yield return Pause(1.3f); for (int num4 = 0; num4 < 20; num4++) { Fx("eye.spear", center + Random.insideUnitSphere.Flat() * 18f, center); } yield return Shot("spears", center, 0.35f, 24f, 14f); yield return Shot("spears2", center, 0.25f, 24f, 14f); yield return Pause(1f); Fx("eye.echoLane", center - side * 24f, center + side * 24f, 0, 500); Fx("eye.echo", front, front, 0, 260); yield return Shot("echoes", front, 0.3f, 18f, 10f); yield return Pause(1f); Fx("eye.judgment", B, Siege.Instance.CorePos, 3000); yield return Shot("judgment", Siege.Instance.CorePos + Vector3.up * 6f, 2.6f, 26f, 10f); Fx("eye.verdict", Siege.Instance.CorePos, Siege.Instance.CorePos); yield return Shot("verdict", Siege.Instance.CorePos, 0.15f, 26f, 10f); Fx("eye.red", B, B); break; } } yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Frozen = false; Reveal.Instance.TestViewEnd(); c.ServerChangeHp(10000000); yield return (object)new WaitForSecondsRealtime(3f); Note(string.Format("{0}: shown; trophy dropped {1}", kind, Counters.TryGetValue("trophy_dropped_" + kind, out var value) ? value : 0)); IEnumerator Close(string move, float wait, float dist, float up) { View(Eye(tp + Vector3.up, -inward + side * 0.5f, dist, up), tp + Vector3.up); yield return (object)new WaitForSecondsRealtime(wait); FortressPlugin.Shot($"fx_{kind}_{move}"); } void Fx(string key, Vector3 a, Vector3 b2, int arg = 0, int who = 0) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) BossFx.Send(key, c, a, b2, arg, who); } IEnumerator Shot(string move, Vector3 at, float wait, float dist = 13f, float up = 8f) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) View(Eye(at, side * 1.2f + inward * 0.6f, dist, up), at); yield return (object)new WaitForSecondsRealtime(wait); FortressPlugin.Shot($"fx_{kind}_{move}"); } } Vector3 row = center + new Vector3(0f, 0f, 6f); for (int num10 = 0; num10 < EnemyCatalog.BossOrder.Length; num10++) { Vector3 val14 = row + new Vector3(((float)num10 - 4.5f) * 1.1f, 0f, 0f); val14.y = BossFx.Ground(val14) + 0.6f; BossTrophies.ServerSpawn(EnemyCatalog.BossOrder[num10], val14); } yield return (object)new WaitForSecondsRealtime(2.5f); Reveal.Instance.TestView(row + new Vector3(0f, 3f, -6f), row); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot("fx_trophies"); Reveal.Instance.TestViewEnd(); plugin.DebugStopRound(); static Vector3 Eye(Vector3 val19, Vector3 pref, float dist, float up, bool low = false) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0112: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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) Vector3 val15 = pref.Flat(); Vector3 val16; if (!(((Vector3)(ref val15)).sqrMagnitude > 0.0001f)) { val16 = Vector3.forward; } else { val15 = pref.Flat(); val16 = ((Vector3)(ref val15)).normalized; } Vector3 val17 = val16; for (int i = 0; i < 14; i++) { float num11 = ((i % 2 == 0) ? 1f : (-1f)) * (float)((i + 1) / 2) * 26f; Vector3 val18 = val19 + Quaternion.Euler(0f, num11, 0f) * val17 * dist; val18.y = (low ? (BossFx.Ground(val18) + 0.8f) : (val19.y + up)); if ((low || !(val18.y < BossFx.Ground(val18) + 1.5f)) && !Physics.Linecast(val19 + Vector3.up * 0.3f, val18, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return val18; } } if (low) { Vector3 val20 = val19 + val17 * dist; val20.y = BossFx.Ground(val20) + 2.5f; return val20; } return val19 + Vector3.up * (dist + up); } static IEnumerator Pause(float s) { yield return (object)new WaitForSecondsRealtime(s); } static void View(Vector3 eye, Vector3 look2) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Reveal.Instance.TestView(eye, look2); } } private IEnumerator PlaytestScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 center = island.Center; float stand = 1.1f; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * stand, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); Siege.Instance.ServerAddCoins(Siege.Money(100000)); while (loot.Vault.StorageSlots - loot.Vault.SlotsUsed < 8) { loot.Vault.Bought[Expansion.Storage] = loot.Vault.BoughtOf(Expansion.Storage) + 1; } Vector3 spot = center + new Vector3(6f, 0f, 6f); spot.y = BossFx.Ground(spot); int scales0 = loot.Vault.Scales; loot.ServerDropScales(spot, 12, 6, 2.5f); yield return (object)new WaitForSecondsRealtime(1f); Reveal.Instance.TestView(spot + new Vector3(3.5f, 2.5f, -3.5f), spot); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("pt_scales"); Reveal.Instance.TestViewEnd(); yield return (object)new WaitForSecondsRealtime(1.5f); foreach (Vector3 debugScale in loot.DebugScales) { yield return Walk(debugScale); } yield return (object)new WaitForSecondsRealtime(0.5f); FortressPlugin.Shot("pt_scales_counter"); Note(string.Format("scales: dropped 12, picked {0}, team scales {1} -> {2} (expect +12), left lying {3}", C("scales_picked"), scales0, loot.Vault.Scales, loot.DebugScales.Count)); int opened0 = C("chests_opened"); loot.ServerSpawnChest(plugin.Wave); yield return (object)new WaitForSecondsRealtime(1f); (int id, Vector3 pos) chest = loot.DebugChest; yield return Walk(chest.pos); yield return (object)new WaitForSecondsRealtime(1f); int afterStep = C("chests_opened") - opened0; ClientManager clientManager = InstanceFinder.ClientManager; LootPick lootPick = default(LootPick); (lootPick.Id, _) = chest; clientManager.Broadcast(lootPick, (Channel)0); yield return (object)new WaitForSecondsRealtime(1.5f); Note(string.Format("chest: opened by stepping on it {0} (expect 0), by E {1} (expect 1), scales by it {2}", afterStep, C("chests_opened") - opened0 - afterStep, loot.DebugScales.Count)); FortressPlugin.Shot("pt_chest"); int hooks0 = loot.Vault.Count(Gear.Hook, Rarity.Rare); int auto0 = C("weapon_auto_stored"); Vector3 val = center + new Vector3(-5f, 0f, 5f); loot.DebugDrop(Gear.Hook, Rarity.Rare, val + Vector3.up); yield return (object)new WaitForSecondsRealtime(1.5f); Gear g2; Rarity r2; Item val2 = ((IEnumerable)Object.FindObjectsOfType()).FirstOrDefault((Func)((Item val3) => Object.op_Implicit((Object)(object)val3) && ((NetworkBehaviour)val3).IsSpawned && WeaponItems.Is(val3, out g2, out r2) && g2 == Gear.Hook && r2 == Rarity.Rare && !Object.op_Implicit((Object)(object)val3.Holder) && !val3.IsInInventory)); if (Object.op_Implicit((Object)(object)val2)) { yield return Walk(((Component)val2).transform.position); } yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("dropped weapon walked over: rare hooks in the vault {0} -> {1} (expect +1), auto-stored {2}", hooks0, loot.Vault.Count(Gear.Hook, Rarity.Rare), C("weapon_auto_stored") - auto0)); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Take, Gear = Gear.Hook, Rarity = Rarity.Rare, Count = 1 }); yield return (object)new WaitForSecondsRealtime(2f); Gear g; Rarity r; bool flag = (Object.op_Implicit((Object)(object)me.Inventory) && me.Inventory._items.Values.Any((Item val3) => Object.op_Implicit((Object)(object)val3) && WeaponItems.Is(val3, out g2, out r2) && g2 == Gear.Hook && r2 == Rarity.Rare)) || (WeaponItems.Held(me, out g, out r) && g == Gear.Hook); Note($"taken out of the vault: in my hands {flag} (expect True)"); Fort(center); yield return (object)new WaitForSecondsRealtime(1f); foreach (int item in BuildSystem.Instance.ServerPieces.Select((PieceState p) => p.Id).ToList()) { BuildSystem.Instance.ServerDamagePiece(item, 60); } yield return (object)new WaitForSecondsRealtime(1f); int hurt = BuildSystem.Instance.ServerPieces.Count((PieceState p) => p.Hp < p.MaxHp); FortressPlugin.Shot("pt_buildbar"); InstanceFinder.ClientManager.Broadcast(new PieceUpgradeRequest { Id = -1, Repair = true }, (Channel)0); yield return (object)new WaitForSecondsRealtime(1f); Note($"mend all: {hurt} damaged -> {BuildSystem.Instance.ServerPieces.Count((PieceState p) => p.Hp < p.MaxHp)} (expect 0)"); Siege.Instance.ServerDamageCoreForTest(300); _ = Siege.Instance.View.CoreHp; yield return (object)new WaitForSecondsRealtime(0.5f); int core0 = Siege.Instance.CoreHp; InstanceFinder.ClientManager.Broadcast(new GateRequest { Pull = 2 }, (Channel)0); yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("lighthouse mended at its door: {0} -> {1} of {2} (expect +10%), repairs {3}", core0, Siege.Instance.CoreHp, Siege.Instance.CoreMax, C("core_repaired"))); PieceState pieceState = BuildSystem.Instance.ServerPieces.FirstOrDefault((PieceState p) => Catalog.IsTurret(p.Type)); if (pieceState.Id != 0) { BuildSystem.Instance.ServerDamagePiece(pieceState.Id, 999999); } yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("pt_turret_lost"); Note(string.Format("turret destroyed: pieces destroyed {0}", C("pieces_destroyed"))); plugin.DebugJumpToWave(2); yield return Until(() => plugin.Wave >= 2 && !plugin.InBuildTime, 30f, "wave 2"); for (int i = 0; i < 30; i++) { if (!plugin.Running) { break; } if (plugin.InBuildTime) { break; } plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); } yield return Until(() => plugin.InBuildTime, 20f, "wave 2 cleared"); int bonus0 = C("settle_bonus"); plugin.DebugStopRound(); yield return Until(() => !plugin.Running, 10f, "round over"); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("pt_results"); Note(string.Format("run bonus: {0} (expect {1} for 2 waves)", C("settle_bonus") - bonus0, FortressPlugin.SettleBonus(2))); FortressIsland.Instance.CloseResults(); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } IEnumerator Walk(Vector3 p) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) me.LocalTeleport(p + Vector3.up * stand, 0f, true); yield return (object)new WaitForSecondsRealtime(0.5f); } } private IEnumerator Revive() { Player localPlayer = Player.LocalPlayer; if (Object.op_Implicit((Object)(object)localPlayer) && localPlayer.Dying.IsDead) { AccessTools.Method(typeof(PlayerDying), "LocalRespawn", (Type[])null, (Type[])null).Invoke(localPlayer.Dying, null); yield return Until(() => !Player.LocalPlayer.Dying.IsDead, 10f, "the player to respawn"); yield return (object)new WaitForSecondsRealtime(1f); } } private static int TurretFor(Vector3 at) { //IL_003b: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) int num = BuildSystem.Instance.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); TurretAt(PieceType.Gun, at + Vector3.up * 2f); int num2 = BuildSystem.Instance.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); if (num2 <= num) { return num; } return num2; } private IEnumerator BodiesScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Dictionary all = (Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null); Vector3 center = island.Center; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 spot = center + gd * 21f; Vector3 eye = center + gd * 8f + Vector3.up * 3.6f; RaycastHit val = default(RaycastHit); float ground = (Physics.Raycast(spot + Vector3.up * 20f, Vector3.down, ref val, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer)) ? ((RaycastHit)(ref val)).point.y : spot.y); string[] array = ((_arg.Length > 0) ? _arg : "dripper,anglerfish,oarfish,squid,lobster,browncrab,rockcrab,seahorse,starfish,stonefish,blobfish,eel,flyingfish,seagull,footsnail,tripodfish,sengarat,voxelfish,leech,clam,seaurchin,halibut,pike,bingbong,dogfish,gar,catfish,needlefish,triggerfish,tigerfish,koifish,goldfish,sponge,shrimp,mahi-mahi,spidercrab,pufferfish,manta,albatross,bowheadwhale,giantpiranha,mutatedbowheadwhale,goblinshark,theoldpike").Split(','); string[] array2 = array; Bounds val2 = default(Bounds); foreach (string name in array2) { if (!all.TryGetValue(name, out var value) || !Object.op_Implicit((Object)(object)value)) { Note(name + ": no such spawnable"); continue; } Creature proto = ((Component)value).GetComponent(); ((Bounds)(ref val2))..ctor(((Component)value).transform.position, Vector3.zero); Renderer[] componentsInChildren = ((Component)value).GetComponentsInChildren(true); foreach (Renderer val3 in componentsInChildren) { if (!(val3 is ParticleSystemRenderer)) { ((Bounds)(ref val2)).Encapsulate(val3.bounds); } } float size = Mathf.Max(((Bounds)(ref val2)).size.x, Mathf.Max(((Bounds)(ref val2)).size.y, ((Bounds)(ref val2)).size.z)); float scale = 7f / Mathf.Max(0.05f, size); Item item = Object.Instantiate(value, spot + Vector3.up * 2f, Quaternion.LookRotation(-gd)); ((Component)item).transform.localScale = Vector3.one * scale; Renderer[] rs = (from r in ((Component)item).GetComponentsInChildren() where r.enabled && !(r is ParticleSystemRenderer) select r).ToArray(); if (rs.Length != 0) { Bounds bounds = rs[0].bounds; componentsInChildren = rs; foreach (Renderer val4 in componentsInChildren) { ((Bounds)(ref bounds)).Encapsulate(val4.bounds); } Transform transform = ((Component)item).transform; transform.position += spot - new Vector3(((Bounds)(ref bounds)).center.x, spot.y, ((Bounds)(ref bounds)).center.z) + Vector3.up * (ground + 0.2f - ((Bounds)(ref bounds)).min.y); } Rigidbody[] componentsInChildren2 = ((Component)item).GetComponentsInChildren(); for (int num3 = 0; num3 < componentsInChildren2.Length; num3++) { componentsInChildren2[num3].isKinematic = true; } Creature component = ((Component)item).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Bosses.Puppets.Add(component); } ((NetworkBehaviour)Server.Instance).Spawn(((Component)item).gameObject, (NetworkConnection)null, default(Scene)); me.LocalTeleport(eye, YawTo(eye, spot), true); yield return null; Aim(YawTo(eye, spot), 8f); yield return (object)new WaitForSecondsRealtime(1.3f); FortressPlugin.Shot("body_" + name); Animator componentInChildren = ((Component)item).GetComponentInChildren(); string text = ((Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren.runtimeAnimatorController)) ? string.Join(" ", componentInChildren.parameters.Select((AnimatorControllerParameter p) => p.name + ":" + ((object)p.type/*cast due to .constrained prefix*/).ToString())) : "-"); string text2 = string.Join(", ", (from m in rs.SelectMany((Renderer r) => r.sharedMaterials) where Object.op_Implicit((Object)(object)m) select ((Object)m).name + "/" + (Object.op_Implicit((Object)(object)m.shader) ? ((Object)m.shader).name : "-") + (m.HasProperty("_Colors") ? "[Colors]" : (m.HasProperty("_BaseMap") ? "[BaseMap]" : ""))).Distinct()); string text3 = string.Join(",", (from m in ((Component)item).GetComponentsInChildren(true) select ((object)m).GetType().Name into n where !n.StartsWith("Network") select n).Distinct()); Note(string.Format("{0}: {1} {2}, size {3:F2} x{4:F1}, max hp {5}, renderers {6} ({7}), animator {8} [{9}], comps {10}; mats {11}", name, Object.op_Implicit((Object)(object)proto) ? ((object)proto).GetType().Name : "?", Object.op_Implicit((Object)(object)proto) ? ((object)proto.BossType/*cast due to .constrained prefix*/).ToString() : "", size, scale, Object.op_Implicit((Object)(object)proto) ? proto.MaxHp : 0, string.Join(",", rs.Select((Renderer r) => ((object)r).GetType().Name).Distinct()), rs.Length, Object.op_Implicit((Object)(object)componentInChildren) ? ((Object)componentInChildren).name : "-", text, text3, text2)); item.DestroyItem((byte)0, byte.MaxValue); yield return (object)new WaitForSecondsRealtime(0.4f); } } private IEnumerator BossProbeScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; List> list = ((Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null)).Where(delegate(KeyValuePair keyValuePair) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)keyValuePair.Value)) { Creature component3 = ((Component)keyValuePair.Value).GetComponent(); if (component3 != null) { return (int)component3.BossType > 0; } } return false; }).ToList(); Bounds val = default(Bounds); foreach (KeyValuePair item in list) { Creature component = ((Component)item.Value).GetComponent(); ((Bounds)(ref val))..ctor(((Component)item.Value).transform.position, Vector3.zero); Renderer[] componentsInChildren = ((Component)item.Value).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { ((Bounds)(ref val)).Encapsulate(val2.bounds); } Note($"boss prefab '{item.Key}': {((object)component).GetType().Name}, {component.BossType}, max hp {component.MaxHp}, hp mult {component.BossHpMultiplier}, time {component.BossTimeInSeconds}s, size {((Bounds)(ref val)).size:F1}, scale {((Component)item.Value).transform.localScale:F2}"); } Vector3 center = island.Center; Vector3 stand = center + new Vector3(0f, 2.3000002f, 6f); foreach (KeyValuePair kv in list) { Creature component2 = ((Component)kv.Value).GetComponent(); string cls = ((object)component2).GetType().Name; bool flag = cls == "Manta" || cls == "Piranha"; bool flag2 = cls == "Albatross" || cls == "BowheadWhale"; Vector3 val3 = center + new Vector3(0f, 0f, flag ? 34f : 18f); val3.y = (flag ? (WaterManager.GetWaterHeight(val3) - 1f) : (flag2 ? 12f : 2.5f)); Item val4 = Object.Instantiate(kv.Value, val3, Quaternion.Euler(0f, 180f, 0f)); ((NetworkBehaviour)Server.Instance).Spawn(((Component)val4).gameObject, (NetworkConnection)null, default(Scene)); Creature boss = (Object.op_Implicit((Object)(object)val4.Creature) ? val4.Creature : ((Component)val4).GetComponent()); me.LocalTeleport(stand, 0f, true); yield return null; Aim(0f, -2f); _ = Time.realtimeSinceStartup; yield return (object)new WaitForSecondsRealtime(4f); FortressPlugin.Shot("bossprobe_" + kv.Key + "_a"); yield return (object)new WaitForSecondsRealtime(5f); FortressPlugin.Shot("bossprobe_" + kv.Key + "_b"); Note(string.Format("{0} ({1}): at {2:F1} after 9 s, hp {3}, boss fight {4}, max {5}, dead {6}", kv.Key, cls, Object.op_Implicit((Object)(object)boss) ? (((Component)boss).transform.position - center) : Vector3.zero, Object.op_Implicit((Object)(object)boss) ? boss._hp.Value : (-1), Object.op_Implicit((Object)(object)BossManager.Boss) ? ((Object)BossManager.Boss).name : "none", BossManager.BossMaxHp, Object.op_Implicit((Object)(object)boss) && boss.IsDead)); if (Object.op_Implicit((Object)(object)boss) && ((NetworkBehaviour)boss).IsSpawned) { ((Item)boss).DestroyItem((byte)0, byte.MaxValue); } yield return (object)new WaitForSecondsRealtime(2.5f); } } private IEnumerator SharkAimScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Vector3 center = island.Center; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 feet = center + gd * 15f; RaycastHit val = default(RaycastHit); if (Physics.Raycast(feet + Vector3.up * 20f, Vector3.down, ref val, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { feet.y = ((RaycastHit)(ref val)).point.y; } (Rarity, float, string)[] array = new(Rarity, float, string)[2] { (Rarity.Rare, 0f, "rare"), (Rarity.Legendary, 25f, "legend") }; for (int num2 = 0; num2 < array.Length; num2++) { var (r, yawOff, tag) = array[num2]; Hold(r); me.LocalTeleport(feet + Vector3.up * 1.1f, Mathf.Atan2(gd.x, gd.z) * 57.29578f + yawOff, true); yield return null; Aim(Mathf.Atan2(gd.x, gd.z) * 57.29578f + yawOff, 14f); yield return (object)new WaitForSecondsRealtime(1.5f); Vector3 mark = Weapons.Instance.DebugCastMark; FortressPlugin.Shot("shark_aim_" + tag); yield return (object)new WaitForSecondsRealtime(0.3f); Transform transform = ((Component)GameInfo.CurCamera).transform; Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 0, Origin = transform.position, Dir = transform.forward }); yield return (object)new WaitForSecondsRealtime(0.5f); Vector3 debugLastShark = Weapons.Instance.DebugLastShark; AutoTest autoTest = this; Vector3 val2 = (mark - center).Flat(); object arg = ((Vector3)(ref val2)).magnitude; val2 = (debugLastShark - mark).Flat(); autoTest.Note($"{tag}: mark at {arg:0.0} m from the island's middle, the shark surfaced {((Vector3)(ref val2)).magnitude:0.0} m from the mark (expect under 1.5)"); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot("shark_aim_" + tag + "_cooling"); yield return (object)new WaitForSecondsRealtime(0.3f); } Item Hold(Rarity r2) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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) foreach (Item item in (from x in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)x) select x).Distinct().ToList()) { me.Inventory.RemoveItem(item); item.DestroyItem((byte)0, byte.MaxValue); } Item val3 = WeaponItems.ServerSpawn(Gear.SharkWhistle, r2, feet + Vector3.up * 1.5f); if (Object.op_Implicit((Object)(object)val3)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(val3, me, (Item)null); } return val3; } } private IEnumerator LadderScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists && Object.op_Implicit((Object)(object)Siege.Instance.Lighthouse), 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Transform lh = Siege.Instance.Lighthouse; FieldRef input = AccessTools.FieldRefAccess("_moveInput"); Vector3 val = lh.TransformPoint(new Vector3(-2.92f, 1.2f, 0f)); Player obj = me; Quaternion val2 = Quaternion.LookRotation((lh.position - val).Flat()); obj.LocalTeleport(val, ((Quaternion)(ref val2)).eulerAngles.y, true); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("ladder_foot"); float t0 = Time.time; bool climbed = false; while (Time.time - t0 < 10f && (!(Local().y > 4.36f) || !me.Movement.Grounded || Ladder.Climbing)) { input.Invoke(me.Movement) = new Vector2(0f, 1f); climbed |= Ladder.Climbing; if (Time.time - t0 > 1.2f && Time.time - t0 < 1.3f) { FortressPlugin.Shot("ladder_climbing"); } yield return null; } input.Invoke(me.Movement) = Vector2.zero; Note(string.Format("up: climbed {0}, {1:0.0} s, now at {2:F2} on the gallery {3} (climb starts {4})", climbed, Time.time - t0, Local(), Local().y > 4.36f, C("ladder_climb"))); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("ladder_top"); Vector3 position = me.Transform.position; Player obj2 = me; val2 = Quaternion.LookRotation((position - lh.position).Flat()); obj2.LocalTeleport(position, ((Quaternion)(ref val2)).eulerAngles.y, true); yield return (object)new WaitForSecondsRealtime(0.5f); t0 = Time.time; while (Time.time - t0 < 10f && (!(Local().y < 1f) || !me.Movement.Grounded)) { input.Invoke(me.Movement) = new Vector2(0f, 1f); if (Time.time - t0 > 1.5f && Time.time - t0 < 1.6f) { FortressPlugin.Shot("ladder_down"); } yield return null; } input.Invoke(me.Movement) = Vector2.zero; Note($"down: {Time.time - t0:0.0} s, now at {Local():F2} (expect the ground in front of the ladder)"); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } Vector3 Local() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) return lh.InverseTransformPoint(me.Transform.position); } } private IEnumerator BranchWalkScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; foreach (Item item in (from x in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)x) select x).Distinct().ToList()) { me.Inventory.RemoveItem(item); item.DestroyItem((byte)0, byte.MaxValue); } Vector3 center = island.Center; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(600f); Siege.Instance.ServerAddCoins(Siege.Money(20000)); BuildSystem B = BuildSystem.Instance; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); int num2 = B.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); TurretAt(PieceType.Gun, center + gd * 9f + Vector3.up * 1.2f); int id = B.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); if (id <= num2) { Note("no gun placed"); yield break; } B.ServerUpgrade(id, 1); yield return (object)new WaitForSecondsRealtime(1f); B.StopBuilding(); B.TryGetState(id, out var s0); Vector3 eye = center + gd * 6.5f; RaycastHit val = default(RaycastHit); if (Physics.Raycast(eye + Vector3.up * 20f, Vector3.down, ref val, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { eye.y = ((RaycastHit)(ref val)).point.y + 1.1f; } me.LocalTeleport(eye, YawTo(eye, s0.Pos), true); yield return (object)new WaitForSecondsRealtime(1f); B.DebugPressU(id); yield return (object)new WaitForSecondsRealtime(0.8f); bool open = PieceMenu.IsOpen; FortressPlugin.Shot("branch_walkup"); yield return (object)new WaitForSecondsRealtime(0.4f); PieceMenu.Instance.DebugUpgrade(2); yield return (object)new WaitForSecondsRealtime(1f); B.TryGetState(id, out var s1); bool stillOpen = PieceMenu.IsOpen; me.LocalTeleport(eye - gd * 8f, YawTo(eye, s0.Pos), true); yield return (object)new WaitForSecondsRealtime(0.8f); Note(string.Format("walk-up U on a Lv{0} gun (building {1}): menu open {2} (expect True), after picking B Lv{3} branch {4} (expect 3, 2), menu {5}; walked 8 m off: menu open {6} (expect False)", s0.Level, BuildSystem.Building, open, s1.Level, s1.Branch, stillOpen ? "still open" : "closed", PieceMenu.IsOpen)); plugin.DebugStopRound(); } private IEnumerator StallLookScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; foreach (Item item3 in (from x in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)x) select x).Distinct().ToList()) { me.Inventory.RemoveItem(item3); item3.DestroyItem((byte)0, byte.MaxValue); } yield return (object)new WaitForSecondsRealtime(2f); Vector3 c = island.MarketPos + Vector3.up * 1.2f; Quaternion face = Quaternion.Euler(0f, -90f, 0f); (float, float, float, string)[] array = new(float, float, float, string)[6] { (0f, 6.5f, 8f, "front"), (-40f, 6.5f, 10f, "left"), (40f, 6.5f, 10f, "right"), (100f, 6f, 8f, "side"), (180f, 6f, 8f, "back"), (0f, 3f, 22f, "counter") }; (float, float, float, string)[] array2 = array; RaycastHit val = default(RaycastHit); for (int num = 0; num < array2.Length; num++) { (float, float, float, string) tuple = array2[num]; float item = tuple.Item1; float item2 = tuple.Item2; float pitch = tuple.Item3; string tag = tuple.Item4; Vector3 eye = c + face * (Quaternion.Euler(0f, item, 0f) * Vector3.forward) * item2; if (Physics.Raycast(eye + Vector3.up * 30f, Vector3.down, ref val, 60f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { eye.y = ((RaycastHit)(ref val)).point.y + 1.1f; } me.LocalTeleport(eye, YawTo(eye, c), true); yield return null; Aim(YawTo(eye, c), pitch); yield return (object)new WaitForSecondsRealtime(1.3f); FortressPlugin.Shot("stall_" + tag); yield return (object)new WaitForSecondsRealtime(0.3f); } } private IEnumerator ShopRefScenario() { yield return (object)new WaitForSecondsRealtime(2f); string path = Path.Combine(Paths.BepInExRootPath, "fortress-shots"); string[] words = new string[14] { "shop", "store", "kiosk", "stand", "stall", "market", "grill", "counter", "booth", "vendor", "cart", "awning", "casino", "bar" }; List roots = (from val8 in Resources.FindObjectsOfTypeAll().Where(delegate(Transform val8) { //IL_0025: 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) if (Object.op_Implicit((Object)(object)val8)) { Scene scene = ((Component)val8).gameObject.scene; if (((Scene)(ref scene)).IsValid() && words.Any((string w) => ((Object)val8).name.ToLower().Contains(w))) { return ((Component)val8).GetComponentsInChildren(true).Length != 0; } } return false; }) where !((Object)val8).name.StartsWith("Fortress") && !PathOf(val8).Contains("Fortress") select val8).ToList(); roots = roots.Where((Transform val8) => !roots.Any((Transform o) => (Object)(object)o != (Object)(object)val8 && val8.IsChildOf(o))).ToList(); int num = 0; foreach (Transform item in roots.OrderByDescending((Transform val8) => ((Component)val8).GetComponentsInChildren(true).Length).Take(14)) { List list = (from r in ((Component)item).GetComponentsInChildren(true) where Object.op_Implicit((Object)(object)((Component)r).GetComponent()) && Object.op_Implicit((Object)(object)((Component)r).GetComponent().sharedMesh) select r).ToList(); Note(string.Format("shop {0}: {1} active {2} at {3:F0}, {4} meshes, mats {5}", num, PathOf(item), ((Component)item).gameObject.activeInHierarchy, item.position, list.Count, string.Join("/", (from m in list.SelectMany((MeshRenderer r) => ((Renderer)r).sharedMaterials) where Object.op_Implicit((Object)(object)m) select ((Object)m).name).Distinct().Take(6)))); StringBuilder stringBuilder = new StringBuilder(); CultureInfo invariantCulture = CultureInfo.InvariantCulture; int num2 = 1; foreach (MeshRenderer item2 in list) { Mesh sharedMesh = ((Component)item2).GetComponent().sharedMesh; Vector3[] vertices; Vector2[] uv; int[] triangles; try { vertices = sharedMesh.vertices; uv = sharedMesh.uv; triangles = sharedMesh.triangles; } catch { continue; } if (vertices.Length == 0) { continue; } Matrix4x4 val = item.worldToLocalMatrix * ((Component)item2).transform.localToWorldMatrix; stringBuilder.Append("o " + ((Object)item2).name + "\n"); Vector3[] array = vertices; foreach (Vector3 val2 in array) { Vector3 val3 = ((Matrix4x4)(ref val)).MultiplyPoint3x4(val2); stringBuilder.Append("v " + (0f - val3.x).ToString("R", invariantCulture) + " " + val3.y.ToString("R", invariantCulture) + " " + val3.z.ToString("R", invariantCulture) + "\n"); } bool flag = uv.Length == vertices.Length; if (flag) { Vector2[] array2 = uv; for (int num3 = 0; num3 < array2.Length; num3++) { Vector2 val4 = array2[num3]; stringBuilder.Append("vt " + val4.x.ToString("R", invariantCulture) + " " + val4.y.ToString("R", invariantCulture) + "\n"); } } for (int num4 = 0; num4 < triangles.Length; num4 += 3) { int num5 = triangles[num4] + num2; int num6 = triangles[num4 + 2] + num2; int num7 = triangles[num4 + 1] + num2; stringBuilder.Append(flag ? $"f {num5}/{num5} {num6}/{num6} {num7}/{num7}\n" : $"f {num5} {num6} {num7}\n"); } num2 += vertices.Length; } if (num2 > 1) { File.WriteAllText(Path.Combine(path, $"shopref_{num}_{((Object)item).name.Replace(' ', '_')}.obj"), stringBuilder.ToString()); } num++; } Player me = Player.LocalPlayer; if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; RaycastHit val7 = default(RaycastHit); foreach (Transform t in roots.Where((Transform val8) => (((Component)val8).gameObject.activeInHierarchy && ((Object)val8).name.StartsWith("TreeShop")) || ((Object)val8).name.StartsWith("SlotMachine")).Take(2)) { Bounds b = (from r in ((Component)t).GetComponentsInChildren() select r.bounds).Aggregate(delegate(Bounds x, Bounds y) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((Bounds)(ref x)).Encapsulate(y); return x; }); Note($"{((Object)t).name}: bounds {((Bounds)(ref b)).size:F1} centre {((Bounds)(ref b)).center:F1}"); for (int a = 0; a < 4; a++) { float num8 = (float)a * 90f + 30f; Vector3 val5 = Quaternion.Euler(0f, num8, 0f) * Vector3.forward; Vector3 center = ((Bounds)(ref b)).center; Vector3 val6 = ((Bounds)(ref b)).extents; Vector3 eye = center + val5 * Mathf.Max(4f, ((Vector3)(ref val6)).magnitude * 1.6f); if (Physics.Raycast(eye + Vector3.up * 30f, Vector3.down, ref val7, 60f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { eye.y = ((RaycastHit)(ref val7)).point.y + 1.1f; } me.LocalTeleport(eye, YawTo(eye, ((Bounds)(ref b)).center), true); yield return null; float yaw = YawTo(eye, ((Bounds)(ref b)).center); float num9 = eye.y - ((Bounds)(ref b)).center.y; val6 = (((Bounds)(ref b)).center - eye).Flat(); Aim(yaw, Mathf.Clamp(Mathf.Atan2(num9, ((Vector3)(ref val6)).magnitude) * 57.29578f, -20f, 30f)); yield return (object)new WaitForSecondsRealtime(1.4f); FortressPlugin.Shot(string.Format("shopref_{0}_{1}", ((Object)t).name.Replace(' ', '_').Replace("(", "").Replace(")", ""), a)); yield return (object)new WaitForSecondsRealtime(0.3f); } } } private IEnumerator PeopleScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; yield return (object)new WaitForSecondsRealtime(2f); foreach (Item item in (from x in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)x) select x).Distinct().ToList()) { me.Inventory.RemoveItem(item); item.DestroyItem((byte)0, byte.MaxValue); } NPC val = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)delegate(NPC val5) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)val5)) { Scene scene = ((Component)val5).gameObject.scene; if (((Scene)(ref scene)).IsValid() && ((Component)val5).gameObject.activeInHierarchy) { return ((Object)val5).name.StartsWith("Swamp Daughter"); } } return false; }); Vector3 cam; if (Object.op_Implicit((Object)(object)val)) { Transform spot = ((Component)val).transform; Person pa = Person.Make(new GameObject("CompareA").transform, "Helper1"); Person pb = Person.Make(new GameObject("CompareB").transform, "Helper1"); ((Component)pa).transform.parent.SetPositionAndRotation(spot.position + spot.right * 1f, spot.rotation); ((Component)pb).transform.parent.SetPositionAndRotation(spot.position - spot.right * 1f, spot.rotation); cam = Stand(spot.position + spot.forward * 3.2f); me.LocalTeleport(cam, YawTo(cam, spot.position), true); yield return null; Aim(YawTo(cam, spot.position), 4f); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("people_compare"); yield return (object)new WaitForSecondsRealtime(0.4f); Object.Destroy((Object)(object)((Component)((Component)pa).transform.parent).gameObject); Object.Destroy((Object)(object)((Component)((Component)pb).transform.parent).gameObject); } cam = Stand(island.Center + FortressIsland.ReadyLocal) - Vector3.up * 1.1f; Vector3 across = Vector3.right; Vector3 toCam = Vector3.forward; string[] ids = new string[12] { "Market", "Smith", "Vault", "Lighthouse", "Helper1", "Helper2", "Helper3", "Helper4", "Helper5", "Helper6", "Helper7", "Helper8" }; List line = new List(); RaycastHit val3 = default(RaycastHit); for (int num = 0; num < ids.Length; num++) { Transform transform = new GameObject("Lineup" + ids[num]).transform; Vector3 val2 = cam + across * ((float)(num % 6) - 2.5f) * 1.1f - toCam * (float)(num / 6) * 2.2f; if (Physics.Raycast(val2 + Vector3.up * 10f, Vector3.down, ref val3, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { val2.y = ((RaycastHit)(ref val3)).point.y; } transform.SetPositionAndRotation(val2, Quaternion.LookRotation(toCam)); Person person = Person.Make(transform, ids[num]); line.Add(person); float num2 = ((Component)person).GetComponentsInChildren().Select(delegate(Renderer r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = r.bounds; return ((Bounds)(ref bounds)).max.y; }).DefaultIfEmpty(val2.y) .Max(); Note(string.Format("line-up {0}: {1}, {2:0.00} m tall", ids[num], Object.op_Implicit((Object)(object)((Component)person).transform.Find("Character")) ? "the game's body" : "modelled", num2 - val2.y)); } bool posing = true; ((MonoBehaviour)this).StartCoroutine(Animate()); Vector3 cam2 = Stand(cam + toCam * 4.2f - across * 0.6f); me.LocalTeleport(cam2, YawTo(cam2, cam - toCam * 1f), true); yield return null; Aim(YawTo(cam2, cam - toCam * 1f), 8f); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("people_lineup"); yield return (object)new WaitForSecondsRealtime(0.4f); for (int n = 0; n < 4; n++) { Vector3 face = ((Component)line[n]).transform.position + Vector3.up * 1.45f; Vector3 near = Stand(((Component)line[n]).transform.position + toCam * 1.5f); me.LocalTeleport(near, YawTo(near, face), true); yield return null; Aim(YawTo(near, face), 2f); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot("people_close_" + ids[n]); yield return (object)new WaitForSecondsRealtime(0.3f); } Vector3 side = Stand(cam + across * 5f + toCam * 1.5f); me.LocalTeleport(side, YawTo(side, cam), true); yield return null; Aim(YawTo(side, cam), 8f); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot("people_lineup_side"); yield return (object)new WaitForSecondsRealtime(0.4f); posing = false; foreach (Person item2 in line) { if (Object.op_Implicit((Object)(object)item2)) { Object.Destroy((Object)(object)((Component)((Component)item2).transform.parent).gameObject); } } foreach (Keeper k in island.Keepers) { Person person2 = k.Person; Note(string.Format("{0}: {1}, parts {2}, {3:0.00} m tall", k.Role, Object.op_Implicit((Object)(object)((Component)person2).transform.Find("Character")) ? "the game's body" : "modelled", string.Join(", ", from r in ((Component)person2).GetComponentsInChildren(true) where ((Component)r).gameObject.activeSelf select ((Object)r).name + ":" + (Object.op_Implicit((Object)(object)r.sharedMesh) ? ((Object)r.sharedMesh).name : "-")), Height((Component)(object)person2))); yield return Photo(((Component)k).transform, 1.9f, 4f, "people_" + k.Role + "_face"); yield return Photo(((Component)k).transform, 3.6f, 14f, "people_" + k.Role); } Keeper keeper = island.Keepers.FirstOrDefault((Keeper keeper2) => keeper2.Role == "Market"); if (Object.op_Implicit((Object)(object)keeper)) { AccessTools.Field(typeof(Keeper), "_talkUntil").SetValue(keeper, Time.time + 4f); yield return Photo(((Component)keeper).transform, 2.6f, 8f, "people_talking"); } loot.Vault.Helpers = 8; loot.SaveVault(); me.LocalTeleport(island.Center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running, 15f, "round start"); yield return (object)new WaitForSecondsRealtime(6f); List helpers = (from x in Object.FindObjectsOfType() where ((Object)x).name.StartsWith("PersonHelper") select x).ToList(); Note(string.Format("helpers: {0}: {1}", helpers.Count, string.Join(", ", helpers.Select((Person h) => ((Object)h).name + " " + string.Join("/", from r in ((Component)h).GetComponentsInChildren(true) where ((Component)r).gameObject.activeSelf && ((Object)r).name != "CharacterHead" select (!Object.op_Implicit((Object)(object)r.sharedMesh)) ? "-" : ((Object)r.sharedMesh).name))))); for (int n = 0; n < Mathf.Min(3, helpers.Count); n++) { Transform spot = ((Component)helpers[n]).transform; Vector3 position = spot.position; Vector3 val4 = spot.forward + spot.right * 0.4f; side = Stand(position + ((Vector3)(ref val4)).normalized * 3.2f); me.LocalTeleport(side, YawTo(side, spot.position), true); yield return null; Aim(YawTo(side, spot.position), 12f); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot("people_helper" + n); yield return (object)new WaitForSecondsRealtime(0.3f); } plugin.DebugStopRound(); IEnumerator Animate() { float t = 0f; while (posing) { t += Time.deltaTime; for (int i = 0; i < line.Count; i++) { if (Object.op_Implicit((Object)(object)line[i])) { line[i].Pose((i == 5) ? (t * 7f) : 0f, (i == 5) ? 1f : 0f, i == 6, (i == 0) ? 1f : 0f, 0f, 0f); } } yield return null; } } static float Height(Component p) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) float num3 = float.MinValue; Renderer[] componentsInChildren = p.GetComponentsInChildren(); foreach (Renderer val5 in componentsInChildren) { float num4 = num3; Bounds bounds = val5.bounds; num3 = Mathf.Max(num4, ((Bounds)(ref bounds)).max.y); } return num3 - p.transform.position.y; } IEnumerator Photo(Transform who, float dist, float pitch, string shot) { Vector3 at = Stand(who.position + who.forward * dist); me.LocalTeleport(at, YawTo(at, who.position), true); yield return null; Aim(YawTo(at, who.position), pitch); yield return (object)new WaitForSecondsRealtime(1.4f); FortressPlugin.Shot(shot); yield return (object)new WaitForSecondsRealtime(0.4f); } static Vector3 Stand(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 20f, Vector3.down, ref val5, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { w.y = ((RaycastHit)(ref val5)).point.y; } return w + Vector3.up * 1.1f; } } private IEnumerator AbsorberScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; ulong key = Loot.KeyOf(me); VaultData V = loot.Vault; Vector3 center = island.Center; float stand = 1.1f; int best0 = V.Best; V.Absorbed.Remove(key); V.Best = 0; loot.SaveVault(); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * stand, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); Siege.Instance.ServerAddCoins(Siege.Money(20000)); foreach (Item item in (from i in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)i) select i).Distinct().ToList()) { me.Inventory.RemoveItem(item); item.DestroyItem((byte)0, byte.MaxValue); } Vector3 to = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.2f, 1.6f, 0.45f); Vector3 val = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(0.6f, stand + 0.2f, 2.6f); me.LocalTeleport(val, YawTo(val, to), true); yield return (object)new WaitForSecondsRealtime(1f); int coins0 = Siege.Instance.ServerCoins; loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Buy, Gear = Gear.Absorber, Rarity = Rarity.Common }); yield return (object)new WaitForSecondsRealtime(1.5f); Note(string.Format("locked (best 0): money {0} -> {1} (expect the same), in hand '{2}'", coins0, Siege.Instance.ServerCoins, Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing")); VaultUI.Instance.Open(VaultUI.Desk.Smith); VaultUI.Instance.DebugTab(2); VaultUI.Instance.DebugSelect(Gear.Absorber, Rarity.Common); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("absorber_shop_locked"); yield return (object)new WaitForSecondsRealtime(0.5f); V.Best = Mathf.Max(best0, 10); loot.SaveVault(); yield return Until(() => loot.ClientVault.Best >= 10, 5f, "unlocked"); VaultUI.Instance.DebugSelect(Gear.Absorber, Rarity.Common); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("absorber_shop_open"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Close(); coins0 = Siege.Instance.ServerCoins; loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Buy, Gear = Gear.Absorber, Rarity = Rarity.Common }); yield return (object)new WaitForSecondsRealtime(2f); Note(string.Format("bought: money {0} -> {1} (expect -{2}), in hand '{3}', counted {4}", coins0, Siege.Instance.ServerCoins, Loot.ShopPrice(Gear.Absorber), Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing", C("weapon_bought"))); if (!WeaponItems.Held(me, out var g, out var _) || g != Gear.Absorber) { Item bought = WeaponItems.ServerSpawn(Gear.Absorber, Rarity.Common, me.Transform.position + Vector3.up); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)bought)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(bought, me, (Item)null); } } float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 side = Vector3.Cross(Vector3.up, val2); Vector3 feet = Ground(center + val2 * 6f); Vector3 eye = feet + Vector3.up * 1.6f; Vector3 prop = Ground(center + val2 * 10f); Vector3 mid = Ground(center + val2 * 16f); me.LocalTeleport(feet + Vector3.up * 0.2f, YawTo(eye, prop), true); plugin.DebugKillAll(); Item trophy = BossTrophies.ServerSpawn(EnemyKind.Warden, prop + Vector3.up * 0.6f); yield return (object)new WaitForSecondsRealtime(2f); Vector3 thing = (Object.op_Implicit((Object)(object)trophy) ? ((Component)trophy).transform.position : prop); for (int t = 0; t < 8; t++) { Weapons.Instance.ServerFire(me, At(thing, (t != 0) ? ((byte)1) : ((byte)0))); if (t == 2) { FortressPlugin.Shot("absorber_sucking"); } yield return (object)new WaitForSecondsRealtime(0.1f); } Weapons.Instance.ServerFire(me, At(thing, 2)); yield return Until(() => loot.ClientVault.AbsorbedOf(key) != null, 5f, "absorbed"); StoredItem heldNow = loot.ClientVault.AbsorbedOf(key); Note(string.Format("sucked in: id {0} (the warden's trophy is {1}), worth {2}, the trophy gone {3}, absorbed {4}", (int)(heldNow?.Id ?? 0), BossTrophies.IdOf(EnemyKind.Warden), heldNow?.Worth ?? 0, !Object.op_Implicit((Object)(object)trophy), C("absorbed"))); yield return (object)new WaitForSecondsRealtime(1f); Aim(YawTo(eye, mid), 12f); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("absorber_holding"); yield return (object)new WaitForSecondsRealtime(0.4f); EnemyKind[] bossOrder = EnemyCatalog.BossOrder; for (int t = 0; t < bossOrder.Length; t++) { EnemyKind k = bossOrder[t]; plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(0.4f); V.Absorbed[key] = new StoredItem { Saved = new SavedItem { Exists = true, ItemID = BossTrophies.IdOf(k) }, Worth = BossTrophies.Worth(k) }; loot.SaveVault(); Creature a = Tank(mid); Creature b = Tank(Ground(mid + side * 2.2f)); me.LocalTeleport(feet + Vector3.up * 0.2f, YawTo(eye, mid), true); yield return (object)new WaitForSecondsRealtime(1.3f); Weapons.Instance.DebugReady(me); int a2 = (Object.op_Implicit((Object)(object)a) ? a._hp.Value : 0); int b2 = (Object.op_Implicit((Object)(object)b) ? b._hp.Value : 0); int n0 = C("absorber_move_" + k); Weapons.Instance.ServerFire(me, At((Object.op_Implicit((Object)(object)a) ? ((Component)a).transform.position : mid) + Vector3.up * 0.5f, 0)); FortressPlugin.Shot("absorber_" + k, k switch { EnemyKind.Voxel => 0.4f, EnemyKind.Koi => 0.6f, _ => 0.25f, }); yield return (object)new WaitForSecondsRealtime((k == EnemyKind.Kraken) ? 3.2f : 2f); Note(string.Format("{0} move: went off {1}, fish health {2} -> {3} and {4} -> {5}", k, C("absorber_move_" + k) - n0, a2, Object.op_Implicit((Object)(object)a) ? a._hp.Value : 0, b2, Object.op_Implicit((Object)(object)b) ? b._hp.Value : 0)); } plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(0.5f); V.Absorbed[key] = new StoredItem { Saved = new SavedItem { Exists = true, ItemID = BossTrophies.IdOf(EnemyKind.Urchin) }, Worth = BossTrophies.Worth(EnemyKind.Urchin) }; loot.SaveVault(); Weapons.Instance.DebugReady(me); Item laser = WeaponItems.ServerSpawn(Gear.Laser, Rarity.Rare, prop + Vector3.up * 0.4f); yield return (object)new WaitForSecondsRealtime(2f); int spat0 = C("absorber_spat"); Vector3 p = (Object.op_Implicit((Object)(object)laser) ? ((Component)laser).transform.position : prop); Weapons.Instance.ServerFire(me, At(p, 3)); Weapons.Instance.ServerFire(me, At(p, 5)); yield return (object)new WaitForSecondsRealtime(1.5f); heldNow = loot.ClientVault.AbsorbedOf(key); BossTrophyItem bossTrophyItem = Object.FindObjectsOfType().FirstOrDefault((BossTrophyItem bossTrophyItem2) => bossTrophyItem2.Boss == EnemyKind.Urchin && ((NetworkBehaviour)((Component)bossTrophyItem2).GetComponent()).IsSpawned); Note(string.Format("swap: now holds id {0} (a rare laser is {1}), spat {2} (expect 1), the urchin's trophy back in the world {3}", (int)(heldNow?.Id ?? 0), WeaponItems.IdOf(Gear.Laser, Rarity.Rare), C("absorber_spat") - spat0, Object.op_Implicit((Object)(object)bossTrophyItem))); Creature tank = Tank(mid); yield return (object)new WaitForSecondsRealtime(1.3f); int t2 = (Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0); int beam0 = C("absorber_copy_Laser"); Vector3 val3 = TankAt(); Vector3 tp0 = val3; Weapons.Instance.ServerFire(me, At(val3, 0)); for (int t = 0; t < 15; t++) { Weapons.Instance.ServerFire(me, At(TankAt(), 1)); if (t == 8) { FortressPlugin.Shot("absorber_copy_laser"); } yield return (object)new WaitForSecondsRealtime(0.1f); } Weapons.Instance.ServerFire(me, At(TankAt(), 2)); AutoTest autoTest = this; object[] obj = new object[4] { C("absorber_copy_Laser") - beam0, t2, Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0, null }; Vector3 val4 = TankAt() - tp0; obj[3] = ((Vector3)(ref val4)).magnitude; autoTest.Note(string.Format("copied laser: started {0}, tank health {1} -> {2}, it drifted {3:0.0} m", obj)); Item pistol = ItemManager.Instance.SpawnNewItem(GameInfo.GetSpawnable("pistol"), prop + Vector3.up * 0.4f, Quaternion.identity); yield return (object)new WaitForSecondsRealtime(2f); Weapons.Instance.DebugReady(me); Vector3 p2 = (Object.op_Implicit((Object)(object)pistol) ? ((Component)pistol).transform.position : prop); Weapons.Instance.ServerFire(me, At(p2, 3)); Weapons.Instance.ServerFire(me, At(p2, 5)); yield return (object)new WaitForSecondsRealtime(1.2f); heldNow = loot.ClientVault.AbsorbedOf(key); int s0 = C("absorber_shot"); if (Object.op_Implicit((Object)(object)tank)) { tank.ServerChangeHp(999999); } tank = Tank(mid); yield return (object)new WaitForSecondsRealtime(1.3f); t2 = (Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0); for (int t = 0; t < 3; t++) { Weapons.Instance.ServerFire(me, At(TankAt(), 0)); Weapons.Instance.ServerFire(me, At(TankAt(), 2)); if (t == 1) { FortressPlugin.Shot("absorber_item_shot", 0.05f); } yield return (object)new WaitForSecondsRealtime(1f); } Note(string.Format("item shots: holds id {0} worth {1}, shots {2} (expect 3), tank health {3} -> {4}", (int)(heldNow?.Id ?? 0), heldNow?.Worth ?? 0, C("absorber_shot") - s0, t2, Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0)); if (!Object.op_Implicit((Object)(object)tank) || tank._hp.Value <= 0) { tank = Tank(mid); yield return (object)new WaitForSecondsRealtime(1.3f); } t2 = (Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0); int flung0 = C("hook_fling_hit"); List pistols0 = (from x in Object.FindObjectsOfType() where Object.op_Implicit((Object)(object)x) && x.ID == 66 select x).ToList(); Weapons.Instance.ServerFire(me, At(TankAt(), 6)); List path = new List(); for (int t = 0; t < 15; t++) { yield return (object)new WaitForSecondsRealtime(0.1f); Item val5 = ((IEnumerable)Object.FindObjectsOfType()).FirstOrDefault((Func)((Item x) => Object.op_Implicit((Object)(object)x) && x.ID == 66 && !pistols0.Contains(x))); if (Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)tank)) { val4 = ((Component)val5).transform.position - eye; object arg = ((Vector3)(ref val4)).magnitude; val4 = ((Component)val5).transform.position - (((Component)tank).transform.position + Vector3.up * 0.5f); path.Add(string.Format("{0:0.0}/{1:0.0}{2}", arg, ((Vector3)(ref val4)).magnitude, (!Object.op_Implicit((Object)(object)val5.Rig)) ? "?" : (val5.Rig.isKinematic ? "k" : ""))); } } AutoTest autoTest2 = this; string arg2 = string.Join(" ", path); float num2; if (!Object.op_Implicit((Object)(object)tank)) { num2 = -1f; } else { val4 = TankAt() - eye; num2 = ((Vector3)(ref val4)).magnitude; } autoTest2.Note($"spat pistol: metres from me / from the tank every 0.1 s: {arg2}; the tank {num2:0.0} m away"); Note(string.Format("spat out: holds {0} (expect nothing), hits {1}, tank health {2} -> {3}", (loot.ClientVault.AbsorbedOf(key) != null) ? "something" : "nothing", C("hook_fling_hit") - flung0, t2, Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0)); FortressPlugin.Shot("absorber_empty"); V.Best = best0; loot.SaveVault(); plugin.DebugStopRound(); WeaponFire At(Vector3 val7, byte phase) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) WeaponFire result = new WeaponFire { Phase = phase, Origin = eye }; Vector3 val6 = val7 - eye; result.Dir = ((Vector3)(ref val6)).normalized; return result; } static int C(string key2) { if (!Counters.TryGetValue(key2, out var value)) { return 0; } return value; } static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val6, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val6)).point; } return w; } Creature Tank(Vector3 at) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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) Creature val6 = plugin.ServerSpawnMinion(EnemyKind.Tank, at + Vector3.up * 1.5f); if (Object.op_Implicit((Object)(object)val6)) { Siege.Instance.Slow(val6, 1f, 60f); } return val6; } Vector3 TankAt() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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) return (Object.op_Implicit((Object)(object)tank) ? ((Component)tank).transform.position : mid) + Vector3.up * 0.5f; } } private IEnumerator LampsScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Vector3 center = island.Center; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(900f); yield return (object)new WaitForSecondsRealtime(3f); Siege.Instance.ServerAddCoins(Siege.Money(3000000)); BuildSystem B = BuildSystem.Instance; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 side = Vector3.Cross(Vector3.up, gd); int[] levels = new int[5] { 3, 4, 12, 20, 25 }; List ids = new List(); for (int num2 = 0; num2 < levels.Length; num2++) { int num3 = B.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); TurretAt(PieceType.Gun, Spot(num2) + Vector3.up * 1.2f); int num4 = B.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); for (int num5 = 1; num5 < levels[num2]; num5++) { if (num4 <= num3) { break; } B.ServerUpgrade(num4, 1); } ids.Add((num4 > num3) ? num4 : 0); } yield return (object)new WaitForSecondsRealtime(1f); foreach (int item in ids) { B.TryGetState(item, out var s); GameObject obj = B.PieceObject(item); Transform val = ((obj != null) ? obj.transform.Find("LevelLook") : null); AutoTest autoTest = this; object[] obj2 = new object[8] { item, s.Level, BuildSystem.LampsLit(s.Level), 17, Mathf.Min(17, s.Level - 3), (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.Find("LampsDim"))) ? "yes" : "no", (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.Find("LampsLit"))) ? "yes" : "no", null }; GameObject obj3 = B.PieceObject(item); obj2[7] = (Object.op_Implicit((Object)(object)((obj3 != null) ? obj3.transform.Find("RankStuds") : null)) ? "yes" : "no"); autoTest.Note(string.Format("gun {0}: Lv{1}, lamps lit {2}/{3} (expect {4}), dim {5}, lit {6}, studs {7} (expect no)", obj2)); } yield return View(center + gd * 4f, Spot(2), "lamps_row", 14f); for (int i = 1; i < levels.Length; i++) { yield return View(Spot(i) - gd * 2.6f + side * 0.5f, Spot(i), "lamps_lv" + levels[i], 32f); } Vector3 Spot(int num6) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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) return center + gd * 9f + side * (float)(num6 - 2) * 3f; } IEnumerator View(Vector3 eye, Vector3 at, string shot, float pitch) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(eye + Vector3.up * 40f, Vector3.down, ref val2, 80f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { eye.y = ((RaycastHit)(ref val2)).point.y + 1.1f; } me.LocalTeleport(eye, YawTo(eye, at), true); yield return null; Aim(YawTo(eye, at), pitch); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot(shot); yield return (object)new WaitForSecondsRealtime(0.4f); } } private IEnumerator TowersScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player localPlayer = Player.LocalPlayer; Vector3 center = island.Center; localPlayer.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(900f); yield return (object)new WaitForSecondsRealtime(3f); Siege.Instance.ServerAddCoins(Siege.Money(200000)); BuildSystem B = BuildSystem.Instance; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 side = Vector3.Cross(Vector3.up, gd); List<(int id, int level, int branch)> ids = new List<(int, int, int)>(); int[] array = new int[5] { 1, 2, 3, 5, 10 }; for (int num2 = 0; num2 < array.Length; num2++) { int num3 = Place(PieceType.Gun, center + gd * 9f + side * (float)(num2 - 2) * 3f + Vector3.up * 1.2f); for (int num4 = 1; num4 < array[num2]; num4++) { B.ServerUpgrade(num3, 1); } ids.Add((num3, array[num2], 1)); } int id = Place(PieceType.Cannon, center + gd * 12f + Vector3.up * 1.2f); for (int num5 = 1; num5 < 6; num5++) { B.ServerUpgrade(id, 2); } yield return (object)new WaitForSecondsRealtime(1f); foreach (var item2 in ids) { int item = item2.id; AutoTest autoTest = this; PieceState s; object[] obj = new object[4] { item, B.TryGetState(item, out s) ? $"Lv{s.Level} branch {s.Branch} hp {s.MaxHp}" : "missing", null, null }; GameObject obj2 = B.PieceObject(item); obj[2] = ((obj2 == null) ? ((int?)null) : ((IEnumerable)obj2.transform.Find("Head"))?.Cast().Count((Transform t) => ((Object)t).name.StartsWith("Barrel") && ((Object)t).name != "BarrelCrystal")); GameObject obj3 = B.PieceObject(item); int? obj4; if (obj3 == null) { obj4 = null; } else { Transform obj5 = obj3.transform.Find("RankStuds"); obj4 = ((obj5 != null) ? new int?(obj5.childCount) : ((int?)null)); } int? num6 = obj4; obj[3] = num6.GetValueOrDefault(); autoTest.Note(string.Format("gun {0}: {1}, barrels {2}, studs {3}", obj)); } Note("gun costs to the next level: " + string.Join(", ", from l in Enumerable.Range(1, 12) select $"Lv{l}->{l + 1} ${Catalog.UpgradeCost(PieceType.Gun, l)}")); Note("gun stats: " + string.Join("; ", new int[6] { 1, 3, 4, 5, 10, 15 }.Select(delegate(int l) { Catalog.TurretStats turretStats = Catalog.Turret(PieceType.Gun, l, 1); return $"Lv{l} dmg {turretStats.Damage} every {turretStats.Interval:0.00}s range {turretStats.Range:0.0} targets {turretStats.Targets}"; }))); Vector3 val = center + gd * 4.5f + Vector3.up * 1.6f; yield return Look(val, YawTo(val, center + gd * 9f), "towers_row"); Vector3 val2 = center + gd * 6.2f + side * 1.5f * 3f; yield return Look(val2, YawTo(val2, center + gd * 9f + side * 1.5f * 3f), "towers_lv5_lv10"); Vector3 val3 = center + gd * 12f; yield return Look(val3 - gd * 3.2f + side * 1.2f, YawTo(val3 - gd * 3.2f + side * 1.2f, val3), "towers_cannon_lv6B"); var (gun10, _, _) = ids[4]; B.TryGetState(gun10, out var before10); Vector3 val4 = before10.Pos + side * 2f * 3f; RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(val4 + Vector3.up * 5f, Vector3.down, ref val5, 12f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { val4.y = ((RaycastHit)(ref val5)).point.y; } bool moved = B.ServerMove(gun10, val4, 90f); bool refused = !B.ServerMove(ids[0].id, val4, 0f); yield return (object)new WaitForSecondsRealtime(1f); B.TryGetState(gun10, out var after10); GameObject val6 = B.PieceObject(gun10); AutoTest autoTest2 = this; object[] obj6 = new object[8] { moved, refused, before10.Level, after10.Level, before10.Hp, after10.Hp, null, null }; Vector3 val7 = after10.Pos - before10.Pos; obj6[6] = ((Vector3)(ref val7)).magnitude; object obj7; if (!Object.op_Implicit((Object)(object)val6)) { obj7 = "-"; } else { val7 = val6.transform.position - after10.Pos; obj7 = ((Vector3)(ref val7)).magnitude.ToString("0.00"); } obj6[7] = obj7; autoTest2.Note(string.Format("moved Lv10 gun: ok {0}, onto a taken spot refused {1}, Lv{2}->Lv{3}, hp {4}->{5}, now {6:0.0} m away, object at {7} m from its state", obj6)); Vector3 eye2 = after10.Pos - gd * 4f + Vector3.up * 1.2f; yield return Look(eye2, YawTo(eye2, after10.Pos), "towers_moved"); B.DebugSetBuilding(on: true, PieceType.Gun); Aim(YawTo(eye2, after10.Pos), 10f); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("towers_look"); yield return (object)new WaitForSecondsRealtime(0.6f); PieceMenu.Instance.Open(gun10); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("towers_menu"); yield return (object)new WaitForSecondsRealtime(0.6f); PieceMenu.Instance.Close(); B.StopBuilding(); B.ServerClearAll(); yield return (object)new WaitForSecondsRealtime(0.5f); int lone = Place(PieceType.Gun, center + gd * 9f + Vector3.up * 1.2f); for (int num7 = 1; num7 < 5; num7++) { B.ServerUpgrade(lone, 1); } PieceState g5 = B.ServerPieces.FirstOrDefault((PieceState x) => x.Id == lone); Creature fishA = plugin.ServerSpawnMinion(EnemyKind.Runner, g5.Pos + gd * 6f + side * 2.5f + Vector3.up * 1f); Creature fishB = plugin.ServerSpawnMinion(EnemyKind.Runner, g5.Pos + gd * 6f - side * 2.5f + Vector3.up * 1f); Creature[] array2 = (Creature[])(object)new Creature[2] { fishA, fishB }; foreach (Creature val8 in array2) { if (Object.op_Implicit((Object)(object)val8)) { Siege.Instance.Slow(val8, 1f, 300f); val8.ServerChangeHp(-100000); } } yield return (object)new WaitForSecondsRealtime(0.3f); int hpA = (Object.op_Implicit((Object)(object)fishA) ? fishA._hp.Value : (-1)); int hpB = (Object.op_Implicit((Object)(object)fishB) ? fishB._hp.Value : (-1)); yield return (object)new WaitForSecondsRealtime(1.5f); Note($"lone Lv{g5.Level} gun on two fish: A {hpA} -> {(Object.op_Implicit((Object)(object)fishA) ? fishA._hp.Value : 0)}, B {hpB} -> {(Object.op_Implicit((Object)(object)fishB) ? fishB._hp.Value : 0)} (both should drop)"); int Place(PieceType t, Vector3 at) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) int num9 = B.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); TurretAt(t, at); int num10 = B.ServerPieces.Select((PieceState x) => x.Id).DefaultIfEmpty(0).Max(); if (num10 <= num9) { return 0; } return num10; } } private IEnumerator GunsScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 center = island.Center; float stand = 1.1f; List guns = GearCatalog.WeaponKinds.Where(GearCatalog.IsGameGun).ToList(); foreach (Gear item in guns) { Item spawnable = GameInfo.GetSpawnable(WeaponItems.GameName(item)); Weapon val = (Weapon)(object)((spawnable is Weapon) ? spawnable : null); string text; try { text = val.Damage.ToString(); } catch (Exception ex) { text = "? " + ex.GetType().Name; } int num; try { num = val.Attachments.AmmoPerMag; } catch { num = -1; } AutoTest autoTest = this; string text2 = $"{item} ({WeaponItems.GameName(item)} id {WeaponItems.GameId(item)}, ours {WeaponItems.IdOf(item, Rarity.Common)}-{WeaponItems.IdOf(item, Rarity.Legendary)}): damage {text}, "; object[] obj2 = new object[5] { F(val, "_timeBetweenShots"), F(val, "_projectileCountPerShot"), num, F(val, "_fullAuto"), null }; Item obj3 = WeaponItems.Prefab(item, Rarity.Common); obj2[4] = ((obj3 != null) ? new int?(obj3.TotalWorth) : ((int?)null)); autoTest.Note(text2 + string.Format("every {0:0.###} s, {1} per shot, mag {2}, full auto {3}, worth {4}", obj2)); } loot.Vault.Starter.Remove(Loot.KeyOf(me)); Gear g2; Rarity r2; foreach (Item item2 in (from i in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)i) && WeaponItems.Is(i, out g2, out r2) select i).Distinct().ToList()) { me.Inventory.RemoveItem(item2); item2.DestroyItem((byte)0, byte.MaxValue); } Note($"before the round: carries a weapon {WeaponItems.Carries(me)}, running {plugin.Running}"); yield return (object)new WaitForSecondsRealtime(0.5f); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * stand, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); Siege.Instance.ServerAddCoins(Siege.Money(100000)); yield return (object)new WaitForSecondsRealtime(1f); List values = (from i in Object.FindObjectsOfType().Where(delegate(Item i) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)i) && ((NetworkBehaviour)i).IsSpawned && !Object.op_Implicit((Object)(object)i.Holder) && WeaponItems.Is(i, out g2, out r2)) { Vector3 val10 = (((Component)i).transform.position - (center + FortressIsland.ReadyLocal)).Flat(); return ((Vector3)(ref val10)).magnitude < 6f; } return false; }) select i.GetName()).ToList(); Note(string.Format("starter: given {0}, by the circle: {1}", C("starter_weapon"), string.Join(", ", values))); float num2 = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); MethodInfo shootM = AccessTools.Method(typeof(Weapon), "Shoot", (Type[])null, (Type[])null); Vector3 val3; Rarity[] array; foreach (Gear g in guns) { array = new Rarity[2] { Rarity.Common, Rarity.Legendary }; foreach (Rarity r in array) { plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(0.5f); Vector3 val2 = Ground(center + gd * 9f); Vector3 eye = val2 + Vector3.up * 1.6f; Vector3 at = Ground(center + gd * 16f); me.LocalTeleport(val2 + Vector3.up * 0.2f, YawTo(eye, at), true); Creature tank = plugin.ServerSpawnMinion(EnemyKind.Tank, at + Vector3.up * 1.5f); if (Object.op_Implicit((Object)(object)tank)) { Siege.Instance.Slow(tank, 1f, 60f); } Item gun = WeaponItems.ServerSpawn(g, r, eye + gd * 0.6f); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)gun)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(gun, me, (Item)null); } yield return (object)new WaitForSecondsRealtime(1.2f); Item held = me.Holding.HeldItem; int hp0 = (Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0); if (Object.op_Implicit((Object)(object)tank) && r == Rarity.Common) { Server.Instance.RpcLogic___HitCreature___215526726(tank, me, 10, ((Component)tank).transform.position, Vector3.forward); } yield return (object)new WaitForSecondsRealtime(0.3f); int hp1 = (Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0); float expect = 10f * FortressPlugin.HandDamage.Value * WeaponItems.GunDamage(g, r); float yaw = YawTo(eye, at); float num4 = eye.y - (at.y + 1f); val3 = (at - eye).Flat(); Aim(yaw, Mathf.Atan2(num4, ((Vector3)(ref val3)).magnitude) * 57.29578f); yield return (object)new WaitForSecondsRealtime(0.5f); int shots = 0; Weapon val4 = (Weapon)(object)((held is Weapon) ? held : null); if (val4 != null) { Note($" ammo {val4.Ammo}"); try { AccessTools.Property(typeof(Weapon), "Ammo").SetValue(val4, 30); } catch { } } for (int k = 0; k < 4; k++) { Weapon val5 = (Weapon)(object)((held is Weapon) ? held : null); if (val5 == null) { break; } try { shootM.Invoke(val5, null); shots++; } catch (Exception ex2) { Note(" shoot: " + ex2.InnerException?.Message); break; } yield return (object)new WaitForSecondsRealtime(Mathf.Max(0.35f, F(val5, "_timeBetweenShots") + 0.05f)); } yield return (object)new WaitForSecondsRealtime(0.8f); if (r == Rarity.Common) { FortressPlugin.Shot("gun_" + g); } int num5 = (Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0); AutoTest autoTest2 = this; object[] obj5 = new object[5] { g, r, Object.op_Implicit((Object)(object)held) ? held.GetName() : "nothing", Object.op_Implicit((Object)(object)held) ? held.ID : 0, null }; Weapon val6 = (Weapon)(object)((held is Weapon) ? held : null); obj5[4] = val6 != null && WeaponItemNoShoot.Ours(val6); autoTest2.Note(string.Format("{0} {1}: holding '{2}' (id {3}), ours-blocked {4}; ", obj5) + ((r == Rarity.Common) ? $"a 10 hit took {hp0 - hp1} (expect {expect:0.#}); " : "") + $"{shots} shots of its own took {hp1 - num5} (tank {num5}/{(Object.op_Implicit((Object)(object)tank) ? tank.MaxHp : 0)})"); if (Object.op_Implicit((Object)(object)held)) { me.Inventory.RemoveItem(held); held.DestroyItem((byte)0, byte.MaxValue); } if (Object.op_Implicit((Object)(object)tank)) { tank.ServerChangeHp(99999); } } } array = new Rarity[2] { Rarity.Common, Rarity.Legendary }; for (int num3 = 0; num3 < array.Length; num3++) { Rarity r = array[num3]; plugin.DebugKillAll(); FortressNet.Instance.ServerReset(); yield return (object)new WaitForSecondsRealtime(0.8f); Vector3 val7 = Ground(center + gd * 6f); Vector3 at = val7 + Vector3.up * 1.6f; Vector3 eye = Ground(center + gd * 20f); Vector3 val8 = Vector3.Cross(Vector3.up, gd); me.LocalTeleport(val7 + Vector3.up * 0.2f, YawTo(at, eye), true); List fish = new List(); for (int num6 = 0; num6 < 4; num6++) { fish.Add(plugin.ServerSpawnMinion(EnemyKind.Runner, eye + val8 * ((float)num6 - 1.5f) * 1.4f + Vector3.up * 1.5f)); } foreach (Creature item3 in fish) { if (Object.op_Implicit((Object)(object)item3)) { Siege.Instance.Slow(item3, 1f, 60f); } } Item held = WeaponItems.ServerSpawn(Gear.Rocket, r, at + gd * 0.6f); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)held)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(held, me, (Item)null); } yield return (object)new WaitForSecondsRealtime(1.5f); int shots = fish.Sum((Creature c) => Object.op_Implicit((Object)(object)c) ? Mathf.Max(0, c._hp.Value) : 0); int hp1 = C("rocket_blast"); Weapons instance = Weapons.Instance; WeaponFire f = new WeaponFire { Phase = 0, Origin = at }; val3 = eye + Vector3.up * 0.5f - at; f.Dir = ((Vector3)(ref val3)).normalized; instance.ServerFire(me, f); FortressPlugin.Shot("rocket_" + r.ToString() + "_fly", 0.2f); FortressPlugin.Shot("rocket_" + r, 0.48f); yield return (object)new WaitForSecondsRealtime(1.5f); int num7 = fish.Sum((Creature c) => Object.op_Implicit((Object)(object)c) ? Mathf.Max(0, c._hp.Value) : 0); Note(string.Format("rocket {0}: holding '{1}', fired {2}, blasts {3}, fish health {4} -> {5}, dead {6}/4", r, Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing", C("weapon_Rocket"), C("rocket_blast") - hp1, shots, num7, fish.Count((Creature c) => !Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0))); if (Object.op_Implicit((Object)(object)me.Holding.HeldItem)) { Item heldItem = me.Holding.HeldItem; me.Inventory.RemoveItem(heldItem); heldItem.DestroyItem((byte)0, byte.MaxValue); } } FortressPlugin.Shot("rocket_view"); while (loot.Vault.StorageSlots - loot.Vault.SlotsUsed < 8) { loot.Vault.Bought[Expansion.Storage] = loot.Vault.BoughtOf(Expansion.Storage) + 1; } Vector3 position = ((Component)Object.FindObjectOfType()).transform.position; int pistols0 = loot.Vault.Count(Gear.Pistol, Rarity.Common); int items0 = loot.Vault.Items.Count; ItemManager.Instance.SpawnNewItem(GameInfo.GetSpawnable("pistol"), position + Vector3.up * 3f, Quaternion.identity); yield return (object)new WaitForSecondsRealtime(2.5f); Note($"vault door: common pistols {pistols0} -> {loot.Vault.Count(Gear.Pistol, Rarity.Common)} (expect +1), game items {items0} -> {loot.Vault.Items.Count} (expect the same)"); Vector3 anvil = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.2f, 1.6f, 0.45f); int shotguns0 = loot.Vault.Count(Gear.Shotgun, Rarity.Common); ItemManager.Instance.SpawnNewItem(GameInfo.GetSpawnable("shotgun"), anvil + Vector3.up * 0.3f, Quaternion.identity); yield return (object)new WaitForSecondsRealtime(2.5f); Note($"anvil: common shotguns {shotguns0} -> {loot.Vault.Count(Gear.Shotgun, Rarity.Common)} (expect +1)"); loot.Vault.Add(Gear.Pistol, Rarity.Common, 3); int rare0 = loot.Vault.Count(Gear.Pistol, Rarity.Rare); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Merge, Gear = Gear.Pistol, Rarity = Rarity.Common }); yield return (object)new WaitForSecondsRealtime(1f); Note($"forge: rare pistols {rare0} -> {loot.Vault.Count(Gear.Pistol, Rarity.Rare)} (expect +1)"); Vector3 val9 = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(0.6f, stand + 0.2f, 2.6f); me.LocalTeleport(val9, YawTo(val9, anvil), true); yield return (object)new WaitForSecondsRealtime(1f); int coins0 = Siege.Instance.ServerCoins; loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Buy, Gear = Gear.Sniper, Rarity = Rarity.Common }); yield return (object)new WaitForSecondsRealtime(2f); Note(string.Format("shop: money {0} -> {1}, in my hands '{2}'", coins0, Siege.Instance.ServerCoins, Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing")); FortressPlugin.Shot("gun_hud"); yield return (object)new WaitForSecondsRealtime(0.6f); VaultUI.Instance.Open(VaultUI.Desk.Smith); VaultUI.Instance.DebugTab(2); VaultUI.Instance.DebugSelect(Gear.Rocket, Rarity.Common); yield return (object)new WaitForSecondsRealtime(3f); FortressPlugin.Shot("gun_shop"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.DebugTab(0); VaultUI.Instance.DebugSelect(Gear.Pistol, Rarity.Rare); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("gun_bench"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Close(); yield return (object)new WaitForSecondsRealtime(0.5f); Tips.Instance.DebugWeaponsPage(); yield return (object)new WaitForSecondsRealtime(2f); if (Tips.Instance.HelpOpen) { Tips.Instance.ToggleHelp(); } yield return (object)new WaitForSecondsRealtime(0.3f); Tips.Instance.DebugWeaponsPage(); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("gun_help"); yield return (object)new WaitForSecondsRealtime(1.5f); if (Tips.Instance.HelpOpen) { Tips.Instance.ToggleHelp(); } static int C(string key) { if (!Counters.TryGetValue(key, out var value)) { return 0; } return value; } static T F(object o, string name) { try { return (T)AccessTools.Field(o.GetType(), name).GetValue(o); } catch { return default(T); } } static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val10 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val10, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val10)).point; } return w; } } private IEnumerator BossGuardScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; SkipBossCamera = true; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 center = island.Center; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); Creature c = plugin.ServerSpawnBoss(EnemyKind.Warden, 1f, 0, 10, 8f); BossBrain brain = Bosses.Of(c); yield return (object)new WaitForSecondsRealtime(1f); int hp0 = (Object.op_Implicit((Object)(object)c) ? c._hp.Value : (-1)); int blocked0 = C("boss_hit_in_entrance"); bool entering = Bosses.Entering(c); c.ServerChangeHp(100); Server.Instance.RpcLogic___HitCreature___215526726(c, me, 50, ((Component)c).transform.position, Vector3.forward); yield return (object)new WaitForSecondsRealtime(0.5f); Note(string.Format("in its entrance (live {0}, entering {1}): health {2} -> {3} (expect the same), hits turned away {4}", brain?.IsLive, entering, hp0, Object.op_Implicit((Object)(object)c) ? c._hp.Value : (-1), C("boss_hit_in_entrance") - blocked0)); yield return Until(() => brain != null && brain.IsLive, 20f, "the entrance to end"); int hp1 = (Object.op_Implicit((Object)(object)c) ? c._hp.Value : (-1)); c.ServerChangeHp(100); yield return (object)new WaitForSecondsRealtime(0.3f); Note($"live (entering {Bosses.Entering(c)}): health {hp1} -> {(Object.op_Implicit((Object)(object)c) ? c._hp.Value : (-1))} (expect -100)"); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(3f); Creature c2 = plugin.ServerSpawnBoss(EnemyKind.Warden, 1f, 1, 10, 8f); yield return (object)new WaitForSecondsRealtime(1f); bool still = Bosses.Entering(c2); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(0.5f); Note($"test key clear in an entrance (entering {still}): health left {(Object.op_Implicit((Object)(object)c2) ? c2._hp.Value : (-1))} (expect 0)"); yield return (object)new WaitForSecondsRealtime(3f); plugin.DebugStopRound(); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } } private IEnumerator PricesScenario() { yield return (object)new WaitForSecondsRealtime(1f); foreach (Item item in from i in ((Dictionary)AccessTools.Field(typeof(GameInfo), "_allItems").GetValue(null)).Values where Object.op_Implicit((Object)(object)i) orderby i.Cost, i.DefaultWorth select i) { Note(string.Format("item {0,3} {1} '{2}': cost {3} {4}, worth {5}, total {6}{7}", item.ID, ((Object)item).name, Name(item), item.Currency, item.Cost, item.DefaultWorth, item.TotalWorth, Object.op_Implicit((Object)(object)item.Creature) ? " (creature)" : "")); } foreach (Purchasable item2 in Resources.FindObjectsOfTypeAll().Where(delegate(Purchasable p) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)p)) { Scene scene = ((Component)p).gameObject.scene; return ((Scene)(ref scene)).IsValid(); } return false; })) { AutoTest autoTest = this; object[] obj = new object[6] { ((object)item2).GetType().Name, ((Object)item2).name, ((Component)item2).transform.position, F(item2, "_customCost"), F(item2, "_isFree"), null }; Item val = F(item2, "_itemToPurchase"); obj[5] = ((val != null && Object.op_Implicit((Object)(object)val)) ? (((Object)val).name + " $" + val.Cost) : "-"); autoTest.Note(string.Format("shop {0} '{1}' at {2:F0}: custom cost {3}, free {4}, item {5}", obj)); } Player localPlayer = Player.LocalPlayer; if (Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Inventory)) { Note("extra hotbar slots: " + string.Join(", ", F(localPlayer.Inventory, "_extraSlotCosts") ?? new int[0])); } foreach (Gear item3 in GearCatalog.WeaponKinds.Where(GearCatalog.IsGameGun)) { Attachments val2 = WeaponMods.PrefabAttachments(item3); BulletUpgrade[] array = (Object.op_Implicit((Object)(object)val2) ? (AccessTools.Field(typeof(Attachments), "_bulletUpgrades").GetValue(val2) as BulletUpgrade[]) : null); Note($"{item3} bullet upgrades: " + ((array == null) ? "-" : string.Join(", ", array.Select((BulletUpgrade t) => string.Format("{0} dmg for {1} {2}", t.Damage, F(t, "_currency"), F(t, "_cost")))))); } Note($"money now ${MoneyManager.Money}, euro {MoneyManager.Euro}"); static T F(object o, string n) { try { return (T)AccessTools.Field(o.GetType(), n).GetValue(o); } catch { return default(T); } } static string Name(Item i) { try { return i.GetName(); } catch { return ((Object)i).name; } } } private IEnumerator Batch8Scenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 center = island.Center; float num = 1.1f; int best0 = loot.Vault.Best; loot.Vault.Best = 0; loot.SaveVault(); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * num, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); Siege.Instance.ServerAddCoins(Siege.Money(1000000)); if (!(_arg == "hook")) { plugin.SkipBuildTime(); yield return Until(() => plugin.Wave == 1 && !plugin.InBuildTime, 15f, "wave 1"); yield return (object)new WaitForSecondsRealtime(8f); for (int i = 0; i < 20; i++) { if (plugin.InBuildTime) { break; } plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); } yield return (object)new WaitForSecondsRealtime(1f); Note($"record mid-round: cleared {plugin.Cleared}, the save's best {loot.Vault.Best} (expect {plugin.Cleared}), the client's {loot.ClientVault.Best}"); plugin.SkipBuildTime(); yield return Until(() => plugin.Wave == 2 && !plugin.InBuildTime, 15f, "wave 2"); yield return Until(() => plugin.CanCallNext, 20f, "wave 2 landed"); int alive2 = FortressPlugin.Alive.Count((Creature c) => Object.op_Implicit((Object)(object)c) && c._hp.Value > 0); int coins0 = Siege.Instance.ServerCoins; plugin.DebugCallNext(); yield return (object)new WaitForSecondsRealtime(9f); Note(string.Format("called early: wave {0} (expect 3), fish {1} -> {2}, calls {3}; can call a boss wave: {4}", plugin.Wave, alive2, FortressPlugin.Alive.Count((Creature c) => Object.op_Implicit((Object)(object)c) && c._hp.Value > 0), C("wave_called_early"), (plugin.Wave + 1) % 10 == 0 && plugin.CanCallNext)); for (int i = 0; i < 25; i++) { if (plugin.InBuildTime) { break; } plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); } yield return (object)new WaitForSecondsRealtime(1f); int num2 = Siege.Instance.ServerCoins - coins0; Note($"both cleared: cleared {plugin.Cleared}, money +{num2} (both bonuses {FortressPlugin.WaveBonus(2) + FortressPlugin.WaveBonus(3)} and the kills)"); } plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); float num3 = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num3), 0f, Mathf.Sin(num3)); Vector3 feet = Ground(center + gd * 6f); Vector3 eye = feet + Vector3.up * 1.6f; Vector3 prop = Ground(center + gd * 11f); Vector3 at = Ground(center + gd * 18f); me.LocalTeleport(feet + Vector3.up * 0.2f, YawTo(eye, prop), true); foreach (Item item in (from val6 in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)val6) select val6).Distinct().ToList()) { me.Inventory.RemoveItem(item); item.DestroyItem((byte)0, byte.MaxValue); } Item hook = WeaponItems.ServerSpawn(Gear.Hook, Rarity.Common, eye + gd * 0.6f); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)hook)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(hook, me, (Item)null); } Item thingItem = BossTrophies.ServerSpawn(EnemyKind.Warden, prop + Vector3.up * 0.6f); yield return (object)new WaitForSecondsRealtime(2f); Creature tank = plugin.ServerSpawnMinion(EnemyKind.Tank, at + Vector3.up * 1.5f); if (Object.op_Implicit((Object)(object)tank)) { Siege.Instance.Slow(tank, 1f, 60f); } yield return (object)new WaitForSecondsRealtime(1f); Vector3 val; Vector3 val2; if (!Object.op_Implicit((Object)(object)thingItem)) { val = gd; } else { val2 = ((Component)thingItem).transform.position + Vector3.up * 0.2f - eye; val = ((Vector3)(ref val2)).normalized; } Vector3 val3 = val; Note("hook sweep toward the trophy: " + Weapons.Instance.DebugHookScan(eye, val3, me)); Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 0, Origin = eye, Dir = val3 }); yield return (object)new WaitForSecondsRealtime(1f); AutoTest autoTest = this; object[] obj = new object[5] { Object.op_Implicit((Object)(object)thingItem) ? thingItem.GetName() : "nothing", Object.op_Implicit((Object)(object)thingItem) ? thingItem.TotalWorth : 0, Weapons.OnLine(thingItem), null, null }; float num4; if (!Object.op_Implicit((Object)(object)thingItem)) { num4 = -1f; } else { val2 = ((Component)thingItem).transform.position - eye; num4 = ((Vector3)(ref val2)).magnitude; } obj[3] = num4; obj[4] = C("hooked_item"); autoTest.Note(string.Format("hooked: '{0}' worth {1}, on the line {2}, {3:0.0} m from my eyes, hooked {4}", obj)); FortressPlugin.Shot("hook_holding"); yield return (object)new WaitForSecondsRealtime(2.5f); int hp0 = (Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0); Vector3 val4; if (!Object.op_Implicit((Object)(object)tank)) { val4 = gd; } else { val2 = ((Component)tank).transform.position + Vector3.up * 0.5f - eye; val4 = ((Vector3)(ref val2)).normalized; } Vector3 dir = val4; Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 0, Origin = eye, Dir = dir }); FortressPlugin.Shot("hook_fling", 0.25f); yield return (object)new WaitForSecondsRealtime(2f); AutoTest autoTest2 = this; object[] obj2 = new object[6] { C("hook_fling_hit"), hp0, Object.op_Implicit((Object)(object)tank) ? tank._hp.Value : 0, GearCatalog.Value(Gear.Hook, Rarity.Common), Weapons.FlingMult(Object.op_Implicit((Object)(object)thingItem) ? thingItem.TotalWorth : 0), null }; float num5; if (!Object.op_Implicit((Object)(object)thingItem)) { num5 = -1f; } else { val2 = ((Component)thingItem).transform.position - at; num5 = ((Vector3)(ref val2)).magnitude; } obj2[5] = num5; autoTest2.Note(string.Format("flung: hits {0}, tank health {1} -> {2} (the hook alone does {3:0}, x{4:0.0} for its worth), the trophy now {5:0.0} m from the tank", obj2)); if (Object.op_Implicit((Object)(object)tank)) { tank.ServerChangeHp(999999); } if (_arg == "hook") { plugin.DebugStopRound(); yield break; } Rarity[] rarities = GearCatalog.Rarities; for (int i = 0; i < rarities.Length; i++) { Rarity r = rarities[i]; plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(0.5f); foreach (Item item2 in (from val6 in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)val6) select val6).Distinct().ToList()) { me.Inventory.RemoveItem(item2); item2.DestroyItem((byte)0, byte.MaxValue); } Item laser = WeaponItems.ServerSpawn(Gear.Laser, r, eye + gd * 0.6f); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)laser)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(laser, me, (Item)null); } Creature t2 = plugin.ServerSpawnMinion(EnemyKind.Tank, at + Vector3.up * 1.5f); if (Object.op_Implicit((Object)(object)t2)) { Siege.Instance.Slow(t2, 1f, 60f); } me.LocalTeleport(feet + Vector3.up * 0.2f, YawTo(eye, at) + 25f, true); yield return (object)new WaitForSecondsRealtime(1.2f); Vector3 val5; if (!Object.op_Implicit((Object)(object)t2)) { val5 = gd; } else { val2 = ((Component)t2).transform.position + Vector3.up * 0.5f - eye; val5 = ((Vector3)(ref val2)).normalized; } Vector3 dir2 = val5; Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 0, Origin = eye, Dir = dir2 }); for (float t3 = 0f; t3 < 2.4f; t3 += 0.1f) { Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 1, Origin = eye, Dir = dir2 }); if (t3 < 0.15f) { FortressPlugin.Shot("laser_" + r.ToString() + "_first"); } yield return (object)new WaitForSecondsRealtime(0.1f); } FortressPlugin.Shot("laser_" + r.ToString() + "_held"); yield return (object)new WaitForSecondsRealtime(0.2f); Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 2, Origin = eye, Dir = dir2 }); if (Object.op_Implicit((Object)(object)t2)) { t2.ServerChangeHp(999999); } } loot.Vault.Helpers = 7; loot.Vault.HelperSpeed = 12; loot.Vault.HelperLoad = 40; loot.SaveVault(); yield return (object)new WaitForSecondsRealtime(2f); StallMenu.Instance.Open(); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("stall_helpers"); yield return (object)new WaitForSecondsRealtime(0.5f); StallMenu.Instance.Close(); Note($"helpers out: {Helpers.Instance.DebugCount} (expect 7)"); plugin.DebugStopRound(); yield return (object)new WaitForSecondsRealtime(2f); Note(string.Format("after the round: best {0} (was {1} before the test), errors {2}", loot.Vault.Best, best0, C("errors"))); loot.Vault.Best = Mathf.Max(best0, loot.Vault.Best); loot.SaveVault(); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } static Vector3 Ground(Vector3 w) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(w + Vector3.up * 10f, Vector3.down, ref val6, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val6)).point; } return w; } } private IEnumerator ModsScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; ulong key = Loot.KeyOf(me); VaultData V = loot.Vault; Vector3 center = island.Center; float stand = 1.1f; foreach (var item in V.Mods.Keys.Where(((ulong, Gear, int) k) => k.Item1 == key).ToList()) { V.Mods.Remove(item); } V.Scales = 5000; loot.SaveVault(); foreach (Gear item2 in GearCatalog.WeaponKinds.Where(GearCatalog.IsGameGun)) { Attachments att = WeaponMods.PrefabAttachments(item2); Item obj = WeaponItems.Prefab(item2, Rarity.Common); Weapon val = (Weapon)(object)((obj is Weapon) ? obj : null); string text = (Object.op_Implicit((Object)(object)att) ? string.Join(" / ", from l in Enumerable.Range(0, 6) select WeaponMods.BulletDamage(att, 0, l)) : "no attachments"); Note($"{item2}: bullets Lv0-5 {text}; mag {(Object.op_Implicit((Object)(object)att) ? WeaponMods.DefaultMag(att) : (-1))}, every {(Object.op_Implicit((Object)(object)val) ? WeaponMods.Interval.Invoke(val) : (-1f)):0.###} s, waits for its shot's animation {Object.op_Implicit((Object)(object)val) && WeaponMods.AnimGated.Invoke(val)}" + ((item2 == Gear.Bow && Object.op_Implicit((Object)(object)att)) ? $", draw speed {att.ChargeSpeed:0.##}" : "")); } me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * stand, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 side = Vector3.Cross(Vector3.up, gd); int[] array = new int[2] { 0, 5 }; foreach (int lvl in array) { Clear(Gear.Rocket); if (lvl > 0) { yield return Buy(Gear.Rocket, 0, lvl); yield return Buy(Gear.Rocket, 1, lvl); yield return Buy(Gear.Rocket, 2, lvl); } plugin.DebugKillAll(); FortressNet.Instance.ServerReset(); yield return (object)new WaitForSecondsRealtime(0.8f); Vector3 val2 = Ground(center + gd * 6f); Vector3 eye = val2 + Vector3.up * 1.6f; Vector3 mid = Ground(center + gd * 20f); me.LocalTeleport(val2 + Vector3.up * 0.2f, YawTo(eye, mid), true); Creature near = plugin.ServerSpawnMinion(EnemyKind.Tank, mid + Vector3.up * 1.5f); Creature far = plugin.ServerSpawnMinion(EnemyKind.Tank, Ground(mid + side * 4.2f) + Vector3.up * 1.5f); Creature[] array2 = (Creature[])(object)new Creature[2] { near, far }; foreach (Creature val3 in array2) { if (Object.op_Implicit((Object)(object)val3)) { Siege.Instance.Slow(val3, 1f, 60f); } } InHand(Gear.Rocket, eye + gd * 0.6f); yield return (object)new WaitForSecondsRealtime(1.5f); int n0 = (Object.op_Implicit((Object)(object)near) ? near._hp.Value : 0); int f0 = (Object.op_Implicit((Object)(object)far) ? far._hp.Value : 0); int fired0 = C("weapon_Rocket"); float num4; Vector3 val4; if (!Object.op_Implicit((Object)(object)near) || !Object.op_Implicit((Object)(object)far)) { num4 = -1f; } else { val4 = ((Component)far).transform.position - ((Component)near).transform.position; num4 = ((Vector3)(ref val4)).magnitude; } float apart = num4; val4 = (Object.op_Implicit((Object)(object)near) ? ((Component)near).transform.position : mid) + Vector3.up * 0.5f - eye; Vector3 aim = ((Vector3)(ref val4)).normalized; Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 0, Origin = eye, Dir = aim }); yield return (object)new WaitForSecondsRealtime(1.1f); Weapons.Instance.ServerFire(me, new WeaponFire { Phase = 0, Origin = eye, Dir = aim }); yield return (object)new WaitForSecondsRealtime(1.2f); int num5 = (Object.op_Implicit((Object)(object)near) ? near._hp.Value : 0); int num6 = (Object.op_Implicit((Object)(object)far) ? far._hp.Value : 0); float num7 = 3f + WeaponMods.TraitAdd(Gear.Rocket, lvl); Note(string.Format("rocket mods Lv{0}: shots that went off {1}/2 (expect {2}), the fish it hit lost {3}, the one {4:0.0} m off lost {5} (blast {6:0.#} m: expect {7})", lvl, C("weapon_Rocket") - fired0, (lvl <= 0) ? 1 : 2, n0 - num5, apart, f0 - num6, num7, (apart <= num7) ? "some" : "none")); if (lvl > 0) { FortressPlugin.Shot("mods_rocket"); } array2 = (Creature[])(object)new Creature[2] { near, far }; foreach (Creature val5 in array2) { if (Object.op_Implicit((Object)(object)val5)) { val5.ServerChangeHp(99999); } } } array = new int[2] { 0, 5 }; float speed; foreach (int lvl in array) { Clear(Gear.Smg); if (lvl > 0) { for (int n0 = 0; n0 < 4; n0++) { yield return Buy(Gear.Smg, n0, lvl); } } Vector3 val6 = Ground(center + gd * 6f); Vector3 val7 = val6 + Vector3.up * 1.6f; me.LocalTeleport(val6 + Vector3.up * 0.2f, YawTo(val7, val7 + gd), true); InHand(Gear.Smg, val7 + gd * 0.6f); yield return Until(() => me.Holding.HeldItem is Weapon, 5f, "the SMG in hand"); List ammoSeen = new List(); for (int n0 = 0; n0 < 6; n0++) { Item heldItem = me.Holding.HeldItem; Weapon val8 = (Weapon)(object)((heldItem is Weapon) ? heldItem : null); if (val8 != null) { ammoSeen.Add(string.Format("{0}{1}", val8.Ammo, Object.op_Implicit((Object)(object)((Item)val8).Holder) ? "" : "(no holder)")); } yield return (object)new WaitForSecondsRealtime(0.2f); } Note(string.Format(" SMG Lv{0} ammo in the first second: {1}", lvl, string.Join(" ", ammoSeen))); Item heldItem2 = me.Holding.HeldItem; Weapon w = (Weapon)(object)((heldItem2 is Weapon) ? heldItem2 : null); if (w == null) { Note("no SMG in hand"); continue; } int fired0 = (int)AccessTools.Method(typeof(Weapon), "GetShotDamage", (Type[])null, (Type[])null).Invoke(w, null); int f0 = w.Ammo; AccessTools.Property(typeof(Weapon), "Ammo").SetValue(w, 5); AccessTools.Method(typeof(Weapon), "Shoot", (Type[])null, (Type[])null).Invoke(w, null); float apart = WeaponMods.Interval.Invoke(w); yield return (object)new WaitForSecondsRealtime(0.6f); float t0 = Time.time; AccessTools.Method(typeof(Weapon), "LocalReload", (Type[])null, (Type[])null).Invoke(w, null); Animation val9 = WeaponMods.Anim.Invoke((Tool)(object)w); string text2 = WeaponMods.ReloadAnim.Invoke(w); speed = ((Object.op_Implicit((Object)(object)val9) && !string.IsNullOrEmpty(text2) && TrackedReference.op_Implicit((TrackedReference)(object)val9[text2])) ? val9[text2].speed : (-1f)); yield return Until(() => !F(w, "_isReloading"), 8f, "the reload"); Note($"SMG mods Lv{lvl}: a shot {fired0} (HUD {WeaponMods.ShotDamage(w)}), every {apart:0.###} s, a load {w.Attachments.AmmoPerMag} (fresh in hand {f0}, after reloading {w.Ammo}), reload {Time.time - t0:0.00} s at {speed:0.00}x"); if (lvl > 0) { FortressPlugin.Shot("mods_smg_hud"); } } Clear(Gear.Bow); Vector3 val10 = Ground(center + gd * 6f) + Vector3.up * 1.6f; InHand(Gear.Bow, val10 + gd * 0.6f); yield return Until(() => me.Holding.HeldItem is Weapon, 5f, "the bow in hand"); yield return (object)new WaitForSecondsRealtime(1f); Item heldItem3 = me.Holding.HeldItem; Weapon val11 = (Weapon)(object)((heldItem3 is Weapon) ? heldItem3 : null); speed = ((val11 != null) ? val11.Attachments.ChargeSpeed : (-1f)); yield return Buy(Gear.Bow, 1, 5); Item heldItem4 = me.Holding.HeldItem; Weapon val12 = (Weapon)(object)((heldItem4 is Weapon) ? heldItem4 : null); float num8 = ((val12 != null) ? val12.Attachments.ChargeSpeed : (-1f)); bool flag = !V.Apply(VaultAction.Mod, Gear.Bow, Rarity.Common, 2, key); Note($"bow: draw speed {speed:0.##} -> {num8:0.##} at Lv5 (expect x{1f / WeaponMods.TimeMult(5):0.##}); a magazine mod refused {flag}"); Clear(Gear.Rocket); Vector3 to = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.2f, 1.6f, 0.45f); Vector3 val13 = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(0.6f, stand + 0.2f, 2.6f); me.LocalTeleport(val13, YawTo(val13, to), true); yield return (object)new WaitForSecondsRealtime(1f); VaultUI.Instance.Open(VaultUI.Desk.Smith); VaultUI.Instance.DebugTab(3); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("mods_tab_empty"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.DebugSelect(Gear.Rocket, Rarity.Common); yield return (object)new WaitForSecondsRealtime(1f); int scales0 = loot.ClientVault.Scales; Button[] array3 = VaultUI.Instance.DebugButtons(); Note(string.Format("mods tab: {0} buttons: {1}", array3.Length, string.Join(" | ", array3.Select(delegate(Button b) { TextMeshProUGUI componentInChildren = ((Component)b).GetComponentInChildren(); return (componentInChildren == null) ? null : ((TMP_Text)componentInChildren).text; })))); if (array3.Length != 0) { ((UnityEvent)array3[0].onClick).Invoke(); } yield return Until(() => loot.ClientVault.ModOf(key, Gear.Rocket, 0) == 1, 5f, "power Lv1 from the button"); Button[] array4 = VaultUI.Instance.DebugButtons(); if (array4.Length > 3) { ((UnityEvent)array4[3].onClick).Invoke(); yield return (object)new WaitForSecondsRealtime(0.6f); ((UnityEvent)VaultUI.Instance.DebugButtons()[3].onClick).Invoke(); } yield return (object)new WaitForSecondsRealtime(1.5f); Note($"mods tab: rocket now {loot.ClientVault.ModOf(key, Gear.Rocket, 0)}/{loot.ClientVault.ModOf(key, Gear.Rocket, 1)}/{loot.ClientVault.ModOf(key, Gear.Rocket, 2)}/{loot.ClientVault.ModOf(key, Gear.Rocket, 3)} (expect 1/0/2/0), scales {scales0} -> {loot.ClientVault.Scales} (expect -{WeaponMods.Cost(0) * 2 + WeaponMods.Cost(1)})"); FortressPlugin.Shot("mods_tab_rocket"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.DebugSelect(Gear.Smg, Rarity.Common); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("mods_tab_smg"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.DebugSelect(Gear.Bow, Rarity.Common); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("mods_tab_bow"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.DebugTab(0); V.Add(Gear.Laser, Rarity.Legendary); loot.SaveVault(); yield return Until(() => loot.ClientVault.Count(Gear.Laser, Rarity.Legendary) > 0, 5f, "a legendary laser in the vault"); VaultUI.Instance.DebugSelect(Gear.Laser, Rarity.Legendary); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("mods_bench_legend"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Close(); foreach (Item item3 in (from i in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)i) select i).Distinct().ToList()) { me.Inventory.RemoveItem(item3); item3.DestroyItem((byte)0, byte.MaxValue); } V.Add(Gear.Rocket, Rarity.Legendary); V.Add(Gear.Smg, Rarity.Epic); V.Add(Gear.Bow, Rarity.Rare); loot.SaveVault(); Vector3 val14 = island.VaultPos + Quaternion.Euler(0f, 90f, 0f) * new Vector3(-0.3f, 0.5f, 0.8f); me.LocalTeleport(val14, YawTo(val14, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(1.5f); VaultUI.Instance.Open(); yield return (object)new WaitForSecondsRealtime(1f); List usable = VaultUI.Instance.DebugHotbarSlots; (Gear, Rarity)[] put = new(Gear, Rarity)[3] { (Gear.Rocket, Rarity.Legendary), (Gear.Smg, Rarity.Epic), (Gear.Bow, Rarity.Rare) }; for (int num2 = 0; num2 < put.Length && num2 < usable.Count; num2++) { VaultUI.Instance.DebugHotbarTake(put[num2].Item1, put[num2].Item2, usable[num2]); yield return (object)new WaitForSecondsRealtime(2.5f); } VaultUI.Instance.Close(); yield return (object)new WaitForSecondsRealtime(1f); List list = (from i in Object.FindObjectsOfType() where ((Object)i).name == "FortressBadge" && ((Component)i).gameObject.activeInHierarchy select i).ToList(); Item val15 = default(Item); Note(string.Format("hotbar: {0}; badges showing {1}: ", string.Join(", ", usable.Select((int i) => (!me.Inventory._items.TryGetValue((byte)i, ref val15) || !Object.op_Implicit((Object)(object)val15)) ? "-" : val15.GetName())), list.Count) + string.Join(", ", list.Select(delegate(Image b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) string text3 = ColorUtility.ToHtmlStringRGB(((Graphic)b).color); TextMeshProUGUI componentInChildren = ((Component)b).GetComponentInChildren(); return text3 + " '" + ((componentInChildren != null) ? ((TMP_Text)componentInChildren).text : null) + "'"; }))); FortressPlugin.Shot("mods_hotbar"); yield return (object)new WaitForSecondsRealtime(0.5f); Note(string.Format("modded {0} times; errors {1}", C("modded"), C("errors"))); IEnumerator Buy(Gear g, int track, int num9) { for (int i = V.ModOf(key, g, track); i < num9; i++) { loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Mod, Gear = g, Slot = (byte)track, Count = (byte)i }); } yield return Until(() => loot.ClientVault.ModOf(key, g, track) == num9, 5f, $"{g} line {track} at {num9}"); } static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } void Clear(Gear g) { for (int i = 0; i < 4; i++) { V.Mods.Remove((key, g, i)); } loot.SaveVault(); } static T F(object o, string name) { try { return (T)AccessTools.Field(o.GetType(), name).GetValue(o); } catch { return default(T); } } static Vector3 Ground(Vector3 val15) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) RaycastHit val16 = default(RaycastHit); if (Physics.Raycast(val15 + Vector3.up * 10f, Vector3.down, ref val16, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return ((RaycastHit)(ref val16)).point; } return val15; } Item InHand(Gear g, Vector3 at) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) foreach (Item item4 in (from i in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)i) select i).Distinct().ToList()) { me.Inventory.RemoveItem(item4); item4.DestroyItem((byte)0, byte.MaxValue); } val15 = WeaponItems.ServerSpawn(g, Rarity.Common, at); if (Object.op_Implicit((Object)(object)val15)) { Server.Instance.RpcLogic___SetItemHolder___3876263354(val15, me, (Item)null); } return val15; } } private IEnumerator HelpersScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 center = island.Center; float stand = 1.1f; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * stand, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); Siege.Instance.ServerAddCoins(Siege.Money(100000)); VaultData vault = loot.Vault; int helperSpeed = 0; vault.HelperLoad = 0; vault.Helpers = (vault.HelperSpeed = helperSpeed); vault.Oven = false; int serverCoins = Siege.Instance.ServerCoins; bool[] values = new bool[6] { Helpers.Instance.ServerBuy(0), Helpers.Instance.ServerBuy(0), Helpers.Instance.ServerBuy(1), Helpers.Instance.ServerBuy(2), Helpers.Instance.ServerBuy(3), Helpers.Instance.ServerBuy(3) }; Note(string.Format("bought {0} (expect True x5, then False: one oven): helpers {1}, speed Lv{2}, basket Lv{3}, oven {4}; money {5} -> {6}", string.Join(" ", values), vault.Helpers, vault.HelperSpeed, vault.HelperLoad, vault.Oven, serverCoins, Siege.Instance.ServerCoins)); VaultData vaultData = VaultData.Read(vault.Write()); Note($"saved and read back: helpers {vaultData.Helpers}, speed {vaultData.HelperSpeed}, basket {vaultData.HelperLoad}, oven {vaultData.Oven}"); Vector3 stall = island.MarketPos; Vector3 val = (center - stall).Flat(); Vector3 val2 = stall + ((Vector3)(ref val)).normalized * 3f; me.LocalTeleport(new Vector3(val2.x, BossFx.Ground(val2) + stand, val2.z), YawTo(val2, stall), true); yield return (object)new WaitForSecondsRealtime(1.5f); StallMenu.Instance.Open(); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("helpers_stall"); yield return (object)new WaitForSecondsRealtime(0.6f); StallMenu.Instance.Close(); Note("helpers: " + Helpers.Instance.DebugState()); Vector3 field = Vector3.Lerp(stall, center, 0.5f); for (int num = 0; num < 8; num++) { plugin.ServerSpawnMinion(EnemyKind.Runner, field + Quaternion.Euler(0f, 45f * (float)num, 0f) * Vector3.forward * 5f + Vector3.up * 1.5f); } yield return (object)new WaitForSecondsRealtime(1.5f); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); int corpses = FortressNet.Instance.ServerCorpses().Count(); int money0 = Siege.Instance.ServerCoins; Note($"corpses lying: {corpses}"); Quaternion val3 = Quaternion.Euler(0f, 90f, 0f); val = (field - stall).Flat(); Vector3 eye = field + val3 * ((Vector3)(ref val)).normalized * 9f; eye.y = BossFx.Ground(eye) + stand; me.LocalTeleport(eye, YawTo(eye, field), true); Aim(YawTo(eye, field), 12f); yield return (object)new WaitForSecondsRealtime(2f); Vector3 val4 = Helpers.Instance.DebugPos(0); Vector3 val5 = val4 + new Vector3(2.5f, 0f, 2.5f); val5.y = BossFx.Ground(val5) + stand; me.LocalTeleport(val5, YawTo(val5, val4), true); Aim(YawTo(val5, val4), 18f); yield return (object)new WaitForSecondsRealtime(0.4f); FortressPlugin.Shot("helpers_walk"); me.LocalTeleport(eye, YawTo(eye, field), true); Aim(YawTo(eye, field), 12f); yield return (object)new WaitForSecondsRealtime(1.6f); FortressPlugin.Shot("helpers_fetch"); Note("helpers at 4 s: " + Helpers.Instance.DebugState()); yield return Until(() => C("helper_sold") >= 2 && FortressNet.Instance.ServerCorpses().Count() == 0, 60f, "helpers selling"); Note(string.Format("helpers: picked {0} of {1}, sold {2} times for {3} (money {4} -> {5}), corpses left {6}", C("helper_picked"), corpses, C("helper_sold"), C("helper_money"), money0, Siege.Instance.ServerCoins, FortressNet.Instance.ServerCorpses().Count())); yield return (object)new WaitForSecondsRealtime(4f); Vector3 val6 = Helpers.Instance.DebugPos(0); List list = new List(); for (int num2 = 0; num2 < 4; num2++) { list.Add(plugin.ServerSpawnMinion(EnemyKind.Runner, val6 + Quaternion.Euler(0f, 90f * (float)num2, 0f) * Vector3.forward * 1.1f + Vector3.up * 1f)); } foreach (Creature item in list) { if (Object.op_Implicit((Object)(object)item)) { Siege.Instance.Slow(item, 1f, 60f); } } me.LocalTeleport(new Vector3(val6.x + 4f, BossFx.Ground(val6 + Vector3.right * 4f) + stand, val6.z + 4f), YawTo(val6 + new Vector3(4f, 0f, 4f), val6), true); yield return Until(() => C("helper_down") >= 1, 15f, "a helper knocked out"); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("helpers_ko"); Note(string.Format("knocked out: {0}; ", C("helper_down")) + Helpers.Instance.DebugState()); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); Vector3 core = island.CorePos; val = (center - core).Flat(); Vector3 towerAt = core + ((Vector3)(ref val)).normalized * 0f + new Vector3(5f, 0f, 0f); bool placed = TurretAt(PieceType.Mender, towerAt); float num3 = 3f; Vector3 wallAt = towerAt + new Vector3(3f, 0f, 0f); wallAt = new Vector3((Mathf.Floor(wallAt.x / num3) + 0.5f) * num3, BossFx.Ground(wallAt), Mathf.Floor(wallAt.z / num3) * num3); bool wallPlaced = BuildSystem.Instance.ServerPlace(PieceType.Wall, wallAt, 0f); yield return (object)new WaitForSecondsRealtime(0.5f); PieceState wall = BuildSystem.Instance.ServerPieces.Where((PieceState p) => p.Type == PieceType.Wall).OrderBy(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val11 = p.Pos - wallAt; return ((Vector3)(ref val11)).sqrMagnitude; }).FirstOrDefault(); if (wall.Id != 0) { BuildSystem.Instance.ServerDamagePiece(wall.Id, 120); } Siege.Instance.ServerDamageCoreForTest(300); yield return (object)new WaitForSecondsRealtime(0.2f); int wall2 = BuildSystem.Instance.ServerPieces.FirstOrDefault((PieceState p) => p.Id == wall.Id).Hp; int core2 = Siege.Instance.CoreHp; int mended0 = C("mended"); Vector3 val7 = towerAt + new Vector3(-6f, 0f, -6f); me.LocalTeleport(new Vector3(val7.x, BossFx.Ground(val7) + stand, val7.z), YawTo(val7, towerAt), true); Aim(YawTo(val7, towerAt), 12f); yield return (object)new WaitForSecondsRealtime(6f); FortressPlugin.Shot("mender"); int hp = BuildSystem.Instance.ServerPieces.FirstOrDefault((PieceState p) => p.Id == wall.Id).Hp; Catalog.TurretStats turretStats = Catalog.Turret(PieceType.Mender, 1, 0); AutoTest autoTest = this; object[] obj = new object[13] { placed, wallPlaced, null, null, null, null, null, null, null, null, null, null, null }; val = (wall.Pos - towerAt).Flat(); obj[2] = ((Vector3)(ref val)).magnitude; obj[3] = wall2; obj[4] = hp; obj[5] = wall.MaxHp; obj[6] = turretStats.Damage; obj[7] = core2; obj[8] = Siege.Instance.CoreHp; obj[9] = (float)turretStats.Damage * 0.5f; obj[10] = turretStats.Range; val = (core - towerAt).Flat(); obj[11] = ((Vector3)(ref val)).magnitude; obj[12] = C("mended") - mended0; autoTest.Note(string.Format("repair tower placed {0}, wall {1} at {2:0.0} m: wall {3} -> {4}/{5} (expect +{6}/s), lighthouse {7} -> {8} (expect +{9:0.#}/s while within {10} m: it's {11:0.0} m), pulses {12}", obj)); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); float num4 = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 val8 = default(Vector3); ((Vector3)(ref val8))..ctor(Mathf.Cos(num4), 0f, Mathf.Sin(num4)); Vector3.Cross(Vector3.up, val8); EnemyKind[] array = new EnemyKind[9] { EnemyKind.Runner, EnemyKind.Charger, EnemyKind.Bomber, EnemyKind.Tank, EnemyKind.Thief, EnemyKind.Shield, EnemyKind.Digger, EnemyKind.Healer, EnemyKind.Splitter }; Vector3 val9 = center + val8 * 10f; val9.y = BossFx.Ground(val9); for (int num5 = 0; num5 <= array.Length; num5++) { Vector3 val10 = val9 + Quaternion.Euler(0f, ((float)num5 - (float)array.Length / 2f) * 11f, 0f) * val8 * 7f; val10.y = BossFx.Ground(val10); plugin.DebugShowcase((num5 < array.Length) ? array[num5] : EnemyKind.Runner, num5 == array.Length, val10, YawTo(val10, val9)); } me.LocalTeleport(val9 + Vector3.up * stand, YawTo(val9, val9 + val8), true); Aim(YawTo(val9, val9 + val8), 14f); yield return (object)new WaitForSecondsRealtime(2.5f); FortressPlugin.Shot("enemy_lineup"); yield return (object)new WaitForSecondsRealtime(0.6f); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } } private IEnumerator HelperLookScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 center = island.Center; float stand = 1.1f; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * stand, 0f, true); plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running && plugin.InBuildTime, 15f, "round start"); plugin.DebugExtendBuild(3000f); if (loot.Vault.Helpers < 1) { loot.Vault.Helpers = 1; } yield return Until(() => Helpers.Instance.DebugCount > 0, 5f, "a helper"); Vector3 marketPos = island.MarketPos; Vector3 val = (center - island.MarketPos).Flat(); Vector3 at = marketPos + ((Vector3)(ref val)).normalized * 6f; at.y = BossFx.Ground(at); Vector3 val2 = at; Quaternion val3 = Quaternion.Euler(0f, 35f, 0f); val = (center - island.MarketPos).Flat(); Vector3 eye = val2 + val3 * ((Vector3)(ref val)).normalized * 3.2f; eye.y = BossFx.Ground(eye) + stand; Helpers.Instance.DebugStage(0, at, YawTo(at, eye), 3, down: false, 6f); me.LocalTeleport(eye, YawTo(eye, at), true); Aim(YawTo(eye, at), 14f); yield return (object)new WaitForSecondsRealtime(3f); Note("helper body: " + Helpers.Instance.DebugBody()); FortressPlugin.Shot("helper_close"); yield return (object)new WaitForSecondsRealtime(0.6f); Helpers.Instance.DebugStage(0, at, YawTo(at, eye), 0, down: true, 6f); yield return (object)new WaitForSecondsRealtime(2.5f); FortressPlugin.Shot("helper_close_ko"); yield return (object)new WaitForSecondsRealtime(0.6f); Helpers.Instance.DebugStage(0, at, YawTo(at, island.CounterPos), 3, down: false, 0f); Vector3 val4 = at; val = (island.CounterPos - at).Flat(); Vector3 val5 = val4 + ((Vector3)(ref val)).normalized * 3f; Vector3 up = Vector3.up; val = (island.CounterPos - at).Flat(); Vector3 val6 = val5 + Vector3.Cross(up, ((Vector3)(ref val)).normalized) * 3f; val6.y = BossFx.Ground(val6) + stand; me.LocalTeleport(val6, YawTo(val6, at), true); Aim(YawTo(val6, at), 12f); yield return (object)new WaitForSecondsRealtime(0.9f); FortressPlugin.Shot("helper_walking"); yield return (object)new WaitForSecondsRealtime(0.6f); foreach (Keeper k in island.Keepers) { Vector3 val7 = ((Component)k).transform.position + ((Component)k).transform.forward * 3f; val7.y = BossFx.Ground(val7) + stand; me.LocalTeleport(val7, YawTo(val7, ((Component)k).transform.position), true); Aim(YawTo(val7, ((Component)k).transform.position), 6f); yield return (object)new WaitForSecondsRealtime(1.2f); if (k.Role == "Smith") { k.Said(); VaultUI.Instance.Close(); yield return (object)new WaitForSecondsRealtime(0.3f); } FortressPlugin.Shot("keeper_" + k.Role); yield return (object)new WaitForSecondsRealtime(0.6f); } } private IEnumerator NpcRefScenario() { Player me = Player.LocalPlayer; if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; string dir = Path.Combine(Paths.BepInExRootPath, "fortress-shots"); Directory.CreateDirectory(dir); List list = Resources.FindObjectsOfTypeAll().Where(delegate(NPC n) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)n)) { Scene scene = ((Component)n).gameObject.scene; if (((Scene)(ref scene)).IsValid()) { return ((Component)n).gameObject.activeInHierarchy; } } return false; }).ToList(); Note(string.Format("npcs: {0}: {1}", list.Count, string.Join(", ", list.Select(delegate(NPC n) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) string name = ((Object)n).name; Vector3 position = ((Component)n).transform.position; return name + " at " + ((Vector3)(ref position)).ToString("F0"); })))); int shot = 0; foreach (NPC item2 in list.Take(8)) { Transform t = ((Component)item2).transform; List list2 = (from r in ((Component)item2).GetComponentsInChildren(true) where r.enabled && ((Component)r).gameObject.activeInHierarchy select r).ToList(); Bounds val = (Bounds)((list2.Count > 0) ? list2[0].bounds : new Bounds(t.position, Vector3.one)); foreach (Renderer item3 in list2) { ((Bounds)(ref val)).Encapsulate(item3.bounds); } StringBuilder stringBuilder = new StringBuilder($"{((Object)item2).name}: bounds {((Bounds)(ref val)).size:F2} from {((Bounds)(ref val)).min.y - t.position.y:F2} to {((Bounds)(ref val)).max.y - t.position.y:F2} over its feet"); SkinnedMeshRenderer[] componentsInChildren = ((Component)item2).GetComponentsInChildren(true); foreach (SkinnedMeshRenderer val2 in componentsInChildren) { object[] obj = new object[5] { ((Object)val2).name, null, null, null, null }; object obj2; if (!Object.op_Implicit((Object)(object)val2.sharedMesh)) { obj2 = "-"; } else { string[] obj3 = new string[5] { ((Object)val2.sharedMesh).name, " ", val2.sharedMesh.vertexCount.ToString(), "v ", null }; Bounds bounds = val2.sharedMesh.bounds; Vector3 size = ((Bounds)(ref bounds)).size; obj3[4] = ((Vector3)(ref size)).ToString("F2"); obj2 = string.Concat(obj3); } obj[1] = obj2; obj[2] = val2.bones.Length; obj[3] = string.Join("/", from m in ((Renderer)val2).sharedMaterials where Object.op_Implicit((Object)(object)m) select ((Object)m).name); obj[4] = (((Renderer)val2).enabled ? "yes" : "no"); stringBuilder.Append(string.Format("\n {0}: mesh {1}, {2} bones, mats {3}, on {4}", obj)); } Transform val3 = t.Find("Character"); if (Object.op_Implicit((Object)(object)val3)) { foreach (Transform item4 in from x in ((Component)val3).GetComponentsInChildren(true) where !Object.op_Implicit((Object)(object)((Component)x).GetComponent()) select x) { stringBuilder.Append($"\n bone {BonePath(item4, val3)}: local {item4.localPosition:F3} rot {item4.localEulerAngles:F0} world-up {item4.position.y - t.position.y:F2}"); } } Note(stringBuilder.ToString()); foreach (SkinnedMeshRenderer item5 in from r in ((Component)item2).GetComponentsInChildren(true) where Object.op_Implicit((Object)(object)r.sharedMesh) select r) { Mesh val4 = new Mesh(); item5.BakeMesh(val4); WriteObj(Path.Combine(dir, $"npc_{shot}_{((Object)item5).name}.obj"), val4, t.InverseTransformPoint(((Component)item5).transform.position), Quaternion.Inverse(t.rotation) * ((Component)item5).transform.rotation, ((Component)item5).transform.lossyScale); } (float, string)[] array = new(float, string)[3] { (0f, "front"), (90f, "side"), (35f, "three") }; for (int num2 = 0; num2 < array.Length; num2++) { (float, string) tuple = array[num2]; float item = tuple.Item1; string tag = tuple.Item2; Vector3 val5 = Quaternion.Euler(0f, item, 0f) * t.forward; Vector3 val6 = t.position + val5 * 2.4f + Vector3.up * 0.2f; me.LocalTeleport(val6, YawTo(val6, t.position), true); Aim(YawTo(val6, t.position), -4f); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot($"npc_{shot}_{tag}"); yield return (object)new WaitForSecondsRealtime(0.5f); } shot++; } } private static string BonePath(Transform t, Transform root) { string text = ((Object)t).name; while (Object.op_Implicit((Object)(object)t.parent) && (Object)(object)t.parent != (Object)(object)root) { t = t.parent; text = ((Object)t).name + "/" + text; } return text; } private static void WriteObj(string file, Mesh mesh, Vector3 offset, Quaternion rot, Vector3 scale) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) CultureInfo invariantCulture = CultureInfo.InvariantCulture; StringBuilder stringBuilder = new StringBuilder(); Vector3[] vertices = mesh.vertices; foreach (Vector3 val in vertices) { Vector3 val2 = offset + rot * Vector3.Scale(val, scale); stringBuilder.Append("v ").Append((0f - val2.x).ToString("R", invariantCulture)).Append(' ') .Append(val2.y.ToString("R", invariantCulture)) .Append(' ') .Append(val2.z.ToString("R", invariantCulture)) .Append('\n'); } Vector2[] uv = mesh.uv; for (int i = 0; i < uv.Length; i++) { Vector2 val3 = uv[i]; stringBuilder.Append("vt ").Append(val3.x.ToString("R", invariantCulture)).Append(' ') .Append(val3.y.ToString("R", invariantCulture)) .Append('\n'); } int[] triangles = mesh.triangles; bool flag = mesh.uv.Length == mesh.vertexCount; for (int j = 0; j < triangles.Length; j += 3) { int num = triangles[j] + 1; int num2 = triangles[j + 2] + 1; int num3 = triangles[j + 1] + 1; stringBuilder.Append(flag ? $"f {num}/{num} {num2}/{num2} {num3}/{num3}\n" : $"f {num} {num2} {num3}\n"); } File.WriteAllText(file, stringBuilder.ToString()); } private IEnumerator WorldRefScenario() { Player localPlayer = Player.LocalPlayer; if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Vector3 c = localPlayer.Transform.position; List<(Transform root, Bounds b, int n)> parts = (from x in (from r in Object.FindObjectsOfType().Where(delegate(MeshRenderer r) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (((Renderer)r).enabled && ((Component)r).gameObject.activeInHierarchy) { Bounds bounds = ((Renderer)r).bounds; Vector3 val2 = (((Bounds)(ref bounds)).center - c).Flat(); if (((Vector3)(ref val2)).magnitude < 90f) { return !((Object)r).name.StartsWith("Fortress"); } } return false; }) group r by (!Object.op_Implicit((Object)(object)((Component)r).transform.parent)) ? ((Component)r).transform : ((Component)r).transform.parent into g select (root: g.Key, b: g.Select((MeshRenderer r) => ((Renderer)r).bounds).Aggregate(delegate(Bounds x, Bounds y) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((Bounds)(ref x)).Encapsulate(y); return x; }), n: g.Count())).Where(delegate((Transform root, Bounds b, int n) x) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Vector3 size = ((Bounds)(ref x.b)).size; if (((Vector3)(ref size)).magnitude > 2.5f) { size = ((Bounds)(ref x.b)).size; return ((Vector3)(ref size)).magnitude < 45f; } return false; }) orderby ((Bounds)(ref x.b)).size.x * ((Bounds)(ref x.b)).size.y * ((Bounds)(ref x.b)).size.z descending select x).Take(16).ToList(); Note("biggest pieces: " + string.Join("; ", parts.Select(((Transform root, Bounds b, int n) x) => string.Format("{0} < {1} ({2} meshes) {3:F1} at {4:F0}", ((Object)x.root).name, Object.op_Implicit((Object)(object)x.root.parent) ? ((Object)x.root.parent).name : "-", x.n, ((Bounds)(ref x.b)).size, ((Bounds)(ref x.b)).center - c)))); for (int i = 0; i < 4; i++) { float num = (float)i * 90f * (MathF.PI / 180f); Vector3 eye = c + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * 26f + Vector3.up * 12f; Reveal.Instance.TestView(eye, c); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot($"world_round_{i}"); yield return (object)new WaitForSecondsRealtime(0.4f); } int k = 0; Vector3 val; foreach (var item3 in parts) { Transform root = item3.root; Bounds item = item3.b; Vector3 center = ((Bounds)(ref item)).center; val = new Vector3(0.7f, 0.45f, -0.7f); Vector3 normalized = ((Vector3)(ref val)).normalized; val = ((Bounds)(ref item)).size; Vector3 eye2 = center + normalized * Mathf.Max(4f, ((Vector3)(ref val)).magnitude * 1.15f); Reveal.Instance.TestView(eye2, center); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot($"world_piece_{k++}_{((Object)root).name.Replace(' ', '_')}"); yield return (object)new WaitForSecondsRealtime(0.4f); } FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); (string, Vector3)[] array = new(string, Vector3)[5] { ("vault", island.VaultPos), ("smithy", island.SmithyPos), ("stall", island.MarketPos), ("lighthouse", island.CorePos), ("center", island.Center) }; for (int i = 0; i < array.Length; i++) { (string, Vector3) tuple = array[i]; string name = tuple.Item1; Vector3 item2 = tuple.Item2; val = new Vector3(0.7f, 0.5f, -0.7f); Vector3 eye3 = item2 + ((Vector3)(ref val)).normalized * 9f; Reveal.Instance.TestView(eye3, item2 + Vector3.up); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot("ours_" + name); yield return (object)new WaitForSecondsRealtime(0.4f); } Reveal.Instance.TestViewEnd(); } private IEnumerator TownRefScenario() { Player me = Player.LocalPlayer; if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Vector3[] spots = (Vector3[])(object)new Vector3[3] { new Vector3(500f, 0f, -100f), new Vector3(310f, 0f, -570f), new Vector3(125f, 0f, -950f) }; for (int s = 0; s < spots.Length; s++) { Vector3 c = spots[s]; me.LocalTeleport(c + Vector3.up * 30f, 0f, true); yield return (object)new WaitForSecondsRealtime(10f); List list = Object.FindObjectsOfType().Where(delegate(MeshRenderer r) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (((Renderer)r).enabled && ((Component)r).gameObject.activeInHierarchy) { Bounds bounds = ((Renderer)r).bounds; Vector3 val2 = (((Bounds)(ref bounds)).center - c).Flat(); if (((Vector3)(ref val2)).magnitude < 140f) { return !((Object)r).name.StartsWith("Fortress"); } } return false; }).ToList(); if (list.Count == 0) { Note($"island {s} at {c}: nothing streamed in"); continue; } Bounds all = list.Select((MeshRenderer r) => ((Renderer)r).bounds).Aggregate(delegate(Bounds x, Bounds y) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((Bounds)(ref x)).Encapsulate(y); return x; }); Note($"island {s} at {c}: {list.Count} meshes over {((Bounds)(ref all)).size:F0} round {((Bounds)(ref all)).center:F0}"); List<(Transform root, Bounds b, int n)> parts = (from x in (from r in list group r by (!Object.op_Implicit((Object)(object)((Component)r).transform.parent)) ? ((Component)r).transform : ((Component)r).transform.parent into g select (root: g.Key, b: g.Select((MeshRenderer r) => ((Renderer)r).bounds).Aggregate(delegate(Bounds x, Bounds y) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((Bounds)(ref x)).Encapsulate(y); return x; }), n: g.Count())).Where(delegate((Transform root, Bounds b, int n) x) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Vector3 size = ((Bounds)(ref x.b)).size; if (((Vector3)(ref size)).magnitude > 2.5f) { size = ((Bounds)(ref x.b)).size; return ((Vector3)(ref size)).magnitude < 40f; } return false; }) orderby ((Bounds)(ref x.b)).size.x * ((Bounds)(ref x.b)).size.y * ((Bounds)(ref x.b)).size.z descending select x).Take(14).ToList(); Note(" biggest: " + string.Join("; ", parts.Select(((Transform root, Bounds b, int n) x) => string.Format("{0} < {1} ({2}) {3:F1}", ((Object)x.root).name, Object.op_Implicit((Object)(object)x.root.parent) ? ((Object)x.root.parent).name : "-", x.n, ((Bounds)(ref x.b)).size)))); for (int i = 0; i < 3; i++) { float num = ((float)i * 120f + 30f) * (MathF.PI / 180f); float num2 = Mathf.Max(30f, Mathf.Max(((Bounds)(ref all)).size.x, ((Bounds)(ref all)).size.z) * 0.6f); Vector3 eye = ((Bounds)(ref all)).center + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * num2 + Vector3.up * num2 * 0.45f; Reveal.Instance.TestView(eye, ((Bounds)(ref all)).center); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot($"town{s}_round_{i}"); yield return (object)new WaitForSecondsRealtime(0.4f); } int k = 0; foreach (var item2 in parts) { Transform root = item2.root; Bounds item = item2.b; Vector3 center = ((Bounds)(ref item)).center; Vector3 val = new Vector3(0.7f, 0.42f, -0.7f); Vector3 normalized = ((Vector3)(ref val)).normalized; val = ((Bounds)(ref item)).size; Vector3 eye2 = center + normalized * Mathf.Max(5f, ((Vector3)(ref val)).magnitude * 1.2f); Reveal.Instance.TestView(eye2, center); yield return (object)new WaitForSecondsRealtime(0.9f); FortressPlugin.Shot($"town{s}_piece_{k++}_{((Object)root).name.Replace(' ', '_')}"); yield return (object)new WaitForSecondsRealtime(0.3f); } Reveal.Instance.TestViewEnd(); yield return (object)new WaitForSecondsRealtime(0.5f); } } private IEnumerator CabinRefScenario() { Player localPlayer = Player.LocalPlayer; if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; Vector3 c = new Vector3(500f, 0f, -100f); localPlayer.LocalTeleport(c + Vector3.up * 30f, 0f, true); yield return (object)new WaitForSecondsRealtime(10f); List source = Object.FindObjectsOfType().Where(delegate(MeshFilter f) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)f) && Object.op_Implicit((Object)(object)f.sharedMesh)) { MeshRenderer component = ((Component)f).GetComponent(); if (component != null && ((Renderer)component).enabled) { Bounds bounds = ((Renderer)component).bounds; Vector3 val4 = (((Bounds)(ref bounds)).center - c).Flat(); return ((Vector3)(ref val4)).magnitude < 140f; } } return false; }).ToList(); Note("meshes here: " + string.Join(", ", (from f in source group f by ((Object)f.sharedMesh).name into g orderby g.Count() descending select g).Select(delegate(IGrouping g) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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) string key = g.Key; object arg = g.Count(); Bounds bounds = ((Renderer)((Component)g.First()).GetComponent()).bounds; return $"{key} x{arg} {((Bounds)(ref bounds)).size:F1}"; }))); List<(Transform, Bounds)> list = (from f in source where !Natural(((Object)f.sharedMesh).name) && !Natural(((Object)f).name) group f by (!Object.op_Implicit((Object)(object)((Component)f).transform.parent)) ? ((Component)f).transform : ((Component)f).transform.parent into g select (root: g.Key, b: g.Select((MeshFilter f) => ((Renderer)((Component)f).GetComponent()).bounds).Aggregate(delegate(Bounds x, Bounds y) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((Bounds)(ref x)).Encapsulate(y); return x; }))).Where(delegate((Transform root, Bounds b) x) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Vector3 size = ((Bounds)(ref x.b)).size; if (((Vector3)(ref size)).magnitude > 0.6f) { size = ((Bounds)(ref x.b)).size; return ((Vector3)(ref size)).magnitude < 30f; } return false; }).OrderByDescending(delegate((Transform root, Bounds b) x) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Vector3 size = ((Bounds)(ref x.b)).size; return ((Vector3)(ref size)).magnitude; }).Take(12) .ToList(); Note("made things: " + string.Join("; ", list.Select<(Transform, Bounds), string>(((Transform root, Bounds b) x) => $"{((Object)x.root).name} {((Bounds)(ref x.b)).size:F1}"))); int k = 0; foreach (var item in list) { Transform root = item.Item1; Bounds b = item.Item2; float[] array = ((k >= 2) ? new float[1] { 35f } : new float[3] { 35f, 145f, 250f }); foreach (float yaw in array) { Vector3 center = ((Bounds)(ref b)).center; Quaternion val = Quaternion.Euler(0f, yaw, 0f); Vector3 val2 = new Vector3(0f, 0.35f, -1f); Vector3 val3 = val * ((Vector3)(ref val2)).normalized; val2 = ((Bounds)(ref b)).size; Vector3 eye = center + val3 * Mathf.Max(3f, ((Vector3)(ref val2)).magnitude * 1.3f); Reveal.Instance.TestView(eye, center); yield return (object)new WaitForSecondsRealtime(0.9f); FortressPlugin.Shot($"made_{k}_{(int)yaw}_{((Object)root).name.Replace(' ', '_')}"); yield return (object)new WaitForSecondsRealtime(0.3f); } k++; } Reveal.Instance.TestViewEnd(); static bool Natural(string n) { if (!n.Contains("Tree") && !n.Contains("Rock") && !n.Contains("Grass") && !n.Contains("Island") && !n.Contains("Bush") && !n.Contains("Fern") && !n.Contains("Plant") && !n.Contains("Terrain")) { return n.Contains("Water"); } return true; } } private IEnumerator VillageLookScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player localPlayer = Player.LocalPlayer; Vector3 c = island.Center; localPlayer.LocalTeleport(c + FortressIsland.ReadyLocal + Vector3.up * 1.1f, 0f, true); yield return (object)new WaitForSecondsRealtime(3f); (string, Vector3, Vector3)[] obj = new(string, Vector3, Vector3)[8] { ("road", Up(c + new Vector3(0f, 0f, -27f), 2.2f), c + new Vector3(0f, 2f, -12f)), default((string, Vector3, Vector3)), default((string, Vector3, Vector3)), default((string, Vector3, Vector3)), default((string, Vector3, Vector3)), default((string, Vector3, Vector3)), default((string, Vector3, Vector3)), default((string, Vector3, Vector3)) }; Vector3 vaultPos = island.VaultPos; Vector3 val = (c + new Vector3(0f, 0f, -18f) - island.VaultPos).Flat(); obj[1] = ("vault", Up(vaultPos + ((Vector3)(ref val)).normalized * 5.5f, 1.9f), island.VaultPos + Vector3.up * 1.3f); Vector3 smithyPos = island.SmithyPos; val = (c + new Vector3(0f, 0f, -18f) - island.SmithyPos).Flat(); obj[2] = ("smithy", Up(smithyPos + ((Vector3)(ref val)).normalized * 6f, 1.9f), island.SmithyPos + Vector3.up * 1.3f); Vector3 marketPos = island.MarketPos; val = (c + new Vector3(0f, 0f, -18f) - island.MarketPos).Flat(); obj[3] = ("stall", Up(marketPos + ((Vector3)(ref val)).normalized * 5.5f, 1.9f), island.MarketPos + Vector3.up * 1.2f); obj[4] = ("plaza", Up(c + new Vector3(7.5f, 0f, -7.5f), 3f), c + Vector3.up * 1.5f); obj[5] = ("pier", Up(c + new Vector3(3f, 0f, -42f), 2.5f), c + new Vector3(0f, 1.5f, -27f)); obj[6] = ("vault_in", island.VaultPos + Quaternion.Euler(0f, 90f, 0f) * new Vector3(-0.4f, 1.7f, 1.3f), island.VaultPos + Quaternion.Euler(0f, 90f, 0f) * new Vector3(1.2f, 1.2f, -0.6f)); obj[7] = ("rack", island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.84f, 1.8f, 1f), island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.84f, 1.95f, -1.3f)); (string, Vector3, Vector3)[] array = obj; (string name, Vector3 eye, Vector3 look)[] array2 = array; for (int num = 0; num < array2.Length; num++) { var (name, eye, look) = array2[num]; Reveal.Instance.TestView(eye, look); yield return (object)new WaitForSecondsRealtime(1.3f); FortressPlugin.Shot("village_" + name); yield return (object)new WaitForSecondsRealtime(0.4f); } Reveal.Instance.TestViewEnd(); static Vector3 Up(Vector3 p, float h) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return new Vector3(p.x, BossFx.Ground(p) + h, p.z); } } private IEnumerator HotbarDragScenario() { FortressIsland island = FortressIsland.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); if (!PlayerManager.InGodMode) { PlayerManager.ToggleGodMode(); } IgnorePlayers = true; Tips.Show.Value = false; yield return Revive(); Player me = Player.LocalPlayer; Vector3 val = island.VaultPos + Quaternion.Euler(0f, 90f, 0f) * new Vector3(-0.3f, 0.5f, 0.8f); me.LocalTeleport(val, YawTo(val, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(1.5f); AutoTest autoTest = this; Vector3 val2 = (me.Transform.position - island.VaultPos).Flat(); autoTest.Note($"standing in the vault at {((Vector3)(ref val2)).magnitude:0.0} m from its middle, height {me.Transform.position.y - island.VaultPos.y:0.00}"); while (loot.Vault.StorageSlots - loot.Vault.SlotsUsed < 4) { loot.Vault.Bought[Expansion.Storage] = loot.Vault.BoughtOf(Expansion.Storage) + 1; } loot.Vault.Add(Gear.Laser, Rarity.Common, 2); loot.SaveVault(); yield return (object)new WaitForSecondsRealtime(0.5f); Gear g; Rarity r; foreach (Item item in (from i in me.Inventory._items.Values.Append(me.Holding.HeldItem) where Object.op_Implicit((Object)(object)i) && WeaponItems.Is(i, out g, out r) select i).Distinct().ToList()) { me.Inventory.RemoveItem(item); item.DestroyItem((byte)0, byte.MaxValue); } yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Open(); yield return (object)new WaitForSecondsRealtime(1f); List debugHotbarSlots = VaultUI.Instance.DebugHotbarSlots; Item val7 = default(Item); int free = debugHotbarSlots.Where((int i) => !me.Inventory._items.TryGetValue((byte)i, ref val7) || !Object.op_Implicit((Object)(object)val7)).DefaultIfEmpty(-1).Last(); Note(string.Format("hotbar handles {0} over slots {1}, an empty one: {2}", VaultUI.Instance.DebugHotbarHandles, string.Join(",", debugHotbarSlots), free)); VaultUI.Instance.DebugHotbarLight(on: true); yield return (object)new WaitForSecondsRealtime(0.4f); FortressPlugin.Shot("hotbar_lit"); yield return (object)new WaitForSecondsRealtime(0.4f); VaultUI.Instance.DebugHotbarLight(on: false); int lasers0 = loot.Vault.Count(Gear.Laser, Rarity.Common); if (free >= 0) { VaultUI.Instance.DebugHotbarTake(Gear.Laser, Rarity.Common, free); } yield return (object)new WaitForSecondsRealtime(2.5f); Item val4 = default(Item); Item val3 = ((free >= 0 && me.Inventory._items.TryGetValue((byte)free, ref val4)) ? val4 : null); Note(string.Format("vault -> hotbar slot {0}: in it '{1}', common lasers {2} -> {3} (expect -1)", free, Object.op_Implicit((Object)(object)val3) ? val3.GetName() : "nothing", lasers0, loot.Vault.Count(Gear.Laser, Rarity.Common))); FortressPlugin.Shot("hotbar_after_take"); yield return (object)new WaitForSecondsRealtime(0.4f); int lasers1 = loot.Vault.Count(Gear.Laser, Rarity.Common); if (free >= 0) { VaultUI.Instance.DebugHotbarStore(free); } yield return (object)new WaitForSecondsRealtime(1.5f); Item val6 = default(Item); Item val5 = ((free >= 0 && me.Inventory._items.TryGetValue((byte)free, ref val6)) ? val6 : null); Note(string.Format("hotbar slot {0} -> vault: in it now '{1}' (expect nothing), common lasers {2} -> {3} (expect +1)", free, Object.op_Implicit((Object)(object)val5) ? val5.GetName() : "nothing", lasers1, loot.Vault.Count(Gear.Laser, Rarity.Common))); VaultUI.Instance.Close(); } private IEnumerator Vault2Scenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Loot loot = Loot.Instance; FortressPlugin plugin = FortressPlugin.Instance; Dictionary dictionary = (Dictionary)AccessTools.Field(typeof(GameInfo), "_allItems").GetValue(null); Item fishKind = ((IEnumerable)dictionary.Values).FirstOrDefault((Func)delegate(Item i) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Creature val4 = (Creature)(object)((i is Creature) ? i : null); return val4 != null && (int)val4.BossType == 0 && !(i is RunningFish) && ((Object)i).name.ToLower().Contains("bass"); }) ?? dictionary.Values.First(delegate(Item i) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Creature val4 = (Creature)(object)((i is Creature) ? i : null); return val4 != null && (int)val4.BossType == 0 && !(i is RunningFish); }); Item knifePrefab = GameInfo.GetSpawnable("knife"); byte knifeId = knifePrefab.ID; for (int num = 0; num < 3; num++) { ItemManager.Instance.SpawnNewItem(knifePrefab, island.Center + new Vector3(2f + (float)num, 3f, -9f), Quaternion.identity); } WeaponItems.ServerSpawn(Gear.Laser, Rarity.Common, island.Center + new Vector3(-2f, 3f, -9f)); yield return (object)new WaitForSecondsRealtime(1.5f); int lying = Lying(); plugin.TestKey((Key)100, shift: true); yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("Shift+F7: {0} things lying on the island -> {1} (expect 0), cleared {2}", lying, Lying(), C("ground_cleared"))); while (loot.Vault.StorageSlots - loot.Vault.SlotsUsed < 8) { loot.Vault.Bought[Expansion.Storage] = loot.Vault.BoughtOf(Expansion.Storage) + 1; } Vector3 chute = ((Component)Object.FindObjectOfType()).transform.position; Vector3 eye = island.VaultPos + Quaternion.Euler(0f, 90f, 0f) * new Vector3(1.6f, 1.4000001f, 4.2f); yield return View(eye, chute, null, 6f); int stored0 = C("vault_stored"); int fish0 = loot.Vault.CountItem(fishKind.ID); int knives0 = loot.Vault.CountItem(knifeId); int rare0 = loot.Vault.Count(Gear.Laser, Rarity.Rare); Item val = DeadFish(chute + Vector3.up * 2.2f); float weight = val.RandomizedWeight; ItemManager.Instance.SpawnNewItem(knifePrefab, chute + Vector3.up * 2.8f, Quaternion.identity); WeaponItems.ServerSpawn(Gear.Laser, Rarity.Rare, chute + Vector3.up * 3.4f); int guns0 = loot.Vault.Items.Count; int commons0 = loot.Vault.Count(Gear.Shotgun, Rarity.Common) + loot.Vault.Count(Gear.Pistol, Rarity.Common); string[] array = new string[2] { "shotgun", "pistol" }; for (int num2 = 0; num2 < array.Length; num2++) { Item spawnable = GameInfo.GetSpawnable(array[num2]); if (spawnable != null && Object.op_Implicit((Object)(object)spawnable)) { ItemManager.Instance.SpawnNewItem(spawnable, chute + Vector3.up * 4f, Quaternion.identity); } } yield return (object)new WaitForSecondsRealtime(0.6f); FortressPlugin.Shot("vault_swallow"); yield return (object)new WaitForSecondsRealtime(2f); Note(string.Format("vault door: stored {0} (expect 3); {1} {2} -> {3} (weight {4:0.000}), knives {5} -> {6}, rare lasers {7} -> {8}; slots {9}/{10}", C("vault_stored") - stored0, ((Object)fishKind).name, fish0, loot.Vault.CountItem(fishKind.ID), weight, knives0, loot.Vault.CountItem(knifeId), rare0, loot.Vault.Count(Gear.Laser, Rarity.Rare), loot.Vault.SlotsUsed, loot.Vault.StorageSlots)); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.TakeItem, Item = fishKind.ID, Slot = 0, Count = 1 }); yield return (object)new WaitForSecondsRealtime(1.5f); Item val2 = (from i in Object.FindObjectsOfType() where Object.op_Implicit((Object)(object)i) && ((NetworkBehaviour)i).IsSpawned && i.ID == fishKind.ID && Mathf.Abs(i.RandomizedWeight - weight) < 0.001f select i).FirstOrDefault(); Note(Object.op_Implicit((Object)(object)val2) ? string.Format("fish taken out: weight {0:0.000} (went in at {1:0.000}), dead {2}, in my hands {3}, taken {4}", val2.RandomizedWeight, weight, Object.op_Implicit((Object)(object)val2.Creature) && val2.Creature.IsDead, (Object)(object)val2.Holder == (Object)(object)me || val2.IsInInventory, C("item_taken")) : "fish taken out: NONE"); yield return View(island.VaultDoor + Vector3.up * 1.1f, island.VaultPos, null, 5f, 0.6f); VaultUI.Instance.Open(); yield return (object)new WaitForSecondsRealtime(2.5f); FortressPlugin.Shot("vault_ui_all"); yield return (object)new WaitForSecondsRealtime(0.6f); VaultUI.Instance.DebugTab(3); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("vault_ui_items"); yield return (object)new WaitForSecondsRealtime(0.6f); Note(string.Format("game items in the vault: {0} (host list {1}, guns kept as game items {2} (expect 0), turned into commons {3} (expect 2))", string.Join(", ", loot.ClientVault.ItemCount.Select((KeyValuePair kv) => (Object.op_Implicit((Object)(object)GameInfo.GetSpawnable(kv.Key)) ? ((Object)GameInfo.GetSpawnable(kv.Key)).name : ("#" + kv.Key)) + " x" + kv.Value)), loot.Vault.Items.Count, loot.Vault.Items.Count - guns0, loot.Vault.Count(Gear.Shotgun, Rarity.Common) + loot.Vault.Count(Gear.Pistol, Rarity.Common) - commons0)); VaultUI.Instance.DebugTab(1); (Gear, Rarity) tuple = loot.ClientVault.Owned.Keys.FirstOrDefault(((Gear, Rarity) k) => !GearCatalog.IsWeapon(k.Item1)); VaultUI.Instance.DebugSelect(tuple.Item1, tuple.Item2); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("vault_ui_gear"); yield return (object)new WaitForSecondsRealtime(0.6f); VaultUI.Instance.Close(); int food0 = C("stall_food"); InstanceFinder.ClientManager.Broadcast(new NetRequest { Food = true }, (Channel)0); yield return (object)new WaitForSecondsRealtime(1.5f); List list = Object.FindObjectsOfType().Where(delegate(Item i) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)i) && ((NetworkBehaviour)i).IsSpawned && Object.op_Implicit((Object)(object)i.Creature) && i.Creature.IsDead) { Vector3 val4 = ((Component)i).transform.position - island.MarketPos; return ((Vector3)(ref val4)).sqrMagnitude < 16f; } return false; }).ToList(); Note(string.Format("stall food: bought {0}, dead fish at the stall {1}, cookness {2}", C("stall_food") - food0, list.Count, string.Join(", ", list.Select((Item g) => g.Cookness.ToString("0.0"))))); Vector3 anvil = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.2f, 1.6f, 0.45f); Vector3 forge = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(0.6f, 1.3000001f, 2.6f); yield return View(forge, anvil, null, 12f); int common0 = loot.Vault.Count(Gear.Laser, Rarity.Common); for (int num3 = 0; num3 < 3; num3++) { WeaponItems.ServerSpawn(Gear.Laser, Rarity.Common, anvil + Vector3.up * (0.3f + 0.3f * (float)num3)); } yield return (object)new WaitForSecondsRealtime(0.55f); FortressPlugin.Shot("anvil_swallow"); yield return (object)new WaitForSecondsRealtime(2f); Note($"anvil: common lasers {common0} -> {loot.Vault.Count(Gear.Laser, Rarity.Common)} (expect +3)"); VaultUI.Instance.Open(VaultUI.Desk.Smith); VaultUI.Instance.DebugSelect(Gear.Laser, Rarity.Common); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("smith_bench"); yield return (object)new WaitForSecondsRealtime(0.6f); int rareB = loot.Vault.Count(Gear.Laser, Rarity.Rare); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Merge, Gear = Gear.Laser, Rarity = Rarity.Common }); yield return (object)new WaitForSecondsRealtime(1.2f); Note($"bench: rare lasers {rareB} -> {loot.Vault.Count(Gear.Laser, Rarity.Rare)} (expect +1)"); FortressPlugin.Shot("smith_bench_after"); yield return (object)new WaitForSecondsRealtime(0.6f); VaultUI.Instance.Close(); Vector3 eye2 = island.CounterPos + new Vector3(-2.6f, 1.5f, -1.4f); yield return View(eye2, island.CounterPos + Vector3.up, null, 15f); DeadFish(island.CounterPos + Vector3.up * 2.6f); yield return (object)new WaitForSecondsRealtime(0.85f); FortressPlugin.Shot("crate_swallow"); yield return (object)new WaitForSecondsRealtime(1.5f); Note(string.Format("crate: sold {0}", C("crate_sold_item"))); LighthouseDoor door = Object.FindObjectOfType(); Vector3 lighthousePos = island.LighthousePos; yield return View(lighthousePos + new Vector3(0.6f, 1.4000001f, -3.4f), lighthousePos + Vector3.up * 1.6f, "lighthouse_door", 2f); Transform gate = (Object.op_Implicit((Object)(object)door) ? ((Component)door).transform.parent.Find("Gate") : null); float gateShut = (Object.op_Implicit((Object)(object)gate) ? gate.localPosition.y : (-1f)); Transform lid = (Object.op_Implicit((Object)(object)door) ? ((Component)door).transform.parent.Find("ClamHinge") : null); if (Object.op_Implicit((Object)(object)door)) { ((Interactable)door).Interact(me); } yield return (object)new WaitForSecondsRealtime(1.6f); Note(string.Format("E at the door: counting {0}, countdown {1}, pulled {2}", island.Starting, Siege.Instance.View.ReadyCountdown, C("gate_pulled"))); FortressPlugin.Shot("gate_countdown"); yield return (object)new WaitForSecondsRealtime(0.4f); if (Object.op_Implicit((Object)(object)door)) { ((Interactable)door).Interact(me); } yield return (object)new WaitForSecondsRealtime(1.2f); Note(string.Format("E again: counting {0} (expect False), cancelled {1}, round {2}", island.Starting, C("gate_cancelled"), plugin.Running)); if (Object.op_Implicit((Object)(object)door)) { ((Interactable)door).Interact(me); } yield return Until(() => plugin.Running, 10f, "the round to start"); yield return (object)new WaitForSecondsRealtime(1.5f); yield return (object)new WaitForSecondsRealtime(3f); Note($"round started from the door: {plugin.Running}; gate {gateShut:0.00} -> {(Object.op_Implicit((Object)(object)gate) ? gate.localPosition.y : (-1f)):0.00} (sunk), clam open {(Object.op_Implicit((Object)(object)lid) ? (360f - lid.localEulerAngles.x) : (-1f)):0} deg"); FortressPlugin.Shot("gate_open"); yield return (object)new WaitForSecondsRealtime(0.4f); Siege.Instance.ServerAddCoins(Siege.Money(2000)); yield return View(forge, anvil, null, 12f); VaultUI.Instance.Open(VaultUI.Desk.Smith); VaultUI.Instance.DebugTab(2); VaultUI.Instance.DebugSelect(Gear.Boomerang, Rarity.Common); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot("smith_shop"); yield return (object)new WaitForSecondsRealtime(0.5f); int bought0 = C("weapon_bought"); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Buy, Gear = Gear.Boomerang }); yield return (object)new WaitForSecondsRealtime(1f); VaultUI.Instance.Close(); Gear g; Rarity r; Item val3 = ((IEnumerable)Object.FindObjectsOfType()).FirstOrDefault((Func)((Item i) => Object.op_Implicit((Object)(object)i) && ((NetworkBehaviour)i).IsSpawned && WeaponItems.Is(i, out g, out r) && g == Gear.Boomerang && r == Rarity.Common)); Note(string.Format("shop: bought {0}, a common boomerang {1}", C("weapon_bought") - bought0, (!Object.op_Implicit((Object)(object)val3)) ? "NOWHERE" : (((Object)(object)val3.Holder == (Object)(object)me || val3.IsInInventory) ? "in my hands" : "on the ground"))); if (Object.op_Implicit((Object)(object)val3)) { if (!((Object)(object)val3.Holder == (Object)(object)me) && !val3.IsInInventory) { val3.PickUp(me, true, true); } yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("weapon_hud"); yield return (object)new WaitForSecondsRealtime(0.5f); } plugin.DebugStopRound(); yield return Until(() => !plugin.Running, 10f, "round over"); yield return (object)new WaitForSecondsRealtime(1f); FortressIsland.Instance.CloseResults(); yield return (object)new WaitForSecondsRealtime(2.5f); Note($"after the round: gate at {(Object.op_Implicit((Object)(object)gate) ? gate.localPosition.y : (-1f)):0.00} (rising back to {gateShut:0.00})"); FortressPlugin.Shot("gate_shut"); yield return (object)new WaitForSecondsRealtime(0.4f); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } Item DeadFish(Vector3 at) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) Item val4 = Object.Instantiate(fishKind, at, Quaternion.identity, Server.Instance.DynamicObjectsHolder); val4.Creature.ServerKillOnSpawn(); ((NetworkBehaviour)Server.Instance).Spawn(((Component)val4).gameObject, (NetworkConnection)null, default(Scene)); return val4; } int Lying() { return Object.FindObjectsOfType().Count((Item i) => Object.op_Implicit((Object)(object)i) && ((NetworkBehaviour)i).IsSpawned && !i.IsDestroying && !Object.op_Implicit((Object)(object)i.Holder) && !i.IsInInventory && (!Object.op_Implicit((Object)(object)i.Creature) || i.Creature.IsDead) && island.OnIsland(((Component)i).transform.position, 51f)); } IEnumerator View(Vector3 val4, Vector3 at, string shot, float pitch, float wait = 1.2f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) me.LocalTeleport(val4, YawTo(val4, at), true); yield return null; Aim(YawTo(val4, at), pitch); yield return (object)new WaitForSecondsRealtime(wait); if (shot != null) { FortressPlugin.Shot(shot); yield return (object)new WaitForSecondsRealtime(0.4f); } } } private IEnumerator RevealScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Note("sounds: " + string.Join(", ", new string[7] { "BossFightIntro", "BossFightOutro", "QuestFinished", "WhaleLanding_0", "WhaleLanding_2", "CasinoWinEpic", "Outro" }.Select((string n) => n + (Object.op_Implicit((Object)(object)AudioManager.GetClip(n)) ? " ok" : " MISSING")))); yield return (object)new WaitForSecondsRealtime(1f); Transform lighthouse = Siege.Instance.Lighthouse; AutoTest autoTest = this; object obj; if (!Object.op_Implicit((Object)(object)lighthouse)) { obj = "none"; } else { Vector3 val = lighthouse.position - island.Center; obj = ((Vector3)(ref val)).ToString("F2"); } autoTest.Note("lighthouse between rounds: " + (string?)obj + " (expect about (0, 1.4, 0))"); Note($"player {Vector3.Distance(me.Transform.position, island.Center):0} m from the island; seen before {Reveal.Seen.Value}"); Reveal.Instance.Replay(); yield return Until(() => Reveal.Playing, 5f, "the entrance to start"); yield return (object)new WaitForSecondsRealtime(3.2f); Note(string.Format("playing: camera {0}, own camera on {1}, inputs blocked {2}, island {3:0.0} m under", Object.op_Implicit((Object)(object)GameInfo.CurCamera) ? ((Object)GameInfo.CurCamera).name : "none", ((Behaviour)me.Camera.Cam).enabled, me.BlockInputs, island.Sink)); yield return Until(() => !Reveal.Playing, 30f, "the entrance to end"); yield return (object)new WaitForSecondsRealtime(1.5f); Note($"entrance done: own camera back {(Object)(object)GameInfo.CurCamera == (Object)(object)me.Camera.Cam && ((Behaviour)me.Camera.Cam).enabled}, inputs blocked {me.BlockInputs}, island in place {island.Sink == 0f}, " + string.Format("started {0} done {1}, seen {2}", C("reveal_started"), C("reveal_done"), Reveal.Seen.Value)); FortressPlugin.Shot("reveal_after"); yield return (object)new WaitForSecondsRealtime(0.6f); Reveal.Instance.Replay(); yield return (object)new WaitForSecondsRealtime(4f); Reveal.Instance.Skip(); yield return Until(() => !Reveal.Playing, 6f, "the skipped entrance to end"); yield return (object)new WaitForSecondsRealtime(1f); Note($"skipped: playing {Reveal.Playing}, island in place {island.Sink == 0f}, own camera back {(Object)(object)GameInfo.CurCamera == (Object)(object)me.Camera.Cam}, inputs blocked {me.BlockInputs}"); Loot.Instance.ServerWin("Tester、Owen"); yield return (object)new WaitForSecondsRealtime(1.5f); Note(string.Format("wins on the save {0}: {1}", Loot.Instance.ClientVault.Wins.Count, string.Join(" / ", Loot.Instance.ClientVault.Wins.Select(((string date, string team) w) => w.date + " " + w.team)))); RecordBoard board = Object.FindObjectOfType(); if (Object.op_Implicit((Object)(object)board)) { Vector3 eye = ((Component)board).transform.position - ((Component)board).transform.forward * 2.6f + Vector3.up * 1.5f; yield return View(eye, ((Component)board).transform.position + Vector3.up * 1.45f, "record_board", 4f); TextMeshProUGUI componentInChildren = ((Component)board).GetComponentInChildren(true); Note(Object.op_Implicit((Object)(object)componentInChildren) ? (string.Format("board text: chars {0}, length {1}, font {2}, shader {3}, ", ((TMP_Text)componentInChildren).textInfo.characterCount, ((TMP_Text)componentInChildren).text.Length, Object.op_Implicit((Object)(object)((TMP_Text)componentInChildren).font) ? ((Object)((TMP_Text)componentInChildren).font).name : "none", Object.op_Implicit((Object)(object)((Graphic)componentInChildren).materialForRendering) ? ((Object)((Graphic)componentInChildren).materialForRendering.shader).name : "none") + string.Format("colour {0}, active {1}, culled {2}, canvas {3}, world bounds {4} scale {5:0.0000}", ((Graphic)componentInChildren).color, ((Behaviour)componentInChildren).isActiveAndEnabled, componentInChildren.canvasRenderer.cull, Object.op_Implicit((Object)(object)((Graphic)componentInChildren).canvas) ? (((object)((Graphic)componentInChildren).canvas.renderMode/*cast due to .constrained prefix*/).ToString() + " layer " + ((Component)((Graphic)componentInChildren).canvas).gameObject.layer) : "none", ((Transform)((TMP_Text)componentInChildren).rectTransform).position, ((Transform)((TMP_Text)componentInChildren).rectTransform).lossyScale.x)) : "board text: NONE"); } else { Note("NO record board"); } Vector3 lighthousePos = island.LighthousePos; yield return View(lighthousePos + new Vector3(2f, 1.7f, -11f), lighthousePos + Vector3.up * 3f, "lighthouse_gold", -12f); me.LocalTeleport(island.Center + FortressIsland.ReadyLocal + Vector3.up * 1.3000001f, 0f, true); yield return (object)new WaitForSecondsRealtime(1f); Reveal.Instance.Victory(island.LighthousePos); yield return Until(() => Reveal.Playing, 5f, "the victory camera to start"); yield return Until(() => !Reveal.Playing, 20f, "the victory camera to end"); yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("victory camera done: ran {0}, own camera back {1}, inputs blocked {2}", C("victory_camera"), (Object)(object)GameInfo.CurCamera == (Object)(object)me.Camera.Cam, me.BlockInputs)); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } IEnumerator View(Vector3 val2, Vector3 at, string shot, float pitch) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) me.LocalTeleport(val2, YawTo(val2, at), true); yield return null; Aim(YawTo(val2, at), pitch); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot(shot); yield return (object)new WaitForSecondsRealtime(0.5f); } } private IEnumerator VillageScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Tips.Show.Value = false; Player me = Player.LocalPlayer; Loot loot = Loot.Instance; ClearLooseWeapons(); yield return (object)new WaitForSecondsRealtime(1f); Note("keepers: " + string.Join(", ", island.Keepers.Select((Keeper k) => $"{k.Role} at {((Component)k).transform.position - island.Center:F1}"))); Note($"stations: market {island.MarketPos - island.Center:F1}, smithy {island.SmithyPos - island.Center:F1}, vault {island.VaultPos - island.Center:F1}, crate {island.CounterPos - island.Center:F1}"); Vector3 center = island.Center; yield return View(center + new Vector3(0f, 2.3000002f, -6.5f), center + new Vector3(0f, 0f, -16f), "village_overview", 12f); yield return View(Front(island.MarketPos, -90f, 5f), island.MarketPos + Vector3.up * 1.2f, "village_market"); yield return View(Front(island.SmithyPos, -90f, 5.5f), island.SmithyPos + Vector3.up * 1.4f, "village_smithy"); yield return View(Front(island.VaultPos, 90f, 5f) + Quaternion.Euler(0f, 90f, 0f) * new Vector3(1.5f, 0f, 0f), island.VaultPos + Vector3.up * 1.2f, "village_vault"); Keeper lk = island.Keepers.FirstOrDefault((Keeper k) => k.Role == "Lighthouse"); if (Object.op_Implicit((Object)(object)lk)) { yield return View(((Component)lk).transform.position + new Vector3(1.2f, 0.3f, -3.2f), ((Component)lk).transform.position + Vector3.up * 1.2f, "village_lighthouse_keeper", 5f); } Keeper smith = island.Keepers.FirstOrDefault((Keeper k) => k.Role == "Smith"); if (Object.op_Implicit((Object)(object)smith)) { Vector3 eye = Front(((Component)smith).transform.position, -90f, 2.2f); yield return View(eye, ((Component)smith).transform.position + Vector3.up * 1.3f, "village_smith_hover", 6f); object obj = AccessTools.Field(((object)me.Holding).GetType(), "_interactable")?.GetValue(me.Holding); Note("looking at the smith: hovering " + ((obj != null) ? obj.GetType().Name : "nothing")); smith.Said(); yield return (object)new WaitForSecondsRealtime(1f); Note($"smith desk open {VaultUI.IsOpen} ({VaultUI.Instance.CurrentDesk})"); FortressPlugin.Shot("village_smith_ui_empty"); yield return (object)new WaitForSecondsRealtime(0.6f); } int before = loot.Vault.Count(Gear.Laser, Rarity.Common); int rareBefore = loot.Vault.Count(Gear.Laser, Rarity.Rare); Vector3 anvil = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.2f, 1.6f, 0.45f); for (int i = 0; i < 3; i++) { WeaponItems.ServerSpawn(Gear.Laser, Rarity.Common, anvil + Vector3.up * 0.3f * (float)i); yield return (object)new WaitForSecondsRealtime(0.3f); } yield return Until(() => loot.Vault.Count(Gear.Laser, Rarity.Common) >= before + 3, 6f, "lasers on the rack"); Note($"rack: common lasers {before} -> {loot.Vault.Count(Gear.Laser, Rarity.Common)} (expect +3)"); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Merge, Gear = Gear.Laser, Rarity = Rarity.Common }); Note($"forged: rare lasers {rareBefore} -> {loot.Vault.Count(Gear.Laser, Rarity.Rare)} (expect +1), common {loot.Vault.Count(Gear.Laser, Rarity.Common)}"); VaultUI.Instance.DebugSelect(Gear.Laser, Rarity.Rare); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("village_smith_ui"); yield return (object)new WaitForSecondsRealtime(0.6f); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Take, Gear = Gear.Laser, Rarity = Rarity.Rare }); yield return (object)new WaitForSecondsRealtime(1.5f); Gear g; Rarity r; List list = (from x in Object.FindObjectsOfType() where Object.op_Implicit((Object)(object)x) && ((NetworkBehaviour)x).IsSpawned && WeaponItems.Is(x, out g, out r) && g == Gear.Laser && r == Rarity.Rare select x).ToList(); Note(string.Format("taken: rare lasers on the rack {0}, in the world {1} at {2}", loot.Vault.Count(Gear.Laser, Rarity.Rare), list.Count, string.Join(" ", list.Select(delegate(Item x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = ((Component)x).transform.position - island.SmithyCounter; return ((Vector3)(ref val2)).magnitude.ToString("0.0") + "m from the counter"; })))); VaultUI.Instance.Close(); if (list.Count > 0) { list[0].PickUp(me, true, true); yield return (object)new WaitForSecondsRealtime(1f); Note("holding " + (Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing")); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Deposit, Gear = Gear.Laser, Rarity = Rarity.Rare }); yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("racked from the hand: rare lasers on the rack {0}, holding {1}", loot.Vault.Count(Gear.Laser, Rarity.Rare), Object.op_Implicit((Object)(object)me.Holding.HeldItem) ? me.Holding.HeldItem.GetName() : "nothing")); } Vector3 eye2 = island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-1.2f, 1.22f, 0.9f); yield return View(eye2, island.SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(-0.75f, 1.6f, -1.3f), "village_rack", -5f); Keeper fishmonger = island.Keepers.FirstOrDefault((Keeper k) => k.Role == "Market"); if (Object.op_Implicit((Object)(object)fishmonger)) { yield return View(Front(((Component)fishmonger).transform.position, -90f, 2.2f), ((Component)fishmonger).transform.position + Vector3.up * 1.3f, "village_market_hover", 6f); fishmonger.Said(); yield return (object)new WaitForSecondsRealtime(1f); Note($"stall open {StallMenu.IsOpen}"); FortressPlugin.Shot("village_stall"); yield return (object)new WaitForSecondsRealtime(0.6f); StallMenu.Instance.Close(); } if (Object.op_Implicit((Object)(object)lk)) { lk.Said(); yield return (object)new WaitForSecondsRealtime(0.8f); Note($"help open {Tips.Instance.HelpOpen}"); FortressPlugin.Shot("village_help"); yield return (object)new WaitForSecondsRealtime(0.6f); Tips.Instance.ToggleHelp(); } me.LocalTeleport(island.Center + new Vector3(3f, -1f, 9f), 0f, true); yield return (object)new WaitForSecondsRealtime(2f); Note(string.Format("under the island: now at {0:F1}, rescued {1}", me.Transform.position - island.Center, C("rescued_from_below"))); PlayerManager.ToggleGodMode(); me.Vitals.TakeDamage(9999, me.Transform.position, Vector3.zero, true); yield return Until(() => !PlayerManager.AlivePlayers.Contains(me), 5f, "death"); yield return (object)new WaitForSecondsRealtime(2f); AccessTools.Method(typeof(PlayerDying), "LocalRespawn", (Type[])null, (Type[])null).Invoke(me.Dying, null); yield return Until(() => PlayerManager.AlivePlayers.Contains(me), 15f, "respawn"); yield return (object)new WaitForSecondsRealtime(3f); Vector3 back = me.Transform.position; RaycastHit val = default(RaycastHit); bool flag = Physics.Raycast(back + Vector3.up * 0.3f, Vector3.down, ref val, 3f, LayerMask.op_Implicit(GameInfo.LevelLayer)); Note(string.Format("respawned {0:F1} m from the spot, at y {1:F1}, ground {2} below, rescued {3}", Vector3.Distance(back, island.RespawnPos), back.y - island.Center.y, flag ? (((RaycastHit)(ref val)).point.y - island.Center.y).ToString("F1") : "none", C("rescued_from_below"))); IEnumerable values = from cc in ((Component)me).GetComponentsInChildren() select $"{PathOf(((Component)cc).transform)} center {cc.center.y:F2} height {cc.height:F2} r {cc.radius:F2} scale {((Component)cc).transform.lossyScale.y:F2} at {((Component)cc).transform.position.y - back.y:F2}"; Note("player body: " + string.Join("; ", values)); FortressPlugin.Shot("village_respawn"); yield return (object)new WaitForSecondsRealtime(0.6f); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } static Vector3 Front(Vector3 pos, float yaw, float d) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) return pos + Quaternion.Euler(0f, yaw, 0f) * new Vector3(0f, 1.1f, d); } IEnumerator View(Vector3 val2, Vector3 at, string shot, float pitch = 8f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) me.LocalTeleport(val2, YawTo(val2, at), true); yield return null; Aim(YawTo(val2, at), pitch); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot(shot); yield return (object)new WaitForSecondsRealtime(0.4f); } } private IEnumerator NpcScenario() { FortressIsland island = FortressIsland.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); Tips.Show.Value = false; Player localPlayer = Player.LocalPlayer; Scene scene; foreach (IGrouping item in (from val13 in Resources.FindObjectsOfTypeAll() where Object.op_Implicit((Object)(object)val13) && Object.op_Implicit((Object)(object)val13.sharedMesh) && ((Object)val13.sharedMesh).name == "CharacterHead" group val13 by ((Object)((Component)val13).transform.root).name).Take(30)) { SkinnedMeshRenderer val = item.First(); AutoTest autoTest = this; object[] obj = new object[7] { PathOf(((Component)val).transform), item.Count(), null, null, null, null, null }; scene = ((Component)val).gameObject.scene; object obj2; if (!((Scene)(ref scene)).IsValid()) { obj2 = "-"; } else { scene = ((Component)val).gameObject.scene; obj2 = ((Scene)(ref scene)).name; } obj[2] = obj2; obj[3] = ((Component)val).gameObject.activeInHierarchy; obj[4] = val.bones.Length; obj[5] = string.Join(",", val.bones.Select((Transform b) => (!Object.op_Implicit((Object)(object)b)) ? "null" : ((Object)b).name)); IEnumerable values; if (!Object.op_Implicit((Object)(object)((Component)val).transform.parent)) { IEnumerable enumerable = new string[0]; values = enumerable; } else { values = from Transform t in (IEnumerable)((Component)val).transform.parent select ((Object)t).name; } obj[6] = string.Join(",", values); autoTest.Note(string.Format("rig: {0} x{1} scene {2} active {3} bones {4} [{5}] siblings [{6}]", obj)); } foreach (DeadPlayer item2 in Resources.FindObjectsOfTypeAll().Take(5)) { AutoTest autoTest2 = this; string[] obj3 = new string[7] { "dead player ", PathOf(((Component)item2).transform), " scene ", null, null, null, null }; scene = ((Component)item2).gameObject.scene; obj3[3] = (((Scene)(ref scene)).IsValid() ? "yes" : "prefab"); obj3[4] = " comps ["; obj3[5] = string.Join(",", (from val13 in ((Component)item2).GetComponentsInChildren(true) select ((object)val13).GetType().Name).Distinct()); obj3[6] = "]"; autoTest2.Note(string.Concat(obj3)); } foreach (NPC item3 in Resources.FindObjectsOfTypeAll().Where(delegate(NPC n) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)n)) { Scene scene2 = ((Component)n).gameObject.scene; return ((Scene)(ref scene2)).IsValid(); } return false; })) { Note(string.Format("npc {0} id {1} at {2} active {3} comps [{4}]", ((Object)item3).name, item3.ID, ((Component)item3).transform.position, ((Component)item3).gameObject.activeInHierarchy, string.Join(",", from val13 in ((Component)item3).GetComponents() select ((object)val13).GetType().Name))); SkinnedMeshRenderer[] componentsInChildren = ((Component)item3).GetComponentsInChildren(true); foreach (SkinnedMeshRenderer r in componentsInChildren) { Note(" " + Smr(r)); } Note(" children [" + string.Join(",", from Transform t in (IEnumerable)((Component)item3).transform select ((Object)t).name) + "]"); } Component val2 = ((IEnumerable)((Component)localPlayer).GetComponentsInChildren(true)).FirstOrDefault((Func)((Component val13) => Object.op_Implicit((Object)(object)val13) && ((object)val13).GetType().Name == "PlayerSkin")); Note("player skin component: " + (Object.op_Implicit((Object)(object)val2) ? (((object)val2).GetType().FullName + " on " + PathOf(val2.transform)) : "none")); List list = new List(); if (Object.op_Implicit((Object)(object)val2)) { foreach (FieldInfo item4 in from f in ((object)val2).GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic) where f.FieldType == typeof(SkinnedMeshRenderer) select f) { object? value = item4.GetValue(val2); SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)((value is SkinnedMeshRenderer) ? value : null); Note(" " + item4.Name + ": " + Smr(val3)); if (Object.op_Implicit((Object)(object)val3) && !item4.Name.StartsWith("_local")) { list.Add(val3); } } } SkinManager sm = default(SkinManager); ref SkinManager reference = ref sm; object? value2 = AccessTools.Field(typeof(SkinManager), "_instance").GetValue(null); reference = (SkinManager)((value2 is SkinManager) ? value2 : null); if (Object.op_Implicit((Object)(object)sm)) { foreach (FieldInfo item5 in from f in typeof(SkinManager).GetFields(BindingFlags.Instance | BindingFlags.NonPublic) where f.FieldType == typeof(Clothes) select f) { object? value3 = item5.GetValue(sm); Clothes val4 = (Clothes)((value3 is Clothes) ? value3 : null); Note("clothes " + item5.Name + ": hat " + ((Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.HatMesh)) ? ((Object)val4.HatMesh).name : "-") + ", outfit " + ((Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.OutfitMesh)) ? ((Object)val4.OutfitMesh).name : "-") + ", accessory " + ((Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.AccessoryMesh)) ? ((Object)val4.AccessoryMesh).name : "-")); } } foreach (Component item6 in Resources.FindObjectsOfTypeAll().Where(delegate(Component val13) { //IL_0025: 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) if (Object.op_Implicit((Object)(object)val13) && ((object)val13).GetType().Name == "PlayerSkin") { Scene scene2 = val13.gameObject.scene; return !((Scene)(ref scene2)).IsValid(); } return false; })) { Note("prefab skin on " + PathOf(item6.transform)); foreach (FieldInfo item7 in from f in ((object)item6).GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic) where f.FieldType == typeof(SkinnedMeshRenderer) select f) { AutoTest autoTest3 = this; string name = item7.Name; object? value4 = item7.GetValue(item6); autoTest3.Note(" " + name + ": " + Smr((SkinnedMeshRenderer)((value4 is SkinnedMeshRenderer) ? value4 : null))); } } NPC val5 = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)delegate(NPC n) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)n)) { Scene scene2 = ((Component)n).gameObject.scene; return ((Scene)(ref scene2)).IsValid(); } return false; }); if (!Object.op_Implicit((Object)(object)val5)) { yield break; } FieldInfo fieldInfo = AccessTools.Field(typeof(NPC), "_skinColor"); Vector3 skinColor = (Vector3)fieldInfo.GetValue(val5); Note($"cloning {((Object)val5).name}, skin {skinColor}"); GameObject val6 = new GameObject("NpcProbeHolder"); val6.SetActive(false); GameObject copy = Object.Instantiate(((Component)val5).gameObject, val6.transform); foreach (Transform item8 in ((IEnumerable)copy.transform).Cast().ToList()) { if (((Object)item8).name != "Character" && !((Object)item8).name.StartsWith("Hand")) { Object.DestroyImmediate((Object)(object)((Component)item8).gameObject); } } Component[] componentsInChildren2 = copy.GetComponentsInChildren(true); foreach (Component val7 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val7) && !(val7 is Transform) && !(val7 is Renderer) && !(val7 is MeshFilter)) { Object.DestroyImmediate((Object)(object)val7); } } Note("copy keeps [" + string.Join(",", (from val13 in copy.GetComponentsInChildren(true) select ((object)val13).GetType().Name).Distinct()) + "], tree [" + string.Join(",", from t in copy.GetComponentsInChildren(true) select ((Object)t).name) + "]"); Vector3 val8 = island.VaultPos + new Vector3(3.5f, 0f, -1.5f); RaycastHit val9 = default(RaycastHit); if (Physics.Raycast(val8 + Vector3.up * 10f, Vector3.down, ref val9, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { val8 = ((RaycastHit)(ref val9)).point; } copy.transform.SetParent((Transform)null, false); copy.transform.SetPositionAndRotation(val8, Quaternion.Euler(0f, 180f, 0f)); Object.Destroy((Object)(object)val6); Bounds val10 = default(Bounds); ((Bounds)(ref val10))..ctor(val8, Vector3.zero); Renderer[] componentsInChildren3 = copy.GetComponentsInChildren(); foreach (Renderer val11 in componentsInChildren3) { ((Bounds)(ref val10)).Encapsulate(val11.bounds); } Note($"copy at {val8}, bounds {((Bounds)(ref val10)).center} size {((Bounds)(ref val10)).size}, source scale {((Component)val5).transform.lossyScale}, source rot {((Component)val5).transform.eulerAngles}"); Vector3 val12 = val8 + new Vector3(0f, 0f, -2.4f); localPlayer.LocalTeleport(val12, 0f, true); yield return null; Aim(0f, 4f); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("npc_copy_plain"); Vector3[] skins = (Vector3[])(object)new Vector3[3] { skinColor, new Vector3(0.55f, 0.36f, 0.25f), new Vector3(0.95f, 0.78f, 0.62f) }; int k = 0; string[] array = new string[7] { "_gunStoreClerc", "_kioskLady", "_military", "_scientist", "_grillmaster", "_swampMan", "_storeGrandma" }; foreach (string c in array) { Dress(c, skins[k++ % skins.Length]); yield return (object)new WaitForSecondsRealtime(0.6f); FortressPlugin.Shot("npc_copy" + c); } void Dress(string clothes, Vector3 skin) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00a7: 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_00b1: Unknown result type (might be due to invalid IL or missing references) object? value5 = AccessTools.Field(typeof(SkinManager), clothes).GetValue(sm); Clothes val13 = (Clothes)((value5 is Clothes) ? value5 : null); SkinnedMeshRenderer[] componentsInChildren4 = copy.GetComponentsInChildren(true); foreach (SkinnedMeshRenderer val14 in componentsInChildren4) { if (((Object)val14).name == "Outfit") { val14.sharedMesh = val13.OutfitMesh; } if (((Object)val14).name == "Hat") { val14.sharedMesh = val13.HatMesh; } if (((Object)val14).name == "Accessory") { val14.sharedMesh = val13.AccessoryMesh; } ShaderManager.SetPlayerColors((Renderer)(object)val14, skin, default(Vector3), default(Vector3), default(Vector3)); } } static string Smr(SkinnedMeshRenderer val13) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)val13)) { return "-"; } return string.Format("{0} mesh {1} mat {2} bones {3} root {4} layer {5} shadows {6} on {7}", PathOf(((Component)val13).transform), Object.op_Implicit((Object)(object)val13.sharedMesh) ? ((Object)val13.sharedMesh).name : "-", Object.op_Implicit((Object)(object)((Renderer)val13).sharedMaterial) ? (((Object)((Renderer)val13).sharedMaterial).name + "/" + ((Object)((Renderer)val13).sharedMaterial.shader).name) : "-", val13.bones.Length, Object.op_Implicit((Object)(object)val13.rootBone) ? ((Object)val13.rootBone).name : "-", ((Component)val13).gameObject.layer, ((Renderer)val13).shadowCastingMode, ((Renderer)val13).enabled && ((Component)val13).gameObject.activeInHierarchy); } } private IEnumerator NewFoesScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); yield return Until(() => plugin.InBuildTime, 5f, "build time"); plugin.DebugExtendBuild(300f); Siege.Instance.ServerAddCoins(Siege.Money(500)); Vector3 row = center + new Vector3(0f, FortressIsland.CoreLocal.y + 0.3f, 4.5f); EnemyKind[] array = new EnemyKind[6] { EnemyKind.Thief, EnemyKind.Shield, EnemyKind.Digger, EnemyKind.Healer, EnemyKind.Splitter, EnemyKind.Mini }; List shown = new List(); for (int num = 0; num < array.Length; num++) { shown.Add(plugin.DebugShowcase(array[num], elite: false, row + new Vector3(((float)num - 2.5f) * 1.6f, 0f, 0f), 180f)); } yield return (object)new WaitForSecondsRealtime(0.8f); yield return Look(row + new Vector3(0f, 0.3f, 3.8f), 180f, "foes_gallery", 0.6f); foreach (Creature item in shown) { if (Object.op_Implicit((Object)(object)item)) { item.ServerChangeHp(1000000); } } me.LocalTeleport(center + new Vector3(0f, 2f, 0f), 0f, true); Vector3 row2 = center + new Vector3(0f, FortressIsland.CoreLocal.y + 0.3f, -9f); List dyed = new List(); EnemyKind[] array2 = new EnemyKind[4] { EnemyKind.Runner, EnemyKind.Thief, EnemyKind.Healer, EnemyKind.Splitter }; for (int num2 = 0; num2 < array2.Length; num2++) { dyed.Add(plugin.DebugShowcase(array2[num2], elite: false, row2 + new Vector3(((float)num2 - 1.5f) * 1.3f, 0f, 0f), 0f)); } yield return (object)new WaitForSecondsRealtime(0.8f); yield return Look(row2 + new Vector3(0f, 0.4f, 3f), 180f, "foes_dyes", 0.6f); foreach (Creature item2 in dyed) { if (Object.op_Implicit((Object)(object)item2)) { item2.ServerChangeHp(1000000); } } int coins0 = Siege.Instance.ServerCoins; plugin.ServerSpawnMinion(EnemyKind.Thief, island.CounterPos + new Vector3(4f, 2f, 3f)); yield return Until(() => C("thief_stole") > 0, 15f, "thief steals"); Note($"thief stole: coins {coins0} -> {Siege.Instance.ServerCoins}"); yield return Until(() => C("thief_escaped") > 0, 25f, "thief escapes"); Note(string.Format("thief escaped {0}", C("thief_escaped"))); Creature runner = plugin.ServerSpawnMinion(EnemyKind.Runner, Gap(1, 12f)); plugin.ServerSpawnMinion(EnemyKind.Healer, Gap(1, 12f) + Vector3.right * 1.5f); yield return (object)new WaitForSecondsRealtime(0.5f); if (Object.op_Implicit((Object)(object)runner)) { runner.ServerChangeHp(runner._hp.Value * 7 / 10); } int hurt = (Object.op_Implicit((Object)(object)runner) ? runner._hp.Value : (-1)); yield return Until(() => C("healed") > 0, 8f, "healer heals"); Note(string.Format("healer: runner hp {0} -> {1}, heals {2}", hurt, Object.op_Implicit((Object)(object)runner) ? runner._hp.Value : (-1), C("healed"))); Creature split = plugin.ServerSpawnMinion(EnemyKind.Splitter, Gap(2, 14f)); yield return (object)new WaitForSecondsRealtime(1f); if (Object.op_Implicit((Object)(object)split)) { split.ServerChangeHp(1000000); } yield return (object)new WaitForSecondsRealtime(1f); Note(string.Format("splitter: minis spawned {0}", C("spawned_Mini"))); float num3 = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num3), 0f, Mathf.Sin(num3)); Vector3 side = Vector3.Cross(Vector3.up, gd); for (int num4 = -2; num4 <= 2; num4++) { WallAt(center + gd * 15f + side * ((float)num4 * 3f) + Vector3.up * 1.2f, gd); } Creature digger = plugin.ServerSpawnMinion(EnemyKind.Digger, Gap(0, 21f)); yield return Until(() => C("digger_burrowed") > 0, 20f, "digger burrows"); yield return (object)new WaitForSecondsRealtime(3f); Note(string.Format("digger: burrowed {0}, now {1} m from the lighthouse (walls at 15 m)", C("digger_burrowed"), Object.op_Implicit((Object)(object)digger) ? Vector3.Distance(((Component)digger).transform.position, center).ToString("F1") : "dead")); TurretAt(PieceType.Gun, center + gd * 10f + Vector3.up * 1.2f); plugin.ServerSpawnMinion(EnemyKind.Shield, Gap(0, 22f) + side * 2f); yield return Until(() => C("shield_blocks") > 5, 20f, "shield blocks"); Note(string.Format("shield: blocked {0} hits", C("shield_blocks"))); plugin.DebugKillAll(); yield return (object)new WaitForSecondsRealtime(1f); static int C(string k) { if (!Counters.TryGetValue(k, out var value)) { return 0; } return value; } Vector3 Gap(int i, float r) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0044: Unknown result type (might be due to invalid IL or missing references) float num5 = FortressIsland.GapAngles[i] * (MathF.PI / 180f); return center + new Vector3(Mathf.Cos(num5), 0f, Mathf.Sin(num5)) * r + Vector3.up * 3f; } } private IEnumerator ConstructScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Construction con = Construction.Instance; BuildSystem bs = BuildSystem.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); Siege.Instance.ServerAddCoins(Siege.Money(2000)); float c = 3f; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 gd = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 side = Vector3.Cross(Vector3.up, gd); Vector3 val = Cell(center + gd * 5f + Vector3.up * 2f) + Vector3.up * 0.5f; me.LocalTeleport(val, YawTo(val, center + gd * 11f), true); yield return (object)new WaitForSecondsRealtime(1f); Vector3 wallPos = new Vector3((Mathf.Floor((center + gd * 14f).x / c) + 0.5f) * c, Mathf.Floor((center.y + 1.45f + 0.25f) / c) * c + c * 0.5f, Mathf.Floor((center + gd * 14f).z / c) * c); int coins = Siege.Instance.ServerCoins; float tw = 0f; yield return Hold(PieceType.Wall, wallPos, teammate: false, null, delegate(float x) { tw = x; }); Note($"wall alone: {tw:F2}s (expect ~{Construction.BuildTime(PieceType.Wall):F1}), cost {coins - Siege.Instance.ServerCoins}"); Vector3 gunPos = Cell(center + gd * 11f); float tg = 0f; yield return Hold(PieceType.Gun, gunPos, teammate: false, "construct_mid", delegate(float x) { tg = x; }); Note($"gun alone: {tg:F2}s (expect ~{Construction.BuildTime(PieceType.Gun):F1})"); Vector3 pos = Cell(center + gd * 11f + side * c); float tc = 0f; yield return Hold(PieceType.Cannon, pos, teammate: true, null, delegate(float x) { tc = x; }); Note($"cannon with a teammate: {tc:F2}s (expect ~{Construction.BuildTime(PieceType.Cannon) / 1.6f:F2})"); Vector3 morPos = Cell(center + gd * 11f - side * c); coins = Siege.Instance.ServerCoins; for (float t = 0f; t < 0.3f; t += 0.15f) { con.Work(PieceType.Mortar, morPos, 0f); yield return (object)new WaitForSeconds(0.15f); } int during = Siege.Instance.ServerCoins; yield return (object)new WaitForSeconds(1.6f); Note($"abandoned mortar: coins {coins} -> {during} while building -> {Siege.Instance.ServerCoins} after (refund), sites left {con.ServerSiteCount}, built {Built(morPos)}"); int gunId = bs.ServerPieces.First(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = p.Pos - gunPos; return ((Vector3)(ref val2)).sqrMagnitude < 0.01f; }).Id; bs.DebugSetBuilding(on: true, PieceType.Gun); PieceMenu.Instance.Open(gunId); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot("menu_upgrade"); yield return (object)new WaitForSecondsRealtime(0.4f); PieceMenu.Instance.DebugUpgrade(1); yield return (object)new WaitForSecondsRealtime(0.8f); FortressPlugin.Shot("menu_branch"); yield return (object)new WaitForSecondsRealtime(0.4f); PieceMenu.Instance.DebugUpgrade(2); yield return (object)new WaitForSecondsRealtime(0.8f); PieceState pieceState = bs.ServerPieces.First((PieceState p) => p.Id == gunId); Note($"menu: gun now Lv{pieceState.Level} branch {pieceState.Branch} (expect Lv3 branch 2), menu open {PieceMenu.IsOpen}, inputs blocked {me.BlockInputs}"); PieceMenu.Instance.Close(); int wallId = bs.ServerPieces.First(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = p.Pos - wallPos; return ((Vector3)(ref val2)).sqrMagnitude < 0.01f; }).Id; float h0 = Time.time; bool shotRemove = false; while (Time.time - h0 < 0.90000004f && bs.ServerPieces.Any((PieceState p) => p.Id == wallId)) { bs.DebugRemoveHold(wallId); if (!shotRemove && Time.time - h0 > 0.35f) { shotRemove = true; FortressPlugin.Shot("remove_hold"); } yield return null; } yield return (object)new WaitForSecondsRealtime(0.5f); Note($"hold-H remove: wall gone {!bs.ServerPieces.Any((PieceState p) => p.Id == wallId)} after {Time.time - h0:F2}s"); bs.DebugSetBuilding(on: false, PieceType.Wall); bool Built(Vector3 val2) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return bs.ServerPieces.Any(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val3 = p.Pos - val2; return ((Vector3)(ref val3)).sqrMagnitude < 0.01f; }); } Vector3 Cell(Vector3 w) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor((Mathf.Floor(w.x / c) + 0.5f) * c, w.y + 5f, (Mathf.Floor(w.z / c) + 0.5f) * c); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, Vector3.down, ref val3, 12f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { val2.y = ((RaycastHit)(ref val3)).point.y; } return val2; } IEnumerator Hold(PieceType type, Vector3 pos2, bool teammate, string shotAt, Action done) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float t2 = Time.time; float next = 0f; bool shot = false; while (!Built(pos2) && Time.time - t2 < 4f) { if (Time.time >= next) { next = Time.time + 0.15f; con.Work(type, pos2, 0f); if (teammate) { con.ServerWork(777777, new BuildWork { Type = type, Pos = pos2, RotY = 0f }); } } if (shotAt != null && !shot && Time.time - t2 > 0.45f) { shot = true; FortressPlugin.Shot(shotAt); } yield return null; } done(Built(pos2) ? (Time.time - t2) : (-1f)); } } private IEnumerator UiScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; Loot.Instance.ServerGive(Gear.Gunpowder, Rarity.Legendary); Loot.Instance.ServerGive(Gear.SharkArmor, Rarity.Epic, 3); Loot.Instance.ServerGive(Gear.Rebar, Rarity.Rare, 2); Loot.Instance.ServerGive(Gear.LuckyCharm, Rarity.Common, 4); Vector3 vaultDoor = island.VaultDoor; me.LocalTeleport(vaultDoor + Vector3.up * 0.5f, YawTo(vaultDoor, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("ui_lobby_prompt"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Open(); VaultUI.Instance.DebugSelect(Gear.SharkArmor, Rarity.Epic); yield return (object)new WaitForSecondsRealtime(1f); FortressPlugin.Shot("ui_vault"); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Close(); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); Siege.Instance.ServerAddCoins(Siege.Money(3000)); SpendLikeAPlayer(center); float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 turretAt = center + val * 10f + Vector3.Cross(Vector3.up, val) * 0.7f * 3f; Vector3 eye = turretAt - val * 3.2f + Vector3.up * 0.2f; BuildSystem.Instance.DebugSetBuilding(on: true, PieceType.Cannon); yield return Look(eye, YawTo(eye, turretAt), "ui_build_look", 1.2f); Vector3 pos = center + new Vector3(0f, 0.5f, -8f); yield return Look(pos, 180f, "ui_build", 1.2f); BuildSystem.Instance.DebugSetBuilding(on: false, PieceType.Wall); yield return Look(eye, YawTo(eye, turretAt), "ui_walkup", 1.2f); plugin.SkipBuildTime(); yield return (object)new WaitForSecondsRealtime(1.2f); FortressPlugin.Shot("ui_banner"); yield return (object)new WaitForSecondsRealtime(5f); yield return Look(center + new Vector3(0f, 0.5f, -3f), 180f, "ui_fight", 0.5f); plugin.DebugKillAll(); yield return Until(() => plugin.InBuildTime, 10f, "wave cleared"); plugin.DebugJumpToWave(10); yield return Until(() => Counters.ContainsKey("spawned_Boss"), 20f, "boss"); yield return (object)new WaitForSecondsRealtime(2f); FortressPlugin.Shot("ui_boss"); yield return (object)new WaitForSecondsRealtime(1f); plugin.TestKey((Key)102, shift: false); yield return (object)new WaitForSecondsRealtime(1.5f); FortressPlugin.Shot("ui_results"); yield return (object)new WaitForSecondsRealtime(1f); } private IEnumerator GearScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); loot.ServerWipeVaultForTest(); IgnorePlayers = true; Player me = Player.LocalPlayer; Vector3 center = island.Center; Equip(new Gear[6] { Gear.Gunpowder, Gear.Rebar, Gear.CoreShield, Gear.WarChest, Gear.SharkArmor, Gear.ToolBelt }); Note("loadout 1: fortress [" + string.Join(",", loot.Vault.Fortress) + "], mine [" + string.Join(",", loot.Vault.Slots(Loot.KeyOf(me))) + "]"); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round 1 start"); Note($"core {Siege.Instance.CoreHp}/{Siege.Instance.CoreMax} (expect 2000), coins {Siege.Instance.ServerCoins} (expect 425)"); int serverCoins = Siege.Instance.ServerCoins; float num = FortressIsland.GapAngles[0] * (MathF.PI / 180f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); WallAt(center + val * 15f + Vector3.up * 1.2f, val); PieceState pieceState = BuildSystem.Instance.ServerPieces.OrderByDescending((PieceState p) => p.Id).FirstOrDefault(); Note($"wall: cost {serverCoins - Siege.Instance.ServerCoins} (expect 8), max hp {pieceState.MaxHp} (expect 360)"); yield return (object)new WaitForSecondsRealtime(1f); int hp0 = me.Vitals.Health; Siege.HurtPlayer(me, 40, Vector3.zero); yield return (object)new WaitForSecondsRealtime(1f); Note($"bite of 40 with shark armor: hp {hp0} -> {me.Vitals.Health} (expect -22)"); plugin.TestKey((Key)102, shift: false); yield return (object)new WaitForSecondsRealtime(2f); while (loot.Vault.Fortress.Count > 0) { loot.ServerRequest(me, new VaultRequest { Action = VaultAction.UnequipFortress, Gear = loot.Vault.Fortress[0].Item1, Rarity = loot.Vault.Fortress[0].Item2 }); } while (loot.Vault.Slots(Loot.KeyOf(me)).Count > 0) { (Gear, Rarity) tuple = loot.Vault.Slots(Loot.KeyOf(me))[0]; Loot loot2 = loot; Player who = me; VaultRequest req = new VaultRequest { Action = VaultAction.UnequipPersonal }; (req.Gear, req.Rarity) = tuple; loot2.ServerRequest(who, req); } Equip(new Gear[6] { Gear.Incendiary, Gear.FrostCore, Gear.TeslaCoil, Gear.Scope, Gear.BigNet, Gear.FishGloves }); Note("loadout 2: fortress [" + string.Join(",", loot.Vault.Fortress) + "], mine [" + string.Join(",", loot.Vault.Slots(Loot.KeyOf(me))) + "]"); PlayerManager.ToggleGodMode(); me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round 2 start"); Note($"net capacity {FortressNet.Instance.ServerCapOf(((NetworkBehaviour)me).ObjectId)} (expect 20)"); Siege.Instance.ServerAddCoins(Siege.Money(600)); SpendLikeAPlayer(center); plugin.SkipBuildTime(); yield return Until(() => Counters.ContainsKey("burn_ticks"), 40f, "incendiary burn"); Note(string.Format("burn ticks {0}, tesla shots {1}", Counters.TryGetValue("burn_ticks", out var value) ? value : 0, Counters.TryGetValue("shots_Tesla", out var value2) ? value2 : 0)); plugin.TestKey((Key)102, shift: false); yield return (object)new WaitForSecondsRealtime(2f); ForceGameItem = true; loot.ServerSpawnChest(20); Vector3 chest = loot.ServerChestPos ?? center; yield return (object)new WaitForSecondsRealtime(0.5f); me.LocalTeleport(chest + Vector3.up * 0.5f, 0f, true); yield return (object)new WaitForSecondsRealtime(2f); ForceGameItem = false; Note("game item: " + string.Join(", ", from kv in Counters where kv.Key.StartsWith("game_item_") select kv.Key.Substring(10))); yield return Look(chest + new Vector3(-2.5f, 1.2f, -3f), YawTo(chest + new Vector3(-2.5f, 0f, -3f), chest), "chest_item", 1f); void Equip(params Gear[] gear) { foreach (Gear gear2 in gear) { loot.ServerGive(gear2, Rarity.Legendary); loot.ServerRequest(me, new VaultRequest { Action = (GearCatalog.IsFortress(gear2) ? VaultAction.EquipFortress : VaultAction.EquipPersonal), Gear = gear2, Rarity = Rarity.Legendary }); } } } private IEnumerator LootScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; Loot loot = Loot.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); loot.ServerWipeVaultForTest(); PlayerManager.ToggleGodMode(); IgnorePlayers = true; Vector3 center = island.Center; Player me = Player.LocalPlayer; me.LocalTeleport(center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); yield return Until(() => plugin.Running, 15f, "round start"); if (!plugin.Running) { yield break; } Siege.Instance.ServerAddCoins(Siege.Money(400)); bool shotDrop = false; bool shotChest = false; bool jumped = false; float end = Time.realtimeSinceStartup + 420f; while (plugin.Running && Time.realtimeSinceStartup < end && plugin.Wave <= 10) { if (plugin.InBuildTime) { SpendLikeAPlayer(center); Vector3? serverChestPos = loot.ServerChestPos; if (serverChestPos.HasValue) { Vector3 chest = serverChestPos.GetValueOrDefault(); if (!shotChest) { shotChest = true; yield return Look(chest + new Vector3(-3f, 1f, -4f), YawTo(chest + new Vector3(-3f, 0f, -4f), chest), "loot_chest", 1f); } me.LocalTeleport(chest + Vector3.up * 0.5f, 0f, true); yield return (object)new WaitForSecondsRealtime(1f); } if (plugin.Wave == 5 && !jumped) { jumped = true; Siege.Instance.ServerAddCoins(Siege.Money(1500)); SpendLikeAPlayer(center); plugin.DebugJumpToWave(10); } else { plugin.SkipBuildTime(); } } Vector3? val = loot.ServerDropPositions.Cast().FirstOrDefault(); if (val.HasValue) { Vector3 d = val.GetValueOrDefault(); if (!shotDrop) { shotDrop = true; yield return Look(d + new Vector3(0f, 0.8f, -2.5f), 0f, "loot_drop", 0.8f); } me.LocalTeleport(d + Vector3.up * 0.3f, 0f, true); } yield return (object)new WaitForSecondsRealtime(1f); } int ownedBeforeStop = loot.Vault.Owned.Values.Sum(); if (plugin.Running) { plugin.TestKey((Key)102, shift: false); } yield return (object)new WaitForSecondsRealtime(1.5f); Note($"loot: wave reached {plugin.Wave}, vault {ownedBeforeStop} before stop, {loot.Vault.Owned.Values.Sum()} after; drops left {loot.ServerDropCount}"); Note("vault: " + string.Join(", ", loot.Vault.Owned.Select((KeyValuePair<(Gear, Rarity), int> kv) => $"{kv.Key.Item1}/{kv.Key.Item2} x{kv.Value}"))); loot.ServerGive(Gear.Gunpowder, Rarity.Common, 3); loot.ServerGive(Gear.SharkArmor, Rarity.Rare); int num = loot.Vault.Count(Gear.Gunpowder, Rarity.Rare); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.Merge, Gear = Gear.Gunpowder, Rarity = Rarity.Common }); Note($"merge: gunpowder rare {num} -> {loot.Vault.Count(Gear.Gunpowder, Rarity.Rare)}, common left {loot.Vault.Count(Gear.Gunpowder, Rarity.Common)}"); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.EquipFortress, Gear = Gear.Gunpowder, Rarity = Rarity.Rare }); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.EquipFortress, Gear = Gear.SharkArmor, Rarity = Rarity.Rare }); loot.ServerRequest(me, new VaultRequest { Action = VaultAction.EquipPersonal, Gear = Gear.SharkArmor, Rarity = Rarity.Rare }); Note(string.Format("equip: fortress [{0}], mine [{1}], gunpowder value {2}, armor value {3}", string.Join(",", loot.Vault.Fortress), string.Join(",", loot.Vault.Slots(Loot.KeyOf(me))), loot.Vault.FortressValue(Gear.Gunpowder), loot.Vault.PersonalValue(Loot.KeyOf(me), Gear.SharkArmor))); yield return (object)new WaitForSecondsRealtime(0.5f); Note($"client mirror matches host: {loot.ClientVault.Write() == loot.Vault.Write()}"); loot.FlushVault(); string serverVaultFile = loot.ServerVaultFile; Note("vault file " + serverVaultFile + ": " + ((serverVaultFile != null && File.Exists(serverVaultFile)) ? (File.ReadAllLines(serverVaultFile).Length + " lines") : "missing")); (Gear, Rarity) tuple = loot.Vault.Slots(Loot.KeyOf(me))[0]; VaultRequest req = new VaultRequest { Action = VaultAction.UnequipPersonal }; (req.Gear, req.Rarity) = tuple; loot.ServerRequest(me, req); Note(string.Format("unequip: mine [{0}], armor back in vault {1}", string.Join(",", loot.Vault.Slots(Loot.KeyOf(me))), loot.Vault.Count(Gear.SharkArmor, Rarity.Rare))); Vector3 door = island.VaultDoor; yield return Look(door + Vector3.up * 0.5f + (door - island.VaultPos) * 1.5f, YawTo(door, island.VaultPos), "vault_outside", 1f); me.LocalTeleport(door + Vector3.up * 0.5f, YawTo(door, island.VaultPos), true); yield return (object)new WaitForSecondsRealtime(1f); loot.ServerGive(Gear.Rebar, Rarity.Epic); loot.ServerGive(Gear.LuckyCharm, Rarity.Common, 4); yield return (object)new WaitForSecondsRealtime(0.5f); VaultUI.Instance.Open(); VaultUI.Instance.DebugSelect(Gear.LuckyCharm, Rarity.Common); yield return (object)new WaitForSecondsRealtime(1f); Note($"vault menu open {VaultUI.IsOpen}, inputs blocked {me.BlockInputs}, cursor {Cursor.lockState}"); FortressPlugin.Shot("vault_ui"); yield return (object)new WaitForSecondsRealtime(1f); VaultUI.Instance.Close(); Note($"vault menu closed: open {VaultUI.IsOpen}, inputs blocked {me.BlockInputs}"); } private IEnumerator CheatsScenario() { FortressIsland island = FortressIsland.Instance; FortressPlugin plugin = FortressPlugin.Instance; yield return Until(() => island.Exists, 30f, "fortress island"); plugin.TestKey((Key)97, shift: false); yield return (object)new WaitForSecondsRealtime(2f); Note($"F4: {Vector3.Distance(Player.LocalPlayer.Transform.position, island.Center + FortressIsland.ReadyLocal):F1} m from the ready circle, boat {Vector3.Distance(BoatManager.Boat.HiddenPhysicsRig.position, island.DockPos):F1} m from dock"); yield return Until(() => plugin.Running, 10f, "round start from the ready circle"); if (!plugin.Running) { plugin.TestKey((Key)102, shift: false); yield return Until(() => plugin.Running, 5f, "F9 start"); } int serverCoins = Siege.Instance.ServerCoins; plugin.TestKey((Key)98, shift: false); Note($"F5: coins {serverCoins} -> {Siege.Instance.ServerCoins}"); bool inGodMode = PlayerManager.InGodMode; plugin.TestKey((Key)99, shift: false); bool inGodMode2 = PlayerManager.InGodMode; plugin.TestKey((Key)99, shift: false); Note($"F6: god {inGodMode} -> {inGodMode2} -> {PlayerManager.InGodMode}"); plugin.TestKey((Key)101, shift: false); yield return Until(() => plugin.Wave == 1 && !plugin.InBuildTime, 5f, "F8 skips build time"); Note($"F8: wave {plugin.Wave}, building {plugin.InBuildTime}"); yield return (object)new WaitForSecondsRealtime(9f); int alive = FortressPlugin.Alive.Count; plugin.TestKey((Key)100, shift: false); yield return (object)new WaitForSecondsRealtime(1.5f); Note($"F7: alive {alive} -> {FortressPlugin.Alive.Count}"); yield return Until(() => plugin.InBuildTime, 5f, "wave cleared after F7"); plugin.TestKey((Key)101, shift: true); yield return Until(() => plugin.Wave >= 6, 5f, "Shift+F8 jump"); Note($"Shift+F8: wave {plugin.Wave}"); FortressPlugin.Shot("cheats_help"); yield return (object)new WaitForSecondsRealtime(1f); plugin.TestKey((Key)102, shift: false); yield return (object)new WaitForSecondsRealtime(1f); Note($"F9: running {plugin.Running}"); } private static string BuildPoolProbe() { if (((Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null)).TryGetValue("dripper", out var value)) { Creature component = ((Component)value).GetComponent(); if (component != null) { return component.MaxHp.ToString(); } } return null; } private static List<(PieceType, float, float, int)> BuildPlan() { List<(PieceType, float, float, int)> list = new List<(PieceType, float, float, int)>(); for (int i = 0; i < 3; i++) { list.Add((PieceType.Wall, 15f, 0f, i)); list.Add((PieceType.Wall, 15f, 1f, i)); list.Add((PieceType.Wall, 15f, -1f, i)); } for (int j = 0; j < 3; j++) { list.Add((PieceType.Gun, 10f, 0.7f, j)); } for (int k = 0; k < 3; k++) { list.Add((PieceType.Spikes, 19f, 0f, k)); } list.Add((PieceType.Cannon, 4f, 0f, 0)); for (int l = 0; l < 3; l++) { list.Add((PieceType.Harpoon, 10f, -0.8f, l)); } list.Add((PieceType.Tesla, 4f, 0f, 1)); list.Add((PieceType.Mortar, 4f, 0f, 2)); for (int m = 0; m < 3; m++) { list.Add((PieceType.Wall, 12f, 1f, m)); list.Add((PieceType.Wall, 12f, -1f, m)); } return list; } private static void SpendLikeAPlayer(Vector3 center) { //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) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0132: 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_0129: Unknown result type (might be due to invalid IL or missing references) foreach (PieceState item5 in BuildSystem.Instance.ServerPieces.Where((PieceState p) => p.Hp < p.MaxHp / 2).ToList()) { BuildSystem.Instance.ServerUpgrade(item5.Id, 0, repair: true); } Vector3 val = default(Vector3); for (int num = 0; num < 40; num++) { bool flag = false; foreach (var item6 in Plan) { PieceType item = item6.type; float item2 = item6.r; float item3 = item6.sideOffset; int item4 = item6.gap; float num2 = FortressIsland.GapAngles[item4] * (MathF.PI / 180f); ((Vector3)(ref val))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 world = center + val * item2 + val2 * item3 * 3f + Vector3.up * 1.2f; if ((item == PieceType.Wall) ? WallAt(world, val) : TurretAt(item, world)) { flag = true; break; } } if (!flag) { PieceState pieceState = (from p in BuildSystem.Instance.ServerPieces where p.Type != PieceType.Floor orderby Catalog.UpgradeCost(p.Type, p.Level) select p).FirstOrDefault(); if (pieceState.Id == 0 || Siege.Instance.ServerCoins < Catalog.UpgradeCost(pieceState.Type, pieceState.Level)) { break; } BuildSystem.Instance.ServerUpgrade(pieceState.Id, 1 + pieceState.Id % 2); } if (Siege.Instance.ServerCoins < 8) { break; } } } private void Finish() { Note("counters: " + string.Join(", ", from k in Counters orderby k.Key select k.Key + "=" + k.Value)); File.WriteAllText(Path.Combine(Root, "fortress-test-report.txt"), _report.ToString()); ((MonoBehaviour)this).StartCoroutine(QuitSoon()); } private IEnumerator QuitSoon() { yield return (object)new WaitForSecondsRealtime(3f); Application.Quit(); } } public static class BossBrains { public static BossBrain Make(EnemyKind k) { return k switch { EnemyKind.Warden => new Warden(), EnemyKind.Urchin => new Urchin(), EnemyKind.Angler => new Angler(), EnemyKind.Steed => new Steed(), EnemyKind.Stonefish => new Stonefish(), EnemyKind.Skyfish => new Skyfish(), EnemyKind.Kraken => new Kraken(), EnemyKind.Voxel => new Voxel(), EnemyKind.Koi => new Koi(), _ => new Eye(), }; } internal static List Spots(Vector3 from, int n, float range, float spread = 16f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_0136: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) List list = (from p in (from p in BuildSystem.Instance.ServerPieces.Where(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val4 = (p.Pos - @from).Flat(); return ((Vector3)(ref val4)).magnitude < range; }) orderby (Catalog.IsTurret(p.Type) ? 2f : 0f) + Random.value * 2f descending select p).Take(n * 2 / 3) select p.Pos).ToList(); foreach (Player item in PlayerManager.AlivePlayers.Where(delegate(Player p) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)p) && Object.op_Implicit((Object)(object)p.Transform) && !AutoTest.IgnorePlayers) { Vector3 val4 = (p.Transform.position - from).Flat(); return ((Vector3)(ref val4)).magnitude < range; } return false; }).Take(2)) { list.Add(item.Transform.position); } int num = 0; while (list.Count < n && num < n * 4) { Vector3 val = from + Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward * Random.Range(4f, spread); Vector3 val2 = (val - FortressIsland.Instance.Center).Flat(); if (((Vector3)(ref val2)).magnitude < 28f) { list.Add(val); } num++; } for (int num2 = 0; num2 < list.Count; num2++) { Vector3 val3 = list[num2]; val3.y = BossFx.Ground(val3); list[num2] = val3; } return list.Take(n).ToList(); } } internal class Warden : BossBrain { protected override IEnumerator Entrance(float seconds) { Send("warden.rise", Home, Home, 0, Mathf.RoundToInt(Reach * 100f)); Vector3 from = base.Pos; Quaternion r = base.T.rotation; for (float t = 0f; t < 1.1f; t += Time.deltaTime) { if (!base.Alive) { break; } float num = t / 1.1f; Put(Vector3.Lerp(from, Home, 1f - (1f - num) * (1f - num)), r * Quaternion.Euler(-30f * (1f - num), 0f, 0f)); yield return null; } Put(Home, r); } protected override IEnumerator Act() { yield return WalkTo(Heart(), 2.4f, 6.5f, Phase2 ? 2.5f : 4f); switch (Pick(4f, 3f, Phase2 ? 1.5f : 2.2f)) { case 0: yield return Guillotine((!Phase2) ? 1 : 2); break; case 1: yield return Shackles(Phase2 ? 3 : 2); break; default: yield return Shell(Phase2 ? 5f : 4f); break; } yield return base.Breath; } private IEnumerator Guillotine(int times) { for (int i = 0; i < times; i++) { if (!base.Alive) { break; } Vector3 at = Target(); yield return Turn(at, 0.35f); Quaternion r = Facing(at - base.Pos); Shout("wardenGuillotine"); yield return Warn("circle", at, at, 2.6f, 1.3f, breakable: true, 0.04f, 0, delegate(float k) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Put(base.Pos, r * Quaternion.Euler(-22f * Mathf.Sin(k * MathF.PI * 0.5f), 0f, 0f)); }); Put(base.Pos, r * Quaternion.Euler(6f, 0f, 0f)); Hit(BossBrain.Circle(at, 2.6f), 170f, 30f, 45f, at, 9f); Send("warden.snap", at, base.Pos); AutoTest.Count("warden_guillotine"); yield return 0.45f; Put(base.Pos, r); } } private Vector3 Target() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) PieceState? pieceState = BossBrain.Best(delegate(PieceState x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val3 = (x.Pos - base.Pos).Flat(); return ((Vector3)(ref val3)).magnitude < 11f; }, delegate(PieceState x) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) float num = (float)x.MaxHp + (Catalog.IsTurret(x.Type) ? 200f : 0f); Vector3 val3 = (x.Pos - base.Pos).Flat(); return num - ((Vector3)(ref val3)).magnitude * 10f; }); Vector3 val = (BossBrain.Core - base.Pos).Flat(); if (((Vector3)(ref val)).magnitude < 11f && (!pieceState.HasValue || Random.value < 0.4f)) { return BossBrain.Core; } if (pieceState.HasValue) { return pieceState.Value.Pos; } Vector3 val2 = base.Pos + base.Forward * (Reach + 3f); val2.y = BossBrain.GroundY(val2); return val2; } private IEnumerator Shackles(int n) { List turrets = TurretsNear(18f).OrderBy(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val = p.Pos - base.Pos; return ((Vector3)(ref val)).sqrMagnitude; }).Take(n).ToList(); if (turrets.Count == 0) { yield return Guillotine(1); yield break; } foreach (PieceState item in turrets) { WarnOnly("lane", base.Pos, item.Pos, 0.9f, 0.9f); } Send("warden.swing", base.Pos, base.Pos, 900); yield return 0.9f; float num = 6f + (float)Tier * 0.3f; foreach (PieceState item2 in turrets) { Bosses.Instance.Silence(item2.Id, num); BuildSystem.Instance.ServerDamagePiece(item2.Id, Scaled(35f)); Send("warden.chain", base.Pos, item2.Pos, Mathf.RoundToInt(num * 1000f), item2.Id); } Shout("wardenChains"); AutoTest.Count("warden_shackles", turrets.Count); yield return 0.5f; } private IEnumerator Shell(float seconds) { TurretMult = 0.25f; Send("warden.shell", base.Pos, base.Pos, Mathf.RoundToInt(seconds * 1000f)); Shout("wardenShell"); AutoTest.Count("warden_shell"); yield return WalkTo(BossBrain.Core, 1.6f, 4f, seconds); TurretMult = 1f; } } internal class Urchin : BossBrain { private Quaternion _spin = Quaternion.identity; private float Radius => Mathf.Max(1f, Height * 0.5f); private void RollTo(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (p - base.Pos).Flat(); if (((Vector3)(ref val)).sqrMagnitude > 1E-06f) { _spin = Quaternion.AngleAxis(((Vector3)(ref val)).magnitude / Radius * 57.29578f, Vector3.Cross(Vector3.up, ((Vector3)(ref val)).normalized)) * _spin; } Put(p, _spin); } private void Spin(Vector3 dir, float degPerSec) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) _spin = Quaternion.AngleAxis(degPerSec * Time.deltaTime, Vector3.Cross(Vector3.up, dir)) * _spin; Put(base.Pos, _spin); } protected override IEnumerator Entrance(float seconds) { _spin = base.T.rotation; Vector3 from = base.Pos; for (float t = 0f; t < 0.75f; t += Time.deltaTime) { if (!base.Alive) { break; } float num = t / 0.75f; Spin(Vector3.forward, 500f); Put(Vector3.Lerp(from, Home, num * num), _spin); yield return null; } Put(Home, _spin); Send("urchin.land", Home, Home, 0, Mathf.RoundToInt(Reach * 130f)); for (float t = 0f; t < 0.5f; t += Time.deltaTime) { if (!base.Alive) { break; } float num2 = t / 0.5f; Put(Home + Vector3.up * 10f * num2 * (1f - num2), _spin); yield return null; } Put(Home, _spin); Send("urchin.land", Home, Home, 0, Mathf.RoundToInt(Reach * 80f)); } protected override IEnumerator Act() { Vector3 goal = Heart(); for (float t = 0f; t < (Phase2 ? 2f : 3f); t += Time.deltaTime) { if (!base.Alive) { break; } Vector3 val = (goal - base.Pos).Flat(); if (!(((Vector3)(ref val)).magnitude > 9f)) { break; } val = (goal - base.Pos).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; PieceState? pieceState = WallAhead(normalized); if (pieceState.HasValue) { BuildSystem.Instance.ServerDamagePiece(pieceState.Value.Id, Scaled(40f)); Send("stomp", pieceState.Value.Pos, pieceState.Value.Pos); yield return 0.5f; } else { RollTo(Stand(base.Pos + normalized * 3.5f * base.SlowFactor * Time.deltaTime)); yield return null; } } switch (Pick(4f, 3.5f, 2.5f)) { case 0: yield return Crush((!Phase2) ? 1 : 2); break; case 1: yield return Volley(Phase2 ? 20 : (11 + Tier / 2)); break; default: yield return Bloom(Phase2 ? 4 : 3); break; } yield return base.Breath; } private IEnumerator Crush(int lanes) { Vector3 val = (Heart() - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; for (int i = 0; i < lanes; i++) { if (!base.Alive) { break; } Vector3 a = base.Pos; Vector3 b = BossBrain.Across(a, dir, 32f); val = (b - a).Flat(); dir = ((Vector3)(ref val)).normalized; Shout("urchinCrush"); Vector3 d0 = dir; yield return Warn("lane", new Vector3(a.x, BossBrain.GroundY(a), a.z), b, Radius * 2f + 1.2f, 1.4f, breakable: true, 0.04f, 0, delegate(float k) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Spin(d0, 200f + 900f * k); }); HashSet hit = new HashSet(); HashSet hurt = new HashSet(); val = (b - a).Flat(); float len = ((Vector3)(ref val)).magnitude; Send("urchin.roll", a, b, Mathf.RoundToInt(len / 16f * 1000f)); for (float d1 = 0f; d1 < len; d1 += 16f * base.SlowFactor * Time.deltaTime) { if (!base.Alive) { break; } Vector3 val2 = Stand(a + dir * d1); RollTo(val2); HitOnce(hit, hurt, BossBrain.Circle(val2, Radius + 0.8f), 95f, 28f, 45f, val2, 12f); yield return null; } AutoTest.Count("urchin_crush"); dir = Quaternion.Euler(0f, (Random.value < 0.5f) ? 50f : (-50f), 0f) * -dir; yield return 0.3f; } } private IEnumerator Volley(int n) { List spots = BossBrains.Spots(base.Pos, n, 20f); Send("urchin.bristle", base.Pos, base.Pos, 1100); foreach (Vector3 item in spots) { WarnOnly("circle", item, item, 1.3f, 1.1f); } yield return 1.1f; Vector3 a = base.Pos + Vector3.up * Radius; foreach (Vector3 item2 in spots) { Send("urchin.spike", a, item2); } yield return 0.45f; foreach (Vector3 item3 in spots) { Hit(BossBrain.Circle(item3, 1.3f), 45f, 16f, 20f, item3, 5f); Send("urchin.caltrop", item3, item3, 9000); Hazard(item3, 1.1f, 9f, Scaled(4f), 0); } AutoTest.Count("urchin_volley"); } private IEnumerator Bloom(int pulses) { Shout("urchinBloom"); for (int i = 0; i < pulses; i++) { if (!base.Alive) { break; } float r = Radius + 4f + (float)i * 0.9f; yield return Warn("ring", base.Pos, base.Pos, r, (i == 0) ? 1.1f : 0.65f, i == 0, 0.04f, Mathf.RoundToInt(Radius * 100f)); Func inside = BossBrain.Circle(base.Pos, r); Hit(delegate(Vector3 p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (inside(p)) { Vector3 val = (p - base.Pos).Flat(); return ((Vector3)(ref val)).magnitude >= Radius * 0.8f; } return false; }, 50f, 22f, 25f, base.Pos, 10f); Send("urchin.bloom", base.Pos, base.Pos, 0, Mathf.RoundToInt(r * 100f)); AutoTest.Count("urchin_bloom"); } } } internal class Angler : BossBrain { private const float Hover = 3.5f; private float _veilUntil; private Vector3 Lantern => base.Pos + base.Forward * Reach * 0.85f + Vector3.up * Height * 0.55f; protected override IEnumerator Entrance(float seconds) { Send("angler.lure", Home, Home, 2200); Vector3 from = base.Pos; for (float t = 0f; t < 1.8f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(from, Home, Mathf.SmoothStep(0f, 1f, t / 1.8f))); yield return null; } Put(Home); } public override void Tick() { base.Tick(); if (_veilUntil > 0f && Time.time > _veilUntil && !Phase2) { _veilUntil = 0f; Lights(on: true); } } protected override void OnStop() { if (Bosses.Dark) { Lights(on: true); } } private void Lights(bool on) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Bosses.Dark = !on; Send("dark", base.Pos, base.Pos, (!on) ? 1 : 0); } protected override IEnumerator Act() { float num = Mathf.Atan2(base.Pos.z - BossBrain.Center.z, base.Pos.x - BossBrain.Center.x) + Random.Range(-0.9f, 0.9f); Vector3 val = BossBrain.Center + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * Random.Range(20f, 25f); val.y = BossBrain.GroundY(val) + Foot + 3.5f; yield return Glide(val, 3.5f); yield return Turn(BossBrain.Core, 0.5f); switch (Pick(Bosses.Dark ? 0f : 3f, 4f, 3.5f)) { case 0: yield return Veil(); break; case 1: yield return Lure(); break; default: yield return Devour((!Phase2) ? 1 : 2); break; } yield return base.Breath; } private IEnumerator Veil() { Send("angler.lure", base.Pos, base.Pos, 1200); yield return 1.2f; Lights(on: false); _veilUntil = Time.time + 15f; Shout("anglerVeil"); AutoTest.Count("angler_veil"); } private IEnumerator Lure() { Shout("anglerLure", always: true); Send("angler.lure", base.Pos, base.Pos, 1700); yield return Warn("circle", new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z), base.Pos, Reach + 1f, 1.7f, breakable: true); Vector3 lantern = Lantern; Send("angler.flash", lantern, base.Pos); int num = 0; foreach (Player item in BossBrain.Targets.ToList()) { Vector3 val = (Object.op_Implicit((Object)(object)item.CamObject) ? item.CamObject.position : (item.Transform.position + Vector3.up * 1.6f)); Vector3 val2 = (Object.op_Implicit((Object)(object)item.CamObject) ? item.CamObject.forward : item.Transform.forward); Vector3 val3 = lantern - val; if (!(((Vector3)(ref val3)).magnitude > 45f) && !(Vector3.Angle(val2, val3) > 50f) && !Physics.Linecast(val, lantern, LayerMask.op_Implicit(GameInfo.LevelLayer))) { int dmg = Mathf.Min(70, Scaled(18f)); Vector3 val4 = (base.Pos - item.Transform.position).Flat(); Siege.HurtPlayer(item, dmg, ((Vector3)(ref val4)).normalized * 16f + Vector3.up * 5f); num++; } } AutoTest.Count("angler_lure"); AutoTest.Count("angler_charmed", num); yield return 0.6f; } private IEnumerator Devour(int times) { for (int i = 0; i < times; i++) { if (!base.Alive) { break; } Vector3 val = Heart(); Vector3 val2 = (val - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val2)).normalized; Vector3 a = new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z); val2 = (val - base.Pos).Flat(); Vector3 b = a + dir * Mathf.Min(26f, ((Vector3)(ref val2)).magnitude + 6f); b.y = BossBrain.GroundY(b); yield return Turn(val, 0.4f); yield return Warn("lane", a, b, 5f, 1.3f, breakable: true); HashSet hit = new HashSet(); HashSet hurt = new HashSet(); Vector3 from = base.Pos; Vector3 to = new Vector3(b.x, BossBrain.GroundY(b) + Foot + 0.8f, b.z); Send("angler.lunge", from, to, 700); for (float t = 0f; t < 0.7f; t += Time.deltaTime) { if (!base.Alive) { break; } Vector3 p = Vector3.Lerp(from, to, t / 0.7f); Put(p, Facing(dir)); HitOnce(hit, hurt, BossBrain.Circle(p, 3f), 110f, 32f, 50f, p, 10f); foreach (Creature item in FortressPlugin.Alive.Where(delegate(Creature c) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)c) && (Object)(object)c != (Object)(object)Body && c._hp.Value > 0 && !EnemyCatalog.IsPuppet(BossBrain.KindOf(c))) { Vector3 val3 = (((Component)c).transform.position - p).Flat(); return ((Vector3)(ref val3)).magnitude < 3.2f; } return false; }).ToList()) { Send("angler.gulp", ((Component)item).transform.position, p); FortressPlugin.Alive.Remove(item); ((Item)item).DestroyItem((byte)0, byte.MaxValue); Body.ServerChangeHp(-Mathf.CeilToInt((float)MaxHp * 0.015f)); AutoTest.Count("angler_ate"); } yield return null; } AutoTest.Count("angler_devour"); yield return Glide(new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos) + Foot + 3.5f, base.Pos.z), 6f); } } protected override IEnumerator SecondForm() { Shout("anglerPhase2"); Send("phase2", base.Pos, base.Pos); Send("angler.lure", base.Pos, base.Pos, 1500); yield return 1.5f; Lights(on: false); _veilUntil = 0f; } } internal class Steed : BossBrain { protected override IEnumerator Entrance(float seconds) { Vector3 from = base.Pos; Vector3 val = (Home - from).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; for (float t = 0f; t < 1.3f; t += Time.deltaTime) { if (!base.Alive) { break; } float num = t / 1.3f; Vector3 val2 = Vector3.Lerp(from, Home, num); val2.y = BossBrain.GroundY(val2) + Foot; Put(val2, Facing(dir)); if (Random.value < 0.25f) { Send("steed.splash", val2, val2); } yield return null; } Put(Home, Facing(dir)); Send("steed.rear", base.Pos, base.Pos); yield return Rear(1.1f, 38f); } private IEnumerator Rear(float seconds, float deg) { Vector3 p0 = base.Pos; Quaternion r = base.T.rotation; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!base.Alive) { break; } Pose(p0, r, deg * Mathf.Sin(t / seconds * MathF.PI)); yield return null; } Put(p0, r); } private void Pose(Vector3 p0, Quaternion r, float deg) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0060: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (r * Quaternion.Inverse(BossLooks.Turn(Kind)) * Vector3.forward).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = p0 - normalized * Reach * 0.55f - Vector3.up * Foot; Vector3 val3 = Vector3.Cross(Vector3.up, normalized); Quaternion val4 = Quaternion.AngleAxis(0f - deg, val3); Put(val2 + val4 * (p0 - val2), val4 * r); } protected override IEnumerator Act() { Vector3 p = BossBrain.SpotNear(Heart(), 9f, 15f); yield return Leap(Stand(p), 5f, 0.9f); Send("steed.land", base.Pos, base.Pos); Hit(BossBrain.Circle(base.Pos, Reach + 1f), 30f, 12f, 0f, base.Pos); switch (Pick(4f, 3f, 3f)) { case 0: yield return Charge((!Phase2) ? 1 : 2); break; case 1: yield return Stomp(); break; default: yield return Cavalry(Phase2 ? 5 : 3); break; } yield return base.Breath; } private IEnumerator Charge(int times) { Vector3 val = (Heart() - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; for (int i = 0; i < times; i++) { if (!base.Alive) { break; } Vector3 a = base.Pos; Vector3 b = BossBrain.Across(a, dir, 34f); val = (b - a).Flat(); dir = ((Vector3)(ref val)).normalized; yield return Turn(b, 0.3f); Vector3 p0 = base.Pos; Quaternion r = base.T.rotation; Shout("steedCharge"); yield return Warn("lane", new Vector3(a.x, BossBrain.GroundY(a), a.z), b, Mathf.Max(3.4f, 2f * (Reach * 0.6f + 1f)), (i == 0) ? 1.2f : 0.8f, breakable: true, 0.04f, 0, delegate(float k) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Pose(p0, r, 24f * Mathf.Sin(Mathf.Min(1f, k * 1.4f) * MathF.PI)); }); Put(p0, r); val = (b - a).Flat(); float len = ((Vector3)(ref val)).magnitude; Send("steed.charge", a, b, Mathf.RoundToInt(len / 24f * 1000f)); HashSet hit = new HashSet(); HashSet hurt = new HashSet(); for (float d = 0f; d < len; d += 24f * base.SlowFactor * Time.deltaTime) { if (!base.Alive) { break; } Vector3 val2 = Stand(a + dir * d); Put(val2, Facing(dir)); HitOnce(hit, hurt, BossBrain.Circle(val2, Reach * 0.6f + 1f), 100f, 34f, 50f, val2, 14f); yield return null; } AutoTest.Count("steed_charge"); dir = -dir; } } private IEnumerator Stomp() { float r = 7.5f + (float)Tier * 0.15f; Vector3 p0 = base.Pos; Quaternion rot = base.T.rotation; Send("steed.rear", base.Pos, base.Pos); yield return Warn("circle", new Vector3(p0.x, BossBrain.GroundY(p0), p0.z), p0, r, 1.4f, breakable: true, 0.04f, 0, delegate(float k) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Pose(p0, rot, 42f * Mathf.Sin(Mathf.Min(1f, k * 1.1f) * MathF.PI * 0.5f)); }); Put(p0, rot); Hit(BossBrain.Circle(p0, r), 80f, 30f, 40f, p0, 12f); Send("steed.stomp", p0, p0, 0, Mathf.RoundToInt(r * 100f)); AutoTest.Count("steed_stomp"); yield return 0.5f; } private IEnumerator Cavalry(int n) { Vector3 val = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward; Vector3 val2 = Vector3.Cross(Vector3.up, val); List<(Vector3 a, Vector3 b)> lanes = new List<(Vector3, Vector3)>(); for (int i = 0; i < n; i++) { Vector3 val3 = BossBrain.Center + val2 * (((float)i - (float)(n - 1) * 0.5f) * 6.5f + Random.Range(-1f, 1f)); Vector3 val4 = val3 - val * 30f; Vector3 val5 = val3 + val * 30f; val4.y = BossBrain.GroundY(val4); val5.y = BossBrain.GroundY(val5); lanes.Add((val4, val5)); } Shout("steedCavalry", always: true); Send("steed.rear", base.Pos, base.Pos); foreach (var item in lanes) { WarnOnly("lane", item.a, item.b, 3.2f, 1.7f); } yield return Rear(1.7f, 32f); foreach (var item2 in lanes) { Send("steed.phantom", item2.a, item2.b, 1100); } HashSet hit = new HashSet(); HashSet hurt = new HashSet(); for (float t = 0f; t < 1.1f; t += Time.deltaTime) { float num = t / 1.1f; foreach (var item3 in lanes) { Vector3 val6 = Vector3.Lerp(item3.a, item3.b, num); HitOnce(hit, hurt, BossBrain.Circle(val6, 2f), 70f, 26f, 35f, val6, 10f); } yield return null; } AutoTest.Count("steed_cavalry"); } protected override IEnumerator SecondForm() { Shout("steedPhase2"); Send("phase2", base.Pos, base.Pos); Send("steed.golden", base.Pos, base.Pos); yield return Rear(1.5f, 45f); } } internal class Stonefish : BossBrain { protected override IEnumerator Entrance(float seconds) { Send("stone.rise", Home, Home, 0, Mathf.RoundToInt(Reach * 100f)); yield return Surface(Home, 0.7f); } private IEnumerator Surface(Vector3 to, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 from = base.Pos; Vector3 over = to + Vector3.up * 1.5f; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(from, over, t / seconds)); yield return null; } for (float t = 0f; t < 0.3f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(over, to, t / 0.3f)); yield return null; } Put(to); } protected override IEnumerator Act() { if (Random.value < 0.75f) { yield return Burrow(BossBrain.SpotNear(Heart(), 7f, 14f)); } switch (Pick(4f, 3.5f, 2.5f)) { case 0: yield return Spires(Phase2 ? 5 : 3); break; case 1: yield return Venom(Phase2 ? 8 : 5); break; default: yield return Gaze(); break; } yield return base.Breath; } private IEnumerator Burrow(Vector3 to) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) to = Stand(to); Vector3 from = base.Pos; Vector3 below = base.Pos + Vector3.down * (Height + 1.5f); Vector3 under = to + Vector3.down * (Height + 1.5f); Send("stone.dig", new Vector3(from.x, BossBrain.GroundY(from), from.z), from); for (float t = 0f; t < 0.6f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(from, below, t / 0.6f)); yield return null; } Siege.Instance.Hide(Body, hidden: true); Vector3 val = (to - from).Flat(); float time = Mathf.Max(0.6f, ((Vector3)(ref val)).magnitude / 9f); Send("stone.tunnel", from, to, Mathf.RoundToInt(time * 1000f)); for (float t = 0f; t < time; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(below, under, t / time)); yield return null; } yield return Warn("circle", new Vector3(to.x, BossBrain.GroundY(to), to.z), to, Reach + 1.5f, 0.8f); Siege.Instance.Hide(Body, hidden: false); Send("stone.rise", to, to, 0, Mathf.RoundToInt(Reach * 100f)); yield return Surface(to, 0.35f); Hit(BossBrain.Circle(to, Reach + 1.5f), 70f, 28f, 30f, to, 10f); AutoTest.Count("stone_burrow"); } protected override void Interrupted() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) base.Interrupted(); if (Siege.Instance.IsHidden(Body)) { Siege.Instance.Hide(Body, hidden: false); Put(Stand(base.Pos)); } } private IEnumerator Spires(int lines) { Vector3 val = (Heart() - base.Pos).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 at = new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z); List ends = new List(); for (int i = 0; i < lines; i++) { Vector3 val2 = at + Quaternion.Euler(0f, ((float)i - (float)(lines - 1) * 0.5f) * ((lines > 3) ? 34f : 30f), 0f) * normalized * 18f; val2.y = BossBrain.GroundY(val2); ends.Add(val2); WarnOnly("lane", at, val2, 2.4f, 1.3f); } Shout("stoneSpires"); Send("stone.rumble", at, at, 1300); yield return Warn("circle", at, at, Reach + 0.5f, 1.3f, breakable: true); foreach (Vector3 item in ends) { Send("stone.spires", at, item); Hit(BossBrain.Lane(at, item, 2.4f), 85f, 30f, 40f, at, 10f); } AutoTest.Count("stone_spires"); yield return 0.6f; } private IEnumerator Venom(int n) { List spots = BossBrains.Spots(base.Pos, n, 22f); float r = (Phase2 ? 3.2f : 2.4f); Send("stone.spines", base.Pos, base.Pos, 1000); foreach (Vector3 item in spots) { WarnOnly("circle", item, item, r, 1f); } yield return 1f; Vector3 a = base.Pos + Vector3.up * Height * 0.4f + base.Forward * Reach * 0.5f; foreach (Vector3 item2 in spots) { Send("stone.spit", a, item2); } yield return 0.5f; foreach (Vector3 item3 in spots) { Hit(BossBrain.Circle(item3, r), 40f, 14f, 18f, item3, 4f); Send("stone.pool", item3, item3, 7000, Mathf.RoundToInt(r * 100f)); Hazard(item3, r, 7f, Scaled(4f), Scaled(5f)); } AutoTest.Count("stone_venom"); } private IEnumerator Gaze() { Vector3 val = (Heart() - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; Vector3 at = new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z); yield return Turn(base.Pos + dir, 0.4f); Shout("stoneGaze"); Send("stone.eyes", base.Pos, base.Pos, 1500); yield return Warn("cone", at, at + dir * 22f, 0f, 1.5f, breakable: true, 0.04f, 35); Send("stone.gaze", base.Pos + Vector3.up * Height * 0.5f, at + dir * 22f, 0, 35); Func cone = BossBrain.Cone(at, dir, 22f, 35f); float num = 7f + (float)Tier * 0.3f; foreach (PieceState item in BossBrain.Pieces.Where((PieceState p) => Catalog.IsTurret(p.Type) && cone(p.Pos)).ToList()) { Bosses.Instance.Silence(item.Id, num); Send("stone.petrify", item.Pos, base.Pos, Mathf.RoundToInt(num * 1000f), item.Id); AutoTest.Count("stone_petrified"); } BossBrain.HurtPlayers(cone, Mathf.Min(70, Scaled(24f)), base.Pos, 5f); AutoTest.Count("stone_gaze"); yield return 0.5f; } } internal class Skyfish : BossBrain { private const float Ring = 30f; private const float Alt = 15f; private float _a; private static float Sea => WaterManager.GetWaterHeight(BossBrain.Center); private Vector3 OrbitPoint(float a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) return BossBrain.Center + new Vector3(Mathf.Cos(a), 0f, Mathf.Sin(a)) * 30f + Vector3.up * (Sea + 15f - BossBrain.Center.y); } protected override IEnumerator Entrance(float seconds) { Vector3 val = (BossBrain.Center - Home).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; Vector3.Cross(Vector3.up, dir); Vector3 a = base.Pos; Vector3 low = Home + dir * 6f + Vector3.up * 1f; Vector3 up = Home + dir * 2f + Vector3.up * 9f; for (float t = 0f; t < 0.9f; t += Time.deltaTime) { if (!base.Alive) { break; } Vector3 p = Vector3.Lerp(a, low, t / 0.9f); Put(p, Facing(low - a) * Quaternion.Euler(10f, 0f, 30f * Mathf.Sin(t * 4f))); yield return null; } Send("sky.pass", low, low); for (float t = 0f; t < 0.7f; t += Time.deltaTime) { if (!base.Alive) { break; } float num = t / 0.7f; Put(Vector3.Lerp(low, up, num), Facing(dir) * Quaternion.Euler(-60f * (1f - num), 0f, 0f)); yield return null; } for (float t = 0f; t < 0.6f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(up, Home, t / 0.6f), Quaternion.Slerp(base.T.rotation, Facing(dir), t / 0.6f)); yield return null; } Put(Home, Facing(BossBrain.Center - Home)); } protected override IEnumerator Act() { yield return Orbit(Random.Range(2f, 3.5f)); int num = Bosses.Instance.All.Count((BossBrain b) => !b.IsBoss && b.Kind == EnemyKind.Squadron); switch (Pick(4f, (num < 3) ? 3f : 0f, 3f)) { case 0: yield return Torpedo(); break; case 1: yield return Squadron(Phase2 ? 6 : 4); break; default: yield return Boom(); break; } yield return base.Breath * 0.6f; } private IEnumerator Orbit(float seconds) { _a = Mathf.Atan2(base.Pos.z - BossBrain.Center.z, base.Pos.x - BossBrain.Center.x); yield return Glide(OrbitPoint(_a), 16f); Vector3 dir = default(Vector3); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!base.Alive) { break; } _a += 7f / 15f * Time.deltaTime * base.SlowFactor; ((Vector3)(ref dir))..ctor(0f - Mathf.Sin(_a), 0f, Mathf.Cos(_a)); Put(OrbitPoint(_a) + Vector3.up * Mathf.Sin(t * 1.3f) * 1.2f, Facing(dir) * Quaternion.Euler(0f, 0f, 28f)); yield return null; } } private IEnumerator Torpedo() { Vector3 val = Heart(); Quaternion val2 = Quaternion.Euler(0f, Random.Range(-35f, 35f), 0f); Vector3 val3 = (val - base.Pos).Flat(); Vector3 run = val2 * ((Vector3)(ref val3)).normalized; Vector3 a = val - run * 20f; Vector3 b = val + run * 20f; a.y = BossBrain.GroundY(a); b.y = BossBrain.GroundY(b); yield return Glide(a - run * 10f + Vector3.up * 14f, 24f); Shout("skyfishDive"); yield return Warn("lane", a, b, 4.5f, 1.4f, breakable: true, 0.04f, 0, delegate(float k) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) Put(base.Pos, Facing(run) * Quaternion.Euler(18f * k, 0f, 0f)); }); val3 = (b - a).Flat(); float len = ((Vector3)(ref val3)).magnitude; Vector3 last = a - run * 99f; for (float d = -10f; d < len + 10f; d += 28f * base.SlowFactor * Time.deltaTime) { if (!base.Alive) { break; } Vector3 val4 = a + run * d; float num = ((d < 0f) ? (3f - d * 1.1f) : ((d > len) ? (3f + (d - len) * 1.1f) : 3f)); Put(new Vector3(val4.x, BossBrain.GroundY(val4) + Foot + num, val4.z), Facing(run) * Quaternion.Euler((d < 0f) ? 25f : ((d > len) ? (-25f) : 0f), 0f, 0f)); if (d >= 0f && d <= len) { val3 = (val4 - last).Flat(); if (((Vector3)(ref val3)).magnitude >= (Phase2 ? 2.2f : 3.2f)) { last = val4; val4.y = BossBrain.GroundY(val4); Hit(BossBrain.Circle(val4, 2.6f), 60f, 20f, 30f, val4, 8f); Send("sky.bomb", val4, val4); } } yield return null; } AutoTest.Count("skyfish_dive"); } private IEnumerator Squadron(int n) { Shout("skyfishSquadron"); Send("sky.call", base.Pos, base.Pos); for (int i = 0; i < n; i++) { if (!base.Alive) { break; } Summon(EnemyKind.Squadron, base.Pos + Quaternion.Euler(0f, (float)i * 360f / (float)n, 0f) * Vector3.forward * 5f - Vector3.up * 1f, new Kamikaze(), 1f); yield return 0.15f; } AutoTest.Count("skyfish_squadron", n); } private IEnumerator Boom() { Vector3 dir = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward; Vector3 a = BossBrain.Center - dir * 30f; Vector3 b = BossBrain.Center + dir * 30f; a.y = BossBrain.GroundY(a); b.y = BossBrain.GroundY(b); yield return Glide(a - dir * 12f + Vector3.up * 24f, 26f); Shout("skyfishBoom"); yield return Warn("lane", a, b, 7f, 1.8f, breakable: true); Vector3 val = (b - a).Flat(); float len = ((Vector3)(ref val)).magnitude; Send("sky.boom", a + Vector3.up * 7f, b + Vector3.up * 7f, Mathf.RoundToInt(len / 50f * 1000f)); HashSet hit = new HashSet(); HashSet hurt = new HashSet(); for (float d = -8f; d < len + 8f; d += 50f * Time.deltaTime) { if (!base.Alive) { break; } Vector3 val2 = a + dir * d; Put(new Vector3(val2.x, BossBrain.GroundY(val2) + Foot + 7f, val2.z), Facing(dir)); if (d >= 0f && d <= len) { HitOnce(hit, hurt, BossBrain.Circle(val2, 3.5f), 140f, 30f, 60f, val2, 14f); } yield return null; } AutoTest.Count("skyfish_boom"); } protected override IEnumerator Fall() { Vector3 from = base.Pos; Vector3 to = Stand(base.Pos); Send("sky.fall", from, to); for (float t = 0f; t < 0.7f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)Body)) { break; } float num = t / 0.7f; Put(Vector3.Lerp(from, to, num * num), base.T.rotation * Quaternion.Euler(0f, 0f, 400f * Time.deltaTime)); yield return null; } Put(to, Facing(base.Forward) * Quaternion.Euler(0f, 0f, 90f)); Send("stomp", to, to); } protected override IEnumerator Recover() { yield return Glide(base.Pos + Vector3.up * 10f, 8f); } protected override IEnumerator SecondForm() { Shout("skyfishPhase2"); Send("phase2", base.Pos, base.Pos); yield return Glide(base.Pos + Vector3.up * 8f, 10f); } } internal class Kamikaze : BossBrain { protected override IEnumerator Act() { Vector3 c = base.Pos; float a = Random.value * 6.28f; float t = 0f; for (float end = Random.Range(1.2f, 2.4f); t < end; t += Time.deltaTime) { if (!base.Alive) { break; } a += 2.4f * Time.deltaTime; Put(c + new Vector3(Mathf.Cos(a) * 3f, Mathf.Sin(t * 3f) * 0.3f, Mathf.Sin(a) * 3f), Facing(new Vector3(0f - Mathf.Sin(a), 0f, Mathf.Cos(a)))); yield return null; } PieceState? pieceState = BossBrain.Best((PieceState p) => Catalog.IsTurret(p.Type), delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (p.Pos - base.Pos).Flat(); return 0f - ((Vector3)(ref val)).magnitude + Random.value * 12f; }); Vector3 at = (pieceState.HasValue ? pieceState.Value.Pos : BossBrain.Core); yield return Warn("circle", at, at, 2.2f, 1f); yield return Glide(at + Vector3.up * 0.6f, 24f); Hit(BossBrain.Circle(at, 2.2f), 80f, 20f, 25f, at, 8f); Send("sky.bomb", at, at); AutoTest.Count("squadron_hit"); FortressPlugin.Alive.Remove(Body); Stop(); ((Item)Body).DestroyItem((byte)0, byte.MaxValue); } } internal class Kraken : BossBrain { private int _gap; private int _moves; private Vector3 Shore => new Vector3(base.Pos.x, WaterManager.GetWaterHeight(base.Pos), base.Pos.z); private Vector3 SeaSpot(int gap) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = BossBrain.Center + BossBrain.GapDir(gap) * 31f; val.y = WaterManager.GetWaterHeight(val) - Height * 0.3f + Foot; return val; } protected override IEnumerator Entrance(float seconds) { _gap = BossBrain.NearestGap(Home); Vector3 to = SeaSpot(_gap); Send("kraken.rise", to, to, 1600); yield return 0.5f; Vector3 from = base.Pos; for (float t = 0f; t < 1.3f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(from, to, Mathf.SmoothStep(0f, 1f, t / 1.3f)), Facing(BossBrain.Center - to)); yield return null; } Put(to, Facing(BossBrain.Center - to)); } protected override IEnumerator Act() { if (++_moves % 3 == 0) { yield return Move((_gap + ((Random.value < 0.5f) ? 1 : 2)) % 3); } Kraken kraken = this; float[] obj = new float[4] { 4f, 3f, 3f, 0f }; obj[3] = (Phase2 ? 2.5f : 0f); switch (kraken.Pick(obj)) { case 0: yield return Sweep(); break; case 1: yield return Grab((!Phase2) ? 1 : 2); break; case 2: yield return Ink(); break; default: yield return Whirl(); break; } yield return base.Breath; } private IEnumerator Move(int gap) { Vector3 from = base.Pos; Vector3 down = base.Pos + Vector3.down * (Height + 2f); Send("kraken.dive", from, from); for (float t = 0f; t < 0.8f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(from, down, t / 0.8f)); yield return null; } Siege.Instance.Hide(Body, hidden: true); _gap = gap; Vector3 to = SeaSpot(gap); Vector3 under = to + Vector3.down * (Height + 2f); Put(under, Facing(BossBrain.Center - to)); yield return 1f; Send("kraken.rise", to, to, 900); yield return 0.4f; Siege.Instance.Hide(Body, hidden: false); for (float t = 0f; t < 0.9f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(under, to, Mathf.SmoothStep(0f, 1f, t / 0.9f))); yield return null; } AutoTest.Count("kraken_moved"); } protected override void Interrupted() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) base.Interrupted(); if (Siege.Instance.IsHidden(Body)) { Siege.Instance.Hide(Body, hidden: false); Put(SeaSpot(_gap)); } } private IEnumerator Sweep() { Vector3 val = (BossBrain.Center - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; float range = 21f; float half = (Phase2 ? 50f : 38f); Shout("krakenSweep"); Send("kraken.tentacles", Shore, Shore + dir * range, 1400, Phase2 ? 5 : 3); yield return Warn("cone", Shore, Shore + dir * range, 0f, 1.4f, breakable: true, 0.04f, Mathf.RoundToInt(half)); Hit(BossBrain.Cone(Shore, dir, range, half), 95f, 30f, 45f, Shore, 12f); Send("kraken.sweep", Shore, Shore + dir * range, 0, Mathf.RoundToInt(half)); AutoTest.Count("kraken_sweep"); yield return 0.6f; } private IEnumerator Grab(int n) { List turrets = BossBrain.Pieces.Where(delegate(PieceState p) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) if (Catalog.IsTurret(p.Type)) { Vector3 val = (p.Pos - base.Pos).Flat(); return ((Vector3)(ref val)).magnitude < 26f; } return false; }).OrderBy(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val = p.Pos - base.Pos; return ((Vector3)(ref val)).sqrMagnitude; }).Take(n) .ToList(); if (turrets.Count == 0) { yield return Sweep(); yield break; } Shout("krakenGrab", always: true); foreach (PieceState item in turrets) { Send("kraken.reach", item.Pos, Shore, 2000, item.Id); } foreach (PieceState item2 in turrets.Skip(1)) { WarnOnly("circle", item2.Pos, item2.Pos, 2.2f, 2f); } yield return Warn("circle", turrets[0].Pos, turrets[0].Pos, 2.2f, 2f, breakable: true, 0.05f); HashSet hashSet = new HashSet(BossBrain.Pieces.Select((PieceState p) => p.Id)); foreach (PieceState item3 in turrets) { if (hashSet.Contains(item3.Id)) { Send("kraken.grab", item3.Pos, Shore, 0, item3.Id); BuildSystem.Instance.ServerTakePiece(item3.Id); AutoTest.Count("kraken_grab"); } } yield return 0.8f; } private IEnumerator Ink() { Vector3 pos = base.Pos; Vector3 val = (BossBrain.Center - base.Pos).Flat(); Vector3 at = pos + ((Vector3)(ref val)).normalized * 14f; at.y = BossBrain.GroundY(at); float r = 7f + (float)Tier * 0.1f; yield return Warn("circle", at, at, r, 1f); Send("kraken.ink", at, Shore, 6000, Mathf.RoundToInt(r * 100f)); foreach (PieceState item in BossBrain.Pieces.Where(delegate(PieceState p) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) if (Catalog.IsTurret(p.Type)) { Vector3 val2 = (p.Pos - at).Flat(); return ((Vector3)(ref val2)).magnitude <= r; } return false; }).ToList()) { Bosses.Instance.Silence(item.Id, 6f); } Hazard(at, r, 6f, Scaled(2f), 0); Shout("krakenInk"); AutoTest.Count("kraken_ink"); } private IEnumerator Whirl() { Vector3 shore = Shore; Vector3 val = (BossBrain.Center - base.Pos).Flat(); Vector3 at = shore + ((Vector3)(ref val)).normalized * 5f; at.y = WaterManager.GetWaterHeight(at); Shout("krakenWhirl"); Send("kraken.whirl", at, at, 7000, 1500); for (float t = 0f; t < 7f; t += 0.5f) { if (!base.Alive) { break; } foreach (Player item in BossBrain.Targets.ToList()) { Vector3 val2 = (at - item.Transform.position).Flat(); if (!(((Vector3)(ref val2)).magnitude > 16f)) { if (((Vector3)(ref val2)).magnitude < 4f) { Siege.HurtPlayer(item, Mathf.Min(70, Scaled(6f)), Vector3.up * 4f); } else { Siege.HurtPlayer(item, 1, ((Vector3)(ref val2)).normalized * 7f + Vector3.up); } } } yield return 0.5f; } AutoTest.Count("kraken_whirl"); } } internal class Voxel : BossBrain { private const float Hover = 2.5f; private int _undos; protected override IEnumerator Entrance(float seconds) { Send("voxel.load", Home, Home, 900); yield return 0.9f; Put(Home, Facing(BossBrain.Center - Home)); Send("voxel.in", Home, Home); } private IEnumerator Blink(Vector3 to) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Send("voxel.out", base.Pos, base.Pos); yield return 0.15f; Put(to, Facing(BossBrain.Core - to)); Send("voxel.in", to, to); yield return 0.3f; } private Vector3 HoverSpot() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_002f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = BossBrain.SpotNear(BossBrain.Center, 12f, 22f); val.y = BossBrain.GroundY(val) + Foot + 2.5f; return val; } protected override IEnumerator Act() { yield return Blink(HoverSpot()); int num = Bosses.Instance.All.Count((BossBrain b) => !b.IsBoss && b.Kind == EnemyKind.Glitch); switch (Pick((num < (Phase2 ? 4 : 2)) ? 3f : 0f, 4f, (base.Hp01 < 0.85f && _undos < 3) ? 2f : 0f, 3f)) { case 0: yield return Copy(Phase2 ? 4 : 2); break; case 1: yield return Delete((!Phase2) ? 1 : 2); break; case 2: yield return Undo(); break; default: yield return Bolts(Phase2 ? 14 : 9); break; } yield return base.Breath; } private IEnumerator Copy(int n) { Shout("voxelCopy"); Send("voxel.copy", base.Pos + Vector3.up * (Height + 1f), base.Pos, 900); yield return 0.9f; for (int i = 0; i < n; i++) { Vector3 val = HoverSpot(); if (Object.op_Implicit((Object)(object)Summon(EnemyKind.Glitch, val - Vector3.up * 2.5f, new GlitchCopy(), 1f))) { Send("voxel.in", val, val); } } AutoTest.Count("voxel_copies", n); yield return Blink(HoverSpot()); } private IEnumerator Delete(int boxes) { List<(Vector3 c, Vector3 to)> centres = new List<(Vector3, Vector3)>(); List pieces = BossBrain.Pieces.ToList(); for (int i = 0; i < boxes; i++) { Vector3 best = (from p in pieces orderby (float)pieces.Count(delegate(PieceState q) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val4 = (q.Pos - p.Pos).Flat(); return ((Vector3)(ref val4)).magnitude < 4f; }) + Random.value descending select p.Pos).FirstOrDefault(); Vector3 val = ((best != Vector3.zero && centres.All(delegate((Vector3 c, Vector3 to) x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val4 = (x.c - best).Flat(); return ((Vector3)(ref val4)).magnitude > 8f; })) ? best : BossBrain.SpotNear(BossBrain.Core, 3f, 12f)); val.y = BossBrain.GroundY(val); Vector3 val2 = val + Quaternion.Euler(0f, Random.Range(0f, 90f), 0f) * Vector3.forward; centres.Add((val, val2)); WarnOnly("box", val, val2, 4f, 1.6f); Send("voxel.select", val, val2, 1600, Mathf.RoundToInt(400f)); } Shout("voxelDelete", always: true); yield return Warn("circle", new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z), base.Pos, 2f, 1.6f, breakable: true); foreach (var item3 in centres) { Vector3 item = item3.c; Vector3 item2 = item3.to; Vector3 val3 = (item2 - item).Flat(); Vector3 normalized = ((Vector3)(ref val3)).normalized; Func inBox = BossBrain.Lane(item - normalized * 4f, item + normalized * 4f, 8f); foreach (PieceState item4 in BossBrain.Pieces.Where((PieceState p) => inBox(p.Pos)).ToList()) { BuildSystem.Instance.ServerDamagePiece(item4.Id, Mathf.Max(Scaled(140f), Mathf.RoundToInt((float)item4.MaxHp * 0.45f))); } if (inBox(BossBrain.Core)) { Siege.Instance.DamageCore(Scaled(60f)); } BossBrain.HurtPlayers(inBox, Mathf.Min(70, Scaled(25f)), item, 6f); Send("voxel.delete", item, item2, 0, Mathf.RoundToInt(400f)); } AutoTest.Count("voxel_delete"); yield return 0.5f; } private IEnumerator Undo() { _undos++; Shout("voxelUndo", always: true); Send("voxel.undo", base.Pos, base.Pos, 3000); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z); yield return Warn("ring", val, val, Reach + 3f, 3f, breakable: true, 0.03f, Mathf.RoundToInt((Reach + 1f) * 100f)); Body.ServerChangeHp(-Mathf.RoundToInt((float)MaxHp * 0.12f)); Send("voxel.restored", base.Pos, base.Pos); AutoTest.Count("voxel_undo"); } private IEnumerator Bolts(int n) { List spots = BossBrains.Spots(base.Pos, n, 24f); foreach (Vector3 item in spots) { WarnOnly("circle", item, item, 1.3f, 0.8f); } yield return 0.8f; foreach (Vector3 item2 in spots) { Send("voxel.bolt", base.Pos + base.Forward * Reach * 0.7f, item2); } yield return 0.35f; foreach (Vector3 item3 in spots) { Hit(BossBrain.Circle(item3, 1.3f), 35f, 14f, 18f, item3, 4f); } AutoTest.Count("voxel_bolts"); } protected override IEnumerator SecondForm() { Shout("voxelPhase2"); Send("voxel.fatal", base.Pos, base.Pos, 2500); yield return 2.5f; } } internal class GlitchCopy : BossBrain { protected override IEnumerator Act() { yield return Random.Range(1.5f, 3f); Vector3 spot = BossBrains.Spots(base.Pos, 1, 20f).FirstOrDefault(); if (!(spot == Vector3.zero)) { yield return Warn("circle", spot, spot, 1.3f, 0.8f); Send("voxel.bolt", base.Pos, spot); yield return 0.35f; Hit(BossBrain.Circle(spot, 1.3f), 30f, 12f, 15f, spot, 4f); if (Random.value < 0.35f) { Vector3 val = BossBrain.SpotNear(BossBrain.Center, 12f, 22f); val.y = BossBrain.GroundY(val) + Foot + 2.5f; Send("voxel.out", base.Pos, base.Pos); Put(val, Facing(BossBrain.Core - val)); Send("voxel.in", val, val); } } } } internal class Koi : BossBrain { private float _a; private float _t; private static float Sea => WaterManager.GetWaterHeight(BossBrain.Center); private Vector3 Mouth => base.Pos + base.Forward * Reach * 0.9f; private Vector3 SwimPoint(float a, float t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_0070: Unknown result type (might be due to invalid IL or missing references) return BossBrain.Center + new Vector3(Mathf.Cos(a), 0f, Mathf.Sin(a)) * (23f + 3f * Mathf.Sin(t * 0.7f)) + Vector3.up * (Sea + 8f + 2.5f * Mathf.Sin(t * 1.3f) - BossBrain.Center.y); } protected override IEnumerator Entrance(float seconds) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(base.Pos.x, WaterManager.GetWaterHeight(base.Pos), base.Pos.z); Send("koi.gate", val, val, 2200); yield return 0.5f; yield return Leap(Home, 10f, 1.3f); } protected override IEnumerator Act() { yield return Swim(Random.Range(2f, 3.5f)); if (!Phase2) { switch (Pick(4f, 3f, 3f)) { case 0: yield return Jet(); break; case 1: yield return GateLeap(); break; default: yield return Rain(10 + Tier / 2); break; } } else { switch (Pick(4f, 3f, 3f)) { case 0: yield return Fire(); break; case 1: yield return Thunder(8); break; default: yield return GateLeap(); break; } } yield return base.Breath; } private IEnumerator Swim(float seconds) { _a = Mathf.Atan2(base.Pos.z - BossBrain.Center.z, base.Pos.x - BossBrain.Center.x); yield return Glide(SwimPoint(_a, _t), 12f); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!base.Alive) { break; } _a += 0.39130434f * Time.deltaTime * base.SlowFactor; _t += Time.deltaTime; Vector3 val = SwimPoint(_a, _t); Vector3 val2 = SwimPoint(_a + 0.05f, _t + 0.05f) - val; Put(val, Quaternion.LookRotation(((Vector3)(ref val2)).normalized) * Quaternion.Euler(0f, 0f, Mathf.Sin(_t * 2f) * 12f) * BossLooks.Turn(Kind)); yield return null; } } private IEnumerator Jet() { Vector3 aim = Heart(); yield return Turn(aim, 0.4f); Vector3 val = (aim - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; Vector3 g = new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z); Shout("koiJet"); yield return Warn("cone", g, g + dir * 24f, 0f, 1.2f, breakable: true, 0.04f, Mathf.RoundToInt(28f)); Send("koi.jet", Mouth, g + dir * 24f, 1300, Mathf.RoundToInt(28f)); float next = 0f; for (float t = 0f; t < 1.3f; t += Time.deltaTime) { if (!base.Alive) { break; } if (t >= next) { next = t + 0.15f; Vector3 val2 = g + Quaternion.Euler(0f, Mathf.Lerp(-28f, 28f, t / 1.3f), 0f) * dir * 24f; val2.y = BossBrain.GroundY(val2); Hit(BossBrain.Lane(g, val2, 1.8f), 30f, 10f, 12f, g, 5f); } yield return null; } AutoTest.Count("koi_jet"); } private IEnumerator GateLeap() { Vector3 at = Heart(); at.y = BossBrain.GroundY(at); float r = (Phase2 ? 6.5f : 5.5f); yield return Glide(Vector3.Lerp(base.Pos, at, 0.4f) + Vector3.up * 18f, 16f); if (Phase2) { Shout("koiDragonDive"); } else { Shout("koiLeap"); } yield return Warn("circle", at, at, r, 1.5f, breakable: true, 0.04f, 0, delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_002f: 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_0044: Unknown result type (might be due to invalid IL or missing references) Koi koi = this; Vector3 pos = base.Pos; Vector3 val = at - base.Pos; koi.Put(pos, Quaternion.LookRotation(((Vector3)(ref val)).normalized) * BossLooks.Turn(Kind)); }); Vector3 from = base.Pos; Vector3 to = at + Vector3.up * Foot * 0.4f; for (float t = 0f; t < 0.45f; t += Time.deltaTime) { if (!base.Alive) { break; } float num = t / 0.45f; Put(Vector3.Lerp(from, to, num * num)); yield return null; } Hit(BossBrain.Circle(at, r), 120f, 35f, 55f, at, 14f); Send("koi.splash", at, at, 0, Mathf.RoundToInt(r * 100f)); AutoTest.Count("koi_leap"); yield return 0.4f; yield return Glide(at + Vector3.up * 9f, 10f); } private IEnumerator Rain(int n) { List spots = BossBrains.Spots(BossBrain.Core, n, 24f, 20f); foreach (Vector3 item in spots) { WarnOnly("circle", item, item, 1.8f, 1.4f); } Send("koi.call", base.Pos, base.Pos, 1400); yield return 1.4f; foreach (Vector3 item2 in spots) { Send("koi.drop", item2, item2); Hit(BossBrain.Circle(item2, 1.8f), 40f, 14f, 18f, item2, 5f); } AutoTest.Count("koi_rain"); } private IEnumerator Fire() { Vector3 aim = Heart(); yield return Turn(aim, 0.4f); Vector3 val = (aim - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; Vector3 g = new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z); Shout("koiFire"); yield return Warn("cone", g, g + dir * 21f, 0f, 1.4f, breakable: true, 0.04f, Mathf.RoundToInt(30f)); Send("koi.breath", Mouth, g + dir * 21f, 1200, Mathf.RoundToInt(30f)); Func cone = BossBrain.Cone(g, dir, 21f, 30f); Hit(cone, 110f, 35f, 50f, g, 8f); foreach (PieceState item in BossBrain.Pieces.Where((PieceState x) => cone(x.Pos)).ToList()) { Hazard(item.Pos, 1.2f, 4f, Scaled(4f), Scaled(10f)); Send("koi.burn", item.Pos, item.Pos, 4000); } AutoTest.Count("koi_fire"); yield return 0.5f; } private IEnumerator Thunder(int n) { List spots = BossBrains.Spots(BossBrain.Core, n, 24f, 18f); foreach (Vector3 item in spots) { WarnOnly("circle", item, item, 2.6f, 1.5f); } Shout("koiThunder"); Send("koi.charge", base.Pos, base.Pos, 1500); yield return 1.5f; foreach (Vector3 item2 in spots) { Send("koi.thunder", item2, item2); Hit(BossBrain.Circle(item2, 2.6f), 90f, 30f, 40f, item2, 8f); } AutoTest.Count("koi_thunder"); yield return 0.4f; } protected override IEnumerator SecondForm() { Shout("koiDragon"); Koi koi = this; Vector3 center = BossBrain.Center; Vector3 val = (base.Pos - BossBrain.Center).Flat(); yield return koi.Glide(center + ((Vector3)(ref val)).normalized * 16f + Vector3.up * (Sea + 20f - BossBrain.Center.y), 12f); Send("koi.dragon", base.Pos, base.Pos, 2600); yield return 2.6f; } } internal class Eye : BossBrain { private const float Alt = 13f; private bool _judged; private static float Sea => WaterManager.GetWaterHeight(BossBrain.Center); private Vector3 Under => new Vector3(base.Pos.x, BossBrain.GroundY(base.Pos), base.Pos.z); protected override IEnumerator Entrance(float seconds) { Send("eye.descend", Home, base.Pos, 2600); Vector3 from = base.Pos; for (float t = 0f; t < 2.6f; t += Time.deltaTime) { if (!base.Alive) { break; } Put(Vector3.Lerp(from, Home, Mathf.SmoothStep(0f, 1f, t / 2.6f)), Facing(BossBrain.Center - Home) * Quaternion.Euler(0f, 90f * (1f - t / 2.6f), 0f)); yield return null; } Put(Home, Facing(BossBrain.Center - Home)); } protected override void OnStop() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Send("eye.red", base.Pos, base.Pos); } protected override IEnumerator Act() { float num = Mathf.Atan2(base.Pos.z - BossBrain.Center.z, base.Pos.x - BossBrain.Center.x) + Random.Range(-0.8f, 0.8f); Vector3 to = BossBrain.Center + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * 25f; to.y = Sea + 13f; yield return Glide(to, 5f); yield return Turn(BossBrain.Core, 0.6f); if (Phase2 && !_judged && base.Hp01 <= 0.25f) { yield return Judgment(); yield break; } switch (Pick(4f, 3.5f, 3.5f)) { case 0: yield return Beam(); break; case 1: yield return Spears(Phase2 ? 3 : 2); break; default: yield return Echoes(Phase2 ? 3 : 2); break; } yield return base.Breath; } private IEnumerator Beam() { Vector3 val = (BossBrain.Core - base.Pos).Flat(); Vector3 dir = ((Vector3)(ref val)).normalized; Vector3 g = Under; Shout("eyeGaze"); Send("eye.open", base.Pos, base.Pos, 1600); yield return Warn("cone", g, g + dir * 36f, 0f, 1.6f, breakable: true, 0.035f, Mathf.RoundToInt(32f)); Send("eye.beam", base.Pos, g + dir * 36f, 2400, Mathf.RoundToInt(32f)); float next = 0f; for (float t = 0f; t < 2.4f; t += Time.deltaTime) { if (!base.Alive) { break; } if (t >= next) { next = t + 0.15f; Vector3 b = g + Quaternion.Euler(0f, Mathf.Lerp(-32f, 32f, t / 2.4f), 0f) * dir * 36f; Hit(BossBrain.Lane(g, b, 2.4f), 26f, 12f, 15f, g, 4f); } yield return null; } AutoTest.Count("eye_beam"); } private IEnumerator Spears(int batches) { Shout("eyeSpears"); for (int b = 0; b < batches; b++) { if (!base.Alive) { break; } List spots = BossBrains.Spots(BossBrain.Core, 33, 30f, 26f); foreach (Vector3 item in spots) { WarnOnly("circle", item, item, 1.5f, 1.6f); } Send("eye.spears", base.Pos, base.Pos, 1600); yield return 1.6f; foreach (Vector3 item2 in spots) { Send("eye.spear", item2, item2); Hit(BossBrain.Circle(item2, 1.5f), 50f, 18f, 25f, item2, 5f); } AutoTest.Count("eye_spears"); yield return 0.5f; } } private IEnumerator Echoes(int n) { Shout("eyeEchoes"); List list = (from _ in Enumerable.Range(0, 6) orderby Random.value select _).Take(n).ToList(); List hits = new List(); using (List.Enumerator enumerator = list.GetEnumerator()) { while (enumerator.MoveNext()) { switch (enumerator.Current) { case 0: foreach (PieceState item in BossBrain.Pieces.OrderByDescending((PieceState p) => (float)p.MaxHp + Random.value * 100f).Take(3).ToList()) { Vector3 at = item.Pos; WarnOnly("circle", at, at, 2.6f, 1.6f); hits.Add(delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Hit(BossBrain.Circle(at, 2.6f), 150f, 30f, 45f, at, 9f); Send("eye.echo", at, at, 0, 260); }); } break; case 1: { Vector3 val2 = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward; Vector3 a2 = BossBrain.Center - val2 * 26f; Vector3 b2 = BossBrain.Center + val2 * 26f; a2.y = BossBrain.GroundY(a2); b2.y = BossBrain.GroundY(b2); WarnOnly("lane", a2, b2, 5f, 1.6f); hits.Add(delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Hit(BossBrain.Lane(a2, b2, 5f), 90f, 28f, 45f, BossBrain.Center, 12f); Send("eye.echoLane", a2, b2, 0, 500); }); break; } case 2: { Vector3 val3 = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward; Vector3 val4 = Vector3.Cross(Vector3.up, val3); for (int num2 = -1; num2 <= 1; num2++) { Vector3 a3 = BossBrain.Center + val4 * (float)num2 * 7f - val3 * 28f; Vector3 b3 = BossBrain.Center + val4 * (float)num2 * 7f + val3 * 28f; a3.y = BossBrain.GroundY(a3); b3.y = BossBrain.GroundY(b3); WarnOnly("lane", a3, b3, 3f, 1.6f); hits.Add(delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Hit(BossBrain.Lane(a3, b3, 3f), 70f, 26f, 35f, a3, 10f); Send("eye.echoLane", a3, b3, 0, 300); }); } break; } case 3: { Vector3 o = BossBrain.SpotNear(BossBrain.Core, 4f, 10f); for (int num = 0; num < 4; num++) { Vector3 e = o + Quaternion.Euler(0f, (float)num * 90f + 45f, 0f) * Vector3.forward * 14f; e.y = BossBrain.GroundY(e); WarnOnly("lane", o, e, 2.4f, 1.6f); hits.Add(delegate { //IL_0011: 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_003b: 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_0067: Unknown result type (might be due to invalid IL or missing references) Hit(BossBrain.Lane(o, e, 2.4f), 85f, 30f, 40f, o, 10f); Send("eye.echoLane", o, e, 0, 240); }); } break; } case 4: { Vector3 val = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward; Vector3 a = BossBrain.Core - val * 20f; Vector3 b = BossBrain.Core + val * 20f; a.y = BossBrain.GroundY(a); b.y = BossBrain.GroundY(b); WarnOnly("lane", a, b, 4.5f, 1.6f); hits.Add(delegate { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) for (float num3 = 0f; num3 <= 40f; num3 += 3.2f) { Vector3 val5 = Vector3.Lerp(a, b, num3 / 40f); Hit(BossBrain.Circle(val5, 2.6f), 60f, 20f, 30f, val5, 8f); Send("eye.echo", val5, val5, 0, 260); } }); break; } default: { int gap = Random.Range(0, 3); Vector3 sea = BossBrain.Center + BossBrain.GapDir(gap) * 31f; Vector3 dir = -BossBrain.GapDir(gap); sea.y = WaterManager.GetWaterHeight(sea); WarnOnly("cone", sea, sea + dir * 21f, 0f, 1.6f, 40); hits.Add(delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Hit(BossBrain.Cone(sea, dir, 21f, 40f), 95f, 30f, 45f, sea, 12f); Send("eye.echoCone", sea, sea + dir * 21f, 0, 40); }); break; } } } } Send("eye.open", base.Pos, base.Pos, 1600); yield return 1.6f; foreach (Action item2 in hits) { item2(); } AutoTest.Count("eye_echoes"); yield return 0.6f; } private IEnumerator Judgment() { _judged = true; Shout("eyeJudgment", always: true); yield return Glide(BossBrain.Core + Vector3.up * 17f, 10f); Send("eye.judgment", base.Pos, BossBrain.Core, 8000); yield return Warn("circle", BossBrain.Core, BossBrain.Core, 12f, 8f, breakable: true, 0.06f); Siege.Instance.DamageCore(Mathf.RoundToInt((float)Siege.Instance.CoreMax * 0.3f)); Hit(BossBrain.Circle(BossBrain.Core, 12f), 200f, 45f, 0f, BossBrain.Core, 16f); Send("eye.verdict", BossBrain.Core, BossBrain.Core); AutoTest.Count("eye_judgment"); yield return 1f; } protected override IEnumerator Fall() { Vector3 from = base.Pos; Vector3 to = base.Pos - Vector3.up * 6f; for (float t = 0f; t < 0.5f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)Body)) { break; } Put(Vector3.Lerp(from, to, t / 0.5f)); yield return null; } } protected override IEnumerator Recover() { yield return Glide(base.Pos + Vector3.up * 6f, 6f); } protected override IEnumerator SecondForm() { Shout("eyePhase2"); Send("eye.red", base.Pos, base.Pos, 1); Send("phase2", base.Pos, base.Pos); Send("eye.open", base.Pos, base.Pos, 2000); yield return 2f; } } public class Bosses : MonoBehaviour { public static Bosses Instance; public const float CrashAfter = 200f; internal static readonly HashSet Puppets = new HashSet(); private readonly Dictionary _brains = new Dictionary(); private readonly Dictionary _silenced = new Dictionary(); private float _nextAura; public static bool Dark; public const float LightReach = 10f; internal static bool TestKill; private float _nextPrune; public IEnumerable All => _brains.Values; private void Awake() { Instance = this; } public static BossBrain Of(Creature c) { if (!Object.op_Implicit((Object)(object)Instance) || !Object.op_Implicit((Object)(object)c) || !Instance._brains.TryGetValue(c, out var value)) { return null; } return value; } public static bool IsPuppet(Creature c) { if (Object.op_Implicit((Object)(object)c)) { return Puppets.Contains(c); } return false; } public void ServerAdd(Creature c, EnemyKind kind, int wave, float hold, Vector3 home) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) BossBrain bossBrain = BossBrains.Make(kind); bossBrain.Init(c, kind, wave, home); _brains[c] = bossBrain; Puppets.Add(c); bossBrain.Hold(hold); } public void ServerAddMinion(Creature c, BossBrain b, EnemyKind kind, int wave) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) b.IsBoss = false; b.Init(c, kind, wave, ((Component)c).transform.position); _brains[c] = b; Puppets.Add(c); b.Hold(0f); } public void ServerClear() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) foreach (BossBrain value in _brains.Values) { value.Stop(); } _brains.Clear(); _silenced.Clear(); Dark = false; BossFx.Send("dark", null, Vector3.zero, Vector3.zero); } public void DebugAge(float seconds) { foreach (BossBrain value in _brains.Values) { value.Age(seconds); } } public void Interrupt(Creature c) { BossBrain bossBrain = Of(c); if (bossBrain != null && bossBrain.TryBreak(byConch: true)) { AutoTest.Count("boss_interrupted"); } } public void Silence(int pieceId, float seconds) { _silenced[pieceId] = Mathf.Max(_silenced.TryGetValue(pieceId, out var value) ? value : 0f, Time.time + seconds); } public bool IsSilenced(int pieceId) { if (_silenced.TryGetValue(pieceId, out var value)) { return Time.time < value; } return false; } public static float RangeAt(Vector3 turret) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0028: Unknown result type (might be due to invalid IL or missing references) if (Dark && Object.op_Implicit((Object)(object)Siege.Instance)) { Vector3 val = (turret - Siege.Instance.CorePos).Flat(); if (((Vector3)(ref val)).sqrMagnitude > 100f) { return 0.5f; } } return 1f; } public static bool Entering(Creature c) { BossBrain bossBrain = Of(c); if (bossBrain != null && bossBrain.IsBoss) { return !bossBrain.IsLive; } return false; } internal static int OnHurt(Creature c, int dmg) { if (dmg > 0) { BossBrain bossBrain = Of(c); if (bossBrain != null) { if (bossBrain.IsBoss && !bossBrain.IsLive && !TestKill) { AutoTest.Count("boss_hit_in_entrance"); return 0; } float num = bossBrain.TakeMult * (Turrets.Firing ? bossBrain.TurretMult : 1f); int num2 = Mathf.Max(1, Mathf.RoundToInt((float)dmg * num)); if (Turrets.Firing) { bossBrain.ByTurrets += num2; } else { bossBrain.ByPlayers += num2; bossBrain.PlayerDamage(num2); } return num2; } } return dmg; } private void Update() { //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) if (!InstanceFinder.IsServerStarted || _brains.Count == 0) { return; } if (FortressPlugin.Frozen) { foreach (Creature key in _brains.Keys) { if (Object.op_Implicit((Object)(object)key)) { Siege.Synced((Item)(object)key); } } return; } bool flag = Time.time >= _nextAura; if (flag) { _nextAura = Time.time + 0.5f; } foreach (KeyValuePair item in _brains.ToList()) { BossBrain value = item.Value; if (!Object.op_Implicit((Object)(object)item.Key) || item.Key._hp.Value <= 0 || !Siege.Instance.ServerActive) { value.Stop(); _brains.Remove(item.Key); if (Object.op_Implicit((Object)(object)item.Key) && item.Key._hp.Value <= 0) { if (value.IsBoss) { value.Report(down: true); value.Died(); BossTrophies.ServerDrop(value.Kind, ((Component)item.Key).transform.position, value.Wave); } ((MonoBehaviour)this).StartCoroutine(Gone(item.Key, value.IsBoss ? 1.8f : 0.5f)); } } else { value.Tick(); if (flag && value.IsBoss) { value.Aura(); } if (AutoTest.Running && Time.time >= value.NextTrace) { value.NextTrace = Time.time + 3f; BuildSystem.Log.LogInfo((object)("boss trace " + value.Trace())); } } } if (!_brains.Values.Any((BossBrain b) => b.IsBoss) && Dark) { Dark = false; BossFx.Send("dark", null, Vector3.zero, Vector3.zero); } } private static IEnumerator Gone(Creature c, float seconds) { Vector3 from = ((Component)c).transform.position; Vector3 to = from + Vector3.down * Mathf.Max(3f, from.y - BossFx.Ground(from) + 3f); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)c)) { break; } float num = t / seconds; if (Object.op_Implicit((Object)(object)((Item)c).Rig)) { ((Item)c).Rig.MovePosition(Vector3.Lerp(from, to, num * num)); } Siege.Synced((Item)(object)c); yield return null; } if (Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned && !((Item)c).IsDestroying) { ((Item)c).DestroyItem((byte)0, byte.MaxValue); } } private void LateUpdate() { if (!(Time.time < _nextPrune)) { _nextPrune = Time.time + 3f; Puppets.RemoveWhere((Creature c) => !Object.op_Implicit((Object)(object)c)); } } } internal class Runner { private readonly Stack _stack = new Stack(); private float _until; public bool Idle => _stack.Count == 0; public string Doing => string.Join(" < ", _stack.Select((IEnumerator e) => e.GetType().Name.Split('>')[0].TrimStart('<'))); public void Start(IEnumerator e) { _stack.Clear(); if (e != null) { _stack.Push(e); } _until = 0f; } public void Stop() { _stack.Clear(); } public void Tick() { if (Time.time < _until) { return; } int num = 0; while (_stack.Count > 0 && num < 64) { IEnumerator enumerator = _stack.Peek(); bool flag; try { flag = enumerator.MoveNext(); } catch (Exception ex) { BuildSystem.Log.LogError((object)("boss brain: " + ex)); _stack.Clear(); break; } if (_stack.Count == 0 || _stack.Peek() != enumerator) { if (Time.time < _until) { break; } } else if (!flag) { _stack.Pop(); } else { object current = enumerator.Current; if (!(current is IEnumerator item)) { if (current is float num2) { _until = Time.time + num2; } break; } _stack.Push(item); } num++; } } } public abstract class BossBrain { public Creature Body; public EnemyKind Kind; public int Wave; public int Tier; public int MaxHp; public bool Phase2; public bool IsBoss = true; public float TakeMult = 1f; public float TurretMult = 1f; protected float Born; protected float Foot; protected float Reach; protected float Height; protected Vector3 Home; internal readonly Runner Run = new Runner(); private bool _warned; private bool _stunned; private int _breakDealt; private int _breakAt; private bool _breakable; internal float NextTrace; private bool _live; private float _liveAt; internal long ByPlayers; internal long ByTurrets; private float _nextTrample; private int _lastPick = -1; private readonly List<(Vector3 at, float r, float until, int player, int piece)> _hazards = new List<(Vector3, float, float, int, int)>(); private float _nextHazard; private readonly HashSet _shouted = new HashSet(); protected bool Broken { get; private set; } public bool Winding => _breakable; protected Transform T => ((Component)Body).transform; protected Rigidbody Rig => ((Item)Body).Rig; public Vector3 Pos => T.position; protected static FortressIsland Isle => FortressIsland.Instance; protected static Vector3 Center => FortressIsland.Instance.Center; protected static Vector3 Core => Siege.Instance.CorePos; protected bool Alive { get { if (Object.op_Implicit((Object)(object)Body) && Body._hp.Value > 0) { return Siege.Instance.ServerActive; } return false; } } protected float Hp01 { get { if (MaxHp <= 0) { return 1f; } return (float)Body._hp.Value / (float)MaxHp; } } protected float SlowFactor => Siege.Instance.SlowOf(Body); protected Vector3 Forward => T.rotation * Quaternion.Inverse(BossLooks.Turn(Kind)) * Vector3.forward; public bool IsLive => _live; protected static IEnumerable Pieces => BuildSystem.Instance.ServerPieces; protected static IEnumerable Targets { get { if (!AutoTest.IgnorePlayers) { return PlayerManager.AlivePlayers.Where((Player p) => Object.op_Implicit((Object)(object)p) && Object.op_Implicit((Object)(object)p.Transform)); } return Enumerable.Empty(); } } protected float Breath => Mathf.Lerp(3.2f, 1.6f, (float)(Tier - 1) / 9f) * (Phase2 ? 0.7f : 1f); public float CrashIn => Mathf.Max(1f, Born + 200f - Time.time); internal string Trace() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) return string.Format("{0} at {1:F1} (home {2:F1}), kinematic {3}, alive {4}, live {5}, hp {6}/{7}, doing {8}", Kind, Pos, Home, Object.op_Implicit((Object)(object)Rig) ? Rig.isKinematic.ToString() : "-", Alive, _live, Body._hp.Value, MaxHp, Run.Doing); } public void DebugBreak() { _breakable = true; TryBreak(byConch: true); } internal void Age(float seconds) { Born -= seconds; } protected Quaternion Facing(Vector3 dir) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) Vector3 val = dir.Flat(); return Quaternion.LookRotation((((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? dir.Flat() : Forward.Flat()) * BossLooks.Turn(Kind); } public void Init(Creature c, EnemyKind kind, int wave, Vector3 home) { //IL_0028: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00b7: 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_00e4: Unknown result type (might be due to invalid IL or missing references) Body = c; Kind = kind; Wave = wave; Tier = Mathf.Clamp(wave / 10, 1, 10); Home = home; MaxHp = (FortressPlugin.Instance.MaxHpOf.TryGetValue(c, out var value) ? value : c._hp.Value); Born = Time.time; Rigidbody[] componentsInChildren = ((Component)c).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].isKinematic = true; } Bounds val = BossLooks.WorldBounds(T); Foot = T.position.y - ((Bounds)(ref val)).min.y; Reach = Mathf.Max(0.5f, Mathf.Max(((Bounds)(ref val)).extents.x, ((Bounds)(ref val)).extents.z)); Height = Mathf.Max(0.5f, ((Bounds)(ref val)).size.y); } public void Hold(float seconds) { Run.Start(HoldThen(seconds)); } private IEnumerator HoldThen(float seconds) { float t0 = Time.time; yield return Entrance(seconds); float num = seconds - (Time.time - t0); if (num > 0f) { yield return num; } if (IsBoss) { Fx.Announce("bossHint" + Kind); } Run.Start(Live()); } private IEnumerator Live() { _live = true; _liveAt = Time.time; while (true) { yield return Act(); yield return null; } } internal void Report(bool down) { if (IsBoss && _live) { int num = Mathf.RoundToInt(Time.time - _liveAt); long num2 = ByPlayers + ByTurrets; int playersPct = (int)((num2 > 0) ? (ByPlayers * 100 / num2) : 0); int num3 = (down ? 100 : ((MaxHp > 0 && Object.op_Implicit((Object)(object)Body)) ? Mathf.Clamp(Mathf.RoundToInt(100f * (float)(MaxHp - Body._hp.Value) / (float)MaxHp), 0, 100) : 0)); BuildSystem.Log.LogInfo((object)(string.Format("Boss fight: {0}, wave {1}, {2} players, {3} health: {4} after {5} s, ", Kind, Wave, PlayerManager.Players.Count, MaxHp, down ? "down" : "rammed the lighthouse", num) + $"{num3}% taken (players {ByPlayers}, turrets {ByTurrets}).")); Fx.BossFight(Kind, down, num, playersPct, num3); } } protected virtual void Interrupted() { TurretMult = 1f; } public static Vector3 ArrivalOffset(EnemyKind k, Vector3 at, Vector3 center) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_00fe: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0126: 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_00a7: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0097: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (at - center).Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(Vector3.up, normalized); switch (k) { case EnemyKind.Warden: return Vector3.down * 7f; case EnemyKind.Urchin: return Vector3.up * 22f; case EnemyKind.Angler: return normalized * 7f + Vector3.down * 10f; case EnemyKind.Kraken: return Vector3.down * 10f; case EnemyKind.Stonefish: return Vector3.down * 8f; case EnemyKind.Eye: return Vector3.up * 35f; case EnemyKind.Koi: return normalized * 6f + Vector3.down * 9f; case EnemyKind.Voxel: return Vector3.down * 40f; case EnemyKind.Steed: { Vector3 val3 = at + normalized * 30f; return normalized * 30f + Vector3.up * (WaterManager.GetWaterHeight(val3) - at.y); } case EnemyKind.Skyfish: return normalized * 45f + val2 * 12f + Vector3.up * 9f; default: return Vector3.zero; } } protected virtual IEnumerator Entrance(float seconds) { Vector3 from = Pos; Quaternion r = T.rotation; for (float t = 0f; t < 0.8f; t += Time.deltaTime) { if (!Alive) { break; } float num = t / 0.8f; Put(Vector3.Lerp(from, Home, 1f - (1f - num) * (1f - num)), r); yield return null; } Put(Home, r); } public void Stop() { Run.Stop(); OnStop(); } protected virtual void OnStop() { } protected abstract IEnumerator Act(); protected virtual IEnumerator SecondForm() { Shout("bossPhase2"); Send("phase2", Pos, Pos); yield return 1.5f; } public virtual void Tick() { if (_breakable && _breakDealt >= _breakAt) { TryBreak(byConch: false); } if (!Phase2 && Hp01 <= 0.5f && !_stunned && _live) { Phase2 = true; AutoTest.Count("boss_phase2_" + Kind); Interrupted(); Run.Start(Then(SecondForm(), Live())); } if (Time.time - Born > 170f && !_warned) { _warned = true; Fx.Announce("bossCrashSoon", 30); } if (Time.time - Born > 200f) { Crash(); return; } Run.Tick(); Hazards(); Siege.Synced((Item)(object)Body); } private static IEnumerator Then(IEnumerator a, IEnumerator b) { yield return a; yield return b; } internal void PlayerDamage(int d) { if (_breakable) { _breakDealt += d; } } internal bool TryBreak(bool byConch) { if (!_breakable || (!byConch && _breakDealt < _breakAt)) { return false; } _breakable = false; Broken = true; AutoTest.Count("boss_broken_" + Kind); Interrupted(); Run.Start(Then(Reel(), Live())); return true; } protected virtual IEnumerator Reel() { _stunned = true; Fx.Announce("bossBroken"); Send("broken", Pos + Vector3.up * (Reach + 0.5f), Pos, 3000); TakeMult = 1.5f; yield return Fall(); yield return 3f; TakeMult = 1f; _stunned = false; yield return Recover(); } protected virtual IEnumerator Fall() { yield break; } protected virtual IEnumerator Recover() { yield break; } protected void Put(Vector3 p, Quaternion r) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Rig)) { T.SetPositionAndRotation(p, r); return; } Rig.MovePosition(p); Rig.MoveRotation(r); } protected void Put(Vector3 p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Put(p, T.rotation); } protected static float GroundY(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) float num = WaterManager.GetWaterHeight(p); RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Vector3(p.x, p.y + 30f, p.z), Vector3.down, ref val, 80f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { num = Mathf.Max(num, ((RaycastHit)(ref val)).point.y); } return num; } protected static float LandY(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(new Vector3(p.x, p.y + 30f, p.z), Vector3.down, ref val, 80f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return WaterManager.GetWaterHeight(p); } return ((RaycastHit)(ref val)).point.y; } protected Vector3 Stand(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) return new Vector3(p.x, GroundY(p) + Foot, p.z); } protected IEnumerator WalkTo(Vector3 goal, float speed, float stopAt, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Alive) { break; } Vector3 val = (goal - Pos).Flat(); if (((Vector3)(ref val)).magnitude <= stopAt) { break; } Vector3 normalized = ((Vector3)(ref val)).normalized; Quaternion r = Quaternion.RotateTowards(T.rotation, Facing(normalized), 140f * Time.deltaTime); PieceState? pieceState = WallAhead(normalized); if (pieceState.HasValue) { Put(Pos, r); yield return Trample(pieceState.Value); continue; } Vector3 p = Pos + normalized * speed * SlowFactor * Time.deltaTime; if (Mathf.Abs(LandY(p) - LandY(Pos)) > 2.5f) { break; } Put(Stand(p), r); yield return null; } } private IEnumerator Trample(PieceState wall) { if (Time.time >= _nextTrample) { _nextTrample = Time.time + 0.8f; BuildSystem.Instance.ServerDamagePiece(wall.Id, Scaled(55f)); Send("stomp", wall.Pos, wall.Pos); } yield return null; } protected PieceState? WallAhead(Vector3 dir) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Pos.Flat() + dir * (Reach * 0.8f + 0.8f); foreach (PieceState serverPiece in BuildSystem.Instance.ServerPieces) { if (serverPiece.Type == PieceType.Wall || Catalog.IsTurret(serverPiece.Type)) { Vector3 val2 = serverPiece.Pos.Flat() - val; if (((Vector3)(ref val2)).sqrMagnitude < 2.5600002f) { return serverPiece; } } } return null; } protected IEnumerator Leap(Vector3 to, float height, float seconds, bool face = true) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 from = Pos; Quaternion r0 = T.rotation; Quaternion val2; if (face) { Vector3 val = (to - from).Flat(); if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { val2 = Facing(to - from); goto IL_008b; } } val2 = r0; goto IL_008b; IL_008b: Quaternion r1 = val2; for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Alive) { break; } float num = t / seconds; Put(Vector3.Lerp(from, to, num) + Vector3.up * height * 4f * num * (1f - num), Quaternion.Slerp(r0, r1, Mathf.Clamp01(num * 3f))); yield return null; } Put(to, r1); } protected IEnumerator Glide(Vector3 to, float speed, float bank = 0f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) while (Alive) { Vector3 val = to - Pos; float num = speed * SlowFactor * Time.deltaTime; if (((Vector3)(ref val)).magnitude <= num) { Put(to); break; } Vector3 val2 = val.Flat(); Quaternion val3 = ((((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? (Facing(val) * Quaternion.Euler(0f, 0f, bank)) : T.rotation); Put(Pos + ((Vector3)(ref val)).normalized * num, Quaternion.RotateTowards(T.rotation, val3, 120f * Time.deltaTime)); yield return null; } } protected IEnumerator Turn(Vector3 toward, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Quaternion r0 = T.rotation; Quaternion r1 = Facing(toward - Pos); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Alive) { break; } Put(Pos, Quaternion.Slerp(r0, r1, t / seconds)); yield return null; } Put(Pos, r1); } protected IEnumerator Warn(string shape, Vector3 a, Vector3 b, float size, float seconds, bool breakable = false, float breakShare = 0.04f, int extra = 0, Action during = null) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) Broken = false; Send("w." + shape, a, b, Mathf.RoundToInt(seconds * 1000f), Mathf.RoundToInt(size * 100f) + extra * 100000); if (breakable) { _breakable = true; _breakDealt = 0; _breakAt = Mathf.Max(1, Mathf.RoundToInt((float)MaxHp * breakShare)); Send("winding", Pos + Vector3.up * (Reach + 0.3f), Pos, Mathf.RoundToInt(seconds * 1000f)); } if (during == null) { yield return seconds; } else { for (float t = 0f; t < seconds; t += Time.deltaTime) { during(t / seconds); yield return null; } } _breakable = false; } protected void WarnOnly(string shape, Vector3 a, Vector3 b, float size, float seconds, int extra = 0) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Send("w." + shape, a, b, Mathf.RoundToInt(seconds * 1000f), Mathf.RoundToInt(size * 100f) + extra * 100000); } protected int Scaled(float baseDmg) { return Mathf.Max(1, Mathf.RoundToInt(baseDmg * (1f + 0.06f * (float)(Wave - 1)))); } protected int Hit(Func inside, float pieceDmg, float playerDmg, float coreDmg, Vector3 from, float knock = 6f) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) int num = 0; if (pieceDmg > 0f) { foreach (PieceState item in Pieces.Where((PieceState p) => inside(p.Pos)).ToList()) { BuildSystem.Instance.ServerDamagePiece(item.Id, Scaled(pieceDmg)); num++; } } if (coreDmg > 0f && inside(Core)) { Siege.Instance.DamageCore(Scaled(coreDmg)); } if (playerDmg > 0f) { HurtPlayers(inside, Scaled(playerDmg), from, knock); } return num; } protected static void HurtPlayers(Func inside, int dmg, Vector3 from, float knock) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) foreach (Player item in Targets.ToList()) { if (inside(item.Transform.position)) { Vector3 val = (item.Transform.position - from).Flat(); Siege.HurtPlayer(item, Mathf.Min(70, dmg), ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Vector3.forward) * knock + Vector3.up * knock * 0.5f); } } } protected static Func Circle(Vector3 c, float r) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return delegate(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (p - c).Flat(); return ((Vector3)(ref val)).sqrMagnitude <= r * r; }; } protected static Func Lane(Vector3 a, Vector3 b, float width) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (b - a).Flat(); float len = ((Vector3)(ref val)).magnitude; Vector3 dir = ((len > 0.01f) ? (val / len) : Vector3.forward); return delegate(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = (p - a).Flat(); float num = Vector3.Dot(val2, dir); if (num >= -0.5f && num <= len + 0.5f) { Vector3 val3 = val2 - dir * num; return ((Vector3)(ref val3)).sqrMagnitude <= width * width * 0.25f; } return false; }; } protected static Func Cone(Vector3 apex, Vector3 dir, float range, float halfAngle) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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) Vector3 val = dir.Flat(); Vector3 d = ((Vector3)(ref val)).normalized; return delegate(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_002e: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = (p - apex).Flat(); return ((Vector3)(ref val2)).sqrMagnitude <= range * range && Vector3.Angle(d, val2) <= halfAngle; }; } protected void HitOnce(HashSet done, HashSet hurt, Func inside, float pieceDmg, float playerDmg, float coreDmg, Vector3 from, float knock = 6f) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) foreach (PieceState item in Pieces.Where((PieceState p) => !done.Contains(p.Id) && inside(p.Pos)).ToList()) { done.Add(item.Id); BuildSystem.Instance.ServerDamagePiece(item.Id, Scaled(pieceDmg)); } if (coreDmg > 0f && !done.Contains(-1) && inside(Core)) { done.Add(-1); Siege.Instance.DamageCore(Scaled(coreDmg)); } foreach (Player item2 in Targets.ToList()) { if (!hurt.Contains(item2) && inside(item2.Transform.position)) { hurt.Add(item2); Vector3 val = (item2.Transform.position - from).Flat(); Siege.HurtPlayer(item2, Mathf.Min(70, Scaled(playerDmg)), ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Vector3.forward) * knock + Vector3.up * knock * 0.5f); } } } protected int Pick(params float[] w) { float num = 0f; for (int i = 0; i < w.Length; i++) { if (i != _lastPick || w.Count((float x) => x > 0f) <= 1) { num += Mathf.Max(0f, w[i]); } } float num2 = Random.value * num; for (int num3 = 0; num3 < w.Length; num3++) { if ((num3 != _lastPick || w.Count((float x) => x > 0f) <= 1) && !(w[num3] <= 0f)) { num2 -= w[num3]; if (num2 <= 0f) { return _lastPick = num3; } } } return _lastPick = Array.FindLastIndex(w, (float x) => x > 0f); } protected static Vector3 Across(Vector3 a, Vector3 dir, float max, float edge = 27f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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) Vector3 val = dir.Flat(); dir = ((Vector3)(ref val)).normalized; Vector3 val2 = (a - Center).Flat(); float num = Vector3.Dot(val2, dir); float num2 = ((Vector3)(ref val2)).sqrMagnitude - edge * edge; float num3 = num * num - num2; float num4 = ((num3 > 0f) ? (0f - num + Mathf.Sqrt(num3)) : max); Vector3 val3 = a + dir * Mathf.Clamp(num4, 6f, max); val3.y = GroundY(val3); return val3; } protected static Vector3 SpotNear(Vector3 near, float min, float max) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 12; i++) { Vector3 val = near + Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward * Random.Range(min, max); Vector3 val2 = (val - Center).Flat(); if (!(((Vector3)(ref val2)).magnitude > 25f) && LandY(val) > WaterManager.GetWaterHeight(val) + 0.3f) { val.y = LandY(val); return val; } } Vector3 val3 = Vector3.Lerp(near, Center, 0.3f); val3.y = GroundY(val3); return val3; } protected static EnemyKind KindOf(Creature c) { if (!Enemies.Instance.TryGet(c, out var tag)) { return EnemyKind.Runner; } return tag.Kind; } protected static PieceState? Best(Func where, Func score) { PieceState? result = null; float num = float.MinValue; foreach (PieceState piece in Pieces) { if (where(piece)) { float num2 = score(piece); if (num2 > num) { num = num2; result = piece; } } } return result; } protected PieceState? NearestPiece(float range, Func where = null) { return Best(delegate(PieceState p) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (where == null || where(p)) { Vector3 val = (p.Pos - Pos).Flat(); return ((Vector3)(ref val)).magnitude <= range; } return false; }, delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (p.Pos - Pos).Flat(); return 0f - ((Vector3)(ref val)).sqrMagnitude; }); } protected IEnumerable TurretsNear(float range) { return Pieces.Where(delegate(PieceState p) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0028: Unknown result type (might be due to invalid IL or missing references) if (Catalog.IsTurret(p.Type)) { Vector3 val = (p.Pos - Pos).Flat(); return ((Vector3)(ref val)).magnitude <= range; } return false; }); } protected static Player SomePlayer(Vector3 near, float range) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return (from _ in Targets.Where(delegate(Player p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (p.Transform.position - near).Flat(); return ((Vector3)(ref val)).magnitude <= range; }) orderby Random.value select _).FirstOrDefault(); } protected Vector3 Heart() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PieceState? pieceState = Best((PieceState p) => Catalog.IsTurret(p.Type), delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (p.Pos - Pos).Flat(); float num = (0f - ((Vector3)(ref val)).sqrMagnitude) * 0.3f; val = (p.Pos - Core).Flat(); return num - ((Vector3)(ref val)).sqrMagnitude; }); if (!pieceState.HasValue || !(Random.value < 0.7f)) { return Core; } return pieceState.Value.Pos; } protected static Vector3 GapDir(int gap) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) float num = FortressIsland.GapAngles[(gap % 3 + 3) % 3] * (MathF.PI / 180f); return new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)); } protected static int NearestGap(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_001f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (p - Center).Flat(); int result = 0; float num = 999f; for (int i = 0; i < 3; i++) { float num2 = Vector3.Angle(val, GapDir(i)); if (num2 < num) { num = num2; result = i; } } return result; } protected void Hazard(Vector3 at, float r, float seconds, int playerDmg, int pieceDmg) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _hazards.Add((at, r, Time.time + seconds, playerDmg, pieceDmg)); } private void Hazards() { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0177: 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) if (_hazards.Count == 0 || Time.time < _nextHazard) { return; } _nextHazard = Time.time + 0.5f; _hazards.RemoveAll(((Vector3 at, float r, float until, int player, int piece) tuple) => Time.time > tuple.until); foreach (var h in _hazards) { if (h.piece > 0) { foreach (PieceState item in Pieces.Where(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = (p.Pos - h.at).Flat(); return ((Vector3)(ref val2)).sqrMagnitude <= h.r * h.r; }).ToList()) { BuildSystem.Instance.ServerDamagePiece(item.Id, h.piece); } } if (h.player <= 0) { continue; } foreach (Player item2 in Targets.ToList()) { Vector3 val = (item2.Transform.position - h.at).Flat(); if (((Vector3)(ref val)).sqrMagnitude <= h.r * h.r && Mathf.Abs(item2.Transform.position.y - h.at.y) < 3f) { Siege.HurtPlayer(item2, h.player, Vector3.up); } } } } protected Creature Summon(EnemyKind kind, Vector3 at, BossBrain brain, float hpShare) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) int hp = Mathf.Max(1, Mathf.RoundToInt(EnemyCatalog.Of(kind).BaseHp * FortressPlugin.Instance.WaveHpMult * hpShare)); FortressPlugin instance = FortressPlugin.Instance; Vector3 val = (Core - at).Flat(); Creature val2 = instance.ServerSpawnPuppet(kind, at, Quaternion.LookRotation((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? (Core - at).Flat() : Vector3.forward), hp); if (Object.op_Implicit((Object)(object)val2)) { Bosses.Instance.ServerAddMinion(val2, brain, kind, Wave); } return val2; } protected void Send(string key, Vector3 a, Vector3 b, int arg = 0, int who = 0) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) BossFx.Send(key, Body, a, b, arg, who); } protected void Shout(string key, bool always = false) { if (_shouted.Add(key) || always) { Fx.Announce(key); } } public void Aura() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (!(Pos.y - GroundY(Pos) > Foot + 2.5f)) { float num = Reach + 0.6f; BuildSystem.Instance.ServerDamageArea(Pos, num, Mathf.RoundToInt((float)(15 + Wave) * 0.5f)); Vector3 val = (Core - Pos).Flat(); if (((Vector3)(ref val)).magnitude < num + 2f) { Siege.Instance.DamageCore(Mathf.RoundToInt((float)(20 + Wave) * 0.5f)); } } } private void Crash() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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) Siege.Instance.DamageCore(Mathf.RoundToInt((float)Siege.Instance.CoreMax * 0.35f)); Fx.Send(FxKind.Crash, Core + Vector3.up * 2f, Core + Vector3.up * 2f); Fx.Announce("bossCrashed"); Report(down: false); AutoTest.Count("boss_crashed"); Stop(); ((Item)Body).DestroyItem((byte)0, byte.MaxValue); } public virtual void Died() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Send("died", Pos, Pos, Mathf.RoundToInt(Reach * 100f)); AutoTest.Count("boss_died_" + Kind); } } [HarmonyPatch] internal static class BossPuppetPatches { [HarmonyPrefix] [HarmonyPatch(typeof(Fish), "UpdateMovement")] private static bool Fish(Fish __instance) { return !Bosses.IsPuppet((Creature)(object)__instance); } [HarmonyPrefix] [HarmonyPatch(typeof(AttackingFish), "UpdateMovement")] private static bool Attacking(AttackingFish __instance) { return !Bosses.IsPuppet((Creature)(object)__instance); } [HarmonyPrefix] [HarmonyPatch(typeof(AttackingFish), "OnCollision")] private static bool Bite(AttackingFish __instance) { return !Bosses.IsPuppet((Creature)(object)__instance); } [HarmonyPrefix] [HarmonyPatch(typeof(Crab), "UpdateMovement")] private static bool Crab(Crab __instance) { return !Bosses.IsPuppet((Creature)(object)__instance); } [HarmonyPrefix] [HarmonyPatch(typeof(DazedUtils), "TryMoveItemFromUnderLevel")] private static bool Surface(Item item, ref bool __result) { if (!Object.op_Implicit((Object)(object)item) || !Object.op_Implicit((Object)(object)item.Creature) || !Bosses.IsPuppet(item.Creature)) { return true; } __result = false; return false; } [HarmonyPrefix] [HarmonyPatch(typeof(RigidbodySync), "SetKinematic")] private static void StayKinematic(RigidbodySync __instance, ref bool kinematic) { if (!kinematic) { Creature component = ((Component)__instance).GetComponent(); if (component != null && Bosses.IsPuppet(component)) { kinematic = true; } } } [HarmonyPrefix] [HarmonyPatch(typeof(Creature), "ServerChangeHp")] private static void Hurt(Creature __instance, ref int damage) { damage = Bosses.OnHurt(__instance, damage); } } public class BossEye : MonoBehaviour { public static readonly string[] Parts = new string[6] { "BossEyeShell", "BossEyeBall", "BossEyeLidTop", "BossEyeLidBottom", "BossEyeHalo", "BossEyeShards" }; public const float TopOpen = -58f; public const float BottomOpen = 42f; public const float Wide = 1.25f; public const float Squint = 0.18f; public const float MaxLook = 32f; public const float ShardTilt = -24f; public const float WakeAfter = 12f; private const float PupilAhead = 2.4f; private Transform _ball; private Transform _top; private Transform _bottom; private Transform _halo; private Transform _shards; private Light _light; private float _born; private float _open; private float _wideUntil; private float _squintUntil; private float _blinkAt; private float _blinkUntil; private float _lookUntil; private float _haloTurn; private float _shardTurn; private bool _awake; private bool _rage; private Vector3 _lookAt; public Vector3 Pupil { get { //IL_001f: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_ball)) { return ((Component)this).transform.position; } return _ball.TransformPoint(Vector3.forward * 2.4f); } } public static BossEye Of(int id) { Transform val = BossFx.BodyOf(id); if (val == null || !Object.op_Implicit((Object)(object)val)) { return null; } return ((Component)val).GetComponent(); } public static bool Dress(Transform root) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_0134: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((Component)root).GetComponent())) { return true; } if (Parts.Any((string p) => !File.Exists(Path.Combine(Models.Dir ?? "", p + ".obj")))) { return false; } List list = (from r in ((Component)root).GetComponentsInChildren() where !(r is ParticleSystemRenderer) select r).ToList(); Transform transform = new GameObject("BossEyeBody").transform; transform.SetParent(root, false); transform.localScale = Vector3.one / root.localScale.x; ((Component)transform).gameObject.layer = ((list.Count > 0) ? ((Component)list[0]).gameObject.layer : ((Component)root).gameObject.layer); BossEye bossEye = ((Component)root).gameObject.AddComponent(); Part("BossEyeShell", transform); bossEye._ball = Part("BossEyeBall", transform); bossEye._top = Part("BossEyeLidTop", transform); bossEye._bottom = Part("BossEyeLidBottom", transform); Transform transform2 = new GameObject("BossEyeGear", new Type[1] { typeof(BossGear) }).transform; transform2.SetParent(transform, false); ((Component)transform2).gameObject.layer = ((Component)transform).gameObject.layer; bossEye._halo = Part("BossEyeHalo", transform2); Transform transform3 = new GameObject("BossEyeShardTilt").transform; transform3.SetParent(transform2, false); transform3.localRotation = Quaternion.Euler(-24f, 0f, 0f); bossEye._shards = Part("BossEyeShards", transform3); foreach (Renderer item in list) { item.forceRenderingOff = true; } Transform val = root.Find("BossGlow"); if (val != null) { Light component = ((Component)val).GetComponent(); if (component != null) { val.SetParent(transform, false); val.localPosition = Vector3.forward * 3.6000001f; component.range = 16f; bossEye._light = component; } } BossLooks.FitCollider(root, transform); return true; static Transform Part(string name, Transform parent) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return Models.Attach(name, parent, Vector3.one).transform; } } public static Vector3 Look(Vector3 dir, float maxDeg) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0035: 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_005f: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) float magnitude = ((Vector3)(ref dir)).magnitude; if (magnitude < 1E-05f) { return Vector3.forward; } dir /= magnitude; float num = maxDeg * (MathF.PI / 180f); if (dir.z >= Mathf.Cos(num)) { return dir; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(dir.x, dir.y, 0f); val = ((((Vector3)(ref val)).sqrMagnitude < 1E-08f) ? Vector3.up : ((Vector3)(ref val)).normalized); return Vector3.forward * Mathf.Cos(num) + val * Mathf.Sin(num); } public void Flare(float seconds) { _awake = true; _wideUntil = Mathf.Max(_wideUntil, Time.time + seconds); } public void Reel(float seconds) { _squintUntil = Time.time + seconds; } public void Rage(bool on) { _rage = on; } public void LookAt(Vector3 at, float seconds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) _lookAt = at; _lookUntil = Time.time + seconds; } private void Start() { _born = Time.time; _blinkAt = _born + 12f + Random.Range(2f, 5f); } private void LateUpdate() { //IL_013f: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; float deltaTime = Time.deltaTime; if (!(deltaTime <= 0f) && Object.op_Implicit((Object)(object)_ball)) { if (!_awake && time - _born > 12f) { _awake = true; } bool flag = time < _wideUntil || _rage; bool flag2 = time < _squintUntil; if (_awake && !flag && !flag2 && time > _blinkAt) { _blinkUntil = time + 0.13f; _blinkAt = time + Random.Range(3.5f, 7.5f); } float num = ((!_awake || time < _blinkUntil) ? 0f : (flag2 ? 0.18f : (flag ? 1.25f : 1f))); _open = Mathf.Lerp(_open, num, 1f - Mathf.Exp((0f - ((num < _open) ? 30f : 8f)) * deltaTime)); float num2 = (flag2 ? (Mathf.Sin(time * 45f) * 1.5f) : 0f); _top.localRotation = Quaternion.Euler(-58f * _open + num2, 0f, 0f); _bottom.localRotation = Quaternion.Euler(42f * _open - num2, 0f, 0f); Camera curCamera = GameInfo.CurCamera; Vector3 val = ((time < _lookUntil) ? _lookAt : (Object.op_Implicit((Object)(object)curCamera) ? ((Component)curCamera).transform.position : (_ball.position + ((Component)this).transform.forward))); Vector3 val2 = Look(_ball.parent.InverseTransformDirection(val - _ball.position), 32f); _ball.localRotation = Quaternion.Slerp(_ball.localRotation, Quaternion.LookRotation(val2, Vector3.up), 1f - Mathf.Exp((0f - ((time < _lookUntil) ? 14f : 5f)) * deltaTime)); float num3 = (_rage ? 2.2f : 1f); _haloTurn += 7f * num3 * deltaTime; _shardTurn += 14f * num3 * deltaTime; _halo.localRotation = Quaternion.AngleAxis(_haloTurn, Vector3.forward); _shards.localRotation = Quaternion.AngleAxis(_shardTurn, Vector3.up); if (Object.op_Implicit((Object)(object)_light)) { _light.intensity = Mathf.Lerp(_light.intensity, (!_awake) ? 0.8f : (flag ? 4f : 1.8f), 1f - Mathf.Exp(-4f * deltaTime)); } } } } public class BossFx : MonoBehaviour { internal class DropMesh : MonoBehaviour { public Mesh Mesh; public List U; public List Rim; private void OnDestroy() { if (Object.op_Implicit((Object)(object)Mesh)) { Object.Destroy((Object)(object)Mesh); } } } public static BossFx Instance; private static readonly RaycastHit[] Hits = (RaycastHit[])(object)new RaycastHit[12]; private bool _night; private bool _red; private float _nightK; private float _redK; private Coroutine _mood; private Canvas _canvas; private Image _overlay; private readonly List _bars = new List(); public bool Moody => _mood != null; private void Awake() { Instance = this; } public static void Send(string key, Creature boss, Vector3 a, Vector3 b, int arg = 0, int who = 0) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(new FxEvent { Kind = FxKind.BossFx, Key = key, From = a, To = b, PieceId = (Object.op_Implicit((Object)(object)boss) ? ((NetworkBehaviour)boss).ObjectId : 0), Arg = arg, Who = who }, true, (Channel)0); } } public static Transform BodyOf(int id) { ClientManager clientManager = InstanceFinder.ClientManager; if (id == 0 || !((Object)(object)clientManager != (Object)null) || !((ManagedObjects)clientManager.Objects).Spawned.TryGetValue(id, out var value) || !Object.op_Implicit((Object)(object)value)) { return null; } return ((Component)value).transform; } private static EnemyKind KindOf(int id) { if (Object.op_Implicit((Object)(object)Enemies.Instance)) { EnemyTag? enemyTag = Enemies.Instance.ClientTagOf(id); if (enemyTag.HasValue) { return enemyTag.GetValueOrDefault().Kind; } } return EnemyKind.Runner; } public static Color ColourOf(int id) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return BossLooks.Colour(KindOf(id)); } public void Play(FxEvent e) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_0235: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) string text = e.Key ?? ""; if (text.StartsWith("w.")) { ((MonoBehaviour)this).StartCoroutine(Warning(text.Substring(2), e.From, e.To, (float)(e.Who % 100000) / 100f, e.Who / 100000, (float)e.Arg / 1000f, ColourOf(e.PieceId))); return; } switch (text) { case "winding": ((MonoBehaviour)this).StartCoroutine(Winding(e.PieceId, (float)e.Arg / 1000f)); break; case "broken": ((MonoBehaviour)this).StartCoroutine(Dizzy(e.PieceId, (float)e.Arg / 1000f)); Fx.Sound("Hitmarker", e.From, 1f, (AudioDistance)3); Burst(e.From, "Gold", 40, 0.18f); BossEye.Of(e.PieceId)?.Reel((float)e.Arg / 1000f); break; case "stomp": WeaponFx.Emit(WeaponFx.Dust, e.From, 8, Vector3.up); Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, e.From, 0.7f, (AudioDistance)2); break; case "phase2": ((MonoBehaviour)this).StartCoroutine(Transform2(e.PieceId)); break; case "died": ((MonoBehaviour)this).StartCoroutine(Death(e.PieceId, e.From, (float)e.Arg / 100f)); break; case "dark": Night(e.Arg > 0); break; case "trophy": ((MonoBehaviour)this).StartCoroutine(Trophy(e.From, (EnemyKind)e.Who)); break; default: if (!BossMoves.Play(this, e)) { BuildSystem.Log.LogWarning((object)("BossFx: no effect " + text)); } break; } } private IEnumerator Warning(string shape, Vector3 a, Vector3 b, float size, int extra, float seconds, Color edge) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) //IL_0036: Unknown result type (might be due to invalid IL or missing references) GameObject go = Decal(shape, a, b, size, extra, edge); if (!Object.op_Implicit((Object)(object)go)) { yield break; } Material mat = ((Renderer)go.GetComponent()).sharedMaterial; DropMesh shape_ = go.GetComponent(); List cols = new List(); shape_.Mesh.GetColors(cols); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } float num = t / seconds; float num2 = Mathf.Lerp(3f, 14f, num * num); float num3 = 0.5f + 0.5f * Mathf.Sin(t * num2); for (int i = 0; i < cols.Count; i++) { if (shape_.Rim[i]) { Color val = cols[i]; cols[i] = new Color(val.r, val.g, val.b, 0.7f + 0.3f * num3); continue; } float num4 = shape_.U[i]; float num5 = Mathf.Clamp01((num * 1.03f - num4) / 0.05f); float num6 = Mathf.Exp((0f - (num4 - num) * (num4 - num)) / 0.0016f); cols[i] = new Color(0.95f, 0.05f + 0.35f * num6, 0.03f, 0.26f + 0.3f * num5 + 0.35f * num6); } shape_.Mesh.SetColors(cols); mat.color = new Color(1f, 1f, 1f, Mathf.Clamp01(t / 0.12f)); yield return null; } if (!Object.op_Implicit((Object)(object)go)) { yield break; } for (float t = 0f; t < 0.25f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } mat.color = new Color(1f, 1f, 1f, 1f - t / 0.25f); yield return null; } Object.Destroy((Object)(object)mat); Object.Destroy((Object)(object)go); } internal static GameObject Decal(string shape, Vector3 a, Vector3 b, float size, int extra, Color edge) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00e6: 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_00fe: 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_0109: 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_01fa: 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_0207: 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) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Expected O, but got Unknown //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Expected O, but got Unknown //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Expected O, but got Unknown List pts = new List(); List cols = new List(); List tris = new List(); List us = new List(); List rims = new List(); Color fill = new Color(0.95f, 0.05f, 0.03f, 0.5f); Color rim = new Color(Mathf.Lerp(edge.r, 1f, 0.25f), Mathf.Lerp(edge.g, 0.15f, 0.25f), Mathf.Lerp(edge.b, 0.1f, 0.25f), 1f); Vector3 fwd = (b - a).Flat(); fwd = ((((Vector3)(ref fwd)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref fwd)).normalized : Vector3.forward); Vector3 right = Vector3.Cross(Vector3.up, fwd); Vector3 val; switch (shape) { case "circle": case "ring": { float r0 = ((shape == "ring") ? ((float)extra / 100f) : 0f); float band = Mathf.Max(0.6f, size - r0); Grid(Mathf.Clamp(Mathf.CeilToInt(band / 0.3f), 4, 40), 40, (float u, float v) => a + Quaternion.Euler(0f, v * 360f, 0f) * Vector3.forward * Mathf.Lerp(r0, size, u), (float u, float v) => u > 1f - 0.28f / band || (r0 > 0f && u < 0.2f / band), wrap: true); break; } case "lane": { val = (b - a).Flat(); float len = ((Vector3)(ref val)).magnitude; Grid(Mathf.Clamp(Mathf.CeilToInt(len / 0.8f), 2, 90), 10, (float u, float v) => a + fwd * len * u + right * (v - 0.5f) * size, (float u, float v) => v < 0.05f || v > 0.95f || u > 1f - 0.3f / Mathf.Max(1f, len), wrap: false); break; } case "cone": { val = (b - a).Flat(); float range = ((Vector3)(ref val)).magnitude; float half = Mathf.Max(5f, (float)extra); Grid(Mathf.Clamp(Mathf.CeilToInt(range / 0.6f), 3, 50), 28, (float u, float v) => a + Quaternion.AngleAxis((v - 0.5f) * 2f * half, Vector3.up) * fwd * range * u, (float u, float v) => u > 1f - 0.3f / Mathf.Max(1f, range) || v < 0.02f || v > 0.98f, wrap: false); break; } default: Grid(Mathf.Clamp(Mathf.CeilToInt(size * 2f / 0.6f), 2, 40), Mathf.Clamp(Mathf.CeilToInt(size * 2f / 0.6f), 2, 40), (float u, float v) => a + fwd * (u - 0.5f) * 2f * size + right * (v - 0.5f) * 2f * size, (float u, float v) => u < 0.03f || u > 0.97f || v < 0.03f || v > 0.97f, wrap: false, (float u, float v) => Mathf.Max(Mathf.Abs(u - 0.5f), Mathf.Abs(v - 0.5f)) * 2f); break; } Mesh val2 = new Mesh { name = "BossWarning" }; val2.indexFormat = (IndexFormat)(pts.Count > 65000); val2.SetVertices(pts); val2.SetColors(cols); val2.SetTriangles(tris, 0); val2.RecalculateBounds(); GameObject val3 = new GameObject("BossWarning", new Type[2] { typeof(MeshFilter), typeof(MeshRenderer) }); val3.GetComponent().sharedMesh = val2; MeshRenderer component = val3.GetComponent(); Material sharedMaterial = new Material(Shader.Find("Sprites/Default")) { renderQueue = 3010 }; ((Renderer)component).sharedMaterial = sharedMaterial; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; DropMesh dropMesh = val3.AddComponent(); dropMesh.Mesh = val2; dropMesh.U = us; dropMesh.Rim = rims; return val3; void Grid(int rows, int columns, Func at, Func onRim, bool wrap, Func fillAt = null) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) int count = pts.Count; for (int i = 0; i <= rows; i++) { for (int j = 0; j <= columns; j++) { float num = (float)i / (float)rows; float arg = (float)j / (float)columns; Vector3 val4 = at(num, arg); val4.y = Floor(val4) + 0.08f; pts.Add(val4); bool flag = onRim(num, arg); cols.Add(flag ? rim : fill); rims.Add(flag); us.Add(fillAt?.Invoke(num, arg) ?? num); } } int num2 = columns + 1; for (int k = 0; k < rows; k++) { for (int l = 0; l < columns; l++) { int num3 = count + k * num2 + l; tris.AddRange(new int[6] { num3, num3 + num2, num3 + 1, num3 + 1, num3 + num2, num3 + num2 + 1 }); } } } } public static float Ground(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) float num = WaterManager.GetWaterHeight(p); RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Vector3(p.x, p.y + 25f, p.z), Vector3.down, ref val, 60f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { num = Mathf.Max(num, ((RaycastHit)(ref val)).point.y); } return num; } public static float Floor(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) float num = WaterManager.GetWaterHeight(p); int num2 = Physics.RaycastNonAlloc(new Vector3(p.x, p.y + 25f, p.z), Vector3.down, Hits, 60f, LayerMask.op_Implicit(GameInfo.LevelLayer)); for (int i = 0; i < num2; i++) { bool flag = false; Transform val = ((Component)((RaycastHit)(ref Hits[i])).collider).transform; while (Object.op_Implicit((Object)(object)val) && !flag) { flag = ((Object)val).name == "FortressPiece"; val = val.parent; } if (!flag) { num = Mathf.Max(num, ((RaycastHit)(ref Hits[i])).point.y); } } return num; } private IEnumerator Winding(int id, float seconds) { Transform body = BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } Transform ring = WeaponFx.Piece(WeaponFx.Torus, BossVfx.Glow(new Color(1f, 0.8f, 0.25f), 6f)); float top = Top(body); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)ring)) { break; } if (!Object.op_Implicit((Object)(object)body)) { break; } float num = t / seconds; ring.position = new Vector3(body.position.x, body.position.y + top + 0.6f, body.position.z); ring.rotation = Quaternion.Euler(90f, t * 180f, 0f); ring.localScale = Vector3.one * Mathf.Lerp(3.2f, 0.6f, num) * (1f + 0.08f * Mathf.Sin(t * 30f)); yield return null; } if (Object.op_Implicit((Object)(object)ring)) { Object.Destroy((Object)(object)((Component)ring).gameObject); } } private IEnumerator Dizzy(int id, float seconds) { Transform body = BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } List stars = new List(); Material mat = BossVfx.Glow(new Color(1f, 0.9f, 0.35f), 7f); for (int i = 0; i < 5; i++) { Transform val = WeaponFx.Piece(WeaponFx.Cube, mat); val.localScale = Vector3.one * 0.35f; stars.Add(val); } float top = Top(body); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)body)) { break; } for (int j = 0; j < stars.Count; j++) { float num = t * 4f + (float)j * MathF.PI * 2f / (float)stars.Count; stars[j].position = body.position + new Vector3(Mathf.Cos(num) * 1.4f, top + 0.4f + 0.15f * Mathf.Sin(t * 6f + (float)j), Mathf.Sin(num) * 1.4f); stars[j].rotation = Quaternion.Euler(t * 300f, t * 200f, 45f); } yield return null; } foreach (Transform item in stars) { if (Object.op_Implicit((Object)(object)item)) { Object.Destroy((Object)(object)((Component)item).gameObject); } } } private IEnumerator Transform2(int id) { Transform body = BodyOf(id); if (!Object.op_Implicit((Object)(object)body)) { yield break; } Color c = ColourOf(id); Fx.Sound("BossFightIntro", body.position, 1f, (AudioDistance)3); float top = Top(body); for (int i = 0; i < 3; i++) { if (!Object.op_Implicit((Object)(object)body)) { break; } Burst(body.position + Vector3.up * top * 0.6f, "Gold", 30, 0.2f); WeaponFx.Emit(WeaponFx.Rings, body.position + Vector3.up * 0.5f, 1, Vector3.up, c, 10f + 6f * (float)i); yield return (object)new WaitForSeconds(0.35f); } } private IEnumerator Death(int id, Vector3 at, float size) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Color c = ColourOf(id); Fx.Sound("Explosion", at, 1f, (AudioDistance)3); try { VFXManager.Play("LavaExplosion", at); } catch { } for (int i = 0; i < 4; i++) { Burst(at + Random.insideUnitSphere * size, "Gold", 30, 0.25f); WeaponFx.Emit(WeaponFx.Rings, at, 1, Vector3.up, c, 6f + 6f * (float)i); WeaponFx.Game((i % 2 == 0) ? "Confetti" : "RedConfetti", at + Vector3.up * 2f, Vector3.up); yield return (object)new WaitForSeconds(0.2f); } } public void Night(bool on) { _night = on; if (on && _mood == null) { _mood = ((MonoBehaviour)this).StartCoroutine(Mood()); } } public void RedSky(bool on) { _red = on; if (on && _mood == null) { _mood = ((MonoBehaviour)this).StartCoroutine(Mood()); } } private IEnumerator Mood() { Light sun = (Light)(Object.op_Implicit((Object)(object)RenderSettings.sun) ? ((object)RenderSettings.sun) : ((object)(from l in Object.FindObjectsOfType() where (int)l.type == 1 && ((Behaviour)l).enabled orderby l.intensity descending select l).FirstOrDefault())); float sunI0 = (Object.op_Implicit((Object)(object)sun) ? sun.intensity : 1f); float fogD0 = RenderSettings.fogDensity; float fogEnd0 = RenderSettings.fogEndDistance; Color sunC0 = (Object.op_Implicit((Object)(object)sun) ? sun.color : Color.white); Color fogC0 = RenderSettings.fogColor; SphericalHarmonicsL2 amb0 = RenderSettings.ambientProbe; Material sky0 = RenderSettings.skybox; Material sky1 = ((!Object.op_Implicit((Object)(object)sky0)) ? ((Material)null) : new Material(sky0)); List<(string name, Color was)> skyColours = new List<(string, Color)>(); if (Object.op_Implicit((Object)(object)sky1)) { RenderSettings.skybox = sky1; for (int num = 0; num < sky1.shader.GetPropertyCount(); num++) { if ((int)sky1.shader.GetPropertyType(num) == 0) { skyColours.Add((sky1.shader.GetPropertyName(num), sky0.GetColor(sky1.shader.GetPropertyName(num)))); } } } float exposure0 = ((Object.op_Implicit((Object)(object)sky1) && sky1.HasProperty("_Exposure")) ? sky0.GetFloat("_Exposure") : (-1f)); Color nightTint = new Color(0.3f, 0.36f, 0.62f); Color redTint = new Color(1f, 0.32f, 0.26f); while (_night || _red || _nightK > 0f || _redK > 0f) { _nightK = Mathf.MoveTowards(_nightK, _night ? 1f : 0f, Time.deltaTime / 1.5f); _redK = Mathf.MoveTowards(_redK, _red ? 1f : 0f, Time.deltaTime / 1.2f); float num2 = Mathf.SmoothStep(0f, 1f, _nightK); float num3 = Mathf.SmoothStep(0f, 1f, _redK) * (1f - num2); Color val = Color.Lerp(Color.Lerp(Color.white, redTint, num3), nightTint, num2); float num4 = Mathf.Lerp(1f, 0.1f, num2) * Mathf.Lerp(1f, 0.8f, num3); float num5 = Mathf.Lerp(1f, 0.15f, num2) * Mathf.Lerp(1f, 0.7f, num3); if (Object.op_Implicit((Object)(object)sun)) { sun.intensity = sunI0 * num4; sun.color = sunC0 * val; } SphericalHarmonicsL2 ambientProbe = amb0; for (int num6 = 0; num6 < 3; num6++) { for (int num7 = 0; num7 < 9; num7++) { int num8 = num6; int num9 = num7; ((SphericalHarmonicsL2)(ref ambientProbe))[num8, num9] = ((SphericalHarmonicsL2)(ref ambientProbe))[num8, num9] * (((Color)(ref val))[num6] * Mathf.Lerp(1f, 0.3f, num2)); } } RenderSettings.ambientProbe = ambientProbe; RenderSettings.fogColor = Color.Lerp(Color.Lerp(fogC0, new Color(0.4f, 0.05f, 0.05f), num3), new Color(0.02f, 0.03f, 0.08f), num2); RenderSettings.fogDensity = fogD0 * (1f + 2.5f * Mathf.Max(num2, num3)) + 0.01f * num2; RenderSettings.fogEndDistance = fogEnd0 * Mathf.Lerp(1f, 0.4f, Mathf.Max(num2, num3)); if (Object.op_Implicit((Object)(object)sky1)) { foreach (var (text, val2) in skyColours) { sky1.SetColor(text, new Color(val2.r * val.r * num5, val2.g * val.g * num5, val2.b * val.b * num5, val2.a)); } if (exposure0 >= 0f) { sky1.SetFloat("_Exposure", exposure0 * num5); } } yield return null; } if (Object.op_Implicit((Object)(object)sun)) { sun.intensity = sunI0; sun.color = sunC0; } RenderSettings.ambientProbe = amb0; RenderSettings.fogColor = fogC0; RenderSettings.fogDensity = fogD0; RenderSettings.fogEndDistance = fogEnd0; if (Object.op_Implicit((Object)(object)sky1)) { if ((Object)(object)RenderSettings.skybox == (Object)(object)sky1) { RenderSettings.skybox = sky0; } Object.Destroy((Object)(object)sky1); } _mood = null; } private IEnumerator Trophy(Vector3 at, EnemyKind k) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Color c = BossLooks.Colour(k); Transform pillar = WeaponFx.Piece(WeaponFx.Cyl, BossVfx.Glow(c, 6f)); Fx.Sound("ShinyCreatureCaught_0" + Random.Range(1, 4), at, 1f, (AudioDistance)3); Vector3 ground = new Vector3(at.x, Ground(at), at.z); for (float t = 0f; t < 2.5f; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)pillar)) { break; } float num = t / 2.5f; float num2 = 0.5f * (1f - num) + 0.05f; pillar.position = ground + Vector3.up * 6f; pillar.localScale = new Vector3(num2, 6f, num2); if (Random.value < 0.5f) { Burst(ground + Vector3.up * Random.Range(0.5f, 10f) + Random.insideUnitSphere.Flat() * 0.6f, "Gold", 2, 0.1f); } yield return null; } if (Object.op_Implicit((Object)(object)pillar)) { Object.Destroy((Object)(object)((Component)pillar).gameObject); } } public static float Top(Transform body) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Bounds val = BossLooks.WorldBounds(body); return ((Bounds)(ref val)).max.y - body.position.y; } public static void Burst(Vector3 at, string colour, int n, float size) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) BossVfx.Burst(at, WeaponFx.SparkColour(colour), n, size); } public void Overlay(OverlayKind kind, float seconds) { ((MonoBehaviour)this).StartCoroutine(OverlayRun(kind, seconds)); } private IEnumerator OverlayRun(OverlayKind kind, float seconds) { if (!Object.op_Implicit((Object)(object)_canvas)) { Hud.Canvas("Over99BossScreen", 850, ref _canvas); RectTransform val = Hud.Node(((Component)_canvas).transform, "Wash", Vector2.zero, Vector2.zero, Vector2.zero); val.anchorMin = Vector2.zero; val.anchorMax = Vector2.one; _overlay = ((Component)val).gameObject.AddComponent(); ((Graphic)_overlay).raycastTarget = false; for (int i = 0; i < 10; i++) { Image val2 = ((Component)Hud.Node(((Component)_canvas).transform, "Glitch", new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(4000f, 30f))).gameObject.AddComponent(); ((Graphic)val2).raycastTarget = false; _bars.Add(val2); } } ((Component)_canvas).gameObject.SetActive(true); for (float t = 0f; t < seconds; t += Time.deltaTime) { float num = Mathf.Clamp01((seconds - t) / Mathf.Min(0.6f, seconds * 0.5f)); switch (kind) { case OverlayKind.White: ((Graphic)_overlay).color = new Color(1f, 1f, 1f, 0.95f * num); break; case OverlayKind.Glint: ((Graphic)_overlay).color = new Color(0.7f, 1f, 1f, 0.35f * num); break; case OverlayKind.Ink: ((Graphic)_overlay).color = new Color(0.03f, 0.02f, 0.05f, 0.82f * num * (0.9f + 0.1f * Mathf.Sin(t * 5f))); break; default: ((Graphic)_overlay).color = new Color(Random.value * 0.2f, Random.value * 0.4f, Random.value * 0.2f, 0.15f * num); foreach (Image bar in _bars) { ((Component)bar).gameObject.SetActive(Random.value < 0.6f); ((Graphic)bar).rectTransform.anchoredPosition = new Vector2(Random.Range(-200f, 200f), Random.Range(-600f, 600f)); ((Graphic)bar).rectTransform.sizeDelta = new Vector2(4000f, Random.Range(6f, 60f)); ((Graphic)bar).color = ((Random.value < 0.33f) ? new Color(1f, 0f, 0.4f, 0.5f * num) : ((Random.value < 0.5f) ? new Color(0f, 1f, 0.5f, 0.5f * num) : new Color(0.2f, 0.4f, 1f, 0.5f * num))); } break; } yield return null; } ((Graphic)_overlay).color = Color.clear; foreach (Image bar2 in _bars) { ((Component)bar2).gameObject.SetActive(false); } } public static IEnumerator Lightning(Vector3 at, Color c) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = at + Vector3.up * 45f + Random.insideUnitSphere.Flat() * 6f; LineRenderer line = WeaponFx.Line("BossLightning", BossVfx.Glow(c, 9f), 0.35f); line.positionCount = 9; for (int i = 0; i < 9; i++) { line.SetPosition(i, Vector3.Lerp(val, at, (float)i / 8f) + ((i > 0 && i < 8) ? (Random.insideUnitSphere * 2.2f) : Vector3.zero)); } Light flash = new GameObject("BossLightningFlash").AddComponent(); flash.type = (LightType)2; flash.color = c; flash.range = 60f; flash.intensity = 6f; ((Component)flash).transform.position = at + Vector3.up * 8f; WeaponFx.Emit(WeaponFx.Sparks("Cyan"), at, 20, Vector3.up, c, 0.1f); Fx.Sound("Explosion", at, 0.5f, (AudioDistance)3); yield return (object)new WaitForSeconds(0.08f); if (Object.op_Implicit((Object)(object)line)) { ((Renderer)line).enabled = false; } yield return (object)new WaitForSeconds(0.05f); if (Object.op_Implicit((Object)(object)line)) { ((Renderer)line).enabled = true; } yield return (object)new WaitForSeconds(0.1f); if (Object.op_Implicit((Object)(object)line)) { Object.Destroy((Object)(object)((Component)line).gameObject); } if (Object.op_Implicit((Object)(object)flash)) { Object.Destroy((Object)(object)((Component)flash).gameObject); } } } public static class BossLooks { private static readonly Dictionary<(Texture, EnemyKind, bool), Texture2D> Painted = new Dictionary<(Texture, EnemyKind, bool), Texture2D>(); private static readonly Dictionary Source = new Dictionary(); public static string BodyOf(EnemyKind k) { switch (k) { case EnemyKind.Warden: return "lobster"; case EnemyKind.Urchin: return "seaurchin"; case EnemyKind.Angler: return "anglerfish"; case EnemyKind.Steed: return "seahorse"; case EnemyKind.Stonefish: return "stonefish"; case EnemyKind.Skyfish: case EnemyKind.Squadron: return "flyingfish"; case EnemyKind.Kraken: return "squid"; case EnemyKind.Voxel: case EnemyKind.Glitch: return "voxelfish"; case EnemyKind.Koi: return "koifish"; case EnemyKind.Eye: return "footsnail"; default: return null; } } public static Quaternion Turn(EnemyKind k) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return Quaternion.Euler(Pitch(k), Yaw(k), 0f); } public static float Yaw(EnemyKind k) { return 0f; } public static float Pitch(EnemyKind k) { return 0f; } public static Bounds WorldBounds(Transform root) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) bool any = false; Bounds b = new Bounds(root.position, Vector3.zero); Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (!val.enabled || val.forceRenderingOff || val is ParticleSystemRenderer || val is LineRenderer || Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent())) { continue; } SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null); if (val2 != null) { Add((Object.op_Implicit((Object)(object)val2.rootBone) ? val2.rootBone : ((Component)val2).transform).localToWorldMatrix, ((Renderer)val2).localBounds); continue; } MeshFilter component = ((Component)val).GetComponent(); if (component != null && Object.op_Implicit((Object)(object)component.sharedMesh)) { Add(((Component)val).transform.localToWorldMatrix, component.sharedMesh.bounds); } } if (!any) { return new Bounds(root.position, Vector3.one * 2f); } return b; void Add(Matrix4x4 m, Bounds local) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) for (int j = 0; j < 8; j++) { Vector3 val3 = ((Matrix4x4)(ref m)).MultiplyPoint3x4(((Bounds)(ref local)).center + Vector3.Scale(((Bounds)(ref local)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1))))); if (!any) { b = new Bounds(val3, Vector3.zero); any = true; } else { ((Bounds)(ref b)).Encapsulate(val3); } } } } public static void FitCollider(Transform root, Transform body) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00c7: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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) BoxCollider val = ((Component)root).GetComponentsInChildren().FirstOrDefault(); if (!Object.op_Implicit((Object)(object)val)) { return; } bool flag = false; Bounds val2 = default(Bounds); MeshFilter[] componentsInChildren = ((Component)body).GetComponentsInChildren(); foreach (MeshFilter val3 in componentsInChildren) { if (Object.op_Implicit((Object)(object)((Component)val3).GetComponentInParent()) || !Object.op_Implicit((Object)(object)val3.sharedMesh)) { continue; } Matrix4x4 val4 = ((Component)val).transform.worldToLocalMatrix * ((Component)val3).transform.localToWorldMatrix; Bounds bounds = val3.sharedMesh.bounds; for (int j = 0; j < 8; j++) { Vector3 val5 = ((Matrix4x4)(ref val4)).MultiplyPoint3x4(((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1))))); if (!flag) { ((Bounds)(ref val2))..ctor(val5, Vector3.zero); flag = true; } else { ((Bounds)(ref val2)).Encapsulate(val5); } } } if (flag) { val.center = ((Bounds)(ref val2)).center; val.size = ((Bounds)(ref val2)).size; } } public static Color Colour(EnemyKind k) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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) switch (k) { case EnemyKind.Warden: return new Color(1f, 0.55f, 0.2f); case EnemyKind.Urchin: return new Color(1f, 0.3f, 0.85f); case EnemyKind.Angler: return new Color(0.3f, 0.9f, 1f); case EnemyKind.Steed: return new Color(1f, 0.85f, 0.4f); case EnemyKind.Stonefish: return new Color(0.55f, 1f, 0.3f); case EnemyKind.Skyfish: case EnemyKind.Squadron: return new Color(0.45f, 0.7f, 1f); case EnemyKind.Kraken: return new Color(0.95f, 0.15f, 0.3f); case EnemyKind.Voxel: case EnemyKind.Glitch: return new Color(0.4f, 1f, 0.6f); case EnemyKind.Koi: return new Color(1f, 0.6f, 0.15f); case EnemyKind.Eye: return new Color(1f, 0.08f, 0.12f); default: return new Color(1f, 0.3f, 0.2f); } } private static (Color[] ramp, float keep) Paint(EnemyKind k, bool second) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0109: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0260: 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_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: 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_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: 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_035f: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) switch (k) { case EnemyKind.Warden: return (ramp: (Color[])(object)new Color[4] { new Color(0.22f, 0.07f, 0.04f), new Color(0.7f, 0.2f, 0.07f), new Color(0.95f, 0.5f, 0.15f), new Color(1f, 0.85f, 0.45f) }, keep: 0f); case EnemyKind.Urchin: return (ramp: (Color[])(object)new Color[4] { new Color(0.12f, 0.02f, 0.18f), new Color(0.45f, 0.06f, 0.55f), new Color(0.85f, 0.2f, 0.75f), new Color(1f, 0.6f, 0.95f) }, keep: 0f); case EnemyKind.Angler: return (ramp: (Color[])(object)new Color[4] { new Color(0.04f, 0.05f, 0.14f), new Color(0.1f, 0.18f, 0.38f), new Color(0.2f, 0.55f, 0.75f), new Color(0.5f, 1f, 1f) }, keep: 0f); case EnemyKind.Steed: return (ramp: (Color[])(object)new Color[3] { new Color(0.45f, 0.47f, 0.55f), new Color(0.9f, 0.92f, 0.98f), new Color(1f, 0.86f, 0.45f) }, keep: 0f); case EnemyKind.Stonefish: return (ramp: (Color[])(object)new Color[4] { new Color(0.14f, 0.15f, 0.13f), new Color(0.33f, 0.36f, 0.28f), new Color(0.45f, 0.6f, 0.3f), new Color(0.65f, 1f, 0.3f) }, keep: 0f); case EnemyKind.Skyfish: case EnemyKind.Squadron: return (ramp: (Color[])(object)new Color[3] { new Color(0.08f, 0.12f, 0.24f), new Color(0.32f, 0.48f, 0.75f), new Color(0.95f, 0.96f, 1f) }, keep: 0.2f); case EnemyKind.Kraken: return (ramp: (Color[])(object)new Color[4] { new Color(0.25f, 0.02f, 0.06f), new Color(0.65f, 0.05f, 0.12f), new Color(0.95f, 0.25f, 0.25f), new Color(1f, 0.7f, 0.6f) }, keep: 0f); case EnemyKind.Koi: if (!second) { return (ramp: (Color[])(object)new Color[3] { new Color(0.62f, 0.08f, 0.05f), new Color(0.97f, 0.94f, 0.9f), new Color(1f, 0.84f, 0.4f) }, keep: 0.25f); } return (ramp: (Color[])(object)new Color[3] { new Color(0.4f, 0.02f, 0.02f), new Color(0.92f, 0.5f, 0.08f), new Color(1f, 0.95f, 0.55f) }, keep: 0f); case EnemyKind.Eye: return (ramp: (Color[])(object)new Color[4] { new Color(0.03f, 0.02f, 0.04f), new Color(0.12f, 0.06f, 0.14f), new Color(0.35f, 0.08f, 0.2f), new Color(1f, 0.15f, 0.2f) }, keep: 0f); default: return (ramp: null, keep: 1f); } } public static void Dress(Transform root, EnemyKind kind, bool second = false) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) Repaint(root, kind, second); Rigidbody[] componentsInChildren = ((Component)root).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].isKinematic = true; } (((Component)root).GetComponent() ?? ((Component)root).gameObject.AddComponent()).Kind = kind; if (kind != EnemyKind.Squadron && kind != EnemyKind.Glitch && !Object.op_Implicit((Object)(object)root.Find("BossGlow"))) { Light obj = new GameObject("BossGlow").AddComponent(); ((Component)obj).transform.SetParent(root, false); ((Component)obj).transform.localPosition = Vector3.up * 0.3f; obj.type = (LightType)2; obj.color = Colour(kind); obj.range = 9f; obj.intensity = 1.6f; obj.shadows = (LightShadows)0; } if (kind == EnemyKind.Eye) { BossEye.Dress(root); } if (kind == EnemyKind.Steed) { BossSteed.Dress(root); } } private static void Repaint(Transform root, EnemyKind kind, bool second) { var (array, keep) = Paint(kind, second); if (array == null) { return; } Models.OwnMaterials ownMaterials = ((Component)root).GetComponent() ?? ((Component)root).gameObject.AddComponent(); Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (val is ParticleSystemRenderer || Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent())) { continue; } Material[] materials = val.materials; Material[] array2 = materials; foreach (Material val2 in array2) { if (!ownMaterials.Mats.Contains(val2)) { ownMaterials.Mats.Add(val2); } if (!val2.HasProperty("_Colors")) { continue; } Texture val3 = val2.GetTexture("_Colors"); if (val3 != null) { if (((Object)val3).name.StartsWith("Boss")) { val3 = (Source.TryGetValue(val3, out var value) ? value : val3); } if (!Painted.TryGetValue((val3, kind, second), out var value2)) { value2 = (Painted[(val3, kind, second)] = Ramp(val3, array, keep, kind.ToString() + (second ? "2" : ""))); } if (Object.op_Implicit((Object)(object)value2)) { val2.SetTexture("_Colors", (Texture)(object)value2); Source[(Texture)(object)value2] = val3; } if (val2.HasProperty("_Emission")) { val2.SetFloat("_Emission", (kind == EnemyKind.Eye || (kind == EnemyKind.Koi && second)) ? 0.35f : 0f); } } } val.materials = materials; } } private static Texture2D Ramp(Texture src, Color[] ramp, float keep, string name) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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) //IL_01eb: 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_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) RenderTexture temporary = RenderTexture.GetTemporary(src.width, src.height, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)2); Graphics.Blit(src, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val = new Texture2D(src.width, src.height, (TextureFormat)4, false) { name = "Boss" + name, filterMode = src.filterMode, wrapMode = src.wrapMode }; val.ReadPixels(new Rect(0f, 0f, (float)src.width, (float)src.height), 0, 0); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); Color[] pixels = val.GetPixels(); float num = 1f; float num2 = 0f; Color[] array = pixels; foreach (Color val2 in array) { if (!(val2.a < 0.5f)) { float num3 = 0.299f * val2.r + 0.587f * val2.g + 0.114f * val2.b; num = Mathf.Min(num, num3); num2 = Mathf.Max(num2, num3); } } if (num2 - num < 0.05f) { num = 0f; num2 = 1f; } for (int j = 0; j < pixels.Length; j++) { Color val3 = pixels[j]; float num4 = Mathf.Clamp01((0.299f * val3.r + 0.587f * val3.g + 0.114f * val3.b - num) / (num2 - num)) * (float)(ramp.Length - 1); int num5 = Mathf.Min(ramp.Length - 2, Mathf.FloorToInt(num4)); Color val4 = Color.Lerp(ramp[num5], ramp[num5 + 1], num4 - (float)num5); pixels[j] = new Color(Mathf.Lerp(val4.r, val3.r, keep), Mathf.Lerp(val4.g, val3.g, keep), Mathf.Lerp(val4.b, val3.b, keep), val3.a); } val.SetPixels(pixels); val.Apply(false); return val; } } public class BossGear : MonoBehaviour { } public class BossBody : MonoBehaviour { public EnemyKind Kind; private readonly List<(Transform bone, Quaternion rest, Vector3 axis, float phase)> _swing = new List<(Transform, Quaternion, Vector3, float)>(); private Vector3 _last; private float _speed; private float _nextAura; private float _t; private BossSteed _steed; private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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) _last = ((Component)this).transform.position; _steed = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)_steed) || Object.op_Implicit((Object)(object)((Component)this).GetComponent())) { return; } int num = 0; HingeJoint[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (HingeJoint val in componentsInChildren) { _swing.Add((((Component)val).transform, ((Component)val).transform.localRotation, ((Joint)val).axis, (float)num++ * 0.8f)); } if (_swing.Count != 0) { return; } SkinnedMeshRenderer[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren2.Length; i++) { foreach (Transform item in componentsInChildren2[i].bones.Where((Transform b) => Object.op_Implicit((Object)(object)b) && ((Object)b).name.StartsWith("leg"))) { _swing.Add((item, item.localRotation, Vector3.forward, (float)num++ * MathF.PI * 0.5f)); } } } private void LateUpdate() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0107: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; if (deltaTime <= 0f) { return; } float speed = _speed; Vector3 val = ((Component)this).transform.position - _last; _speed = Mathf.Lerp(speed, ((Vector3)(ref val)).magnitude / deltaTime, 1f - Mathf.Exp(-4f * deltaTime)); _last = ((Component)this).transform.position; _t += deltaTime * (2f + Mathf.Min(10f, _speed * 1.2f)); float num = Mathf.Lerp(12f, 28f, Mathf.Clamp01(_speed / 6f)); foreach (var (val2, val3, val4, num2) in _swing) { if (Object.op_Implicit((Object)(object)val2)) { val2.localRotation = val3 * Quaternion.AngleAxis(Mathf.Sin(_t + num2) * num, val4); } } if (Time.time >= _nextAura) { _nextAura = Time.time + 0.12f; Aura(); } } private void Aura() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_0146: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) Color c = BossLooks.Colour(Kind); Vector3 at = (Object.op_Implicit((Object)(object)_steed) ? _steed.AuraPoint() : (((Component)this).transform.position + Random.insideUnitSphere * ((Kind == EnemyKind.Eye) ? 4f : (1.5f * ((Component)this).transform.lossyScale.x * 0.1f)))); switch (Kind) { case EnemyKind.Urchin: case EnemyKind.Koi: case EnemyKind.Eye: WeaponFx.Emit(BossVfx.Sparks(c), at, 1, Vector3.up, null, 0.12f, null, 0.8f); break; case EnemyKind.Angler: case EnemyKind.Kraken: WeaponFx.Emit(WeaponFx.Bubbles, at, 1, Vector3.up); break; case EnemyKind.Stonefish: WeaponFx.Emit(BossVfx.Sparks(c), at, 1, Vector3.up, null, 0.1f, null, 0.9f); break; default: WeaponFx.Emit(BossVfx.Sparks(c), at, 1, Vector3.up, null, 0.08f, null, 0.6f); break; case EnemyKind.Squadron: case EnemyKind.Glitch: break; } } } public enum OverlayKind { White, Glint, Ink, Glitch } public class BossSteed : MonoBehaviour { public static readonly string[] Parts = new string[8] { "BossSteedBody", "BossSteedHead", "BossSteedTail", "BossSteedForeArm", "BossSteedForeShin", "BossSteedThigh", "BossSteedHindShin", "BossSteedWing" }; public static readonly Vector3 Neck = new Vector3(0f, -0.2f, 2.9f); public static readonly Vector3 Dock = new Vector3(0f, -0.15f, -3.62f); public static readonly Vector3 Wing = new Vector3(-0.7f, 0.55f, 1.5f); public static readonly Vector3 Shoulder = new Vector3(-0.62f, -1.3f, 2.55f); public static readonly Vector3 Knee = new Vector3(0f, -2.7f, 0.07f); public static readonly Vector3 Hip = new Vector3(-0.66f, -0.75f, -2.35f); public static readonly Vector3 Hock = new Vector3(0f, -3f, -0.65f); public const float Hooves = 5.7f; public const float HorseShift = 6.88f; private static readonly string[] Legs = new string[4] { "FL", "FR", "HL", "HR" }; private Transform _body; private Transform _head; private Transform _tail; private readonly Transform[] _upper = (Transform[])(object)new Transform[4]; private readonly Transform[] _lower = (Transform[])(object)new Transform[4]; private readonly Transform[] _wings = (Transform[])(object)new Transform[2]; private Renderer[] _sparkle; private Vector3 _last; private float _speed; private float _stride; private float _run; private float _fly; private float _rear; private readonly float[] _pose = new float[15]; private readonly float[] _other = new float[15]; private static Mesh _mirrored; public const int Pitch = 8; public const int Bob = 9; public const int NeckTurn = 10; public const int TailLift = 11; public const int Raise = 12; public const int Sweep = 13; public const int Tilt = 14; public const int N = 15; private static readonly float[] Stride = new float[4] { 0.45f, 0.55f, 0f, 0.1f }; public static bool Dress(Transform root) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00dc: 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_0108: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: 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_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((Component)root).GetComponent())) { return true; } if (Parts.Any((string p) => !File.Exists(Path.Combine(Models.Dir ?? "", p + ".obj")))) { return false; } List list = (from r in ((Component)root).GetComponentsInChildren() where !(r is ParticleSystemRenderer) select r).ToList(); Transform transform = new GameObject("BossSteedRig").transform; transform.SetParent(root, false); transform.localScale = Vector3.one / root.localScale.x; ((Component)transform).gameObject.layer = ((list.Count > 0) ? ((Component)list[0]).gameObject.layer : ((Component)root).gameObject.layer); Transform val = Part("BossSteedBody", transform, "Body", Vector3.zero); Part("BossSteedHead", val, "Head", Neck); Part("BossSteedTail", val, "Tail", Dock); Vector3 val2 = default(Vector3); for (int num = 0; num < 4; num++) { ((Vector3)(ref val2))..ctor((num % 2 == 0) ? 1f : (-1f), 1f, 1f); Transform parent = Part((num < 2) ? "BossSteedForeArm" : "BossSteedThigh", val, Legs[num], Vector3.Scale((num < 2) ? Shoulder : Hip, val2)); Part((num < 2) ? "BossSteedForeShin" : "BossSteedHindShin", parent, "Shin", (num < 2) ? Knee : Hock); } BossLooks.FitCollider(root, transform); Part("BossSteedWing", val, "WingL", Wing); MeshFilter component = ((Component)Part("BossSteedWing", val, "WingR", Vector3.Scale(Wing, new Vector3(-1f, 1f, 1f)))).GetComponent(); component.sharedMesh = Mirrored(component.sharedMesh); foreach (Renderer item in list) { item.forceRenderingOff = true; } Transform val3 = root.Find("Horse"); if (val3 != null) { val3.localPosition += Vector3.forward * (6.88f / root.localScale.z); } Transform val4 = root.Find("BossGlow"); if (val4 != null) { Light component2 = ((Component)val4).GetComponent(); if (component2 != null) { val4.SetParent(transform, false); val4.localPosition = Vector3.up * 2.5f; component2.range = 14f; } } ((Component)root).gameObject.AddComponent().Bind(val); return true; static Transform Part(string model, Transform parent2, string name, Vector3 at) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Transform transform2 = Models.Attach(model, parent2, Vector3.one).transform; ((Object)transform2).name = name; transform2.localPosition = at; return transform2; } } private static Mesh Mirrored(Mesh m) { if (Object.op_Implicit((Object)(object)_mirrored)) { return _mirrored; } Mesh val = Object.Instantiate(m); ((Object)val).name = ((Object)m).name + "Right"; val.SetVertices(((IEnumerable)m.vertices).Select((Func)((Vector3 v) => new Vector3(0f - v.x, v.y, v.z))).ToList()); for (int num = 0; num < m.subMeshCount; num++) { val.SetTriangles(m.GetTriangles(num).Reverse().ToArray(), num); } val.RecalculateNormals(); val.RecalculateBounds(); return _mirrored = val; } private void Bind(Transform body) { //IL_00ee: 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) _body = body; _head = body.Find("Head"); _tail = body.Find("Tail"); for (int i = 0; i < 4; i++) { _upper[i] = body.Find(Legs[i]); _lower[i] = _upper[i].Find("Shin"); } _wings[0] = body.Find("WingL"); _wings[1] = body.Find("WingR"); _sparkle = ((IEnumerable)(object)new Transform[4] { _wings[0], _wings[1], _head, _tail }).Select((Transform t) => ((Component)t).GetComponent()).ToArray(); _last = ((Component)this).transform.position; } public Transform Phantom(Material mat) { //IL_0005: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0051: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("BossSteedPhantom").transform; transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation); Transform val = Object.Instantiate(_body, transform, false); val.localPosition = Vector3.zero; val.localRotation = Quaternion.identity; val.localScale = Vector3.one; Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren(); foreach (Renderer val2 in componentsInChildren) { val2.sharedMaterials = Enumerable.Repeat(mat, val2.sharedMaterials.Length).ToArray(); val2.shadowCastingMode = (ShadowCastingMode)0; } ((Component)transform).gameObject.AddComponent().Bind(val); return transform; } public Vector3 AuraPoint() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0060: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = _sparkle[Random.Range(0, _sparkle.Length)].bounds; return ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f))); } private void LateUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: 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_031b: 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_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; float time = Time.time; if (!(deltaTime <= 0f) && Object.op_Implicit((Object)(object)_body)) { Vector3 position = ((Component)this).transform.position; Vector3 val = (position - _last) / deltaTime; _last = position; float speed = _speed; Vector2 val2 = new Vector2(val.x, val.z); _speed = Mathf.Lerp(speed, Mathf.Min(60f, ((Vector2)(ref val2)).magnitude), 1f - Mathf.Exp(-6f * deltaTime)); float num = Mathf.Asin(Mathf.Clamp(((Component)this).transform.forward.y, -1f, 1f)) * 57.29578f; float num2 = position.y - 5.7f - BossFx.Ground(position); Ease(ref _rear, Mathf.Clamp01(num / 28f), 8f, deltaTime); Ease(ref _fly, (num2 > 1f && num < 10f) ? 1f : 0f, 5f, deltaTime); Ease(ref _run, Mathf.Clamp01((_speed - 1.5f) / 4f), 4f, deltaTime); _stride = Mathf.Repeat(_stride + deltaTime * Mathf.Clamp(_speed / 9f, 0.8f, 2.4f), 1f); Rest(_pose, time); Gallop(_other, _stride); Mix(_pose, _other, _run); Leap(_other, time); Mix(_pose, _other, _fly); Rear(_other, time); Mix(_pose, _other, _rear); _body.localPosition = Vector3.up * _pose[9]; _body.localRotation = Quaternion.AngleAxis(_pose[8], Vector3.right); _head.localRotation = Quaternion.AngleAxis(_pose[10], Vector3.right); _tail.localRotation = Quaternion.AngleAxis(_pose[11], Vector3.right); for (int i = 0; i < 4; i++) { _upper[i].localRotation = Quaternion.AngleAxis(_pose[i], Vector3.right); _lower[i].localRotation = Quaternion.AngleAxis(_pose[4 + i], Vector3.right); } Quaternion val3 = Quaternion.AngleAxis(_pose[14], Vector3.right) * Quaternion.AngleAxis(0f - _pose[13], Vector3.up) * Quaternion.AngleAxis(_pose[12], Vector3.forward); _wings[0].localRotation = val3; _wings[1].localRotation = new Quaternion(val3.x, 0f - val3.y, 0f - val3.z, val3.w); } } private static void Ease(ref float v, float to, float rate, float dt) { v = Mathf.Lerp(v, to, 1f - Mathf.Exp((0f - rate) * dt)); } private static void Mix(float[] into, float[] from, float k) { for (int i = 0; i < 15; i++) { into[i] = Mathf.Lerp(into[i], from[i], k); } } public static void Rest(float[] o, float t) { Array.Clear(o, 0, 15); float num = Mathf.Sin(t * 1.3f); float num2 = Mathf.Repeat(t, 7f); o[9] = 0.04f * num; o[10] = 4f + 3f * Mathf.Sin(t * 0.45f); o[11] = 4f + 4f * Mathf.Sin(t * 0.8f); o[12] = -45f + 3f * num; o[13] = 30f; o[14] = -30f; if (num2 < 1.2f) { float num3 = Mathf.Sin(num2 / 1.2f * MathF.PI); o[0] = (-18f + 10f * Mathf.Sin(num2 * 9f)) * num3; o[4] = 75f * num3; } } public static void Gallop(float[] o, float u) { for (int i = 0; i < 4; i++) { float num = MathF.PI * 2f * (u - Stride[i]); float num2 = Mathf.Pow(Mathf.Max(0f, 0f - Mathf.Cos(num)), 0.7f); o[i] = ((i < 2) ? 28f : 26f) * Mathf.Sin(num); o[4 + i] = ((i < 2) ? (75f * num2) : (-45f * num2)); } o[8] = 4f * Mathf.Sin(MathF.PI * 2f * (u - 0.3f)); o[9] = 0.3f * Mathf.Sin(MathF.PI * 4f * u); o[10] = 10f + 6f * Mathf.Sin(MathF.PI * 2f * (u - 0.45f)); o[11] = 40f + 6f * Mathf.Sin(MathF.PI * 2f * u); o[12] = -25f; o[13] = 55f; o[14] = -10f; } public static void Leap(float[] o, float t) { Array.Clear(o, 0, 15); o[0] = -50f; o[4] = 110f; o[1] = -45f; o[5] = 105f; o[2] = 40f; o[6] = 25f; o[3] = 35f; o[7] = 20f; o[8] = -6f; o[10] = -4f; o[11] = 50f; o[12] = -20f + 35f * Mathf.Sin(t * 14f); } public static void Rear(float[] o, float t) { Array.Clear(o, 0, 15); float num = Mathf.Sin(t * 9f); o[0] = -35f + 20f * num; o[4] = 80f; o[1] = -20f - 20f * num; o[5] = 100f; o[10] = 22f; o[11] = 10f; o[12] = -55f + 4f * num; o[13] = 5f; } } public class BossTrophyItem : MonoBehaviour { public EnemyKind Boss; } public static class BossTrophies { public const byte FirstId = 180; private static readonly Dictionary Prefabs = new Dictionary(); public static bool Ready { get; private set; } public static byte IdOf(EnemyKind k) { return (byte)(180 + Array.IndexOf(EnemyCatalog.BossOrder, k)); } public static int Worth(EnemyKind k) { return Siege.Money(Mathf.RoundToInt(500f * Mathf.Pow(1.4f, (float)Array.IndexOf(EnemyCatalog.BossOrder, k)))); } public static string ModelOf(EnemyKind k) { return "Trophy" + k; } public static bool Is(Item item, out EnemyKind k) { BossTrophyItem bossTrophyItem = (Object.op_Implicit((Object)(object)item) ? ((Component)item).GetComponent() : null); k = (Object.op_Implicit((Object)(object)bossTrophyItem) ? bossTrophyItem.Boss : EnemyKind.Runner); return Object.op_Implicit((Object)(object)bossTrophyItem); } public static bool TryRegister() { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown if (Ready) { return true; } Item spawnable = GameInfo.GetSpawnable("spidercrabshell"); NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)spawnable) && Object.op_Implicit((Object)(object)networkManager)) { PrefabObjects spawnablePrefabs = networkManager.SpawnablePrefabs; SinglePrefabObjects val = (SinglePrefabObjects)(object)((spawnablePrefabs is SinglePrefabObjects) ? spawnablePrefabs : null); if (val != null) { Dictionary dictionary = (Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null); Dictionary byId = (Dictionary)AccessTools.Field(typeof(GameInfo), "_idToSpawnable").GetValue(null); Dictionary dictionary2 = (Dictionary)AccessTools.Field(typeof(GameInfo), "_allItems").GetValue(null); if (EnemyCatalog.BossOrder.Any((EnemyKind k) => byId.ContainsKey(IdOf(k)) && !Is(byId[IdOf(k)], out var _))) { BuildSystem.Log.LogError((object)"Item ids 180-189 are taken by the game: boss trophies can't be items."); Ready = true; return true; } GameObject val2 = new GameObject("FortressBossTrophies"); val2.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val2); EnemyKind[] bossOrder = EnemyCatalog.BossOrder; for (int num = 0; num < bossOrder.Length; num++) { EnemyKind enemyKind = bossOrder[num]; GameObject val3 = Object.Instantiate(((Component)spawnable).gameObject, val2.transform); ((Object)val3).name = "FortressTrophy" + enemyKind; Item component = val3.GetComponent(); AccessTools.Field(typeof(Item), "_id").SetValue(component, IdOf(enemyKind)); AccessTools.Field(typeof(Item), "_worth").SetValue(component, Worth(enemyKind)); AccessTools.Property(typeof(Item), "IsQuestItem").SetValue(component, false); val3.AddComponent().Boss = enemyKind; Dress(val3, component, enemyKind, spawnable); ((PrefabObjects)val).AddObject(val3.GetComponent(), true, true); dictionary[((Object)val3).name.ToLower()] = component; byId[IdOf(enemyKind)] = component; dictionary2[IdOf(enemyKind)] = component; Prefabs[enemyKind] = component; } Ready = true; BuildSystem.Log.LogInfo((object)$"Boss trophies registered as items {(byte)180}-{180 + EnemyCatalog.BossOrder.Length - 1}."); return true; } } return false; } private static void Dress(GameObject go, Item item, EnemyKind k, Item shell) { //IL_00af: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0161: 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_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_01ac: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01ca: 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_01f8: 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_0201: 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) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0235: 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_0241: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: 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_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_031d: 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_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0330: 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_033a: Unknown result type (might be due to invalid IL or missing references) Collider val = ((IEnumerable)go.GetComponentsInChildren(true)).FirstOrDefault((Func)((Collider c) => !c.isTrigger)); int num = (Object.op_Implicit((Object)(object)val) ? ((Component)val).gameObject.layer : go.layer); Renderer[] componentsInChildren = go.GetComponentsInChildren(true); for (int num2 = 0; num2 < componentsInChildren.Length; num2++) { componentsInChildren[num2].enabled = false; } Collider[] componentsInChildren2 = go.GetComponentsInChildren(true); foreach (Collider val2 in componentsInChildren2) { if (!val2.isTrigger) { val2.enabled = false; } } GameObject val3 = Models.Attach(ModelOf(k), go.transform, Vector3.one * 0.4f); ((Object)val3).name = "FortressModel"; MeshFilter component = val3.GetComponent(); Mesh val4 = ((component != null) ? component.sharedMesh : null); float num3; Bounds bounds; if (!Object.op_Implicit((Object)(object)val4)) { num3 = 0.5f; } else { bounds = val4.bounds; float x = ((Bounds)(ref bounds)).size.x; bounds = val4.bounds; float y = ((Bounds)(ref bounds)).size.y; bounds = val4.bounds; num3 = Mathf.Max(x, Mathf.Max(y, ((Bounds)(ref bounds)).size.z)); } float num4 = num3; float num5 = 0.8f / Mathf.Max(0.1f, num4); Vector3 lossyScale = go.transform.lossyScale; val3.transform.localScale = new Vector3(num5 / lossyScale.x, num5 / lossyScale.y, num5 / lossyScale.z); Transform transform = val3.transform; Vector3 localPosition; if (!Object.op_Implicit((Object)(object)val4)) { localPosition = Vector3.zero; } else { bounds = val4.bounds; localPosition = -Vector3.Scale(((Bounds)(ref bounds)).center, val3.transform.localScale); } transform.localPosition = localPosition; BoxCollider val5 = go.AddComponent(); Vector3 size; if (!Object.op_Implicit((Object)(object)val4)) { size = Vector3.one * 0.5f; } else { bounds = val4.bounds; size = Vector3.Scale(((Bounds)(ref bounds)).size, val3.transform.localScale); } val5.size = size; val5.center = Vector3.zero; if (num != go.layer) { GameObject val6 = new GameObject("TrophyCollider") { layer = num }; val6.transform.SetParent(go.transform, false); val6.AddComponent().size = val5.size; Object.Destroy((Object)(object)val5); } AccessTools.Field(typeof(Item), "_mesh").SetValue(item, val4); if (Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)shell.Mesh)) { float num6 = shell.InventoryMeshScale * Big(shell.Mesh.bounds) / Big(val4.bounds); Quaternion val7 = Quaternion.Euler(shell.InventoryMeshRot); Vector3 inventoryMeshPos = shell.InventoryMeshPos; bounds = shell.Mesh.bounds; Vector3 val8 = inventoryMeshPos + val7 * (((Bounds)(ref bounds)).center * shell.InventoryMeshScale); FieldInfo fieldInfo = AccessTools.Field(typeof(Item), "_inventoryMeshPos"); bounds = val4.bounds; fieldInfo.SetValue(item, val8 - val7 * (((Bounds)(ref bounds)).center * num6)); AccessTools.Field(typeof(Item), "_inventoryMeshScale").SetValue(item, num6); } go.AddComponent().Rarity = Rarity.Legendary; static float Big(Bounds b) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) return Mathf.Max(0.001f, Mathf.Max(((Bounds)(ref b)).size.x, Mathf.Max(((Bounds)(ref b)).size.y, ((Bounds)(ref b)).size.z))); } } public static Material[] Colours(Item item) { if (Is(item, out var k) && Prefabs.TryGetValue(k, out var value)) { Transform val = WeaponItems.ModelOf(value); if (val != null) { Renderer component = ((Component)val).GetComponent(); if (component != null) { return component.sharedMaterials; } } } return null; } public static Item ServerSpawn(EnemyKind k, Vector3 at) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (!Prefabs.TryGetValue(k, out var value) || !Object.op_Implicit((Object)(object)value) || !Object.op_Implicit((Object)(object)ItemManager.Instance)) { return null; } Item result = ItemManager.Instance.SpawnNewItem(value, at, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); AutoTest.Count("trophy_spawned"); return result; } public static void ServerDrop(EnemyKind k, Vector3 died, int wave) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_00a8: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; Vector3 val = died; if (Object.op_Implicit((Object)(object)instance) && instance.Exists) { Vector3 center = instance.Center; Vector3 val2 = (died - center).Flat(); val = center + ((((Vector3)(ref val2)).magnitude > 1f) ? ((Vector3)(ref val2)).normalized : Vector3.forward) * Mathf.Min(((Vector3)(ref val2)).magnitude, 20f); } val.y = BossFx.Ground(val) + 2.5f; Item obj = ServerSpawn(k, val); if (Object.op_Implicit((Object)(object)Loot.Instance)) { Loot.Instance.ServerDropScales(val, Loot.BossScales(wave), 8, 3.2f); } BossFx.Send("trophy", null, val, val, 0, (int)k); Fx.Announce("trophyDropped" + k); if (Object.op_Implicit((Object)(object)obj)) { AutoTest.Count("trophy_dropped_" + k); } } } [HarmonyPatch(typeof(GameInfo), "Awake")] internal static class RegisterBossTrophies { private static void Postfix() { BossTrophies.TryRegister(); } } [HarmonyPatch(typeof(Item), "GetName")] internal static class BossTrophyName { private static void Postfix(Item __instance, ref string __result) { if (BossTrophies.Is(__instance, out var k)) { __result = L10n.T("trophy" + k); } } } public static class BossVfx { public class Tube { public readonly Transform T; private readonly Mesh _mesh = new Mesh { name = "BossVfxTube" }; private readonly int _sides; private readonly List _v = new List(); private readonly List _t = new List(); public Tube(Material mat, int sides = 7) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) _sides = sides; T = new GameObject("BossVfxTube", new Type[2] { typeof(MeshFilter), typeof(MeshRenderer) }).transform; ((Component)T).GetComponent().sharedMesh = _mesh; MeshRenderer component = ((Component)T).GetComponent(); ((Renderer)component).sharedMaterial = mat; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; _mesh.MarkDynamic(); } public void Set(IList path, float root, float tip) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00ba: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00b1: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) _v.Clear(); _t.Clear(); int count = path.Count; Vector3 val = Vector3.forward; List list = new List(); for (int i = 0; i < count; i++) { Vector3 val2 = path[Mathf.Min(count - 1, i + 1)] - path[Mathf.Max(0, i - 1)]; Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 1E-06f) { val3 = Vector3.up; } val2 = Vector3.Cross(Vector3.Cross(val3, val), val3); val = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val)).sqrMagnitude < 1E-06f) { val2 = Vector3.Cross(val3, Vector3.right); val = ((Vector3)(ref val2)).normalized; } Vector3 val4 = Vector3.Cross(val3, val); float num = Mathf.Lerp(root, tip, (float)i / (float)(count - 1)); Vector3[] array = (Vector3[])(object)new Vector3[_sides]; for (int j = 0; j < _sides; j++) { float num2 = (float)j * MathF.PI * 2f / (float)_sides; array[j] = path[i] + (val * Mathf.Cos(num2) + val4 * Mathf.Sin(num2)) * num; } list.Add(array); } for (int k = 0; k + 1 < count; k++) { for (int l = 0; l < _sides; l++) { int num3 = (l + 1) % _sides; Vector3[] array2 = (Vector3[])(object)new Vector3[6] { list[k][l], list[k + 1][l], list[k][num3], list[k][num3], list[k + 1][l], list[k + 1][num3] }; foreach (Vector3 item in array2) { _t.Add(_v.Count); _v.Add(item); } } } _mesh.Clear(); _mesh.SetVertices(_v); _mesh.SetTriangles(_t, 0); _mesh.RecalculateNormals(); _mesh.RecalculateBounds(); } public void Destroy() { if (Object.op_Implicit((Object)(object)T)) { Object.Destroy((Object)(object)((Component)T).gameObject); } Object.Destroy((Object)(object)_mesh); } } private static readonly Dictionary Meshes = new Dictionary(); private static readonly Dictionary Mats = new Dictionary(); public static Mesh Shard { get { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a3: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if (Meshes.TryGetValue("Shard", out var value)) { return value; } List list = new List(); Vector3 zero = Vector3.zero; Vector3 up = Vector3.up; Vector3[] array = (Vector3[])(object)new Vector3[6]; for (int i = 0; i < 6; i++) { float num = (float)i * MathF.PI / 3f; array[i] = new Vector3(Mathf.Cos(num) * 0.2f, 0.28f, Mathf.Sin(num) * 0.2f); } for (int j = 0; j < 6; j++) { int num2 = (j + 1) % 6; list.AddRange((IEnumerable)(object)new Vector3[6] { array[j], up, array[num2], array[num2], zero, array[j] }); } return Meshes["Shard"] = Faceted("Shard", list); } } public static Mesh Spike { get { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0097: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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) if (Meshes.TryGetValue("Spike", out var value)) { return value; } List list = new List(); Vector3[] array = (Vector3[])(object)new Vector3[5]; for (int i = 0; i < 5; i++) { float num = (float)i * MathF.PI * 2f / 5f; array[i] = new Vector3(Mathf.Cos(num) * 0.08f, Mathf.Sin(num) * 0.08f, 0f); } for (int j = 0; j < 5; j++) { int num2 = (j + 1) % 5; list.AddRange((IEnumerable)(object)new Vector3[6] { array[j], array[num2], Vector3.forward, array[num2], array[j], Vector3.zero }); } return Meshes["Spike"] = Faceted("Spike", list); } } public static Mesh Link { get { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (Meshes.TryGetValue("Link", out var value)) { return value; } List list = new List(); for (int i = 0; i < 10; i++) { for (int j = 0; j < 5; j++) { list.AddRange((IEnumerable)(object)new Vector3[6] { P(i, j), P(i + 1, j), P(i, j + 1), P(i, j + 1), P(i + 1, j), P(i + 1, j + 1) }); } } return Meshes["Link"] = Faceted("Link", list); static Vector3 P(int num2, int num4) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0070: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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) float num = (float)num2 * MathF.PI * 2f / 10f; float num3 = (float)num4 * MathF.PI * 2f / 5f; Vector3 val2 = new Vector3(Mathf.Cos(num) * 0.4f, Mathf.Sin(num) * 0.55f, 0f); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(Mathf.Cos(num), Mathf.Sin(num), 0f); return val2 + (val3 * Mathf.Cos(num3) + Vector3.forward * Mathf.Sin(num3)) * 0.12f; } } } private static Mesh Faceted(string name, List tris) { //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_0017: Expected O, but got Unknown Mesh val = new Mesh { name = "BossVfx" + name }; int[] array = new int[tris.Count]; for (int i = 0; i < array.Length; i++) { array[i] = i; } val.SetVertices(tris); val.SetTriangles(array, 0); val.RecalculateNormals(); val.RecalculateBounds(); return val; } public static Mesh Rock(int variant) { //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: 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) //IL_0243: 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_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) string text = "Rock" + variant; if (Meshes.TryGetValue(text, out var value)) { return value; } Random rng = new Random(17 + variant * 31); int num = 5 + variant % 3; List list = new List(); float[] array = new float[3] { 0f, 0.35f, 0.68f }; float[] array2 = new float[3] { 0.5f, 0.36f, 0.2f }; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(R(-0.12f, 0.12f), R(-0.12f, 0.12f)); for (int i = 0; i < array.Length; i++) { Vector3[] array3 = (Vector3[])(object)new Vector3[num]; for (int j = 0; j < num; j++) { float num2 = ((float)j + R(-0.2f, 0.2f)) * MathF.PI * 2f / (float)num; float num3 = array2[i] * R(0.75f, 1.15f); array3[j] = new Vector3(Mathf.Cos(num2) * num3 + val.x * array[i], array[i] + R(-0.04f, 0.04f), Mathf.Sin(num2) * num3 + val.y * array[i]); } list.Add(array3); } Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x * 1.1f, 1f, val.y * 1.1f); List list2 = new List(); for (int k = 0; k + 1 < list.Count; k++) { for (int l = 0; l < num; l++) { int num4 = (l + 1) % num; list2.AddRange((IEnumerable)(object)new Vector3[6] { list[k][l], list[k + 1][l], list[k][num4], list[k][num4], list[k + 1][l], list[k + 1][num4] }); } } Vector3[] array4 = list[list.Count - 1]; for (int m = 0; m < num; m++) { list2.AddRange((IEnumerable)(object)new Vector3[3] { array4[m], val2, array4[(m + 1) % num] }); } return Meshes[text] = Faceted(text, list2); float R(float a, float b) { return a + (float)rng.NextDouble() * (b - a); } } public static Mesh Ring(float inner) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown string text = "Ring" + Mathf.RoundToInt(inner * 100f); if (Meshes.TryGetValue(text, out var value)) { return value; } List list = new List(); List list2 = new List(); List list3 = new List(); Vector3 val = default(Vector3); for (int i = 0; i <= 48; i++) { float num = (float)i * MathF.PI * 2f / 48f; ((Vector3)(ref val))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); list.Add(val * inner); list2.Add(new Color(1f, 1f, 1f, 0f)); list.Add(val); list2.Add(Color.white); if (i < 48) { int num2 = i * 2; list3.AddRange(new int[6] { num2, num2 + 1, num2 + 2, num2 + 2, num2 + 1, num2 + 3 }); } } value = new Mesh { name = "BossVfx" + text }; value.SetVertices(list); value.SetColors(list2); value.SetTriangles(list3, 0); value.RecalculateBounds(); return Meshes[text] = value; } public static Material Solid(Color c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) string key = "Solid" + ColorUtility.ToHtmlStringRGB(c); if (!Mats.TryGetValue(key, out var value) || !Object.op_Implicit((Object)(object)value)) { value = (Mats[key] = Models.Make(c)); } return value; } public static Material Glow(Color c, float glow = 4f) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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) string text = "Glow" + ColorUtility.ToHtmlStringRGB(c) + glow; if (Mats.TryGetValue(text, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } value = Object.Instantiate(WeaponFx.Emissive("BossVfxBase", Color.white, 1f)); ((Object)value).name = "Fortress" + text; if (value.HasProperty("_BaseColorAddSubDiff")) { value.SetVector("_BaseColorAddSubDiff", Vector4.zero); } float num = Mathf.Lerp(0.6f, 1.3f, Mathf.InverseLerp(1f, 8f, glow)); if (value.HasProperty("_BaseColor")) { value.SetColor("_BaseColor", c * 0.1f); } if (value.HasProperty("_EmissionColor")) { value.SetColor("_EmissionColor", c * num); } return Mats[text] = value; } public static Material Wash(Color c) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown return new Material(Shader.Find("Sprites/Default")) { color = c, renderQueue = 3015 }; } public static ParticleSystem Sparks(Color c) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return WeaponFx.System("BossSparks" + ColorUtility.ToHtmlStringRGB(c), () => new WeaponFx.Spec { Mat = Glow(c, 3f), Mesh = WeaponFx.Cube, Life = new Vector2(0.25f, 0.55f), Speed = new Vector2(3f, 8f), Size = new Vector2(0.06f, 0.12f), Gravity = 1.2f, Drag = 1.5f, SizeOverLife = WeaponFx.Curve(0f, 1f, 0.6f, 0.8f, 1f, 0f), Shape = (ParticleSystemShapeType)4, Angle = 50f, Radius = 0.02f, Max = 800 }); } public static void Burst(Vector3 at, Color c, int n, float size = 0.12f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) WeaponFx.Emit(Sparks(c), at, n, Random.onUnitSphere, null, size); } private static void Run(IEnumerator e) { if (Object.op_Implicit((Object)(object)BossFx.Instance)) { ((MonoBehaviour)BossFx.Instance).StartCoroutine(e); } } public static void Shock(Vector3 at, float radius, Color c, float seconds = 0.5f, float inner = 0.75f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Run(ShockRun(at, radius, c, seconds, inner)); } private static IEnumerator ShockRun(Vector3 at, float radius, Color c, float seconds, float inner) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform t = WeaponFx.Piece(Ring(inner), Wash(c)); Material mat = ((Renderer)((Component)t).GetComponent()).sharedMaterial; t.position = new Vector3(at.x, BossFx.Ground(at) + 0.12f, at.z); for (float s = 0f; s < seconds; s += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)t)) { break; } float num = s / seconds; float num2 = 1f - (1f - num) * (1f - num); t.localScale = new Vector3(radius * Mathf.Max(0.05f, num2), 1f, radius * Mathf.Max(0.05f, num2)); mat.color = new Color(c.r, c.g, c.b, 0.9f * (1f - num * num)); yield return null; } Object.Destroy((Object)(object)mat); if (Object.op_Implicit((Object)(object)t)) { Object.Destroy((Object)(object)((Component)t).gameObject); } } public static void Flash(Vector3 at, float size, Color c, float seconds = 0.25f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Run(FlashRun(at, size, c, seconds)); } private static IEnumerator FlashRun(Vector3 at, float size, Color c, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform core = WeaponFx.Piece(WeaponFx.Ball, Glow(Color.Lerp(c, Color.white, 0.3f), 7f)); Transform halo = WeaponFx.Piece(WeaponFx.Ball, Wash(new Color(c.r, c.g, c.b, 0.45f))); Material hm = ((Renderer)((Component)halo).GetComponent()).sharedMaterial; Vector3 position = (halo.position = at); core.position = position; Light l = new GameObject("BossVfxLight").AddComponent(); l.type = (LightType)2; l.color = c; l.range = size * 4f; l.shadows = (LightShadows)0; ((Component)l).transform.position = at; for (float s = 0f; s < seconds; s += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)core)) { break; } float num = s / seconds; float num2 = 1f - (1f - num) * (1f - num); core.localScale = Vector3.one * size * 0.35f * (1f - num); halo.localScale = Vector3.one * size * (0.45f + 0.55f * num2); hm.color = new Color(c.r, c.g, c.b, 0.45f * (1f - num)); l.intensity = 3f * (1f - num); yield return null; } if (Object.op_Implicit((Object)(object)core)) { Object.Destroy((Object)(object)((Component)core).gameObject); } if (Object.op_Implicit((Object)(object)halo)) { Object.Destroy((Object)(object)((Component)halo).gameObject); } Object.Destroy((Object)(object)hm); if (Object.op_Implicit((Object)(object)l)) { Object.Destroy((Object)(object)((Component)l).gameObject); } } public static void Debris(Vector3 at, int n, Color c, float speed = 6f, float size = 0.25f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) ParticleSystem ps = WeaponFx.System("BossDebris" + ColorUtility.ToHtmlStringRGB(c), () => new WeaponFx.Spec { Mat = Solid(c), Mesh = WeaponFx.Cube, Life = new Vector2(0.9f, 1.6f), Speed = new Vector2(3f, 8f), Size = new Vector2(0.12f, 0.3f), Gravity = 2.2f, Drag = 0.2f, SizeOverLife = WeaponFx.Curve(0f, 1f, 0.75f, 1f, 1f, 0f), Shape = (ParticleSystemShapeType)4, Angle = 40f, Radius = 0.3f, Max = 600 }); for (int num = 0; num < n; num++) { Vector3 val = Vector3.up * 1.4f + Random.insideUnitSphere.Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 at2 = at + Vector3.up * 0.2f; float size2 = size * Random.Range(0.6f, 1.4f); Vector3? velocity = normalized * speed * Random.Range(0.6f, 1.2f); WeaponFx.Emit(ps, at2, 1, normalized, null, size2, velocity); } } public static void Dust(Vector3 at, float radius, int n) { //IL_0004: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < n; i++) { Vector3 val = at + Random.insideUnitSphere.Flat() * radius; val.y = BossFx.Ground(val) + 0.2f; WeaponFx.Emit(WeaponFx.Dust, val, 2, Vector3.up); } } public static void Scar(Vector3 at, float radius, Color c, float seconds = 6f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Run(ScarRun(at, radius, c, seconds)); } private static IEnumerator ScarRun(Vector3 at, float radius, Color c, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject go = BossFx.Decal("circle", at, at + Vector3.forward, radius, 0, c); MeshRenderer component = go.GetComponent(); Material mat = ((Renderer)component).sharedMaterial; Mesh sharedMesh = go.GetComponent().sharedMesh; List list = new List(); sharedMesh.GetColors(list); for (int i = 0; i < list.Count; i++) { list[i] = ((list[i].a > 0.6f) ? new Color(c.r * 0.6f, c.g * 0.6f, c.b * 0.6f, 0.5f) : new Color(0.08f, 0.06f, 0.05f, 0.55f)); } sharedMesh.SetColors(list); for (float s = 0f; s < seconds; s += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } mat.color = new Color(1f, 1f, 1f, Mathf.Clamp01((seconds - s) / 1.5f)); yield return null; } Object.Destroy((Object)(object)mat); if (Object.op_Implicit((Object)(object)go)) { Object.Destroy((Object)(object)go); } } public static void Spires(IList points, float height, Color rock, Color tip, float hold = 1.6f, float every = 0.03f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) Run(SpiresRun(points, height, rock, tip, hold, every)); } private static IEnumerator SpiresRun(IList points, float height, Color rock, Color tip, float hold, float every) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) List<(Transform t, Vector3 size)> made = new List<(Transform, Vector3)>(); Material rockMat = Solid(rock); Vector3 val3 = default(Vector3); for (int i = 0; i < points.Count; i++) { Vector3 val = points[i]; val.y = BossFx.Ground(val) - 0.3f; Transform val2 = WeaponFx.Piece(Rock(i % 6), rockMat); val2.position = val; val2.rotation = Quaternion.Euler(Random.Range(-14f, 14f), Random.value * 360f, Random.Range(-14f, 14f)); ((Vector3)(ref val3))..ctor(Random.Range(0.8f, 1.2f), height * Random.Range(0.75f, 1.2f), Random.Range(0.8f, 1.2f)); made.Add((val2, val3)); if (tip.a > 0f) { Transform obj = WeaponFx.Piece(Shard, Glow(tip, 3f), val2); obj.localPosition = new Vector3(0f, 0.82f, 0f); obj.localScale = new Vector3(0.45f, 0.35f, 0.45f); } ((MonoBehaviour)BossFx.Instance).StartCoroutine(Grow(val2, val3, 0.12f)); Debris(val, 4, rock, 5f, 0.22f); WeaponFx.Emit(WeaponFx.Dust, val + Vector3.up * 0.3f, 4, Vector3.up); if (i % 3 == 0) { Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, val, 0.5f, (AudioDistance)2); } if (every > 0f) { yield return (object)new WaitForSeconds(every); } } yield return (object)new WaitForSeconds(hold); for (float t = 0f; t < 0.5f; t += Time.deltaTime) { foreach (var (val4, val5) in made) { if (Object.op_Implicit((Object)(object)val4)) { val4.localScale = new Vector3(val5.x, val5.y * (1f - t / 0.5f), val5.z); } } yield return null; } foreach (var item2 in made) { Transform item = item2.t; if (Object.op_Implicit((Object)(object)item)) { Dust(item.position, 0.3f, 1); Object.Destroy((Object)(object)((Component)item).gameObject); } } } private static IEnumerator Grow(Transform t, Vector3 to, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) for (float s = 0f; s < seconds; s += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)t)) { break; } float num = s / seconds; t.localScale = new Vector3(to.x, to.y * (1f - (1f - num) * (1f - num)), to.z); yield return null; } if (Object.op_Implicit((Object)(object)t)) { t.localScale = to; } } public static void Impact(Vector3 at, float radius, Color c, Color rock, bool scar = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(at.x, BossFx.Ground(at), at.z); Flash(val + Vector3.up * 0.6f, radius * 0.9f, c, 0.3f); Shock(val, radius * 1.6f, c, 0.45f); Debris(val, Mathf.RoundToInt(6f + radius * 4f), rock, 4f + radius * 1.5f, 0.2f + radius * 0.05f); Dust(val, radius * 0.8f, Mathf.RoundToInt(4f + radius * 3f)); if (scar) { Scar(val, radius * 0.9f, c, 5f); } } } public class BubbleShell : MonoBehaviour { private static readonly List All = new List(); private static Material _mat; private const int Around = 64; private const int Rows = 32; private const int LineSteps = 128; public const float Tall = 0.8f; private const float LineIn = 0.965f; private float _r; private Mesh _film; private Mesh _line; private Vector3[] _fv; private Vector3[] _fn; private Vector3[] _lv; private Color32[] _fc; private Color32[] _lc; private float[] _la; private Renderer _shown; private float _nextLine; private readonly List _others = new List(); public static void Make(Transform holder, float radius) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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) Vector3 val = (Object.op_Implicit((Object)(object)holder.parent) ? holder.parent.lossyScale : Vector3.one); holder.localScale = new Vector3(1f / val.x, 1f / val.y, 1f / val.z); if (!Object.op_Implicit((Object)(object)_mat)) { _mat = BossVfx.Wash(Color.white); } ((Component)holder).gameObject.AddComponent().Build(radius); } private void Build(float r) { //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Expected O, but got Unknown _r = r; List list = new List(); List list2 = new List(); List list3 = new List(); Vector3 val = default(Vector3); for (int i = 0; i <= 32; i++) { float num = MathF.PI * ((float)i / 32f - 0.5f); for (int j = 0; j <= 64; j++) { float num2 = MathF.PI * 2f * (float)j / 64f; ((Vector3)(ref val))..ctor(r * Mathf.Cos(num) * Mathf.Cos(num2), r * 0.8f * Mathf.Sin(num), r * Mathf.Cos(num) * Mathf.Sin(num2)); list.Add(val); Vector3 val2 = new Vector3(val.x, val.y / 0.64000005f, val.z); list2.Add(((Vector3)(ref val2)).normalized); if (j < 64 && i < 32) { int num3 = i * 65 + j; list3.AddRange(new int[6] { num3, num3 + 64 + 1, num3 + 1, num3 + 1, num3 + 64 + 1, num3 + 64 + 2 }); } } } _fv = list.ToArray(); _fn = list2.ToArray(); _fc = (Color32[])(object)new Color32[_fv.Length]; _film = new Mesh { name = "FortressBubbleFilm" }; _film.SetVertices(list); _film.colors32 = _fc; _film.SetTriangles(list3, 0); _film.RecalculateBounds(); list.Clear(); list3.Clear(); List list4 = new List(); Vector3 val3 = default(Vector3); for (int k = 0; k <= 128; k++) { float num4 = MathF.PI * 2f * (float)k / 128f; ((Vector3)(ref val3))..ctor(Mathf.Cos(num4), 0f, Mathf.Sin(num4)); list.Add(val3 * r * 0.965f + Vector3.up * 0.12f); list4.Add(0f); list.Add(val3 * r + Vector3.up * 0.12f); list4.Add(0.55f); if (k < 128) { int num5 = k * 2; list3.AddRange(new int[6] { num5, num5 + 1, num5 + 2, num5 + 2, num5 + 1, num5 + 3 }); } } _lv = list.ToArray(); _la = list4.ToArray(); _lc = (Color32[])(object)new Color32[_lv.Length]; _line = new Mesh { name = "FortressBubbleLine" }; _line.SetVertices(list); _line.colors32 = _lc; _line.SetTriangles(list3, 0); _line.RecalculateBounds(); _shown = ((Component)WeaponFx.Piece(_film, _mat, ((Component)this).transform)).GetComponent(); WeaponFx.Piece(_line, _mat, ((Component)this).transform); } private void OnEnable() { All.Add(this); } private void OnDisable() { All.Remove(this); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_film)) { Object.Destroy((Object)(object)_film); } if (Object.op_Implicit((Object)(object)_line)) { Object.Destroy((Object)(object)_line); } } private void LateUpdate() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_011e: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0231: 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_0259: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_0284: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0307: 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_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0386: 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_039d: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) Camera val = (Object.op_Implicit((Object)(object)GameInfo.CurCamera) ? GameInfo.CurCamera : Camera.main); if (!Object.op_Implicit((Object)(object)val) || _fv == null) { return; } float num = _r + 40f; Vector3 val2 = ((Component)val).transform.position - ((Component)this).transform.position; int num2 = ((((Vector3)(ref val2)).sqrMagnitude > num * num) ? 8 : (ClientSettings.Reduced ? 4 : 2)); if ((Time.frameCount + (((Object)this).GetInstanceID() & 0xFFFF)) % num2 != 0) { return; } _others.Clear(); foreach (BubbleShell item in All) { if (!((Object)(object)item == (Object)(object)this) && item._fv != null) { Vector3 val3 = ((Component)this).transform.InverseTransformPoint(((Component)item).transform.position); Vector2 val4 = new Vector2(val3.x, val3.z); if (((Vector2)(ref val4)).sqrMagnitude < (_r + item._r) * (_r + item._r)) { _others.Add(new Vector4(val3.x, val3.y, val3.z, item._r)); } } } if (Time.time >= _nextLine) { _nextLine = Time.time + 0.5f; for (int i = 0; i < _lv.Length; i++) { _lc[i] = new Color32((byte)150, (byte)230, byte.MaxValue, (byte)(255f * _la[i] * Keep(_lv[i]))); } _line.colors32 = _lc; } if (!_shown.isVisible) { return; } Vector3 val5 = ((Component)this).transform.InverseTransformPoint(((Component)val).transform.position); bool flag = val5.x * val5.x / (_r * _r) + val5.y * val5.y / (_r * _r * 0.8f * 0.8f) + val5.z * val5.z / (_r * _r) < 1f; Vector3 val6 = (Object.op_Implicit((Object)(object)RenderSettings.sun) ? (-((Component)this).transform.InverseTransformDirection(((Component)RenderSettings.sun).transform.forward)) : Vector3.up); float num3 = Time.time * 0.9f; for (int j = 0; j < _fv.Length; j++) { Vector3 val7 = _fv[j]; float num4 = Keep(val7); if (num4 <= 0f) { _fc[j] = default(Color32); continue; } val2 = val5 - val7; Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val8 = _fn[j]; float num5 = Vector3.Dot(val8, normalized); float num6 = 1f - Mathf.Abs(num5); Color val9 = Color.HSVToRGB(Mathf.Repeat(0.48f + 0.6f * num6 + 0.06f * Mathf.Sin(val7.y * 0.6f + num3), 1f), 0.42f * num6, 1f); float num7 = Mathf.Pow(Mathf.Max(0f, Vector3.Dot(Vector3.Reflect(-normalized, (num5 >= 0f) ? val8 : (-val8)), val6)), 24f); float num8 = 0.5f + 0.5f * Mathf.Sin(val7.y * 1.3f + (val7.x - val7.z) * 0.5f + num3 * 2f); if (flag) { val9 = Color.Lerp(val9, Color.HSVToRGB(Mathf.Repeat(0.5f + 0.3f * num8, 1f), 0.35f, 1f), 0.6f); } float num9 = ((flag ? (0.05f + 0.05f * num8) : 0.02f) + 0.5f * num6 * num6 * num6 + 0.5f * num7) * num4; val9 = Color.Lerp(val9, Color.white, num7); _fc[j] = new Color32((byte)(val9.r * 255f), (byte)(val9.g * 255f), (byte)(val9.b * 255f), (byte)(Mathf.Clamp01(num9) * 255f)); } _film.colors32 = _fc; } private float Keep(Vector3 p) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) float num = 1f; foreach (Vector4 other in _others) { float num2 = (p.x - other.x) / other.w; float num3 = (p.y - other.y) / (other.w * 0.8f); float num4 = (p.z - other.z) / other.w; float num5 = num2 * num2 + num3 * num3 + num4 * num4; if (num5 < 1f) { num = Mathf.Min(num, Mathf.SmoothStep(0f, 1f, (Mathf.Sqrt(num5) - 0.97f) / 0.03f)); } } return num; } } public struct PiecePlaceRequest : IBroadcast { public PieceType Type; public Vector3 Pos; public float RotY; } public struct PieceRemoveRequest : IBroadcast { public int Id; } public struct PieceUpgradeRequest : IBroadcast { public int Id; public int Branch; public bool Repair; public int FromLevel; } public struct PieceMoveRequest : IBroadcast { public int Id; public Vector3 Pos; public float RotY; } public struct PieceState : IBroadcast { public int Id; public PieceType Type; public Vector3 Pos; public float RotY; public bool Removed; public int Hp; public int MaxHp; public int Level; public int Branch; } public class BuildSystem : MonoBehaviour { public const float Cell = 3f; private const float Reach = 12f; public const float PlaceReach = 7.5f; public const float InteractReach = 4.5f; public static ManualLogSource Log; public static ConfigEntry BuildKey; public static BuildSystem Instance; private readonly Dictionary _serverPieces = new Dictionary(); private readonly Dictionary _spent = new Dictionary(); private int _nextId = 1; private readonly Dictionary _pieces = new Dictionary(); private readonly Dictionary _states = new Dictionary(); private readonly Dictionary _pieceIds = new Dictionary(); private NetworkManager _registeredOn; private bool _building; private PieceType _type; private bool _flip; private GameObject _ghost; private PieceType _ghostType = (PieceType)255; private bool _ghostValid; private string _lookInfo = ""; private string _lookKeys = ""; private int _lookLevel; private int _lookHp; private int _lookMax; private string _lookPicture; private string _blockReason = ""; public int RoundBuilt; private int _moveId; private bool _moveFromWalkUp; private bool _waitRelease; private bool _walkUp; private float _nextWork; public const float RemoveTime = 0.6f; private int _removeId; private float _removeHold; private Vector3 _removeHome; private int _debugHold; private readonly Transform[] _cellEdges = (Transform[])(object)new Transform[4]; private Material _cellMat; private static Material _mendRimMat; private static Material _collarMat; private static Material _trimMat; private static Material _crystalA; private static Material _crystalB; private static Material _studMat; public const int Lamps = 17; public const int LampsWhite = 25; private const float LampRing = 1f; private static readonly Dictionary LampMeshes; private static readonly Dictionary LampGlows; private static Mesh _lampSockets; private RectTransform _cards; private readonly List<(Image box, Image ring, Image pic, TextMeshProUGUI name, TextMeshProUGUI cost)> _card = new List<(Image, Image, Image, TextMeshProUGUI, TextMeshProUGUI)>(); private Image _keysBox; private Image _warnBox; private Image _lookBox; private Image _lookPic; private Image _descBox; private TextMeshProUGUI _descText; private TextMeshProUGUI _keysText; private TextMeshProUGUI _warnText; private TextMeshProUGUI _lookName; private TextMeshProUGUI _lookKeysText; private TextMeshProUGUI _lookStatsText; private string _lookStats = ""; private Hud.Bar _lookBar; private const float LookPic = 96f; private readonly Dictionary _owner = new Dictionary(); private float _nextHitSound; public IEnumerable ServerPieces => _serverPieces.Values; public static bool Building { get { if (Object.op_Implicit((Object)(object)Instance)) { return Instance._building; } return false; } } public static int PieceLayer { get { //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) LayerMask levelLayer = GameInfo.LevelLayer; int value = ((LayerMask)(ref levelLayer)).value; for (int i = 0; i < 32; i++) { if ((value & (1 << i)) != 0) { return i; } } return 0; } } public bool Moving => _moveId != 0; public static bool AimingAtPiece { get { if (Object.op_Implicit((Object)(object)Instance)) { return Instance._walkUp; } return false; } } public int ClientRepairAllCost => _states.Values.Where((PieceState s) => s.Hp < s.MaxHp).Sum((PieceState s) => Perks.MyCost(Catalog.RepairCost(s.Hp, s.MaxHp))); private PieceType GhostType { get { if (_moveId == 0 || !_states.TryGetValue(_moveId, out var value)) { return _type; } return value.Type; } } public GameObject PieceObject(int id) { if (!_pieces.TryGetValue(id, out var value)) { return null; } return value; } static BuildSystem() { LampMeshes = new Dictionary(); LampGlows = new Dictionary(); GenericWriter.SetWrite((Action)delegate(Writer w, PiecePlaceRequest v) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) w.WriteByte((byte)v.Type); w.WriteVector3(v.Pos); w.WriteSingle(v.RotY); }); GenericReader.SetRead((Func)((Reader r) => new PiecePlaceRequest { Type = (PieceType)r.ReadByte(), Pos = r.ReadVector3(), RotY = r.ReadSingle() })); GenericWriter.SetWrite((Action)delegate(Writer w, PieceRemoveRequest v) { w.WriteInt32(v.Id); }); GenericReader.SetRead((Func)((Reader r) => new PieceRemoveRequest { Id = r.ReadInt32() })); GenericWriter.SetWrite((Action)delegate(Writer w, PieceUpgradeRequest v) { w.WriteInt32(v.Id); w.WriteInt32(v.Branch); w.WriteBoolean(v.Repair); w.WriteInt32(v.FromLevel); }); GenericReader.SetRead((Func)((Reader r) => new PieceUpgradeRequest { Id = r.ReadInt32(), Branch = r.ReadInt32(), Repair = r.ReadBoolean(), FromLevel = r.ReadInt32() })); GenericWriter.SetWrite((Action)delegate(Writer w, PieceMoveRequest v) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) w.WriteInt32(v.Id); w.WriteVector3(v.Pos); w.WriteSingle(v.RotY); }); GenericReader.SetRead((Func)((Reader r) => new PieceMoveRequest { Id = r.ReadInt32(), Pos = r.ReadVector3(), RotY = r.ReadSingle() })); GenericWriter.SetWrite((Action)delegate(Writer w, PieceState v) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) w.WriteInt32(v.Id); w.WriteByte((byte)v.Type); w.WriteVector3(v.Pos); w.WriteSingle(v.RotY); w.WriteBoolean(v.Removed); w.WriteInt32(v.Hp); w.WriteInt32(v.MaxHp); w.WriteInt32(v.Level); w.WriteInt32(v.Branch); }); GenericReader.SetRead((Func)((Reader r) => new PieceState { Id = r.ReadInt32(), Type = (PieceType)r.ReadByte(), Pos = r.ReadVector3(), RotY = r.ReadSingle(), Removed = r.ReadBoolean(), Hp = r.ReadInt32(), MaxHp = r.ReadInt32(), Level = r.ReadInt32(), Branch = r.ReadInt32() })); } private void Awake() { Instance = this; } private void Update() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Invalid comparison between Unknown and I4 //IL_0205: 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) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) EnsureRegistered(); Keyboard current = Keyboard.current; if (current == null || ChatManager.IsTyping || Hud.ModalOpen) { return; } if (((ButtonControl)current.jKey).wasPressedThisFrame && (((ButtonControl)current.leftShiftKey).isPressed || ((ButtonControl)current.rightShiftKey).isPressed) && Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.ViewActive && InstanceFinder.IsClientStarted) { InstanceFinder.ClientManager.Broadcast(new PieceUpgradeRequest { Id = -1, Repair = true }, (Channel)0); return; } if (((ButtonControl)current[BuildKey.Value]).wasPressedThisFrame) { SetBuilding(!_building); } if (!_building) { WalkUp(current); return; } _walkUp = false; if (!InstanceFinder.IsClientStarted || !Object.op_Implicit((Object)(object)GameInfo.CurCamera) || !Object.op_Implicit((Object)(object)Player.LocalPlayer) || (int)Cursor.lockState != 1) { if (Object.op_Implicit((Object)(object)_ghost)) { _ghost.SetActive(false); } HideCell(); return; } if (((ButtonControl)current.escapeKey).wasPressedThisFrame) { SetBuilding(on: false); return; } Mouse current2 = Mouse.current; if (_moveId != 0) { UpdateMove(current, current2); return; } if (_waitRelease && (current2 == null || !current2.leftButton.isPressed)) { _waitRelease = false; } bool flag = ((ButtonControl)current.leftShiftKey).isPressed || ((ButtonControl)current.rightShiftKey).isPressed; if (((ButtonControl)current.tKey).wasPressedThisFrame) { for (int i = 0; i < 13; i++) { _type = (PieceType)(((int)_type + ((!flag) ? 1 : 12)) % 13); if (Loot.Instance.ClientVault.CanBuild(_type)) { break; } } } if (((ButtonControl)current.yKey).wasPressedThisFrame) { _flip = !_flip; } UpdateGhost(); UpdateLookInfo(out var id, 12f); Transform transform = ((Component)GameInfo.CurCamera).transform; SiteState site; bool flag2 = Construction.Instance.SiteUnderAim(new Ray(transform.position, transform.forward), 12f, out site); if (flag2 && Object.op_Implicit((Object)(object)_ghost)) { _ghost.SetActive(false); HideCell(); } if (current2 != null && current2.leftButton.isPressed && !_waitRelease && Time.time >= _nextWork && (flag2 || _ghostValid)) { _nextWork = Time.time + 0.15f; if (flag2) { Construction.Instance.Work(site.Type, site.Pos, site.RotY); } else { Construction.Instance.Work(_type, _ghost.transform.position, _ghost.transform.eulerAngles.y); } } UpdateRemoveHold(((ButtonControl)current.hKey).isPressed ? id : _debugHold); _debugHold = 0; if (id != 0 && ((ButtonControl)current.uKey).wasPressedThisFrame) { Upgrade(id, flag); } if (id != 0 && ((ButtonControl)current.jKey).wasPressedThisFrame) { InstanceFinder.ClientManager.Broadcast(new PieceUpgradeRequest { Id = id, Repair = true }, (Channel)0); } if (id != 0 && current2 != null && current2.rightButton.wasPressedThisFrame && Time.frameCount - PieceMenu.ClosedFrame > 1) { PieceMenu.Instance.Open(id); } if (id != 0 && ((ButtonControl)current.mKey).wasPressedThisFrame) { StartMove(id); } } public void StartMove(int id) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (_states.ContainsKey(id)) { if (!_building) { _moveFromWalkUp = true; SetBuilding(on: true); } _moveId = id; Fx.Sound("PickupWhoosh", _states[id].Pos, 0.6f, (AudioDistance)1); } } private void EndMove() { if (_moveId != 0) { _moveId = 0; _waitRelease = true; if (_moveFromWalkUp) { _moveFromWalkUp = false; SetBuilding(on: false); } } } private void UpdateMove(Keyboard kb, Mouse mouse) { //IL_00a6: 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_00bd: Unknown result type (might be due to invalid IL or missing references) _lookInfo = ""; if (!_states.ContainsKey(_moveId) || !Object.op_Implicit((Object)(object)Siege.Instance) || !Siege.Instance.ViewActive) { EndMove(); return; } UpdateGhost(); if (((ButtonControl)kb.mKey).wasPressedThisFrame || (mouse != null && mouse.rightButton.wasPressedThisFrame)) { EndMove(); } else if (mouse != null && mouse.leftButton.wasPressedThisFrame && _ghostValid) { InstanceFinder.ClientManager.Broadcast(new PieceMoveRequest { Id = _moveId, Pos = _ghost.transform.position, RotY = _ghost.transform.eulerAngles.y }, (Channel)0); EndMove(); } } public bool ServerMove(int id, Vector3 pos, float rotY) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return OnMoveRequest(null, new PieceMoveRequest { Id = id, Pos = pos, RotY = rotY }, (Channel)0); } private void WalkUp(Keyboard kb) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Invalid comparison between Unknown and I4 _walkUp = false; _lookInfo = ""; bool num = Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.ViewActive && !Weapons.Drawn && InstanceFinder.IsClientStarted && Object.op_Implicit((Object)(object)GameInfo.CurCamera) && Object.op_Implicit((Object)(object)Player.LocalPlayer) && (int)Cursor.lockState == 1 && PlayerManager.AlivePlayers.Contains(Player.LocalPlayer); int id = 0; if (num) { UpdateLookInfo(out id, 4.5f); } _walkUp = id != 0; UpdateRemoveHold((id != 0 && ((ButtonControl)kb.hKey).isPressed) ? id : _debugHold); _debugHold = 0; if (id != 0) { bool shift = ((ButtonControl)kb.leftShiftKey).isPressed || ((ButtonControl)kb.rightShiftKey).isPressed; if (((ButtonControl)kb.uKey).wasPressedThisFrame) { Upgrade(id, shift); } if (((ButtonControl)kb.jKey).wasPressedThisFrame) { InstanceFinder.ClientManager.Broadcast(new PieceUpgradeRequest { Id = id, Repair = true }, (Channel)0); } if (((ButtonControl)kb.mKey).wasPressedThisFrame) { StartMove(id); } } } private void Upgrade(int id, bool shift) { if (_states.TryGetValue(id, out var value) && value.Level == 2 && Catalog.HasBranches(value.Type) && !shift) { if (Time.frameCount - PieceMenu.ClosedFrame > 1) { PieceMenu.Instance.Open(id, !_building); } } else { InstanceFinder.ClientManager.Broadcast(new PieceUpgradeRequest { Id = id, Branch = ((!shift) ? 1 : 2), FromLevel = LevelOf(id) }, (Channel)0); } } public void DebugPressU(int id) { Upgrade(id, shift: false); } private void ServerRepairAll(Player who) { int num = 0; int num2 = 0; foreach (PieceState item in (from x in _serverPieces.Values where x.Hp < x.MaxHp orderby (float)x.Hp / (float)Mathf.Max(1, x.MaxHp) select x).ToList()) { if (!Siege.Instance.ServerTrySpend(Perks.Cost(Catalog.RepairCost(item.Hp, item.MaxHp), who))) { num2++; continue; } PieceState pieceState = item; pieceState.Hp = pieceState.MaxHp; _serverPieces[pieceState.Id] = pieceState; InstanceFinder.ServerManager.Broadcast(pieceState, true, (Channel)0); num++; } AutoTest.Count("repairs", num); if (num2 > 0) { Fx.Announce("repairAllPartial", num2); } else if (num > 0) { Fx.Announce("repairAllDone", num); } } private void UpdateRemoveHold(int id) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (_removeId != 0 && (id != _removeId || !_pieces.ContainsKey(_removeId))) { if (_pieces.TryGetValue(_removeId, out var value) && Object.op_Implicit((Object)(object)value)) { value.transform.position = _removeHome; } _removeId = 0; } if (id != 0 && _pieces.TryGetValue(id, out var value2) && Object.op_Implicit((Object)(object)value2)) { if (_removeId == 0) { _removeId = id; _removeHold = 0f; _removeHome = value2.transform.position; } _removeHold += Time.deltaTime; float num = Mathf.Clamp01(_removeHold / 0.6f); value2.transform.position = _removeHome + Vector3.down * 0.35f * num + Random.insideUnitSphere * 0.05f * num; Hud.Ring(num, L10n.T("removing", RefundEstimate(_states[id])), Hud.Bad); if (num >= 1f) { InstanceFinder.ClientManager.Broadcast(new PieceRemoveRequest { Id = id }, (Channel)0); _removeId = 0; } } } public static int RefundEstimate(PieceState s) { int num = Perks.MyCost(Catalog.BuildCost(s.Type)); for (int i = 1; i < s.Level; i++) { num += Perks.MyCost(Catalog.UpgradeCost(s.Type, i)); } return num / 2; } public bool TryGetState(int id, out PieceState s) { return _states.TryGetValue(id, out s); } public void DebugRemoveHold(int id) { _debugHold = id; } public void DebugSetBuilding(bool on, PieceType type) { _type = type; SetBuilding(on); } public void StopBuilding() { SetBuilding(on: false); } private void SetBuilding(bool on) { if (!on) { _moveFromWalkUp = false; EndMove(); } _building = on; if (on && Weapons.Drawn) { Weapons.Instance.Holster(); } if (!on && Object.op_Implicit((Object)(object)_ghost)) { _ghost.SetActive(false); } if (!on) { HideCell(); } } private bool ComputePlacement(out Vector3 pos, out Quaternion rot) { return ComputePlacement(0, out pos, out rot); } private bool ComputePlacement(int extend, out Vector3 pos, out Quaternion rot) { //IL_0012: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_00f8: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0150: 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_0167: 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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0249: 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_01fc: 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_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0438: 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_0448: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0462: 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_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0389: 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_049a: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: 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_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: 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_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_0353: 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_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) PieceType ghostType = GhostType; Transform transform = ((Component)GameInfo.CurCamera).transform; LayerMask levelLayer = GameInfo.LevelLayer; int num = ((LayerMask)(ref levelLayer)).value | (1 << PieceLayer); RaycastHit val = default(RaycastHit); bool flag = Physics.Raycast(transform.position, transform.forward, ref val, 7.5f, num, (QueryTriggerInteraction)1); float? num2 = null; Vector3 val2; if (flag) { val2 = ((RaycastHit)(ref val)).point - transform.forward * 0.05f; GameObject key = (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider.attachedRigidbody) ? ((Component)((RaycastHit)(ref val)).collider.attachedRigidbody).gameObject : ((Component)((RaycastHit)(ref val)).collider).gameObject); if (_pieceIds.TryGetValue(key, out var value) && _states.TryGetValue(value, out var value2)) { num2 = BaseOf(value2); } } else { Vector3 val3 = transform.position + transform.forward * 7.5f; RaycastHit val4 = default(RaycastHit); flag = Physics.Raycast(val3 + Vector3.up * 3f, Vector3.down, ref val4, 30f, num, (QueryTriggerInteraction)1); val2 = (flag ? ((RaycastHit)(ref val4)).point : val3); } Vector3 forward = transform.forward; forward.y = 0f; bool flag2 = Mathf.Abs(forward.x) >= Mathf.Abs(forward.z); float num3 = ((!flag2) ? ((forward.z >= 0f) ? 0f : 180f) : ((forward.x >= 0f) ? 90f : 270f)); if (_flip) { num3 += 180f; } int num4 = Mathf.FloorToInt(val2.x / 3f); int num5 = Mathf.FloorToInt(val2.z / 3f); if (extend != 0) { if (flag2) { num4 += ((forward.x >= 0f) ? extend : (-extend)); } else { num5 += ((forward.z >= 0f) ? extend : (-extend)); } } Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(((float)num4 + 0.5f) * 3f, val2.y, ((float)num5 + 0.5f) * 3f); Vector3 at; float num6 = (num2.HasValue ? (num2.Value + 3f * Mathf.Floor((val2.y - num2.Value + 0.25f) / 3f)) : (Loot.Ground(val5 + Vector3.up * 2.5f, 8f, out at) ? at.y : val2.y)); Vector3 val6 = default(Vector3); ((Vector3)(ref val6))..ctor(val5.x, num6, val5.z); switch (ghostType) { case PieceType.Wall: { Vector3 position = Player.LocalPlayer.Transform.position; int num7 = Mathf.FloorToInt(position.x / 3f); int num8 = Mathf.FloorToInt(position.z / 3f); if (flag2) { int num9 = (((num4 != num7) ? (num4 <= num7) : (forward.x >= 0f)) ? 1 : 0); pos = new Vector3((float)(num4 + num9) * 3f, num6 + 1.5f, val6.z); rot = Quaternion.Euler(0f, 90f, 0f); } else { int num10 = (((num5 != num8) ? (num5 <= num8) : (forward.z >= 0f)) ? 1 : 0); pos = new Vector3(val6.x, num6 + 1.5f, (float)(num5 + num10) * 3f); rot = Quaternion.identity; } break; } case PieceType.Floor: pos = val6; rot = Quaternion.identity; break; case PieceType.Ramp: pos = val6 + Vector3.up * 3f * 0.5f; rot = Quaternion.Euler(-45f, num3, 0f); break; case PieceType.Spikes: { pos = new Vector3(val6.x, num6, val6.z); RaycastHit val8 = default(RaycastHit); if (Physics.Raycast(pos + Vector3.up * 4f, Vector3.down, ref val8, 6f, num, (QueryTriggerInteraction)1)) { pos.y = ((RaycastHit)(ref val8)).point.y + 0.07f; } rot = Quaternion.identity; break; } default: { pos = new Vector3(val6.x, num6, val6.z); RaycastHit val7 = default(RaycastHit); if (Physics.Raycast(pos + Vector3.up * 4f, Vector3.down, ref val7, 6f, num, (QueryTriggerInteraction)1)) { pos.y = ((RaycastHit)(ref val7)).point.y; } rot = Quaternion.Euler(0f, num3, 0f); break; } } return flag; } private static float BaseOf(PieceState s) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (s.Type != PieceType.Wall && s.Type != PieceType.Ramp) { return s.Pos.y; } return s.Pos.y - 1.5f; } internal static bool Overlap(PieceType a, Vector3 pa, PieceType b, Vector3 pb) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (Clashes(a, b)) { Vector2 val = new Vector2(pa.x - pb.x, pa.z - pb.z); if (((Vector2)(ref val)).sqrMagnitude < 0.04f) { return Mathf.Abs(pa.y - pb.y) < 1.5f; } } return false; } internal static bool AllowedAt(Vector3 pos) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)FortressIsland.Instance)) { return FortressIsland.Instance.OnIsland(pos, 27f); } return false; } private static bool Clashes(PieceType a, PieceType b) { if (a != b) { if (Catalog.IsTurret(a)) { return Catalog.IsTurret(b); } return false; } return true; } private void UpdateGhost() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_01ef: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) PieceType type = GhostType; if (!Object.op_Implicit((Object)(object)_ghost) || _ghostType != type) { if (Object.op_Implicit((Object)(object)_ghost)) { Object.Destroy((Object)(object)_ghost); } _ghost = CreatePieceVisual(type); ((Object)_ghost).name = "FortressGhost"; _ghostType = type; Object.DontDestroyOnLoad((Object)(object)_ghost); } Vector3 pos; Quaternion rot; bool flag = ComputePlacement(out pos, out rot); if (flag && Taken(pos) && ComputePlacement(1, out var pos2, out var rot2) && !Taken(pos2)) { pos = pos2; rot = rot2; } bool flag2 = pos.y + 3f > WaterManager.GetWaterHeight(pos); bool flag3 = !Taken(pos); bool num = _moveId != 0; bool flag4 = num || Siege.Instance.ViewCoins >= Perks.MyCost(Catalog.BuildCost(type)); bool flag5 = AllowedAt(pos); bool flag6 = num || Loot.Instance.ClientVault.CanBuild(type); _blockReason = ((!flag6) ? L10n.T("needBlueprint") : ((!Siege.Instance.ViewActive) ? L10n.T("needRound") : ((!flag5) ? L10n.T("needIsland") : ((!flag4) ? L10n.T("needCoins") : "")))); _ghostValid = flag && flag2 && flag3 && flag4 && flag5 && flag6 && Siege.Instance.ViewActive; _ghost.SetActive(true); _ghost.transform.SetPositionAndRotation(pos, rot); Color c = (_ghostValid ? new Color(0.3f, 0.6f, 1f) : new Color(0.9f, 0.2f, 0.2f)); Models.Paint(_ghost, c); DrawCell(pos, c); bool Taken(Vector3 at) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return _states.Values.Any((PieceState s) => s.Id != _moveId && Overlap(s.Type, s.Pos, type, at)); } } private void DrawCell(Vector3 at, Color c) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_cellMat)) { _cellMat = Models.Make(c, c); } Models.SetMatColor(_cellMat, c); PieceType ghostType = GhostType; float num = ((ghostType == PieceType.Wall || ghostType == PieceType.Ramp) ? (at.y - 1.5f) : at.y); Vector3 forward = ((Component)GameInfo.CurCamera).transform.forward; forward.y = 0f; Vector3 val = ((ghostType == PieceType.Wall) ? (at + ((Vector3)(ref forward)).normalized * 1.5f) : at); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor((Mathf.Floor(val.x / 3f) + 0.5f) * 3f, num + 0.06f, (Mathf.Floor(val.z / 3f) + 0.5f) * 3f); for (int i = 0; i < 4; i++) { if (!Object.op_Implicit((Object)(object)_cellEdges[i])) { GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)val3.GetComponent()); Renderer component = val3.GetComponent(); component.sharedMaterial = _cellMat; component.shadowCastingMode = (ShadowCastingMode)0; Object.DontDestroyOnLoad((Object)(object)val3); _cellEdges[i] = val3.transform; } bool flag = i < 2; float num2 = ((i % 2 == 0) ? (-0.5f) : 0.5f) * 3f; ((Component)_cellEdges[i]).gameObject.SetActive(true); _cellEdges[i].position = val2 + (flag ? new Vector3(0f, 0f, num2) : new Vector3(num2, 0f, 0f)); _cellEdges[i].localScale = (flag ? new Vector3(3f, 0.04f, 0.07f) : new Vector3(0.07f, 0.04f, 3f)); } } private void HideCell() { Transform[] cellEdges = _cellEdges; foreach (Transform val in cellEdges) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.SetActive(false); } } } internal static GameObject CreatePieceVisual(PieceType t) { GameObject obj = CreatePieceObject(t, 0); Object.Destroy((Object)(object)obj.GetComponent()); return obj; } private static GameObject CreatePieceObject(PieceType t, int layer) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Catalog.Size(t); GameObject val2 = new GameObject("FortressPiece"); val2.layer = layer; BoxCollider val3 = val2.AddComponent(); val3.size = val; if (Catalog.IsTurret(t)) { val3.center = new Vector3(0f, val.y * 0.5f, 0f); Models.Attach("TurretBase", val2.transform, new Vector3(1.4f, 0.8f, 1.4f), new Vector3(0f, 0.4f, 0f)); GameObject val4 = new GameObject("Head"); val4.layer = layer; val4.transform.SetParent(val2.transform, false); val4.transform.localPosition = new Vector3(0f, 0.85f, 0f); Models.Attach(Catalog.HeadModel(t), val4.transform, new Vector3(0.6f, 0.5f, 1.4f)); } else { Models.Attach(t.ToString(), val2.transform, val); } return val2; } private static void Drop(Transform t) { if (Object.op_Implicit((Object)(object)t)) { ((Object)t).name = "_gone"; ((Component)t).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)t).gameObject); } } private static void SetBubbleRing(GameObject go, PieceType type, int level, int branch) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Drop(go.transform.Find("BubbleRing")); Transform transform = new GameObject("BubbleRing").transform; transform.SetParent(go.transform, false); float range = Catalog.Turret(type, level, branch).Range; if (type == PieceType.Bubble) { BubbleShell.Make(transform, range); return; } if (!Object.op_Implicit((Object)(object)_mendRimMat)) { _mendRimMat = BossVfx.Wash(new Color(0.45f, 1f, 0.55f, 0.5f)); } Vector3 lossyScale = go.transform.lossyScale; Transform obj = WeaponFx.Piece(BossVfx.Ring(0.93f), _mendRimMat, transform); obj.localPosition = new Vector3(0f, 0.12f / lossyScale.y, 0f); obj.localScale = new Vector3(range / lossyScale.x, 1f, range / lossyScale.z); } private static void SetTurretLook(GameObject go, PieceType type, int level, int branch) { //IL_00c0: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0264: 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_0288: Unknown result type (might be due to invalid IL or missing references) //IL_030d: 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_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) Drop(go.transform.Find("LevelLook")); Transform val = go.transform.Find("Head"); if (Object.op_Implicit((Object)(object)val)) { foreach (Transform item in ((IEnumerable)val).Cast().ToList()) { if (((Object)item).name.StartsWith("Barrel")) { Drop(item); } } val.localScale = Vector3.one * (1f + 0.07f * (float)Mathf.Min(level - 1, 2) + 0.015f * (float)Mathf.Min(Catalog.Beyond(level), 12)); } Transform transform = new GameObject("LevelLook").transform; transform.SetParent(go.transform, false); if (!Object.op_Implicit((Object)(object)_collarMat)) { _collarMat = Models.Make(new Color(0.24f, 0.26f, 0.3f)); _trimMat = Models.Make(new Color(1f, 0.78f, 0.3f), new Color(0.9f, 0.6f, 0.15f)); } if (!Object.op_Implicit((Object)(object)_crystalA)) { _crystalA = Models.Make(new Color(1f, 0.6f, 0.2f), new Color(1f, 0.5f, 0.1f)); _crystalB = Models.Make(new Color(0.35f, 0.85f, 1f), new Color(0.25f, 0.8f, 1f)); } if (level >= 2) { Part((PrimitiveType)2, transform, new Vector3(0f, 0.5f, 0f), new Vector3(1.5f, 0.07f, 1.5f), _collarMat); } if (level >= 3) { Part((PrimitiveType)2, transform, new Vector3(0f, 0.58f, 0f), new Vector3(1.38f, 0.03f, 1.38f), _trimMat); } if (level >= 3 && Object.op_Implicit((Object)(object)val) && branch > 0) { ((Object)Part((PrimitiveType)3, val, new Vector3(0f, 0.42f, -0.32f), Vector3.one * 0.16f, (branch == 2) ? _crystalB : _crystalA, Quaternion.Euler(45f, 0f, 45f))).name = "BarrelCrystal"; } int num = Catalog.Milestones(level); for (int i = 1; i <= num; i++) { if (!Object.op_Implicit((Object)(object)val)) { break; } Transform transform2 = new GameObject("Barrel" + i).transform; transform2.SetParent(val, false); float num2 = ((i % 2 == 1) ? 1f : (-1f)) * (0.42f + 0.28f * (float)((i - 1) / 2)); transform2.localPosition = new Vector3(num2, -0.05f, -0.05f); transform2.localScale = Vector3.one * 0.72f; Models.Attach(Catalog.HeadModel(type), transform2, new Vector3(0.6f, 0.5f, 1.4f)); } SetLamps(transform, level); static GameObject Part(PrimitiveType p, Transform parent, Vector3 at, Vector3 size, Material m, Quaternion? rot = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0055: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive(p); Object.Destroy((Object)(object)obj.GetComponent()); obj.transform.SetParent(parent, false); obj.transform.localPosition = at; obj.transform.localRotation = (Quaternion)(((??)rot) ?? Quaternion.identity); obj.transform.localScale = size; obj.GetComponent().sharedMaterial = m; return obj; } } public static int LampsLit(int level) { return Mathf.Min(17, Catalog.Beyond(level)); } private static void SetLamps(Transform look, int level) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) int num = LampsLit(level); List list = Enumerable.Range(0, 17).Select(LampAt).ToList(); if (!Object.op_Implicit((Object)(object)_lampSockets)) { _lampSockets = Combine("FortressLampSockets", WeaponFx.Cyl, list, new Vector3(0.17f, 0.07f, 0.17f)); } if (!LampMeshes.TryGetValue(num, out (Mesh, Mesh) value)) { List source = list.Select((Vector3 p) => p + Vector3.up * 0.13f).ToList(); value = (LampMeshes[num] = (Combine("FortressLampsDim" + num, WeaponFx.Ball, source.Skip(num), Vector3.one * 0.15f), Combine("FortressLampsLit" + num, WeaponFx.Ball, source.Take(num), Vector3.one * 0.15f))); } ((Object)WeaponFx.Piece(_lampSockets, _collarMat, look)).name = "LampSockets"; if (num < 17) { ((Object)WeaponFx.Piece(value.Item1, BossVfx.Solid(new Color(0.09f, 0.1f, 0.12f)), look)).name = "LampsDim"; } if (num != 0) { int num2 = Mathf.Clamp(level, 20, 25); if (!LampGlows.TryGetValue(num2, out var value2) || !Object.op_Implicit((Object)(object)value2)) { float num3 = Mathf.InverseLerp(20f, 25f, (float)num2); value2 = (LampGlows[num2] = BossVfx.Glow(Color.Lerp(new Color(1f, 0.72f, 0.2f), new Color(1f, 0.97f, 0.9f), num3), Mathf.Round(5f + 3f * num3))); } ((Object)WeaponFx.Piece(value.Item2, value2, look)).name = "LampsLit"; } } private static Vector3 LampAt(int i) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) int num = (i + 1) / 2; float num2 = MathF.PI + ((i % 2 == 1) ? (-1f) : 1f) * (float)num * 2f * MathF.PI / 17f; return new Vector3(Mathf.Sin(num2) * 1f, 0f, Mathf.Cos(num2) * 1f); } private static Mesh Combine(string name, Mesh part, IEnumerable at, Vector3 size) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown Mesh val = new Mesh { name = name }; val.CombineMeshes(at.Select(delegate(Vector3 p) { //IL_0002: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_002d: Unknown result type (might be due to invalid IL or missing references) CombineInstance result = default(CombineInstance); ((CombineInstance)(ref result)).mesh = part; ((CombineInstance)(ref result)).transform = Matrix4x4.TRS(p, Quaternion.identity, size); return result; }).ToArray(), true, true); return val; } private static void SetRankStuds(GameObject go, PieceType type, int level) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_010f: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) Drop(go.transform.Find("RankStuds")); int num = Mathf.Min(12, Catalog.Beyond(level)); if (num != 0 && !Catalog.IsTurret(type)) { Transform transform = new GameObject("RankStuds").transform; transform.SetParent(go.transform, false); if (!Object.op_Implicit((Object)(object)_studMat)) { _studMat = Models.Make(new Color(1f, 0.82f, 0.32f), new Color(1f, 0.7f, 0.2f)); } Vector3 val = Catalog.Size(type); for (int i = 0; i < num; i++) { GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)obj.GetComponent()); obj.transform.SetParent(transform, false); float num2 = (float)i * MathF.PI * 2f / 12f; obj.transform.localPosition = ((type == PieceType.Wall) ? new Vector3(((float)i - (float)(num - 1) / 2f) * 0.24f, val.y * 0.5f + 0.07f, 0f) : new Vector3(Mathf.Cos(num2) * val.x * 0.42f, val.y * 0.5f + 0.05f, Mathf.Sin(num2) * val.z * 0.42f)); obj.transform.localScale = Vector3.one * 0.13f; obj.transform.localRotation = Quaternion.Euler(45f, num2 * 57.29578f, 45f); obj.GetComponent().sharedMaterial = _studMat; } } } private static void SetWallModel(GameObject go, int level) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) string text = ((level >= 3) ? "WallMetal" : ((level == 2) ? "WallStone" : "Wall")); if (Object.op_Implicit((Object)(object)go.transform.Find(text + "Model"))) { return; } foreach (Transform item in go.transform) { Object.Destroy((Object)(object)((Component)item).gameObject); } Models.Attach(text, go.transform, Catalog.Size(PieceType.Wall)); } private void UpdateLookInfo(out int id, float reach) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) id = 0; _lookInfo = ""; Transform transform = ((Component)GameInfo.CurCamera).transform; RaycastHit val = default(RaycastHit); if (!Physics.Raycast(transform.position, transform.forward, ref val, reach, 1 << PieceLayer, (QueryTriggerInteraction)1)) { return; } GameObject key = (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider.attachedRigidbody) ? ((Component)((RaycastHit)(ref val)).collider.attachedRigidbody).gameObject : ((Component)((RaycastHit)(ref val)).collider).gameObject); if (!_pieceIds.TryGetValue(key, out id) || !_states.TryGetValue(id, out var value)) { id = 0; return; } if (value.Type == PieceType.Floor || value.Type == PieceType.Ramp) { Collider[] array = Physics.OverlapSphere(((RaycastHit)(ref val)).point + Vector3.up * 0.9f, 1.1f, 1 << PieceLayer, (QueryTriggerInteraction)1); foreach (Collider val2 in array) { GameObject key2 = (Object.op_Implicit((Object)(object)val2.attachedRigidbody) ? ((Component)val2.attachedRigidbody).gameObject : ((Component)val2).gameObject); if (_pieceIds.TryGetValue(key2, out var value2) && _states.TryGetValue(value2, out var value3) && value3.Type != PieceType.Floor && value3.Type != PieceType.Ramp) { id = value2; value = value3; break; } } } string text = ((value.Level != 2 || !Catalog.HasBranches(value.Type)) ? L10n.T("upgradeHint", Perks.MyCost(Catalog.UpgradeCost(value.Type, value.Level))) : L10n.T("branchHint", L10n.T(Catalog.BranchKey(value.Type, 1)), L10n.T(Catalog.BranchKey(value.Type, 2)), Perks.MyCost(Catalog.UpgradeCost(value.Type, value.Level)))); string text2 = ((value.Hp < value.MaxHp) ? (" " + L10n.T("repairHint", Perks.MyCost(Catalog.RepairCost(value.Hp, value.MaxHp)))) : ""); string text3 = ((value.Branch > 0) ? (" · " + L10n.T(Catalog.BranchKey(value.Type, value.Branch))) : ""); _lookInfo = PieceName(value.Type, value.Level) + text3; _lookStats = string.Join("\u3000", PieceMenu.Deltas(value, value.Level + 1, (value.Branch <= 0) ? 1 : value.Branch)); _lookLevel = value.Level; _lookHp = value.Hp; _lookMax = value.MaxHp; _lookPicture = PieceMenu.PictureOf(value); _lookKeys = text + "\u3000" + text2.Trim() + ((text2.Length > 0) ? "\u3000" : "") + L10n.T("moveHint") + "\u3000" + L10n.T("removeHint"); } public static string PieceName(PieceType t, int level) { if (t == PieceType.Wall) { return L10n.T((level >= 3) ? "WallMetal" : ((level == 2) ? "WallStone" : "Wall")); } return L10n.T(t.ToString()); } private bool EnsureBuildUi() { //IL_005c: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_0311: 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_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0430: 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_046a: 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_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_cards)) { return true; } if (!Object.op_Implicit((Object)(object)Hud.Font)) { return false; } Transform root = Hud.Root; Vector2 anchor = default(Vector2); ((Vector2)(ref anchor))..ctor(0.5f, 0.5f); float num = 1370f; Vector2 anchor2 = default(Vector2); ((Vector2)(ref anchor2))..ctor(0.5f, 1f); _cards = Hud.Node(root, "BuildCards", new Vector2(0.5f, 0f), new Vector2(0f, 128f), new Vector2(num, 120f)); for (int i = 0; i < 13; i++) { Image val = Hud.Box((Transform)(object)_cards, new Vector2(0f, 0f), new Vector2((float)i * 106f, 0f), new Vector2(98f, 116f), Hud.Panel); Image item = Hud.Box(((Component)val).transform, anchor, Vector2.zero, new Vector2(98f, 116f), Hud.Accent, 14f, "Ui_outline"); Image val2 = Hud.Picture(((Component)val).transform, "Piece" + (PieceType)i/*cast due to .constrained prefix*/, anchor2, new Vector2(0f, -5f), new Vector2(56f, 56f)); TextMeshProUGUI val3 = Hud.Label(((Component)val).transform, "", 15f, anchor2, new Vector2(0f, Object.op_Implicit((Object)(object)val2) ? (-62f) : (-8f)), new Vector2(90f, Object.op_Implicit((Object)(object)val2) ? 20f : 44f), (TextAlignmentOptions)258); ((TMP_Text)val3).enableWordWrapping = !Object.op_Implicit((Object)(object)val2); ((TMP_Text)val3).enableAutoSizing = true; ((TMP_Text)val3).fontSizeMin = 11f; ((TMP_Text)val3).fontSizeMax = 15f; TextMeshProUGUI item2 = Hud.Label(((Component)val).transform, "", 20f, new Vector2(0.5f, 0f), new Vector2(0f, 6f), new Vector2(88f, 26f), (TextAlignmentOptions)1026, Hud.Gold, bold: true); _card.Add((val, item, val2, val3, item2)); } _keysBox = Hud.Box(root, new Vector2(0.5f, 0f), new Vector2(0f, 258f), new Vector2(600f, 42f), Hud.Panel, 21f); _keysText = Hud.Label(((Component)_keysBox).transform, "", 21f, anchor, Vector2.zero, new Vector2(1600f, 42f), (TextAlignmentOptions)514); _descBox = Hud.Box(root, new Vector2(0.5f, 0f), new Vector2(0f, 306f), new Vector2(600f, 40f), Hud.Panel, 20f); _descText = Hud.Label(((Component)_descBox).transform, "", 19f, anchor, Vector2.zero, new Vector2(1600f, 40f), (TextAlignmentOptions)514, Hud.Muted); _warnBox = Hud.Box(root, new Vector2(0.5f, 0f), new Vector2(0f, 354f), new Vector2(400f, 42f), new Color(0.45f, 0.08f, 0.06f, 0.85f), 21f); _warnText = Hud.Label(((Component)_warnBox).transform, "", 22f, anchor, Vector2.zero, new Vector2(1200f, 42f), (TextAlignmentOptions)514, null, bold: true); _lookBox = Hud.Box(root, anchor, new Vector2(0f, -150f), new Vector2(560f, 136f), Hud.Panel, 16f); _lookPic = Hud.PictureSlot(((Component)_lookBox).transform, new Vector2(0f, 0.5f), new Vector2(10f, 0f), new Vector2(86f, 86f)); _lookName = Hud.Label(((Component)_lookBox).transform, "", 24f, new Vector2(0.5f, 1f), new Vector2(48f, -8f), new Vector2(540f, 32f), (TextAlignmentOptions)258, null, bold: true); _lookStatsText = Hud.Label(((Component)_lookBox).transform, "", 17f, new Vector2(0.5f, 1f), new Vector2(48f, -42f), new Vector2(1200f, 26f), (TextAlignmentOptions)258, Hud.Muted); _lookBar = Hud.Bar.Make(((Component)_lookBox).transform, new Vector2(0.5f, 0.5f), new Vector2(48f, -14f), new Vector2(380f, 14f), Hud.Good); _lookKeysText = Hud.Label(((Component)_lookBox).transform, "", 19f, new Vector2(0.5f, 0f), new Vector2(48f, 10f), new Vector2(1200f, 32f), (TextAlignmentOptions)1026); return true; } private static void FitPill(Image box, TextMeshProUGUI t, string text, float pad = 48f) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!(((TMP_Text)t).text == text)) { ((TMP_Text)t).text = text; ((Graphic)box).rectTransform.sizeDelta = new Vector2(((TMP_Text)t).GetPreferredValues(text).x + pad, ((Graphic)box).rectTransform.sizeDelta.y); } } private void LateUpdate() { bool flag = _building && EnsureBuildUi(); bool flag2 = !_building && _walkUp && EnsureBuildUi(); if (Object.op_Implicit((Object)(object)_cards)) { ((Component)_cards).gameObject.SetActive(flag); ((Component)_keysBox).gameObject.SetActive(flag); if (!flag) { ((Component)_descBox).gameObject.SetActive(false); } } if (!flag && !flag2) { if (Object.op_Implicit((Object)(object)_warnBox)) { ((Component)_warnBox).gameObject.SetActive(false); ((Component)_lookBox).gameObject.SetActive(false); } } else { if (flag2) { ((Component)_warnBox).gameObject.SetActive(false); } else { BuildCards(); } LookPanel(); } } private void BuildCards() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00c3: 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) //IL_0102: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_01d1: 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_01af: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _card.Count; i++) { PieceType pieceType = (PieceType)i; (Image box, Image ring, Image pic, TextMeshProUGUI name, TextMeshProUGUI cost) tuple = _card[i]; Image item = tuple.box; Image item2 = tuple.ring; Image item3 = tuple.pic; TextMeshProUGUI item4 = tuple.name; TextMeshProUGUI item5 = tuple.cost; int num = Perks.MyCost(Catalog.BuildCost(pieceType)); bool flag = !Loot.Instance.ClientVault.CanBuild(pieceType); bool flag2 = pieceType == _type; bool flag3 = Siege.Instance.ViewCoins >= num && !flag; ((Component)item2).gameObject.SetActive(flag2); ((Graphic)item).color = (Color)(flag2 ? new Color(0.22f, 0.16f, 0.07f, 0.92f) : Hud.Panel); ((Graphic)item).rectTransform.anchoredPosition = new Vector2(((Graphic)item).rectTransform.anchoredPosition.x, flag2 ? 10f : 0f); ((TMP_Text)item4).text = PieceName(pieceType, 1); ((Graphic)item4).color = (flag3 ? Hud.Ink : Hud.Muted); ((TMP_Text)item4).fontStyle = (FontStyles)(flag2 ? 1 : 0); ((TMP_Text)item5).text = (flag ? L10n.T("cardLocked") : num.ToString()); ((Graphic)item5).color = (flag ? Hud.Muted : (flag3 ? Hud.Gold : Hud.Bad)); ((Graphic)item).color = (Color)(flag ? new Color(0.05f, 0.06f, 0.08f, 0.55f) : ((Graphic)item).color); if (Object.op_Implicit((Object)(object)item3)) { ((Graphic)item3).color = (Color)(flag ? new Color(0.3f, 0.3f, 0.3f, 0.45f) : (flag3 ? Color.white : new Color(1f, 1f, 1f, 0.55f))); } } FitPill(_keysBox, _keysText, Hud.Keys(L10n.T((_moveId != 0) ? "moveKeys" : "buildKeys"))); ((Component)_descBox).gameObject.SetActive(_moveId == 0); if (_moveId == 0) { FitPill(_descBox, _descText, "" + PieceName(_type, 1) + ":" + L10n.T("pieceDesc" + _type)); } bool flag4 = _blockReason.Length > 0; ((Component)_warnBox).gameObject.SetActive(flag4); if (flag4) { FitPill(_warnBox, _warnText, _blockReason); } } private void LookPanel() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) bool flag = _lookInfo.Length > 0; ((Component)_lookBox).gameObject.SetActive(flag); if (flag) { string text = Catalog.Stars(_lookLevel, Hud.Hex(new Color(1f, 1f, 1f, 0.25f))); ((TMP_Text)_lookName).text = _lookInfo + " " + text + ""; float num = ((_lookMax > 0) ? ((float)_lookHp / (float)_lookMax) : 1f); _lookBar.Set(num, Hud.HealthColor(num)); Hud.ShowPicture(_lookPic, _lookPicture); string text2 = Hud.Keys(_lookKeys); if (((TMP_Text)_lookKeysText).text != text2 || ((TMP_Text)_lookStatsText).text != _lookStats) { ((TMP_Text)_lookKeysText).text = text2; ((TMP_Text)_lookStatsText).text = _lookStats; float num2 = Mathf.Max(((TMP_Text)_lookKeysText).GetPreferredValues(text2).x, ((TMP_Text)_lookStatsText).GetPreferredValues(_lookStats).x); ((Graphic)_lookBox).rectTransform.sizeDelta = new Vector2(Mathf.Max(460f, num2 + 48f) + 96f, 136f); } } } private void EnsureRegistered() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (!Object.op_Implicit((Object)(object)networkManager) || (Object)(object)networkManager == (Object)(object)_registeredOn) { return; } _registeredOn = networkManager; networkManager.ServerManager.RegisterBroadcast(Net.Safe(OnPlaceRequest), true); networkManager.ServerManager.RegisterBroadcast(Net.Safe(OnRemoveRequest), true); networkManager.ServerManager.RegisterBroadcast(Net.Safe(OnUpgradeRequest), true); networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection c, PieceMoveRequest r, Channel ch) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) OnMoveRequest(c, r, ch); }), true); networkManager.ClientManager.RegisterBroadcast((Action)OnPieceState); networkManager.SceneManager.OnClientLoadedStartScenes += OnClientLoaded; networkManager.ServerManager.OnServerConnectionState += delegate(ServerConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { _serverPieces.Clear(); _spent.Clear(); } }; networkManager.ClientManager.OnClientConnectionState += delegate(ClientConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { ClearLocalPieces(); } }; Log.LogInfo((object)"Build system registered on NetworkManager."); } private void OnPlaceRequest(NetworkConnection conn, PiecePlaceRequest req, Channel ch) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); ServerPlace(req.Type, req.Pos, req.RotY, Object.op_Implicit((Object)(object)val) ? ((NetworkBehaviour)val).ObjectId : (-1)); } public int OwnerOf(int pieceId) { if (!_owner.TryGetValue(pieceId, out var value)) { return -1; } return value; } public bool ServerCanPlace(PieceType type, Vector3 pos) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (Siege.Instance.ServerActive && AllowedAt(pos) && Loot.Instance.Vault.CanBuild(type)) { return !_serverPieces.Values.Any((PieceState p) => Overlap(p.Type, p.Pos, type, pos)); } return false; } public bool ServerPlace(PieceType type, Vector3 pos, float rotY, int ownerId = -1, int prepaid = -1) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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) if (!ServerCanPlace(type, pos)) { return false; } if (ownerId < 0 && Object.op_Implicit((Object)(object)Player.LocalPlayer)) { ownerId = ((NetworkBehaviour)Player.LocalPlayer).ObjectId; } int num = ((prepaid >= 0) ? prepaid : Perks.Cost(Catalog.BuildCost(type), ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).ObjectId == ownerId)))); if (prepaid < 0 && !Siege.Instance.ServerTrySpend(num)) { return false; } int num2 = Perks.MaxHp(type, 1); PieceState pieceState = new PieceState { Id = _nextId++, Type = type, Pos = pos, RotY = rotY, Hp = num2, MaxHp = num2, Level = 1 }; _serverPieces[pieceState.Id] = pieceState; _spent[pieceState.Id] = (Siege.Instance.ServerActive ? num : 0); InstanceFinder.ServerManager.Broadcast(pieceState, true, (Channel)0); RoundBuilt++; _owner[pieceState.Id] = ownerId; Stats.Built(ownerId); AutoTest.Count("placed_" + type); return true; } public void ServerUpgrade(int id, int branch, bool repair = false) { OnUpgradeRequest(null, new PieceUpgradeRequest { Id = id, Branch = branch, Repair = repair, FromLevel = (_serverPieces.TryGetValue(id, out var value) ? value.Level : 0) }, (Channel)0); } public int LevelOf(int id) { if (!_states.TryGetValue(id, out var value)) { return 0; } return value.Level; } private void OnUpgradeRequest(NetworkConnection conn, PieceUpgradeRequest req, Channel ch) { Player val = (Player)((conn == (NetworkConnection)null) ? ((object)Player.LocalPlayer) : ((object)((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)))); if (req.Repair && req.Id == -1) { ServerRepairAll(val); } else { if (!_serverPieces.TryGetValue(req.Id, out var value)) { return; } if (req.Repair) { if (value.Hp < value.MaxHp && Siege.Instance.ServerTrySpend(Perks.Cost(Catalog.RepairCost(value.Hp, value.MaxHp), val))) { value.Hp = value.MaxHp; _serverPieces[value.Id] = value; InstanceFinder.ServerManager.Broadcast(value, true, (Channel)0); AutoTest.Count("repairs"); } } else { if (req.FromLevel != value.Level) { return; } int num = Perks.Cost(Catalog.UpgradeCost(value.Type, value.Level), val); if (Siege.Instance.ServerTrySpend(num)) { if (Siege.Instance.ServerActive) { _spent[value.Id] += num; } value.Level++; if (value.Level == 3 && Catalog.HasBranches(value.Type)) { value.Branch = ((req.Branch != 2) ? 1 : 2); } int num2 = Perks.MaxHp(value.Type, value.Level); value.Hp += num2 - value.MaxHp; value.MaxHp = num2; _serverPieces[value.Id] = value; InstanceFinder.ServerManager.Broadcast(value, true, (Channel)0); } } } } private bool OnMoveRequest(NetworkConnection conn, PieceMoveRequest req, Channel ch) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if (!_serverPieces.TryGetValue(req.Id, out var s) || !Siege.Instance.ServerActive) { return false; } if (float.IsNaN(req.Pos.x + req.Pos.y + req.Pos.z) || !AllowedAt(req.Pos)) { return false; } if (_serverPieces.Values.Any((PieceState p) => p.Id != s.Id && Overlap(p.Type, p.Pos, s.Type, req.Pos))) { return false; } s.Pos = req.Pos; s.RotY = req.RotY; _serverPieces[s.Id] = s; InstanceFinder.ServerManager.Broadcast(s, true, (Channel)0); AutoTest.Count("moved_" + s.Type); return true; } private void OnRemoveRequest(NetworkConnection conn, PieceRemoveRequest req, Channel ch) { if (_serverPieces.TryGetValue(req.Id, out var value)) { if (_spent.TryGetValue(req.Id, out var value2)) { Siege.Instance.ServerAddCoins(value2 / 2); } Remove(value); } } public void ServerClearAll() { foreach (PieceState item in _serverPieces.Values.ToList()) { Remove(item); } } private void Lost(PieceState state) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Catalog.IsTurret(state.Type)) { Fx.Send(FxKind.PieceLost, state.Pos, state.Pos, 0, (int)state.Type, state.Level); } Remove(state); } private void Remove(PieceState state) { _serverPieces.Remove(state.Id); _spent.Remove(state.Id); state.Removed = true; InstanceFinder.ServerManager.Broadcast(state, true, (Channel)0); } public bool ServerDamage(Collider col, int dmg) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)col) || !_pieceIds.TryGetValue(((Component)col).gameObject, out var value) || !_serverPieces.TryGetValue(value, out var value2)) { return false; } dmg = Mathf.Max(1, Mathf.RoundToInt((float)dmg * (1f - Turrets.ShieldAt(value2.Pos)))); value2.Hp -= dmg; if (value2.Hp <= 0) { Lost(value2); AutoTest.Count("pieces_destroyed"); return true; } _serverPieces[value] = value2; InstanceFinder.ServerManager.Broadcast(value2, true, (Channel)0); return true; } public void ServerDamagePiece(int id, int dmg) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (_serverPieces.TryGetValue(id, out var value)) { value.Hp -= Mathf.Max(1, Mathf.RoundToInt((float)dmg * (1f - Turrets.ShieldAt(value.Pos)))); if (value.Hp <= 0) { Lost(value); AutoTest.Count("pieces_destroyed"); } else { _serverPieces[id] = value; InstanceFinder.ServerManager.Broadcast(value, true, (Channel)0); } } } public void ServerTakePiece(int id) { if (_serverPieces.TryGetValue(id, out var value)) { value.Hp = 0; Remove(value); AutoTest.Count("pieces_destroyed"); } } public void ServerDamageArea(Vector3 at, float radius, int dmg) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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) foreach (PieceState item in _serverPieces.Values.Where(delegate(PieceState p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val = p.Pos - at; return ((Vector3)(ref val)).sqrMagnitude <= radius * radius; }).ToList()) { PieceState current = item; current.Hp -= Mathf.Max(1, Mathf.RoundToInt((float)dmg * (1f - Turrets.ShieldAt(current.Pos)))); if (current.Hp <= 0) { Lost(current); AutoTest.Count("pieces_destroyed"); } else { _serverPieces[current.Id] = current; InstanceFinder.ServerManager.Broadcast(current, true, (Channel)0); } } } public List ServerRepairArea(Vector3 at, float radius, float share) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (PieceState item in _serverPieces.Values.Where(delegate(PieceState p) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (p.Hp < p.MaxHp) { Vector3 val = p.Pos - at; return ((Vector3)(ref val)).sqrMagnitude <= radius * radius; } return false; }).ToList()) { PieceState current = item; current.Hp = Mathf.Min(current.MaxHp, current.Hp + Mathf.CeilToInt((float)current.MaxHp * share)); _serverPieces[current.Id] = current; InstanceFinder.ServerManager.Broadcast(current, true, (Channel)0); list.Add(current.Pos); } return list; } public List ServerMendArea(Vector3 at, float radius, int hp, int self) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (PieceState item in _serverPieces.Values.Where(delegate(PieceState p) { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (p.Id != self && p.Hp < p.MaxHp) { Vector3 val = (p.Pos - at).Flat(); return ((Vector3)(ref val)).sqrMagnitude <= radius * radius; } return false; }).ToList()) { PieceState current = item; current.Hp = Mathf.Min(current.MaxHp, current.Hp + hp); _serverPieces[current.Id] = current; InstanceFinder.ServerManager.Broadcast(current, true, (Channel)0); list.Add(current.Pos); } return list; } public static bool IsWall(Collider col) { if (!Object.op_Implicit((Object)(object)col)) { return false; } string[] array = ((Object)((Component)col).gameObject).name.Split('_'); if (array.Length >= 2 && array[0] == "FortressPiece" && Enum.TryParse(array[1], out var result)) { if (result != PieceType.Wall) { return Catalog.IsTurret(result); } return true; } return false; } private void OnClientLoaded(NetworkConnection conn, bool asServer) { if (!asServer) { return; } foreach (PieceState value in _serverPieces.Values) { InstanceFinder.ServerManager.Broadcast(conn, value, true, (Channel)0); } } private void OnPieceState(PieceState s, Channel ch) { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) _pieces.TryGetValue(s.Id, out var value); if (s.Removed) { if (Object.op_Implicit((Object)(object)value)) { _pieceIds.Remove(value); PieceState value2; bool broken = (_states.TryGetValue(s.Id, out value2) && value2.Hp <= 0) || s.Hp <= 0; ((MonoBehaviour)this).StartCoroutine(Shatter(value, broken)); } _pieces.Remove(s.Id); _states.Remove(s.Id); return; } PieceState value3; bool num = _states.TryGetValue(s.Id, out value3); if (!Object.op_Implicit((Object)(object)value)) { value = CreatePieceObject(s.Type, PieceLayer); ((Object)value).name = "FortressPiece_" + s.Type.ToString() + "_" + s.Id; value.transform.position = s.Pos; value.transform.rotation = ((s.Type == PieceType.Ramp) ? Quaternion.Euler(-45f, s.RotY, 0f) : Quaternion.Euler(0f, s.RotY, 0f)); _pieces[s.Id] = value; _pieceIds[value] = s.Id; value3.Level = 0; } if (value3.Level != s.Level || value3.Branch != s.Branch) { if (Catalog.IsTurret(s.Type)) { SetTurretLook(value, s.Type, s.Level, s.Branch); } if (s.Type == PieceType.Wall) { SetWallModel(value, s.Level); } else { Models.SetLevelLook(value, s.Type, s.Level); } if (s.Type == PieceType.Bubble || s.Type == PieceType.Mender) { SetBubbleRing(value, s.Type, s.Level, s.Branch); } SetRankStuds(value, s.Type, s.Level); } if (num && (value3.Pos != s.Pos || value3.RotY != s.RotY)) { Fx.Send(FxKind.Dust, value3.Pos, value3.Pos); value.transform.position = s.Pos; value.transform.rotation = ((s.Type == PieceType.Ramp) ? Quaternion.Euler(-45f, s.RotY, 0f) : Quaternion.Euler(0f, s.RotY, 0f)); ((MonoBehaviour)this).StartCoroutine(Pop(value.transform)); Fx.SoundRandom("WoodItemImpact_V", 1, 3, s.Pos, 0.8f, (AudioDistance)1); } if (!num) { ((MonoBehaviour)this).StartCoroutine(Pop(value.transform)); Fx.SoundRandom("WoodItemImpact_V", 1, 3, s.Pos, 0.8f, (AudioDistance)1); } else if (s.Level > value3.Level) { ((MonoBehaviour)this).StartCoroutine(Pop(value.transform)); Fx.SoundRandom("MetallicItemImpact_V", 1, 2, s.Pos, 0.9f, (AudioDistance)1); Fx.Sound("Buy_01", s.Pos, 0.6f, (AudioDistance)1); } else if (s.Hp < value3.Hp) { ((MonoBehaviour)this).StartCoroutine(Shake(value.transform, s.Id)); if (Time.time > _nextHitSound) { _nextHitSound = Time.time + 0.15f; Fx.SoundRandom("KnifeHit_0", 1, 4, s.Pos, 0.6f, (AudioDistance)1); } } else if (s.Hp > value3.Hp) { Fx.Sound("Buy_02", s.Pos, 0.6f, (AudioDistance)1); } _states[s.Id] = s; Models.Tint(value, (s.MaxHp > 0) ? Mathf.Clamp01((float)s.Hp / (float)s.MaxHp) : 1f); } private static IEnumerator Pop(Transform t) { for (float k = 0f; k < 1f; k += Time.deltaTime / 0.18f) { if (!Object.op_Implicit((Object)(object)t)) { break; } t.localScale = Vector3.one * Mathf.Lerp(0.7f, 1f, 1f - (1f - k) * (1f - k)); yield return null; } if (Object.op_Implicit((Object)(object)t)) { t.localScale = Vector3.one; } } private IEnumerator Shake(Transform t, int id) { for (float k = 0f; k < 0.15f; k += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)t)) { break; } t.position = Home() + Random.insideUnitSphere * 0.06f; yield return null; } if (Object.op_Implicit((Object)(object)t)) { t.position = Home(); } Vector3 Home() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!_states.TryGetValue(id, out var value)) { return t.position; } return value.Pos; } } private static IEnumerator Shatter(GameObject go, bool broken) { if (broken) { Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, go.transform.position, 1f, (AudioDistance)2); } Collider[] componentsInChildren = go.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Vector3 start = go.transform.position; for (float k = 0f; k < 1f; k += Time.deltaTime / (broken ? 0.4f : 0.2f)) { if (!Object.op_Implicit((Object)(object)go)) { break; } go.transform.localScale = Vector3.one * (1f - k); if (broken) { go.transform.position = start + Vector3.down * k * 0.8f + Random.insideUnitSphere * 0.05f; } yield return null; } if (Object.op_Implicit((Object)(object)go)) { Object.Destroy((Object)(object)go); } } private void ClearLocalPieces() { foreach (GameObject value in _pieces.Values) { if (Object.op_Implicit((Object)(object)value)) { Object.Destroy((Object)(object)value); } } _pieces.Clear(); _states.Clear(); _pieceIds.Clear(); } } [HarmonyPatch(typeof(PlayerHolding), "PrimaryInput")] internal static class BlockPrimaryWhileBuilding { private static bool Prefix() { if (!BuildSystem.Building && !Weapons.Drawn) { return !Hud.ModalOpen; } return false; } } [HarmonyPatch(typeof(PlayerHolding), "SecondaryInput")] internal static class BlockSecondaryWhileBuilding { private static bool Prefix() { if (!BuildSystem.Building && !Weapons.Drawn) { return !Hud.ModalOpen; } return false; } } [HarmonyPatch(typeof(PlayerPunching), "PunchInput")] internal static class BlockPunchWhileBuilding { private static bool Prefix() { if (!BuildSystem.Building && !Weapons.Drawn) { return !Hud.ModalOpen; } return false; } } [HarmonyPatch(typeof(PlayerPunching), "CanPunch")] internal static class NoHeldPunchWhileBuilding { private static bool Prefix(ref bool __result) { if (!BuildSystem.Building && !Weapons.Drawn) { return true; } __result = false; return false; } } public enum PieceType : byte { Wall, Floor, Ramp, Gun, Cannon, Harpoon, Mortar, Tesla, Spikes, Flame, Sniper, Bubble, Mender } public static class Catalog { public struct TurretStats { public int Damage; public float Interval; public float Range; public float MinRange; public float Splash; public int Chain; public int Shots; public int Targets; public bool Pierce; public float Slow; public float SlowTime; public float Burn; public float BossMult; public float WaterMult; public float Cone; public float Shield; } public const int BranchLevel = 3; public const float BeyondDamage = 1.2f; public const float BeyondHp = 1.15f; public const float BeyondCost = 1.5f; public const float BeyondRange = 0.4f; public const float BeyondRangeMax = 4f; public const int TypeCount = 13; public const float MendCore = 0.5f; public static bool IsTurret(PieceType t) { if ((int)t < 3 || (int)t > 7) { return (int)t >= 9; } return true; } public static bool NeedsBlueprint(PieceType t) { if ((int)t >= 9) { return t != PieceType.Mender; } return false; } public static bool Shoots(PieceType t) { if (IsTurret(t) && t != PieceType.Bubble) { return t != PieceType.Mender; } return false; } public static bool HasBranches(PieceType t) { return IsTurret(t); } public static string HeadModel(PieceType t) { return t.ToString() + "Head"; } public static int BuildCost(PieceType t) { return Siege.Money(BaseCost(t)); } private static int BaseCost(PieceType t) { switch (t) { case PieceType.Wall: return 10; case PieceType.Floor: case PieceType.Ramp: return 8; case PieceType.Gun: return 50; case PieceType.Cannon: return 80; case PieceType.Harpoon: return 70; case PieceType.Mortar: return 110; case PieceType.Tesla: return 90; case PieceType.Flame: return 100; case PieceType.Sniper: return 120; case PieceType.Bubble: return 130; case PieceType.Mender: return 120; default: return 25; } } public static int Beyond(int level) { return Mathf.Max(0, level - 3); } private static float Grow(float per, int level) { return Mathf.Min(1000000f, Mathf.Pow(per, (float)Beyond(level))); } private static int Table(int level) { return Mathf.Clamp(level, 1, 3) - 1; } public static int UpgradeCost(PieceType t, int level) { int num = t switch { PieceType.Wall => 15, PieceType.Gun => 40, PieceType.Cannon => 60, PieceType.Harpoon => 50, PieceType.Mortar => 80, PieceType.Tesla => 70, PieceType.Spikes => 15, PieceType.Flame => 70, PieceType.Sniper => 80, PieceType.Bubble => 90, PieceType.Mender => 80, _ => 10, }; return Siege.Money(Mathf.RoundToInt(Mathf.Min((level < 3) ? ((float)(num * level)) : ((float)(num * 3) * Mathf.Pow(1.5f, (float)(level - 3))), 100000000f))); } public static int RepairCost(int hp, int maxHp) { return Siege.Money(Mathf.Max(1, Mathf.CeilToInt((float)(maxHp - hp) / 10f))); } public static int MaxHp(PieceType t, int level) { int num = Table(level); int num2; switch (t) { case PieceType.Wall: num2 = (new int[3] { 200, 400, 650 })[num]; break; case PieceType.Floor: case PieceType.Ramp: num2 = (new int[3] { 100, 200, 350 })[num]; break; case PieceType.Spikes: num2 = (new int[3] { 120, 200, 300 })[num]; break; default: num2 = (new int[3] { 300, 450, 600 })[num]; break; } return Mathf.RoundToInt(Mathf.Min(100000000f, (float)num2 * Grow(1.15f, level))); } public static TurretStats Turret(PieceType t, int level, int branch) { TurretStats result = TableTurret(t, level, branch); if (Beyond(level) == 0) { return result; } float num = Grow(1.2f, level); result.Damage = Mathf.RoundToInt(Mathf.Min(100000000f, (float)result.Damage * num)); result.Burn *= num; result.Range += Mathf.Min(4f, 0.4f * (float)Beyond(level)); if (t == PieceType.Bubble) { result.Shield = Mathf.Min(0.85f, result.Shield + 0.025f * (float)Beyond(level)); } int num2 = Milestones(level); switch (t) { case PieceType.Gun: case PieceType.Sniper: result.Targets += num2; break; case PieceType.Cannon: case PieceType.Harpoon: case PieceType.Mortar: result.Shots += num2; break; case PieceType.Tesla: result.Chain += 2 * num2; break; case PieceType.Flame: result.Cone = Mathf.Min(90f, result.Cone + 10f * (float)num2); break; case PieceType.Bubble: case PieceType.Mender: result.Range += 2f * (float)num2; break; } return result; } public static int Milestones(int level) { return Mathf.Min(3, level / 5); } private static TurretStats TableTurret(PieceType t, int level, int branch) { int num = Table(level); TurretStats result = new TurretStats { Shots = 1, Targets = 1, BossMult = 1f, WaterMult = 1f }; switch (t) { case PieceType.Gun: result.Damage = (new int[3] { 6, 9, 13 })[num]; result.Interval = (new float[3] { 0.25f, 0.2f, 0.15f })[num]; result.Range = (new float[3] { 16f, 18f, 20f })[num]; if (branch == 1) { result.Interval *= 0.5f; } if (branch == 2) { result.BossMult = 3f; } break; case PieceType.Cannon: result.Damage = (new int[3] { 25, 40, 60 })[num]; result.Interval = (new float[3] { 2f, 1.7f, 1.4f })[num]; result.Range = (new float[3] { 18f, 21f, 24f })[num]; result.Splash = 3f; if (branch == 1) { result.Splash = 5f; result.Shots = 3; result.Damage = Mathf.RoundToInt((float)result.Damage * 0.6f); } if (branch == 2) { result.Damage = Mathf.RoundToInt((float)result.Damage * 2.5f); } break; case PieceType.Harpoon: result.Damage = (new int[3] { 18, 28, 40 })[num]; result.Interval = (new float[3] { 1.6f, 1.4f, 1.2f })[num]; result.Range = (new float[3] { 20f, 23f, 26f })[num]; result.Pierce = true; result.Slow = 0.35f; result.SlowTime = 2f; if (branch == 1) { result.Shots = 3; } if (branch == 2) { result.Slow = 0.7f; result.SlowTime = 3.5f; } break; case PieceType.Mortar: result.Damage = (new int[3] { 35, 55, 80 })[num]; result.Interval = (new float[3] { 3.5f, 3f, 2.6f })[num]; result.Range = (new float[3] { 32f, 36f, 40f })[num]; result.MinRange = 8f; result.Splash = 4f; if (branch == 1) { result.Burn = 12f; } if (branch == 2) { result.Shots = 3; } break; case PieceType.Flame: result.Damage = (new int[3] { 6, 9, 13 })[num]; result.Interval = (new float[3] { 0.2f, 0.18f, 0.15f })[num]; result.Range = (new float[3] { 7f, 8f, 9f })[num]; result.Cone = 35f; result.Burn = (new float[3] { 5f, 8f, 12f })[num]; if (branch == 1) { result.Burn *= 2f; } if (branch == 2) { result.Cone = 60f; result.Range += 2f; } break; case PieceType.Sniper: result.Damage = (new int[3] { 80, 120, 180 })[num]; result.Interval = (new float[3] { 3f, 2.6f, 2.2f })[num]; result.Range = (new float[3] { 40f, 45f, 50f })[num]; if (branch == 1) { result.BossMult = 2f; } if (branch == 2) { result.Interval *= 0.6f; } break; case PieceType.Bubble: result.Damage = 0; result.Interval = 1f; result.Range = (new float[3] { 8f, 9f, 10f })[num]; result.Shield = (new float[3] { 0.3f, 0.4f, 0.5f })[num]; if (branch == 1) { result.Range += 4f; } if (branch == 2) { result.Shield = 0.65f; } break; case PieceType.Mender: result.Damage = (new int[3] { 5, 8, 12 })[num]; result.Interval = 1f; result.Range = (new float[3] { 7f, 8f, 9f })[num]; if (branch == 1) { result.Range += 4f; } if (branch == 2) { result.Damage *= 2; } break; case PieceType.Tesla: result.Damage = (new int[3] { 14, 22, 33 })[num]; result.Interval = (new float[3] { 1.2f, 1f, 0.85f })[num]; result.Range = (new float[3] { 11f, 13f, 15f })[num]; result.Chain = (new int[3] { 3, 4, 5 })[num]; result.WaterMult = 2f; if (branch == 1) { result.Chain += 3; } if (branch == 2) { result.Damage *= 2; result.Interval *= 1.5f; } break; } return result; } public static string BranchKey(PieceType t, int branch) { if (branch != 0) { return t.ToString() + ((branch == 1) ? "A" : "B"); } return null; } public static Vector3 Size(PieceType t) { //IL_0027: 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_0051: 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_007b: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(t switch { PieceType.Wall => new Vector3(3f, 3f, 0.3f), PieceType.Floor => new Vector3(3f, 0.3f, 3f), PieceType.Ramp => new Vector3(3f, 0.3f, 4.2426f), PieceType.Spikes => new Vector3(3f, 0.15f, 3f), _ => new Vector3(1.6f, 1.6f, 1.6f), }); } public static int SpikeDamage(int level) { return Mathf.RoundToInt(Mathf.Min(100000000f, (float)(new int[3] { 4, 7, 11 })[Table(level)] * Grow(1.2f, level))); } public static string Stars(int level, string dim = "#FFFFFF40") { return new string('★', Mathf.Min(level, 3)) + ((level < 3) ? ("" + new string('★', 3 - level) + "") : "") + ((Beyond(level) > 0) ? $"+{Beyond(level)}" : ""); } } public struct BuildWork : IBroadcast { public PieceType Type; public Vector3 Pos; public float RotY; } public struct SiteState : IBroadcast { public int Id; public PieceType Type; public Vector3 Pos; public float RotY; public float Progress; public byte Workers; public byte End; } public class Construction : MonoBehaviour { private class Site { public int Id; public int Owner; public int Paid; public PieceType Type; public Vector3 Pos; public float RotY; public float Progress; public float LastSent; public byte LastWorkers; public readonly Dictionary Work = new Dictionary(); } private class View { public SiteState S; public GameObject Root; public GameObject Model; public float NextChip; public float NextHammer; } public static Construction Instance; public const float TeamBonus = 0.6f; public const float WorkGap = 0.35f; public const float Abandon = 1f; public const float SendEvery = 0.15f; private readonly Dictionary _sites = new Dictionary(); private int _nextId = 1; private readonly Dictionary _views = new Dictionary(); private readonly List<(Transform t, Vector3 v, float until)> _chips = new List<(Transform, Vector3, float)>(); private float _lastLocalWork = -10f; private int _localSite; private NetworkManager _registeredOn; private static Material _woodChip; private static Material _metalChip; private static Material _scaffold; private readonly List _labels = new List(); public bool LocalWorking => Time.time - _lastLocalWork < 0.35f; public bool ClientOthersBuilding => _views.Values.Any((View v) => !LocalWorking || v.S.Id != _localSite); public int ServerSiteCount => _sites.Count; public static float BuildTime(PieceType t) { if (!Catalog.IsTurret(t)) { if (t != PieceType.Spikes) { return 0.4f; } return 0.6f; } return 1f; } static Construction() { GenericWriter.SetWrite((Action)delegate(Writer w, BuildWork v) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) w.WriteByte((byte)v.Type); w.WriteVector3(v.Pos); w.WriteSingle(v.RotY); }); GenericReader.SetRead((Func)((Reader r) => new BuildWork { Type = (PieceType)r.ReadByte(), Pos = r.ReadVector3(), RotY = r.ReadSingle() })); GenericWriter.SetWrite((Action)delegate(Writer w, SiteState v) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) w.WriteInt32(v.Id); w.WriteByte((byte)v.Type); w.WriteVector3(v.Pos); w.WriteSingle(v.RotY); w.WriteSingle(v.Progress); w.WriteByte(v.Workers); w.WriteByte(v.End); }); GenericReader.SetRead((Func)((Reader r) => new SiteState { Id = r.ReadInt32(), Type = (PieceType)r.ReadByte(), Pos = r.ReadVector3(), RotY = r.ReadSingle(), Progress = r.ReadSingle(), Workers = r.ReadByte(), End = r.ReadByte() })); } private void Awake() { Instance = this; } private void Update() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, BuildWork w, Channel ch) { Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); if (Object.op_Implicit((Object)(object)val)) { ServerWork(((NetworkBehaviour)val).ObjectId, w); } }), true); networkManager.ClientManager.RegisterBroadcast((Action)delegate(SiteState s, Channel ch) { OnSite(s); }); networkManager.SceneManager.OnClientLoadedStartScenes += delegate(NetworkConnection conn, bool asServer) { if (asServer) { foreach (Site value in _sites.Values) { InstanceFinder.ServerManager.Broadcast(conn, StateOf(value, 0), true, (Channel)0); } } }; networkManager.ServerManager.OnServerConnectionState += delegate(ServerConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { _sites.Clear(); } }; networkManager.ClientManager.OnClientConnectionState += delegate(ClientConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { ClearViews(); } }; } if (InstanceFinder.IsServerStarted) { ServerTick(); } ClientTick(); } public void Work(PieceType type, Vector3 pos, float rotY) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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) _lastLocalWork = Time.time; View view = _views.Values.FirstOrDefault(delegate(View v) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = v.S.Pos - pos; return ((Vector3)(ref val)).sqrMagnitude < 0.01f; }); _localSite = view?.S.Id ?? 0; if (view != null) { type = view.S.Type; rotY = view.S.RotY; } if (InstanceFinder.IsClientStarted) { InstanceFinder.ClientManager.Broadcast(new BuildWork { Type = type, Pos = pos, RotY = rotY }, (Channel)0); } } public bool SiteUnderAim(Ray ray, float reach, out SiteState site) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) site = default(SiteState); float num = 1.3f; foreach (View value in _views.Values) { Vector3 val = value.S.Pos + Vector3.up * ((Catalog.IsTurret(value.S.Type) || value.S.Type == PieceType.Spikes) ? 0.6f : 0f); float num2 = Vector3.Dot(val - ((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction); if (!(num2 < 0f) && !(num2 > reach)) { Vector3 val2 = Vector3.Cross(((Ray)(ref ray)).direction, val - ((Ray)(ref ray)).origin); float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude < num) { num = magnitude; site = value.S; } } } return num < 1.3f; } public void ServerWork(int playerId, BuildWork w) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) Site site = _sites.Values.FirstOrDefault(delegate(Site s) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = s.Pos - w.Pos; return ((Vector3)(ref val)).sqrMagnitude < 0.01f; }); if (site == null) { if (!BuildSystem.Instance.ServerCanPlace(w.Type, w.Pos)) { return; } Player builder = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).ObjectId == playerId)); int num = Perks.Cost(Catalog.BuildCost(w.Type), builder); if (!Siege.Instance.ServerTrySpend(num)) { return; } site = new Site { Id = _nextId++, Owner = playerId, Paid = num, Type = w.Type, Pos = w.Pos, RotY = w.RotY }; _sites[site.Id] = site; AutoTest.Count("sites_started"); } site.Work[playerId] = Time.time; } private void ServerTick() { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) if (_sites.Count == 0) { return; } float now = Time.time; foreach (Site item in _sites.Values.ToList()) { if (!Siege.Instance.ServerActive) { End(item, 2, refund: false); continue; } int num = item.Work.Values.Count((float t) => now - t < 0.35f); if (num == 0) { if (now - item.Work.Values.DefaultIfEmpty(0f).Max() > 1f) { End(item, 2, refund: true); AutoTest.Count("sites_abandoned"); } continue; } bool flag = item.Work.Any((KeyValuePair kv) => now - kv.Value < 0.35f && Perks.Legend(kv.Key, Gear.ToolBelt)); if (flag) { Perks.Proc(Gear.ToolBelt, item.Pos); } item.Progress += Time.deltaTime * (1f + 0.6f * (float)(num - 1)) * (flag ? 2f : 1f) / BuildTime(item.Type); if (item.Progress >= 1f) { if (BuildSystem.Instance.ServerPlace(item.Type, item.Pos, item.RotY, item.Owner, item.Paid)) { End(item, 1, refund: false); } else { End(item, 2, refund: true); } } else if (now - item.LastSent > 0.1f || num != item.LastWorkers) { item.LastSent = now; item.LastWorkers = (byte)num; InstanceFinder.ServerManager.Broadcast(StateOf(item, 0), true, (Channel)0); } } } private void End(Site s, byte how, bool refund) { _sites.Remove(s.Id); if (refund) { Siege.Instance.ServerAddCoins(s.Paid); } InstanceFinder.ServerManager.Broadcast(StateOf(s, how), true, (Channel)0); } private static SiteState StateOf(Site s, byte end) { //IL_0025: 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) return new SiteState { Id = s.Id, Type = s.Type, Pos = s.Pos, RotY = s.RotY, Progress = Mathf.Clamp01(s.Progress), Workers = s.LastWorkers, End = end }; } private void OnSite(SiteState s) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0060: 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) _views.TryGetValue(s.Id, out var value); if (s.End != 0) { if (value != null) { Burst(value, (s.End == 1) ? 14 : 6); Object.Destroy((Object)(object)value.Root); _views.Remove(s.Id); } if (s.End == 2) { Fx.Sound("PickupWhoosh", s.Pos, 0.5f, (AudioDistance)1); } return; } if (value == null) { value = new View { Root = new GameObject("FortressSite") }; Object.DontDestroyOnLoad((Object)(object)value.Root); value.Root.transform.position = s.Pos; value.Root.transform.rotation = ((s.Type == PieceType.Ramp) ? Quaternion.Euler(-45f, s.RotY, 0f) : Quaternion.Euler(0f, s.RotY, 0f)); value.Model = BuildSystem.CreatePieceVisual(s.Type); value.Model.transform.SetParent(value.Root.transform, false); Models.Paint(value.Model, new Color(0.78f, 0.86f, 1f)); Scaffold(value.Root.transform, s.Type); _views[s.Id] = value; } value.S = s; } private void ClientTick() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00c7: 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_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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; foreach (View value in _views.Values) { float progress = value.S.Progress; bool flag = value.S.Type == PieceType.Wall; value.Model.transform.localScale = new Vector3(1f, Mathf.Max(0.04f, progress), 1f); value.Model.transform.localPosition = (flag ? (Vector3.down * (1f - progress) * 3f * 0.5f) : Vector3.zero); if (time >= value.NextChip) { value.NextChip = time + 0.07f; Chip(value.S.Pos + Random.insideUnitSphere * 1.1f + Vector3.up * 0.3f, Catalog.IsTurret(value.S.Type)); } if (time >= value.NextHammer) { value.NextHammer = time + 0.26f; if (Catalog.IsTurret(value.S.Type)) { Fx.SoundRandom("MetallicItemImpact_V", 1, 2, value.S.Pos, 0.45f, (AudioDistance)1); } else { Fx.SoundRandom("WoodItemImpact_V", 1, 3, value.S.Pos, 0.45f, (AudioDistance)1); } } } for (int num = _chips.Count - 1; num >= 0; num--) { Transform val; float num2; Vector3 val2; (val, val2, num2) = _chips[num]; if (!Object.op_Implicit((Object)(object)val) || time > num2) { if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val).gameObject); } _chips.RemoveAt(num); } else { val2 += Physics.gravity * Time.deltaTime; val.position += val2 * Time.deltaTime; val.Rotate(400f * Time.deltaTime, 230f * Time.deltaTime, 0f); _chips[num] = (val, val2, num2); } } DrawLabels(); } private void Chip(Vector3 at, bool metal) { //IL_0028: 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) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_010b: Unknown result type (might be due to invalid IL or missing references) if (_chips.Count <= 80) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)val.GetComponent()); val.transform.position = at; val.transform.localScale = Vector3.one * Random.Range(0.06f, 0.12f); if (!Object.op_Implicit((Object)(object)_woodChip)) { _woodChip = Models.Make(new Color(0.72f, 0.55f, 0.33f)); _metalChip = Models.Make(new Color(0.75f, 0.75f, 0.72f)); } val.GetComponent().sharedMaterial = ((metal && Random.value < 0.6f) ? _metalChip : _woodChip); _chips.Add((val.transform, new Vector3(Random.Range(-1.5f, 1.5f), Random.Range(2f, 4f), Random.Range(-1.5f, 1.5f)), Time.time + 0.6f)); } } private void Burst(View v, int n) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < n; i++) { Chip(v.S.Pos + Random.insideUnitSphere * 1.2f + Vector3.up * 0.5f, Catalog.IsTurret(v.S.Type)); } } private static void Scaffold(Transform root, PieceType t) { //IL_0009: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00f3: 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_0100: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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) //IL_0171: 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_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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: 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_01c2: 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_01e9: 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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Catalog.Size(t) + new Vector3(0.2f, 0.2f, 0.2f); Vector3 c = ((Catalog.IsTurret(t) || t == PieceType.Spikes) ? (Vector3.up * val.y * 0.5f) : Vector3.zero); if (Catalog.IsTurret(t)) { ((Vector3)(ref val))..ctor(1.8f, 2f, 1.8f); } if (!Object.op_Implicit((Object)(object)_scaffold)) { _scaffold = Models.Make(new Color(0.55f, 0.4f, 0.24f)); } Vector3 val2 = val * 0.5f; float[] array = new float[2] { 0f - val2.y, val2.y }; foreach (float num in array) { Bar(new Vector3(0f - val2.x, num, 0f - val2.z), new Vector3(val2.x, num, 0f - val2.z)); Bar(new Vector3(0f - val2.x, num, val2.z), new Vector3(val2.x, num, val2.z)); Bar(new Vector3(0f - val2.x, num, 0f - val2.z), new Vector3(0f - val2.x, num, val2.z)); Bar(new Vector3(val2.x, num, 0f - val2.z), new Vector3(val2.x, num, val2.z)); } array = new float[2] { 0f - val2.x, val2.x }; foreach (float num2 in array) { float[] array2 = new float[2] { 0f - val2.z, val2.z }; foreach (float num3 in array2) { Bar(new Vector3(num2, 0f - val2.y, num3), new Vector3(num2, val2.y, num3)); } } void Bar(Vector3 a, Vector3 b) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)obj.GetComponent()); obj.transform.SetParent(root, false); obj.transform.localPosition = c + (a + b) * 0.5f; Vector3 val3 = b - a; obj.transform.localScale = new Vector3(Mathf.Max(0.06f, Mathf.Abs(val3.x)), Mathf.Max(0.06f, Mathf.Abs(val3.y)), Mathf.Max(0.06f, Mathf.Abs(val3.z))); obj.GetComponent().sharedMaterial = _scaffold; } } private void DrawLabels() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0097: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) int num = 0; Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera) && Object.op_Implicit((Object)(object)Hud.Font)) { foreach (View value2 in _views.Values) { if (LocalWorking && value2.S.Id == _localSite) { continue; } Vector3 val = value2.S.Pos + Vector3.up * ((value2.S.Type == PieceType.Wall) ? 2f : 2.3f); Vector3 val2 = val - ((Component)curCamera).transform.position; if (((Vector3)(ref val2)).sqrMagnitude > 900f) { continue; } Vector3 val3 = curCamera.WorldToScreenPoint(val); if (!(val3.z < 0f)) { if (num >= _labels.Count) { List labels = _labels; Transform root = Hud.Root; Vector2 zero = Vector2.zero; Vector2 zero2 = Vector2.zero; Vector2 box = new Vector2(260f, 40f); Vector2? pivot = new Vector2(0.5f, 0.5f); labels.Add(Hud.Label(root, "", 22f, zero, zero2, box, (TextAlignmentOptions)514, null, bold: true, outline: true, pivot)); } TextMeshProUGUI val4 = _labels[num++]; ((Component)val4).gameObject.SetActive(true); RectTransform rectTransform = ((TMP_Text)val4).rectTransform; Vector2 anchorMin = (((TMP_Text)val4).rectTransform.anchorMax = new Vector2(val3.x / (float)Screen.width, val3.y / (float)Screen.height)); rectTransform.anchorMin = anchorMin; ((TMP_Text)val4).rectTransform.anchoredPosition = Vector2.zero; string text = ((value2.S.Workers > 1) ? $" ×{1f + 0.6f * (float)(value2.S.Workers - 1):0.#}" : ""); ((TMP_Text)val4).text = L10n.T("siteLabel", Mathf.RoundToInt(value2.S.Progress * 100f)) + text; } } } for (int i = num; i < _labels.Count; i++) { if (Object.op_Implicit((Object)(object)_labels[i])) { ((Component)_labels[i]).gameObject.SetActive(false); } } if (LocalWorking && _views.TryGetValue(_localSite, out var value)) { Hud.Ring(value.S.Progress, L10n.T("siteLabel", Mathf.RoundToInt(value.S.Progress * 100f))); } else if (LocalWorking) { View view = _views.Values.OrderBy(delegate(View x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Vector3 val6 = x.S.Pos - (Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Transform.position : Vector3.zero); return ((Vector3)(ref val6)).sqrMagnitude; }).FirstOrDefault(); if (view != null) { _localSite = view.S.Id; Hud.Ring(view.S.Progress, L10n.T("siteLabel", Mathf.RoundToInt(view.S.Progress * 100f))); } } } private void ClearViews() { foreach (View value in _views.Values) { if (Object.op_Implicit((Object)(object)value.Root)) { Object.Destroy((Object)(object)value.Root); } } _views.Clear(); } } public enum EnemyKind : byte { Runner, Charger, Spitter, Bomber, Tank, Thief, Shield, Digger, Healer, Splitter, Mini, Warden, Urchin, Angler, Steed, Stonefish, Skyfish, Kraken, Voxel, Koi, Eye, Squadron, Glitch } public struct EnemyTag : IBroadcast { public int ObjectId; public EnemyKind Kind; public bool Elite; } public struct EnemyStats { public float Speed; public float Hp; public float Damage; public float WallMult; public float Scale; public float BaseHp; public int Reward; public string Gear; public int FirstWave; } public static class EnemyCatalog { public enum Body { Land, Sea, Sky } public const int FinalWave = 100; public static readonly EnemyKind[] BossOrder = new EnemyKind[10] { EnemyKind.Warden, EnemyKind.Urchin, EnemyKind.Angler, EnemyKind.Steed, EnemyKind.Stonefish, EnemyKind.Skyfish, EnemyKind.Kraken, EnemyKind.Voxel, EnemyKind.Koi, EnemyKind.Eye }; public const float EliteHp = 3f; public const float EliteDamage = 1.5f; public const float EliteScale = 1.3f; public const int EliteReward = 3; public static EnemyStats Of(EnemyKind k) { return k switch { EnemyKind.Charger => new EnemyStats { BaseHp = 15f, Speed = 1.8f, Hp = 0.5f, Damage = 0.6f, WallMult = 1f, Scale = 0.75f, Reward = 2, Gear = "Helmet", FirstWave = 3 }, EnemyKind.Spitter => new EnemyStats { BaseHp = 40f, Speed = 0f, Hp = 1.2f, Damage = 1f, WallMult = 1f, Scale = 1.1f, Reward = 5, Gear = "SpitterCannon", FirstWave = 5 }, EnemyKind.Bomber => new EnemyStats { BaseHp = 40f, Speed = 1.2f, Hp = 1.1f, Damage = 8f, WallMult = 1f, Scale = 1f, Reward = 4, Gear = "Bomb", FirstWave = 6 }, EnemyKind.Tank => new EnemyStats { BaseHp = 150f, Speed = 0.5f, Hp = 5f, Damage = 2.5f, WallMult = 2f, Scale = 1.8f, Reward = 10, Gear = "Shell", FirstWave = 8 }, EnemyKind.Thief => new EnemyStats { BaseHp = 25f, Speed = 2f, Hp = 0.8f, Damage = 0.3f, WallMult = 1f, Scale = 0.8f, Reward = 6, Gear = "ThiefSack", FirstWave = 4 }, EnemyKind.Shield => new EnemyStats { BaseHp = 60f, Speed = 0.8f, Hp = 2f, Damage = 1f, WallMult = 1f, Scale = 1.15f, Reward = 6, Gear = "ShieldBoard", FirstWave = 7 }, EnemyKind.Digger => new EnemyStats { BaseHp = 35f, Speed = 1.1f, Hp = 1.2f, Damage = 1f, WallMult = 1f, Scale = 0.9f, Reward = 5, Gear = "MinerHat", FirstWave = 9 }, EnemyKind.Healer => new EnemyStats { BaseHp = 40f, Speed = 0.85f, Hp = 1.2f, Damage = 0.5f, WallMult = 1f, Scale = 0.95f, Reward = 7, Gear = "HealerStaff", FirstWave = 6 }, EnemyKind.Splitter => new EnemyStats { BaseHp = 45f, Speed = 0.9f, Hp = 1.5f, Damage = 1f, WallMult = 1f, Scale = 1.25f, Reward = 4, Gear = "SplitterBubbles", FirstWave = 5 }, EnemyKind.Mini => new EnemyStats { BaseHp = 8f, Speed = 1.6f, Hp = 0.3f, Damage = 0.4f, WallMult = 1f, Scale = 0.55f, Reward = 1, Gear = null, FirstWave = 999 }, EnemyKind.Warden => Boss(650f, 18f, 120), EnemyKind.Urchin => Boss(750f, 22f, 160), EnemyKind.Angler => Boss(900f, 10f, 200), EnemyKind.Steed => Boss(950f, 4.2f, 240), EnemyKind.Stonefish => Boss(1000f, 9f, 280), EnemyKind.Skyfish => Boss(1050f, 11f, 320), EnemyKind.Kraken => Boss(1150f, 14f, 360), EnemyKind.Voxel => Boss(1200f, 10f, 420), EnemyKind.Koi => Boss(1300f, 12f, 500), EnemyKind.Eye => Boss(1600f, 95f, 1000), EnemyKind.Squadron => new EnemyStats { BaseHp = 14f, Speed = 1f, Hp = 0.5f, Damage = 1f, WallMult = 1f, Scale = 3f, Reward = 3, Gear = null, FirstWave = 999 }, EnemyKind.Glitch => new EnemyStats { BaseHp = 40f, Speed = 1f, Hp = 1f, Damage = 1f, WallMult = 1f, Scale = 6f, Reward = 4, Gear = null, FirstWave = 999 }, _ => new EnemyStats { BaseHp = 30f, Speed = 1f, Hp = 1f, Damage = 1f, WallMult = 1f, Scale = 1f, Reward = 3, Gear = null, FirstWave = 1 }, }; } private static EnemyStats Boss(float baseHp, float scale, int reward) { return new EnemyStats { BaseHp = baseHp, Speed = 1f, Hp = 40f, Damage = 1f, WallMult = 2f, Scale = scale, Reward = reward, Gear = null, FirstWave = 999 }; } public static bool IsBoss(EnemyKind k) { if ((int)k >= 11) { return (int)k <= 20; } return false; } public static bool IsPuppet(EnemyKind k) { return (int)k >= 11; } public static Body BodyOf(EnemyKind k) { switch (k) { default: return Body.Land; case EnemyKind.Angler: case EnemyKind.Skyfish: case EnemyKind.Voxel: case EnemyKind.Koi: case EnemyKind.Eye: case EnemyKind.Squadron: case EnemyKind.Glitch: return Body.Sky; case EnemyKind.Kraken: return Body.Sea; } } public static EnemyKind BossFor(int wave) { return BossOrder[(Mathf.Max(1, wave / 10) - 1) % BossOrder.Length]; } } public class Enemies : MonoBehaviour { public static Enemies Instance; private readonly Dictionary _tags = new Dictionary(); private readonly List<(EnemyTag tag, float until)> _pending = new List<(EnemyTag, float)>(); private readonly HashSet _dressed = new HashSet(); private NetworkManager _registeredOn; private readonly List _markers = new List(); private readonly List<(RectTransform root, TextMeshProUGUI name, Hud.Bar bar)> _plates = new List<(RectTransform, TextMeshProUGUI, Hud.Bar)>(); private readonly Dictionary _seenMax = new Dictionary(); private readonly Dictionary _tops = new Dictionary(); private float _nextPrune; private readonly Dictionary _clientTags = new Dictionary(); private static readonly Dictionary<(Texture, EnemyKind, bool), Texture> Tinted; private static Material _blit; private static readonly Color EliteDye; public IEnumerable> ServerAll => _tags.Where((KeyValuePair kv) => Object.op_Implicit((Object)(object)kv.Key) && kv.Key._hp.Value > 0); static Enemies() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Tinted = new Dictionary<(Texture, EnemyKind, bool), Texture>(); EliteDye = new Color(1f, 0.85f, 0.42f); GenericWriter.SetWrite((Action)delegate(Writer w, EnemyTag v) { w.WriteInt32(v.ObjectId); w.WriteByte((byte)v.Kind); w.WriteBoolean(v.Elite); }); GenericReader.SetRead((Func)((Reader r) => new EnemyTag { ObjectId = r.ReadInt32(), Kind = (EnemyKind)r.ReadByte(), Elite = r.ReadBoolean() })); } private void Awake() { Instance = this; } public bool TryGet(Creature c, out EnemyTag tag) { return _tags.TryGetValue(c, out tag); } public bool ClientIsFortress(int objectId) { return _clientTags.ContainsKey(objectId); } public EnemyTag? ClientTagOf(int objectId) { if (!_clientTags.TryGetValue(objectId, out var value)) { return null; } return value; } public Transform ClientFind(EnemyKind kind) { ClientManager clientManager = InstanceFinder.ClientManager; if ((Object)(object)clientManager == (Object)null) { return null; } foreach (KeyValuePair clientTag in _clientTags) { if (clientTag.Value.Kind == kind && ((ManagedObjects)clientManager.Objects).Spawned.TryGetValue(clientTag.Key, out var value) && Object.op_Implicit((Object)(object)value)) { Creature component = ((Component)value).GetComponent(); if (component == null || !component.IsDead) { return ((Component)value).transform; } } } return null; } public static EnemyStats StatsOf(EnemyTag t) { EnemyStats result = EnemyCatalog.Of(t.Kind); if (t.Elite) { result.BaseHp *= 3f; result.Hp *= 3f; result.Damage *= 1.5f; result.Scale *= 1.3f; result.Reward *= 3; } return result; } public void ServerTag(Creature c, EnemyKind kind, bool elite) { EnemyTag enemyTag = new EnemyTag { ObjectId = ((NetworkBehaviour)c).ObjectId, Kind = kind, Elite = elite }; _tags[c] = enemyTag; InstanceFinder.ServerManager.Broadcast(enemyTag, true, (Channel)0); } public void ServerForget(Creature c) { _tags.Remove(c); } public void ServerClear() { _tags.Clear(); } public IEnumerable ClientEnemies() { ClientManager cm = InstanceFinder.ClientManager; if ((Object)(object)cm == (Object)null) { yield break; } foreach (int item in _dressed) { if (((ManagedObjects)cm.Objects).Spawned.TryGetValue(item, out var value) && Object.op_Implicit((Object)(object)value)) { Creature component = ((Component)value).GetComponent(); if (component != null && component.Hp > 0) { yield return ((Component)value).transform; } } } } public bool ClientCorpseNear(Vector3 pos, float r) { //IL_0065: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) ClientManager clientManager = InstanceFinder.ClientManager; if ((Object)(object)clientManager == (Object)null) { return false; } foreach (int item in _dressed) { if (!((ManagedObjects)clientManager.Objects).Spawned.TryGetValue(item, out var value) || !Object.op_Implicit((Object)(object)value)) { continue; } Creature component = ((Component)value).GetComponent(); if (component != null && component._hp.Value <= 0) { Vector3 val = ((Component)value).transform.position - pos; if (((Vector3)(ref val)).sqrMagnitude < r * r) { return true; } } } return false; } public IEnumerable ClientKindsNear(Vector3 pos, float r) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) ClientManager cm = InstanceFinder.ClientManager; if ((Object)(object)cm == (Object)null) { yield break; } foreach (int item in _dressed) { if (!_clientTags.TryGetValue(item, out var value) || !((ManagedObjects)cm.Objects).Spawned.TryGetValue(item, out var value2) || !Object.op_Implicit((Object)(object)value2)) { continue; } Creature component = ((Component)value2).GetComponent(); if (component != null && component._hp.Value > 0) { Vector3 val = ((Component)value2).transform.position - pos; if (((Vector3)(ref val)).sqrMagnitude < r * r) { yield return value.Kind; } } } } private void LateUpdate() { //IL_0037: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_01a9: 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_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0245: 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_0164: Unknown result type (might be due to invalid IL or missing references) int num = 0; Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera) && Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.ViewActive) { Vector3 position = ((Component)curCamera).transform.position; Vector2 val3 = default(Vector2); foreach (Transform item in ClientEnemies()) { if (num >= 12) { break; } Vector3 val = item.position + Vector3.up; float num2 = Vector3.Distance(val, position); if (num2 > 70f) { continue; } Vector3 val2 = curCamera.WorldToViewportPoint(val); if (!(val2.z > 0f) || !(val2.x > 0.02f) || !(val2.x < 0.98f) || !(val2.y > 0.02f) || !(val2.y < 0.98f)) { ((Vector2)(ref val3))..ctor(val2.x - 0.5f, val2.y - 0.5f); if (val2.z < 0f) { val3 = -val3; } if (((Vector2)(ref val3)).sqrMagnitude < 0.0001f) { val3 = Vector2.down; } val3 = ((Vector2)(ref val3)).normalized; if (num >= _markers.Count) { _markers.Add(Hud.CreateMarker("EnemyMarker", new Color(1f, 0.25f, 0.2f, 0.9f), 34f)); } Image val4 = _markers[num++]; ((Component)val4).gameObject.SetActive(true); float num3 = Mathf.Max(Mathf.Abs(val3.x) / 0.46f, Mathf.Abs(val3.y) / 0.44f); RectTransform rectTransform = ((Graphic)val4).rectTransform; Vector2 anchorMin = (((Graphic)val4).rectTransform.anchorMax = new Vector2(0.5f + val3.x / num3, 0.5f + val3.y / num3)); rectTransform.anchorMin = anchorMin; ((Graphic)val4).rectTransform.anchoredPosition = Vector2.zero; ((Transform)((Graphic)val4).rectTransform).localRotation = Quaternion.Euler(0f, 0f, Mathf.Atan2(val3.y, val3.x) * 57.29578f + 180f); ((Graphic)val4).color = new Color(1f, 0.25f, 0.2f, Mathf.Lerp(1f, 0.35f, num2 / 70f)); } } } for (int i = num; i < _markers.Count; i++) { if (Object.op_Implicit((Object)(object)_markers[i])) { ((Component)_markers[i]).gameObject.SetActive(false); } } DrawPlates(curCamera); } private static bool Named(EnemyTag t) { if (!t.Elite && !EnemyCatalog.IsBoss(t.Kind)) { if ((int)t.Kind >= 5) { return t.Kind != EnemyKind.Mini; } return false; } return true; } private void DrawPlates(Camera cam) { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037f: 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_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039a: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026f: 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_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) int num = 0; ClientManager clientManager = InstanceFinder.ClientManager; if (Object.op_Implicit((Object)(object)cam) && (Object)(object)clientManager != (Object)null && Object.op_Implicit((Object)(object)Hud.Font) && Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.ViewActive) { foreach (int item3 in _dressed) { if (num >= 24) { break; } if (!((ManagedObjects)clientManager.Objects).Spawned.TryGetValue(item3, out var value) || !Object.op_Implicit((Object)(object)value)) { continue; } Creature component = ((Component)value).GetComponent(); if (component == null || !_clientTags.TryGetValue(item3, out var value2)) { continue; } int value3 = component._hp.Value; if (value3 <= 0) { continue; } int value4; int num2 = (_seenMax.TryGetValue(item3, out value4) ? Mathf.Max(value4, value3) : value3); _seenMax[item3] = num2; bool flag = Named(value2); bool flag2 = value3 < num2; float num3 = Vector3.Distance(((Component)cam).transform.position, ((Component)value).transform.position); if ((!flag || !(num3 < 35f)) && (!flag2 || !(num3 < 22f))) { continue; } if (!_tops.TryGetValue(item3, out (float, float) value5) || Time.time >= value5.Item2) { Renderer[] array = (from r in ((Component)value).GetComponentsInChildren() where !r.forceRenderingOff && !Object.op_Implicit((Object)(object)((Component)r).GetComponentInParent()) select r).ToArray(); value5 = ((array.Length != 0) ? (array.Max(delegate(Renderer r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = r.bounds; return ((Bounds)(ref bounds)).max.y; }) - ((Component)value).transform.position.y) : 1f, Time.time + 1f); _tops[item3] = value5; } Vector3 val = cam.WorldToScreenPoint(((Component)value).transform.position + Vector3.up * (value5.Item1 + 0.35f)); if (!(val.z < 0f)) { if (num >= _plates.Count) { RectTransform val2 = Hud.Node(Hud.Root, "Plate", Vector2.zero, Vector2.zero, new Vector2(160f, 40f), (Vector2?)new Vector2(0.5f, 0f)); TextMeshProUGUI item = Hud.Label((Transform)(object)val2, "", 18f, new Vector2(0.5f, 0f), new Vector2(0f, 12f), new Vector2(240f, 26f), (TextAlignmentOptions)1026, null, bold: true, outline: true); Hud.Bar item2 = Hud.Bar.Make((Transform)(object)val2, new Vector2(0.5f, 0f), Vector2.zero, new Vector2(74f, 9f), Hud.Bad); _plates.Add((val2, item, item2)); } var (val3, val4, bar) = _plates[num++]; ((Component)val3).gameObject.SetActive(true); Vector2 anchorMin = (val3.anchorMax = new Vector2(val.x / (float)Screen.width, val.y / (float)Screen.height)); val3.anchorMin = anchorMin; val3.anchoredPosition = Vector2.zero; float num4 = Mathf.Clamp(14f / Mathf.Max(1f, num3), 0.65f, 1.15f) * (EnemyCatalog.IsBoss(value2.Kind) ? 1.4f : 1f); ((Transform)val3).localScale = Vector3.one * num4; ((Component)val4).gameObject.SetActive(flag); if (flag) { ((TMP_Text)val4).text = (value2.Elite ? "★ " : "") + L10n.T("enemy" + value2.Kind); ((Graphic)val4).color = ((value2.Elite || EnemyCatalog.IsBoss(value2.Kind)) ? Hud.Gold : Color.Lerp(Color.white, DyeOf(value2.Kind), 0.8f)); } bar.Set((float)value3 / (float)Mathf.Max(1, num2), Hud.Bad); } } } for (int num5 = num; num5 < _plates.Count; num5++) { if (Object.op_Implicit((Object)(object)_plates[num5].root)) { ((Component)_plates[num5].root).gameObject.SetActive(false); } } } private void Update() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ClientManager.RegisterBroadcast((Action)delegate(EnemyTag t, Channel ch) { _pending.Add((t, Time.time + 5f)); }); networkManager.SceneManager.OnClientLoadedStartScenes += delegate(NetworkConnection conn, bool asServer) { if (!asServer) { return; } foreach (KeyValuePair tag2 in _tags) { if (Object.op_Implicit((Object)(object)tag2.Key)) { InstanceFinder.ServerManager.Broadcast(conn, tag2.Value, true, (Channel)0); } } }; } for (int num = _pending.Count - 1; num >= 0; num--) { var (tag, num2) = _pending[num]; if (TryDress(tag) || Time.time > num2) { _pending.RemoveAt(num); } } ClientManager cm = InstanceFinder.ClientManager; if (!((Object)(object)cm != (Object)null) || !(Time.time >= _nextPrune)) { return; } _nextPrune = Time.time + 5f; _dressed.RemoveWhere((int id) => !((ManagedObjects)cm.Objects).Spawned.ContainsKey(id)); foreach (int item in _clientTags.Keys.Where((int id) => !_dressed.Contains(id)).ToList()) { _clientTags.Remove(item); _seenMax.Remove(item); _tops.Remove(item); } } private bool TryDress(EnemyTag tag) { //IL_0071: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: 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_0207: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0289: 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_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) if (_dressed.Contains(tag.ObjectId)) { return true; } ClientManager clientManager = InstanceFinder.ClientManager; if ((Object)(object)clientManager == (Object)null || !((ManagedObjects)clientManager.Objects).Spawned.TryGetValue(tag.ObjectId, out var value) || !Object.op_Implicit((Object)(object)value)) { return false; } EnemyStats enemyStats = StatsOf(tag); Transform transform = ((Component)value).transform; transform.localScale = (EnemyCatalog.IsPuppet(tag.Kind) ? Vector3.one : ShapeOf(tag.Kind)) * enemyStats.Scale; if (EnemyCatalog.IsPuppet(tag.Kind)) { _clientTags[tag.ObjectId] = tag; Creature component = ((Component)value).GetComponent(); if (component != null) { Bosses.Puppets.Add(component); } BossLooks.Dress(transform, tag.Kind); _dressed.Add(tag.ObjectId); AutoTest.Count("dressed_" + tag.Kind); return true; } _clientTags[tag.ObjectId] = tag; if (!FoeBodies.Dress(transform, tag.Kind, tag.Elite, enemyStats.Gear)) { Renderer[] array = (from r in ((Component)transform).GetComponentsInChildren() where r.enabled select r).ToArray(); Bounds val = (Bounds)((array.Length != 0) ? array[0].bounds : new Bounds(transform.position, Vector3.one)); Renderer[] array2 = array; foreach (Renderer val2 in array2) { ((Bounds)(ref val)).Encapsulate(val2.bounds); } float num2 = Mathf.Max(0.3f, Mathf.Min(((Bounds)(ref val)).size.x, ((Bounds)(ref val)).size.z)); Vector3 val3 = transform.InverseTransformPoint(new Vector3(((Bounds)(ref val)).center.x, ((Bounds)(ref val)).max.y, ((Bounds)(ref val)).center.z)); Tint(transform, tag.Kind, tag.Elite); if (enemyStats.Gear != null) { Wear(transform, enemyStats.Gear, val3 - Vector3.up * (enemyStats.Gear.EndsWith("Shell") ? (0.35f * ((Bounds)(ref val)).size.y / enemyStats.Scale) : 0.05f), num2 / enemyStats.Scale); } if (tag.Elite) { Wear(transform, "Crown", val3, num2 * 0.7f / enemyStats.Scale); } } _dressed.Add(tag.ObjectId); AutoTest.Count("dressed_" + tag.Kind); return true; } public static Vector3 ShapeOf(EnemyKind k) { //IL_0040: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00d3: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(k switch { EnemyKind.Charger => new Vector3(0.85f, 0.8f, 1.35f), EnemyKind.Tank => new Vector3(1.3f, 1.05f, 1.1f), EnemyKind.Thief => new Vector3(0.75f, 1.1f, 0.95f), EnemyKind.Shield => new Vector3(1.25f, 1f, 0.95f), EnemyKind.Digger => new Vector3(1.15f, 0.75f, 1.15f), EnemyKind.Healer => new Vector3(0.85f, 1.3f, 0.85f), EnemyKind.Bomber => new Vector3(1.15f, 1.1f, 1f), EnemyKind.Splitter => new Vector3(1.15f, 0.9f, 1.15f), _ => Vector3.one, }); } public static Color DyeOf(EnemyKind k) { //IL_0044: 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) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00d7: Unknown result type (might be due to invalid IL or missing references) switch (k) { case EnemyKind.Charger: return new Color(1f, 0.5f, 0.44f); case EnemyKind.Bomber: return new Color(0.55f, 0.55f, 0.66f); case EnemyKind.Tank: return new Color(0.88f, 0.76f, 0.52f); case EnemyKind.Thief: return new Color(0.74f, 0.52f, 1f); case EnemyKind.Shield: return new Color(0.55f, 0.74f, 1f); case EnemyKind.Digger: return new Color(0.96f, 0.68f, 0.38f); case EnemyKind.Healer: return new Color(0.5f, 1f, 0.58f); case EnemyKind.Splitter: case EnemyKind.Mini: return new Color(0.78f, 1f, 0.34f); default: return Color.white; } } private static void Tint(Transform root, EnemyKind kind, bool elite) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) Color val = DyeOf(kind) * (elite ? EliteDye : Color.white); val.a = 1f; if (val == Color.white) { return; } if (!Object.op_Implicit((Object)(object)_blit)) { Shader val2 = Shader.Find("UI/Default"); if (!Object.op_Implicit((Object)(object)val2)) { return; } _blit = new Material(val2); } Models.OwnMaterials ownMaterials = ((Component)root).gameObject.AddComponent(); Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(); foreach (Renderer val3 in componentsInChildren) { Material[] materials = val3.materials; ownMaterials.Mats.AddRange(materials); Material[] array = materials; foreach (Material val4 in array) { string[] array2 = new string[3] { "_Colors", "_BaseMap", "_MainTex" }; foreach (string text in array2) { if (!val4.HasProperty(text)) { continue; } Texture texture = val4.GetTexture(text); if (texture != null) { if (!Tinted.TryGetValue((texture, kind, elite), out var value)) { RenderTexture val5 = new RenderTexture(texture.width, texture.height, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)2) { filterMode = texture.filterMode, wrapMode = texture.wrapMode }; _blit.color = val; Graphics.Blit(texture, val5, _blit); value = (Tinted[(texture, kind, elite)] = (Texture)(object)val5); } val4.SetTexture(text, value); break; } } } val3.materials = materials; } } internal static void Wear(Transform root, string model, Vector3 localPos, float size) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(model + "Gear"); val.transform.SetParent(root, false); val.transform.localPosition = localPos; val.transform.localScale = Vector3.one * size; Models.Attach(model, val.transform, Vector3.one * 0.5f).layer = ((Component)root).gameObject.layer; } } public static class FoeBodies { private static readonly Color Gilt = new Color(0.98f, 0.8f, 0.32f); private static readonly Dictionary Verts = new Dictionary(); public static string ModelOf(EnemyKind k) { return "Foe" + ((k == EnemyKind.Mini) ? EnemyKind.Splitter : k); } private static (float along, float down, float size) Anchor(string gear) { switch (gear) { default: return (along: 0f, down: 0.03f, size: 1f); case "HealerStaff": return (along: 0.3f, down: 0.02f, size: 1.5f); case "Shell": return (along: 0f, down: 0.12f, size: 1f); case "ThiefSack": return (along: -0.12f, down: 0.02f, size: 1f); case "ShieldBoard": return (along: 0.33f, down: 0f, size: 1f); case "Helmet": case "MinerHat": return (along: 0.27f, down: 0.04f, size: 1f); } } public static bool Dress(Transform root, EnemyKind kind, bool elite, string gear) { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00d9: 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) //IL_00e2: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: 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_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: 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_01f5: Unknown result type (might be due to invalid IL or missing references) string text = ModelOf(kind); if (!File.Exists(Path.Combine(Models.Dir ?? "", text + ".obj"))) { return false; } MeshFilter val = null; List list = new List(); MeshFilter[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (MeshFilter val2 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val2.sharedMesh) && ((Object)val2.sharedMesh).name.StartsWith("DripFish")) { if (!Object.op_Implicit((Object)(object)val) || ((Object)val2.sharedMesh).name == "DripFish") { val = val2; } Renderer component = ((Component)val2).GetComponent(); if (component != null) { list.Add(component); } } } if (!Object.op_Implicit((Object)(object)val)) { return false; } Transform transform = ((Component)val).transform; Vector3 val3 = Snap(transform.InverseTransformDirection(root.forward)); Vector3 val4 = Snap(transform.InverseTransformDirection(root.up)); GameObject val5 = Models.Attach(text, transform, Vector3.one * 0.5f); Mesh sharedMesh = val5.GetComponent().sharedMesh; var (localScale, localPosition) = Fit(val3, val4, val.sharedMesh.bounds, sharedMesh.bounds, Enemies.ShapeOf(kind)); val5.transform.localRotation = Quaternion.LookRotation(val3, val4); val5.transform.localScale = localScale; val5.transform.localPosition = localPosition; foreach (Renderer item in list) { item.forceRenderingOff = true; } Renderer component2 = val5.GetComponent(); if (elite) { Color[] array = Models.ColorsOf(component2); for (int j = 0; j < array.Length; j++) { if (((Color)(ref array[j])).maxColorComponent > 0.1f) { Models.Recolor(component2, j, Color.Lerp(array[j], Gilt, 0.45f)); } } } Bounds bounds = sharedMesh.bounds; float num = Mathf.Max(((Bounds)(ref bounds)).size.x, 0.3f * ((Bounds)(ref bounds)).size.z); float num2 = 0f; if (gear != null) { var (along, num3, num4) = Anchor(gear); Enemies.Wear(val5.transform, gear, TopAt(sharedMesh, along) - Vector3.up * num3 * ((Bounds)(ref bounds)).size.y, num * num4); if (gear == "Helmet" || gear == "MinerHat") { num2 = ((gear == "Helmet") ? 0.4f : 0.55f) * num; } } if (elite) { Enemies.Wear(val5.transform, "Crown", TopAt(sharedMesh, 0.27f) + Vector3.up * num2, num * 0.7f); } return true; } public static (Vector3 scale, Vector3 pos) Fit(Vector3 fwd, Vector3 up, Bounds game, Bounds ours, Vector3 shape) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_000f: 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_0037: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0094: 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_009c: 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_00a6: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(up, fwd); float num = Mathf.Abs(Vector3.Dot(((Bounds)(ref game)).size, fwd)); float num2 = num / Mathf.Max(0.01f, ((Bounds)(ref ours)).size.z); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(num2 * shape.z / shape.x, num2 * shape.z / shape.y, num2); Vector3 val3 = Vector3.Scale(((Bounds)(ref ours)).center, val2); return (scale: val2, pos: ((Bounds)(ref game)).center - (val * val3.x + up * val3.y + fwd * val3.z) + up * (0.03f * num)); } public static Vector3 Snap(Vector3 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_007b: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs(v.x); float num2 = Mathf.Abs(v.y); float num3 = Mathf.Abs(v.z); if (!(num >= num2) || !(num >= num3)) { if (!(num2 >= num3)) { return new Vector3(0f, 0f, Mathf.Sign(v.z)); } return new Vector3(0f, Mathf.Sign(v.y), 0f); } return new Vector3(Mathf.Sign(v.x), 0f, 0f); } private static Vector3 TopAt(Mesh m, float along) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_00a4: Unknown result type (might be due to invalid IL or missing references) if (!Verts.TryGetValue(m, out var value)) { value = (Verts[m] = m.vertices); } Bounds bounds = m.bounds; float num = ((Bounds)(ref bounds)).center.z + along * ((Bounds)(ref bounds)).size.z; float y = ((Bounds)(ref bounds)).center.y; Vector3[] array = value; foreach (Vector3 val in array) { if (Mathf.Abs(val.z - num) < 0.06f * ((Bounds)(ref bounds)).size.z && Mathf.Abs(val.x) > 0.02f && val.y > y) { y = val.y; } } return new Vector3(0f, y, num); } } public enum IslandUnlock { AfterFinalBoss, Always } public struct GateRequest : IBroadcast { public byte Pull; } public struct RoundResult : IBroadcast { public int Waves; public int Kills; public int Built; public int Best; public bool NewRecord; public bool CoreLost; public bool Victory; public string Table; } public class FortressIsland : MonoBehaviour { [HarmonyPatch(typeof(RadarUI), "UpdateIslandDots")] internal static class RadarDotPatch { private static void Postfix(RadarUI __instance, MapDot[] ____islandDots) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null || !Instance.Exists || ____islandDots == null || ____islandDots.Length == 0) { return; } if (_dot == null || !Object.op_Implicit((Object)(Image)AccessTools.Field(typeof(MapDot), "_dot").GetValue(_dot))) { Image val = (Image)AccessTools.Field(typeof(MapDot), "_dot").GetValue(____islandDots[0]); if (!Object.op_Implicit((Object)(object)val)) { return; } Image component = Object.Instantiate(((Component)val).gameObject, ((Component)val).transform.parent).GetComponent(); ((Graphic)component).color = new Color(1f, 0.55f, 0.1f, 0f); _dot = new MapDot(); AccessTools.Field(typeof(MapDot), "_dot").SetValue(_dot, component); } UpdateDot.Invoke(__instance, new object[2] { _dot, Instance.Center }); } } public static FortressIsland Instance; public static ConfigEntry Unlock; public static bool ForceForTest; public static readonly Vector3 CoreLocal; public static readonly Vector3 ReadyLocal; public static readonly Vector3 DockLocal; public static readonly Vector3 RespawnLocal; public static readonly Vector3 VaultLocal; public const float VaultYaw = 90f; public static readonly Vector3 MarketLocal; public const float MarketYaw = -90f; public static readonly Vector3 SmithyLocal; public const float SmithyYaw = -90f; public static readonly Vector3 KeeperLocal; public static readonly Vector3 BoardLocal; public const float BoardYaw = 35f; public const float BuildRadius = 27f; public const float IslandRadius = 36f; public static readonly float[] GapAngles; private const float ReadySeconds = 5f; private const float Offshore = 230f; public const float StandHeight = 1.1f; public static readonly Vector3 BerthLocal; public static readonly string[] NotSolid; public readonly List Keepers = new List(); private Vector3 _lighthouseLocal; private float _sink; private GameObject _root; private Vector3 _anchor = new Vector3(float.NaN, 0f, 0f); private NetworkManager _registeredOn; private bool _wasUnlocked; private GameObject _results; private float _resultsUntil; private bool _wasUnlockedKnown; private bool _welcomed; private RoundResult? _pendingResult; private float _nextRescue; private float _startAt = -1f; private const float ResultsSeconds = 15f; private static MapDot _dot; private static readonly MethodInfo UpdateDot; public bool Exists => Object.op_Implicit((Object)(object)_root); public Vector3 Center { get; private set; } public Vector3 CorePos => Center + CoreLocal; public Vector3 DockPos => Center + DockLocal; public Vector3 RespawnPos { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Vector3 at; return (Loot.Ground(Center + RespawnLocal + Vector3.up * 6f, 12f, out at) ? at : (Center + RespawnLocal + Vector3.up * 1.2f)) + Vector3.up * 1.1f; } } public Vector3 BerthPos { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Center + BerthLocal; val.y = WaterManager.GetWaterHeight(val); return val; } } public Vector3 CounterPos { get; private set; } public Vector3 VaultPos { get; private set; } public Vector3 VaultDoor => VaultPos + Quaternion.Euler(0f, 90f, 0f) * new Vector3(0f, 0f, 2.6f); public Vector3 MarketPos { get; private set; } public Vector3 SmithyPos { get; private set; } public Vector3 SmithyCounter => SmithyPos + Quaternion.Euler(0f, -90f, 0f) * new Vector3(0f, 1.2f, 2.1f); public Transform Rack { get; private set; } public IslandDecor Decor { get; private set; } public Vector3 LighthousePos => (Object.op_Implicit((Object)(object)_root) ? _root.transform.position : Center) + _lighthouseLocal; public float Sink { get { return _sink; } set { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) _sink = value; if (Object.op_Implicit((Object)(object)_root)) { _root.transform.position = Center + Vector3.down * value; } } } public bool ResultsShowing { get { if (Object.op_Implicit((Object)(object)_results)) { return _results.activeSelf; } return false; } } public static bool HostUnlocked { get { if (!ForceForTest && Unlock.Value != IslandUnlock.Always) { if (Object.op_Implicit((Object)(object)NPCManager.Instance)) { return NPCManager.Instance.FinalBossKilled; } return false; } return true; } } public static bool Unlocked { get { if (!InstanceFinder.IsServerStarted) { if (Object.op_Implicit((Object)(object)Siege.Instance)) { return Siege.Instance.View.IslandOpen; } return false; } return HostUnlocked; } } public bool Starting => _startAt > 0f; public void ServerMoveBoatToBerth() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) BoatManager.Instance.TryMoveBoat(BerthPos, Quaternion.identity); } public bool InPool(Vector3 p) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Decor)) { return Decor.InPool(p); } return false; } static FortressIsland() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00c3: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) CoreLocal = new Vector3(0f, 1.45f, 0f); ReadyLocal = new Vector3(0f, 1.46f, -4.5f); DockLocal = new Vector3(0f, 0.6f, -36f); RespawnLocal = new Vector3(0.5f, 0f, -18.5f); VaultLocal = new Vector3(-8f, 0f, -17f); MarketLocal = new Vector3(5.5f, 0f, -16.8f); SmithyLocal = new Vector3(6.2f, 0f, -10.8f); KeeperLocal = new Vector3(-2.6f, 0f, -3.4f); BoardLocal = new Vector3(3.6f, 0f, -6.2f); GapAngles = new float[3] { 90f, 210f, 330f }; BerthLocal = new Vector3(4f, 0f, -42f); NotSolid = new string[2] { "White", "IslBuoyRed" }; UpdateDot = AccessTools.Method(typeof(RadarUI), "UpdateDot", (Type[])null, (Type[])null); GenericWriter.SetWrite((Action)delegate(Writer w, RoundResult v) { w.WriteInt32(v.Waves); w.WriteInt32(v.Kills); w.WriteInt32(v.Built); w.WriteInt32(v.Best); w.WriteBoolean(v.NewRecord); w.WriteBoolean(v.CoreLost); w.WriteBoolean(v.Victory); w.WriteString(v.Table ?? ""); }); GenericWriter.SetWrite((Action)delegate(Writer w, GateRequest v) { w.WriteByte(v.Pull); }); GenericReader.SetRead((Func)((Reader r) => new GateRequest { Pull = r.ReadByte() })); GenericReader.SetRead((Func)((Reader r) => new RoundResult { Waves = r.ReadInt32(), Kills = r.ReadInt32(), Built = r.ReadInt32(), Best = r.ReadInt32(), NewRecord = r.ReadBoolean(), CoreLost = r.ReadBoolean(), Victory = r.ReadBoolean(), Table = r.ReadString() })); } private void Awake() { Instance = this; } public bool OnIsland(Vector3 p, float radius = 36f) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!Exists) { return false; } Vector3 val = p - Center; val.y = 0f; return ((Vector3)(ref val)).sqrMagnitude <= radius * radius; } private void Update() { //IL_0145: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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) NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ClientManager.RegisterBroadcast((Action)delegate(RoundResult r, Channel ch) { _pendingResult = r; }); networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, GateRequest req, Channel ch) { Player who = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); if (req.Pull == 2) { Siege.Instance.ServerRepairCore(who); } else { ServerToggleStart(who); } }), true); networkManager.ClientManager.OnClientConnectionState += delegate(ClientConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { Despawn(); } }; } if (_pendingResult.HasValue && !Reveal.Playing) { ShowResults(_pendingResult.Value); _pendingResult = null; } bool flag = InstanceFinder.IsClientStarted && Object.op_Implicit((Object)(object)Player.LocalPlayer) && (Object.op_Implicit((Object)(object)Island.CurIsland) || Object.op_Implicit((Object)(object)_root)) && (InstanceFinder.IsServerStarted || (Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.HasView)); bool flag2 = flag && Unlocked; if (flag2 && !_wasUnlocked && _wasUnlockedKnown && Unlock.Value == IslandUnlock.AfterFinalBoss) { Reveal.Instance.Queue(); } _wasUnlocked = flag2; _wasUnlockedKnown = flag; if (!flag2) { Despawn(); return; } Vector3 val = MainIslandPos(); if (!Object.op_Implicit((Object)(object)Siege.Instance) || !Siege.Instance.ViewActive) { if (!float.IsNaN(_anchor.x)) { Vector3 val2 = val - _anchor; if (!(((Vector3)(ref val2)).sqrMagnitude > 1f)) { goto IL_01af; } } _anchor = val; Center = PickCenter(_anchor); Despawn(); } goto IL_01af; IL_01af: if (!Object.op_Implicit((Object)(object)_root)) { Spawn(); } RescueFromBelow(); if (!_welcomed && Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Player.LocalPlayer.Transform) && OnIsland(Player.LocalPlayer.Transform.position, 48f)) { _welcomed = true; Banner(L10n.T("islandWelcome"), 4f); } if (InstanceFinder.IsServerStarted) { ServerReadyCheck(); } } private void RescueFromBelow() { //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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.LocalPlayer; if (!Object.op_Implicit((Object)(object)_root) || !Object.op_Implicit((Object)(object)localPlayer) || !Object.op_Implicit((Object)(object)localPlayer.Transform) || !((Component)localPlayer.Transform).gameObject.activeInHierarchy || Time.time < _nextRescue) { return; } _nextRescue = Time.time + 0.5f; Vector3 p = localPlayer.Transform.position; if (!OnIsland(p, 27f) || Physics.Raycast(p + Vector3.up * 0.3f, Vector3.down, 8f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return; } List list = (from h in Physics.RaycastAll(new Vector3(p.x, Center.y + 40f, p.z), Vector3.down, 80f, LayerMask.op_Implicit(GameInfo.LevelLayer)) where ((RaycastHit)(ref h)).point.y > p.y + 0.3f select h).ToList(); if (list.Count != 0) { RaycastHit val = list.OrderBy((RaycastHit h) => ((RaycastHit)(ref h)).point.y).First(); Vector3 point = ((RaycastHit)(ref val)).point; localPlayer.LocalTeleport(point + Vector3.up * 1.1f, localPlayer.Transform.eulerAngles.y, true); BuildSystem.Log.LogInfo((object)$"Under the island at {p - Center:F1}: back up to {point - Center:F1}."); AutoTest.Count("rescued_from_below"); } } private static Vector3 MainIslandPos() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) try { return IslandManager.GetIslandInfo((int)OnlineIslandManager.CurIsland).IslandPosition; } catch { return Island.IslandPos; } } private static Vector3 PickCenter(Vector3 cur) { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; int num = 0; for (int i = 0; i < 16; i++) { IslandInfo val2 = null; try { val2 = IslandManager.GetIslandInfo(i); } catch { } if (val2 == null) { break; } try { val += val2.IslandPosition; num++; } catch { } } Vector3 val3 = ((num > 0) ? (cur - val / (float)num) : Vector3.forward); val3.y = 0f; if (((Vector3)(ref val3)).sqrMagnitude < 1f) { val3 = Vector3.forward; } Vector3 result = cur + ((Vector3)(ref val3)).normalized * 230f; result.y = 0f; return result; } private void Spawn() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_002c: 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_007f: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_0182: 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_0192: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030f: 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_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0373: 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_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06dc: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) _root = new GameObject("FortressIsland"); _root.layer = BuildSystem.PieceLayer; _root.transform.position = Center; _sink = 0f; Object.DontDestroyOnLoad((Object)(object)_root); GameObject obj = Models.Attach("FortressIsland", _root.transform, new Vector3(60f, 2f, 60f), new Vector3(0f, 0.2f, 0f)); MeshFilter component = obj.GetComponent(); MeshCollider val = obj.AddComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sharedMesh)) { val.sharedMesh = Models.ColliderOf("FortressIsland", NotSolid) ?? component.sharedMesh; } Decor = _root.AddComponent(); Decor.Load(Path.Combine(Models.Dir, "FortressIsland.decor.txt")); Vector3 pos; GameObject val2 = Station("MarketStall", MarketLocal, -90f, out pos); MarketPos = pos; Lamp(val2.transform, new Vector3(0f, 2.15f, 0.6f), new Color(1f, 0.9f, 0.75f), 4.5f, 0.9f, flicker: false); CounterPos = Ground(val2.transform.TransformPoint(new Vector3(0f, 0f, 1.6f))); GameObject val3 = new GameObject("StallCounter") { layer = BuildSystem.PieceLayer }; val3.transform.SetParent(val2.transform, false); val3.transform.localPosition = new Vector3(0f, 0.2f, 0.6f); BoxCollider obj2 = val3.AddComponent(); ((Collider)obj2).isTrigger = true; obj2.size = new Vector3(3f, 1.1f, 1f); obj2.center = new Vector3(0f, 1.3f, 0f); val3.AddComponent(); VaultPos = Ground(Center + VaultLocal); GameObject val4 = new GameObject("Vault"); val4.layer = BuildSystem.PieceLayer; val4.transform.SetParent(_root.transform, false); val4.transform.position = VaultPos; val4.transform.rotation = Quaternion.Euler(0f, 90f, 0f); GameObject val5 = Models.Attach("Vault", val4.transform, new Vector3(4f, 2.6f, 3.4f), new Vector3(0f, 1.3f, 0f)); MeshFilter component2 = val5.GetComponent(); if (component2 != null && Object.op_Implicit((Object)(object)component2.sharedMesh)) { val5.AddComponent().sharedMesh = component2.sharedMesh; } else { val5.AddComponent(); } GameObject val6 = new GameObject("VaultChute") { layer = BuildSystem.PieceLayer }; val6.transform.SetParent(val4.transform, false); val6.transform.localPosition = new Vector3(0f, 1f, 2.15f); BoxCollider obj3 = val6.AddComponent(); ((Collider)obj3).isTrigger = true; obj3.size = new Vector3(1.6f, 2f, 0.9f); val6.AddComponent(); Vector3 pos2; GameObject val7 = Station("Smithy", SmithyLocal, -90f, out pos2); SmithyPos = pos2; Lamp(val7.transform, new Vector3(0f, 2.3f, 0.2f), new Color(1f, 0.9f, 0.75f), 4.5f, 1.4f, flicker: false); Lamp(val7.transform, new Vector3(1.25f, 1.25f, -0.9f), new Color(1f, 0.5f, 0.15f), 3.5f, 2.2f, flicker: true); GameObject val8 = new GameObject("SmithyCounter") { layer = BuildSystem.PieceLayer }; val8.transform.SetParent(val7.transform, false); BoxCollider obj4 = val8.AddComponent(); ((Collider)obj4).isTrigger = true; obj4.size = new Vector3(2.2f, 1.4f, 1.5f); obj4.center = new Vector3(0f, 1f, 0.55f); val8.AddComponent(); Rack = new GameObject("WeaponRack").transform; Rack.SetParent(val7.transform, false); ((Component)Rack).gameObject.AddComponent(); Keepers.Clear(); Keeper(val2.transform, new Vector3(0f, 0.1f, -0.4f), -90f, "_kioskLady", "Market", delegate { StallMenu.Instance.Open(); }); Keeper(val7.transform, new Vector3(-0.4f, 0.12f, -0.55f), -90f, "_gunStoreClerc", "Smith", delegate { VaultUI.Instance.Open(VaultUI.Desk.Smith); }); Keeper(val4.transform, new Vector3(1.3f, 0.26f, -0.05f), 90f, "_military", "Vault", delegate { VaultUI.Instance.Open(); }); Vector3 val9 = Ground(Center + KeeperLocal); Keeper(_root.transform, _root.transform.InverseTransformPoint(val9), 200f, "_lighthouseKeeper", "Lighthouse", delegate { Tips.Instance.ToggleHelp(); }); GameObject val10 = new GameObject("RecordBoard") { layer = BuildSystem.PieceLayer }; val10.transform.SetParent(_root.transform, false); val10.transform.SetPositionAndRotation(Ground(Center + BoardLocal), Quaternion.Euler(0f, 35f, 0f)); val10.AddComponent(); RaycastHit val11 = default(RaycastHit); _lighthouseLocal = (Physics.Raycast(CorePos + Vector3.up * 2f, Vector3.down, ref val11, 6f, LayerMask.op_Implicit(GameInfo.LevelLayer)) ? ((RaycastHit)(ref val11)).point : CorePos) - Center; BuildSystem.Log.LogInfo((object)$"Fortress island at {Center} (off island at {_anchor})."); void Keeper(Transform at, Vector3 local, float yaw, string clothes, string role, Action talk) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) Keeper keeper = HtfFortress.Keepers.Make(at, at.TransformPoint(local), yaw, clothes, role, talk); if (Object.op_Implicit((Object)(object)keeper)) { Keepers.Add(keeper); } } } private static void Lamp(Transform station, Vector3 local, Color c, float range, float intensity, bool flicker) { //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_0032: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Lamp"); val.transform.SetParent(station, false); val.transform.localPosition = local; Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = c; obj.range = range; obj.intensity = intensity; obj.shadows = (LightShadows)0; if (flicker) { val.AddComponent(); } } private Vector3 Ground(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(p + Vector3.up * 20f, Vector3.down, ref val, 40f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return p; } return ((RaycastHit)(ref val)).point; } private GameObject Station(string model, Vector3 local, float yaw, out Vector3 pos) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) pos = Ground(Center + local); GameObject val = new GameObject(model); val.layer = BuildSystem.PieceLayer; val.transform.SetParent(_root.transform, false); val.transform.SetPositionAndRotation(pos, Quaternion.Euler(0f, yaw, 0f)); GameObject val2 = Models.Attach(model, val.transform, new Vector3(3f, 2.5f, 2.5f), new Vector3(0f, 1.25f, 0f)); MeshFilter component = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sharedMesh)) { val2.AddComponent().sharedMesh = component.sharedMesh; } else { val2.AddComponent(); } return val; } private void Despawn() { if (Object.op_Implicit((Object)(object)_root)) { Object.Destroy((Object)(object)_root); } _root = null; } public void ServerToggleStart(Player who) { //IL_0040: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) FortressPlugin instance = FortressPlugin.Instance; if (!Object.op_Implicit((Object)(object)who) || !Object.op_Implicit((Object)(object)who.Transform) || (Object)(object)instance == (Object)null || instance.Running || !Object.op_Implicit((Object)(object)_root)) { return; } Vector3 val = who.Transform.position - LighthousePos; if (!(((Vector3)(ref val)).sqrMagnitude > 49f)) { if (_startAt > 0f) { _startAt = -1f; Fx.Announce("gateCancelled"); AutoTest.Count("gate_cancelled"); } else { _startAt = Time.time + 5f; Fx.Announce("gatePulled", Mathf.RoundToInt(5f)); AutoTest.Count("gate_pulled"); } } } private void ServerReadyCheck() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) FortressPlugin instance = FortressPlugin.Instance; if ((Object)(object)instance == (Object)null || instance.Running || !Object.op_Implicit((Object)(object)_root) || _startAt < 0f) { _startAt = -1f; Siege.Instance.ServerReady(0, 0, 0); return; } float num = _startAt - Time.time; Siege.Instance.ServerReady(0, 0, Mathf.Max(1, Mathf.CeilToInt(num))); if (num <= 0f) { _startAt = -1f; instance.StartRound(CorePos); } } public bool WalkerSpawn(out Vector3 pos) { return WalkerSpawn(-1, out pos); } public bool WalkerSpawn(int gap, out Vector3 pos) { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); for (int i = 0; i < 10; i++) { float num = (GapAngles[(gap >= 0) ? (gap % GapAngles.Length) : Random.Range(0, GapAngles.Length)] + Random.Range(-6f, 6f)) * (MathF.PI / 180f); float num2 = Random.Range(23.5f, 26f); if (Physics.Raycast(Center + new Vector3(Mathf.Cos(num) * num2, 10f, Mathf.Sin(num) * num2), Vector3.down, ref val, 20f, LayerMask.op_Implicit(GameInfo.LevelLayer)) && ((RaycastHit)(ref val)).point.y > WaterManager.GetWaterHeight(((RaycastHit)(ref val)).point) + 0.2f) { pos = ((RaycastHit)(ref val)).point + Vector3.up * 0.8f; return true; } } pos = default(Vector3); return false; } public Vector3 SpitterSpot() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) float num = (GapAngles[Random.Range(0, GapAngles.Length)] + Random.Range(-25f, 25f)) * (MathF.PI / 180f); float num2 = Random.Range(27.5f, 29.5f); Vector3 val = Center + new Vector3(Mathf.Cos(num) * num2, 0f, Mathf.Sin(num) * num2); val.y = WaterManager.GetWaterHeight(val) - 0.35f; return val; } public Vector3 SeaSpawn() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, MathF.PI * 2f); float num2 = Random.Range(38f, 45f); Vector3 val = Center + new Vector3(Mathf.Cos(num) * num2, 0f, Mathf.Sin(num) * num2); val.y = WaterManager.GetWaterHeight(val) - 0.6f; return val; } public void Banner(string text, float seconds) { Hud.Banner(text, seconds); } private void ShowResults(RoundResult r) { //IL_00c1: 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_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) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: 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_0245: 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_0287: 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_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: 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_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_results)) { Object.Destroy((Object)(object)_results); } if (!Object.op_Implicit((Object)(object)Hud.Font)) { return; } Vector2 anchor = default(Vector2); ((Vector2)(ref anchor))..ctor(0.5f, 0.5f); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 1f); List list = (from x in Stats.Parse(r.Table) orderby x.Kills + x.TurretKills descending select x).ToList(); List<(string, string)> list2 = Mvps(list); float num = 358f + 40f * (float)list.Count + ((list2.Count > 0) ? 64f : 0f) + 66f; Image val2 = Hud.Box(Hud.Root, anchor, new Vector2(0f, 20f), new Vector2(1000f, num), Hud.PanelSolid, 26f); _results = ((Component)val2).gameObject; Transform transform = ((Component)val2).transform; float num2 = 0f; Image obj = Hud.Box(transform, val, new Vector2(0f, -10f), new Vector2(980f, 104f), r.Victory ? new Color(0.5f, 0.36f, 0.05f, 0.95f) : new Color(0.42f, 0.09f, 0.07f, 0.9f), 20f); Hud.Label(((Component)obj).transform, L10n.T(r.Victory ? "resultVictoryTitle" : (r.CoreLost ? "resultCoreTitle" : "resultWipeTitle")), 44f, anchor, new Vector2(0f, 10f), new Vector2(940f, 60f), (TextAlignmentOptions)514, null, bold: true); Hud.Label(((Component)obj).transform, r.NewRecord ? ("★ " + L10n.T("resultRecordShort") + " ★") : L10n.T("resultBest", r.Best), 22f, anchor, new Vector2(0f, -28f), new Vector2(940f, 30f), (TextAlignmentOptions)514, Hud.Muted, r.NewRecord); num2 -= 132f; (string, string)[] array = new(string, string)[3] { (r.Waves.ToString(), L10n.T("tileWaves")), (r.Kills.ToString(), L10n.T("tileKills")), (r.Built.ToString(), L10n.T("tileBuilt")) }; for (int num3 = 0; num3 < 3; num3++) { Image obj2 = Hud.Box(transform, val, new Vector2((float)(num3 - 1) * 316f, num2 - 6f), new Vector2(300f, 108f), Hud.Raised, 16f, "Ui", val); Hud.Label(((Component)obj2).transform, array[num3].Item1, 52f, val, new Vector2(0f, -6f), new Vector2(290f, 64f), (TextAlignmentOptions)514, (num3 == 0) ? Hud.Accent : Hud.Ink, bold: true); Hud.Label(((Component)obj2).transform, array[num3].Item2, 21f, new Vector2(0.5f, 0f), new Vector2(0f, 10f), new Vector2(290f, 30f), (TextAlignmentOptions)1026, Hud.Muted); } num2 -= 128f; int[] cols = new int[6] { 3, 36, 49, 66, 80, 91 }; Hud.Label(((Component)Hud.Box(transform, val, new Vector2(0f, num2), new Vector2(940f, 40f), Hud.Raised, 10f, "Ui", val)).transform, Line(L10n.T("tableHeader").Split(new string[1] { " " }, StringSplitOptions.None)), 19f, anchor, Vector2.zero, new Vector2(920f, 40f), (TextAlignmentOptions)513, Hud.Muted); num2 -= 46f; foreach (Stats.Row item in list) { string text = ((item.Name.Length > 16) ? (item.Name.Substring(0, 15) + "…") : item.Name); string text2 = Line(new string[6] { "" + text + "", item.Kills.ToString(), item.TurretKills.ToString(), item.Fished.ToString(), item.Built.ToString(), item.Downs.ToString() }); Vector2 anchor2 = val; Vector2 pos = new Vector2(0f, num2); Vector2 box = new Vector2(920f, 38f); Vector2? pivot = val; Hud.Label(transform, text2, 22f, anchor2, pos, box, (TextAlignmentOptions)513, null, bold: false, outline: false, pivot); num2 -= 40f; } num2 -= 12f; if (list2.Count > 0) { float num4 = 300f; float num5 = (float)(-(list2.Count - 1)) * (num4 + 12f) / 2f; for (int num6 = 0; num6 < list2.Count; num6++) { Hud.Label(((Component)Hud.Box(transform, val, new Vector2(num5 + (float)num6 * (num4 + 12f), num2), new Vector2(num4, 50f), new Color(0.35f, 0.26f, 0.06f, 0.75f), 25f, "Ui", val)).transform, "" + list2[num6].Item1 + " " + list2[num6].Item2, 20f, anchor, Vector2.zero, new Vector2(num4 - 16f, 50f), (TextAlignmentOptions)514); } num2 -= 64f; } Hud.Label(transform, Hud.Keys(L10n.T("resultAgain") + "\u3000·\u3000" + L10n.T("resultClose")), 22f, new Vector2(0.5f, 0f), new Vector2(0f, 22f), new Vector2(940f, 34f), (TextAlignmentOptions)514, Hud.Muted); _results.SetActive(false); _resultsUntil = Time.time + 15f; Hud.HideBanner(); Fx.Sound(r.NewRecord ? "CasinoWinEpic" : "Death", Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Transform.position : Center, 1f, (AudioDistance)3); string Line(IEnumerable cells) { return string.Concat(cells.Select((string c, int i) => $"{c}")); } } public void CloseResults() { _resultsUntil = 0f; } private static List<(string title, string who)> Mvps(List rows) { List<(string, string)> list = new List<(string, string)>(); if (rows.Count == 0 || (rows.Count < 2 && !AutoTest.Running)) { return list; } Stats.Row row = rows.OrderByDescending((Stats.Row x) => x.Kills).First(); Add("mvpKills", row, row.Kills); Stats.Row row2 = (from x in rows orderby x.TurretKills descending, x.Built descending select x).First(); Add("mvpBuilder", row2, row2.TurretKills); Stats.Row row3 = rows.OrderByDescending((Stats.Row x) => x.Fished).First(); Add("mvpFisher", row3, row3.Fished); Stats.Row row4 = (from x in rows orderby x.Downs, x.Kills descending select x).First(); if (row4.Downs == 0) { list.Add((L10n.T("mvpSurvivor"), row4.Name)); } return list; void Add(string key, Stats.Row best, int value) { if (best != null && value > 0) { list.Add((L10n.T(key), $"{best.Name} ({value})")); } } } private void LateUpdate() { bool flag = Object.op_Implicit((Object)(object)Player.LocalPlayer) && !PlayerManager.AlivePlayers.Contains(Player.LocalPlayer); if (flag && Time.time < _resultsUntil) { _resultsUntil = Time.time + 15f; } if (Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.ViewActive) { _resultsUntil = 0f; } if (Object.op_Implicit((Object)(object)_results)) { _results.SetActive(!flag && Time.time < _resultsUntil); } } } [HarmonyPatch] internal static class RespawnAtFortress { private static bool Near(Vector3 pos) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)FortressIsland.Instance != (Object)null && FortressIsland.Instance.Exists) { return FortressIsland.Instance.OnIsland(pos, 70f); } return false; } [HarmonyPostfix] [HarmonyPatch(typeof(SpawnManager), "GetPlayerSpawnPos")] private static void PlayerPos(Vector3 __0, ref Vector3 __result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Near(__0)) { __result = FortressIsland.Instance.RespawnPos; } } [HarmonyPostfix] [HarmonyPatch(typeof(SpawnManager), "GetPlayerSpawnRot")] private static void PlayerRot(Vector3 __0, ref float __result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (Near(__0)) { __result = 0f; } } [HarmonyPrefix] [HarmonyPatch(typeof(Server), "RpcLogic___RespawnPlayer___2210451296")] private static void WipeStart(Vector3 __1, out bool __state) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) __state = PlayerManager.AlivePlayers.Count == 0 && Near(__1); } [HarmonyPostfix] [HarmonyPatch(typeof(Server), "RpcLogic___RespawnPlayer___2210451296")] private static void WipeEnd(bool __state) { if (__state) { ((MonoBehaviour)FortressIsland.Instance).StartCoroutine(MoveBoatToBerth()); } } private static IEnumerator MoveBoatToBerth() { yield return (object)new WaitForSeconds(0.5f); FortressIsland.Instance.ServerMoveBoatToBerth(); } } [HarmonyPatch(typeof(Boat), "ApplyReturnForce")] internal static class BoatStaysAtFortress { public const float Reach = 66f; private static bool Prefix(Boat __instance) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)FortressIsland.Instance) && FortressIsland.Instance.Exists && Object.op_Implicit((Object)(object)__instance.HiddenPhysicsRig)) { return !FortressIsland.Instance.OnIsland(__instance.HiddenPhysicsRig.position, 66f); } return true; } } public struct NetState : IBroadcast { public int PlayerId; public int Count; public int Capacity; public int Value; } public struct NetRequest : IBroadcast { public bool Sell; public int Level; public bool Food; } public struct NetSwing : IBroadcast { public Vector3 Origin; public Vector3 Dir; } public class FortressNet : MonoBehaviour { public static FortressNet Instance; public static readonly int[] Capacity; public static readonly int[] UpgradeCost; private const float CounterRadius = 3f; private const float UseRadius = 4.5f; private const float CorpseLife = 150f; private readonly Dictionary _corpses = new Dictionary(); private readonly Dictionary _nets = new Dictionary(); private int _netLevel; private float _nextTick; private NetState _mine; private NetworkManager _registeredOn; public const float SwingReach = 3.2f; public const float SwingHalfAngle = 55f; public const int FoodCost = 25; public const float FoodGrace = 6f; private readonly HashSet _food = new HashSet(); private Image _panel; private TextMeshProUGUI _netTitle; private TextMeshProUGUI _netCount; private TextMeshProUGUI _netFull; private Hud.Bar _netBar; public bool ClientNetFull { get { if (_mine.Capacity > 0) { return _mine.Count >= _mine.Capacity; } return false; } } public int ClientNetLevel { get { VaultData vaultData = (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.ClientVault : null); int num = ((vaultData != null && Object.op_Implicit((Object)(object)Player.LocalPlayer)) ? Mathf.RoundToInt(vaultData.PersonalValue(Loot.KeyOf(Player.LocalPlayer), Gear.BigNet)) : 0); return Array.IndexOf(Capacity, _mine.Capacity - num); } } private int Cap => Capacity[Mathf.Clamp(_netLevel, 0, Capacity.Length - 1)]; public (int count, int capacity, int value) ClientNet => (count: _mine.Count, capacity: (_mine.Capacity > 0) ? _mine.Capacity : Capacity[0], value: _mine.Value); static FortressNet() { Capacity = new int[3] { 5, 10, 20 }; UpgradeCost = new int[2] { 60, 150 }; GenericWriter.SetWrite((Action)delegate(Writer w, NetState v) { w.WriteInt32(v.PlayerId); w.WriteInt32(v.Count); w.WriteInt32(v.Capacity); w.WriteInt32(v.Value); }); GenericReader.SetRead((Func)((Reader r) => new NetState { PlayerId = r.ReadInt32(), Count = r.ReadInt32(), Capacity = r.ReadInt32(), Value = r.ReadInt32() })); GenericWriter.SetWrite((Action)delegate(Writer w, NetRequest v) { w.WriteBoolean(v.Sell); w.WriteInt32(v.Level); w.WriteBoolean(v.Food); }); GenericReader.SetRead((Func)((Reader r) => new NetRequest { Sell = r.ReadBoolean(), Level = r.ReadInt32(), Food = r.ReadBoolean() })); GenericWriter.SetWrite((Action)delegate(Writer w, NetSwing v) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) w.WriteVector3(v.Origin); w.WriteVector3(v.Dir); }); GenericReader.SetRead((Func)((Reader r) => new NetSwing { Origin = r.ReadVector3(), Dir = r.ReadVector3() })); } private void Awake() { Instance = this; } private int CapOf(int playerId) { return Cap + Mathf.RoundToInt(Perks.Of(playerId, Gear.BigNet)); } public void ServerAddCorpse(Creature c, int value) { if (Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned) { _corpses[c] = (value, Time.time + 150f); } } public Creature ServerNearestCorpse(Vector3 pos, float within) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return _corpses.Keys.Where(delegate(Creature c) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned) { Vector3 val = ((Component)c).transform.position - pos; return ((Vector3)(ref val)).sqrMagnitude < within * within; } return false; }).OrderBy(delegate(Creature c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)c).transform.position - pos; return ((Vector3)(ref val)).sqrMagnitude; }).FirstOrDefault(); } public int ServerTakeCorpse(Creature c) { if (!Object.op_Implicit((Object)(object)c) || !_corpses.TryGetValue(c, out (int, float) value)) { return 0; } _corpses.Remove(c); if (((NetworkBehaviour)c).IsSpawned) { ((Item)c).DestroyItem((byte)0, byte.MaxValue); } return value.Item1; } public IEnumerable ServerCorpses() { return _corpses.Keys.Where((Creature c) => Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned); } public IEnumerable ServerCorpsePositions() { return from c in _corpses.Keys where Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned select ((Component)c).transform.position; } public int ServerCapOf(int playerId) { return CapOf(playerId); } public int ServerScoopAround(Player p, float radius) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)p) || !Object.op_Implicit((Object)(object)p.Transform)) { return 0; } Vector3 pos = p.Transform.position; _nets.TryGetValue(((NetworkBehaviour)p).ObjectId, out (int, int) value); int num = CapOf(((NetworkBehaviour)p).ObjectId); int num2 = 0; foreach (KeyValuePair item in _corpses.Where(delegate(KeyValuePair kv) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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) if (Object.op_Implicit((Object)(object)kv.Key)) { Vector3 val = ((Component)kv.Key).transform.position - pos; return ((Vector3)(ref val)).sqrMagnitude < radius * radius; } return false; }).OrderBy(delegate(KeyValuePair kv) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)kv.Key).transform.position - pos; return ((Vector3)(ref val)).sqrMagnitude; }).ToList()) { if (value.Item1 >= num) { break; } value.Item1++; value.Item2 += item.Value.Item1; num2++; if (Perks.Legend(p, Gear.FishGloves)) { Siege.Instance.ServerAddCoins(Siege.Money(1)); Stats.Fished(((NetworkBehaviour)p).ObjectId, Siege.Money(1)); } Fx.Send(FxKind.Scoop, ((Component)item.Key).transform.position, pos); ((Item)item.Key).DestroyItem((byte)0, byte.MaxValue); _corpses.Remove(item.Key); } _nets[((NetworkBehaviour)p).ObjectId] = value; Send(((NetworkBehaviour)p).ObjectId); return num2; } public int ServerNetCount(int playerId) { if (!_nets.TryGetValue(playerId, out (int, int) value)) { return 0; } return value.Item1; } public void ServerReset(bool keepSize = false) { foreach (Creature item in _corpses.Keys.Where((Creature c) => Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned).ToList()) { ((Item)item).DestroyItem((byte)0, byte.MaxValue); } _corpses.Clear(); _nets.Clear(); if (!keepSize) { _netLevel = 0; } foreach (Player player in PlayerManager.Players) { if (Object.op_Implicit((Object)(object)player)) { Send(((NetworkBehaviour)player).ObjectId); } } } private void Send(int playerId) { _nets.TryGetValue(playerId, out (int, int) value); InstanceFinder.ServerManager.Broadcast(new NetState { PlayerId = playerId, Count = value.Item1, Capacity = CapOf(playerId), Value = value.Item2 }, true, (Channel)0); } private void Update() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ClientManager.RegisterBroadcast((Action)delegate(NetState s, Channel ch) { if (Object.op_Implicit((Object)(object)Player.LocalPlayer) && s.PlayerId == ((NetworkBehaviour)Player.LocalPlayer).ObjectId) { _mine = s; } }); networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, NetRequest r, Channel ch) { Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); if (r.Food) { if (Object.op_Implicit((Object)(object)val)) { ServerBuyFood(val); } } else if (!r.Sell) { if (r.Level == _netLevel) { ServerUpgrade(); } } else if (Object.op_Implicit((Object)(object)val)) { ServerSell(val); } }), true); networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, NetSwing s, Channel ch) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); if (Object.op_Implicit((Object)(object)val)) { ServerSwing(val, s.Origin, s.Dir); } }), true); networkManager.ClientManager.OnClientConnectionState += delegate(ClientConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { _mine = default(NetState); } }; } if (InstanceFinder.IsServerStarted && Time.time >= _nextTick) { _nextTick = Time.time + 0.25f; ServerTick(); } ClientInput(); } private void ServerTick() { //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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019b: 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) FortressIsland instance = FortressIsland.Instance; if (!Object.op_Implicit((Object)(object)instance) || !instance.Exists) { return; } foreach (KeyValuePair item in _corpses.Where((KeyValuePair kv) => !Object.op_Implicit((Object)(object)kv.Key) || !((NetworkBehaviour)kv.Key).IsSpawned || Time.time > kv.Value.until).ToList()) { if (Object.op_Implicit((Object)(object)item.Key) && ((NetworkBehaviour)item.Key).IsSpawned) { ((Item)item.Key).DestroyItem((byte)0, byte.MaxValue); } _corpses.Remove(item.Key); } Vector3 counterPos = instance.CounterPos; foreach (Player alivePlayer in PlayerManager.AlivePlayers) { if (!Object.op_Implicit((Object)(object)alivePlayer) || !Object.op_Implicit((Object)(object)alivePlayer.Transform)) { continue; } Vector3 position = alivePlayer.Transform.position; (int, int) value; bool flag = !_nets.TryGetValue(((NetworkBehaviour)alivePlayer).ObjectId, out value); int num = CapOf(((NetworkBehaviour)alivePlayer).ObjectId); if (value.Item1 >= num && Perks.Legend(alivePlayer, Gear.BigNet)) { Vector3 val = position - counterPos; if (((Vector3)(ref val)).sqrMagnitude >= 9f) { int num2 = Mathf.RoundToInt((float)value.Item2 * 0.8f * (1f + Perks.Of(alivePlayer, Gear.FishGloves))); Siege.Instance.ServerAddCoins(num2); Stats.Fished(((NetworkBehaviour)alivePlayer).ObjectId, num2); Fx.Send(FxKind.Sell, position, position, 0, num2); AutoTest.Count("legend_autosell"); Perks.Proc(Gear.BigNet, position); value = default((int, int)); flag = true; } } _nets[((NetworkBehaviour)alivePlayer).ObjectId] = value; if (flag) { Send(((NetworkBehaviour)alivePlayer).ObjectId); } } } public void ServerSwing(Player p, Vector3 origin, Vector3 dir) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_007e: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00ca: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031c: 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_0330: 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_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_029e: 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_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (!Object.op_Implicit((Object)(object)p) || !Object.op_Implicit((Object)(object)p.Transform) || !Object.op_Implicit((Object)(object)instance) || !instance.Exists || !PlayerManager.AlivePlayers.Contains(p) || ((Vector3)(ref dir)).sqrMagnitude < 0.01f) { return; } Vector3 pos = p.Transform.position; if (!instance.OnIsland(pos, 42f)) { return; } Vector3 val = origin - pos; if (((Vector3)(ref val)).sqrMagnitude > 9f) { origin = pos + Vector3.up * 1.6f; } val = new Vector3(dir.x, 0f, dir.z); Vector3 flat = ((Vector3)(ref val)).normalized; _nets.TryGetValue(((NetworkBehaviour)p).ObjectId, out (int, int) value); if (Object.op_Implicit((Object)(object)instance) && value.Item1 > 0) { val = instance.CounterPos - pos; if (((Vector3)(ref val)).sqrMagnitude < 20.25f && Vector3.Angle(flat, new Vector3(instance.CounterPos.x - pos.x, 0f, instance.CounterPos.z - pos.z)) < 60f) { ServerSell(p); return; } } int num = CapOf(((NetworkBehaviour)p).ObjectId); foreach (Creature item2 in (from x in (from c in _corpses.Keys where Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned select (c: c, d: ((Component)c).transform.position - pos)).Where(delegate((Creature c, Vector3 d) x) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (((Vector3)(ref x.d)).sqrMagnitude < 10.240001f && Mathf.Abs(x.d.y) < 2.5f) { Vector2 val6 = new Vector2(x.d.x, x.d.z); if (!(((Vector2)(ref val6)).sqrMagnitude < 0.8f)) { return Vector3.Angle(flat, new Vector3(x.d.x, 0f, x.d.z)) < 55f; } return true; } return false; }) orderby ((Vector3)(ref x.d)).sqrMagnitude select x.c).ToList()) { if (value.Item1 >= num) { break; } int item = _corpses[item2].value; _corpses.Remove(item2); value.Item1++; value.Item2 += item; if (Perks.Legend(p, Gear.FishGloves)) { Siege.Instance.ServerAddCoins(Siege.Money(1)); Stats.Fished(((NetworkBehaviour)p).ObjectId, Siege.Money(1)); Perks.Proc(Gear.FishGloves, pos); } Fx.Send(FxKind.Scoop, ((Component)item2).transform.position, pos, ((NetworkBehaviour)item2).ObjectId, 0, ((NetworkBehaviour)p).ObjectId); ((MonoBehaviour)this).StartCoroutine(Remove((Item)(object)item2)); AutoTest.Count("net_scooped"); } HashSet hashSet = new HashSet(); Collider[] array = Physics.OverlapSphere(pos + flat * 1.6f + Vector3.up * 0.6f, 3.2f, -1, (QueryTriggerInteraction)1); foreach (Collider val2 in array) { if (value.Item1 >= num) { break; } Item val3 = ItemManager.Get(val2); if (!Object.op_Implicit((Object)(object)val3) || !hashSet.Add(val3) || Object.op_Implicit((Object)(object)val3.Holder) || val3.IsDestroying || ((NetworkBehaviour)val3).IsDeinitializing || Object.op_Implicit((Object)(object)val3.DeadPlayer)) { continue; } Creature creature = val3.Creature; if (!Object.op_Implicit((Object)(object)creature) || (int)creature.BossType != 0 || _corpses.ContainsKey(creature) || FortressPlugin.Alive.Contains(creature) || val3.TotalWorth <= 0) { continue; } Vector3 val4 = ((Component)val3).transform.position - pos; if (!(((Vector3)(ref val4)).sqrMagnitude > 10.240001f) && !(Mathf.Abs(val4.y) > 2.5f)) { Vector2 val5 = new Vector2(val4.x, val4.z); if (!(((Vector2)(ref val5)).sqrMagnitude > 0.8f) || !(Vector3.Angle(flat, new Vector3(val4.x, 0f, val4.z)) > 55f)) { value.Item1++; value.Item2 += val3.TotalWorth; Fx.Send(FxKind.Scoop, ((Component)val3).transform.position, pos, ((NetworkBehaviour)val3).ObjectId, 0, ((NetworkBehaviour)p).ObjectId); ((MonoBehaviour)this).StartCoroutine(Remove(val3)); AutoTest.Count("net_scooped_fish"); } } } _nets[((NetworkBehaviour)p).ObjectId] = value; Send(((NetworkBehaviour)p).ObjectId); } private static IEnumerator Remove(Item c) { yield return (object)new WaitForSeconds(0.15f); if (Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned) { c.DestroyItem((byte)0, byte.MaxValue); } } public void ServerSellThrown(Item item, Vector3 into) { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if (Swallow.IsGoing(item) || _food.Contains(item)) { return; } Creature val = (Creature)(object)((item is Creature) ? item : null); if (val != null && _corpses.TryGetValue(val, out (int, float) value)) { if (Siege.Instance.ServerActive) { _corpses.Remove(val); Siege.Instance.ServerAddCoins(value.Item1); if (Object.op_Implicit((Object)(object)item.LastHolder)) { Stats.Fished(((NetworkBehaviour)item.LastHolder).ObjectId, value.Item1); } Fx.Send(FxKind.Sell, ((Component)item).transform.position, ((Component)item).transform.position, 0, value.Item1); Swallow.Server((Item)(object)val, into, Gulp.Crate); AutoTest.Count("crate_sold_body"); } } else if (item.TotalWorth > 0) { MoneyManager.SellItem(item); Swallow.Server(item, into, Gulp.Crate); AutoTest.Count("crate_sold_item"); } } public void ServerSell(Player p) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //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) FortressIsland instance = FortressIsland.Instance; if (Object.op_Implicit((Object)(object)p) && Object.op_Implicit((Object)(object)p.Transform) && Object.op_Implicit((Object)(object)instance) && instance.Exists && _nets.TryGetValue(((NetworkBehaviour)p).ObjectId, out (int, int) value) && value.Item1 != 0) { Vector3 val = p.Transform.position - instance.CounterPos; if (!(((Vector3)(ref val)).sqrMagnitude > 20.25f)) { int num = Mathf.RoundToInt((float)value.Item2 * (1f + Perks.Of(p, Gear.FishGloves))); Siege.Instance.ServerPay(num); Stats.Fished(((NetworkBehaviour)p).ObjectId, num); Fx.Send(FxKind.Sell, instance.CounterPos, instance.CounterPos, 0, num); AutoTest.Count("net_sold", value.Item1); _nets[((NetworkBehaviour)p).ObjectId] = default((int, int)); Send(((NetworkBehaviour)p).ObjectId); } } } private void ServerBuyFood(Player who) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0099: 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_00da: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; Item spawnable = GameInfo.GetSpawnable("bass"); if (Object.op_Implicit((Object)(object)instance) && instance.Exists && Object.op_Implicit((Object)(object)spawnable) && Object.op_Implicit((Object)(object)who) && Object.op_Implicit((Object)(object)who.Transform) && PlayerManager.AlivePlayers.Contains(who) && Siege.Instance.ServerTrySpend(Siege.Money(25), always: true)) { Item val = Object.Instantiate(spawnable, who.Transform.position + Vector3.up * 1.2f, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), Server.Instance.DynamicObjectsHolder); if (Object.op_Implicit((Object)(object)val.Creature)) { val.Creature.ServerKillOnSpawn(); } ((NetworkBehaviour)Server.Instance).Spawn(((Component)val).gameObject, (NetworkConnection)null, default(Scene)); val._cookness.Value = 1f; _food.Add(val); Loot.HandToEat(who, val); ((MonoBehaviour)this).StartCoroutine(EatenAnyway(who, val)); AutoTest.Count("stall_food"); } } private IEnumerator EatenAnyway(Player who, Item fish) { float t = 0.5f; while (true) { yield return (object)new WaitForSeconds(0.5f); if (!Object.op_Implicit((Object)(object)fish) || !((NetworkBehaviour)fish).IsSpawned || fish.IsDestroying || ((NetworkBehaviour)fish).IsDeinitializing || fish.IsInInventory) { break; } bool eating = Object.op_Implicit((Object)(object)who) && Object.op_Implicit((Object)(object)who.Eating) && who.Eating._isEating.Value; if (LeftOver(t, eating)) { Creature val = (Creature)(object)((fish is Creature) ? fish : null); if (val != null && Object.op_Implicit((Object)(object)who) && Object.op_Implicit((Object)(object)who.Vitals) && PlayerManager.AlivePlayers.Contains(who)) { float num = GameInfo.CooknessEatCurve.Evaluate(((Item)val).Cookness); who.Vitals.RestoreFullness((int)((float)val.FullnessToRestore * num)); who.Vitals.Heal((int)((float)val.HpToRestore * num)); fish.DestroyItem((byte)3, byte.MaxValue); AutoTest.Count("stall_food_finished"); } break; } t += 0.5f; } _food.Remove(fish); } public static bool LeftOver(float waited, bool eating) { if (waited >= 6f) { if (eating) { return waited >= 20f; } return true; } return false; } private void ServerUpgrade() { if (_netLevel >= UpgradeCost.Length || !Siege.Instance.ServerTrySpend(Siege.Money(UpgradeCost[_netLevel]), always: true)) { return; } _netLevel++; foreach (Player player in PlayerManager.Players) { if (Object.op_Implicit((Object)(object)player)) { Send(((NetworkBehaviour)player).ObjectId); } } Fx.Announce("netUpgraded", Cap); } private bool NearCounter() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (Object.op_Implicit((Object)(object)instance) && instance.Exists && Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Player.LocalPlayer.Transform)) { Vector3 val = Player.LocalPlayer.Transform.position - instance.CounterPos; return ((Vector3)(ref val)).sqrMagnitude < 17.639997f; } return false; } private void ClientInput() { Keyboard current = Keyboard.current; if (current != null && !ChatManager.IsTyping && !BuildSystem.Building && !Hud.ModalOpen && ((ButtonControl)current.uKey).wasPressedThisFrame && NearCounter() && !BuildSystem.AimingAtPiece && Siege.Instance.ViewActive && InstanceFinder.IsClientStarted) { bool flag = ((ButtonControl)current.leftShiftKey).isPressed || ((ButtonControl)current.rightShiftKey).isPressed; if (flag || _mine.Count > 0) { InstanceFinder.ClientManager.Broadcast(new NetRequest { Sell = !flag, Level = ClientNetLevel }, (Channel)0); } } } private void LateUpdate() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00e4: 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_013b: 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_0159: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: 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_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Siege.Instance) || !Siege.Instance.ViewActive || !Object.op_Implicit((Object)(object)Hud.Font) || BuildSystem.Building) { if (Object.op_Implicit((Object)(object)_panel)) { ((Component)_panel).gameObject.SetActive(false); } return; } if (!Object.op_Implicit((Object)(object)_panel)) { _panel = Hud.Box(Hud.Root, new Vector2(1f, 0f), new Vector2(-24f, 150f), new Vector2(320f, 74f), Hud.Panel, 16f); _netTitle = Hud.Label(((Component)_panel).transform, "", 21f, new Vector2(0f, 1f), new Vector2(16f, -8f), new Vector2(200f, 30f), (TextAlignmentOptions)257); _netCount = Hud.Label(((Component)_panel).transform, "", 24f, new Vector2(1f, 1f), new Vector2(-16f, -6f), new Vector2(120f, 30f), (TextAlignmentOptions)260, null, bold: true); _netBar = Hud.Bar.Make(((Component)_panel).transform, new Vector2(0f, 0f), new Vector2(16f, 14f), new Vector2(288f, 14f), Hud.Accent); _netFull = Hud.Label(((Component)_panel).transform, "", 20f, new Vector2(1f, 1f), new Vector2(0f, 30f), new Vector2(560f, 28f), (TextAlignmentOptions)1028, Hud.Bad, bold: true, outline: true); } ((Component)_panel).gameObject.SetActive(true); int num = ((_mine.Capacity > 0) ? _mine.Capacity : Capacity[0]); bool flag = _mine.Count >= num; ((TMP_Text)_netTitle).text = L10n.T("netTitle") + " " + L10n.T("netWorth", _mine.Value) + ""; ((TMP_Text)_netCount).text = $"{_mine.Count} / {num}"; ((Graphic)_netCount).color = (flag ? Hud.Bad : Hud.Ink); _netBar.Set((float)_mine.Count / (float)num, flag ? Hud.Bad : Hud.Accent); ((Component)_netFull).gameObject.SetActive(flag || _mine.Count == 0); ((TMP_Text)_netFull).text = (flag ? L10n.T("netFullShort") : L10n.T("netHow")); ((Graphic)_netFull).color = (flag ? Hud.Bad : Hud.Muted); if (NearCounter()) { VaultData clientVault = Loot.Instance.ClientVault; ulong player = Loot.KeyOf(Player.LocalPlayer); int num2 = Mathf.RoundToInt(clientVault.PersonalValue(player, Gear.BigNet)); int num3 = Array.IndexOf(Capacity, num - num2); int num4 = Mathf.RoundToInt((float)_mine.Value * (1f + clientVault.PersonalValue(player, Gear.FishGloves))); Hud.Prompt(((_mine.Count > 0) ? L10n.T("netSellHint", _mine.Count, num4) : L10n.T("netEmptyHint")) + "\u3000\u3000" + ((num3 >= 0 && num3 < UpgradeCost.Length) ? L10n.T("netUpgradeHint", Capacity[num3 + 1], Siege.Money(UpgradeCost[num3])) : L10n.T("netMax"))); } } } internal class SellCounter : MonoBehaviour { private void OnTriggerStay(Collider other) { //IL_0074: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (InstanceFinder.IsServerStarted && Object.op_Implicit((Object)(object)FortressNet.Instance)) { Item val = ItemManager.Get(other); if (Object.op_Implicit((Object)(object)val) && !Object.op_Implicit((Object)(object)val.Holder) && !((NetworkBehaviour)val).IsDeinitializing && !val.IsDestroying && !Object.op_Implicit((Object)(object)val.DeadPlayer) && (!Object.op_Implicit((Object)(object)val.Creature) || val.Creature.IsDead)) { FortressNet.Instance.ServerSellThrown(val, ((Component)this).transform.position + Vector3.up * 0.9f); } } } } [BepInPlugin("owen.htf.fortress", "OVER 99", "0.1.2")] public class FortressPlugin : BaseUnityPlugin { public const string Version = "0.1.2"; private ConfigEntry _toggleKey; private ConfigEntry _debugKeys; private int _kills; private ConfigEntry _pool; private ConfigEntry _baseCount; private ConfigEntry _countPerWave; private ConfigEntry _hpPerWave; private ConfigEntry _radius; private ConfigEntry _breakSeconds; private bool _practice; private ConfigEntry _walkerShare; private ConfigEntry _walkerRadius; private ConfigEntry _readyKey; private ConfigEntry _firstBuildSeconds; private ConfigEntry _killReward; private ConfigEntry _waveBonus; public static readonly List Alive = new List(); private readonly HashSet _required = new HashSet(); private float _waveStarted; private bool _requiredSpawned; private bool _spawning; private List _poolPrefabs = new List(); private List _walkerPrefabs = new List(); private bool _running; private int _wave; private int _cleared; private int _stackFrom; private int _bestAtStart; private float _nextWaveAt; private bool _warnedNoLand; private bool _hadAlivePlayers; private static FortressPlugin _instance; public const float CallHold = 1.2f; private float _callHeld; public static readonly HashSet Showcase = new HashSet(); public static ConfigEntry HandDamage; private Image _testHelp; private readonly HashSet _markedDead = new HashSet(); private Vector3 _stuckFrom; private float _stuckSince; private float _nextStuckHint; public static bool Frozen; private int _testBoss = -1; private bool _victory; private static readonly (EnemyKind kind, float weight)[] Mix = new(EnemyKind, float)[10] { (EnemyKind.Runner, 5f), (EnemyKind.Charger, 3f), (EnemyKind.Spitter, 2f), (EnemyKind.Bomber, 2f), (EnemyKind.Tank, 1.5f), (EnemyKind.Thief, 1.5f), (EnemyKind.Splitter, 1.5f), (EnemyKind.Healer, 1f), (EnemyKind.Shield, 1.5f), (EnemyKind.Digger, 1.2f) }; public const int LandCap = 36; private static readonly FieldRef IgnoreWater = AccessTools.FieldRefAccess("_ignoreDeathByWater"); public readonly Dictionary MaxHpOf = new Dictionary(); private float _hpMult = 1f; private List _alive => Alive; private static bool IsHost { get { if (Object.op_Implicit((Object)(object)Server.Instance)) { return ((NetworkBehaviour)Server.Instance).IsServerInitialized; } return false; } } public static FortressPlugin Instance => _instance; public bool Running => _running; public string ReadyKeyName => ((object)_readyKey.Value/*cast due to .constrained prefix*/).ToString(); public int Wave => _wave; public int Cleared => _cleared; public bool InBuildTime { get { if (_running) { return _nextWaveAt > 0f; } return false; } } public bool CanCallNext { get { if (_running && _wave > 0 && _nextWaveAt == 0f && !_spawning && (_wave + 1) % 10 != 0) { return _wave < 100; } return false; } } public float WaveHpMult => _hpMult; public bool TestKeysOn => _debugKeys.Value; private bool KeysOn { get { if (!_debugKeys.Value) { if (!IsHost && Object.op_Implicit((Object)(object)Siege.Instance)) { return Siege.Instance.View.TestKeys; } return false; } return true; } } private void Awake() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Expected O, but got Unknown //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Expected O, but got Unknown //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Expected O, but got Unknown //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Expected O, but got Unknown //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Expected O, but got Unknown //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Expected O, but got Unknown //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Expected O, but got Unknown //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Expected O, but got Unknown //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Expected O, but got Unknown //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Expected O, but got Unknown //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Expected O, but got Unknown //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Expected O, but got Unknown _instance = this; _toggleKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "ToggleKey", (Key)102, "Test key: host starts / ends a round (needs DebugKeys)."); _debugKeys = ((BaseUnityPlugin)this).Config.Bind("Debug", "DebugKeys", false, "Test keys for the host: F4 teleport to the fortress, F5 +500 coins, F6 god mode, F7 kill all, F8 skip build time (Shift: jump 5 waves), F9 start/end a round."); FortressIsland.Unlock = ((BaseUnityPlugin)this).Config.Bind("Island", "Unlock", IslandUnlock.AfterFinalBoss, "When the fortress island appears: after beating the final boss, or always."); Reveal.Seen = ((BaseUnityPlugin)this).Config.Bind("Island", "RevealSeen", false, "The island's entrance (it rises out of the sea) has played on this computer. Set to false to see it again."); _pool = ((BaseUnityPlugin)this).Config.Bind("Waves", "CreaturePool", "", "Comma-separated creature names to spawn. Empty = hostile creatures only. Names are listed in the BepInEx log on start."); _baseCount = ((BaseUnityPlugin)this).Config.Bind("Waves", "BaseCount", 3, new ConfigDescription("Creatures in wave 1.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 50), Array.Empty())); _countPerWave = ((BaseUnityPlugin)this).Config.Bind("Waves", "CountPerWave", 2, new ConfigDescription("Extra creatures added each wave.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 20), Array.Empty())); _hpPerWave = ((BaseUnityPlugin)this).Config.Bind("Waves", "HpPerWave", 0.4f, new ConfigDescription("Extra HP multiplier per wave (0.4 = +40% each wave).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); _radius = ((BaseUnityPlugin)this).Config.Bind("Waves", "SpawnRadius", 6f, new ConfigDescription("Distance from the host where creatures appear.", (AcceptableValueBase)(object)new AcceptableValueRange(3f, 80f), Array.Empty())); _breakSeconds = ((BaseUnityPlugin)this).Config.Bind("Waves", "BuildSecondsBetweenWaves", 90f, new ConfigDescription("Build time between waves (the host can press N to start the next wave sooner).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 300f), Array.Empty())); _walkerShare = ((BaseUnityPlugin)this).Config.Bind("Siege", "WalkerShare", 0.5f, new ConfigDescription("Share of each wave that are walkers charging the core.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); _walkerRadius = ((BaseUnityPlugin)this).Config.Bind("Siege", "WalkerSpawnRadius", 25f, new ConfigDescription("How far from the core walkers appear (on land).", (AcceptableValueBase)(object)new AcceptableValueRange(8f, 80f), Array.Empty())); Siege.CoreMaxHp = ((BaseUnityPlugin)this).Config.Bind("Siege", "CoreMaxHp", 1000, new ConfigDescription("Core health.", (AcceptableValueBase)(object)new AcceptableValueRange(50, 10000), Array.Empty())); Siege.WalkerDamage = ((BaseUnityPlugin)this).Config.Bind("Siege", "WalkerDamage", 10, new ConfigDescription("Damage a walker deals per hit to walls and the core.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 500), Array.Empty())); _readyKey = ((BaseUnityPlugin)this).Config.Bind("Waves", "ReadyKey", (Key)28, "Host presses this during build time to start the next wave right away, or holds it mid-wave to bring the next one early."); _firstBuildSeconds = ((BaseUnityPlugin)this).Config.Bind("Waves", "BuildSecondsBeforeWave1", 90f, new ConfigDescription("Build time before wave 1 (the host can press N to start sooner).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 300f), Array.Empty())); Siege.MoneyScaleEntry = ((BaseUnityPlugin)this).Config.Bind("Economy", "MoneyScale", 30f, new ConfigDescription("The fortress costs and pays the game's own money: every price and reward is this many dollars per fortress coin.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 100f), Array.Empty())); ConfigEntry val = ((BaseUnityPlugin)this).Config.Bind("Economy", "PriceVersion", 1, "Which price list this file was last moved to (don't change)."); if (val.Value < 2) { if (Mathf.Approximately(Siege.MoneyScaleEntry.Value, 10f)) { Siege.MoneyScaleEntry.Value = 30f; } val.Value = 2; } _killReward = ((BaseUnityPlugin)this).Config.Bind("Economy", "KillReward", 3, new ConfigDescription("Coins per kill (plus the wave number).", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); _waveBonus = ((BaseUnityPlugin)this).Config.Bind("Economy", "WaveBonus", 25, new ConfigDescription("Coins for clearing a wave (plus 6 x wave).", (AcceptableValueBase)(object)new AcceptableValueRange(0, 500), Array.Empty())); Turrets.DamageMultiplier = ((BaseUnityPlugin)this).Config.Bind("Economy", "TurretDamage", 1f, new ConfigDescription("Turret damage multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); HandDamage = ((BaseUnityPlugin)this).Config.Bind("Economy", "HandDamage", 1f, new ConfigDescription("Multiplier on damage players' own weapons (guns, bow, knife, fists) deal to fortress enemies.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); L10n.Setting = ((BaseUnityPlugin)this).Config.Bind("General", "Language", LanguageSetting.Auto, "Language for Fortress messages. Auto follows the game."); BuildSystem.BuildKey = ((BaseUnityPlugin)this).Config.Bind("Build", "BuildKey", (Key)21, "Toggle build mode."); Weapons.NetKey = ((BaseUnityPlugin)this).Config.Bind("Weapons", "NetKey", (Key)20, "Take out / put away the hand net (scoops dead fish; sell them at the fish stall)."); Weapons.DamageMultiplier = ((BaseUnityPlugin)this).Config.Bind("Economy", "WeaponDamage", 1f, new ConfigDescription("Multiplier on fortress weapon damage (laser gun, gas gun, boomerang, shark, ...). It already grows with the wave.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); BuildSystem.Log = ((BaseUnityPlugin)this).Logger; Models.Dir = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Models"); Hud.IconDir = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Icons"); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); Markers.Show = ((BaseUnityPlugin)this).Config.Bind("Players", "TeammateMarkers", true, "Show where your teammates are: a mark over their heads with name and distance (red while they're down and need carrying back), an arrow at the screen's edge when they're off it."); Unstuck.UnstuckKey = ((BaseUnityPlugin)this).Config.Bind("Players", "UnstuckKey", (Key)29, "Hold to get out when you're stuck in or between pieces (you're also freed by yourself when you're inside one, or push for 2 s and go nowhere)."); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); Tips.Show = ((BaseUnityPlugin)this).Config.Bind("Tips", "ShowTips", true, "Show a short tip card the first time something new happens."); Tips.Reset = ((BaseUnityPlugin)this).Config.Bind("Tips", "ResetTips", false, "Set to true to see every tip card again."); ClientSettings.Bind(((BaseUnityPlugin)this).Config); ClientSettings.Add("setTeamMarkers", Markers.Show); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); Harmony val2 = new Harmony("owen.htf.fortress"); Type[] typesFromAssembly = AccessTools.GetTypesFromAssembly(typeof(FortressPlugin).Assembly); foreach (Type type in typesFromAssembly) { try { val2.CreateClassProcessor(type).Patch(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Patch " + type.Name + " failed: " + ex.GetBaseException().Message)); } } ((BaseUnityPlugin)this).Logger.LogInfo((object)"OVER 99 (HTF Fortress) loaded."); } public static void Shot(string tag, float delay = 0f) { ((MonoBehaviour)_instance).StartCoroutine(_instance.ShotAfter(tag, delay)); } public void SkipBuildTime() { if (InBuildTime) { _nextWaveAt = Time.time; } } public void DebugExtendBuild(float seconds) { if (InBuildTime) { _nextWaveAt = Time.time + seconds; } } public void DebugJumpToWave(int wave) { _wave = wave - 1; _nextWaveAt = Time.time; } public void DebugSummonBoss(EnemyKind kind) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) int num = (Array.IndexOf(EnemyCatalog.BossOrder, kind) + 1) * 10; int gap = Random.Range(0, 3); FortressIsland instance = FortressIsland.Instance; Fx.Send(FxKind.BossIntro, (Object.op_Implicit((Object)(object)instance) && instance.Exists) ? instance.Center : Siege.Instance.CorePos, BossSpot(kind, gap), num, (int)kind); ((MonoBehaviour)this).StartCoroutine(SummonAfter(kind, gap, num)); } private IEnumerator SummonAfter(EnemyKind kind, int gap, int wave) { yield return (object)new WaitForSeconds(Reveal.BossSpawnAt(wave)); if (_running) { ServerSpawnBoss(kind, HpMult(wave, _hpPerWave.Value), gap, wave, Reveal.BossSeconds(wave) - Reveal.BossSpawnAt(wave)); } } public Creature DebugShowcase(EnemyKind kind, bool elite, Vector3 pos, float yaw) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) Item val = _walkerPrefabs.FirstOrDefault() ?? ((IEnumerable)BuildPool()).FirstOrDefault((Func)((Item p) => ((Component)p).GetComponent() is RunningFish)); if (!Object.op_Implicit((Object)(object)val)) { return null; } Item val2 = Object.Instantiate(val, pos, Quaternion.Euler(0f, yaw, 0f)); val2.Rig.isKinematic = true; ((NetworkBehaviour)Server.Instance).Spawn(((Component)val2).gameObject, (NetworkConnection)null, default(Scene)); Enemies.Instance.ServerTag(val2.Creature, kind, elite); Showcase.Add(val2.Creature); return val2.Creature; } public int DebugClearGround() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if ((Object)(object)instance == (Object)null || !instance.Exists) { return 0; } int num = 0; Item[] array = Object.FindObjectsOfType(); foreach (Item val in array) { if (Object.op_Implicit((Object)(object)val) && ((NetworkBehaviour)val).IsSpawned && !val.IsDestroying && !Object.op_Implicit((Object)(object)val.Holder) && !Object.op_Implicit((Object)(object)val.SyncedHolder) && !val.IsInInventory && !Object.op_Implicit((Object)(object)val.DeadPlayer) && (!Object.op_Implicit((Object)(object)val.Creature) || val.Creature.IsDead) && instance.OnIsland(((Component)val).transform.position, 51f)) { val.DestroyItem((byte)0, byte.MaxValue); num++; } } AutoTest.Count("ground_cleared", num); return num + Loot.Instance.ServerClearDrops(); } public void DebugKillAll() { Bosses.TestKill = true; try { foreach (Creature item in _alive.Where((Creature c) => Object.op_Implicit((Object)(object)c) && c._hp.Value > 0).ToList()) { item.ServerChangeHp(1000000); } } finally { Bosses.TestKill = false; } } public void DebugStopRound() { if (_running) { Stop(L10n.T("stopped")); } } public void HostTestKey(TestKeyRequest r) { if (_debugKeys.Value && r.Key != 97) { TestKey((Key)r.Key, r.Shift, r.Ctrl); } } private void UpdateTestKeys(Keyboard kb) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected I4, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_testHelp) && KeysOn && Object.op_Implicit((Object)(object)Hud.Font)) { _testHelp = Hud.Box(Hud.Root, new Vector2(1f, 1f), new Vector2(-18f, -18f), new Vector2(330f, 290f), Hud.Panel); Transform transform = ((Component)_testHelp).transform; string text = Hud.Keys(L10n.T("testKeys")); Vector2 anchor = new Vector2(0f, 1f); Vector2 pos = new Vector2(16f, -12f); Vector2 box = new Vector2(560f, 270f); Vector2? pivot = new Vector2(0f, 1f); TextMeshProUGUI val = Hud.Label(transform, text, 19f, anchor, pos, box, (TextAlignmentOptions)257, null, bold: false, outline: false, pivot); ((TMP_Text)val).lineSpacing = 18f; ((TMP_Text)val).enableWordWrapping = false; Vector2 preferredValues = ((TMP_Text)val).GetPreferredValues(((TMP_Text)val).text, float.PositiveInfinity, float.PositiveInfinity); if (preferredValues.x > 560f) { ((TMP_Text)val).fontSize = ((TMP_Text)val).fontSize * (560f / preferredValues.x); preferredValues = ((TMP_Text)val).GetPreferredValues(((TMP_Text)val).text, float.PositiveInfinity, float.PositiveInfinity); } ((TMP_Text)val).rectTransform.sizeDelta = preferredValues; ((Graphic)_testHelp).rectTransform.sizeDelta = preferredValues + new Vector2(32f, 26f); } if (Object.op_Implicit((Object)(object)_testHelp)) { ((Component)_testHelp).gameObject.SetActive(KeysOn); } if (!KeysOn || kb == null || ChatManager.IsTyping || Hud.ModalOpen) { return; } Key[] array = new Key[10]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); array[9] = (Key)(int)_toggleKey.Value; Key[] array2 = (Key[])(object)array; foreach (Key val2 in array2) { if (((ButtonControl)kb[val2]).wasPressedThisFrame) { TestKey(val2, kb.shiftKey.isPressed, kb.ctrlKey.isPressed); } } } private void Unstick(Keyboard kb) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_00ea: 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_00f1: 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_0139: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.LocalPlayer; FortressIsland instance = FortressIsland.Instance; if (kb == null || !Object.op_Implicit((Object)(object)localPlayer) || !Object.op_Implicit((Object)(object)localPlayer.Transform) || (Object)(object)instance == (Object)null || !instance.Exists || ChatManager.IsTyping || Hud.ModalOpen) { return; } if (((ButtonControl)kb.f4Key).wasPressedThisFrame) { localPlayer.LocalTeleport(instance.Center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); if (IsHost && _debugKeys.Value) { instance.ServerMoveBoatToBerth(); } AutoTest.Count("unstick_key"); return; } Vector3 position = localPlayer.Transform.position; if (((ButtonControl)kb.wKey).isPressed || ((ButtonControl)kb.aKey).isPressed || ((ButtonControl)kb.sKey).isPressed || ((ButtonControl)kb.dKey).isPressed) { Vector3 val = position - _stuckFrom; if (!(((Vector3)(ref val)).sqrMagnitude > 0.09f)) { if (Time.time - _stuckSince > 2.5f && Time.time > _nextStuckHint && instance.OnIsland(position, 51f)) { Hud.Banner(Hud.Keys(L10n.T("stuckHint")), 3.5f); _nextStuckHint = Time.time + 25f; } return; } } _stuckFrom = position; _stuckSince = Time.time; } public void TestKey(Key key, bool shift, bool ctrl = false) { //IL_00ce: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected I4, but got Unknown //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected I4, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_045f: 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_039c: 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_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Player.LocalPlayer)) { return; } if (!IsHost) { FortressIsland instance = FortressIsland.Instance; if ((int)key == 97) { if ((Object)(object)instance != (Object)null && instance.Exists) { Player.LocalPlayer.LocalTeleport(instance.Center + FortressIsland.ReadyLocal + Vector3.up * 0.5f, 0f, true); } } else if (Object.op_Implicit((Object)(object)Siege.Instance) && Siege.Instance.View.TestKeys) { InstanceFinder.ClientManager.Broadcast(new TestKeyRequest { Key = (int)key, Shift = shift, Ctrl = ctrl }, (Channel)0); } else { Say(L10n.T("testHostOnly")); } return; } FortressIsland instance2 = FortressIsland.Instance; if (key == _toggleKey.Value) { if (_running) { Stop(L10n.T("stopped")); } else { StartRound(((Object)(object)instance2 != (Object)null && instance2.Exists) ? instance2.CorePos : Player.LocalPlayer.Transform.position); } return; } switch (key - 94) { case 4: if (_running) { Siege.Instance.ServerAddCoins(Siege.Money(500)); _practice = true; } else { Say(L10n.T("testNotRunning")); } break; case 5: PlayerManager.ToggleGodMode(); _practice |= _running; Say(L10n.T(PlayerManager.InGodMode ? "testGodOn" : "testGodOff")); break; case 6: if (shift) { Say(L10n.T("testCleared", DebugClearGround())); } else { DebugKillAll(); _practice |= _running; } break; case 0: { if (!_running) { Say(L10n.T("testNotRunning")); break; } if (!shift || _testBoss < 0) { _testBoss = (_testBoss + 1) % EnemyCatalog.BossOrder.Length; } EnemyKind kind = EnemyCatalog.BossOrder[_testBoss]; DebugSummonBoss(kind); _practice = true; Say(L10n.T("testBoss", L10n.T("bossName" + kind), (_testBoss + 1) * 10)); break; } case 1: foreach (BossBrain item in Bosses.Instance.All.Where((BossBrain b) => b.IsBoss).ToList()) { if (shift) { item.DebugBreak(); } else { item.Body.ServerChangeHp(Mathf.Max(1, item.MaxHp / 4)); } } _practice |= _running; break; case 2: if (shift) { Vector3 position = Player.LocalPlayer.Transform.position; Vector3 val = Player.LocalPlayer.Transform.forward.Flat(); Vector3 normalized = ((Vector3)(ref val)).normalized; for (int num = 0; num < EnemyCatalog.BossOrder.Length; num++) { BossTrophies.ServerSpawn(EnemyCatalog.BossOrder[num], position + normalized * 2.5f + Quaternion.Euler(0f, ((float)num - 4.5f) * 14f, 0f) * normalized * 1.5f + Vector3.up * 1.2f); } _practice |= _running; } else if (!_running) { Say(L10n.T("testNotRunning")); } else { Siege.Instance.DamageCore(-Siege.Instance.CoreMax); BuildSystem.Instance.ServerRepairArea(Siege.Instance.CorePos, 1000f, 1f); _practice = true; Say(L10n.T("testMended")); } break; case 10: Frozen = !Frozen; Say(L10n.T(Frozen ? "testFrozen" : "testUnfrozen")); break; case 9: if (_running) { Say(L10n.T("testNotDuringRound")); } else { Reveal.Instance.Replay(); } break; case 7: if (!_running) { Say(L10n.T("testNotRunning")); } else if (ctrl) { DebugKillAll(); DebugJumpToWave((_wave / 10 + 1) * 10); _practice = true; Say(L10n.T("testJump", _wave + 1)); } else if (shift) { DebugKillAll(); DebugJumpToWave(_wave + 5); _practice = true; Say(L10n.T("testJump", _wave + 1)); } else { SkipBuildTime(); } break; case 3: case 8: break; } } private IEnumerator ShotAfter(string tag, float delay) { if (delay > 0f) { yield return (object)new WaitForSeconds(delay); } string text = Path.Combine(Paths.BepInExRootPath, "fortress-shots"); Directory.CreateDirectory(text); string text2 = Path.Combine(text, DateTime.Now.ToString("HHmmss") + "_" + tag + ".png"); ScreenCapture.CaptureScreenshot(text2); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Screenshot: " + text2)); } private void Update() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) Keyboard current = Keyboard.current; if (current != null && ((ButtonControl)current.f10Key).wasPressedThisFrame) { Shot("manual"); } Unstick(current); UpdateTestKeys(current); if (!_running) { return; } if (!IsHost || !Object.op_Implicit((Object)(object)Player.LocalPlayer)) { Stop(L10n.T("notHost")); return; } foreach (Player item in PlayerManager.Players.Where((Player p) => Object.op_Implicit((Object)(object)p) && Object.op_Implicit((Object)(object)p.Transform) && Object.op_Implicit((Object)(object)p.Dying))) { bool isDead = item.Dying.IsDead; if (isDead && _markedDead.Add(((NetworkBehaviour)item).ObjectId)) { Fx.Send(FxKind.DeathMark, item.Transform.position, item.Transform.position, 0, 0, ((NetworkBehaviour)item).ObjectId); } else if (!isDead) { _markedDead.Remove(((NetworkBehaviour)item).ObjectId); } } if (PlayerManager.AlivePlayers.Count > 0) { _hadAlivePlayers = true; } else if (_hadAlivePlayers && _wave > 0) { Stop(L10n.T("wipe")); return; } if (Siege.Instance.CoreDestroyed) { Stop(L10n.T("coreDown")); return; } Stats.TrackDowns(); Vector3 corePos = Siege.Instance.CorePos; foreach (Creature item2 in _alive.Where(delegate(Creature c) { //IL_0024: 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_002f: 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) if (Object.op_Implicit((Object)(object)c) && c._hp.Value > 0 && ((NetworkBehaviour)c).IsSpawned) { Vector3 val = ((Component)c).transform.position - corePos; if (((Vector3)(ref val)).sqrMagnitude > 6400f) { if (Enemies.Instance.TryGet(c, out var tag3)) { return !EnemyCatalog.IsBoss(tag3.Kind); } return true; } } return false; }).ToList()) { _alive.Remove(item2); _required.Remove(item2); ((Item)item2).DestroyItem((byte)0, byte.MaxValue); AutoTest.Count("escaped"); } List list = _alive.Where((Creature c) => !Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0).ToList(); int num = list.Count; int num2 = 0; List list2 = new List(); foreach (Creature item3 in list) { if (!Object.op_Implicit((Object)(object)item3)) { num--; continue; } int killerId = Stats.Killed(item3); EnemyTag tag; bool num3 = Enemies.Instance.TryGet(item3, out tag); if (num3) { Loot.Instance.ServerOnKill(((Component)item3).transform.position, tag.Kind, tag.Elite, killerId, _wave); } int num4 = (num3 ? KillReward(tag, _wave) : Siege.Money(_killReward.Value)); num2 += num4; if (num3 && EnemyCatalog.IsPuppet(tag.Kind)) { num2 += CorpseValue(num4); } else { FortressNet.Instance.ServerAddCorpse(item3, CorpseValue(num4) + Siege.Instance.ServerTakeCarried(item3)); } if (num3 && tag.Kind == EnemyKind.Splitter) { list2.Add(((Component)item3).transform.position); } Enemies.Instance.ServerForget(item3); } _alive.RemoveAll((Creature c) => !Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0); foreach (Vector3 item4 in list2) { for (int num5 = 0; num5 < 3; num5++) { ServerSpawnMinion(EnemyKind.Mini, item4 + Quaternion.Euler(0f, (float)num5 * 120f, 0f) * Vector3.forward * 0.8f); } } _required.RemoveWhere((Creature c) => !Object.op_Implicit((Object)(object)c) || c._hp.Value <= 0); bool flag = _wave > 0 && _nextWaveAt == 0f && !_spawning && (_requiredSpawned ? (_required.Count == 0) : (_alive.Count == 0)); if (_wave > 0 && _nextWaveAt == 0f && Time.time - _waveStarted > 180f && _required.Count == 0) { flag = true; } if (_wave > 0 && _nextWaveAt == 0f && Time.time - _waveStarted > 240f) { foreach (Creature item5 in _required.Where((Creature c) => Object.op_Implicit((Object)(object)c)).ToList()) { BuildSystem.Log.LogInfo((object)string.Format("wave cap: removing {0} at {1} (core {2})", Enemies.Instance.TryGet(item5, out var tag2) ? tag2.Kind.ToString() : "?", ((Component)item5).transform.position, Siege.Instance.CorePos)); } flag = true; AutoTest.Count("wave_capped"); } if (flag && _alive.Count > 0) { foreach (Creature item6 in _alive.Where((Creature c) => Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned).ToList()) { ((Item)item6).DestroyItem((byte)0, byte.MaxValue); } _alive.Clear(); } if (num > 0) { Siege.Instance.ServerAddCoins(num2); _kills += num; AutoTest.Count("kills", num); } if ((_wave == 0 || flag) && _alive.Count == 0 && _nextWaveAt == 0f) { if (_wave > 0) { _cleared = _wave; if (!_practice && !PlayerManager.InGodMode) { Loot.Instance.ServerRecord(_cleared); } int num6 = 0; for (int num7 = Mathf.Min(_stackFrom, _wave); num7 <= _wave; num7++) { num6 += WaveBonus(num7, _waveBonus.Value, Perks.Team(Gear.WarChest)); } if (Perks.TeamLegend(Gear.WarChest)) { num6 += Mathf.Min(Siege.Money(100), Siege.Instance.ServerCoins / 10); Perks.Proc(Gear.WarChest, Siege.Instance.CorePos + Vector3.up * 4f); } Siege.Instance.ServerAddCoins(num6); if (_wave >= 100) { Victory(); return; } Say(L10n.T("cleared", _wave, num6, _breakSeconds.Value.ToString("0"), _readyKey.Value)); Fx.Announce("clearedBanner", _wave); for (int num8 = Mathf.Min(_stackFrom, _wave); num8 <= _wave; num8++) { if (num8 % 5 == 0) { Loot.Instance.ServerSpawnChest(num8); } } } _nextWaveAt = Time.time + ((_wave == 0) ? _firstBuildSeconds.Value : _breakSeconds.Value); } bool flag2 = _nextWaveAt > 0f; if (flag2 && current != null && ((ButtonControl)current[_readyKey.Value]).wasPressedThisFrame && !ChatManager.IsTyping) { _nextWaveAt = Time.time; } else if (!flag2) { HoldForNextWave(current); } Siege.Instance.ServerProgress(_wave, _alive.Count, flag2, flag2 ? Mathf.CeilToInt(_nextWaveAt - Time.time) : 0); if (_nextWaveAt > 0f && Time.time >= _nextWaveAt) { _nextWaveAt = 0f; SpawnWave(++_wave); } } private void HoldForNextWave(Keyboard kb) { //IL_000a: 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) if (kb == null || !((ButtonControl)kb[_readyKey.Value]).isPressed || ChatManager.IsTyping || Hud.ModalOpen) { _callHeld = 0f; } else if (!(_callHeld < 0f) && CanCallNext) { _callHeld += Time.deltaTime; Hud.Ring(_callHeld / 1.2f, L10n.T("callingNext", _wave + 1), Hud.Accent); if (!(_callHeld < 1.2f)) { _callHeld = -1f; DebugCallNext(); } } } public void DebugCallNext() { if (CanCallNext) { Say(L10n.T("calledEarly", _wave + 1)); AutoTest.Count("wave_called_early"); SpawnWave(++_wave, onTop: true); } } public void StartRound(Vector3 corePos) { //IL_014b: 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_01b9: Unknown result type (might be due to invalid IL or missing references) Loot.Instance.ServerNewRound(); if (!IsHost) { ChatManager.ChatMessage(L10n.T("prefix") + " " + L10n.T("onlyHost")); return; } List list = BuildPool(); _walkerPrefabs = list.Where((Item p) => ((Component)p).GetComponent() is RunningFish).ToList(); _poolPrefabs = list.Except(_walkerPrefabs).ToList(); if (list.Count == 0) { ChatManager.ChatMessage(L10n.T("prefix") + " " + L10n.T("noCreatures")); return; } _running = true; _victory = false; _wave = 0; _cleared = 0; _warnedNoLand = false; _hadAlivePlayers = false; _practice = PlayerManager.InGodMode; _kills = 0; Stats.Reset(); BuildSystem.Instance.RoundBuilt = 0; _nextWaveAt = 0f; _alive.Clear(); MaxHpOf.Clear(); _hpMult = 1f; FortressNet.Instance.ServerReset(keepSize: true); Siege.Instance.ServerStart(corePos); _bestAtStart = Loot.Instance.Vault.Best; Say(L10n.T("start", Loot.Instance.Vault.Best)); Say(L10n.T("startHint", BuildSystem.BuildKey.Value, _readyKey.Value)); Say(L10n.T("fishTip")); Shot("start", 2f); } private void Victory() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) _victory = true; Vector3 val = Siege.Instance.CorePos + Vector3.up * 6f; Fx.Send(FxKind.Victory, val, val); Fx.Announce("victoryBanner"); AutoTest.Count("victory"); Stop(L10n.T("victory")); } private void Stop(string why) { Stats.TrackDowns(); _running = false; bool coreDestroyed = Siege.Instance.CoreDestroyed; foreach (Creature item in _alive.Where((Creature c) => Object.op_Implicit((Object)(object)c) && ((NetworkBehaviour)c).IsSpawned)) { ((Item)item).DestroyItem((byte)0, byte.MaxValue); } _alive.Clear(); _required.Clear(); _spawning = false; Enemies.Instance.ServerClear(); FortressNet.Instance.ServerReset(); Siege.Instance.ServerStop(); Loot.Instance.ServerCollectAll(); bool flag = _practice || PlayerManager.InGodMode; bool flag2 = !flag && (Loot.Instance.ServerRecord(_cleared) || _cleared > _bestAtStart); if (_victory && !flag) { Loot.Instance.ServerWin(string.Join("、", PlayerManager.Players.Where((Player p) => Object.op_Implicit((Object)(object)p)).Select(Loot.NameOf))); } int num = ((!flag) ? SettleBonus(_cleared) : 0); if (num > 0) { AutoTest.Count("settle_bonus", num); if (Object.op_Implicit((Object)(object)MoneyManager.Instance)) { SyncVar money = MoneyManager.Instance._money; money.Value += num; } Say(L10n.T("settleBonus", _cleared, num)); Fx.Announce("settleBonusShort", num); } int best = Loot.Instance.Vault.Best; string text = (flag ? L10n.T("practice") : (flag2 ? L10n.T("newRecord") : L10n.T("best", best))); Say(L10n.T("result", why, _cleared) + text); InstanceFinder.ServerManager.Broadcast(new RoundResult { Waves = _cleared, Kills = _kills, Built = BuildSystem.Instance.RoundBuilt, Best = best, NewRecord = flag2, CoreLost = coreDestroyed, Victory = _victory, Table = Stats.Table() }, true, (Channel)0); _victory = false; BuildSystem.Instance.ServerClearAll(); } private List BuildPool() { Dictionary source = (Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null); Dictionary creatures = source.Where(delegate(KeyValuePair kv) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)kv.Value)) { Creature component = ((Component)kv.Value).GetComponent(); if (component != null && (int)component.BossType == 0) { return !kv.Key.Contains("meat"); } } return false; }).ToDictionary((KeyValuePair kv) => kv.Key, (KeyValuePair kv) => kv.Value); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Spawnable creatures: " + string.Join(", ", creatures.Keys.OrderBy((string k) => k)))); List list = (from s in _pool.Value.Split(',') select s.Replace(" ", "").ToLower() into s where s.Length > 0 select s).ToList(); if (list.Count == 0) { List> source2 = creatures.Where((KeyValuePair kv) => IsHostile(((Component)kv.Value).GetComponent())).ToList(); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Default pool (hostile): " + string.Join(", ", source2.Select((KeyValuePair kv) => kv.Key + "(" + ((object)((Component)kv.Value).GetComponent()).GetType().Name + ")")))); return source2.Select((KeyValuePair kv) => kv.Value).ToList(); } foreach (string item in list.Where((string w) => !creatures.ContainsKey(w))) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("CreaturePool: unknown creature '" + item + "'")); } return (from w in list.Where(creatures.ContainsKey) select creatures[w]).ToList(); } private static EnemyKind PickKind(int wave) { (EnemyKind, float)[] array = Mix.Where(((EnemyKind kind, float weight) m) => EnemyCatalog.Of(m.kind).FirstWave <= wave).ToArray(); float num = Random.Range(0f, array.Sum(((EnemyKind kind, float weight) m) => m.weight)); (EnemyKind, float)[] array2 = array; for (int num2 = 0; num2 < array2.Length; num2++) { (EnemyKind, float) tuple = array2[num2]; num -= tuple.Item2; if (num <= 0f) { return tuple.Item1; } } return EnemyKind.Runner; } public static int KillReward(EnemyTag tag, int wave) { return Siege.Money(Enemies.StatsOf(tag).Reward + wave / 4); } public static int SettleBonus(int waves) { if (waves <= 0) { return 0; } return Siege.Money(100 * waves); } public static int CorpseValue(int killReward) { return Siege.Money(3) + Mathf.RoundToInt((float)killReward * 1.5f); } public static int WaveBonus(int wave, int baseBonus = 25, float warChest = 0f) { return Siege.Money(Mathf.RoundToInt((float)(baseBonus + 6 * wave) * (1f + warChest))); } public static float HpMult(int wave, float hpPerWave = 0.4f) { float num = wave - 1; return 1f + hpPerWave * num + 0.05f * num * num + 0.0015f * num * num * num; } public static float BossHpMult(int wave) { return Mathf.Max(1f, (float)wave / 3f + (float)(wave * wave) / 900f); } public static (List<(EnemyKind kind, bool elite)> plan, int extras, float hpMult) PlanWave(int wave, int players, int baseCount, int perWave, float hpPerWave, bool seaPool) { float num = 1f + 0.4f * (float)(Mathf.Max(1, players) - 1); int num2 = Mathf.RoundToInt((float)Mathf.Min(36, baseCount + perWave * (wave - 1) + 2 * Mathf.Max(0, wave - 8)) * num); float item = HpMult(wave, hpPerWave); bool num3 = wave % 10 == 0; bool flag = !num3 && (wave % 5 == 0 || (wave > 10 && wave % 3 == 0)); List<(EnemyKind, bool)> list = new List<(EnemyKind, bool)>(); if (num3) { list.Add((EnemyCatalog.BossFor(wave), false)); num2 /= 2; } int num4 = (flag ? (2 + wave / 10) : 0) + Mathf.RoundToInt((float)num2 * Mathf.Clamp01((float)(wave - 15) / 100f)); for (int i = 0; i < num2; i++) { list.Add((PickKind(wave), i < num4)); } return (plan: list, extras: seaPool ? Mathf.Min(12, 1 + wave / 3) : 0, hpMult: item); } private void SpawnWave(int wave, bool onTop = false) { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) _waveStarted = Time.time; _requiredSpawned = false; if (!onTop) { _required.Clear(); _stackFrom = wave; } (List<(EnemyKind kind, bool elite)> plan, int extras, float hpMult) tuple = PlanWave(wave, PlayerManager.Players.Count, _baseCount.Value, _countPerWave.Value, _hpPerWave.Value, _poolPrefabs.Count > 0); List<(EnemyKind, bool)> item = tuple.plan; int item2 = tuple.extras; float hpMult = (_hpMult = tuple.hpMult); bool num = item.Count > 0 && EnemyCatalog.IsBoss(item[0].Item1); bool flag = item.Any<(EnemyKind, bool)>(((EnemyKind kind, bool elite) p) => p.elite); Vector3 position = Player.LocalPlayer.Transform.position; Vector3 corePos = Siege.Instance.CorePos; bool flag2 = FortressIsland.Instance.Exists && FortressIsland.Instance.OnIsland(corePos); Item walkerPrefab = _walkerPrefabs.FirstOrDefault(); int num2 = Random.Range(0, 3); List<(EnemyKind, bool)> list = item.OrderBy<(EnemyKind, bool), int>(((EnemyKind kind, bool elite) p) => (!EnemyCatalog.IsBoss(p.kind)) ? 1 : 0).ThenBy<(EnemyKind, bool), float>(((EnemyKind kind, bool elite) _) => Random.value).ToList(); _spawning = true; _requiredSpawned = list.Count > 0 || _required.Count > 0; if (num && flag2) { EnemyKind kind = EnemyCatalog.BossFor(wave); (EnemyKind, bool) item3 = list.FirstOrDefault<(EnemyKind, bool)>(((EnemyKind kind, bool elite) p) => p.kind == kind); list.Remove(item3); Fx.Send(FxKind.BossIntro, FortressIsland.Instance.Center, BossSpot(kind, num2), wave, (int)kind); ((MonoBehaviour)this).StartCoroutine(BossArrives(kind, num2, hpMult, corePos, walkerPrefab, wave, list, item2, position)); } else { ((MonoBehaviour)this).StartCoroutine(SpawnBursts(list, num2, hpMult, flag2, corePos, walkerPrefab, item2, position, wave)); Fx.Announce(flag ? "eliteBanner" : "waveBanner", wave); } Say(L10n.T("wave", wave, item.Count + item2, hpMult.ToString("0.##"))); Shot("wave" + wave, 4f); } private IEnumerator BossArrives(EnemyKind kind, int gap, float hpMult, Vector3 core, Item walkerPrefab, int wave, List<(EnemyKind kind, bool elite)> rest, int extras, Vector3 host) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(Reveal.BossSpawnAt(wave)); if (!_running || _wave != wave) { _spawning = false; yield break; } ServerSpawnBoss(kind, hpMult, gap, wave, Reveal.BossSeconds(wave) - Reveal.BossSpawnAt(wave)); yield return (object)new WaitForSeconds(Reveal.BossSeconds(wave) - Reveal.BossSpawnAt(wave)); if (_running && _wave == wave) { yield return SpawnBursts(rest, gap + 1, hpMult, island: true, core, walkerPrefab, extras, host, wave); } else { _spawning = false; } } public static Vector3 BossSpot(EnemyKind kind, int gap) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0081: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_015c: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; Vector3 val = ((Object.op_Implicit((Object)(object)instance) && instance.Exists) ? instance.Center : Siege.Instance.CorePos); float num = FortressIsland.GapAngles[(gap % 3 + 3) % 3] * (MathF.PI / 180f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); switch (EnemyCatalog.BodyOf(kind)) { case EnemyCatalog.Body.Sea: { Vector3 val7 = val + val2 * 31f; val7.y = WaterManager.GetWaterHeight(val7); return val7; } case EnemyCatalog.Body.Sky: { Vector3 val5 = val + val2 * 25f; RaycastHit val6 = default(RaycastHit); val5.y = Mathf.Max(WaterManager.GetWaterHeight(val5), Physics.Raycast(val5 + Vector3.up * 30f, Vector3.down, ref val6, 60f, LayerMask.op_Implicit(GameInfo.LevelLayer)) ? ((RaycastHit)(ref val6)).point.y : 0f) + 5f; return val5; } default: { Vector3 val3 = val + val2 * 22.5f + Vector3.up * 10f; RaycastHit val4 = default(RaycastHit); if (!Physics.Raycast(val3, Vector3.down, ref val4, 20f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { return val3 - Vector3.up * 9f; } return ((RaycastHit)(ref val4)).point; } } } private IEnumerator SpawnBursts(List<(EnemyKind kind, bool elite)> plan, int gapStart, float hpMult, bool island, Vector3 core, Item walkerPrefab, int extras, Vector3 host, int wave) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) for (int burst = 0; burst < 3; burst++) { if (!_running) { break; } if (_wave != wave) { break; } for (int i = burst; i < plan.Count; i += 3) { (EnemyKind kind, bool elite) tuple = plan[i]; EnemyKind item = tuple.kind; bool item2 = tuple.elite; int gap = (gapStart + i) % 3; if (EnemyCatalog.IsBoss(item)) { ServerSpawnBoss(item, hpMult, gap, wave, 0f); continue; } if (!Object.op_Implicit((Object)(object)walkerPrefab)) { break; } Vector3 pos; if (item == EnemyKind.Spitter && island) { pos = FortressIsland.Instance.SpitterSpot(); } else if (island) { if (!FortressIsland.Instance.WalkerSpawn(gap, out pos)) { continue; } } else if (!FindLandAround(core, _walkerRadius.Value, out pos)) { if (!_warnedNoLand) { _warnedNoLand = true; Say(L10n.T("noLand")); } continue; } Creature val = SpawnCreature(walkerPrefab, pos, 0f, Enemies.StatsOf(new EnemyTag { Kind = item, Elite = item2 }).BaseHp * hpMult); Enemies.Instance.ServerTag(val, item, item2); Siege.Instance.RegisterWalker(val); if (item != EnemyKind.Spitter) { _required.Add(val); } AutoTest.Count("spawned_" + item.ToString() + (item2 ? "_elite" : "")); } if (burst == 0) { for (int j = 0; j < extras; j++) { Item val2 = _poolPrefabs[Random.Range(0, _poolPrefabs.Count)]; Vector3 pos2 = (island ? FortressIsland.Instance.SeaSpawn() : FindSpawnPos(host, _radius.Value, WalksOnLand(((Component)val2).GetComponent()))); SpawnCreature(val2, pos2, 0f, 25f * hpMult); AutoTest.Count("sea_spawned"); } } if (burst < 2) { yield return (object)new WaitForSeconds(3.5f); } } _spawning = false; } private Creature SpawnCreature(Item prefab, Vector3 pos, float hpMult, float hp = 0f, float yaw = float.NaN) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) Item val = Object.Instantiate(prefab, pos, Quaternion.Euler(0f, float.IsNaN(yaw) ? Random.Range(0f, 360f) : yaw, 0f)); Creature creature = val.Creature; creature._hp.Value = Mathf.Max(1, Mathf.RoundToInt((hp > 0f) ? hp : ((float)creature.MaxHp * hpMult))); MaxHpOf[creature] = creature._hp.Value; ((NetworkBehaviour)Server.Instance).Spawn(((Component)val).gameObject, (NetworkConnection)null, default(Scene)); _alive.Add(creature); return creature; } public Creature ServerSpawnBoss(EnemyKind kind, float hpMult, int gap, int wave, float hold) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) int hp = Mathf.Max(1, Mathf.RoundToInt(EnemyCatalog.Of(kind).BaseHp * hpMult * BossHpMult(wave) * (1f + 0.5f * (float)(Mathf.Max(1, PlayerManager.Players.Count) - 1)))); Vector3 val = BossSpot(kind, gap); Vector3 val2 = (Siege.Instance.CorePos - val).Flat(); Vector3 home; Creature val3 = ServerSpawnPuppet(kind, val, Quaternion.LookRotation((((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val2)).normalized : Vector3.forward), hp, BossBrain.ArrivalOffset(kind, val, (Object.op_Implicit((Object)(object)FortressIsland.Instance) && FortressIsland.Instance.Exists) ? FortressIsland.Instance.Center : Siege.Instance.CorePos), out home); if (!Object.op_Implicit((Object)(object)val3)) { return null; } _required.Add(val3); Bosses.Instance.ServerAdd(val3, kind, wave, hold, home); return val3; } public Creature ServerSpawnPuppet(EnemyKind kind, Vector3 at, Quaternion rot, int hp) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Vector3 home; return ServerSpawnPuppet(kind, at, rot, hp, Vector3.zero, out home); } public Creature ServerSpawnPuppet(EnemyKind kind, Vector3 at, Quaternion rot, int hp, Vector3 offset, out Vector3 home) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_00a9: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00cd: 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_00e4: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0176: Unknown result type (might be due to invalid IL or missing references) home = at; if (!((Dictionary)AccessTools.Field(typeof(GameInfo), "_nameToSpawnable").GetValue(null)).TryGetValue(BossLooks.BodyOf(kind) ?? "", out var value) || !Object.op_Implicit((Object)(object)value)) { ((BaseUnityPlugin)this).Logger.LogWarning((object)$"no body for {kind}"); return null; } Item val = Object.Instantiate(value, at, rot * BossLooks.Turn(kind)); ((Component)val).transform.localScale = Vector3.one * EnemyCatalog.Of(kind).Scale; Transform transform = ((Component)val).transform; Vector3 position = transform.position; Vector3 up = Vector3.up; float y = at.y; Bounds val2 = BossLooks.WorldBounds(((Component)val).transform); transform.position = position + up * (y - ((Bounds)(ref val2)).min.y); home = ((Component)val).transform.position; Transform transform2 = ((Component)val).transform; transform2.position += offset; Rigidbody[] componentsInChildren = ((Component)val).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].isKinematic = true; } Creature component = ((Component)val).GetComponent(); component._hp.Value = hp; MaxHpOf[component] = hp; Bosses.Puppets.Add(component); IgnoreWater.Invoke(component) = true; ((NetworkBehaviour)Server.Instance).Spawn(((Component)val).gameObject, (NetworkConnection)null, default(Scene)); _alive.Add(component); Enemies.Instance.ServerTag(component, kind, elite: false); AutoTest.Count("spawned_" + kind); return component; } public Creature ServerSpawnMinion(EnemyKind kind, Vector3 pos) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_006b: Unknown result type (might be due to invalid IL or missing references) Item val = _walkerPrefabs.FirstOrDefault(); if (!_running || !Object.op_Implicit((Object)(object)val)) { return null; } RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(pos + Vector3.up * 4f, Vector3.down, ref val2, 10f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { pos = ((RaycastHit)(ref val2)).point + Vector3.up * 0.5f; } Creature val3 = SpawnCreature(val, pos, 0f, EnemyCatalog.Of(kind).BaseHp * _hpMult); Enemies.Instance.ServerTag(val3, kind, elite: false); Siege.Instance.RegisterWalker(val3); _required.Add(val3); AutoTest.Count("spawned_" + kind); return val3; } private static bool FindLandAround(Vector3 center, float radius, out Vector3 pos) { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) RaycastHit val2 = default(RaycastHit); for (float num = radius; num >= 8f; num -= 4f) { for (int i = 0; i < 8; i++) { float num2 = Random.Range(0f, MathF.PI * 2f); Vector3 val = center + new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)) * num; if (Physics.Raycast(new Vector3(val.x, center.y + 40f, val.z), Vector3.down, ref val2, 120f, LayerMask.op_Implicit(GameInfo.LevelLayer)) && ((RaycastHit)(ref val2)).point.y > WaterManager.GetWaterHeight(((RaycastHit)(ref val2)).point) + 0.3f) { pos = ((RaycastHit)(ref val2)).point + Vector3.up; return true; } } } pos = default(Vector3); return false; } private static bool WalksOnLand(Creature c) { if (!(c is RunningFish)) { return c is Crab; } return true; } private static bool IsHostile(Creature c) { if (!(c is AttackingFish) && !(c is RunningFish)) { return c is Crab; } return true; } private static Vector3 FindSpawnPos(Vector3 center, float radius, bool wantLand) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_003b: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00eb: Unknown result type (might be due to invalid IL or missing references) Vector3 result = center + Vector3.forward * radius; RaycastHit val2 = default(RaycastHit); for (int num = 0; num < 12; num++) { float num2 = Random.Range(0f, MathF.PI * 2f); Vector3 val = center + new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)) * radius; float waterHeight = WaterManager.GetWaterHeight(val); int num3; ? val3; if (Physics.Raycast(new Vector3(val.x, center.y + 40f, val.z), Vector3.down, ref val2, 120f, LayerMask.op_Implicit(GameInfo.LevelLayer))) { num3 = ((((RaycastHit)(ref val2)).point.y > waterHeight + 0.3f) ? 1 : 0); if (num3 != 0) { val3 = ((RaycastHit)(ref val2)).point + Vector3.up * 1f; goto IL_00e0; } } else { num3 = 0; } val3 = new Vector3(val.x, waterHeight - 0.5f, val.z); goto IL_00e0; IL_00e0: Vector3 val4 = (Vector3)val3; if (num == 0) { result = val4; } if (num3 == (wantLand ? 1 : 0)) { return val4; } } return result; } private void Say(string msg) { ((BaseUnityPlugin)this).Logger.LogInfo((object)msg); try { Server.Instance.SendChatMessage(L10n.T("prefix") + " " + msg, (NetworkConnection)null); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Chat broadcast failed: " + ex.Message)); ChatManager.ChatMessage(L10n.T("prefix") + " " + msg); } } } [HarmonyPatch(typeof(PlayerDying), "MouseClick")] internal static class NoSelfRespawn { private static float _nextHint; private static bool Prefix() { if (!Object.op_Implicit((Object)(object)Siege.Instance) || !Siege.Instance.ViewActive || PlayerManager.AlivePlayers.Count == 0) { return true; } if (Time.time >= _nextHint) { _nextHint = Time.time + 4f; ChatManager.ChatMessage(L10n.T("prefix") + " " + L10n.T("downNoGiveUp")); } AutoTest.Count("give_up_blocked"); return false; } } public enum FxKind : byte { Tracer, Cannonball, Blast, Spit, Announce, Harpoon, Mortar, Zap, Burn, Scoop, Sell, Heal, Dust, Wave, Decoy, Snipe, Flame, Proc, Beam, Gas, Boomerang, Shark, Bubble, Hook, Whirl, Sonic, WeaponHit, Victory, Crash, Net, Jelly, Water, Puffer, Star, Claw, Absorb, PieceLost, DeathMark, BossIntro, BossFx, Rocket, Mend, Absorber, Drip, Gatling } public struct FxEvent : IBroadcast { public FxKind Kind; public Vector3 From; public Vector3 To; public int PieceId; public string Key; public int Arg; public int Who; } public class Fx : MonoBehaviour { private static Fx _instance; private NetworkManager _registeredOn; private Material _tracer; private Material _ball; private Material _blast; private Material _spit; private Material _bolt; private Material _zap; private Material _fire; private Material _heal; private Material _dust; private Material _water; public const float SameGap = 0.06f; public const float Window = 0.25f; public const int PerWindow = 12; private static readonly Dictionary LastPlayed; private static float _windowAt; private static int _inWindow; public static readonly List<(Vector3 pos, float until, string who)> DeathMarks; private readonly List _lost = new List(); private bool _flushing; public const float SpitFlight = 0.8f; public const float MortarFlight = 1.3f; private static readonly Stack Cubes; private static readonly Stack Spheres; public static Fx Instance => _instance; static Fx() { LastPlayed = new Dictionary(); _windowAt = float.MinValue; DeathMarks = new List<(Vector3, float, string)>(); Cubes = new Stack(); Spheres = new Stack(); GenericWriter.SetWrite((Action)delegate(Writer w, FxEvent v) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) w.WriteByte((byte)v.Kind); w.WriteVector3(v.From); w.WriteVector3(v.To); w.WriteInt32(v.PieceId); w.WriteString(v.Key ?? ""); w.WriteInt32(v.Arg); w.WriteInt32(v.Who); }); GenericReader.SetRead((Func)((Reader r) => new FxEvent { Kind = (FxKind)r.ReadByte(), From = r.ReadVector3(), To = r.ReadVector3(), PieceId = r.ReadInt32(), Key = r.ReadString(), Arg = r.ReadInt32(), Who = r.ReadInt32() })); } private void Awake() { _instance = this; } public static void Send(FxKind kind, Vector3 from, Vector3 to, int pieceId = 0, int damage = 0, int who = 0) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(new FxEvent { Kind = kind, From = from, To = to, PieceId = pieceId, Arg = damage, Who = who }, true, (Channel)0); } } public static void Sound(string clip, Vector3 at, float volume = 1f, AudioDistance dist = (AudioDistance)2) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (!MayPlay(clip, Time.unscaledTime)) { return; } try { AudioManager.PlayClipAt(clip, at, true, dist, volume, 0.1f); } catch { } } public static void SoundRandom(string prefix, int min, int max, Vector3 at, float volume = 1f, AudioDistance dist = (AudioDistance)2) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!MayPlay(prefix, Time.unscaledTime)) { return; } try { AudioManager.PlayRandomClipAt(prefix, min, max, at, true, dist, volume, 0.1f); } catch { } } public static bool MayPlay(string clip, float now) { if (LastPlayed.TryGetValue(clip ?? "", out var value) && now - value < 0.06f && now >= value) { return false; } if (now - _windowAt >= 0.25f || now < _windowAt) { _windowAt = now; _inWindow = 0; } if (_inWindow >= 12) { return false; } _inWindow++; LastPlayed[clip ?? ""] = now; return true; } private IEnumerator DeathPillar(Vector3 at, int playerId) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Player who = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).ObjectId == playerId)); string item = (Object.op_Implicit((Object)(object)who) ? Loot.NameOf(who) : ""); (Vector3 at, float, string name) mark = (at: at, Time.time + 120f, name: item); DeathMarks.Add(mark); Transform pillar = WeaponFx.Piece(WeaponFx.Cyl, BossVfx.Glow(new Color(1f, 0.78f, 0.25f))); pillar.position = at + Vector3.up * 15f; pillar.localScale = new Vector3(0.18f, 15f, 0.18f); bool backAlive = false; for (float t = 0f; t < 120f; t += 0.25f) { if (!Object.op_Implicit((Object)(object)pillar)) { break; } pillar.localScale = new Vector3(0.18f + 0.04f * Mathf.Sin(t * 3f), 15f, 0.18f + 0.04f * Mathf.Sin(t * 3f)); if (Object.op_Implicit((Object)(object)who) && Object.op_Implicit((Object)(object)who.Transform) && !who.Dying.IsDead) { if (backAlive) { Vector3 val = (who.Transform.position - at).Flat(); if (((Vector3)(ref val)).magnitude < 3f) { break; } } backAlive = true; } yield return (object)new WaitForSeconds(0.25f); } DeathMarks.Remove(mark); if (Object.op_Implicit((Object)(object)pillar)) { Object.Destroy((Object)(object)((Component)pillar).gameObject); } } private IEnumerator FlushLost() { _flushing = true; yield return (object)new WaitForSeconds(0.5f); ChatManager.ChatMessage("" + L10n.T("towersLost", string.Join("、", _lost)) + ""); Vector3 at = ((Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Player.LocalPlayer.Transform)) ? Player.LocalPlayer.Transform.position : Vector3.zero); Sound("Error", at, 0.6f, (AudioDistance)2); _lost.Clear(); _flushing = false; } public static void Announce(string key, int arg = 0) { if (InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(new FxEvent { Kind = FxKind.Announce, Key = key, Arg = arg }, true, (Channel)0); } } public static void BossFight(EnemyKind kind, bool down, int seconds, int playersPct, int takenPct) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(new FxEvent { Kind = FxKind.Announce, Key = (down ? "bossFightDown" : "bossFightCrashed"), Arg = seconds, PieceId = playersPct, Who = (int)kind, From = new Vector3((float)takenPct, 0f, 0f) }, true, (Channel)0); } } private void Update() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ClientManager.RegisterBroadcast((Action)delegate(FxEvent e, Channel ch) { Play(e); }); } } private void Play(FxEvent e) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0d29: Unknown result type (might be due to invalid IL or missing references) //IL_0d46: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_0868: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Unknown result type (might be due to invalid IL or missing references) //IL_08a9: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_08e5: Unknown result type (might be due to invalid IL or missing references) //IL_08fe: Unknown result type (might be due to invalid IL or missing references) //IL_0909: Unknown result type (might be due to invalid IL or missing references) //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09de: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) //IL_0a4e: Unknown result type (might be due to invalid IL or missing references) //IL_0a59: Unknown result type (might be due to invalid IL or missing references) //IL_0b2f: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b70: Unknown result type (might be due to invalid IL or missing references) //IL_0b98: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0bf8: Unknown result type (might be due to invalid IL or missing references) //IL_0c03: Unknown result type (might be due to invalid IL or missing references) //IL_0c20: Unknown result type (might be due to invalid IL or missing references) //IL_0be5: Unknown result type (might be due to invalid IL or missing references) //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cdf: Unknown result type (might be due to invalid IL or missing references) //IL_0ce4: Unknown result type (might be due to invalid IL or missing references) //IL_0cee: Unknown result type (might be due to invalid IL or missing references) //IL_0cf3: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Unknown result type (might be due to invalid IL or missing references) //IL_0a16: Unknown result type (might be due to invalid IL or missing references) //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a25: Unknown result type (might be due to invalid IL or missing references) //IL_0a2a: Unknown result type (might be due to invalid IL or missing references) //IL_096c: Unknown result type (might be due to invalid IL or missing references) //IL_0977: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Unknown result type (might be due to invalid IL or missing references) //IL_0986: Unknown result type (might be due to invalid IL or missing references) //IL_098b: Unknown result type (might be due to invalid IL or missing references) //IL_0aa4: Unknown result type (might be due to invalid IL or missing references) //IL_0a7e: Unknown result type (might be due to invalid IL or missing references) //IL_0d0a: Unknown result type (might be due to invalid IL or missing references) //IL_0d0f: Unknown result type (might be due to invalid IL or missing references) //IL_0ac6: Unknown result type (might be due to invalid IL or missing references) //IL_0ad8: Unknown result type (might be due to invalid IL or missing references) //IL_0ae3: Unknown result type (might be due to invalid IL or missing references) //IL_09a8: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0c48: Unknown result type (might be due to invalid IL or missing references) //IL_0c53: Unknown result type (might be due to invalid IL or missing references) //IL_0c61: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0cab: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) if (e.Kind == FxKind.DeathMark) { ((MonoBehaviour)this).StartCoroutine(DeathPillar(e.From, e.Who)); Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).ObjectId == e.Who)); if ((Object)(object)val == (Object)(object)Player.LocalPlayer) { ChatManager.ChatMessage(L10n.T("prefix") + " " + L10n.T("downSelf")); } else if (Object.op_Implicit((Object)(object)val)) { ChatManager.ChatMessage(L10n.T("prefix") + " " + L10n.T("downOther", Loot.NameOf(val))); } return; } if (e.Kind == FxKind.PieceLost) { _lost.Add(BuildSystem.PieceName((PieceType)e.Arg, e.Who) + " Lv" + e.Who); if (!_flushing) { ((MonoBehaviour)this).StartCoroutine(FlushLost()); } return; } if (e.Kind == FxKind.Announce) { if (e.Key == "bossFightDown" || e.Key == "bossFightCrashed") { ChatManager.ChatMessage(L10n.T(e.Key, L10n.T("bossName" + (EnemyKind)e.Who/*cast due to .constrained prefix*/), e.Arg, e.PieceId, 100 - e.PieceId, Mathf.RoundToInt(e.From.x))); return; } if (Object.op_Implicit((Object)(object)FortressIsland.Instance)) { FortressIsland.Instance.Banner(L10n.T(e.Key, e.Arg), 3.5f); } Vector3 at = ((Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Player.LocalPlayer.Transform)) ? Player.LocalPlayer.Transform.position : Vector3.zero); if (e.Key == "clearedBanner") { Sound("WinRound", at, 0.8f, (AudioDistance)3); } else { Sound("QuestReceived", at, 0.9f, (AudioDistance)3); } return; } if (e.Kind == FxKind.Absorber) { if (Object.op_Implicit((Object)(object)BossFx.Instance)) { BossMoves.PlayAbsorber(BossFx.Instance, e); } return; } if (((int)e.Kind >= 18 && (int)e.Kind <= 26) || ((int)e.Kind >= 29 && (int)e.Kind <= 34) || e.Kind == FxKind.Rocket || e.Kind == FxKind.Drip || e.Kind == FxKind.Gatling) { if (Object.op_Implicit((Object)(object)Weapons.Instance)) { Weapons.Instance.PlayFx(e); } return; } if (e.Kind == FxKind.Absorb) { ((MonoBehaviour)this).StartCoroutine(Swallow.View(e)); return; } if (e.Kind == FxKind.BossIntro) { Reveal.Instance.Boss((EnemyKind)e.Arg, e.To, e.From, e.PieceId); return; } if (e.Kind == FxKind.BossFx) { if (Object.op_Implicit((Object)(object)BossFx.Instance)) { BossFx.Instance.Play(e); } return; } if (e.Arg > 0 && e.Kind != FxKind.Proc && e.Kind != FxKind.Decoy) { try { PlayerUI.AddDamageNumber(e.To + Vector3.up * 0.8f, e.Arg, false); } catch { } } if (!Object.op_Implicit((Object)(object)_tracer)) { _tracer = Models.Make(new Color(1f, 0.85f, 0.4f), new Color(1f, 0.7f, 0.2f)); _ball = Models.Make(new Color(0.15f, 0.15f, 0.15f)); _blast = Models.Make(new Color(1f, 0.55f, 0.1f), new Color(1f, 0.5f, 0.1f)); _spit = Models.Make(new Color(0.35f, 0.85f, 0.4f), new Color(0.2f, 0.6f, 0.25f)); _bolt = Models.Make(new Color(0.75f, 0.78f, 0.82f)); _zap = Models.Make(new Color(0.55f, 0.85f, 1f), new Color(0.4f, 0.8f, 1f)); _fire = Models.Make(new Color(1f, 0.45f, 0.1f), new Color(1f, 0.4f, 0.05f)); _heal = Models.Make(new Color(0.45f, 1f, 0.5f), new Color(0.3f, 1f, 0.4f)); _dust = Models.Make(new Color(0.62f, 0.5f, 0.36f)); _water = Models.Make(new Color(0.55f, 0.8f, 1f), new Color(0.4f, 0.7f, 1f)); } if (e.PieceId != 0 && e.Kind != FxKind.Scoop) { AimTurret(e.PieceId, e.To); } switch (e.Kind) { case FxKind.Tracer: ((MonoBehaviour)this).StartCoroutine(Tracer(e.From, e.To)); SoundRandom("SMGFireOutside_V", 1, 4, e.From, 0.35f, (AudioDistance)2); break; case FxKind.Cannonball: ((MonoBehaviour)this).StartCoroutine(Arc(e.From, e.To, _ball, 0.35f, 0.35f, 1.5f, blastAtEnd: true)); SoundRandom("ShotgunFireOutside_0", 1, 4, e.From, 0.8f, (AudioDistance)2); break; case FxKind.Spit: ((MonoBehaviour)this).StartCoroutine(Arc(e.From, e.To, _spit, 0.3f, 0.8f, 2.5f, blastAtEnd: false)); SoundRandom("PiranhaVomit_V", 1, 3, e.From, 0.8f, (AudioDistance)2); break; case FxKind.Blast: ((MonoBehaviour)this).StartCoroutine(Blast(e.To, 3.5f)); Sound("Explosion", e.To, 1f, (AudioDistance)3); break; case FxKind.Harpoon: ((MonoBehaviour)this).StartCoroutine(Bolt(e.From, e.To)); SoundRandom("BowShoot_0", 1, 4, e.From, 0.9f, (AudioDistance)2); break; case FxKind.Mortar: ((MonoBehaviour)this).StartCoroutine(Arc(e.From, e.To, _ball, 0.45f, 1.3f, 9f, blastAtEnd: true)); Sound("BoatFire", e.From, 0.8f, (AudioDistance)2); break; case FxKind.Zap: ((MonoBehaviour)this).StartCoroutine(Zap(e.From, e.To)); if (e.PieceId != 0) { Sound("Ignite", e.From, 0.6f, (AudioDistance)2); } break; case FxKind.Scoop: if (!Object.op_Implicit((Object)(object)Weapons.Instance) || !Weapons.Instance.OnScoop(e)) { ((MonoBehaviour)this).StartCoroutine(Fly(e.From, e.To + Vector3.up * 1.2f)); } SoundRandom("PickUp_V", 1, 3, e.To, 0.7f, (AudioDistance)1); break; case FxKind.Sell: SoundRandom("Sell_0", 1, 3, e.To, 1f, (AudioDistance)2); ((MonoBehaviour)this).StartCoroutine(Blast(e.To + Vector3.up, 1.6f, _tracer)); break; case FxKind.Burn: if (!ClientSettings.Reduced) { ((MonoBehaviour)this).StartCoroutine(Blast(e.To + Random.insideUnitSphere * 1.5f, 1.4f, _fire)); } break; case FxKind.Heal: ((MonoBehaviour)this).StartCoroutine(Zap(e.From, e.To, _heal)); if (!ClientSettings.Reduced) { ((MonoBehaviour)this).StartCoroutine(Blast(e.To, 0.9f, _heal)); } Sound("QuestReceived", e.To, 0.25f, (AudioDistance)1); break; case FxKind.Mend: AimTurret(e.PieceId, e.To); ((MonoBehaviour)this).StartCoroutine(Zap(e.From, e.To, _heal)); if (!ClientSettings.Reduced) { ((MonoBehaviour)this).StartCoroutine(Blast(e.To, 0.6f, _heal)); } break; case FxKind.Dust: ((MonoBehaviour)this).StartCoroutine(Blast(e.To, 2.2f, _dust)); SoundRandom("ItemImpactHeavy_V", 1, 3, e.To, 0.8f, (AudioDistance)2); break; case FxKind.Wave: ((MonoBehaviour)this).StartCoroutine(Blast(e.To, 6f, _water)); SoundRandom("WhaleLanding_0", 1, 3, e.To, 1f, (AudioDistance)3); break; case FxKind.Decoy: ((MonoBehaviour)this).StartCoroutine(Duck(e.To, e.Arg)); break; case FxKind.Proc: GearCards.Instance.Proc((Gear)e.Arg, e.To); break; case FxKind.Snipe: ((MonoBehaviour)this).StartCoroutine(Tracer(e.From, e.To)); SoundRandom("SniperrifleFireOutside_V", 1, 4, e.From, 0.9f, (AudioDistance)3); break; case FxKind.Flame: { for (int num = ((!ClientSettings.Reduced) ? 1 : 3); num <= 3; num++) { ((MonoBehaviour)this).StartCoroutine(Blast(Vector3.Lerp(e.From, e.To, (float)num / 3f), 0.6f + 0.35f * (float)num, _fire)); } if (Random.value < 0.3f) { Sound("Ignite", e.From, 0.5f, (AudioDistance)2); } break; } case FxKind.Victory: ((MonoBehaviour)this).StartCoroutine(Fireworks(e.To)); Reveal.Instance.Victory(e.To - Vector3.up * 6f); break; case FxKind.Crash: try { ParticleManager.Play("BigExplosion", e.To, Vector3.up); } catch { } Sound("Explosion", e.To, 1f, (AudioDistance)3); SoundRandom("WhaleLanding_0", 1, 3, e.To, 1f, (AudioDistance)3); break; } } private IEnumerator Fireworks(Vector3 at) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Sound("CasinoWinEpic", at, 1f, (AudioDistance)3); string[] kinds = new string[3] { "Confetti", "RedConfetti", "GreenConfetti" }; for (int i = 0; i < 14; i++) { Vector3 val = at + new Vector3(Random.Range(-6f, 6f), Random.Range(0f, 5f), Random.Range(-6f, 6f)); try { ParticleManager.Play(kinds[i % kinds.Length], val, Vector3.up); } catch { } if (i % 3 == 0) { SoundRandom("ItemImpactHeavy_V", 1, 3, val, 0.4f, (AudioDistance)2); } yield return (object)new WaitForSeconds(0.35f); } } private static void AimTurret(int pieceId, Vector3 target) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) GameObject val = BuildSystem.Instance.PieceObject(pieceId); Transform val2 = (Object.op_Implicit((Object)(object)val) ? val.transform.Find("Head") : null); if (Object.op_Implicit((Object)(object)val2)) { Vector3 val3 = target - val2.position; val3.y = 0f; if (((Vector3)(ref val3)).sqrMagnitude > 0.01f) { val2.rotation = Quaternion.LookRotation(val3); } } } private static GameObject Shape(PrimitiveType type, Material mat) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Invalid comparison between Unknown and I4 //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 Stack stack = (((int)type == 3) ? Cubes : Spheres); GameObject val = null; while (stack.Count > 0 && !Object.op_Implicit((Object)(object)val)) { val = stack.Pop(); } if (!Object.op_Implicit((Object)(object)val)) { val = ((Component)WeaponFx.Piece(((int)type == 3) ? WeaponFx.Cube : WeaponFx.Ball, mat)).gameObject; ((Object)val).name = (((int)type == 3) ? "FortressFxCube" : "FortressFxBall"); Object.DontDestroyOnLoad((Object)(object)val); } val.GetComponent().sharedMaterial = mat; val.transform.localScale = Vector3.one; val.SetActive(true); return val; } private static void Done(GameObject go) { if (Object.op_Implicit((Object)(object)go)) { go.SetActive(false); Stack stack = ((((Object)go).name == "FortressFxCube") ? Cubes : Spheres); if (stack.Count < 200) { stack.Push(go); } else { Object.Destroy((Object)(object)go); } } } private IEnumerator Tracer(Vector3 from, Vector3 to) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject go = Shape((PrimitiveType)3, _tracer); Vector3 val = to - from; go.transform.SetPositionAndRotation(from + val * 0.5f, Quaternion.LookRotation(val)); go.transform.localScale = new Vector3(0.05f, 0.05f, ((Vector3)(ref val)).magnitude); yield return (object)new WaitForSeconds(0.05f); Done(go); } private IEnumerator Fly(Vector3 from, Vector3 to) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject go = Shape((PrimitiveType)0, _spit); go.transform.localScale = Vector3.one * 0.35f; for (float t = 0f; t < 0.3f; t += Time.deltaTime) { float num = t / 0.3f; go.transform.position = Vector3.Lerp(from, to, num) + Vector3.up * Mathf.Sin(num * MathF.PI) * 1.2f; go.transform.localScale = Vector3.one * 0.35f * (1f - num * 0.6f); yield return null; } Done(go); } private IEnumerator Bolt(Vector3 from, Vector3 to) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject go = Shape((PrimitiveType)3, _bolt); go.transform.localScale = new Vector3(0.08f, 0.08f, 1.4f); go.transform.rotation = Quaternion.LookRotation(to - from); for (float t = 0f; t < 0.3f; t += Time.deltaTime) { go.transform.position = Vector3.Lerp(from, to, t / 0.3f); yield return null; } Done(go); } private IEnumerator Duck(Vector3 at, float seconds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) GameObject go = new GameObject("FortressDecoy"); go.transform.position = at; Models.Attach("Decoy", go.transform, new Vector3(0.8f, 0.8f, 0.8f), new Vector3(0f, 0.4f, 0f)); Sound("QuestReceived", at, 0.6f, (AudioDistance)2); for (float t = 0f; t < seconds; t += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } go.transform.localScale = Vector3.one * (1f + 0.06f * Mathf.Sin(t * 9f)) * Mathf.Min(1f, (seconds - t) * 2f); go.transform.rotation = Quaternion.Euler(0f, Mathf.Sin(t * 2f) * 25f, Mathf.Sin(t * 5f) * 6f); yield return null; } if (Object.op_Implicit((Object)(object)go)) { Object.Destroy((Object)(object)go); } } private IEnumerator Zap(Vector3 from, Vector3 to, Material mat = null) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject[] parts = (GameObject[])(object)new GameObject[3]; Vector3 val = from; for (int i = 0; i < 3; i++) { Vector3 val2 = ((i == 2) ? to : (Vector3.Lerp(from, to, (float)(i + 1) / 3f) + Random.insideUnitSphere * 0.5f)); GameObject val3 = Shape((PrimitiveType)3, Object.op_Implicit((Object)(object)mat) ? mat : _zap); Vector3 val4 = val2 - val; val3.transform.SetPositionAndRotation(val + val4 * 0.5f, Quaternion.LookRotation(val4)); val3.transform.localScale = new Vector3(0.07f, 0.07f, ((Vector3)(ref val4)).magnitude); parts[i] = val3; val = val2; } yield return (object)new WaitForSeconds(0.09f); GameObject[] array = parts; for (int j = 0; j < array.Length; j++) { Done(array[j]); } } private IEnumerator Arc(Vector3 from, Vector3 to, Material mat, float size, float flight, float height, bool blastAtEnd) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject ball = Shape((PrimitiveType)0, mat); ball.transform.localScale = Vector3.one * size; for (float t = 0f; t < flight; t += Time.deltaTime) { float num = t / flight; ball.transform.position = Vector3.Lerp(from, to, num) + Vector3.up * Mathf.Sin(num * MathF.PI) * height; yield return null; } Done(ball); if (blastAtEnd) { Sound("Explosion", to, 0.6f, (AudioDistance)2); yield return Blast(to, 2.5f); } else { SoundRandom("ItemHitWaterMedium_V", 1, 3, to, 0.8f, (AudioDistance)2); yield return Blast(to, 1.2f, _spit); } } private IEnumerator Blast(Vector3 at, float maxSize, Material mat = null) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) GameObject blast = Shape((PrimitiveType)0, Object.op_Implicit((Object)(object)mat) ? mat : _blast); blast.transform.position = at; for (float t = 0f; t < 0.18f; t += Time.deltaTime) { float num = t / 0.18f; blast.transform.localScale = Vector3.one * Mathf.Lerp(0.4f, maxSize, num) * (1f - num * 0.3f); yield return null; } Done(blast); } } public enum Rarity : byte { Common, Rare, Epic, Legendary } public enum Expansion : byte { TeamSlot, PersonalSlot, Storage } public enum Gear : byte { Gunpowder, Scope, ApRounds, Incendiary, FrostCore, TeslaCoil, Rebar, CoreShield, WarChest, SharkArmor, BigNet, FishGloves, Gauntlet, ToolBelt, LuckyCharm, Overclock, FieldRepair, Decoy, NetCannon, Shockwave, Laser, PoisonGas, Boomerang, SharkWhistle, BubbleGun, Hook, Whirlpool, Conch, NetLauncher, JellyGun, WaterCannon, PufferBomb, StarThrower, LobsterClaw, Rocket, Pistol, Shotgun, Smg, Sniper, Rifle, Bow, Absorber, Gatling } public static class GearCatalog { public const int FortressSlots = 4; public const int PersonalSlots = 2; public const int ActiveSlots = 1; public const int WeaponSlots = 0; public static readonly (int scales, int best)[] TeamSlotPrices = new(int, int)[4] { (40, 15), (100, 30), (200, 50), (350, 70) }; public static readonly (int scales, int best)[] PersonalSlotPrices = new(int, int)[2] { (60, 25), (180, 55) }; public static readonly (int scales, int best)[] StoragePrices = new(int, int)[10] { (20, 0), (30, 5), (45, 10), (60, 15), (80, 20), (100, 25), (125, 30), (150, 35), (180, 40), (220, 45) }; public const int StorageBase = 30; public const int StorageStep = 10; public const int Stack = 50; public static readonly Gear[] All = (Gear[])Enum.GetValues(typeof(Gear)); public static readonly Rarity[] Rarities = (Rarity[])Enum.GetValues(typeof(Rarity)); public static readonly Gear[] WeaponKinds = All.Where(IsWeapon).ToArray(); public static readonly Gear[] Droppable = WeaponKinds.Where((Gear g) => !IsSpecial(g)).ToArray(); private static readonly float[][] Values = new float[43][] { new float[4] { 0.08f, 0.15f, 0.25f, 0.4f }, new float[4] { 0.08f, 0.15f, 0.22f, 0.3f }, new float[4] { 0.2f, 0.4f, 0.7f, 1f }, new float[4] { 2f, 4f, 7f, 12f }, new float[4] { 0.1f, 0.15f, 0.2f, 0.3f }, new float[4] { 1f, 2f, 3f, 4f }, new float[4] { 0.15f, 0.3f, 0.5f, 0.8f }, new float[4] { 0.2f, 0.4f, 0.7f, 1f }, new float[4] { 0.25f, 0.5f, 0.8f, 1.2f }, new float[4] { 0.1f, 0.2f, 0.3f, 0.45f }, new float[4] { 3f, 6f, 10f, 15f }, new float[4] { 0.1f, 0.2f, 0.35f, 0.5f }, new float[4] { 0.15f, 0.3f, 0.5f, 0.8f }, new float[4] { 0.05f, 0.1f, 0.15f, 0.25f }, new float[4] { 1.25f, 1.5f, 2f, 3f }, new float[4] { 7f, 8.5f, 10f, 12f }, new float[4] { 0.4f, 0.5f, 0.6f, 0.8f }, new float[4] { 10f, 12f, 14f, 16f }, new float[4] { 12f, 14f, 16f, 20f }, new float[4] { 1.5f, 1.8f, 2.2f, 3f }, new float[4] { 30f, 40f, 54f, 72f }, new float[4] { 4.5f, 6.5f, 9.5f, 15f }, new float[4] { 24f, 28f, 34f, 46f }, new float[4] { 60f, 78f, 102f, 105f }, new float[4] { 2f, 2.5f, 3f, 3.5f }, new float[4] { 23f, 30f, 39f, 51f }, new float[4] { 3f, 3.5f, 4f, 5f }, new float[4] { 4f, 4.5f, 5f, 6f }, new float[4] { 2.5f, 3f, 3.5f, 4.5f }, new float[4] { 12f, 16f, 22f, 32f }, new float[4] { 6f, 7f, 8.5f, 10f }, new float[4] { 60f, 82f, 112f, 115f }, new float[4] { 13f, 17f, 21f, 27f }, new float[4] { 90f, 126f, 174f, 180f }, new float[4] { 40f, 54f, 72f, 73f }, new float[4] { 1f, 1.4f, 1.9f, 2.6f }, new float[4] { 1f, 1.4f, 1.9f, 2.6f }, new float[4] { 1f, 1.4f, 1.9f, 2.6f }, new float[4] { 1f, 1.4f, 1.9f, 2.6f }, new float[4] { 1f, 1.4f, 1.9f, 2.6f }, new float[4] { 1f, 1.4f, 1.9f, 2.6f }, new float[4] { 18f, 24f, 31f, 40f }, new float[4] { 11.5f, 15f, 19f, 24f } }; private static readonly float[][] WeaponCooldowns = new float[23][] { new float[4], new float[4] { 2.2f, 2f, 1.8f, 1.5f }, new float[4], new float[4] { 34f, 30f, 26f, 22f }, new float[4] { 0.9f, 0.8f, 0.75f, 0.6f }, new float[4] { 2.2f, 2f, 1.7f, 1.2f }, new float[4] { 9f, 8f, 7f, 5.5f }, new float[4] { 4.5f, 4f, 3.5f, 2.6f }, new float[4] { 7f, 6f, 5.2f, 4f }, new float[4] { 3.8f, 3.4f, 3f, 2.4f }, new float[4], new float[4] { 3.8f, 3.4f, 3f, 2.6f }, new float[4] { 0.7f, 0.6f, 0.52f, 0.42f }, new float[4] { 1.9f, 1.7f, 1.4f, 1.1f }, new float[4] { 1.6f, 1.45f, 1.3f, 1.2f }, new float[4], new float[4], new float[4], new float[4], new float[4], new float[4], new float[4] { 0.9f, 0.8f, 0.7f, 0.55f }, new float[4] }; public static readonly int[] SalvageScales = new int[4] { 1, 3, 8, 20 }; public static readonly int[] AscendCosts = new int[3] { 4, 10, 50 }; public static readonly int[] EnhanceCosts = new int[5] { 15, 25, 40, 60, 90 }; public const int MaxEnhance = 5; public const float EnhanceStep = 0.1f; public static readonly float[] RollFirst = new float[4] { 70f, 22f, 7f, 1f }; public static readonly float[] RollLate = new float[4] { 35f, 35f, 22f, 8f }; public static (int scales, int best)[] PricesOf(Expansion e) { return e switch { Expansion.PersonalSlot => PersonalSlotPrices, Expansion.TeamSlot => TeamSlotPrices, _ => StoragePrices, }; } public static (int scales, int best)? NextPrice(Expansion e, int bought) { if (bought >= PricesOf(e).Length) { return null; } return PricesOf(e)[bought]; } public static bool IsFortress(Gear g) { return (int)g <= 8; } public static bool IsActive(Gear g) { if ((int)g >= 15) { return (int)g <= 19; } return false; } public static bool IsWeapon(Gear g) { return (int)g >= 20; } public static bool IsGameGun(Gear g) { if ((int)g >= 35) { return (int)g <= 40; } return false; } public static bool IsSpecial(Gear g) { return (int)g >= 41; } public static int SlotKind(Gear g) { if (!IsFortress(g)) { if (!IsActive(g)) { if (!IsWeapon(g)) { return 1; } return 3; } return 2; } return 0; } public static int SlotsOf(int kind) { return kind switch { 1 => 2, 0 => 4, _ => (kind == 2) ? 1 : 0, }; } public static float Cooldown(Gear g, Rarity r) { if (!IsWeapon(g)) { return 0f; } return WeaponCooldowns[(uint)(g - 20)][(uint)r]; } public static float Stacked(Gear g, IEnumerable worn) { float num = 0f; float num2 = 1f; int num3 = 0; foreach (float item in worn) { num3++; num += ((g == Gear.LuckyCharm) ? (item - 1f) : item); num2 *= 1f - item; } if (num3 != 0) { switch (g) { default: return num; case Gear.LuckyCharm: return 1f + num; case Gear.FrostCore: case Gear.SharkArmor: case Gear.ToolBelt: return 1f - num2; } } return 0f; } public static float Value(Gear g, Rarity r) { return Values[(uint)g][(uint)r]; } public static int AscendCost(Rarity r) { if ((int)r >= 3) { return -1; } return AscendCosts[(uint)r]; } private static bool IsPercent(Gear g) { if (g != Gear.Incendiary && g != Gear.TeslaCoil && g != Gear.BigNet && g != Gear.LuckyCharm && (!IsActive(g) || g == Gear.FieldRepair)) { return !IsWeapon(g); } return false; } public static string FormatValue(Gear g, Rarity r) { return FormatValue(g, Value(g, r)); } public static string FormatValue(Gear g, float v) { if (IsPercent(g)) { return Mathf.RoundToInt(v * 100f) + "%"; } if (g == Gear.LuckyCharm || IsGameGun(g)) { return "×" + v.ToString("0.##"); } if (g == Gear.BigNet || g == Gear.TeslaCoil) { return Mathf.RoundToInt(v).ToString(); } return v.ToString("0.#"); } public static string Name(Gear g) { return L10n.T("gear" + g); } public static string Effect(Gear g, Rarity r) { return Effect(g, r, Value(g, r)); } public static string Effect(Gear g, Rarity r, float v, float cooldownMult = 1f) { return L10n.T("gearFx" + g, FormatValue(g, v)) + ((Cooldown(g, r) > 0f) ? ("\u3000" + L10n.T("cooldown", (Cooldown(g, r) * cooldownMult).ToString("0.#")) + "") : ""); } public static string RarityName(Rarity r) { return L10n.T("rarity" + r); } public static Color Color(Rarity r) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) return (Color)(r switch { Rarity.Rare => new Color(0.29f, 0.64f, 1f), Rarity.Epic => new Color(0.71f, 0.36f, 1f), Rarity.Legendary => new Color(1f, 0.71f, 0.18f), _ => new Color(0.91f, 0.91f, 0.91f), }); } public static string Hex(Rarity r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ColorUtility.ToHtmlStringRGB(Color(r)); } public static string Label(Gear g, Rarity r) { return "[" + RarityName(r) + "] " + Name(g) + ""; } public static Rarity Roll(int wave, Rarity atLeast = Rarity.Common) { float num = Mathf.Clamp01((float)(wave - 1) / 19f); float[] array = new float[4] { Mathf.Lerp(RollFirst[0], RollLate[0], num), Mathf.Lerp(RollFirst[1], RollLate[1], num), Mathf.Lerp(RollFirst[2], RollLate[2], num), Mathf.Lerp(RollFirst[3], RollLate[3], num) }; for (int i = 0; i < (int)atLeast; i++) { array[i] = 0f; } float num2 = Random.value * array.Sum(); for (int j = 0; j < 4; j++) { if (num2 < array[j]) { return (Rarity)j; } num2 -= array[j]; } return Rarity.Legendary; } public static Gear RandomGear() { Gear gear = All[Random.Range(0, 34)]; if (!IsWeapon(gear)) { return gear; } return Droppable[Random.Range(0, Droppable.Length)]; } } public class StoredItem { public SavedItem Saved; public bool Dead; public int Worth; private static readonly CultureInfo Inv = CultureInfo.InvariantCulture; public byte Id => Saved.ItemID; private static string F(float f) { return f.ToString("R", Inv); } private static string B(bool b) { if (!b) { return "0"; } return "1"; } public string Write() { SavedItem saved = Saved; return $"{saved.ItemID} {B(Dead)} {F(saved.Cookness)} {F(saved.BettingMultiplier)} {F(saved.Weight)} {F(saved.KillScoreMultiplier)} {B(saved.IsDripCreature)} " + $"{saved.SkinIndex} {saved.Sharpness} {saved.Quiver} {saved.Sight} {saved.BarrelAttachment} {saved.AmmoType} {B(saved.ExtendedMag)} {B(saved.LaserSight)}"; } public static StoredItem Read(string id, string dead, string rest) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0121: Expected O, but got Unknown string[] f = rest.Split(' '); return new StoredItem { Dead = (dead == "1"), Saved = new SavedItem { Exists = true, ItemID = byte.Parse(id, Inv), Cookness = P(0), BettingMultiplier = P(1), Weight = P(2), KillScoreMultiplier = P(3), IsDripCreature = (f[4] == "1"), SkinIndex = Y(5), Sharpness = Y(6), Quiver = Y(7), Sight = Y(8), BarrelAttachment = Y(9), AmmoType = Y(10), ExtendedMag = (f[11] == "1"), LaserSight = (f[12] == "1") } }; float P(int i) { return float.Parse(f[i], Inv); } byte Y(int i) { return byte.Parse(f[i], Inv); } } } public class VaultData { public readonly Dictionary<(Gear, Rarity), int> Owned = new Dictionary<(Gear, Rarity), int>(); public readonly List<(Gear, Rarity)> Fortress = new List<(Gear, Rarity)>(); public readonly Dictionary> Personal = new Dictionary>(); public readonly Dictionary Names = new Dictionary(); public readonly HashSet Unlocked = new HashSet(); public int Scales; public readonly Dictionary Enhance = new Dictionary(); public readonly Dictionary<(ulong, Gear, int), int> Mods = new Dictionary<(ulong, Gear, int), int>(); public int Best; public readonly HashSet Starter = new HashSet(); public readonly Dictionary Bought = new Dictionary(); public readonly List<(string date, string team)> Wins = new List<(string, string)>(); public int Helpers; public int HelperSpeed; public int HelperLoad; public bool Oven; public readonly List Unknown = new List(); public readonly List Items = new List(); public readonly Dictionary ItemCount = new Dictionary(); public readonly Dictionary Absorbed = new Dictionary(); public const int ModVersion = 2; private static readonly Gear[] RangeTraits = new Gear[4] { Gear.Boomerang, Gear.Conch, Gear.WaterCannon, Gear.Absorber }; public int StorageSlots => 30 + 10 * BoughtOf(Expansion.Storage); public int SlotsUsed => ((IEnumerable)Owned.Values).Sum((Func)Stacks) + ((IEnumerable)ItemCount.Values).Sum((Func)Stacks); public bool VaultFull => SlotsUsed >= StorageSlots; public int BoughtOf(Expansion e) { if (!Bought.TryGetValue(e, out var value)) { return 0; } return value; } public int SlotsOf(int kind) { return kind switch { 1 => 2 + BoughtOf(Expansion.PersonalSlot), 0 => 4 + BoughtOf(Expansion.TeamSlot), _ => GearCatalog.SlotsOf(kind), }; } private static int Stacks(int n) { return (n + 50 - 1) / 50; } public bool Fits(Gear g, Rarity r) { if (Count(g, r) % 50 == 0) { return !VaultFull; } return true; } public bool FitsItem(byte id) { if (CountItem(id) % 50 == 0) { return !VaultFull; } return true; } public int CountItem(byte id) { if (!ItemCount.TryGetValue(id, out var value)) { return 0; } return value; } public void AddItem(StoredItem s) { Items.Add(s); ItemCount[s.Id] = CountItem(s.Id) + 1; } public StoredItem AbsorbedOf(ulong player) { if (!Absorbed.TryGetValue(player, out var value)) { return null; } return value; } public StoredItem TakeItem(byte id) { int num = Items.FindLastIndex((StoredItem x) => x.Id == id); if (num < 0) { return null; } StoredItem result = Items[num]; Items.RemoveAt(num); int num2 = (ItemCount[id] = CountItem(id) - 1); if (num2 <= 0) { ItemCount.Remove(id); } return result; } public int EnhanceOf(Gear g) { if (!Enhance.TryGetValue(g, out var value)) { return 0; } return value; } public float ValueOf(Gear g, Rarity r) { return GearCatalog.Value(g, r) * ((r == Rarity.Legendary) ? (1f + 0.1f * (float)EnhanceOf(g)) : 1f); } public string LabelOf(Gear g, Rarity r, ulong player = 0uL) { string text = GearCatalog.Label(g, r); int num = PlusOf(g, r, player); return text + ((num > 0) ? $" +{num}" : ""); } public int PlusOf(Gear g, Rarity r, ulong player) { if (!GearCatalog.IsWeapon(g)) { if (r != Rarity.Legendary) { return 0; } return EnhanceOf(g); } return ModTotal(player, g); } public int ModOf(ulong player, Gear g, int track) { if (!Mods.TryGetValue((player, g, track), out var value)) { return 0; } return value; } public int ModTotal(ulong player, Gear g) { return Enumerable.Range(0, 4).Sum((int t) => ModOf(player, g, t)); } public float WeaponValue(ulong player, Gear g, Rarity r) { return ValueOf(g, r) * (GearCatalog.IsGameGun(g) ? 1f : WeaponMods.PowerMult(ModOf(player, g, 0), g)); } public string EffectFor(ulong player, Gear g, Rarity r) { if (GearCatalog.IsWeapon(g)) { return GearCatalog.Effect(g, r, WeaponValue(player, g, r), WeaponMods.TimeMult(ModOf(player, g, 1))); } return GearCatalog.Effect(g, r, ValueOf(g, r)); } public bool OwnsLegendary(Gear g) { if (Count(g, Rarity.Legendary) <= 0 && !Fortress.Any(((Gear, Rarity) f) => f.Item1 == g && f.Item2 == Rarity.Legendary)) { return Personal.Values.Any((List<(Gear, Rarity)> l) => l.Any(((Gear, Rarity) x) => x.Item1 == g && x.Item2 == Rarity.Legendary)); } return true; } private static bool OnSale(Gear g, Rarity r, int tab, Rarity? colour) { if (tab != 3 && (tab != 1 || !GearCatalog.IsWeapon(g)) && (tab != 2 || GearCatalog.IsWeapon(g))) { if (colour.HasValue) { return colour == r; } return true; } return false; } private static bool ItemsOnSale(int tab, Rarity? colour) { if (!colour.HasValue) { if (tab != 0) { return tab == 3; } return true; } return false; } public (int money, int scales, int count) SaleOf(int tab, Rarity? colour) { int num = 0; int num2 = 0; int num3 = 0; foreach (KeyValuePair<(Gear, Rarity), int> item in Owned.Where((KeyValuePair<(Gear, Rarity), int> kv) => OnSale(kv.Key.Item1, kv.Key.Item2, tab, colour))) { if (GearCatalog.IsWeapon(item.Key.Item1)) { num += WeaponItems.Worth(item.Key.Item2) * item.Value; } else { num2 += GearCatalog.SalvageScales[(uint)item.Key.Item2] * item.Value; } num3 += item.Value; } if (ItemsOnSale(tab, colour)) { num3 += ItemCount.Values.Sum(); } return (money: num, scales: num2, count: num3); } public (int money, int scales, int count) SellAll(int tab, Rarity? colour, Func worth) { (int, int, int) result = SaleOf(tab, colour); foreach (var item in Owned.Keys.Where(((Gear, Rarity) k) => OnSale(k.Item1, k.Item2, tab, colour)).ToList()) { Owned.Remove(item); } if (ItemsOnSale(tab, colour)) { result.Item1 += Items.Sum(worth); Items.Clear(); ItemCount.Clear(); } Scales += result.Item2; return result; } public bool CanBuild(PieceType t) { if (Catalog.NeedsBlueprint(t)) { return Unlocked.Contains(t); } return true; } public int Count(Gear g, Rarity r) { if (!Owned.TryGetValue((g, r), out var value)) { return 0; } return value; } public void Add(Gear g, Rarity r, int n = 1) { int num = Count(g, r) + n; if (num <= 0) { Owned.Remove((g, r)); } else { Owned[(g, r)] = num; } } public List<(Gear, Rarity)> Slots(ulong player) { if (!Personal.TryGetValue(player, out var value)) { return Personal[player] = new List<(Gear, Rarity)>(); } return value; } public float FortressValue(Gear g) { return GearCatalog.Stacked(g, from x in Fortress where x.Item1 == g select ValueOf(g, x.Item2)); } public float PersonalValue(ulong player, Gear g) { if (!Personal.TryGetValue(player, out var value)) { return 0f; } return GearCatalog.Stacked(g, from x in value where x.Item1 == g select ValueOf(g, x.Item2)); } public string Write(bool forClients = false) { List list = new List(); foreach (KeyValuePair<(Gear, Rarity), int> item in Owned) { list.Add($"own {item.Key.Item1} {item.Key.Item2} {item.Value}"); } foreach (var item2 in Fortress) { list.Add($"fort {item2.Item1} {item2.Item2}"); } foreach (KeyValuePair> item3 in Personal) { foreach (var item4 in item3.Value) { list.Add($"pers {item3.Key} {item4.Item1} {item4.Item2}"); } } foreach (KeyValuePair name in Names) { list.Add(string.Format("name {0} {1}", name.Key, name.Value.Replace("\n", " "))); } foreach (PieceType item5 in Unlocked) { list.Add($"unlock {item5} 1"); } list.Add($"scales {Scales} 0"); foreach (KeyValuePair item6 in Enhance) { list.Add($"enh {item6.Key} {item6.Value}"); } foreach (KeyValuePair<(ulong, Gear, int), int> mod in Mods) { list.Add($"mod {mod.Key.Item1} {mod.Key.Item2} {mod.Key.Item3} {mod.Value}"); } list.Add($"best {Best} 0"); foreach (ulong item7 in Starter) { list.Add($"starter {item7} 1"); } foreach (KeyValuePair item8 in Bought) { list.Add($"buy {item8.Key} {item8.Value}"); } foreach (var win in Wins) { list.Add(string.Format("win {0} {1} {2}", win.date, win.team.Split('、').Length, win.team.Replace("\n", " "))); } list.Add($"helpers {Helpers} {HelperSpeed} {HelperLoad}"); list.Add($"oven {(Oven ? 1 : 0)} 0"); list.Add($"modv {2} 0"); foreach (KeyValuePair item9 in Absorbed) { list.Add(forClients ? $"absorbn {item9.Key} {item9.Value.Id} {item9.Value.Worth}" : $"absorb {item9.Key} {item9.Value.Worth} {item9.Value.Write()}"); } if (forClients) { foreach (KeyValuePair item10 in ItemCount) { list.Add($"itemn {item10.Key} {item10.Value}"); } } else { foreach (StoredItem item11 in Items) { list.Add("item " + item11.Write()); } } if (!forClients) { list.AddRange(Unknown); } return string.Join("\n", list); } public bool Apply(VaultAction action, Gear g, Rarity r, int slot, ulong key) { switch (action) { case VaultAction.Merge: if ((int)r >= 3 || Count(g, r) < 3) { return false; } Add(g, r, -3); Add(g, r + 1); AutoTest.Count("merged"); return true; case VaultAction.EquipFortress: if (!GearCatalog.IsFortress(g) || Count(g, r) < 1 || Fortress.Count >= SlotsOf(0)) { return false; } Add(g, r, -1); Fortress.Add((g, r)); return true; case VaultAction.EquipPersonal: { List<(Gear, Rarity)> list2 = Slots(key); int kind = GearCatalog.SlotKind(g); if (kind == 0 || kind == 2 || Count(g, r) < 1 || list2.Count(((Gear, Rarity) s) => GearCatalog.SlotKind(s.Item1) == kind) >= SlotsOf(kind)) { return false; } Add(g, r, -1); list2.Add((g, r)); return true; } case VaultAction.Salvage: if (Count(g, r) < 1) { return false; } Add(g, r, -1); Scales += GearCatalog.SalvageScales[(uint)r]; AutoTest.Count("salvaged"); return true; case VaultAction.Ascend: { int num5 = GearCatalog.AscendCost(r); if (num5 < 0 || Count(g, r) < 1 || Scales < num5) { return false; } Add(g, r, -1); Add(g, r + 1); Scales -= num5; AutoTest.Count("ascended"); return true; } case VaultAction.Enhance: { int num6 = EnhanceOf(g); if (GearCatalog.IsWeapon(g) || !OwnsLegendary(g) || num6 >= 5 || Scales < GearCatalog.EnhanceCosts[num6]) { return false; } Scales -= GearCatalog.EnhanceCosts[num6]; Enhance[g] = num6 + 1; AutoTest.Count("enhanced"); return true; } case VaultAction.Mod: { int num3 = ModOf(key, g, slot); int num4 = WeaponMods.Cost(num3); if (!WeaponMods.Has(g, slot) || Scales < num4) { return false; } Scales -= num4; Mods[(key, g, slot)] = num3 + 1; AutoTest.Count("modded"); return true; } case VaultAction.Expand: { Expansion expansion = (Expansion)slot; if (!Enum.IsDefined(typeof(Expansion), expansion)) { return false; } (int, int)? tuple = GearCatalog.NextPrice(expansion, BoughtOf(expansion)); if (!tuple.HasValue || Scales < tuple.Value.Item1 || Best < tuple.Value.Item2) { return false; } Scales -= tuple.Value.Item1; Bought[expansion] = BoughtOf(expansion) + 1; AutoTest.Count("expanded_" + expansion); return true; } case VaultAction.UnequipFortress: { int num2 = Fortress.FindIndex(((Gear, Rarity) f) => f.Item1 == g && f.Item2 == r); if (num2 < 0) { return false; } Fortress.RemoveAt(num2); Add(g, r); return true; } case VaultAction.UnequipPersonal: { List<(Gear, Rarity)> list = Slots(key); int num = list.FindIndex(((Gear, Rarity) x) => x.Item1 == g && x.Item2 == r); if (num < 0) { return false; } list.RemoveAt(num); Add(g, r); return true; } default: return false; } } public static VaultData Read(string text) { //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Expected O, but got Unknown VaultData vaultData = new VaultData(); int num = 1; string[] array = (text ?? "").Split('\n'); for (int i = 0; i < array.Length; i++) { string text2 = array[i].Trim(); if (text2.Length == 0) { continue; } string[] array2 = text2.Split(new char[1] { ' ' }, 4); bool flag = array2.Length >= 3; if (flag) { try { switch (array2[0]) { case "own": vaultData.Add(P(array2[1]), P(array2[2]), int.Parse(array2[3])); break; case "fort": vaultData.Fortress.Add((P(array2[1]), P(array2[2]))); break; case "pers": { Gear gear = P(array2[2]); Rarity rarity = P(array2[3]); if (GearCatalog.IsActive(gear)) { vaultData.Add(gear, rarity); } else { vaultData.Slots(ulong.Parse(array2[1])).Add((gear, rarity)); } break; } case "name": vaultData.Names[ulong.Parse(array2[1])] = ((array2.Length > 3) ? (array2[2] + " " + array2[3]) : array2[2]); break; case "unlock": vaultData.Unlocked.Add(P(array2[1])); break; case "scales": vaultData.Scales = int.Parse(array2[1]); break; case "enh": vaultData.Enhance[P(array2[1])] = int.Parse(array2[2]); break; case "mod": { string[] array4 = array2[3].Split(' '); vaultData.Mods[(ulong.Parse(array2[1]), P(array2[2]), int.Parse(array4[0]))] = int.Parse(array4[1]); break; } case "best": vaultData.Best = int.Parse(array2[1]); break; case "starter": vaultData.Starter.Add(ulong.Parse(array2[1])); break; case "buy": vaultData.Bought[P(array2[1])] = int.Parse(array2[2]); break; case "win": vaultData.Wins.Add((array2[1], (array2.Length > 3) ? array2[3] : "")); break; case "helpers": vaultData.Helpers = int.Parse(array2[1]); vaultData.HelperSpeed = int.Parse(array2[2]); vaultData.HelperLoad = ((array2.Length > 3) ? int.Parse(array2[3]) : 0); break; case "oven": vaultData.Oven = array2[1] == "1"; break; case "modv": num = int.Parse(array2[1]); break; case "item": if (array2.Length > 3) { vaultData.AddItem(StoredItem.Read(array2[1], array2[2], array2[3])); } break; case "itemn": vaultData.ItemCount[byte.Parse(array2[1])] = int.Parse(array2[2]); break; case "absorb": { string[] array3 = array2[3].Split(new char[1] { ' ' }, 3); StoredItem storedItem = StoredItem.Read(array3[0], array3[1], array3[2]); storedItem.Worth = int.Parse(array2[2]); vaultData.Absorbed[ulong.Parse(array2[1])] = storedItem; break; } case "absorbn": vaultData.Absorbed[ulong.Parse(array2[1])] = new StoredItem { Saved = new SavedItem { Exists = true, ItemID = byte.Parse(array2[2]) }, Worth = int.Parse(array2[3]) }; break; default: flag = false; break; } } catch (Exception) { flag = false; } } if (!flag) { vaultData.Unknown.Add(text2); } } foreach (KeyValuePair item in vaultData.Enhance.Where((KeyValuePair kv) => GearCatalog.IsWeapon(kv.Key)).ToList()) { foreach (ulong item2 in vaultData.Starter.Concat(vaultData.Names.Keys).Concat(vaultData.Personal.Keys).Distinct()) { vaultData.Mods[(item2, item.Key, 0)] = Math.Max(vaultData.ModOf(item2, item.Key, 0), Math.Min(5, item.Value)); } vaultData.Enhance.Remove(item.Key); } if (num < 2) { foreach (var item3 in vaultData.Mods.Keys.Where(((ulong, Gear, int) k) => k.Item3 == 2 && RangeTraits.Contains(k.Item2)).ToList()) { vaultData.Mods[(item3.Item1, item3.Item2, 3)] = vaultData.Mods[item3]; vaultData.Mods.Remove(item3); } } return vaultData; } private static T P(string s) { return (T)Enum.Parse(typeof(T), s); } } public static class Perks { private static int _frame = -1; private static VaultData _of; private static readonly Dictionary TeamNow = new Dictionary(); private static readonly Dictionary LegendNow = new Dictionary(); private static readonly Dictionary LastProc = new Dictionary(); private static VaultData V { get { if (!Object.op_Implicit((Object)(object)Loot.Instance)) { return null; } return Loot.Instance.Vault; } } private static void Fresh() { VaultData v = V; if (Time.frameCount != _frame || v != _of) { _frame = Time.frameCount; _of = v; TeamNow.Clear(); LegendNow.Clear(); } } public static float Team(Gear g) { Fresh(); if (!TeamNow.TryGetValue(g, out var value)) { value = (TeamNow[g] = V?.FortressValue(g) ?? 0f); } return value; } public static float Of(Player p, Gear g) { if (!Object.op_Implicit((Object)(object)p) || V == null) { return 0f; } return V.PersonalValue(Loot.KeyOf(p), g); } public static float Of(int playerObjectId, Gear g) { return Of(((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player x) => Object.op_Implicit((Object)(object)x) && ((NetworkBehaviour)x).ObjectId == playerObjectId)), g); } public static bool TeamLegend(Gear g) { Fresh(); if (!LegendNow.TryGetValue(g, out var value)) { value = (LegendNow[g] = V != null && V.Fortress.Any(((Gear, Rarity) f) => f.Item1 == g && f.Item2 == Rarity.Legendary)); } return value; } public static bool Legend(Player p, Gear g) { if (Object.op_Implicit((Object)(object)p) && V != null && V.Personal.TryGetValue(Loot.KeyOf(p), out var value)) { return value.Any(((Gear, Rarity) x) => x.Item1 == g && x.Item2 == Rarity.Legendary); } return false; } public static bool Legend(int playerObjectId, Gear g) { return Legend(((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player x) => Object.op_Implicit((Object)(object)x) && ((NetworkBehaviour)x).ObjectId == playerObjectId)), g); } public static void Proc(Gear g, Vector3 at) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (!LastProc.TryGetValue(g, out var value) || !(Time.time - value < 1f)) { LastProc[g] = Time.time; Fx.Send(FxKind.Proc, at, at, 0, (int)g); } } public static int Cost(int baseCost, Player builder) { return Discount(baseCost, Of(builder, Gear.ToolBelt)); } public static int MyCost(int baseCost) { return Discount(baseCost, (Object.op_Implicit((Object)(object)Player.LocalPlayer) && Object.op_Implicit((Object)(object)Loot.Instance)) ? Loot.Instance.ClientVault.PersonalValue(Loot.KeyOf(Player.LocalPlayer), Gear.ToolBelt) : 0f); } private static int Discount(int c, float off) { if (!(off > 0f)) { return c; } return Mathf.Max(1, Mathf.CeilToInt((float)c * (1f - off))); } public static int MaxHp(PieceType t, int level) { if (t != PieceType.Wall) { return Catalog.MaxHp(t, level); } return Mathf.RoundToInt((float)Catalog.MaxHp(t, level) * (1f + Team(Gear.Rebar))); } } public class GearCards : MonoBehaviour { private class Card { public Image Box; public CanvasGroup Group; public float Start; public float Until; } private struct Line { public string Glyph; public string Picture; public string Name; public string Detail; public Color Color; } public static GearCards Instance; private readonly List _cards = new List(); private const float CardsTop = 0.8f; private const float CardsFloor = 450f; private readonly Dictionary _lit = new Dictionary(); private readonly List<(TextMeshProUGUI t, Vector3 at, float start)> _floats = new List<(TextMeshProUGUI, Vector3, float)>(); private RectTransform _bar; private string _barKey = ""; private readonly Dictionary _tiles = new Dictionary(); private const float BarTile = 46f; private void Awake() { Instance = this; } public void ShowGear(Gear g, Rarity r) { //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) VaultData clientVault = Loot.Instance.ClientVault; string text = clientVault.EffectFor(Loot.MyKey, g, r); if (r == Rarity.Legendary && !GearCatalog.IsActive(g)) { text = text + "\n★ " + L10n.T("gearLegend" + g) + ""; } Push(L10n.T("cardPicked"), new List { new Line { Glyph = L10n.T("glyph" + g), Picture = "Gear" + g, Name = clientVault.LabelOf(g, r, Loot.MyKey), Detail = text, Color = GearCatalog.Color(r) } }, 64f); } public void ShowChest(List<(Gear, Rarity)> items, string gameItem) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) VaultData v = Loot.Instance.ClientVault; List list = (from i in items orderby i.Item2 descending select new Line { Glyph = L10n.T("glyph" + i.Item1), Picture = "Gear" + i.Item1, Name = v.LabelOf(i.Item1, i.Item2, Loot.MyKey), Color = GearCatalog.Color(i.Item2), Detail = (GearCatalog.IsWeapon(i.Item1) ? (L10n.T("cardWeaponDrop") + "\n") : "") + v.EffectFor(Loot.MyKey, i.Item1, i.Item2) }).ToList(); string[] array = gameItem?.Split('|'); if (array != null && array.Length == 2 && int.TryParse(array[1], out var result)) { list.Add(new Line { Glyph = "◆", Name = "[" + GearCatalog.RarityName((Rarity)result) + "] " + array[0], Detail = L10n.T("cardGameItem"), Color = GearCatalog.Color((Rarity)result) }); } Push(L10n.T("cardChest"), list, 44f, items.Any(((Gear, Rarity) i) => !GearCatalog.IsWeapon(i.Item1))); } private void Push(string title, List lines, float tile, bool toVault = true) { //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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00e1: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0226: 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_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Hud.Font) || lines.Count == 0) { return; } bool flag = lines.Count == 1 && tile >= 60f; Image val = Hud.Box(Hud.Root, new Vector2(1f, 0.8f), Vector2.zero, new Vector2(480f, 100f), Hud.Panel, 16f, "Ui", (Vector2?)new Vector2(1f, 1f)); CanvasGroup val2 = ((Component)val).gameObject.AddComponent(); val2.blocksRaycasts = false; Transform transform = ((Component)val).transform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 1f); Hud.Label(transform, title, 15f, val3, new Vector2(16f, -10f), new Vector2(448f, 20f), (TextAlignmentOptions)257, Hud.Muted, bold: false, outline: false, val3); float num = -36f; float num2 = 16f + tile + 14f; float num3 = 480f - num2 - 16f; foreach (Line line in lines) { GlyphTile(transform, val3, new Vector2(16f, num), tile, line.Glyph, line.Color, line.Picture); string text = "" + line.Name + ""; TextMeshProUGUI obj = Hud.Label(transform, text, flag ? 22f : 18f, val3, new Vector2(num2, num), new Vector2(num3, 30f), (TextAlignmentOptions)257, line.Color, bold: false, outline: false, val3); float y = ((TMP_Text)obj).GetPreferredValues(text, num3, 0f).y; ((TMP_Text)obj).rectTransform.sizeDelta = new Vector2(num3, y); string text2 = Hud.Keys(line.Detail); TextMeshProUGUI obj2 = Hud.Label(transform, text2, flag ? 17f : 15f, val3, new Vector2(num2, num - y - 2f), new Vector2(num3, 200f), (TextAlignmentOptions)257, flag ? Hud.Ink : Hud.Muted, bold: false, outline: false, val3); float y2 = ((TMP_Text)obj2).GetPreferredValues(text2, num3, 0f).y; ((TMP_Text)obj2).rectTransform.sizeDelta = new Vector2(num3, y2); num -= Mathf.Max(tile, y + 2f + y2) + 10f; } if (toVault) { Hud.Label(transform, Hud.Keys(L10n.T("cardWhere")), 14f, val3, new Vector2(16f, num - 2f), new Vector2(448f, 20f), (TextAlignmentOptions)257, Hud.Muted, bold: false, outline: false, val3); num -= 20f; } ((Graphic)val).rectTransform.sizeDelta = new Vector2(480f, 0f - num + 10f); _cards.Insert(0, new Card { Box = val, Group = val2, Start = Time.time, Until = Time.time + 7f }); while (_cards.Count > 3) { Object.Destroy((Object)(object)((Component)_cards[_cards.Count - 1].Box).gameObject); _cards.RemoveAt(_cards.Count - 1); } } private static Image GlyphTile(Transform parent, Vector2 anchor, Vector2 pos, float size, string glyph, Color c, string picture = null) { //IL_0009: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) float radius = size * 0.22f; Image val = Hud.Box(parent, anchor, pos, new Vector2(size, size), new Color(c.r * 0.3f, c.g * 0.3f, c.b * 0.3f, 0.95f), radius, "Ui", anchor); Hud.Box(((Component)val).transform, new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(size, size), c, radius, "Ui_outline"); if (!Object.op_Implicit((Object)(object)Hud.Picture(((Component)val).transform, picture, new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(size * 0.84f, size * 0.84f)))) { Hud.Label(((Component)val).transform, glyph, size * 0.48f, new Vector2(0.5f, 0.5f), new Vector2(0f, 1f), new Vector2(size, size), (TextAlignmentOptions)514, c, bold: true); } return val; } public void Proc(Gear g, Vector3 at) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) _lit[g] = Time.time; if (Object.op_Implicit((Object)(object)Hud.Font)) { TextMeshProUGUI item = Hud.Label(Hud.Root, "★ " + L10n.T("legendShort" + g), 24f, Vector2.zero, Vector2.zero, new Vector2(300f, 34f), (TextAlignmentOptions)514, Hud.Gold, bold: true, outline: true); _floats.Add((item, at + Vector3.up * 1.5f, Time.time)); AutoTest.Count("proc_" + g); } } private void LateUpdate() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_016e: 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; for (int num = _cards.Count - 1; num >= 0; num--) { Card card = _cards[num]; if (!Object.op_Implicit((Object)(object)card.Box) || time > card.Until) { if (Object.op_Implicit((Object)(object)card.Box)) { Object.Destroy((Object)(object)((Component)card.Box).gameObject); } _cards.RemoveAt(num); } } float num2 = 0f; Rect rect = ((RectTransform)Hud.Root).rect; float num3 = ((Rect)(ref rect)).height * 0.8f - 450f; foreach (Card card2 in _cards) { float num4 = Mathf.Clamp01((time - card2.Start) / 0.25f); float num5 = Mathf.Clamp01((card2.Until - time) / 0.5f); card2.Group.alpha = Mathf.Min(num4, num5); ((Component)card2.Box).gameObject.SetActive(!Hud.ModalOpen && num2 + ((Graphic)card2.Box).rectTransform.sizeDelta.y <= num3); ((Graphic)card2.Box).rectTransform.anchoredPosition = new Vector2(-22f + 40f * (1f - num4), 0f - num2); num2 += ((Graphic)card2.Box).rectTransform.sizeDelta.y + 10f; } Camera curCamera = GameInfo.CurCamera; Vector2 val2 = default(Vector2); for (int num6 = _floats.Count - 1; num6 >= 0; num6--) { (TextMeshProUGUI t, Vector3 at, float start) tuple = _floats[num6]; TextMeshProUGUI item = tuple.t; Vector3 item2 = tuple.at; float item3 = tuple.start; float num7 = (time - item3) / 1.2f; if (!Object.op_Implicit((Object)(object)item) || num7 >= 1f || !Object.op_Implicit((Object)(object)curCamera)) { if (Object.op_Implicit((Object)(object)item)) { Object.Destroy((Object)(object)((Component)item).gameObject); } _floats.RemoveAt(num6); } else { Vector3 val = curCamera.WorldToScreenPoint(item2 + Vector3.up * num7); ((Component)item).gameObject.SetActive(val.z > 0f); RectTransform rectTransform = ((TMP_Text)item).rectTransform; RectTransform rectTransform2 = ((TMP_Text)item).rectTransform; ((Vector2)(ref val2))..ctor(val.x / (float)Screen.width, val.y / (float)Screen.height); rectTransform2.anchorMax = val2; rectTransform.anchorMin = val2; ((TMP_Text)item).rectTransform.anchoredPosition = Vector2.zero; ((TMP_Text)item).alpha = 1f - num7 * num7; } } DrawLoadout(); } private void DrawLoadout() { //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_0278: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: 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_0321: Unknown result type (might be due to invalid IL or missing references) VaultData v = (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.ClientVault : null); ulong key = (Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Loot.KeyOf(Player.LocalPlayer) : 0); List<(Gear, Rarity)> value; List<(Gear, Rarity)> list = ((v != null && v.Personal.TryGetValue(key, out value)) ? value.Where(((Gear, Rarity) x) => !GearCatalog.IsActive(x.Item1)).ToList() : new List<(Gear, Rarity)>()); if (v == null || !Object.op_Implicit((Object)(object)Siege.Instance) || !Siege.Instance.ViewActive || !Object.op_Implicit((Object)(object)Hud.Font) || (v.Fortress.Count <= 0 && list.Count <= 0) || Hud.ModalOpen) { if (Object.op_Implicit((Object)(object)_bar)) { ((Component)_bar).gameObject.SetActive(false); } return; } string text = string.Join(",", v.Fortress.Select(((Gear, Rarity) x) => $"{x.Item1}{x.Item2}{v.EnhanceOf(x.Item1)}")) + "|" + string.Join(",", list.Select(((Gear, Rarity) x) => $"{x.Item1}{x.Item2}{v.EnhanceOf(x.Item1)}")); if (!Object.op_Implicit((Object)(object)_bar) || text != _barKey) { if (Object.op_Implicit((Object)(object)_bar)) { Object.Destroy((Object)(object)((Component)_bar).gameObject); } _tiles.Clear(); _barKey = text; _bar = Hud.Node(Hud.Root, "Loadout", new Vector2(1f, 0f), Vector2.zero, new Vector2(320f, 120f), (Vector2?)new Vector2(1f, 0f)); Row(L10n.T("loadoutTeam"), v.Fortress.ToList(), 54f); Row(L10n.T("loadoutMine"), list, 0f); } ((Component)_bar).gameObject.SetActive(true); _bar.anchoredPosition = new Vector2(-24f, (Object.op_Implicit((Object)(object)Actives.Instance) && Actives.Instance.ClientHasActive) ? 336f : 264f); foreach (KeyValuePair tile in _tiles) { float value2; float num = (_lit.TryGetValue(tile.Key, out value2) ? Mathf.Clamp01(1f - (Time.time - value2) / 0.8f) : 0f); ((Transform)tile.Value.Item1).localScale = Vector3.one * (1f + 0.25f * num); ((Graphic)tile.Value.Item2).color = new Color(1f, 1f, 1f, 0.6f * num); } void Row(string label, List<(Gear, Rarity)> items, float y) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) if (items.Count != 0) { Hud.Label((Transform)(object)_bar, label, 15f, new Vector2(1f, 0f), new Vector2(0f - (float)items.Count * 52f - 8f, y + 23f), new Vector2(60f, 20f), (TextAlignmentOptions)516, (Color?)Hud.Muted, bold: false, outline: false, (Vector2?)new Vector2(1f, 0.5f)); for (int i = 0; i < items.Count; i++) { (Gear, Rarity) tuple = items[i]; Gear item = tuple.Item1; Rarity item2 = tuple.Item2; Color val = GearCatalog.Color(item2); Image val2 = GlyphTile((Transform)(object)_bar, new Vector2(1f, 0f), new Vector2((float)(-(items.Count - 1 - i)) * 52f, y), 46f, L10n.T("glyph" + item), val, "Gear" + item); if (item2 == Rarity.Legendary && v.EnhanceOf(item) > 0) { Hud.Label(((Component)val2).transform, "+" + v.EnhanceOf(item), 12f, new Vector2(1f, 1f), new Vector2(-3f, -2f), new Vector2(30f, 14f), (TextAlignmentOptions)260, (Color?)val, bold: true, outline: false, (Vector2?)new Vector2(1f, 1f)); } Image val3 = Hud.Box(((Component)val2).transform, new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(46f, 46f), new Color(1f, 1f, 1f, 0f), 10f); ((Graphic)val3).raycastTarget = false; _tiles[item] = (((Graphic)val2).rectTransform, val3); } } } } } public struct HelperView : IBroadcast { public byte Id; public Vector3 Pos; public float Yaw; public byte Load; public byte Cap; public byte Hp; public byte State; } public struct HelperBuy : IBroadcast { public byte What; } public class Helpers : MonoBehaviour { private class Hand { public byte Id; public Vector3 Pos; public Vector3 GoalPos; public float Yaw; public float Hp = 1f; public float KoUntil; public int Load; public int Value; public object Goal; public byte State; } private class View { public Transform Root; public Transform Bag; public Person Person; public Vector3 Pos; public Vector3 Shown; public float Yaw; public float Seen; public float Walk; public byte Load; public byte Cap; public byte Hp; public byte State; } public static Helpers Instance; public const int MaxHelpers = 30; public const int MaxLevel = 40; public const int OvenPrice = 400; public const float OvenBonus = 0.5f; public const float Reach = 1.4f; public const float KoSeconds = 20f; public const float DangerRange = 1.8f; public const float FishAvoid = 4f; public const float BitePerSecond = 0.12f; private NetworkManager _registeredOn; private readonly List _hands = new List(); private float _last; private float _nextSend; private float _nextThink; private readonly Dictionary _sent = new Dictionary(); private float _heldUntil; private readonly Dictionary _views = new Dictionary(); private readonly List<(RectTransform root, TextMeshProUGUI label, Hud.Bar bar)> _plates = new List<(RectTransform, TextMeshProUGUI, Hud.Bar)>(); public int DebugCount => _hands.Count; public static int HirePrice(int have) { return Mathf.RoundToInt(150f * Mathf.Pow(1.3f, (float)have)); } public static int UpgradePrice(int level) { return Mathf.RoundToInt(120f * Mathf.Pow(1.22f, (float)level)); } public static float Speed(int level) { return 3f + 0.6f * (float)level; } public static int Basket(int level) { return 2 + level * 3 / 2; } private void Awake() { Instance = this; } static Helpers() { GenericWriter.SetWrite((Action)delegate(Writer w, HelperView v) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) w.WriteByte(v.Id); w.WriteVector3(v.Pos); w.WriteSingle(v.Yaw); w.WriteByte(v.Load); w.WriteByte(v.Cap); w.WriteByte(v.Hp); w.WriteByte(v.State); }); GenericReader.SetRead((Func)((Reader r) => new HelperView { Id = r.ReadByte(), Pos = r.ReadVector3(), Yaw = r.ReadSingle(), Load = r.ReadByte(), Cap = r.ReadByte(), Hp = r.ReadByte(), State = r.ReadByte() })); GenericWriter.SetWrite((Action)delegate(Writer w, HelperBuy v) { w.WriteByte(v.What); }); GenericReader.SetRead((Func)((Reader r) => new HelperBuy { What = r.ReadByte() })); } public static int PriceOf(int what, VaultData v) { switch (what) { default: return -1; case 3: if (!v.Oven) { return 400; } return -1; case 2: if (v.HelperLoad >= 40) { return -1; } return UpgradePrice(v.HelperLoad); case 1: if (v.HelperSpeed >= 40) { return -1; } return UpgradePrice(v.HelperSpeed); case 0: if (v.Helpers >= 30) { return -1; } return HirePrice(v.Helpers); } } private void Update() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, HelperBuy b, Channel ch) { ServerBuy(b.What); }), true); networkManager.ClientManager.RegisterBroadcast((Action)delegate(HelperView v, Channel ch) { OnView(v); }); networkManager.ClientManager.OnClientConnectionState += delegate(ClientConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { ClearViews(); } }; } if (InstanceFinder.IsServerStarted) { ServerTick(); } ClientTick(); } public bool ServerBuy(byte what) { VaultData vaultData = (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.Vault : null); if (vaultData == null) { return false; } int num = PriceOf(what, vaultData); if (num < 0 || !Siege.Instance.ServerTrySpend(Siege.Money(num), always: true)) { return false; } switch (what) { case 0: vaultData.Helpers++; break; case 1: vaultData.HelperSpeed++; break; case 2: vaultData.HelperLoad++; break; default: vaultData.Oven = true; break; } Loot.Instance.SaveVault(); AutoTest.Count("helper_bought_" + what); return true; } private static Vector3 Home(FortressIsland island, int id) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) return island.MarketPos + Quaternion.Euler(0f, 70f * (float)id, 0f) * new Vector3(0f, 0f, 2.2f + 0.7f * (float)((id - 1) / 5)); } private static float Ground(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) float num = WaterManager.GetWaterHeight(p); RaycastHit[] array = Physics.RaycastAll(new Vector3(p.x, p.y + 1.2f, p.z), Vector3.down, 30f, LayerMask.op_Implicit(GameInfo.LevelLayer)); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; string name = ((Object)((Component)((RaycastHit)(ref val)).collider).gameObject).name; if (!name.StartsWith("FortressPiece") && !(name == "FortressCore")) { num = Mathf.Max(num, ((RaycastHit)(ref val)).point.y); } } return num; } private void ServerTick() { //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_0260: 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_02c4: 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_039a: 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_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_073d: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_074d: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_084b: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextThink) { return; } _nextThink = Time.time + 0.1f; float num = Mathf.Min(0.3f, Time.time - _last); _last = Time.time; FortressIsland instance = FortressIsland.Instance; VaultData vaultData = (Object.op_Implicit((Object)(object)Loot.Instance) ? Loot.Instance.Vault : null); int num2 = ((Object.op_Implicit((Object)(object)instance) && instance.Exists && Object.op_Implicit((Object)(object)Siege.Instance) && vaultData != null && Object.op_Implicit((Object)(object)FortressNet.Instance)) ? Mathf.Clamp(vaultData.Helpers, 0, 30) : 0); while (_hands.Count > num2) { Hand hand = _hands[_hands.Count - 1]; _hands.RemoveAt(_hands.Count - 1); _sent.Remove(hand.Id); InstanceFinder.ServerManager.Broadcast(new HelperView { Id = hand.Id, State = byte.MaxValue }, true, (Channel)0); } while (_hands.Count < num2) { byte id = (byte)(_hands.Count + 1); Vector3 val = Home(instance, id); _hands.Add(new Hand { Id = id, Pos = new Vector3(val.x, Ground(val), val.z) }); } if (_hands.Count == 0 || FortressPlugin.Frozen) { return; } if (Time.time < _heldUntil) { Broadcast(Basket(vaultData.HelperLoad)); return; } float num3 = Speed(vaultData.HelperSpeed); int num4 = Basket(vaultData.HelperLoad); List fish = (from c in FortressPlugin.Alive where Object.op_Implicit((Object)(object)c) && c._hp.Value > 0 && !Siege.Instance.IsHidden(c) select ((Component)c).transform.position).ToList(); Dictionary dictionary = new Dictionary(); foreach (Creature item in FortressNet.Instance.ServerCorpses()) { if (instance.OnIsland(((Component)item).transform.position, 40f)) { dictionary[item] = ((Component)item).transform.position; } } foreach (Loot.Lying item2 in Loot.Instance.ServerLying()) { dictionary[item2.Key] = item2.Pos; } HashSet hashSet = new HashSet(from o in _hands where o.Goal != null select o.Goal); foreach (Hand h in _hands) { if (h.State == 3) { if (Time.time < h.KoUntil) { continue; } Vector3 val2 = Home(instance, h.Id); h.Pos = new Vector3(val2.x, Ground(val2), val2.z); h.State = 0; h.Hp = 1f; } int num5 = fish.Count(delegate(Vector3 f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val7 = f - h.Pos; return ((Vector3)(ref val7)).sqrMagnitude < 3.2399998f; }); if (num5 > 0) { h.Hp -= 0.12f * (float)num5 * num; if (h.Hp <= 0f) { KnockOut(h); continue; } } else { h.Hp = Mathf.Min(1f, h.Hp + 0.03f * num); } Vector3 val3; if (h.Load >= num4 || h.Goal == null || !dictionary.TryGetValue(h.Goal, out h.GoalPos) || Unsafe(h.GoalPos)) { if (h.Goal != null) { hashSet.Remove(h.Goal); } h.Goal = null; float num6 = float.MaxValue; if (h.Load < num4) { foreach (KeyValuePair item3 in dictionary) { val3 = item3.Value - h.Pos; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude < num6 && !hashSet.Contains(item3.Key) && !Unsafe(item3.Value)) { num6 = sqrMagnitude; h.Goal = item3.Key; h.GoalPos = item3.Value; } } } if (h.Goal != null) { hashSet.Add(h.Goal); } } Vector3 val4; if (h.Goal != null) { h.State = 1; val4 = h.GoalPos; val3 = (val4 - h.Pos).Flat(); if (((Vector3)(ref val3)).sqrMagnitude < 1.9599999f) { object goal = h.Goal; Creature val5 = (Creature)((goal is Creature) ? goal : null); if (val5 != null) { int num7 = FortressNet.Instance.ServerTakeCorpse(val5); if (num7 > 0) { h.Load++; h.Value += num7; Fx.Send(FxKind.Scoop, val4, h.Pos + Vector3.up); AutoTest.Count("helper_picked"); } } else if (Loot.Instance.ServerHelperPick(h.Goal, h.Pos + Vector3.up)) { AutoTest.Count("helper_looted"); } dictionary.Remove(h.Goal); hashSet.Remove(h.Goal); h.Goal = null; } } else if (h.Load > 0) { h.State = 2; val4 = instance.CounterPos; val3 = (val4 - h.Pos).Flat(); if (((Vector3)(ref val3)).sqrMagnitude < 4.84f) { Sell(h, vaultData, instance.CounterPos); continue; } } else { h.State = 0; val4 = Home(instance, h.Id); } Vector3 val6 = (val4 - h.Pos).Flat(); float magnitude = ((Vector3)(ref val6)).magnitude; if (magnitude > 0.3f) { Hand hand2 = h; hand2.Pos += val6 / magnitude * Mathf.Min(magnitude, num3 * num); h.Yaw = Mathf.Atan2(val6.x, val6.z) * 57.29578f; } h.Pos.y = Mathf.MoveTowards(h.Pos.y, Ground(h.Pos), 8f * num); } Broadcast(num4); bool Unsafe(Vector3 at) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return fish.Any(delegate(Vector3 f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val7 = (f - at).Flat(); return ((Vector3)(ref val7)).sqrMagnitude < 16f; }); } } private void Broadcast(int cap) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextSend) { return; } _nextSend = Time.time + 0.1f; foreach (Hand hand in _hands) { HelperView helperView = new HelperView { Id = hand.Id, Pos = hand.Pos, Yaw = hand.Yaw, Load = (byte)hand.Load, Cap = (byte)cap, Hp = (byte)Mathf.RoundToInt(Mathf.Clamp01(hand.Hp) * 255f), State = hand.State }; if (!_sent.TryGetValue(hand.Id, out (HelperView, float) value) || !(Time.time - value.Item2 < 1f) || !Same(value.Item1, helperView)) { _sent[hand.Id] = (helperView, Time.time); InstanceFinder.ServerManager.Broadcast(helperView, true, (Channel)0); } } } private static bool Same(HelperView a, HelperView b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector3 val = a.Pos - b.Pos; if (((Vector3)(ref val)).sqrMagnitude < 0.0025f && Mathf.Abs(Mathf.DeltaAngle(a.Yaw, b.Yaw)) < 1f && a.Load == b.Load && a.Cap == b.Cap && a.Hp == b.Hp) { return a.State == b.State; } return false; } private void Sell(Hand h, VaultData v, Vector3 counter) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.RoundToInt((float)h.Value * (1f + (v.Oven ? 0.5f : 0f))); if (num > 0) { Siege.Instance.ServerPay(num); Fx.Send(FxKind.Sell, counter, counter, 0, num); AutoTest.Count("helper_sold"); AutoTest.Count("helper_money", num); } h.Load = 0; h.Value = 0; } private void KnockOut(Hand h) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) h.State = 3; h.KoUntil = Time.time + 20f; h.Load = 0; h.Value = 0; h.Goal = null; Fx.Send(FxKind.Dust, h.Pos, h.Pos); AutoTest.Count("helper_down"); } public string DebugState() { return string.Join(", ", _hands.Select((Hand h) => string.Format("#{0} {1} {2} fish ({3}) hp {4:0.00}", h.Id, (new string[4] { "idle", "fetching", "selling", "down" })[Mathf.Min(3, (int)h.State)], h.Load, h.Value, h.Hp))); } public string DebugBody() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (!_views.TryGetValue(1, out var value) || !Object.op_Implicit((Object)(object)value.Person)) { return "no view"; } return string.Join("; ", ((Component)value.Person).GetComponentsInChildren(true).Select(delegate(Renderer r) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) string name = ((Object)r).name; Bounds bounds = r.bounds; return $"{name} {((Bounds)(ref bounds)).size}"; })) + $" | root {value.Root.position}"; } public Vector3 DebugPos(int i) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return _hands[i].Pos; } public void DebugStage(int i, Vector3 at, float yaw, int load, bool down, float seconds) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Hand hand = _hands[i]; hand.Pos = at; hand.Yaw = yaw; hand.Load = load; hand.State = (byte)(down ? 3u : ((load > 0) ? 2u : 0u)); hand.Hp = (down ? 0f : 0.6f); if (down) { hand.KoUntil = Time.time + seconds; } _heldUntil = Time.time + seconds; } private void OnView(HelperView s) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00d3: 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) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) if (s.State == byte.MaxValue) { Drop(s.Id); return; } if (!_views.TryGetValue(s.Id, out var value)) { Transform transform = new GameObject("FortressHelper" + s.Id).transform; transform.position = s.Pos; Person person = Person.Make(transform, "Helper" + s.Id); ((Component)person).transform.localScale = Vector3.one * 0.82f; Transform transform2 = new GameObject("Basket").transform; transform2.SetParent(((Component)person).transform, false); transform2.localPosition = new Vector3(0f, 0.86f, 0.5f); Models.Attach("HelperBasket", transform2, Vector3.one * 0.42f); Dictionary views = _views; byte id = s.Id; View obj = new View { Root = transform, Person = person, Bag = transform2, Shown = s.Pos }; View view = obj; views[id] = obj; value = view; } if (value.State != 3 && s.State == 3) { ChatManager.ChatMessage(L10n.T("prefix") + " " + L10n.T("helperDown", 20)); Fx.SoundRandom("ItemImpactHeavy_V", 1, 3, s.Pos, 0.8f, (AudioDistance)2); } value.Pos = s.Pos; value.Yaw = s.Yaw; value.Load = s.Load; value.Cap = s.Cap; value.Hp = s.Hp; value.State = s.State; value.Seen = Time.time; } private void Drop(byte id) { if (_views.TryGetValue(id, out var value) && Object.op_Implicit((Object)(object)value.Root)) { Object.Destroy((Object)(object)((Component)value.Root).gameObject); } _views.Remove(id); } private void ClearViews() { foreach (byte item in _views.Keys.ToList()) { Drop(item); } } private void ClientTick() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00a9: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) Camera curCamera = GameInfo.CurCamera; foreach (byte item in _views.Keys.ToList()) { View view = _views[item]; if (!Object.op_Implicit((Object)(object)view.Root) || Time.time - view.Seen > 3f) { Drop(item); continue; } Vector3 shown = view.Shown; view.Shown = Vector3.Lerp(view.Shown, view.Pos, 1f - Mathf.Exp(-12f * Time.deltaTime)); Vector3 val = (view.Shown - shown).Flat(); float num = ((Vector3)(ref val)).magnitude / Mathf.Max(0.0001f, Time.deltaTime); view.Walk += Time.deltaTime * Mathf.Clamp(num, 0f, 6f) * 3.2f; bool flag = view.State == 3; bool flag2 = view.Load > 0 && !flag; view.Root.position = view.Shown; Quaternion val2 = Quaternion.Euler(0f, view.Yaw, 0f); view.Root.rotation = Quaternion.Slerp(view.Root.rotation, flag ? (val2 * Quaternion.Euler(-80f, 0f, 0f)) : (val2 * Quaternion.Euler(0f, 0f, (num > 0.2f) ? (Mathf.Sin(view.Walk) * 4f) : 0f)), 1f - Mathf.Exp(-10f * Time.deltaTime)); int num2; if (Object.op_Implicit((Object)(object)curCamera)) { val = view.Shown - ((Component)curCamera).transform.position; num2 = ((((Vector3)(ref val)).sqrMagnitude < 2025f) ? 1 : 0); } else { num2 = 1; } bool flag3 = (byte)num2 != 0; if (Object.op_Implicit((Object)(object)view.Person) && (flag3 || (Time.frameCount + item) % 6 == 0)) { view.Person.Pose(view.Walk, flag ? 0f : Mathf.Clamp01(num / 2.5f), flag2, 0f, 0f, flag ? (-20f) : 0f); } if (Object.op_Implicit((Object)(object)view.Bag)) { if (((Component)view.Bag).gameObject.activeSelf != flag2) { ((Component)view.Bag).gameObject.SetActive(flag2); } if (flag2) { view.Bag.localScale = Vector3.one * Mathf.Lerp(0.75f, 1.15f, (float)(int)view.Load / (float)Mathf.Max(1, (int)view.Cap)); } } } DrawPlates(); } private void DrawPlates() { //IL_0060: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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) //IL_01f2: 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_0206: 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_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_02c0: 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_031b: Unknown result type (might be due to invalid IL or missing references) Camera curCamera = GameInfo.CurCamera; int num = 0; if (Object.op_Implicit((Object)(object)curCamera) && Object.op_Implicit((Object)(object)Hud.Font) && !Reveal.Playing) { foreach (View value in _views.Values) { if (!Object.op_Implicit((Object)(object)value.Root)) { continue; } float num2 = Vector3.Distance(((Component)curCamera).transform.position, value.Shown); if (num2 > 30f) { continue; } Vector3 val = curCamera.WorldToScreenPoint(value.Shown + Vector3.up * 2.1f); if (!(val.z < 0f)) { if (num >= _plates.Count) { RectTransform val2 = Hud.Node(Hud.Root, "HelperPlate", Vector2.zero, Vector2.zero, new Vector2(160f, 40f), (Vector2?)new Vector2(0.5f, 0f)); TextMeshProUGUI item = Hud.Label((Transform)(object)val2, "", 17f, new Vector2(0.5f, 0f), new Vector2(0f, 12f), new Vector2(260f, 26f), (TextAlignmentOptions)1026, null, bold: true, outline: true); Hud.Bar item2 = Hud.Bar.Make((Transform)(object)val2, new Vector2(0.5f, 0f), Vector2.zero, new Vector2(64f, 8f), Hud.Good); _plates.Add((val2, item, item2)); } var (val3, val4, bar) = _plates[num++]; ((Component)val3).gameObject.SetActive(true); Vector2 anchorMin = (val3.anchorMax = new Vector2(val.x / (float)Screen.width, val.y / (float)Screen.height)); val3.anchorMin = anchorMin; val3.anchoredPosition = Vector2.zero; ((Transform)val3).localScale = Vector3.one * Mathf.Clamp(14f / Mathf.Max(1f, num2), 0.65f, 1.1f); ((TMP_Text)val4).text = ((value.State == 3) ? L10n.T("helperKo") : L10n.T("helperPlate", value.Load, value.Cap)); ((Graphic)val4).color = (Color)((value.State == 3) ? Hud.Bad : new Color(0.75f, 1f, 0.8f)); bool flag = value.Hp < 250 && value.State != 3; ((Component)bar.Back).gameObject.SetActive(flag); if (flag) { bar.Set((float)(int)value.Hp / 255f, Hud.HealthColor((float)(int)value.Hp / 255f)); } } } } for (int i = num; i < _plates.Count; i++) { if (Object.op_Implicit((Object)(object)_plates[i].root)) { ((Component)_plates[i].root).gameObject.SetActive(false); } } } } public static class Hud { private class OutlineOnShow : MonoBehaviour { private void OnEnable() { Outline(((Component)this).GetComponent()); Object.Destroy((Object)(object)this); } } internal class OneLine : MonoBehaviour { private TextMeshProUGUI _t; private string _text; private float _full; private float _set = -1f; private Vector2 _box; private void LateUpdate() { //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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) if ((!Object.op_Implicit((Object)(object)_t) && !Object.op_Implicit((Object)(object)(_t = ((Component)this).GetComponent()))) || ((TMP_Text)_t).enableAutoSizing) { return; } if (((TMP_Text)_t).fontSize != _set) { _full = ((TMP_Text)_t).fontSize; } Rect rect = ((TMP_Text)_t).rectTransform.rect; Vector2 size = ((Rect)(ref rect)).size; if (((TMP_Text)_t).fontSize != _set || !(size == _box) || !(((TMP_Text)_t).text == _text)) { _text = ((TMP_Text)_t).text; _box = size; _set = ((TMP_Text)_t).fontSize; if (!(size.y >= _full * 2f) && !(size.x < 1f) && !string.IsNullOrEmpty(_text)) { ((TMP_Text)_t).enableWordWrapping = false; ((TMP_Text)_t).fontSize = _full; float x = ((TMP_Text)_t).GetPreferredValues(_text, float.PositiveInfinity, float.PositiveInfinity).x; ((TMP_Text)_t).fontSize = (_set = ((x > size.x) ? Mathf.Max(_full * 0.6f, _full * size.x / x) : _full)); } } } } public class Bar { public Image Back; public Image Fill; private RectTransform _fill; public void Set(float v, Color? c = null) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) _fill.anchorMax = new Vector2(Mathf.Clamp01(v), 1f); ((Component)_fill).gameObject.SetActive(v > 0.001f); if (c.HasValue) { ((Graphic)Fill).color = c.Value; } } public static Bar Make(Transform parent, Vector2 anchor, Vector2 pos, Vector2 size, Color fill, Vector2? pivot = null) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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) Bar obj = new Bar { Back = Box(parent, anchor, pos, size, new Color(0f, 0f, 0f, 0.45f), size.y / 2f, "Ui", pivot) }; obj.Fill = Box(((Component)obj.Back).transform, Vector2.zero, Vector2.zero, Vector2.zero, fill, size.y / 2f); obj._fill = ((Graphic)obj.Fill).rectTransform; obj._fill.anchorMin = Vector2.zero; obj._fill.anchorMax = Vector2.one; obj._fill.pivot = new Vector2(0f, 0.5f); obj._fill.sizeDelta = Vector2.zero; return obj; } } internal class HudRunner : MonoBehaviour { private void LateUpdate() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_promptBox)) { ((Component)_promptBox).gameObject.SetActive(Time.frameCount - _promptFrame <= 1); } if (Object.op_Implicit((Object)(object)_ringBack)) { ((Component)_ringBack).gameObject.SetActive(Time.frameCount - _ringFrame <= 1); } if (Object.op_Implicit((Object)(object)_banner)) { float time = Time.time; bool flag = time < _bannerUntil; ((Component)_banner).gameObject.SetActive(flag); if (flag) { float num = Mathf.Clamp01((time - _bannerStart) / 0.15f); float num2 = Mathf.Clamp01((_bannerUntil - time) / 0.4f); ((Component)_banner).transform.localScale = Vector3.one * Mathf.Lerp(0.85f, 1f, 1f - (1f - num) * (1f - num)); _bannerGroup.alpha = Mathf.Min(num, num2); } } } } public static readonly Color Panel = new Color(0.05f, 0.07f, 0.1f, 0.72f); public static readonly Color PanelSolid = new Color(0.07f, 0.09f, 0.12f, 1f); public static readonly Color Raised = new Color(0.12f, 0.145f, 0.19f, 1f); public static readonly Color Accent = new Color(1f, 0.69f, 0.27f); public static readonly Color Gold = new Color(1f, 0.84f, 0.35f); public static readonly Color Good = new Color(0.45f, 0.86f, 0.52f); public static readonly Color Bad = new Color(1f, 0.42f, 0.36f); public static readonly Color Muted = new Color(0.66f, 0.72f, 0.8f); public static readonly Color Ink = new Color(0.96f, 0.97f, 1f); private static Canvas _canvas; private static readonly Dictionary Sprites = new Dictionary(); public static string IconDir; private static readonly Dictionary Pictures = new Dictionary(); private static readonly Regex KeyRx = new Regex("\\[([^\\]\\[]{1,14})\\]"); private static Image _promptBox; private static TextMeshProUGUI _promptText; private static int _promptFrame = -10; private static Image _banner; private static Image _bannerLine; private static TextMeshProUGUI _bannerText; private static CanvasGroup _bannerGroup; private static float _bannerStart; private static float _bannerUntil; private static Image _ringBack; private static Image _ringFill; private static TextMeshProUGUI _ringText; private static int _ringFrame = -10; public static Transform Root => ((Component)Canvas("FortressHUD", 500, ref _canvas)).transform; public static bool ModalOpen { get { if (!MenuOpen) { return Tips.HelpShown; } return true; } } public static bool MenuOpen { get { if (!VaultUI.IsOpen && !PieceMenu.IsOpen && !StallMenu.IsOpen) { return Reveal.Playing; } return true; } } public static TMP_FontAsset Font { get { object? obj = AccessTools.Field(typeof(LocalizationManager), "_defaultFontAsset")?.GetValue(AccessTools.Field(typeof(LocalizationManager), "_instance")?.GetValue(null)); return (TMP_FontAsset)((obj is TMP_FontAsset) ? obj : null); } } public static Canvas Canvas(string name, int order, ref Canvas cache) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)cache)) { return cache; } GameObject val = new GameObject(name, new Type[3] { typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster) }); Object.DontDestroyOnLoad((Object)(object)val); cache = val.GetComponent(); cache.renderMode = (RenderMode)0; cache.sortingOrder = order; CanvasScaler component = val.GetComponent(); component.uiScaleMode = (ScaleMode)1; component.referenceResolution = new Vector2(1920f, 1080f); component.matchWidthOrHeight = 0.5f; if (name == "FortressHUD") { val.AddComponent(); } return cache; } public static Sprite Sprite(string name) { if (Sprites.TryGetValue(name, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } value = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Sprite x) => ((Object)x).name == name)); if (Object.op_Implicit((Object)(object)value)) { Sprites[name] = value; } return value; } public static Sprite PictureOf(string name) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (Pictures.TryGetValue(name, out var value)) { return value; } if (name.StartsWith("Gear") && Enum.TryParse(name.Substring(4), out var result) && GearCatalog.IsGameGun(result)) { return ItemIcons.Of(WeaponItems.GameId(result)); } string path = Path.Combine(IconDir ?? "", name + ".png"); if (File.Exists(path)) { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true) { name = name, wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)2 }; if (ImageConversion.LoadImage(val, File.ReadAllBytes(path), true)) { value = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } } Pictures[name] = value; return value; } public static Image Picture(Transform parent, string name, Vector2 anchor, Vector2 pos, Vector2 size, Vector2? pivot = null) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Sprite val = ((name != null) ? PictureOf(name) : null); if (!Object.op_Implicit((Object)(object)val)) { return null; } Image obj = PictureSlot(parent, anchor, pos, size, pivot); obj.sprite = val; ((Behaviour)obj).enabled = true; return obj; } public static Image PictureSlot(Transform parent, Vector2 anchor, Vector2 pos, Vector2 size, Vector2? pivot = null) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Image obj = ((Component)Node(parent, "Picture", anchor, pos, size, pivot)).gameObject.AddComponent(); obj.preserveAspect = true; ((Graphic)obj).raycastTarget = false; ((Behaviour)obj).enabled = false; return obj; } public static void ShowPicture(Image img, string name) { Sprite val = ((name != null) ? PictureOf(name) : null); if ((Object)(object)img.sprite != (Object)(object)val) { img.sprite = val; } ((Behaviour)img).enabled = Object.op_Implicit((Object)(object)val); } public static RectTransform Node(Transform parent, string name, Vector2 anchor, Vector2 pos, Vector2 size, Vector2? pivot = null) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); val.transform.SetParent(parent, false); RectTransform val2 = (RectTransform)val.transform; Vector2 anchorMin = (val2.anchorMax = anchor); val2.anchorMin = anchorMin; val2.pivot = pivot ?? anchor; val2.anchoredPosition = pos; val2.sizeDelta = size; return val2; } public static Image Box(Transform parent, Vector2 anchor, Vector2 pos, Vector2 size, Color color, float radius = 14f, string sprite = "Ui", Vector2? pivot = null) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Image obj = ((Component)Node(parent, "Box", anchor, pos, size, pivot)).gameObject.AddComponent(); ((Graphic)obj).color = color; ((Graphic)obj).raycastTarget = false; Round(obj, radius, sprite); return obj; } public static void Round(Image img, float radius, string sprite = "Ui") { //IL_0030: Unknown result type (might be due to invalid IL or missing references) Sprite val = ((radius > 0f) ? Sprite(sprite) : null); if (Object.op_Implicit((Object)(object)val)) { img.sprite = val; img.type = (Type)1; img.pixelsPerUnitMultiplier = Mathf.Max(0.01f, val.border.x * 100f / (val.pixelsPerUnit * radius)); } } public static Image Icon(Transform parent, string sprite, Vector2 anchor, Vector2 pos, Vector2 size, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Image obj = ((Component)Node(parent, "Icon", anchor, pos, size)).gameObject.AddComponent(); obj.sprite = Sprite(sprite); obj.preserveAspect = true; ((Graphic)obj).color = color; ((Graphic)obj).raycastTarget = false; return obj; } public static TextMeshProUGUI Label(Transform parent, string text, float size, Vector2 anchor, Vector2 pos, Vector2 box, TextAlignmentOptions align, Color? color = null, bool bold = false, bool outline = false, Vector2? pivot = null) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0046: Unknown result type (might be due to invalid IL or missing references) RectTransform val = Node(parent, "Label", anchor, pos, box, pivot); TextMeshProUGUI val2 = ((Component)val).gameObject.AddComponent(); ((TMP_Text)val2).font = Font; ((TMP_Text)val2).fontSize = size; ((TMP_Text)val2).alignment = align; ((Graphic)val2).color = (Color)(((??)color) ?? Ink); ((TMP_Text)val2).fontStyle = (FontStyles)(bold ? 1 : 0); ((Graphic)val2).raycastTarget = false; ((TMP_Text)val2).richText = true; if (outline) { if (((Component)val).gameObject.activeInHierarchy) { Outline(val2); } else { ((Component)val).gameObject.AddComponent(); } } ((TMP_Text)val2).text = text; ((Component)val).gameObject.AddComponent(); return val2; } private static void Outline(TextMeshProUGUI t) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)t).outlineWidth = 0.18f; ((TMP_Text)t).outlineColor = Color32.op_Implicit(new Color(0f, 0f, 0f, 0.85f)); } public static Color HealthColor(float f) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!(f > 0.6f)) { if (!(f > 0.3f)) { return Bad; } return Gold; } return Good; } public static string Keys(string s) { return KeyRx.Replace(s ?? "", (Match m) => " " + m.Groups[1].Value + " "); } public static string Hex(Color c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return "#" + ColorUtility.ToHtmlStringRGB(c); } public static TextMeshProUGUI CreateText(string name, Vector2 anchor, Vector2 offset, float size, TextAlignmentOptions align) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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) if (!Object.op_Implicit((Object)(object)Font)) { return null; } TextMeshProUGUI obj = Label(Root, "", size, anchor, offset, new Vector2(1400f, 60f), align, null, bold: false, outline: true); ((Object)((Component)obj).gameObject).name = name; return obj; } public static Image CreateMarker(string name, Color color, float size) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Image obj = Icon(Root, "Arrow", new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(size, size), color); ((Object)((Component)obj).gameObject).name = name; return obj; } public static void Prompt(string text) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Font)) { if (!Object.op_Implicit((Object)(object)_promptBox)) { _promptBox = Box(Root, new Vector2(0.5f, 0.3f), Vector2.zero, new Vector2(400f, 54f), Panel, 27f); _promptText = Label(((Component)_promptBox).transform, "", 26f, new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(1200f, 54f), (TextAlignmentOptions)514); } string text2 = Keys(text); if (((TMP_Text)_promptText).text != text2) { ((TMP_Text)_promptText).text = text2; ((Graphic)_promptBox).rectTransform.sizeDelta = new Vector2(((TMP_Text)_promptText).GetPreferredValues(text2).x + 56f, 54f); } _promptFrame = Time.frameCount; } } public static void Banner(string text, float seconds, Color? accent = null) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_0124: 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_0167: 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_0195: 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_01bc: 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_01e1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Font)) { if (!Object.op_Implicit((Object)(object)_banner)) { _banner = Box(Root, new Vector2(0.5f, 0.5f), new Vector2(0f, 230f), new Vector2(700f, 104f), Panel, 22f); _bannerGroup = ((Component)_banner).gameObject.AddComponent(); _bannerGroup.blocksRaycasts = false; _bannerLine = Box(((Component)_banner).transform, new Vector2(0.5f, 0f), new Vector2(0f, 12f), new Vector2(120f, 5f), Accent, 2.5f); _bannerText = Label(((Component)_banner).transform, "", 50f, new Vector2(0.5f, 0.5f), new Vector2(0f, 6f), new Vector2(1500f, 100f), (TextAlignmentOptions)514, null, bold: true); } ((TMP_Text)_bannerText).text = text; ((Graphic)_bannerLine).color = (Color)(((??)accent) ?? Accent); Vector2 preferredValues = ((TMP_Text)_bannerText).GetPreferredValues(text); ((Graphic)_banner).rectTransform.sizeDelta = new Vector2(Mathf.Max(420f, preferredValues.x + 140f), Mathf.Max(104f, preferredValues.y + 44f)); ((TMP_Text)_bannerText).rectTransform.sizeDelta = new Vector2(1500f, preferredValues.y + 10f); _bannerStart = Time.time; _bannerUntil = Time.time + seconds; } } public static void HideBanner() { _bannerUntil = 0f; } public static void Ring(float progress, string caption, Color? color = null) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Font)) { if (!Object.op_Implicit((Object)(object)_ringBack)) { _ringBack = Icon(Root, "UICircle_outline", new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(92f, 92f), new Color(0f, 0f, 0f, 0.45f)); _ringFill = Icon(((Component)_ringBack).transform, "UICircle_outline", new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(92f, 92f), Accent); _ringFill.type = (Type)3; _ringFill.fillMethod = (FillMethod)4; _ringFill.fillOrigin = 2; _ringFill.fillClockwise = true; _ringText = Label(((Component)_ringBack).transform, "", 22f, new Vector2(0.5f, 0f), new Vector2(0f, -36f), new Vector2(600f, 32f), (TextAlignmentOptions)514, null, bold: true, outline: true); } _ringFill.fillAmount = Mathf.Clamp01(progress); ((Graphic)_ringFill).color = (Color)(((??)color) ?? Accent); ((TMP_Text)_ringText).text = caption; _ringFrame = Time.frameCount; } } } public class IslandDecor : MonoBehaviour { public readonly List<(Vector3 at, float radius)> Pools = new List<(Vector3, float)>(); private readonly List<(string kind, Matrix4x4 m)> _wanted = new List<(string, Matrix4x4)>(); private readonly List<(Mesh mesh, Material mat, List batch)> _batches = new List<(Mesh, Material, List)>(); private bool _built; private Vector3 _builtAt; public void Load(string file) { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //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_00e2: 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_00af: Unknown result type (might be due to invalid IL or missing references) if (!File.Exists(file)) { BuildSystem.Log.LogWarning((object)("No island decor file: " + file)); return; } CultureInfo invariantCulture = CultureInfo.InvariantCulture; string[] array = File.ReadAllLines(file); Vector3 val = default(Vector3); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (array2.Length >= 6 && !array2[0].StartsWith("#")) { ((Vector3)(ref val))..ctor(float.Parse(array2[1], invariantCulture), float.Parse(array2[2], invariantCulture), float.Parse(array2[3], invariantCulture)); float num = float.Parse(array2[4], invariantCulture); float num2 = float.Parse(array2[5], invariantCulture); if (array2[0] == "Pool") { Pools.Add((val, num2)); } else { _wanted.Add((array2[0], Matrix4x4.TRS(val, Quaternion.Euler(0f, num, 0f), Vector3.one * num2))); } } } } public bool InPool(Vector3 world) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Vector3 val = world - ((Component)this).transform.position; foreach (var (val2, num) in Pools) { if (val.y < val2.y + 1.2f) { Vector2 val3 = new Vector2(val.x - val2.x, val.z - val2.z); if (((Vector2)(ref val3)).sqrMagnitude < num * num) { return true; } } } return false; } private static Dictionary Types() { return AccessTools.Field(typeof(InstanceManager), "_instanceTypeDic")?.GetValue(null) as Dictionary; } private void Build() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = Types(); if (dictionary == null || dictionary.Count == 0) { return; } _built = true; _builtAt = ((Component)this).transform.position; _batches.Clear(); Matrix4x4 origin = Matrix4x4.TRS(((Component)this).transform.position, Quaternion.identity, Vector3.one); foreach (IGrouping item in from w in _wanted group w by w.kind) { if (!dictionary.TryGetValue(item.Key, out var value) || !Object.op_Implicit((Object)(object)value.Mesh) || !Object.op_Implicit((Object)(object)value.Material)) { BuildSystem.Log.LogWarning((object)("No game plant " + item.Key)); continue; } List list = item.Select<(string, Matrix4x4), Matrix4x4>(((string kind, Matrix4x4 m) w) => origin * w.m).ToList(); for (int num = 0; num < list.Count; num += 1000) { _batches.Add((value.Mesh, value.Material, list.GetRange(num, Mathf.Min(1000, list.Count - num)))); } } if (!Reveal.Playing) { BuildSystem.Log.LogInfo((object)$"Island decor: {_wanted.Count} plants in {_batches.Count} batches, {Pools.Count} tide pools."); } } private void LateUpdate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!_built || ((Component)this).transform.position != _builtAt) { Build(); } Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera) && !Reveal.Playing) { Vector3 val = ((Component)curCamera).transform.position - ((Component)this).transform.position; if (((Vector3)(ref val)).sqrMagnitude > 67600f) { return; } } foreach (var (val2, val3, list) in _batches) { Graphics.DrawMeshInstanced(val2, 0, val3, list); } } } public class ItemIcons : MonoBehaviour { public static ItemIcons Instance; private static readonly Dictionary Done = new Dictionary(); private static readonly List Wanted = new List(); private const int Layer = 31; private const int Size = 160; private static readonly Vector3 Stage = new Vector3(0f, 6000f, 0f); private bool _busy; private static readonly Color Key = new Color(0.16f, 0.18f, 0.22f, 1f); public static event Action Ready; private void Awake() { Instance = this; } public static Sprite Of(byte id) { if (Done.TryGetValue(id, out var value)) { return value; } if (!Wanted.Contains(id)) { Wanted.Add(id); } return null; } private void Update() { if (!_busy && Wanted.Count != 0) { byte id = Wanted[0]; Wanted.RemoveAt(0); ((MonoBehaviour)this).StartCoroutine(Take(id)); } } private IEnumerator Take(byte id) { _busy = true; Item prefab = GameInfo.GetSpawnable(id); GameObject root = (Object.op_Implicit((Object)(object)prefab) ? Pose(prefab) : null); if (!Object.op_Implicit((Object)(object)root)) { BuildSystem.Log.LogInfo((object)string.Format("Item icon {0} ({1}): nothing to draw", id, Object.op_Implicit((Object)(object)prefab) ? ((Object)prefab).name : "no prefab")); Done[id] = null; _busy = false; yield break; } Bounds b = Bounds(root); Texture2D tex = null; int num = 0; int[] array = new int[2] { 0, 31 }; foreach (int layer in array) { Transform[] componentsInChildren = root.GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { ((Component)componentsInChildren[j]).gameObject.layer = layer; } RenderTexture rt = RenderTexture.GetTemporary(160, 160, 24, (RenderTextureFormat)0); Camera cam = new GameObject("ItemIconCamera").AddComponent(); cam.clearFlags = (CameraClearFlags)2; cam.backgroundColor = Key; cam.cullingMask = 1 << layer; cam.orthographic = true; cam.orthographicSize = Mathf.Max(((Bounds)(ref b)).extents.x, Mathf.Max(((Bounds)(ref b)).extents.y, ((Bounds)(ref b)).extents.z)) * 1.15f + 0.01f; cam.nearClipPlane = 0.01f; cam.farClipPlane = 50f; cam.targetTexture = rt; Vector3 val = new Vector3(-0.8f, 0.65f, -1f); Vector3 normalized = ((Vector3)(ref val)).normalized; ((Component)cam).transform.position = ((Bounds)(ref b)).center + normalized * 10f; ((Component)cam).transform.LookAt(((Bounds)(ref b)).center); yield return (object)new WaitForEndOfFrame(); RenderTexture active = RenderTexture.active; RenderTexture.active = rt; if (Object.op_Implicit((Object)(object)tex)) { Object.Destroy((Object)(object)tex); } tex = new Texture2D(160, 160, (TextureFormat)4, false) { name = "ItemIcon" + id, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; tex.ReadPixels(new Rect(0f, 0f, 160f, 160f), 0, 0); RenderTexture.active = active; RenderTexture.ReleaseTemporary(rt); Object.Destroy((Object)(object)((Component)cam).gameObject); Color32[] pixels = tex.GetPixels32(); Color32 val2 = pixels[0]; num = 0; for (int k = 0; k < pixels.Length; k++) { if (Mathf.Abs(pixels[k].r - val2.r) + Mathf.Abs(pixels[k].g - val2.g) + Mathf.Abs(pixels[k].b - val2.b) > 6) { pixels[k].a = byte.MaxValue; num++; } else { pixels[k] = new Color32((byte)0, (byte)0, (byte)0, (byte)0); } } tex.SetPixels32(pixels); tex.Apply(); BuildSystem.Log.LogInfo((object)$"Item icon {id} ({((Object)prefab).name}) on layer {layer}: {root.transform.childCount} meshes, size {((Bounds)(ref b)).size:F2}, {num} of {25600} pixels drawn"); if (num > 0) { break; } } Object.Destroy((Object)(object)root); if (num == 0 && Object.op_Implicit((Object)(object)tex)) { Object.Destroy((Object)(object)tex); } Done[id] = ((num > 0) ? Sprite.Create(tex, new Rect(0f, 0f, 160f, 160f), new Vector2(0.5f, 0.5f), 100f) : null); _busy = false; ItemIcons.Ready?.Invoke(); } private static GameObject Pose(Item prefab) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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) GameObject val = new GameObject("ItemIconStage"); val.transform.position = Stage; Matrix4x4 worldToLocalMatrix = ((Component)prefab).transform.worldToLocalMatrix; int num = 0; Renderer[] componentsInChildren = ((Component)prefab).GetComponentsInChildren(true); bool flag = prefab is Weapon && Object.op_Implicit((Object)(object)prefab.Mesh) && componentsInChildren.Any((Renderer r) => (Object)(object)MeshOf(r) == (Object)(object)prefab.Mesh); Renderer[] array = componentsInChildren; foreach (Renderer val2 in array) { bool num3; if (!flag) { if (!val2.enabled || !ActiveInPrefab(((Component)val2).transform, ((Component)prefab).transform) || val2 is ParticleSystemRenderer || val2 is LineRenderer) { continue; } num3 = val2 is TrailRenderer; } else { num3 = (Object)(object)MeshOf(val2) != (Object)(object)prefab.Mesh; } if (!num3) { Mesh val3 = MeshOf(val2); if (Object.op_Implicit((Object)(object)val3)) { GameObject val4 = new GameObject("Part", new Type[2] { typeof(MeshFilter), typeof(MeshRenderer) }) { layer = 31 }; val4.transform.SetParent(val.transform, false); Matrix4x4 val5 = worldToLocalMatrix * ((Component)val2).transform.localToWorldMatrix; val4.transform.localPosition = Vector4.op_Implicit(((Matrix4x4)(ref val5)).GetColumn(3)); val4.transform.localRotation = ((Matrix4x4)(ref val5)).rotation; val4.transform.localScale = ((Matrix4x4)(ref val5)).lossyScale; val4.GetComponent().sharedMesh = val3; MeshRenderer component = val4.GetComponent(); ((Renderer)component).sharedMaterials = val2.sharedMaterials; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; num++; } } } if (num > 0) { return val; } Object.Destroy((Object)(object)val); return null; static Mesh MeshOf(Renderer r) { SkinnedMeshRenderer val6 = (SkinnedMeshRenderer)(object)((r is SkinnedMeshRenderer) ? r : null); if (val6 == null) { MeshFilter component2 = ((Component)r).GetComponent(); if (component2 == null) { return null; } return component2.sharedMesh; } return val6.sharedMesh; } } private static bool ActiveInPrefab(Transform t, Transform root) { while (Object.op_Implicit((Object)(object)t)) { if (!((Component)t).gameObject.activeSelf) { return false; } if ((Object)(object)t == (Object)(object)root) { return true; } t = t.parent; } return true; } private static Bounds Bounds(GameObject root) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = root.GetComponentsInChildren(); Bounds bounds = componentsInChildren[0].bounds; Renderer[] array = componentsInChildren; foreach (Renderer val in array) { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } return bounds; } } public static class Keepers { public static Keeper Make(Transform parent, Vector3 pos, float yaw, string clothes, string role, Action talk) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00b5: 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_00d0: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Keeper_" + role); val.SetActive(false); val.transform.SetParent(parent, true); val.transform.SetPositionAndRotation(pos, Quaternion.Euler(0f, yaw, 0f)); Person person = Person.Make(val.transform, role); Keeper keeper = val.AddComponent(); keeper.Role = role; keeper.Talk = talk; keeper.Person = person; keeper.Voice = Voice(val); GameObject val2 = new GameObject("Talk"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0f, 0.95f, 0f); val2.layer = LayerMask.NameToLayer("Interactable"); val2.tag = "Interactable"; CapsuleCollider val3 = val2.AddComponent(); val3.center = Vector3.zero; val3.height = 1.9f; val3.radius = 0.45f; Transform transform = new GameObject("TextTarget").transform; transform.SetParent(val.transform, false); transform.localPosition = new Vector3(0f, 2.15f, 0f); KeeperTalk keeperTalk = val2.AddComponent(); keeperTalk.Keeper = keeper; AccessTools.Field(typeof(Interactable), "_interactCol").SetValue(keeperTalk, val3); AccessTools.Field(typeof(Interactable), "_textTarget").SetValue(keeperTalk, transform); AccessTools.Field(typeof(Interactable), "_modelsToOutline").SetValue(keeperTalk, person.Renderers); val.SetActive(true); return keeper; } private static AudioSource Voice(GameObject on) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) AudioSource val = (from n in Resources.FindObjectsOfTypeAll().Where(delegate(NPC n) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)n)) { Scene scene = ((Component)n).gameObject.scene; return ((Scene)(ref scene)).IsValid(); } return false; }) select ((Component)n).GetComponentInChildren(true)).FirstOrDefault((Func)((AudioSource a) => Object.op_Implicit((Object)(object)a) && Object.op_Implicit((Object)(object)a.clip))); if (!Object.op_Implicit((Object)(object)val)) { return null; } AudioSource obj = on.AddComponent(); obj.clip = val.clip; obj.outputAudioMixerGroup = val.outputAudioMixerGroup; obj.spatialBlend = val.spatialBlend; obj.rolloffMode = val.rolloffMode; obj.minDistance = val.minDistance; obj.maxDistance = val.maxDistance; obj.volume = val.volume; obj.pitch = Random.Range(0.85f, 1.2f); obj.playOnAwake = false; return obj; } } public class Keeper : MonoBehaviour { public string Role; public Action Talk; public Person Person; public AudioSource Voice; private float _yaw; private float _baseYaw; private float _talkUntil; private float _lookYaw; private float _lookPitch; private const float SeeRange = 7f; private const float MaxTurn = 70f; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) _baseYaw = (_yaw = ((Component)this).transform.eulerAngles.y); if (Object.op_Implicit((Object)(object)Voice)) { Voice.Stop(); Voice.loop = true; } } public void Said() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) _talkUntil = Time.time + 1.1f; if (Object.op_Implicit((Object)(object)Voice) && Object.op_Implicit((Object)(object)Voice.clip)) { Voice.time = Random.Range(0f, Voice.clip.length); Voice.volume = 0.75f; Voice.Play(); } else { Fx.Sound("Pop", ((Component)this).transform.position + Vector3.up * 1.6f, 0.5f, (AudioDistance)1); } Talk?.Invoke(); } private void LateUpdate() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Person)) { Player localPlayer = Player.LocalPlayer; Vector3? val = ((Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Camera)) ? new Vector3?(localPlayer.Camera.CamTransform.position) : ((Vector3?)null)); int num; if (val.HasValue) { Vector3 valueOrDefault = val.GetValueOrDefault(); Vector3 val2 = valueOrDefault - ((Component)this).transform.position; num = ((((Vector3)(ref val2)).sqrMagnitude < 49f) ? 1 : 0); } else { num = 0; } float num2 = _baseYaw; float num3 = 0f; float num4 = 0f; if (num != 0 && val.HasValue) { Vector3 valueOrDefault2 = val.GetValueOrDefault(); Vector3 val3 = valueOrDefault2 - ((Component)this).transform.position; float num5 = Mathf.Atan2(val3.x, val3.z) * 57.29578f; num2 = _baseYaw + Mathf.Clamp(Mathf.DeltaAngle(_baseYaw, num5), -70f, 70f); Vector3 val4 = ((Component)Person).transform.InverseTransformPoint(valueOrDefault2) - Person.Eyes; num3 = Mathf.Clamp(Mathf.Atan2(val4.x, val4.z) * 57.29578f, -40f, 40f); float y = val4.y; Vector2 val5 = new Vector2(val4.x, val4.z); num4 = Mathf.Clamp((0f - Mathf.Atan2(y, ((Vector2)(ref val5)).magnitude)) * 57.29578f, -25f, 25f); } _yaw = Mathf.MoveTowardsAngle(_yaw, num2, 140f * Time.deltaTime); ((Component)Person).transform.rotation = Quaternion.Euler(0f, _yaw, 0f); float num6 = 1f - Mathf.Exp(-8f * Time.deltaTime); _lookYaw = Mathf.Lerp(_lookYaw, num3, num6); _lookPitch = Mathf.Lerp(_lookPitch, num4, num6); bool flag = Time.time < _talkUntil; Person.Pose(0f, 0f, carry: false, flag ? 1f : 0f, _lookYaw, _lookPitch + (flag ? (Mathf.Sin(Time.time * 14f) * 6f) : 0f)); if (Object.op_Implicit((Object)(object)Voice) && Voice.isPlaying && !flag) { Voice.Stop(); } } } } public class KeeperTalk : Interactable { public Keeper Keeper; private string _text; public override void Hover() { //IL_0073: 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) if (!base._isHovering) { _text = L10n.T("keeper" + Keeper.Role) + "\n" + L10n.T("keeperTalk") + " " + SpriteManager.GetPickUpInput(); PlayerUI.SetLookAtText(_text, ((Interactable)this).TextTarget, default(Vector3), false); } ((Interactable)this).Hover(); } public override void UnHover() { PlayerUI.HideLookAtText(_text); ((Interactable)this).UnHover(); } public override void Interact(Player player) { ((Interactable)this).Interact(player); if (!((Object)(object)player != (Object)(object)Player.LocalPlayer)) { ((Interactable)this).UnHover(); Keeper.Said(); } } } public enum LanguageSetting { Auto, English, TraditionalChinese, SimplifiedChinese } public static class L10n { private enum Lang { En, ZhTW, ZhCN } public static ConfigEntry Setting; private static readonly Dictionary Table = new Dictionary { ["prefix"] = new string[3] { "[Fortress]", "[要塞]", "[要塞]" }, ["start"] = new string[3] { "The siege begins! Best so far: {0} waves.", "要塞防禦開始!最高紀錄 {0} 波。", "要塞防御开始!最高纪录 {0} 波。" }, ["wave"] = new string[3] { "Wave {0}: {1} creatures (HP x{2})!", "第 {0} 波:{1} 隻怪物(血量 x{2})!", "第 {0} 波:{1} 只怪物(血量 x{2})!" }, ["cleared"] = new string[3] { "Wave {0} cleared! +${1}. Build time {2}s (host: {3} to start now).", "第 {0} 波清除!+${1}。建造時間 {2} 秒(房主按 {3} 立即開始)。", "第 {0} 波清除!+${1}。建造时间 {2} 秒(房主按 {3} 立即开始)。" }, ["startHint"] = new string[3] { "Press {0} to build walls and turrets. Host: {1} starts the next wave early.", "按 {0} 建造牆和砲塔。房主按 {1} 可以提早開始下一波。", "按 {0} 建造墙和炮塔。房主按 {1} 可以提早开始下一波。" }, ["stopped"] = new string[3] { "Stopped.", "已停止。", "已停止。" }, ["notHost"] = new string[3] { "Stopped (not host anymore).", "已停止(你已不是房主)。", "已停止(你已不是房主)。" }, ["wipe"] = new string[3] { "Everyone is down! Game over.", "全員倒下!遊戲結束。", "全员倒下!游戏结束。" }, ["downSelf"] = new string[3] { "You're down! In a round you can't get up on your own: a friend has to pick up your body (E) and hold it to bring you back. Everyone down and it's over.", "你倒下了!要塞模式中不能自己復活:要隊友把你的身體撿起來(E)抱著才能救回來。全員倒下就輸了。", "你倒下了!要塞模式中不能自己复活:要队友把你的身体捡起来(E)抱着才能救回来。全员倒下就输了。" }, ["downOther"] = new string[3] { "{0} is down! Pick up their body (E) and hold it to bring them back.", "{0} 倒下了!把他的身體撿起來(E)抱著就能救回來。", "{0} 倒下了!把他的身体捡起来(E)抱着就能救回来。" }, ["downNoGiveUp"] = new string[3] { "No getting up on your own in a round: wait for a friend to hold your body.", "要塞模式中不能自己復活:等隊友把你的身體抱起來。", "要塞模式中不能自己复活:等队友把你的身体抱起来。" }, ["result"] = new string[3] { "{0} Cleared {1} waves.", "{0}撐過 {1} 波。", "{0}撑过 {1} 波。" }, ["newRecord"] = new string[3] { " NEW RECORD!", " 新紀錄!", " 新纪录!" }, ["best"] = new string[3] { " (best: {0})", "(最高:{0})", "(最高:{0})" }, ["practice"] = new string[3] { " (test keys used: no record)", "(用了測試鍵,不計紀錄)", "(用了测试键,不计纪录)" }, ["onlyHost"] = new string[3] { "Only the host can start waves.", "只有房主可以開始波次。", "只有房主可以开始波次。" }, ["noCreatures"] = new string[3] { "No creatures to spawn, check CreaturePool.", "沒有可生成的怪物,請檢查 CreaturePool 設定。", "没有可生成的怪物,请检查 CreaturePool 设置。" }, ["buildHud"] = new string[3] { "BUILD: {0} [hold LMB] place [Y] flip [U] upgrade [J] repair [H] remove (half back) [G] exit", "建造:{0} [按住左鍵] 放置 [Y] 反向 [U] 升級 [J] 修理 [H] 拆除(退一半) [G] 離開", "建造:{0} [按住左键] 放置 [Y] 反向 [U] 升级 [J] 修理 [H] 拆除(退一半) [G] 离开" }, ["cost"] = new string[3] { " (${0})", "(${0})", "(${0})" }, ["free"] = new string[3] { " (free outside fortress mode)", "(要塞模式外免費)", "(要塞模式外免费)" }, ["lookInfo"] = new string[3] { "{0} Lv{1} HP {2}/{3} {4}", "{0} Lv{1} 耐久 {2}/{3} {4}", "{0} Lv{1} 耐久 {2}/{3} {4}" }, ["upgradeHint"] = new string[3] { "[U] upgrade: ${0}", "[U] 升級:${0}", "[U] 升级:${0}" }, ["buildPhase"] = new string[3] { "Build time {0}s", "建造時間 {0} 秒", "建造时间 {0} 秒" }, ["fightPhase"] = new string[3] { "Defend the lighthouse!", "守住燈塔!", "守住灯塔!" }, ["siegeHud"] = new string[3] { "Wave {0} Core {1}/{2} Enemies {3} Money ${4}", "第 {0} 波 核心 {1}/{2} 敵人 {3} 錢 ${4}", "第 {0} 波 核心 {1}/{2} 敌人 {3} 钱 ${4}" }, ["coreDown"] = new string[3] { "The core was destroyed! Game over.", "核心被摧毀!遊戲結束。", "核心被摧毁!游戏结束。" }, ["noLand"] = new string[3] { "No land near the core, so walkers can't spawn. Start on an island to get walkers.", "核心附近沒有陸地,登陸魚無法出現。請站在島上再開始。", "核心附近没有陆地,登陆鱼无法出现。请站在岛上再开始。" }, ["islandUnlocked"] = new string[3] { "A new island has appeared on your radar...", "雷達上出現了一座新的島……", "雷达上出现了一座新的岛……" }, ["boardTitle"] = new string[3] { "OVER 99 records", "OVER 99 紀錄", "OVER 99 纪录" }, ["boardBest"] = new string[3] { "Best run: {0} waves", "最高紀錄:撐過 {0} 波", "最高纪录:撑过 {0} 波" }, ["boardNone"] = new string[3] { "Nobody has held all 100 waves yet.\nWill it be you?", "還沒有人撐過全部 100 波。\n你們會是第一隊嗎?", "还没有人撑过全部 100 波。\n你们会是第一队吗?" }, ["boardWins"] = new string[3] { "OVER 99 × {0}", "OVER 99 達成 {0} 次", "OVER 99 达成 {0} 次" }, ["bossIntroWave"] = new string[3] { "Wave {0}", "第 {0} 波", "第 {0} 波" }, ["enemyWarden"] = new string[3] { "Iron-Claw Warden", "鐵鉗典獄長", "铁钳典狱长" }, ["bossNameWarden"] = new string[3] { "Iron-Claw Warden", "鐵鉗典獄長", "铁钳典狱长" }, ["bossEpithetWarden"] = new string[3] { "The Guillotine of the Shore", "沙灘的斷頭台", "沙滩的断头台" }, ["bossQuoteWarden"] = new string[3] { "Kneel. Your walls will be your gravestones.", "跪下吧。你們的城牆,就是你們的墓碑。", "跪下吧。你们的城墙,就是你们的墓碑。" }, ["bossHintWarden"] = new string[3] { "Its claw falls on the red circle: hit it hard while it winds up to break the move. In its shell turrets barely scratch it: go in with your weapons", "牠的鉗子會落在紅圈:趁蓄力時猛打就能破招。縮進殼裡時砲塔幾乎打不動,拿武器上前打", "它的钳子会落在红圈:趁蓄力时猛打就能破招。缩进壳里时炮塔几乎打不动,拿武器上前打" }, ["wardenGuillotine"] = new string[3] { "Guillotine Claw!", "斷頭鉗!", "断头钳!" }, ["wardenChains"] = new string[3] { "Shackles! Chained turrets are silenced", "鎖鏈枷鎖!被鎖住的砲塔暫時停火", "锁链枷锁!被锁住的炮塔暂时停火" }, ["wardenShell"] = new string[3] { "Shell Fortress: turrets do a quarter. Use your weapons!", "甲殼要塞:砲塔只剩四分之一傷害,用武器打!", "甲壳要塞:炮塔只剩四分之一伤害,用武器打!" }, ["enemyUrchin"] = new string[3] { "Thousand-Needle Urchin", "萬針刺皇", "万针刺皇" }, ["bossNameUrchin"] = new string[3] { "Thousand-Needle Urchin", "萬針刺皇", "万针刺皇" }, ["bossEpithetUrchin"] = new string[3] { "Sovereign of Ten Thousand Spikes", "萬刃加身的刺之君主", "万刃加身的刺之君主" }, ["bossQuoteUrchin"] = new string[3] { "Come closer. I'll make a pincushion of you.", "想靠近我?那就千瘡百孔吧。", "想靠近我?那就千疮百孔吧。" }, ["bossHintUrchin"] = new string[3] { "It rolls down the red lane: get out of it, or break it while it spins up. Its spikes stay in the ground: don't stand on them", "牠會沿著紅色通道滾過去:閃開,或趁牠原地加速時破招。射出的刺會留在地上,別踩", "它会沿着红色通道滚过去:闪开,或趁它原地加速时破招。射出的刺会留在地上,别踩" }, ["urchinCrush"] = new string[3] { "Rolling Crush!", "滾地碾壓!", "滚地碾压!" }, ["urchinBloom"] = new string[3] { "Thorn Bloom! Get away from it", "萬針綻放!快離開牠身邊", "万针绽放!快离开它身边" }, ["enemyAngler"] = new string[3] { "Abyssal Lantern", "深淵提燈", "深渊提灯" }, ["bossNameAngler"] = new string[3] { "Abyssal Lantern", "深淵提燈", "深渊提灯" }, ["bossEpithetAngler"] = new string[3] { "Keeper of the Light That Lures Souls", "誘魂之光的持有者", "诱魂之光的持有者" }, ["bossQuoteAngler"] = new string[3] { "Look at my light... and sink into the endless night.", "看著我的光……然後,沉入永夜吧。", "看着我的光……然后,沉入永夜吧。" }, ["bossHintAngler"] = new string[3] { "When its lantern flares, LOOK AWAY or be dragged in. In its dark, turrets only see far near the lighthouse's light", "燈籠一閃就轉頭別看,不然會被吸過去!黑暗中只有燈塔光照得到的砲塔看得遠", "灯笼一闪就转头别看,不然会被吸过去!黑暗中只有灯塔光照得到的炮塔看得远" }, ["anglerLure"] = new string[3] { "Don't look at the light!", "別看那道光!", "别看那道光!" }, ["anglerVeil"] = new string[3] { "Abyssal Veil: outside the lighthouse's light turrets see half as far", "深淵帷幕:燈塔光外,砲塔射程減半", "深渊帷幕:灯塔光外,炮塔射程减半" }, ["anglerPhase2"] = new string[3] { "Endless night: the dark won't lift again", "永夜降臨:黑暗不再散去", "永夜降临:黑暗不再散去" }, ["enemySteed"] = new string[3] { "Silver Steed", "白銀天馬", "白银天马" }, ["bossNameSteed"] = new string[3] { "Silver Steed", "白銀天馬", "白银天马" }, ["bossEpithetSteed"] = new string[3] { "Knight of the Golden Spin", "黃金迴轉的騎士", "黄金回转的骑士" }, ["bossQuoteSteed"] = new string[3] { "Under my hooves there is no road that can't be ridden.", "在我的鐵蹄之下,沒有跨不過的路。", "在我的铁蹄之下,没有跨不过的路。" }, ["bossHintSteed"] = new string[3] { "It charges down lanes and stamps the ground round it: watch the red, and break its charges", "牠會沿著通道衝鋒、原地踏地震:看紅色區域閃避,打斷牠的衝鋒", "它会沿着通道冲锋、原地踏地震:看红色区域闪避,打断它的冲锋" }, ["steedCharge"] = new string[3] { "Lance Charge!", "衝鋒陷陣!", "冲锋陷阵!" }, ["steedCavalry"] = new string[3] { "Phantom Cavalry! Out of the lanes", "幻影騎兵!快離開通道", "幻影骑兵!快离开通道" }, ["steedPhase2"] = new string[3] { "Golden Spin!", "黃金迴轉!", "黄金回转!" }, ["enemyStonefish"] = new string[3] { "Venom Rock Emperor", "劇毒岩皇", "剧毒岩皇" }, ["bossNameStonefish"] = new string[3] { "Venom Rock Emperor", "劇毒岩皇", "剧毒岩皇" }, ["bossEpithetStonefish"] = new string[3] { "Whose Nest of Poison Is the Earth", "以大地為毒巢者", "以大地为毒巢者" }, ["bossQuoteStonefish"] = new string[3] { "Move, I dare you. This ground is mine already.", "動一下試試?這片土地,早已是我的毒巢。", "动一下试试?这片土地,早已是我的毒巢。" }, ["bossHintStonefish"] = new string[3] { "It travels under the ground, where turrets can't see it. Its eyes glow before its gaze turns turrets to stone: break it then", "牠會鑽地移動,砲塔看不到。眼睛發光就是石化凝視:趁那時打斷", "它会钻地移动,炮塔看不到。眼睛发光就是石化凝视:趁那时打断" }, ["stoneSpires"] = new string[3] { "Rock Spires!", "岩刺突襲!", "岩刺突袭!" }, ["stoneGaze"] = new string[3] { "Petrifying Gaze! Break it!", "石化之瞳!快打斷!", "石化之瞳!快打断!" }, ["enemySkyfish"] = new string[3] { "Sky Torpedo Admiral", "天翔魚雷提督", "天翔鱼雷提督" }, ["bossNameSkyfish"] = new string[3] { "Sky Torpedo Admiral", "天翔魚雷提督", "天翔鱼雷提督" }, ["bossEpithetSkyfish"] = new string[3] { "Sovereign of the Open Sky", "制空權的主宰", "制空权的主宰" }, ["bossQuoteSkyfish"] = new string[3] { "Air superiority was mine from the start.", "制空權,從一開始就是我的。", "制空权,从一开始就是我的。" }, ["bossHintSkyfish"] = new string[3] { "Focus it while it lines up a run: broken, it falls out of the sky. Shoot its squadron before they dive on your turrets", "牠對準俯衝時集火就能把牠打下來!先擊落飛魚中隊,別讓牠們撞上砲塔", "它对准俯冲时集火就能把它打下来!先击落飞鱼中队,别让它们撞上炮塔" }, ["skyfishDive"] = new string[3] { "Torpedo Dive!", "魚雷俯衝!", "鱼雷俯冲!" }, ["skyfishSquadron"] = new string[3] { "Flying-fish squadron! Shoot them down", "飛魚中隊來襲!快擊落", "飞鱼中队来袭!快击落" }, ["skyfishBoom"] = new string[3] { "Sonic Boom!", "音爆!", "音爆!" }, ["skyfishPhase2"] = new string[3] { "Full Barrage!", "全彈發射!", "全弹发射!" }, ["enemySquadron"] = new string[3] { "Flying-Fish Squadron", "飛魚中隊", "飞鱼中队" }, ["enemyKraken"] = new string[3] { "Crimson Kraken", "深紅克拉肯", "深红克拉肯" }, ["bossNameKraken"] = new string[3] { "Crimson Kraken", "深紅克拉肯", "深红克拉肯" }, ["bossEpithetKraken"] = new string[3] { "The Sea That Drags All Below", "將一切拖入深淵的海魔", "将一切拖入深渊的海魔" }, ["bossQuoteKraken"] = new string[3] { "This whole island... I'll drag it into the deep.", "整座島……都將被拖進深海。", "整座岛……都将被拖进深海。" }, ["bossHintKraken"] = new string[3] { "A tentacle rising by a turret means it's about to drag it into the sea: break it to save the turret! Its ink blinds turrets", "砲塔旁冒出觸手,代表要把它拖進海裡:快破招救砲塔!墨汁會讓砲塔看不見", "炮塔旁冒出触手,代表要把它拖进海里:快破招救炮塔!墨汁会让炮塔看不见" }, ["krakenSweep"] = new string[3] { "Tentacle Sweep!", "觸手橫掃!", "触手横扫!" }, ["krakenGrab"] = new string[3] { "It's got a turret! Break it!", "觸手抓住砲塔了!快打斷!", "触手抓住炮塔了!快打断!" }, ["krakenInk"] = new string[3] { "Ink! Turrets in it can't see", "墨汁!裡面的砲塔看不見", "墨汁!里面的炮塔看不见" }, ["krakenWhirl"] = new string[3] { "Whirlpool! Don't get dragged in", "漩渦!別被捲進去", "漩涡!别被卷进去" }, ["enemyVoxel"] = new string[3] { "Shattered Pixel King", "碎裂像素王", "碎裂像素王" }, ["bossNameVoxel"] = new string[3] { "Shattered Pixel King", "碎裂像素王", "碎裂像素王" }, ["bossEpithetVoxel"] = new string[3] { "The Error in the World's Code", "世界程式碼的錯誤", "世界代码的错误" }, ["bossQuoteVoxel"] = new string[3] { "Your defences? One Ctrl+Z and they're gone.", "你們的防線?Ctrl+Z 一下就沒了。", "你们的防线?Ctrl+Z 一下就没了。" }, ["bossHintVoxel"] = new string[3] { "Its copies aren't it (the real one is bigger). Break its Ctrl+Z or it heals; get out of the red box before DELETE", "分身不是本尊(本尊比較大)。打斷 Ctrl+Z,不然牠會回血;DELETE 之前快離開紅框", "分身不是本尊(本尊比较大)。打断 Ctrl+Z,不然它会回血;DELETE 之前快离开红框" }, ["voxelCopy"] = new string[3] { "Ctrl+C, Ctrl+V: copies!", "Ctrl+C、Ctrl+V:分身!", "Ctrl+C、Ctrl+V:分身!" }, ["voxelDelete"] = new string[3] { "DELETE: out of the box!", "DELETE:快離開紅框!", "DELETE:快离开红框!" }, ["voxelUndo"] = new string[3] { "Ctrl+Z: it's healing! Break it!", "Ctrl+Z:牠在回血!快打斷!", "Ctrl+Z:它在回血!快打断!" }, ["voxelPhase2"] = new string[3] { "FATAL ERROR", "FATAL ERROR 致命錯誤", "FATAL ERROR 致命错误" }, ["enemyGlitch"] = new string[3] { "Pixel Copy", "像素分身", "像素分身" }, ["enemyKoi"] = new string[3] { "Koi of the Dragon Gate", "登龍錦鯉", "登龙锦鲤" }, ["bossNameKoi"] = new string[3] { "Koi of the Dragon Gate", "登龍錦鯉", "登龙锦鲤" }, ["bossEpithetKoi"] = new string[3] { "The One Who Swims Up the Waterfall", "逆流而上的登龍者", "逆流而上的登龙者" }, ["bossQuoteKoi"] = new string[3] { "A koi that swims upstream becomes a dragon. You are only my gate.", "逆流而上的鯉,終將成龍——而你們,只是我的龍門。", "逆流而上的鲤,终将成龙——而你们,只是我的龙门。" }, ["bossHintKoi"] = new string[3] { "At half health it becomes a dragon. Its leaps and its breath can be broken: hit it hard while it winds up", "半血時化身為龍。牠的躍擊和龍息都能在蓄力時打斷", "半血时化身为龙。它的跃击和龙息都能在蓄力时打断" }, ["koiJet"] = new string[3] { "Water Dragon Jet!", "水龍彈!", "水龙弹!" }, ["koiLeap"] = new string[3] { "It leaps for the gate!", "躍龍門!", "跃龙门!" }, ["koiDragonDive"] = new string[3] { "Dragon Dive!", "神龍俯衝!", "神龙俯冲!" }, ["koiDragon"] = new string[3] { "The koi leaps the Dragon Gate... and becomes a DRAGON!", "鯉躍龍門——化身為龍!", "鲤跃龙门——化身为龙!" }, ["koiFire"] = new string[3] { "Dragon Breath!", "龍炎!", "龙炎!" }, ["koiThunder"] = new string[3] { "Heaven's Thunder! Out of the circles!", "天雷!快離開光圈!", "天雷!快离开光圈!" }, ["enemyEye"] = new string[3] { "The Eye at the End", "終焉之眼", "终焉之眼" }, ["bossNameEye"] = new string[3] { "The Eye at the End", "終焉之眼", "终焉之眼" }, ["bossEpithetEye"] = new string[3] { "OVER 99: Judge of the Last Line", "OVER 99・最終防線的審判者", "OVER 99・最终防线的审判者" }, ["bossQuoteEye"] = new string[3] { "The ninety-ninth line ends here. Go beyond it, if you can.", "第九十九道防線,到此為止。超越吧——如果你們做得到。", "第九十九道防线,到此为止。超越吧——如果你们做得到。" }, ["bossHintEye"] = new string[3] { "The shadows of every boss come back. At a quarter health it judges the lighthouse: everyone, break it!", "所有王的影子都會重現。剩四分之一血時會審判燈塔:全員集火打斷!", "所有王的影子都会重现。剩四分之一血时会审判灯塔:全员集火打断!" }, ["eyeGaze"] = new string[3] { "Its gaze sweeps the fort!", "凝視掃射!", "凝视扫射!" }, ["eyeSpears"] = new string[3] { "Ninety-Nine Spears!", "九十九之矛!", "九十九之矛!" }, ["eyeEchoes"] = new string[3] { "Echoes of the fallen...", "往日回響……", "往日回响……" }, ["eyePhase2"] = new string[3] { "OVER 99", "OVER 99——超越極限", "OVER 99——超越极限" }, ["eyeJudgment"] = new string[3] { "LAST JUDGMENT: break it, or the lighthouse falls!", "最後的審判:打斷牠,否則燈塔將崩毀!", "最后的审判:打断它,否则灯塔将崩毁!" }, ["trophyWarden"] = new string[3] { "The Warden's Guillotine Claw", "典獄長的斷罪鉗", "典狱长的断罪钳" }, ["trophyDroppedWarden"] = new string[3] { "Trophy: The Warden's Guillotine Claw! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:典獄長的斷罪鉗!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:典狱长的断罪钳!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophyUrchin"] = new string[3] { "The Urchin King's Needle", "刺皇的王之刺", "刺皇的王之刺" }, ["trophyDroppedUrchin"] = new string[3] { "Trophy: The Urchin King's Needle! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:刺皇的王之刺!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:刺皇的王之刺!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophyAngler"] = new string[3] { "The Soul-Luring Lantern", "誘魂之燈", "诱魂之灯" }, ["trophyDroppedAngler"] = new string[3] { "Trophy: The Soul-Luring Lantern! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:誘魂之燈!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:诱魂之灯!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophySteed"] = new string[3] { "The Golden Horseshoe", "黃金蹄鐵", "黄金蹄铁" }, ["trophyDroppedSteed"] = new string[3] { "Trophy: The Golden Horseshoe! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:黃金蹄鐵!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:黄金蹄铁!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophyStonefish"] = new string[3] { "The Venom Rock's Spines", "劇毒岩皇的毒棘", "剧毒岩皇的毒棘" }, ["trophyDroppedStonefish"] = new string[3] { "Trophy: The Venom Rock's Spines! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:劇毒岩皇的毒棘!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:剧毒岩皇的毒棘!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophySkyfish"] = new string[3] { "The Admiral's Wing", "提督之翼", "提督之翼" }, ["trophyDroppedSkyfish"] = new string[3] { "Trophy: The Admiral's Wing! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:提督之翼!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:提督之翼!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophyKraken"] = new string[3] { "The Crimson Tentacle", "深紅觸手", "深红触手" }, ["trophyDroppedKraken"] = new string[3] { "Trophy: The Crimson Tentacle! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:深紅觸手!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:深红触手!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophyVoxel"] = new string[3] { "The Pixel Core", "像素核心", "像素核心" }, ["trophyDroppedVoxel"] = new string[3] { "Trophy: The Pixel Core! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:像素核心!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:像素核心!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophyKoi"] = new string[3] { "The Dragon Pearl", "龍珠", "龙珠" }, ["trophyDroppedKoi"] = new string[3] { "Trophy: The Dragon Pearl! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:龍珠!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:龙珠!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["trophyEye"] = new string[3] { "The Eye at the End", "終焉之眼的眼核", "终焉之眼的眼核" }, ["trophyDroppedEye"] = new string[3] { "Trophy: The Eye at the End! Sell it at the fish stall's counter, or keep it in the vault", "掉落戰利品:終焉之眼的眼核!可以丟到魚攤櫃台賣錢,或收進儲藏庫", "掉落战利品:终焉之眼的眼核!可以丢到鱼摊柜台卖钱,或收进储藏库" }, ["bossBroken"] = new string[3] { "BREAK! It's reeling: hit it!", "破招!牠失去平衡了,全力攻擊!", "破招!它失去平衡了,全力攻击!" }, ["bossPhase2"] = new string[3] { "It enters its second form!", "牠進入第二形態!", "它进入第二形态!" }, ["revealTitle"] = new string[3] { "OVER 99", "OVER 99", "OVER 99" }, ["revealSub"] = new string[3] { "Fortress Island has risen from the sea", "要塞島從海中升起", "要塞岛从海中升起" }, ["revealLine"] = new string[3] { "Hold the lighthouse through 100 waves. It's on your radar.", "撐過 100 波,守住燈塔。雷達上找得到它。", "撑过 100 波,守住灯塔。雷达上找得到它。" }, ["revealSkip"] = new string[3] { "Hold [Space] 3 s to skip", "按住 [空白鍵] 3 秒跳過", "按住 [空格键] 3 秒跳过" }, ["victorySub"] = new string[3] { "All 100 waves held: the lighthouse stands", "100 波全部撐過・燈塔屹立不搖", "100 波全部撑过・灯塔屹立不摇" }, ["islandTitle"] = new string[3] { "Fortress Island", "要塞島", "要塞岛" }, ["readyPrompt"] = new string[3] { "At the lighthouse door, [E] opens the gate: the pearl's light brings the fish", "到燈塔門口按 [E] 打開閘門,珍珠的光會引來魚群", "到灯塔门口按 [E] 打开闸门,珍珠的光会引来鱼群" }, ["readyCountdown"] = new string[3] { "The gate is opening: the fish come in {0}...", "閘門打開中,魚群 {0} 秒後到……", "闸门打开中,鱼群 {0} 秒后到……" }, ["gateCancelHint"] = new string[3] { "[E] at the door: stop", "在門口按 [E] 取消", "在门口按 [E] 取消" }, ["gatePull"] = new string[3] { "Open the gate: start the round", "打開閘門・開始守塔", "打开闸门・开始守塔" }, ["gateCancel"] = new string[3] { "Hold off: stop the countdown", "先等等:取消開戰", "先等等:取消开战" }, ["gatePulled"] = new string[3] { "The gate opens and the pearl shines out! The fish come in {0} s", "閘門打開,珍珠的光透出來了!魚群 {0} 秒後殺到", "闸门打开,珍珠的光透出来了!鱼群 {0} 秒后杀到" }, ["gateCancelled"] = new string[3] { "The gate closed again: not yet", "閘門又關上了,先不開戰", "闸门又关上了,先不开战" }, ["ladderHint"] = new string[3] { "Ladder: [W] up [S] down [Space] let go", "梯子:[W] 往上\u3000[S] 往下\u3000[空白鍵] 放手", "梯子:[W] 往上\u3000[S] 往下\u3000[空格键] 放手" }, ["vaultFullNotice"] = new string[3] { "The vault is full ({0} slots): expand it at the quartermaster", "儲藏庫滿了({0} 格):到軍需官那裡擴充", "储藏库满了({0} 格):到军需官那里扩充" }, ["vaultSaved"] = new string[3] { "The fortress vault is saved with it", "要塞倉庫也一起存好了", "要塞仓库也一起存好了" }, ["testCleared"] = new string[3] { "Cleared {0} things lying around the island.", "清掉了島上 {0} 件地上的東西。", "清掉了岛上 {0} 件地上的东西。" }, ["resultCore"] = new string[3] { "The lighthouse has fallen", "燈塔陷落了", "灯塔陷落了" }, ["resultWipe"] = new string[3] { "Everyone is down", "全員倒下", "全员倒下" }, ["resultStats"] = new string[3] { "Waves cleared {0} Kills {1} Built {2}", "撐過 {0} 波 擊殺 {1} 建造 {2}", "撑过 {0} 波 击杀 {1} 建造 {2}" }, ["resultRecord"] = new string[3] { "NEW RECORD!", "新紀錄!", "新纪录!" }, ["resultBest"] = new string[3] { "Best: {0} waves", "最高紀錄:{0} 波", "最高纪录:{0} 波" }, ["resultAgain"] = new string[3] { "Open the lighthouse gate [E] to go again", "到燈塔門口按 E 打開閘門,再挑戰一次", "到灯塔门口按 E 打开闸门,再挑战一次" }, ["needRound"] = new string[3] { "Start a round first (the lighthouse door, [E])", "先開始一局(到燈塔門口按 E)", "先开始一局(到灯塔门口按 E)" }, ["needIsland"] = new string[3] { "You can only build on the fortress island", "只能在要塞島上建造", "只能在要塞岛上建造" }, ["needCoins"] = new string[3] { "Not enough money", "錢不夠", "钱不够" }, ["waveBanner"] = new string[3] { "Wave {0}", "第 {0} 波", "第 {0} 波" }, ["eliteBanner"] = new string[3] { "Wave {0}: elites incoming!", "第 {0} 波:精英來襲!", "第 {0} 波:精英来袭!" }, ["clearedBanner"] = new string[3] { "Wave {0} cleared", "第 {0} 波清除", "第 {0} 波清除" }, ["Harpoon"] = new string[3] { "Harpoon", "魚叉塔", "鱼叉塔" }, ["Mortar"] = new string[3] { "Mortar", "迫擊砲", "迫击炮" }, ["Tesla"] = new string[3] { "Tesla coil", "電網塔", "电网塔" }, ["Spikes"] = new string[3] { "Spike trap", "尖刺陷阱", "尖刺陷阱" }, ["GunA"] = new string[3] { "Storm", "暴風", "暴风" }, ["GunB"] = new string[3] { "Armour-piercing", "穿甲", "穿甲" }, ["CannonA"] = new string[3] { "Cluster", "集束", "集束" }, ["CannonB"] = new string[3] { "Heavy", "重砲", "重炮" }, ["HarpoonA"] = new string[3] { "Multi-shot", "多重", "多重" }, ["HarpoonB"] = new string[3] { "Freeze", "冰凍", "冰冻" }, ["MortarA"] = new string[3] { "Firestorm", "燃燒", "燃烧" }, ["MortarB"] = new string[3] { "Barrage", "連發", "连发" }, ["TeslaA"] = new string[3] { "Spread", "擴散", "扩散" }, ["TeslaB"] = new string[3] { "Overload", "超載", "超载" }, ["branchHint"] = new string[3] { "[U] {0} / [Shift+U] {1}: ${2}", "[U] {0} / [Shift+U] {1}:${2}", "[U] {0} / [Shift+U] {1}:${2}" }, ["repairHint"] = new string[3] { "[J] repair: ${0}", "[J] 修理:${0}", "[J] 修理:${0}" }, ["barHint"] = new string[3] { "[T] next [Shift+T] back", "[T] 下一個 [Shift+T] 上一個", "[T] 下一个 [Shift+T] 上一个" }, ["islandWelcome"] = new string[3] { "OVER 99\nFortress Island · hold the lighthouse", "OVER 99\n要塞島・守住燈塔", "OVER 99\n要塞岛・守住灯塔" }, ["netHud"] = new string[3] { "Net {0}/{1} (worth {2})", "漁網 {0}/{1}(價值 {2})", "渔网 {0}/{1}(价值 {2})" }, ["netFull"] = new string[3] { "FULL - sell at the fish stall by the dock", "滿了,到碼頭旁的魚攤賣掉", "满了,到码头旁的鱼摊卖掉" }, ["netUpgradeHint"] = new string[3] { "[Shift+U] bigger net ({0} fish): ${1}", "[Shift+U] 升級漁網(裝 {0} 隻):${1}", "[Shift+U] 升级渔网(装 {0} 只):${1}" }, ["netMax"] = new string[3] { "Net at max size", "漁網已是最大", "渔网已是最大" }, ["netUpgraded"] = new string[3] { "Bigger nets! Everyone now carries {0} fish", "漁網升級!每人可裝 {0} 隻", "渔网升级!每人可装 {0} 只" }, ["tableHeader"] = new string[3] { "Player Kills Turret kills Fished Built Downs", "玩家 擊殺 砲塔擊殺 捕魚收入 建造 倒下", "玩家 击杀 炮塔击杀 捕鱼收入 建造 倒下" }, ["testKeys"] = new string[3] { "Test keys (Mac: hold Fn)\n[F1] a boss now (the next one; Shift: the same again)\n[F2] boss -25% health (Shift: break its move)\n[F3] mend the lighthouse and buildings\n[Shift+F3] the ten boss trophies\n[F4] back by the lighthouse (anyone, any time)\n[F5] +$15000\n[F6] god mode on/off\n[F7] kill all enemies\n[Shift+F7] clear what lies on the island\n[F8] skip build time\n[Shift+F8] jump 5 waves\n[Ctrl+F8] jump to the next boss wave\n[F9] start / end a round\n[F10] the island's entrance again\n[F11] freeze / unfreeze the battle", "測試鍵 (Mac 要按住 Fn)\n[F1] 叫出下一隻大王(Shift:同一隻再來)\n[F2] 大王血量 -25%(Shift:強制破招)\n[F3] 修好燈塔和所有建築\n[Shift+F3] 十隻大王的戰利品\n[F4] 回到燈塔旁(任何人隨時都能用)\n[F5] +$15000\n[F6] 無敵 開/關\n[F7] 清除所有敵人\n[Shift+F7] 清除島上地上的東西\n[F8] 跳過建造時間\n[Shift+F8] 跳 5 波\n[Ctrl+F8] 跳到下一個大王波\n[F9] 開始/結束一局\n[F10] 重看島嶼登場動畫\n[F11] 凍結/解凍戰場", "测试键 (Mac 要按住 Fn)\n[F1] 叫出下一只大王(Shift:同一只再来)\n[F2] 大王血量 -25%(Shift:强制破招)\n[F3] 修好灯塔和所有建筑\n[Shift+F3] 十只大王的战利品\n[F4] 回到灯塔旁(任何人随时都能用)\n[F5] +$15000\n[F6] 无敌 开/关\n[F7] 清除所有敌人\n[Shift+F7] 清除岛上地上的东西\n[F8] 跳过建造时间\n[Shift+F8] 跳 5 波\n[Ctrl+F8] 跳到下一个大王波\n[F9] 开始/结束一局\n[F10] 重看岛屿登场动画\n[F11] 冻结/解冻战场" }, ["testBoss"] = new string[3] { "Here comes {0} (the boss of wave {1}).", "叫出:{0}(第 {1} 波的大王)。", "叫出:{0}(第 {1} 波的大王)。" }, ["testMended"] = new string[3] { "The lighthouse and every building mended.", "燈塔和所有建築都修好了。", "灯塔和所有建筑都修好了。" }, ["testFrozen"] = new string[3] { "Battle frozen (F11 again to go on).", "戰場凍結(再按 F11 繼續)。", "战场冻结(再按 F11 继续)。" }, ["testUnfrozen"] = new string[3] { "Battle goes on.", "戰場繼續。", "战场继续。" }, ["testHostOnly"] = new string[3] { "Test keys are host only.", "測試鍵只有房主能用。", "测试键只有房主能用。" }, ["testNoIsland"] = new string[3] { "The fortress island isn't here yet (Mod Settings: Island / Unlock).", "要塞島還沒出現(Mod 設定:Island / Unlock)。", "要塞岛还没出现(Mod 设置:Island / Unlock)。" }, ["testNotDuringRound"] = new string[3] { "Not during a round.", "回合中不能用。", "回合中不能用。" }, ["testNotRunning"] = new string[3] { "Start a round first (F9 or the lighthouse door).", "先開始一局(F9 或燈塔門口按 E)。", "先开始一局(F9 或灯塔门口按 E)。" }, ["testGodOn"] = new string[3] { "God mode ON.", "無敵:開。", "无敌:开。" }, ["testGodOff"] = new string[3] { "God mode OFF.", "無敵:關。", "无敌:关。" }, ["testJump"] = new string[3] { "Jumping to wave {0}.", "跳到第 {0} 波。", "跳到第 {0} 波。" }, ["rarityCommon"] = new string[3] { "Common", "普通", "普通" }, ["rarityRare"] = new string[3] { "Rare", "稀有", "稀有" }, ["rarityEpic"] = new string[3] { "Epic", "史詩", "史诗" }, ["rarityLegendary"] = new string[3] { "Legendary", "傳說", "传说" }, ["gearGunpowder"] = new string[3] { "Gunpowder", "強化火藥", "强化火药" }, ["gearFxGunpowder"] = new string[3] { "All turret damage +{0}", "所有砲塔傷害 +{0}", "所有炮塔伤害 +{0}" }, ["gearScope"] = new string[3] { "Scope", "精準瞄具", "精准瞄具" }, ["gearFxScope"] = new string[3] { "Turret range +{0}", "砲塔射程 +{0}", "炮塔射程 +{0}" }, ["gearApRounds"] = new string[3] { "AP Rounds", "穿甲彈", "穿甲弹" }, ["gearFxApRounds"] = new string[3] { "Damage vs tank crabs and bosses +{0}", "對坦克蟹和魔王傷害 +{0}", "对坦克蟹和魔王伤害 +{0}" }, ["gearIncendiary"] = new string[3] { "Incendiary Rounds", "燃燒彈", "燃烧弹" }, ["gearFxIncendiary"] = new string[3] { "Turret hits burn for {0}/s, 3 s", "砲塔命中後燃燒,每秒 {0} 傷害,3 秒", "炮塔命中后燃烧,每秒 {0} 伤害,3 秒" }, ["gearFrostCore"] = new string[3] { "Frost Core", "寒冰核心", "寒冰核心" }, ["gearFxFrostCore"] = new string[3] { "Every turret hit slows by {0}", "所有砲塔命中減速 {0}", "所有炮塔命中减速 {0}" }, ["gearTeslaCoil"] = new string[3] { "Tesla Coil", "雷擊線圈", "雷击线圈" }, ["gearFxTeslaCoil"] = new string[3] { "Tesla towers chain {0} more targets", "電網塔多連鎖 {0} 個目標", "电网塔多连锁 {0} 个目标" }, ["gearRebar"] = new string[3] { "Rebar", "鋼筋", "钢筋" }, ["gearFxRebar"] = new string[3] { "Wall health +{0}", "牆的血量 +{0}", "墙的血量 +{0}" }, ["gearCoreShield"] = new string[3] { "Lighthouse Shield", "燈塔護盾", "灯塔护盾" }, ["gearFxCoreShield"] = new string[3] { "Lighthouse health +{0}", "燈塔血量 +{0}", "灯塔血量 +{0}" }, ["gearWarChest"] = new string[3] { "War Chest", "戰爭基金", "战争基金" }, ["gearFxWarChest"] = new string[3] { "Every cleared wave pays {0} more", "每清一波的獎金 +{0}", "每清一波的奖金 +{0}" }, ["gearSharkArmor"] = new string[3] { "Shark-skin Armor", "鯊皮護甲", "鲨皮护甲" }, ["gearFxSharkArmor"] = new string[3] { "Bite and blast damage taken -{0}", "被咬、被炸的傷害 -{0}", "被咬、被炸的伤害 -{0}" }, ["gearBigNet"] = new string[3] { "Big Net", "大漁網", "大渔网" }, ["gearFxBigNet"] = new string[3] { "Your net holds {0} more fish", "漁網多裝 {0} 隻", "渔网多装 {0} 只" }, ["gearFishGloves"] = new string[3] { "Fishmonger's Gloves", "魚販手套", "鱼贩手套" }, ["gearFxFishGloves"] = new string[3] { "Fish you sell are worth +{0}", "你賣的魚屍價值 +{0}", "你卖的鱼尸价值 +{0}" }, ["gearGauntlet"] = new string[3] { "Brawler's Gauntlet", "鬥士拳套", "斗士拳套" }, ["gearFxGauntlet"] = new string[3] { "Your hand damage vs fortress enemies +{0}", "親手打要塞敵人的傷害 +{0}", "亲手打要塞敌人的伤害 +{0}" }, ["gearToolBelt"] = new string[3] { "Tool Belt", "工具腰帶", "工具腰带" }, ["gearFxToolBelt"] = new string[3] { "What you build, upgrade and repair costs -{0}", "你蓋、升級、修理的花費 -{0}", "你盖、升级、修理的花费 -{0}" }, ["gearLuckyCharm"] = new string[3] { "Lucky Charm", "幸運符", "幸运符" }, ["gearFxLuckyCharm"] = new string[3] { "Gear drop chance from your kills {0}", "你打死的怪掉裝備機率 {0}", "你打死的怪掉装备几率 {0}" }, ["lootPicked"] = new string[3] { "{0} picked up {1}", "{0} 撿到 {1}", "{0} 捡到 {1}" }, ["chestOpened"] = new string[3] { "{0} opened the chest: {1} (weapons are on the ground by it, the rest went into the vault)", "{0} 打開了寶箱:{1}(武器掉在寶箱旁邊,其他的已經放進儲藏庫)", "{0} 打开了宝箱:{1}(武器掉在宝箱旁边,其他的已经放进储藏库)" }, ["chestName"] = new string[3] { "Chest", "寶箱", "宝箱" }, ["scalesName"] = new string[3] { "fish scales", "魚鱗", "鱼鳞" }, ["scalesSwept"] = new string[3] { "{0} fish scales left lying went into the vault", "沒撿的 {0} 片魚鱗收進了儲藏庫", "没捡的 {0} 片鱼鳞收进了储藏库" }, ["chestOpen"] = new string[3] { "Open", "打開", "打开" }, ["chestAuto"] = new string[3] { "The chest went into the vault: {0}", "寶箱收進了儲藏庫:{0}", "宝箱收进了储藏库:{0}" }, ["lootLeftovers"] = new string[3] { "Loot left on the ground went into the vault: {0}", "地上沒撿的戰利品收進了儲藏庫:{0}", "地上没捡的战利品收进了储藏库:{0}" }, ["chestBanner"] = new string[3] { "A chest appeared by the lighthouse! [E] on it to open", "燈塔旁出現了寶箱!走過去按 [E] 打開", "灯塔旁出现了宝箱!走过去按 [E] 打开" }, ["vaultLocked"] = new string[3] { "The vault is locked while a round is on", "開局中不能換裝備", "开局中不能换装备" }, ["vaultTitle"] = new string[3] { "Vault", "儲藏庫", "储藏库" }, ["vaultSubtitle"] = new string[3] { "Shared by the whole team · anything thrown at the door goes in · up to 50 of a thing per slot", "全隊共用・任何東西丟到門口就收進來・一格最多 50 個", "全队共用・任何东西丢到门口就收进来・一格最多 50 个" }, ["vaultTabAll"] = new string[3] { "All ({0})", "全部({0})", "全部({0})" }, ["vaultTabGear"] = new string[3] { "Gear ({0})", "裝備({0})", "装备({0})" }, ["vaultTabWeapons"] = new string[3] { "Weapons ({0})", "武器({0})", "武器({0})" }, ["vaultTabItems"] = new string[3] { "Game items ({0})", "遊戲物品({0})", "游戏物品({0})" }, ["vaultSlots"] = new string[3] { "{0} slots", "{0} 格", "{0} 格" }, ["vaultEmptyAll"] = new string[3] { "Empty: throw anything at the vault's door and it goes in; enemies drop gear.", "還是空的:任何東西丟到儲藏庫門口就會收進來;打怪會掉裝備。", "还是空的:任何东西丢到储藏库门口就会收进来;打怪会掉装备。" }, ["vaultItemKind"] = new string[3] { "The game's own item (not gear): it comes back out just as it went in", "遊戲本身的物品(不是裝備):拿出來跟放進去時一模一樣", "游戏本身的物品(不是装备):拿出来跟放进去时一模一样" }, ["vaultItemTake"] = new string[3] { "Fish keep their weight and cookness, guns their attachments, everything its skin. Taken out, it goes into your hands (at your feet if they're full).", "魚的重量和熟度、槍的配件、外觀都會保留。拿出來會直接到你手上(滿了就放在腳邊)。", "鱼的重量和熟度、枪的配件、外观都会保留。拿出来会直接到你手上(满了就放在脚边)。" }, ["vaultDropTake"] = new string[3] { "Let go here: one comes out at the door\n(hold Shift: ten)", "放開=拿出 1 個,放在門口\n(按住 Shift:10 個)", "放开=拿出 1 个,放在门口\n(按住 Shift:10 个)" }, ["vaultTake1"] = new string[3] { "Take one out", "拿出 1 個", "拿出 1 个" }, ["vaultTake10"] = new string[3] { "Take ten out", "拿出 10 個", "拿出 10 个" }, ["vaultFortress"] = new string[3] { "Fortress (team)", "要塞(全隊)", "要塞(全队)" }, ["vaultMine"] = new string[3] { "My gear", "我的裝備", "我的装备" }, ["vaultTeam"] = new string[3] { "Teammates:", "隊友:", "队友:" }, ["vaultNow"] = new string[3] { "In effect:", "生效中:", "生效中:" }, ["vaultNowNone"] = new string[3] { "Nothing equipped: click a slot, then pick something on the right to put in it.", "還沒裝任何東西:點一個格子,再從右邊挑一件放進去。", "还没装任何东西:点一个格子,再从右边挑一件放进去。" }, ["vaultEmpty"] = new string[3] { "Nothing yet: enemies drop gear, and every 5th wave leaves a chest.", "還沒有東西:打怪會掉裝備,每 5 波會出現寶箱。", "还没有东西:打怪会掉装备,每 5 波会出现宝箱。" }, ["vaultEmptySlot"] = new string[3] { "empty", "空", "空" }, ["vaultUnequip"] = new string[3] { "click to take off", "點一下卸下", "点一下卸下" }, ["vaultKindFortress"] = new string[3] { "Fortress gear: works for the whole team once worn", "要塞裝備:裝上後全隊生效", "要塞装备:装上后全队生效" }, ["vaultKindPersonal"] = new string[3] { "Personal gear: works only while worn, for whoever wears it", "個人裝備:要裝上才有效,誰裝誰生效", "个人装备:要装上才有效,谁装谁生效" }, ["vaultOwned"] = new string[3] { "In the vault: {0}", "儲藏庫裡有:{0} 個", "储藏库里有:{0} 个" }, ["vaultMerge"] = new string[3] { "Merge 3 → 1 ({0})", "合成 3 → 1({0})", "合成 3 → 1({0})" }, ["vaultMaxed"] = new string[3] { "Max rarity", "已是最高稀有度", "已是最高稀有度" }, ["vaultEquipFortress"] = new string[3] { "Equip to fortress", "裝到要塞", "装到要塞" }, ["vaultEquipMine"] = new string[3] { "Equip on me", "裝到我身上", "装到我身上" }, ["vaultFull"] = new string[3] { "Slots full", "格子滿了", "格子满了" }, ["vaultTabFortress"] = new string[3] { "Fortress gear ({0})", "要塞裝備({0})", "要塞装备({0})" }, ["vaultTabPersonal"] = new string[3] { "Personal gear ({0})", "個人裝備({0})", "个人装备({0})" }, ["vaultTabActive"] = new string[3] { "Active gear ({0})", "主動裝備({0})", "主动装备({0})" }, ["vaultTabEmpty"] = new string[3] { "None of this kind yet: check the other tabs.", "這一類還沒有裝備,看看其他分頁。", "这一类还没有装备,看看其他分页。" }, ["vaultPick"] = new string[3] { "Click an item to see what it does.", "點一件裝備看它的效果。", "点一件装备看它的效果。" }, ["vaultHelp"] = new string[3] { "Click an equipped slot to take it off · U or Esc to close", "點已裝備的格子卸下・U 或 Esc 關閉", "点已装备的格子卸下・U 或 Esc 关闭" }, ["chestGameItem"] = new string[3] { "The chest also threw out {0}: it is on the ground by the chest, pick it up!", "寶箱還噴出了 {0},掉在寶箱旁邊,快去撿!", "宝箱还喷出了 {0},掉在宝箱旁边,快去捡!" }, ["item_knife"] = new string[3] { "Knife", "小刀", "小刀" }, ["item_brassknuckles"] = new string[3] { "Brass Knuckles", "手指虎", "手指虎" }, ["item_bow"] = new string[3] { "Bow", "弓", "弓" }, ["item_dynamite"] = new string[3] { "Dynamite", "炸藥", "炸药" }, ["item_disc"] = new string[3] { "Disc", "飛盤", "飞盘" }, ["item_moneyinabottle"] = new string[3] { "Money in a Bottle", "瓶中錢", "瓶中钱" }, ["item_pistol"] = new string[3] { "Pistol", "手槍", "手枪" }, ["item_shotgun"] = new string[3] { "Shotgun", "霰彈槍", "霰弹枪" }, ["item_smg"] = new string[3] { "SMG", "衝鋒槍", "冲锋枪" }, ["item_sniperrifle"] = new string[3] { "Sniper Rifle", "狙擊槍", "狙击枪" }, ["item_assaultrifle"] = new string[3] { "Assault Rifle", "突擊步槍", "突击步枪" }, ["islandName"] = new string[3] { "OVER 99 · Fortress Island", "OVER 99・要塞島", "OVER 99・要塞岛" }, ["hudWave"] = new string[3] { "Wave {0}/100", "第 {0}/100 波", "第 {0}/100 波" }, ["bossCrashIn"] = new string[3] { "crashes in {0}:{1}", "撞燈塔倒數 {0}:{1}", "撞灯塔倒数 {0}:{1}" }, ["bossCrashSoon"] = new string[3] { "{0} s until the boss crashes into the lighthouse!", "再 {0} 秒王就要撞上燈塔!", "再 {0} 秒王就要撞上灯塔!" }, ["bossCrashed"] = new string[3] { "The boss crashed into the lighthouse!", "王撞上燈塔了!", "王撞上灯塔了!" }, ["bossFightDown"] = new string[3] { "{0} down in {1} s (players {2}%, turrets {3}%)", "{0} 討伐完成:{1} 秒(玩家 {2}%、砲塔 {3}%)", "{0} 讨伐完成:{1} 秒(玩家 {2}%、炮塔 {3}%)" }, ["bossFightCrashed"] = new string[3] { "{0} held out {1} s and rammed the lighthouse ({4}% of its health taken; players {2}%, turrets {3}%)", "{0} 撐了 {1} 秒,撞上燈塔(打掉 {4}% 血;玩家 {2}%、砲塔 {3}%)", "{0} 撑了 {1} 秒,撞上灯塔(打掉 {4}% 血;玩家 {2}%、炮塔 {3}%)" }, ["victoryBanner"] = new string[3] { "OVER 99! All 100 waves held!", "OVER 99!100 波全部撐過!", "OVER 99!100 波全部撑过!" }, ["victory"] = new string[3] { "Victory!", "勝利!", "胜利!" }, ["resultVictoryTitle"] = new string[3] { "OVER 99: the lighthouse stands", "OVER 99・燈塔屹立不搖", "OVER 99・灯塔屹立不摇" }, ["hudLighthouse"] = new string[3] { "Lighthouse", "燈塔", "灯塔" }, ["phaseSkip"] = new string[3] { "[{0}] start now", "[{0}] 立即開始", "[{0}] 立即开始" }, ["hookHolding"] = new string[3] { "On the hook: {0} (${1}) · [LMB] fling it: x{2} damage", "勾著:{0}(${1})・左鍵甩出去:傷害 ×{2}", "勾着:{0}(${1})・左键甩出去:伤害 ×{2}" }, ["phaseCallNext"] = new string[3] { "[hold {0}] next wave now", "[按住 {0}] 提早叫下一波", "[按住 {0}] 提早叫下一波" }, ["callingNext"] = new string[3] { "Wave {0}…", "叫來第 {0} 波…", "叫来第 {0} 波…" }, ["calledEarly"] = new string[3] { "Wave {0} called early: it lands on top of this one. Both pay out once the field is clear.", "提早叫來第 {0} 波:跟這波疊在一起,全部清完兩波的獎金一起給。", "提早叫来第 {0} 波:跟这波叠在一起,全部清完两波的奖金一起给。" }, ["markDeath"] = new string[3] { "{0}'s things", "{0} 的掉落物", "{0} 的掉落物" }, ["pieceDescWall"] = new string[3] { "Blocks the fish: they stop to break it first (Lv2 stone, Lv3 iron hold out longer)", "擋住魚,牠們會先停下來打牆(Lv2 石牆、Lv3 鐵牆更耐打)", "挡住鱼,它们会先停下来打墙(Lv2 石墙、Lv3 铁墙更耐打)" }, ["pieceDescFloor"] = new string[3] { "A floor to stand on: build platforms and high turret spots", "可以站上去的地板:蓋高台、放高處的砲塔", "可以站上去的地板:盖高台、放高处的炮塔" }, ["pieceDescRamp"] = new string[3] { "A slope up onto a platform", "斜坡:走上高台", "斜坡:走上高台" }, ["pieceDescGun"] = new string[3] { "Fast fire at the nearest fish (Lv3: Storm doubles the fire rate, Armour-piercing x3 on bosses)", "射速快,打最近的魚(Lv3 二選一:風暴=射速 ×2,穿甲=打大王 ×3)", "射速快,打最近的鱼(Lv3 二选一:风暴=射速 ×2,穿甲=打大王 ×3)" }, ["pieceDescCannon"] = new string[3] { "Shells that burst: hurts every fish where they land", "砲彈會爆炸:落點一片的魚都受傷", "炮弹会爆炸:落点一片的鱼都受伤" }, ["pieceDescHarpoon"] = new string[3] { "Goes through a whole line of fish and slows them", "魚叉穿過整排魚,還會讓牠們變慢", "鱼叉穿过整排鱼,还会让它们变慢" }, ["pieceDescMortar"] = new string[3] { "The longest range, bursts on a group; can't hit within 8 m", "射程最遠、打一整群;8 公尺內打不到", "射程最远、打一整群;8 米内打不到" }, ["pieceDescTesla"] = new string[3] { "Its shock jumps from fish to fish; fish in water take double", "電擊會在魚之間跳;打水裡的魚傷害 ×2", "电击会在鱼之间跳;打水里的鱼伤害 ×2" }, ["pieceDescSpikes"] = new string[3] { "Fish standing on it keep getting hurt", "踩在上面的魚會一直受傷", "踩在上面的鱼会一直受伤" }, ["pieceDescFlame"] = new string[3] { "A short cone of fire: everything in it burns", "近距離扇形噴火,燒到的都會持續燃燒", "近距离扇形喷火,烧到的都会持续燃烧" }, ["pieceDescSniper"] = new string[3] { "Very long range, one hard hit at the toughest fish in reach", "射程很遠、一發很痛,專打射程內血最多的魚", "射程很远、一发很痛,专打射程内血最多的鱼" }, ["pieceDescBubble"] = new string[3] { "Doesn't shoot: buildings in its bubble (the lighthouse too) take 30-50% less damage; one bubble covers a spot, they don't stack", "不攻擊:泡泡範圍內的建築(含燈塔)少受 30~50% 傷害;同一處只算最強的一座,不會疊加", "不攻击:泡泡范围内的建筑(含灯塔)少受 30~50% 伤害;同一处只算最强的一座,不会叠加" }, ["helpTabPlay"] = new string[3] { "How to play", "玩法", "玩法" }, ["helpTabVillage"] = new string[3] { "The village", "小村", "小村" }, ["helpTabFoes"] = new string[3] { "The fish", "敵人", "敌人" }, ["helpTabWeapons"] = new string[3] { "Weapons", "武器圖鑑", "武器图鉴" }, ["helpTabSettings"] = new string[3] { "Settings", "設定", "设置" }, ["setOn"] = new string[3] { "On", "開", "开" }, ["setOff"] = new string[3] { "Off", "關", "关" }, ["setDamageNumbers"] = new string[3] { "Damage numbers", "傷害數字", "伤害数字" }, ["setDamageNumbersD"] = new string[3] { "The numbers over what you hit. The same switch as in the game's own Options.", "打到東西時跳出來的數字。跟遊戲自己「選項」裡的是同一個開關。", "打到东西时跳出来的数字。跟游戏自己「选项」里的是同一个开关。" }, ["setReducedFx"] = new string[3] { "Fewer effects", "精簡特效", "精简特效" }, ["setReducedFxD"] = new string[3] { "Fewer particles, shorter gas clouds, lighter bubble shields. For lag in the late waves.", "粒子變少、毒氣雲變短、泡泡護盾更省。後面幾波會卡的話打開。", "粒子变少、毒气云变短、泡泡护盾更省。后面几波会卡的话打开。" }, ["setTeamMarkers"] = new string[3] { "Teammate marks", "隊友標示", "队友标示" }, ["setTeamMarkersD"] = new string[3] { "A mark over each teammate with their name and distance, red while they're down; an arrow at the edge when they're off screen.", "每個隊友頭上的名字和距離,倒下時變紅;不在畫面裡時邊緣有箭頭。", "每个队友头上的名字和距离,倒下时变红;不在画面里时边缘有箭头。" }, ["setNote"] = new string[3] { "Only your own screen changes: each player sets their own.", "只改你自己的畫面,每個人各自設定。", "只改你自己的画面,每个人各自设置。" }, ["helpLegendValue"] = new string[3] { "Legendary: {0}", "傳說:{0}", "传说:{0}" }, ["stuckHint"] = new string[3] { "Stuck? Hold [O] to get out, or [F4] takes you back by the lighthouse", "卡住了嗎?按住 [O] 脫困,或按 [F4] 回到燈塔旁", "卡住了吗?按住 [O] 脱困,或按 [F4] 回到灯塔旁" }, ["unstuckHolding"] = new string[3] { "Keep holding: getting you out", "繼續按住:脫困", "继续按住:脱困" }, ["unstuckDone"] = new string[3] { "Got you out", "幫你從卡住的地方移出來了", "帮你从卡住的地方移出来了" }, ["unstuckNowhere"] = new string[3] { "No room nearby: [F4] takes you back by the lighthouse", "附近找不到空位:按 [F4] 回到燈塔旁", "附近找不到空位:按 [F4] 回到灯塔旁" }, ["mateDown"] = new string[3] { "down: carry them back", "倒下了:抱回來救", "倒下了:抱回来救" }, ["towersLost"] = new string[3] { "Turret destroyed: {0}", "砲塔被打爆了:{0}", "炮塔被打爆了:{0}" }, ["coreRepair"] = new string[3] { "Mend the lighthouse +10%: ${0}", "修燈塔 +10%:${0}", "修灯塔 +10%:${0}" }, ["coreFull"] = new string[3] { "The lighthouse is at full health", "燈塔是滿的", "灯塔是满的" }, ["settleBonus"] = new string[3] { "Held {0} waves: ${1} for the next run", "撐了 {0} 波:結算獎金 ${1},下一局用", "撑了 {0} 波:结算奖金 ${1},下一局用" }, ["settleBonusShort"] = new string[3] { "Run bonus +${0}", "結算獎金 +${0}", "结算奖金 +${0}" }, ["phaseBuildKey"] = new string[3] { "[{0}] build", "[{0}] 建造", "[{0}] 建造" }, ["phaseRepairAll"] = new string[3] { "[Shift+J] mend all ${0}", "[Shift+J] 全部修好 ${0}", "[Shift+J] 全部修好 ${0}" }, ["repairAllDone"] = new string[3] { "All mended: {0} buildings", "全部修好了:{0} 座建築", "全部修好了:{0} 座建筑" }, ["repairAllPartial"] = new string[3] { "Not enough money: {0} buildings still damaged", "錢不夠:還有 {0} 座沒修", "钱不够:还有 {0} 座没修" }, ["netTitle"] = new string[3] { "Net", "漁網", "渔网" }, ["netWorth"] = new string[3] { "worth {0}", "價值 {0}", "价值 {0}" }, ["netFullShort"] = new string[3] { "Full! Sell at the stall", "滿了!拿去魚攤賣", "满了!拿去鱼摊卖" }, ["resultCoreTitle"] = new string[3] { "The lighthouse has fallen", "燈塔陷落了", "灯塔陷落了" }, ["resultWipeTitle"] = new string[3] { "Everyone is down", "全員倒下", "全员倒下" }, ["resultRecordShort"] = new string[3] { "NEW RECORD", "新紀錄", "新纪录" }, ["tileWaves"] = new string[3] { "waves cleared", "撐過的波數", "撑过的波数" }, ["tileKills"] = new string[3] { "kills", "擊殺", "击杀" }, ["tileBuilt"] = new string[3] { "built", "建造", "建造" }, ["buildKeys"] = new string[3] { "[hold LMB] build\u3000[RMB] menu\u3000[M] move\u3000[T] next\u3000[Shift+T] back\u3000[Y] flip\u3000[G] exit", "[按住左鍵] 建造\u3000[右鍵] 選單\u3000[M] 搬移\u3000[T] 下一個\u3000[Shift+T] 上一個\u3000[Y] 反轉\u3000[G] 離開", "[按住左键] 建造\u3000[右键] 菜单\u3000[M] 搬移\u3000[T] 下一个\u3000[Shift+T] 上一个\u3000[Y] 反转\u3000[G] 离开" }, ["removeHint"] = new string[3] { "[hold H] take down", "[按住 H] 拆除", "[按住 H] 拆除" }, ["siteLabel"] = new string[3] { "Building {0}%", "施工中 {0}%", "施工中 {0}%" }, ["removing"] = new string[3] { "Taking down… ${0} back", "拆除中…退 ${0}", "拆除中…退 ${0}" }, ["menuMove"] = new string[3] { "Move", "搬移", "搬移" }, ["moveHint"] = new string[3] { "[M] move", "[M] 搬移", "[M] 搬移" }, ["moveKeys"] = new string[3] { "Moving: [LMB] put it down\u3000[RMB] / [M] cancel\u3000(keeps its level and health, free)", "搬移中:[左鍵] 放下\u3000[右鍵]/[M] 取消\u3000(等級和血量不變,免費)", "搬移中:[左键] 放下\u3000[右键]/[M] 取消\u3000(等级和血量不变,免费)" }, ["statChain"] = new string[3] { "Chain", "連鎖", "连锁" }, ["milestoneGun"] = new string[3] { "+ one more fish at a time", "+同時多打一隻", "+同时多打一只" }, ["milestoneSniper"] = new string[3] { "+ one more fish at a time", "+同時多打一隻", "+同时多打一只" }, ["milestoneCannon"] = new string[3] { "+ one more shell", "+多一發砲彈", "+多一发炮弹" }, ["milestoneMortar"] = new string[3] { "+ one more shell", "+多一發砲彈", "+多一发炮弹" }, ["milestoneHarpoon"] = new string[3] { "+ one more harpoon", "+多一支魚叉", "+多一支鱼叉" }, ["milestoneTesla"] = new string[3] { "+ 2 chain jumps", "+連鎖多 2 隻", "+连锁多 2 只" }, ["milestoneFlame"] = new string[3] { "+ a wider flame", "+火焰更寬", "+火焰更宽" }, ["milestoneBubble"] = new string[3] { "+ 2 m wider", "+範圍多 2 公尺", "+范围多 2 米" }, ["milestoneMender"] = new string[3] { "+ 2 m wider", "+範圍多 2 公尺", "+范围多 2 米" }, ["pieceDescMender"] = new string[3] { "Doesn't shoot: once a second every damaged building in its green ring gets health back (5-12, more with levels), the lighthouse half that; works between waves too", "不攻擊:綠色圈內受損的建築每秒回血(5~12,升級更多),燈塔回一半;波與波之間也會修", "不攻击:绿色圈内受损的建筑每秒回血(5~12,升级更多),灯塔回一半;波与波之间也会修" }, ["statHeal"] = new string[3] { "Heal", "回血", "回血" }, ["stallFishHead"] = new string[3] { "Fish", "魚", "鱼" }, ["stallHelpersHead"] = new string[3] { "Helpers: the bodies sold for the team, everything else into the vault", "小幫手:魚屍撿去賣(錢歸全隊),其他東西收進倉庫", "小帮手:鱼尸捡去卖(钱归全队),其他东西收进仓库" }, ["helperWho"] = new string[3] { "A helper", "小幫手", "小帮手" }, ["helperHireTitle"] = new string[3] { "Hire a helper ({0}/{1})", "雇一個小幫手({0}/{1})", "雇一个小帮手({0}/{1})" }, ["helperHireDetail"] = new string[3] { "Picks up everything on the island, round or not; fish that catch one knock it out for a while", "島上的東西都會撿(局外也會);被魚抓到會被打昏一陣子", "岛上的东西都会捡(局外也会);被鱼抓到会被打昏一阵子" }, ["helperSpeedTitle"] = new string[3] { "Faster legs (Lv{0}/{1})", "跑更快(Lv{0}/{1})", "跑更快(Lv{0}/{1})" }, ["helperSpeedDetail"] = new string[3] { "{0} m/s → {1} m/s", "每秒 {0} 公尺 → {1} 公尺", "每秒 {0} 米 → {1} 米" }, ["helperLoadTitle"] = new string[3] { "Bigger baskets (Lv{0}/{1})", "大籃子(Lv{0}/{1})", "大篮子(Lv{0}/{1})" }, ["helperLoadDetail"] = new string[3] { "{0} fish a trip → {1}", "一趟拿 {0} 隻 → {1} 隻", "一趟拿 {0} 只 → {1} 只" }, ["helperSpeedNow"] = new string[3] { "{0} m/s", "每秒 {0} 公尺", "每秒 {0} 米" }, ["helperLoadNow"] = new string[3] { "{0} fish a trip", "一趟拿 {0} 隻", "一趟拿 {0} 只" }, ["helperOvenTitle"] = new string[3] { "The oven", "烤爐", "烤炉" }, ["helperOvenOwned"] = new string[3] { "The oven (bought)", "烤爐(已經有了)", "烤炉(已经有了)" }, ["helperOvenDetail"] = new string[3] { "The helpers grill what they bring in: it sells for {0}% more", "小幫手拿回來的魚先烤過再賣,多賣 {0}%", "小帮手拿回来的鱼先烤过再卖,多卖 {0}%" }, ["helperMaxed"] = new string[3] { "Done", "已滿", "已满" }, ["helperOwned"] = new string[3] { "Bought", "已買", "已买" }, ["rackSign"] = new string[3] { "Any one ${0}", "每把 ${0}", "每把 ${0}" }, ["helperPlate"] = new string[3] { "Helper {0}/{1}", "小幫手 {0}/{1}", "小帮手 {0}/{1}" }, ["helperKo"] = new string[3] { "Knocked out", "昏倒了", "昏倒了" }, ["helperDown"] = new string[3] { "A helper was knocked out by the fish: what it carried is lost; back from the stall in {0} s", "小幫手被魚打昏了,身上的魚掉光;{0} 秒後從魚攤回來", "小帮手被鱼打昏了,身上的鱼掉光;{0} 秒后从鱼摊回来" }, ["menuNext"] = new string[3] { "Lv{0}: {1}", "升級到 Lv{0}:{1}", "升级到 Lv{0}:{1}" }, ["menuUpgrade"] = new string[3] { "Upgrade (${0})", "升級(${0})", "升级(${0})" }, ["menuPick"] = new string[3] { "Choose (${0})", "選這個(${0})", "选这个(${0})" }, ["menuRepair"] = new string[3] { "Repair ({0})", "修理({0})", "修理({0})" }, ["menuHealthy"] = new string[3] { "No damage", "沒有損傷", "没有损伤" }, ["menuRemove"] = new string[3] { "Take down (+{0})", "拆除(退 {0})", "拆除(退 {0})" }, ["menuRemoveSure"] = new string[3] { "Click again to confirm", "再點一次確定", "再点一次确定" }, ["menuClose"] = new string[3] { "Close", "關閉", "关闭" }, ["statDamage"] = new string[3] { "Damage", "傷害", "伤害" }, ["statRate"] = new string[3] { "Fire rate", "射速", "射速" }, ["statRange"] = new string[3] { "Range", "射程", "射程" }, ["statHp"] = new string[3] { "Health", "耐久", "耐久" }, ["GunA_d"] = new string[3] { "Fires twice as fast", "射速 ×2", "射速 ×2" }, ["GunB_d"] = new string[3] { "×3 damage vs tank crabs and bosses", "對坦克蟹、魔王傷害 ×3", "对坦克蟹、魔王伤害 ×3" }, ["CannonA_d"] = new string[3] { "3 balls per shot, wider blast", "一次 3 顆,爆炸範圍更大", "一次 3 颗,爆炸范围更大" }, ["CannonB_d"] = new string[3] { "×2.5 damage per ball", "每顆傷害 ×2.5", "每颗伤害 ×2.5" }, ["HarpoonA_d"] = new string[3] { "3 harpoons in a fan", "一次 3 支,扇形射出", "一次 3 支,扇形射出" }, ["HarpoonB_d"] = new string[3] { "Strong, long slow", "強力又持久的減速", "强力又持久的减速" }, ["MortarA_d"] = new string[3] { "The impact keeps burning", "落點會持續燃燒", "落点会持续燃烧" }, ["MortarB_d"] = new string[3] { "3 shells per volley", "一次 3 發", "一次 3 发" }, ["TeslaA_d"] = new string[3] { "Chains 3 more targets", "多連鎖 3 個目標", "多连锁 3 个目标" }, ["TeslaB_d"] = new string[3] { "×2 damage, fires slower", "傷害 ×2,射速變慢", "伤害 ×2,射速变慢" }, ["thiefStole"] = new string[3] { "A thief grabbed a corpse worth {0}! Catch it before it reaches the sea!", "小偷魚叼走了價值 {0} 的魚屍!在牠跑回海裡前抓住牠!", "小偷鱼叼走了价值 {0} 的鱼尸!在它跑回海里前抓住它!" }, ["thiefCoins"] = new string[3] { "A thief stole ${0} from the fish stall! After it!", "小偷魚從魚攤偷走了 ${0}!快追!", "小偷鱼从鱼摊偷走了 ${0}!快追!" }, ["thiefEscaped"] = new string[3] { "The thief got away with {0}", "小偷魚帶著 {0} 逃回海裡了", "小偷鱼带着 {0} 逃回海里了" }, ["enemyRunner"] = new string[3] { "Runner", "登陸魚", "登陆鱼" }, ["enemyCharger"] = new string[3] { "Charger", "衝鋒魚", "冲锋鱼" }, ["enemySpitter"] = new string[3] { "Spitter", "砲擊魚", "炮击鱼" }, ["enemyBomber"] = new string[3] { "Bomber", "自爆河豚", "自爆河豚" }, ["enemyTank"] = new string[3] { "Tank Crab", "坦克蟹", "坦克蟹" }, ["enemyThief"] = new string[3] { "Thief", "小偷魚", "小偷鱼" }, ["enemyShield"] = new string[3] { "Shield Bearer", "盾牌魚", "盾牌鱼" }, ["enemyDigger"] = new string[3] { "Digger", "鑽地魚", "钻地鱼" }, ["enemyHealer"] = new string[3] { "Healer", "治療魚", "治疗鱼" }, ["enemySplitter"] = new string[3] { "Splitter", "分裂魚", "分裂鱼" }, ["enemyMini"] = new string[3] { "Mini", "小魚", "小鱼" }, ["legendTitle"] = new string[3] { "Legendary special", "傳說特效", "传说特效" }, ["legendOnly"] = new string[3] { "(legendary only)", "(傳說才有)", "(传说才有)" }, ["gearLegendGunpowder"] = new string[3] { "Turret kills burst, hurting fish within 2.5 m", "砲塔擊殺會爆開,波及 2.5 公尺內的魚", "炮塔击杀会爆开,波及 2.5 米内的鱼" }, ["gearLegendScope"] = new string[3] { "10% of turret hits are critical (x3)", "砲塔有 10% 機率爆擊(×3)", "炮塔有 10% 几率暴击(×3)" }, ["gearLegendApRounds"] = new string[3] { "Turrets ignore the shield bearers shields", "砲塔無視盾牌魚的盾牌", "炮塔无视盾牌鱼的盾牌" }, ["gearLegendIncendiary"] = new string[3] { "Fire jumps to the nearest fish", "火會跳到最近的另一隻魚", "火会跳到最近的另一只鱼" }, ["gearLegendFrostCore"] = new string[3] { "6% of hits freeze the target for 1.5 s", "6% 機率把目標冰凍 1.5 秒", "6% 几率把目标冰冻 1.5 秒" }, ["gearLegendTeslaCoil"] = new string[3] { "Every zap stuns for a moment", "每次電擊都會短暫麻痺", "每次电击都会短暂麻痹" }, ["gearLegendRebar"] = new string[3] { "Walls and turrets bite back: attackers take 30% of the damage", "牆和砲塔會反擊:攻擊者受到 30% 反傷", "墙和炮塔会反击:攻击者受到 30% 反伤" }, ["gearLegendCoreShield"] = new string[3] { "Left alone for 5 s, the lighthouse mends 1% a second", "燈塔 5 秒沒被打就每秒回 1%", "灯塔 5 秒没被打就每秒回 1%" }, ["gearLegendWarChest"] = new string[3] { "Every cleared wave pays 10% interest (up to 100)", "每清一波多拿 10% 利息(最多 100)", "每清一波多拿 10% 利息(最多 100)" }, ["gearLegendSharkArmor"] = new string[3] { "Fish that bite you take 25 damage", "咬你的魚會受到 25 點反傷", "咬你的鱼会受到 25 点反伤" }, ["gearLegendBigNet"] = new string[3] { "A full net sells itself anywhere (80%)", "漁網滿了自動賣掉(八折),不用跑魚攤", "渔网满了自动卖掉(八折),不用跑鱼摊" }, ["gearLegendFishGloves"] = new string[3] { "Every fish you scoop pays a little right away, as if scooped by hand", "每撿一隻魚屍立刻拿到一點錢(跟用手撈一樣)", "每捡一只鱼尸立刻拿到一点钱(跟用手捞一样)" }, ["gearLegendGauntlet"] = new string[3] { "Every melee hit (fists, knife, brass knuckles) stuns for 0.6 s", "每一下近戰(拳頭、小刀、手指虎)都讓魚暈 0.6 秒", "每一下近战(拳头、小刀、手指虎)都让鱼晕 0.6 秒" }, ["gearLegendToolBelt"] = new string[3] { "You build twice as fast", "你施工的速度 ×2", "你施工的速度 ×2" }, ["gearLegendLuckyCharm"] = new string[3] { "Gear dropped by your kills is one rarity better", "你打下的裝備高一級稀有度", "你打下的装备高一级稀有度" }, ["gearOverclock"] = new string[3] { "Overclock Chip", "超頻晶片", "超频芯片" }, ["gearFxOverclock"] = new string[3] { "All turrets fire twice as fast for {0}s", "所有砲塔射速 ×2,持續 {0} 秒", "所有炮塔射速 ×2,持续 {0} 秒" }, ["gearFieldRepair"] = new string[3] { "First-aid Toolbox", "急救工具箱", "急救工具箱" }, ["gearFxFieldRepair"] = new string[3] { "Buildings within 10 m get {0} of their health back (the lighthouse half that)", "10 公尺內的建築回復 {0} 耐久(燈塔回一半)", "10 米内的建筑回复 {0} 耐久(灯塔回一半)" }, ["gearDecoy"] = new string[3] { "Decoy Duck", "誘餌鴨", "诱饵鸭" }, ["gearFxDecoy"] = new string[3] { "Drop a rubber duck: fish within 15 m chase it for {0}s", "放一隻橡皮鴨,15 公尺內的魚追著牠 {0} 秒", "放一只橡皮鸭,15 米内的鱼追着它 {0} 秒" }, ["gearNetCannon"] = new string[3] { "Fish Cannon", "捕魚砲", "捕鱼炮" }, ["gearFxNetCannon"] = new string[3] { "Every corpse within {0} m flies into your net", "{0} 公尺內的魚屍全飛進你的漁網", "{0} 米内的鱼尸全飞进你的渔网" }, ["gearShockwave"] = new string[3] { "Shockwave Hammer", "震波錘", "震波锤" }, ["gearFxShockwave"] = new string[3] { "Fish within 6 m are thrown back, stunned {0}s and take 40 damage (grows with the wave)", "把 6 公尺內的魚震開、暈 {0} 秒並造成 40 傷害(隨波數成長)", "把 6 米内的鱼震开、晕 {0} 秒并造成 40 伤害(随波数成长)" }, ["cooldown"] = new string[3] { "cooldown {0}s", "冷卻 {0} 秒", "冷却 {0} 秒" }, ["vaultKindActive"] = new string[3] { "Active gear: nothing to wear, everyone uses the team's with K in a round (Shift+K switches); each use spends one", "主動道具:不用裝,大家都能用全隊的,開局中按 K 用(Shift+K 換);用一次少一個", "主动道具:不用装,大家都能用全队的,开局中按 K 用(Shift+K 换);用一次少一个" }, ["vaultActiveNote"] = new string[3] { "Nothing to wear: [K] uses one up, [Shift+K] switches", "不用裝:[K] 用掉一個,[Shift+K] 換", "不用装:[K] 用掉一个,[Shift+K] 换" }, ["activePicked"] = new string[3] { "Active: {0} ({1}/{2}) · [Shift+K] next", "主動道具:{0}({1}/{2})・[Shift+K] 換下一個", "主动道具:{0}({1}/{2})・[Shift+K] 换下一个" }, ["vaultActiveSlot"] = new string[3] { "active (K)", "主動(K)", "主动(K)" }, ["netSellHint"] = new string[3] { "[U] sell {0} fish: +${1} for the team", "[U] 賣掉 {0} 隻魚屍:全隊 +${1}", "[U] 卖掉 {0} 只鱼尸:全队 +${1}" }, ["netEmptyHint"] = new string[3] { "Net empty: [F] hand net, then click on dead fish", "漁網是空的:按 [F] 拿出手網,對著魚屍按左鍵", "渔网是空的:按 [F] 拿出手网,对着鱼尸按左键" }, ["resultClose"] = new string[3] { "[Esc] close", "[Esc] 關閉", "[Esc] 关闭" }, ["netKeys"] = new string[3] { "[LMB] scoop · [U] at the stall: sell · [{0}] put away", "[左鍵] 撈魚屍\u3000[U] 在魚攤賣掉\u3000[{0}] 收起", "[左键] 捞鱼尸\u3000[U] 在鱼摊卖掉\u3000[{0}] 收起" }, ["starterWeapon"] = new string[3] { "A Rocket Launcher for everyone without a weapon is lying in front of the lighthouse: pick it up with [E]", "沒有武器的人,燈塔前放了一把火箭筒:按 [E] 撿起來", "没有武器的人,灯塔前放了一把火箭筒:按 [E] 捡起来" }, ["glyphGunpowder"] = new string[3] { "Pw", "火", "火" }, ["glyphScope"] = new string[3] { "Sc", "瞄", "瞄" }, ["glyphApRounds"] = new string[3] { "AP", "穿", "穿" }, ["glyphIncendiary"] = new string[3] { "In", "燃", "燃" }, ["glyphFrostCore"] = new string[3] { "Fr", "冰", "冰" }, ["glyphTeslaCoil"] = new string[3] { "Te", "雷", "雷" }, ["glyphRebar"] = new string[3] { "Rb", "筋", "筋" }, ["glyphCoreShield"] = new string[3] { "Sh", "盾", "盾" }, ["glyphWarChest"] = new string[3] { "WC", "金", "金" }, ["glyphSharkArmor"] = new string[3] { "Ar", "甲", "甲" }, ["glyphBigNet"] = new string[3] { "Nt", "網", "网" }, ["glyphFishGloves"] = new string[3] { "Gl", "販", "贩" }, ["glyphGauntlet"] = new string[3] { "Ga", "拳", "拳" }, ["glyphToolBelt"] = new string[3] { "Tb", "工", "工" }, ["glyphLuckyCharm"] = new string[3] { "Lk", "運", "运" }, ["glyphOverclock"] = new string[3] { "OC", "頻", "频" }, ["glyphFieldRepair"] = new string[3] { "Rp", "修", "修" }, ["glyphDecoy"] = new string[3] { "Dk", "鴨", "鸭" }, ["glyphNetCannon"] = new string[3] { "NC", "捕", "捕" }, ["glyphShockwave"] = new string[3] { "SW", "震", "震" }, ["glyphLaser"] = new string[3] { "La", "光", "光" }, ["glyphPoisonGas"] = new string[3] { "Gs", "毒", "毒" }, ["glyphBoomerang"] = new string[3] { "Bm", "鏢", "镖" }, ["glyphSharkWhistle"] = new string[3] { "Sk", "鯊", "鲨" }, ["glyphBubbleGun"] = new string[3] { "Bb", "泡", "泡" }, ["glyphHook"] = new string[3] { "Hk", "鉤", "钩" }, ["glyphWhirlpool"] = new string[3] { "Wh", "渦", "涡" }, ["glyphConch"] = new string[3] { "Co", "螺", "螺" }, ["vaultLoadoutTitle"] = new string[3] { "Your loadout", "你的配裝", "你的配装" }, ["vaultCollectionTitle"] = new string[3] { "Collection", "收藏", "收藏" }, ["vaultRowFortress"] = new string[3] { "Fortress · works for the whole team", "要塞・全隊生效", "要塞・全队生效" }, ["vaultRowPersonal"] = new string[3] { "Personal · only you", "個人・只有你", "个人・只有你" }, ["vaultRowActive"] = new string[3] { "Active [K]", "主動 [K]", "主动 [K]" }, ["vaultWorkshop"] = new string[3] { "Workshop", "工坊", "工坊" }, ["vaultHint"] = new string[3] { "Drag gear onto your slots to wear it, back to take it off · drag a weapon or an item out to take it · right-click: equip / take one out (Shift: ten) · [Esc] to close", "裝備拖到右邊的格子=裝上,拖回來=卸下\u3000武器或道具拖到右下=拿出來\u3000右鍵:裝上/拿出一個(Shift 拿 10 個)\u3000[Esc] 關閉", "装备拖到右边的格子=装上,拖回来=卸下\u3000武器或道具拖到右下=拿出来\u3000右键:装上/拿出一个(Shift 拿 10 个)\u3000[Esc] 关闭" }, ["vaultInUse"] = new string[3] { "equipped", "裝備中", "装备中" }, ["vaultPickForSlot"] = new string[3] { "Now click an item on the right to put it in this slot.", "現在點右邊的一件裝備,放進這一格。", "现在点右边的一件装备,放进这一格。" }, ["vaultCardEmpty"] = new string[3] { "Point at a slot or an item to see what it does.", "滑鼠移到格子或裝備上,這裡會說明它的效果。", "鼠标移到格子或装备上,这里会说明它的效果。" }, ["vaultEquipBtn"] = new string[3] { "Equip", "裝上", "装上" }, ["vaultSwapBtn"] = new string[3] { "Equip, taking off {0}", "裝上(換下 {0})", "装上(换下 {0})" }, ["vaultUnequipBtn"] = new string[3] { "Take off", "卸下", "卸下" }, ["vaultReplaceBtn"] = new string[3] { "Swap into this slot", "換進這一格", "换进这一格" }, ["vaultFullHint"] = new string[3] { "Slots full: right-click one to take it off", "格子滿了:右鍵點一格卸下", "格子满了:右键点一格卸下" }, ["vaultSellTitle"] = new string[3] { "Sell all", "一鍵賣", "一键卖" }, ["vaultSellEvery"] = new string[3] { "All", "全部", "全部" }, ["vaultSellAgain"] = new string[3] { "Again: sell ×{0}", "再按一次:賣 ×{0}", "再按一次:卖 ×{0}" }, ["vaultSellCardTitle"] = new string[3] { "Sell all here: {0} ×{1}", "一鍵賣這一頁:{0} ×{1}", "一键卖这一页:{0} ×{1}" }, ["vaultSellMoney"] = new string[3] { "Weapons: +${0}, as at the stall's counter", "武器:+${0}(跟魚攤櫃台一樣價)", "武器:+${0}(跟鱼摊柜台一样价)" }, ["vaultSellScales"] = new string[3] { "Gear melts down: +{0} scales", "裝備熔掉:+{0} 魚鱗", "装备熔掉:+{0} 鱼鳞" }, ["vaultSellItems"] = new string[3] { "{0} of the game's items, at the stall's price", "物品 {0} 個,照魚攤櫃台的價錢", "物品 {0} 个,照鱼摊柜台的价钱" }, ["vaultSellNote"] = new string[3] { "Click twice to sell. What's worn and what you carry stay.", "按兩下才會賣。身上裝的、帶著的不會賣。", "按两下才会卖。身上装的、带着的不会卖。" }, ["vaultNextRarity"] = new string[3] { "One rarity up: {0}", "高一級:{0}", "高一级:{0}" }, ["vaultNoneLeft"] = new string[3] { "None of this rarity", "沒有這個稀有度", "没有这个稀有度" }, ["versionOther"] = new string[3] { "{0} runs a different Fortress build ({1}, yours {2}): send them your HtfFortress folder, or the game can go wrong", "{0} 的要塞模組版本跟你不同({1},你是 {2}):把你的 HtfFortress 資料夾傳給他,不然遊戲可能出錯", "{0} 的要塞模组版本跟你不同({1},你是 {2}):把你的 HtfFortress 文件夹传给他,不然游戏可能出错" }, ["versionNone"] = new string[3] { "{0} has no Fortress mod, or one too old to check: everyone needs the same HtfFortress folder", "{0} 沒有要塞模組,或是舊到無法檢查的版本:每個人都要裝同一份 HtfFortress 資料夾", "{0} 没有要塞模组,或是旧到无法检查的版本:每个人都要装同一份 HtfFortress 文件夹" }, ["versionMine"] = new string[3] { "Your Fortress build ({0}) differs from the host's ({1}): install the host's HtfFortress folder", "你的要塞模組版本({0})跟房主({1})不同:請裝房主的 HtfFortress 資料夾", "你的要塞模组版本({0})跟房主({1})不同:请装房主的 HtfFortress 文件夹" }, ["versionHostNone"] = new string[3] { "The host has no Fortress mod, or one too old to check: the fortress won't work in this game", "房主沒有要塞模組,或是舊到無法檢查的版本:這一場要塞功能不能用", "房主没有要塞模组,或是旧到无法检查的版本:这一场要塞功能不能用" }, ["gearNetLauncher"] = new string[3] { "Net Launcher", "撒網砲", "撒网炮" }, ["gearFxNetLauncher"] = new string[3] { "Shoot a net: every fish under it is held fast for {0} s", "射出一張網:網下的魚全部被纏住 {0} 秒", "射出一张网:网下的鱼全部被缠住 {0} 秒" }, ["gearLegendNetLauncher"] = new string[3] { "A net half as big again, and the fish in it take 30% more damage from everything", "網子大一半,被網住的魚受到的所有傷害 +30%", "网子大一半,被网住的鱼受到的所有伤害 +30%" }, ["glyphNetLauncher"] = new string[3] { "Ne", "網", "网" }, ["gearJellyGun"] = new string[3] { "Jellyfish Gun", "水母槍", "水母枪" }, ["gearFxJellyGun"] = new string[3] { "Lob a jellyfish: it hangs there 6 s, stinging every fish under it for {0}/s (half again if wet) and slowing them", "丟出一隻水母:停在空中 6 秒,螫下面每隻魚每秒 {0}(濕掉的 +50%),還會減速", "丢出一只水母:停在空中 6 秒,螫下面每只鱼每秒 {0}(湿掉的 +50%),还会减速" }, ["gearLegendJellyGun"] = new string[3] { "When it fades it splits into three small jellyfish", "消失時分裂成三隻小水母", "消失时分裂成三只小水母" }, ["glyphJellyGun"] = new string[3] { "Je", "母", "母" }, ["gearWaterCannon"] = new string[3] { "Water Cannon", "高壓水砲", "高压水炮" }, ["gearFxWaterCannon"] = new string[3] { "Hold to spray: pushes fish back {0} m a second (and hurts a little) and wets them for 5 s (tesla towers and jellyfish +50%); the tank runs dry", "按住噴水:每秒把魚推回 {0} 公尺(有一點傷害),噴到的魚濕掉 5 秒(電網塔、水母打牠 +50%);水箱會噴完", "按住喷水:每秒把鱼推回 {0} 米(有一点伤害),喷到的鱼湿掉 5 秒(电网塔、水母打它 +50%);水箱会喷完" }, ["gearLegendWaterCannon"] = new string[3] { "Pushes harder, and soaked fish are slowed", "推得更遠,被噴到的魚會減速", "推得更远,被喷到的鱼会减速" }, ["glyphWaterCannon"] = new string[3] { "Wa", "噴", "喷" }, ["gearPufferBomb"] = new string[3] { "Pufferfish Bomb", "河豚炸彈", "河豚炸弹" }, ["gearFxPufferBomb"] = new string[3] { "Throw it: it swells up and bursts, {0} damage to every fish round it, and poison", "丟出去:牠會脹大然後爆開,周圍每隻魚 {0} 傷害,再加中毒", "丢出去:它会胀大然后爆开,周围每只鱼 {0} 伤害,再加中毒" }, ["gearLegendPufferBomb"] = new string[3] { "It bursts twice", "會爆兩次", "会爆两次" }, ["glyphPufferBomb"] = new string[3] { "Pu", "豚", "豚" }, ["gearStarThrower"] = new string[3] { "Starfish Thrower", "海星飛鏢", "海星飞镖" }, ["gearFxStarThrower"] = new string[3] { "A fan of 3-5 starfish, {0} damage each, every one cutting through two fish", "一次射出 3~5 隻海星,每隻 {0} 傷害,各穿過兩隻魚", "一次射出 3~5 只海星,每只 {0} 伤害,各穿过两只鱼" }, ["gearLegendStarThrower"] = new string[3] { "Each starfish cuts through three fish", "每隻海星穿過三隻魚", "每只海星穿过三只鱼" }, ["glyphStarThrower"] = new string[3] { "St", "星", "星" }, ["gearLobsterClaw"] = new string[3] { "Lobster Claw", "龍蝦鉗", "龙虾钳" }, ["gearFxLobsterClaw"] = new string[3] { "Shoots the claw out at the first fish in your aim and flings it on: {0} damage where it lands, half to the fish it lands on", "鉗子射出去夾住瞄準的第一隻魚往前甩:落地時 {0} 傷害,被砸到的魚受一半", "钳子射出去夹住瞄准的第一只鱼往前甩:落地时 {0} 伤害,被砸到的鱼受一半" }, ["gearLegendLobsterClaw"] = new string[3] { "Grabs three fish at once", "一次夾三隻", "一次夹三只" }, ["glyphLobsterClaw"] = new string[3] { "Cl", "鉗", "钳" }, ["gearRocket"] = new string[3] { "Rocket Launcher", "火箭筒", "火箭筒" }, ["gearFxRocket"] = new string[3] { "Fire a rocket that bursts on the first fish or the ground: {0} damage to every fish within 3 m", "發射火箭,碰到魚或地面就爆炸:3 公尺內每隻魚 {0} 傷害", "发射火箭,碰到鱼或地面就爆炸:3 米内每只鱼 {0} 伤害" }, ["gearLegendRocket"] = new string[3] { "Fires three rockets in a spread", "一次發射三枚火箭,散開來打", "一次发射三枚火箭,散开来打" }, ["glyphRocket"] = new string[3] { "Rk", "砲", "炮" }, ["gunNow"] = new string[3] { "Right now: {0} a hit on fortress fish", "現在打要塞的魚每發 {0}", "现在打要塞的鱼每发 {0}" }, ["gearPistol"] = new string[3] { "Pistol", "手槍", "手枪" }, ["gearFxPistol"] = new string[3] { "The game's own pistol, shooting and reloading as ever: {0} its damage to fortress fish, growing with the wave", "遊戲原本的手槍,開槍、換彈照舊:打要塞的魚傷害 {0},隨波數成長", "游戏原本的手枪,开枪、换弹照旧:打要塞的鱼伤害 {0},随波数成长" }, ["gearLegendPistol"] = new string[3] { "15% of hits deal triple damage", "15% 機率三倍傷害", "15% 几率三倍伤害" }, ["glyphPistol"] = new string[3] { "Pi", "手", "手" }, ["gearShotgun"] = new string[3] { "Shotgun", "霰彈槍", "霰弹枪" }, ["gearFxShotgun"] = new string[3] { "The game's own shotgun, shooting and reloading as ever: {0} its damage to fortress fish, growing with the wave", "遊戲原本的霰彈槍,開槍、換彈照舊:打要塞的魚傷害 {0},隨波數成長", "游戏原本的霰弹枪,开枪、换弹照旧:打要塞的鱼伤害 {0},随波数成长" }, ["gearLegendShotgun"] = new string[3] { "15% of hits deal triple damage", "15% 機率三倍傷害", "15% 几率三倍伤害" }, ["glyphShotgun"] = new string[3] { "SG", "散", "散" }, ["gearSmg"] = new string[3] { "SMG", "衝鋒槍", "冲锋枪" }, ["gearFxSmg"] = new string[3] { "The game's own smg, shooting and reloading as ever: {0} its damage to fortress fish, growing with the wave", "遊戲原本的衝鋒槍,開槍、換彈照舊:打要塞的魚傷害 {0},隨波數成長", "游戏原本的冲锋枪,开枪、换弹照旧:打要塞的鱼伤害 {0},随波数成长" }, ["gearLegendSmg"] = new string[3] { "15% of hits deal triple damage", "15% 機率三倍傷害", "15% 几率三倍伤害" }, ["glyphSmg"] = new string[3] { "MG", "衝", "冲" }, ["gearSniper"] = new string[3] { "Sniper Rifle", "狙擊槍", "狙击枪" }, ["gearFxSniper"] = new string[3] { "The game's own sniper rifle, shooting and reloading as ever: {0} its damage to fortress fish, growing with the wave", "遊戲原本的狙擊槍,開槍、換彈照舊:打要塞的魚傷害 {0},隨波數成長", "游戏原本的狙击枪,开枪、换弹照旧:打要塞的鱼伤害 {0},随波数成长" }, ["gearLegendSniper"] = new string[3] { "15% of hits deal triple damage", "15% 機率三倍傷害", "15% 几率三倍伤害" }, ["glyphSniper"] = new string[3] { "Sn", "狙", "狙" }, ["gearRifle"] = new string[3] { "Assault Rifle", "突擊步槍", "突击步枪" }, ["gearFxRifle"] = new string[3] { "The game's own assault rifle, shooting and reloading as ever: {0} its damage to fortress fish, growing with the wave", "遊戲原本的突擊步槍,開槍、換彈照舊:打要塞的魚傷害 {0},隨波數成長", "游戏原本的突击步枪,开枪、换弹照旧:打要塞的鱼伤害 {0},随波数成长" }, ["gearLegendRifle"] = new string[3] { "15% of hits deal triple damage", "15% 機率三倍傷害", "15% 几率三倍伤害" }, ["glyphRifle"] = new string[3] { "AR", "步", "步" }, ["gearBow"] = new string[3] { "Bow", "弓", "弓" }, ["gearFxBow"] = new string[3] { "The game's own bow, shooting and reloading as ever: {0} its damage to fortress fish, growing with the wave", "遊戲原本的弓,開槍、換彈照舊:打要塞的魚傷害 {0},隨波數成長", "游戏原本的弓,开枪、换弹照旧:打要塞的鱼伤害 {0},随波数成长" }, ["gearLegendBow"] = new string[3] { "15% of hits deal triple damage", "15% 機率三倍傷害", "15% 几率三倍伤害" }, ["glyphBow"] = new string[3] { "Bw", "弓", "弓" }, ["gearAbsorber"] = new string[3] { "Absorber", "吸收槍", "吸收枪" }, ["gearFxAbsorber"] = new string[3] { "Sucks in anything lying about and fires with it: copies of an item hit for {0} × what it's worth; a weapon in it is copied, a boss's trophy gives that boss's move. Everything it fires does ×2.5 to fortress fish", "把地上的任何東西吸進來再拿它開火:射出物品的分身,每發 {0} × 它的價值;吸武器就複製那把武器,吸大王的戰利品就能用那隻大王的招。打要塞魚一律 ×2.5", "把地上的任何东西吸进来再拿它开火:射出物品的分身,每发 {0} × 它的价值;吸武器就复制那把武器,吸大王的战利品就能用那只大王的招。打要塞鱼一律 ×2.5" }, ["gearLegendAbsorber"] = new string[3] { "Every weapon it copies fires as a legendary", "複製的武器都以傳說級開火", "复制的武器都以传说级开火" }, ["glyphAbsorber"] = new string[3] { "Ab", "吸", "吸" }, ["gearGatling"] = new string[3] { "Gatling Gun", "加特林機槍", "加特林机枪" }, ["gearFxGatling"] = new string[3] { "Hold to spin the barrels up and pour bullets into the first fish in your aim: {0} damage a bullet, 12 a second once it's spun up", "按住讓槍管轉起來,子彈狂掃準星前第一隻魚:每發 {0} 傷害,轉滿後每秒 12 發", "按住让枪管转起来,子弹狂扫准星前第一只鱼:每发 {0} 伤害,转满后每秒 12 发" }, ["gearLegendGatling"] = new string[3] { "Every bullet glances off into the nearest other fish for half", "每發子彈再彈到旁邊另一隻魚(半傷)", "每发子弹再弹到旁边另一只鱼(半伤)" }, ["glyphGatling"] = new string[3] { "Gt", "機", "机" }, ["absorberKeys"] = new string[3] { "[LMB] fire / suck in · [RMB] swap · [R] spit out · [Q] drop", "[左鍵] 開火/吸\u3000[右鍵] 換吸別的\u3000[R] 吐出來\u3000[Q] 丟下", "[左键] 开火/吸\u3000[右键] 换吸别的\u3000[R] 吐出来\u3000[Q] 丢下" }, ["absorberEmpty"] = new string[3] { "Absorber: empty", "吸收槍:空的", "吸收枪:空的" }, ["absorberEmptyHow"] = new string[3] { "Empty: hold the left button to suck in what lies within {0} m ahead (fish, weapons, trophies, anything)", "空的:按住左鍵,把前方 {0} 公尺內地上的東西吸進來(魚、武器、戰利品,什麼都行)", "空的:按住左键,把前方 {0} 米内地上的东西吸进来(鱼、武器、战利品,什么都行)" }, ["absorberIn"] = new string[3] { "In the absorber: {0}", "吸收槍裡:{0}", "吸收枪里:{0}" }, ["absorberCopy"] = new string[3] { "Copied: fires as {0}", "複製中:當成 {0} 開火", "复制中:当成 {0} 开火" }, ["absorberShot"] = new string[3] { "Shoots copies of it: {0} damage each (worth ${1}: ×{2})", "射出它的分身:每發 {0} 傷害(價值 ${1},×{2})", "射出它的分身:每发 {0} 伤害(价值 ${1},×{2})" }, ["absorberBoost"] = new string[3] { "Everything it fires does ×{0} to fortress fish (a boss takes it as it is)", "它打出去的一切對要塞魚 ×{0}(大王照原本的算)", "它打出去的一切对要塞鱼 ×{0}(大王照原本的算)" }, ["absorberSpit"] = new string[3] { "R: spit it out at the fish (×{0}) · right button: suck in something else instead", "R:吐出來砸魚(×{0})・右鍵:吸別的把它換掉", "R:吐出来砸鱼(×{0})・右键:吸别的把它换掉" }, ["absMoveWarden"] = new string[3] { "Guillotine", "斷罪", "断罪" }, ["absMoveFxWarden"] = new string[3] { "the first fish ahead takes {0}; one left under a third of its health is cut down", "前方第一隻魚受 {0} 傷害,血剩不到三分之一的直接處決", "前方第一只鱼受 {0} 伤害,血剩不到三分之一的直接处决" }, ["absMoveUrchin"] = new string[3] { "Needle Crown", "萬針齊發", "万针齐发" }, ["absMoveFxUrchin"] = new string[3] { "12 needles out all round, {0} each, each through two fish", "向四周射出 12 根刺,每根 {0} 傷害、可貫穿兩隻", "向四周射出 12 根刺,每根 {0} 伤害、可贯穿两只" }, ["absMoveAngler"] = new string[3] { "Soul Lantern", "誘魂燈", "诱魂灯" }, ["absMoveFxAngler"] = new string[3] { "a lantern draws the fish within 10 m in, then bursts: {0} each, held 1.5 s", "丟出燈籠把 10 公尺內的魚拉過去,再爆開:每隻 {0} 傷害並定住 1.5 秒", "丢出灯笼把 10 米内的鱼拉过去,再爆开:每只 {0} 伤害并定住 1.5 秒" }, ["absMoveSteed"] = new string[3] { "Golden Stomp", "黃金蹄踏", "黄金蹄踏" }, ["absMoveFxSteed"] = new string[3] { "a stomp where you aim: {0} within 5 m, and the fish thrown back", "在準心處重踏:5 公尺內 {0} 傷害並把魚震開", "在准心处重踏:5 米内 {0} 伤害并把鱼震开" }, ["absMoveStonefish"] = new string[3] { "Venom Spires", "毒棘陣", "毒棘阵" }, ["absMoveFxStonefish"] = new string[3] { "spires up along the ground ahead (14 m): {0} and three stacks of poison", "前方 14 公尺地面竄出毒棘:{0} 傷害加三層毒", "前方 14 米地面窜出毒棘:{0} 伤害加三层毒" }, ["absMoveSkyfish"] = new string[3] { "Air Raid", "提督空襲", "提督空袭" }, ["absMoveFxSkyfish"] = new string[3] { "six bombs down the aim, {0} each within 3 m", "沿準心方向投下六顆炸彈,每顆 3 公尺內 {0} 傷害", "沿准心方向投下六颗炸弹,每颗 3 米内 {0} 伤害" }, ["absMoveKraken"] = new string[3] { "Crimson Grasp", "深紅纏握", "深红缠握" }, ["absMoveFxKraken"] = new string[3] { "tentacles where you aim hold everything within 5 m for 3 s, {0} a second", "準心處竄出觸手,抓住 5 公尺內的魚 3 秒,每秒 {0} 傷害", "准心处窜出触手,抓住 5 米内的鱼 3 秒,每秒 {0} 伤害" }, ["absMoveVoxel"] = new string[3] { "Delete", "刪除鍵", "删除键" }, ["absMoveFxVoxel"] = new string[3] { "an 8 m box where you aim: fish with less health than ten shots are deleted, the rest take {0}", "在準心處框選 8 公尺:血量低於十發的魚直接刪除,其他受 {0} 傷害", "在准心处框选 8 米:血量低于十发的鱼直接删除,其他受 {0} 伤害" }, ["absMoveKoi"] = new string[3] { "Dragon Breath", "龍息", "龙息" }, ["absMoveFxKoi"] = new string[3] { "a cone of fire ahead for 1.5 s, {0} every quarter second", "向前噴火 1.5 秒,每 0.25 秒 {0} 傷害", "向前喷火 1.5 秒,每 0.25 秒 {0} 伤害" }, ["absMoveEye"] = new string[3] { "The End's Gaze", "終焉凝視", "终焉凝视" }, ["absMoveFxEye"] = new string[3] { "a 45 m beam through everything ({0}), then spears from the sky on the five fish nearest its end", "45 公尺光束貫穿一切({0} 傷害),再從天降下長槍刺向終點附近五隻魚", "45 米光束贯穿一切({0} 伤害),再从天降下长枪刺向终点附近五只鱼" }, ["gearLaser"] = new string[3] { "Laser Gun", "雷射槍", "激光枪" }, ["gearFxLaser"] = new string[3] { "Hold to fire a beam: {0} damage/s, up to ×3 the longer you keep it on; overheats", "按住發射光束:每秒 {0} 傷害,照越久越痛,最多 ×3;會過熱", "按住发射光束:每秒 {0} 伤害,照越久越痛,最多 ×3;会过热" }, ["gearLegendLaser"] = new string[3] { "The beam pierces every fish in its path", "光束貫穿一整排魚", "光束贯穿一整排鱼" }, ["gearPoisonGas"] = new string[3] { "Gas Gun", "毒氣槍", "毒气枪" }, ["gearFxPoisonGas"] = new string[3] { "Lob a gas cloud: each second inside adds a poison stack (up to 5), {0} damage/s per stack; poisoned fish can't be healed", "拋出毒氣雲:在裡面每秒疊一層毒(最多 5 層),每層每秒 {0} 傷害;中毒的魚補不了血", "抛出毒气云:在里面每秒叠一层毒(最多 5 层),每层每秒 {0} 伤害;中毒的鱼补不了血" }, ["gearLegendPoisonGas"] = new string[3] { "A poisoned fish that dies bursts into a new cloud", "中毒的魚死掉會爆出一團新的毒雲", "中毒的鱼死掉会爆出一团新的毒云" }, ["gearBoomerang"] = new string[3] { "Tuna Boomerang", "鮪魚回力鏢", "金枪鱼回旋镖" }, ["gearFxBoomerang"] = new string[3] { "Throw it through the fish and it comes back: {0} damage each way (one more boomerang each rarity up)", "丟出去穿過魚群再飛回來:去程、回程各 {0} 傷害(每升一階多一支)", "丢出去穿过鱼群再飞回来:去程、回程各 {0} 伤害(每升一阶多一支)" }, ["gearLegendBoomerang"] = new string[3] { "Throws four at once in a wide fan", "一次丟四支,扇形散開", "一次丢四支,扇形散开" }, ["gearSharkWhistle"] = new string[3] { "Shark Whistle", "鯊魚哨", "鲨鱼哨" }, ["gearFxSharkWhistle"] = new string[3] { "Call a shark to the sea where you aim: it hunts fish in the water and at the waterline, {0} per bite (×3 on spitters)", "在你瞄準的海面叫來一隻鯊魚:牠獵殺水裡和岸邊的魚,每口 {0} 傷害(咬砲擊魚 ×3)", "在你瞄准的海面叫来一只鲨鱼:它猎杀水里和岸边的鱼,每口 {0} 伤害(咬炮击鱼 ×3)" }, ["gearLegendSharkWhistle"] = new string[3] { "Calls two sharks", "一次叫來兩隻鯊魚", "一次叫来两只鲨鱼" }, ["gearBubbleGun"] = new string[3] { "Bubble Gun", "泡泡槍", "泡泡枪" }, ["gearFxBubbleGun"] = new string[3] { "Trap a fish in a bubble for {0}s: it floats helpless and takes +50% damage (bosses are only slowed)", "把一隻魚關進泡泡 {0} 秒:浮在空中不能動,受到的傷害 +50%(魔王只減速)", "把一只鱼关进泡泡 {0} 秒:浮在空中不能动,受到的伤害 +50%(魔王只减速)" }, ["gearLegendBubbleGun"] = new string[3] { "When the bubble bursts it splashes nearby fish for 20 damage (grows with the wave)", "泡泡破掉時濺傷周圍的魚 20 點(隨波數成長)", "泡泡破掉时溅伤周围的鱼 20 点(随波数成长)" }, ["gearHook"] = new string[3] { "Grapple Gun", "鉤爪槍", "钩爪枪" }, ["gearFxHook"] = new string[3] { "Hook a fish for {0} damage and reel it to you (walls stop it); a thief lets go of what it stole", "鉤住一隻魚造成 {0} 傷害並拉過來(會被牆擋住);小偷魚會吐出偷走的東西", "钩住一只鱼造成 {0} 伤害并拉过来(会被墙挡住);小偷鱼会吐出偷走的东西" }, ["gearLegendHook"] = new string[3] { "The hook jumps on to a second fish nearby", "鉤子再彈到附近第二隻魚", "钩子再弹到附近第二只鱼" }, ["gearWhirlpool"] = new string[3] { "Whirlpool Cannon", "漩渦砲", "漩涡炮" }, ["gearFxWhirlpool"] = new string[3] { "Fire a whirlpool: for {0}s it drags fish within 6 m to its middle (bosses are only slowed)", "發射漩渦:{0} 秒內把 6 公尺內的魚捲到中間(魔王只減速)", "发射漩涡:{0} 秒内把 6 米内的鱼卷到中间(魔王只减速)" }, ["gearLegendWhirlpool"] = new string[3] { "It explodes when it ends: 40 damage (grows with the wave)", "結束時爆炸,造成 40 傷害(隨波數成長)", "结束时爆炸,造成 40 伤害(随波数成长)" }, ["gearConch"] = new string[3] { "Sonic Conch", "聲波海螺", "声波海螺" }, ["gearFxConch"] = new string[3] { "Blast the fish in front of you {0} m back (10 damage); breaks a Behemoth's charge", "把面前的魚震退 {0} 公尺(10 傷害);能打斷深海巨獸的衝鋒", "把面前的鱼震退 {0} 米(10 伤害);能打断深海巨兽的冲锋" }, ["gearLegendConch"] = new string[3] { "The blast also stuns for 1.5 s", "震波還會讓魚暈 1.5 秒", "震波还会让鱼晕 1.5 秒" }, ["legendShortLaser"] = new string[3] { "Piercing beam", "貫穿光束", "贯穿光束" }, ["legendShortNetLauncher"] = new string[3] { "Wide net", "大網", "大网" }, ["legendShortJellyGun"] = new string[3] { "Splitting jellyfish", "分裂水母", "分裂水母" }, ["legendShortWaterCannon"] = new string[3] { "Soaking spray", "減速水柱", "减速水柱" }, ["legendShortPufferBomb"] = new string[3] { "Double burst", "連爆", "连爆" }, ["legendShortStarThrower"] = new string[3] { "Deep cut", "三穿", "三穿" }, ["legendShortLobsterClaw"] = new string[3] { "Triple grab", "一夾三", "一夹三" }, ["legendShortRocket"] = new string[3] { "Triple rocket", "三連發", "三连发" }, ["legendShortPistol"] = new string[3] { "Critical", "暴擊", "暴击" }, ["legendShortShotgun"] = new string[3] { "Critical", "暴擊", "暴击" }, ["legendShortSmg"] = new string[3] { "Critical", "暴擊", "暴击" }, ["legendShortSniper"] = new string[3] { "Critical", "暴擊", "暴击" }, ["legendShortRifle"] = new string[3] { "Critical", "暴擊", "暴击" }, ["legendShortBow"] = new string[3] { "Critical", "暴擊", "暴击" }, ["legendShortAbsorber"] = new string[3] { "Legend copies", "傳說複製", "传说复制" }, ["legendShortGatling"] = new string[3] { "Ricochet", "跳彈", "跳弹" }, ["legendShortPoisonGas"] = new string[3] { "Plague burst", "毒爆", "毒爆" }, ["legendShortBoomerang"] = new string[3] { "Four at once", "四連鏢", "四连镖" }, ["legendShortSharkWhistle"] = new string[3] { "Twin sharks", "雙鯊", "双鲨" }, ["legendShortBubbleGun"] = new string[3] { "Bubble burst", "泡泡爆破", "泡泡爆破" }, ["legendShortHook"] = new string[3] { "Double hook", "連環鉤", "连环钩" }, ["legendShortWhirlpool"] = new string[3] { "Maelstrom", "大漩渦", "大漩涡" }, ["legendShortConch"] = new string[3] { "Stunning blast", "震暈", "震晕" }, ["vaultKindWeapon"] = new string[3] { "Fortress weapon: an item you carry (E to pick up, LMB to fire); damage grows with the wave", "要塞武器:拿在手上的道具(E 撿、左鍵發射);傷害隨波數成長", "要塞武器:拿在手上的道具(E 捡、左键发射);伤害随波数成长" }, ["vaultTabWeapon"] = new string[3] { "Weapons ({0})", "武器({0})", "武器({0})" }, ["weaponKeys"] = new string[3] { "[LMB] fire · [Q] drop", "[左鍵] 發射\u3000[Q] 丟下", "[左键] 发射\u3000[Q] 丢下" }, ["thiefHooked"] = new string[3] { "Hooked the thief: ${0} back!", "鉤到小偷魚:拿回 ${0}!", "钩到小偷鱼:拿回 ${0}!" }, ["tip_weapon_t"] = new string[3] { "Fortress weapon", "要塞武器", "要塞武器" }, ["tip_weapon"] = new string[3] { "Fortress weapons are items, like the game's own guns: [E] picks one up, [1-9] switches, [LMB] fires, [Q] drops it for a friend. Fish and chests drop them.", "要塞武器跟遊戲裡的槍一樣是道具:[E] 撿起來,[1~9] 切換,[左鍵] 發射,[Q] 丟在地上給隊友。魚和寶箱會掉。", "要塞武器跟游戏里的枪一样是道具:[E] 捡起来,[1~9] 切换,[左键] 发射,[Q] 丢在地上给队友。鱼和宝箱会掉。" }, ["activeReady"] = new string[3] { "ready", "就緒", "就绪" }, ["activeNone"] = new string[3] { "The team has no active gear left: fish and chests drop it", "全隊沒有主動道具了:打怪、開寶箱會掉", "全队没有主动道具了:打怪、开宝箱会掉" }, ["activeRoundOnly"] = new string[3] { "Active gear works during a round", "主動技能只有局內能用", "主动技能只有局内能用" }, ["activeOverclock"] = new string[3] { "Turrets overclocked for {0}s!", "砲塔超頻 {0} 秒!", "炮塔超频 {0} 秒!" }, ["Flame"] = new string[3] { "Flamethrower", "火焰噴射塔", "火焰喷射塔" }, ["Sniper"] = new string[3] { "Sniper Tower", "狙擊塔", "狙击塔" }, ["Bubble"] = new string[3] { "Bubble Shield", "泡泡護盾", "泡泡护盾" }, ["FlameA"] = new string[3] { "Inferno", "烈焰", "烈焰" }, ["FlameB"] = new string[3] { "Wide", "廣角", "广角" }, ["SniperA"] = new string[3] { "Armour-breaker", "破甲", "破甲" }, ["SniperB"] = new string[3] { "Rapid", "速射", "速射" }, ["BubbleA"] = new string[3] { "Expanse", "擴張", "扩张" }, ["Mender"] = new string[3] { "Repair Tower", "修補塔", "修补塔" }, ["MenderA"] = new string[3] { "Wide", "廣域", "广域" }, ["MenderB"] = new string[3] { "Surge", "急救", "急救" }, ["MenderA_d"] = new string[3] { "Reaches 4 m further", "範圍再大 4 公尺", "范围再大 4 米" }, ["MenderB_d"] = new string[3] { "Heals twice as much", "回血量加倍", "回血量加倍" }, ["BubbleB"] = new string[3] { "Hardened", "硬化", "硬化" }, ["FlameA_d"] = new string[3] { "Burns twice as hot", "燃燒傷害 ×2", "燃烧伤害 ×2" }, ["FlameB_d"] = new string[3] { "Wider cone, +2 m range", "噴射角度更大、射程 +2", "喷射角度更大、射程 +2" }, ["SniperA_d"] = new string[3] { "×2 damage vs tank crabs and bosses", "對坦克蟹、魔王傷害 ×2", "对坦克蟹、魔王伤害 ×2" }, ["SniperB_d"] = new string[3] { "Fires 1.7× as often", "射速 ×1.7", "射速 ×1.7" }, ["BubbleA_d"] = new string[3] { "Covers 4 m further", "範圍再大 4 公尺", "范围再大 4 米" }, ["BubbleB_d"] = new string[3] { "Buildings take 65% less damage", "建築減傷 65%", "建筑减伤 65%" }, ["statShield"] = new string[3] { "Damage taken", "建築減傷", "建筑减伤" }, ["statRadius"] = new string[3] { "Radius", "範圍", "范围" }, ["statBurn"] = new string[3] { "Burn", "燃燒", "燃烧" }, ["cardLocked"] = new string[3] { "blueprint", "需藍圖", "需蓝图" }, ["needBlueprint"] = new string[3] { "Needs a blueprint: chests from wave 10 and bosses drop them", "需要藍圖:第 10 波後的寶箱和魔王會掉", "需要蓝图:第 10 波后的宝箱和魔王会掉" }, ["blueprintFound"] = new string[3] { "{0} found a blueprint: {1}! New turret unlocked", "{0} 找到了藍圖:{1}!新砲塔解鎖", "{0} 找到了蓝图:{1}!新炮塔解锁" }, ["blueprintFoundTeam"] = new string[3] { "A blueprint went into the vault: {1}! New turret unlocked", "藍圖收進了儲藏庫:{1}!新砲塔解鎖", "蓝图收进了储藏库:{1}!新炮塔解锁" }, ["blueprintBanner"] = new string[3] { "New turret unlocked!", "解鎖了新砲塔!", "解锁了新炮塔!" }, ["tip_island_t"] = new string[3] { "Fortress Island", "要塞島", "要塞岛" }, ["tip_island"] = new string[3] { "The fish are after the pearl in the lighthouse's porch. At its door, [E] opens the gate: 5 seconds later they come. Down the dock road: the fishmonger buys fish, the smith forges weapons at his bench, the quartermaster keeps the vault (throw anything at its door) and the loadout. Talk to them with [E]. [I] shows the full guide.", "魚群是來搶燈塔門口那顆珍珠的。到門口按 [E] 打開閘門,5 秒後牠們就來了。往碼頭的路上:魚販收魚、鐵匠在工作台鍛造武器、軍需官管儲藏庫(什麼都能丟進門口)和配裝,按 [E] 跟他們說話。按 [I] 看完整說明。", "鱼群是来抢灯塔门口那颗珍珠的。到门口按 [E] 打开闸门,5 秒后它们就来了。往码头的路上:鱼贩收鱼、铁匠在工作台锻造武器、军需官管储藏库(什么都能丢进门口)和配装,按 [E] 跟他们说话。按 [I] 看完整说明。" }, ["tip_start_t"] = new string[3] { "Build time", "建造時間", "建造时间" }, ["tip_start"] = new string[3] { "Press [G] to build: walls across the three beach gaps, turrets behind them. The host can press [N] to start early.", "按 [G] 進入建造模式:在三個沙灘缺口擋牆,牆後放砲塔。房主按 [N] 可以提早開始。", "按 [G] 进入建造模式:在三个沙滩缺口挡墙,墙后放炮塔。房主按 [N] 可以提早开始。" }, ["tip_build_t"] = new string[3] { "How to build", "怎麼蓋", "怎么盖" }, ["tip_build"] = new string[3] { "[hold LMB] to build, let go to cancel and get the money back. [RMB] on a piece opens its menu (upgrade, repair). [hold H] takes it down.", "[按住左鍵] 施工,放開就取消並退錢。看著建築按 [右鍵] 打開選單(升級、修理);[按住 H] 拆除。", "[按住左键] 施工,放开就取消并退钱。看着建筑按 [右键] 打开菜单(升级、修理);[按住 H] 拆除。" }, ["tip_net_t"] = new string[3] { "Corpses are money", "魚屍就是錢", "鱼尸就是钱" }, ["tip_net"] = new string[3] { "Press [F] to take out your hand net and click on dead fish to scoop them: you'll see them pile up in the net. Sell them at the fish stall by the dock with [U]; any fish you throw onto its counter is sold too.", "按 [F] 拿出手網,對著魚屍按 [左鍵] 撈起來,會看到牠們一隻隻堆進網子。拿到碼頭旁的魚攤按 [U] 賣掉;任何魚丟到魚攤櫃台上也會賣掉。", "按 [F] 拿出手网,对着鱼尸按 [左键] 捞起来,会看到它们一只只堆进网子。拿到码头旁的鱼摊按 [U] 卖掉;任何鱼丢到鱼摊柜台上也会卖掉。" }, ["tip_netFull_t"] = new string[3] { "Your net is full", "漁網滿了", "渔网满了" }, ["tip_netFull"] = new string[3] { "Walk to the fish stall by the dock (follow the glowing marker) and press [U] to sell. [Shift+U] there buys a bigger net.", "走到碼頭旁的魚攤(跟著閃爍的標記),按 [U] 賣掉。在魚攤前按 [Shift+U] 可以升級漁網。", "走到码头旁的鱼摊(跟着闪烁的标记),按 [U] 卖掉。在鱼摊前按 [Shift+U] 可以升级渔网。" }, ["tip_loot_t"] = new string[3] { "Gear dropped", "掉裝備了", "掉装备了" }, ["tip_loot"] = new string[3] { "The glowing crystal is a piece of gear: walk over it to pick it up. It goes into the team vault.", "發光的水晶是裝備,走過去就撿起來,會存進全隊共用的儲藏庫。", "发光的水晶是装备,走过去就捡起来,会存进全队共用的储藏库。" }, ["tip_chest_t"] = new string[3] { "A chest!", "寶箱!", "宝箱!" }, ["tip_chest"] = new string[3] { "A chest appeared by the lighthouse. Walk up and press [E] to open it: several pieces of gear (into the vault), fish scales, sometimes a weapon (on the ground by it).", "燈塔旁出現了寶箱,走過去按 [E] 打開:好幾件裝備(直接進儲藏庫)、幾片魚鱗,有時還有武器(掉在寶箱旁邊)。", "灯塔旁出现了宝箱,走过去按 [E] 打开:好几件装备(直接进储藏库)、几片鱼鳞,有时还有武器(掉在宝箱旁边)。" }, ["tip_scales_t"] = new string[3] { "Fish scales", "魚鱗", "鱼鳞" }, ["tip_scales"] = new string[3] { "The glowing blue flakes are fish scales: walk over them to pick them up (your count is bottom left). Bosses burst into a ring of them, chests have a few, elites drop one now and then, and dismantling gear at the smithy gives some too. Scales rank gear up, enhance legendaries, mod your weapons and expand the vault.", "發光的藍色小片是魚鱗:走過去就撿起來(數量在左下角)。打王會噴一圈、寶箱有幾片、精英怪偶爾掉一片,到鐵匠拆裝備也會給。魚鱗用來升階、強化傳說、改造武器、擴充儲藏庫和裝備格。", "发光的蓝色小片是鱼鳞:走过去就捡起来(数量在左下角)。打王会喷一圈、宝箱有几片、精英怪偶尔掉一片,到铁匠拆装备也会给。鱼鳞用来升阶、强化传说、改造武器、扩充储藏库和装备格。" }, ["tip_vault_t"] = new string[3] { "Time to gear up", "去配裝吧", "去配装吧" }, ["tip_vault"] = new string[3] { "Everything you picked up is in the vault: the red-roofed shed left of the dock. Talk to the quartermaster [E] and equip it, any time, mid-round too: gear only works once worn. Anything thrown at its door goes in too.", "撿到的裝備都在儲藏庫:碼頭左邊的紅屋頂小屋,跟軍需官說話 [E] 把裝備裝上,隨時都能換(局中也可以),裝上才有效;任何東西丟到門口也會收進去。", "捡到的装备都在储藏库:码头左边的红屋顶小屋,跟军需官说话 [E] 把装备装上,随时都能换(局中也可以),装上才有效;任何东西丢到门口也会收进去。" }, ["tip_active_t"] = new string[3] { "Active gear", "主動裝備", "主动装备" }, ["tip_active"] = new string[3] { "Press [K] in a round to use active gear (each use spends one), [Shift+K] to switch to another the team has; how many are left shows bottom right.", "開局中按 [K] 用主動道具(用一次少一個),[Shift+K] 換成全隊有的另一個;右下角會顯示還剩幾個。", "开局中按 [K] 用主动道具(用一次少一个),[Shift+K] 换成全队有的另一个;右下角会显示还剩几个。" }, ["tip_upkeep_t"] = new string[3] { "Looking after the fort", "照顧你的要塞", "照顾你的要塞" }, ["tip_upkeep"] = new string[3] { "No need for build mode: walk up to a turret or wall and look at it. [U] upgrade · [J] repair · [hold H] take down (half the money back).", "不用進建造模式:走到砲塔或牆前看著它。[U] 升級\u3000[J] 修理\u3000[按住 H] 拆除(退一半的錢)。", "不用进建造模式:走到炮塔或墙前看着它。[U] 升级\u3000[J] 修理\u3000[按住 H] 拆除(退一半的钱)。" }, ["tip_team_t"] = new string[3] { "Build together", "一起蓋", "一起盖" }, ["tip_team"] = new string[3] { "See a site that says Building? Look at it and hold the mouse to help: every extra builder adds 60% speed.", "看到寫著「施工中」的工地,看著它按住左鍵就能幫忙,每多一人快 60%。", "看到写着「施工中」的工地,看着它按住左键就能帮忙,每多一人快 60%。" }, ["tip_foeSpitter_t"] = new string[3] { "Spitter", "砲擊魚", "炮击鱼" }, ["tip_foeSpitter"] = new string[3] { "It floats off the beach and spits. Only turrets near the shore reach it; it dives once the landing fish are dead.", "浮在岸邊海上吐水彈。砲塔要放在靠岸的地方才打得到;登陸的魚死光牠就會潛走。", "浮在岸边海上吐水弹。炮塔要放在靠岸的地方才打得到;登陆的鱼死光它就会潜走。" }, ["tip_foeBomber_t"] = new string[3] { "Bomber", "自爆河豚", "自爆河豚" }, ["tip_foeBomber"] = new string[3] { "It blows up on whatever it touches. Kill it before it gets close, or drop a decoy duck for it.", "碰到牆或人就會爆炸。在牠靠近前打掉,或放誘餌鴨讓牠炸在鴨子上。", "碰到墙或人就会爆炸。在它靠近前打掉,或放诱饵鸭让它炸在鸭子上。" }, ["tip_foeTank_t"] = new string[3] { "Tank crab", "坦克蟹", "坦克蟹" }, ["tip_foeTank"] = new string[3] { "Tough and breaks walls fast. Upgrade walls to stone or better; AP rounds and sniper towers hurt it most.", "又硬又會拆牆。把牆升到石頭以上,穿甲彈和狙擊塔對牠特別有效。", "又硬又会拆墙。把墙升到石头以上,穿甲弹和狙击塔对它特别有效。" }, ["tip_foeThief_t"] = new string[3] { "Thief!", "小偷魚!", "小偷鱼!" }, ["tip_foeThief"] = new string[3] { "It hops walls, grabs corpses or money, and runs back to the sea through a beach. Chase it down to get the loot back!", "會跳過牆偷魚屍或錢,再從沙灘逃回海裡。追上去打死牠,就能把贓物拿回來!", "会跳过墙偷鱼尸或钱,再从沙滩逃回海里。追上去打死它,就能把赃物拿回来!" }, ["tip_foeShield_t"] = new string[3] { "Shield bearer", "盾牌魚", "盾牌鱼" }, ["tip_foeShield"] = new string[3] { "Its shield stops 80% of turret damage from the front. Put turrets at its side, or hit it yourself.", "盾牌擋掉正面 80% 的砲塔傷害。把砲塔放在側面,或自己動手打。", "盾牌挡掉正面 80% 的炮塔伤害。把炮塔放在侧面,或自己动手打。" }, ["tip_foeDigger_t"] = new string[3] { "Digger", "鑽地魚", "钻地鱼" }, ["tip_foeDigger"] = new string[3] { "It tunnels under the first wall it meets. Keep some turrets or spikes near the lighthouse too.", "碰到牆會從地底鑽過去。燈塔附近也要放一些砲塔或尖刺。", "碰到墙会从地底钻过去。灯塔附近也要放一些炮塔或尖刺。" }, ["tip_foeHealer_t"] = new string[3] { "Healer", "治療魚", "治疗鱼" }, ["tip_foeHealer"] = new string[3] { "It heals the fish around it. Take it out first!", "會幫附近受傷的魚補血。優先打掉牠!", "会帮附近受伤的鱼补血。优先打掉它!" }, ["tip_foeSplitter_t"] = new string[3] { "Splitter", "分裂魚", "分裂鱼" }, ["tip_foeSplitter"] = new string[3] { "It bursts into three small fish when it dies: keep some firepower behind the line.", "死掉會裂成 3 隻小魚,後排要留一點火力。", "死掉会裂成 3 只小鱼,后排要留一点火力。" }, ["tip_foeWarden_t"] = new string[3] { "Iron-Claw Warden", "鐵鉗典獄長", "铁钳典狱长" }, ["tip_foeWarden"] = new string[3] { "A gold ring over a boss means a move you can break: hit it hard (or blow the conch) before the ring closes and it reels, taking +50%.", "王頭上出現金色圓環=這招可以破:圓環收起前猛打(或吹海螺),牠就會失衡、受到 +50% 傷害。", "王头上出现金色圆环=这招可以破:圆环收起前猛打(或吹海螺),它就会失衡、受到 +50% 伤害。" }, ["tip_foeUrchin_t"] = new string[3] { "Thousand-Needle Urchin", "萬針刺皇", "万针刺皇" }, ["tip_foeUrchin"] = new string[3] { "Red on the ground is where it hits next. Its spikes stay stuck in the sand for a while: don't stand on them.", "地上的紅色就是下一招的落點。射出的刺會插在沙裡一陣子,別站上去。", "地上的红色就是下一招的落点。射出的刺会插在沙里一阵子,别站上去。" }, ["tip_foeAngler_t"] = new string[3] { "Abyssal Lantern", "深淵提燈", "深渊提灯" }, ["tip_foeAngler"] = new string[3] { "When its lantern swells, turn your back on it! Whoever is looking at the flash gets pulled in.", "燈籠變大時轉身背對牠!閃光那一刻正在看牠的人會被吸過去。", "灯笼变大时转身背对它!闪光那一刻正在看它的人会被吸过去。" }, ["tip_foeSteed_t"] = new string[3] { "Silver Steed", "白銀天馬", "白银天马" }, ["tip_foeSteed"] = new string[3] { "Its charges go straight through walls. Get out of the lane, or break the charge while it rears.", "牠的衝鋒會直接穿過牆。離開通道,或趁牠揚起前蹄時打斷。", "它的冲锋会直接穿过墙。离开通道,或趁它扬起前蹄时打断。" }, ["tip_foeStonefish_t"] = new string[3] { "Venom Rock Emperor", "劇毒岩皇", "剧毒岩皇" }, ["tip_foeStonefish"] = new string[3] { "Its venom pools eat walls: repair them after. Stone turrets wake up again on their own.", "毒池會腐蝕城牆,事後記得修。被石化的砲塔過一陣子會自己恢復。", "毒池会腐蚀城墙,事后记得修。被石化的炮塔过一阵子会自己恢复。" }, ["tip_foeSkyfish_t"] = new string[3] { "Sky Torpedo Admiral", "天翔魚雷提督", "天翔鱼雷提督" }, ["tip_foeSkyfish"] = new string[3] { "Sniper towers and mortars reach it in the sky. Break its dive and it crashes down: everyone, go!", "狙擊塔和迫擊砲打得到天上的牠。打斷俯衝牠就會墜落:全員上!", "狙击塔和迫击炮打得到天上的它。打断俯冲它就会坠落:全员上!" }, ["tip_foeKraken_t"] = new string[3] { "Crimson Kraken", "深紅克拉肯", "深红克拉肯" }, ["tip_foeKraken"] = new string[3] { "It moves between the beaches under the sea. Turrets close to the water reach it; don't let it drag them in.", "牠會在海底換沙灘。靠水邊的砲塔打得到牠,別讓牠把砲塔拖走。", "它会在海底换沙滩。靠水边的炮塔打得到它,别让它把炮塔拖走。" }, ["tip_foeVoxel_t"] = new string[3] { "Shattered Pixel King", "碎裂像素王", "碎裂像素王" }, ["tip_foeVoxel"] = new string[3] { "Its copies are smaller and weaker: finish them, but save your burst to break its Ctrl+Z.", "分身比較小、比較弱:清掉牠們,但留住爆發去打斷 Ctrl+Z。", "分身比较小、比较弱:清掉它们,但留住爆发去打断 Ctrl+Z。" }, ["tip_foeKoi_t"] = new string[3] { "Koi of the Dragon Gate", "登龍錦鯉", "登龙锦鲤" }, ["tip_foeKoi"] = new string[3] { "As a dragon its breath sets buildings burning for a while: spread your turrets out.", "化龍後牠的龍息會讓建築持續燃燒:砲塔分散一點擺。", "化龙后它的龙息会让建筑持续燃烧:炮塔分散一点摆。" }, ["tip_foeEye_t"] = new string[3] { "The Eye at the End", "終焉之眼", "终焉之眼" }, ["tip_foeEye"] = new string[3] { "Save everything for the Last Judgment: when it hangs over the lighthouse, everyone hit it at once.", "把一切留給最後的審判:牠停在燈塔上空時,全員一起打!", "把一切留给最后的审判:它停在灯塔上空时,全员一起打!" }, ["tipFoot"] = new string[3] { "[I] full guide · tips can be turned off in Mod Settings (Tips)", "[I] 完整說明 · 提示卡可在 Mod 設定(Tips)關掉", "[I] 完整说明 · 提示卡可在 Mod 设置(Tips)关掉" }, ["helpHint"] = new string[3] { "[I] guide", "[I] 說明", "[I] 说明" }, ["netHow"] = new string[3] { "[F] hand net · click on dead fish", "[F] 手網 · 對著魚屍按左鍵撈", "[F] 手网 · 对着鱼尸按左键捞" }, ["markCrate"] = new string[3] { "Fish stall: sell fish, buy food [E]", "魚攤・賣魚、買烤魚 [E]", "鱼摊・卖鱼、买烤鱼 [E]" }, ["markVault"] = new string[3] { "Vault: gear [E] · throw anything at the door to store it", "儲藏庫・裝備 [E]・東西丟到門口就收進去", "储藏库・装备 [E]・东西丢到门口就收进去" }, ["markSmithy"] = new string[3] { "Smithy: forge 3 into 1, rank up, mods, buy weapons [E]", "鐵匠鋪・三合一、升階、改造、買武器 [E]", "铁匠铺・三合一、升阶、改造、买武器 [E]" }, ["keeperTalk"] = new string[3] { "Talk", "交談", "交谈" }, ["keeperMarket"] = new string[3] { "Fishmonger", "魚販", "鱼贩" }, ["keeperSmith"] = new string[3] { "Weaponsmith", "武器鐵匠", "武器铁匠" }, ["keeperVault"] = new string[3] { "Quartermaster", "軍需官", "军需官" }, ["keeperLighthouse"] = new string[3] { "Lighthouse keeper", "燈塔看守人", "灯塔看守人" }, ["smithTitle"] = new string[3] { "Smithy", "鐵匠鋪", "铁匠铺" }, ["smithSubtitle"] = new string[3] { "The workbench over the team vault · three of a kind and colour forge into the next colour · what's made goes back into the vault", "全隊儲藏庫的工作台・三個同款同色的鍛成高一階・做好的放回儲藏庫", "全队储藏库的工作台・三个同款同色的锻成高一阶・做好的放回储藏库" }, ["smithBench"] = new string[3] { "The bench", "工作台", "工作台" }, ["smithBenchEmpty"] = new string[3] { "Pick a weapon or a piece of gear on the left to put it on the bench.", "點左邊的一把武器或一件裝備,放上工作台。", "点左边的一把武器或一件装备,放上工作台。" }, ["smithEmpty"] = new string[3] { "Nothing to work on: weapons thrown on the anvil (or into the vault) show up here.", "沒有東西可以加工:丟到鐵砧上(或丟進儲藏庫)的武器會出現在這裡。", "没有东西可以加工:丢到铁砧上(或丢进储藏库)的武器会出现在这里。" }, ["smithMerge"] = new string[3] { "Forge 3 → 1 (you have {0})", "鍛造 3 → 1(有 {0} 個)", "锻造 3 → 1(有 {0} 个)" }, ["smithTakeOne"] = new string[3] { "Take one out", "拿一把出來", "拿一把出来" }, ["smithTabShop"] = new string[3] { "Shop", "商店", "商店" }, ["smithShopTitle"] = new string[3] { "The smith's shop", "鐵匠的商店", "铁匠的商店" }, ["smithShopPick"] = new string[3] { "Pick something on the left: what it does is in its card below.", "點左邊的東西,下面的卡片會寫它能做什麼。", "点左边的东西,下面的卡片会写它能做什么。" }, ["smithBuy"] = new string[3] { "Buy one ${0}", "買一把\u3000${0}", "买一把\u3000${0}" }, ["smithBuyOne"] = new string[3] { "Buy one ${0}", "買一個\u3000${0}", "买一个\u3000${0}" }, ["smithShopPoor"] = new string[3] { "Not enough money", "錢不夠", "钱不够" }, ["smithShopFull"] = new string[3] { "The vault is full", "倉庫滿了", "仓库满了" }, ["smithShopNote"] = new string[3] { "Paid from the crew's money. Weapons are common and go into your hands (three of a kind forge into one rare); active gear [K] goes into the vault and costs more the further the team has got; explosives go into your hands.", "用全隊的錢買。武器是普通的,直接到你手上(三把一樣的可以合成一把稀有);K 技能直接進倉庫,打得越遠越貴;炸藥直接到你手上。", "用全队的钱买。武器是普通的,直接到你手上(三把一样的可以合成一把稀有);K 技能直接进仓库,打得越远越贵;炸药直接到你手上。" }, ["smithShopItemKind"] = new string[3] { "The game's own explosive", "遊戲本身的炸藥", "游戏本身的炸药" }, ["smithShopExplosive"] = new string[3] { "At the game's own shop price. Light it and throw it well away: it blows fish, people and boats about (a stuck boat too), and hurts anyone close, friends included.", "照遊戲商店的價錢賣。點燃後丟遠一點:魚、人、船都會被炸飛(卡住的船也行),旁邊的人會受傷,隊友也會。", "照游戏商店的价钱卖。点燃后丢远一点:鱼、人、船都会被炸飞(卡住的船也行),旁边的人会受伤,队友也会。" }, ["smithShopLocked"] = new string[3] { "Sold after beating the wave {0} boss", "打倒第 {0} 波大王後開賣", "打倒第 {0} 波大王后开卖" }, ["smithTabMods"] = new string[3] { "Mods", "改造", "改造" }, ["smithToMods"] = new string[3] { "Your mods →", "個人改造 →", "个人改造 →" }, ["smithModsNote"] = new string[3] { "Weapons aren't enhanced: each player mods their own (the Mods tab)", "武器不用強化:每個人改自己的(改造分頁)", "武器不用强化:每个人改自己的(改造分页)" }, ["modTitle"] = new string[3] { "Your mods: {0}", "你的改造:{0}", "你的改造:{0}" }, ["modPick"] = new string[3] { "Pick a weapon on the left. Mods are yours alone and kept for good: every weapon of that kind you hold, any rarity, has them.", "點左邊的一種武器。改造只屬於你、永久有效:你拿的這種武器每一把(任何稀有度)都算。", "点左边的一种武器。改造只属于你、永久有效:你拿的这种武器每一把(任何稀有度)都算。" }, ["modNote"] = new string[3] { "Yours alone, for good: every {0} you hold, any rarity · paid with the team's fish scales", "只屬於你、永久:你拿的每一把{0}(任何稀有度)都算・用全隊的魚鱗付", "只属于你、永久:你拿的每一把{0}(任何稀有度)都算・用全队的鱼鳞付" }, ["modAllRarities"] = new string[3] { "Mods are on the weapon kind, not one gun: common to legendary, every one of it you hold gets them", "改造是整種武器的,不分稀有度:普通到傳說,你拿的每一把都吃得到", "改造是整种武器的,不分稀有度:普通到传说,你拿的每一把都吃得到" }, ["modNoMagazine"] = new string[3] { "The bow holds one arrow: no magazine to upgrade", "弓一次只搭一支箭,沒有彈匣可以改", "弓一次只搭一支箭,没有弹匣可以改" }, ["modBuy"] = new string[3] { "Lv{0} ◆{1}", "升到 Lv{0}\u3000◆{1}", "升到 Lv{0}\u3000◆{1}" }, ["modCard"] = new string[3] { "Your mods: {0}", "你的改造:{0}", "你的改造:{0}" }, ["modPower"] = new string[3] { "Power", "威力", "威力" }, ["modTrait"] = new string[3] { "Trait", "特性", "特性" }, ["modBullets"] = new string[3] { "Bullets", "子彈", "子弹" }, ["modFireRate"] = new string[3] { "Fire rate", "射速", "射速" }, ["modRange"] = new string[3] { "Range", "射程", "射程" }, ["modRateValue"] = new string[3] { "−{0}% between shots", "每發間隔 −{0}%", "每发间隔 −{0}%" }, ["modDrawValue"] = new string[3] { "draw −{0}%", "拉弓時間 −{0}%", "拉弓时间 −{0}%" }, ["modRatePourValue"] = new string[3] { "+{0}% a second", "每秒 +{0}%", "每秒 +{0}%" }, ["modRateWhatLaser"] = new string[3] { "The beam pulses faster: more damage a second", "光束跳得更快:每秒傷害更高", "光束跳得更快:每秒伤害更高" }, ["modRateWhatWater"] = new string[3] { "Pours out faster: a harder push, more damage", "水柱更急:推力和傷害更高", "水柱更急:推力和伤害更高" }, ["modRateWhatLinger"] = new string[3] { "Stings faster: more damage a second, and thrown sooner", "毒和螫刺發作更快:每秒傷害更高,也丟得更快", "毒和螫刺发作更快:每秒伤害更高,也丢得更快" }, ["modRangeWhat"] = new string[3] { "Reaches further", "打得更遠", "打得更远" }, ["modRangeWhatLob"] = new string[3] { "Lobs further", "丟得更遠", "丢得更远" }, ["modRangeWhatShark"] = new string[3] { "Hunts further round where it surfaces", "鯊魚獵捕的範圍更大", "鲨鱼猎捕的范围更大" }, ["modRangeWhatAbsorber"] = new string[3] { "Sucks in from further", "吸得更遠", "吸得更远" }, ["modRangeWhatGun"] = new string[3] { "Straighter, faster shots", "子彈更準、飛得更快", "子弹更准、飞得更快" }, ["modRangeValue"] = new string[3] { "{0} m", "{0} 公尺", "{0} 米" }, ["modRangeGunValue"] = new string[3] { "spread −{0}% · shots +{1}% faster", "散布 −{0}%・彈速 +{1}%", "散布 −{0}%・弹速 +{1}%" }, ["modMagazine"] = new string[3] { "Magazine", "彈匣換彈", "弹匣换弹" }, ["modPowerWhat"] = new string[3] { "Its number: damage, seconds or push", "主要數值:傷害、秒數或推力", "主要数值:伤害、秒数或推力" }, ["modBulletsWhat"] = new string[3] { "The game's own bullet upgrades", "遊戲本身的子彈升級", "游戏本身的子弹升级" }, ["modFireRateWhat"] = new string[3] { "Less time between shots", "射擊間隔更短", "射击间隔更短" }, ["modDrawWhat"] = new string[3] { "Draws and nocks faster", "拉弓、上箭更快", "拉弓、上箭更快" }, ["modMagazineWhat"] = new string[3] { "More rounds, a faster reload", "彈匣更大、換彈更快", "弹匣更大、换弹更快" }, ["modBulletsValue"] = new string[3] { "{0} a shot", "每發 {0}", "每发 {0}" }, ["modMagazineValue"] = new string[3] { "{0} rounds · reload −{1}%", "{0} 發・換彈 −{1}%", "{0} 发・换弹 −{1}%" }, ["modUnitTimes"] = new string[3] { "+{0}x", "+{0} 倍", "+{0} 倍" }, ["modUnitDamage"] = new string[3] { "+{0} damage", "+{0} 傷害", "+{0} 伤害" }, ["modUnitFish"] = new string[3] { "+{0} fish", "+{0} 隻", "+{0} 只" }, ["modUnitSeconds"] = new string[3] { "+{0} s", "+{0} 秒", "+{0} 秒" }, ["modUnitSecondsLess"] = new string[3] { "-{0} s", "-{0} 秒", "-{0} 秒" }, ["modUnitMetres"] = new string[3] { "+{0} m", "+{0} 公尺", "+{0} 米" }, ["modUnitDegrees"] = new string[3] { "+{0}°", "+{0}°", "+{0}°" }, ["modTraitLaser"] = new string[3] { "Bites harder the longer it's on: a higher cap", "照越久越痛:上限更高", "照越久越痛:上限更高" }, ["modTraitPoisonGas"] = new string[3] { "The cloud hangs longer", "毒雲停留更久", "毒云停留更久" }, ["modTraitBoomerang"] = new string[3] { "Fish it hits are slowed", "被打中的魚變慢", "被打中的鱼变慢" }, ["modTraitSharkWhistle"] = new string[3] { "The shark hunts longer", "鯊魚待得更久", "鲨鱼待得更久" }, ["modTraitBubbleGun"] = new string[3] { "Bubbles burst on the fish around when they pop", "泡泡破掉時炸傷周圍的魚", "泡泡破掉时炸伤周围的鱼" }, ["modTraitHook"] = new string[3] { "The fish is stunned once it's pulled in", "拉回來之後暈住", "拉回来之后晕住" }, ["modTraitWhirlpool"] = new string[3] { "Hurts what it holds more", "漩渦裡的傷害更高", "漩涡里的伤害更高" }, ["modTraitConch"] = new string[3] { "A wider blast", "震波範圍更寬", "震波范围更宽" }, ["modTraitNetLauncher"] = new string[3] { "A bigger net", "網子更大", "网子更大" }, ["modTraitJellyGun"] = new string[3] { "The jellyfish hangs longer", "水母停留更久", "水母停留更久" }, ["modTraitWaterCannon"] = new string[3] { "A bigger tank", "水箱更大", "水箱更大" }, ["modTraitPufferBomb"] = new string[3] { "A wider burst", "爆炸範圍更大", "爆炸范围更大" }, ["modTraitStarThrower"] = new string[3] { "Each star cuts through more fish", "每顆海星多穿幾隻", "每颗海星多穿几只" }, ["modTraitLobsterClaw"] = new string[3] { "A wider splash where the thrown fish lands", "丟出去的魚落地濺得更廣", "丢出去的鱼落地溅得更广" }, ["modTraitRocket"] = new string[3] { "A wider blast", "爆炸範圍更大", "爆炸范围更大" }, ["modTraitAbsorber"] = new string[3] { "Sucks in from a wider cone", "吸的角度更寬", "吸的角度更宽" }, ["modTraitGatling"] = new string[3] { "The barrels spin up to full speed sooner", "槍管更快轉到全速", "枪管更快转到全速" }, ["smithCardEmpty"] = new string[3] { "Point at something to see what it does.", "滑鼠移到東西上,這裡會說明它的效果。", "鼠标移到东西上,这里会说明它的效果。" }, ["smithCarried"] = new string[3] { "On you", "你身上的武器", "你身上的武器" }, ["smithCarriedNone"] = new string[3] { "You carry no fortress weapons", "身上沒有要塞武器", "身上没有要塞武器" }, ["smithDepositAll"] = new string[3] { "Put the {0} weapons you carry into the vault", "把身上 {0} 把武器收進儲藏庫", "把身上 {0} 把武器收进储藏库" }, ["smithTip"] = new string[3] { "Click a weapon to put it on the rack · dropping one on the anvil [Q] does the same", "點一把武器就放上架・直接丟到鐵砧上 [Q] 也行", "点一把武器就放上架・直接丢到铁砧上 [Q] 也行" }, ["smithRack"] = new string[3] { "The rack", "武器架", "武器架" }, ["smithRackEmpty"] = new string[3] { "The rack is empty: put the weapons you carry on it (left)", "架上還沒有武器:把身上的武器放上來(左邊)", "架上还没有武器:把身上的武器放上来(左边)" }, ["smithTake"] = new string[3] { "Take one", "拿一把", "拿一把" }, ["smithNotOnRack"] = new string[3] { "Not on the rack", "架上沒有", "架上没有" }, ["smithHint"] = new string[3] { "Click (or drag) something on the left onto the bench, then the buttons · weapons thrown on the anvil go into the vault · [Esc] to close", "點左邊的東西(或拖過來)放上工作台,再按下面的按鈕\u3000武器丟到鐵砧上也會收進儲藏庫\u3000[Esc] 關閉", "点左边的东西(或拖过来)放上工作台,再按下面的按钮\u3000武器丢到铁砧上也会收进储藏库\u3000[Esc] 关闭" }, ["vaultStorage"] = new string[3] { "Vault", "儲藏庫", "储藏库" }, ["smithRackCount"] = new string[3] { "Rack", "武器架", "武器架" }, ["vaultExpand"] = new string[3] { "Expand +{0}: {1} scales", "擴充 +{0}:{1} 魚鱗", "扩充 +{0}:{1} 鱼鳞" }, ["vaultExpandNeeds"] = new string[3] { "+{0} after a {1}-wave round", "撐過 {1} 波後可擴充 +{0}", "撑过 {1} 波后可扩充 +{0}" }, ["vaultExpandMax"] = new string[3] { "Fully expanded", "已擴充到最大", "已扩充到最大" }, ["vaultBuyPrice"] = new string[3] { "{0} scales", "{0} 魚鱗", "{0} 鱼鳞" }, ["vaultBuyNeeds"] = new string[3] { "Hold {0} waves", "需撐過 {0} 波", "需撑过 {0} 波" }, ["vaultYouHave"] = new string[3] { "(you have {0} scales; best {1} waves)", "(你有 {0} 魚鱗;最高 {1} 波)", "(你有 {0} 鱼鳞;最高 {1} 波)" }, ["expandTeamSlot"] = new string[3] { "Another team slot", "多一格要塞裝備(全隊)", "多一格要塞装备(全队)" }, ["expandTeamSlot_d"] = new string[3] { "One more piece of fortress gear working for the whole team (up to 8 slots).", "全隊多裝一件要塞裝備,所有人都受惠(最多 8 格)。", "全队多装一件要塞装备,所有人都受惠(最多 8 格)。" }, ["expandPersonalSlot"] = new string[3] { "Another personal slot", "多一格個人裝備", "多一格个人装备" }, ["expandPersonalSlot_d"] = new string[3] { "Every player gets one more personal slot (up to 4).", "每個人都多一格個人裝備(最多 4 格)。", "每个人都多一格个人装备(最多 4 格)。" }, ["expandStorage"] = new string[3] { "A bigger vault", "擴充儲藏庫", "扩充储藏库" }, ["expandStorage_d"] = new string[3] { "10 more slots (a slot holds up to 50 of one thing), a step every 5 waves held, up to 130. When the vault is full, new gear is dismantled into scales on the spot, and what's thrown at the door stays outside.", "多 10 格(一格最多放 50 個同樣的東西),每撐過 5 波就能再擴一次,最多 130 格。滿了的時候,新撿到的裝備會當場拆成魚鱗,丟到門口的東西會留在外面。", "多 10 格(一格最多放 50 个同样的东西),每撑过 5 波就能再扩一次,最多 130 格。满了的时候,新捡到的装备会当场拆成鱼鳞,丢到门口的东西会留在外面。" }, ["lootPickUp"] = new string[3] { "Pick up", "撿起", "捡起" }, ["lootOverflow"] = new string[3] { "The vault is full ({0}): {1} became {2} scales", "儲藏庫滿了({0} 件):{1} 自動拆成 {2} 魚鱗", "储藏库满了({0} 件):{1} 自动拆成 {2} 鱼鳞" }, ["rackFull"] = new string[3] { "The weapon rack is full ({0}): expand it at the smith", "武器架滿了({0} 把):到鐵匠那裡擴充", "武器架满了({0} 把):到铁匠那里扩充" }, ["stallTitle"] = new string[3] { "Fish stall", "魚攤", "鱼摊" }, ["stallLine"] = new string[3] { "Bring me the catch, I pay the crew on the spot!", "漁獲拿來,當場算錢給全隊!", "渔获拿来,当场算钱给全队!" }, ["stallSellTitle"] = new string[3] { "Sell your net ({0} fish)", "賣掉網裡的魚({0} 隻)", "卖掉网里的鱼({0} 只)" }, ["stallSellDetail"] = new string[3] { "+${0} for the whole crew", "全隊 +${0}", "全队 +${0}" }, ["stallSellNone"] = new string[3] { "The net is empty: [F] takes it out, click on dead fish", "網子是空的:按 [F] 拿出網子,對著魚屍按左鍵", "网子是空的:按 [F] 拿出网子,对着鱼尸按左键" }, ["stallSellBtn"] = new string[3] { "Sell +${0}", "賣出 +${0}", "卖出 +${0}" }, ["stallNetTitle"] = new string[3] { "A bigger net: holds {0}", "換大網:裝 {0} 隻", "换大网:装 {0} 只" }, ["stallNetDetail"] = new string[3] { "Yours holds {0} · for the whole crew, this round", "現在裝 {0} 隻・全隊適用,到這局結束", "现在装 {0} 只・全队适用,到这局结束" }, ["stallNetDetailNext"] = new string[3] { "Yours holds {0} · for the whole crew, through the next round", "現在裝 {0} 隻・全隊適用,用到下一局結束", "现在装 {0} 只・全队适用,用到下一局结束" }, ["stallNetMaxDetail"] = new string[3] { "The biggest net there is", "已經是最大的網", "已经是最大的网" }, ["stallFoodTitle"] = new string[3] { "Grilled fish", "烤魚", "烤鱼" }, ["stallFoodDetail"] = new string[3] { "Eaten on the spot: fills you up and heals a little", "買了當場吃掉:回飽食度和一點血", "买了当场吃掉:回饱食度和一点血" }, ["stallHint"] = new string[3] { "Fish thrown onto the counter sell too · [Esc] or right-click to close", "魚丟到櫃台上也能賣\u3000[Esc] 或右鍵關閉", "鱼丢到柜台上也能卖\u3000[Esc] 或右键关闭" }, ["markCircle"] = new string[3] { "Lighthouse: [E] to start", "燈塔:按 E 開局", "灯塔:按 E 开局" }, ["markChest"] = new string[3] { "Chest", "寶箱", "宝箱" }, ["helpTitle"] = new string[3] { "OVER 99 · Fortress Island guide", "OVER 99・要塞島說明", "OVER 99・要塞岛说明" }, ["helpClose"] = new string[3] { "[I] / [Esc] close", "[I]/[Esc] 關閉", "[I]/[Esc] 关闭" }, ["helpKeys"] = new string[3] { "[E] use\u3000[F] net\u3000[G] build\u3000[K] skill\u3000[1-9] weapons\u3000[Q] drop\u3000[O] hold: unstuck", "[E] 互動\u3000[F] 網子\u3000[G] 建造\u3000[K] 技能\u3000[1-9] 換武器\u3000[Q] 丟掉\u3000[O] 按住脫困", "[E] 互动\u3000[F] 网子\u3000[G] 建造\u3000[K] 技能\u3000[1-9] 换武器\u3000[Q] 丢掉\u3000[O] 按住脱困" }, ["helpPearlT"] = new string[3] { "Guard the pearl", "保護珍珠", "保护珍珠" }, ["helpPearl"] = new string[3] { "The fish are after the pearl in the lighthouse. If the lighthouse falls, you lose.", "魚群是來搶燈塔裡那顆珍珠的。燈塔被打爆就輸了。", "鱼群是来抢灯塔里那颗珍珠的。灯塔被打爆就输了。" }, ["helpStartT"] = new string[3] { "Open the gate", "開門開戰", "开门开战" }, ["helpStart"] = new string[3] { "[E] at the lighthouse door opens the gate: the fish come 5 s later.", "到燈塔門口按 [E] 打開閘門,5 秒後魚群就來。", "到灯塔门口按 [E] 打开闸门,5 秒后鱼群就来。" }, ["helpReviveT"] = new string[3] { "Pick each other up", "倒下靠隊友", "倒下靠队友" }, ["helpRevive"] = new string[3] { "You can't get up on your own: a teammate has to help. All down, you lose.", "倒下不能自己起來,要隊友扶;全員倒下也算輸。", "倒下不能自己起来,要队友扶;全员倒下也算输。" }, ["helpBuildT"] = new string[3] { "Walls and turrets", "蓋牆和砲台", "盖墙和炮台" }, ["helpBuild"] = new string[3] { "[G] builds. Look at a piece and [RMB] to upgrade or repair it.", "按 [G] 建造;看著建築按 [右鍵] 升級、修理。", "按 [G] 建造;看着建筑按 [右键] 升级、修理。" }, ["helpNetT"] = new string[3] { "Scoop fish, earn money", "撈魚屍賺錢", "捞鱼尸赚钱" }, ["helpNet"] = new string[3] { "[F] takes out the net: scoop up dead fish and sell them at the stall.", "按 [F] 拿網撈魚屍,拿去魚攤賣錢。", "按 [F] 拿网捞鱼尸,拿去鱼摊卖钱。" }, ["helpLootT"] = new string[3] { "Grab the gear", "撿裝備變強", "捡装备变强" }, ["helpLoot"] = new string[3] { "Fish drop weapons and gear: walk over them or [E] to pick them up.", "魚會掉武器和裝備,走過去或按 [E] 就撿起來。", "鱼会掉武器和装备,走过去或按 [E] 就捡起来。" }, ["helpStallT"] = new string[3] { "Fish stall", "魚攤", "鱼摊" }, ["helpStall"] = new string[3] { "Buys your fish; sells bigger nets and grilled fish.", "收魚屍換錢,也賣大網和烤魚。", "收鱼尸换钱,也卖大网和烤鱼。" }, ["helpHelperT"] = new string[3] { "Helpers", "小幫手", "小帮手" }, ["helpHelper"] = new string[3] { "Hire them at the stall: bodies get sold, the rest goes into the vault.", "在魚攤雇:魚屍撿去賣,其他東西收進倉庫。", "在鱼摊雇:鱼尸捡去卖,其他东西收进仓库。" }, ["helpSmithyT"] = new string[3] { "Smithy", "鐵匠鋪", "铁匠铺" }, ["helpSmithy"] = new string[3] { "Three of a kind forge into a better one; mods upgrade your weapon.", "三件一樣的鍛成更強一階,還能改造武器。", "三件一样的锻成更强一阶,还能改造武器。" }, ["helpVaultT"] = new string[3] { "Vault", "儲藏庫", "储藏库" }, ["helpVault"] = new string[3] { "Everything you pick up lands here: talk to the quartermaster to wear it.", "撿到的都放這;跟軍需官說話換上裝備。", "捡到的都放这;跟军需官说话换上装备。" }, ["helpChestT"] = new string[3] { "Chests", "寶箱", "宝箱" }, ["helpChest"] = new string[3] { "Every 5 waves a chest turns up by the lighthouse: [E] opens it.", "每 5 波燈塔旁出現寶箱,按 [E] 打開。", "每 5 波灯塔旁出现宝箱,按 [E] 打开。" }, ["helpLadderT"] = new string[3] { "Up the lighthouse", "爬上燈塔", "爬上灯塔" }, ["helpLadder"] = new string[3] { "The ladder on its east side goes up to the gallery: [W] up, [S] down, [Space] let go.", "東邊的梯子通到瞭望台:[W] 爬、[S] 下、[空白鍵] 放手。", "东边的梯子通到瞭望台:[W] 爬、[S] 下、[空格键] 放手。" }, ["helpFoeCharger"] = new string[3] { "Fast: charges straight at you", "跑很快,直直衝過來", "跑很快,直直冲过来" }, ["helpFoeTank"] = new string[3] { "Tough and slow; hits walls twice as hard", "又硬又慢,拆牆特別兇", "又硬又慢,拆墙特别凶" }, ["helpFoeSpitter"] = new string[3] { "Shoots from the sea: only turrets near the shore reach it", "在海上開砲,靠岸的砲塔才打得到", "在海上开炮,靠岸的炮塔才打得到" }, ["helpFoeBomber"] = new string[3] { "Blows up on whatever it touches", "碰到東西就爆炸", "碰到东西就爆炸" }, ["helpFoeThief"] = new string[3] { "Steals fish and money: chase it down", "偷魚屍和錢,追上去打死", "偷鱼尸和钱,追上去打死" }, ["helpFoeShield"] = new string[3] { "Blocks shots from the front: hit its side", "正面擋子彈,從側面打", "正面挡子弹,从侧面打" }, ["helpFoeDigger"] = new string[3] { "Tunnels under walls: guard the inside too", "會鑽過牆,內圈也要守", "会钻过墙,内圈也要守" }, ["helpFoeHealer"] = new string[3] { "Heals the others: kill it first", "幫別的魚補血,先打它", "帮别的鱼补血,先打它" }, ["helpFoeSplitter"] = new string[3] { "Splits into 3 when it dies", "死掉會裂成 3 隻小的", "死掉会裂成 3 只小的" }, ["helpBossT"] = new string[3] { "Bosses", "大王", "大王" }, ["helpBoss"] = new string[3] { "One every 10 waves, 10 in all; wave 100 is the last", "每 10 波一隻,共 10 隻;第 100 波是最後一戰", "每 10 波一只,共 10 只;第 100 波是最后一战" }, ["vaultScales"] = new string[3] { "Fish scales {0}", "魚鱗 {0}", "鱼鳞 {0}" }, ["vaultSalvage"] = new string[3] { "Dismantle (+{0} scales)", "拆成魚鱗(+{0})", "拆成鱼鳞(+{0})" }, ["vaultAscend"] = new string[3] { "Rank up ({0} scales)", "升階(魚鱗 {0})", "升阶(鱼鳞 {0})" }, ["vaultNoAscend"] = new string[3] { "Already the highest rarity", "已經是最高階", "已经是最高阶" }, ["vaultEnhance"] = new string[3] { "Enhance to +{0} ({1} scales)", "強化到 +{0}(魚鱗 {1})", "强化到 +{0}(鱼鳞 {1})" }, ["smithOnYou"] = new string[3] { "on you", "身上", "身上" }, ["smithCarriedCount"] = new string[3] { "(+{0} you carry)", "(身上還有 {0} 把)", "(身上还有 {0} 把)" }, ["smithEnhanceNote"] = new string[3] { "An enhancement counts for every legendary of this kind, the ones you carry too", "強化會套用到這一種的每一把傳說(身上的也算)", "强化会套用到这一种的每一把传说(身上的也算)" }, ["vaultEnhanceMax"] = new string[3] { "Fully enhanced (+5)", "已強化到 +5", "已强化到 +5" }, ["vaultEnhanceLevel"] = new string[3] { "Legendary enhancement +{0} / {1} (each +10%)", "傳說強化 +{0} / {1}(每級 +10%)", "传说强化 +{0} / {1}(每级 +10%)" }, ["cardPicked"] = new string[3] { "You picked up", "你撿到了", "你捡到了" }, ["cardChest"] = new string[3] { "The chest gave the team", "寶箱開出了", "宝箱开出了" }, ["cardWeaponDrop"] = new string[3] { "On the ground by the chest: [E] to hold it, or walk over it to put it in the vault", "掉在寶箱旁邊:按 [E] 拿在手上,走過去就收進儲藏庫", "掉在宝箱旁边:按 [E] 拿在手上,走过去就收进储藏库" }, ["cardGameItem"] = new string[3] { "(on the ground by the chest)", "(掉在寶箱旁邊)", "(掉在宝箱旁边)" }, ["cardWhere"] = new string[3] { "In the vault: gear only works once worn there (the quartermaster [E], any time) · [I] guide", "已存進儲藏庫:要到儲藏庫裝上才會生效(找軍需官 [E],隨時都能換)· [I] 說明", "已存进储藏库:要到储藏库装上才会生效(找军需官 [E],随时都能换)· [I] 说明" }, ["loadoutTeam"] = new string[3] { "Fortress", "要塞", "要塞" }, ["loadoutMine"] = new string[3] { "Me", "我", "我" }, ["legendShortGunpowder"] = new string[3] { "Burst", "爆裂", "爆裂" }, ["legendShortScope"] = new string[3] { "Critical", "爆擊", "暴击" }, ["legendShortApRounds"] = new string[3] { "Pierce", "破盾", "破盾" }, ["legendShortIncendiary"] = new string[3] { "Spread", "延燒", "延烧" }, ["legendShortFrostCore"] = new string[3] { "Freeze", "冰封", "冰封" }, ["legendShortTeslaCoil"] = new string[3] { "Stun", "麻痺", "麻痹" }, ["legendShortRebar"] = new string[3] { "Thorns", "反刺", "反刺" }, ["legendShortCoreShield"] = new string[3] { "Regen", "再生", "再生" }, ["legendShortWarChest"] = new string[3] { "Interest", "利息", "利息" }, ["legendShortSharkArmor"] = new string[3] { "Bite back", "反咬", "反咬" }, ["legendShortBigNet"] = new string[3] { "Auto-sell", "自動販賣", "自动贩卖" }, ["legendShortFishGloves"] = new string[3] { "Paid", "現賺", "现赚" }, ["legendShortGauntlet"] = new string[3] { "Knockout", "重拳", "重拳" }, ["legendShortToolBelt"] = new string[3] { "Fast build", "神速施工", "神速施工" }, ["legendShortLuckyCharm"] = new string[3] { "Lucky", "好運", "好运" }, ["mvpKills"] = new string[3] { "Kill King", "擊殺王", "击杀王" }, ["mvpBuilder"] = new string[3] { "Master Builder", "建築大師", "建筑大师" }, ["mvpFisher"] = new string[3] { "Fisher King", "漁夫王", "渔夫王" }, ["mvpSurvivor"] = new string[3] { "Never Went Down", "不倒翁", "不倒翁" }, ["fishTip"] = new string[3] { "Dead fish are the money: press [F] for the hand net and click on them, then sell at the fish stall by the dock with [U]. Careful, they bite now!", "魚屍才是主要收入:按 [F] 拿出手網對著魚屍按左鍵撈起來,再到碼頭旁的魚攤按 [U] 賣掉。小心,牠們現在會咬人了!", "鱼尸才是主要收入:按 [F] 拿出手网对着鱼尸按左键捞起来,再到码头旁的鱼摊按 [U] 卖掉。小心,它们现在会咬人了!" }, ["Wall"] = new string[3] { "Wall", "牆", "墙" }, ["Floor"] = new string[3] { "Floor", "地板", "地板" }, ["Ramp"] = new string[3] { "Ramp", "斜坡", "斜坡" }, ["WallStone"] = new string[3] { "Stone wall", "石牆", "石墙" }, ["WallMetal"] = new string[3] { "Metal wall", "鐵牆", "铁墙" }, ["Cannon"] = new string[3] { "Cannon", "大砲", "大炮" }, ["Gun"] = new string[3] { "Machine gun", "機槍塔", "机枪塔" } }; public static string T(string key, params object[] args) { if (!Table.TryGetValue(key, out var value)) { return key; } string text = value[(int)Current()]; if (args.Length != 0) { return string.Format(text, args); } return text; } private static Lang Current() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) switch (Setting?.Value ?? LanguageSetting.Auto) { case LanguageSetting.English: return Lang.En; case LanguageSetting.TraditionalChinese: return Lang.ZhTW; case LanguageSetting.SimplifiedChinese: return Lang.ZhCN; default: { string text; try { Locale selectedLocale = LocalizationSettings.SelectedLocale; object obj; if (selectedLocale == null) { obj = null; } else { LocaleIdentifier identifier = selectedLocale.Identifier; obj = ((LocaleIdentifier)(ref identifier)).Code; } if (obj == null) { obj = ""; } text = (string)obj; } catch { text = ""; } if (!text.StartsWith("zh")) { return Lang.En; } if (!text.Contains("TW") && !text.Contains("HK") && !text.Contains("Hant")) { return Lang.ZhCN; } return Lang.ZhTW; } } } } [HarmonyPatch(typeof(PlayerMovement), "Move")] public static class Ladder { public const float FaceX = -1.62f; public const float HalfWidth = 0.25f; public const float DeckY = 4.36f; public const float DeckR = 1.55f; public const float Off = 0.55f; private const float Speed = 2.4f; private static readonly FieldRef Rig = AccessTools.FieldRefAccess("_rig"); private static readonly FieldRef Col = AccessTools.FieldRefAccess("_col"); private static readonly FieldRef Input = AccessTools.FieldRefAccess("_moveInput"); private static float _letGoUntil; private static float _nextHint; private static bool _broken; public static bool Climbing { get; private set; } public static int Way(float forward, float facing, bool grounded, float feet) { int num = ((forward > 0.1f) ? 1 : ((forward < -0.1f) ? (-1) : 0)); if (facing < -0.2f) { num = -num; } if (grounded && (num <= 0 || !(facing > 0.5f) || !(feet < 3.3600001f))) { return 0; } return num; } private static void Postfix(PlayerMovement __instance) { if (_broken) { return; } try { Climb(__instance); } catch (Exception ex) { _broken = true; Climbing = false; BuildSystem.Log.LogError((object)("Ladder off: " + ex)); } } private static void Climb(PlayerMovement __instance) { //IL_0074: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00b6: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0123: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_01ad: 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_026e: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) bool climbing = Climbing; Climbing = false; Player localPlayer = Player.LocalPlayer; Transform val = (Object.op_Implicit((Object)(object)Siege.Instance) ? Siege.Instance.Lighthouse : null); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)localPlayer) || (Object)(object)localPlayer.Movement != (Object)(object)__instance || Time.time < _letGoUntil) { return; } Rigidbody val2 = Rig.Invoke(__instance); CapsuleCollider val3 = Col.Invoke(__instance); Vector3 val4 = val.InverseTransformPoint(val2.position); float num = val4.y - (Object.op_Implicit((Object)(object)val3) ? (val3.height * 0.5f) : 0.9f); float num2 = -1.62f - val4.x; if (Mathf.Abs(val4.z) > 0.55f || num2 < -0.3f || num2 > 0.9f || num < -0.5f || num > 4.6600003f) { return; } Vector2 val5 = (localPlayer.BlockInputs ? Vector2.zero : Input.Invoke(__instance)); Vector3 val6 = val.InverseTransformDirection(localPlayer.CurPlayerRot * Vector3.forward); Vector2 val7 = new Vector2(val6.x, val6.z); float x = ((Vector2)(ref val7)).normalized.x; bool grounded = __instance.Grounded; int num3 = Way(val5.y, x, grounded, num); if (grounded && num3 <= 0) { return; } if (!localPlayer.BlockInputs && Keyboard.current != null && ((ButtonControl)Keyboard.current.spaceKey).isPressed) { _letGoUntil = Time.time + 0.6f; val2.linearVelocity = val.TransformDirection(new Vector3(-2.5f, 2.5f, 0f)); return; } Climbing = true; Vector3 val8 = default(Vector3); if (num3 > 0 && num > 4.4100003f) { ((Vector3)(ref val8))..ctor(2.2f, 0.4f, (0f - val4.z) * 4f); } else { Vector2 val9 = Vector2.ClampMagnitude(new Vector2(-2.17f - val4.x, 0f - val4.z) * 6f, 2f); ((Vector3)(ref val8))..ctor(val9.x, (float)num3 * 2.4f, val9.y); } val8 = val.TransformDirection(val8); if (val2.useGravity) { val8.y -= Physics.gravity.y * Time.fixedDeltaTime; } val2.linearVelocity = val8; if (!climbing) { AutoTest.Count("ladder_climb"); if (Time.time >= _nextHint) { _nextHint = Time.time + 90f; Hud.Banner(Hud.Keys(L10n.T("ladderHint")), 3.5f); } } } } public struct VaultState : IBroadcast { public string Data; } public enum VaultAction : byte { Merge, EquipFortress, EquipPersonal, UnequipFortress, UnequipPersonal, Salvage, Ascend, Enhance, Deposit, Take, Expand, TakeItem, Buy, StoreSlot, Mod, SellAll, BuyItem } public struct VaultRequest : IBroadcast { public VaultAction Action; public Gear Gear; public Rarity Rarity; public byte Slot; public byte Item; public byte Count; public byte Into; } public enum LootWhat : byte { Drop, DropGone, Chest, ChestGone, Leftovers, Blueprint, Overflow, Cleared, Scales, ScalesGone, Give } public struct LootPick : IBroadcast { public int Id; } public struct LootEvent : IBroadcast { public int Id; public LootWhat What; public Vector3 Pos; public Gear Gear; public Rarity Rarity; public string Who; public string Data; public string Item; } public class Loot : MonoBehaviour { public struct Lying { public int Id; public Item Item; public Vector3 Pos; public object Key => Item ?? ((object)Id); } public static Loot Instance; private const float PickRadius = 1.2f; private const float ReachRadius = 4f; private const float DropLife = 90f; private string _loadedFor; private readonly Dictionary _drops = new Dictionary(); private (int id, Vector3 pos, int wave) _chest; private int _nextId = 1; private float _nextTick; private readonly Dictionary _dropViews = new Dictionary(); private readonly Dictionary _scaleViews = new Dictionary(); private GameObject _chestView; private NetworkManager _registeredOn; private static readonly HashSet BackedUp; private bool _unsent; private float _nextSend; private int _roundDrops; public static float NormalDrop; public static float EliteDrop; private static readonly string[] GameItems; private static readonly Gear[] GameGuns; public const float GameItemChance = 0.3f; private readonly Dictionary _scales = new Dictionary(); private readonly HashSet _lootWeapons = new HashSet(); public const float ScaleRadius = 1.5f; public const float EliteScaleChance = 0.25f; public const string HelperWho = "\u0001helper"; public const float LieStill = 15f; private Dictionary _still = new Dictionary(); private readonly List _lying = new List(); private float _nextLying; private readonly Dictionary _helpersWait = new Dictionary(); private static readonly Dictionary HandedOut; private static readonly MethodInfo ToSaved; private float _nextFull; public const int WeaponPrice = 300; public const int SpecialPrice = 5000; public const int SpecialBest = 10; public const int GatlingBest = 80; public const int ActivePrice = 150; private static List _explosives; private static bool _noneLogged; private static readonly FieldInfo WorthField; private static readonly Dictionary BeamMats; private static Material _scaleMat; private static readonly MethodInfo StartEatingMethod; private static readonly List Floating; private TextMeshProUGUI _scalesHud; private int _scalesShown = -1; private float _scalesBump; public VaultData Vault { get; private set; } = new VaultData(); public VaultData ClientVault { get; private set; } = new VaultData(); public bool ClientHasDrops => _dropViews.Count > 0; public bool ClientHasScales => _scaleViews.Count > 0; public Vector3? ClientChestPos { get { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_chestView)) { return null; } return _chestView.transform.position; } } public static ulong MyKey { get { if (!Object.op_Implicit((Object)(object)Player.LocalPlayer)) { return 0uL; } return KeyOf(Player.LocalPlayer); } } public static List ShopItems { get { if (_explosives == null || _explosives.Count <= 0) { return _explosives = FindExplosives(); } return _explosives; } } public string ServerVaultFile { get { if (!string.IsNullOrEmpty(_loadedFor)) { return FilePath(_loadedFor); } return null; } } public List DebugScales => _scales.Values.Select(((Vector3 pos, int n) v) => v.pos).ToList(); public (int id, Vector3 pos) DebugChest => (id: _chest.id, pos: _chest.pos); public int ServerDropCount => _drops.Count; public IEnumerable ServerDropPositions => _drops.Values.Select(((Gear g, Rarity r, Vector3 pos, float until) d) => d.pos); public Vector3? ServerChestPos { get { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (_chest.id == 0) { return null; } return _chest.pos; } } static Loot() { BackedUp = new HashSet(); NormalDrop = 0.06f; EliteDrop = 0.35f; GameItems = new string[5] { "knife", "brassknuckles", "dynamite", "disc", "moneyinabottle" }; GameGuns = GearCatalog.WeaponKinds.Where(GearCatalog.IsGameGun).ToArray(); HandedOut = new Dictionary(); ToSaved = AccessTools.Method(typeof(SaveManager), "ItemToSavedItem", (Type[])null, (Type[])null); WorthField = AccessTools.Field(typeof(Item), "_worth"); BeamMats = new Dictionary(); StartEatingMethod = AccessTools.Method(typeof(PlayerEating), "StartEating", (Type[])null, (Type[])null); Floating = new List(); GenericWriter.SetWrite((Action)delegate(Writer w, LootPick v) { w.WriteInt32(v.Id); }); GenericReader.SetRead((Func)((Reader r) => new LootPick { Id = r.ReadInt32() })); GenericWriter.SetWrite((Action)delegate(Writer w, VaultState v) { w.WriteString(v.Data ?? ""); }); GenericReader.SetRead((Func)((Reader r) => new VaultState { Data = r.ReadString() })); GenericWriter.SetWrite((Action)delegate(Writer w, VaultRequest v) { w.WriteByte((byte)v.Action); w.WriteByte((byte)v.Gear); w.WriteByte((byte)v.Rarity); w.WriteByte(v.Slot); w.WriteByte(v.Item); w.WriteByte(v.Count); w.WriteByte(v.Into); }); GenericReader.SetRead((Func)((Reader r) => new VaultRequest { Action = (VaultAction)r.ReadByte(), Gear = (Gear)r.ReadByte(), Rarity = (Rarity)r.ReadByte(), Slot = r.ReadByte(), Item = r.ReadByte(), Count = r.ReadByte(), Into = r.ReadByte() })); GenericWriter.SetWrite((Action)delegate(Writer w, LootEvent v) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) w.WriteInt32(v.Id); w.WriteByte((byte)v.What); w.WriteVector3(v.Pos); w.WriteByte((byte)v.Gear); w.WriteByte((byte)v.Rarity); w.WriteString(v.Who ?? ""); w.WriteString(v.Data ?? ""); w.WriteString(v.Item ?? ""); }); GenericReader.SetRead((Func)((Reader r) => new LootEvent { Id = r.ReadInt32(), What = (LootWhat)r.ReadByte(), Pos = r.ReadVector3(), Gear = (Gear)r.ReadByte(), Rarity = (Rarity)r.ReadByte(), Who = r.ReadString(), Data = r.ReadString(), Item = r.ReadString() })); } private void Awake() { Instance = this; } public static ulong KeyOf(Player p) { if (p.SteamID == 0L) { return (uint)((NetworkBehaviour)p).ObjectId; } return p.SteamID; } internal static string NameOf(Player p) { if (!string.IsNullOrEmpty(p.SteamName)) { return p.SteamName; } return "Player " + ((NetworkBehaviour)p).ObjectId; } private static string Pack(IEnumerable<(Gear, Rarity)> items) { return string.Join(",", items.Select(delegate((Gear, Rarity) i) { int item = (int)i.Item1; string text = item.ToString(); item = (int)i.Item2; return text + ":" + item; })); } private static IEnumerable<(Gear, Rarity)> Unpack(string s) { return from x in (s ?? "").Split(',') select x.Split(':') into f where f.Length == 2 select ((Gear)int.Parse(f[0]), (Rarity)int.Parse(f[1])); } private static string Labels(string packed) { return string.Join("、", from i in Unpack(packed) select GearCatalog.Label(i.Item1, i.Item2)); } private void Update() { NetworkManager networkManager = InstanceFinder.NetworkManager; if (Object.op_Implicit((Object)(object)networkManager) && (Object)(object)networkManager != (Object)(object)_registeredOn) { _registeredOn = networkManager; networkManager.ClientManager.RegisterBroadcast((Action)delegate(VaultState s, Channel ch) { ClientVault = VaultData.Read(s.Data); }); networkManager.ClientManager.RegisterBroadcast((Action)delegate(LootEvent e, Channel ch) { OnLoot(e); }); networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, VaultRequest req, Channel ch) { Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); if (Object.op_Implicit((Object)(object)val)) { ServerRequest(val, req); } }), true); networkManager.ServerManager.RegisterBroadcast(Net.Safe(delegate(NetworkConnection conn, LootPick req, Channel ch) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_00cd: 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) Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).Owner == conn)); Vector3 val2; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.Transform) && _drops.TryGetValue(req.Id, out (Gear, Rarity, Vector3, float) value)) { val2 = value.Item3 - val.Transform.position; if (((Vector3)(ref val2)).sqrMagnitude < 16f) { ServerPick(req.Id, val); SaveVault(); return; } } if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.Transform) && _chest.id != 0 && req.Id == _chest.id) { val2 = _chest.pos - val.Transform.position; if (((Vector3)(ref val2)).sqrMagnitude < 25f) { OpenChest(val); } } }), true); networkManager.SceneManager.OnClientLoadedStartScenes += delegate(NetworkConnection conn, bool asServer) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (!asServer) { return; } SendVault(conn); foreach (KeyValuePair drop in _drops) { InstanceFinder.ServerManager.Broadcast(conn, new LootEvent { Id = drop.Key, What = LootWhat.Drop, Pos = drop.Value.Item3, Gear = drop.Value.Item1, Rarity = drop.Value.Item2 }, true, (Channel)0); } if (_chest.id != 0) { InstanceFinder.ServerManager.Broadcast(conn, new LootEvent { Id = _chest.id, What = LootWhat.Chest, Pos = _chest.pos }, true, (Channel)0); } foreach (KeyValuePair scale in _scales) { InstanceFinder.ServerManager.Broadcast(conn, new LootEvent { Id = scale.Key, What = LootWhat.Scales, Pos = scale.Value.Item1, Data = scale.Value.Item2.ToString() }, true, (Channel)0); } }; networkManager.ServerManager.OnServerConnectionState += delegate(ServerConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { _drops.Clear(); _scales.Clear(); _chest = default((int, Vector3, int)); } }; networkManager.ClientManager.OnClientConnectionState += delegate(ClientConnectionStateArgs a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)a.ConnectionState == 1) { ClearViews(); } }; } if (InstanceFinder.IsServerStarted && Time.time >= _nextTick) { _nextTick = Time.time + 0.2f; ServerTick(); } if (_unsent && Time.time >= _nextSend) { SendChange(); } AnimateViews(); DrawScalesHud(); } private static void BackupSave(string save) { if (!BackedUp.Add(save)) { return; } try { string text = Path.Combine(Paths.BepInExRootPath, "fortress-backups"); Directory.CreateDirectory(text); string text2 = string.Concat(save.Select((char c) => (!Path.GetInvalidFileNameChars().Contains(c)) ? c : '_')); string text3 = DateTime.Now.ToString("yyyyMMdd-HHmmss"); string path = Path.Combine(Application.persistentDataPath, "Saves"); string[] array = (Directory.Exists(path) ? Directory.GetFiles(path, save + ".txt", SearchOption.AllDirectories) : new string[0]); foreach (string text4 in array) { File.Copy(text4, Path.Combine(text, text2 + "-" + text3 + "-" + Path.GetFileName(Path.GetDirectoryName(text4)) + ".txt"), overwrite: true); } if (File.Exists(FilePath(save))) { File.Copy(FilePath(save), Path.Combine(text, text2 + "-" + text3 + "-vault.txt"), overwrite: true); } foreach (string item in (from f in Directory.GetFiles(text, text2 + "-*") orderby f descending select f).Skip(10)) { File.Delete(item); } } catch (Exception ex) { BuildSystem.Log.LogWarning((object)("Save backup failed: " + ex.Message)); } } private static string FilePath(string save) { return Path.Combine(Paths.BepInExRootPath, "fortress-vault", Safe(save) + ".txt"); } private static string Safe(string save) { return string.Concat(save.Select((char c) => (!Path.GetInvalidFileNameChars().Contains(c)) ? c : '_')); } private void EnsureLoaded() { string text = SaveManager.CurServerSave?.Name; if (!string.IsNullOrEmpty(text) && !(text == _loadedFor)) { _loadedFor = text; BackupSave(text); string text2 = ReadSafely(FilePath(text)); Vault = ((text2 != null) ? VaultData.Read(text2) : new VaultData()); BuildSystem.Log.LogInfo((object)$"Vault for save '{text}': {Vault.Owned.Values.Sum()} gear and weapons, {Vault.Items.Count} of the game's items, {Vault.SlotsUsed}/{Vault.StorageSlots} slots, {Vault.Fortress.Count} fortress slots in use."); SendVault(null); } } internal void SaveVault() { if (string.IsNullOrEmpty(_loadedFor)) { return; } if (!InstanceFinder.IsServerStarted) { FlushVault(); return; } _unsent = true; if (Time.time >= _nextSend) { SendChange(); } } private void SendChange() { _unsent = false; _nextSend = Time.time + 0.5f; SendVault(null); } internal bool FlushVault() { if (string.IsNullOrEmpty(_loadedFor)) { return false; } bool num = WriteSafely(FilePath(_loadedFor), Vault.Write()); if (!num) { BuildSystem.Log.LogError((object)("The vault of '" + _loadedFor + "' couldn't be written: the last good one is kept.")); } return num; } public static bool WriteSafely(string path, string text) { string text2 = path + ".tmp"; try { Directory.CreateDirectory(Path.GetDirectoryName(path)); File.WriteAllText(text2, text); if (File.ReadAllText(text2) != text) { return false; } if (!File.Exists(path)) { File.Move(text2, path); } else { File.Replace(text2, path, string.IsNullOrWhiteSpace(File.ReadAllText(path)) ? null : (path + ".backup")); } return true; } catch (Exception ex) { ManualLogSource log = BuildSystem.Log; if (log != null) { log.LogWarning((object)("Writing " + path + ": " + ex.Message)); } return false; } finally { try { if (File.Exists(text2)) { File.Delete(text2); } } catch (Exception) { } } } public static string ReadSafely(string path) { string[] array = new string[2] { path, path + ".backup" }; foreach (string text in array) { try { string text2 = (File.Exists(text) ? File.ReadAllText(text) : null); if (string.IsNullOrWhiteSpace(text2)) { continue; } if (text != path) { ManualLogSource log = BuildSystem.Log; if (log != null) { log.LogWarning((object)(path + " is missing or empty: read its backup instead.")); } } return text2; } catch (Exception ex) { ManualLogSource log2 = BuildSystem.Log; if (log2 != null) { log2.LogWarning((object)("Reading " + text + ": " + ex.Message)); } } } return null; } internal static void ArchiveVault(string save) { try { string text = FilePath(save); string text2 = Path.Combine(Paths.BepInExRootPath, "fortress-backups"); if (Object.op_Implicit((Object)(object)Instance) && Instance._loadedFor == save) { Instance._loadedFor = null; Instance.Vault = new VaultData(); } if (File.Exists(text)) { Directory.CreateDirectory(text2); File.Move(text, Path.Combine(text2, $"deleted-{Safe(save)}-{DateTime.Now:yyyyMMdd-HHmmss}-vault.txt")); if (File.Exists(text + ".backup")) { File.Delete(text + ".backup"); } BuildSystem.Log.LogInfo((object)("Save '" + save + "' deleted: its vault moved to " + text2 + ".")); } } catch (Exception ex) { BuildSystem.Log.LogWarning((object)("Archiving the vault of '" + save + "': " + ex.Message)); } } private void SendVault(NetworkConnection to) { if (InstanceFinder.IsServerStarted) { VaultState vaultState = new VaultState { Data = Vault.Write(forClients: true) }; if (to != (NetworkConnection)null) { InstanceFinder.ServerManager.Broadcast(to, vaultState, true, (Channel)0); } else { InstanceFinder.ServerManager.Broadcast(vaultState, true, (Channel)0); } } } private static void Broadcast(LootEvent e) { if (InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(e, true, (Channel)0); } } public void ServerNewRound() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) _roundDrops = 0; EnsureLoaded(); FortressIsland instance = FortressIsland.Instance; if (!WeaponItems.Ready || !Object.op_Implicit((Object)(object)instance) || !instance.Exists) { return; } Vector3 circle = instance.Center + FortressIsland.ReadyLocal; bool flag = false; bool flag2 = false; int n = 0; foreach (List<(Gear, Rarity)> value in Vault.Personal.Values) { foreach (var item2 in value.Where(((Gear, Rarity) x) => GearCatalog.IsWeapon(x.Item1)).ToList()) { Wait(WeaponItems.ServerSpawn(item2.Item1, item2.Item2, Spot())); value.Remove(item2); flag = true; } } foreach (Player item3 in PlayerManager.Players.Where((Player p) => Object.op_Implicit((Object)(object)p))) { ulong item = KeyOf(item3); if (!Vault.Starter.Contains(item) && !WeaponItems.Carries(item3)) { Vault.Starter.Add(item); Wait(WeaponItems.ServerSpawn(Gear.Rocket, Rarity.Common, Spot())); flag = (flag2 = true); AutoTest.Count("starter_weapon"); } } if (flag) { SaveVault(); } if (flag2) { Fx.Announce("starterWeapon"); } Vector3 Spot() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) return circle + Quaternion.Euler(0f, 40f * (float)n++, 0f) * Vector3.forward * 3f + Vector3.up * 0.8f; } } public static float DropChance(EnemyKind kind, bool elite, int wave, int roundDrops, float luck) { float num = (EnemyCatalog.IsBoss(kind) ? 1f : (elite ? EliteDrop : NormalDrop)); if (roundDrops == 0 && wave >= 2) { num = 1f; } return num * Mathf.Max(1f, luck); } public void ServerOnKill(Vector3 pos, EnemyKind kind, bool elite, int killerId, int wave) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Player val = ((IEnumerable)PlayerManager.Players).FirstOrDefault((Func)((Player p) => Object.op_Implicit((Object)(object)p) && ((NetworkBehaviour)p).ObjectId == killerId)); float num = DropChance(kind, elite, wave, _roundDrops, Object.op_Implicit((Object)(object)val) ? Vault.PersonalValue(KeyOf(val), Gear.LuckyCharm) : 0f); if (EnemyCatalog.IsBoss(kind)) { ServerUnlockRandom(val); } if (elite && !EnemyCatalog.IsBoss(kind) && Random.value < 0.25f) { ServerDropScales(pos, 1, 1, 0f); } if (!(Random.value >= num)) { Rarity rarity = GearCatalog.Roll(wave, EnemyCatalog.IsBoss(kind) ? Rarity.Epic : Rarity.Common); if (Object.op_Implicit((Object)(object)val) && Perks.Legend(val, Gear.LuckyCharm) && (int)rarity < 3) { rarity++; Perks.Proc(Gear.LuckyCharm, pos); } Drop(GearCatalog.RandomGear(), rarity, pos); _roundDrops++; } } internal static bool Ground(Vector3 from, float depth, out Vector3 at) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) foreach (RaycastHit item in from h in Physics.RaycastAll(@from, Vector3.down, depth, LayerMask.op_Implicit(GameInfo.LevelLayer)) orderby ((RaycastHit)(ref h)).distance select h) { RaycastHit current = item; if (!BuildSystem.IsWall(((RaycastHit)(ref current)).collider) && !(((Object)((Component)((RaycastHit)(ref current)).collider).gameObject).name == "FortressCore")) { at = ((RaycastHit)(ref current)).point; return true; } } at = from; return false; } private void Drop(Gear g, Rarity r, Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0042: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (Ground(pos + Vector3.up * 2f, 40f, out var at)) { pos = at + Vector3.up * 0.5f; } pos.y = Mathf.Max(pos.y, WaterManager.GetWaterHeight(pos) + 0.3f); if (GearCatalog.IsWeapon(g)) { Item val = WeaponItems.ServerSpawn(g, r, pos + Vector3.up * 0.5f); if (val != null && Object.op_Implicit((Object)(object)val)) { _lootWeapons.Add(val); AutoTest.Count("loot_dropped"); return; } } int num = _nextId++; _drops[num] = (g, r, pos, Time.time + 90f); Broadcast(new LootEvent { Id = num, What = LootWhat.Drop, Pos = pos, Gear = g, Rarity = r }); AutoTest.Count("loot_dropped"); } public bool ServerUnlockRandom(Player who) { EnsureLoaded(); List list = (from PieceType t in Enum.GetValues(typeof(PieceType)) where !Vault.CanBuild(t) select t).ToList(); if (list.Count == 0) { return false; } PieceType item = list[Random.Range(0, list.Count)]; Vault.Unlocked.Add(item); SaveVault(); Broadcast(new LootEvent { What = LootWhat.Blueprint, Who = (Object.op_Implicit((Object)(object)who) ? NameOf(who) : ""), Data = item.ToString() }); Fx.Announce("blueprintBanner"); AutoTest.Count("blueprints"); return true; } public void ServerSpawnChest(int wave) { //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_0046: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (!((Object)(object)instance == (Object)null) && instance.Exists) { if (_chest.id != 0) { OpenChest(null); } Ground(instance.Center + new Vector3(3.5f, 4f, -3f), 10f, out var at); _chest = (id: _nextId++, pos: at, wave: wave); Broadcast(new LootEvent { Id = _chest.id, What = LootWhat.Chest, Pos = at }); Fx.Announce("chestBanner"); AutoTest.Count("chests"); } } public static List<(Gear, Rarity)> ChestRoll(int wave) { int num = 2 + ((wave >= 10) ? 1 : 0) + ((wave >= 20) ? 1 : 0); List<(Gear, Rarity)> list = new List<(Gear, Rarity)>(); for (int i = 0; i < num; i++) { list.Add((GearCatalog.RandomGear(), GearCatalog.Roll(wave + 5))); } return list; } private void OpenChest(Player who) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) List<(Gear, Rarity)> list = ChestRoll(_chest.wave); bool flag = Random.value < 0.3f || AutoTest.ForceGameItem; if (flag && !AutoTest.ForceGameItem && Random.value < 0.5f) { list.Add((GameGuns[Random.Range(0, GameGuns.Length)], GearCatalog.Roll(_chest.wave + 5))); flag = false; } int num = 0; foreach (var item2 in list) { if (GearCatalog.IsWeapon(item2.Item1)) { Item val = WeaponItems.ServerSpawn(item2.Item1, item2.Item2, _chest.pos + Quaternion.Euler(0f, 90f * (float)num++, 0f) * Vector3.forward * 0.8f + Vector3.up * 1.2f); if (val != null && Object.op_Implicit((Object)(object)val)) { _lootWeapons.Add(val); continue; } } ServerStore(item2.Item1, item2.Item2); } ServerDropScales(_chest.pos, 2 + Mathf.Clamp(_chest.wave / 10, 0, 6), 3, 1.6f); SaveVault(); if (_chest.wave >= 10 && (Random.value < 0.6f || AutoTest.ForceGameItem)) { ServerUnlockRandom(who); } string item = ""; if (flag) { string text = GameItems[Random.Range(0, GameItems.Length)]; Item spawnable = GameInfo.GetSpawnable(text); if (Object.op_Implicit((Object)(object)spawnable)) { Item val2 = Object.Instantiate(spawnable, _chest.pos + Vector3.up * 1.2f, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); ((NetworkBehaviour)Server.Instance).Spawn(((Component)val2).gameObject, (NetworkConnection)null, default(Scene)); item = text + ":0"; AutoTest.Count("game_item_" + text); } } Broadcast(new LootEvent { Id = _chest.id, What = LootWhat.ChestGone, Pos = _chest.pos, Who = (Object.op_Implicit((Object)(object)who) ? NameOf(who) : ""), Data = Pack(list), Item = item }); _chest = default((int, Vector3, int)); AutoTest.Count("chests_opened"); } public void ServerCollectAll() { int num = _scales.Values.Sum(((Vector3 pos, int n) x) => x.n); foreach (int item in _scales.Keys.ToList()) { ServerPickScales(item, null); } if (num > 0) { Broadcast(new LootEvent { What = LootWhat.ScalesGone, Data = num.ToString(), Who = "*" }); } List<(Gear, Rarity)> list = _drops.Values.Select(((Gear g, Rarity r, Vector3 pos, float until) d) => (g: d.g, r: d.r)).ToList(); foreach (int item2 in _drops.Keys.ToList()) { Broadcast(new LootEvent { Id = item2, What = LootWhat.DropGone }); } _drops.Clear(); if (list.Count > 0) { foreach (var item3 in list) { ServerStore(item3.Item1, item3.Item2); } SaveVault(); Broadcast(new LootEvent { What = LootWhat.Leftovers, Data = Pack(list) }); } if (_chest.id != 0) { OpenChest(null); } } private bool ServerStore(Gear g, Rarity r) { if (Vault.Fits(g, r)) { Vault.Add(g, r); return true; } Vault.Scales += GearCatalog.SalvageScales[(uint)r]; Broadcast(new LootEvent { What = LootWhat.Overflow, Gear = g, Rarity = r, Data = Vault.StorageSlots.ToString() }); AutoTest.Count("overflow_salvaged"); return false; } public static int BossScales(int wave) { return 6 + 3 * Mathf.Clamp(wave / 10, 1, 10); } public void ServerDropScales(Vector3 at, int total, int pieces, float spread) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00bc: 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_0117: 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_009e: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (total <= 0) { return; } pieces = Mathf.Clamp(pieces, 1, total); for (int i = 0; i < pieces; i++) { int item = total / pieces + ((i < total % pieces) ? 1 : 0); Vector3 val = at + Quaternion.Euler(0f, (float)i * 360f / (float)pieces + Random.Range(-20f, 20f), 0f) * Vector3.forward * ((pieces == 1) ? 0f : Random.Range(spread * 0.4f, spread)); if (Ground(val + Vector3.up * 3f, 40f, out var at2)) { val = at2 + Vector3.up * 0.35f; } val.y = Mathf.Max(val.y, WaterManager.GetWaterHeight(val) + 0.3f); int num = _nextId++; _scales[num] = (val, item); Broadcast(new LootEvent { Id = num, What = LootWhat.Scales, Pos = val, Data = item.ToString() }); } AutoTest.Count("scales_dropped", total); } private void ServerPickScales(int id, Player p, string who = "") { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (_scales.TryGetValue(id, out (Vector3, int) value)) { _scales.Remove(id); Vault.Scales += value.Item2; Broadcast(new LootEvent { Id = id, What = LootWhat.ScalesGone, Pos = value.Item1, Data = value.Item2.ToString(), Who = (Object.op_Implicit((Object)(object)p) ? NameOf(p) : who) }); if (Object.op_Implicit((Object)(object)p)) { AutoTest.Count("scales_picked", value.Item2); } } } private void ServerPick(int id, Player p) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (_drops.TryGetValue(id, out (Gear, Rarity, Vector3, float) value)) { _drops.Remove(id); ServerStore(value.Item1, value.Item2); Broadcast(new LootEvent { Id = id, What = LootWhat.DropGone, Pos = value.Item3, Gear = value.Item1, Rarity = value.Item2, Who = NameOf(p) }); AutoTest.Count("loot_picked"); } } private void ServerTick() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0246: 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) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) EnsureLoaded(); foreach (KeyValuePair item in _drops.Where((KeyValuePair kv) => Time.time > kv.Value.until).ToList()) { _drops.Remove(item.Key); Broadcast(new LootEvent { Id = item.Key, What = LootWhat.DropGone }); } bool flag = false; foreach (Player alivePlayer in PlayerManager.AlivePlayers) { if (!Object.op_Implicit((Object)(object)alivePlayer) || !Object.op_Implicit((Object)(object)alivePlayer.Transform)) { continue; } Vector3 pos = alivePlayer.Transform.position; foreach (KeyValuePair item2 in _drops.Where(delegate(KeyValuePair kv) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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) Vector3 val2 = kv.Value.pos - pos; return ((Vector3)(ref val2)).sqrMagnitude < 1.44f; }).ToList()) { ServerPick(item2.Key, alivePlayer); flag = true; } foreach (KeyValuePair item3 in _scales.Where(delegate(KeyValuePair kv) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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) Vector3 val2 = kv.Value.pos - pos; return ((Vector3)(ref val2)).sqrMagnitude < 2.25f; }).ToList()) { ServerPickScales(item3.Key, alivePlayer); flag = true; } foreach (Item item4 in _lootWeapons.ToList()) { if (!Object.op_Implicit((Object)(object)item4) || item4.IsDestroying || !((NetworkBehaviour)item4).IsSpawned || Object.op_Implicit((Object)(object)item4.Holder) || Object.op_Implicit((Object)(object)item4.SyncedHolder) || item4.IsInInventory) { _lootWeapons.Remove(item4); continue; } Vector3 val = ((Component)item4).transform.position - pos; if (!(((Vector3)(ref val)).sqrMagnitude >= 1.44f) && WeaponItems.Is(item4, out var g, out var r) && Vault.Fits(g, r)) { _lootWeapons.Remove(item4); Vault.Add(g, r); Broadcast(new LootEvent { What = LootWhat.DropGone, Pos = ((Component)item4).transform.position, Gear = g, Rarity = r, Who = NameOf(alivePlayer) }); item4.DestroyItem((byte)0, byte.MaxValue); AutoTest.Count("weapon_auto_stored"); flag = true; } } } if (flag) { SaveVault(); } } private void Wait(Item it) { if (Object.op_Implicit((Object)(object)it)) { _helpersWait[it] = Time.time + 180f; } } private bool FitsVault(Item it) { if (!WeaponItems.AsFortress(it, out var g, out var r)) { return Vault.FitsItem(it.ID); } return Vault.Fits(g, r); } public List ServerLying() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (Time.time < _nextLying || !Object.op_Implicit((Object)(object)instance) || !instance.Exists) { return _lying; } _nextLying = Time.time + 0.5f; _lying.Clear(); foreach (KeyValuePair drop in _drops) { _lying.Add(new Lying { Id = drop.Key, Pos = drop.Value.Item3 }); } foreach (KeyValuePair scale in _scales) { _lying.Add(new Lying { Id = scale.Key, Pos = scale.Value.Item1 }); } HashSet hashSet = new HashSet(FortressNet.Instance.ServerCorpses()); foreach (Item item in (from kv in _helpersWait where !Object.op_Implicit((Object)(object)kv.Key) || Time.time >= kv.Value select kv.Key).ToList()) { _helpersWait.Remove(item); } Dictionary dictionary = new Dictionary(); foreach (Item value2 in ItemManager.Items.Values) { if (!Object.op_Implicit((Object)(object)value2) || !instance.OnIsland(((Component)value2).transform.position, 40f) || !Storable(value2) || (Object.op_Implicit((Object)(object)value2.RigidbodySync) && value2.RigidbodySync.OnBoat) || (Object.op_Implicit((Object)(object)value2.Creature) && hashSet.Contains(value2.Creature)) || _helpersWait.ContainsKey(value2) || !FitsVault(value2)) { continue; } Vector3 position = ((Component)value2).transform.position; (float, Vector3) obj; if (_still.TryGetValue(value2, out (float, Vector3) value)) { Vector3 val = value.Item2 - position; if (((Vector3)(ref val)).sqrMagnitude < 0.25f) { obj = value; goto IL_02b3; } } obj = (Time.time, position); goto IL_02b3; IL_02b3: (float, Vector3) tuple = (dictionary[value2] = obj); if (Time.time - tuple.Item1 >= 15f) { _lying.Add(new Lying { Item = value2, Pos = position }); } } _still = dictionary; return _lying; } public bool ServerHelperPick(object key, Vector3 basket) { //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_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_00e2: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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_01d7: Unknown result type (might be due to invalid IL or missing references) EnsureLoaded(); (Vector3, int) value2; if (key is int num && _drops.TryGetValue(num, out (Gear, Rarity, Vector3, float) value)) { _drops.Remove(num); ServerStore(value.Item1, value.Item2); Broadcast(new LootEvent { Id = num, What = LootWhat.DropGone, Pos = value.Item3, Gear = value.Item1, Rarity = value.Item2, Who = "\u0001helper" }); Fx.Send(FxKind.Scoop, value.Item3, basket); } else if (key is int num2 && _scales.TryGetValue(num2, out value2)) { ServerPickScales(num2, null, "\u0001helper"); Fx.Send(FxKind.Scoop, value2.Item1, basket); } else { Item val = (Item)((key is Item) ? key : null); if (val == null || !Storable(val) || !FitsVault(val)) { return false; } Vector3 position = ((Component)val).transform.position; if (WeaponItems.AsFortress(val, out var g, out var r)) { Vault.Add(g, r); Broadcast(new LootEvent { What = LootWhat.DropGone, Pos = position, Gear = g, Rarity = r, Who = "\u0001helper" }); } else { SavedItem val2 = SavedOf(val); if (val2 == null) { return false; } Vault.AddItem(new StoredItem { Saved = val2, Dead = (Object.op_Implicit((Object)(object)val.Creature) && val.Creature.IsDead) }); } Fx.Send(FxKind.Scoop, position, basket); val.DestroyItem((byte)0, byte.MaxValue); } SaveVault(); return true; } public void ServerRequest(Player who, VaultRequest req) { if (!Object.op_Implicit((Object)(object)who)) { return; } EnsureLoaded(); if ((req.Action == VaultAction.Expand && req.Count != Vault.BoughtOf((Expansion)req.Slot)) || (req.Action == VaultAction.Enhance && req.Count != Vault.EnhanceOf(req.Gear))) { return; } ulong num = KeyOf(who); if (req.Action == VaultAction.Mod && req.Count != (byte)Vault.ModOf(num, req.Gear, req.Slot)) { return; } if (req.Action == VaultAction.Deposit) { if (!ServerDeposit(who, req.Gear, req.Rarity)) { return; } } else if (req.Action == VaultAction.Take) { if (!ServerTake(who, req.Gear, req.Rarity, Mathf.Max(1, (int)req.Count), req.Into - 1)) { return; } } else if (req.Action == VaultAction.TakeItem) { if (!ServerTakeItem(who, req.Item, Mathf.Max(1, (int)req.Count), req.Into - 1)) { return; } } else if (req.Action == VaultAction.StoreSlot) { if (!ServerStoreSlot(who, req.Slot)) { return; } } else if (req.Action == VaultAction.Buy) { if (!ServerBuy(who, req.Gear)) { return; } } else if (req.Action == VaultAction.BuyItem) { if (!ServerBuyItem(who, req.Item)) { return; } } else if (req.Action == VaultAction.SellAll) { if (!ServerSellAll(req.Slot, (req.Count == 1) ? ((Rarity?)null) : new Rarity?(req.Rarity))) { return; } } else if (!Vault.Apply(req.Action, req.Gear, req.Rarity, req.Slot, num)) { return; } if (req.Action == VaultAction.EquipPersonal || req.Action == VaultAction.Mod) { Vault.Names[num] = NameOf(who); } SaveVault(); } private bool ServerDeposit(Player who, Gear g, Rarity r) { if (!GearCatalog.IsWeapon(g) || !Object.op_Implicit((Object)(object)who.Inventory)) { return false; } Item held = (Object.op_Implicit((Object)(object)who.Holding) ? who.Holding.HeldItem : null); Item val = ((IEnumerable)who.Inventory._items.Values).FirstOrDefault((Func)((Item i) => Match(i) && (Object)(object)i != (Object)(object)held)) ?? (Match(held) ? held : null); if (!Object.op_Implicit((Object)(object)val) || !Vault.Fits(g, r)) { return false; } who.Inventory.RemoveItem(val); val.DestroyItem((byte)0, byte.MaxValue); Vault.Add(g, r); AutoTest.Count("weapon_racked"); return true; bool Match(Item i) { if (Object.op_Implicit((Object)(object)i) && !i.IsDestroying && WeaponItems.Is(i, out var g2, out var r2) && g2 == g) { return r2 == r; } return false; } } public void ServerDepositThrown(Item item, Gear g, Rarity r, Vector3 into) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)item) && !item.IsDestroying && !Swallow.IsGoing(item)) { EnsureLoaded(); if (!Vault.Fits(g, r)) { VaultFullNotice(); return; } Vault.Add(g, r); Swallow.Server(item, into, Gulp.Forge); AutoTest.Count("weapon_racked"); SaveVault(); } } public void ServerStoreThrown(Item item, Vector3 into) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (!Storable(item)) { return; } EnsureLoaded(); if (WeaponItems.AsFortress(item, out var g, out var r)) { if (!Vault.Fits(g, r)) { VaultFullNotice(); return; } Vault.Add(g, r); } else { SavedItem val = SavedOf(item); if (val == null) { return; } if (!Vault.FitsItem(item.ID)) { VaultFullNotice(); return; } Vault.AddItem(new StoredItem { Saved = val, Dead = (Object.op_Implicit((Object)(object)item.Creature) && item.Creature.IsDead) }); } Swallow.Server(item, into, Gulp.Vault); AutoTest.Count("vault_stored"); SaveVault(); } internal static bool Storable(Item item) { if (Object.op_Implicit((Object)(object)item) && ((NetworkBehaviour)item).IsSpawned && !item.IsDestroying && !((NetworkBehaviour)item).IsDeinitializing && !Swallow.IsGoing(item) && !Object.op_Implicit((Object)(object)item.Holder) && !Object.op_Implicit((Object)(object)item.SyncedHolder) && !item.IsInInventory && !Object.op_Implicit((Object)(object)item.BirdHolder) && !Object.op_Implicit((Object)(object)item.AttachedRod) && !Object.op_Implicit((Object)(object)item.DeadPlayer) && !item.IsQuestItem && (!Object.op_Implicit((Object)(object)item.Creature) || item.Creature.IsDead) && (!HandedOut.TryGetValue(item, out var value) || !(Time.time < value))) { return !Weapons.OnLine(item); } return false; } private static void JustOut(Item item) { if (!Object.op_Implicit((Object)(object)item)) { return; } foreach (Item item2 in (from kv in HandedOut where !Object.op_Implicit((Object)(object)kv.Key) || Time.time > kv.Value select kv.Key).ToList()) { HandedOut.Remove(item2); } HandedOut[item] = Time.time + 4f; } internal static SavedItem SavedOf(Item item) { try { object? obj = ToSaved?.Invoke(null, new object[2] { (byte)0, item }); return (SavedItem)((obj is SavedItem) ? obj : null); } catch (Exception ex) { BuildSystem.Log.LogWarning((object)("Can't store " + ((Object)item).name + ": " + ex.GetBaseException().Message)); return null; } } private void VaultFullNotice() { if (!(Time.time < _nextFull)) { _nextFull = Time.time + 5f; Fx.Announce("vaultFullNotice", Vault.StorageSlots); } } private static Vector3 AtFeet(Player who) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)who) || !Object.op_Implicit((Object)(object)who.Transform)) { return HandOut(0); } return who.Transform.position + Vector3.up * 1.2f + new Vector3(Random.Range(-0.2f, 0.2f), 0f, Random.Range(-0.2f, 0.2f)); } private static void GiveTo(Player who, Item it, int slot = -1) { if (Object.op_Implicit((Object)(object)who) && Object.op_Implicit((Object)(object)it) && InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(((NetworkBehaviour)who).Owner, new LootEvent { What = LootWhat.Give, Id = ((NetworkBehaviour)it).ObjectId, Data = ((slot >= 0) ? slot.ToString() : "") }, true, (Channel)0); } } internal static void HandToEat(Player who, Item it) { if (Object.op_Implicit((Object)(object)who) && Object.op_Implicit((Object)(object)it) && InstanceFinder.IsServerStarted) { InstanceFinder.ServerManager.Broadcast(((NetworkBehaviour)who).Owner, new LootEvent { What = LootWhat.Give, Id = ((NetworkBehaviour)it).ObjectId, Data = "eat" }, true, (Channel)0); } } private bool ServerStoreSlot(Player who, byte slot) { Item val = default(Item); if (!Object.op_Implicit((Object)(object)who.Inventory) || !who.Inventory._items.TryGetValue(slot, ref val) || !Object.op_Implicit((Object)(object)val) || val.IsDestroying || val.IsQuestItem || Object.op_Implicit((Object)(object)val.DeadPlayer) || (Object.op_Implicit((Object)(object)val.Creature) && !val.Creature.IsDead)) { return false; } EnsureLoaded(); if (WeaponItems.AsFortress(val, out var g, out var r)) { if (!Vault.Fits(g, r)) { VaultFullNotice(); return false; } Vault.Add(g, r); } else { SavedItem val2 = SavedOf(val); if (val2 == null) { return false; } if (!Vault.FitsItem(val.ID)) { VaultFullNotice(); return false; } Vault.AddItem(new StoredItem { Saved = val2, Dead = (Object.op_Implicit((Object)(object)val.Creature) && val.Creature.IsDead) }); } who.Inventory.RemoveItem(val); val.DestroyItem((byte)0, byte.MaxValue); AutoTest.Count("hotbar_stored"); return true; } private static Vector3 HandOut(int desk) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; return ((desk == 1) ? instance.SmithyCounter : (instance.VaultDoor + Vector3.up * 0.9f)) + new Vector3(Random.Range(-0.35f, 0.35f), Random.Range(0f, 0.3f), Random.Range(-0.35f, 0.35f)); } private bool ServerTake(Player who, Gear g, Rarity r, int n, int slot = -1) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (!GearCatalog.IsWeapon(g) || Vault.Count(g, r) < 1 || !Object.op_Implicit((Object)(object)instance) || !instance.Exists) { return false; } n = Mathf.Min(n, Vault.Count(g, r)); int num = 0; for (int i = 0; i < n; i++) { Item val = WeaponItems.ServerSpawn(g, r, AtFeet(who)); if (val != null && Object.op_Implicit((Object)(object)val)) { JustOut(val); GiveTo(who, val, (i == 0) ? slot : (-1)); num++; } } Vault.Add(g, r, -num); AutoTest.Count("weapon_taken", num); return num > 0; } public static int ShopPrice(Gear g) { return Siege.Money(GearCatalog.IsSpecial(g) ? 5000 : 300); } public static int UnlockBest(Gear g) { if (g != Gear.Gatling) { return 10; } return 80; } public static bool ForSale(Gear g, VaultData v) { if (GearCatalog.IsSpecial(g)) { return v.Best >= UnlockBest(g); } return true; } public static int ActiveShopPrice(int best) { return Siege.Money(150 * (10 + Mathf.Max(0, best)) / 10); } public static int ShopPrice(Gear g, VaultData v) { if (!GearCatalog.IsActive(g)) { return ShopPrice(g); } return ActiveShopPrice(v.Best); } public static bool Buyable(Gear g, VaultData v) { if (!GearCatalog.IsWeapon(g)) { if (GearCatalog.IsActive(g)) { return v.Fits(g, Rarity.Common); } return false; } return ForSale(g, v); } private bool ServerBuy(Player who, Gear g) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (!Buyable(g, Vault) || !Object.op_Implicit((Object)(object)instance) || !instance.Exists || !Siege.Instance.ServerTrySpend(ShopPrice(g, Vault), always: true)) { return false; } if (GearCatalog.IsActive(g)) { Vault.Add(g, Rarity.Common); } else { Item val = WeaponItems.ServerSpawn(g, Rarity.Common, AtFeet(who)); if (val != null && Object.op_Implicit((Object)(object)val)) { JustOut(val); GiveTo(who, val); } } AutoTest.Count("weapon_bought"); return true; } private static List FindExplosives() { Dictionary all = typeof(GameInfo).GetField("_allItems", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) as Dictionary; List list = ((all == null) ? new List() : (from id in (from i in all.Values where i is Explosive select i.ID).Distinct() orderby id select id).ToList()); if (list.Count > 0) { BuildSystem.Log.LogInfo((object)("The smithy sells the game's explosives: " + string.Join(", ", list.Select((byte id) => $"{id} {((Object)all[id]).name} ${ItemPrice(id)}")))); } else if (!_noneLogged && all != null && all.Count > 0) { _noneLogged = true; BuildSystem.Log.LogWarning((object)$"No explosive among the game's {all.Count} items: the smithy sells none."); } return list; } public static int ItemPrice(byte id) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) Item spawnable = GameInfo.GetSpawnable(id); if (spawnable == null || !Object.op_Implicit((Object)(object)spawnable)) { return 0; } if ((int)spawnable.Currency != 0 || spawnable.Cost <= 0) { return Mathf.Max(Siege.Money(10), 2 * spawnable.DefaultWorth); } return spawnable.Cost; } private bool ServerBuyItem(Player who, byte id) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; Item spawnable = GameInfo.GetSpawnable(id); if (!ShopItems.Contains(id) || !Object.op_Implicit((Object)(object)spawnable) || !Object.op_Implicit((Object)(object)instance) || !instance.Exists || !Siege.Instance.ServerTrySpend(ItemPrice(id), always: true)) { return false; } Item val = Object.Instantiate(spawnable, AtFeet(who), Quaternion.identity, Server.Instance.DynamicObjectsHolder); ((NetworkBehaviour)Server.Instance).Spawn(((Component)val).gameObject, (NetworkConnection)null, default(Scene)); JustOut(val); GiveTo(who, val); AutoTest.Count("item_bought"); return true; } private bool ServerSellAll(int tab, Rarity? colour) { //IL_0060: 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) FortressIsland instance = FortressIsland.Instance; if (!Object.op_Implicit((Object)(object)instance) || !instance.Exists) { return false; } var (num, _, num2) = Vault.SellAll(tab, colour, ItemWorth); if (num2 == 0) { return false; } Siege.Instance.ServerPay(num); Fx.Send(FxKind.Sell, instance.VaultDoor, instance.VaultDoor, 0, num); AutoTest.Count("vault_sold", num2); return true; } private static int ItemWorth(StoredItem s) { Item spawnable = GameInfo.GetSpawnable(s.Id); if (!Object.op_Implicit((Object)(object)spawnable) || WorthField == null) { return 0; } SavedItem saved = s.Saved; float num = ((saved.Weight > 0f) ? saved.Weight : 1f); return (int)((float)(int)((float)(int)WorthField.GetValue(spawnable) * num * GameInfo.CooknessWorthCurve.Evaluate(saved.Cookness) * saved.BettingMultiplier) * saved.KillScoreMultiplier); } private bool ServerTakeItem(Player who, byte id, int n, int slot = -1) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) FortressIsland instance = FortressIsland.Instance; if (Vault.CountItem(id) < 1 || !Object.op_Implicit((Object)(object)instance) || !instance.Exists) { return false; } int num = 0; for (int i = 0; i < n; i++) { StoredItem storedItem = Vault.TakeItem(id); if (storedItem == null) { break; } Item val = Spawn(storedItem, AtFeet(who)); if (Object.op_Implicit((Object)(object)val)) { JustOut(val); GiveTo(who, val, (i == 0) ? slot : (-1)); num++; continue; } Vault.AddItem(storedItem); break; } AutoTest.Count("item_taken", num); return num > 0; } internal static Item Spawn(StoredItem s, Vector3 at) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) Item spawnable = GameInfo.GetSpawnable(s.Id); if (!Object.op_Implicit((Object)(object)spawnable)) { return null; } Item val = Object.Instantiate(spawnable, at, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), Server.Instance.DynamicObjectsHolder); val.LoadFromSave(s.Saved); if (Object.op_Implicit((Object)(object)val.Creature)) { if (s.Dead) { val.Creature.ServerKillOnSpawn(); } if (s.Saved.IsDripCreature) { val.Creature.SetDrip(); } } ((NetworkBehaviour)Server.Instance).Spawn(((Component)val).gameObject, (NetworkConnection)null, default(Scene)); return val; } public int ServerClearDrops() { int result = _drops.Count + _scales.Count + ((_chest.id != 0) ? 1 : 0); _drops.Clear(); _scales.Clear(); _chest = default((int, Vector3, int)); Broadcast(new LootEvent { What = LootWhat.Cleared }); return result; } public bool ServerRecord(int waves) { EnsureLoaded(); if (waves <= Vault.Best) { return false; } Vault.Best = waves; SaveVault(); return true; } public void ServerWin(string team) { EnsureLoaded(); Vault.Wins.Add((DateTime.Now.ToString("yyyy-MM-dd"), team)); SaveVault(); } public void ServerWipeVaultForTest() { string text = SaveManager.CurServerSave?.Name; if (!string.IsNullOrEmpty(text)) { string[] array = new string[2] { FilePath(text), FilePath(text) + ".backup" }; foreach (string path in array) { if (File.Exists(path)) { File.Delete(path); } } } _loadedFor = null; EnsureLoaded(); } public void DebugDrop(Gear g, Rarity r, Vector3 pos) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) Drop(g, r, pos); } public void DebugEquip(Player who, Gear g, Rarity r) { EnsureLoaded(); List<(Gear, Rarity)> list = Vault.Slots(KeyOf(who)); if (GearCatalog.IsActive(g)) { Vault.Add(g, r); } else if (GearCatalog.IsFortress(g)) { Vault.Fortress.RemoveAll(((Gear, Rarity) f) => f.Item1 == g); Vault.Fortress.Add((g, r)); } else { list.RemoveAll(((Gear, Rarity) s) => GearCatalog.SlotKind(s.Item1) == GearCatalog.SlotKind(g)); list.Add((g, r)); } SaveVault(); } public void DebugBest(int waves) { EnsureLoaded(); Vault.Best = waves; SaveVault(); } public void ServerGive(Gear g, Rarity r, int n = 1) { EnsureLoaded(); Vault.Add(g, r, n); SaveVault(); } private void OnLoot(LootEvent e) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_0462: 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_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) switch (e.What) { case LootWhat.Drop: if (!_dropViews.ContainsKey(e.Id)) { _dropViews[e.Id] = MakeDropView(e.Id, e.Pos, e.Gear, e.Rarity); } break; case LootWhat.DropGone: { if (_dropViews.TryGetValue(e.Id, out var value2)) { Object.Destroy((Object)(object)value2); _dropViews.Remove(e.Id); } if (!string.IsNullOrEmpty(e.Who)) { ChatManager.ChatMessage(L10n.T("lootPicked", (e.Who == "\u0001helper") ? L10n.T("helperWho") : e.Who, GearCatalog.Label(e.Gear, e.Rarity))); Fx.Sound(((int)e.Rarity >= 2) ? "QuestReceived" : "PickupGrab", e.Pos, 1f, (AudioDistance)2); if (Object.op_Implicit((Object)(object)Player.LocalPlayer) && e.Who == NameOf(Player.LocalPlayer)) { GearCards.Instance.ShowGear(e.Gear, e.Rarity); } } break; } case LootWhat.Chest: if (Object.op_Implicit((Object)(object)_chestView)) { Object.Destroy((Object)(object)_chestView); } _chestView = MakeChestView(e.Id, e.Pos); break; case LootWhat.ChestGone: { if (Object.op_Implicit((Object)(object)_chestView)) { Object.Destroy((Object)(object)_chestView); } ChatManager.ChatMessage(string.IsNullOrEmpty(e.Who) ? L10n.T("chestAuto", Labels(e.Data)) : L10n.T("chestOpened", e.Who, Labels(e.Data))); string[] array = (e.Item ?? "").Split(':'); if (array.Length == 2 && int.TryParse(array[1], out var result2)) { ChatManager.ChatMessage(L10n.T("chestGameItem", "[" + GearCatalog.RarityName((Rarity)result2) + "] " + L10n.T("item_" + array[0]) + "")); } Fx.Sound("CasinoWinEpic", e.Pos, 1f, (AudioDistance)3); GearCards.Instance.ShowChest(Unpack(e.Data).ToList(), (array.Length == 2 && int.TryParse(array[1], out var result3)) ? (L10n.T("item_" + array[0]) + "|" + result3) : null); break; } case LootWhat.Blueprint: { if (Enum.TryParse(e.Data, out var result4)) { ChatManager.ChatMessage(L10n.T(string.IsNullOrEmpty(e.Who) ? "blueprintFoundTeam" : "blueprintFound", e.Who, BuildSystem.PieceName(result4, 1))); } break; } case LootWhat.Give: { ((MonoBehaviour)this).StartCoroutine(TakeInHand(e.Id, int.TryParse(e.Data, out var result5) ? result5 : (-1), e.Data == "eat")); break; } case LootWhat.Scales: if (!_scaleViews.ContainsKey(e.Id)) { _scaleViews[e.Id] = MakeScaleView(e.Pos, (!int.TryParse(e.Data, out var result)) ? 1 : result); } break; case LootWhat.ScalesGone: { if (_scaleViews.TryGetValue(e.Id, out var value)) { Object.Destroy((Object)(object)value); _scaleViews.Remove(e.Id); } if (e.Who == "*") { ChatManager.ChatMessage(L10n.T("scalesSwept", e.Data)); } else if (!string.IsNullOrEmpty(e.Who)) { ((MonoBehaviour)this).StartCoroutine(FloatText(e.Pos + Vector3.up * 0.6f, "+" + e.Data + " ◆")); Fx.Sound("PickupGrab", e.Pos, 1f, (AudioDistance)2); } break; } case LootWhat.Cleared: foreach (GameObject value3 in _dropViews.Values) { if (Object.op_Implicit((Object)(object)value3)) { Object.Destroy((Object)(object)value3); } } _dropViews.Clear(); foreach (GameObject value4 in _scaleViews.Values) { if (Object.op_Implicit((Object)(object)value4)) { Object.Destroy((Object)(object)value4); } } _scaleViews.Clear(); if (Object.op_Implicit((Object)(object)_chestView)) { Object.Destroy((Object)(object)_chestView); } break; case LootWhat.Leftovers: ChatManager.ChatMessage(L10n.T("lootLeftovers", Labels(e.Data))); break; case LootWhat.Overflow: ChatManager.ChatMessage(L10n.T("lootOverflow", e.Data, GearCatalog.Label(e.Gear, e.Rarity), GearCatalog.SalvageScales[(uint)e.Rarity])); break; } } public static string DropModel(Gear g) { if (GearCatalog.IsWeapon(g)) { return Weapons.ModelName(g); } return g switch { Gear.WarChest => "Chest", Gear.Decoy => "Decoy", Gear.BigNet => "HandNetBag", _ => "Gear" + g, }; } private static GameObject MakeDropView(int id, Vector3 pos, Gear g, Rarity r) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_00a0: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FortressLoot"); val.transform.position = pos; Transform transform = new GameObject("Spin").transform; transform.SetParent(val.transform, false); GameObject val2 = Models.Attach(DropModel(g), transform, Vector3.one * 0.4f); MeshFilter component = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sharedMesh)) { Bounds bounds = component.sharedMesh.bounds; float num = (((int)r >= 2) ? 0.75f : 0.6f) / Mathf.Max(0.05f, Mathf.Max(((Bounds)(ref bounds)).size.x, Mathf.Max(((Bounds)(ref bounds)).size.y, ((Bounds)(ref bounds)).size.z))); val2.transform.localScale = Vector3.one * num; val2.transform.localPosition = -((Bounds)(ref bounds)).center * num; } else { Models.Paint(val2, GearCatalog.Color(r)); } if (!BeamMats.TryGetValue(r, out var value)) { value = (BeamMats[r] = Models.Make(GearCatalog.Color(r), GearCatalog.Color(r) * 1.2f)); } Part((PrimitiveType)2, val.transform, new Vector3(0f, -0.42f, 0f), new Vector3(0.7f, 0.01f, 0.7f), value); RarityGem rarityGem = val.AddComponent(); rarityGem.Rarity = r; rarityGem.Height = 0.75f; GameObject val4 = new GameObject("Grab"); val4.SetActive(false); val4.transform.SetParent(val.transform, false); val4.layer = LayerMask.NameToLayer("Interactable"); val4.tag = "Interactable"; SphereCollider val5 = val4.AddComponent(); val5.radius = 0.55f; LootGrab lootGrab = val4.AddComponent(); lootGrab.Id = id; lootGrab.Gear = g; lootGrab.Rarity = r; AccessTools.Field(typeof(Interactable), "_interactCol").SetValue(lootGrab, val5); AccessTools.Field(typeof(Interactable), "_textTarget").SetValue(lootGrab, val.transform); AccessTools.Field(typeof(Interactable), "_modelsToOutline").SetValue(lootGrab, new GameObject[1] { val2 }); val4.SetActive(true); return val; } private static void Part(PrimitiveType type, Transform parent, Vector3 at, Vector3 scale, Material m) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive(type); Object.Destroy((Object)(object)obj.GetComponent()); obj.transform.SetParent(parent, false); obj.transform.localPosition = at; obj.transform.localScale = scale; Renderer component = obj.GetComponent(); component.sharedMaterial = m; component.shadowCastingMode = (ShadowCastingMode)0; } private static GameObject MakeChestView(int id, Vector3 pos) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0089: 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) GameObject val = new GameObject("FortressChest"); val.transform.position = pos; GameObject val2 = Models.Attach("Chest", val.transform, new Vector3(1f, 0.7f, 0.7f), new Vector3(0f, 0.35f, 0f)); GameObject val3 = new GameObject("Grab"); val3.SetActive(false); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = new Vector3(0f, 0.4f, 0f); val3.layer = LayerMask.NameToLayer("Interactable"); val3.tag = "Interactable"; BoxCollider val4 = val3.AddComponent(); val4.size = new Vector3(1.2f, 0.9f, 0.9f); LootGrab lootGrab = val3.AddComponent(); lootGrab.Id = id; lootGrab.Chest = true; AccessTools.Field(typeof(Interactable), "_interactCol").SetValue(lootGrab, val4); AccessTools.Field(typeof(Interactable), "_textTarget").SetValue(lootGrab, val.transform); AccessTools.Field(typeof(Interactable), "_modelsToOutline").SetValue(lootGrab, new GameObject[1] { val2.gameObject }); val3.SetActive(true); return val; } private static GameObject MakeScaleView(Vector3 pos, int n) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FortressScales"); val.transform.position = pos; Transform transform = new GameObject("Spin").transform; transform.SetParent(val.transform, false); if (!Object.op_Implicit((Object)(object)_scaleMat)) { _scaleMat = BossVfx.Glow(new Color(0.25f, 0.62f, 1f), 6f); } int num = Mathf.Clamp(n, 1, 3); for (int i = 0; i < num; i++) { Transform obj = WeaponFx.Piece(WeaponFx.Ball, _scaleMat, transform); obj.localPosition = new Vector3(((float)i - (float)(num - 1) * 0.5f) * 0.16f, (float)i * 0.04f, (float)(i % 2) * 0.08f); obj.localRotation = Quaternion.Euler(25f + 15f * (float)i, 40f * (float)i, 10f); obj.localScale = new Vector3(0.4f, 0.05f, 0.29f); } return val; } private static IEnumerator TakeInHand(int objectId, int slot = -1, bool eat = false) { for (float t = 0f; t < 3f; t += 0.1f) { Player me = Player.LocalPlayer; ClientManager clientManager = InstanceFinder.ClientManager; if (Object.op_Implicit((Object)(object)me) && (Object)(object)clientManager != (Object)null && ((ManagedObjects)clientManager.Objects).Spawned.TryGetValue(objectId, out var value) && Object.op_Implicit((Object)(object)value)) { Item it = ((Component)value).GetComponent(); if (it != null && Object.op_Implicit((Object)(object)it) && !Object.op_Implicit((Object)(object)it.Holder) && !it.IsInInventory) { bool into = slot >= 0 && Object.op_Implicit((Object)(object)me.Inventory) && SlotEmpty(me, slot); Item before = (Object.op_Implicit((Object)(object)me.Holding) ? me.Holding.HeldItem : null); if ((into || eat) && Object.op_Implicit((Object)(object)me.Holding) && Object.op_Implicit((Object)(object)me.Holding.HeldItem)) { me.Inventory.LocalTrySelectSlot(-1); yield return null; } try { it.PickUp(me, true, true); } catch (Exception ex) { BuildSystem.Log.LogWarning((object)("Couldn't hand over " + ((Object)it).name + ": " + ex.Message)); break; } if (eat) { yield return EatHeld(me, it, before); } else { if (!into) { break; } for (float w = 0f; w < 2f; w += Time.deltaTime) { if ((Object)(object)me.Holding.HeldItem == (Object)(object)it && !Object.op_Implicit((Object)(object)me.Holding.UninitializedHeldItem)) { break; } yield return null; } yield return (object)new WaitForSeconds(0.15f); if ((Object)(object)me.Holding.HeldItem == (Object)(object)it && SlotEmpty(me, slot)) { me.Inventory.LocalTrySelectSlot(slot); AutoTest.Count("hotbar_into"); } } break; } } yield return (object)new WaitForSeconds(0.1f); } } private static IEnumerator EatHeld(Player me, Item food, Item before) { for (float w = 0f; w < 2f; w += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)me)) { break; } if ((Object)(object)me.Holding.HeldItem == (Object)(object)food && !Object.op_Implicit((Object)(object)me.Holding.UninitializedHeldItem)) { break; } yield return null; } PlayerEating eating = (Object.op_Implicit((Object)(object)me) ? ((Component)me).GetComponentInChildren(true) : null); if (!Object.op_Implicit((Object)(object)eating) || !Object.op_Implicit((Object)(object)food) || (Object)(object)me.Holding.HeldItem != (Object)(object)food) { yield break; } yield return (object)new WaitForSeconds(0.2f); try { StartEatingMethod?.Invoke(eating, null); } catch (Exception ex) { BuildSystem.Log.LogWarning((object)("Couldn't start eating: " + ex.Message)); yield break; } AutoTest.Count("food_eating"); for (float w = 0f; w < 8f; w += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)food)) { break; } if (food.IsDestroying) { break; } yield return null; } if (!Object.op_Implicit((Object)(object)before) || !Object.op_Implicit((Object)(object)me) || !Object.op_Implicit((Object)(object)me.Inventory) || Object.op_Implicit((Object)(object)me.Holding.HeldItem)) { yield break; } foreach (KeyValuePair item in me.Inventory._items) { if ((Object)(object)item.Value == (Object)(object)before) { me.Inventory.LocalTrySelectSlot((int)item.Key); break; } } } private static bool SlotEmpty(Player me, int slot) { Item val = default(Item); if (me.Inventory._items.TryGetValue((byte)slot, ref val)) { return !Object.op_Implicit((Object)(object)val); } return true; } private static IEnumerator FloatText(Vector3 at, string text) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Floating.RemoveAll((GameObject x) => !Object.op_Implicit((Object)(object)x)); if (!Object.op_Implicit((Object)(object)Hud.Font) || Floating.Count >= (ClientSettings.Reduced ? 3 : 8)) { yield break; } GameObject go = new GameObject("FortressFloatText"); Floating.Add(go); TextMeshPro t = go.AddComponent(); ((TMP_Text)t).font = Hud.Font; ((TMP_Text)t).text = text; ((TMP_Text)t).fontSize = 6f; ((TMP_Text)t).alignment = (TextAlignmentOptions)514; ((TMP_Text)t).fontStyle = (FontStyles)1; ((TMP_Text)t).outlineWidth = 0.2f; ((TMP_Text)t).outlineColor = new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue); for (float s = 0f; s < 1.2f; s += Time.deltaTime) { if (!Object.op_Implicit((Object)(object)go)) { break; } go.transform.position = at + Vector3.up * s * 1.2f; Camera curCamera = GameInfo.CurCamera; if (Object.op_Implicit((Object)(object)curCamera)) { go.transform.rotation = Quaternion.LookRotation(go.transform.position - ((Component)curCamera).transform.position); } ((TMP_Text)t).alpha = Mathf.Clamp01((1.2f - s) / 0.4f); yield return null; } Object.Destroy((Object)(object)go); } private void DrawScalesHud() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0161: 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) if (!Object.op_Implicit((Object)(object)Hud.Font) || !Object.op_Implicit((Object)(object)FortressIsland.Instance) || !FortressIsland.Instance.Exists || !Object.op_Implicit((Object)(object)Player.LocalPlayer) || Hud.ModalOpen) { if (Object.op_Implicit((Object)(object)_scalesHud)) { ((Component)_scalesHud).gameObject.SetActive(false); } return; } if (!Object.op_Implicit((Object)(object)_scalesHud)) { _scalesHud = Hud.Label(Hud.Root, "", 26f, Vector2.zero, new Vector2(48f, 182f), new Vector2(300f, 36f), (TextAlignmentOptions)513, Color.white, bold: true, outline: true, Vector2.zero); } ((Component)_scalesHud).gameObject.SetActive(true); int scales = ClientVault.Scales; if (scales != _scalesShown) { if (_scalesShown >= 0 && scales > _scalesShown) { _scalesBump = 1f; } _scalesShown = scales; ((TMP_Text)_scalesHud).text = string.Format("◆ {0} {1}", scales, L10n.T("scalesName")); } _scalesBump = Mathf.MoveTowards(_scalesBump, 0f, Time.deltaTime * 2.5f); ((TMP_Text)_scalesHud).transform.localScale = Vector3.one * (1f + 0.25f * _scalesBump); } private void AnimateViews() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_012e: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; foreach (KeyValuePair scaleView in _scaleViews) { if (Object.op_Implicit((Object)(object)scaleView.Value)) { Transform child = scaleView.Value.transform.GetChild(0); child.localPosition = Vector3.up * (0.1f * Mathf.Sin(time * 3f + (float)scaleView.Key)); child.localRotation = Quaternion.Euler(0f, time * 90f + (float)scaleView.Key * 53f, 0f); } } foreach (KeyValuePair dropView in _dropViews) { if (Object.op_Implicit((Object)(object)dropView.Value)) { Transform child2 = dropView.Value.transform.GetChild(0); child2.localPosition = Vector3.up * (0.15f * Mathf.Sin(time * 2.5f + (float)dropView.Key)); child2.localRotation = Quaternion.Euler(0f, time * 70f + (float)dropView.Key * 37f, 0f); } } } private void ClearViews() { foreach (GameObject value in _dropViews.Values) { if (Object.op_Implicit((Object)(object)value)) { Object.Destroy((Object)(object)value); } } _dropViews.Clear(); foreach (GameObject value2 in _scaleViews.Values) { if (Object.op_Implicit((Object)(object)value2)) { Object.Destroy((Object)(object)value2); } } _scaleViews.Clear(); if (Object.op_Implicit((Object)(object)_chestView)) { Object.Destroy((Object)(object)_chestView); } ClientVault = new VaultData(); } } public class LootGrab : Interactable { public int Id; public Gear Gear; public Rarity Rarity; public bool Chest; private string _text; public override void Hover() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (!base._isHovering) { _text = (Chest ? (L10n.T("chestName") + "\n" + L10n.T("chestOpen") + " " + SpriteManager.GetPickUpInput()) : (GearCatalog.Label(Gear, Rarity) + "\n" + L10n.T("lootPickUp") + " " + SpriteManager.GetPickUpInput())); PlayerUI.SetLookAtText(_text, ((Interactable)this).TextTarget, default(Vector3), false); } ((Interactable)this).Hover(); } public override void UnHover() { PlayerUI.HideLookAtText(_text); ((Interactable)this).UnHover(); } public override void Interact(Player player) { ((Interactable)this).Interact(player); if (!((Object)(object)player != (Object)(object)Player.LocalPlayer) && InstanceFinder.IsClientStarted) { ((Interactable)this).UnHover(); InstanceFinder.ClientManager.Broadcast(new LootPick { Id = Id }, (Channel)0); } } protected override void OnDestroy() { PlayerUI.HideLookAtText(_text); ((Interactable)this).OnDestroy(); } } [HarmonyPatch] internal static class VaultSaves { [HarmonyPostfix] [HarmonyPatch(typeof(SaveManager), "SaveServer", new Type[] { typeof(bool) })] private static void Saved(bool autoSave) { if (Object.op_Implicit((Object)(object)Loot.Instance) && Loot.Instance.FlushVault() && !autoSave) { ChatManager.ChatMessage("" + L10n.T("vaultSaved") + ""); } } [HarmonyPostfix] [HarmonyPatch(typeof(SaveSystem), "DeleteServer")] private static void Deleted(string name) { Loot.ArchiveVault(name); } } public class Markers : MonoBehaviour { private class Mark { public RectTransform Root; public Image Dot; public Image Arrow; public TextMeshProUGUI Text; public CanvasGroup Group; public string Name; public int Metres = -1; public int Seen; public bool Down; public bool Edge = true; public Item Body; public float NextBody; public float NextText; } public static ConfigEntry Show; private static readonly Color Mate = new Color(0.45f, 0.85f, 1f); private readonly Dictionary _marks = new Dictionary(); private readonly HashSet _here = new HashSet(); private readonly List _gone = new List(); private float _nextSweep; private void LateUpdate() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) Camera curCamera = GameInfo.CurCamera; Player localPlayer = Player.LocalPlayer; FortressIsland instance = FortressIsland.Instance; bool num = (Show == null || Show.Value) && Object.op_Implicit((Object)(object)curCamera) && Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)Hud.Font) && (Object)(object)instance != (Object)null && instance.Exists && !Hud.ModalOpen && instance.OnIsland(((Component)curCamera).transform.position, 96f); int frameCount = Time.frameCount; if (num) { for (int i = 0; i < PlayerManager.Players.Count; i++) { Player val = PlayerManager.Players[i]; if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val == (Object)(object)localPlayer)) { Mark mark = Get(val); if (Place(mark, val, curCamera)) { mark.Seen = frameCount; } } } } foreach (KeyValuePair mark2 in _marks) { if (mark2.Value.Seen != frameCount && ((Component)mark2.Value.Root).gameObject.activeSelf) { ((Component)mark2.Value.Root).gameObject.SetActive(false); } } if (Time.time >= _nextSweep) { Sweep(); } } private void Sweep() { _nextSweep = Time.time + 2f; _here.Clear(); for (int i = 0; i < PlayerManager.Players.Count; i++) { if (Object.op_Implicit((Object)(object)PlayerManager.Players[i])) { _here.Add(((NetworkBehaviour)PlayerManager.Players[i]).ObjectId); } } _gone.Clear(); foreach (KeyValuePair mark in _marks) { if (!_here.Contains(mark.Key)) { _gone.Add(mark.Key); } } foreach (int item in _gone) { if (Object.op_Implicit((Object)(object)_marks[item].Root)) { Object.Destroy((Object)(object)((Component)_marks[item].Root).gameObject); } _marks.Remove(item); } } private Mark Get(Player p) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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) //IL_013f: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_0196: Unknown result type (might be due to invalid IL or missing references) if (_marks.TryGetValue(((NetworkBehaviour)p).ObjectId, out var value) && Object.op_Implicit((Object)(object)value.Root)) { return value; } value = new Mark { Name = Loot.NameOf(p) }; value.Root = Hud.Node(Hud.Root, "TeammateMark", new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(10f, 10f)); value.Group = ((Component)value.Root).gameObject.AddComponent(); value.Group.blocksRaycasts = false; value.Group.interactable = false; value.Dot = Hud.Box((Transform)(object)value.Root, new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(13f, 13f), Mate, 3f); ((Transform)((Graphic)value.Dot).rectTransform).localRotation = Quaternion.Euler(0f, 0f, 45f); value.Arrow = Hud.Icon((Transform)(object)value.Root, "Arrow", new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(30f, 30f), Mate); value.Text = Hud.Label((Transform)(object)value.Root, "", 17f, new Vector2(0.5f, 0.5f), new Vector2(0f, 20f), new Vector2(320f, 26f), (TextAlignmentOptions)1026, Mate, bold: true, outline: true); ((Behaviour)value.Dot).enabled = false; _marks[((NetworkBehaviour)p).ObjectId] = value; return value; } private static bool Place(Mark m, Player p, Camera cam) { //IL_003a: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0094: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) bool flag = Object.op_Implicit((Object)(object)p.Dying) && p.Dying.IsDead; Vector3 val2; if (flag) { Item val = Body(m, p); if (!Object.op_Implicit((Object)(object)val)) { return false; } val2 = ((Component)val).transform.position + Vector3.up * 0.9f; } else { if (!Object.op_Implicit((Object)(object)p.Transform) || !((Component)p.Transform).gameObject.activeInHierarchy) { return false; } val2 = p.Transform.position + Vector3.up * 2.25f; } Vector3 val3 = cam.WorldToViewportPoint(val2); float num = Vector3.Distance(((Component)cam).transform.position, val2); bool flag2 = val3.z <= 0f || val3.x < 0.03f || val3.x > 0.97f || val3.y < 0.05f || val3.y > 0.95f; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(val3.x, val3.y); if (flag2) { Vector2 val5 = default(Vector2); ((Vector2)(ref val5))..ctor(val3.x - 0.5f, val3.y - 0.5f); if (val3.z < 0f) { val5 = -val5; } if (((Vector2)(ref val5)).sqrMagnitude < 0.0001f) { val5 = Vector2.down; } ((Vector2)(ref val5)).Normalize(); float num2 = Mathf.Max(Mathf.Abs(val5.x) / 0.45f, Mathf.Abs(val5.y) / 0.42f); ((Vector2)(ref val4))..ctor(0.5f + val5.x / num2, 0.5f + val5.y / num2); ((Transform)((Graphic)m.Arrow).rectTransform).localRotation = Quaternion.Euler(0f, 0f, Mathf.Atan2(val5.y, val5.x) * 57.29578f + 180f); ((TMP_Text)m.Text).rectTransform.anchoredPosition = new Vector2((0f - val5.x) * 150f, (0f - val5.y) * 34f); } if (!((Component)m.Root).gameObject.activeSelf) { ((Component)m.Root).gameObject.SetActive(true); } Vector2 val6 = (m.Root.anchorMin = (m.Root.anchorMax = val4)); m.Root.anchoredPosition = Vector2.zero; if (flag2 != m.Edge) { m.Edge = flag2; ((Behaviour)m.Dot).enabled = !flag2; ((Behaviour)m.Arrow).enabled = flag2; if (!flag2) { ((TMP_Text)m.Text).rectTransform.anchoredPosition = new Vector2(0f, 20f); } } int num3 = Mathf.RoundToInt(num); if (flag != m.Down || (num3 != m.Metres && Time.time >= m.NextText)) { m.Down = flag; m.Metres = num3; m.NextText = Time.time + 0.25f; m.Name = Loot.NameOf(p); Color color = (flag ? Hud.Bad : Mate); ((TMP_Text)m.Text).text = (flag ? string.Format("{0} {1} {2}m", m.Name, L10n.T("mateDown"), num3) : $"{m.Name} {num3}m"); ((Graphic)m.Text).color = color; ((Graphic)m.Dot).color = color; ((Graphic)m.Arrow).color = color; } float num4 = 1f; if (flag) { num4 = 0.7f + 0.3f * Mathf.Sin(Time.time * 7f); } else if (!flag2) { num4 = Mathf.InverseLerp(3f, 7f, num); val6 = new Vector2(val3.x - 0.5f, val3.y - 0.5f); if (((Vector2)(ref val6)).sqrMagnitude < 0.0064f && num < 30f) { num4 = Mathf.Min(num4, 0.3f); } } m.Group.alpha = num4; return true; } private static Item Body(Mark m, Player p) { DeadPlayer val = (Object.op_Implicit((Object)(object)p.Dying) ? p.Dying.DeadPlayer : null); if (Object.op_Implicit((Object)(object)val)) { return (Item)(object)val; } if (Object.op_Implicit((Object)(object)m.Body) && Object.op_Implicit((Object)(object)m.Body.DeadPlayer) && (Object)(object)m.Body.DeadPlayer.Player == (Object)(object)p) { return m.Body; } if (Time.time < m.NextBody) { return null; } m.NextBody = Time.time + 0.5f; foreach (Item value in ItemManager.Items.Values) { if (Object.op_Implicit((Object)(object)value) && Object.op_Implicit((Object)(object)value.DeadPlayer) && (Object)(object)value.DeadPlayer.Player == (Object)(object)p) { m.Body = value; return value; } } return null; } } public static class Models { private class Model { public Mesh Mesh; public Color[] Colors; public Color[] Emits; public string[] Names; } internal class OwnMaterials : MonoBehaviour { public readonly List Mats = new List(); private void OnDestroy() { Renderer component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { BaseColors.Remove(component); Originals.Remove(component); } foreach (Material mat in Mats) { if (!Object.op_Implicit((Object)(object)mat)) { continue; } if (Swatch.TryGetValue(mat, out var value)) { if (Object.op_Implicit((Object)(object)value)) { Object.Destroy((Object)(object)value); } Swatch.Remove(mat); } Painted.Remove(mat); Object.Destroy((Object)(object)mat); } } } public static string Dir; private static readonly Dictionary Cache = new Dictionary(); private static Material _template; private static readonly Dictionary BaseColors = new Dictionary(); private static readonly Dictionary Originals = new Dictionary(); private static readonly Dictionary Swatch = new Dictionary(); private static readonly Dictionary Painted = new Dictionary(); private static readonly Dictionary Colliders = new Dictionary(); private static Material Template() { if (Object.op_Implicit((Object)(object)_template)) { return _template; } Material[] source = Resources.FindObjectsOfTypeAll(); _template = ((IEnumerable)source).FirstOrDefault((Func)((Material m) => Object.op_Implicit((Object)(object)m) && Object.op_Implicit((Object)(object)m.shader) && ((Object)m.shader).name == "Shader Graphs/DefaultShader")) ?? ((IEnumerable)source).FirstOrDefault((Func)((Material m) => Object.op_Implicit((Object)(object)m) && Object.op_Implicit((Object)(object)m.shader) && ((Object)m.shader).name.Contains("Lit") && m.shader.isSupported)); if (Object.op_Implicit((Object)(object)_template)) { Shader sh = _template.shader; IEnumerable values = from i in Enumerable.Range(0, sh.GetPropertyCount()) select sh.GetPropertyName(i) + ":" + ((object)sh.GetPropertyType(i)/*cast due to .constrained prefix*/).ToString(); BuildSystem.Log.LogInfo((object)("Material template '" + ((Object)_template).name + "' shader '" + ((Object)sh).name + "': " + string.Join(", ", values))); } else { BuildSystem.Log.LogWarning((object)"No game material found to copy; models may render magenta."); } return _template; } public static Material Make(Color color, Color emit = default(Color)) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Invalid comparison between Unknown and I4 //IL_010a: 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_00fc: 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_0107: Unknown result type (might be due to invalid IL or missing references) Material val = Template(); Material val2 = (Object.op_Implicit((Object)(object)val) ? new Material(val) : new Material(Shader.Find("Universal Render Pipeline/Lit"))); Texture2D val3 = new Texture2D(2, 2, (TextureFormat)4, false) { filterMode = (FilterMode)0, wrapMode = (TextureWrapMode)1 }; Swatch[val2] = val3; Shader shader = val2.shader; for (int i = 0; i < shader.GetPropertyCount(); i++) { string propertyName = shader.GetPropertyName(i); string text = propertyName.ToLowerInvariant(); if ((int)shader.GetPropertyType(i) == 4 && (text == "_colors" || text.Contains("main") || text.Contains("base") || text.Contains("albedo"))) { val2.SetTexture(propertyName, (Texture)(object)val3); } } if (((Color)(ref emit)).maxColorComponent > 0f) { if (val2.HasProperty("_Emission")) { val2.SetFloat("_Emission", 1f); } val2.EnableKeyword("_EMISSION"); color = Color.Lerp(color, emit, 0.5f); } SetMatColor(val2, color); return val2; } public static Color[] ColorsOf(Renderer r) { if (!BaseColors.TryGetValue(r, out var value)) { return (Color[])(object)new Color[0]; } return value; } public static void Recolor(Renderer r, int i, Color c) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (BaseColors.TryGetValue(r, out var value) && i < value.Length) { value[i] = c; } if (Originals.TryGetValue(r, out var value2) && i < value2.Length) { value2[i] = c; } Material[] sharedMaterials = r.sharedMaterials; if (i < sharedMaterials.Length && Object.op_Implicit((Object)(object)sharedMaterials[i])) { SetMatColor(sharedMaterials[i], c); } } internal static void SetMatColor(Material m, Color c) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_008e: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) if (!Painted.TryGetValue(m, out var value) || !(value == c)) { Painted[m] = c; if (Swatch.TryGetValue(m, out var value2) && Object.op_Implicit((Object)(object)value2)) { Color val = Color.Lerp(c, new Color(((Color)(ref c)).grayscale, ((Color)(ref c)).grayscale, ((Color)(ref c)).grayscale), 0.15f) * 0.9f; Color linear = ((Color)(ref val)).linear; value2.SetPixels((Color[])(object)new Color[4] { linear, linear, linear, linear }); value2.Apply(false); } if (m.HasProperty("_BaseColor")) { m.SetColor("_BaseColor", c); } if (m.HasProperty("_Color")) { m.SetColor("_Color", c); } } } public static GameObject Attach(string name, Transform parent, Vector3 fallbackSize, Vector3 fallbackOffset = default(Vector3)) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_013a: Unknown result type (might be due to invalid IL or missing references) Model model = Load(name); GameObject val; if (model != null) { val = new GameObject(name + "Model"); val.AddComponent().sharedMesh = model.Mesh; ((Renderer)val.AddComponent()).sharedMaterials = model.Colors.Select((Color c, int i) => Make(c, model.Emits[i])).ToArray(); } else { val = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)val.GetComponent()); val.transform.localScale = fallbackSize; val.GetComponent().sharedMaterial = Make(new Color(0.6f, 0.45f, 0.3f)); } val.AddComponent().Mats.AddRange(val.GetComponent().sharedMaterials); val.transform.SetParent(parent, false); val.transform.localPosition = ((model != null) ? Vector3.zero : fallbackOffset); val.layer = ((Component)parent).gameObject.layer; Renderer component = val.GetComponent(); Color[] array = (Color[])((model != null) ? ((Array)model.Colors.ToArray()) : ((Array)new Color[1] { new Color(0.6f, 0.45f, 0.3f) })); BaseColors[component] = array; Originals[component] = array.ToArray(); return val; } public static Mesh ColliderOf(string name, params string[] notSolid) { //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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown string key = name + "|" + string.Join(",", notSolid); if (Colliders.TryGetValue(key, out var value)) { return value; } Model model = Load(name); if (model == null) { return null; } Mesh src = model.Mesh; Mesh val = new Mesh { name = ((Object)src).name + "Collider", indexFormat = src.indexFormat }; val.SetVertices(src.vertices); val.SetTriangles((from i in Enumerable.Range(0, src.subMeshCount) where !notSolid.Contains(model.Names[i]) select i).SelectMany((int i) => src.GetTriangles(i)).ToArray(), 0); val.RecalculateBounds(); return Colliders[key] = val; } public static void Tint(GameObject root, float t) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = root.GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (BaseColors.TryGetValue(val, out var value)) { Material[] sharedMaterials = val.sharedMaterials; for (int j = 0; j < sharedMaterials.Length && j < value.Length; j++) { SetMatColor(sharedMaterials[j], Color.Lerp(new Color(0.5f, 0.08f, 0.08f), value[j], t)); } } } } public static void SetLevelLook(GameObject root, PieceType type, int level) { Renderer[] componentsInChildren = root.GetComponentsInChildren(); foreach (Renderer key in componentsInChildren) { if (Originals.TryGetValue(key, out var value)) { BaseColors[key] = value.Select((Color c) => LevelColor(c, type, level)).ToArray(); } } } private static Color LevelColor(Color c, PieceType type, int level) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (level <= 1) { return c; } float grayscale = ((Color)(ref c)).grayscale; if (Catalog.IsTurret(type)) { return Color.Lerp(c, new Color(1f, 0.85f, 0.45f), (level == 2) ? 0.08f : 0.16f); } Color val = ((level == 2) ? new Color(0.58f, 0.58f, 0.6f) : new Color(0.38f, 0.43f, 0.52f)); return Color.Lerp(new Color(grayscale, grayscale, grayscale), val, 0.75f) * (0.7f + grayscale); } public static void Paint(GameObject root, Color c) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = root.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] sharedMaterials = componentsInChildren[i].sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { SetMatColor(sharedMaterials[j], c); } } } private static Model Load(string name) { if (Cache.TryGetValue(name, out var value)) { return value; } Model model = null; string text = Path.Combine(Dir ?? "", name + ".obj"); if (File.Exists(text)) { try { model = Parse(text); } catch (Exception ex) { BuildSystem.Log.LogWarning((object)("Failed to load " + text + ": " + ex.Message)); } } else { BuildSystem.Log.LogWarning((object)("Model not found: " + text)); } Cache[name] = model; return model; } private static Model Parse(string path) { //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) CultureInfo inv = CultureInfo.InvariantCulture; List src = new List(); List list = new List(); List> list2 = new List>(); List list3 = new List(); int num = -1; foreach (string item in File.ReadLines(path)) { string[] array = item.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries); if (array.Length == 0) { continue; } if (array[0] == "v") { src.Add(new Vector3(0f - float.Parse(array[1], inv), float.Parse(array[2], inv), float.Parse(array[3], inv))); } else if (array[0] == "usemtl") { num = list3.IndexOf(array[1]); if (num < 0) { list3.Add(array[1]); list2.Add(new List()); num = list2.Count - 1; } } else if (array[0] == "f") { if (num < 0) { list3.Add("default"); list2.Add(new List()); num = 0; } int[] array2 = (from t in array.Skip(1) select int.Parse(t.Split('/')[0], inv) into i select (i <= 0) ? (src.Count + i) : (i - 1)).ToArray(); for (int num2 = 1; num2 + 1 < array2.Length; num2++) { int count = list.Count; list.Add(src[array2[0]]); list.Add(src[array2[num2 + 1]]); list.Add(src[array2[num2]]); list2[num].Add(count); list2[num].Add(count + 1); list2[num].Add(count + 2); } } } Mesh val = new Mesh { name = Path.GetFileNameWithoutExtension(path) }; if (list.Count > 65000) { val.indexFormat = (IndexFormat)1; } val.SetVertices(list); val.subMeshCount = list2.Count; for (int num3 = 0; num3 < list2.Count; num3++) { val.SetTriangles(list2[num3], num3); } val.RecalculateNormals(); val.RecalculateBounds(); var (kd, ke) = ParseMtl(Path.ChangeExtension(path, ".mtl")); Color value; return new Model { Mesh = val, Colors = list3.Select((string n) => (!kd.TryGetValue(n, out value)) ? Color.gray : value).ToArray(), Emits = list3.Select((string n) => (!ke.TryGetValue(n, out value)) ? Color.black : value).ToArray(), Names = list3.ToArray() }; } private static (Dictionary, Dictionary) ParseMtl(string path) { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) CultureInfo invariantCulture = CultureInfo.InvariantCulture; Dictionary dictionary = new Dictionary(); Dictionary dictionary2 = new Dictionary(); if (!File.Exists(path)) { return (dictionary, dictionary2); } string text = null; Color value = default(Color); foreach (string item in File.ReadLines(path)) { string[] array = item.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries); if (array.Length != 0) { if (array[0] == "newmtl") { text = array[1]; } else if (text != null && (array[0] == "Kd" || array[0] == "Ke") && array.Length >= 4) { ((Color)(ref value))..ctor(float.Parse(array[1], invariantCulture), float.Parse(array[2], invariantCulture), float.Parse(array[3], invariantCulture)); ((array[0] == "Kd") ? dictionary : dictionary2)[text] = value; } } } return (dictionary, dictionary2); } } public class Person : MonoBehaviour { public static readonly Vector3 Eyes = new Vector3(0f, 1.58f, 0f); private static readonly Dictionary Keepers = new Dictionary { ["Market"] = "_kioskLady", ["Smith"] = "_grillmaster", ["Vault"] = "_military", ["Lighthouse"] = "_lighthouseKeeper" }; private static readonly string[] HelperClothes = new string[8] { "_swampLady", "_tourist", "_scaredGuyInShorts", "_jacob", "_archer", "_andrei", "_gunStoreClerc", "_scientist" }; private Transform _body; private Transform _head; private Transform _armUL; private Transform _armLL; private Transform _armUR; private Transform _armLR; private Transform _legUL; private Transform _legLL; private Transform _legUR; private Transform _legLR; private Transform _mouth; private Transform[] _eyes = (Transform[])(object)new Transform[0]; private readonly Dictionary _rest = new Dictionary(); private Vector3 _bodyRest; private Transform _oBody; private Transform _oHead; private Transform _oArmL; private Transform _oArmR; private Transform _oLegL; private Transform _oLegR; private static GameObject _template; private static GameObject _holder; public GameObject[] Renderers => (from r in ((Component)this).GetComponentsInChildren(true) select ((Component)r).gameObject).ToArray(); public static Person Make(Transform parent, string id) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("Person" + id).transform; transform.SetParent(parent, false); Person person = ((Component)transform).gameObject.AddComponent(); bool flag = false; try { flag = person.Dress(id); } catch (Exception ex) { BuildSystem.Log.LogWarning((object)("Couldn't dress " + id + " in the game's body: " + ex)); } if (!flag) { foreach (Transform item in ((IEnumerable)transform).Cast().ToList()) { Object.DestroyImmediate((Object)(object)((Component)item).gameObject); } person._body = null; person.Modelled(id); } return person; } private static GameObject Template() { if (Object.op_Implicit((Object)(object)_template)) { return _template; } _template = (from r in Resources.FindObjectsOfTypeAll().Where(delegate(SkinnedMeshRenderer r) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)r) && Object.op_Implicit((Object)(object)r.sharedMesh) && ((Object)r.sharedMesh).name == "CharacterHead") { Scene scene = ((Component)r).gameObject.scene; if (!((Scene)(ref scene)).IsValid() && Object.op_Implicit((Object)(object)((Component)r).transform.parent) && Object.op_Implicit((Object)(object)((Component)r).transform.parent.Find("Armature"))) { return Object.op_Implicit((Object)(object)((Component)r).transform.parent.Find("Outfit")); } } return false; }) select ((Component)((Component)r).transform.parent).gameObject into c orderby c.GetComponentsInChildren(true).Any((SkinnedMeshRenderer h) => Object.op_Implicit((Object)(object)h.sharedMesh) && ((Object)h.sharedMesh).name == "LeftHand") descending select c).FirstOrDefault(); return _template; } private bool Dress(string id) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: 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_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0341: 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_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0351: 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_035b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Template(); object? value = AccessTools.Field(typeof(SkinManager), "_instance").GetValue(null); SkinManager val2 = (SkinManager)((value is SkinManager) ? value : null); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2)) { return false; } if (!Keepers.TryGetValue(id, out var value2)) { int result; int num = ((!int.TryParse(id.Replace("Helper", ""), out result)) ? 1 : Mathf.Max(1, result)); value2 = HelperClothes[(num - 1) % HelperClothes.Length]; } object? obj = AccessTools.Field(typeof(SkinManager), value2)?.GetValue(val2); Clothes val3 = (Clothes)((obj is Clothes) ? obj : null); if (!Object.op_Implicit((Object)(object)val3)) { return false; } if (!Object.op_Implicit((Object)(object)_holder)) { _holder = new GameObject("FortressPersonHolder"); _holder.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_holder); } GameObject val4 = Object.Instantiate(val, _holder.transform, false); ((Object)val4).name = "Character"; foreach (Component item in val4.GetComponentsInChildren(true).Reverse()) { if (Object.op_Implicit((Object)(object)item) && !(item is Transform) && !(item is SkinnedMeshRenderer)) { Object.DestroyImmediate((Object)(object)item); } } foreach (Transform item2 in (from t in val4.GetComponentsInChildren(true) where ((Object)t).name.Contains("Canvas") select t).ToList()) { if (Object.op_Implicit((Object)(object)item2)) { Object.DestroyImmediate((Object)(object)((Component)item2).gameObject); } } val4.SetActive(false); val4.transform.SetParent(((Component)this).transform, false); val4.transform.localPosition = Vector3.zero; val4.transform.localRotation = Quaternion.identity; val4.transform.localScale = val.transform.lossyScale; SkinnedMeshRenderer[] componentsInChildren = val4.GetComponentsInChildren(true); foreach (SkinnedMeshRenderer val5 in componentsInChildren) { Mesh val6 = ((((Object)val5).name == "Outfit") ? val3.OutfitMesh : ((((Object)val5).name == "Hat") ? val3.HatMesh : ((((Object)val5).name == "Accessory") ? val3.AccessoryMesh : val5.sharedMesh))); if (!Object.op_Implicit((Object)(object)val6)) { ((Component)val5).gameObject.SetActive(false); continue; } val5.sharedMesh = val6; Transform val7 = (Object.op_Implicit((Object)(object)val5.rootBone) ? val5.rootBone : ((Component)val5).transform); float num3 = Mathf.Max(0.001f, Mathf.Min(Mathf.Abs(val7.lossyScale.x), Mathf.Abs(((Component)val5).transform.lossyScale.x))); ((Renderer)val5).localBounds = new Bounds(Vector3.zero, Vector3.one * (5f / num3)); val5.updateWhenOffscreen = false; ShaderManager.SetPlayerColors((Renderer)(object)val5, Vector3.zero, default(Vector3), default(Vector3), default(Vector3)); } val4.SetActive(true); Dictionary bones = (from t in val4.GetComponentsInChildren(true) group t by ((Object)t).name).ToDictionary((IGrouping g) => g.Key, (IGrouping g) => g.First()); _body = B("Body"); _head = B("Head"); _mouth = B("MouthLower"); _armUL = B("ArmUpper_L"); _armLL = B("ArmLower_L"); _armUR = B("ArmUpper_R"); _armLR = B("ArmLower_R"); _legUL = B("LegUpper_L"); _legLL = B("LegLower_L"); _legUR = B("LegUpper_R"); _legLR = B("LegLower_R"); _eyes = ((IEnumerable)(object)new Transform[2] { B("Eye_L"), B("Eye_R") }).Where((Transform e) => Object.op_Implicit((Object)(object)e)).ToArray(); if (!Object.op_Implicit((Object)(object)_body) || !Object.op_Implicit((Object)(object)_head) || !Object.op_Implicit((Object)(object)_armUL) || !Object.op_Implicit((Object)(object)_armUR) || !Object.op_Implicit((Object)(object)_legUL) || !Object.op_Implicit((Object)(object)_legUR)) { Object.Destroy((Object)(object)val4); return false; } Stand(((IEnumerable)val4.GetComponentsInChildren(true)).FirstOrDefault((Func)((SkinnedMeshRenderer r) => Object.op_Implicit((Object)(object)r.sharedMesh) && ((Object)r.sharedMesh).name == "CharacterHead"))); return true; Transform B(string n) { if (!bones.TryGetValue(n, out var value3)) { return null; } return value3; } } private void Stand(SkinnedMeshRenderer head) { //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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_01bf: 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_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: 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_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)head) && Object.op_Implicit((Object)(object)head.sharedMesh) && head.sharedMesh.bindposes.Length == head.bones.Length) { Matrix4x4[] bindposes = head.sharedMesh.bindposes; foreach (var item3 in (from x in head.bones.Select((Transform b, int i) => (b: b, i: i)) where Object.op_Implicit((Object)(object)x.b) orderby Depth(x.b) select x).ToList()) { Transform item = item3.b; int item2 = item3.i; Matrix4x4 val = ((Component)head).transform.localToWorldMatrix * ((Matrix4x4)(ref bindposes[item2])).inverse; item.SetPositionAndRotation(Vector4.op_Implicit(((Matrix4x4)(ref val)).GetColumn(3)), ((Matrix4x4)(ref val)).rotation); } } Point(_legUL, C(-0.04f, -1f, 0f)); Point(_legLL, C(0f, -1f, 0f)); Point(_legUR, C(0.04f, -1f, 0f)); Point(_legLR, C(0f, -1f, 0f)); Point(_armUL, C(-0.22f, -1f, 0.04f)); Point(_armLL, C(-0.06f, -1f, 0.22f)); Point(_armUR, C(0.22f, -1f, 0.04f)); Point(_armLR, C(0.06f, -1f, 0.22f)); foreach (Transform item4 in from b in ((IEnumerable)(object)new Transform[11] { _body, _head, _mouth, _armUL, _armLL, _armUR, _armLR, _legUL, _legLL, _legUR, _legLR }).Concat(_eyes) where Object.op_Implicit((Object)(object)b) select b) { _rest[item4] = item4.localRotation; } _bodyRest = _body.localPosition; Transform val2 = ((Object.op_Implicit((Object)(object)_body.parent) && Object.op_Implicit((Object)(object)_body.parent.parent)) ? _body.parent.parent : _body.parent); float num = Low(); if (num < float.MaxValue && _eyes.Length != 0) { float num2 = _eyes.Average((Transform e) => e.position.y) - num; if (num2 > 0.3f) { val2.localScale *= Eyes.y / num2; } num = Low(); } if (num < float.MaxValue) { Transform body = _body; body.position += Vector3.up * (((Component)this).transform.position.y - num); } _bodyRest = _body.localPosition; Vector3 C(float x, float y, float z) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; Vector3 val3 = new Vector3(x, y, z); return transform.TransformDirection(((Vector3)(ref val3)).normalized); } float Low() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) float num3 = float.MaxValue; foreach (SkinnedMeshRenderer item5 in from r in ((Component)this).GetComponentsInChildren(true) where ((Component)r).gameObject.activeSelf && Object.op_Implicit((Object)(object)r.sharedMesh) select r) { Mesh val3 = new Mesh(); item5.BakeMesh(val3); Vector3[] vertices = val3.vertices; foreach (Vector3 val4 in vertices) { num3 = Mathf.Min(num3, ((Component)item5).transform.TransformPoint(val4).y); } Object.Destroy((Object)(object)val3); } return num3; } static void Point(Transform b, Vector3 dir) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)b)) { b.rotation = Quaternion.FromToRotation(b.up, dir) * b.rotation; } } } private static int Depth(Transform t) { int num = 0; while (Object.op_Implicit((Object)(object)t.parent)) { t = t.parent; num++; } return num; } private void Turn(Transform b, float degrees, Vector3 axis) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)b) && _rest.TryGetValue(b, out var value)) { Quaternion val = (Object.op_Implicit((Object)(object)b.parent) ? b.parent.rotation : Quaternion.identity) * value; b.localRotation = value * Quaternion.AngleAxis(degrees, Quaternion.Inverse(val) * ((Component)this).transform.TransformDirection(axis)); } } private void Reset(Transform b) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)b) && _rest.TryGetValue(b, out var value)) { b.localRotation = value; } } public void Pose(float walk, float stride, bool carry, float wave, float lookYaw, float lookPitch) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: 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_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041c: 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_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0385: 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_038b: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_body)) { PoseModelled(walk, stride, carry, wave, lookYaw, lookPitch); return; } foreach (Transform key in _rest.Keys) { Reset(key); } float num = Mathf.Sin(walk) * 30f * stride; Turn(_legUL, 0f - num, Vector3.right); Turn(_legUR, num, Vector3.right); Turn(_legLL, Mathf.Max(0f, Mathf.Sin(walk + 1.2f)) * 40f * stride, Vector3.right); Turn(_legLR, Mathf.Max(0f, 0f - Mathf.Sin(walk + 1.2f)) * 40f * stride, Vector3.right); if (carry) { Turn(_armUL, -72f, Vector3.right); Turn(_armUR, -72f, Vector3.right); Turn(_armLL, -18f, Vector3.right); Turn(_armLR, -18f, Vector3.right); } else { Turn(_armUL, num * 0.8f, Vector3.right); Turn(_armUR, (0f - num) * 0.8f, Vector3.right); Turn(_armLL, -8f - Mathf.Abs(num) * 0.3f, Vector3.right); Turn(_armLR, -8f - Mathf.Abs(num) * 0.3f, Vector3.right); } if (wave > 0f) { Quaternion val = Quaternion.AngleAxis((150f + Mathf.Sin(Time.time * 12f) * 15f) * wave, ((Component)this).transform.forward); Quaternion val2 = (Object.op_Implicit((Object)(object)_armUR.parent) ? _armUR.parent.rotation : Quaternion.identity) * _rest[_armUR]; _armUR.rotation = val * val2; Turn(_armLR, -25f * wave, Vector3.right); if (Object.op_Implicit((Object)(object)_mouth)) { Turn(_mouth, Mathf.Abs(Mathf.Sin(Time.time * 15f)) * 22f * wave, Vector3.right); } } Quaternion val3 = (Object.op_Implicit((Object)(object)_head.parent) ? _head.parent.rotation : Quaternion.identity) * _rest[_head]; _head.rotation = Quaternion.AngleAxis(lookYaw, ((Component)this).transform.up) * Quaternion.AngleAxis(lookPitch, ((Component)this).transform.right) * val3; Camera curCamera = GameInfo.CurCamera; Transform[] eyes = _eyes; foreach (Transform val4 in eyes) { Vector3 up = val4.up; Vector3 val5 = (Object.op_Implicit((Object)(object)curCamera) ? (((Component)curCamera).transform.position - val4.position) : up); if (Object.op_Implicit((Object)(object)curCamera) && ((Vector3)(ref val5)).magnitude < 7f) { val4.rotation = Quaternion.FromToRotation(up, Vector3.RotateTowards(up, ((Vector3)(ref val5)).normalized, 0.6981317f, 0f)) * val4.rotation; } } _body.localPosition = _bodyRest + _body.parent.InverseTransformVector(((Component)this).transform.up * (Mathf.Abs(Mathf.Sin(walk)) * 0.035f * stride + 0.006f * Mathf.Sin(Time.time * 2.1f))); } private void Modelled(string id) { //IL_0052: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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) int result; string part = (id.StartsWith("Helper") ? ("Helper" + ((((!int.TryParse(id.Substring(6), out result)) ? 1 : result) - 1) % 3 + 1)) : id); _oBody = Part("Body", Vector3.zero); _oHead = Part("Head", new Vector3(0f, 1.45f, 0f)); _oArmL = Part("ArmL", new Vector3(-0.19f, 1.38f, 0f)); _oArmR = Part("ArmR", new Vector3(0.19f, 1.38f, 0f)); _oLegL = Part("LegL", new Vector3(-0.085f, 0.92f, 0f)); _oLegR = Part("LegR", new Vector3(0.085f, 0.92f, 0f)); Transform Part(string name, Vector3 at) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject(name).transform; transform.SetParent(((Component)this).transform, false); transform.localPosition = at; Models.Attach("Person" + part + name, transform, Vector3.one * 0.2f); return transform; } } private void PoseModelled(float walk, float stride, bool carry, float wave, float lookYaw, float lookPitch) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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) if (Object.op_Implicit((Object)(object)_oBody)) { float num = Mathf.Sin(walk) * 28f * stride; _oLegL.localRotation = Quaternion.Euler(num, 0f, 0f); _oLegR.localRotation = Quaternion.Euler(0f - num, 0f, 0f); if (carry) { Transform oArmL = _oArmL; Quaternion localRotation = (_oArmR.localRotation = Quaternion.Euler(-60f, 0f, 0f)); oArmL.localRotation = localRotation; } else { _oArmL.localRotation = Quaternion.Euler((0f - num) * 0.8f, 0f, -6f); _oArmR.localRotation = Quaternion.Euler(num * 0.8f, 0f, 6f); } if (wave > 0f) { _oArmR.localRotation = Quaternion.Slerp(_oArmR.localRotation, Quaternion.Euler(0f, 0f, 150f + Mathf.Sin(Time.time * 12f) * 18f), wave); } _oHead.localRotation = Quaternion.Euler(lookPitch, lookYaw, 0f); _oBody.localPosition = Vector3.up * Mathf.Abs(Mathf.Sin(walk)) * 0.035f * stride; } } } public class PieceMenu : MonoBehaviour { public static PieceMenu Instance; private Canvas _canvas; private RectTransform _panel; private int _id; private string _drawn; private bool _confirmRemove; private bool _walkUp; public static int ClosedFrame = -10; private const float WalkOff = 6f; public static bool IsOpen { get; private set; } private void Awake() { Instance = this; } public void Open(int id, bool walkUp = false) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) _walkUp = walkUp; if (BuildSystem.Instance.TryGetState(id, out var _) && Object.op_Implicit((Object)(object)Hud.Font)) { _id = id; _drawn = null; _confirmRemove = false; IsOpen = true; ((Component)Hud.Canvas("FortressPieceMenu", 610, ref _canvas)).gameObject.SetActive(true); PlayerCamera.ToggleMouse(true); Fx.Sound("Click", Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Transform.position : Vector3.zero, 0.6f, (AudioDistance)1); } } public void Close() { if (IsOpen) { ClosedFrame = Time.frameCount; } IsOpen = false; if (Object.op_Implicit((Object)(object)_canvas)) { ((Component)_canvas).gameObject.SetActive(false); } PlayerCamera.ToggleMouse(false); } private void Update() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!IsOpen) { return; } Mouse current = Mouse.current; PieceState s; bool num = !BuildSystem.Instance.TryGetState(_id, out s); Player localPlayer = Player.LocalPlayer; int num2; if (_walkUp) { if (Object.op_Implicit((Object)(object)localPlayer) && Object.op_Implicit((Object)(object)localPlayer.Transform)) { Vector3 val = localPlayer.Transform.position - s.Pos; num2 = ((((Vector3)(ref val)).sqrMagnitude > 36f) ? 1 : 0); } else { num2 = 1; } } else { num2 = 0; } bool flag = (byte)num2 != 0; if (num || (!BuildSystem.Building && !_walkUp) || flag || !Object.op_Implicit((Object)(object)Siege.Instance) || !Siege.Instance.ViewActive || (current != null && current.rightButton.wasPressedThisFrame)) { Close(); return; } string text = $"{s.Level}|{s.Branch}|{s.Hp}|{s.MaxHp}|{Siege.Instance.ViewCoins}|{_confirmRemove}"; if (text != _drawn) { _drawn = text; Redraw(s); } } private void Redraw(PieceState s) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_0103: 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_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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031c: 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_037d: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_076c: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0434: 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_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_0988: Unknown result type (might be due to invalid IL or missing references) //IL_099c: Unknown result type (might be due to invalid IL or missing references) //IL_09ce: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Unknown result type (might be due to invalid IL or missing references) //IL_09ec: Unknown result type (might be due to invalid IL or missing references) //IL_0a00: Unknown result type (might be due to invalid IL or missing references) //IL_0a5f: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a7d: Unknown result type (might be due to invalid IL or missing references) //IL_0a91: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_panel)) { Object.Destroy((Object)(object)((Component)_panel).gameObject); } Vector2 anchor = default(Vector2); ((Vector2)(ref anchor))..ctor(0.5f, 0.5f); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 1f); bool flag = Catalog.HasBranches(s.Type) && s.Level == 2; float num = 150f + (flag ? 330f : 210f) + 90f; Image val2 = Hud.Box(((Component)_canvas).transform, anchor, Vector2.zero, new Vector2(4000f, 3000f), new Color(0f, 0f, 0f, 0.35f), 0f); ((Graphic)val2).raycastTarget = true; _panel = ((Graphic)val2).rectTransform; Transform transform = ((Component)Hud.Box((Transform)(object)_panel, anchor, new Vector2(0f, 30f), new Vector2(760f, num), Hud.PanelSolid, 24f)).transform; int viewCoins = Siege.Instance.ViewCoins; Hud.Picture(transform, PictureOf(s), new Vector2(0f, 1f), new Vector2(26f, -18f), new Vector2(80f, 80f), (Vector2?)new Vector2(0f, 1f)); string text = ((s.Branch > 0) ? (" " + L10n.T(Catalog.BranchKey(s.Type, s.Branch)) + "") : ""); string text2 = Catalog.Stars(s.Level); Hud.Label(transform, BuildSystem.PieceName(s.Type, s.Level) + text + " " + text2 + "", 32f, val, new Vector2(0f, -22f), new Vector2(720f, 44f), (TextAlignmentOptions)514, null, bold: true); float num2 = ((s.MaxHp > 0) ? ((float)s.Hp / (float)s.MaxHp) : 1f); Hud.Bar.Make(transform, val, new Vector2(-40f, -86f), new Vector2(460f, 16f), Hud.HealthColor(num2)).Set(num2); Hud.Label(transform, $"{s.Hp} / {s.MaxHp}", 22f, val, new Vector2(204f, -77f), new Vector2(160f, 34f), (TextAlignmentOptions)513, (Color?)Hud.Muted, bold: false, outline: false, (Vector2?)new Vector2(0f, 1f)); float num3 = -130f; int num4 = Perks.MyCost(Catalog.UpgradeCost(s.Type, s.Level)); if (flag) { for (int i = 1; i <= 2; i++) { int pick = i; Transform transform2 = ((Component)Hud.Box(transform, val, new Vector2((float)((i != 1) ? 1 : (-1)) * 182f, num3), new Vector2(350f, 312f), Hud.Raised, 18f, "Ui", val)).transform; Hud.Label(transform2, L10n.T(Catalog.BranchKey(s.Type, i)), 28f, val, new Vector2(0f, -14f), new Vector2(330f, 38f), (TextAlignmentOptions)514, Hud.Accent, bold: true); Hud.Label(transform2, L10n.T(Catalog.BranchKey(s.Type, i) + "_d"), 20f, val, new Vector2(0f, -54f), new Vector2(320f, 52f), (TextAlignmentOptions)514, Hud.Muted); Hud.Label(transform2, string.Join("\n", Deltas(s, 3, i)), 21f, val, new Vector2(0f, -110f), new Vector2(310f, 120f), (TextAlignmentOptions)258); Btn(transform2, new Vector2(0.5f, 0f), new Vector2(0f, 14f), new Vector2(300f, 50f), new Color(0.26f, 0.42f, 0.78f), L10n.T("menuPick", num4), viewCoins >= num4, delegate { Send(new PieceUpgradeRequest { Id = _id, Branch = pick, FromLevel = s.Level }); }); } num3 -= 330f; } else { Transform transform3 = ((Component)Hud.Box(transform, val, new Vector2(0f, num3), new Vector2(716f, 192f), Hud.Raised, 18f, "Ui", val)).transform; string text3 = ((Catalog.IsTurret(s.Type) && Catalog.Milestones(s.Level + 1) > Catalog.Milestones(s.Level)) ? (" " + L10n.T("milestone" + s.Type) + "") : ""); Hud.Label(transform3, L10n.T("menuNext", s.Level + 1, BuildSystem.PieceName(s.Type, s.Level + 1)) + text3, 26f, val, new Vector2(0f, -14f), new Vector2(690f, 36f), (TextAlignmentOptions)514, Hud.Accent, bold: true); ((TMP_Text)Hud.Label(transform3, string.Join("\u3000 ", Deltas(s, s.Level + 1, s.Branch)), 21f, val, new Vector2(0f, -62f), new Vector2(700f, 60f), (TextAlignmentOptions)514)).enableWordWrapping = false; Btn(transform3, new Vector2(0.5f, 0f), new Vector2(0f, 16f), new Vector2(320f, 54f), new Color(0.26f, 0.42f, 0.78f), L10n.T("menuUpgrade", num4), viewCoins >= num4, delegate { Send(new PieceUpgradeRequest { Id = _id, Branch = 1, FromLevel = s.Level }); }); num3 -= 210f; } int num5 = ((s.Hp < s.MaxHp) ? Perks.MyCost(Catalog.RepairCost(s.Hp, s.MaxHp)) : 0); Btn(transform, new Vector2(0.5f, 0f), new Vector2(-270f, 24f), new Vector2(170f, 54f), new Color(0.22f, 0.55f, 0.36f), (num5 > 0) ? L10n.T("menuRepair", num5) : L10n.T("menuHealthy"), num5 > 0 && viewCoins >= num5, delegate { Send(new PieceUpgradeRequest { Id = _id, Repair = true }); }); Btn(transform, new Vector2(0.5f, 0f), new Vector2(-90f, 24f), new Vector2(170f, 54f), new Color(0.26f, 0.42f, 0.78f), L10n.T("menuMove"), enabled: true, delegate { int id = _id; Close(); BuildSystem.Instance.StartMove(id); }); Btn(transform, new Vector2(0.5f, 0f), new Vector2(90f, 24f), new Vector2(170f, 54f), new Color(0.62f, 0.2f, 0.16f), _confirmRemove ? L10n.T("menuRemoveSure") : L10n.T("menuRemove", BuildSystem.RefundEstimate(s)), enabled: true, delegate { if (!_confirmRemove) { _confirmRemove = true; } else { InstanceFinder.ClientManager.Broadcast(new PieceRemoveRequest { Id = _id }, (Channel)0); Close(); } }); Btn(transform, new Vector2(0.5f, 0f), new Vector2(270f, 24f), new Vector2(170f, 54f), new Color(0.3f, 0.33f, 0.38f), L10n.T("menuClose"), enabled: true, Close); } public static string PictureOf(PieceState s) { if (s.Type != PieceType.Wall) { return "Piece" + s.Type; } if (s.Level < 3) { if (s.Level != 2) { return "PieceWall"; } return "PieceWallStone"; } return "PieceWallMetal"; } private void Send(PieceUpgradeRequest r) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (InstanceFinder.IsClientStarted) { InstanceFinder.ClientManager.Broadcast(r, (Channel)0); } Fx.Sound("Click", Object.op_Implicit((Object)(object)Player.LocalPlayer) ? Player.LocalPlayer.Transform.position : Vector3.zero, 0.6f, (AudioDistance)1); } internal static List Deltas(PieceState s, int toLevel, int branch) { List list = new List(); if (s.Type == PieceType.Bubble) { Catalog.TurretStats turretStats = Catalog.Turret(s.Type, s.Level, s.Branch); Catalog.TurretStats turretStats2 = Catalog.Turret(s.Type, toLevel, branch); list.Add(Arrow(L10n.T("statShield"), Mathf.RoundToInt(turretStats.Shield * 100f) + "%", Mathf.RoundToInt(turretStats2.Shield * 100f) + "%")); list.Add(Arrow(L10n.T("statRadius"), turretStats.Range.ToString("0"), turretStats2.Range.ToString("0"))); } else if (s.Type == PieceType.Mender) { Catalog.TurretStats turretStats3 = Catalog.Turret(s.Type, s.Level, s.Branch); Catalog.TurretStats turretStats4 = Catalog.Turret(s.Type, toLevel, branch); list.Add(Arrow(L10n.T("statHeal"), turretStats3.Damage + "/s", turretStats4.Damage + "/s")); list.Add(Arrow(L10n.T("statRadius"), turretStats3.Range.ToString("0"), turretStats4.Range.ToString("0"))); } else if (Catalog.IsTurret(s.Type)) { Catalog.TurretStats t = Catalog.Turret(s.Type, s.Level, s.Branch); Catalog.TurretStats t2 = Catalog.Turret(s.Type, toLevel, branch); if (s.Type == PieceType.Flame) { list.Add(Arrow(L10n.T("statBurn"), t.Burn.ToString("0") + "/s", t2.Burn.ToString("0") + "/s")); } list.Add(Arrow(L10n.T("statDamage"), Dmg(t), Dmg(t2))); if (s.Type == PieceType.Tesla) { list.Add(Arrow(L10n.T("statChain"), t.Chain.ToString(), t2.Chain.ToString())); } list.Add(Arrow(L10n.T("statRate"), (1f / t.Interval).ToString("0.#") + "/s", (1f / t2.Interval).ToString("0.#") + "/s")); list.Add(Arrow(L10n.T("statRange"), t.Range.ToString("0"), t2.Range.ToString("0"))); } float num = ((Catalog.MaxHp(s.Type, s.Level) > 0) ? ((float)s.MaxHp / (float)Catalog.MaxHp(s.Type, s.Level)) : 1f); list.Add(Arrow(L10n.T("statHp"), s.MaxHp.ToString(), Mathf.RoundToInt((float)Catalog.MaxHp(s.Type, toLevel) * num).ToString())); if (s.Type == PieceType.Spikes) { list.Add(Arrow(L10n.T("statDamage"), Catalog.SpikeDamage(s.Level).ToString(), Catalog.SpikeDamage(toLevel).ToString())); } return list; static string Arrow(string label, string a, string b) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!(a == b)) { return label + " " + a + " → " + b + ""; } return label + " " + a; } static string Dmg(Catalog.TurretStats turretStats5) { if (turretStats5.Shots * turretStats5.Targets <= 1) { return turretStats5.Damage.ToString(); } return $"{turretStats5.Damage}×{turretStats5.Shots * turretStats5.Targets}"; } } private static void Btn(Transform parent, Vector2 anchor, Vector2 pos, Vector2 size, Color c, string text, bool enabled, Action onClick) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00c7: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) Image obj = Hud.Box(parent, anchor, pos, size, c, 14f, "Ui", (Vector2?)new Vector2(0.5f, anchor.y)); ((Graphic)obj).raycastTarget = true; Button obj2 = ((Component)obj).gameObject.AddComponent