Esempio n. 1
0
        internal static void Load()
        {
            // Create the trait selection (https://www.d20pfsrd.com/traits/).
            // TODO: ideally we'd use FeatureGroup.Trait, but it's not recognized by the game code.
            var featureGroup   = FeatureGroup.Feat;
            var traitSelection = Helpers.CreateFeatureSelection("TraitSelection1", "Traits",
                                                                "Character traits are abilities that are not tied to your character’s race or class. They can enhance your character’s skills, racial abilities, class abilities, or other statistics, enabling you to further customize them. At its core, a character trait is approximately equal in power to half a feat, so two character traits are roughly equivalent to a bonus feat. Yet a character trait isn’t just another kind of power you can add on to your character—it’s a way to quantify (and encourage) building a character background that fits into your campaign world. Think of character traits as “story seeds” for your background; after you pick your two traits, you’ll have a point of inspiration from which to build your character’s personality and history. Alternatively, if you’ve already got a background in your head or written down for your character, you can view picking their traits as a way to quantify that background, just as picking race and class and ability scores quantifies their other strengths and weaknesses.",
                                                                "f243a1b828714591b5fa0635b0cefb5b", null, featureGroup);
            var traitSelection2 = Helpers.CreateFeatureSelection("TraitSelection2", "Traits",
                                                                 traitSelection.Description, "d3a6541d2d384b1390d8ea26bb02b8cd", null, featureGroup);
            var traitSelection3 = Helpers.CreateFeatureSelection("TraitSelection3", "Traits",
                                                                 traitSelection.Description, "d4b7541d2d384b1390d8ea26bb02b8rt", null, featureGroup);

            var DrawbackSelection1 = Helpers.CreateFeatureSelection("DrawbackSelection3", "Drawbacks",
                                                                    "Drawbacks are traits in reverse. Instead of granting you a boon, they grant you a negative effect, typically in particular circumstances. " +
                                                                    "If you choose to take a drawback, you can take a third trait that you have access to. " +
                                                                    "You are not required to take a drawback.(disable in eldrich arcana menu and restart game)", "4db7541d2d384b1390d8ea26bb02b9tr", null, featureGroup);

            var choices         = new List <BlueprintFeatureSelection>();
            var Drawbackchoices = new List <BlueprintFeatureSelection>();

            var Skip = Helpers.CreateFeatureSelection("NoChoice", "(Skip)",
                                                      "skip this selection.",
                                                      "afb4225be98a4b3e9717883f22068c28", null, FeatureGroup.None);

            choices.Add(Skip);
            Drawbackchoices.Add(Skip);
            var DrawbackEmotion  = EmotionDrawbacks.CreateEmotionDrawbacks();
            var DrawbackPhysique = PhysiqueDrawbacks.CreatePhysiqueDrawbacks();

            Drawbackchoices.Add(DrawbackEmotion);
            Drawbackchoices.Add(DrawbackPhysique);
            choices.Add(CombatTraits.CreateCombatTraits());//,choices,"combattraits");
            choices.Add(FaithTraits.CreateFaithTraits());
            choices.Add(MagicTraits.CreateMagicTraits());
            BlueprintFeatureSelection adopted;

            choices.Add(SocialTraits.CreateSocialTraits(out adopted));
            choices.Add(EquipmentTraits.CreateEquipmentTraits());
            choices.Add(RaceTraits.CreateRaceTraits(adopted));
            choices.Add(CampaignTraits.CreateCampaignTraits());
            choices.Add(RegionalTraits.CreateRegionalTraits());
            // if main settings cheatcustomtrait = false it won't be added just be initialized
            var x = CreateCustomTraits(Main.settings.CheatCustomTraits);

            if (Main.settings.CheatCustomTraits)
            {
                choices.Add(x);
            }


            traitSelection.SetFeatures(choices);


            DrawbackSelection1.SetFeatures(Drawbackchoices);
            traitSelection2.SetFeatures(traitSelection.Features);
            traitSelection3.SetFeatures(traitSelection.Features);
            ApplyClassMechanics_Apply_Patch.onChargenApply.Add((state, unit) =>
            {
                traitSelection.AddSelection(state, unit, 1);
                traitSelection2.AddSelection(state, unit, 1);
                DrawbackSelection1.AddSelection(state, unit, 1);
            });
            //this only lets the player select a second feat if drawbackemotion is chosen
            SelectFeature_Apply_Patch.onApplyFeature.Add(DrawbackEmotion, (state, unit) =>
            {
                traitSelection3.AddSelection(state, unit, 1);
            });


            // Create the "Additional Traits" feat.
            var additionalTraits = Helpers.CreateFeature("AdditionalTraitsProgression",
                                                         "Additional Traits",
                                                         "You have more traits than normal.\nBenefit: You gain two character traits of your choice. These traits must be chosen from different lists, and cannot be chosen from lists from which you have already selected a character trait. You must meet any additional qualifications for the character traits you choose — this feat cannot enable you to select a dwarf character trait if you are an elf, for example.",
                                                         "02dbb324cc334412a55e6d8f9fe87009",
                                                         Image2Sprite.Create("Mods/EldritchArcana/sprites/additional_traits.png"),//Helpers.GetIcon("0d3651b2cb0d89448b112e23214e744e"), // Extra Performance
                                                         FeatureGroup.Feat);

            var additionalTrait1 = Helpers.CreateFeatureSelection("AdditionalTraitSelection1", "Traits",
                                                                  traitSelection.Description,
                                                                  "a85fbbe3c9184137a31a12f4b0b7904a", null, FeatureGroup.Feat);
            var additionalTrait2 = Helpers.CreateFeatureSelection("AdditionalTraitSelection2", "Traits",
                                                                  traitSelection.Description,
                                                                  "0fdd6f51c19c44938b9d64b147cf32f8", null, FeatureGroup.Feat);
            var additionalTrait3 = Helpers.CreateFeatureSelection("AdditionalTraitSelection3", "Traits",
                                                                  traitSelection.Description,
                                                                  "1cdd6f51c19c44938b9d64b147cf32d2", null, FeatureGroup.Feat);
            var additionalDrawback1 = Helpers.CreateFeatureSelection("AdditionalDrawbackSelection1", "Drawbacks",
                                                                     DrawbackSelection1.Description,
                                                                     "1ddd6f51c19c44938b9d64b147cc22c9", null, FeatureGroup.Feat);

            additionalTrait1.SetFeatures(traitSelection.Features);
            additionalTrait2.SetFeatures(traitSelection.Features);
            additionalTrait3.SetFeatures(traitSelection.Features);
            additionalDrawback1.SetFeatures(DrawbackSelection1.Features);

            SelectFeature_Apply_Patch.onApplyFeature.Add(additionalTraits, (state, unit) =>
            {
                additionalTrait1.AddSelection(state, unit, 1);
                additionalTrait2.AddSelection(state, unit, 1);
                additionalDrawback1.AddSelection(state, unit, 1);
                //HereHere
            });

            SelectFeature_Apply_Patch.onApplyFeature.Add(DrawbackPhysique, (state, unit) =>
            {
                additionalTrait3.AddSelection(state, unit, 1);
            });

            library.AddFeats(additionalTraits);
        }
        internal static void Load()
        {
            // Create the trait selection (https://www.d20pfsrd.com/traits/).
            // TODO: ideally we'd use FeatureGroup.Trait, but it's not recognized by the game code.
            var featureGroup   = FeatureGroup.Feat;
            var traitSelection = Helpers.CreateFeatureSelection("TraitSelection1", RES.loadTraits_error,
                                                                RES.TraitsSelectionDescription_info,
                                                                "f243a1b828714591b5fa0635b0cefb5b", null, featureGroup);
            var traitSelection2 = Helpers.CreateFeatureSelection("TraitSelection2", RES.loadTraits_error,
                                                                 traitSelection.Description, "d3a6541d2d384b1390d8ea26bb02b8cd", null, featureGroup);
            var traitSelection3 = Helpers.CreateFeatureSelection("TraitSelection3", RES.loadTraits_error,
                                                                 traitSelection.Description, "d4b7541d2d384b1390d8ea26bb02b8rt", null, featureGroup);

            var DrawbackSelection1 = Helpers.CreateFeatureSelection("DrawbackSelection3", RES.Drawbacks_info,
                                                                    RES.DrawbacksDescription_info, "4db7541d2d384b1390d8ea26bb02b9tr", null, featureGroup);

            var choices         = new List <BlueprintFeatureSelection>();
            var Drawbackchoices = new List <BlueprintFeatureSelection>();

            var Skip = Helpers.CreateFeatureSelection("NoChoice", RES.SkipSelection_info,
                                                      RES.SkipSelectionDescription_info,
                                                      "afb4225be98a4b3e9717883f22068c28", null, FeatureGroup.None);

            choices.Add(Skip);
            Drawbackchoices.Add(Skip);
            var DrawbackEmotion  = EmotionDrawbacks.CreateEmotionDrawbacks();
            var DrawbackPhysique = PhysiqueDrawbacks.CreatePhysiqueDrawbacks();

            Drawbackchoices.Add(DrawbackEmotion);
            Drawbackchoices.Add(DrawbackPhysique);
            choices.Add(CombatTraits.CreateCombatTraits());//,choices,"combattraits");
            choices.Add(FaithTraits.CreateFaithTraits());
            choices.Add(MagicTraits.CreateMagicTraits());
            BlueprintFeatureSelection adopted;

            choices.Add(SocialTraits.CreateSocialTraits(out adopted));
            choices.Add(EquipmentTraits.CreateEquipmentTraits());
            choices.Add(RaceTraits.CreateRaceTraits(adopted));
            choices.Add(CampaignTraits.CreateCampaignTraits());
            choices.Add(RegionalTraits.CreateRegionalTraits());
            // if main settings cheatcustomtrait = false it won't be added just be initialized
            var x = CreateCustomTraits(Main.settings.CheatCustomTraits);

            if (Main.settings.CheatCustomTraits)
            {
                choices.Add(x);
            }

            traitSelection.SetFeatures(choices);

            DrawbackSelection1.SetFeatures(Drawbackchoices);
            traitSelection2.SetFeatures(traitSelection.Features);
            traitSelection3.SetFeatures(traitSelection.Features);
            ApplyClassMechanics_Apply_Patch.onChargenApply.Add((state, unit) =>
            {
                traitSelection.AddSelection(state, unit, 1);
                traitSelection2.AddSelection(state, unit, 1);
                DrawbackSelection1.AddSelection(state, unit, 1);
            });
            //this only lets the player select a second feat if drawbackemotion is chosen
            SelectFeature_Apply_Patch.onApplyFeature.Add(DrawbackEmotion, (state, unit) =>
            {
                traitSelection3.AddSelection(state, unit, 1);
            });


            // Create the "Additional Traits" feat.
            var additionalTraits = Helpers.CreateFeature("AdditionalTraitsProgression",
                                                         RES.AdditionalTraitsFeatName_info,
                                                         RES.AdditionalTraitsFeatDescription_info,
                                                         "02dbb324cc334412a55e6d8f9fe87009",
                                                         Image2Sprite.Create("Mods/EldritchArcana/sprites/additional_traits.png"),//Helpers.GetIcon("0d3651b2cb0d89448b112e23214e744e"), // Extra Performance
                                                         FeatureGroup.Feat);

            var additionalTrait1 = Helpers.CreateFeatureSelection("AdditionalTraitSelection1", RES.loadTraits_error,
                                                                  traitSelection.Description,
                                                                  "a85fbbe3c9184137a31a12f4b0b7904a", null, FeatureGroup.Feat);
            var additionalTrait2 = Helpers.CreateFeatureSelection("AdditionalTraitSelection2", RES.loadTraits_error,
                                                                  traitSelection.Description,
                                                                  "0fdd6f51c19c44938b9d64b147cf32f8", null, FeatureGroup.Feat);
            var additionalTrait3 = Helpers.CreateFeatureSelection("AdditionalTraitSelection3", RES.loadTraits_error,
                                                                  traitSelection.Description,
                                                                  "1cdd6f51c19c44938b9d64b147cf32d2", null, FeatureGroup.Feat);
            var additionalDrawback1 = Helpers.CreateFeatureSelection("AdditionalDrawbackSelection1", RES.Drawbacks_info,
                                                                     DrawbackSelection1.Description,
                                                                     "1ddd6f51c19c44938b9d64b147cc22c9", null, FeatureGroup.Feat);

            additionalTrait1.SetFeatures(traitSelection.Features);
            additionalTrait2.SetFeatures(traitSelection.Features);
            additionalTrait3.SetFeatures(traitSelection.Features);
            additionalDrawback1.SetFeatures(DrawbackSelection1.Features);

            SelectFeature_Apply_Patch.onApplyFeature.Add(additionalTraits, (state, unit) =>
            {
                additionalTrait1.AddSelection(state, unit, 1);
                additionalTrait2.AddSelection(state, unit, 1);
                additionalDrawback1.AddSelection(state, unit, 1);
                //HereHere
            });

            SelectFeature_Apply_Patch.onApplyFeature.Add(DrawbackPhysique, (state, unit) =>
            {
                additionalTrait3.AddSelection(state, unit, 1);
            });

            library.AddFeats(additionalTraits);
        }