Ejemplo n.º 1
0
 public override void RegisterProfessions()
 {
     Logger.LogInformation("Registering Luck Professions...");
     Lucky = new TierOneProfession
     {
         Id          = 30,
         DisplayName = "Lucky",
         EffectText  = new[] { "Better daily luck." }
     };
     Quester = new TierOneProfession
     {
         Id          = 31,
         DisplayName = "Quester",
         EffectText  = new[] { "Quests are more likely to appear each day." },
     };
     SpecialCharm = new TierTwoProfession
     {
         Id                = 32,
         DisplayName       = "Special Charm",
         EffectText        = new[] { "Great daily luck most of the time." },
         SpecialHandling   = new SpecialCharmSpecialHandling(),
         TierOneProfession = Lucky
     };
     LuckA2 = new TierTwoProfession
     {
         Id                = 33,
         DisplayName       = "Luck A2",
         EffectText        = new[] { "Does...nothing, yet." },
         TierOneProfession = Lucky
     };
     NightOwl = new TierTwoProfession
     {
         Id                = 34,
         DisplayName       = "Night Owl",
         EffectText        = new[] { "Nightly events occur twice as often." },
         TierOneProfession = Quester
     };
     LuckB2 = new TierTwoProfession
     {
         Id                = 35,
         DisplayName       = "Luck B2",
         EffectText        = new[] { "Does...nothing, yet." },
         TierOneProfession = Quester
     };
     Quester.TierTwoProfessions = new List <TierTwoProfession>
     {
         NightOwl,
         LuckB2
     };
     Lucky.TierTwoProfessions = new List <TierTwoProfession>
     {
         SpecialCharm,
         LuckA2
     };
     Logger.LogInformation("Luck Professions Registered.");
 }
 public override void RegisterProfessions()
 {
     Logger.LogInformation("Registering Combat professions...");
     Fighter = new TierOneProfession
     {
         Id = 24,
         SpecialHandling = new FighterSpecialHandling(),
     };
     Scout = new TierOneProfession
     {
         Id = 25,
     };
     Brute = new TierTwoProfession
     {
         Id = 26,
         TierOneProfession = Fighter
     };
     Defender = new TierTwoProfession
     {
         Id = 27,
         SpecialHandling   = new DefenderSpecialHandling(),
         TierOneProfession = Fighter
     };
     Acrobat = new TierTwoProfession
     {
         Id = 28,
         TierOneProfession = Scout
     };
     Desperado = new TierTwoProfession
     {
         Id = 29,
         TierOneProfession = Scout
     };
     Scout.TierTwoProfessions = new List <TierTwoProfession>
     {
         Acrobat,
         Desperado
     };
     Fighter.TierTwoProfessions = new List <TierTwoProfession>
     {
         Brute,
         Defender
     };
     Logger.LogInformation("Combat professions registered.");
 }
Ejemplo n.º 3
0
 public override void RegisterProfessions()
 {
     Logger.LogInformation("Registering Mining professions...");
     Miner = new TierOneProfession
     {
         Id = 18
     };
     Geologist = new TierOneProfession
     {
         Id = 19
     };
     Blacksmith = new TierTwoProfession
     {
         Id = 20,
         TierOneProfession = Miner
     };
     Prospector = new TierTwoProfession
     {
         Id = 21,
         TierOneProfession = Miner
     };
     Excavator = new TierTwoProfession
     {
         Id = 22,
         TierOneProfession = Geologist
     };
     Gemologist = new TierTwoProfession
     {
         Id = 23,
         TierOneProfession = Geologist
     };
     Miner.TierTwoProfessions = new List <TierTwoProfession>
     {
         Blacksmith,
         Prospector
     };
     Geologist.TierTwoProfessions = new List <TierTwoProfession>
     {
         Excavator,
         Gemologist
     };
     Logger.LogInformation("Mining professions registered.");
 }
 public override void RegisterProfessions()
 {
     Logger.LogInformation("Registering Foraging professions...");
     Forester = new TierOneProfession
     {
         Id = 12
     };
     Gatherer = new TierOneProfession
     {
         Id = 13
     };
     Lumberjack = new TierTwoProfession
     {
         Id = 14,
         TierOneProfession = Forester
     };
     Tapper = new TierTwoProfession
     {
         Id = 15,
         TierOneProfession = Forester
     };
     Botanist = new TierTwoProfession
     {
         Id = 16,
         TierOneProfession = Gatherer
     };
     Tracker = new TierTwoProfession
     {
         Id = 17,
         TierOneProfession = Gatherer
     };
     Forester.TierTwoProfessions = new List <TierTwoProfession>
     {
         Lumberjack,
         Tapper
     };
     Gatherer.TierTwoProfessions = new List <TierTwoProfession>
     {
         Botanist,
         Tracker
     };
     Logger.LogInformation("Foraging professions registered.");
 }
 public override void RegisterProfessions()
 {
     Logger.LogInformation("Registering Fishing professions...");
     Fisher = new TierOneProfession
     {
         Id = 6
     };
     Trapper = new TierOneProfession
     {
         Id = 7
     };
     Angler = new TierTwoProfession
     {
         Id = 8,
         TierOneProfession = Fisher
     };
     Pirate = new TierTwoProfession
     {
         Id = 9,
         TierOneProfession = Fisher
     };
     Mariner = new TierTwoProfession
     {
         Id = 10,
         TierOneProfession = Trapper
     };
     Luremaster = new TierTwoProfession
     {
         Id = 11,
         TierOneProfession = Trapper
     };
     Fisher.TierTwoProfessions = new List <TierTwoProfession>
     {
         Angler,
         Pirate
     };
     Trapper.TierTwoProfessions = new List <TierTwoProfession>
     {
         Mariner,
         Luremaster
     };
     Logger.LogInformation("Fishing professions registered.");
 }
