Skip to content

Commit

Permalink
1.18.0.3 (3/1/18)
Browse files Browse the repository at this point in the history
1.18.0.3 (3/1/18)
=============
- Added smaller blast doors by request
- Added secret support for Lord of the Rims content
  • Loading branch information
jecrell committed Mar 1, 2018
1 parent 1f2a3a1 commit 9eefabb
Show file tree
Hide file tree
Showing 7 changed files with 1,043 additions and 668 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<author>Jecrell</author>
<targetVersion>0.18.0</targetVersion>
<description>
V1.18.0.2
V1.18.0.3
Adds new types and sizes of doors to RimWorld.

Currently included:
Expand Down
Binary file modified Assemblies/DoorsExpanded.dll
Binary file not shown.
70 changes: 69 additions & 1 deletion Defs/ThingDef_Building/Heron_Doors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,77 @@
██████ ███████ ██ ██ ███████ ██ ██████ ██████ ██████ ██ ██ ███████
-->


<DoorsExpanded.DoorExpandedDef ParentName="HeronMetalDoorBase">
<defName>PH_DoorBlastDoor</defName>
<label>blast door (1x2)</label>
<size>(2,1)</size>
<building>
<soundDoorOpenManual>HeronBlastDoorOpen</soundDoorOpenManual>
<soundDoorCloseManual>HeronBlastDoorClose</soundDoorCloseManual>
</building>
<placeWorkers>
<li>JecsTools.PlaceWorker_Outline</li>
</placeWorkers>
<stuffCategories>
<li>Metallic</li>
</stuffCategories>
<statBases>
<MaxHitPoints>450</MaxHitPoints>
<WorkToBuild>1800</WorkToBuild>
</statBases>
<costStuffCount>200</costStuffCount>
<costList>
<Steel>100</Steel>
<Component>10</Component>
</costList>
<blueprintGraphicData>
<texPath>Things/Building/Door/DoorTripleThick_Blueprint</texPath>
</blueprintGraphicData>
<uiIconPath>Things/Building/Door/BlastDoorUI</uiIconPath>
<graphicData>
<texPath>Things/Building/Door/DoorBlastDoor_Mover</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(2,1)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<doorAsync>
<texPath>Things/Building/Door/DoorBlastDoor_MoverAsync</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(2,1)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</doorAsync>
<doorFrameSplitOffset>(0,0,1)</doorFrameSplitOffset>
<doorFrame>
<texPath>Things/Building/Door/DoorBlastDoorFrame</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<shaderType>CutoutComplex</shaderType>
<drawSize>(2,1)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</doorFrame>
<doorFrameSplit>
<texPath>Things/Building/Door/DoorBlastDoorFrameAsync</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<shaderType>CutoutComplex</shaderType>
<drawSize>(2,1)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</doorFrameSplit>
<doorType>Standard</doorType>
<fixedPerspective>true</fixedPerspective>
<rotatesSouth>false</rotatesSouth>
</DoorsExpanded.DoorExpandedDef>

<DoorsExpanded.DoorExpandedDef ParentName="HeronMetalDoorBase">
<defName>PH_DoorThickBlastDoor</defName>
<label>blast door (thick)</label>
<label>blast door (2x3)</label>
<size>(3,2)</size>
<building>
<soundDoorOpenManual>HeronBlastDoorOpen</soundDoorOpenManual>
Expand Down
1,593 changes: 939 additions & 654 deletions Source/.idea/.idea.ProjectHeron/.idea/workspace.xml

Large diffs are not rendered by default.

40 changes: 29 additions & 11 deletions Source/Building_DoorExpanded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Verse.AI.Group;
using Verse.AI;
using System.Diagnostics;
using System.Globalization;
using Harmony;
//using Reloader;

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -179,16 +179,20 @@ 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)
{
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);
}
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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));
}
}

Expand Down
6 changes: 5 additions & 1 deletion Source/DoorExpandedDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using Verse;
using RimWorld;
using UnityEngine;

namespace DoorsExpanded
{
Expand All @@ -12,7 +13,8 @@ public enum DoorType
{
Standard = 0,
Stretch,
DoubleSwing
DoubleSwing,
FreePassage
}
public class DoorExpandedDef : ThingDef
{
Expand All @@ -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;
Expand Down
Binary file modified Source/obj/Debug/DoorsExpanded.dll
Binary file not shown.

0 comments on commit 9eefabb

Please sign in to comment.