// Token: 0x0600005B RID: 91 RVA: 0x00005AF8 File Offset: 0x00003CF8 public static void ChkMSBattleStim(Pawn p, out string Reason, out bool Passed) { Reason = null; if (!p.RaceProps.Humanlike) { Passed = false; Reason = "MSExotic.NotHumanLike".Translate(p?.LabelShort.CapitalizeFirst()); return; } if (MSHediffEffecter.HasHediff(p, DefDatabase <HediffDef> .GetNamed("MSBattleStim_High", true))) { Passed = false; Reason = "MSExoctic.AlreadyStimmed".Translate(p?.LabelShort.CapitalizeFirst()); return; } Passed = true; }
public static void PostFix(ref Job __result, Pawn pawn) { if (__result != null && !MSHediffEffecter.HasHediff(pawn, DefDatabase <HediffDef> .GetNamed("MSCondom_High", false))) { JobDef CondomJobDef = DefDatabase <JobDef> .GetNamed("MSWearCondom", true); if (CondomJobDef != null) { Pawn pawn2 = pawn; if ((pawn2?.Map) != null && pawn.Spawned) { ThingDef CondomDef = DefDatabase <ThingDef> .GetNamed("MSCondom", false); if (CondomDef != null) { TraverseParms TravParms = TraverseParms.For(TraverseMode.NoPassClosedDoors, Danger.None, false); Predicate <Thing> validator = delegate(Thing t) { Pawn pawn3 = pawn; if ((pawn3?.GetRoom(RegionType.Set_Passable)) != null) { Pawn pawn4 = pawn; if ((pawn4?.GetRoom(RegionType.Set_Passable)) == (t?.GetRoom(RegionType.Set_Passable))) { return(true); } } return(false); }; Thing Condom = GenClosest.ClosestThingReachable(pawn.Position, pawn.Map, ThingRequest.ForDef(CondomDef), PathEndMode.ClosestTouch, TravParms, 20f, validator, null, 0, -1, false, RegionType.Set_Passable, false); if (Condom != null) { Job JobCondom = new Job(CondomJobDef, Condom); __result = JobCondom; } } } } } }
public static void PostFix(ref Job __result, Pawn pawn) { if (__result == null || MSHediffEffecter.HasHediff(pawn, DefDatabase <HediffDef> .GetNamed("MSCondom_High", false))) { return; } var CondomJobDef = DefDatabase <JobDef> .GetNamed("MSWearCondom"); if (CondomJobDef == null) { return; } var pawn2 = pawn; if (pawn2?.Map == null || !pawn.Spawned) { return; } var CondomDef = DefDatabase <ThingDef> .GetNamed("MSCondom", false); if (CondomDef == null) { return; } var TravParms = TraverseParms.For(TraverseMode.NoPassClosedDoors, Danger.None); bool Validator(Thing t) { var pawn3 = pawn; if (pawn3.GetRoom() == null) { return(false); } var pawn4 = pawn; if (pawn4.GetRoom() == t?.GetRoom()) { return(true); } return(false); } var Condom = GenClosest.ClosestThingReachable(pawn.Position, pawn.Map, ThingRequest.ForDef(CondomDef), PathEndMode.ClosestTouch, TravParms, 20f, Validator); if (Condom == null) { return; } var JobCondom = new Job(CondomJobDef, Condom); __result = JobCondom; }