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.doublecalculatePaymentMultiplier(Campaign campaign, AtBContract contract) Calculate the total payment modifier for the contract based on the configured market method (e.g., CAM_OPS, ATB_MONTHLY).voidcheckForFollowup(Campaign campaign, AtBContract contract) Generate followup contracts and add them to the market if the currently selected market type supports them.voidgenerateContractOffers(Campaign campaign, boolean newCampaign) Generate available contract offers for the player's force.voidrerollClause(AtBContract contract, int clause, Campaign campaign) Rerolls a specific clause in a contract, typically as part of a negotiation process.protected voidrollCommandClause(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, calculateRequiredCombatElements, calculateRequiredCombatTeams, generateContractOffers, generateInstanceFromXML, getContracts, getMethod, getQualityRating, getRerollsUsed, getSkillRating, removeContract, rollSalvageClause, rollSupportClause, rollTransportClause, setAllyRating, setAttacker, setEnemyCode, setEnemyRating, setIsRiotDuty, setSystemId, updateReport, writeToXML, writeToXML
-
Constructor Details
-
CamOpsContractMarket
public CamOpsContractMarket()
-
-
Method Details
-
addAtBContract
Description copied from class:AbstractContractMarketGenerate a new contract and add it to the market.- Specified by:
addAtBContractin classAbstractContractMarket- Returns:
- The newly generated contract
-
generateContractOffers
Description copied from class:AbstractContractMarketGenerate available contract offers for the player's force.- Specified by:
generateContractOffersin classAbstractContractMarketnewCampaign- Boolean indicating whether this is a fresh campaign.
-
calculatePaymentMultiplier
Description copied from class:AbstractContractMarketCalculate the total payment modifier for the contract based on the configured market method (e.g., CAM_OPS, ATB_MONTHLY).- Specified by:
calculatePaymentMultiplierin classAbstractContractMarket- Returns:
- a double representing the total payment multiplier.
-
checkForFollowup
Description copied from class:AbstractContractMarketGenerate followup contracts and add them to the market if the currently selected market type supports them.- Specified by:
checkForFollowupin classAbstractContractMarket- Parameters:
campaign- The current campaign.contract- The AtBContract being completed and used as a basis for followup missions
-
rerollClause
Description copied from class:AbstractContractMarketRerolls 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:
rerollClausein 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:AbstractContractMarketCalculates and sets the command rights clause for a contract based on a roll and modifier.This method determines the appropriate
ContractCommandRightsfor the givenContract, using the result of a die 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:
rollCommandClausein classAbstractContractMarket- Parameters:
contract- TheContractwhose 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.
-