Skip to content

Commit

Permalink
Merge pull request #213 from Aviuz/1.2-devbranch
Browse files Browse the repository at this point in the history
1.2 devbranch
  • Loading branch information
Hazzer authored Dec 21, 2020
2 parents a41d608 + e1ded12 commit 28d3f6a
Show file tree
Hide file tree
Showing 32 changed files with 696 additions and 15 deletions.
File renamed without changes.
48 changes: 48 additions & 0 deletions 1.1/Defs/ConceptDef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<ConceptDef>
<defName>PrisonLabor_Indroduction</defName>
<label>Prison labor</label>
<priority>45</priority>
<needsOpportunity>True</needsOpportunity>
<highlightTags>
<li>ITab-Prisoner-Closed</li>
</highlightTags>
<helpText>You can force your prisoners to do labor.\n\nTo do so you must select "Force to work" option from "Prisoner" pane\n\nPrisoners will work on orders and bills that are in allowed area. Make sure prisoners can reach their work.\n\nThey can only cook, mine, cut plants, haul, clean, or grow plants, that do not require special skills.\n\nPrisoner sometimes refuses to work. Reasons can be different. He can be injured, hungry, tired, or not motivated enough.\n\nHINT: You can assign work types in "Work" pane.\n\nHINT: If you put a stove in a prison cell make sure they can reach raw food.\n\nHINT: You can let prioners moving through doors by leaving them open.</helpText>
</ConceptDef>
<ConceptDef>
<defName>PrisonLabor_Motivation</defName>
<label>Motivating prisoners</label>
<priority>100</priority>
<needsOpportunity>True</needsOpportunity>
<helpText>One of yours prisoners stopped working.\nHe won't work any longer, unless he gets motivated.\n\nYou can check status of motivation in "Needs" tab.\n\nMake sure you have enough wardens (check "Work" tab), or draft one of your colonist and order him to stand around your prisoners.\n\nLow motivation of prisoners can lead to revolts.</helpText>
</ConceptDef>
<ConceptDef>
<defName>PrisonLabor_Growing</defName>
<label>Growing by prisoners</label>
<priority>100</priority>
<needsOpportunity>True</needsOpportunity>
<helpText>Prisoners can only grow plants that don't require any special skills like potato or cotton. They can however gather any plant that is ordered to harvest.</helpText>
</ConceptDef>
<ConceptDef>
<defName>PrisonLabor_Management</defName>
<label>Prison labor management</label>
<priority>100</priority>
<needsOpportunity>True</needsOpportunity>
<helpText>You can manage your prison labor in several ways.\n\nYou can assign work types to prisoners by accessing "Work" tab.\n\nYou can restrict when prisoners should work, rest, or sleep by accessing "Restrict" tab.\n\nYou can restrict work to "Prisoners only". For work orders that covers area you can choose "Labor area" tool from "Architect"->"Orders" panel.\nFor bills there is an option "Prisoners only".</helpText>
</ConceptDef>
<ConceptDef>
<defName>PrisonLabor_Timetable</defName>
<label>Prisoners time restrictions</label>
<priority>100</priority>
<needsOpportunity>True</needsOpportunity>
<helpText>You can make time restrictions for prisoners.\n\n"Work" time will force them to work even when they're hungry or tired.\n\n"Joy" time will let them rest from job and get motivation bonus.\n\n"Sleep" time will force them to stay in prison cell.\n\n"Anything" is default setting.</helpText>
</ConceptDef>
<ConceptDef>
<defName>PrisonLabor_Treatment</defName>
<label>Treatment system</label>
<priority>50</priority>
<needsOpportunity>True</needsOpportunity>
<helpText>In prison labor you need to take care for prisoners. Good treatment can prevent revolts, and can provoke recruit proposition (without recruting process!).\n\nTo maintain good treatment status you need to feed prisoners regularly and set some free time so they can regenerate their strength\n\nTreatment will go lower if you beat prisoners, starve them, or exploit in terms of labor.\nGood treatment will result in:\n - Random offers with request to join colony\n - Preventing revolts\n - Preventing suicide</helpText>
</ConceptDef>
</Defs>
29 changes: 29 additions & 0 deletions 1.1/Defs/Hediffs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<HediffDef>
<defName>PrisonLabor_PrisonerChains</defName>
<description>This pawn has prisoners chains. Note: it is default Vanilla mechanics, but in hediff state</description>
<label>prisoners chains</label>
<stages>
<li>
<label>not active</label>
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>active</label>
<becomeVisible>false</becomeVisible>
<minSeverity>0.01</minSeverity>
<capMods>
<li>
<capacity>Manipulation</capacity>
<offset>-0.3</offset>
</li>
<li>
<capacity>Moving</capacity>
<postFactor>0.5</postFactor>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>
49 changes: 49 additions & 0 deletions 1.1/Defs/Incidents.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Defs>
<IncidentDef>
<defName>PrisonLabor_Revolt</defName>
<label>revolt</label>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<workerClass>PrisonLabor.Core.Incidents.IncidentWorker_Revolt</workerClass>
<letterLabel>Revolt</letterLabel>
<letterText>Revolt has been started by {0}. The prisoners united under faction {1}, and began uprising with self-made weapons</letterText>
<letterDef>ThreatBig</letterDef>
<baseChance>5.4</baseChance>
<minRefireDays>20</minRefireDays>
<category>ThreatBig</category>
<pointsScaleable>true</pointsScaleable>
<minThreatPoints>200</minThreatPoints>
</IncidentDef>

