diff --git a/About/About.xml b/About/About.xml
index 9ef0534..32ef166 100644
--- a/About/About.xml
+++ b/About/About.xml
@@ -4,7 +4,7 @@
Jecrell
0.18.0
- V1.18.0.2
+ V1.18.0.3
Adds new types and sizes of doors to RimWorld.
Currently included:
diff --git a/Assemblies/DoorsExpanded.dll b/Assemblies/DoorsExpanded.dll
index 375d904..ea1b5e3 100644
Binary files a/Assemblies/DoorsExpanded.dll and b/Assemblies/DoorsExpanded.dll differ
diff --git a/Defs/ThingDef_Building/Heron_Doors.xml b/Defs/ThingDef_Building/Heron_Doors.xml
index 5b98e9b..aee86b5 100644
--- a/Defs/ThingDef_Building/Heron_Doors.xml
+++ b/Defs/ThingDef_Building/Heron_Doors.xml
@@ -162,9 +162,77 @@
██████ ███████ ██ ██ ███████ ██ ██████ ██████ ██████ ██ ██ ███████
-->
+
+
+ PH_DoorBlastDoor
+
+ (2,1)
+
+ HeronBlastDoorOpen
+ HeronBlastDoorClose
+
+
+ JecsTools.PlaceWorker_Outline
+
+
+ Metallic
+
+
+ 450
+ 1800
+
+ 200
+
+ 100
+ 10
+
+
+ Things/Building/Door/DoorTripleThick_Blueprint
+
+ Things/Building/Door/BlastDoorUI
+
+ Things/Building/Door/DoorBlastDoor_Mover
+ Graphic_Multi
+ (2,1)
+
+ false
+
+
+
+ Things/Building/Door/DoorBlastDoor_MoverAsync
+ Graphic_Multi
+ (2,1)
+
+ false
+
+
+ (0,0,1)
+
+ Things/Building/Door/DoorBlastDoorFrame
+ Graphic_Multi
+ CutoutComplex
+ (2,1)
+
+ false
+
+
+
+ Things/Building/Door/DoorBlastDoorFrameAsync
+ Graphic_Multi
+ CutoutComplex
+ (2,1)
+
+ false
+
+
+ Standard
+ true
+ false
+
+
PH_DoorThickBlastDoor
-
+
(3,2)
HeronBlastDoorOpen
diff --git a/Source/.idea/.idea.ProjectHeron/.idea/workspace.xml b/Source/.idea/.idea.ProjectHeron/.idea/workspace.xml
index 8d087d5..6391d28 100644
--- a/Source/.idea/.idea.ProjectHeron/.idea/workspace.xml
+++ b/Source/.idea/.idea.ProjectHeron/.idea/workspace.xml
@@ -14,7 +14,7 @@
-
+
@@ -89,11 +89,11 @@
-
+
-
-
+
+
@@ -149,121 +149,122 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -272,8 +273,8 @@
-
-
+
+
@@ -282,8 +283,8 @@
-
-
+
+
@@ -303,18 +304,18 @@
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
@@ -334,7 +335,6 @@
FriendlyTouched
destroy
hold
- Draw
Stretch
Gizmo
speed
@@ -344,6 +344,9 @@
friendly
CanPhysically
PawnApproaching
+ TryClose
+ Draw
+ async
namespace DoorsExpanded
@@ -355,8 +358,8 @@
-
-
+
+
@@ -368,10 +371,10 @@
-
-
+
+
@@ -381,9 +384,9 @@
true
DEFINITION_ORDER
-
-
-
+
+
+
@@ -414,19 +417,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -483,11 +473,12 @@
+
-
+
@@ -499,20 +490,19 @@
-
+
-
+
-
+
-
@@ -522,6 +512,7 @@
+
@@ -538,6 +529,296 @@
+
+
+
+
+
+
+
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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1421,16 +1705,16 @@
-
-
+
+
-
-
+
+
@@ -1471,21 +1755,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1500,7 +1769,7 @@
-
+
@@ -1560,131 +1829,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -1708,5 +1856,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Building_DoorExpanded.cs b/Source/Building_DoorExpanded.cs
index 404d7b5..2c79de4 100644
--- a/Source/Building_DoorExpanded.cs
+++ b/Source/Building_DoorExpanded.cs
@@ -9,6 +9,7 @@
using Verse.AI.Group;
using Verse.AI;
using System.Diagnostics;
+using System.Globalization;
using Harmony;
//using Reloader;
@@ -66,14 +67,14 @@ public override void SpawnSetup(Map map, bool respawningAfterLoad)
public override bool BlocksPawn(Pawn p)
{
- return !this.openInt && !this.PawnCanOpen(p);
+ return Def.doorType != DoorType.FreePassage && !this.openInt && !this.PawnCanOpen(p);
}
public bool Open
{
get
{
- return this.openInt;
+ return Def.doorType == DoorType.FreePassage || this.openInt;
}
}
@@ -111,7 +112,6 @@ public override void Draw()
case DoorType.DoubleSwing:
DrawDoubleSwingParams(Def, this.DrawPos, rotation, out mesh, out matrix, d, flipped);
break;
- case DoorType.Standard:
default:
DrawParams(Def, this.DrawPos, rotation, out mesh, out matrix, d, flipped);
break;
@@ -179,6 +179,7 @@ public void DrawFrameParams(DoorExpandedDef thingDef, Vector3 drawPos, Rot4 rota
new Vector3(thingDef.doorFrame.drawSize.x * persMod, 1f, thingDef.doorFrame.drawSize.y * persMod) :
new Vector3(thingDef.doorFrame.drawSize.x, 1f, thingDef.doorFrame.drawSize.y);
+ Vector3 offset = thingDef.doorFrameOffset;
if (thingDef.doorFrameSplit != null)
{
if (rotation == Rot4.West)
@@ -186,9 +187,12 @@ public void DrawFrameParams(DoorExpandedDef thingDef, Vector3 drawPos, Rot4 rota
rotQuat = Quaternion.Euler(0, 270, 0); //new Quaternion(0, 0.7f, 0, -0.7f);// Euler(0, 270, 0);
graphicVector.z -= 2.7f;
mesh = MeshPool.plane10Flip;
+ offset = thingDef.doorFrameSplitOffset;
}
}
-
+ graphicVector += offset;
+
+
matrix = default(Matrix4x4);
matrix.SetTRS(graphicVector, rotQuat, scaleVector);
}
@@ -330,7 +334,7 @@ public bool SlowsPawns
{
get
{
- return this.TicksToOpenNow > 20;
+ return Def.doorType != DoorType.FreePassage && this.TicksToOpenNow > 20;
//return !this.DoorPowerOn || this.TicksToOpenNow > 20;
}
}
@@ -340,7 +344,7 @@ public bool SlowsPawns
public virtual bool PawnCanOpen(Pawn p)
{
Lord lord = p.GetLord();
- return (lord != null && lord.LordJob != null && lord.LordJob.CanOpenAnyDoor(p)) ||
+ return Def.doorType == DoorType.FreePassage || (lord != null && lord.LordJob != null && lord.LordJob.CanOpenAnyDoor(p)) ||
(p.IsWildMan() && !p.mindState.wildManEverReachedOutside) || base.Faction == null ||
(p.guest != null && p.guest.Released) || GenAI.MachinesLike(base.Faction, p);
}
@@ -388,11 +392,17 @@ public void DoorOpen(int ticksToClose = 60)
this.openInt = true;
if (this.DoorPowerOn)
{
- this.def.building.soundDoorOpenPowered.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
+ var buildingSoundDoorOpenPowered = this.def?.building?.soundDoorOpenPowered;
+ if (buildingSoundDoorOpenPowered != null)
+ buildingSoundDoorOpenPowered.PlayOneShot(new TargetInfo(base.Position, base.Map,
+ false));
}
else
{
- this.def.building.soundDoorOpenManual.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
+ var buildingSoundDoorOpenManual = this.def?.building?.soundDoorOpenManual;
+ if (buildingSoundDoorOpenManual != null)
+ buildingSoundDoorOpenManual.PlayOneShot(
+ new TargetInfo(base.Position, base.Map, false));
}
foreach (Building_DoorRegionHandler door in invisDoors)
{
@@ -458,7 +468,7 @@ public bool FreePassage
{
get
{
- return this.openInt && (this.holdOpenInt || !this.WillCloseSoon);
+ return Def.doorType == DoorType.FreePassage || this.openInt && (this.holdOpenInt || !this.WillCloseSoon);
}
}
@@ -497,6 +507,10 @@ public int TicksToOpenNow
num *= 0.25f;
}
num *= Def.doorOpenSpeedRate;
+ if (Def.doorType == DoorType.FreePassage)
+ {
+ num *= 0.01f;
+ }
return Mathf.RoundToInt(num);
}
}
@@ -623,11 +637,15 @@ public void DoorTryClose()
this.openInt = false;
if (this.DoorPowerOn)
{
- this.def.building.soundDoorClosePowered.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
+ var buildingSoundDoorClosePowered = this.def?.building?.soundDoorClosePowered;
+ if (buildingSoundDoorClosePowered != null)
+ buildingSoundDoorClosePowered.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
}
else
{
- this.def.building.soundDoorCloseManual.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
+ var buildingSoundDoorCloseManual = this.def?.building?.soundDoorCloseManual;
+ if (buildingSoundDoorCloseManual != null)
+ buildingSoundDoorCloseManual.PlayOneShot(new TargetInfo(base.Position, base.Map, false));
}
}
diff --git a/Source/DoorExpandedDef.cs b/Source/DoorExpandedDef.cs
index 7b8c40b..5fc519a 100644
--- a/Source/DoorExpandedDef.cs
+++ b/Source/DoorExpandedDef.cs
@@ -4,6 +4,7 @@
using System.Text;
using Verse;
using RimWorld;
+using UnityEngine;
namespace DoorsExpanded
{
@@ -12,7 +13,8 @@ public enum DoorType
{
Standard = 0,
Stretch,
- DoubleSwing
+ DoubleSwing,
+ FreePassage
}
public class DoorExpandedDef : ThingDef
{
@@ -23,7 +25,9 @@ public class DoorExpandedDef : ThingDef
public int tempLeakRate = 375;
public float doorOpenSpeedRate = 1.0f;
public GraphicData doorFrame;
+ public Vector3 doorFrameOffset = new Vector3(0,0,0);
public GraphicData doorFrameSplit;
+ public Vector3 doorFrameSplitOffset = new Vector3(0,0,0);
public GraphicData doorAsync;
public CompPower powerComp;
diff --git a/Source/obj/Debug/DoorsExpanded.dll b/Source/obj/Debug/DoorsExpanded.dll
index 375d904..ea1b5e3 100644
Binary files a/Source/obj/Debug/DoorsExpanded.dll and b/Source/obj/Debug/DoorsExpanded.dll differ