Class ContractSupportPayments
Both are paid as they are earned for an ordinary contract. Under the #NO_IN_CONTRACT_SUPPORT special rule they are instead withheld onto the contract (see
AbstractContract.changeWithheldSupportPayments(Money)) and settled as a single lump sum when the contract ends
through renderWithheldSupport(Campaign, AbstractContract).
Straight support is a per-contract term but repairs and maintenance are campaign-wide costs, so the share is drawn
from the active contract offering the most generous support (see getStraightSupportContract(Campaign)).
Battle loss compensation, by contrast, is settled against the specific contract whose scenario cost the unit.
Both payouts are doubled for a contract carrying the ChaosObjectiveSpecialRules.DOUBLE_SUPPORT_PAYOUTS
special rule. The doubling is applied before the withhold check, so a contract that also carries
ChaosObjectiveSpecialRules.NO_IN_CONTRACT_SUPPORT withholds - and later pays out - the already-doubled
amount.
- Since:
- 0.51.01
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractContractgetStraightSupportContract(Campaign campaign) static voidpayBattlefieldLoss(Campaign campaign, AbstractContract contract, Money amount, String unitName) Settles battle loss compensation for a unit lost beyond repair, either crediting it immediately or, under theChaosObjectiveSpecialRules.NO_IN_CONTRACT_SUPPORTspecial rule, withholding it until the contract ends.static voidreimburseStraightSupport(Campaign campaign, Money cost, String costDescription) Reimburses the straight-support share of a campaign-wide cost the player has just paid, such as a repair or a maintenance charge.static voidrenderWithheldSupport(Campaign campaign, AbstractContract contract) Pays out, in a single lump sum, all support withheld on the contract under theChaosObjectiveSpecialRules.NO_IN_CONTRACT_SUPPORTspecial rule, then clears the withheld total.
-
Method Details
-
reimburseStraightSupport
Reimburses the straight-support share of a campaign-wide cost the player has just paid, such as a repair or a maintenance charge.The share is
cost *the support multiplier of the active contract offering the most generous straight support, doubled when that contract carriesChaosObjectiveSpecialRules.DOUBLE_SUPPORT_PAYOUTS. When the contract carries theChaosObjectiveSpecialRules.NO_IN_CONTRACT_SUPPORTspecial rule the share is withheld until the contract ends; otherwise it is credited immediately. Does nothing when the cost is not positive, no contract is active, or the support multiplier is zero.- Parameters:
campaign- the active campaigncost- the cost the player paid, whose support share is reimbursedcostDescription- a short description of the cost, used in the ledger note (e.g. the repaired part or unit)- Since:
- 0.51.01
-
payBattlefieldLoss
public static void payBattlefieldLoss(Campaign campaign, AbstractContract contract, Money amount, String unitName) Settles battle loss compensation for a unit lost beyond repair, either crediting it immediately or, under theChaosObjectiveSpecialRules.NO_IN_CONTRACT_SUPPORTspecial rule, withholding it until the contract ends.The amount is doubled when the contract carries
ChaosObjectiveSpecialRules.DOUBLE_SUPPORT_PAYOUTS. Does nothing when the resulting amount is not positive.- Parameters:
campaign- the active campaigncontract- the contract whose scenario cost the unitamount- the battle loss compensation owed, before theDOUBLE_SUPPORT_PAYOUTSrule is appliedunitName- the name of the lost unit, used in the ledger note and report- Since:
- 0.51.01
-
renderWithheldSupport
Pays out, in a single lump sum, all support withheld on the contract under theChaosObjectiveSpecialRules.NO_IN_CONTRACT_SUPPORTspecial rule, then clears the withheld total.Does nothing when nothing has been withheld, so it is safe to call for every completed contract.
- Parameters:
campaign- the active campaigncontract- the contract being completed- Since:
- 0.51.01
-
getStraightSupportContract
- Parameters:
campaign- the active campaign- Returns:
- the active contract offering the highest straight-support multiplier, or
nullwhen no contract is active - Since:
- 0.51.01
-