0 of 0

File information

Last updated

Original upload

Created by

Mathih

Uploaded by

Scarlex

Virus scan

Safe to use

Tags for this mod

About this mod

Logic and definition for Unarmored Defense, used by other mods.

Requirements
Permissions and credits
--- About ---
This mod adds the mechanic of Unarmored Defense to Solasta. Unarmored Defense is used by Barbarian and Monk classes in 5E SRD.
This mod extends the logic of the game to account for a character having a fighting style or a feat of this type when applying its bonuses.

The mod adds the following as feats and fighting styles:

Unarmored Defense (Constitution)
While you are not wearing any armor, your Armor Class equals 10 + your Dexterity modifier + your Constitution modifier. You can use a shield and still gain this benefit.

Unarmored Defense (Wisdom)
While you are wearing no armor and not wielding a shield, your AC equals 10 + your Dexterity modifier + your Wisdom modifier.


--- API/Usage ---
This mod is inteded as a package for other mods to use as needed. On its own, the mod does nothing unless another mod uses its feats or fighting styles.

Usage in your mod:
To use Unarmored Defense in your mod, complete the following step:

1. In your mods .csproj file, locate the <ItemGroup> section and paste the following dependency.

<Reference Include="SolastaUnarmoredDefense">
<HintPath>$([System.IO.Path]::Combine($(SolastaInstallDir), 'Mods\SolastaUnarmoredDefense\SolastaUnarmoredDefense.dll'))</HintPath>
</Reference>


2. Ensure that the Unarmored Defense mod has been installed into your Solasta Mods folder

3. To use any of the feats or fighting styles included in this mod, simply use the SolastaUnarmoredDefense in your code.
    
The feat versions are added to the game database the moment they are called.
internal static void ModEntryPoint()
 {
// This feat can now be picked up at appropriate levels
var initializedFeat = SolastaUnarmoredDefense.Feats.UnarmoredDefenseWis;
 }




Here's an example of a Barbarian unarmored defense implementation using a fighting style choice at level 1

internal class MyClassFightingStyleChoice : BaseDefinitionBuilder<FeatureDefinitionFightingStyleChoice>
    {
        const string FightingStyleChoice = "Name";
        const string FightingStyleChoiceGuid = "Guid";

        protected MyClassFightingStyleChoice(string name, string guid) :
base(DatabaseHelper.FeatureDefinitionFightingStyleChoices.FightingStyleFighter,
name, guid)
        {
            Definition.FightingStyles.Clear();

            // The fighting style is built and added to the db when it is called. All there is to do is get its name
            Definition.FightingStyles.Add(SolastaUnarmoredDefense.FightingStyles.UnarmoredDefense_Constitution.Name);
        }

        public static FeatureDefinitionFightingStyleChoice CreateAndAddToDB(string name, string guid)
            => new MyClassFightingStyleChoice(name, guid).AddToDB();

        public static FeatureDefinitionFightingStyleChoice StyleChoice =
CreateAndAddToDB(FightingStyleChoice, FightingStyleChoiceGuid);
    }


In our class definition, simply add a reference to the fightingstyle choice builder:
 Definition.FeatureUnlocks.Add(new FeatureUnlockByLevel(MyClassFightingStyleChoice.StyleChoice, 1));