Ejemplo n.º 6
0
 public override void RegisterProfessions()
 {
     Logger.LogInformation("Registering Farming professions...");
     Rancher = new TierOneProfession
     {
         Id = 0
     };
     Tiller = new TierOneProfession
     {
         Id = 1
     };
     Coopmaster = new TierTwoProfession
     {
         Id = 2,
         TierOneProfession = Rancher
     };
     Shepherd = new TierTwoProfession
     {
         Id = 3,
         TierOneProfession = Rancher
     };
     Artisan = new TierTwoProfession
     {
         Id = 4,
         TierOneProfession = Tiller
     };
     Agriculturist = new TierTwoProfession
     {
         Id = 5,
         TierOneProfession = Tiller
     };
     Rancher.TierTwoProfessions = new List <TierTwoProfession>
     {
         Coopmaster, Shepherd
     };
     Tiller.TierTwoProfessions = new List <TierTwoProfession>
     {
         Artisan, Agriculturist
     };
     Logger.LogInformation("Farming professions registered.");
 }
Ejemplo n.º 7
0
        /// <summary>Get the professions added by this mod.</summary>
        private IEnumerable <Profession> GetAddedProfessions()
        {
            var lucky = new TierOneProfession
            {
                Id          = 30,
                DisplayName = "Lucky",
                EffectText  = new[] { "Better daily luck." }
            };
            var quester = new TierOneProfession
            {
                Id          = 31,
                DisplayName = "Quester",
                EffectText  = new[] { "Quests are more likely to appear each day." },
            };
            var specialCharm = new TierTwoProfession
            {
                Id                = 32,
                DisplayName       = "Special Charm",
                EffectText        = new[] { "Great daily luck most of the time." },
                SpecialHandling   = new SpecialCharmSpecialHandling(),
                TierOneProfession = lucky
            };
            var luckA2 = new TierTwoProfession
            {
                Id                = 33,
                DisplayName       = "Luck A2",
                EffectText        = new[] { "Does...nothing, yet." },
                TierOneProfession = lucky
            };
            var nightOwl = new TierTwoProfession
            {
                Id                = 34,
                DisplayName       = "Night Owl",
                EffectText        = new[] { "Nightly events occur twice as often." },
                TierOneProfession = quester
            };
            var luckB2 = new TierTwoProfession
            {
                Id                = 35,
                DisplayName       = "Luck B2",
                EffectText        = new[] { "Does...nothing, yet." },
                TierOneProfession = quester
            };

            quester.TierTwoProfessions = new List <TierTwoProfession>
            {
                nightOwl,
                luckB2
            };
            lucky.TierTwoProfessions = new List <TierTwoProfession>
            {
                specialCharm,
                luckA2
            };

            return(new Profession[]
            {
                lucky,
                quester,
                specialCharm,
                luckA2,
                nightOwl,
                luckB2
            });
        }
