Allow effect to toggle the zoc

[effect]
	apply_to=zoc
	value=<new value>
[/effect]
This commit is contained in:
Benoît Timbert 2007-03-03 20:51:25 +00:00
parent a481843d64
commit 7ee3b19d34
2 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,7 @@ Version 1.3.1+svn:
* all [store_*] tags get a default variable name
* use complex variable substitution almost everywhere
* new key for [set_variable], literal=, to avoid variable substitution
* [effect] can now toggle the zoc
* Misceleanous bug fixes
* a unit that dies while attacking will now correctly play it's own death
sounds

View File

@ -2571,7 +2571,12 @@ void unit::add_modification(const std::string& type, const config& mod,
if (ap) {
mod_mdr_merge(*mv, *ap, !utils::string_bool(replace));
}
}else if (apply_to == "image_mod") {
} else if (apply_to == "zoc") {
const std::string& zoc_value = (**i.first)["value"];
if(!zoc_value.empty()) {
emit_zoc_ = lexical_cast_default<int>(zoc_value);
}
} else if (apply_to == "image_mod") {
LOG_UT << "applying image_mod \n";
std::string mod = (**i.first)["replace"];
if (!mod.empty()){