new strict_amla=[yes|no] key in [advancement]...
...to disable the advancement if the unit can advance to another unit. changelog update for commit 2006-06-01T15:10:22Z!benoit.timbert@free.fr
This commit is contained in:
parent
c79742c010
commit
16eb7974b5
3 changed files with 27 additions and 20 deletions
|
@ -1,6 +1,8 @@
|
|||
Version 1.1.4+svn:
|
||||
* WML engine
|
||||
* all [event] tags shall perform complex substitution
|
||||
* new key in [advancement] to to prevent amla if the unit can advance to
|
||||
another unit.
|
||||
* language and i18n:
|
||||
* updated translations: Czech, Finnish, Hungarian, Italian, Latin,
|
||||
Norwegian, Portuguese (Brazil), Spanish, Swedish
|
||||
|
@ -19,6 +21,7 @@ Version 1.1.4+svn:
|
|||
* revised multiplayer maps: Charge, Meteor Lake, King of the Hill, Loris
|
||||
River, Paths of Daggers, Siege Castles, Waterloo Sunset
|
||||
* units
|
||||
* fixed zoc/no zoc ellipses
|
||||
* balancing changes:
|
||||
* Increased HP of the Footpad from 28 to 30
|
||||
* Increased melee and ranged damage of the Footpad from 4-2 to 5-2
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#macro to define AMLA adding HP
|
||||
#define AMLA_TOUGH HP_ADVANCE
|
||||
[advancement]
|
||||
strict_amla=yes
|
||||
max_times=100
|
||||
id=tough_{HP_ADVANCE}
|
||||
description= _ "Max HP bonus +" {HP_ADVANCE} _", MAX XP +25%"
|
||||
|
@ -23,6 +24,7 @@ increase=25%
|
|||
#macro to define AMLA full healing
|
||||
#define AMLA_NECROHEAL
|
||||
[advancement]
|
||||
strict_amla=yes
|
||||
max_times=100
|
||||
id=necroheal
|
||||
description= _ "Full Heal"
|
||||
|
|
42
src/unit.cpp
42
src/unit.cpp
|
@ -2109,26 +2109,28 @@ config::child_list unit::get_modification_advances() const
|
|||
config::child_list res;
|
||||
const config::child_list& advances = modification_advancements();
|
||||
for(config::child_list::const_iterator i = advances.begin(); i != advances.end(); ++i) {
|
||||
if(modification_count("advance",(**i)["id"]) < lexical_cast_default<size_t>((**i)["max_times"],1)) {
|
||||
std::vector<std::string> temp = utils::split((**i)["require_amla"]);
|
||||
if(temp.size()){
|
||||
std::sort(temp.begin(),temp.end());
|
||||
std::vector<std::string> uniq;
|
||||
std::unique_copy(temp.begin(),temp.end(),std::back_inserter(uniq));
|
||||
bool requirements_done=true;
|
||||
for(std::vector<std::string>::const_iterator ii = uniq.begin(); ii != uniq.end(); ii++){
|
||||
int required_num = std::count(temp.begin(),temp.end(),*ii);
|
||||
int mod_num = modification_count("advance",*ii);
|
||||
if(required_num>mod_num){
|
||||
requirements_done=false;
|
||||
}
|
||||
}
|
||||
if(requirements_done){
|
||||
res.push_back(*i);
|
||||
}
|
||||
}else{
|
||||
res.push_back(*i);
|
||||
}
|
||||
if (!utils::string_bool((**i)["strict_amla"]) || advances_to_.empty()) {
|
||||
if(modification_count("advance",(**i)["id"]) < lexical_cast_default<size_t>((**i)["max_times"],1)) {
|
||||
std::vector<std::string> temp = utils::split((**i)["require_amla"]);
|
||||
if(temp.size()){
|
||||
std::sort(temp.begin(),temp.end());
|
||||
std::vector<std::string> uniq;
|
||||
std::unique_copy(temp.begin(),temp.end(),std::back_inserter(uniq));
|
||||
bool requirements_done=true;
|
||||
for(std::vector<std::string>::const_iterator ii = uniq.begin(); ii != uniq.end(); ii++){
|
||||
int required_num = std::count(temp.begin(),temp.end(),*ii);
|
||||
int mod_num = modification_count("advance",*ii);
|
||||
if(required_num>mod_num){
|
||||
requirements_done=false;
|
||||
}
|
||||
}
|
||||
if(requirements_done){
|
||||
res.push_back(*i);
|
||||
}
|
||||
}else{
|
||||
res.push_back(*i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue