-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#647 added support for Quality Builder
- Loading branch information
1 parent
bbd8551
commit b2f2fe0
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
.../ProjectRimFactory/Common/HarmonyPatches/Patch_QualityBuilder_getPawnConstructionSkill.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using ProjectRimFactory.Drones; | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Verse; | ||
|
||
namespace ProjectRimFactory.Common.HarmonyPatches | ||
{ | ||
internal class Patch_QualityBuilder_getPawnConstructionSkill | ||
{ | ||
static public bool Prefix(out int __result, Pawn pawn) | ||
{ | ||
__result = 0; | ||
if (pawn is Pawn_Drone) | ||
{ | ||
__result = pawn.skills.GetSkill(SkillDefOf.Construction).Level; | ||
return false; | ||
} | ||
return true; | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Source/ProjectRimFactory/Common/HarmonyPatches/Patch_QualityBuilder_pawnCanConstruct.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using ProjectRimFactory.Drones; | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Verse; | ||
|
||
namespace ProjectRimFactory.Common.HarmonyPatches | ||
{ | ||
class Patch_QualityBuilder_pawnCanConstruct | ||
{ | ||
public static void Postfix(Pawn pawn, ref bool __result) | ||
{ | ||
if (!__result && pawn is Pawn_Drone && (pawn.workSettings?.WorkIsActive(WorkTypeDefOf.Construction) ?? false)) | ||
{ | ||
__result = true; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters