コード例 #1
0
        public void InteractionsTrackerTick()
        {
            RandomSocialMode currentSocialMode = this.CurrentSocialMode;

            if (currentSocialMode == RandomSocialMode.Off)
            {
                this.wantsRandomInteract = false;
            }
            else
            {
                if (currentSocialMode == RandomSocialMode.Quiet)
                {
                    this.wantsRandomInteract = false;
                }
                if (!this.wantsRandomInteract)
                {
                    if (Find.TickManager.TicksGame > this.lastInteractionTime + 320 && this.pawn.IsHashIntervalTick(60))
                    {
                        int num = 0;
                        if (currentSocialMode != RandomSocialMode.Quiet)
                        {
                            if (currentSocialMode != RandomSocialMode.Normal)
                            {
                                if (currentSocialMode == RandomSocialMode.SuperActive)
                                {
                                    num = 550;
                                }
                            }
                            else
                            {
                                num = 6600;
                            }
                        }
                        else
                        {
                            num = 22000;
                        }
                        if (Rand.MTBEventOccurs((float)num, 1f, 60f))
                        {
                            if (!this.TryInteractRandomly())
                            {
                                this.wantsRandomInteract = true;
                            }
                        }
                    }
                }
                else if (this.pawn.IsHashIntervalTick(91))
                {
                    if (this.TryInteractRandomly())
                    {
                        this.wantsRandomInteract = false;
                    }
                }
            }
        }
コード例 #2
0
        public void InteractionsTrackerTick()
        {
            RandomSocialMode currentSocialMode = CurrentSocialMode;

            switch (currentSocialMode)
            {
            case RandomSocialMode.Off:
                wantsRandomInteract = false;
                return;

            case RandomSocialMode.Quiet:
                wantsRandomInteract = false;
                break;
            }
            if (!wantsRandomInteract)
            {
                if (Find.TickManager.TicksGame > lastInteractionTime + 320 && pawn.IsHashIntervalTick(60))
                {
                    int num = 0;
                    switch (currentSocialMode)
                    {
                    case RandomSocialMode.Quiet:
                        num = 22000;
                        break;

                    case RandomSocialMode.Normal:
                        num = 6600;
                        break;

                    case RandomSocialMode.SuperActive:
                        num = 550;
                        break;
                    }
                    if (Rand.MTBEventOccurs(num, 1f, 60f) && !TryInteractRandomly())
                    {
                        wantsRandomInteract = true;
                    }
                }
            }
            else if (pawn.IsHashIntervalTick(91) && TryInteractRandomly())
            {
                wantsRandomInteract = false;
            }
        }