aboutsummaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-06-12 15:32:53 -0400
committerYour Name <you@example.com>2021-06-12 15:32:53 -0400
commit01293baa64fa905c5763020bd6c0b4903d41fc78 (patch)
tree4c49a63852fd84ead388a8fd092d64d2df7f9e1b /src/item.cc
parentb27700a7e0b281ece3dea23060c17e0cae28715d (diff)
downloaddmtool-01293baa64fa905c5763020bd6c0b4903d41fc78.tar.gz
dmtool-01293baa64fa905c5763020bd6c0b4903d41fc78.tar.bz2
dmtool-01293baa64fa905c5763020bd6c0b4903d41fc78.zip
Verified some creature attacks
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/item.cc b/src/item.cc
index 3bb9895..5ecdb0c 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -11,8 +11,12 @@ using namespace std;
namespace entry {
shared_ptr<Item> Item::create(const nlohmann::json& data) {
- if(data["type"] == "weapons") {
- return utils::loadDFromJson<Item, Weapon>(data);
+ if(data["type"] == "weapons" || data["type"] == "spell attack") {
+ auto w = utils::loadDFromJson<Item, Weapon>(data);
+ if(! data["text"].empty()) {
+ w->Entry::setText(data["text"]);
+ }
+ return w;
} else if(data["type"] == "armor") {
return utils::loadDFromJson<Item, Armor>(data);
}