Implement set_icon attribute for [effect] apply_to=attack modifications

This commit is contained in:
Ignacio R. Morelle 2013-11-13 01:12:13 -03:00
parent 59af0a1cf0
commit 8407eddca4
2 changed files with 7 additions and 0 deletions

View file

@ -175,6 +175,7 @@ Version 1.11.6+dev:
(probably accidentally) in 1.10.
* Overhaul of the game events engine. Fixes some obscure bugs, like #21031,
and grants feature request #18713.
* Added new set_icon attribute for [effect] apply_to=attack.
* Miscellaneous and bug fixes:
* Added -256 and -512 color shifts to FADE_TO_BLACK and FADE_TO_BLACK_HOLD
macros to account for ToD color shifts greater than -31, guaranteeing

View file

@ -176,6 +176,7 @@ bool attack_type::apply_modification(const config& cfg,std::string* description)
const std::string& set_name = cfg["set_name"];
const t_string& set_desc = cfg["set_description"];
const std::string& set_type = cfg["set_type"];
const std::string& set_icon = cfg["set_icon"];
const std::string& del_specials = cfg["remove_specials"];
const config &set_specials = cfg.child("set_specials");
const std::string& increase_damage = cfg["increase_damage"];
@ -202,6 +203,11 @@ bool attack_type::apply_modification(const config& cfg,std::string* description)
cfg_["type"] = type_;
}
if(set_icon.empty() == false) {
icon_ = set_icon;
cfg_["icon"] = icon_;
}
if(del_specials.empty() == false) {
const std::vector<std::string>& dsl = utils::split(del_specials);
if (config &specials = cfg_.child("specials"))