public void QueueStateChange(ControlState state) { RequestedState = state; if (state == CurrentState) { if (changeStateChore != null) { changeStateChore.Cancel(""); changeStateChore = null; } kSelectable.RemoveStatusItem(ModAssets.CurtainStatus, true); return; } ; if (DebugHandler.InstantBuildMode) { if (changeStateChore != null) { changeStateChore.Cancel("Debug state change"); } ApplyRequestedControlState(); return; } kSelectable.AddStatusItem(ModAssets.CurtainStatus, this); changeStateChore = new WorkChore <Curtain>( chore_type: Db.Get().ChoreTypes.Toggle, target: this, only_when_operational: false); }
protected virtual Chore CreateChore() { WorkChore <ResearchCenter> workChore = new WorkChore <ResearchCenter>(Db.Get().ChoreTypes.Research, this, null, true, null, null, null, true, null, false, true, null, true, true, true, PriorityScreen.PriorityClass.basic, 5, false, true); workChore.preemption_cb = CanPreemptCB; return(workChore); }
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); }
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); }
public void StopDoctorChore() { if (doctorChore != null) { doctorChore.Cancel("StopDoctorChore"); doctorChore = null; } }
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); }
public Chore CreateChore() { var workChore = new WorkChore <GeneShufflerPrepare>( chore_type: Db.Get().ChoreTypes.GeneShuffle, target: master.workable, schedule_block: Db.Get().ScheduleBlockTypes.Work, only_when_operational: true); 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 <PhonoboxWorkable>(relax, target, null, true, null, null, OnSocialChoreEnd, false, recreation, false, true, null, false, true, false, PriorityScreen.PriorityClass.high, 5, false, true); chore.AddPrecondition(ChorePreconditions.instance.CanDoWorkerPrioritizable, workable); return(chore); }
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 void StartDoctorChore() { if (base.master.IsValidEffect(base.master.doctoredHealthEffect) || base.master.IsValidEffect(base.master.doctoredDiseaseEffect)) { doctorChore = new WorkChore <DoctorChoreWorkable>(Db.Get().ChoreTypes.Doctor, base.smi.master, null, true, null, null, null, true, null, false, true, null, false, true, true, PriorityScreen.PriorityClass.basic, 5, true, true); WorkChore <DoctorChoreWorkable> workChore = doctorChore; workChore.onComplete = (Action <Chore>)Delegate.Combine(workChore.onComplete, (Action <Chore>) delegate { base.smi.GoTo(base.smi.sm.operational.healing.newlyDoctored); }); } }
private void ApplyRequestedControlState() { if (changeStateChore != null) { changeStateChore.Cancel(""); } changeStateChore = null; CurrentState = RequestedState; UpdateState(); kSelectable.RemoveStatusItem(ModAssets.CurtainStatus); Trigger((int)GameHashes.DoorStateChanged, this); }
protected override void OnCleanUp() { controller.GoTo(controller.sm.passingWaiting); controller.StopSM(""); foreach (int cell in building.PlacementCells) { //SetCellPassable(cell, true, false); CleanSim(cell); } changeStateChore = null; base.OnCleanUp(); }
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); }
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 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(); }
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 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); } }
protected override void OnCompleteWork(Worker worker) { base.OnCompleteWork(worker); changeStateChore = null; ApplyRequestedControlState(); }