コード例 #1
0
        public static void OnGUI()
        {
            HStack("Character Creation", 1,
                   () => Slider("Build Points (Main)", ref settings.characterCreationAbilityPointsPlayer, 1, 200, 25, "", AutoWidth()),
                   () => Slider("Build Points (Mercenary)", ref settings.characterCreationAbilityPointsMerc, 1, 200, 20, "", AutoWidth()),
                   () => Slider("Ability Max", ref settings.characterCreationAbilityPointsMax, 0, 50, 18, "", AutoWidth()),
                   () => Slider("Ability Min", ref settings.characterCreationAbilityPointsMin, 0, 50, 7, "", AutoWidth()),
                   //() => {
                   //    UI.Toggle("All Appearance Options", ref settings.toggleAllRaceCustomizations);
                   //    UI.Space(25);
                   //    UI.Label("Allows you to choose all appearance options from any race".green());
                   //},
                   () => { }
                   );
            Div(0, 25);
            HStack("Mythic Paths", 1,
                   () => Label("Warning! Using these might break your game somehow. Recommend for experimental tinkering like trying out different builds, and not for actually playing the game.".green()),
                   () => ActionButton("Unlock Aeon", Actions.UnlockAeon, Width(300)),
                   () => ActionButton("Unlock Azata", Actions.UnlockAzata, Width(300)),
                   () => ActionButton("Unlock Trickster", Actions.UnlockTrickster, Width(300)),
                   () => ActionButton("Unlock Lich", Actions.UnlockLich, Width(300)),
                   () => { ActionButton("Unlock Swarm", Actions.UnlockSwarm, Width(300)); Space(25); Label("Only available at Mythic level 8 or higher".green()); },
                   () => { ActionButton("Unlock Gold Dragon", Actions.UnlockGoldDragon, Width(300)); Space(25); Label("Only available at Mythic level 8 or higher".green()); },
                   () => {
                ActionButton("All Mythic Paths".orange(), Actions.UnlockAllBasicMythicPaths, Width(300));
                Space(25);
                Label("Unlock mythic paths besides Legend and Devil which block progression".green());
            },
                   () => Label("", Height(10)),
                   () => { ActionButton("Unlock Devil", Actions.UnlockDevil, Width(300)); Space(25); Label("Prevents you from advancing in Aeon or Azata".green()); },
                   () => { ActionButton("Unlock Legend", Actions.UnlockLegend, Width(300)); Space(25); Label("Prevents you from advancing all other Mythic Path".green()); },
                   () => { }
                   );
            Div(0, 25);
            HStack("Create & Level Up", 1,
                   () => {
                Slider("Feature Selection Multiplier", ref settings.featsMultiplier, 0, 10, 1, "", Width(600));
                Space(25);
                Label("This allows you to select a given feature more than once at level up".green());
            },
                   () => Toggle("Apply Feature Selection Multiplier to party members", ref settings.toggleFeatureMultiplierCompanions),
                   () => {
                Toggle("Allow Multiple Archetypes When Selecting A New Class", ref settings.toggleMultiArchetype);
                25.space();
                Label("This allows you to select combinations of archetypes when selecting a class for the first time that contain distinct spellbooks".green());
            },
                   () => Toggle("Enable  'Next' when no feat selections are available", ref settings.toggleNextWhenNoAvailableFeatSelections),
                   () => Toggle("Make All Feature Selections Optional", ref settings.toggleOptionalFeatSelection),
                   () => {
                Toggle("Ignore Attribute Cap", ref settings.toggleIgnoreAttributeCap);
                Space(25);
                Toggle("Ignore Remaining Attribute Points", ref settings.toggleIgnoreAttributePointsRemaining);
            },
                   () => {
                Toggle("Ignore Skill Cap", ref settings.toggleIgnoreSkillCap);
                Space(73);
                Toggle("Ignore Remaining Skill Points", ref settings.toggleIgnoreSkillPointsRemaining);
            },
                   () => Toggle("Always Able To Level Up", ref settings.toggleNoLevelUpRestrictions),
                   () => Toggle("Add Full Hit Die Value", ref settings.toggleFullHitdiceEachLevel),
                   (Action)(() => {
                Toggle((string)"Ignore Class Restrictions", ref settings.toggleIgnoreClassRestrictions);
                Space(25);
                Label("Experimental".cyan() + ": in addition to regular leveling, this allows you to choose any mythic class each time you level up starting from level 1. This may have interesting and unexpected effects. Backup early and often...".green());
            }),
                   (Action)(() => {
                Toggle((string)"Ignore Feat Restrictions", ref settings.toggleIgnoreFeatRestrictions);
                Space(25);
                Label("Experimental".cyan() + ": lets you select any feat ignoring prerequisites.".green());
            }),
                   () => Toggle("Allow Companions to Take Mythic Classes", ref settings.toggleAllowCompanionsToBecomeMythic),
                   () => Toggle("Allow Pets to Take Mythic Classes", ref settings.toggleAllowMythicPets),
                   () => Toggle("Ignore Prerequisites When Choosing A Feat", ref settings.toggleFeaturesIgnorePrerequisites),
                   () => Toggle("Ignore Caster Type And Spell Level Restrictions", ref settings.toggleIgnoreCasterTypeSpellLevel),
                   () => Toggle("Ignore Forbidden Archetypes", ref settings.toggleIgnoreForbiddenArchetype),
                   () => Toggle("Ignore Required Stat Values", ref settings.toggleIgnorePrerequisiteStatValue),
                   () => Toggle("Ignore Required Class Levels", ref settings.toggleIgnorePrerequisiteClassLevel),
                   () => Toggle("Ignore Alignment When Choosing A Class", ref settings.toggleIgnoreAlignmentWhenChoosingClass),
                   () => Toggle("Ignore Prerequisite Features (like Race) when choosing Class", ref settings.toggleIgnoreFeaturePrerequisitesWhenChoosingClass),
#if false // This is incredibly optimistic and requires resolving a bunch of conflicts with the existing gestalt and scroll copy logic
                   () => UI.Toggle("Ignore Spellbook Restrictions When Choosing Spells", ref settings.toggleUniversalSpellbookd),
#endif

                   () => Toggle("Skip Spell Selection", ref settings.toggleSkipSpellSelection),
#if DEBUG
                   () => Toggle("Lock Character Level", ref settings.toggleLockCharacterLevel),
                   //                    () => UI.Toggle("Ignore Alignment Restrictions", ref settings.toggleIgnoreAlignmentRestriction),
#endif
#if false
                   // Do we need these or is it covered by toggleFeaturesIgnorePrerequisites
                   () => { UI.Toggle("Ignore Feat Prerequisites When Choosing A Class", ref settings.toggleIgnoreFeaturePrerequisitesWhenChoosingClass); },
                   () => { UI.Toggle("Ignore Feat Prerequisits (List) When Choosing A Class", ref settings.toggle); },
#endif
                   () => Toggle("Remove Level 20 Caster Level Cap", ref settings.toggleUncappedCasterLevel),
                   () => Toggle("Party Level Cap 40 (continuous growth after 20)", ref settings.toggleContinousLevelCap),
                   () => Toggle("Party Level Cap 24 (exponential growth)", ref settings.toggleExponentialLevelCap),

                   () => { }
                   );
#if true
            Div(0, 25);
            HStack("Multiple Classes", 1,
                   //() => UI.Label("Experimental Preview".magenta(), UI.AutoWidth()),
                   () => {
                Toggle("Multiple Classes On Level-Up", ref settings.toggleMulticlass);
                Space(25);
                using (VerticalScope()) {
                    Label("Experimental - With this enabled you can configure characters in the Party Editor to gain levels in additional classes whenever they level up. See the link for more information on this campaign variant.".green());
                    LinkButton("Gestalt Characters", "https://www.d20srd.org/srd/variant/classes/gestaltCharacters.htm");
                    Space(15);
                }
            },
                   () => {
                EnumGrid("Hit Point (Hit Die) Growth", ref settings.multiclassHitPointPolicy, 0, AutoWidth());
            },
                   () => {
                EnumGrid("Basic Attack Growth Pr", ref settings.multiclassBABPolicy, 0, AutoWidth());
            },
                   () => {
                EnumGrid("Saving Throw Growth", ref settings.multiclassSavingThrowPolicy, 0, AutoWidth());
            },
                   () => {
                EnumGrid("Skill Point Growth", ref settings.multiclassSkillPointPolicy, 0, AutoWidth());
            },
#if false
                   () => UI.Toggle("Use Recalculate Caster Levels", ref settings.toggleRecalculateCasterLevelOnLevelingUp),
                   () => UI.Toggle("Restrict Caster Level To Current", ref settings.toggleRestrictCasterLevelToCharacterLevel),
                   //() => { UI.Toggle("Restrict CL to Current (temp) ", ref settings.toggleRestrictCasterLevelToCharacterLevelTemporary),
                   () => UI.Toggle("Restrict Class Level for Prerequisites to Caster Level", ref settings.toggleRestrictClassLevelForPrerequisitesToCharacterLevel),
                   () => UI.Toggle("Fix Favored Class HP", ref settings.toggleFixFavoredClassHP),
                   () => UI.Toggle("Always Receive Favored Class HP", ref settings.toggleAlwaysReceiveFavoredClassHP),
                   () => UI.Toggle("Always Receive Favored Class HP Except Prestige", ref settings.toggleAlwaysReceiveFavoredClassHPExceptPrestige),
#endif
                   () => { }
                   );

            if (settings.toggleMulticlass)
            {
                UnitEntityData selectedChar = null;
                Div(0, 25);
                HStack("Class Selection", 1,
                       () => {
                    if (Main.IsInGame)
                    {
                        var characters = Game.Instance.Player.m_PartyAndPets;
                        if (characters == null)
                        {
                            return;
                        }
                        settings.selectedClassToConfigMulticlass = Math.Min(characters.Count, settings.selectedClassToConfigMulticlass);
                        ActionSelectionGrid(ref settings.selectedClassToConfigMulticlass,
                                            characters.Select((ch) => ch.CharacterName).Prepend("Char Gen").ToArray(),
                                            6,
                                            (index) => { },
                                            AutoWidth()
                                            );
                        if (settings.selectedClassToConfigMulticlass <= 0)
                        {
                            selectedChar = null;
                        }
                        else
                        {
                            selectedChar = characters[settings.selectedClassToConfigMulticlass - 1];
                        }
                    }
                },
                       () => { }
                       );

                MulticlassPicker.OnGUI(selectedChar, 150);
            }
#endif
        }
