Esempio n. 1
0
        static Start()
        {
            var pawnSkillTimerCache = new PawnSkillTimerCache(25);
            var levelEventMaker     = new LevelEventMaker(pawnSkillTimerCache);

            SkillRecordLearnPatch.InitializePatch(new Harmony("Krafs.LevelUp"), levelEventMaker);
        }
Esempio n. 2
0
 public LevelEventMaker(PawnSkillTimerCache pawnSkillTimerCache, Settings modSettings)
 {
     this.pawnSkillTimerCache = pawnSkillTimerCache;
     this.modSettings         = modSettings;
     this.levelUpMessage      = "Krafs.LevelUp.LevelUpMessage".TranslateSimple().Replace("{0}", "{0}".Colorize(ColoredText.NameColor));
     this.levelDownMessage    = "Krafs.LevelUp.LevelDownMessage".TranslateSimple().Replace("{0}", "{0}".Colorize(ColoredText.NameColor));
 }
Esempio n. 3
0
        static Start()
        {
            var pawnSkillTimerCache = new PawnSkillTimerCache(25);
            var modSettings         = LoadedModManager.GetMod <ModHandler>().GetSettings <Settings>();
            var levelEventMaker     = new LevelEventMaker(pawnSkillTimerCache, modSettings);

            SkillRecordLearnPatch.InitializePatch(new Harmony("Krafs.LevelUp"), levelEventMaker);
        }
Esempio n. 4
0
        public void ExecuteActions(LevelingInfo levelingInfo)
        {
            if (!levelingInfo.Pawn.IsFreeColonist)
            {
                return;
            }

            for (int i = 0; i < preparedActions.Count; i++)
            {
                preparedActions[i].Execute(levelingInfo);
            }

            bool cooldownPassed = PawnSkillTimerCache.EnoughTimeHasPassed(levelingInfo);

            if (!cooldownPassed)
            {
                return;
            }

            for (int i = 0; i < preparedCooldownActions.Count; i++)
            {
                preparedCooldownActions[i].Execute(levelingInfo);
            }
        }
Esempio n. 5
0
 public LevelEventMaker(PawnSkillTimerCache pawnSkillTimerCache)
 {
     this.pawnSkillTimerCache = pawnSkillTimerCache;
 }