<IncidentDef>
<defName>PrisonLabor_ResocializationOffer</defName>
<label>resocialization offer</label>
<category>Misc</category>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<workerClass>PrisonLabor.Core.Incidents.IncidentWorker_ResocializationOffer</workerClass>
<letterLabel>Resocialization offer</letterLabel>
<letterText>Offer by {0}.</letterText>
<letterDef>PositiveEvent</letterDef>
<baseChance>10</baseChance>
<populationEffect>IncreaseEasy</populationEffect>
</IncidentDef>

<IncidentDef>
<defName>PrisonLabor_Suicide</defName>
<label>prisoner suicide</label>
<category>Misc</category>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<workerClass>PrisonLabor.Core.Incidents.IncidentWorker_Suicide</workerClass>
<letterLabel>Prisoner suicide</letterLabel>
<letterText>{0} has commited suicide, because of bad treatment.</letterText>
<letterDef>NegativeEvent</letterDef>
<baseChance>2</baseChance>
<minThreatPoints>500</minThreatPoints>
<pointsScaleable>false</pointsScaleable>
</IncidentDef>
</Defs>
32 changes: 32 additions & 0 deletions 1.1/Defs/JobDef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<JobDef>
<defName>PrisonLabor_PrisonerSupervise</defName>
<driverClass>PrisonLabor.Core.AI.JobDrivers.JobDriver_Supervise</driverClass>
<reportString>watching prisoner TargetA.</reportString>
<alwaysShowWeapon>true</alwaysShowWeapon>
</JobDef>
<JobDef>
<defName>PrisonLabor_Arrest</defName>
<driverClass>JobDriver_TakeToBed</driverClass>
<reportString>arresting TargetA.</reportString>
<alwaysShowWeapon>true</alwaysShowWeapon>
<makeTargetPrisoner>true</makeTargetPrisoner>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>PrisonLabor_Mine_Tweak</defName>
<driverClass>PrisonLabor.Tweaks.JobDriver_Mine_Tweak</driverClass>
<reportString>digging at TargetA.</reportString>
</JobDef>
<JobDef>
<defName>PrisonLabor_Harvest_Tweak</defName>
<driverClass>PrisonLabor.Tweaks.JobDriver_PlantHarvest_Tweak</driverClass>
<reportString>harvesting TargetA.</reportString>
</JobDef>
<JobDef>
<defName>PrisonLabor_CutPlant_Tweak</defName>
<driverClass>PrisonLabor.Tweaks.JobDriver_PlantCut_Tweak</driverClass>
<reportString>cutting TargetA.</reportString>
</JobDef>
</Defs>
22 changes: 22 additions & 0 deletions 1.1/Defs/Needs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<NeedDef>
<defName>PrisonLabor_Motivation</defName>
<needClass>PrisonLabor.Core.Needs.Need_Motivation</needClass>
<label>Motivation</label>
<description>Motivation represents how motivated to work is prisoner. Motivation can be improved by colonists standing nearby.</description>
<listPriority>90</listPriority>
<major>false</major>
<showForCaravanMembers>false</showForCaravanMembers>
</NeedDef>
<NeedDef>
<defName>PrisonLabor_Treatment</defName>
<needClass>PrisonLabor.Core.Needs.Need_Treatment</needClass>
<label>Treatment happiness</label>
<description>Treatment happiness represents how prisoners are content of treatment in colony.</description>
<listPriority>89</listPriority>
<major>false</major>
<showForCaravanMembers>false</showForCaravanMembers>
<showOnNeedList>false</showOnNeedList>
</NeedDef>
</Defs>
13 changes: 13 additions & 0 deletions 1.1/Defs/PrisonerInteractionModeDef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<PrisonerInteractionModeDef>
<defName>PrisonLabor_workOption</defName>
<label>Force to work</label>
<listOrder>5</listOrder>
</PrisonerInteractionModeDef>
<PrisonerInteractionModeDef>
<defName>PrisonLabor_workAndRecruitOption</defName>
<label>Work and recruit</label>
<listOrder>6</listOrder>
</PrisonerInteractionModeDef>
</Defs>
26 changes: 26 additions & 0 deletions 1.1/Defs/ThinkTreeDef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<ThinkTreeDef>
<defName>PrisonLabor_WorkThinkTree</defName>
<insertTag>Humanlike_PostDuty</insertTag>
<insertPriority>80</insertPriority>
<thinkRoot Class="PrisonLabor.Core.AI.ThinkNodes.ThinkNode_Labor">
<invert>false</invert>
<subNodes>
<li Class="PrisonLabor.Core.AI.ThinkNodes.ThinkNode_SeekSafeTemperature">
<subNodes>
<li Class="JobGiver_SeekSafeTemperature"/>
</subNodes>
</li>
<li Class="ThinkNode_Priority">
<subNodes>
<li Class="PrisonLabor.Core.AI.JobGivers.JobGiver_BedTime" />
<li Class="PrisonLabor.Core.AI.JobGivers.JobGiver_PickupWeapon" />
<li Class="PrisonLabor.Core.AI.JobGivers.JobGiver_Diet" />
<li Class="PrisonLabor.Core.AI.JobGivers.JobGiver_Labor" />
</subNodes>
</li>
</subNodes>
</thinkRoot>
</ThinkTreeDef>
</Defs>
37 changes: 37 additions & 0 deletions 1.1/Defs/ThoughtsDef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<!-- Situation thoughts-->
<ThoughtDef>
<defName>PrisonLabor_VeryGoodTreatment</defName>
<workerClass>PrisonLabor.Core.AI.ThoughtWorkers.ThoughtWorker_VeryGoodTreatment</workerClass>
<stages>
<li>
<label>treated very good</label>
<description>In this prison I've been treated very well.</description>
<baseMoodEffect>15</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>PrisonLabor_LowMotivation</defName>
<workerClass>PrisonLabor.Core.AI.ThoughtWorkers.ThoughtWorker_LowMotivation</workerClass>
<stages>
<li>
<label>not supervised</label>
<description>Nobody cares if I'm working or not.</description>
<baseMoodEffect>5</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>PrisonLabor_FreeTime</defName>
<workerClass>PrisonLabor.Core.AI.ThoughtWorkers.ThoughtWorker_FreeTime</workerClass>
<stages>
<li>
<label>free time</label>
<description>Even tough I'm prisoner, I can still have some free time.</description>
<baseMoodEffect>5</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
</Defs>
15 changes: 15 additions & 0 deletions 1.1/Defs/WorkGiverDef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<WorkGiverDef>
<defName>PrisonLabor_SupervisePrisonLabor</defName>
<label>watch prisoner</label>
<giverClass>PrisonLabor.Core.AI.WorkGivers.WorkGiver_Supervise</giverClass>
<workType>PrisonLabor_Jailor</workType>
<priorityInType>5</priorityInType>
<verb>watch prisoner</verb>
<gerund>watching prisoner</gerund>
<requiredCapacities>
<li>Talking</li>
</requiredCapacities>
</WorkGiverDef>
</Defs>
19 changes: 19 additions & 0 deletions 1.1/Defs/WorkTypes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<WorkTypeDef>
<defName>PrisonLabor_Jailor</defName>
<labelShort>Jailor</labelShort>
<pawnLabel>Jailor</pawnLabel>
<gerundLabel>watching prisoners</gerundLabel>
<description>Manage prisoners, which includes escort, watching, releasing, and execution of prisoners.</description>
<verb>Supervise</verb>
<naturalPriority>1099</naturalPriority>
<requireCapableColonist>true</requireCapableColonist>
<relevantSkills>
<li>Social</li>
</relevantSkills>
<workTags>
<li>Social</li>
</workTags>
</WorkTypeDef>
</Defs>
Binary file modified 1.2/Assemblies/PrisonLabor.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</li>
</modDependencies>

