Exemple #1
0
 static void Postfix(SpellDescriptor spellDescriptor, ref string __result)
 {
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.Earth))
     {
         __result = maybeAddSeparator(__result) + "Earth";
     }
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.Water))
     {
         __result = maybeAddSeparator(__result) + "Water";
     }
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.Air))
     {
         __result = maybeAddSeparator(__result) + "Air";
     }
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.Shadow))
     {
         __result = maybeAddSeparator(__result) + "Shadow";
     }
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.LanguageDependent))
     {
         __result = maybeAddSeparator(__result) + "Language-Dependent";
     }
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.Pain))
     {
         __result = maybeAddSeparator(__result) + "Pain";
     }
 }
Exemple #2
0
        public static SpellImmunityToSpellDescriptor CreateSpellImmunity(this SpellDescriptor spell)
        {
            var s = Helpers.Create <SpellImmunityToSpellDescriptor>();

            s.Descriptor = spell;
            return(s);
        }
Exemple #3
0
        public static ImmuneToAttackOfOpportunityForSpells Create(SpellDescriptor descriptor = SpellDescriptor.None)
        {
            var i = Helpers.Create <ImmuneToAttackOfOpportunityForSpells>();

            i.Descriptor = descriptor;
            return(i);
        }
 public void ClearSlot()
 {
     _button.interactable = false;
     _spell       = null;
     WaitForLearn = false;
     Image.sprite = _originalSprite;
 }
Exemple #5
0
        public static BuffDescriptorImmunity CreateBuffImmunity(this SpellDescriptor spell)
        {
            var b = Helpers.Create <BuffDescriptorImmunity>();

            b.Descriptor = spell;
            return(b);
        }
    public void UpdateSlot(SpellDescriptor spell)
    {
        _spell       = spell;
        WaitForLearn = true;
        Image.sprite = spell.Image;

        _button.interactable = !_spell.Learned;
    }
Exemple #7
0
 public void Suppress(SpellDescriptor spellDescriptor)
 {
     foreach (SpellDescriptor spellDescriptor1 in UnitPartBuffSuppressSaved.GetValues(spellDescriptor))
     {
         this.m_SpellDescriptors.Add(spellDescriptor1);
     }
     this.Update();
 }
 public Spell(int id, Wizard wizard, SpellDescriptor descriptor, SpellObject obj)
 {
     this.Id = id;
     this.Wizard = wizard;
     this.Descriptor = descriptor;
     this.Object = obj;
     this.RegionalSpells = new Dictionary<Region, RegionalSpell>();
 }
        static public void undeadImmunitiesChange()
        {
            BlueprintFeature undeadImmunities = library.Get <BlueprintFeature>("8a75eb16bfff86949a4ddcb3dd2f83ae");

            //Undead have 3 condition immunities, 1 for nauseated, 1 for fatigued and 1 for sickened

            //They also 2 base buff descriptor immunities, which in turn each grant many immunities
            //Buff descriptor immunity: Poison, Disease, Sickened, Shaken, Fatigue, Frightened, Exhausted, Confusion, Death, Bleed, VilderavnBleed
            //Buff descriptor immunity: MindAffecting, Fear, Compulsion, Emotion, Charm, Daze, Shaken, Frightened, Confusion, Sleep

            //Stun and sleep are added here because, by PnP rules, Undead are immune to these traits in addition to being immune to mind-affecting things
            //SpellDescriptor sd1 = (SpellDescriptor)((long)SpellDescriptor.Poison + (long)SpellDescriptor.Disease + (long)SpellDescriptor.Fatigue + (long)SpellDescriptor.Exhausted + (long)SpellDescriptor.Death + (long)SpellDescriptor.Bleed + (long)SpellDescriptor.VilderavnBleed) + (long)SpellDescriptor.Stun + (long)SpellDescriptor.Sleep;
            SpellDescriptor sd1 = (SpellDescriptor)((long)SpellDescriptor.Poison + (long)SpellDescriptor.Disease + (long)SpellDescriptor.Sickened + (long)SpellDescriptor.Fatigue + (long)SpellDescriptor.Exhausted + (long)SpellDescriptor.Death + (long)SpellDescriptor.Bleed + (long)SpellDescriptor.VilderavnBleed + (long)SpellDescriptor.Stun + (long)SpellDescriptor.Sleep);
            //The list to bypass now includes only mindaffecting elements. As the PnP rules do not specificy that Daze
            //is mind-affecting that has been removed from their immunities entirely
            //its possible that this should be the mindaffecting trait alone or all of the mind affecting things
            //SpellDescriptor sd2 = (SpellDescriptor)((long)SpellDescriptor.MindAffecting + (long)SpellDescriptor.Fear + (long)SpellDescriptor.Compulsion + (long)SpellDescriptor.Emotion + (long)SpellDescriptor.Charm + (long)SpellDescriptor.Shaken + (long)SpellDescriptor.Frightened + (long)SpellDescriptor.Confusion);
            SpellDescriptor sd2 = (SpellDescriptor)((long)SpellDescriptor.MindAffecting);

            foreach (BuffDescriptorImmunity bdi in undeadImmunities.GetComponents <BuffDescriptorImmunity>())
            {
                if ((long)bdi.Descriptor.Value == 6597687263488) //This is the first buff descriptor's value which includes redundant buffs
                {
                    bdi.Descriptor = sd1;
                }
                if ((long)bdi.Descriptor.Value == 4366631152)
                {
                    bdi.Descriptor = sd2;
                }
                //Main.logger.Log("Buff descriptor immunity list: " + bdi.Descriptor.Value.ToString());
            }

            //undead also have a derivative stat bonus immunity which they should retain
            //undead have immunitities to spells in a manner similar to buffs. They are immune to Any spell with a descriptor that matches their condition immunities
            //The value is different here because the base game immunities do not include the VildravenBleed from the conditions immunities list
            //This block function similarly to the one above just for spell immunity instead of just condition immunity
            foreach (SpellImmunityToSpellDescriptor sitsd in undeadImmunities.GetComponents <SpellImmunityToSpellDescriptor>())
            {
                if ((long)sitsd.Descriptor.Value == 2199640752384) //the initial value similar to above minus the value of the vildravn bleed. yes it is a 13 digit number thank you very much
                {
                    sitsd.Descriptor = sd1;
                }
                if ((long)sitsd.Descriptor.Value == 4366631152)
                {
                    sitsd.Descriptor = sd2;
                }
                //Main.logger.Log("Spell descriptor immunity list: " + sitsd.Descriptor.Value.ToString());
            }

            //because undead should be immune to all fortitude negates effects, they should have immunity to the baleful polymorph buff
            BlueprintBuff        balefulPolymorphBuff = library.Get <BlueprintBuff>("0a52d8761bfd125429842103aed48b90");
            SpecificBuffImmunity sbi = new SpecificBuffImmunity
            {
                Buff = balefulPolymorphBuff
            };

            undeadImmunities.ComponentsArray = undeadImmunities.ComponentsArray.AddToArray(sbi);
        }
