Decompiled source of HowToFishPvp v1.0.1
plugins/HowToFishPvp.dll
Decompiled 15 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using FishNet.Connection; using FishNet.Object; using HarmonyLib; using Microsoft.CodeAnalysis; using Steamworks; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("HowToFishPvp")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("HowToFishPvp")] [assembly: AssemblyTitle("HowToFishPvp")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace HowToFishPvp { [HarmonyPatch] internal static class DeathPatch { [HarmonyPatch(typeof(PlayerUI), "ToggleDeathUI")] [HarmonyPrefix] private static bool SkipDeathUi(bool to) { if (!PvpSession.Queued) { return true; } return !to; } [HarmonyPatch(typeof(PlayerDeathCam), "EnableDeathCam")] [HarmonyPrefix] private static bool SkipDeathCam() { if (!PvpSession.Queued) { return true; } if (PvpSession.Phase == PvpPhase.MatchOver || PvpSession.Phase == PvpPhase.Fighting) { return true; } return false; } [HarmonyPatch(typeof(PlayerDying), "DeathEffects")] [HarmonyPrefix] private static bool SkipHideBody() { if (!PvpSession.Queued) { return true; } if (PvpLobby.IsSkyLobby() || Time.time < PvpSession.ProtectUntil) { return false; } return true; } [HarmonyPatch(typeof(PlayerDying), "LocalRespawn")] [HarmonyPrefix] private static bool SkipGiveUpRespawn() { return !PvpSession.Queued; } [HarmonyPatch(typeof(DeadPlayer), "PrimaryInput")] [HarmonyPrefix] private static bool SkipSlapRevive() { return !PvpSession.Queued; } [HarmonyPatch(typeof(PlayerDying), "ResurrectEffect")] [HarmonyPostfix] private static void AfterResurrect(PlayerDying __instance) { if (PvpSession.Queued && !((Object)(object)__instance == (Object)null)) { Player val = null; try { object? value = AccessTools.Field(typeof(PlayerDying), "_player").GetValue(__instance); val = (Player)((value is Player) ? value : null); } catch { } if (!((Object)(object)val == (Object)null)) { PvpController.RestorePlayerView(val); } } } [HarmonyPatch(typeof(Player), "LocalTeleport")] [HarmonyPostfix] private static void AfterTeleport(Player __instance) { if (PvpSession.Queued && !((Object)(object)__instance == (Object)null) && !PvpController.QuietTeleport && (PvpSession.Phase != PvpPhase.Fighting || !((Object)(object)__instance.Dying != (Object)null) || !__instance.Dying.IsDead)) { PvpController.RestoreVisuals(__instance); } } [HarmonyPatch(typeof(Player), "get_BlockInputs")] [HarmonyPostfix] private static void FreezeDuringCountdown(ref bool __result) { if (PvpSession.Queued && PvpSession.Phase == PvpPhase.Countdown && PvpSession.CountdownDisplay >= 1 && !PvpLobby.IsSkyLobby()) { __result = true; } } } [HarmonyPatch(typeof(Server), "RpcLogic___HitPlayer___2449261505")] internal static class HitPatch { private static void Postfix(Player __0, Player __5) { if (PvpSession.MatchRunning && PvpSession.Phase == PvpPhase.Fighting && !((Object)(object)__0 == (Object)null) && !((Object)(object)__0.Vitals == (Object)null) && __0.Vitals.Health <= 0 && !((Object)(object)__5 == (Object)null) && !((Object)(object)__5 == (Object)(object)__0)) { PvpSession.EnsurePlayer(__5); } } } [HarmonyPatch(typeof(PlayerVitals))] internal static class HungerPatch { [HarmonyPrefix] [HarmonyPatch("LowerFullnessTick")] private static bool SkipHungerTick() { return !PvpSession.Queued; } [HarmonyPrefix] [HarmonyPatch("DamageFromFullness")] private static bool SkipHungerDamage() { return !PvpSession.Queued; } [HarmonyPrefix] [HarmonyPatch("LowerFullness")] private static bool SkipLoseFullness() { return !PvpSession.Queued; } } internal static class IslandPatch { private static float _nextClean; private static bool InPvp() { if (PvpSession.Queued || MenuPatch.PvpSelected) { return true; } try { if (PvpSync.LobbySaysPvp()) { return true; } } catch { } try { ServerSaveObject curServerSave = SaveManager.CurServerSave; if (curServerSave != null && !string.IsNullOrEmpty(curServerSave.Name) && curServerSave.Name.IndexOf("PVP", StringComparison.OrdinalIgnoreCase) >= 0) { return true; } } catch { } return false; } internal static void TickClean() { if (InPvp() && !(Time.unscaledTime < _nextClean)) { _nextClean = Time.unscaledTime + 0.35f; ClearBlack(); KillTips(); } } internal static void ClearBlack() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) try { CanvasManager.ToggleBlackscreen(false, true, 0f); } catch { } try { object? value = AccessTools.Field(typeof(CanvasManager), "_instance").GetValue(null); CanvasManager val = (CanvasManager)((value is CanvasManager) ? value : null); if (!((Object)(object)val == (Object)null)) { object? value2 = AccessTools.Field(typeof(CanvasManager), "_blackScreen").GetValue(val); Image val2 = (Image)((value2 is Image) ? value2 : null); if (!((Object)(object)val2 == (Object)null)) { ((Graphic)val2).color = new Color(0f, 0f, 0f, 0f); ((Component)val2).gameObject.SetActive(false); } } } catch { } } internal static void KillTips() { try { if ((Object)(object)PlayerTutorial.Instance != (Object)null) { PlayerTutorial.Instance.SkipTutorial(); } } catch { } try { PlayerTutorial instance = PlayerTutorial.Instance; if (!((Object)(object)instance == (Object)null)) { object? value = AccessTools.Field(typeof(PlayerTutorial), "_tutorialGroup").GetValue(instance); CanvasGroup val = (CanvasGroup)((value is CanvasGroup) ? value : null); if ((Object)(object)val != (Object)null) { val.alpha = 0f; ((Component)val).gameObject.SetActive(false); } object? value2 = AccessTools.Field(typeof(PlayerTutorial), "_tutorialHolder").GetValue(instance); RectTransform val2 = (RectTransform)((value2 is RectTransform) ? value2 : null); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(false); } AccessTools.Field(typeof(PlayerTutorial), "_hide").SetValue(instance, true); } } catch { } } [HarmonyPatch(typeof(MainMenuManager), "CrashAnimation")] [HarmonyPrefix] private static bool SkipJoinCinematic() { if (!InPvp()) { return true; } try { AccessTools.Field(typeof(MainMenuManager), "_isShowingCutscene").SetValue(null, true); MainMenuManager.InstantCrash(); } catch { } try { Player.ToggleLocalPlayer(true); } catch { } PvpSession.EnsureQueued(); ClearBlack(); KillTips(); return false; } [HarmonyPatch(typeof(MainMenuManager), "HideBoat")] [HarmonyPrefix] private static bool SkipHideBoatFade() { if (!InPvp()) { return true; } try { AccessTools.Field(typeof(MainMenuManager), "_isShowingCutscene").SetValue(null, false); } catch { } ClearBlack(); return false; } [HarmonyPatch(typeof(CanvasManager), "ToggleBlackscreen")] [HarmonyPrefix] private static bool SkipPvpBlackFade(bool to, ref bool instant) { if (!InPvp()) { return true; } if (to) { return false; } instant = true; return true; } [HarmonyPatch(typeof(TutorialManager), "AddTutorial")] [HarmonyPrefix] private static bool SkipTutorial() { return !InPvp(); } [HarmonyPatch(typeof(TutorialManager), "Start")] [HarmonyPrefix] private static bool SkipTutorialStart() { return !InPvp(); } [HarmonyPatch(typeof(PlayerTutorial), "AddTutorial")] [HarmonyPrefix] private static bool SkipPlayerTutorial() { return !InPvp(); } [HarmonyPatch(typeof(PlayerTutorial), "InitializeLocal")] [HarmonyPostfix] private static void AfterTutorialInit() { if (InPvp()) { KillTips(); } } [HarmonyPatch(typeof(OnlineIslandManager), "OnStartServer")] [HarmonyPostfix] private static void OnStartServerPostfix(OnlineIslandManager __instance) { if (!PvpSession.Queued) { return; } try { MenuPatch.ApplyPvpSaveIslands(); PvpController.UnlockAllIslands(); if ((Object)(object)__instance != (Object)null && ((NetworkBehaviour)__instance).IsServerInitialized) { __instance.SpawnIsland((byte)1); } } catch (Exception ex) { Debug.LogError((object)("[HowToFishPvp] OnStartServer island set failed: " + ex)); } ClearBlack(); KillTips(); } [HarmonyPatch(typeof(OnlineIslandManager), "OnStartClient")] [HarmonyPostfix] private static void OnStartClientPostfix() { if (!PvpSession.Queued || PvpSession.MatchRunning) { return; } KillTips(); ClearBlack(); try { OnlineIslandManager.ToggleTeleportPlayers(true); IslandManager.LoadIsland((byte)1); IslandManager.OnIslandChange((byte)1); } catch (Exception ex) { Debug.LogError((object)("[HowToFishPvp] OnStartClient island load failed: " + ex)); } } [HarmonyPatch(typeof(BoatManager), "TrySpawnBoat")] [HarmonyPrefix] private static bool SkipSpawnBoat() { return !InPvp(); } [HarmonyPatch(typeof(BoatManager), "TryMoveBoat")] [HarmonyPrefix] private static bool SkipMoveBoat() { return !InPvp(); } [HarmonyPatch(typeof(IslandManager), "OnIslandChange")] [HarmonyPostfix] private static void AfterIslandChange() { if (PvpSession.Queued) { PvpController.HideShops(); PvpController.RestoreAllViews(); ClearBlack(); KillTips(); } } } [HarmonyPatch] internal static class LobbyPatch { private static bool InSafePeriod() { if (PvpLobby.IsSkyLobby()) { return true; } if (!PvpSession.Queued) { return false; } if (Time.time < PvpSession.ProtectUntil) { return true; } return PvpSession.Phase == PvpPhase.Countdown; } private static Player PlayerOf(PlayerMovement move) { if ((Object)(object)move == (Object)null) { return null; } try { object? value = AccessTools.Field(typeof(PlayerMovement), "_player").GetValue(move); return (Player)((value is Player) ? value : null); } catch { return null; } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerVitals), "TakeDamage")] private static bool SkipLobbyDamage() { return !InSafePeriod(); } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerVitals), "LocalHit")] private static bool SkipLobbyLocalHit() { return !InSafePeriod(); } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerVitals), "TickUpdate")] private static bool SkipLobbyTicks() { return !InSafePeriod(); } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerVitals), "FireTick")] private static bool SkipLobbyFire() { return !InSafePeriod(); } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerVitals), "PoisonTick")] private static bool SkipLobbyPoison() { return !InSafePeriod(); } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerMovement), "UnderWaterCheck")] private static bool SkipLobbyDrown(PlayerMovement __instance) { if (PvpBoats.IsStandingOnBoat(PlayerOf(__instance))) { return false; } return !InSafePeriod(); } [HarmonyPrefix] [HarmonyPatch(typeof(Server), "HitPlayer")] private static bool SkipLobbyHit() { return !InSafePeriod(); } [HarmonyPrefix] [HarmonyPatch(typeof(Server), "RpcLogic___HitPlayer___2449261505")] private static bool SkipLobbyHitRpc() { return !InSafePeriod(); } } internal static class MenuPatch { [CompilerGenerated] private static class <>O { public static UnityAction <0>__StartPvpFromMenu; } private const string ButtonObjectName = "HowToFishPvpModeButton"; internal static bool PvpSelected; private static Button _pvpButton; internal static void TryAttachIfNeeded() { ButtonManager manager = GetManager(); if ((Object)(object)manager != (Object)null) { EnsurePvpButton(manager); } } [HarmonyPatch(typeof(ButtonManager), "Start")] [HarmonyPostfix] private static void StartPostfix(ButtonManager __instance) { try { EnsurePvpButton(__instance); } catch (Exception ex) { Debug.LogError((object)("[HowToFishPvp] Menu setup failed: " + ex)); } } [HarmonyPatch(typeof(ButtonManager), "ToggleCreateServerButton")] [HarmonyPostfix] private static void KeepPvpClickable() { if ((Object)(object)_pvpButton != (Object)null) { ((Selectable)_pvpButton).interactable = true; PaintEnabled(_pvpButton); } } [HarmonyPatch(typeof(ButtonManager), "CreateNewServer")] [HarmonyPrefix] private static void CreatePrefix(ButtonManager __instance) { if (PvpSelected) { QueuePvp(__instance); } } [HarmonyPatch(typeof(SaveManager), "CreateServer")] [HarmonyPostfix] private static void CreateServerPostfix() { if (PvpSession.Queued) { ApplyPvpSaveIslands(); } } internal static void QueuePvp(ButtonManager manager) { PvpSelected = true; PvpSession.Queued = true; PvpSession.ResetMatch(); PvpSession.Phase = PvpPhase.WaitingForPlayers; PvpSession.Banner = "PVP MODE"; PvpSession.SubBanner = "Invite friends, then wait in-world"; ApplyPvpSaveIslands(); object? value = AccessTools.Field(typeof(ButtonManager), "_serverNameInputField").GetValue(manager); TMP_InputField val = (TMP_InputField)((value is TMP_InputField) ? value : null); if ((Object)(object)val != (Object)null && string.IsNullOrEmpty(val.text)) { val.text = "PVP Arena"; } AccessTools.Field(typeof(ButtonManager), "_useSteam").SetValue(manager, true); AccessTools.Field(typeof(ButtonManager), "_isPublic").SetValue(manager, false); } internal static void ApplyPvpSaveIslands() { ServerSaveObject curServerSave = SaveManager.CurServerSave; if (curServerSave != null) { curServerSave.SpawnedIsland = 1; curServerSave.MaxIsland = byte.MaxValue; } } internal static void StartPvpFromMenu() { ButtonManager manager = GetManager(); if (!((Object)(object)manager == (Object)null)) { QueuePvp(manager); object? value = AccessTools.Field(typeof(ButtonManager), "_serverNameInputField").GetValue(manager); TMP_InputField val = (TMP_InputField)((value is TMP_InputField) ? value : null); if ((Object)(object)val != (Object)null) { val.text = "PVP Arena"; } AccessTools.Method(typeof(ButtonManager), "ToggleCreateServerButton", (Type[])null, (Type[])null).Invoke(manager, new object[1] { true }); manager.CreateNewServer(); } } private static ButtonManager GetManager() { object? value = AccessTools.Field(typeof(ButtonManager), "_instance").GetValue(null); ButtonManager val = (ButtonManager)((value is ButtonManager) ? value : null); if ((Object)(object)val == (Object)null) { val = Object.FindObjectOfType<ButtonManager>(); } return val; } private static void EnsurePvpButton(ButtonManager manager) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //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_00d6: Expected O, but got Unknown object? value = AccessTools.Field(typeof(ButtonManager), "_createServerButton").GetValue(manager); Button val = (Button)((value is Button) ? value : null); if ((Object)(object)val == (Object)null) { return; } Transform parent = ((Component)val).transform.parent; if ((Object)(object)parent == (Object)null) { return; } Transform val2 = parent.Find("HowToFishPvpModeButton"); if ((Object)(object)val2 != (Object)null) { _pvpButton = ((Component)val2).GetComponent<Button>(); BindHostButtons(val, _pvpButton); return; } _pvpButton = Object.Instantiate<Button>(val, parent); ((Object)_pvpButton).name = "HowToFishPvpModeButton"; ((Component)_pvpButton).gameObject.SetActive(true); ((Selectable)_pvpButton).interactable = true; _pvpButton.onClick = new ButtonClickedEvent(); ButtonClickedEvent onClick = _pvpButton.onClick; object obj = <>O.<0>__StartPvpFromMenu; if (obj == null) { UnityAction val3 = StartPvpFromMenu; <>O.<0>__StartPvpFromMenu = val3; obj = (object)val3; } ((UnityEvent)onClick).AddListener((UnityAction)obj); StripLocalization(((Component)_pvpButton).gameObject); BindHostButtons(val, _pvpButton); } private static void BindHostButtons(Button create, Button pvp) { //IL_0046: 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_006a: 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_0082: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)create == (Object)null) && !((Object)(object)pvp == (Object)null)) { RectTransform component = ((Component)create).GetComponent<RectTransform>(); RectTransform component2 = ((Component)pvp).GetComponent<RectTransform>(); LayoutElement val = ((Component)component2).GetComponent<LayoutElement>(); if ((Object)(object)val == (Object)null) { val = ((Component)pvp).gameObject.AddComponent<LayoutElement>(); } val.ignoreLayout = true; component2.anchorMin = component.anchorMin; component2.anchorMax = component.anchorMax; component2.pivot = component.pivot; component2.sizeDelta = component.sizeDelta; component2.offsetMin = component.offsetMin; component2.offsetMax = component.offsetMax; PvpHostButtons pvpHostButtons = ((Component)pvp).GetComponent<PvpHostButtons>(); if ((Object)(object)pvpHostButtons == (Object)null) { pvpHostButtons = ((Component)pvp).gameObject.AddComponent<PvpHostButtons>(); } pvpHostButtons.CreateRt = component; pvpHostButtons.PvpRt = component2; if ((Object)(object)((Component)pvp).GetComponent<PvpButtonLabel>() == (Object)null) { ((Component)pvp).gameObject.AddComponent<PvpButtonLabel>(); } ApplyPvpLabel(((Component)pvp).gameObject); PaintEnabled(pvp); } } private static void PaintEnabled(Button btn) { //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_001a: 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_0055: 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 ((Object)(object)btn == (Object)null) { return; } ((Selectable)btn).interactable = true; ColorBlock colors = ((Selectable)btn).colors; ((ColorBlock)(ref colors)).normalColor = Color.white; ((ColorBlock)(ref colors)).highlightedColor = Color.white; ((ColorBlock)(ref colors)).selectedColor = Color.white; ((ColorBlock)(ref colors)).disabledColor = Color.white; ((ColorBlock)(ref colors)).colorMultiplier = 1f; ((Selectable)btn).colors = colors; Image[] componentsInChildren = ((Component)btn).GetComponentsInChildren<Image>(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (!((Object)(object)componentsInChildren[i] == (Object)null)) { string text = ((Object)((Component)componentsInChildren[i]).gameObject).name ?? ""; if (text.IndexOf("outline", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("border", StringComparison.OrdinalIgnoreCase) >= 0) { ((Graphic)componentsInChildren[i]).color = Color.white; } } } } internal static void StripLocalization(GameObject go) { Component[] componentsInChildren = go.GetComponentsInChildren<Component>(true); foreach (Component val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && !(val is Transform) && !(val is CanvasRenderer)) { string text = ((object)val).GetType().FullName ?? ""; if (text.IndexOf("Localize", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("Localization", StringComparison.OrdinalIgnoreCase) >= 0) { Object.Destroy((Object)(object)val); } } } } internal static void ApplyPvpLabel(GameObject go) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)go == (Object)null)) { TMP_Text[] componentsInChildren = go.GetComponentsInChildren<TMP_Text>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].text = "PVP MODE"; ((Graphic)componentsInChildren[i]).color = Color.white; componentsInChildren[i].alignment = (TextAlignmentOptions)514; } } } } internal sealed class PvpButtonLabel : MonoBehaviour { private void LateUpdate() { MenuPatch.ApplyPvpLabel(((Component)this).gameObject); } } internal sealed class PvpHostButtons : MonoBehaviour { internal RectTransform CreateRt; internal RectTransform PvpRt; private Vector2 _layoutPos; private int _appliedFrame = -1; private const float CreateDown = 8f; private const float BothDown = 16f; private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown Canvas.willRenderCanvases += new WillRenderCanvases(AfterCanvas); } private void OnDisable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown Canvas.willRenderCanvases -= new WillRenderCanvases(AfterCanvas); } private void LateUpdate() { MenuPatch.ApplyPvpLabel(((Component)this).gameObject); } private void AfterCanvas() { PlacePair(); } private void PlacePair() { //IL_005c: 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_0088: 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_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) //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_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_00e5: 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_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) if (!((Object)(object)CreateRt == (Object)null) && !((Object)(object)PvpRt == (Object)null)) { ((Component)this).gameObject.SetActive(true); int frameCount = Time.frameCount; if (_appliedFrame != frameCount) { _layoutPos = CreateRt.anchoredPosition; _appliedFrame = frameCount; } PvpRt.anchorMin = CreateRt.anchorMin; PvpRt.anchorMax = CreateRt.anchorMax; PvpRt.pivot = CreateRt.pivot; PvpRt.sizeDelta = CreateRt.sizeDelta; Rect rect = CreateRt.rect; float num = ((Rect)(ref rect)).height; if (num < 8f) { num = 42f; } CreateRt.anchoredPosition = _layoutPos + new Vector2(0f, -24f); PvpRt.anchoredPosition = _layoutPos + new Vector2(0f, num + 2f - 16f); } } } [BepInPlugin("mox.howtofish.pvp", "How to Fish PVP Mode", "1.0.1")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "mox.howtofish.pvp"; public const string PluginName = "How to Fish PVP Mode"; public const string PluginVersion = "1.0.1"; internal static Plugin Instance; internal static Harmony Harmony; private void Awake() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown Instance = this; Harmony = new Harmony("mox.howtofish.pvp"); PatchSafe(typeof(MenuPatch)); PatchSafe(typeof(IslandPatch)); PatchSafe(typeof(HitPatch)); PatchSafe(typeof(ShopPatch)); PatchSafe(typeof(HungerPatch)); PatchSafe(typeof(DeathPatch)); PatchSafe(typeof(LobbyPatch)); PatchSafe(typeof(PvpSync)); PatchSafe(typeof(PvpGrab)); PatchSafe(typeof(PvpFloodPatch)); PatchSafe(typeof(PvpBoom)); PatchSafe(typeof(PvpSpike)); PatchSafe(typeof(PvpCloak)); PatchSafe(typeof(PvpBoats)); ((Component)this).gameObject.AddComponent<PvpController>(); ((Component)this).gameObject.AddComponent<PvpHud>(); ((Component)this).gameObject.AddComponent<PvpGrab>(); ((Component)this).gameObject.AddComponent<PvpCloakDriver>(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"PVP Mode loaded. PVP MODE sits next to Create on New Game."); } private void PatchSafe(Type type) { try { Harmony.CreateClassProcessor(type).Patch(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Failed to patch " + type.Name + ": " + ex)); } } } internal enum ArenaMap { None, Benches, Towers, Floaters, Tightrope, Stairs, Hole, Pillars, Spinner, House, Tiny, Bridge, Crates, Colosseum, FallGrid, FallRing, FallLanes, FallSteps, Seesaw, Movers, MoveFerry, MoveCircle, Elevators, DropPath, DualSpin, Windmill, Cross, OceanBridge } internal static class PvpArena { private struct PropKit { public GameObject Src; public Mesh Mesh; public Material[] Mats; public bool Wood; } private const float SkyAboveWater = 26f; private static GameObject _root; private static ArenaMap _built; private static int _layer; private static float _yaw; private static ArenaMap[] _plan; private static int _planSeed; private static readonly List<Transform> _spawns = new List<Transform>(); private static readonly List<Renderer> _hiddenRends = new List<Renderer>(); private static readonly List<Collider> _hiddenCols = new List<Collider>(); private static readonly List<Texture> _stoneTex = new List<Texture>(); private static readonly List<Texture> _woodTex = new List<Texture>(); private static readonly Dictionary<int, Material> _clones = new Dictionary<int, Material>(); private static int _surfI; private static int _propI; private static Shader _lit; private static readonly List<PropKit> _woodProps = new List<PropKit>(); private static readonly List<PropKit> _rockProps = new List<PropKit>(); internal static bool IsActive { get { if ((Object)(object)_root != (Object)null && _built != ArenaMap.None) { return _built != ArenaMap.Benches; } return false; } } internal static ArenaMap Built => _built; internal static void Roll(int seed) { _planSeed = seed; int num = 20; _plan = new ArenaMap[num]; Random random = new Random(seed); List<ArenaMap> list = new List<ArenaMap>(); list.Add(ArenaMap.Movers); list.Add(ArenaMap.FallGrid); list.Add(ArenaMap.FallRing); list.Add(ArenaMap.FallLanes); list.Add(ArenaMap.FallSteps); list.Add(ArenaMap.MoveFerry); list.Add(ArenaMap.MoveCircle); list.Add(ArenaMap.OceanBridge); Shuffle(list, random); List<ArenaMap> list2 = new List<ArenaMap>(); for (int i = 0; i < list.Count; i++) { list2.Add(list[i]); } while (list2.Count < num) { list2.Add(ArenaMap.None); } int num2 = list2.IndexOf(ArenaMap.None); if (num2 > 0) { ArenaMap value = list2[0]; list2[0] = list2[num2]; list2[num2] = value; } for (int num3 = list2.Count - 1; num3 >= 2; num3--) { int index = random.Next(1, num3 + 1); ArenaMap value2 = list2[num3]; list2[num3] = list2[index]; list2[index] = value2; } for (int j = 0; j < num; j++) { _plan[j] = list2[j]; } for (int k = 1; k < num; k++) { if (_plan[k] == ArenaMap.OceanBridge) { ArenaMap arenaMap = _plan[1]; _plan[1] = _plan[k]; _plan[k] = arenaMap; break; } } Debug.Log((object)("[HowToFishPvp] Map plan seed=" + seed + " " + PlanLine())); } internal static void ClearPlan() { _plan = null; _planSeed = 0; } internal static ArenaMap ForRound(int round) { if (PvpSession.MapSeed != 0 && (_plan == null || _planSeed != PvpSession.MapSeed)) { Roll(PvpSession.MapSeed); } if (_plan == null) { return ArenaMap.None; } int num = round - 1; if (num < 0 || num >= _plan.Length) { return ArenaMap.None; } return _plan[num]; } internal static string Title(ArenaMap map) { return map switch { ArenaMap.Benches => "Benches", ArenaMap.Towers => "Towers", ArenaMap.Floaters => "Floaters", ArenaMap.Tightrope => "Tightrope", ArenaMap.Stairs => "Stairs", ArenaMap.Hole => "The Hole", ArenaMap.Pillars => "Pillars", ArenaMap.Spinner => "Spinner", ArenaMap.House => "House", ArenaMap.Tiny => "Tiny", ArenaMap.Bridge => "Bridge", ArenaMap.Crates => "Crates", ArenaMap.Colosseum => "Colosseum", ArenaMap.FallGrid => "Falling Floors", ArenaMap.FallRing => "Falling Ring", ArenaMap.FallLanes => "Falling Lanes", ArenaMap.FallSteps => "Falling Steps", ArenaMap.Seesaw => "Seesaw", ArenaMap.Movers => "Movers", ArenaMap.MoveFerry => "Ferries", ArenaMap.MoveCircle => "Orbit", ArenaMap.Elevators => "Elevators", ArenaMap.DropPath => "Drop Path", ArenaMap.DualSpin => "Twin Spinners", ArenaMap.Windmill => "Windmill", ArenaMap.Cross => "Cross", ArenaMap.OceanBridge => "Docks", _ => "", }; } internal static bool NeedsSkyArena(int round) { return ForRound(round) != ArenaMap.None; } internal static bool TryGetSpawn(out Vector3 pos, out float yaw) { return TryGetSlot(0, 1, out pos, out yaw); } internal static bool TryGetSlot(int slot, int count, out Vector3 pos, out float yaw) { //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_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_00f2: 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_00f8: 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_011e: 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) pos = Vector3.zero; yaw = _yaw; if (!IsActive || _spawns.Count == 0) { return false; } if (count < 1) { count = 1; } int count2 = _spawns.Count; int num = ((count2 != 1) ? Mathf.RoundToInt(Mathf.Clamp01((float)slot / Mathf.Max(1f, (float)count - 1f)) * (float)(count2 - 1)) : 0); if (num < 0) { num = 0; } if (num >= count2) { num = count2 - 1; } if ((Object)(object)_spawns[num] == (Object)null) { return false; } pos = _spawns[num].position; if (count2 >= 2 && (Object)(object)_spawns[0] != (Object)null && (Object)(object)_spawns[count2 - 1] != (Object)null) { Vector3 val = ((num < count2 / 2) ? _spawns[count2 - 1].position : _spawns[0].position) - pos; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { yaw = Mathf.Atan2(val.x, val.z) * 57.29578f; } } return true; } internal static bool TryRandomDrop(out Vector3 pos) { //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_0040: 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_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_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_0090: 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_00ad: 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_00cb: 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_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) pos = Vector3.zero; if (!IsActive || (Object)(object)_root == (Object)null) { return false; } Collider[] componentsInChildren = _root.GetComponentsInChildren<Collider>(); int num = 0; try { num = LayerMask.op_Implicit(GameInfo.LevelLayer); } catch { } try { num |= LayerMask.op_Implicit(GameInfo.CanJumpOnLayers); } catch { } if (num == 0) { num = -5; } if (componentsInChildren != null && componentsInChildren.Length != 0) { RaycastHit val2 = default(RaycastHit); for (int i = 0; i < 14; i++) { Collider val = componentsInChildren[Random.Range(0, componentsInChildren.Length)]; if (!((Object)(object)val == (Object)null)) { Bounds bounds = val.bounds; if (Physics.Raycast(new Vector3(Random.Range(((Bounds)(ref bounds)).min.x, ((Bounds)(ref bounds)).max.x), ((Bounds)(ref bounds)).max.y + 2.4f, Random.Range(((Bounds)(ref bounds)).min.z, ((Bounds)(ref bounds)).max.z)), Vector3.down, ref val2, 10f, num, (QueryTriggerInteraction)1) && !((Object)(object)((RaycastHit)(ref val2)).transform == (Object)null) && ((RaycastHit)(ref val2)).transform.IsChildOf(_root.transform)) { pos = ((RaycastHit)(ref val2)).point; return true; } } } } if (_spawns.Count == 0) { return false; } int index = Random.Range(0, _spawns.Count); if ((Object)(object)_spawns[index] == (Object)null) { return false; } pos = _spawns[index].position; return true; } internal static void Destroy() { PvpBoats.Wipe(); RestoreIsland(); _spawns.Clear(); if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _built = ArenaMap.None; } internal static void AddSpawn(Transform mark) { if ((Object)(object)mark != (Object)null && !_spawns.Contains(mark)) { _spawns.Add(mark); } } internal unsafe static bool Build(ArenaMap map, int playerCount) { //IL_00f9: 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_0089: 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_00b0: 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_008f: 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_006b: 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_00bb: 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_00cc: Expected O, but got Unknown //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) Destroy(); if (map == ArenaMap.None || map == ArenaMap.Benches) { return false; } HarvestMats(); _layer = FirstJumpLayer(); if (!TryIslandSpawn(out var pos, out var yaw)) { pos = ((!((Object)(object)Player.LocalPlayer != (Object)null) || !((Object)(object)Player.LocalPlayer.Transform != (Object)null)) ? Vector3.zero : Player.LocalPlayer.Transform.position); } _yaw = yaw; float num = 0f; try { num = WaterManager.GetWaterHeight(pos); } catch { try { num = WaterManager.WaterHeight; } catch { } } Vector3 val = FindOpenWater(pos, num); Vector3 position = ((map == ArenaMap.OceanBridge) ? new Vector3(val.x, num, val.z) : new Vector3(val.x, num + 26f, val.z)); _root = new GameObject("HowToFishPvpArena"); _root.layer = _layer; try { _root.tag = "Level"; } catch { } _root.transform.position = position; MoveToIslandScene(_root); switch (map) { case ArenaMap.Towers: BuildTowers(); break; case ArenaMap.Floaters: BuildFloaters(); break; case ArenaMap.Tightrope: BuildTightrope(); break; case ArenaMap.Stairs: BuildStairs(); break; case ArenaMap.Hole: BuildHole(); break; case ArenaMap.Pillars: BuildPillars(); break; case ArenaMap.Spinner: BuildSpinner(); break; case ArenaMap.House: BuildHouse(); break; case ArenaMap.Tiny: BuildTiny(); break; case ArenaMap.Bridge: BuildBridge(); break; case ArenaMap.Crates: BuildCrates(); break; case ArenaMap.Colosseum: BuildColosseum(); break; case ArenaMap.FallGrid: BuildFallGrid(); break; case ArenaMap.FallRing: BuildFallRing(); break; case ArenaMap.FallLanes: BuildFallLanes(); break; case ArenaMap.FallSteps: BuildFallSteps(); break; case ArenaMap.Seesaw: BuildSeesaw(); break; case ArenaMap.Movers: BuildMovers(); break; case ArenaMap.MoveFerry: BuildMoveFerry(); break; case ArenaMap.MoveCircle: BuildMoveCircle(); break; case ArenaMap.Elevators: BuildElevators(); break; case ArenaMap.DropPath: BuildDropPath(); break; case ArenaMap.DualSpin: BuildDualSpin(); break; case ArenaMap.Windmill: BuildWindmill(); break; case ArenaMap.Cross: BuildCross(); break; case ArenaMap.OceanBridge: BuildOceanBridge(); break; } HideIsland(); Physics.SyncTransforms(); _built = map; Debug.Log((object)("[HowToFishPvp] Arena " + map.ToString() + " rocks=" + _rockProps.Count + " wood=" + _woodProps.Count + " at " + ((object)(*(Vector3*)(&position))/*cast due to .constrained prefix*/).ToString())); return true; } private static void BuildTowers() { //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_0052: 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_0095: 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_00c4: 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_00f8: Unknown result type (might be due to invalid IL or missing references) Stack(-7f); Stack(7f); Box(new Vector3(-2.3f, 3.25f, 0f), new Vector3(2.6f, 0.35f, 0.75f), wood: true); Box(new Vector3(2.3f, 3.25f, 0f), new Vector3(2.6f, 0.35f, 0.75f), wood: true); Box(new Vector3(0f, 1.1f, 4.2f), new Vector3(2.4f, 0.5f, 2.4f), wood: false); Box(new Vector3(0f, 1.1f, -4.2f), new Vector3(2.4f, 0.5f, 2.4f), wood: false); Mark(new Vector3(-7f, 6.2f, 0f)); Mark(new Vector3(7f, 6.2f, 0f)); } private static void Stack(float x) { //IL_000b: 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_0036: 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_0061: 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) Box(new Vector3(x, 0.4f, 0f), new Vector3(5f, 0.8f, 5f), wood: false); Box(new Vector3(x, 3.15f, 0f), new Vector3(3.6f, 0.7f, 3.6f), wood: false); Box(new Vector3(x, 5.7f, 0f), new Vector3(2.8f, 0.65f, 2.8f), wood: false); } private static void BuildFloaters() { //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_003e: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fa: 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_0158: 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_0187: 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_01b6: 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_01e5: 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) Box(new Vector3(-8.5f, 0.4f, -3.5f), new Vector3(2.6f, 0.7f, 2.6f), wood: false); Box(new Vector3(-4f, 1.6f, 4.2f), new Vector3(2.2f, 0.55f, 2.2f), wood: true); Box(new Vector3(0f, 0.35f, 0f), new Vector3(3.4f, 0.7f, 3.4f), wood: false); Box(new Vector3(5.5f, 2.3f, -5f), new Vector3(2.3f, 0.55f, 2.3f), wood: false); Box(new Vector3(7.2f, 0.45f, 3.2f), new Vector3(2.8f, 0.7f, 2.8f), wood: false); Box(new Vector3(-6.2f, 3.6f, 1.2f), new Vector3(1.9f, 0.5f, 1.9f), wood: true); Box(new Vector3(2.2f, 4.4f, 6f), new Vector3(2.1f, 0.5f, 2.1f), wood: false); Box(new Vector3(-1.2f, 2.9f, -7.2f), new Vector3(2.2f, 0.5f, 2.2f), wood: true); Box(new Vector3(8f, 3.2f, -1f), new Vector3(1.8f, 0.5f, 1.8f), wood: false); Box(new Vector3(0f, 5.6f, 0f), new Vector3(1.7f, 0.45f, 1.7f), wood: false); Mark(new Vector3(-8.5f, 0.85f, -3.5f)); Mark(new Vector3(7.2f, 0.9f, 3.2f)); } private static void BuildTightrope() { //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_003e: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fa: 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_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) Box(new Vector3(0f, 0.22f, 0f), new Vector3(18f, 0.44f, 0.62f), wood: true); Box(new Vector3(-9.2f, 0.45f, 0f), new Vector3(2.6f, 0.9f, 2.6f), wood: false); Box(new Vector3(9.2f, 0.45f, 0f), new Vector3(2.6f, 0.9f, 2.6f), wood: false); Box(new Vector3(0f, 0.3f, 3.6f), new Vector3(1.9f, 0.45f, 1.9f), wood: false); Box(new Vector3(0f, 0.3f, -3.6f), new Vector3(1.9f, 0.45f, 1.9f), wood: false); Box(new Vector3(-4.5f, 1.8f, 0f), new Vector3(1.5f, 0.35f, 1.5f), wood: true); Box(new Vector3(4.5f, 1.8f, 0f), new Vector3(1.5f, 0.35f, 1.5f), wood: true); Mark(new Vector3(-9.2f, 1f, 0f)); Mark(new Vector3(9.2f, 1f, 0f)); } private static void BuildStairs() { //IL_0027: 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_0063: 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_0092: 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_00c1: 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) for (int i = 0; i < 7; i++) { float num = (float)i * 2.55f - 7.6f; float num2 = 0.35f + (float)i * 0.85f; Box(new Vector3(num, num2, 0f), new Vector3(3.1f, 0.55f, 3.2f), i % 2 == 0); } Box(new Vector3(-7.6f, 0.9f, 4.2f), new Vector3(2.4f, 0.5f, 2.4f), wood: false); Box(new Vector3(7.6f, 5.8f, -4.2f), new Vector3(2.4f, 0.5f, 2.4f), wood: false); Mark(new Vector3(-7.6f, 0.75f, 0f)); Mark(new Vector3(7.7f, 5.8f, 0f)); } private static void BuildHole() { //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_003e: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fa: 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_0158: 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_0187: 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) Box(new Vector3(0f, 0.4f, 6.2f), new Vector3(12.4f, 0.7f, 2.5f), wood: false); Box(new Vector3(0f, 0.4f, -6.2f), new Vector3(12.4f, 0.7f, 2.5f), wood: false); Box(new Vector3(6.2f, 0.4f, 0f), new Vector3(2.5f, 0.7f, 9.9f), wood: false); Box(new Vector3(-6.2f, 0.4f, 0f), new Vector3(2.5f, 0.7f, 9.9f), wood: false); Box(new Vector3(4.4f, 2f, 4.4f), new Vector3(2f, 0.5f, 2f), wood: true); Box(new Vector3(-4.4f, 2f, -4.4f), new Vector3(2f, 0.5f, 2f), wood: true); Box(new Vector3(-4.4f, 2f, 4.4f), new Vector3(2f, 0.5f, 2f), wood: false); Box(new Vector3(4.4f, 2f, -4.4f), new Vector3(2f, 0.5f, 2f), wood: false); Mark(new Vector3(0f, 0.85f, 6.2f)); Mark(new Vector3(0f, 0.85f, -6.2f)); } private static void BuildPillars() { //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_004b: 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_0087: 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_00c3: 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_00fa: Unknown result type (might be due to invalid IL or missing references) Pillar(new Vector3(-7.2f, 0f, -5f), 4f); Pillar(new Vector3(-2.2f, 0f, 4.4f), 6.2f); Pillar(new Vector3(6.4f, 0f, 5.2f), 3.2f); Pillar(new Vector3(7f, 0f, -4.2f), 5f); Pillar(new Vector3(0f, 0f, 0f), 8f); Pillar(new Vector3(-5.2f, 0f, 1.6f), 2.4f); Pillar(new Vector3(3f, 0f, -6.4f), 4.4f); Mark(new Vector3(-7.2f, 4.1f, -5f)); Mark(new Vector3(6.4f, 3.3f, 5.2f)); } private static void Pillar(Vector3 basePos, float h) { //IL_0000: 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_0023: Unknown result type (might be due to invalid IL or missing references) Box(new Vector3(basePos.x, h * 0.5f, basePos.z), new Vector3(1.85f, h, 1.85f), wood: false); } private static void BuildSpinner() { //IL_0000: 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_001a: 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_0040: 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_0066: 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_009b: 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) GameObject obj = MakeSpin(Vector3.zero, 22f, Vector3.up); BoxOn(obj.transform, Vector3.zero, new Vector3(3.2f, 0.8f, 3.2f), wood: false); BoxOn(obj.transform, Vector3.zero, new Vector3(16f, 0.65f, 2.3f), wood: true); BoxOn(obj.transform, Vector3.zero, new Vector3(2.3f, 0.65f, 16f), wood: true); MarkOn(obj.transform, new Vector3(-6.5f, 0.55f, 0f)); MarkOn(obj.transform, new Vector3(6.5f, 0.55f, 0f)); } private static void BuildHouse() { //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_003e: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fa: 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_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) Box(new Vector3(0f, 0.4f, 0f), new Vector3(14f, 0.8f, 10f), wood: false); Box(new Vector3(-6.8f, 2.5f, 0f), new Vector3(0.4f, 4.2f, 10f), wood: true); Box(new Vector3(6.8f, 2.5f, 0f), new Vector3(0.4f, 4.2f, 10f), wood: true); Box(new Vector3(0f, 2.5f, -4.8f), new Vector3(13.6f, 4.2f, 0.4f), wood: true); Box(new Vector3(-2.2f, 1.15f, 1.2f), new Vector3(2.2f, 1.5f, 0.55f), wood: false); Box(new Vector3(2.6f, 1.05f, -1.4f), new Vector3(2.5f, 1.3f, 0.55f), wood: false); Box(new Vector3(0f, 0.95f, -2.8f), new Vector3(2f, 1.1f, 1.6f), wood: false); Mark(new Vector3(-5.2f, 0.9f, 2.6f)); Mark(new Vector3(5.2f, 0.9f, 2.6f)); } private static void BuildTiny() { //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_003e: 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) Box(new Vector3(0f, 0.35f, 0f), new Vector3(2.35f, 0.7f, 2.35f), wood: false); Mark(new Vector3(-0.55f, 0.8f, 0f)); Mark(new Vector3(0.55f, 0.8f, 0f)); } private static void BuildBridge() { //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_003e: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fa: 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_0142: Unknown result type (might be due to invalid IL or missing references) Box(new Vector3(-8.2f, 0.5f, 0f), new Vector3(5.6f, 1f, 5.6f), wood: false); Box(new Vector3(8.2f, 0.5f, 0f), new Vector3(5.6f, 1f, 5.6f), wood: false); Box(new Vector3(-3.4f, 0.32f, 0.95f), new Vector3(5.2f, 0.38f, 0.62f), wood: true); Box(new Vector3(3.4f, 0.32f, 0.95f), new Vector3(5.2f, 0.38f, 0.62f), wood: true); Box(new Vector3(0f, 0.32f, -0.95f), new Vector3(11.4f, 0.35f, 0.55f), wood: true); Box(new Vector3(0f, 2.4f, 0f), new Vector3(1.8f, 0.4f, 1.8f), wood: false); Mark(new Vector3(-8.2f, 1.1f, 0f)); Mark(new Vector3(8.2f, 1.1f, 0f)); } private static void BuildCrates() { //IL_001c: 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_004e: 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_007e: 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_00a1: 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_00d0: 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_00ff: 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_012e: 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_015f: 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) float num = 1.9f; for (int i = 0; i < 5; i++) { Box(new Vector3((float)(i - 2) * num, num * 0.5f, 0f), new Vector3(num, num, num), wood: true); } for (int j = 0; j < 3; j++) { Box(new Vector3((float)(j - 1) * num, num * 1.5f, 0f), new Vector3(num, num, num), j == 1); } Box(new Vector3(0f, num * 2.5f, 0f), new Vector3(num, num, num), wood: false); Box(new Vector3(-5.6f, 0.7f, 3.4f), new Vector3(2.2f, 1.4f, 2.2f), wood: false); Box(new Vector3(5.6f, 0.7f, -3.4f), new Vector3(2.2f, 1.4f, 2.2f), wood: false); Box(new Vector3(0f, 0.4f, 4.6f), new Vector3(2.4f, 0.8f, 2.4f), wood: false); Box(new Vector3(0f, 0.4f, -4.6f), new Vector3(2.4f, 0.8f, 2.4f), wood: false); Mark(new Vector3(-3.8f, num + 0.15f, 0f)); Mark(new Vector3(3.8f, num + 0.15f, 0f)); } private static void BuildColosseum() { //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_003e: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fa: 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_0162: 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_0191: 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_01c0: 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_01ef: 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_021e: 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) Box(new Vector3(0f, 0.4f, 8.4f), new Vector3(14f, 0.75f, 2.6f), wood: false); Box(new Vector3(0f, 0.4f, -8.4f), new Vector3(14f, 0.75f, 2.6f), wood: false); Box(new Vector3(8.4f, 0.4f, 0f), new Vector3(2.6f, 0.75f, 14f), wood: false); Box(new Vector3(-8.4f, 0.4f, 0f), new Vector3(2.6f, 0.75f, 14f), wood: false); Box(new Vector3(0f, 0.45f, 0f), new Vector3(10f, 0.7f, 2.2f), wood: true); Box(new Vector3(0f, 0.45f, 0f), new Vector3(2.2f, 0.7f, 10f), wood: true); Box(new Vector3(0f, 0.7f, 0f), new Vector3(3f, 0.9f, 3f), wood: false); Stack(-8.4f); Box(new Vector3(8.4f, 0.4f, 8.4f), new Vector3(2.8f, 0.8f, 2.8f), wood: false); Box(new Vector3(8.4f, 3.15f, 8.4f), new Vector3(2.2f, 0.65f, 2.2f), wood: false); Box(new Vector3(-8.4f, 2.1f, 8.4f), new Vector3(2f, 0.5f, 2f), wood: true); Box(new Vector3(8.4f, 2.1f, -8.4f), new Vector3(2f, 0.5f, 2f), wood: true); Mark(new Vector3(-8.4f, 6.2f, 0f)); Mark(new Vector3(8.4f, 0.9f, 8.4f)); } private static void BuildFallGrid() { //IL_00bb: 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_00ed: 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_007f: 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_0068: 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) int num = 5; float num2 = 2.2f; float num3 = 0.18f; float num4 = num2 + num3; float num5 = 0f - (float)(num - 1) * 0.5f * num4; Vector3 localPos = default(Vector3); for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { ((Vector3)(ref localPos))..ctor(num5 + (float)j * num4, 0.35f, num5 + (float)i * num4); if ((j == 0 || j == num - 1) && (i == 0 || i == num - 1)) { Box(localPos, new Vector3(num2, 0.7f, num2), wood: false); } else { FallBox(localPos, new Vector3(num2, 0.7f, num2), wood: false, 0.55f); } } } SafeMark(new Vector3(num5, 0.35f, num5), 0.7f); SafeMark(new Vector3(num5, 0.35f, 0f - num5), 0.7f); SafeMark(new Vector3(0f - num5, 0.35f, num5), 0.7f); SafeMark(new Vector3(0f - num5, 0.35f, 0f - num5), 0.7f); } private static void BuildFallRing() { //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_003c: 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_0069: 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_0096: 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_00e8: 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) SafePad(new Vector3(-8.6f, 0.5f, -8.6f), new Vector3(3.4f, 1f, 3.4f)); SafePad(new Vector3(-8.6f, 0.5f, 8.6f), new Vector3(3.4f, 1f, 3.4f)); SafePad(new Vector3(8.6f, 0.5f, -8.6f), new Vector3(3.4f, 1f, 3.4f)); SafePad(new Vector3(8.6f, 0.5f, 8.6f), new Vector3(3.4f, 1f, 3.4f)); int num = 10; float num2 = 5.1f; for (int i = 0; i < num; i++) { float num3 = (float)i * (float)Math.PI * 2f / (float)num; FallBox(new Vector3(Mathf.Cos(num3) * num2, 0.38f, Mathf.Sin(num3) * num2), new Vector3(2.15f, 0.65f, 2.15f), wood: false, 0.45f + (float)(i % 3) * 0.12f); } } private static void BuildFallLanes() { //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_003c: 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_0069: 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_0096: 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_00e9: 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) SafePad(new Vector3(-9.2f, 0.5f, -3.2f), new Vector3(3.2f, 1f, 3.2f)); SafePad(new Vector3(-9.2f, 0.5f, 3.2f), new Vector3(3.2f, 1f, 3.2f)); SafePad(new Vector3(9.2f, 0.5f, -3.2f), new Vector3(3.2f, 1f, 3.2f)); SafePad(new Vector3(9.2f, 0.5f, 3.2f), new Vector3(3.2f, 1f, 3.2f)); float[] array = new float[3] { -2.4f, 0f, 2.4f }; for (int i = 0; i < array.Length; i++) { for (int j = 0; j < 5; j++) { FallBox(new Vector3(-5.2f + (float)j * 2.6f, 0.35f, array[i]), new Vector3(2.15f, 0.6f, 1.85f), wood: false, 0.4f + (float)j * 0.08f); } } } private static void BuildFallSteps() { //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_003c: 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_0069: 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_0096: 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_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_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_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_011d: 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_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_0153: 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_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_0189: 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_01a4: 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_01c6: 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) SafePad(new Vector3(-9f, 0.5f, -3f), new Vector3(3.2f, 1f, 3.2f)); SafePad(new Vector3(-9f, 0.5f, 3f), new Vector3(3.2f, 1f, 3.2f)); SafePad(new Vector3(9f, 0.5f, -3f), new Vector3(3.2f, 1f, 3.2f)); SafePad(new Vector3(9f, 0.5f, 3f), new Vector3(3.2f, 1f, 3.2f)); Vector3[] array = (Vector3[])(object)new Vector3[9] { new Vector3(-5.4f, 0.35f, -1.6f), new Vector3(-2.6f, 0.7f, 0.4f), new Vector3(0f, 1.05f, -0.8f), new Vector3(2.6f, 0.7f, 1.4f), new Vector3(5.4f, 0.35f, 0.2f), new Vector3(-3.8f, 0.35f, 2.6f), new Vector3(3.8f, 0.35f, -2.8f), new Vector3(0f, 0.35f, 3.2f), new Vector3(0f, 0.35f, -3.4f) }; for (int i = 0; i < array.Length; i++) { float num = 1.7f + (float)(i % 3) * 0.25f; FallBox(array[i], new Vector3(num, 0.55f, num), wood: false, 0.38f + (float)(i % 4) * 0.1f); } } private static void BuildSeesaw() { //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_0020: 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_0044: 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_00ac: 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_010e: 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_0113: 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_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_0173: 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_01a0: 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_01d4: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SeesawAnchor"); val.transform.SetParent(_root.transform, false); val.transform.localPosition = Vector3.zero; Rigidbody val2 = val.AddComponent<Rigidbody>(); val2.isKinematic = true; val2.useGravity = false; GameObject obj = Box(Vector3.zero, new Vector3(14f, 0.5f, 2.6f), wood: true); ((Object)obj).name = "Seesaw"; Rigidbody obj2 = obj.AddComponent<Rigidbody>(); obj2.mass = 90f; obj2.useGravity = false; obj2.linearDamping = 1.1f; obj2.angularDamping = 3.6f; obj2.centerOfMass = new Vector3(0f, -0.2f, 0f); obj2.constraints = (RigidbodyConstraints)46; ConfigurableJoint obj3 = obj.AddComponent<ConfigurableJoint>(); ((Joint)obj3).connectedBody = val2; ((Joint)obj3).autoConfigureConnectedAnchor = true; obj3.xMotion = (ConfigurableJointMotion)0; obj3.yMotion = (ConfigurableJointMotion)0; obj3.zMotion = (ConfigurableJointMotion)0; obj3.angularYMotion = (ConfigurableJointMotion)0; obj3.angularXMotion = (ConfigurableJointMotion)1; obj3.angularZMotion = (ConfigurableJointMotion)1; SoftJointLimit val3 = default(SoftJointLimit); ((SoftJointLimit)(ref val3)).limit = 18f; SoftJointLimit val4 = val3; val3 = default(SoftJointLimit); ((SoftJointLimit)(ref val3)).limit = -18f; obj3.lowAngularXLimit = val3; obj3.highAngularXLimit = val4; obj3.angularZLimit = val4; obj3.rotationDriveMode = (RotationDriveMode)1; JointDrive slerpDrive = default(JointDrive); ((JointDrive)(ref slerpDrive)).positionSpring = 70f; ((JointDrive)(ref slerpDrive)).positionDamper = 22f; ((JointDrive)(ref slerpDrive)).maximumForce = 1E+09f; obj3.slerpDrive = slerpDrive; obj3.targetRotation = Quaternion.identity; Box(new Vector3(0f, -0.55f, 0f), new Vector3(1.6f, 0.7f, 1.6f), wood: false); Mark(new Vector3(-5.8f, 0.4f, 0f)); Mark(new Vector3(5.8f, 0.4f, 0f)); } private static void BuildMovers() { //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_003c: 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_0069: 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_0096: 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_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_00eb: 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_0123: 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_015b: 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_0183: Unknown result type (might be due to invalid IL or missing references) SafePad(new Vector3(-9f, 0.5f, -3.2f), new Vector3(3.3f, 1f, 3.3f)); SafePad(new Vector3(-9f, 0.5f, 3.2f), new Vector3(3.3f, 1f, 3.3f)); SafePad(new Vector3(9f, 0.5f, -3.2f), new Vector3(3.3f, 1f, 3.3f)); SafePad(new Vector3(9f, 0.5f, 3.2f), new Vector3(3.3f, 1f, 3.3f)); MoveBox(new Vector3(-4f, 0.4f, -3.5f), new Vector3(-4f, 0.4f, 3.5f), new Vector3(2.6f, 0.55f, 2.6f), 4.2f, 0f); MoveBox(new Vector3(0f, 0.4f, 3.5f), new Vector3(0f, 0.4f, -3.5f), new Vector3(2.6f, 0.55f, 2.6f), 4.2f, 1.5f); MoveBox(new Vector3(4f, 0.4f, -3.5f), new Vector3(4f, 0.4f, 3.5f), new Vector3(2.6f, 0.55f, 2.6f), 4.2f, 3f); } private static void BuildMoveFerry() { //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_003c: 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_0069: 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_0096: 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_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_00eb: 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_0123: 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_015b: 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_0183: 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_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) SafePad(new Vector3(-8.6f, 0.5f, -8.6f), new Vector3(3.4f, 1f, 3.4f)); SafePad(new Vector3(8.6f, 0.5f, -8.6f), new Vector3(3.4f, 1f, 3.4f)); SafePad(new Vector3(-8.6f, 0.5f, 8.6f), new Vector3(3.4f, 1f, 3.4f)); SafePad(new Vector3(8.6f, 0.5f, 8.6f), new Vector3(3.4f, 1f, 3.4f)); MoveBox(new Vector3(-3.4f, 0.4f, -4.2f), new Vector3(-3.4f, 0.4f, 4.2f), new Vector3(2.5f, 0.55f, 2.5f), 5f, 0f); MoveBox(new Vector3(0f, 0.4f, 4.2f), new Vector3(0f, 0.4f, -4.2f), new Vector3(2.5f, 0.55f, 2.5f), 5f, 1.6f); MoveBox(new Vector3(3.4f, 0.4f, -4.2f), new Vector3(3.4f, 0.4f, 4.2f), new Vector3(2.5f, 0.55f, 2.5f), 5f, 3.2f); MoveBox(new Vector3(-6.2f, 0.9f, 0f), new Vector3(6.2f, 0.9f, 0f), new Vector3(2.2f, 0.5f, 2.2f), 6.2f, 0.8f); } private static void BuildMoveCircle() { //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_003c: 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_0069: 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_0096: 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_00c1: 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) SafePad(new Vector3(-9.2f, 0.5f, -9.2f), new Vector3(3.3f, 1f, 3.3f)); SafePad(new Vector3(-9.2f, 0.5f, 9.2f), new Vector3(3.3f, 1f, 3.3f)); SafePad(new Vector3(9.2f, 0.5f, -9.2f), new Vector3(3.3f, 1f, 3.3f)); SafePad(new Vector3(9.2f, 0.5f, 9.2f), new Vector3(3.3f, 1f, 3.3f)); for (int i = 0; i < 5; i++) { float phase = (float)i * ((float)Math.PI * 2f / 5f); OrbitBox(Vector3.zero, 4.4f, new Vector3(2.35f, 0.55f, 2.35f), 7.5f, phase); } } private static void BuildElevators() { //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_003c: 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_0069: 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_0091: 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_00c9: 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_0101: 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) SafePad(new Vector3(-8f, 0.5f, 0f), new Vector3(3.2f, 1f, 3.2f)); SafePad(new Vector3(8f, 0.5f, 0f), new Vector3(3.2f, 1f, 3.2f)); MoveBox(new Vector3(-3.5f, 0.4f, 0f), new Vector3(-3.5f, 6.5f, 0f), new Vector3(2.8f, 0.55f, 2.8f), 5.5f, 0f); MoveBox(new Vector3(0f, 6.5f, 0f), new Vector3(0f, 0.4f, 0f), new Vector3(2.8f, 0.55f, 2.8f), 5.5f, 0f); MoveBox(new Vector3(3.5f, 0.4f, 0f), new Vector3(3.5f, 6.5f, 0f), new Vector3(2.8f, 0.55f, 2.8f), 5.5f, 2.7f); } private static void BuildDropPath() { //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_003c: 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_0082: 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) SafePad(new Vector3(-9f, 0.5f, 0f), new Vector3(3.6f, 1f, 3.6f)); SafePad(new Vector3(9f, 0.5f, 0f), new Vector3(3.6f, 1f, 3.6f)); for (int i = 0; i < 6; i++) { FallBox(new Vector3(-5.5f + (float)i * 2.2f, 0.35f, (i % 2 == 0) ? 0.9f : (-0.9f)), new Vector3(1.8f, 0.55f, 1.8f), wood: true, 0.4f); } } private static void BuildDualSpin() { //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) //IL_002a: 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_0050: 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_0076: 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_00a5: 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_00bf: 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_00e5: 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_010b: 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_0140: 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) GameObject val = MakeSpin(new Vector3(-5.5f, 0f, 0f), 20f, Vector3.up); BoxOn(val.transform, Vector3.zero, new Vector3(10f, 0.6f, 2.1f), wood: true); BoxOn(val.transform, Vector3.zero, new Vector3(2.1f, 0.6f, 10f), wood: true); BoxOn(val.transform, Vector3.zero, new Vector3(2.4f, 0.75f, 2.4f), wood: false); GameObject obj = MakeSpin(new Vector3(5.5f, 0f, 0f), -20f, Vector3.up); BoxOn(obj.transform, Vector3.zero, new Vector3(10f, 0.6f, 2.1f), wood: true); BoxOn(obj.transform, Vector3.zero, new Vector3(2.1f, 0.6f, 10f), wood: true); BoxOn(obj.transform, Vector3.zero, new Vector3(2.4f, 0.75f, 2.4f), wood: false); MarkOn(val.transform, new Vector3(-4f, 0.5f, 0f)); MarkOn(obj.transform, new Vector3(4f, 0.5f, 0f)); } private static void BuildWindmill() { //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_003c: 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_0069: 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_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_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_00ce: 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) SafePad(new Vector3(-8.5f, 0.5f, 0f), new Vector3(3.4f, 1f, 3.4f)); SafePad(new Vector3(8.5f, 0.5f, 0f), new Vector3(3.4f, 1f, 3.4f)); GameObject obj = MakeSpin(new Vector3(0f, 4.2f, 0f), 28f, Vector3.forward); BoxOn(obj.transform, Vector3.zero, new Vector3(14f, 0.7f, 1.8f), wood: true); BoxOn(obj.transform, Vector3.zero, new Vector3(1.8f, 14f, 0.7f), wood: true); BoxOn(obj.transform, Vector3.zero, new Vector3(2.2f, 2.2f, 2.2f), wood: false); } private static void BuildCross() { //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_003e: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fa: 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) Box(new Vector3(0f, 0.4f, 0f), new Vector3(16f, 0.75f, 3.2f), wood: false); Box(new Vector3(0f, 0.4f, 0f), new Vector3(3.2f, 0.75f, 16f), wood: false); Box(new Vector3(0f, 0.85f, 0f), new Vector3(3.6f, 0.6f, 3.6f), wood: true); Box(new Vector3(6.5f, 1.8f, 0f), new Vector3(2f, 0.45f, 2f), wood: true); Box(new Vector3(-6.5f, 1.8f, 0f), new Vector3(2f, 0.45f, 2f), wood: true); Mark(new Vector3(-7.2f, 0.9f, 0f)); Mark(new Vector3(7.2f, 0.9f, 0f)); } private static void BuildOceanBridge() { //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_0064: 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_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_00ab: 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_00df: 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_0100: Unknown result type (might be due to invalid IL or missing references) FindPlankAsset(out var mesh, out var mats); float num = 8.5f; float num2 = 4.2f; float num3 = 0.5f; float num4 = 0.62f; float num5 = num + num2 * 2f; float num6 = (num + num2) * 0.5f; LayDockRun(mesh, mats, new Vector3(0f, num4, num6), new Vector3(num5, num3, num2)); LayDockRun(mesh, mats, new Vector3(0f, num4, 0f - num6), new Vector3(num5, num3, num2)); LayDockRun(mesh, mats, new Vector3(num6, num4, 0f), new Vector3(num2, num3, num)); LayDockRun(mesh, mats, new Vector3(0f - num6, num4, 0f), new Vector3(num2, num3, num)); float num7 = num4 + num3 * 0.5f; float num8 = num6; Mark(new Vector3(0f - num8, num7, 0f - num8)); Mark(new Vector3(0f - num8, num7, num8)); Mark(new Vector3(num8, num7, 0f - num8)); Mark(new Vector3(num8, num7, num8)); Debug.Log((object)("[HowToFishPvp] Ocean docks mesh=" + (((Object)(object)mesh != (Object)null) ? ((Object)mesh).name : "wood box") + " hole=" + num)); } private static void LayDockRun(Mesh mesh, Material[] mats, Vector3 center, Vector3 size) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0042: 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_005f: 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_0083: 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) GameObject val = new GameObject("OceanDock"); val.layer = _layer; try { val.tag = "Level"; } catch { } val.transform.SetParent(_root.transform, false); val.transform.localPosition = center; val.transform.localRotation = Quaternion.identity; BoxCollider obj2 = val.AddComponent<BoxCollider>(); obj2.center = Vector3.zero; obj2.size = size; if ((Object)(object)mesh != (Object)null) { TilePlanks(val, mesh, mats, size); } else { StampCube(val, size, wood: true); } } private static void TilePlanks(GameObject dest, Mesh mesh, Material[] mats, Vector3 size) { //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_0010: 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_0042: 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_0078: 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_008a: 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_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_00b0: 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_00c4: 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_0125: 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_0136: 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_011a: 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_0169: 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_017a: 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_0153: 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_017f: 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_01ae: 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_01cb: 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_01de: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = mesh.bounds; Vector3 size2 = ((Bounds)(ref bounds)).size; if (size2.x < 0.05f) { size2.x = 1f; } if (size2.y < 0.05f) { size2.y = 1f; } if (size2.z < 0.05f) { size2.z = 1f; } bool flag = size2.x >= size2.z; float num = (flag ? size2.x : size2.z); float num2 = (flag ? size2.z : size2.x); bool flag2 = size.x >= size.z; float num3 = (flag2 ? size.x : size.z); float num4 = (flag2 ? size.z : size.x); int num5 = Mathf.Max(1, Mathf.RoundToInt(num3 / Mathf.Max(0.85f, num))); float num6 = num3 / (float)num5; float num7 = ((flag == flag2) ? 0f : 90f); Vector3 ls = (flag ? new Vector3(num6 / num, size.y / size2.y, num4 / num2) : new Vector3(num4 / num2, size.y / size2.y, num6 / num)); if (num7 != 0f) { ls = (flag ? new Vector3(num4 / num2, size.y / size2.y, num6 / num) : new Vector3(num6 / num, size.y / size2.y, num4 / num2)); } for (int i = 0; i < num5; i++) { float num8 = (0f - num3) * 0.5f + num6 * ((float)i + 0.5f); Vector3 lp = (flag2 ? new Vector3(num8, 0f, 0f) : new Vector3(0f, 0f, num8)); AddMeshPart(dest, mesh, mats, lp, Quaternion.Euler(0f, num7, 0f), ls); } } private static void FindPlankAsset(out Mesh mesh, out Material[] mats) { mesh = null; mats = null; int num = 99; try { MeshFilter[] array = Resources.FindObjectsOfTypeAll<MeshFilter>(); if (array != null) { foreach (MeshFilter val in array) { if ((Object)(object)val == (Object)null || (Object)(object)val.sharedMesh == (Object)null || ((Object)(object)_root != (Object)null && ((Component)val).transform.IsChildOf(_root.transform))) { continue; } int num2 = PlankRank(((Object)((Component)val).gameObject).name + " " + ((Object)val.sharedMesh).name, val.sharedMesh); if (num2 < num) { num = num2; mesh = val.sharedMesh; MeshRenderer component = ((Component)val).GetComponent<MeshRenderer>(); if ((Object)(object)component != (Object)null && ((Renderer)component).sharedMaterials != null && ((Renderer)component).sharedMaterials.Length != 0) { mats = ((Renderer)component).sharedMaterials; } if (num2 == 0) { break; } } } } } catch { } if ((Object)(object)mesh != (Object)null) { return; } try { Mesh[] array2 = Resources.FindObjectsOfTypeAll<Mesh>(); if (array2 == null) { return; } foreach (Mesh val2 in array2) { if (!((Object)(object)val2 == (Object)null) && UsablePropMesh(val2)) { int num3 = PlankRank(((Object)val2).name, val2); if (num3 < num) { num = num3; mesh = val2; } } } } catch { } } private static int PlankRank(string name, Mesh m) { //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_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_0050: 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_005c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m == (Object)null) { return 99; } string text = name.ToLowerInvariant(); if (text.IndexOf("curve") >= 0 || text.IndexOf("combined") >= 0 || text.IndexOf("batch") >= 0) { return 99; } Bounds bounds = m.bounds; Vector3 size = ((Bounds)(ref bounds)).size; float num = Mathf.Max(size.x, Mathf.Max(size.y, size.z)); if (num < 0.35f || num > 22f) { return 99; } string text2 = ((Object)m).name.ToLowerInvariant(); if (text2 == "plank") { return 0; } if (text2.IndexOf("plank") >= 0) { return 1; } if (text2.IndexOf("docks") >= 0 || text.IndexOf("docks") >= 0) { return 2; } if (text2.IndexOf("dock") >= 0 || text.IndexOf("pier") >= 0 || text.IndexOf("walkway") >= 0 || text.IndexOf("boardwalk") >= 0 || text.IndexOf("jetty") >= 0) { return 3; } return 99; } private static GameObject MakeSpin(Vector3 localPos, float deg, Vector3 axis) { //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_0015: 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_0031: Unknown result type (might be due to invalid IL or missing