Introduce enum for item ability magic use type

- The affect party status now also supports removing each status
- Removing the flight status is similar to flight wearing off normally - it can lead to party death if you're on a blocked space, and even if not you'll probably take some damage.
- Streamlined the item constructors a little with constructor delegation
This commit is contained in:
2015-01-27 21:11:06 -05:00
parent 2933f1e2e7
commit ea0fbcffc8
6 changed files with 174 additions and 174 deletions

View File

@@ -1571,7 +1571,7 @@ static void put_item_abils_in_dlog(cDialog& me, cItem& item, short which) {
me["abilname"].setText("No ability");
else me["abilname"].setText(get_str("item-abilities", int(item.ability)));
dynamic_cast<cLedGroup&>(me["use-type"]).setSelected("use" + std::to_string(item.magic_use_type));
dynamic_cast<cLedGroup&>(me["use-type"]).setSelected("use" + std::to_string(int(item.magic_use_type)));
dynamic_cast<cLedGroup&>(me["treasure"]).setSelected("type" + std::to_string(item.treas_class));
me["str1"].setTextToNum(item.abil_data[0]);
me["str2"].setTextToNum(item.abil_data[1]);
@@ -1640,7 +1640,7 @@ static void put_item_abils_in_dlog(cDialog& me, cItem& item, short which) {
}
static void save_item_abils(cDialog& me, cItem& item) {
item.magic_use_type = boost::lexical_cast<short>(dynamic_cast<cLedGroup&>(me["use-type"]).getSelected().substr(3));
item.magic_use_type = boost::lexical_cast<eItemUse>(dynamic_cast<cLedGroup&>(me["use-type"]).getSelected().substr(3));
item.treas_class = boost::lexical_cast<short>(dynamic_cast<cLedGroup&>(me["treasure"]).getSelected().substr(4));
item.abil_data[0] = me["str1"].getTextAsNum();
item.abil_data[1] = me["str2"].getTextAsNum();