<description>Version 1.1.11
<description>Version 1.2.0

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
61 changes: 60 additions & 1 deletion Defs/Hediffs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,78 @@
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>active</label>
<label>unchained totaly unchained</label>
<becomeVisible>false</becomeVisible>
<minSeverity>0.01</minSeverity>
</li>
<li>
<label>unchained legs</label>
<becomeVisible>false</becomeVisible>
<minSeverity>0.60</minSeverity>
<capMods>
<li>
<capacity>Manipulation</capacity>
<offset>-0.3</offset>
</li>
</capMods>
</li>
<li>
<label>unchained hands</label>
<becomeVisible>false</becomeVisible>
<minSeverity>0.80</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<postFactor>0.5</postFactor>
</li>
</capMods>
</li>
<li>
<label>active</label>
<becomeVisible>false</becomeVisible>
<minSeverity>0.90</minSeverity>
<capMods>
<li>
<capacity>Manipulation</capacity>
<offset>-0.3</offset>
</li>
<li>
<capacity>Moving</capacity>
<postFactor>0.5</postFactor>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>PrisonLabor_RemovedHandscuffs</defName>
<description>Prisoner has removed handscuffs</description>
<label>Removed Handscuff</label>
<stages>
<li>
<label>not active</label>
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>active</label>
<becomeVisible>true</becomeVisible>
<minSeverity>0.01</minSeverity>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>PrisonLabor_RemovedLegscuffs</defName>
<description>Prisoner has removed legscuffs</description>
<label>Removed legscuffs</label>
<stages>
<li>
<label>not active</label>
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>active</label>
<becomeVisible>true</becomeVisible>
<minSeverity>0.01</minSeverity>
</li>
</stages>
</HediffDef>
Expand Down
Loading

0 comments on commit 28d3f6a

Please sign in to comment.