Fix bug #11982 and introduce new required attributes in WML for core abilities.

This commit is contained in:
Ignacio R. Morelle 2008-09-11 02:22:26 +00:00
parent a3ac679bd1
commit 295ff4ffd9
3 changed files with 26 additions and 4 deletions

View file

@ -8,6 +8,7 @@
id=healing
affect_allies=yes
name= _ "heals +4"
female_name= _ "female^heals +4"
description= _ "Heals +4:
Allows the unit to heal adjacent friendly units at the beginning of each turn.
@ -27,6 +28,7 @@ A poisoned unit cannot be cured of its poison by a healer, and must seek the car
id=healing
affect_allies=yes
name= _ "heals +8"
female_name= _ "female^heals +8"
description= _ "Heals +8:
This unit combines herbal remedies with magic to heal units more quickly than is normally possible on the battlefield.
@ -47,6 +49,7 @@ A poisoned unit cannot be cured of its poison by a healer, and must seek the car
affect_allies=yes
id=curing
name= _ "cures"
female_name= _ "female^cures"
description= _ "Cures:
A curer can cure a unit of poison, although that unit will receive no additional healing on the turn it is cured of the poison."
affect_self=no
@ -71,6 +74,7 @@ A curer can cure a unit of poison, although that unit will receive no additional
value=8
id=regenerates
name= _ "regenerates"
female_name= _ "female^regenerates"
description= _ "Regenerates:
The unit will heal itself 8 HP per turn. If it is poisoned, it will remove the poison instead of healing."
affect_self=yes
@ -91,6 +95,7 @@ The unit will heal itself 8 HP per turn. If it is poisoned, it will remove the p
less_than_equal_to=50
[/filter_base_value]
name= _ "steadfast"
female_name= _ "female^steadfast"
description= _ "Steadfast:
This unit's resistances are doubled, up to a maximum of 50%, when defending. Vulnerabilities are not affected."
affect_self=yes
@ -106,6 +111,7 @@ This unit's resistances are doubled, up to a maximum of 50%, when defending. Vul
value=25
cumulative=no
name= _ "leadership"
female_name= _ "female^leadership"
description= _ "Leadership:
This unit can lead friendly units that are next to it, making them fight better.
@ -128,6 +134,7 @@ Adjacent friendly units of lower level will do more damage in battle. When a uni
value=50
cumulative=no
name= _ "leadership"
female_name= _ "female^leadership"
description= _ "Leadership:
This unit can lead friendly units that are next to it, making them fight better.
@ -162,6 +169,7 @@ Adjacent friendly units of lower level will do more damage in battle. When a uni
value=75
cumulative=no
name= _ "leadership"
female_name= _ "female^leadership"
description= _ "Leadership:
This unit can lead friendly units that are next to it, making them fight better.
@ -208,6 +216,7 @@ Adjacent friendly units of lower level will do more damage in battle. When a uni
value=100
cumulative=no
name= _ "leadership"
female_name= _ "female^leadership"
description= _ "Leadership:
This unit can lead friendly units that are next to it, making them fight better.
@ -266,6 +275,7 @@ Adjacent friendly units of lower level will do more damage in battle. When a uni
value=125
cumulative=no
name= _ "leadership"
female_name= _ "female^leadership"
description= _ "Leadership:
This unit can lead friendly units that are next to it, making them fight better.
@ -334,6 +344,7 @@ Adjacent friendly units of lower level will do more damage in battle. When a uni
[skirmisher]
id=skirmisher
name= _ "skirmisher"
female_name= _ "female^skirmisher"
description= _ "Skirmisher:
This unit is skilled in moving past enemies quickly, and ignores all enemy Zones of Control."
affect_self=yes
@ -349,6 +360,7 @@ This unit is skilled in moving past enemies quickly, and ignores all enemy Zones
max_value=25
cumulative=no
name= _ "illuminates"
female_name= _ "female^illuminates"
description= _ "Illuminates:
This unit illuminates the surrounding area, making lawful units fight better, and chaotic units fight worse.
@ -363,6 +375,7 @@ Any units adjacent to this unit will fight as if it were dusk when it is night,
[teleport]
id=teleport
name= _ "teleport"
female_name= _ "female^teleport"
description= _ "Teleport:
This unit may teleport between any two empty villages owned by its side using one of its moves."
[/teleport]
@ -374,7 +387,9 @@ This unit may teleport between any two empty villages owned by its side using on
[hides]
id=ambush
name= _ "ambush"
female_name= _ "female^ambush"
name_inactive= _ "ambush"
female_name_inactive= _ "female^ambush"
description= _ "Ambush:
This unit can hide in forest, and remain undetected by its enemies.
@ -398,11 +413,13 @@ Enemy units cannot see this unit while it is in forest, except if they have unit
[hides]
id=nightstalk
name= _ "nightstalk"
female_name= _ "nightstalk"
description= _ "Nightstalk:
The unit becomes invisible during night.
Enemy units cannot see this unit at night, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
name_inactive= _ "nightstalk"
female_name_inactive= _ "female^nightstalk"
description_inactive= _ "Nightstalk:
The unit becomes invisible during night.
@ -422,11 +439,13 @@ Enemy units cannot see this unit at night, except if they have units next to it.
[hides]
id=concealment
name= _ "concealment"
female_name= _ "female^concealment"
description= _ "Concealment:
This unit can hide in villages (with the exception of water villages), and remain undetected by its enemies, except by those standing next to it.
Enemy units can not see this unit while it is in a village, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
name_inactive= _ "concealment"
female_name_inactive= _ "female^concealment"
description_inactive= _ "Concealment:
This unit can hide in villages (with the exception of water villages), and remain undetected by its enemies, except by those standing next to it.
@ -446,11 +465,13 @@ Enemy units can not see this unit while it is in a village, except if they have
[hides]
id=submerge
name= _ "submerge"
female_name= _ "female^submerge"
description= _ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.
Enemy units cannot see this unit while it is in deep water, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
name_inactive= _ "submerge"
female_name_inactive= _ "female^submerge"
description_inactive= _ "Submerge:
This unit can hide in deep water, and remain undetected by its enemies.
@ -473,6 +494,7 @@ Enemy units cannot see this unit while it is in deep water, except if they have
[dummy]
id=feeding
name= _ "feeding"
female_name= _ "female^feeding"
description=_ "Feeding:
This unit gains 1 hitpoint added to its maximum whenever it kills a living unit."
[/dummy]

