コード例 #1
0
        public string GetDays()
        {
            if (CheatMode)
            {
                return("CM");
            }



            if (!this.FixingBotch && !this.RemoveingConditioning && this.ChangeType == TraitAlterType.UNSET)
            {
                return("NA");
            }

            if (this.FixingBotch)
            {
                return(DayToSafeTime(1f));
            }

            if (this.RemoveingConditioning)
            {
                return(DayToSafeTime(1f));
            }

            var tempConCount = this.StartingConditioning?.Count() ?? 0;

            if (this.RemoveingConditioning)
            {
                tempConCount--;
            }

            var days = PS_ConditioningHelper.DaysToCondition(tempConCount);

            return(DayToSafeTime(days));
        }
コード例 #2
0
        public void StartReconditioning(Pawn pawn, PS_Conditioning_Data conData)
        {
            if (this.PodOwner != null && this.PodOwner != pawn)//!string.IsNullOrEmpty(this.PodOwnerId) && pawn.ThingID != this.PodOwnerId)
            {
                Log.Error("PS_Buildings_ReconPod: Tried to start conditioning on a pawn that was not the owner");
                return;
            }
            this.SaveNeeds(pawn.needs.AllNeeds);
            pawn.DeSpawn(DestroyMode.Vanish);
            if (this.TryAcceptThing(pawn))
            {
                this.ConditioningData = conData;
                this.CurrentMaxTicks  = PS_ConditioningHelper.DaysToCondition(pawn) * this.TicksPerDay;
                this.CurrentTicksLeft = CurrentMaxTicks;
                this.JobState         = PS_Conditioning_JobState.Reconditioning;
                this.TryAssignPawn(pawn);

                EffecterDef progressBar = EffecterDefOf.ProgressBar;
                ProgressBarEffector = progressBar.Spawn();
                var target = new TargetInfo(this);
                ProgressBarEffector.EffectTick(target, TargetInfo.Invalid);
            }
        }