コード例 #1
0
        private static void addSteelHeadbutt()
        {
            foreach (ArmorProficiencyGroup ArmorProficiency in new ArmorProficiencyGroup[] { ArmorProficiencyGroup.Heavy, ArmorProficiencyGroup.Medium })
            {
                string              newAssetID = Helpers.getGuid("SteelHeadbuttType" + ArmorProficiency);
                DiceType            diceType   = ArmorProficiency == ArmorProficiencyGroup.Heavy ? DiceType.D4 : DiceType.D3;
                BlueprintWeaponType BlueprintWeaponTypeBite     = library.Get <BlueprintWeaponType>("952e30e6cb40b454789a9db6e5f6dd09");
                BlueprintWeaponType BlueprintWeaponTypeHeadbutt = library.CopyAndAdd(BlueprintWeaponTypeBite, "SteelHeadbuttType" + ArmorProficiency, newAssetID);

                Traverse traverse = Traverse.Create(BlueprintWeaponTypeHeadbutt);
                traverse.Field("m_AssetGuid").SetValue(newAssetID);
                traverse.Field("m_IsNatural").SetValue(false);
                traverse.Field("m_DefaultNameText").SetValue(new FakeLocalizedString("Steel Headbutt"));
                traverse.Field("m_DescriptionText").SetValue(new FakeLocalizedString("While wearing medium or heavy armor, a fighter can deliver a headbutt with his helm as part of a full attack action. This headbutt is in addition to his normal attacks, and is made using the fighter’s base attack bonus – 5. A helmet headbutt deals 1d3 points of damage if the fighter is wearing medium armor, or 1d4 points of damage if he is wearing heavy armor (1d2 and 1d3, respectively, for Small creatures), plus an amount of damage equal to 1/2 the fighter’s Strength modifier. Treat this attack as a weapon attack made using the same special material (if any) as the armor. The armor’s enhancement bonus does modify the headbutt attack."));
                traverse.Field("m_BaseDamage").SetValue(new DiceFormula(1, diceType));


                for (int i = 0; i <= 5; ++i)
                {
                    newAssetID = Helpers.getGuid("SteelHeadbuttType" + ArmorProficiency + "Enhancement" + i);
                    BlueprintItemWeapon BlueprintItemWeaponBite     = library.Get <BlueprintItemWeapon>("35dfad6517f401145af54111be04d6cf");
                    BlueprintItemWeapon BlueprintItemWeaponHeadbutt = library.CopyAndAdd(BlueprintItemWeaponBite, "SteelHeadbuttType" + ArmorProficiency + "Enhancement" + i, newAssetID);

                    traverse = Traverse.Create(BlueprintItemWeaponHeadbutt);
                    traverse.Field("m_AssetGuid").SetValue(newAssetID);
                    traverse.Field("m_Type").SetValue(BlueprintWeaponTypeBite);
                    traverse.Field("SpendCharges").SetValue(false);
                    BlueprintItemWeaponBite.DamageType.Physical.Enhancement      = i;
                    BlueprintItemWeaponBite.DamageType.Physical.EnhancementTotal = i;
                }
            }
        }
