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/creature.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/creature.cc') diff --git a/src/creature.cc b/src/creature.cc index 3587ab0..13b54d3 100644 --- a/src/creature.cc +++ b/src/creature.cc @@ -13,7 +13,7 @@ using namespace std; namespace creature { Creature::Creature(const json& data) - : inventory(json2ptrvec(data["inventory"])), creatureName(data["name"]), size(data["size"]), type(data["type"]), alignment(data["alignment"]), hdCount(data["hit_die_count"]), hdSides(data["hit_die_sides"]), speed(data["speed"]), stats(data["stats"]), skills(data["skills"]), saves(data["saves"]), langs(data["langs"]), cr(data["cr"]), proficiency(data["prof"]), dmgImmunities(json2vec(data["d_immunities"])), dmgResistances(json2vec(data["d_resistances"])), dmgVulnerabilities(json2vec(data["d_vulnerabilities"])), condImmunities(json2vec(data["c_immunities"])), features(json2ptrvec(data["features"])) + : inventory(json2ptrvec(data["inventory"])), creatureName(data["name"]), size(data["size"]), type(data["type"]), alignment(data["alignment"]), hdCount(data["hit_die_count"]), hdSides(data["hit_die_sides"]), speed(data["speed"]), stats(data["stats"]), skills(data["skills"]), saves(data["saves"]), langs(data["langs"]), cr(data["cr"]), proficiency(data["prof"]), dmgImmunities(json2vec(data["d_immunities"])), dmgResistances(json2vec(data["d_resistances"])), dmgVulnerabilities(json2vec(data["d_vulnerabilities"])), condImmunities(json2vec(data["c_immunities"])), features(json2ptrvec(data["features"])) { // Initialize names and hp if(((map) data).contains("givenName")) { @@ -109,7 +109,7 @@ namespace creature { return bonus; } - void Creature::addInventoryItem(shared_ptr item) { + void Creature::addInventoryItem(shared_ptr item) { inventory.push_back(item); } @@ -141,7 +141,7 @@ namespace creature { const int getAC(const Creature& c) { int baseBonus = 10 + c.getBonus("dex"); int miscBonus = 0; - for(auto a : getItems(c)) { + for(auto a : getItems(c)) { if(c.getScore("str") < a->getStrRequirement()) { continue; } -- cgit v1.2.3