Beispiel #1
0
        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);
        }
Beispiel #2
0
        static public BlueprintFeature Create()
        {
            if (ArcaneReservoir.resource == null)
            {
                UnityModManagerNet.UnityModManager.Logger.Log("[Arcanist ConsumeSpell]Arcane Reservoir Pool must be created before ConsumeSpells::Create()");
                return(null);
            }
            if (library.BlueprintsByAssetId.ContainsKey("6e48c034817eabd99df991e0435025ed"))
            {
                return(library.Get <BlueprintFeature>("6e48c034817eabd99df991e0435025ed"));
            }
            consume_resource = Helpers.CreateAbilityResource("ArcanistClassConsumeSpellAblResource", "", "",
                                                             "56e3d1e34251f5c628ae08e78dbf0360",//MD5-32[ArcanistClass.ConsumeSpell.AblResource]
                                                             IconSet.vanish_icon);
            consume_resource.SetIncreasedByStat(3, StatType.Charisma);

            var variants = new List <BlueprintAbility>();

            for (int i = 1; i <= 9; i++)
            {
                int least_arcanist_level = (i == 1) ? 1 : 2 * i;
                AbilityRequirementClassSpellLevel comp_pre = Helpers.Create <AbilityRequirementClassSpellLevel>();
                comp_pre.characterClass     = arcanist;
                comp_pre.RequiredSpellLevel = i;

                AbilityResourceLogic comp_res = Helpers.Create <AbilityResourceLogic>();
                comp_res.Amount           = 1;
                comp_res.IsSpendResource  = true;
                comp_res.RequiredResource = consume_resource;
                comp_res.CostIsCustom     = false;

                AbilityEffectRunAction         comp_act = Helpers.Create <AbilityEffectRunAction>();
                ConsumeSpellForReservoirAction act      = Helpers.Create <ConsumeSpellForReservoirAction>();
                act.resource           = ArcaneReservoir.resource;
                act.spellLevel         = i;
                act.blueprintSpellbook = arcanist.Spellbook;
                comp_act.Actions       = new ActionList {
                    Actions = new GameAction[] { act }
                };

                BlueprintAbility abl_i = Helpers.CreateAbility($"ArcanistClassConsumeSpellLevel{i}Abl", "", "",
                                                               OtherUtils.GetMd5($"ArcanistClassConsumeSpellLevel{i}Abl"), IconSet.magus_spellrecall, AbilityType.Supernatural,
                                                               UnitCommand.CommandType.Move, AbilityRange.Personal,
                                                               "", "", comp_pre, comp_res, comp_act);
                abl_i.SetName(Helpers.CreateString($"ArcanistClass.ConsumeSpell.Level{i}.Abl.Name"));
                abl_i.SetDescription(Helpers.CreateString($"ArcanistClass.ConsumeSpell.Level{i}.Abl.Desc"));
                abl_i.LocalizedDuration    = Helpers.CreateString("ArcaneTide.Instant");
                abl_i.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.NoSave");
                variants.Add(abl_i);
                ablList.Add(abl_i);
            }

            AbilityResourceLogic comp_res0 = Helpers.Create <AbilityResourceLogic>();

            comp_res0.Amount           = 1;
            comp_res0.IsSpendResource  = true;
            comp_res0.RequiredResource = consume_resource;
            comp_res0.CostIsCustom     = false;

            abl = Helpers.CreateAbility("ArcanistClassConsumeSpellAbl", "", "",
                                        "33bec6603df0f7cfe904525e9a44432e",//MD5-32[ArcanistClass.ConsumeSpells.Abl]
                                        IconSet.magus_spellrecall,
                                        AbilityType.Supernatural,
                                        UnitCommand.CommandType.Move,
                                        AbilityRange.Personal,
                                        "",
                                        "",
                                        comp_res0);
            abl.SetName(Helpers.CreateString("ArcanistClass.ConsumeSpells.Abl.Name"));
            abl.SetDescription(Helpers.CreateString("ArcanistClass.ConsumeSpells.Abl.Desc"));
            abl.LocalizedDuration    = Helpers.CreateString("ArcaneTide.Instant");
            abl.LocalizedSavingThrow = Helpers.CreateString("ArcaneTide.NoSave");
            abl.AddComponent(abl.CreateAbilityVariants(variants.ToArray <BlueprintAbility>()));
            ablList.Add(abl);
            feat = Helpers.CreateFeature("ArcanistClassConsumeSpellsFeat", "", "",
                                         "6e48c034817eabd99df991e0435025ed",//MD5-32[ArcanistClass.ConsumeSpells.Feat]
                                         IconSet.magus_spellrecall,
                                         FeatureGroup.None,
                                         Helpers.Create <AddAbilityResources>(a => a.Resource = consume_resource),
                                         Helpers.Create <AddFacts>(a => a.Facts = new BlueprintUnitFact[] { abl }));
            feat.SetName(Helpers.CreateString("ArcanistClass.ConsumeSpells.Name"));
            feat.SetDescription(Helpers.CreateString("ArcanistClass.ConsumeSpells.Desc"));
            return(feat);
        }