private Chore CreatePatientChore(StatesInstance smi) { WorkChore <DoctorStation> workChore = new WorkChore <DoctorStation>(Db.Get().ChoreTypes.GetDoctored, smi.master, null, true, null, null, null, false, null, false, true, null, false, true, false, PriorityScreen.PriorityClass.personalNeeds, 5, false, true); workChore.AddPrecondition(TreatmentAvailable, smi.master); workChore.AddPrecondition(DoctorAvailable, smi.master); return(workChore); }
private Chore CreateWorkChore() { ChoreType astronaut = Db.Get().ChoreTypes.Astronaut; KAnimFile anim = Assets.GetAnim("anim_hat_kanim"); WorkChore <CommandModuleWorkable> workChore = new WorkChore <CommandModuleWorkable>(astronaut, this, null, true, null, null, null, false, null, false, true, anim, false, true, false, PriorityScreen.PriorityClass.personalNeeds, 5, false, true); workChore.AddPrecondition(ChorePreconditions.instance.HasSkillPerk, Db.Get().SkillPerks.CanUseRockets); workChore.AddPrecondition(ChorePreconditions.instance.IsAssignedtoMe, assignable); return(workChore); }
private Chore CreateChore(int i) { Workable workable = workables[i]; ChoreType relax = Db.Get().ChoreTypes.Relax; Workable target = workable; ScheduleBlockType recreation = Db.Get().ScheduleBlockTypes.Recreation; Chore chore = new WorkChore <SocialGatheringPointWorkable>(relax, target, null, true, null, null, OnSocialChoreEnd, false, recreation, false, true, null, false, true, false, PriorityScreen.PriorityClass.high, 5, false, false); chore.AddPrecondition(ChorePreconditions.instance.IsNotRedAlert, null); chore.AddPrecondition(ChorePreconditions.instance.CanDoWorkerPrioritizable, workable); return(chore); }
private Chore CreateUseChore(SMInstance smi, ChoreType choreType) { WorkChore <ToiletWorkableUse> workChore = new WorkChore <ToiletWorkableUse>(choreType, smi.master, null, true, null, null, null, false, null, true, true, null, false, true, false, PriorityScreen.PriorityClass.personalNeeds, 5, false, false); smi.activeUseChores.Add(workChore); WorkChore <ToiletWorkableUse> workChore2 = workChore; workChore2.onExit = (Action <Chore>) Delegate.Combine(workChore2.onExit, (Action <Chore>) delegate(Chore exiting_chore) { smi.activeUseChores.Remove(exiting_chore); }); workChore.AddPrecondition(ChorePreconditions.instance.IsPreferredAssignableOrUrgentBladder, smi.master.GetComponent <Assignable>()); workChore.AddPrecondition(ChorePreconditions.instance.IsExclusivelyAvailableWithOtherChores, smi.activeUseChores); return(workChore); }
protected override WorkChore <RelaxationPoint> CreateWorkChore() { WorkChore <RelaxationPoint> workChore = new WorkChore <RelaxationPoint>(Db.Get().ChoreTypes.StressHeal, this, null, true, null, null, null, false, null, true, true, null, false, true, false, PriorityScreen.PriorityClass.high, 5, false, true); workChore.AddPrecondition(IsStressAboveActivationRange, this); return(workChore); }
private WorkChore <OilWellCap> CreateWorkChore() { WorkChore <OilWellCap> workChore = new WorkChore <OilWellCap>(Db.Get().ChoreTypes.Depressurize, this, null, true, null, null, null, true, null, false, false, null, false, true, true, PriorityScreen.PriorityClass.basic, 5, false, true); workChore.AddPrecondition(AllowedToDepressurize, this); return(workChore); }
private static void Postfix(WorkChore <OilWellCap> __result, Operational ___operational) { if (!__result.onlyWhenOperational) { __result.AddPrecondition(ChorePreconditions.instance.IsOperational, ___operational); var deconstructable = __result.GetComponent <Deconstructable>(); if (deconstructable != null) { __result.AddPrecondition(ChorePreconditions.instance.IsNotMarkedForDeconstruction, deconstructable); } var enabledButton = __result.GetComponent <BuildingEnabledButton>(); if (enabledButton != null) { __result.AddPrecondition(ChorePreconditions.instance.IsNotMarkedForDisable, enabledButton); } OnlyWhenOperational.Set(__result, true); } }
private Chore CreateRepairChore(SMInstance smi) { WorkChore <Repairable> workChore = new WorkChore <Repairable>(Db.Get().ChoreTypes.Repair, smi.master, null, true, null, null, null, true, null, false, false, null, false, true, true, PriorityScreen.PriorityClass.basic, 5, true, true); Deconstructable component = smi.master.GetComponent <Deconstructable>(); if ((UnityEngine.Object)component != (UnityEngine.Object)null) { workChore.AddPrecondition(ChorePreconditions.instance.IsNotMarkedForDeconstruction, component); } Breakable component2 = smi.master.GetComponent <Breakable>(); if ((UnityEngine.Object)component2 != (UnityEngine.Object)null) { workChore.AddPrecondition(IsNotBeingAttacked, component2); } workChore.AddPrecondition(IsNotAngry, null); return(workChore); }
private Chore CreateChore(StatesInstance smi) { Workable component = smi.master.GetComponent <EspressoMachineWorkable>(); ChoreType relax = Db.Get().ChoreTypes.Relax; Workable target = component; ScheduleBlockType recreation = Db.Get().ScheduleBlockTypes.Recreation; Chore chore = new WorkChore <EspressoMachineWorkable>(relax, target, null, true, null, null, null, false, recreation, false, true, null, false, true, false, PriorityScreen.PriorityClass.high, 5, false, true); chore.AddPrecondition(ChorePreconditions.instance.CanDoWorkerPrioritizable, component); return(chore); }
private Chore CreateChore(StatesInstance smi) { Workable component = smi.master.GetComponent <ChampagneFillerWorkable>(); Chore chore = new WorkChore <ChampagneFillerWorkable>(Db.Get().ChoreTypes.Relax, component, null, true, null, null, null, false, Db.Get().ScheduleBlockTypes.Recreation, false, true, null, false, true, false, PriorityScreen.PriorityClass.high, 5, false, true); chore.AddPrecondition(ChorePreconditions.instance.CanDoWorkerPrioritizable, component); return(chore); }
public Chore CreateUseChore(StatesInstance smi, ChoreType choreType, PriorityScreen.PriorityClass priorityClass) { var chore = new WorkChore <SuitRechargerWorkable>( chore_type: choreType, target: smi.master.workable, ignore_schedule_block: true, only_when_operational: false, allow_prioritization: false, priority_class: priorityClass, priority_class_value: Chore.DEFAULT_BASIC_PRIORITY, add_to_daily_report: false); smi.activeUseChores.Add(chore); chore.onExit += (exiting_chore) => smi.activeUseChores.Remove(exiting_chore); chore.AddPrecondition(IsSuitEquipped, null); if (durabilityEnabled) // не проверять если износ отключен в настройках сложности { chore.AddPrecondition(IsSuitHasEnoughDurability, smi.master); } chore.AddPrecondition(DoesSuitNeedRecharging, null); chore.AddPrecondition(IsEnoughOxygen, smi.master); chore.AddPrecondition(IsEnoughFuel, smi.master); chore.AddPrecondition(ChorePreconditions.instance.IsExclusivelyAvailableWithOtherChores, smi.activeUseChores); return(chore); }
private Chore CreateChore() { var workChore = new WorkChore <CarouselCentrifugeWorkable>( chore_type: Db.Get().ChoreTypes.Relax, target: this, schedule_block: Db.Get().ScheduleBlockTypes.Recreation, allow_in_red_alert: false, allow_prioritization: false, priority_class: PriorityScreen.PriorityClass.high ); workChore.AddPrecondition(ChorePreconditions.instance.CanDoWorkerPrioritizable, this); return(workChore); }
protected override void OnSpawn() { if (string.IsNullOrEmpty(currentStage)) { currentStage = "Default"; } SetStage(currentStage, true); shouldShowSkillPerkStatusItem = false; if (currentStage == "Default") { shouldShowSkillPerkStatusItem = true; Prioritizable.AddRef(base.gameObject); chore = new WorkChore <Artable>(Db.Get().ChoreTypes.Art, this, null, true, null, null, null, true, null, false, true, null, false, true, true, PriorityScreen.PriorityClass.basic, 5, false, true); chore.AddPrecondition(ChorePreconditions.instance.HasSkillPerk, requiredSkillPerk); } base.OnSpawn(); }