Quellcode durchsuchen

[StasisPod] 2.0.3.8 init

Zariteis vor 4 Jahren
Ursprung
Commit
130a08e2e2

BIN
StasisPod/Assets/iStasisPod.png


BIN
StasisPod/Assets/stasisPod.png


BIN
StasisPod/Assets/stasisPodOn.pdn


BIN
StasisPod/Assets/stasisPodOn.png


BIN
StasisPod/Assets/stasispod


+ 14 - 0
StasisPod/Core.cs

@@ -0,0 +1,14 @@
+using GadgetCore;
+using GadgetCore.API;
+
+namespace StasisPod
+{
+  internal static class Core
+  {
+    public static int itemStasisPodId = -1;
+    public static int npcID = -1;
+    public static MenuInfo menu = null;
+
+    public static GadgetLogger logger;
+  }
+}

+ 25 - 0
StasisPod/ItemUtil.cs

@@ -0,0 +1,25 @@
+using GadgetCore.API;
+using UnityEngine;
+
+namespace StasisPod
+{
+  public static class ItemUtil
+  {
+    public static TileInfo CreatePlacableItem(string tileImgPath, string itemImgPath, string name, GameObject tileObject)
+    {
+
+      Texture2D textureTile = GadgetCoreAPI.LoadTexture2D(tileImgPath);
+      Texture2D textureItem = GadgetCoreAPI.LoadTexture2D(itemImgPath);
+
+      GameObject gameObject = Object.Instantiate(tileObject);
+      gameObject.name = name;
+      gameObject.AddComponent<StasisPodScript>();
+
+      ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, name, "", textureItem);
+      itemInfo.Register(name);
+      var tile = new TileInfo(TileType.INTERACTIVE, textureTile, gameObject, itemInfo);
+      tile.Register(name);
+      return tile;
+    }
+  }
+}

+ 4 - 0
StasisPod/Manifest.ini

@@ -0,0 +1,4 @@
+[Metadata]
+Name=Stasis Pod
+Assembly=StasisPod.dll
+Dependencies=Scrap Yard

+ 1 - 0
StasisPod/ModInfo.txt

@@ -0,0 +1 @@
+A mod that adds a stasis pod which can be used to heal the player on the ship.

+ 10 - 0
StasisPod/Properties/AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System.Reflection;
+using static StasisPod.StasisPod;
+
+[assembly: AssemblyProduct("StasisPod")] //Set this to the full name of the mod including spaces.
+[assembly: AssemblyTitle("Stasis Pod")] //This is only used when mousing over a dll file in Windows explorer.
+[assembly: AssemblyDescription("A mod that adds a stasis pod which can be used to heal the player on the ship.")] //This is a short description for your mod's assembly.
+[assembly: AssemblyCompany("")] //Set this to your name/nickname and/or website
+[assembly: AssemblyCopyright("© 2021 Zariteis. All rights reserved.")] //Set this to your copyright name.
+[assembly: AssemblyVersion(MOD_VERSION)]
+[assembly: AssemblyFileVersion(MOD_VERSION)]

+ 8 - 0
StasisPod/Properties/launchSettings.json

@@ -0,0 +1,8 @@
+{
+  "profiles": {
+    "StasisPod": {
+      "commandName": "Executable",
+      "executablePath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Roguelands\\Roguelands.exe"
+    }
+  }
+}

+ 15 - 0
StasisPod/README.txt

@@ -0,0 +1,15 @@
+In addition to changing all references to "Template" this and that to a more appropriate name,
+you need to add a file called "GamePaths.xml" to the folder ABOVE where you put this template, with the following content:
+
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+  <PropertyGroup>
+    <!-- Set this full path to your game folder. Must contain a slash at the end. -->
+    <GamePath>C:\Program Files (x86)\Steam\steamapps\common\Roguelands\</GamePath>
+
+    <!-- Set this partial path to the game's Managed folder. Must contain a slash at the end. -->
+    <ManagedFolder>Roguelands_Data\Managed\</ManagedFolder>
+  </PropertyGroup>
+</Project>
+
+Note that `GamePath` may need to be changed, depending on the nature of your installation.

+ 122 - 0
StasisPod/StasisPod.cs