コード例 #2
0
        public static void createWeaponTypes()
        {
            var dagger              = library.Get <BlueprintWeaponType>("07cc1a7fceaee5b42b3e43da960fe76d");
            var starknife           = library.Get <BlueprintWeaponType>("5a939137fc039084580725b2b0845c3f");
            var all_throwable_types = new BlueprintWeaponType[] { dagger, starknife };
            var strength_thrown     = library.Get <BlueprintWeaponEnchantment>("c4d213911e9616949937e1520c80aaf3");

            thrown_type_blueprints = new Dictionary <WeaponCategory, BlueprintWeaponType>();
            var seed_guid = "a8bb69f6793a40f68fe34125f44c7684";

            foreach (var type in all_throwable_types)
            {
                var thrown_type = library.CopyAndAdd <BlueprintWeaponType>(type, "Thrown" + type.name, Helpers.MergeIds(type.AssetGuid, seed_guid));

                Helpers.SetField(thrown_type, "m_TypeNameText", Helpers.CreateString(thrown_type.name + "TypeName", thrown_type.TypeName + " (Thrown)"));
                Helpers.SetField(thrown_type, "m_DefaultNameText", Helpers.CreateString(thrown_type.name + "DefaultName", thrown_type.DefaultName + " (Thrown)"));
                Helpers.SetField(thrown_type, "m_AttackType", AttackType.Ranged);
                Helpers.SetField(thrown_type, "m_AttackRange", FeetExtension.Feet(20.0f));

                WeaponVisualParameters new_wp = thrown_type.VisualParameters.CloneObject();
                Helpers.SetField(new_wp, "m_Projectiles", new BlueprintProjectile[] { thrown_weapon_proj });
                if (thrown_type.Category == WeaponCategory.Dagger)
                {
                    Helpers.SetField(new_wp, "m_WeaponAnimationStyle", WeaponAnimationStyle.ThrownStraight);
                }

                Helpers.SetField(thrown_type, "m_VisualParameters", new_wp);

                thrown_type_blueprints.Add(thrown_type.Category, thrown_type);

                var thrown_type_enchantments = Helpers.GetField <BlueprintWeaponEnchantment[]>(thrown_type, "m_Enchantments").AddToArray(strength_thrown);
                Helpers.SetField(thrown_type, "m_Enchantments", thrown_type_enchantments);
            }
        }
コード例 #3
0
        private static void CreateDivineFightingTechniques()
        {
            BlueprintFeature    desnaFeature = library.Get <BlueprintFeature>("2c0a3b9971327ba4d9d85354d16998c1");         // DesnaFeature
            BlueprintWeaponType _weaponType  = Main.library.Get <BlueprintWeaponType>("5a939137fc039084580725b2b0845c3f"); // Starknife

            BlueprintFeature desnasShootingStar = Helpers.CreateFeature(
                "DesnasShootingStar",
                "Desnas Shooting Star",
                "Among the divine fighting manuals of the Inner Sea, few are as ancient as Clamor of the Spheres, a collection of fighting techniques favored by Desna’s faithful. True to its name, the manual focuses on interpreting the chaos and sounds of combat, but nevertheless provides insightful and downright brilliant methods of defense with Desna’s favored weapon, using techniques that treat a fight with a starknife more as a beautiful dance than a battle. \nYou can add your Charisma bonus to attack rolls and damage rolls when wielding a starknife. If you do so, you don’t modify attack rolls and damage rolls with your starknife with your Strength modifier, your Dexterity modifier (if you have Weapon Finesse), or any other ability score (if you have an ability that allows you to modify attack rolls and damage rolls with that ability score)",
                Helpers.getGuid("DesnasShootingStar"),
                desnaFeature.Icon,
                FeatureGroup.CombatFeat,
                Helpers.Create <DesnasShootingStarLogic>(),
                desnaFeature.PrerequisiteFeature(),
                Helpers.Create <PrerequisiteAlignment>(x => x.Alignment    = AlignmentMaskType.ChaoticGood),
                Helpers.Create <AddStartingEquipment>(x => x.CategoryItems = new [] { _weaponType.Category }));

            Helpers.AddCombatFeats(library, desnasShootingStar);
        }
