From 4618763c0e3a723bf4bb43c7b9edbce87240e0af Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Apr 2021 11:23:27 -0400 Subject: Rebased feature/item on entry --- src/spellcasting.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/spellcasting.h') 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("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 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 spellsBySlot; }; + + std::string genText(const Spellcasting& s, const creature::Creature& c); } -- cgit v1.2.3