View file

@ -213,7 +213,7 @@ std::vector<std::string> unit::unit_ability_tooltips() const
i_end = list_map.end(); i != i_end; ++i) {
for (config::child_list::const_iterator j = i->second.begin(),
j_end = i->second.end(); j != j_end; ++j) {
std::string const &name = (**j)["name"];
std::string const &name = (this->gender_ == unit_race::MALE ? (**j)["name"] : (**j)["female_name"]);
if (!name.empty()) {
res.push_back(name);
res.push_back((**j)["description"]);
@ -253,13 +253,13 @@ std::vector<std::string> unit::ability_tooltips(const gamemap::location& loc) co
for (config::child_list::const_iterator j = i->second.begin(),
j_end = i->second.end(); j != j_end; ++j) {
if (ability_active(i->first, **j, loc)) {
std::string const &name = (**j)["name"];
std::string const &name = (gender_ == unit_race::MALE ? (**j)["name"] : (**j)["female_name"]);
if (!name.empty()) {
res.push_back(name);
res.push_back((**j)["description"]);
}
} else {
std::string const &name = (**j)["name_inactive"];
std::string const &name = (gender_ == unit_race::MALE ? (**j)["name_inactive"] : (**j)["female_name_inactive"]);
if (!name.empty()) {
res.push_back(name);
res.push_back((**j)["description_inactive"]);

View file

@ -841,7 +841,7 @@ void unit_type::build_help_index(const config& cfg, const movement_type_map& mv_
for(config::child_map::const_iterator j = abi.begin(); j != abi.end(); ++j) {
for(config::child_list::const_iterator k = j->second.begin(); k != j->second.end(); ++k) {
if((**k)["name"] != "") {
abilities_.push_back((**k)["name"]);
abilities_.push_back(genders_.front() == unit_race::MALE ? (**k)["name"] : (**k)["female_name"]);
ability_tooltips_.push_back((**k)["description"]);
}
}