Decompiled source of RavenwoodPieces v2.0.4
plugins/RavenwoodPieces/RavenwoodPieces.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("RavenwoodPieces")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MagicMike")] [assembly: AssemblyProduct("RavenwoodPieces")] [assembly: AssemblyCopyright("Copyright © MagicMike 2025RavenwoodPieces")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")] [assembly: AssemblyFileVersion("2.0.4")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.4.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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; } } } public class Elevator : MonoBehaviour { public bool m_canMove = true; public float m_speed = 2f; public int m_startPoint; public Transform[] m_points; private int i; private bool m_reverse; public static readonly int m_elevatorPosition = StringExtensionMethods.GetStableHashCode("elevatorPosition"); private ZNetView m_nview; public void Start() { //IL_0079: 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) m_nview = ((Component)this).gameObject.GetComponentInParent<ZNetView>(); if ((Object)(object)m_nview != (Object)null && m_nview.GetZDO() != null) { i = m_nview.GetZDO().GetInt(m_elevatorPosition, 0); ((Component)this).transform.position = m_points[i].position; } else { ((Component)this).transform.position = m_points[m_startPoint].position; i = m_startPoint; } } public void Update() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)m_nview != (Object)null) || m_nview.GetZDO() == null) { return; } if (Vector3.Distance(((Component)this).transform.position, m_points[i].position) < 0.01f) { m_canMove = false; if (i == m_points.Length - 1) { m_reverse = true; i--; return; } if (i == 0) { m_reverse = false; i++; return; } if (m_reverse) { i--; } else { i++; } } if (m_canMove) { ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, m_points[i].position, m_speed * Time.deltaTime); m_nview.GetZDO().Set(m_elevatorPosition, i, false); } } } public class ElevatorSwitch : MonoBehaviour, Hoverable, Interactable { public Elevator m_elevator; private string m_name; private Piece m_piece; private void Start() { m_piece = ((Component)this).gameObject.GetComponentInParent<Piece>(); m_name = m_piece.m_name; } public string GetHoverText() { return Localization.instance.Localize(m_name + "\n[<color=yellow><b>$KEY_Use</b></color>] $text_fb_use_elevator"); } public string GetHoverName() { return m_name; } public bool Interact(Humanoid human, bool hold, bool alt) { if (hold) { return false; } if (m_elevator.m_canMove) { return true; } m_elevator.m_speed = 2f; m_elevator.m_canMove = true; return true; } public bool UseItem(Humanoid user, ItemData item) { return false; } } public class ParentPlatform : MonoBehaviour { private Piece m_piece; private void Start() { m_piece = ((Component)this).gameObject.GetComponentInParent<Piece>(); } private void OnCollisionEnter(Collision other) { other.transform.SetParent(((Component)this).transform); other.gameObject.GetComponent<Rigidbody>().interpolation = (RigidbodyInterpolation)0; m_piece.m_canBeRemoved = false; } private void OnCollisionExit(Collision other) { other.transform.SetParent((Transform)null); other.gameObject.GetComponent<Rigidbody>().interpolation = (RigidbodyInterpolation)1; m_piece.m_canBeRemoved = true; } } public class TriggerPlatform : MonoBehaviour { public Elevator m_platform; private void OnTriggerEnter(Collider other) { } } namespace RavenwoodPieces { internal class FB_Pieces { public static EffectList buildWood; public static EffectList breakWood; public static EffectList hitWood; public static EffectList buildMetal; public static EffectList breakMetal; public static EffectList hitMetal; public static EffectList buildStone; public static EffectList breakStone; public static EffectList hitStone; public static EffectList portcullisOpen; public static EffectList portcullisClose; public static EffectList portcullisLocked; public static EffectList gateOpen; public static EffectList gateClose; public static EffectList gateLocked; public static EffectList doorOpen; public static EffectList doorClose; public static EffectList doorLocked; public static EffectList addFuel; public static ItemDrop fuelResin; public static void AddPieces() { AddFX(); AddFortressWallEnd(); AddFortressWall(); AddFortressWallStairLeft(); AddFortressWallStairRight(); AddFortressWallCorner(); AddFortressWallCross(); AddFortressWallTJunction(); AddFortressWallTower(); AddFortressWallPortcullis(); AddPortcullisGate(); AddFortressWallGateway(); AddFortressGates(); AddBridge01(); AddBridge02(); AddBridgeStairs(); AddShelter01(); AddHouse01(); AddHouse02(); AddHouse03(); AddHouse04(); AddVikingHouse01(); AddVikingHouse02(); AddVikingHouse03(); AddVikingHouse04(); AddVikingHouse05(); AddVikingHouse06(); AddVikingHouse07(); AddVikingHouse08(); AddWoodDoor01(); } public static void AddFX() { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00d9: 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_00e6: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Expected O, but got Unknown //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Expected O, but got Unknown //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Expected O, but got Unknown //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Expected O, but got Unknown //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Expected O, but got Unknown //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Expected O, but got Unknown //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Expected O, but got Unknown //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Expected O, but got Unknown //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Expected O, but got Unknown //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Expected O, but got Unknown //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Expected O, but got Unknown //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Expected O, but got Unknown //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Expected O, but got Unknown //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Expected O, but got Unknown //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Expected O, but got Unknown //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Expected O, but got Unknown //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Expected O, but got Unknown //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Expected O, but got Unknown //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Expected O, but got Unknown GameObject prefab = Cache.GetPrefab<GameObject>("sfx_build_hammer_wood"); GameObject prefab2 = Cache.GetPrefab<GameObject>("sfx_wood_break"); GameObject prefab3 = Cache.GetPrefab<GameObject>("sfx_wood_hit"); GameObject prefab4 = Cache.GetPrefab<GameObject>("sfx_build_hammer_metal"); GameObject prefab5 = Cache.GetPrefab<GameObject>("sfx_metal_shield_blocked"); GameObject prefab6 = Cache.GetPrefab<GameObject>("sfx_metal_blocked"); GameObject prefab7 = Cache.GetPrefab<GameObject>("sfx_build_hammer_stone"); GameObject prefab8 = Cache.GetPrefab<GameObject>("sfx_rock_destroyed"); GameObject prefab9 = Cache.GetPrefab<GameObject>("sfx_rock_hit"); GameObject prefab10 = Cache.GetPrefab<GameObject>("sfx_open_portcullis_fb"); GameObject prefab11 = Cache.GetPrefab<GameObject>("sfx_close_portcullis_fb"); GameObject prefab12 = Cache.GetPrefab<GameObject>("sfx_darkwood_door_open"); GameObject prefab13 = Cache.GetPrefab<GameObject>("sfx_darkwood_door_close"); GameObject prefab14 = Cache.GetPrefab<GameObject>("sfx_door_open"); GameObject prefab15 = Cache.GetPrefab<GameObject>("sfx_door_close"); GameObject prefab16 = Cache.GetPrefab<GameObject>("vfx_walltorch_addFuel"); GameObject prefab17 = Cache.GetPrefab<GameObject>("sfx_FireAddFuel"); EffectList val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab } }; buildWood = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab2 } }; breakWood = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab3 } }; hitWood = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab4 } }; buildMetal = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab5 } }; breakMetal = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab6 } }; hitMetal = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab7 } }; buildStone = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab8 } }; breakStone = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab9 } }; hitStone = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab10 } }; portcullisOpen = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab11 } }; portcullisClose = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab6 } }; portcullisLocked = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab12 } }; gateOpen = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab13 } }; gateClose = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab3 } }; gateLocked = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab14 } }; doorOpen = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab15 } }; doorClose = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab3 } }; doorLocked = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[2] { new EffectData { m_prefab = prefab16 }, new EffectData { m_prefab = prefab17 } }; addFuel = val; fuelResin = Cache.GetPrefab<GameObject>("Resin").GetComponent<ItemDrop>(); } public static void AddFortressWallEnd() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_end"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 200, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWall() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 300, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallStairLeft() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_stair_left"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 400, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallStairRight() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_stair_right"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 400, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallCorner() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_corner"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 300, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallCross() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_cross"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 500, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallTJunction() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_tjunction"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 400, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallTower() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_tower"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "Stone", Amount = 400, Recover = true }, new RequirementConfig { Item = "RoundLog", Amount = 20, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallPortcullis() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_portcullis"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 300, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddPortcullisGate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_portcullis"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "forge"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Iron", Amount = 20, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildMetal; Door component = val.GetComponent<Door>(); component.m_openEffects = portcullisOpen; component.m_closeEffects = portcullisClose; component.m_lockedEffects = portcullisLocked; PieceManager.Instance.AddPiece(val3); } public static void AddFortressWallGateway() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_wall_gateway"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Stone", Amount = 300, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildStone; PieceManager.Instance.AddPiece(val3); } public static void AddFortressGates() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_fortress_gates"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "forge"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "Wood", Amount = 20, Recover = true }, new RequirementConfig { Item = "Iron", Amount = 10, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; Door component = val.GetComponent<Door>(); component.m_openEffects = gateOpen; component.m_closeEffects = gateClose; component.m_lockedEffects = gateLocked; PieceManager.Instance.AddPiece(val3); } public static void AddBridge01() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_bridge_01"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_workbench"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "Wood", Amount = 200, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 100, Recover = true } }; CustomPiece val3 = new CustomPiece(val, false, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddBridge02() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_bridge_02"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_workbench"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Wood", Amount = 100, Recover = true } }; CustomPiece val3 = new CustomPiece(val, false, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddBridgeStairs() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0061: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_bridge_stairs"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_workbench"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Wood", Amount = 8, Recover = true } }; CustomPiece val3 = new CustomPiece(val, false, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddShelter01() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00a9: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00cb: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_shelter_01"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 200, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 100, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 50, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddHouse01() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_house_01"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 200, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 300, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 50, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddHouse02() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_house_02"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 150, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 200, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 80, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddHouse03() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_house_03"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 200, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 400, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 100, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddHouse04() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00d1: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_house_04"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 450, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 200, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 400, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 100, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse01() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_01"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 200, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 400, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 50, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse02() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_02"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "Wood", Amount = 400, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 200, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 50, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse03() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_03"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 600, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 300, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 200, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 150, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse04() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00d1: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_04"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 400, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 150, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 400, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 95, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse05() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_05"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 200, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 300, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 50, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse06() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00d1: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_06"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 400, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 200, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 400, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 100, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse07() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_07"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 600, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 400, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 50, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddVikingHouse08() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0087: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_viking_house_08"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_stonecutter"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = "Wood", Amount = 200, Recover = true }, new RequirementConfig { Item = "FineWood", Amount = 100, Recover = true }, new RequirementConfig { Item = "Stone", Amount = 200, Recover = true }, new RequirementConfig { Item = "Resin", Amount = 50, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; PieceManager.Instance.AddPiece(val3); } public static void AddWoodDoor01() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0061: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.fbpieces.LoadAsset<GameObject>("fb_wood_door_01"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_workbench"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[1] { new RequirementConfig { Item = "Wood", Amount = 4, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; Door component = val.GetComponent<Door>(); component.m_openEffects = doorOpen; component.m_closeEffects = doorClose; component.m_lockedEffects = doorLocked; PieceManager.Instance.AddPiece(val3); } } internal class LocalisedText { public static CustomLocalization Localization = LocalizationManager.Instance.GetLocalization(); public static void AddLocalisations() { CustomLocalization localization = Localization; string text = "English"; localization.AddTranslation(ref text, new Dictionary<string, string> { { "piece_fb_wall_end", "Fortress Wall End" }, { "piece_fb_wall", "Fortress Wall" }, { "piece_fb_wall_stair_left", "Fortress Wall Stair Left" }, { "piece_fb_wall_stair_right", "Fortress Wall Stair Right" }, { "piece_fb_wall_corner", "Fortress Wall Corner" }, { "piece_fb_wall_cross", "Fortress Wall Cross" }, { "piece_fb_wall_tjunction", "Fortress Wall T-Junction" }, { "piece_fb_wall_tower", "Fortress Wall Tower" }, { "piece_fb_wall_portcullis", "Fortress Wall Portcullis" }, { "piece_fb_portcullis", "Portcullis Gate" }, { "piece_fb_wall_gateway", "Fortress Wall Gateway" }, { "piece_fb_wall_gates", "Wall Gate" }, { "piece_fb_bridge_01", "Roofed Wood Bridge" }, { "piece_fb_bridge_02", "Wood Bridge" }, { "piece_fb_bridge_stairs", "Bridge Stairs" }, { "piece_fb_shelter_01", "Shelter" }, { "piece_fb_house_01", "House 01" }, { "piece_fb_house_02", "House 02" }, { "piece_fb_house_03", "House 03" }, { "piece_fb_house_04", "House 04" }, { "piece_fb_viking_house_01", "Viking House 01" }, { "piece_fb_viking_house_02", "Viking House 02" }, { "piece_fb_viking_house_03", "Viking House 03" }, { "piece_fb_viking_house_04", "Viking House 04" }, { "piece_fb_viking_house_05", "Viking House 05" }, { "piece_fb_viking_house_06", "Viking House 06" }, { "piece_fb_viking_house_07", "Viking House 07" }, { "piece_fb_viking_house_08", "Viking House 08" }, { "piece_fb_wood_doorway_01", "Wood Doorway 01" }, { "piece_fb_wood_doorway_02", "Wood Doorway 02" }, { "piece_fb_wood_doorway_03", "Wood Doorway 03" }, { "piece_fb_wood_door_01", "Wood Door 01" }, { "piece_fb_wood_door_02", "Wood Door 02" }, { "piece_fb_wood_door_03", "Wood Door 03" }, { "text_fb_door", "Door" }, { "text_fb_window", "Window" }, { "text_fb_window_open", "Open" }, { "text_fb_window_close", "Close" }, { "text_fb_use_elevator", "Use Elevator" } }); } } internal class GamePatches { [HarmonyPatch(typeof(EffectArea))] internal static class EffectAreaPatch { [HarmonyPostfix] [HarmonyPatch("Awake")] private static void AwakePostfix(EffectArea __instance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)__instance.m_type == 32) { __instance.m_statusEffect = "NoMonstersStatus"; __instance.m_statusEffectHash = StringExtensionMethods.GetStableHashCode("NoMonstersStatus"); } } [HarmonyPrefix] [HarmonyPatch("CustomFixedUpdate")] private static void CustomFixedUpdatePrefex(EffectArea __instance, float deltaTime) { if (Object.op_Implicit((Object)(object)__instance)) { __instance.m_collidedWithCharacter = __instance.m_collidedWithCharacter.Where((Character x) => IsValidCollidedWithCharacter(x)).ToList(); } } private static bool IsValidCollidedWithCharacter(Character item) { if (!Object.op_Implicit((Object)(object)item) || item.GetSEMan() == null || !Object.op_Implicit((Object)(object)item.GetSEMan().m_nview) || !item.GetSEMan().m_nview.IsValid()) { return false; } return true; } } [HarmonyPatch(typeof(Player))] internal static class PlayerPatch { [HarmonyPostfix] [HarmonyPatch("UpdateEnvStatusEffects")] private static void UpdateEnvStatusEffectsPostFix(Player __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) EffectArea val = EffectArea.IsPointInsideArea(((Component)__instance).transform.position, (Type)32, 1f); if (((Character)__instance).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("NoMonstersStatus")) && !Object.op_Implicit((Object)(object)val)) { ((Character)__instance).m_seman.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("NoMonstersStatus"), false); } } } [HarmonyPatch(typeof(ZNetScene), "Awake")] private static class ZNetSceneSoundsPatch { private static void Postfix(ZNetScene __instance) { GameObject prefab = __instance.GetPrefab("sfx_elevator_fb"); GameObject prefab2 = __instance.GetPrefab("sfx_open_portcullis_fb"); GameObject prefab3 = __instance.GetPrefab("sfx_close_portcullis_fb"); try { prefab.GetComponentInChildren<AudioSource>().outputAudioMixerGroup = AudioMan.instance.m_ambientMixer; prefab2.GetComponentInChildren<AudioSource>().outputAudioMixerGroup = AudioMan.instance.m_ambientMixer; prefab3.GetComponentInChildren<AudioSource>().outputAudioMixerGroup = AudioMan.instance.m_ambientMixer; } catch { Logger.LogError((object)"Error with ZNetSceneSoundsPatch!"); } } } } [BepInPlugin("MagicMike.RavenwoodPieces", "RavenwoodPieces", "2.0.4")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class RavenwoodPiecesPlugin : BaseUnityPlugin { internal const string PluginName = "RavenwoodPieces"; internal const string PluginVersion = "2.0.4"; internal const string PluginAuthor = "MagicMike"; internal const string PluginGUID = "MagicMike.RavenwoodPieces"; internal const string PluginCopy = "Copyright © MagicMike 2025RavenwoodPieces"; private CustomLocalization Localization = LocalizationManager.Instance.GetLocalization(); public static RavenwoodPiecesPlugin plugininstance; public static AssetBundle rwpieces; public static string piecesBundle = "ravenwoodpieces"; public static AssetBundle rwpiecesnew; public static string piecesBundleNew = "ravenwoodpiecesnew"; public static AssetBundle fbpieces; public static string piecesBundleFB = "villagestuff"; private Harmony harmony = new Harmony("MagicMike.RavenwoodPieces"); public void Awake() { LoadAssetBundles(); LoadAssets(); LocalisedText.AddLocalisations(); PrefabManager.OnVanillaPrefabsAvailable += AddRWEffects; PrefabManager.OnVanillaPrefabsAvailable += AddRWPieces; PrefabManager.OnVanillaPrefabsAvailable += AddFBPieces; harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "MagicMike.RavenwoodPieces"); Game.isModded = true; } public static void LoadAssetBundles() { rwpieces = AssetUtils.LoadAssetBundleFromResources(piecesBundle, Assembly.GetExecutingAssembly()); if ((Object)(object)rwpieces == (Object)null) { Logger.LogError((object)("Failed to load asset bundle with name: " + piecesBundle)); } rwpiecesnew = AssetUtils.LoadAssetBundleFromResources(piecesBundleNew, Assembly.GetExecutingAssembly()); if ((Object)(object)rwpiecesnew == (Object)null) { Logger.LogError((object)("Failed to load asset bundle with name: " + piecesBundleNew)); } fbpieces = AssetUtils.LoadAssetBundleFromResources(piecesBundleFB, Assembly.GetExecutingAssembly()); if ((Object)(object)fbpieces == (Object)null) { Logger.LogError((object)("Failed to load asset bundle with name: " + piecesBundleFB)); } } public static void LoadAssets() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown try { CustomPrefab val = new CustomPrefab(fbpieces.LoadAsset<GameObject>("sfx_elevator_fb"), true); PrefabManager.Instance.AddPrefab(val); CustomPrefab val2 = new CustomPrefab(fbpieces.LoadAsset<GameObject>("sfx_open_portcullis_fb"), true); PrefabManager.Instance.AddPrefab(val2); CustomPrefab val3 = new CustomPrefab(fbpieces.LoadAsset<GameObject>("sfx_close_portcullis_fb"), true); PrefabManager.Instance.AddPrefab(val3); } catch (Exception ex) { Logger.LogError((object)("Exception caught while loading Custom Assets: " + ex.Message)); } } public static void AddRWEffects() { try { RW_StatusEffects.LoadStatusEffects(); } catch (Exception ex) { Logger.LogError((object)("Exception caught while adding Ravenwood Effects: " + ex.Message)); } finally { PrefabManager.OnVanillaPrefabsAvailable -= AddRWEffects; } } public static void AddRWPieces() { try { RW_Pieces.AddPieces(); } catch (Exception ex) { Logger.LogError((object)("Exception caught while adding Ravenwood Pieces: " + ex.Message)); } finally { PrefabManager.OnVanillaPrefabsAvailable -= AddRWPieces; } } public static void AddFBPieces() { try { FB_Pieces.AddPieces(); } catch (Exception ex) { Logger.LogError((object)("Exception caught while adding Ravenwood Pieces: " + ex.Message)); } finally { PrefabManager.OnVanillaPrefabsAvailable -= AddFBPieces; } } } public class RW_Pieces { public static EffectList buildWood; public static EffectList breakWood; public static EffectList hitWood; public static EffectList buildStone; public static EffectList breakStone; public static EffectList hitStone; public static EffectList buildMetal; public static EffectList breakMetal; public static EffectList hitMetal; public static EffectList doorOpen; public static EffectList doorClose; public static EffectList addFuel; public static GameObject _gameObject; public static CustomPiece _customPiece; public static void AddPieces() { SetupGamePrefabs(); AddMonsterProtector10m(); AddMonsterProtector25m(); AddMonsterProtector50m(); AddMonsterProtector75m(); AddMonsterProtector100m(); AddDisplaycase(); AddStepladders(); AddDoubleDoors(); AddFloor1x1(); AddFloor2x2(); AddFloor4x4(); AddFloor8x8(); AddFloorCorner1x1(); AddFloorCorner2x2(); AddWall1x1(); AddWall2x2(); AddWall4x4(); AddWall8x8(); AddAsksvinSign(); AddLoxSign(); AddBlackBearSign(); AddBrownBearSign(); AddBoarSign(); AddRazorBackSign(); AddDarkhornSign(); AddProwlerSign(); AddFoxSign(); AddWolfSign(); AddChickenSign(); AddCastleWall(); AddCastleTower(); AddCastleGateway(); AddCastleFloor2x2(); AddCastleFloor4x4(); AddCastleFloor8x8(); AddLargeWall(); AddLargeWallCorner(); AddLargeWallCross(); AddLargeWallTjunction(); AddLargeWallStairs(); AddLargeWallStairsReverse(); AddLargeWallGateway(); AddLargeWallTower(); AddLargeWallEnd(); AddLargeWallGlass(); AddLargeWallGate(); AddLargeWallMarble(); AddLargeWallStairsMarble(); AddLargeWallStairsMarbleReverse(); AddLargeWallGatewayMarble(); AddLargeWallTowerMarble(); AddLargeWallCornerMarble(); AddLargeWallMarbleGlass(); AddLargeWallMossy(); AddLargeWallStairsMossy(); AddLargeWallStairsMossyReverse(); AddLargeWallGatewayMossy(); AddLargeWallTowerMossy(); AddLargeWallCornerMossy(); AddLargeWallIce(); AddLargeWallStairsIce(); AddLargeWallStairsIceReverse(); AddLargeWallGatewayIce(); AddLargeWallTowerIce(); AddLargeWallCornerIce(); AddLargeWallIceGlass(); AddLargeWallLava(); AddLargeWallStairsLava(); AddLargeWallStairsLavaReverse(); AddLargeWallGatewayLava(); AddLargeWallTowerLava(); AddLargeWallCornerLava(); AddOakTree(); AddAshwoodTree(); AddAncientTree(); AddFirTreeSmall(); AddFirTreeMedium(); AddFirTreeLarge(); AddFirTreeMassive(); AddPineTree(); AddWillowTree(); AddSakuraTree01(); AddSakuraTree02(); AddSakuraTree03(); AddSakuraTree04(); AddMapleTree01(); AddMapleTree02(); AddHedgeStraight(); AddHedgeAngle15(); AddHedgeAngle45(); AddHedgeAngle90(); AddHedgeArch(); AddHedgeHalfH(); AddHedgeHalfV(); AddHedgeQuater(); AddRoadStraight(); AddRoadAngled(); AddRoadCurved(); AddRoadCross(); AddRoadTjunction(); AddRoadLjunction(); AddRoadSupport(); } public static void SetupGamePrefabs() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00e3: 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_00f0: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Expected O, but got Unknown //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Expected O, but got Unknown //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown GameObject prefab = Cache.GetPrefab<GameObject>("sfx_build_hammer_wood"); GameObject prefab2 = Cache.GetPrefab<GameObject>("sfx_wood_break"); GameObject prefab3 = Cache.GetPrefab<GameObject>("sfx_wood_hit"); GameObject prefab4 = Cache.GetPrefab<GameObject>("sfx_build_hammer_stone"); GameObject prefab5 = Cache.GetPrefab<GameObject>("sfx_rock_hit"); GameObject prefab6 = Cache.GetPrefab<GameObject>("sfx_build_hammer_metal"); GameObject prefab7 = Cache.GetPrefab<GameObject>("sfx_metal_blocked"); Cache.GetPrefab<GameObject>("vfx_walltorch_addFuel"); Cache.GetPrefab<GameObject>("sfx_FireAddFuel"); GameObject prefab8 = Cache.GetPrefab<GameObject>("sfx_door_open"); GameObject prefab9 = Cache.GetPrefab<GameObject>("sfx_door_close"); EffectList val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab } }; buildWood = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab2 } }; breakWood = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab3 } }; hitWood = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab4 } }; buildStone = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab5 } }; breakStone = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab5 } }; hitStone = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab6 } }; buildMetal = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab7 } }; breakMetal = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab7 } }; hitMetal = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab8 } }; doorOpen = val; val = new EffectList(); val.m_effectPrefabs = (EffectData[])(object)new EffectData[1] { new EffectData { m_prefab = prefab9 } }; doorClose = val; } public static void AddMonsterProtector10m() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0061: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.rwpiecesnew.LoadAsset<GameObject>("rp_monster_protector_red_new"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_workbench"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "Wood", Amount = 2, Recover = true }, new RequirementConfig { Item = "Mushroom", Amount = 10, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; EffectArea component = ((Component)Utils.FindChild(val.transform, "nomonsters", (IterativeSearchType)0)).GetComponent<EffectArea>(); component.m_statusEffect = "NoMonstersStatus"; component.m_statusEffectHash = StringExtensionMethods.GetStableHashCode("NoMonstersStatus"); PieceManager.Instance.AddPiece(val3); } public static void AddMonsterProtector25m() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0061: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.rwpiecesnew.LoadAsset<GameObject>("rp_monster_protector_yellow_new"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_workbench"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "Wood", Amount = 2, Recover = true }, new RequirementConfig { Item = "MushroomYellow", Amount = 10, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; EffectArea component = ((Component)Utils.FindChild(val.transform, "nomonsters", (IterativeSearchType)0)).GetComponent<EffectArea>(); component.m_statusEffect = "NoMonstersStatus"; component.m_statusEffectHash = StringExtensionMethods.GetStableHashCode("NoMonstersStatus"); PieceManager.Instance.AddPiece(val3); } public static void AddMonsterProtector50m() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0061: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown GameObject val = RavenwoodPiecesPlugin.rwpiecesnew.LoadAsset<GameObject>("rp_monster_protector_blue_new"); PieceConfig val2 = new PieceConfig(); val2.CraftingStation = "piece_workbench"; val2.PieceTable = "_HammerPieceTable"; val2.Category = "Ravenwood-Pieces"; val2.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig { Item = "Wood", Amount = 2, Recover = true }, new RequirementConfig { Item = "MushroomBlue", Amount = 10, Recover = true } }; CustomPiece val3 = new CustomPiece(val, true, val2); val.GetComponent<Piece>().m_placeEffect = buildWood; EffectArea component = ((Component)Utils.FindChild(val.transform, "nomonsters", (IterativeSearchType)0)).GetComponent<EffectArea>(); component.m_statusEffect = "NoMonstersStatus"; component.m_statusEffectHash = StringExtensionMethods.GetStableHashCode("NoMonstersStatus"); PieceManager.Instance.AddPiece(val3); } public static void AddMonsterProtector75m() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0061: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (migh