private static void LoadFavoredClass() { // Note: the favored class choice has no components for behavior, because the logic is implemented by // AddFavoredClassBonusChoice on level up. BlueprintFeature favoredClassAny = Helpers.CreateFeature( "FavoredClassAny", "Favored Class — Any", "The favored class is automatically determined each level-up, and an extra hit point is awarded if gaining a level in that class. The favored class is your highest level non-prestige class. This is the default game behavior.", "ea5f395c351a4f00be7f7a300d3bb5b4", null, FeatureGroup.Feat); List <BlueprintFeature> choices = new List <BlueprintFeature> { favoredClassAny }; // Per FAQ, half-elf and half-orcs can qualify for human favored class bonuses (or elf/orc ones, respectively). // In the game, Aasimar appear to be treated as having "Scion of Humanity" (they don't have Darkvision, but // spells that affect humanoids work on them), so they should also qualify. // TODO: Tiefling should qualify too. extraSpellRaces = new BlueprintRace[] { Helpers.halfElf, Helpers.halfOrc, Helpers.human, Helpers.aasimar, Helpers.tiefling }; foreach (BlueprintCharacterClass characterClass in Helpers.classes) { if (characterClass.PrestigeClass) { continue; } choices.Add(CreateFavoredClassProgression(characterClass)); } EventBus.Subscribe(new UpdateLevelUpDeterminatorText()); PrerequisiteNoFeature noFeature = Helpers.PrerequisiteNoFeature(null); BlueprintFeatureSelection favoredClass = Helpers.CreateFeatureSelection( "FavoredClass", "Favored Class", "Each character begins play with a single favored class of their choosing—typically, this is the same class as the one they choose at 1st level. " + "Whenever a character gains a level in their favored class, they receive either +1 hit point, +1 skill rank, or the racial bonus associated with their favored class. " + "The choice of favored class cannot be changed once the character is created.", "bc4c271ef0954eceb808d84978c500f7", null, UpdateLevelUpDeterminatorText.Group, noFeature); noFeature.Feature = favoredClass; favoredClass.SetFeatures(choices); ApplyClassMechanics_Apply_Patch.onChargenApply.Add((state, unit) => { favoredClass.AddSelection(state, unit, 1); }); }
private static void LoadDeitySelection() { // For RP flavor, this adds an optional deity/atheism selection to the character creation page. BlueprintFeatureSelection baseDeitySelection = library.Get <BlueprintFeatureSelection>("59e7a76987fe3b547b9cce045f4db3e4"); BlueprintFeature atheismFeature = library.Get <BlueprintFeature>("92c0d2da0a836ce418a267093c09ca54"); // Classes tagged with "no atheism" can't select it on the Deity selection. // (in practice, most of them wouldn't get the option, since they have their own deity selection feature. // This is mainly for Oracles, but it also serves as nice documentation.) atheismFeature.AddComponents( Helpers.classes.Where(c => c.GetComponents <PrerequisiteNoFeature>().Any(p => p.Feature == atheismFeature)) .Select(c => Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass = c))); BlueprintFeatureSelection deitySelection = library.CopyAndAdd(baseDeitySelection, "DeitySelectionAny", "d5c3c9d4080043f98e6c09f4e843440e"); deitySelection.Group = FeatureGroup.None; // to prevent "determinators" page clutter. BlueprintFeature noDeityChoice = Helpers.CreateFeature("SkipDeity", "(Skip)", "Choose this to skip selecting a deity at character creation. You may select one later if you gain a level in a class that requires it (such as Cleric, Inquisitor, or Paladin).", "e1f5711210404b34a805b00749eeba20", null, FeatureGroup.None); noDeityChoice.HideInUI = true; List <BlueprintFeature> choices = new List <BlueprintFeature> { noDeityChoice }; choices.AddRange(baseDeitySelection.AllFeatures); choices.Add(atheismFeature); deitySelection.SetFeatures(choices); BlueprintFeatureSelection paladinDeitySelection = library.Get <BlueprintFeatureSelection>("a7c8b73528d34c2479b4bd638503da1d"); ApplyClassMechanics_Apply_Patch.onChargenApply.Add((state, unit) => { if (!state.Selections.Any(s => s.Selection.GetGroup() == FeatureGroup.Deities || (object)s.Selection == paladinDeitySelection)) { deitySelection.AddSelection(state, unit, 1); } }); }