コード例 #4
0
        static void createDeadeyeDevoteeProgression()
        {
            var allowed_weapons = new BlueprintWeaponType[4];

            allowed_weapons[0] = library.Get <BlueprintWeaponType>("99ce02fb54639b5439d07c99c55b8542"); // shortbow
            allowed_weapons[1] = library.Get <BlueprintWeaponType>("7a1211c05ec2c46428f41e3c0db9423f"); // longbow
            allowed_weapons[2] = library.Get <BlueprintWeaponType>("1ac79088a7e5dde46966636a3ac71c35"); // composite longbow
            allowed_weapons[3] = library.Get <BlueprintWeaponType>("011f6f86a0b16df4bbf7f40878c3e80b"); // composite shortbow

            CreateEnergyArrow();
            CreateDivineSpellbookSelection();
            CreateDeadeyeDevoteeProficiencies();
            CreateDeadeyeDevoteeFeatures();


            deadeyeDevoteeProgression = Helpers.CreateProgression("DeadeyeDevoteeProgression",
                                                                  deadeyeDevotee.Name,
                                                                  deadeyeDevotee.Description,
                                                                  "",
                                                                  deadeyeDevotee.Icon,
                                                                  FeatureGroup.None);
            deadeyeDevoteeProgression.Classes = getDeadeyeDevoteeArray();

            deadeyeDevoteeProgression.LevelEntries = new LevelEntry[] {
                Helpers.LevelEntry(1, deadeyeDevoteeProficiencies, ArcaneArcherClass.enhanceArrowsMagic),
                Helpers.LevelEntry(2, Hinterlander.imbue_arrow, divineSpellbookSelection),
                Helpers.LevelEntry(3, ArcaneArcherClass.enhanceArrowsElemental),
                Helpers.LevelEntry(4, energyArrow),
                Helpers.LevelEntry(5, ArcaneArcherClass.arcaneArcherFeat), // Distant arrows aren't possible, providing a feat for this level seems reasonable seeing as the class also doesn't get spellcasting here.
                Helpers.LevelEntry(6, ArcaneArcherClass.phaseArrow),
                Helpers.LevelEntry(7, ArcaneArcherClass.enhanceArrowsBurst),
                Helpers.LevelEntry(8, ArcaneArcherClass.hailOfArrows),
                Helpers.LevelEntry(9, ArcaneArcherClass.enhanceArrowsAligned),
                Helpers.LevelEntry(10, ArcaneArcherClass.arrowOfDeath)
            };

            deadeyeDevoteeProgression.UIDeterminatorsGroup = new BlueprintFeatureBase[] { deadeyeDevoteeProficiencies };
            deadeyeDevoteeProgression.UIGroups             = new UIGroup[]  {
                Helpers.CreateUIGroup(energyArrow, ArcaneArcherClass.phaseArrow, ArcaneArcherClass.hailOfArrows, ArcaneArcherClass.arrowOfDeath),
                Helpers.CreateUIGroup(ArcaneArcherClass.enhanceArrowsMagic, ArcaneArcherClass.enhanceArrowsElemental, ArcaneArcherClass.enhanceArrowsBurst, ArcaneArcherClass.enhanceArrowsAligned),
                Helpers.CreateUIGroup(divineSpellbookSelection, Hinterlander.imbue_arrow, ArcaneArcherClass.arcaneArcherFeat)
            };
        }
        static void createSummonedWeaponEnchantment()
        {
            summoned_weapon_enchant = Common.createWeaponEnchantment("SummonedWeaponEnchant",
                                                                     "Summoned",
                                                                     "This is a summoned weapon.",
                                                                     "",
                                                                     "",
                                                                     "",
                                                                     0,
                                                                     null
                                                                     );

            BlueprintWeaponType[] kinetic_blade_types = new BlueprintWeaponType[] { library.Get <BlueprintWeaponType>("b05a206f6c1133a469b2f7e30dc970ef"),
                                                                                    library.Get <BlueprintWeaponType>("a15b2fb1d5dc4f247882a7148d50afb0") };
            //add it to kinetic blades
            var kinetic_blades = library.GetAllBlueprints().OfType <BlueprintItemWeapon>().Where(w => kinetic_blade_types.Contains(w.Type));

            foreach (var kb in kinetic_blades)
            {
                Common.addEnchantment(kb, summoned_weapon_enchant);
            }
        }
