Skip to content

Commit

Permalink
Updated for RimWorld 1.5
Browse files Browse the repository at this point in the history
- Note for saves of 1.4 to 1.5, while there are no red errors, previously built doors will be destroyed upon loading the save. Any 1.4 DoorsExpanded doors will need to be rebuilt in 1.5.
- Rebased the code to extend from the new Building_MultiTileDoor class in RimWorld 1.5
- Removed a large amount of code and patches related to spawning invisible doors and the previously utilized Building_DoorRegionHandler
  • Loading branch information
jecrell committed Apr 20, 2024
1 parent 19bc1fd commit 5bb1575
Show file tree
Hide file tree
Showing 75 changed files with 2,502 additions and 3,109 deletions.
Binary file added 1.5/Assemblies/DoorsExpanded.dll
Binary file not shown.
12 changes: 12 additions & 0 deletions 1.5/Defs/JobDefs/PH_Jobs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>

<JobDef>
<defName>PH_UseRemoteButton</defName>
<driverClass>DoorsExpanded.JobDriver_UseRemoteButton</driverClass>
<reportString>using TargetA.</reportString>
<casualInterruptible>false</casualInterruptible>
<allowOpportunisticPrefix>true</allowOpportunisticPrefix>
</JobDef>

</Defs>
66 changes: 66 additions & 0 deletions 1.5/Defs/ResearchProjectDefs/Heron_ResearchProjects.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>

<ResearchProjectDef Name="ProjectHeronResearch" Abstract="True">
<tab>Heron_ResearchTab</tab>
</ResearchProjectDef>

<ResearchProjectDef ParentName="ProjectHeronResearch">
<defName>ProjectHeron_Curtains</defName>
<label>simple curtains</label>
<description>Unlocks simple construction techniques to make rings, simple hooks, and poles for the production of curtains, which open far faster than standard doors, but slowly vent temperatures between rooms.</description>
<techLevel>Neolithic</techLevel>
<baseCost>200</baseCost>
<researchViewX>0</researchViewX>
<researchViewY>2</researchViewY>
<tags>
<li>ClassicStart</li>
<li>TribalStart</li>
</tags>
</ResearchProjectDef>

<ResearchProjectDef ParentName="ProjectHeronResearch">
<defName>ProjectHeron_PrisonDoors</defName>
<label>prisoner containment</label>
<description>Provides simple prison doors to keep inmates safe, well, mostly.</description>
<baseCost>500</baseCost>
<techLevel>Medieval</techLevel>
<researchViewX>1</researchViewX>
<researchViewY>2</researchViewY>
</ResearchProjectDef>

<ResearchProjectDef ParentName="ProjectHeronResearch">
<defName>ProjectHeron_RemoteDoors</defName>
<label>remote doors</label>
<description>Unlocks remote doors for remote containment as well as buttons and levers to manipulate them.</description>
<baseCost>800</baseCost>
<techLevel>Industrial</techLevel>
<researchViewX>1</researchViewX>
<researchViewY>3</researchViewY>
</ResearchProjectDef>

<ResearchProjectDef ParentName="ProjectHeronResearch">
<defName>ProjectHeron_Gates</defName>
<label>hinges and gates</label>
<description>Hinges and fastening techniques allow for the construction of swinging doors, such as large gates.</description>
<baseCost>200</baseCost>
<techLevel>Neolithic</techLevel>
<researchViewX>0</researchViewX>
<researchViewY>3</researchViewY>
<tags>
<li>ClassicStart</li>
</tags>
</ResearchProjectDef>

<ResearchProjectDef ParentName="ProjectHeronResearch">
<defName>ProjectHeron_BlastDoors</defName>
<label>blast doors</label>
<description>Allows for the production of blast absorbing pressurized blast doors.</description>
<baseCost>3000</baseCost>
<techLevel>Industrial</techLevel>
<requiredResearchBuilding>HiTechResearchBench</requiredResearchBuilding>
<researchViewX>2</researchViewX>
<researchViewY>2</researchViewY>
</ResearchProjectDef>

</Defs>
9 changes: 9 additions & 0 deletions 1.5/Defs/ResearchProjectDefs/Heron_ResearchTab.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>

<ResearchTabDef>
<defName>Heron_ResearchTab</defName>
<label>Doors Research</label>
</ResearchTabDef>

</Defs>
150 changes: 150 additions & 0 deletions 1.5/Defs/SoundDef/Heron_Sounds.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>

<SoundDef>
<defName>HeronGarageOpen</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/RemoteDoor/GarageOpen</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>

<SoundDef>
<defName>HeronGarageClose</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/RemoteDoor/GarageClose</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>

<SoundDef>
<defName>HeronCurtainOpen</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/Curtain/CurtainOpen</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>

<SoundDef>
<defName>HeronCurtainClose</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/Curtain/CurtainClose</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>


<SoundDef>
<defName>HeronJailDoorOpen</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/JailDoor/JailDoorOpen</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>

<SoundDef>
<defName>HeronJailDoorClose</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/JailDoor/JailDoorClose</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>


<SoundDef>
<defName>HeronBlastDoorOpen</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/BlastDoor/BlastDoorOpen</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>

<SoundDef>
<defName>HeronBlastDoorClose</defName>
<context>MapOnly</context>
<maxSimultaneous>1</maxSimultaneous>
<subSounds>
<li>
<name>False</name>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>Misc/BlastDoor/BlastDoorClose</clipPath>
</li>
</grains>
<volumeRange>3</volumeRange>
<pitchRange>0.85~1.15</pitchRange>
</li>
</subSounds>
</SoundDef>