Ejemplo n.º 8
0
        /// <summary>Get the professions added by this mod.</summary>
        private IEnumerable <Profession> GetAddedProfessions()
        {
            var gourmet = new TierOneProfession
            {
                Id          = 50,
                DisplayName = "Gourmet",
                EffectText  = new[] { "+20% sell price" }
            };
            var satisfying = new TierOneProfession
            {
                Id          = 51,
                DisplayName = "Satisfying",
                EffectText  = new[] { "+25% buff duration once eaten" }
            };
            var efficient = new TierTwoProfession
            {
                Id                = 52,
                DisplayName       = "Efficient",
                EffectText        = new[] { "15% chance to not consume ingredients" },
                TierOneProfession = gourmet
            };
            var professionalChef = new TierTwoProfession
            {
                Id                = 53,
                DisplayName       = "Prof. Chef",
                EffectText        = new[] { "Home-cooked meals are always at least silver" },
                TierOneProfession = gourmet
            };
            var intenseFlavors = new TierTwoProfession
            {
                Id          = 54,
                DisplayName = "Intense Flavors",
                EffectText  = new[]
                {
                    "Food buffs are one level stronger",
                    "(+20% for max energy or magnetism)"
                },
                TierOneProfession = satisfying
            };
            var secretSpices = new TierTwoProfession
            {
                Id                = 55,
                DisplayName       = "Secret Spices",
                EffectText        = new[] { "Provides a few random buffs when eating unbuffed food." },
                TierOneProfession = satisfying
            };

            gourmet.TierTwoProfessions = new List <TierTwoProfession>
            {
                efficient,
                professionalChef
            };
            satisfying.TierTwoProfessions = new List <TierTwoProfession>
            {
                intenseFlavors,
                secretSpices
            };
            return(new Profession[]
            {
                gourmet,
                satisfying,
                efficient,
                professionalChef,
                intenseFlavors,
                secretSpices
            });
        }
