Skip to content

Commit

Permalink
Update rules to explain order of maintenance costs
Browse files Browse the repository at this point in the history
* Pulled in changes from PR #111
  * Added section to rules showing order of maintenance payments.
* Updated snapshots to reflect changes.
  • Loading branch information
jt-traub committed May 7, 2024
1 parent 2bf1962 commit 5274779
Show file tree
Hide file tree
Showing 7 changed files with 226 additions and 0 deletions.
22 changes: 22 additions & 0 deletions genrules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,28 @@ int Game::GenRules(const AString &rules, const AString &css, const AString &intr
<< "them and using the money is more economical than using them for maintenance.";
};
f << '\n' << enclose("p", false);
f << enclose("p", true);
f << "Maintenance costs are paid in the following order:";
f << enclose("ol", true);
if (Globals->FOOD_ITEMS_EXIST && Globals->UPKEEP_FOOD_VALUE > 0) {
f << enclose("li", true) << "Food items the unit owns if the unit is set " << url("#consume", "CONSUME UNIT")
<< "or " << url("#consume", "CONSUME FACTION") << "\n" << enclose("li", false);
f << enclose("li", true) << "Food items from faction units in the same region if the unit is set "
<< url("#consume", "CONSUME FACTION") << "\n" << enclose("li", false);
}
f << enclose("li", true) << "Silver in the unit's possession\n" << enclose("li", false);
f << enclose("li", true) << "Silver from other faction units in the same region.\n" << enclose("li", false);
if (Globals->FOOD_ITEMS_EXIST && Globals->UPKEEP_FOOD_VALUE > 0) {
f << enclose("li", true) << "Food items in the unit's possession.\n" << enclose("li", false);
f << enclose("li", true) << "Food items from faction units in the same region.\n" << enclose("li", false);
}
f << enclose("li", true) << "Unclaimed silver.\n" << enclose("li", false);
f << enclose("li", true) << "Silver from allied units in the same region.\n" << enclose("li", false);
if (Globals->FOOD_ITEMS_EXIST && Globals->UPKEEP_FOOD_VALUE > 0) {
f << enclose("li", true) << "Food items from allied units in the same region.\n" << enclose("li", false);
}
f << enclose("ol", false);
f << enclose("p", false);

