This update changes upkeep to exempt leaders...

...rather than relying an oddity of the way leader units are typically
defined. There shouldn't be an impact on play in typcial scenarios.
This commit is contained in:
Bruno Wolff III 2007-08-12 22:26:07 +00:00
parent 3e7429f123
commit 2325b63b4c
3 changed files with 19 additions and 1 deletions

View file

@ -82,6 +82,16 @@ Version 1.3.6+svn:
* fog and shroud tiles are now defined by the TerrainWML (not [game_config])
* new key store_location_as= to store generated chamber item locations
* the border has been made themable
* Instead of having an empty upkeep type as the default when reading a
config file being used to normally give leaders a 0 upkeep, now leaders
(canrecruit=1) are specifically exempted from upkeep and the upkeep
type defaults to "full" when read from config files the same as for
using the recruit function. This makes documenting how upkeep works
simpler (it currently wasn't really correct) without having to make
leaders loyal. It also will work better for campaigns where the leaders
change (not that there are any now) so that the current leader is
exempted and any exleaders pay for upkeep (unless the are specically
marked as loyal).
* team color
* allow color ranges to be defined on-the-fly (like color palettes)
* now [side] colour=<string> is valid (previously only int)

View file

@ -250,7 +250,7 @@ Income is simple. You have a base income of 2 gold per turn. For every village y
Upkeep is also fairly simple. Each unit requires an amount of Upkeep equal to its level. You can support as many levels <italic>text=worth</italic> of units as you have villages, without paying any upkeep. However, for each level of unit beyond the number of villages you have, you must pay one gold per turn. For example, if you have twelve level one units and ten villages, you would have to pay two gold each turn in upkeep." + _"
Upkeep costs are subtracted from your Income, so in the case of twelve levels of units and ten villages, your resultant Income would be 10 gold per turn." + _"
There is one important exception to Upkeep: units with the Loyal trait never incur upkeep. Units you begin the scenario with (such as Konrad or Delfador), or units who join you during a scenario (such as the Horseman in the second scenario of Heir to the Throne) will usually have the Loyal trait."
There are two important exceptions to Upkeep: units with the Loyal trait and leaders never incur upkeep. Units you begin the scenario with (such as Delfador), or units who join you during a scenario (such as the Horseman in the second scenario of Heir to the Throne) will usually have the Loyal trait. The unit you are playing (such as Konrad) will almost always be a leader."
[/topic]
[topic]

View file

@ -1372,6 +1372,10 @@ void unit::read(const config& cfg)
}
game_events::add_events(cfg_.get_children("event"),id_);
cfg_.clear_children("event");
// Make the default upkeep "full"
if(cfg_["upkeep"].empty()) {
cfg_["upkeep"] = "full";
}
}
void unit::write(config& cfg) const
{
@ -1957,6 +1961,10 @@ std::set<gamemap::location> unit::overlaps(const gamemap::location &loc) const
int unit::upkeep() const
{
// Leaders do not incur upkeep.
if(can_recruit()) {
return 0;
}
if(cfg_["upkeep"] == "full") {
return level();
}