Class CamOpsContractMarket
java.lang.Object
mekhq.campaign.market.contractMarket.AbstractContractMarket
mekhq.campaign.market.contractMarket.CamOpsContractMarket
Contract Market as described in Campaign Operations, 4th printing.
-
Nested Class Summary
Nested classes/interfaces inherited from class mekhq.campaign.market.contractMarket.AbstractContractMarket
AbstractContractMarket.ClauseMods, AbstractContractMarket.NoContractLocationFoundException
-
Field Summary
Fields inherited from class mekhq.campaign.market.contractMarket.AbstractContractMarket
CLAUSE_COMMAND, CLAUSE_NUM, CLAUSE_SALVAGE, CLAUSE_SUPPORT, CLAUSE_TRANSPORT, clauseMods, contractIds, contracts, followupContracts, lastId, MAXIMUM_ATTEMPTS_TO_FIND_NON_MERC_EMPLOYER, MAXIMUM_GENERATION_RETRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAtBContract
(Campaign campaign) Generate a new contract and add it to the market.double
calculatePaymentMultiplier
(Campaign campaign, AtBContract contract) Calculate the total payment modifier for the contract based on the configured market method (e.g., CAM_OPS, ATB_MONTHLY).void
checkForFollowup
(Campaign campaign, AtBContract contract) Generate followup contracts and add them to the market if the currently selected market type supports them.void
generateContractOffers
(Campaign campaign, boolean newCampaign) Generate available contract offers for the player's force.void
rerollClause
(AtBContract contract, int clause, Campaign campaign) Rerolls a specific clause in a contract, typically as part of a negotiation process.protected void
rollCommandClause
(Contract contract, int modifier, boolean isMercenary) Calculates and sets the command rights clause for a contract based on a roll and modifier.Methods inherited from class mekhq.campaign.market.contractMarket.AbstractContractMarket
calculateMaxDeployableCombatTeams, calculateRequiredCombatTeams, findMissionType, generateContractOffers, generateInstanceFromXML, getContracts, getMethod, getQualityRating, getRerollsUsed, getSkillRating, removeContract, rollCommandClause, rollSalvageClause, rollSupportClause, rollTransportClause, setAllyRating, setAllyRating, setAttacker, setEnemyCode, setEnemyRating, setEnemyRating, setIsRiotDuty, setSystemId, updateReport, writeToXML
-
Constructor Details
-
CamOpsContractMarket
public CamOpsContractMarket()
-
-
Method Details
-
addAtBContract
Description copied from class:AbstractContractMarket
Generate a new contract and add it to the market.- Specified by:
addAtBContract
in classAbstractContractMarket
- Returns:
- The newly generated contract
-
generateContractOffers
Description copied from class:AbstractContractMarket
Generate available contract offers for the player's force.- Specified by:
generateContractOffers
in classAbstractContractMarket
newCampaign
- Boolean indicating whether this is a fresh campaign.
-
calculatePaymentMultiplier
Description copied from class:AbstractContractMarket
Calculate the total payment modifier for the contract based on the configured market method (e.g., CAM_OPS, ATB_MONTHLY).- Specified by:
calculatePaymentMultiplier
in classAbstractContractMarket
- Returns:
- a double representing the total payment multiplier.
-
checkForFollowup
Description copied from class:AbstractContractMarket
Generate followup contracts and add them to the market if the currently selected market type supports them.- Specified by:
checkForFollowup
in classAbstractContractMarket
- Parameters:
campaign
- The current campaign.contract
- The AtBContract being completed and used as a basis for followup missions
-
rerollClause
Description copied from class:AbstractContractMarket
Rerolls a specific clause in a contract, typically as part of a negotiation process. This method adjusts the clause based on the provided clause type and associated modifiers, ensuring the contract reflects updated terms.The recalculated clause values can affect aspects such as command, salvage, transport, or support terms. Special rules, such as overrides for Clan technology salvage, may also be applied when rerolling specific clauses.
- Overrides:
rerollClause
in classAbstractContractMarket
- Parameters:
contract
- the contract being negotiated, which will have its terms modifiedclause
- the type of clause to be rerolled (e.g., command, salvage, transport, or support)campaign
- the active campaign context, used to access campaign-specific options and rules
-
rollCommandClause
Description copied from class:AbstractContractMarket
Calculates and sets the command rights clause for a contract based on a roll and modifier.This method determines the appropriate
ContractCommandRights
for the givenContract
, using the result of a dice roll (with modifiers). The logic differentiates between mercenary and non-mercenary contracts, as these have different thresholds for command rights determination.- For mercenaries, the command rights are determined using multiple thresholds, defined by constants, and can be one of the following:
- For non-mercenaries, only two outcomes are possible:
- Overrides:
rollCommandClause
in classAbstractContractMarket
- Parameters:
contract
- TheContract
whose command rights will be set based on the roll outcome.modifier
- The numeric modifier applied to the dice roll value.isMercenary
- Indicates whether the contract applies to a mercenary, which affects the thresholds used for determining command rights.
-