示例#1
0
 static BlueprintFeature CreateEnhancedCures()
 {
     ContextRankConfig_GetValue_Patch.Apply();
     return(enhancedCures = Helpers.CreateFeature("MysteryLifeEnhancedCures", RES.EnhancedCuresFeatureName_info,
                                                  RES.EnhancedCuresFeatureDescription_info,
                                                  "111a339509c140b2818877f538351bca",
                                                  Helpers.GetIcon("3361c5df793b4c8448756146a88026ad"), // cure serious wounds
                                                  FeatureGroup.None));
 }
 static BlueprintFeature CreateEnhancedCures()
 {
     ContextRankConfig_GetValue_Patch.Apply();
     return(enhancedCures = Helpers.CreateFeature("MysteryLifeEnhancedCures", "强力治疗",
                                                  "当你施展一个治疗法术的时候,以你的先知等级,而不是法术提供的上限来决定额外的治疗加值。例如一个11级的先知施展“治疗轻伤”的时候,他将治疗“1d8+11”点伤害,而非“1d8+5”点。",
                                                  "111a339509c140b2818877f538351bca",
                                                  Helpers.GetIcon("3361c5df793b4c8448756146a88026ad"), // cure serious wounds
                                                  FeatureGroup.None));
 }
示例#3
0
 static BlueprintFeature CreateEnhancedCures()
 {
     ContextRankConfig_GetValue_Patch.Apply();
     return(enhancedCures = Helpers.CreateFeature("MysteryLifeEnhancedCures", "Enhanced Cures",
                                                  "Whenever you cast a cure spell, the maximum number of hit points healed is based on your oracle level, not the limit based on the spell. For example, an 11th-level oracle of life with this revelation may cast cure light wounds to heal 1d8+11 hit points instead of the normal 1d8+5 maximum.",
                                                  "111a339509c140b2818877f538351bca",
                                                  Helpers.GetIcon("3361c5df793b4c8448756146a88026ad"), // cure serious wounds
                                                  FeatureGroup.None));
 }
示例#4
0
        static BloodlineLevelLogic()
        {
            var description = "Eldritch Heritage/Crossblooded advancement";

            Main.ApplyPatch(typeof(BindAbilitiesToClass_GetLevel_Patch), description);
            Main.ApplyPatch(typeof(AddFeatureOnClassLevel_GetLevel_Patch), description);
            Main.ApplyPatch(typeof(ReplaceCasterLevelOfAbility_CalculateClassLevel_Patch), description);
            Main.ApplyPatch(typeof(ReplaceCasterLevelOfAbility_OnEventAboutToTrigger_Patch), description);
            Main.ApplyPatch(typeof(BlueprintAbilityResource_GetMaxAmount_Patch), description);
            ContextRankConfig_GetValue_Patch.Apply();
        }
