Remove some old backward compatibility

This commit is contained in:
Benoît Timbert 2007-04-28 09:15:10 +00:00
parent e34f4aabe9
commit 40c5035fd0

View File

@ -186,87 +186,6 @@ bool attack_type::apply_modification(const config& cfg,std::string* description)
} }
} }
// v1.2 backward compatibility (should be removed in a few v1.3.x releases
const std::string& set_special = cfg["set_special"];
if(set_special.empty() == false) {
lg::wml_error << "[effect] uses set_special=" << set_special <<", which is now deprecated. Use [set_specials] instead. Support will be removed in version 1.3.3\n";
cfg_.clear_children("specials");
config new_specials;
if(set_special == "berserk") {
config& sp = new_specials.add_child("berserk");
sp["name"] = t_string("berserk","wesnoth");
sp["description"] = t_string("Berserk:\nWhether used offensively or defensively, this attack presses the engagement until one of the combatants is slain, or 30 rounds of attacks have occurred.","wesnoth");
sp["value"] = "30";
sp["id"] = "berserk";
} else if(set_special == "backstab") {
config& sp = new_specials.add_child("damage");
sp["name"] = t_string("backstab","wesnoth");
sp["description"] = t_string("Backstab:\nThis attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (e.g. turned to stone).","wesnoth");
sp["backstab"] = "yes";
sp["multiply"] = "2";
sp["active_on"] = "offense";
sp["id"] = "backstab";
} else if(set_special == "plague") {
config& sp = new_specials.add_child("plague");
sp["name"] = t_string("plague","wesnoth");
sp["description"] = t_string("Plague:\nWhen a unit is killed by a Plague attack, that unit is replaced with a unit identical to and on the same side as the unit with the Plague attack. (This doesn't work on Undead or units in villages.)","wesnoth");
} else if(set_special.substr(0,7) == "plague(") {
config& sp = new_specials.add_child("plague");
sp["name"] = t_string("plague","wesnoth") + set_special.substr(6);
sp["description"] = t_string("Plague:\nWhen a unit is killed by a Plague attack, that unit is replaced with a unit of the specified type on the same side as the unit with the Plague attack. (This doesn't work on Undead or units in villages.)","wesnoth");
sp["type"] = set_special.substr(7,set_special.size()-8);
} else if(set_special == "swarm") {
config& sp = new_specials.add_child("attacks");
sp["name"] = t_string("swarm","wesnoth");
sp["description"] = t_string("Swarm:\nThe number of strikes of this attack decreases when the unit is wounded. The number of strikes is proportional to the % of HP/maximum HP the unit has. For example a unit with 3/4 of its maximum HP will get 3/4 of the number of strikes.","wesnoth");
sp["id"] = "swarm";
} else if(set_special == "slow") {
config& sp = new_specials.add_child("slow");
sp["name"] = t_string("slows","wesnoth");
sp["description"] = t_string("Slow:\nThis attack slows the target until it ends a turn. Slow halves the damage caused by attacks and slowed units move at half the normal speed (rounded up).","wesnoth");
} else if(set_special == "stone") {
config& sp = new_specials.add_child("stones");
sp["name"] = t_string("stones","wesnoth");
sp["description"] = t_string("Stone:\nThis attack turns the target to stone. Units that have been turned to stone may not move or attack.","wesnoth");
} else if(set_special == "marksman") {
config& sp = new_specials.add_child("chance_to_hit");
sp["name"] = t_string("marksman","wesnoth");
sp["description"] = t_string("Marksman:\nWhen used offensively, this attack always has at least a 60% chance to hit.","wesnoth");
sp["value"] = "60";
sp["cumulative"] = "yes";
sp["active_on"] = "offense";
sp["id"] = "marksman";
} else if(set_special == "magical") {
config& sp = new_specials.add_child("chance_to_hit");
sp["name"] = t_string("magical","wesnoth");
sp["description"] = t_string("Magical:\nThis attack always has a 70% chance to hit.","wesnoth");
sp["value"] = "70";
sp["cumulative"] = "no";
sp["id"] = "magical";
} else if(set_special == "charge") {
config& sp = new_specials.add_child("damage");
sp["name"] = t_string("charge","wesnoth");
sp["description"] = t_string("Charge:\nThis attack deals double damage to the target. It also causes this unit to take double damage from the target's counterattack.","wesnoth");
sp["multiply"] = "2";
sp["active_on"] = "offense";
sp["apply_to"] = "both";
sp["id"] = "charge";
} else if(set_special == "drain") {
config& sp = new_specials.add_child("drains");
sp["name"] = t_string("drains","wesnoth");
sp["description"] = t_string("Drain:\nThis unit drains health from living units, healing itself for half the amount of damage it deals (rounded down).","wesnoth");
} else if(set_special == "firststrike") {
config& sp = new_specials.add_child("firststrike");
sp["name"] = t_string("firststrike","wesnoth");
sp["description"] = t_string("Firststrike:\nThis unit always strikes first with this attack, even if they are defending.","wesnoth");
} else if(set_special == "poison") {
config& sp = new_specials.add_child("poison");
sp["name"] = t_string("poison","wesnoth");
sp["description"] = t_string("Poison:\nThis attack poisons the target. Poisoned units lose 8 HP every turn until they are cured or are reduced to 1 HP.","wesnoth");
}
cfg_.add_child("specials",new_specials);
} // end of backward compatibility block
if(increase_damage.empty() == false) { if(increase_damage.empty() == false) {
damage_ = utils::apply_modifier(damage_, increase_damage, 1); damage_ = utils::apply_modifier(damage_, increase_damage, 1);