aboutsummaryrefslogtreecommitdiff
path: root/src/armor.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-05-09 13:56:46 -0400
committerYour Name <you@example.com>2021-05-09 13:56:46 -0400
commitd13358b71ec15085f2638fd9c3fc634df62dfc94 (patch)
tree467c643a068bf2d83da3632823a6434244ae004e /src/armor.cc
parente3aaa68a2ea1a403256150121c57a0287014162f (diff)
downloaddmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.tar.gz
dmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.tar.bz2
dmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.zip
Reduced dependency on json-related hacks
Diffstat (limited to 'src/armor.cc')
-rw-r--r--src/armor.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/armor.cc b/src/armor.cc
index 85c5bc2..ecf8c1e 100644
--- a/src/armor.cc
+++ b/src/armor.cc
@@ -31,13 +31,13 @@ namespace entry{
}
- string genText(const Armor& a, const creature::Creature& c) {
+ string Armor::getText(const creature::Creature& c) const {
stringstream text;
- text << genText(static_cast<const Item&>(a), c);
+ text << getName() << " (" << getType() << "): ";
int dex = c.getBonus(rules::Ability::Dex());
- string dexBonusLight = " (i.e., " + to_string(a.getACBonus() + dex) + ")";
- string dexBonusMedium = " (i.e., " + to_string(a.getACBonus() + ((dex > 2)? 2 : dex)) + ")";
- text << ": " << getTextHelper(a, dexBonusLight, dexBonusMedium);
+ string dexBonusLight = " (i.e., " + to_string(getACBonus() + dex) + ")";
+ string dexBonusMedium = " (i.e., " + to_string(getACBonus() + ((dex > 2)? 2 : dex)) + ")";
+ text << getTextHelper(*this, dexBonusLight, dexBonusMedium);
return text.str();
}
}