public static ThinkResult LayDownInPlace(Pawn pawn, JobGiver_PatientGoToBed giver) { if (Settings.Get().FieldTendingActive(pawn)) { return(new ThinkResult(new Job(JobDefOf.LayDown, pawn.Position), giver)); } else { return(ThinkResult.NoJob); } }
public static ThinkResult LayDownInPlace(Pawn pawn, JobGiver_PatientGoToBed giver) { if (Settings.Get().FieldTendingActive(pawn)) { Building_Bed tempTendSpot = pawn.Position.GetThingList(pawn.Map).FirstOrDefault(t => t.def == TempSleepSpot) as Building_Bed; if (tempTendSpot == null && !GenSpawn.WouldWipeAnythingWith(pawn.Position, Rot4.North, TempSleepSpot, pawn.Map, t => true)) { tempTendSpot = ThingMaker.MakeThing(TempSleepSpot) as Building_Bed; GenSpawn.Spawn(tempTendSpot, pawn.Position, pawn.Map, WipeMode.FullRefund); tempTendSpot.Medical = true; Log.Message($"Creating bed {tempTendSpot} for {pawn} at {pawn.Position}"); } return(new ThinkResult(new Job(JobDefOf.LayDown, tempTendSpot), giver)); } else { return(ThinkResult.NoJob); } }
public void AddMedicalButton() { var option = new TieredFloatMenuOption(Strings.ReportToMedical, null, Textures.LookBusyButton, Textures.LookBusyButtonHover, Textures.MenuButtonPress, TextAnchor.MiddleCenter, MenuOptionPriority.High, 0f, -1f, Strings.ReportToMedicalTooltip); option.action = delegate { JobGiver_PatientGoToBed jgp = new JobGiver_PatientGoToBed { respectTimetable = false }; foreach (var pawn in this.colonistGroup.ActivePawns) { ThinkResult thinkResult = jgp.TryIssueJobPackage(pawn, default(JobIssueParams)); if (thinkResult.IsValid) { pawn.jobs.TryTakeOrderedJob(thinkResult.Job); } } TacticDefOf.TG_ClickSFX.PlayOneShotOnCamera(); }; option.bottomIndent = Textures.MenuButton.height + 25; options.Add(option); }