From d13358b71ec15085f2638fd9c3fc634df62dfc94 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 May 2021 13:56:46 -0400 Subject: Reduced dependency on json-related hacks --- src/armor.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/armor.cc') 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(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(); } } -- cgit v1.2.3