Ejemplo n.º 9
0
        private void InitiateUi()
        {
            if (_uiInitiated)
            {
                return;
            }
            _uiInitiated = true;
            Logger.LogVerbose("Level Up Menu - initializing UI...");
            Prestige          prestigeData = PrestigeSaveData.CurrentlyLoadedPrestigeSet.Prestiges.Single(x => x.SkillType == _currentSkill.Type);
            List <Profession> prestigedProfessionsForThisSkillAndLevel = _currentSkill.Professions
                                                                         .Where(x => prestigeData.PrestigeProfessionsSelected.Contains(x.Id) && x.LevelAvailableAt == _currentLevel)
                                                                         .ToList();
            List <Profession> professionsToChooseFrom = _currentSkill.Professions.Where(x => x.LevelAvailableAt == _currentLevel).ToList();

            if (_currentLevel == 5)
            {
                if (!prestigedProfessionsForThisSkillAndLevel.Any())
                {
                    Logger.LogVerbose("Level Up Menu - No prestiged professions found for this skill/level combination.");
                    return;
                }
                if (prestigedProfessionsForThisSkillAndLevel.Count == 1)
                {
                    Logger.LogInformation("Level Up Menu - One level 5 prestiged profession found, automatically selecting the other.");
                    Profession professionToAdd = professionsToChooseFrom.First(x => !prestigedProfessionsForThisSkillAndLevel.Contains(x));
                    Game1.player.professions.Add(professionToAdd.Id);
                    professionToAdd.SpecialHandling?.ApplyEffect();
                    _internalMenu.exitThisMenu(false);
                    RemoveLevelFromLevelList(_currentSkill.Type.Ordinal, _currentLevel);
                    Game1.activeClickableMenu = new LevelUpMessageDialogWithProfession(MessageDialogBounds, $"You levelled your {_currentSkill.Type.Name} skill to level {_currentLevel} and gained a profession!", _currentSkill, professionToAdd);
                    return;
                }
                if (prestigedProfessionsForThisSkillAndLevel.Count >= 2)
                {
                    Logger.LogInformation("Level Up Menu - Both available level 5 professions are already prestiged.");
                    _internalMenu.exitThisMenu(false);
                    RemoveLevelFromLevelList(_currentSkill.Type.Ordinal, _currentLevel);
                    Game1.activeClickableMenu = new LevelUpMessageDialog(MessageDialogBounds, $"You levelled your {_currentSkill.Type.Name} skill to level {_currentLevel}!", _currentSkill);
                    return;
                }
            }
            if (_currentLevel != 10)
            {
                return;
            }

            int levelFiveProfessionsCount = Game1.player.professions
                                            .Intersect(
                _currentSkill.Professions.Where(x => x is TierOneProfession).Select(x => x.Id)
                )
                                            .Count();

            if (levelFiveProfessionsCount == 1)
            {
                if (!prestigedProfessionsForThisSkillAndLevel.Any())
                {
                    Logger.LogVerbose("Level Up Menu - No prestiged professions found for this skill/level combination.");
                    return;
                }
                if (prestigedProfessionsForThisSkillAndLevel.Count == 1)
                {
                    Logger.LogInformation("Level Up Menu - One level 10 prestiged profession found for only one available level 5 skill (cheater!), automatically selecting the other.");
                    TierOneProfession tierOneProfession = ((TierTwoProfession)prestigedProfessionsForThisSkillAndLevel.First()).TierOneProfession;
                    Profession        professionToAdd   = professionsToChooseFrom
                                                          .First(x =>
                                                                 (x as TierTwoProfession)?.TierOneProfession == tierOneProfession &&
                                                                 !prestigedProfessionsForThisSkillAndLevel.Contains(x)
                                                                 );
                    Game1.player.professions.Add(professionToAdd.Id);
                    professionToAdd.SpecialHandling?.ApplyEffect();
                    _internalMenu.exitThisMenu(false);
                    RemoveLevelFromLevelList(_currentSkill.Type.Ordinal, _currentLevel);
                    Game1.activeClickableMenu = new LevelUpMessageDialogWithProfession(ExtraTallMessageDialogBounds, $"You levelled your {_currentSkill.Type.Name} skill to level {_currentLevel} and gained a profession! {Environment.NewLine} You may now prestige this skill again!", _currentSkill, professionToAdd);
                    return;
                }
                if (prestigedProfessionsForThisSkillAndLevel.Count < 2)
                {
                    return;
                }
                Logger.LogInformation("Level Up Menu - Only one level 5 profession found with both level 10 professions already prestiged (cheater!).");
                _internalMenu.exitThisMenu(false);
                RemoveLevelFromLevelList(_currentSkill.Type.Ordinal, _currentLevel);
                Game1.activeClickableMenu = new LevelUpMessageDialog(MessageDialogBounds, $"You levelled your {_currentSkill.Type.Name} skill to level {_currentLevel}!  {Environment.NewLine} You may now prestige this skill again!", _currentSkill);
            }
            else
            {
                if (prestigedProfessionsForThisSkillAndLevel.Count <= 2)
                {
                    Logger.LogInformation("Level Up Menu - Two or less prestiged level 10 professions found for this skill, with more than one level 5 profession found.");
                    if (prestigedProfessionsForThisSkillAndLevel.Intersect(professionsToChooseFrom.Take(2)).Count() == 2)
                    {
                        Logger.LogInformation("Level Up Menu - All of one level 10 profession branch found, switching to remaining menu.");
                        ToggleLevelTenMenu();
                        return;
                    }
                    if (prestigedProfessionsForThisSkillAndLevel.Intersect(professionsToChooseFrom.Skip(2).Take(2)).Count() == 2)
                    {
                        Logger.LogInformation("Level Up Menu - All of one level 10 profession branch found, leaving at default menu.");
                        return;
                    }
                    Logger.LogInformation("Level Up Menu - Both level up menus found as viable, enabling user side toggle.");
                    SetupLevelTenToggleButton();
                    _drawToggleSwitch           = true;
                    _drawLeftPrestigedIndicator = prestigedProfessionsForThisSkillAndLevel
                                                  .Contains(professionsToChooseFrom.Skip(_isRightSideOfTree == false ? 0 : 2).First());
                    _drawRightPrestigedIndicator = prestigedProfessionsForThisSkillAndLevel
                                                   .Contains(professionsToChooseFrom.Skip(_isRightSideOfTree == false ? 1 : 3).First());
                    return;
                }
                if (prestigedProfessionsForThisSkillAndLevel.Count == 3)
                {
                    Logger.LogInformation("Level Up Menu - All but one level 10 profession found, selecting remaining profession.");
                    Profession professionToAdd = professionsToChooseFrom.First(x => !prestigedProfessionsForThisSkillAndLevel.Contains(x));
                    Game1.player.professions.Add(professionToAdd.Id);
                    professionToAdd.SpecialHandling?.ApplyEffect();
                    _internalMenu.exitThisMenu(false);
                    RemoveLevelFromLevelList(_currentSkill.Type.Ordinal, _currentLevel);
                    Game1.activeClickableMenu = new LevelUpMessageDialogWithProfession(ExtraTallMessageDialogBounds, $"You levelled your {_currentSkill.Type.Name} skill to level {_currentLevel} and gained a profession!  {Environment.NewLine} You may now prestige this skill again!", _currentSkill, professionToAdd);
                    return;
                }
                if (prestigedProfessionsForThisSkillAndLevel.Count < 4)
                {
                    return;
                }
                Logger.LogInformation("Level Up Menu - All professions already prestiged for this skill.");
                _internalMenu.exitThisMenu(false);
                RemoveLevelFromLevelList(_currentSkill.Type.Ordinal, _currentLevel);
                Game1.activeClickableMenu = new LevelUpMessageDialog(ExtraTallMessageDialogBounds, $"You levelled your {_currentSkill.Type.Name} skill to level {_currentLevel}!  {Environment.NewLine} Congratulations! You have prestiged all of your professions and reached level 10 again! You may continue to earn prestige points if you wish, as more prestige options are coming soon!", _currentSkill);
            }
        }