@@ -0,0 +1,122 @@
+using GadgetCore.API;
+using GadgetCore.API.ConfigMenu;
+using ScrapYard.API;
+using System;
+using System.Collections;
+using System.Reflection;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+namespace StasisPod
+{
+  [Gadget("StasisPod", LoadAfter: new string[] { "ScrapYard" }, Dependencies: new string[] { "ScrapYard" })]
+  public class StasisPod : Gadget<StasisPod>
+  {
+    public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
+    public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
+
+    public override IGadgetConfigMenu GetConfigMenu() { return null; }
+    protected override void LoadConfig() { Config.Reset(); Config.Save(); }
+
+    public override string GetModDescription()
+    {
+      return "A mod that adds a stasis pod which can be used to heal the player on the ship.";
+    }
+
+    protected override void Initialize()
+    {
+      Logger.Log("Stasis Pod v" + Info.Mod.Version);
+      Core.logger = Logger;
+
+      var asset = GadgetCoreAPI.LoadAssetBundle("stasispod");
+
+      var tile = ItemUtil.CreatePlacableItem("stasisPod.png", "iStasisPod.png", "Stasis Pod", (GameObject)asset.LoadAsset("assets/resources/tileStasisPod.prefab"));
+
+      Core.npcID = tile.GetID();
+      if (Core.npcID == -1)
+        throw new System.Exception("Could not register Tile " + "scrapyardmerchant");
+      Core.itemStasisPodId = tile.Item.GetID();
+
+      tile.OnInteract += OnInteractPod;
+
+      GadgetCoreAPI.RegisterCustomRPC("SetPodInUse", delegate (object[] args)
+      {
+        StasisPodScript.CallEventSetRPC(args);
+      });
+
+      ShopPlatform.DefaultObjects.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemStasisPodId, 1250));
+
+      SceneManager.sceneLoaded += OnSceneLoaded;
+    }
+
+    internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
+    {
+      if (scene.buildIndex == 1)
+      {
+        InstanceTracker.GameScript.StartCoroutine(HpLoop());
+      }
+    }
+
+    private static int off = 0;
+
+    private static IEnumerator HpLoop()
+    {
+      while (!Network.isServer && !Network.isClient)
+      {
+        yield return new WaitForSeconds(0.25f);
+      }
+      while (true)
+      {
+        off = (off + 1) % 3;
+        yield return new WaitForSeconds(0.5f);
+        if (PlayerScript.curInteractObj != null && PlayerScript.curInteractObj.GetComponent<StasisPodScript>() != null && PlayerScript.beamed)
+        {
+          if (off == 0) InstanceTracker.GameScript.RecoverHP(10);
+          if (off == 1) InstanceTracker.GameScript.RecoverMana(10);
+          if (off == 2) InstanceTracker.GameScript.RecoverStamina(10);
+        }
+        else
+          yield return new WaitForSeconds(0.6f);
+      }
+    }
+
+    public static readonly FieldInfo canInteractField = typeof(PlayerScript).GetField("canInteract", BindingFlags.NonPublic | BindingFlags.Instance);
+    public static readonly FieldInfo interactingField = typeof(PlayerScript).GetField("interacting", BindingFlags.NonPublic | BindingFlags.Instance);
+    public static readonly FieldInfo rField = typeof(PlayerScript).GetField("r", BindingFlags.NonPublic | BindingFlags.Instance);
+    public static readonly FieldInfo tField = typeof(PlayerScript).GetField("t", BindingFlags.NonPublic | BindingFlags.Instance);
+    //public static readonly FieldInfo interactingField = typeof(PlayerScript).GetField("interacting", BindingFlags.NonPublic | BindingFlags.Instance);
+
+    private IEnumerator OnInteractPod()
+    {
+      try
+      {
+        var podScript = PlayerScript.curInteractObj.GetComponent<StasisPodScript>();
+        if (podScript.CanUse() || PlayerScript.beamed)
+        {
+          var setUse = !PlayerScript.beamed;
+          PlayerScript.beamed = setUse;
+          InstanceTracker.PlayerScript.GetComponent<Collider>().enabled = !setUse;
+          podScript.StartCallSet(setUse);
+          ((Rigidbody)rField.GetValue(InstanceTracker.PlayerScript)).detectCollisions = !setUse;
+          ((Rigidbody)rField.GetValue(InstanceTracker.PlayerScript)).useGravity = !setUse;
+          ((Rigidbody)rField.GetValue(InstanceTracker.PlayerScript)).velocity = new Vector3(0f, 0f, 0f);
+          ((Transform)tField.GetValue(InstanceTracker.PlayerScript)).position = new Vector3(PlayerScript.curInteractObj.transform.position.x, PlayerScript.curInteractObj.transform.position.y, 0f);
+          //InstanceTracker.PlayerScript.playerTrigger.portal = null;
+          InstanceTracker.PlayerScript.GetComponent<NetworkView>().RPC("Beam", RPCMode.All, new object[] { setUse ? 0 : 1 });
+          InstanceTracker.PlayerScript.w.SetActive(true);
+        }
+        else
+        {
+          canInteractField.SetValue(InstanceTracker.PlayerScript, false);
+          InstanceTracker.PlayerScript.w.SetActive(false);
+        }
+        interactingField.SetValue(InstanceTracker.PlayerScript, false);
+      }
+      catch (System.Exception e)
+      {
+        Core.logger.Log(e);
+      }
+      yield break;
+    }
+  }
+}

