aboutsummaryrefslogtreecommitdiff
path: root/src/weapon.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapon.cc')
-rw-r--r--src/weapon.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/weapon.cc b/src/weapon.cc
index fe50eaf..0c4dc29 100644
--- a/src/weapon.cc
+++ b/src/weapon.cc
@@ -25,16 +25,16 @@ namespace entry {
auto dmgs = w.getDamage();
for(size_t i = 0; i < dmgs.size(); i++) {
const Damage& d = dmgs[i];
- text << d.count << "d" << d.sides;
+ text << d.dmg_die_count << "d" << d.dmg_die_sides;
if(i == 0) {
if(w.getProperties().count("versatile")) {
- text << " (or " << d.count << "d" << d.sides + 2 << " if two-handed)";
+ text << " (or " << d.dmg_die_count << "d" << d.dmg_die_sides + 2 << " if two-handed)";
}
text << " + " << damageBonus;
}
- text << " " << d.type << " damage";
+ text << " " << d.dmg_type << " damage";
if(i < dmgs.size()-1) {
- if(d.isOr) {
+ if(d.is_or) {
text << " or ";
} else {
text << " plus ";
@@ -52,7 +52,7 @@ namespace entry {
if(! w.Entry::getText().empty()) {
text << " " << w.Entry::getText();
}
- text << " " << genText(static_cast<const Substantial&>(w));
+ text << " " << w.Substantial::getText();
return text.str();
}
@@ -61,12 +61,12 @@ namespace entry {
bool first = true;
for(Damage& d : dmgs) {
d.rolled = 0;
- int sides = d.sides;
+ int sides = d.dmg_die_sides;
if(first && versatile && w.getProperties().count("versatile")) {
sides += 2;
}
first = false;
- for(int i = 0; i < d.count; i++) {
+ for(int i = 0; i < d.dmg_die_count; i++) {
d.rolled += dice::roll(sides);
}
}
@@ -87,9 +87,9 @@ namespace entry {
} else {
text << dmgsNoVersatile[i].rolled;
}
- text << " " << dmgsNoVersatile[i].type << " damage";
+ text << " " << dmgsNoVersatile[i].dmg_type << " damage";
if(i < dmgsNoVersatile.size()-1) {
- if(dmgsNoVersatile[i].isOr) {
+ if(dmgsNoVersatile[i].is_or) {
text << " or ";
} else {
text << " plus ";
@@ -128,12 +128,12 @@ namespace entry {
}
- string genText(const Weapon& w, const creature::Creature& c) {
+ string Weapon::getText(const creature::Creature& c) const {
stringstream text;
- text << w.getName() << " (" << w.getType() << "): ";
+ text << getName() << " (" << getType() << "): ";
// Determine best ability bonus
- int abilityBonus = c.getBonus(creature::getBestAbility(getAbilityOptions(w), c));
- text << getTextHelper(w, to_string(abilityBonus + c.getProficiency()), to_string(abilityBonus));
+ int abilityBonus = c.getBonus(creature::getBestAbility(getAbilityOptions(*this), c));
+ text << getTextHelper(*this, to_string(abilityBonus + c.getProficiency()), to_string(abilityBonus));
return text.str();
}
}