</Defs>
126 changes: 126 additions & 0 deletions 1.5/Defs/ThingDef_Building/Heron_Base.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>

<!--
========================= Base Doors =============================
You don't need to use these as a base doors for your custom doors, but they're convenient to base off of.
Custom doors must define a "DoorsExpanded.CompProperties_DoorExpanded" comp - see Heron_Doors.xml for examples.
-->

<ThingDef ParentName="AbstractHeronDoorBase" Name="HeronClothDoorBase" Abstract="True">
<!-- Only cloth doors are minifiable by default. -->
<thingCategories>
<li>Buildings</li>
</thingCategories>
<minifiedDef>MinifiedThing</minifiedDef>
<stuffCategories>
<li>Fabric</li>
<li>Leathery</li>
</stuffCategories>
</ThingDef>

<ThingDef ParentName="AbstractHeronDoorBase" Name="HeronMetalDoorBase" Abstract="True">
<stuffCategories>
<li>Metallic</li>
</stuffCategories>
</ThingDef>

<ThingDef ParentName="AbstractHeronDoorBase" Name="HeronDoorBase" Abstract="True">
<stuffCategories>
<li>Metallic</li>
<li>Woody</li>
<li>Stony</li>
</stuffCategories>
</ThingDef>

<!-- Based off /Defs/ThingDefs[@Name="DoorBase"] - can't simply inherit from it, since there's no way to override its building.blueprintGraphicData with null. -->
<ThingDef Name="AbstractHeronDoorBase" ParentName="BuildingBase" Abstract="True">
<!-- Note: thingClass will be overriden in a DoorsExpanded.CompProperties_DoorExpanded, which must be defined. -->
<thingClass>DoorsExpanded.Building_DoorExpanded</thingClass>
<category>Building</category>
<altitudeLayer>DoorMoveable</altitudeLayer>
<fillPercent>1</fillPercent>
<useHitPoints>true</useHitPoints>
<!-- Note: Not using stuffCategories from /Defs/ThingDefs[@Name="DoorBase"] - they're defined in ThingDefs inheriting this. -->
<statBases>
<MaxHitPoints>250</MaxHitPoints>
<Flammability>1.0</Flammability>
</statBases>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<selectable>true</selectable>
<tickerType>Normal</tickerType>
<!-- Note: rotatable should be false for 1x1 doors since they're auto-rotated. -->
<rotatable>true</rotatable>
<soundImpactDefault>BulletImpact_Metal</soundImpactDefault>
<useStuffTerrainAffordance>true</useStuffTerrainAffordance>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<designationCategory>Structure</designationCategory>
<holdsRoof>true</holdsRoof>
<staticSunShadowHeight>1.0</staticSunShadowHeight>
<blockLight>true</blockLight>
<drawerType>RealtimeOnly</drawerType>
<building>
<isInert>true</isInert>
<canPlaceOverWall>true</canPlaceOverWall>
<soundDoorOpenPowered>Door_OpenPowered</soundDoorOpenPowered>
<soundDoorClosePowered>Door_ClosePowered</soundDoorClosePowered>
<soundDoorOpenManual>Door_OpenManual</soundDoorOpenManual>
<soundDoorCloseManual>Door_CloseManual</soundDoorCloseManual>
<ai_chillDestination>false</ai_chillDestination>
<!-- Note: Not using blueprintClass or blueprintGraphicData from /Defs/ThingDefs[@Name="DoorBase"]
since we're patching Blueprint and want the default blueprintGraphicData. -->
</building>
<comps>
<li Class="CompProperties_Forbiddable"/>
</comps>
<placeWorkers>
<li>PlaceWorker_DoorLearnOpeningSpeed</li>
</placeWorkers>
</ThingDef>

<!--
========================= Internal =============================
Doors Expanded doors are internally composed of these 1x1 invisible doors primarily for pathfinding purposes.
This is used for internal use only - do NOT reuse for other purposes.
-->
<ThingDef>
<defName>HeronInvisibleDoor</defName>
<label>(internal invisible door)</label> <!-- Note: This shouldn't need translation, since the user should never see this -->
<thingClass>DoorsExpanded.Building_DoorRegionHandler</thingClass>
<category>Building</category>
<thingCategories/>
<repairEffect>Repair</repairEffect>
<graphicData>
<texPath>BlankTex</texPath>
<graphicClass>Graphic_Single</graphicClass>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<!-- In case another mod makes invis doors minifiable (note: Minify Everything is already mitigated against in code)
and a mod like Home Mover needs to show ghost textures, specify a dummy blank uiIconPath for said ghost textures. -->
<uiIconPath>BlankTex</uiIconPath>
<altitudeLayer>FloorEmplacement</altitudeLayer>
<fillPercent>0</fillPercent>
<useHitPoints>false</useHitPoints>
<scatterableOnMapGen>false</scatterableOnMapGen>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<selectable>false</selectable>
<neverMultiSelect>true</neverMultiSelect>
<isAutoAttackableMapObject>false</isAutoAttackableMapObject>
<tickerType>Normal</tickerType>
<rotatable>false</rotatable>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<drawerType>RealtimeOnly</drawerType>
<building>
<isEdifice>true</isEdifice>
<isInert>true</isInert>
<canPlaceOverWall>true</canPlaceOverWall>
</building>
<comps>
<li Class="CompProperties_Forbiddable"/>
</comps>
</ThingDef>

</Defs>
Loading

0 comments on commit 5bb1575

Please sign in to comment.