Skip to content

Commit

Permalink
0.8.8
Browse files Browse the repository at this point in the history
- changed slow from prisoners chains to act as factor instead offset
- fixed compatibility issues with Seeds Please (again)
  • Loading branch information
Aviuz committed Oct 8, 2017
1 parent e50974f commit ae5855a
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 11 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>Prison Labor</name>
<author>Avius</author>
<targetVersion>0.17.0</targetVersion>
<description>Version 0.8.7
<description>Version 0.8.8

This mod force prisoners to work. To enable this feature prisoners must have "Force to work" option checked ("Prisoner" tab). Prison labor needs management that consist:
- Motivation - prisoners need to be motivated by presence of colonists. Wardens have new job - supervising prisoners. Low motivation can lead to revolts.
Expand Down
Binary file modified Assemblies/PrisonLabor.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Defs/Hediffs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</li>
<li>
<capacity>Moving</capacity>
<offset>-0.5</offset>
<postFactor>0.5</postFactor>
</li>
</capMods>
</li>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>
<p align="center">
<a href="https://github.com/Aviuz/PrisonLabor/releases">
<img src="https://img.shields.io/badge/version-0.8.7-orange.svg?style=flat" alt="v0.8.7" />
<img src="https://img.shields.io/badge/version-0.8.8-orange.svg?style=flat" alt="v0.8.8" />
</a>
</p>

Expand Down
9 changes: 7 additions & 2 deletions Source/CompatibilityPatches/SeedsPlease.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ static public void Init()
{
try
{
WorkGiverDef seedsPleaseDef = DefDatabase<WorkGiverDef>.GetNamed("PrisonLabor_GrowerSow_Tweak");
WorkGiverDef seedsPleaseDef = DefDatabase<WorkGiverDef>.GetNamed("GrowerSow");
seedsPleaseDef.giverClass = typeof(SeedsPlease_WorkGiver);
JobDef prisonLaborDef = DefDatabase<JobDef>.GetNamed("PrisonLabor_Harvest_Tweak");
JobDef prisonLaborDef = JobDefOf.Harvest;
SeedsPlease_WorkDriver_Patch.Run();
prisonLaborDef.driverClass = DefDatabase<JobDef>.GetNamed("Harvest").driverClass;
}
Expand All @@ -27,5 +27,10 @@ static public void Init()
}
}
}

static public bool CanOverrideHarvest()
{
return DefDatabase<JobDef>.GetNamed("SowWithSeeds", false) == null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class SeedsPlease_WorkDriver_Patch
public static void Run()
{
var harmony = HarmonyInstance.Create("Harmony_PrisonLabor_SeedsPlease");
var harvestDriverClass = DefDatabase<JobDef>.GetNamed("Harvest").driverClass;
var harvestDriverClass = JobDefOf.Harvest.driverClass;
harmony.Patch(
harvestDriverClass.GetMethod("HarvestSeedsToil", BindingFlags.NonPublic | BindingFlags.Instance),
new HarmonyMethod(null), new HarmonyMethod(null), new HarmonyMethod(typeof(SeedsPlease_WorkDriver_Patch).GetMethod("MethodFinder")));
Expand Down
10 changes: 10 additions & 0 deletions Source/NewsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ public void Init()
List<string> titlesList = new List<string>();
List<string[]> itemsList = new List<string[]>();

// 0.8.8 (silent)
if (showAll)
{
titlesList.Add("Prison Labor Beta v0.8.8");
string[] itemsArray =
{
"changed slow from prisoners chains to act as factor instead offset",
"fixed compatibility issues with Seeds Please(again)",
};
}
// 0.8.7 (silent)
if (showAll)
{
Expand Down
3 changes: 2 additions & 1 deletion Source/PrefsData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public enum Version
v0_8_4,
v0_8_5,
v0_8_6,
v0_8_7
v0_8_7,
v0_8_8
}

[Flags]
Expand Down
7 changes: 5 additions & 2 deletions Source/Tweaks/ClassInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ public static void Init()
cutPlantJob.driverClass = typeof(JobDriver_PlantCut_Tweak);

// Harvest
var harvestJob = JobDefOf.Harvest;
harvestJob.driverClass = typeof(JobDriver_PlantHarvest_Tweak);
if (CompatibilityPatches.SeedsPlease.CanOverrideHarvest())
{
var harvestJob = JobDefOf.Harvest;
harvestJob.driverClass = typeof(JobDriver_PlantHarvest_Tweak);
}

// Grow
var growWorkGiver = DefDatabase<WorkGiverDef>.GetNamed("GrowerSow");
Expand Down
4 changes: 2 additions & 2 deletions Source/VersionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace PrisonLabor
{
class VersionUtility
{
public const Version versionNumber = Version.v0_8_7;
public const string versionString = "0.8.7";
public const Version versionNumber = Version.v0_8_8;
public const string versionString = "0.8.8";

public static void CheckVersion()
{
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Changelog:
0.8.8
- changed slow from prisoners chains to act as factor instead offset
- fixed compatibility issues with Seeds Please (again)
0.8.7
- fixed bug with dropping motivation while in bed
- prisoners will now get different weapons when revolt triggers (molotovs, bows, or clubs)
Expand Down

0 comments on commit ae5855a

Please sign in to comment.