-
-
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.
- Loading branch information
Showing
33 changed files
with
1,025 additions
and
408 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Verse; | ||
|
||
namespace PrisonLabor | ||
{ | ||
class Alert_LazyPrisoners : Alert | ||
{ | ||
public Alert_LazyPrisoners() | ||
{ | ||
this.defaultLabel = "Prisoners aren't working"; | ||
this.defaultExplanation = "Work in progress"; | ||
} | ||
|
||
private IEnumerable<Pawn> LazyPrisoners | ||
{ | ||
get | ||
{ | ||
List<Map> maps = Find.Maps; | ||
for (int i = 0; i < maps.Count; i++) | ||
{ | ||
foreach (Pawn pawn in maps[i].mapPawns.AllPawns) | ||
{ | ||
if (PrisonLaborUtility.LaborEnabled(pawn) && PrisonLaborUtility.WorkTime(pawn) && pawn.needs.TryGetNeed<Need_Motivation>().IsLazy) | ||
yield return pawn; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public override string GetExplanation() | ||
{ | ||
StringBuilder stringBuilder = new StringBuilder(); | ||
foreach (Pawn current in LazyPrisoners) | ||
{ | ||
stringBuilder.AppendLine(" " + current.NameStringShort); | ||
} | ||
return string.Format("Those prisoners are lazy:\n\n{0}\nTry to motivate them.", stringBuilder.ToString()); | ||
} | ||
|
||
public override AlertReport GetReport() | ||
{ | ||
if (PrisonLaborPrefs.EnableMotivationMechanics) | ||
{ | ||
return AlertReport.CulpritIs(LazyPrisoners.FirstOrDefault()); | ||
} | ||
else | ||
{ | ||
return false; | ||
} | ||
} | ||
|
||
} | ||
} |
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,56 @@ | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Verse; | ||
|
||
namespace PrisonLabor | ||
{ | ||
class Alert_StarvingPrisoners : Alert | ||
{ | ||
public Alert_StarvingPrisoners() | ||
{ | ||
this.defaultLabel = "Prisoners are starving"; | ||
this.defaultExplanation = "Work in progress"; | ||
} | ||
|
||
private IEnumerable<Pawn> StarvingPrisoners | ||
{ | ||
get | ||
{ | ||
List<Map> maps = Find.Maps; | ||
for (int i = 0; i < maps.Count; i++) | ||
{ | ||
foreach (Pawn pawn in maps[i].mapPawns.AllPawns) | ||
{ | ||
if (PrisonLaborUtility.LaborEnabled(pawn) && PrisonLaborUtility.WorkTime(pawn) && (!PrisonLaborPrefs.EnableMotivationMechanics || !pawn.needs.TryGetNeed<Need_Motivation>().IsLazy) && pawn.timetable != null && pawn.timetable.CurrentAssignment == TimeAssignmentDefOf.Anything && pawn.needs.food.Starving) | ||
yield return pawn; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public override string GetExplanation() | ||
{ | ||
StringBuilder stringBuilder = new StringBuilder(); | ||
foreach (Pawn current in StarvingPrisoners) | ||
{ | ||
stringBuilder.AppendLine(" " + current.NameStringShort); | ||
} | ||
return string.Format("Those prisoners are starving and won't work:\n\n{0}", stringBuilder.ToString()); | ||
} | ||
|
||
public override AlertReport GetReport() | ||
{ | ||
if (!PrisonLaborPrefs.DisableMod) | ||
{ | ||
return AlertReport.CulpritIs(StarvingPrisoners.FirstOrDefault()); | ||
} | ||
else | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.