Ejemplo n.º 10
0
        private IEnumerable <Profession> GetAddedProfessions()
        {
            var sousChef = new TierOneProfession
            {
                Id          = 50,
                DisplayName = "Sous Chef",
                EffectText  = new[] { "Cooking oil further improves the quality of recipes." }
            };
            var quickEater = new TierOneProfession
            {
                Id          = 51,
                DisplayName = "Quick Eater",
                EffectText  = new[] { "Food restores your energy more quickly." }
            };
            var headChef = new TierTwoProfession
            {
                Id                = 52,
                DisplayName       = "Head Chef",
                EffectText        = new[] { "Cooked foods given as gifts befriend quicker." },
                TierOneProfession = sousChef
            };
            var fiveStarCook = new TierTwoProfession
            {
                Id                = 53,
                DisplayName       = "Five Star Cook",
                EffectText        = new[] { "Cooked foods worth 30% more." },
                TierOneProfession = sousChef
            };
            var gourmet = new TierTwoProfession
            {
                Id                = 54,
                DisplayName       = "Gourmet",
                EffectText        = new[] { "Chance to craft an extra portion when cooking." },
                TierOneProfession = quickEater
            };
            var glutton = new TierTwoProfession
            {
                Id                = 55,
                DisplayName       = "Glutton",
                EffectText        = new[] { "Buff duration from food and drinks increased when at full energy." },
                TierOneProfession = quickEater
            };

            sousChef.TierTwoProfessions = new List <TierTwoProfession>
            {
                headChef,
                fiveStarCook
            };
            quickEater.TierTwoProfessions = new List <TierTwoProfession>
            {
                gourmet,
                glutton
            };
            return(new Profession[]
            {
                sousChef,
                quickEater,
                headChef,
                fiveStarCook,
                gourmet,
                glutton
            });
        }
Ejemplo n.º 11
0
        /// <summary>Get the professions added by this mod.</summary>
        private IEnumerable <Profession> GetAddedProfessions()
        {
            var skill = SpaceCore.Skills.GetSkill("spacechase0.Magic");

            IList <Profession>        professions = new List <Profession>();
            IList <TierOneProfession> tierOne     = new List <TierOneProfession>();

            foreach (var professionGroup in skill.ProfessionsForLevels)
            {
                if (professionGroup.Level == 5)
                {
                    var professionA = new TierOneProfession
                    {
                        DisplayName = professionGroup.First.GetName(),
                        Id          = professionGroup.First.GetVanillaId(),
                        EffectText  = new[] { professionGroup.First.GetDescription() },
                    };
                    var professionB = new TierOneProfession
                    {
                        DisplayName = professionGroup.Second.GetName(),
                        Id          = professionGroup.Second.GetVanillaId(),
                        EffectText  = new[] { professionGroup.Second.GetDescription() },
                    };

                    professions.Add(professionA);
                    professions.Add(professionB);
                    tierOne.Add(professionA);
                    tierOne.Add(professionB);
                }
                else if (professionGroup.Level == 10)
                {
                    TierOneProfession requiredProfession = tierOne.First(p => p.DisplayName == professionGroup.Requires.GetName());

                    var professionA = new TierTwoProfession
                    {
                        DisplayName       = professionGroup.First.GetName(),
                        Id                = professionGroup.First.GetVanillaId(),
                        EffectText        = new[] { professionGroup.First.GetDescription() },
                        TierOneProfession = requiredProfession,
                    };
                    var professionB = new TierTwoProfession
                    {
                        DisplayName       = professionGroup.Second.GetName(),
                        Id                = professionGroup.Second.GetVanillaId(),
                        EffectText        = new[] { professionGroup.Second.GetDescription() },
                        TierOneProfession = requiredProfession,
                    };

                    professions.Add(professionA);
                    professions.Add(professionB);

                    requiredProfession.TierTwoProfessions = new[] { professionA, professionB };
                }
            }

            foreach (var profession in professions)
            {
                if (profession.DisplayName == "Mana Reserve")
                {
                    profession.SpecialHandling = new ManaCapSpecialHandling(500);
                }
                else if (profession.DisplayName == "Potential" || profession.DisplayName == "Prodigy")
                {
                    profession.SpecialHandling = new UpgradePointSpecialHandling(2);
                }
            }

            return(professions);
        }