コード例 #2
0
        public static void OnGUI()
        {
            var player        = Game.Instance.Player;
            var filterChoices = GetPartyFilterChoices();

            if (filterChoices == null)
            {
                return;
            }

            charToAdd    = null;
            charToRemove = null;
            var characterListFunc = UI.TypePicker <List <UnitEntityData> >(
                null,
                ref Main.settings.selectedPartyFilter,
                filterChoices
                );
            var characterList = characterListFunc.func();
            var mainChar      = GameHelper.GetPlayerCharacter();

            if (characterListFunc.name == "Nearby")
            {
                UI.Slider("Nearby Distance", ref nearbyRange, 1f, 200, 25, 0, " meters", UI.Width(250));
                characterList = characterList.OrderBy((ch) => ch.DistanceTo(mainChar)).ToList();
            }
            UI.Space(20);
            int chIndex = 0;

            respecableCount = 0;
            var  selectedCharacter = GetSelectedCharacter();
            bool isWide            = Main.IsWide;

            foreach (UnitEntityData ch in characterList)
            {
                var classData = ch.Progression.Classes;
                // TODO - understand the difference between ch.Progression and ch.Descriptor.Progression
                UnitProgressionData      progression = ch.Descriptor.Progression;
                BlueprintStatProgression xpTable     = BlueprintRoot.Instance.Progression.XPTable;
                int level       = progression.CharacterLevel;
                int mythicLevel = progression.MythicExperience;
                var spellbooks  = ch.Spellbooks;
                var spellCount  = spellbooks.Sum((sb) => sb.GetAllKnownSpells().Count());
                using (UI.HorizontalScope()) {
                    UI.Label(ch.CharacterName.orange().bold(), UI.Width(200));
                    UI.Space(25);
                    float distance = mainChar.DistanceTo(ch);;
                    UI.Label(distance < 1 ? "" : distance.ToString("0") + "m", UI.Width(75));
                    UI.Space(25);
                    UI.Label("lvl".green() + $": {level}", UI.Width(75));
                    // Level up code adapted from Bag of Tricks https://www.nexusmods.com/pathfinderkingmaker/mods/2
                    if (player.AllCharacters.Contains(ch))
                    {
                        if (progression.Experience < xpTable.GetBonus(level + 1) && level < 20)
                        {
                            UI.ActionButton("+1", () => {
                                progression.AdvanceExperienceTo(xpTable.GetBonus(level + 1), true);
                            }, UI.Width(70));
                        }
                        else if (progression.Experience >= xpTable.GetBonus(level + 1) && level < 20)
                        {
                            UI.Label("LvUp".cyan().italic(), UI.Width(70));
                        }
                        else
                        {
                            UI.Space(74);
                        }
                    }
                    else
                    {
                        UI.Space(74);
                    }
                    UI.Space(25);
                    UI.Label($"my".green() + $": {mythicLevel}", UI.Width(100));
                    if (player.AllCharacters.Contains(ch))
                    {
                        if (progression.MythicExperience < 10)
                        {
                            UI.ActionButton("+1", () => {
                                progression.AdvanceMythicExperience(progression.MythicExperience + 1, true);
                            }, UI.Width(70));
                        }
                        else
                        {
                            UI.Label("max".cyan(), UI.Width(70));
                        }
                    }
                    else
                    {
                        UI.Space(74);
                    }
                    UI.Space(35);
                    if (!isWide)
                    {
                        ActionsGUI(ch);
                    }
                    UI.Wrap(!Main.IsWide, 303, 0);
                    bool showClasses = ch == selectedCharacter && selectedToggle == ToggleChoice.Classes;
                    if (UI.DisclosureToggle($"{classData.Count} Classes", ref showClasses))
                    {
                        if (showClasses)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Classes; Logger.Log($"selected {ch.CharacterName}");
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    bool showStats = ch == selectedCharacter && selectedToggle == ToggleChoice.Stats;
                    if (UI.DisclosureToggle("Stats", ref showStats, true, isWide ? 150 : 200))
                    {
                        if (showStats)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Stats;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    UI.Wrap(Main.IsNarrow, 279);
                    bool showFacts = ch == selectedCharacter && selectedToggle == ToggleChoice.Facts;
                    if (UI.DisclosureToggle("Facts", ref showFacts, true, isWide ? 150 : 200))
                    {
                        if (showFacts)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Facts;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    bool showBuffs = ch == selectedCharacter && selectedToggle == ToggleChoice.Buffs;
                    if (UI.DisclosureToggle("Buffs", ref showBuffs, true, isWide ? 150 : 200))
                    {
                        if (showBuffs)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Buffs;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    UI.Wrap(Main.IsNarrow, 304);
                    bool showAbilities = ch == selectedCharacter && selectedToggle == ToggleChoice.Abilities;
                    if (UI.DisclosureToggle("Abilities", ref showAbilities, true))
                    {
                        if (showAbilities)
                        {
                            selectedCharacter = ch; selectedToggle = ToggleChoice.Abilities;
                        }
                        else
                        {
                            selectedToggle = ToggleChoice.None;
                        }
                    }
                    UI.Space(25);
                    if (spellCount > 0)
                    {
                        bool showSpells = ch == selectedCharacter && selectedToggle == ToggleChoice.Spells;
                        if (UI.DisclosureToggle($"{spellCount} Spells", ref showSpells, true))
                        {
                            if (showSpells)
                            {
                                selectedCharacter = ch; selectedToggle = ToggleChoice.Spells;
                            }
                            else
                            {
                                selectedToggle = ToggleChoice.None;
                            }
                        }
                    }
                    else
                    {
                        UI.Space(180);
                    }
                    if (isWide)
                    {
                        ActionsGUI(ch);
                    }
                }
                if (!Main.IsWide)
                {
                    UI.Div(20, 20);
                }
                if (selectedCharacter != spellbookEditCharacter)
                {
                    editSpellbooks         = false;
                    spellbookEditCharacter = null;
                }
                if (selectedCharacter != multiclassEditCharacter)
                {
                    editMultiClass          = false;
                    multiclassEditCharacter = null;
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Classes)
                {
#if DEBUG
                    UI.Div(100, 20);
                    using (UI.HorizontalScope()) {
                        UI.Space(100);
                        UI.Toggle("Multiple Classes On Level-Up", ref settings.toggleMulticlass, 0);
                        if (settings.toggleMulticlass)
                        {
                            UI.Space(39);
                            if (UI.DisclosureToggle("Config".orange().bold(), ref editMultiClass))
                            {
                                multiclassEditCharacter = selectedCharacter;
                            }
                            UI.Space(25);
                            UI.Label("Experimental Preview ".magenta() + "See 'Level Up + Multiclass' for more options".green());
                        }
                        else
                        {
                            UI.Space(50);  UI.Label("Experimental Preview ".magenta());
                        }
                    }
#endif
                    UI.Div(100, 20);
                    if (editMultiClass)
                    {
                        var multiclassSet = ch.GetMulticlassSet();
                        MulticlassPicker.OnGUI(multiclassSet);
                        ch.SetMulticlassSet(multiclassSet);
                    }
                    else
                    {
                        var prog = ch.Descriptor.Progression;
                        using (UI.HorizontalScope()) {
                            UI.Space(100);
                            UI.Label("Character Level".cyan(), UI.Width(250));
                            UI.ActionButton("<", () => prog.CharacterLevel = Math.Max(0, prog.CharacterLevel - 1), UI.AutoWidth());
                            UI.Space(25);
                            UI.Label("level".green() + $": {prog.CharacterLevel}", UI.Width(100f));
                            UI.ActionButton(">", () => prog.CharacterLevel = Math.Min(20, prog.CharacterLevel + 1), UI.AutoWidth());
                            UI.Space(25);
                            UI.ActionButton("Reset", () => ch.resetClassLevel(), UI.Width(125));
                            UI.Space(23);
                            UI.Label("This directly changes your character level but will not change exp or adjust any features associated with your character. To do a normal level up use +1 Lvl above".green());
                        }
                        UI.Div(0, 25);
                        using (UI.HorizontalScope()) {
                            UI.Space(100);
                            UI.Label("Mythic Level".cyan(), UI.Width(250));
                            UI.ActionButton("<", () => prog.MythicLevel = Math.Max(0, prog.MythicLevel - 1), UI.AutoWidth());
                            UI.Space(25);
                            UI.Label("my lvl".green() + $": {prog.MythicLevel}", UI.Width(100f));
                            UI.ActionButton(">", () => prog.MythicLevel = Math.Min(10, prog.MythicLevel + 1), UI.AutoWidth());
                            UI.Space(175);
                            UI.Label("This directly changes your mythic level but will not adjust any features associated with your character. To do a normal mythic level up use +1 my above".green());
                        }
                        foreach (var cd in classData)
                        {
                            UI.Div(100, 20);
                            using (UI.HorizontalScope()) {
                                UI.Space(100);
                                UI.Label(cd.CharacterClass.Name.orange(), UI.Width(250));
                                UI.ActionButton("<", () => cd.Level = Math.Max(0, cd.Level - 1), UI.AutoWidth());
                                UI.Space(25);
                                UI.Label("level".green() + $": {cd.Level}", UI.Width(100f));
                                var maxLevel = cd.CharacterClass.Progression.IsMythic ? 10 : 20;
                                UI.ActionButton(">", () => cd.Level = Math.Min(maxLevel, cd.Level + 1), UI.AutoWidth());
                                UI.Space(175);
                                UI.Label(cd.CharacterClass.Description.green(), UI.AutoWidth());
                            }
                        }
                    }
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Stats)
                {
                    UI.Div(100, 20, 755);
                    var alignment = ch.Descriptor.Alignment.Value;
                    using (UI.HorizontalScope()) {
                        UI.Space(100);
                        UI.Label("Alignment", UI.Width(425));
                        UI.Label($"{alignment.Name()}".color(alignment.Color()).bold(), UI.Width(1250f));
                    }
                    using (UI.HorizontalScope()) {
                        UI.Space(528);
                        int alignmentIndex = Array.IndexOf(alignments, alignment);
                        var titles         = alignments.Select(
                            a => a.Acronym().color(a.Color()).bold()).ToArray();
                        if (UI.SelectionGrid(ref alignmentIndex, titles, 3, UI.Width(250f)))
                        {
                            ch.Descriptor.Alignment.Set(alignments[alignmentIndex]);
                        }
                    }
                    UI.Div(100, 20, 755);
                    using (UI.HorizontalScope()) {
                        UI.Space(100);
                        UI.Label("Size", UI.Width(425));
                        var size = ch.Descriptor.State.Size;
                        UI.Label($"{size}".orange().bold(), UI.Width(175));
                    }
                    using (UI.HorizontalScope()) {
                        UI.Space(528);
                        UI.EnumGrid(
                            () => ch.Descriptor.State.Size,
                            (s) => ch.Descriptor.State.Size = s,
                            3, UI.Width(600));
                    }
                    using (UI.HorizontalScope()) {
                        UI.Space(528);
                        UI.ActionButton("Reset", () => { ch.Descriptor.State.Size = ch.Descriptor.OriginalSize; }, UI.Width(197));
                    }
                    UI.Div(100, 20, 755);
                    foreach (StatType obj in Enum.GetValues(typeof(StatType)))
                    {
                        StatType        statType        = (StatType)obj;
                        ModifiableValue modifiableValue = ch.Stats.GetStat(statType);
                        if (modifiableValue != null)
                        {
                            String key         = $"{ch.CharacterName}-{statType.ToString()}";
                            var    storedValue = statEditorStorage.ContainsKey(key) ? statEditorStorage[key] : modifiableValue.BaseValue;
                            var    statName    = statType.ToString();
                            if (statName == "BaseAttackBonus" || statName == "SkillAthletics")
                            {
                                UI.Div(100, 20, 755);
                            }
                            using (UI.HorizontalScope()) {
                                UI.Space(100);
                                UI.Label(statName, UI.Width(400f));
                                UI.Space(25);
                                UI.ActionButton(" < ", () => {
                                    modifiableValue.BaseValue -= 1;
                                    storedValue = modifiableValue.BaseValue;
                                }, UI.AutoWidth());
                                UI.Space(20);
                                UI.Label($"{modifiableValue.BaseValue}".orange().bold(), UI.Width(50f));
                                UI.ActionButton(" > ", () => {
                                    modifiableValue.BaseValue += 1;
                                    storedValue = modifiableValue.BaseValue;
                                }, UI.AutoWidth());
                                UI.Space(25);
                                UI.ActionIntTextField(ref storedValue, statType.ToString(), (v) => {
                                    modifiableValue.BaseValue = v;
                                }, null, UI.Width(75));
                                statEditorStorage[key] = storedValue;
                            }
                        }
                    }
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Facts)
                {
                    FactsEditor.OnGUI(ch, ch.Progression.Features.Enumerable.ToList());
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Buffs)
                {
                    FactsEditor.OnGUI(ch, ch.Descriptor.Buffs.Enumerable.ToList());
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Abilities)
                {
                    FactsEditor.OnGUI(ch, ch.Descriptor.Abilities.Enumerable.ToList());
                }
                if (ch == selectedCharacter && selectedToggle == ToggleChoice.Spells)
                {
                    UI.Space(20);
                    var names  = spellbooks.Select((sb) => sb.Blueprint.GetDisplayName()).ToArray();
                    var titles = names.Select((name, i) => $"{name} ({spellbooks.ElementAt(i).CasterLevel})").ToArray();
                    if (spellbooks.Any())
                    {
                        using (UI.HorizontalScope()) {
                            UI.SelectionGrid(ref selectedSpellbook, titles, 7, UI.Width(1581));
                            if (selectedSpellbook > names.Count())
                            {
                                selectedSpellbook = 0;
                            }
                            //                        UI.DisclosureToggle("Edit", ref editSpellbooks);
                        }
                        var spellbook = spellbooks.ElementAt(selectedSpellbook);
                        if (editSpellbooks)
                        {
                            spellbookEditCharacter = ch;
                            var blueprints = BlueprintExensions.GetBlueprints <BlueprintSpellbook>().OrderBy((bp) => bp.GetDisplayName());
                            BlueprintListUI.OnGUI(ch, blueprints, 100);
                        }
                        else
                        {
                            var maxLevel    = spellbook.Blueprint.MaxSpellLevel;
                            var casterLevel = spellbook.CasterLevel;
                            using (UI.HorizontalScope()) {
                                UI.EnumerablePicker <int>(
                                    "Spell Level".bold() + " (count)",
                                    ref selectedSpellbookLevel,
                                    Enumerable.Range(0, casterLevel + 1),
                                    0,
                                    (lvl) => {
                                    var levelText  = lvl <= casterLevel ? $"L{lvl}".bold() : $"L{lvl}".grey();
                                    var knownCount = spellbook.GetKnownSpells(lvl).Count();
                                    var countText  = knownCount > 0 ? $" ({knownCount})".white() : "";
                                    return(levelText + countText);
                                },
                                    UI.AutoWidth()
                                    );
                                if (casterLevel < maxLevel)
                                {
                                    UI.ActionButton("+1 Caster Level", () => spellbook.AddBaseLevel());
                                }
                            }
                            FactsEditor.OnGUI(ch, spellbook, selectedSpellbookLevel);
                        }
                    }
#if false
                    else
                    {
                        spellbookEditCharacter = ch;
                        editSpellbooks         = true;
                        var blueprints = BlueprintExensions.GetBlueprints <BlueprintSpellbook>().OrderBy((bp) => bp.GetDisplayName());
                        BlueprintListUI.OnGUI(ch, blueprints, 100);
                    }
#endif
                }
                if (selectedCharacter != GetSelectedCharacter())
                {
                    selectedCharacterIndex = characterList.IndexOf(selectedCharacter);
                }
                chIndex += 1;
            }
            UI.Space(25);
            if (respecableCount > 0)
            {
                UI.Label($"{respecableCount} characters".yellow().bold() + " can be respecced. Pressing Respec will close the mod window and take you to character level up".orange());
                UI.Label("WARNING".yellow().bold() + " this feature is ".orange() + "EXPERIMENTAL".yellow().bold() + " and uses unreleased and likely buggy code.".orange());
                UI.Label("BACK UP".yellow().bold() + " before playing with this feature.You will lose your mythic ranks but you can restore them in this Party Editor.".orange());
            }
            UI.Space(25);
            if (charToAdd != null)
            {
                UnitEntityDataUtils.AddCompanion(charToAdd);
            }
            if (charToRemove != null)
            {
                UnitEntityDataUtils.RemoveCompanion(charToRemove);
            }
        }
コード例 #3
0
ファイル: LevelUp.cs プロジェクト: SnowyJune973/ToyBox
        public static void OnGUI()
        {
            if (Main.IsInGame)
            {
                UI.HStack("Character Creation", 1,
                          () => UI.Toggle("Ignore Attribute Cap", ref settings.toggleIgnoreAttributeStatCapChargen, 0),
                          () => UI.Toggle("Ignore Remaining Attribute Points", ref settings.toggleIgnoreAttributePointsRemainingChargen, 0),
                          () => UI.Toggle("Ignore Alignment", ref settings.toggleIgnoreAttributeStatCapChargen, 0),

                          () => UI.Slider("Build Points (Main)", ref settings.characterCreationAbilityPointsPlayer, 1, 200, 25, "", UI.AutoWidth()),
                          () => UI.Slider("Build Points (Mercenary)", ref settings.characterCreationAbilityPointsMerc, 1, 200, 20, "", UI.AutoWidth()),
                          () => UI.Slider("Ability Max", ref settings.characterCreationAbilityPointsMax, 0, 50, 18, "", UI.AutoWidth()),
                          () => UI.Slider("Ability Min", ref settings.characterCreationAbilityPointsMin, 0, 50, 7, "", UI.AutoWidth()),
                          () => { }
                          );
                UI.Div(0, 25);
                UI.HStack("Level Up", 1,
                          () => UI.Slider("Feature Selection Multiplier", ref settings.featsMultiplier, 0, 10, 1, "", UI.AutoWidth()),
                          () => UI.Toggle("Always Able To Level Up", ref settings.toggleNoLevelUpRestrictions, 0),
                          () => UI.Toggle("Add Full Hit Die Value", ref settings.toggleFullHitdiceEachLevel, 0),
                          () => {
                    UI.Toggle("Ignore Class And Feat Restrictions", ref settings.toggleIgnorePrerequisites, 0);
                    UI.Space(25);
                    UI.Label("Experimental".cyan() + ": in addition to regular leveling, this allows you to choose any mythic class each time you level up starting from level 1. This may have interesting and unexpected effects. Backup early and often...".green());
                },
                          () => UI.Toggle("Ignore Prerequisites When Choosing A Feat", ref settings.toggleFeaturesIgnorePrerequisites, 0),
                          () => UI.Toggle("Ignore Caster Type And Spell Level Restrictions", ref settings.toggleIgnoreCasterTypeSpellLevel, 0),
                          () => UI.Toggle("Ignore Forbidden Archetypes", ref settings.toggleIgnoreForbiddenArchetype, 0),
                          () => UI.Toggle("Ignore Required Stat Values", ref settings.toggleIgnorePrerequisiteStatValue, 0),
                          () => UI.Toggle("Ignore Alignment When Choosing A Class", ref settings.toggleIgnoreAlignmentWhenChoosingClass, 0),
                          () => UI.Toggle("Skip Spell Selection", ref settings.toggleSkipSpellSelection, 0),
#if DEBUG
                          () => UI.Toggle("Lock Character Level", ref settings.toggleLockCharacterLevel, 0),
//                    () => UI.Toggle("Ignore Alignment Restrictions", ref settings.toggleIgnoreAlignmentRestriction, 0),
                          () => UI.Toggle("Ignore Remaining Attribute Points", ref settings.toggleIgnoreAttributePointsRemaining, 0),
                          () => UI.Toggle("Ignore Skill Cap", ref settings.toggleIgnoreSkillCap, 0),
                          () => UI.Toggle("Ignore Remaining Skill Points", ref settings.toggleIgnoreSkillPointsRemaining, 0),
#endif
#if false
                          // Do we need these or is it covered by toggleFeaturesIgnorePrerequisites
                          () => { UI.Toggle("Ignore Feat Prerequisites When Choosing A Class", ref settings.toggleIgnoreFeaturePrerequisitesWhenChoosingClass, 0); },
                          () => { UI.Toggle("Ignore Feat Prerequisits (List) When Choosing A Class", ref settings.toggle, 0); },
#endif

                          () => { }
                          );
#if DEBUG
                UI.Div(0, 25);
                UI.HStack("Multiple Classes", 1,
                          () => UI.Label("Experimental Preview".magenta(), UI.AutoWidth()),
                          () => {
                    UI.Toggle("Multiple Classes On Level-Up", ref settings.toggleMulticlass, 0);
                    UI.Space(25);
                    UI.Label("With this enabled you can configure characters in the Party Editor to gain levels in additional classes whenever they level up. Please go to Party Editor > Character > Classes to configure this".green());
                },
                          () => UI.Toggle("Use Highest Hit Die", ref settings.toggleTakeHighestHitDie, 0),
                          () => UI.Toggle("Use Highest Skill Points", ref settings.toggleTakeHighestSkillPoints, 0),
                          () => UI.Toggle("Use Highest BAB ", ref settings.toggleTakeHighestBAB, 0),
                          () => UI.Toggle("Use Highest Save By Recalc", ref settings.toggleTakeHighestSaveByRecalculation, 0),
                          () => UI.Toggle("Use Highest Save ", ref settings.toggleTakeHighestSaveByAlways, 0),
                          () => UI.Toggle("Use Recalculate Caster Levels", ref settings.toggleRecalculateCasterLevelOnLevelingUp, 0),
                          () => UI.Toggle("Restrict Caster Level To Current", ref settings.toggleRestrictCasterLevelToCharacterLevel, 0),
                          //() => { UI.Toggle("Restrict CL to Current (temp) ", ref settings.toggleRestrictCasterLevelToCharacterLevelTemporary, 0),
                          () => UI.Toggle("Restrict Class Level for Prerequisites to Caster Level", ref settings.toggleRestrictClassLevelForPrerequisitesToCharacterLevel, 0),
                          () => UI.Toggle("Fix Favored Class HP", ref settings.toggleFixFavoredClassHP, 0),
                          () => UI.Toggle("Always Receive Favored Class HP", ref settings.toggleAlwaysReceiveFavoredClassHP, 0),
                          () => UI.Toggle("Always Receive Favored Class HP Except Prestige", ref settings.toggleAlwaysReceiveFavoredClassHPExceptPrestige, 0),
                          () => { }
                          );
                if (settings.toggleMulticlass)
                {
                    UI.Div(0, 25);
                    UI.HStack("Character Generation", 1,
                              () =>
                              UI.Label("Choose default multiclass setting to use during creation of new characters".green(), UI.AutoWidth())
                              );
                    var multiclassSet = settings.charGenMulticlassSet;
                    MulticlassPicker.OnGUI(multiclassSet, 150);
                    settings.charGenMulticlassSet = multiclassSet;
                }
#endif
            }
        }