Author: shadowmaster
Date: Thu Sep 11 04:22:26 2008
New Revision: 29386
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29386&view=rev
Log:
* Fix bug #11982 and introduce new required attributes in WML for core
abilities.
Modified:
trunk/data/core/macros/abilities.cfg
trunk/src/unit_abilities.cpp
trunk/src/unit_types.cpp
Modified: trunk/data/core/macros/abilities.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/abilities.cfg?rev=29386&r1=29385&r2=29386&view=diff
==============================================================================
--- trunk/data/core/macros/abilities.cfg (original)
+++ trunk/data/core/macros/abilities.cfg Thu Sep 11 04:22:26 2008
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
[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 @@
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 @@
[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 @@
[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 @@
[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 @@
[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 @@
[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 @@
[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]
Modified: trunk/src/unit_abilities.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_abilities.cpp?rev=29386&r1=29385&r2=29386&view=diff
==============================================================================
--- trunk/src/unit_abilities.cpp (original)
+++ trunk/src/unit_abilities.cpp Thu Sep 11 04:22:26 2008
@@ -213,7 +213,7 @@
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 @@
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"]);
Modified: trunk/src/unit_types.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.cpp?rev=29386&r1=29385&r2=29386&view=diff
==============================================================================
--- trunk/src/unit_types.cpp (original)
+++ trunk/src/unit_types.cpp Thu Sep 11 04:22:26 2008
@@ -841,7 +841,7 @@
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"]);
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits