diff options
author | Your Name <you@example.com> | 2021-05-18 16:26:49 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-05-18 16:26:49 -0400 |
commit | 38e33d8756a5b652965be8ada478b5c4238b857c (patch) | |
tree | d4e3b166103c4c0cc8d3a4ed963333a2982bb366 /src/creature.cc | |
parent | e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd (diff) | |
download | dmtool-38e33d8756a5b652965be8ada478b5c4238b857c.tar.gz dmtool-38e33d8756a5b652965be8ada478b5c4238b857c.tar.bz2 dmtool-38e33d8756a5b652965be8ada478b5c4238b857c.zip |
Added spellcasting command
Diffstat (limited to 'src/creature.cc')
-rw-r--r-- | src/creature.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/creature.cc b/src/creature.cc index 9366bac..7060c10 100644 --- a/src/creature.cc +++ b/src/creature.cc @@ -80,6 +80,14 @@ namespace creature { inventory.push_back(item); } + void Creature::addSpellcasting() { + if(getSpellcasting()) { + throw runtime_error("Creature " + getName() + " already has spellcasting"); + } + std::shared_ptr<entry::Feature> sc(new entry::Spellcasting()); + features.push_back(sc); + } + shared_ptr<entry::Spellcasting> Creature::getSpellcasting() const { for(auto f : getFeatures()) { if(f->getType() == "spells") { |