コード例 #6
0
        static void fixMartialExoticWeapons()
        {
            var oversized_bastard_sword_types = new BlueprintWeaponType[]
            {
                library.Get <BlueprintWeaponType>("1e460a2dc830cf546939b2723aa875e7"),                                //oversized bastard sword
                library.Get <BlueprintWeaponType>("58dcff8d1dd5d094eb345e8eeb2e4626"),                                //oversized bastard sword no penalty
            };
            var bastard_sword_type = library.Get <BlueprintWeaponType>("d2fe2c5516b56f04da1d5ea51ae3ddfe");

            Helpers.SetField(bastard_sword_type, "m_IsTwoHanded", true);
            WeaponVisualParameters bs_visuals = Helpers.GetField <WeaponVisualParameters>(bastard_sword_type, "m_VisualParameters");

            Helpers.SetField(bs_visuals, "m_WeaponAnimationStyle", WeaponAnimationStyle.SlashingTwoHanded);
            fixFullWeaponCategory(WeaponCategory.BastardSword, WeaponCategory.Greatsword,
                                  Helpers.Create <HoldingItemsMechanics.CanHoldIn1Hand>(c =>
            {
                c.category = WeaponCategory.BastardSword;
                c.require_full_proficiency = true;
                c.except_types             = oversized_bastard_sword_types;
            }));

            var dwarven_waraxe_type = library.Get <BlueprintWeaponType>("a6925f5f897801449a648d865637e5a0");

            Helpers.SetField(dwarven_waraxe_type, "m_IsTwoHanded", true);
            WeaponVisualParameters dw_visuals = Helpers.GetField <WeaponVisualParameters>(dwarven_waraxe_type, "m_VisualParameters");

            Helpers.SetField(dw_visuals, "m_WeaponAnimationStyle", WeaponAnimationStyle.SlashingTwoHanded);
            fixFullWeaponCategory(WeaponCategory.DwarvenWaraxe, WeaponCategory.Battleaxe,
                                  Helpers.Create <HoldingItemsMechanics.CanHoldIn1Hand>(c => { c.category = WeaponCategory.DwarvenWaraxe; c.require_full_proficiency = true; }));



            var bastard_sword_proficiency = library.Get <BlueprintFeature>("57299a78b2256604dadf1ab9a42e2873");

            bastard_sword_proficiency.SetDescription(bastard_sword_proficiency.Description + "\nA character can use a bastard sword two-handed as a martial weapon, without exotic weapon proficiency.");

            var dwarven_waraxe_proficiency = library.Get <BlueprintFeature>("bd0d7feca087d2247b12965c1467790c");

            dwarven_waraxe_proficiency.SetDescription(dwarven_waraxe_proficiency.Description + "\nA character can use a dwarven waraxe two-handed as a martial weapon, without exotic weapon proficiency.");

            var duelling_sword_proficiency = library.Get <BlueprintFeature>("9c37279588fd9e34e9c4cb234857492c");

            fixFullWeaponCategory(WeaponCategory.DuelingSword, WeaponCategory.Longsword,
                                  Helpers.Create <NewMechanics.ConsiderAsFinessable>(c => c.category = WeaponCategory.DuelingSword));
            duelling_sword_proficiency.SetDescription(duelling_sword_proficiency.Description + "\nA dueling sword can be used as a martial weapon (in which case it functions as a longsword), but if you have the feat Exotic Weapon Proficiency (dueling sword), you can use the Weapon Finesse feat to apply your Dexterity modifier instead of your Strength modifier to attack rolls with a dueling sword sized for you, even though it isn’t a light weapon.");

            var estoc_type = library.Get <BlueprintWeaponType>("d516765b3c2904e4a939749526a52a9a");

            Helpers.SetField(estoc_type, "m_IsTwoHanded", true);

            var estoc_proficiency = library.Get <BlueprintFeature>("9dc64f0b9161a354c9471a631318e16c");

            fixFullWeaponCategory(WeaponCategory.Estoc, WeaponCategory.Greatsword,
                                  Helpers.Create <HoldingItemsMechanics.CanHoldIn1Hand>(c => { c.category = WeaponCategory.Estoc; c.require_full_proficiency = true; }),
                                  Helpers.Create <NewMechanics.ConsiderAsFinessable>(c => c.category = WeaponCategory.Estoc));
            estoc_proficiency.SetDescription(estoc_proficiency.Description + "\nLike the bastard sword, an estoc requires special training to use it one handed, but it can also be wielded as a two-handed martial weapon.\nWhen you wield an estoc with one hand, treat it as a one-handed weapon; when you wield an estoc with two hands, treat it as a two-handed weapon. If you can use the estoc proficiently with one hand, you can also use the Weapon Finesse feat to apply your Dexterity modifier instead of your Strength modifier on attack rolls when wielding an estoc sized for you with one or two hands, even though it isn’t a light weapon.");

            //remove duelling sword and estoc from list of finessable weapons
            var info = typeof(WeaponCategoryExtension).GetField("Data", BindingFlags.NonPublic | BindingFlags.Static);
            var data = (Array)info.GetValue(null);

            foreach (var dd in data)
            {
                var category = Helpers.GetField <WeaponCategory>(dd, "Category");
                if (category == WeaponCategory.DuelingSword || category == WeaponCategory.Estoc)
                {
                    var subcategories = Helpers.GetField <WeaponSubCategory[]>(dd, "SubCategories");
                    subcategories = subcategories.RemoveFromArray(WeaponSubCategory.Finessable);
                    Helpers.SetField(dd, "SubCategories", subcategories);
                    break;
                }
            }

            //fix kensai choosen weapon to give proficiency
            var kensai_choosen_weapon = library.Get <BlueprintParametrizedFeature>("c0b4ec0175e3ff940a45fc21f318a39a");

            kensai_choosen_weapon.AddComponent(Helpers.Create <AddFullWeaponProficiencyWeaponCategory>());
            AddFullWeaponProficiencyWeaponCategory.category_feature_map = new Dictionary <WeaponCategory, BlueprintFeature>()
            {
                { WeaponCategory.BastardSword, library.Get <BlueprintFeature>("57299a78b2256604dadf1ab9a42e2873") },
                { WeaponCategory.DwarvenWaraxe, library.Get <BlueprintFeature>("bd0d7feca087d2247b12965c1467790c") },
                { WeaponCategory.DuelingSword, library.Get <BlueprintFeature>("9c37279588fd9e34e9c4cb234857492c") },
                { WeaponCategory.Estoc, library.Get <BlueprintFeature>("9dc64f0b9161a354c9471a631318e16c") }
            };


            //fix units
            var hendrick_bandit = library.Get <BlueprintUnit>("5d7122078d52ec34aa5cc34df345ed51");

            hendrick_bandit.Body.PrimaryHand = library.Get <BlueprintItemWeapon>("0ce4b3f4a3d70fa45851313a7f3d233f"); //battle axe +1 instead of bastard sword +1 since he does not have proficiency

            //fix all oversized bastard swords to require exotic weapon proficiency
            var oversized_bastard_swords = library.GetAllBlueprints().OfType <BlueprintItemWeapon>().Where(w => oversized_bastard_sword_types.Contains(w.Type)).ToArray();

            foreach (var obs in oversized_bastard_swords)
            {
                obs.AddComponent(Helpers.Create <NewMechanics.EquipmentRestrictionFeature>(e => e.feature = bastard_sword_proficiency));
            }
        }