+ 256 - 0
StasisPod/StasisPod.csproj

@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project Sdk="Microsoft.NET.Sdk">
+  <ImportGroup>
+    <Import Project="../GamePaths.xml" />
+  </ImportGroup>
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProjectGuid>{91AB81DE-EAEE-47D1-93DD-541179208219}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>StasisPod</RootNamespace>
+    <AssemblyName>StasisPod</AssemblyName>
+    <TargetFrameworks>net35</TargetFrameworks>
+    <FileAlignment>512</FileAlignment>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+    <Configurations>Release</Configurations>
+    <Authors>Zariteis</Authors>
+    <ApplicationIcon />
+    <StartupObject />
+    <Platforms>x86</Platforms>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net35|x86'">
+    <NoWarn>1701;1702</NoWarn>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="0Harmony">
+      <HintPath>$(GamePath)$(ManagedFolder)0Harmony.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="Assembly-CSharp">
+      <HintPath>$(GamePath)$(ManagedFolder)Assembly-CSharp.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="GadgetCore">
+      <HintPath>$(GamePath)$(ManagedFolder)GadgetCore.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="ScrapYard">
+      <HintPath>..\ScrapYard\Release\ScrapYard.dll</HintPath>
+      <Private>false</Private>
+      <SpecificVersion>false</SpecificVersion>
+    </Reference>
+    <Reference Include="UnityEngine">
+      <HintPath>$(GamePath)$(ManagedFolder)UnityEngine.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="ModInfo.txt">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <UsingTask TaskName="GetFileVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+    <ParameterGroup>
+      <AssemblyPath ParameterType="System.String" Required="true" />
+      <Version ParameterType="System.String" Output="true" />
+      <TrimmedVersion ParameterType="System.String" Output="true" />
+    </ParameterGroup>
+    <Task>
+      <Using Namespace="System.Diagnostics" />
+      <Using Namespace="System.Text" />
+      <Using Namespace="System.Linq" />
+      <Code Type="Fragment" Language="cs">
+        <![CDATA[
+      this.Version = FileVersionInfo.GetVersionInfo(this.AssemblyPath).FileVersion;  
+      this.TrimmedVersion = this.Version.Split('.').TakeWhile(x => !x.Equals("0")).Aggregate(new StringBuilder(), (a, b) => { if (a.Length > 0) a.Append("."); a.Append(b); return a; }).ToString();
+      if (this.TrimmedVersion.IndexOf('.') == -1) this.TrimmedVersion += ".0";
+    ]]>
+      </Code>
+    </Task>
+  </UsingTask>
+  <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+    <GetFileVersion AssemblyPath="$(TargetPath)">
+      <Output TaskParameter="Version" PropertyName="ModFullVersion" />
+      <Output TaskParameter="TrimmedVersion" PropertyName="AssemblyFileVersion" />
+    </GetFileVersion>
+    <ItemGroup>
+      <OldZip Include="$(TargetDir)$(AssemblyName)_v*.zip" />
+      <OldZip Include="$(GamePath)GadgetCore\Mods\$(AssemblyName)_v*.zip" />
+    </ItemGroup>
+    <Delete Files="@(OldZip)" />
+    <MakeDir Directories="$(TargetDir)..\BuildCache\" />
+    <ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(TargetDir)..\BuildCache\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+    <Copy SourceFiles="$(TargetDir)..\BuildCache\$(AssemblyName)_v$(AssemblyFileVersion).zip" DestinationFiles="$(TargetDir)$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+    <RemoveDir Directories="$(TargetDir)..\BuildCache\" />
+    <MakeDir Directories="$(GamePath)GadgetCore\Mods\" />
+    <Copy SourceFiles="$(TargetDir)$(AssemblyName)_v$(AssemblyFileVersion).zip" DestinationFiles="$(GamePath)GadgetCore\Mods\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+    <Message Importance="High" Text="Mod Exported to $(GamePath)GadgetCore\Mods\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+  </Target>
+  <ItemGroup>
+    <None Update="Assets\bStasisPod0.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\bStasisPod1.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\bStasisPod2.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cStasisPod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cCombatSimulator.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cGreenLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\charBG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cOrangeLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cPlatform.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cPurpleLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cWhiteLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\cYellowLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\First\one">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iAirCore.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iStasisPod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iCombatSimulator.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iCore.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iEarthCore.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iFireCore.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iGreenLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iOrangeLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iPlatform.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iPurpleLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iStasisPod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iWaterCore.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iWhiteLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\iYellowLamp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\menuStasisPod">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\menuStasisPodBase.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\menuCombatSimulator.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\one">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\slotStasisPod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\stasispod">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\stasisPod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\stasisPodOn.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Manifest.ini">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System">
+      <Private>false</Private>
+      <SpecificVersion>true</SpecificVersion>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Data">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Drawing">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.IO.Compression.FileSystem">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Numerics">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Runtime.Serialization">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Xml">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Xml.Linq">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Patches\" />
+  </ItemGroup>
+</Project>

