diff options
Diffstat (limited to 'src/spellcasting.h')
-rw-r--r-- | src/spellcasting.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/spellcasting.h b/src/spellcasting.h index f996322..0ea235c 100644 --- a/src/spellcasting.h +++ b/src/spellcasting.h @@ -6,7 +6,7 @@ typedef nlohmann::json json; -namespace feature { +namespace entry { struct SlotLevel : public Jsonable { SlotLevel(const json& data) : numSlots(data["slots"]), spells(jsonList2vec<spell::Spell>("spellcasting", data["spells"])) {} virtual ~SlotLevel() {} @@ -29,11 +29,12 @@ namespace feature { bool isInnate(void) const {return innate;} std::string getAbility(void) const {return ability;} std::vector<SlotLevel> getSpellsBySlot(void) const {return spellsBySlot;} + virtual std::string getText(const creature::Creature& c) const; virtual json toJson(void) const { auto data = Feature::toJson(); data["innate"] = innate; - data["ability"] = ability; + data["spellcasting_ability"] = ability; data["levels"] = spellsBySlot; return data; } @@ -43,4 +44,6 @@ namespace feature { const std::string ability; const std::vector<SlotLevel> spellsBySlot; }; + + std::string genText(const Spellcasting& s, const creature::Creature& c); } |