示例#5
0
        internal static IEnumerable <BlueprintFeature> CreateMetamagicFeats()
        {
            if (metamagicFeats != null)
            {
                return(metamagicFeats);
            }
            var library = Main.library;

            // Patch the cost computation for metamagics so the new ones are recognized.
            Main.ApplyPatch(typeof(MetamagicHelper_DefaultCost_Patch), "Spell level cost for new metamagic feats");

            foreach (var spell in Helpers.allSpells)
            {
                var newMetamagic = (Metamagic)0;
                if (spell.HasAreaEffect() || spell.Variants.Any(v => v.HasAreaEffect()))
                {
                    newMetamagic |= (Metamagic)ModMetamagic.Selective;
                }

                if (spell.EffectOnEnemy == AbilityEffectOnUnit.Harmful)
                {
                    // TODO: check if it actually has a saving throw.
                    // (Need to recursively search for ContextActionSavingThrow.)
                    // TODO: spells like Web may not working with persistent spell.
                    newMetamagic |= (Metamagic)ModMetamagic.Persistent;

                    var dealsDamage = (spell.AvailableMetamagic & Metamagic.Empower) == Metamagic.Empower;
                    var descriptor  = spell.SpellDescriptor;
                    var hasElement  = (descriptor & (SpellDescriptor.Fire | SpellDescriptor.Cold | SpellDescriptor.Electricity | SpellDescriptor.Acid)) != 0;
                    if (dealsDamage || hasElement)
                    {
                        // TODO: many spells did not have the cold descriptor set.
                        // We'll need to scan for elemental damage (any element can be cold if used with
                        // Elemental Spell or the elemental arcana).
                        newMetamagic |= (Metamagic)ModMetamagic.Rime;

                        newMetamagic |= (Metamagic)ModMetamagic.Elemental;

                        // TODO: this won't work for spells that don't have variable damage components.
                        // We'll need to traverse the components to look for ContextActionDealDamage.
                        newMetamagic |= (Metamagic)ModMetamagic.Dazing;

                        // TODO: this has false positives (spells that can't actually benefit, because they
                        // already scale to 20th level). Presumably we could look for ContextRankConfig?
                        newMetamagic |= (Metamagic)ModMetamagic.Intensified;
                    }
                    var hasForce = (descriptor & SpellDescriptor.Force) != 0;
                    if (hasForce || spell.AssetGuid == "4ac47ddb9fa1eaf43a1b6809980cfbd2")
                    {
                        // Magic Missile does not correctly have the force descriptor set.
                        // Scan for damage actions?
                        newMetamagic |= (Metamagic)ModMetamagic.Toppling;
                    }
                }

                spell.AvailableMetamagic |= newMetamagic;
                if (spell.Parent != null)
                {
                    spell.Parent.AvailableMetamagic |= newMetamagic;
                }
            }

            // TODO: need some new icons for these feats.
            // The spell schools here are very arbitrary, it's just a way to get unique icons for each.
            var feats = new List <BlueprintFeature>();

            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Dazing, "2a9007dd7d9e4dfab2e5eef02d1cb596", "Dazing Spell",
                          "You can modify a spell to daze a creature damaged by the spell. When a creature takes damage from this spell, they become dazed for a number of rounds equal to the original level of the spell. If the spell allows a saving throw, a successful save negates the daze effect. If the spell does not allow a save, the target can make a Will save to negate the daze effect. If the spell effect also causes the creature to become dazed, the duration of this metamagic effect is added to the duration of the spell." +
                          "\nLevel Increase: +3",
                          /*SpellFocusEnchantment*/
                          "c5bf645f128c39b40850cde005b8538f",
                          Helpers.Create <DazingMetamagic>(d => d.DazeBuff = library.Get <BlueprintBuff>("9934fedff1b14994ea90205d189c8759"))));
            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Intensified, "ac3a3d3cdf4e4723bd99c14782092e8e", "Intensified Spell",
                          "An intensified spell increases the maximum number of damage dice by 5 levels. You must actually have sufficient caster levels to surpass the maximum in order to benefit from this feat. No other variables of the spell are affected, and spells that inflict damage that is not modified by caster level are not affected by this feat." +
                          "\nLevel Increase: +1",
                          /*SpellFocusDivination*/
                          "955e97411611d384db2cbc00d7ed5ead"));
            // patch to adjust the maximum dice cap.
            ContextRankConfig_GetValue_Patch.Apply();

            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Rime, "72e78961aec04ecfb92c50c280e9d8bb", "Rime Spell",
                          "The frost of your cold spell clings to the target, impeding it for a short time. A rime spell causes creatures that takes cold damage from the spell to become entangled for a number of rounds equal to the original level of the spell." +
                          "\nThis feat only affects spells with the cold descriptor." +
                          "\nLevel Increase: +1",
                          /*SpellFocusNecromancy*/
                          "8791da25011fd1844ad61a3fea6ece54",
                          Helpers.Create <RimeMetamagic>(r => r.EntangleBuff = library.Get <BlueprintBuff>("f7f6330726121cf4b90a6086b05d2e38"))));
            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Toppling, "566739fdc0e2417f9165b72bab7ba421", "Toppling Spell",
                          "The impact of your force spell is strong enough to knock the target prone. If the target takes damage, fails its saving throw, or is moved by your force spell, make a trip check against the target, using your caster level plus your casting ability score bonus (Wisdom for clerics, Intelligence for wizards, and so on). This does not provoke an attack of opportunity. If the check fails, the target cannot attempt to trip you or the force effect in response." +
                          "\nThis feat only affects spells with the force descriptor." +
                          "\nLevel Increase: +1",
                          /*SpellFocusConjuration*/
                          "d342cc595f499434687f9765f56d525c",
                          Helpers.Create <TopplingMetamagic>()));
            feats.Add(persistentSpellFeat = CreateMetamagicFeat(
                          ModMetamagic.Persistent, "fd0df5bbcadb4a5abb3d3030aeceb9a9", "Persistent Spell",
                          "Whenever a creature targeted by a persistent spell or within its area succeeds on its saving throw against the spell, it must make another saving throw against the effect. If a creature fails this second saving throw, it suffers the full effects of the spell, as if it had failed its first saving throw." +
                          "\nLevel Increase: +2",
                          /*SpellFocusIllusion*/
                          "e588279a80eb7a24b813fadad4bc83b5",
                          Helpers.Create <PersistentMetamagic>()));

            // Note: this is different from PnP. Since it's impossible to selecti which targets to exclude,
            // all friendly targets are excluded (rather than limiting it to the caster's ability bonus).
            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Selective, "7b6cf55779314114aa85e1b1577e94bf", "Selective Spell",
                          "When casting a selective spell with an area effect and a duration of instantaneous, friendly targets in the area are excluded from the effects of your spell." +
                          "\nLevel Increase: +1",
                          /*SpellFocusAbjuration*/
                          "71a3f1c1ac77ae3488b9b3d6d2aac01a",
                          Helpers.Create <SelectiveMetamagic>(),
                          Helpers.PrerequisiteStatValue(StatType.SkillKnowledgeArcana, 10)));
            RuleSpellTargetCheck.ApplyPatch();

            var elementalSpellFeat = Helpers.CreateFeatureSelection(
                "MetamagicElementalSpellSelection",
                "Metamagic (Elemental Spell)",
                "Choose one energy type: acid, cold, electricity, or fire. You may replace a spell’s normal damage with that energy type.\nLevel Increase: +1",
                "3c4cf55166884d7093366d26f90b609c",
                Helpers.GetIcon("bb24cc01319528849b09a3ae8eec0b31"), // ElementalFocusSelection
                FeatureGroup.Feat,
                Helpers.Create <RecommendationRequiresSpellbook>());

            elementalSpellFeat.Groups = new FeatureGroup[] { FeatureGroup.WizardFeat, FeatureGroup.Feat };
            elementalSpellFeat.SetFeatures(
                CreateElementalMetamagicFeat(ModMetamagic.ElementalFire, DamageEnergyType.Fire, "8fe8989edd8847968d36c57f90a1f344", /*ElementalFocusFire*/ "13bdf8d542811ac4ca228a53aa108145"),
                CreateElementalMetamagicFeat(ModMetamagic.ElementalCold, DamageEnergyType.Cold, "9fafef03ad234c389b36e9c13199e60a", /*ElementalFocusCold*/ "2ed9d8bf76412ba4a8afe38fa9925fca"),
                CreateElementalMetamagicFeat(ModMetamagic.ElementalElectricity, DamageEnergyType.Electricity, "f506a40aa32440839ba83177781d18b5", /*ElementalFocusElectricity*/ "d439691f37d17804890bd9c263ae1e80"),
                CreateElementalMetamagicFeat(ModMetamagic.ElementalAcid, DamageEnergyType.Acid, "4a78281cc87d43929a5417ae0ccb8e43", /*ElementalFocusAcid*/ "52135eada006e9045a848cd659749608"));

            feats.Add(elementalSpellFeat);

            Main.SafeLoad(AddMetamagicRodsToVendors, "Metamagic rods");
            return(metamagicFeats = feats);
        }