f << anchor("economy_recruiting") << '\n';
f << enclose("h3", true) << "Recruiting:\n" << enclose("h3", false);
Expand Down
34 changes: 34 additions & 0 deletions snapshot-tests/rules/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,40 @@ <h3>
when sold in towns, so selling them and using the money is more
economical than using them for maintenance.
</p>
<p>
Maintenance costs are paid in the following order:<ol>
<li>
Food items the unit owns if the unit is set <a
href="#consume">CONSUME UNIT</a>or <a href="#consume">CONSUME
FACTION</a>
</li>
<li>
Food items from faction units in the same region if the unit is set
<a href="#consume">CONSUME FACTION</a>
</li>
<li>
Silver in the unit's possession
</li>
<li>
Silver from other faction units in the same region.
</li>
<li>
Food items in the unit's possession.
</li>
<li>
Food items from faction units in the same region.
</li>
<li>
Unclaimed silver.
</li>
<li>
Silver from allied units in the same region.
</li>
<li>
Food items from allied units in the same region.
</li>
</ol>
</p>
<a name="economy_recruiting"></a>
<h3>
Recruiting:
Expand Down
34 changes: 34 additions & 0 deletions snapshot-tests/rules/fracas.html
Original file line number Diff line number Diff line change
Expand Up @@ -2106,6 +2106,40 @@ <h3>
when sold in towns, so selling them and using the money is more
economical than using them for maintenance.
</p>
<p>
Maintenance costs are paid in the following order:<ol>
<li>
Food items the unit owns if the unit is set <a
href="#consume">CONSUME UNIT</a>or <a href="#consume">CONSUME
FACTION</a>
</li>
<li>
Food items from faction units in the same region if the unit is set
<a href="#consume">CONSUME FACTION</a>
</li>
<li>
Silver in the unit's possession
</li>
<li>
Silver from other faction units in the same region.
</li>
<li>
Food items in the unit's possession.
</li>
<li>
Food items from faction units in the same region.
</li>
<li>
Unclaimed silver.
</li>
<li>
Silver from allied units in the same region.
</li>
<li>
Food items from allied units in the same region.
</li>
</ol>
</p>
<a name="economy_recruiting"></a>
<h3>
Recruiting:
Expand Down
34 changes: 34 additions & 0 deletions snapshot-tests/rules/havilah.html
Original file line number Diff line number Diff line change
Expand Up @@ -2308,6 +2308,40 @@ <h3>
when sold in towns, so selling them and using the money is more
economical than using them for maintenance.
</p>
<p>
Maintenance costs are paid in the following order:<ol>
<li>
Food items the unit owns if the unit is set <a
href="#consume">CONSUME UNIT</a>or <a href="#consume">CONSUME
FACTION</a>
</li>
<li>
Food items from faction units in the same region if the unit is set
<a href="#consume">CONSUME FACTION</a>
</li>
<li>
Silver in the unit's possession
</li>
<li>
Silver from other faction units in the same region.
</li>
<li>
Food items in the unit's possession.
</li>
<li>
Food items from faction units in the same region.
</li>
<li>
Unclaimed silver.
</li>
<li>
Silver from allied units in the same region.
</li>
<li>
Food items from allied units in the same region.
</li>
</ol>
</p>
<a name="economy_recruiting"></a>
<h3>
Recruiting:
Expand Down
34 changes: 34 additions & 0 deletions snapshot-tests/rules/kingdoms.html
Original file line number Diff line number Diff line change
Expand Up @@ -2425,6 +2425,40 @@ <h3>
selling them and using the money is more economical than using them for
maintenance.
</p>
<p>
Maintenance costs are paid in the following order:<ol>
<li>
Food items the unit owns if the unit is set <a
href="#consume">CONSUME UNIT</a>or <a href="#consume">CONSUME
FACTION</a>
</li>
<li>
Food items from faction units in the same region if the unit is set
<a href="#consume">CONSUME FACTION</a>
</li>
<li>
Silver in the unit's possession
</li>
<li>
Silver from other faction units in the same region.
</li>
<li>
Food items in the unit's possession.
</li>
<li>
Food items from faction units in the same region.
</li>
<li>
Unclaimed silver.
</li>
<li>
Silver from allied units in the same region.
</li>
<li>
Food items from allied units in the same region.
</li>
</ol>
</p>
<a name="economy_recruiting"></a>
<h3>
Recruiting:
Expand Down
34 changes: 34 additions & 0 deletions snapshot-tests/rules/neworigins.html
Original file line number Diff line number Diff line change
Expand Up @@ -2270,6 +2270,40 @@ <h3>
that these items are worth more when sold in towns, so selling them and
using the money is more economical than using them for maintenance.
</p>
<p>
Maintenance costs are paid in the following order:<ol>
<li>
Food items the unit owns if the unit is set <a
href="#consume">CONSUME UNIT</a>or <a href="#consume">CONSUME
FACTION</a>
</li>
<li>
Food items from faction units in the same region if the unit is set
<a href="#consume">CONSUME FACTION</a>
</li>
<li>
Silver in the unit's possession
</li>
<li>
Silver from other faction units in the same region.
</li>
<li>
Food items in the unit's possession.
</li>
<li>
Food items from faction units in the same region.
</li>
<li>
Unclaimed silver.
</li>
<li>
Silver from allied units in the same region.
</li>
<li>
Food items from allied units in the same region.
</li>
</ol>
</p>
<a name="economy_recruiting"></a>
<h3>
Recruiting:
Expand Down
34 changes: 34 additions & 0 deletions snapshot-tests/rules/standard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,40 @@ <h3>
when sold in towns, so selling them and using the money is more
economical than using them for maintenance.
</p>
<p>
Maintenance costs are paid in the following order:<ol>
<li>
Food items the unit owns if the unit is set <a
href="#consume">CONSUME UNIT</a>or <a href="#consume">CONSUME
FACTION</a>
</li>
<li>
Food items from faction units in the same region if the unit is set
<a href="#consume">CONSUME FACTION</a>
</li>
<li>
Silver in the unit's possession
</li>
<li>
Silver from other faction units in the same region.
</li>
<li>
Food items in the unit's possession.
</li>
<li>
Food items from faction units in the same region.
</li>
<li>
Unclaimed silver.
</li>
<li>
Silver from allied units in the same region.
</li>
<li>
Food items from allied units in the same region.
</li>
</ol>
</p>
<a name="economy_recruiting"></a>
<h3>
Recruiting:
Expand Down

0 comments on commit 5274779

Please sign in to comment.