Class AtBContract
- Direct Known Subclasses:
AtBContract.AtBContractRef
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classDeprecated.Represents a reference to another AtBContract. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intDeprecated.protected intDeprecated.protected intDeprecated.protected intDeprecated.protected intDeprecated.protected intDeprecated.protected AtBContractDeprecated.protected intDeprecated.protected booleanDeprecated.protected LocalDateDeprecated.If the date is non-null, there will be a special scenario or big battle on that date, but the scenario is not generated until the other battle rolls for the week.protected intDeprecated.Fields inherited from class mekhq.campaign.mission.AbstractMissionTransition
OH_FULL, OH_HALF, OH_NONE, OH_NUM, UNKNOWN_DIFFICULTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeprecated.AtBContract(String name) Deprecated.AtBContract(Contract contract, Campaign campaign) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptContract(Campaign campaign) Deprecated.Calculations to be performed once the contract has been accepted.voidDeprecated.voidaddPlayerMinorBreaches(int num) Deprecated.voidcalculateLength(boolean variable) Deprecated.voidcheckEvents(Campaign campaign) Deprecated.voidcheckMorale(Campaign campaign, LocalDate today) Deprecated.Checks and updates the morale which depends on various conditions such as the rout end date, skill levels, victories, defeats, etc.voidDeprecated.Applies a salvage override rule for Clan technology based on the contract timeline and faction involvement.booleancontractExtended(Campaign campaign) Deprecated.booleandoBonusRoll(Campaign campaign, boolean isPostScenario) Deprecated.Performs a bonus roll to determine and execute a random campaign bonus.intDeprecated.static intgetBestRepairLocation(List<AtBContract> activeContracts) Deprecated.Determines the best available repair location from a list of active contracts.intgetContractScore(boolean isUseMaplessMode) Deprecated.Calculates the overall contract score based on scenario outcomes and modifiers.intDeprecated.intDeprecated.getEmployerName(int year) Deprecated.Deprecated.Deprecated.getRandomDayOfMonth(LocalDate today) Deprecated.intDeprecated.Determines the repair location for the contract based on the contract type.intDeprecated.Calculates the number of required Victory Points (VP) needed to achieve overall success for this StratCon contract.voidinitContractDetails(Campaign campaign) Deprecated.booleanDeprecated.booleanDeprecated.voidloadFieldsFromXmlNode(Campaign campaign, megamek.Version version, Node node) Deprecated.Parses allAbstractMissionTransitionfields from child nodes of the mission XML element.voidDeprecated.Restores any references to other contracts.voidsetContractScoreArbitraryModifier(int newModifier) Deprecated.voidsetMercSubcontract(boolean sub) Deprecated.voidsetParentContract(AtBContract parent) Deprecated.voidupdateEnemy(Campaign campaign, LocalDate today, String enemyCode) Deprecated.Updates the enemy faction and enemy bot name for this contract.protected intwriteToXMLBegin(Campaign campaign, PrintWriter printWriter, int indent) Deprecated.Writes allAbstractMissionTransitionfields to XML.Methods inherited from class mekhq.campaign.mission.Contract
calculateContract, isActiveOn, setSystemIdMethods inherited from class mekhq.campaign.mission.Mission
generateInstanceFromXML, toStringMethods inherited from class mekhq.campaign.mission.AbstractMissionTransition
addSalvageByEmployer, addSalvageByUnit, addScenario, calculateSalvagePercentage, canSalvage, changeMoraleLevel, changePartsAvailabilityLevel, clearScenarios, createClanOpponent, createEmployerLiaison, generateEnemyName, getAdvanceAmount, getAdvancePercent, getAllyBotName, getAllyCamouflage, getAllyColour, getAllyQuality, getAllySkill, getBaseAmount, getBattleLossCompensation, getBattleLossCompString, getCachedJumpPath, getClanOpponent, getCommandRights, getCompletedScenarios, getContractDifficulty, getContractNegotiationCommandRoll, getContractNegotiationSalvageRoll, getContractNegotiationSupportRoll, getContractNegotiationTransportRoll, getContractType, getContractTypeName, getCurrentAtBScenarios, getCurrentSalvagePct, getCurrentScenarios, getDescription, getEmployerCode, getEmployerFaction, getEmployerLiaison, getEmployerName, getEmployerTransportReimbursement, getEndingDate, getEnemy, getEnemyBotName, getEnemyCamouflage, getEnemyCode, getEnemyColour, getEnemyMercenaryEmployer, getEnemyMercenaryEmployerCode, getEnemyName, getEnemyQuality, getEnemySkill, getEstimatedPayrollExpenses, getEstimatedTotalProfit, getFeeAmount, getHoldingCellsRented, getHospitalBedsRented, getHyperlinkedName, getId, getJumpPath, getKitchensRented, getLegacyPlanetName, getLengthInMonths, getLengthPlusTravel, getMaximumSupportPoints, getMonthsLeft, getMoraleLevel, getMRBCFeePercentage, getName, getOverheadAmount, getOverheadCompensation, getOverheadCompensationName, getPartsAvailabilityLevel, getPaymentMultiplier, getPlayerTransportCost, getRequiredCombatElements, getRequiredCombatTeams, getRoutedPayout, getRoutEndDate, getSalvagedByEmployer, getSalvagedByUnit, getSalvagePercent, getSalvagePercentString, getScenarios, getScenariosCopy, getSharesPercent, getSigningBonus, getSigningBonusAmount, getStartDate, getStatus, getStraightSupport, getStraightSupportString, getStratConCampaignState, getSupportAmount, getSystem, getSystemId, getSystemName, getTotalAdvanceAmount, getTotalAmount, getTotalAmountPlusFees, getTotalAmountPlusFeesAndBonuses, getTotalEstimatedMaintenanceExpenses, getTotalEstimatedOverheadExpenses, getTotalEstimatedPayrollExpenses, getTotalMonthlyPayOut, getTotalTransportationFees, getTransitAmount, getTransportAmount, getTransportCompensation, getTransportCompString, getTravelDays, getVisibleScenarios, isActiveOn, isBatchallAccepted, isPaidMRBCFee, isPeaceful, isPlayerAttacker, isSalvageExchange, setAdvanceAmount, setAdvancePercent, setAllyBotName, setAllyCamouflage, setAllyColour, setAllyQuality, setAllySkill, setBaseAmount, setBatchallAccepted, setBattleLossCompensation, setCachedJumpPath, setClanOpponent, setCommandRights, setContractDifficulty, setContractNegotiationCommandRoll, setContractNegotiationSalvageRoll, setContractNegotiationSupportRoll, setContractNegotiationTransportRoll, setContractType, setContractTypeAndName, setContractTypeName, setDescription, setEmployerCode, setEmployerLiaison, setEmployerName, setEndingDate, setEnemyBotName, setEnemyCamouflage, setEnemyCode, setEnemyColour, setEnemyMercenaryEmployerCode, setEnemyName, setEnemyQuality, setEnemySkill, setFeeAmount, setHoldingCellsRented, setHospitalBedsRented, setId, setKitchensRented, setLegacyPlanetName, setLengthInMonths, setMoraleLevel, setMRBCFeePercentage, setName, setOverheadAmount, setOverheadCompensation, setPaidMRBCFee, setPartsAvailabilityLevel, setPaymentMultiplier, setPlayerAttacker, setRequiredCombatElements, setRequiredCombatTeams, setRoutedPayout, setRoutEndDate, setSalvagedByEmployer, setSalvagedByUnit, setSalvageExchange, setSalvagePercent, setSharesPercent, setSigningBonus, setSigningBonusAmount, setStartAndEndDate, setStartDate, setStatus, setStraightSupport, setStratConCampaignState, setSupportAmount, setTransitAmount, setTransportAmount, setTransportCompensation, subtractSalvageByUnit, updateEmployer, writeToXML, writeToXMLEnd
-
Field Details
-
parentContract
Deprecated. -
extensionLength
protected int extensionLengthDeprecated. -
playerMinorBreaches
protected int playerMinorBreachesDeprecated. -
employerMinorBreaches
protected int employerMinorBreachesDeprecated. -
contractScoreArbitraryModifier
protected int contractScoreArbitraryModifierDeprecated. -
moraleMod
protected int moraleModDeprecated. -
priorLogisticsFailure
protected boolean priorLogisticsFailureDeprecated. -
specialEventScenarioDate
Deprecated.If the date is non-null, there will be a special scenario or big battle on that date, but the scenario is not generated until the other battle rolls for the week. -
specialEventScenarioType
protected int specialEventScenarioTypeDeprecated. -
battleTypeMod
protected int battleTypeModDeprecated. -
nextWeekBattleTypeMod
protected int nextWeekBattleTypeModDeprecated.
-
-
Constructor Details
-
AtBContract
protected AtBContract()Deprecated. -
AtBContract
Deprecated. -
AtBContract
Deprecated.
-
-
Method Details
-
initContractDetails
Deprecated. -
calculateLength
public void calculateLength(boolean variable) Deprecated. -
checkMorale
Deprecated.Checks and updates the morale which depends on various conditions such as the rout end date, skill levels, victories, defeats, etc. This method also updates the enemy status based on the morale level.- Parameters:
today- The current date in the context.
-
updateEnemy
Deprecated.Updates the enemy faction and enemy bot name for this contract.- Parameters:
campaign- The current campaign.today- The current LocalDate object.enemyCode-Nullablethe code for the new faction, ifnullan appropriate random faction will be used
-
getRepairLocation
public int getRepairLocation()Deprecated.Determines the repair location for the contract based on the contract type.The returned repair location corresponds to the type of operation:
- Guerrilla warfare contracts:
Unit.SITE_IMPROVISED - Raid-type contracts:
Unit.SITE_FIELD_WORKSHOP - All other contracts:
Unit.SITE_FACILITY_BASIC
- Overrides:
getRepairLocationin classAbstractMissionTransition- Returns:
- the repair location constant based on the contract type
- Guerrilla warfare contracts:
-
getBestRepairLocation
Deprecated.Determines the best available repair location from a list of active contracts.This method evaluates all active contracts and returns the highest quality repair facility available. Repair locations are ranked numerically, with higher values representing better facilities. If no active contracts exist, a basic facility is assumed to be available.
- Parameters:
activeContracts- the list of active contracts to evaluate for repair facilities- Returns:
- the numeric value of the best available repair location; returns
Unit.SITE_FACILITY_BASICif no contracts are active
-
getContractScore
public int getContractScore(boolean isUseMaplessMode) Deprecated.Calculates the overall contract score based on scenario outcomes and modifiers.For StratCon campaigns, this returns the current victory points from the campaign state.
For standard contracts, this aggregates scores from all completed scenarios and applies any arbitrary modifiers that have been set for this contract.
- Parameters:
isUseMaplessMode-trueif mapless mode is enabled in StratCon- Returns:
- the total contract score, including victory points or scenario scores plus modifiers
-
getCurrentSupportPoints
public int getCurrentSupportPoints()Deprecated.- Returns:
- the total available support points, or 0 if StratCon is not enabled for this contract
- Since:
- 0.50.10
-
getContractScoreArbitraryModifier
public int getContractScoreArbitraryModifier()Deprecated. -
doBonusRoll
Deprecated.Performs a bonus roll to determine and execute a random campaign bonus. The roll is simulated using 1d6, and the outcome triggers different bonus effects based on the roll value. The effects may involve recruiting dependents, adding new units, or other benefits as determined by the campaign options and roll outcome.- Parameters:
campaign- the currentCampaigninstance.isPostScenario- abooleanindicating if this roll occurs post-scenario (used to determine specific behaviors for roll = 3).- Returns:
trueif specific post-scenario behavior is triggered (roll = 3), otherwisefalse.- Throws:
IllegalStateException- if an unexpected roll value is encountered.
-
isSubcontract
public boolean isSubcontract()Deprecated. -
getParentContract
Deprecated. -
setParentContract
Deprecated. -
isMercSubcontract
public boolean isMercSubcontract()Deprecated. -
setMercSubcontract
public void setMercSubcontract(boolean sub) Deprecated. -
checkEvents
Deprecated. -
getRandomDayOfMonth
Deprecated. -
contractExtended
Deprecated. -
getMonthlyPayOut
Deprecated.- Overrides:
getMonthlyPayOutin classAbstractMissionTransition
-
writeToXMLBegin
Deprecated.Description copied from class:AbstractMissionTransitionWrites allAbstractMissionTransitionfields to XML. Subclasses that have their own private fields must override this, callsuper.writeToXMLBegin(...), append only their private tags, and return the resulting indent.- Overrides:
writeToXMLBeginin classContract
-
loadFieldsFromXmlNode
public void loadFieldsFromXmlNode(Campaign campaign, megamek.Version version, Node node) throws ParseException Deprecated.Description copied from class:AbstractMissionTransitionParses allAbstractMissionTransitionfields from child nodes of the mission XML element. Subclasses with private fields must override this, callsuper.loadFieldsFromXmlNode(...), then handle only their own nodes.- Overrides:
loadFieldsFromXmlNodein classContract- Throws:
ParseException
-
restore
Deprecated.Restores any references to other contracts.- Parameters:
c- The Campaign which holds this contract.
-
getEmployerName
Deprecated.- Overrides:
getEmployerNamein classAbstractMissionTransition
-
addPlayerMinorBreach
public void addPlayerMinorBreach()Deprecated. -
addPlayerMinorBreaches
public void addPlayerMinorBreaches(int num) Deprecated. -
setContractScoreArbitraryModifier
public void setContractScoreArbitraryModifier(int newModifier) Deprecated. -
getBattleTypeMod
public int getBattleTypeMod()Deprecated. -
acceptContract
Deprecated.Description copied from class:AbstractMissionTransitionCalculations to be performed once the contract has been accepted.- Overrides:
acceptContractin classAbstractMissionTransition
-
clanTechSalvageOverride
public void clanTechSalvageOverride()Deprecated.Applies a salvage override rule for Clan technology based on the contract timeline and faction involvement. This method checks the factions of both the enemy and employer and determines if a salvage exchange should be forced based on whether the battle occurs before the Battle of Tukayyid.This rule was implemented to better match canon employer behavior during this period.
-
getRequiredVictoryPoints
public int getRequiredVictoryPoints()Deprecated.Calculates the number of required Victory Points (VP) needed to achieve overall success for this StratCon contract.The calculation is based on several averaged campaign parameters:
- Base requirement — Required number of combat teams multiplied by the contract length.
- Scenario odds — The mean scenario-odds percentage across all StratCon tracks, converted to a probability.
- Turning point chance — A scaling factor based on command rights:
INTEGRATEDcontracts assume a 100% chance, while all others use a one-third chance.
The final result estimates the expected number of Turning Points the player must win for overall contract success. If the player loses a handful of Turning Points, they should still be able to win the contract by being proactive in the Area of Operations.
- Returns:
- the required number of Victory Points, rounded up to the nearest integer
- Since:
- 0.50.10
-