示例#6
0
        internal static IEnumerable <BlueprintFeature> CreateMetamagicFeats()
        {
            if (metamagicFeats != null)
            {
                return(metamagicFeats);
            }
            var library = Main.library;

            // Patch the cost computation for metamagics so the new ones are recognized.
            Main.ApplyPatch(typeof(MetamagicHelper_DefaultCost_Patch), "Spell level cost for new metamagic feats");

            foreach (var spell in Helpers.allSpells)
            {
                var newMetamagic = (Metamagic)0;
                if (spell.HasAreaEffect() || spell.Variants.Any(v => v.HasAreaEffect()))
                {
                    newMetamagic |= (Metamagic)ModMetamagic.Selective;
                }

                if (spell.EffectOnEnemy == AbilityEffectOnUnit.Harmful)
                {
                    // TODO: check if it actually has a saving throw.
                    // (Need to recursively search for ContextActionSavingThrow.)
                    // TODO: spells like Web may not working with persistent spell.
                    newMetamagic |= (Metamagic)ModMetamagic.Persistent;

                    var dealsDamage = (spell.AvailableMetamagic & Metamagic.Empower) == Metamagic.Empower;
                    var descriptor  = spell.SpellDescriptor;
                    var hasElement  = (descriptor & (SpellDescriptor.Fire | SpellDescriptor.Cold | SpellDescriptor.Electricity | SpellDescriptor.Acid)) != 0;
                    if (dealsDamage || hasElement)
                    {
                        // TODO: many spells did not have the cold descriptor set.
                        // We'll need to scan for elemental damage (any element can be cold if used with
                        // Elemental Spell or the elemental arcana).
                        newMetamagic |= (Metamagic)ModMetamagic.Rime;

                        newMetamagic |= (Metamagic)ModMetamagic.Elemental;

                        // TODO: this won't work for spells that don't have variable damage components.
                        // We'll need to traverse the components to look for ContextActionDealDamage.
                        newMetamagic |= (Metamagic)ModMetamagic.Dazing;

                        // TODO: this has false positives (spells that can't actually benefit, because they
                        // already scale to 20th level). Presumably we could look for ContextRankConfig?
                        newMetamagic |= (Metamagic)ModMetamagic.Intensified;
                    }
                    var hasForce = (descriptor & SpellDescriptor.Force) != 0;
                    if (hasForce || spell.AssetGuid == "4ac47ddb9fa1eaf43a1b6809980cfbd2")
                    {
                        // Magic Missile does not correctly have the force descriptor set.
                        // Scan for damage actions?
                        newMetamagic |= (Metamagic)ModMetamagic.Toppling;
                    }
                }

                spell.AvailableMetamagic |= newMetamagic;
                if (spell.Parent != null)
                {
                    spell.Parent.AvailableMetamagic |= newMetamagic;
                }
            }

            // TODO: need some new icons for these feats.
            // The spell schools here are very arbitrary, it's just a way to get unique icons for each.
            var feats = new List <BlueprintFeature>();

            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Dazing, "2a9007dd7d9e4dfab2e5eef02d1cb596", RES.MetamagicFeatDazingSpellName_info,
                          RES.MetamagicFeatDazingSpellDescription_info,
                          /*SpellFocusEnchantment*/
                          Helpers.GetIcon("c5bf645f128c39b40850cde005b8538f"),
                          Helpers.Create <DazingMetamagic>(d => d.DazeBuff = library.Get <BlueprintBuff>("9934fedff1b14994ea90205d189c8759"))));
            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Intensified, "ac3a3d3cdf4e4723bd99c14782092e8e", RES.MetamagicFeatIntensifiedSpellName_info,
                          RES.MetamagicFeatIntensifiedSpellDescription_info,
                          /*SpellFocusDivination*/
                          Helpers.GetIcon("955e97411611d384db2cbc00d7ed5ead")));
            // patch to adjust the maximum dice cap.
            ContextRankConfig_GetValue_Patch.Apply();

            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Rime, "72e78961aec04ecfb92c50c280e9d8bb", RES.MetamagicFeatRimeSpellName_info,
                          RES.MetamagicFeatRimeSpellDescription_info,
                          /*SpellFocusNecromancy*/
                          Helpers.GetIcon("8791da25011fd1844ad61a3fea6ece54"),
                          Helpers.Create <RimeMetamagic>(r => r.EntangleBuff = library.Get <BlueprintBuff>("f7f6330726121cf4b90a6086b05d2e38"))));
            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Toppling, "566739fdc0e2417f9165b72bab7ba421", RES.MetamagicFeatTopplingSpellName_info,
                          RES.MetamagicFeatTopplingSpellDescription_info,
                          /*SpellFocusConjuration*/
                          Helpers.GetIcon("d342cc595f499434687f9765f56d525c"),
                          Helpers.Create <TopplingMetamagic>()));
            feats.Add(persistentSpellFeat = CreateMetamagicFeat(
                          ModMetamagic.Persistent, "fd0df5bbcadb4a5abb3d3030aeceb9a9", RES.MetamagicFeatPersistentSpellName_info,
                          RES.MetamagicFeatPersistentSpellDescription_info,
                          /*SpellFocusIllusion*/
                          Helpers.GetIcon("e588279a80eb7a24b813fadad4bc83b5"),
                          Helpers.Create <PersistentMetamagic>()));

            // Note: this is different from PnP. Since it's impossible to selecti which targets to exclude,
            // all friendly targets are excluded (rather than limiting it to the caster's ability bonus).
            feats.Add(CreateMetamagicFeat(
                          ModMetamagic.Selective, "7b6cf55779314114aa85e1b1577e94bf", RES.MetamagicFeatSelectiveSpellName_info,
                          RES.MetamagicFeatSelectiveSpellDescription_info,
                          /*SpellFocusAbjuration*/
                          Helpers.GetIcon("71a3f1c1ac77ae3488b9b3d6d2aac01a"),
                          Helpers.Create <SelectiveMetamagic>(),
                          Helpers.PrerequisiteStatValue(StatType.SkillKnowledgeArcana, 10)));
            RuleSpellTargetCheck.ApplyPatch();

            var elementalSpellFeat = Helpers.CreateFeatureSelection(
                "MetamagicElementalSpellSelection",
                RES.MetamagicElementalSpellSelectionName_info,
                RES.MetamagicElementalSpellSelectionDescription_info,
                "3c4cf55166884d7093366d26f90b609c",
                Helpers.GetIcon("bb24cc01319528849b09a3ae8eec0b31"), // ElementalFocusSelection
                FeatureGroup.Feat,
                Helpers.Create <RecommendationRequiresSpellbook>());

            elementalSpellFeat.Groups = new FeatureGroup[] { FeatureGroup.WizardFeat, FeatureGroup.Feat };

            var fire = Image2Sprite.Create("Mods/EldritchArcana/sprites/fire.png");
            var shoc = Image2Sprite.Create("Mods/EldritchArcana/sprites/shock.png");
            var acid = Image2Sprite.Create("Mods/EldritchArcana/sprites/acid.png");
            var forc = Image2Sprite.Create("Mods/EldritchArcana/sprites/forc.png");
            var cold = Image2Sprite.Create("Mods/EldritchArcana/sprites/cold.png");

            //string plaatje1 = powerplaatje.GetInstanceID().ToString();

            elementalSpellFeat.SetFeatures(
                CreateElementalMetamagicFeat(ModMetamagic.ElementalFire, DamageEnergyType.Fire, "8fe8989edd8847968d36c57f90a1f344", fire),
                CreateElementalMetamagicFeat(ModMetamagic.ElementalCold, DamageEnergyType.Cold, "9fafef03ad234c389b36e9c13199e60a", cold),
                CreateElementalMetamagicFeat(ModMetamagic.ElementalElectricity, DamageEnergyType.Electricity, "f506a40aa32440839ba83177781d18b5", shoc),
                CreateElementalMetamagicFeat(ModMetamagic.ElementalForce, DamageEnergyType.Magic, "f506a40cb32440839ba83177781d18b5", forc),
                CreateElementalMetamagicFeat(ModMetamagic.ElementalAcid, DamageEnergyType.Acid, "4a78281cc87d43929a5417ae0ccb8e43", acid));
            //4ac47ddb9fa1eaf43a1b6809980cfbd2

            feats.Add(elementalSpellFeat);

            Main.SafeLoad(AddMetamagicRodsToVendors, RES.MetamagicRodsName_info);
            return(metamagicFeats = feats);
        }