Anyone else waiting for Quantum Storage before starting their first A17 game?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
<li Class="ThingWithComps">
<def>MealLavish</def>
<id>MealLavish14540087</id>
<pos>(103, 0, 333)</pos>
<health>36</health>
<stackCount>0</stackCount>
<ingredients>
<li>Elephant_Meat</li>
<li>RawBerries</li>
<li>RawPotatoes</li>
</ingredients>
</li>
if( passability == Traversability.Impassable || thingClass == typeof(Building_Door) || temporaryRegionBarrier )
regionBarrier = true;
<?xml version="1.0" encoding="utf-8" ?>
<Buildings>
<!--========================= Doors =============================-->
<ThingDef ParentName="BuildingBase" Name="RemoteDoorBase" Abstract="True">
<thingClass>RemoteDoor.Building_RemoteDoor</thingClass>
<blueprintClass>Blueprint_Door</blueprintClass>
<category>Building</category>
<blueprintGraphicData>
<texPath>Things/Building/Door/Door_Blueprint</texPath>
</blueprintGraphicData>
<altitudeLayer>DoorMoveable</altitudeLayer>
<fillPercent>1</fillPercent>
<useHitPoints>true</useHitPoints>
<stuffCategories>
<li>Metallic</li>
<li>Woody</li>
<li>Stony</li>
</stuffCategories>
<statBases>
<MaxHitPoints>500</MaxHitPoints>
<Flammability>1.0</Flammability>
</statBases>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<selectable>true</selectable>
<tickerType>Normal</tickerType>
<rotatable>false</rotatable>
<soundImpactDefault>BulletImpactMetal</soundImpactDefault>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<designationCategory>Structure</designationCategory>
<holdsRoof>true</holdsRoof>
<staticSunShadowHeight>1.0</staticSunShadowHeight>
<blockLight>true</blockLight>
<drawerType>RealtimeOnly</drawerType>
<building>
<soundDoorOpenPowered>DoorOpenPowered</soundDoorOpenPowered>
<soundDoorClosePowered>DoorClosePowered</soundDoorClosePowered>
<soundDoorOpenManual>DoorOpenManual</soundDoorOpenManual>
<soundDoorCloseManual>DoorCloseManual</soundDoorCloseManual>
<ignoreNeedsPower>true</ignoreNeedsPower>
<canPlaceOverWall>true</canPlaceOverWall>
</building>
<comps>
<li Class="CompProperties_Forbiddable"/>
</comps>
</ThingDef>
<ThingDef ParentName="RemoteDoorBase">
<defName>RemoteDoor</defName>
<label>Remote Door</label>
<description>Divides rooms. Powered operation allows people to move through the door without slowing down.</description>
<statBases>
<MaxHitPoints>1500</MaxHitPoints>
<WorkToMake>2200</WorkToMake>
</statBases>
<graphicData>
<texPath>Things/Building/Door/Autodoor_Mover</texPath>
<graphicClass>Graphic_Single</graphicClass>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<uiIconPath>Things/Building/Door/Autodoor_MenuIcon</uiIconPath>
<costList>
<Steel>40</Steel>
<Component>4</Component>
</costList>
<costStuffCount>50</costStuffCount>
<comps>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>80</basePowerConsumption>
</li>
<li Class="CompProperties_Breakdownable"/>
</comps>
<researchPrerequisites>
<li>Autodoors</li>
</researchPrerequisites>
</ThingDef>
</Buildings>
using UnityEngine;
using System;
using System.Runtime.InteropServices;
using System.Collections;
using System.Collections.Generic;
using Verse;
using Verse.Sound;
using Verse.AI;
using Verse.AI.Group;
using System.Diagnostics;
namespace RemoteDoor
{
public class Building_RemoteDoor : RimWorld.Building_Door
{
Command_Toggle realCommandToggle = null;
public void ToggleDoor()
{
if (realCommandToggle != null)
{
realCommandToggle.toggleAction.Invoke();
if (DoorPowerOn)
{
if (realCommandToggle.isActive())
DoorOpen();
else
DoorTryClose();
}
}
}
public override IEnumerable<Gizmo> GetGizmos()
{
foreach (var g in base.GetGizmos())
{
Command c = (Command)g;
if (c.icon == RimWorld.TexCommand.HoldOpen)
{
// this is way messier than I'd have liked but
// the base class keeps the holdOpenInt variable private...
// things would be so much cleaner with direct access to it
Command_Toggle ct = (Command_Toggle)c;
realCommandToggle = ct;
Command_Toggle ro = new Command_Toggle();
ro.defaultLabel = "Cycle door";
ro.defaultDesc = "Cycle the door remotely";
ro.icon = RimWorld.TexCommand.HoldOpen;
ro.isActive = ct.isActive;
ro.toggleAction = new Action(this.ToggleDoor);
yield return ro;
continue;
}
yield return g;
}
}
}
}