From cf27b596efbeb3bb634280d3d741b21d5d387206 Mon Sep 17 00:00:00 2001 From: Robert Kubosz Date: Tue, 12 May 2020 03:15:19 +0200 Subject: [PATCH] add artificer to create-character --- dungeonsheets/classes/__init__.py | 5 +- dungeonsheets/classes/artificer.py | 82 +++- dungeonsheets/features/__init__.py | 1 + dungeonsheets/features/artificer.py | 575 +++++++++++++++++++++------- 4 files changed, 520 insertions(+), 143 deletions(-) diff --git a/dungeonsheets/classes/__init__.py b/dungeonsheets/classes/__init__.py index c332595..56b5219 100644 --- a/dungeonsheets/classes/__init__.py +++ b/dungeonsheets/classes/__init__.py @@ -1,7 +1,8 @@ -__all__ = ('CharClass', 'Barbarian', 'Bard', 'Cleric', 'Druid', 'Fighter', +__all__ = ('CharClass', 'Artificer', 'Barbarian', 'Bard', 'Cleric', 'Druid', 'Fighter', 'Monk', 'Paladin', 'Ranger', 'Rogue', 'Sorceror', 'Warlock', 'Wizard', 'RevisedRanger', 'available_classes') +from dungeonsheets.classes.artificer import Artificer from dungeonsheets.classes.barbarian import Barbarian from dungeonsheets.classes.bard import Bard from dungeonsheets.classes.classes import CharClass @@ -16,5 +17,5 @@ from dungeonsheets.classes.sorceror import Sorceror from dungeonsheets.classes.warlock import Warlock from dungeonsheets.classes.wizard import Wizard -available_classes = [Barbarian, Bard, Cleric, Druid, Fighter, Monk, Paladin, +available_classes = [Artificer, Barbarian, Bard, Cleric, Druid, Fighter, Monk, Paladin, Ranger, Rogue, Sorceror, Warlock, Wizard, RevisedRanger] diff --git a/dungeonsheets/classes/artificer.py b/dungeonsheets/classes/artificer.py index 654fb39..e6103e0 100644 --- a/dungeonsheets/classes/artificer.py +++ b/dungeonsheets/classes/artificer.py @@ -1,40 +1,97 @@ from collections import defaultdict -from dungeonsheets import exceptions, features, monsters, weapons +from dungeonsheets import features, weapons from dungeonsheets.classes.classes import CharClass, SubClass -from dungeonsheets.stats import findattr +# Eberron Rising from the Last War class Alchemist(SubClass): """An Alchemist is an expert at combining reagents to produce mystical effects. Alchemists use their creations to give life and to leech it away. - Alchemy is the oldest of ar­tificer traditions, and its versatility has + Alchemy is the oldest of artificer traditions, and its versatility has long been valued during times of war and peace. """ name = "Alchemist" features_by_level = defaultdict(list) - features_by_level[3] = [features.ToolProficiency] + features_by_level[3] = [features.AlchemistToolProficiency, + features.AlchemistSpells, + features.ExperimentalElixir] features_by_level[5] = [features.AlchemicalSavant] features_by_level[9] = [features.RestorativeReagents] features_by_level[15] = [features.ChemicalMastery] +class Artillerist(SubClass): + """An Artillerist specializes in using magic to hurl energy, projectiles, + and explosions on a battlefield. This destructive power was valued by all + the armies of the Last War. Now that the war is over, some members of this + specialization have sought to build a more peaceful world by using their + powers to fight the resurgence of strife in Khorvaire. The gnome artificer + Vi, an unlikely yet key member of House Cannith's warforged project, has + been especially vocal about making things right: "It's about time we fixed + things instead of blowing them all to hell." + """ + + name = "Artillerist" + features_by_level = defaultdict(list) + features_by_level[3] = [features.ArtilleristSpells, + features.ArtilleristToolProficiency, + features.EldritchCannon] + features_by_level[5] = [features.ArcaneFirearm] + features_by_level[9] = [features.ExplosiveCannon] + features_by_level[15] = [features.FortifiedPosition] + + +class BattleSmith(SubClass): + """Armies require protection, and someone has to put things back together + if defenses fail. A combination of protector and medic, a Battle Smith is + an expert at defending others and repairing both material and personnel. + To aid in their work, Battle Smiths are usually accompanied by a steel + defender, a protective compan­ion of their own creation. Many soldiers tell + stories of nearly dying before being saved by a Battle Smith and a steel + defender. + + Battle Smiths played a key role in House Cannith's work on battle + constructs and the original warforged, and after the Last War, these + artificers led efforts to aid those who were injured in the war's horrific + battles. + """ + + name = "Battle Smith" + features_by_level = defaultdict(list) + features_by_level[3] = [features.BattleSmithSpells, + features.BattleSmithToolProficiency, + features.BattleReady, + features.SteelDefender] + features_by_level[5] = [features.ExtraAttackBattleSmith] + features_by_level[9] = [features.ArcaneJolt] + features_by_level[15] = [features.ImprovedDefender] + + class Artificer(CharClass): name = "Artificer" hit_dice_faces = 8 subclass_select_level = 3 + subclasses_available = (Alchemist, Artillerist, BattleSmith) saving_throw_proficiencies = ('intelligence', 'constitution') primary_abilities = ('intelligence',) _proficiencies_text = ( 'Light armor', 'Medium armor', 'Shields', 'Simple weapons', - 'Thieve\'s tools', 'Tinker\'s tools', - 'One type of artisan\'s tools of your choice') - weapon_proficiencies = (weapon.SimpleWeapon) - class_skill_choices = ('Arcana', 'History', 'Investigation', 'Medicine', - 'Nature', 'Perception', 'Sleight of Hand') + "Thieve's tools", "Tinker's tools", + "One type of artisan's tools of your choice") + _multiclass_proficiencies_text = ( + "Light armor", "Medium armor", "Shields", + "Thieve's tools", "Tinker's tools") + weapon_proficiencies = (weapons.SimpleWeapon,) + class_skill_choices = ( + 'Arcana', 'History', 'Investigation', + 'Medicine', 'Nature', 'Perception', 'Sleight of Hand') features_by_level = defaultdict(list) - features_by_level[1] = [features.MagicalTinkering] + features_by_level[1] = [features.MagicalTinkering, + features.FirearmProficiency, + features.ArtificerSpellcasting, + features.ArtificerRitualCasting] features_by_level[2] = [features.InfuseItem] features_by_level[3] = [features.TheRightToolForTheJob] features_by_level[6] = [features.ToolExpertise] @@ -44,7 +101,6 @@ class Artificer(CharClass): features_by_level[14] = [features.MagicItemSavant] features_by_level[18] = [features.MagicItemMaster] features_by_level[20] = [features.SoulOfArtifice] - subclasses_available = (Alchemist, Artillerist, BattleSmith) spellcasting_ability = 'intelligence' spell_slots_by_level = { 1: (2, 2, 0, 0, 0, 0, 0, 0, 0, 0), @@ -66,5 +122,5 @@ class Artificer(CharClass): 17: (4, 4, 3, 3, 3, 1, 0, 0, 0, 0), 18: (4, 4, 3, 3, 3, 1, 0, 0, 0, 0), 19: (4, 4, 3, 3, 3, 2, 0, 0, 0, 0), - 20: (4, 4, 3, 3, 3, 2, 0, 0, 0, 0), - + 20: (4, 4, 3, 3, 3, 2, 0, 0, 0, 0) + } diff --git a/dungeonsheets/features/__init__.py b/dungeonsheets/features/__init__.py index 77c0250..5df8be3 100644 --- a/dungeonsheets/features/__init__.py +++ b/dungeonsheets/features/__init__.py @@ -1,3 +1,4 @@ +from dungeonsheets.features.artificer import * from dungeonsheets.features.backgrounds import * from dungeonsheets.features.barbarian import * from dungeonsheets.features.bard import * diff --git a/dungeonsheets/features/artificer.py b/dungeonsheets/features/artificer.py index 25ecb7f..09a36ad 100644 --- a/dungeonsheets/features/artificer.py +++ b/dungeonsheets/features/artificer.py @@ -1,21 +1,21 @@ from dungeonsheets import spells -from dungeonsheets.features.features import Feature, FeatureSelector +from dungeonsheets.features.features import Feature class _SpecialistSpells(Feature): """Starting at 3rd level, you always have certain spells pre­pared after - you reach particular levels in this class, as shown in the Specializatin + you reach particular levels in this class, as shown in the Specialization Spells table. These spells count as artificer spells for you, but they don't count against the number of artificer spells you prepare. """ _name = "Select One" source = "Artificer" _spells = { - 3: [], - 5: [], - 9: [], - 13: [], - 17: [] + 3: [spells.HealingWord, spells.RayOfSickness], + 5: [spells.FlamingSphere, spells.MelfsAcidArrow], + 9: [spells.GaseousForm, spells.MassHealingWord], + 13: [spells.Blight, spells.DeathWard], + 17: [spells.Cloudkill, spells.RaiseDead] } spells_known = [] spells_prepared = [] @@ -31,58 +31,39 @@ class _SpecialistSpells(Feature): if level >= lvl: self.spells_known.extend(spl) self.spells_prepared.extend(spl) - super().__init__.(owner=owner) + super().__init__(owner=owner) -class AlchemistSpells(_SpecialistSpells): - """Starting at 3rd level, you always have certain spells pre­pared after - you reach particular levels in this class, as shown in the Alchemist Spells - table. These spells count as artificer spells for you, but they don't count - against the number of artificer spells you prepare. +# Alchemist +class ArtificerSpellcasting(Feature): + """You have studied the workings of magic and how to channel it through + objects. As a result, you have gained the ability to cast spells. To + observers, you don't appear to be casting spells in a conventional way; you + look as if you're producing wonders using mundane items or out­landish + inventions. + + **Tools Required** You produce your artificer spell effects through your + tools. You must have a spellcasting focus-specifically thieves' tools or + some kind of artisan's tool-in hand when you cast any spell with this + Spellcasting feature. You must be proficient with the tool to use it in + this way. See chapter 5, "Equipment," in the Player's Handbook for + descriptions of these tools. + + After you gain the Infuse Item feature at 2nd level, you can also use any + item bearing one of your infusions as a spellcasting focus. """ - _name = "Alchemist" - _spells = { - 3: [spells.HealingWord, spells.RayOfSickness], - 5: [spells.FlamingSphere, spells.MelfsAcidArrow], - 9: [spells.GaseousForm, spells.MassHealingWord], - 13: [spells.Blight, spells.DeathWard], - 17: [spells.Cloudkill, spells.RaiseDead] - } + name = "Spellcasting" + source = "Artificer" -class ArtilleristSpells(_SpecialistSpells): - """Starting at 3rd level, you always have certain spells prepared after - you reach particular levels in this class, as shown in the Artillerist - Spells table. These spells count as artificer spells for you, but they - don't count against the number of artificer spells you prepare. +class ArtificerRitualCasting(Feature): + """You can cast an artificer spell as a ritual if that spell has the ritual + tag and you have the spell prepared. """ - _name = "Artillerist" - _spells = { - 3: [spells.Shield, spells.Thunderwave], - 5: [spells.ScorchingRay, spells.Shatter], - 9: [spells.Fireball, spells.WindWall], - 13: [spells.IceStorm, spells.WallOfFire], - 17: [spells.ConeOfCold, spells.WallOfForce] - } - - -class BattleSmithSpells(_SpecialistSpells): - """Starting at 3rd level, you always have certain spells prepared after you - reach particular levels in this class, as shown in the Battle Smith Spells - table. These spells count as artificer spells for you, but they don't count - against the number of artificer spells you prepare. - """ - - _name = "Battle Smith" - _spells = { - 3: [spells.Heroism, spells.Shield], - 5: [spells.BrandingSmite, spells.WardingBond], - 9: [spells.AuraOfVitality, spells.ConjureBarrage], - 13: [spells.AuraOfPurity, spells.FireShield], - 17: [spells.BanishingSmite, spells.MassCureWounds] - } + name = "Ritual Casting" + source = "Artificer" class FirearmProficiency(Feature): @@ -97,78 +78,24 @@ class FirearmProficiency(Feature): source = "Artificer" -class ToolProficiency(Feature): - """At 3rd level, you choose the type of specialist you are: Alchemist, - Artillerist, or Battle Smith, each of which is detailed at the end of the - class's description. Your choice grants you features at 5th level and again - at 9th and 15th level. - """ - - name = "Tool Proficiency" - source = "Artificer (Alchemist)" - - -class AlchemicalSavant(Feature): - """At 5th level, you develop masterful command of magical chemicals, - enhancing the healing and damage you create through them. Whenever you - cast a spell using your alchemist's supplies as the spellcasting focus, you - gain a bonus to one roll of the spell. That roll must restore hit points or - be a damage roll that deals acid, fire, necrotic, or poison damage, and the - bonus equals your Intelli­gence modifier (minimum of +1). - """ - - name = "Alchemical Savant" - source = "Artificer (Alchemist)" - - -class RestorativeReagents(Feature): - """Starting at 9th level, you can incorporate - restorative reagents into some of your works: - - Whenever a creature drinks an experimental elixir you created, the - creature gains temporary hit points equal to 2d6 + your Intelligence - modifier (minimum of 1 temporary hit point). - - You can cast lesser restoration without expending a spell slot and - without preparing the spell, provided you use alchemist's supplies as the - spellcasting focus. You can do so a number of times equal to your - Intelligence modifier (minimum of once), and you regain all expended uses - when you finish a long rest. - """ - - name = "Restorative Reagents" - source = "Artificer (Alchemist)" - - -class ChemicalMastery(Feature): - """By 15th level, you have been exposed to so many chemicals that they - pose little risk to you, and you can use them to quickly end certain - ailments: - - You gain resistance to acid damage and poison damage, and you are immune - to the poisoned condition. - - You can cast greater restoration and heal without expending a spell - slot, without preparing the spell, and without material components, - provided you use alchemist's supplies as the spellcasting focus. Once - you cast either spell with this feature, you can't cast that spell with - it again until you finish a long rest. - """ - - name = "Chemical Mastery" - source = "Artificer (Alchemist)" - - class MagicalTinkering(Feature): """At 1st level, you learn how to invest a spark of magic into mundane objects. To use this ability, you must have tinker's tools or other artisan's tools in hand. You then touch a Tiny nonmagical object as an action and give it one of the following magical properties of your choice: + - The object sheds bright light in a 5-foot radius and dim light for an additional 5 fe et. + - Whenever tapped by a creature, the object emits a recorded message that can be heard up to 10 feet away. You utter the message when you bestow this property on the object, and the recording can be no more than 6 seconds long. + - The object continuously emits your choice of an odor or a nonverbal sound (wind, waves, chirping, or the like). The chosen phenomenon is perceivable up to 10 feet away. + - A static visual effect appears on one of the object's surfaces. This effect can be a picture, up to 25 words of text, lines and shapes, or a mixture of these elements, as you like. The chosen property lasts @@ -179,10 +106,10 @@ class MagicalTinkering(Feature): this feature at one time is equal to your Intelligence modifier (minimum of one object). If you try to exceed your maximum, the oldest property immediately ends, and then the new property applies. - """ + """ - name = "Magical Tinkering" - source = "Artificer" + name = "Magical Tinkering" + source = "Artificer" class InfuseItem(Feature): @@ -190,7 +117,7 @@ class InfuseItem(Feature): magical infusions. The magic items you create with this feature are effectively prototypes of permanent items. - INFUSIONS KNOWN + **Infusions known** When you gain this feature, pick four artificer infusions to learn, choosing from the "Artificer Infusions" section at the end of the class's description. You learn additional infusions of your choice when you @@ -198,7 +125,7 @@ class InfuseItem(Feature): of the Artificer table. Whenever you gain a level in this class, you can re­place one of the artificer infusions you learned with a new one. - INFUSING AN ITEM + **Infusing an item** Whenever you finish a long rest, you can touch a non­magical object and imbue it with one of your artificer in­fusions, turning it into a magic item. An infusion works on only certain kinds of objects, as specified in @@ -245,23 +172,32 @@ class InfuseItem(Feature): 20: (12, 6), } - @property def name(self): known_infusions = self._infusions[self.owner.Artificer.level][0] infused_items = self._infusions[self.owner.Artificer.level][1] - return self._name + " ({:d} Infusions Known, {:d} Infused Items".format( + return self._name + " ({:d} Infusions Known, {:d} Infused Items)".format( known_infusions, infused_items) +class ArtificerSpecialist(Feature): + """At 3rd level, you choose the type of specialist you are: Alchemist, + Artillerist, or Battle Smith, each of which is detailed at the end of the + class's description. Your choice grants you features at 5th level and again + at 9th and 15th level. + """ + + name = "Artificer Specialist" + source = "Artificer" + class TheRightToolForTheJob(Feature): """At 3rd level, you learn how to produce exactly the tool you need: with tinker's tools in hand, you can magically create one set of artisan's tools - in an unoccupied space within 5 feet of you. This creation requires 1 - hour of uninterrupted work, which can coincide with a short or long rest. + in an unoccupied space within 5 feet of you. This creation requires 1 hour + of uninterrupted work, which can coincide with a short or long rest. Though the product of magic, the tools are nonmagical, and they vanish when - you use this fea­ture again. + you use this feature again. """ name = "The Right Tool For The Job" @@ -281,9 +217,11 @@ class FlashOfGenius(Feature): """Starting at 7th level, you gain the ability to come up with solutions under pressure. When you or another creature you can see within 30 feet of you makes an ability check or a saving throw, you can use your reaction to - add your Intelligence modifier to the roll. You can use this feature a - number of times equal to your Intelligence modifier (minimum of once). You - re­gain all expended uses when you finish a long rest. + add your Intelligence modifier to the roll. + + You can use this feature a number of times equal to your Intelligence + modifier (minimum of once). You regain all expended uses when you finish a + long rest. """ name = "Flash Of Genius" @@ -293,21 +231,23 @@ class FlashOfGenius(Feature): class MagicItemAdept(Feature): """When you reach 10th level, you achieve a profound un­derstanding of how to use and make magic items: + - You can attune to up to four magic items at once. + - If you craft a magic item with a rarity of common or uncommon, it takes you a quarter of the normal time, and it costs you half as much of the usual gold. - """ + """ - name = "Magic Item Adept" - source = "Artificer" + name = "Magic Item Adept" + source = "Artificer" class SpellStoringItem(Feature): """At 11th level, you learn how to store a spell in an object. Whenever you finish a long rest, you can touch one simple or martial weapon or one item that you can use as a spellcasting focus, and you store a spell in it, - choosing a 1st- or 2nd-level spell from the artificer spell list that + choosing a 1st- or 2nd-level spell from the artificer spell list that requires 1 action to cast (you needn't have it prepared). While holding the object, a creature can take an action to produce the @@ -324,7 +264,9 @@ class SpellStoringItem(Feature): class MagicItemSavant(Feature): """At 14th level, your skill with magic items deepens more: + - You can attune to up to five magic items at once. + - You ignore all class, race, spell, and level require­ments on attuning to or using a magic item. """ @@ -345,12 +287,389 @@ class MagicItemMaster(Feature): class SoulOfArtifice(Feature): """At 20th level, you develop a mystical connection to your magic items, which you can draw on for protection: + - You gain a +1 bonus to all saving throws per magic item you are currently attuned to. + - If you're reduced to 0 hit points but not killed out­right, you can use your reaction to end one of your artificer infusions, causing you to drop - to 1 hit point instead of 0. + to 1 hit point instead of 0. """ - name = "Soul Of Artifice" + name = "Soul of Artifice" source = "Artificer" + + +# Alchemist +class AlchemistToolProficiency(Feature): + """When you adopt this specialization at 3rd level, you gain proficiency + with alchemist's supplies. If you already have this proficiency, you gain + proficiency with one other type of artisan's tools of your choice. + """ + + name = "Tool Proficiency" + source = "Artificer (Alchemist)" + + +class AlchemistSpells(_SpecialistSpells): + """Starting at 3rd level, you always have certain spells pre­pared after + you reach particular levels in this class, as shown in the Alchemist Spells + table. These spells count as artificer spells for you, but they don't count + against the number of artificer spells you prepare. + """ + + _name = "Alchemist" + _spells = { + 3: [spells.HealingWord, spells.RayOfSickness], + 5: [spells.FlamingSphere, spells.MelfsAcidArrow], + 9: [spells.GaseousForm, spells.MassHealingWord], + 13: [spells.Blight, spells.DeathWard], + 17: [spells.Cloudkill, spells.RaiseDead] + } + + +class ExperimentalElixir(Feature): + """Beginning at 3rd level, whenever you finish a long rest, you can + magically produce an *experimental elixir* in an empty flask you touch. + Roll on the Experimental Elixir table for the elixir's effect, which is + triggered when someone drinks the elixir. As an action, a creature can + drink the elixir or administer it to an incapacitated creature. + + Creating an *experimental elixir* requires you to have alchemist supplies + on your person, and any elixir you create with this feature lasts until it + is drunk or until the end of your next long rest. + + When you reach certain levels in this class, you can make more elixirs at + the end of a long rest: two at 6th level and three at 15th level. Roll for + each elixir's effect separately. Each elixir requires its own flask. + + You can create additional *experimental elixirs* by expending a spell slot + of 1st level or higher for each one. When you do so, you use your action to + create the elixir in an empty flask you touch, and you choose the elixir's + effect from the Experimental Elixir table. + + **Experimental Elixir** + + roll d6 + + **1 -- Healing.** The drinker regains a number of hit points equal to 2d4 + + your Intelligence modifier. + + **2 -- Swiftness.** The drinker's walking speed increases by 10 feet for 1 + hour. + + **3 -- Resilience.** The drinker gains a +1 bonus to AC for 10 minutes. + + **4 -- Boldness.** The drinker can roll a d4 and add the num­ber rolled to + every attack roll and saving throw they make for the next minute. + + **5 -- Flight.** The drinker gains a flying speed of 10 feet for 10 + minutes. + + **6 -- Transformation.** The drinker's body is transformed as if by the + alter self spell. The drinker determines the transformation caused by the + spell, the effects of which last for 10 minutes. + """ + + name = "Experimental Elixir" + source = "Artificer (Alchemist)" + + +class AlchemicalSavant(Feature): + """At 5th level, you develop masterful command of magical chemicals, + enhancing the healing and damage you create through them. Whenever you + cast a spell using your alchemist's supplies as the spellcasting focus, you + gain a bonus to one roll of the spell. That roll must restore hit points or + be a damage roll that deals acid, fire, necrotic, or poison damage, and the + bonus equals your Intelli­gence modifier (minimum of +1). + """ + + name = "Alchemical Savant" + source = "Artificer (Alchemist)" + + +class RestorativeReagents(Feature): + """Starting at 9th level, you can incorporate + restorative reagents into some of your works: + + - Whenever a creature drinks an experimental elixir you created, the + creature gains temporary hit points equal to 2d6 + your Intelligence + modifier (minimum of 1 temporary hit point). + + - You can cast lesser restoration without expending a spell slot and + without preparing the spell, provided you use alchemist's supplies as the + spellcasting focus. You can do so a number of times equal to your + Intelligence modifier (minimum of once), and you regain all expended uses + when you finish a long rest. + """ + + name = "Restorative Reagents" + source = "Artificer (Alchemist)" + + +class ChemicalMastery(Feature): + """By 15th level, you have been exposed to so many chemicals that they + pose little risk to you, and you can use them to quickly end certain + ailments: + + - You gain resistance to acid damage and poison damage, and you are immune + to the poisoned condition. + + - You can cast greater restoration and heal without expending a spell + slot, without preparing the spell, and without material components, + provided you use alchemist's supplies as the spellcasting focus. Once + you cast either spell with this feature, you can't cast that spell with + it again until you finish a long rest. + """ + + name = "Chemical Mastery" + source = "Artificer (Alchemist)" + + +# Artillerist +class ArtilleristSpells(_SpecialistSpells): + """Starting at 3rd level, you always have certain spells prepared after + you reach particular levels in this class, as shown in the Artillerist + Spells table. These spells count as artificer spells for you, but they + don't count against the number of artificer spells you prepare. + """ + + _name = "Artillerist" + _spells = { + 3: [spells.Shield, spells.Thunderwave], + 5: [spells.ScorchingRay, spells.Shatter], + 9: [spells.Fireball, spells.WindWall], + 13: [spells.IceStorm, spells.WallOfFire], + 17: [spells.ConeOfCold, spells.WallOfForce] + } + + +class ArtilleristToolProficiency(Feature): + """When you adopt this specialization at 3rd level, you gain proficiency + with woodcarver's tools. If you already have this proficiency, you gain + proficiency with one other type of artisan's tools of your choice. + """ + + name = "Tool Proficiency" + source = "Artificer (Artillerist)" + + +class EldritchCannon(Feature): + """At 3rd level, you learn how to create a magical cannon. Using + woodcarver's tools or smith's tools, you can take an action to magically + create a Small or Tiny eldritch cannon in an unoccupied space on a + horizontal surface within 5 feet of you. A Small eldritch cannon occupies + its space, and a Tiny one can be held in one hand. + + Once you create a cannon, you can't do so again until you finish a long + rest or until you expend a spell slot of 1st level or higher. You can have + only one cannon at a time and can't create one while your cannon is + present. + + The cannon is a magical object. Regardless of size, the cannon has an AC of + 18 and a number of hit points equal to five times your artificer level. It + is immune to poison damage, psychic damage, and all conditions. If it is + forced to make an ability check or a saving throw, treat all its ability + scores as 10 (+O). If the *mending* spell is cast on it, it regains 2d6 hit + points. It disappears if it is reduced to 0 hit points or after 1 hour. You + can dismiss it early as an action. + + When you create the cannon, you determine its appearance and whether it + has legs. You also decide which type it is, choosing from the options on + the Eldritch Cannons table. On each of your turns, you can take a bonus + action to cause the cannon to activate if you are within 60 feet of it. As + part of the same bonus action, you can direct the cannon to walk or climb + up to 15 feet to an unoccupied space, provided it has legs. + + **Eldritch Cannons** + + *Flamethrower*: The cannon exhales fire in an adjacent 15-foot cone that + you designate. Each creature in that area must make a Dexterity saving + throw against your spell save DC, taking 2d8 fire damage on a failed save + or half as much damage on a successful one. The fire ignites any flammable + objects in the area that aren't being worn or carried. + + *Force Ballista*: Make a ranged spell attack, originating from the cannon, + at one creature or object within 120 feet of it. On a hit, the target takes + 2d8 force damage, and if the target is a creature, it is pushed up to 5 + feet away from the cannon. + + *Protector*: The cannon emits a burst of positive energy + that grants itself and each creature of your choice within 10 feet of it a + number of temporary hit points equal to 1d8 + your Intelligence modifier + (minimum of +1) + """ + + name = "Eldritch Cannon" + source = "Artificer (Artillerist)" + + +class ArcaneFirearm(Feature): + """At 5th level, you know how to turn a wand, staff, or rod into an arcane + firearm, a conduit for your destructive spells. When you finish a long + rest, you can use wood­carver's tools to carve special sigils into a wand, + staff, or rod and thereby turn it into your arcane firearm. The sigils + disappear from the object if you later carve them on a different item. The + sigils otherwise last indefinitely. + + You can use your arcane firearm as a spellcasting focus for your artificer + spells. When you cast an artificer spell through the firearm, roll a d8, + and you gain a bonus to one of the spell's damage rolls equal to the + number rolled. + """ + + name = "Arcane Firearm" + source = "Artificer (Artillerist)" + + +class ExplosiveCannon(Feature): + """Starting at 9th level, every eldritch cannon you create is more + destructive: + + - The cannon's damage rolls all increase by 1d8. + + - As an action, you can command the cannon to detonate if you are within 60 + feet of it. Doing so destroys the cannon and forces each creature within + 20 feet of it to make a Dexterity saving throw against your spell save + DC, taking 3d8 force damage on a failed save or half as much damage on a + successful one. + """ + + name = "Explosive Cannon" + source = "Artificer (Artillerist)" + + +class FortifiedPosition(Feature): + """Starting at 15th level, you're a master at forming well-defended + emplacements using Eldritch Cannon: + + - You and your allies have half cover while within 10 feet of a cannon you + create with Eldritch Cannon, as a result of a shimmering field of magical + protection that the cannon emits. + + - You can now have two cannons at the same time. You can create two with + the same action (but not the same spell slot), and you can activate both + of them with the same bonus action. You determine whether the cannons are + identical to each other or different. You can't create a third cannon + while you have two. + """ + + name = "Fortified Position" + source = "Artificer (Artillerist)" + + +# Battle Smith +class BattleSmithSpells(_SpecialistSpells): + """Starting at 3rd level, you always have certain spells prepared after you + reach particular levels in this class, as shown in the Battle Smith Spells + table. These spells count as artificer spells for you, but they don't count + against the number of artificer spells you prepare. + """ + + _name = "Battle Smith" + _spells = { + 3: [spells.Heroism, spells.Shield], + 5: [spells.BrandingSmite, spells.WardingBond], + 9: [spells.AuraOfVitality, spells.ConjureBarrage], + 13: [spells.AuraOfPurity, spells.FireShield], + 17: [spells.BanishingSmite, spells.MassCureWounds] + } + + +class BattleSmithToolProficiency(Feature): + """When you adopt this specialization at 3rd level, you gain proficiency + with smith's tools. If you already have this proficiency, you gain + proficiency with one other type of artisan's tools of your choice. + """ + + name = "Tool Proficiency" + source = "Artificer (Battle Smith)" + + +class BattleReady(Feature): + """When you reach 3rd level, your combat training and your experiments with + magic have paid off in two ways: + + - You gain proficiency with martial weapons. + + - When you attack with a magic weapon, you can use your Intelligence + modifier, instead of Strength or Dexterity modifier, for the attack and + damage rolls. + """ + + name = "Battle Ready" + source = "Artificer (Battle Smith)" + + +class SteelDefender(Feature): + """By 3rd level, your tinkering has borne you a faithful companion, a steel + defender. It is friendly to you and your companions, and it obeys your + commands. See this creature's game statistics in the steel defender stat + block. You determine the creature's appearance and whether it has two legs + or fo ur; your choice has no effect on its game statistics. + + In combat, the steel defender shares your initiative count, but it takes + its turn immediately after yours. It can move and use its reaction on its + own, but the only action it takes on its turn is the Dodge action, unless + you take a bonus action on your turn to command it to take one of the + actions in its stat block or the Dash, Disen­gage, Help, Hide, or Search + action. + + If the *mending* spell is cast on it, it regains 2d6 hit points. If it has + died within the last hour, you can use your smith's tools as an action to + revive it, provided you are within 5 feet of it and you expend a spell slot + of 1st level or higher. The steel defender returns to life after 1 minute + with all its hit points restored. + + At the end of a long rest, you can create a new steel defender if you have + your smith's tools with you. If you already have a steel defender from this + feature, the first one immediately perishes. + """ + + name = "Steel Defender" + source = "Artificer (Battle Smith)" + + +class ExtraAttackBattleSmith(Feature): + """Starting at 5th level, you can attack twice, rather than once, whenever + you take the Attack action on your turn. + """ + + name = "Extra Attack" + source = "Artificer (Battle Smith)" + + +class ArcaneJolt(Feature): + """At 9th level, you learn new ways to channel arcane en­ergy to harm or + heal. When either you hit a target with a magic weapon attack or your steel + defender hits a target, you can channel magical energy through the strike + to create one of the following effects: + + - The target takes an extra 2d6 force damage. + + - Choose one creature or object you can see within 30 feet of the target. + Healing energy flows into the chosen recipient, restoring 2d6 hit points + to it. You can use this energy a number of times equal to your + Intelligence modifier (minimum of once), but you can do so no more than + once on a turn. You regain all expended uses when you finish a long rest + """ + + name = "Arcane Jolt" + source = "Artificer (Battle Smith)" + + +class ImprovedDefender(Feature): + """At 15th level, your Arcane jolt and steel defender be­come more + powerful: + + - The extra damage and the healing of your Arcane jolt both increase to + 4d6. + + - Your steel defender gains a +2 bonus to Armor Class. + + - Whenever your steel defender uses its Deflect Attack, the attacker takes + force damage equal to 1d4 +your Intelligence modifier. + """ + + name = "Improved Defender" + source = "Artificer (Battle Smith)"