コード例 #7
0
        static internal void createShillelagh()
        {
            var boneshaker   = library.Get <BlueprintAbility>("b7731c2b4fa1c9844a092329177be4c3");
            var bless_weapon = library.Get <BlueprintAbility>("831e942864e924846a30d2e0678e438b");
            var enchant_dice = Helpers.Create <NewMechanics.WeaponDamageChange>();

            enchant_dice.dice_formula            = new DiceFormula(2, DiceType.D6);
            enchant_dice.bonus_damage            = 0;
            enchant_dice.damage_type_description = null;
            var enchantment_size = Common.createWeaponEnchantment("ShillelaghEnchantment",
                                                                  "Shillelagh",
                                                                  "Your own non - magical club or quarterstaff becomes a weapon with a + 1 enhancement bonus on attack and damage rolls. A quarterstaff gains this enhancement for both ends of the weapon.It deals damage as if it were two size categories larger(a Small club or quarterstaff so transmuted deals 1d8 points of damage, a Medium 2d6, and a Large 3d6), +1 for its enhancement bonus. If you stop wielding it, the weapon loses magical properties.",
                                                                  "Shillelagh",
                                                                  "",
                                                                  "",
                                                                  0,
                                                                  null,
                                                                  enchant_dice);
            var enhantment1 = library.Get <BlueprintWeaponEnchantment>("d704f90f54f813043a525f304f6c0050");

            BlueprintWeaponType[] shillelagh_types = new BlueprintWeaponType[] { library.Get <BlueprintWeaponType>("26aa0672af2c7d84ba93bec37758c712"), // club
                                                                                 library.Get <BlueprintWeaponType>("629736dabac7f9f4a819dc854eaed2d6")  // quarterstaff
            };
            var buff = Helpers.CreateBuff("ShillelaghBuff",
                                          enchantment_size.Name,
                                          enchantment_size.Description,
                                          "",
                                          boneshaker.Icon,
                                          null,
                                          Common.createBuffContextEnchantPrimaryHandWeapon(Common.createSimpleContextValue(1), true, true, shillelagh_types, enchantment_size),
                                          Common.createBuffContextEnchantPrimaryHandWeapon(Common.createSimpleContextValue(1), true, true, shillelagh_types, enhantment1)
                                          );

            buff.Stacking = Kingmaker.UnitLogic.Buffs.Blueprints.StackingType.Replace;


            var apply_buff = Common.createContextActionApplyBuff(buff,
                                                                 Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default), DurationRate.Minutes)
                                                                 );

            shillelagh = Helpers.CreateAbility("ShillelaghAbility",
                                               buff.Name,
                                               buff.Description,
                                               "",
                                               buff.Icon,
                                               AbilityType.Spell,
                                               Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Standard,
                                               AbilityRange.Personal,
                                               Helpers.minutesPerLevelDuration,
                                               "",
                                               bless_weapon.GetComponent <AbilitySpawnFx>(),
                                               bless_weapon.GetComponent <ContextRankConfig>(),
                                               Helpers.CreateRunActions(apply_buff),
                                               Helpers.CreateSpellComponent(Kingmaker.Blueprints.Classes.Spells.SpellSchool.Transmutation),
                                               Common.createAbilityCasterMainWeaponCheck(shillelagh_types[0].Category, shillelagh_types[1].Category)
                                               );
            shillelagh.CanTargetSelf      = true;
            shillelagh.CanTargetPoint     = false;
            shillelagh.CanTargetFriends   = false;
            shillelagh.CanTargetEnemies   = false;
            shillelagh.Animation          = Kingmaker.Visual.Animation.Kingmaker.Actions.UnitAnimationActionCastSpell.CastAnimationStyle.Omni;
            shillelagh.AnimationStyle     = Kingmaker.View.Animation.CastAnimationStyle.CastActionOmni;
            shillelagh.AvailableMetamagic = Kingmaker.UnitLogic.Abilities.Metamagic.Extend | Kingmaker.UnitLogic.Abilities.Metamagic.Quicken | Kingmaker.UnitLogic.Abilities.Metamagic.Heighten;
            shillelagh.AddToSpellList(Helpers.druidSpellList, 1);
            shillelagh.AddSpellAndScroll("98abe0fd52e9d7d49a4a94615acbbc60"); //boneshacker
        }