+ 22 - 0
StasisPod/StasisPod.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31005.135
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StasisPod", "StasisPod.csproj", "{91AB81DE-EAEE-47D1-93DD-541179208219}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{91AB81DE-EAEE-47D1-93DD-541179208219}.Release|x86.ActiveCfg = Release|x86
+		{91AB81DE-EAEE-47D1-93DD-541179208219}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {2874CE36-051F-43FD-B44A-8C254A4A8923}
+	EndGlobalSection
+EndGlobal

+ 66 - 0
StasisPod/StasisPodScript.cs

@@ -0,0 +1,66 @@
+
+using GadgetCore.API;
+using System;
+using System.Collections;
+using System.Reflection;
+using UnityEngine;
+
+namespace StasisPod
+{
+  public class StasisPodScript : MonoBehaviour
+  {
+    public static event Action<object[]> SetRPC;
+    private void Start()
+    {
+      id = "x" + (Math.Floor(transform.position.x) / 4).ToString() + "y" + (Math.Floor(transform.position.y) / 4).ToString();
+      SetRPC += this.Set;
+    }
+
+    private void OnDestroy()
+    {
+      SetRPC -= this.Set;
+    }
+
+    private void Set(object[] o)
+    {
+      if (o[0].ToString() == id)
+      {
+        this.inUse = (bool)o[1];
+        UpdateTile();
+      }
+    }
+
+    internal void StartCallSet(bool inUse)
+    {
+      StartCoroutine(CallSet(inUse));
+    }
+
+    private IEnumerator CallSet(bool inUse)
+    {
+      yield return new WaitForSeconds(0.01f);
+      GadgetCoreAPI.CallCustomRPC("SetPodInUse", RPCMode.AllBuffered, new object[] { this.id, inUse });
+      yield break;
+    }
+
+    private void UpdateTile()
+    {
+      gameObject.transform.GetChild(1).gameObject.SetActive(inUse);
+    }
+
+    internal bool CanUse()
+    {
+      return !inUse;
+    }
+
+    public bool inUse = false;
+    public string id;
+
+    internal static void CallEventSetRPC(object[] args)
+    {
+      var setFrameItemRPC = StasisPodScript.SetRPC;
+      if (setFrameItemRPC == null)
+        return;
+      setFrameItemRPC(args);
+    }
+  }
+}