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 the costs it covers are campaign-wide, 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. The straight-support share of overhead and food and housing is capped at the whole cost, so those monthly
charges can be refunded in full but never turn a profit.
- Since:
- 0.51.01
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleThe fraction of a monthly overhead or food and housing charge the contract reimburses through straight support: thestraight-support share, capped at the whole charge so the refund never exceeds what was paid.static AbstractContractgetStraightSupportContract(Campaign campaign) static doublegetStraightSupportShare(AbstractContract contract) The fraction of a covered cost the contract reimburses through straight support: its support multiplier, doubled when it carriesChaosObjectiveSpecialRules.DOUBLE_SUPPORT_PAYOUTS.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 voidreimburseMonthlyStraightSupport(Campaign campaign, Money cost, String costDescription) Reimburses the straight-support share of a monthly overhead or food and housing charge the player has just paid, reporting the reimbursement when it is credited.static voidreimburseStraightSupport(Campaign campaign, Money cost, String costDescription) Reimburses the straight-support share of a repair cost the player has just paid.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 repair cost the player has just paid.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
-
reimburseMonthlyStraightSupport
public static void reimburseMonthlyStraightSupport(Campaign campaign, Money cost, String costDescription) Reimburses the straight-support share of a monthly overhead or food and housing charge the player has just paid, reporting the reimbursement when it is credited.The share is worked out as for
reimburseStraightSupport(Campaign, Money, String), but capped at the whole cost (seegetMonthlyStraightSupportShare(AbstractContract)).- Parameters:
campaign- the active campaigncost- the cost the player paid, whose support share is reimbursedcostDescription- a short, lower-case description of the cost, used in the ledger note and report (e.g. "overhead costs")- 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
-