Exemple #10
0
 public void Release(SpellDescriptor spellDescriptor)
 {
     foreach (SpellDescriptor spellDescriptor1 in UnitPartBuffSuppressSaved.GetValues(spellDescriptor))
     {
         this.m_SpellDescriptors.Remove(spellDescriptor1);
     }
     this.Update();
     this.TryRemovePart();
 }
Exemple #11
0
        public BlueprintFeature createEnergyBlast()
        {
            var fx_id = new string[]
            {
                "2e4bb367a72490b46944654f321b91a4", //acid
                "070bd772af57d3c46ae89218032dad80", //cold
                "448260fa84101684ca32750574089663", //electricity
                "c152c5cb0af124a40bc94087f9e2bb29", //fire
            };

            var energy = new DamageEnergyType[]
            {
                DamageEnergyType.Acid, DamageEnergyType.Cold, DamageEnergyType.Electricity, DamageEnergyType.Fire
            };

            var descriptors = new SpellDescriptor[]
            {
                SpellDescriptor.Acid, SpellDescriptor.Cold, SpellDescriptor.Electricity, SpellDescriptor.Fire
            };

            var icons = new UnityEngine.Sprite[]
            {
                LoadIcons.Image2Sprite.Create(@"AbilityIcons/AcidBall.png"),
                Helpers.GetIcon("9f10909f0be1f5141bf1c102041f93d9"), //snowball
                NewSpells.aggressive_thundercloud.Icon,
                Helpers.GetIcon("2d81362af43aeac4387a3d4fced489c3"), //fireball
            };

            var names = new string[] { "Acid", "Cold", "Electricity", "Fire" };

            var abilities = new BlueprintAbility[names.Length];

            for (int i = 0; i < abilities.Length; i++)
            {
                var dmg = Helpers.CreateActionDealDamage(energy[i],
                                                         Helpers.CreateContextDiceValue(DiceType.D6,
                                                                                        Helpers.CreateContextValue(AbilityRankType.Default),
                                                                                        Helpers.CreateContextValue(AbilityRankType.DamageBonus)),
                                                         isAoE: true, halfIfSaved: true);

                var ability = Helpers.CreateAbility(prefix + names[i] + "EnergyBlastAbility",
                                                    "Energy Blast: " + names[i],
                                                    "As a standard action that provokes attacks of opportunity, you can expend 2 points of mental focus to unleash a blast of energy. This blast has a range of 60 feet, and deals 1d6+2 points of energy damage, plus an additional 1d6+2 points for every 2 occultist levels you possess beyond 1st (up to a maximum of 10d6+20 at 19th level). The blast deals damage to each creature in a 20-foot-radius burst, but each affected creature can attempt a Reflex save to halve the damage. When you unleash an energy blast, you must decide what type of damage it deals (acid, cold, electricity, or fire). You must be at least 5th level to select this focus power.",
                                                    "",
                                                    icons[i],
                                                    AbilityType.SpellLike,
                                                    CommandType.Standard,
                                                    AbilityRange.Medium,
                                                    "",
                                                    "",
                                                    Helpers.CreateRunActions(SavingThrowType.Reflex, dmg),
                                                    Helpers.CreateSpellComponent(SpellSchool.Evocation),
                                                    Helpers.CreateSpellDescriptor(descriptors[i]),
                                                    createDCScaling(),
                                                    createClassScalingConfig(ContextRankProgression.StartPlusDivStep, stepLevel: 2, startLevel: 1),
                                                    createClassScalingConfig(ContextRankProgression.Custom, type: AbilityRankType.DamageBonus,
                                                                             customProgression: new (int, int)[] { (2, 2), (4, 4), (6, 6), (8, 8), (10, 10),
 static void Postfix(SpellDescriptor spellDescriptor, ref string __result)
 {
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.Water))
     {
         __result = maybeAddSeparator(__result) + "Water";
     }
     if (spellDescriptor.Intersects((SpellDescriptor)ExtraSpellDescriptor.Wind))
     {
         __result = maybeAddSeparator(__result) + "Wind";
     }
 }
Exemple #13
0
 private static IEnumerable <SpellDescriptor> GetValues(
     SpellDescriptor spellDescriptor)
 {
     return(EnumUtils.GetValues <SpellDescriptor>().Where <SpellDescriptor>((Func <SpellDescriptor, bool>)(v =>
     {
         if (v != SpellDescriptor.None)
         {
             return (ulong)(spellDescriptor & v) > 0UL;
         }
         return false;
     })));
 }
Exemple #14
0
 public void AffactByTargetSpell(SpellDescriptor sd)
 {
     if (sd.Damage != 0)
     {
         _stat.ChangeHealth(-sd.Damage, sd.EnergyType);
     }
     foreach (var buff in sd.ApplyBuff)
     {
         _buffHandler.ApplyBuff(buff);
     }
     _cEffects.ActivateOneTimeEffect(sd.EffectName);
 }
Exemple #15
0
        public override void runActions(MechanicsContext context, UnitEntityData target, int dc, int check_result)
        {
            if (check_result <= dc + dc_bypass)
            {
                return;
            }
            var intimidate_value = context.MaybeCaster.Stats.GetStat <ModifiableValueSkill>(StatType.SkillPersuasion).BaseValue;

            if (intimidate_value < min_value)
            {
                return;
            }

            var spell_descriptors_to_add = new SpellDescriptor[]
            {
                SpellDescriptor.MindAffecting,
                SpellDescriptor.Fear
            };

            for (int i = 0; i < spell_descriptors_to_add.Length; i++)
            {
                if ((context.SpellDescriptor & spell_descriptors_to_add[i]) > 0)
                {
                    spell_descriptors_to_add[i] = SpellDescriptor.None;
                }
                else
                {
                    context.AddSpellDescriptor(spell_descriptors_to_add[i]);
                }
            }

            RuleSavingThrow saving_throw = new RuleSavingThrow(target, SavingThrowType.Will, 10 + intimidate_value);

            context.TriggerRule(saving_throw);

            foreach (var sd in spell_descriptors_to_add)
            {
                if (sd != SpellDescriptor.None)
                {
                    context.RemoveSpellDescriptor(sd);
                }
            }
            if (saving_throw.IsPassed)
            {
                return;
            }

            int duration = intimidate_value < upgrade_value ? 1 : RulebookEvent.Dice.D(new DiceFormula(1, DiceType.D4));

            target.Descriptor.AddBuff(frightened_buff, context, new TimeSpan?(duration.Rounds().Seconds));
        }
Exemple #16
0
    public void LearnSpell(SpellDescriptor spellD)
    {
        ScrollReserchSlot.ClearSlot();
        GameObject go = Instantiate(ScrollPrefab, SpellBookParent);

        go.SetActive(true);
        ScrollElement se = go.GetComponent <ScrollElement>();

        if (se)
        {
            spellD.Learned = true;
            se.Init(spellD);
        }
    }
Exemple #17
0
    public void UpdateRunes()
    {
        SpellDescriptor spellD = GetCorrectSpell();

        if (spellD == null)
        {
            ScrollReserchSlot.ClearSlot();
            Debug.LogWarning("NoCorrectRune");
        }
        else
        {
            CrateSpell(spellD);
        }
    }
Exemple #18
0
 private void Init()
 {
     ScrollPrefab.SetActive(false);
     RunePrefab.SetActive(false);
     ScrollReserchSlot.Init(this);
     foreach (var runeRef in Runes)
     {
         RuneDescriptor rune = Instantiate(runeRef);
         _myRunes.Add(rune);
     }
     foreach (var spellRef in Spells)
     {
         SpellDescriptor spell = Instantiate(spellRef);
         _mySpells.Add(spell);
     }
     foreach (var rSlot in RuneSlots)
     {
         rSlot.Init(this);
     }
 }
Exemple #19
0
    public bool TryFireSpell(SpellDescriptor spellDescriptor)
    {
        switch (spellDescriptor.SpellType)
        {
        case SpellType.Target:
            return(CastTargetSpell(spellDescriptor));

        case SpellType.AOE:
            break;

        case SpellType.Projectile:
            break;

        case SpellType.Global:
            break;

        default:
            break;
        }
        return(true);
    }
Exemple #20
0
    private bool CastTargetSpell(SpellDescriptor spellDescriptor)
    {
        //checkDistance
        if (!_targeter.CurrentFocusedCharacter || Vector2.Distance(transform.position, _targeter.CurrentFocusedCharacter.transform.position) > spellDescriptor.Range)
        {
            return(false);
        }

        SpellAffector sa = _targeter.CurrentFocusedCharacter.GetComponent <SpellAffector>();

        if (sa)
        {
            Debug.Log("SendRpc " + spellDescriptor.Name);
            sa.photonView.RPC("RPC_ApplyTargetSpell", PhotonTargets.AllBuffered, spellDescriptor.Name);
        }
        else
        {
            return(false);
        }

        return(true);
    }
Exemple #21
0
        static void createPersistanceInquisition()
        {
            var combat_reflexes = library.Get <BlueprintFeature>("0f8939ae6f220984e8fb568abbdfba95");

            var add_feat = Helpers.CreateFeature("PersistanceInquisitionBonusFeat",
                                                 combat_reflexes.Name,
                                                 "You receive Combat Reflexes as a bonus feat.",
                                                 "",
                                                 combat_reflexes.Icon,
                                                 FeatureGroup.None,
                                                 Helpers.CreateAddFact(combat_reflexes)
                                                 );

            var relentless_footing_resource = Helpers.CreateAbilityResource("RelentlessFootingResource", "", "", "", null);

            relentless_footing_resource.SetIncreasedByStat(3, StatType.Wisdom);

            var longstrider_buff   = library.Get <BlueprintBuff>("035ed56eb973f0e469a288ff5991c9ff");
            var relentless_footing = Helpers.CreateAbility("RelentlessFootingAbility",
                                                           "Relentless Footing",
                                                           "As a swift action, you can add 10 feet to your land speed. This increase counts as an enhancement bonus. You can use this ability a number of times per day equal to 3 + your Wisdom bonus (minimum 1).",
                                                           "",
                                                           longstrider_buff.Icon,
                                                           AbilityType.Extraordinary,
                                                           Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Swift,
                                                           AbilityRange.Personal,
                                                           Helpers.oneRoundDuration,
                                                           "",
                                                           Helpers.CreateRunActions(Common.createContextActionApplyBuff(longstrider_buff, Helpers.CreateContextDuration(1), dispellable: false)),
                                                           Helpers.CreateResourceLogic(relentless_footing_resource),
                                                           library.Get <BlueprintAbility>("14c90900b690cac429b229efdf416127").GetComponent <AbilitySpawnFx>() //from longstrider
                                                           );

            relentless_footing.setMiscAbilityParametersSelfOnly();
            var relentless_footing_feature = Common.AbilityToFeature(relentless_footing, false);

            relentless_footing_feature.AddComponent(Helpers.CreateAddAbilityResource(relentless_footing_resource));

            var inner_strength_resource = Helpers.CreateAbilityResource("InnerStrengthResource", "", "", "", null);

            inner_strength_resource.SetFixedResource(1);

            var lay_on_hands            = library.Get <BlueprintAbility>("8d6073201e5395d458b8251386d72df1"); //lay on hands self
            var inner_strength_variants = new List <BlueprintAbility>();
            var descriptors             = new SpellDescriptor[] { SpellDescriptor.Blindness, SpellDescriptor.Confusion, SpellDescriptor.Frightened, SpellDescriptor.Shaken, SpellDescriptor.Sickened, SpellDescriptor.Staggered };

            foreach (var d in descriptors)
            {
                var ability = Helpers.CreateAbility($"InnerStrength{d.ToString()}Ability",
                                                    $"Inner Strength: {d.ToString()}",
                                                    "At 6th level, once per day, you may heal yourself as a swift action, healing 1d6 hit points for every two inquisitor levels you possess. When you use this ability, you can also remove one of the following conditions from yourself: blinded, confused, frightened, nauseated, shaken, sickened, or staggered.",
                                                    "",
                                                    lay_on_hands.Icon,
                                                    AbilityType.Supernatural,
                                                    Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Swift,
                                                    AbilityRange.Personal,
                                                    "",
                                                    "",
                                                    Helpers.CreateRunActions(Common.createContextActionHealTarget(Helpers.CreateContextDiceValue(Kingmaker.RuleSystem.DiceType.D6, Helpers.CreateContextValue(Kingmaker.Enums.AbilityRankType.Default), 0)),
                                                                             Common.createContextActionDispelMagic(d, new SpellSchool[0], Kingmaker.RuleSystem.Rules.RuleDispelMagic.CheckType.DC)
                                                                             ),
                                                    lay_on_hands.GetComponent <AbilitySpawnFx>(),
                                                    Helpers.CreateResourceLogic(inner_strength_resource),
                                                    Helpers.CreateContextRankConfig(baseValueType: ContextRankBaseValueType.ClassLevel, classes: scaling_classes),
                                                    Common.createContextCalculateAbilityParamsBasedOnClasses(scaling_classes, StatType.Wisdom)
                                                    );
                ability.setMiscAbilityParametersSelfOnly();
                inner_strength_variants.Add(ability);
            }

            var inner_strength = Common.createVariantWrapper("InnerStrengthAbility", "", inner_strength_variants.ToArray());

            inner_strength.SetName("Inner Strength");
            inner_strength.AddComponent(Helpers.CreateResourceLogic(inner_strength_resource));

            var inner_strength_feature = Common.AbilityToFeature(inner_strength, false);

            inner_strength_feature.AddComponent(Helpers.CreateAddAbilityResource(inner_strength_resource));


            persistance = Helpers.CreateProgression("PersistanceInquisitionProgression",
                                                    "Persistance Inquisition",
                                                    "Your deity chose you for your persistence. You have vowed to pursue the enemies of the faith to the world’s end if necessary.",
                                                    "",
                                                    null,
                                                    FeatureGroup.Domain);
            persistance.Classes = scaling_classes;

            persistance.LevelEntries = new LevelEntry[] {
                Helpers.LevelEntry(1, add_feat, relentless_footing_feature),
                Helpers.LevelEntry(8, inner_strength_feature)
            };
            persistance.UIGroups = Helpers.CreateUIGroups(relentless_footing_feature, inner_strength_feature);

            addToDomainSelection(persistance, "Asmodeus", "Iomedae", "Urgathoa");
        }
 public double GetOpinion(SpellDescriptor descriptor)
 {
     return descriptor.GetOpinion(this);
 }
Exemple #23
0
        public static RunActionOnFailedSave Create(BlueprintAbilityResource resource, SpellDescriptor descriptor, GameAction failedSave)
        {
            var i = Helpers.Create <RunActionOnFailedSave>();

            i.Resource     = resource;
            i.Descriptor   = descriptor;
            i.OnFailedSave = Helpers.CreateActionList(failedSave);
            return(i);
        }
Exemple #24
0
 public void Init(SpellDescriptor spellD)
 {
     SpellDescriptor = spellD;
     Image.sprite    = spellD.Image;
     _startParent    = transform.parent;
 }
Exemple #25
0
 private void CrateSpell(SpellDescriptor spellD)
 {
     ScrollReserchSlot.UpdateSlot(spellD);
 }
Exemple #26
0
        public BlueprintFeature createWallOfPower()
        {
            var areas = new BlueprintAbilityAreaEffect[]
            {
                library.Get <BlueprintAbilityAreaEffect>("2a9cebe780b6130428f3bf4b18270021"), //acid
                library.Get <BlueprintAbilityAreaEffect>("608d84e25f42d6044ba9b96d9f60722a"), //cold
                library.Get <BlueprintAbilityAreaEffect>("2175d68215aa61644ad1d877d4915ece"), //electricity
                library.Get <BlueprintAbilityAreaEffect>("ac8737ccddaf2f948adf796b5e74eee7")  //fire
            };

            var icons = new UnityEngine.Sprite[]
            {
                Helpers.GetIcon("1e418794638cf95409f6e33c8c3dbe1a"), //acid wall
                Helpers.GetIcon("e377feb2ecec95e478e0565da621ea55"), //cold wall
                Helpers.GetIcon("8ba05ef69b06ea04c9430427a95685f6"), //elec wall
                Helpers.GetIcon("77d255c06e4c6a745b807400793cf7b1"), //fire wall
            };

            var energy = new DamageEnergyType[]
            {
                DamageEnergyType.Acid, DamageEnergyType.Cold, DamageEnergyType.Electricity, DamageEnergyType.Fire
            };

            var descriptors = new SpellDescriptor[]
            {
                SpellDescriptor.Acid, SpellDescriptor.Cold, SpellDescriptor.Electricity, SpellDescriptor.Fire
            };

            var names = new string[] { "Acid", "Cold", "Electricity", "Fire" };

            var abilities = new BlueprintAbility[areas.Length];


            for (int i = 0; i < abilities.Length; i++)
            {
                var dmg = Helpers.CreateActionDealDamage(energy[i],
                                                         Helpers.CreateContextDiceValue(BalanceFixes.getDamageDie(DiceType.D6),
                                                                                        2,
                                                                                        Helpers.CreateContextValue(AbilityRankType.Default)),
                                                         isAoE: true);

                var dmg_action = Helpers.CreateActionList(dmg);
                var area       = library.CopyAndAdd(areas[i], prefix + names[i] + "WallOfPowerArea", "");
                area.ComponentsArray = new BlueprintComponent[]
                {
                    Helpers.Create <NewMechanics.AbilityAreaEffectRunActionWithFirstRound>(a =>
                    {
                        a.Round     = dmg_action;
                        a.UnitEnter = dmg_action;
                    }),
                    createClassScalingConfig()
                };
                area.SpellResistance = true;
                var ability = Helpers.CreateAbility(prefix + names[i] + "WallOfPowerAbility",
                                                    "Wall of Power: " + names[i],
                                                    $"By expending 1 point of mental focus as a standard action, you can create a wall of pure energy with a length of up to 5 feet per occultist level you possess. This wall is 10 feet high and 1 foot thick. It doesn’t block passage, line of sight, or line of effect, but does deal damage to anyone passing through it. The wall deals 2d{BalanceFixes.getDamageDieString(DiceType.D6)} points of energy damage + 1 point of energy damage per occultist level you possess. You must select acid, cold, electricity, or fire when you create the wall to determine the type of damage it deals. The wall lasts for 1 round per occultist level you possess. You must be at least 9th level to select this focus power.",
                                                    "",
                                                    icons[i],
                                                    AbilityType.SpellLike,
                                                    CommandType.Standard,
                                                    AbilityRange.Medium,
                                                    "",
                                                    "",
                                                    Helpers.CreateRunActions(Common.createContextActionSpawnAreaEffect(area, Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default)))),
                                                    Helpers.CreateSpellDescriptor(descriptors[i]),
                                                    Helpers.CreateSpellComponent(SpellSchool.Evocation),
                                                    createClassScalingConfig(),
                                                    resource.CreateResourceLogic()
                                                    );

                ability.setMiscAbilityParametersRangedDirectional();
                abilities[i] = ability;
            }

            var wrapper = Common.createVariantWrapper(prefix + "WallOfPowerAbilityBase", "", abilities);

            wrapper.SetName("Wall of Power");
            addFocusInvestmentCheck(wrapper, SpellSchool.Evocation);
            var feature = Common.AbilityToFeature(wrapper, false);

            addMinLevelPrerequisite(feature, 9);
            return(feature);
        }
Exemple #27
0
        public BlueprintFeature createEnergyBlast()
        {
            var fx_id = new string[]
            {
                "2e4bb367a72490b46944654f321b91a4", //acid
                "070bd772af57d3c46ae89218032dad80", //cold
                "448260fa84101684ca32750574089663", //electricity
                "c152c5cb0af124a40bc94087f9e2bb29", //fire
            };

            var energy = new DamageEnergyType[]
            {
                DamageEnergyType.Acid, DamageEnergyType.Cold, DamageEnergyType.Electricity, DamageEnergyType.Fire
            };

            var descriptors = new SpellDescriptor[]
            {
                SpellDescriptor.Acid, SpellDescriptor.Cold, SpellDescriptor.Electricity, SpellDescriptor.Fire
            };

            var icons = new UnityEngine.Sprite[]
            {
                LoadIcons.Image2Sprite.Create(@"AbilityIcons/AcidBall.png"),
                Helpers.GetIcon("9f10909f0be1f5141bf1c102041f93d9"), //snowball
                NewSpells.aggressive_thundercloud.Icon,
                Helpers.GetIcon("2d81362af43aeac4387a3d4fced489c3"), //fireball
            };

            var names = new string[] { "Acid", "Cold", "Electricity", "Fire" };

            var abilities = new BlueprintAbility[names.Length];

            for (int i = 0; i < abilities.Length; i++)
            {
                var dmg = Helpers.CreateActionDealDamage(energy[i],
                                                         Helpers.CreateContextDiceValue(BalanceFixes.getDamageDie(DiceType.D4),
                                                                                        Helpers.CreateContextValue(AbilityRankType.Default),
                                                                                        0),
                                                         isAoE: true, halfIfSaved: true);

                var ability = Helpers.CreateAbility(prefix + names[i] + "EnergyBlastAbility",
                                                    "Energy Blast: " + names[i],
                                                    $"As a standard action that provokes attacks of opportunity, you can expend 2 points of mental focus to unleash a blast of energy. This blast has a range of 60 feet, and deals 1d{BalanceFixes.getDamageDieString(DiceType.D4)} points of energy damage per occultist level. The blast deals damage to each creature in a 20-foot-radius burst, but each affected creature can attempt a Reflex save to halve the damage. When you unleash an energy blast, you must decide what type of damage it deals (acid, cold, electricity, or fire). You must be at least 5th level to select this focus power.",
                                                    "",
                                                    icons[i],
                                                    AbilityType.SpellLike,
                                                    CommandType.Standard,
                                                    AbilityRange.Medium,
                                                    "",
                                                    "",
                                                    Helpers.CreateRunActions(SavingThrowType.Reflex, dmg),
                                                    Helpers.CreateSpellComponent(SpellSchool.Evocation),
                                                    Helpers.CreateSpellDescriptor(descriptors[i]),
                                                    createDCScaling(),
                                                    createClassScalingConfig(),
                                                    resource.CreateResourceLogic(amount: 2),
                                                    Common.createAbilitySpawnFx(fx_id[i], anchor: AbilitySpawnFxAnchor.ClickedTarget),
                                                    Helpers.CreateAbilityTargetsAround(20.Feet(), TargetType.Any)
                                                    );
                ability.SpellResistance = true;
                ability.setMiscAbilityParametersRangedDirectional();
                abilities[i] = ability;
            }

            var wrapper = Common.createVariantWrapper(prefix + "EnergyBlastAbilityBase", "", abilities);

            wrapper.SetName("Energy Blast");
            addFocusInvestmentCheck(wrapper, SpellSchool.Evocation);
            var feature = Common.AbilityToFeature(wrapper, false);

            addMinLevelPrerequisite(feature, 5);
            return(feature);
        }
Exemple #28
0
 public Spell(string wizardName, SpellDescriptor descriptor, SpellObject obj)
 {
     this.wizardName = wizardName;
     this.Descriptor = descriptor;
     this.Object = obj;
 }
Exemple #29
0
        static void createRestorationDomain()
        {
            var pharasma = library.Get <BlueprintFeature>("458750bc214ab2e44abdeae404ab22e9");

            var descriptors = new SpellDescriptor[] { SpellDescriptor.Shaken, SpellDescriptor.Daze, SpellDescriptor.Fatigue, SpellDescriptor.Sickened, SpellDescriptor.Staggered };
            var icon        = Helpers.GetIcon("caae1dc6fcf7b37408686971ee27db13");

            var resource = Helpers.CreateAbilityResource("RestorativeTouchResource", "", "", "", null);

            resource.SetIncreasedByStat(3, StatType.Wisdom);

            var abilities = new List <BlueprintAbility>();

            foreach (var d in descriptors)
            {
                var a = Helpers.CreateAbility(d.ToString() + "RestorativeTouchAbility",
                                              "Restortaive Touch: " + d.ToString(),
                                              "You can touch a creature, letting the healing power of your deity flow through you to relieve the creature of a minor condition. Your touch can remove the dazed, fatigued, shaken, sickened, or staggered condition. You choose which condition is removed. You can use this ability a number of times per day equal to 3 + your Wisdom modifier.",
                                              "",
                                              icon,
                                              AbilityType.Supernatural,
                                              Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Standard,
                                              AbilityRange.Touch,
                                              "",
                                              "",
                                              Helpers.CreateRunActions(Helpers.Create <ContextActionRemoveBuffsByDescriptor>(c => c.SpellDescriptor = d)),
                                              resource.CreateResourceLogic(),
                                              Common.createAbilitySpawnFx("224fb8fd952ec4d45b6d3436a77663d9", anchor: Kingmaker.UnitLogic.Abilities.Components.Base.AbilitySpawnFxAnchor.SelectedTarget,
                                                                          position_anchor: Kingmaker.UnitLogic.Abilities.Components.Base.AbilitySpawnFxAnchor.None,
                                                                          orientation_anchor: Kingmaker.UnitLogic.Abilities.Components.Base.AbilitySpawnFxAnchor.None
                                                                          )
                                              );
                a.setMiscAbilityParametersTouchFriendly();
                abilities.Add(a);
            }

            var wrapper = Common.createVariantWrapper("RestorativeTouchBase", "", abilities.ToArray());

            wrapper.SetName("Restorative Touch");
            var restorative_touch = Common.AbilityToFeature(wrapper, false);

            restorative_touch.AddComponent(resource.CreateAddAbilityResource());

            var healing_domain           = library.Get <BlueprintProgression>("b0a26ee984b6b6945b884467aa2f1baa");
            var healing_domain_secondary = library.Get <BlueprintProgression>("599fb0d60358c354d8c5c4304a73e19a");


            var healing_domain_base = library.Get <BlueprintFeature>("303cf1c933f343c4d91212f8f4953e3c");

            var spell_list = library.CopyAndAdd <BlueprintSpellList>("033b2b6a8899be844ae8aa91d4dab477", "RestorationSubdomainSpellList", "");

            Common.excludeSpellsFromList(spell_list, a => false);
            restoration_domain = createSubdomain("RestorationSubdomain", "Restoration Subdomain",
                                                 "Your touch staves off pain and death, and your healing magic is particularly vital and potent.\n" +
                                                 $"{wrapper.Name}: {wrapper.Description}\n" +
                                                 "Healer's Blessing: At 6th level, all of your cure spells are treated as if they were empowered, increasing the amount of damage healed by half (+50%). This does not apply to damage dealt to undead with a cure spell. This does not stack with the Empower Spell metamagic feat.\n"
                                                 + "Domain Spells: Remove Sickness, Remove Disease, Lesser, Cure Serious Wounds, Neutralize Poison, Break Enchantment, Heal, Restoration, Greater, Protection from Spells, Heal, Mass.",
                                                 healing_domain,
                                                 new BlueprintFeature[] { healing_domain_base },
                                                 new BlueprintFeature[] { restorative_touch },
                                                 spell_list
                                                 );
            Common.replaceDomainSpell(restoration_domain, library.Get <BlueprintAbility>("4093d5a0eb5cae94e909eb1e0e1a6b36"), 2);
            Common.replaceDomainSpell(restoration_domain, library.Get <BlueprintAbility>("e7240516af4241b42b2cd819929ea9da"), 4);
            Common.replaceDomainSpell(restoration_domain, library.Get <BlueprintAbility>("7792da00c85b9e042a0fdfc2b66ec9a8"), 5);
            restoration_domain.AddComponents(Helpers.PrerequisiteNoFeature(healing_domain), Helpers.PrerequisiteNoFeature(pharasma));

            restoration_domain_secondary = library.CopyAndAdd(restoration_domain, "RestorationSubdomainSecondaryProgression", "");
            restoration_domain_secondary.RemoveComponents <LearnSpellList>();

            restoration_domain_secondary.AddComponents(Helpers.PrerequisiteNoFeature(restoration_domain),
                                                       Helpers.PrerequisiteNoFeature(healing_domain),
                                                       Helpers.PrerequisiteNoFeature(healing_domain_secondary));
            restoration_domain.AddComponents(Helpers.PrerequisiteNoFeature(restoration_domain_secondary));

            cleric_domain_selection.AllFeatures           = cleric_domain_selection.AllFeatures.AddToArray(restoration_domain);
            cleric_secondary_domain_selection.AllFeatures = cleric_secondary_domain_selection.AllFeatures.AddToArray(restoration_domain_secondary);
        }
Exemple #30
0
 public float GetOpinion(SpellDescriptor descriptor)
 {
     return descriptor.GetOpinion(this);
 }
Exemple #31
0
    public void RPC_ApplyTargetSpell(string spellName)
    {
        SpellDescriptor sd = _scriptableRefHolder.Spells.Find(x => x.Name == spellName);

        AffactByTargetSpell(sd);
    }