-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from Aviuz/1.2.3
1.2.3
- Loading branch information
Showing
33 changed files
with
547 additions
and
177 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
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
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
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ internal static void Run() | |
//NoWaterNoLife.Init(); | ||
WorkTab.Init(); | ||
Quarry.Init(); | ||
Kajin2.Init(); | ||
} | ||
} | ||
} |
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,64 @@ | ||
using HarmonyLib; | ||
using PrisonLabor.Core.Other; | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Verse; | ||
|
||
namespace PrisonLabor.CompatibilityPatches | ||
{ | ||
static class Kajin2 | ||
{ | ||
private static ModSearcher modSeeker; | ||
internal static void Init() | ||
{ | ||
ModSearcher modSeeker = new ModSearcher("Kijin Race 2.0"); | ||
if (modSeeker.LookForMod()) | ||
{ | ||
Patch(); | ||
} | ||
} | ||
|
||
private static void Patch() | ||
{ | ||
try | ||
{ | ||
MethodBase methodBase = getTargetMethod(); | ||
if (methodBase != null) | ||
{ | ||
var harmony = new Harmony("Harmony_PrisonLabor_Kajin2"); | ||
harmony.Patch(methodBase, postfix: new HarmonyMethod(typeof(Kajin2).GetMethod("postfix_Job"))); | ||
} | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error($"PrisonLaborException: failed to proceed Kijin Race 2.0 mod patches: {e.ToString()}"); | ||
} | ||
|
||
} | ||
|
||
public static Pawn postfix_Job( Pawn __result, IntVec3 c, Map map) | ||
{ | ||
if (__result == null) | ||
{ | ||
foreach(Thing thing in GridsUtility.GetThingList(c, map) ) | ||
{ | ||
Pawn val = thing as Pawn; | ||
if (val != null && !val.Dead && !val.Downed && val.IsPrisonerOfColony) | ||
{ | ||
return val; | ||
} | ||
} | ||
} | ||
return __result; | ||
} | ||
private static MethodBase getTargetMethod() | ||
{ | ||
return AccessTools.Method("Kijin2.Kijin2PlantCollectedPatch:GetFirstPawnNotDeadOrDowned"); | ||
} | ||
} | ||
} |
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
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
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
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
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
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 |
---|---|---|
|
@@ -64,6 +64,7 @@ public enum Version | |
v1_1_11, | ||
v1_2_0, | ||
v1_2_1, | ||
v1_2_2 | ||
v1_2_2, | ||
v1_2_3 | ||
} | ||
} |
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
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
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
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,31 @@ | ||
using PrisonLabor.Constants; | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Verse; | ||
|
||
namespace PrisonLabor.Core.Other | ||
{ | ||
public static class CleanPrisonersStatus | ||
{ | ||
|
||
static public void Clean(Pawn prisoner) | ||
{ | ||
prisoner.workSettings = new Pawn_WorkSettings(prisoner); | ||
Hediff legs = prisoner.health.hediffSet.GetFirstHediffOfDef(PL_DefOf.PrisonLabor_RemovedLegscuffs, false); | ||
if (legs != null) | ||
{ | ||
prisoner.health.hediffSet.hediffs.Remove(legs); | ||
} | ||
Hediff hands = prisoner.health.hediffSet.GetFirstHediffOfDef(PL_DefOf.PrisonLabor_RemovedHandscuffs, false); | ||
if (hands != null) | ||
{ | ||
prisoner.health.hediffSet.hediffs.Remove(hands); | ||
} | ||
prisoner.playerSettings.AreaRestriction = null; | ||
} | ||
} | ||
} |
Oops, something went wrong.