Example #1
0
        public void LogStorytellerCompVote(StorytellerPack pack)
        {
            if (!StorytellerLastTickTracker.ContainsKey(pack.defName))
            {
                StorytellerLastTickTracker.Add(pack.defName, 0);
            }

            StorytellerLastTickTracker[pack.defName] = Find.TickManager.TicksGame;
        }
        public bool HaveMinimumDaysBetweenEventsPassed(StorytellerPack pack)
        {
            if (StorytellerLastTickTracker == null)
            {
                StorytellerLastTickTracker = new Dictionary <string, int>();
            }

            if (!StorytellerLastTickTracker.ContainsKey(pack.defName))
            {
                StorytellerLastTickTracker.Add(pack.defName, GenDate.DaysPassed < 2 ? 0 : Find.TickManager.TicksGame);

                return(true);
            }

            float daysBetweenEvents;

            switch (pack.defName)
            {
            case "ToryTalker":
                daysBetweenEvents = ToolkitSettings.ToryTalkerMTBDays;
                break;

            case "HodlBot":
                daysBetweenEvents = ToolkitSettings.HodlBotMTBDays;
                break;

            case "UristBot":
                daysBetweenEvents = ToolkitSettings.UristBotMTBDays;
                break;

            case "Milasandra":
                daysBetweenEvents = ((StorytellerCompProperties_ToolkitOnOffCycle)(DefDatabase <StorytellerPack> .GetNamed("Milasandra").StorytellerComp).props).minSpacingDays;
                break;

            case "Mercurius":
                daysBetweenEvents = ((StorytellerCompProperties_ToolkitCategoryMTB)(DefDatabase <StorytellerPack> .GetNamed("Mercurius").StorytellerComp).props).mtbDays;
                break;

            default:
                Log.Error("No MTB days for storyteller pack");
                return(false);
            }

            return((daysBetweenEvents * GenDate.TicksPerDay) + StorytellerLastTickTracker[pack.defName] < Find.TickManager.TicksGame);
        }
Example #3
0
        public bool HaveMinimumDaysBetweenEventsPassed(StorytellerPack pack)
        {
            if (StorytellerLastTickTracker == null)
            {
                StorytellerLastTickTracker = new Dictionary <string, int>();
            }

            if (!StorytellerLastTickTracker.ContainsKey(pack.defName))
            {
                StorytellerLastTickTracker.Add(pack.defName, GenDate.DaysPassed < 2 ? 0 : Find.TickManager.TicksGame);

                return(true);
            }

            float daysBetweenEvents;

            switch (pack.defName)
            {
            case "ToryTalker":
                daysBetweenEvents = ToolkitSettings.ToryTalkerMTBDays;
                break;

            case "HodlBot":
                daysBetweenEvents = ToolkitSettings.HodlBotMTBDays;
                break;

            case "UristBot":
                daysBetweenEvents = ToolkitSettings.UristBotMTBDays;
                break;

            default:
                Log.Error("No MTB days for storyteller pack");
                return(false);
            }

            return((daysBetweenEvents * GenDate.TicksPerDay) + StorytellerLastTickTracker[pack.defName] < Find.TickManager.TicksGame);
        }