static public BlueprintAbility CreateHeighten() { var variants = new List <BlueprintAbility>(); Metamagic heighten = Metamagic.Heighten; BlueprintFeature heightenFeat = library.Get <BlueprintFeature>(MetaFeats.dict[(int)heighten]); for (int i = 1; i <= 9; i++) { string buffname = $"ArcanistClassSponHeighten{i}SubBuff"; var buff_i = Helpers.CreateBuff(buffname, "", "", OtherUtils.GetMd5(buffname), heightenFeat.Icon, null); buff_i.SetName(Helpers.CreateString($"ArcanistClass.SponMetamagic.Heighten{i}.Name")); buff_i.SetDescription(heightenFeat.GetDescription()); var ablEffectComp = Helpers.Create <AbilityEffectRunAction>(); var ablEffectCompAction = Helpers.Create <ContextActionApplyBuff>(); ablEffectCompAction.Buff = buff_i; ablEffectCompAction.Permanent = false; ablEffectCompAction.DurationValue = PresetDurations.oneRound; ablEffectCompAction.IsFromSpell = false; ablEffectCompAction.IsNotDispelable = false; ablEffectCompAction.ToCaster = false; ablEffectCompAction.AsChild = true; ablEffectComp.Actions = new ActionList { Actions = new GameAction[] { null, ablEffectCompAction } }; var ablRequirementComp = Helpers.Create <AbilityRequirementFeature>(); ablRequirementComp.Feat = heightenFeat; ablRequirementComp.Not = false; var ablRequirementComp2 = Helpers.Create <AbilityRequirementClassSpellLevel>(); ablRequirementComp2.characterClass = ArcanistClass.arcanist; ablRequirementComp2.RequiredSpellLevel = i; var abl_i_name = $"ArcanistClassSponHeighten{i}SubAbl"; var abl_i = Helpers.CreateAbility(abl_i_name, "", "", OtherUtils.GetMd5(abl_i_name), heightenFeat.Icon, AbilityType.Special, UnitCommand.CommandType.Free, AbilityRange.Personal, "", "", ablEffectComp, ablRequirementComp, ablRequirementComp2); abl_i.SetName(buff_i.GetName()); abl_i.SetDescription(buff_i.GetDescription()); abl_i.LocalizedDuration = Helpers.CreateString("ArcaneTide.OneRound"); abl_i.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.WillSave.NoHarm"); variants.Add(abl_i); buffDict[OtherUtils.make_pair <int, int>((int)heighten, i)] = buff_i; } BlueprintAbility abl = Helpers.CreateAbility("ArcanistClassSponHeightenAbl", "", "", OtherUtils.GetMd5("ArcanistClassSponHeightenAbl"), heightenFeat.Icon, AbilityType.Special, UnitCommand.CommandType.Free, AbilityRange.Personal, "", ""); abl.SetName(heightenFeat.GetName()); abl.SetDescription(heightenFeat.GetDescription()); abl.LocalizedDuration = Helpers.CreateString("ArcaneTide.OneRound"); abl.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.WillSave.NoHarm"); abl.AddComponent(abl.CreateAbilityVariants(variants)); return(abl); }
static public BlueprintFeature Create() { if (library.BlueprintsByAssetId.ContainsKey("b04d23c4d4f14d431d316063db884fe5")) { return(library.Get <BlueprintFeature>("b04d23c4d4f14d431d316063db884fe5")); } var variants = new List <BlueprintAbility>(); buffDict = new Dictionary <Pair <int, int>, BlueprintBuff>(); flagBuff = Helpers.CreateBuff("ArcanistClassSponMetamagicFlagBuff", "", "", OtherUtils.GetMd5("ArcanistClassSponMetamagicFlagBuff"), null, null); flagBuff.SetBuffFlags(flagBuff.GetBuffFlags() | BuffFlags.HiddenInUi); //make metamagics other than heighten foreach (var kv in MetaFeats.dict) { Metamagic metaId = (Metamagic)(kv.Key); BlueprintFeature metaFeat = library.Get <BlueprintFeature>(kv.Value); if (metaId == Metamagic.Heighten) { continue; } RealMetamagicOnNextSpell comp = Helpers.Create <RealMetamagicOnNextSpell>(); comp.metamagic = metaId; var buff_i = Helpers.CreateBuff($"ArcanistClassSponMetamagic{metaId}SubBuff", "", "", OtherUtils.GetMd5($"ArcanistClassSponMetamagic{metaId}SubBuff"), metaFeat.Icon, null, comp); buff_i.SetName(metaFeat.GetName()); buff_i.SetDescription(metaFeat.GetDescription()); var ablEffectComp = Helpers.Create <AbilityEffectRunAction>(); var ablEffectCompAction = Helpers.Create <ContextActionApplyBuff>(); ablEffectCompAction.Buff = buff_i; ablEffectCompAction.Permanent = false; ablEffectCompAction.DurationValue = PresetDurations.oneRound; ablEffectCompAction.IsFromSpell = false; ablEffectCompAction.IsNotDispelable = false; ablEffectCompAction.ToCaster = false; ablEffectCompAction.AsChild = true; ablEffectComp.Actions = new ActionList { Actions = new GameAction[] { null, ablEffectCompAction } }; var ablRequirementComp = Helpers.Create <AbilityRequirementFeature>(); ablRequirementComp.Feat = metaFeat; ablRequirementComp.Not = false; var abl_i = Helpers.CreateAbility($"ArcanistClassSponMetamagic{metaId}SubAbl", "", "", OtherUtils.GetMd5($"ArcanistClassSponMetamagic{metaId}SubAbl"), metaFeat.Icon, AbilityType.Special, UnitCommand.CommandType.Free, AbilityRange.Personal, "", "", ablEffectComp, ablRequirementComp); abl_i.SetName(metaFeat.GetName()); abl_i.SetDescription(metaFeat.GetDescription()); abl_i.LocalizedDuration = Helpers.CreateString("ArcaneTide.OneRound"); abl_i.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.WillSave.NoHarm"); variants.Add(abl_i); buffDict[OtherUtils.make_pair <int, int>((int)metaId, 0)] = buff_i; } var abl = Helpers.CreateAbility("ArcanistClassSponMetamagicAbl", "", "", "d4abbfad4a4cd0eadde062132945f7bf",//MD5-32[ArcanistClass.SponMetamagic.Abl] IconSet.metamagic, AbilityType.Special, UnitCommand.CommandType.Free, AbilityRange.Personal, "", ""); abl.SetName(Helpers.CreateString("ArcanistClass.SponMetamagic.Abl.Name")); abl.SetDescription(Helpers.CreateString("ArcanistClass.SponMetamagic.Abl.Desc")); abl.LocalizedDuration = Helpers.CreateString("ArcaneTide.OneRound"); abl.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.WillSave.NoHarm"); abl.AddComponent(Helpers.CreateAbilityVariants(abl, variants)); var ablHeighten = CreateHeighten(); feat = Helpers.CreateFeature("ArcanistClassSponMetamagicFeat", "", "", "b04d23c4d4f14d431d316063db884fe5",//MD5-32[ArcanistClass.SponMetamagic.Feat] null, FeatureGroup.None, Helpers.Create <AddFacts>(a => a.Facts = new BlueprintUnitFact[] { abl, ablHeighten })); feat.HideInUI = true; return(feat); }
static BlueprintFeature CreateSpellVulnerability() { //Log.Write(DrawFeatGuids[1]); var spellvulsprite = Image2Sprite.Create("Mods/EldritchArcana/sprites/spell_vulnerability.png"); int SpellVunrabilityBonus = -4; var components = new List <BlueprintComponent> { }; var SpellschoolChoiceFeature = (new SpellSchool[] { SpellSchool.Abjuration, SpellSchool.Conjuration, //SpellSchool.Divination, SpellSchool.Enchantment, SpellSchool.Evocation, SpellSchool.Illusion, SpellSchool.Necromancy, SpellSchool.Transmutation, //SpellSchool.Universalist }).Select((school) => Helpers.CreateFeature($"SpellVulnerability{school}", $"SpellVulnerability-{school}", $" you have {SpellVunrabilityBonus} on saves vs {school}", Helpers.MergeIds(DrawFeatGuids[1], Helpers.spellSchoolGuid(school)), Helpers.GetIcon(Helpers.spellSchoolGuid(school)), FeatureGroup.None, Helpers.Create <SavingThrowBonusAgainstSchool>(a => { a.School = school; a.Value = SpellVunrabilityBonus; a.ModifierDescriptor = ModifierDescriptor.Penalty; }))).ToArray(); var ElementalWeaknes = new DamageEnergyType[] { DamageEnergyType.Cold, DamageEnergyType.Acid, //divination DamageEnergyType.Sonic, DamageEnergyType.Fire, DamageEnergyType.Electricity, DamageEnergyType.Unholy, DamageEnergyType.Divine, //universalist }; BlueprintFeature feature = SpellschoolChoiceFeature[1]; for (int i = 0; i < 7; i++) { feature = SpellschoolChoiceFeature[i]; feature.SetDescription(feature.GetDescription() + $" and Elementalweakness {ElementalWeaknes[i]}"); feature.AddComponent(Helpers.Create <AddEnergyVulnerability>(a => { a.Type = ElementalWeaknes[i]; })); } //var noFeature = Helpers.PrerequisiteNoFeature(null); var feat = Helpers.CreateFeatureSelection("SpellVulnerability", "Spell Vulnerability", "if you pick a Drawback at level one you can choose an extra feat on top\n" + $"Bane: choose a spellschool you have {SpellVunrabilityBonus} on saves vs that spellschool.", //\n(except universalist and divination becouse there are no saves of those catagory) DrawFeatGuids[1], spellvulsprite, //Helpers.NiceIcons(15), FeatureGroup.Feat); //,PrerequisiteCharacterLevelExact.Create(1) //feat.AddComponents(ElementalWeaknesChoiceFeature); //noFeature.Feature = feat; /* * foreach (var choice in SpellschoolChoiceFeature) * { * Log.Write(choice.Name); * Log.Write(choice.Description); * }*/ feat.SetFeatures(SpellschoolChoiceFeature); //feat.AddComponents(ikweethetniet); //components.AddRange(ikweethetniet); return(feat); }