Can a condition check a player's total income?
-
One of the rules for the BBR map I'm working on is that an income of at least 52 PUs for Japan is worth an additional Victory Point for the Axis. The idea is that even if you don't control a particular victory city (like Shanghai), you should still be rewarded for having accumulated a large and valuable empire by the time the game's eight-turn limit is over.
Is there a way to implement something like this in TripleA? I see that there is an economic victory condition that will instantly cause the Axis to win if the total Axis income reaches a certain level, but that's not quite what I'm looking for -- in this case, only Japanese income should count toward the threshold, and reaching the threshold is only worth one additional victory point, not the entire game.
-
-
@wc_sumpton Thanks; I threw in my support on the relevant GitHub page. Do you want me to submit a pull request for you, or can you do that? Seems like development resources are very scarce right now, so maybe every little bit helps.
-
A pull request was issued but canceled. Any-who thanks for your support. Visually, a players resources can be check by viewing the resources tab. Otherwise every territory would need to be checked:
<!-- First the objective attachment --> <attachment name="objectiveAttachmentJapanRecevies52PUs" attachTo="Japan" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="JapanCountBox" count="1"/> <option name="unitPresence" value="Any" count="52"/> </attachment> <!-- Always True condition --> <attachment name="conditionAttachmentAlwaysTrue" attachTo="Japan" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="switch" value="true"/> </attachment> <!-- Conditions for counting --> <attachment name="conditionAttachmentJapanOwnership5PUs" attachTo="Japan" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="@Territories5PUs@" count="each"/> </attachment> <attachment name="conditionAttachmentJapanOwnership4PUs" attachTo="Japan" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="@Territories4PUs@" count="each"/> </attachment> ... <!-- Clean up trigger --> <attachment name="triggerAttachmentJapanCountBoxCleanUp" attachTo="Japan" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentAlwaysTrue"/> <option name="removeUnits" value="JapanCountBox:All" count="999"/> <option name="when" value="after:japanNonCombatMove"/> <!-- If there is a running count, place a when for each player --> <!-- <option name="when" value="after:usaNonCombatMovet"/> --> </attachment> <!-- Placement triggers for counting --> <attachment name="triggerAttachmentJapanOwnership5PUs" attachTo="Japan" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentJapanOwnership5PUs"/> <option name="placement" value="JapanCountBox:infantry" count="5"/> <option name="when" value="after:japanPlacement"/> <!-- For a running count, place a when for each player --> <!-- <option name="when" value="after:usaPlacement"/> --> </attachment> <attachment name="triggerAttachmentJapanOwnership4PUs" attachTo="Japan" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentJapanOwnership4PUs"/> <option name="placement" value="JapanCountBox:infantry" count="4"/> <option name="when" value="after:japanPlacement"/> <!-- For a running count, place a when for each player --> <!-- <option name="when" value="after:usaPlacement"/> --> </attachment>
Notes: 'JapanCountBox' can be any Impassable territory that has no connection to another territory.
It's a lot... but something like this should be able to count what Japan is receiving in PSs.
Cheers...
-
@wc_sumpton This is great, thanks! I think it will work well.