Package mekhq.campaign.parts
Class BattleArmorSuit
java.lang.Object
mekhq.campaign.parts.Part
mekhq.campaign.parts.BattleArmorSuit
Battle Armor suits are crazy - you can't crit the equipment in them, so if we remove the suit we should remove all
the equipment with the same trooper and track its value and tonnage in the suit object. As of 0.3.16, we are doing
this differently. We are now using the linked child and parent part ids from the Part java to link the suit to all of
its constituent equipment and armor. This stuff is then pulled off the unit and put back on with the
BattleArmorSuit.remove and MissingBattleArmorSuit.fix methods. This allows us to adjust for the fact that modular
equipment can now be removed separately. We still need to figure out how to acquire new suits that come pre-packaged
with all of their equipment.
-
Nested Class Summary
Nested classes/interfaces inherited from class mekhq.campaign.parts.Part
Part.PartPersonRef, Part.PartRef, Part.PartUnitRef -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected booleanprotected intprotected intprotected megamek.common.units.EntityMovementModeprotected Stringprotected booleanprotected intprotected intFields inherited from class mekhq.campaign.parts.Part
brandNew, campaign, childParts, daysToArrival, daysToWait, hits, id, mode, name, omniPodded, parentPart, quality, quantity, resources, shorthandedMod, skillMin, TA_GENERIC, TA_POD, tech, timeSpent, unit, unitTonnage, unitTonnageMatters, usedForRefitPlanning, workingOvertimeFields inherited from interface megamek.common.interfaces.ITechnology
DATE_ES, DATE_NONE, DATE_PS -
Constructor Summary
ConstructorsConstructorDescriptionBattleArmorSuit(String ch, String m, int ton, int t, int w, int gmp, int jmp, boolean q, boolean clan, megamek.common.units.EntityMovementMode mode, Campaign c) BattleArmorSuit(megamek.common.battleArmor.BattleArmor ba, int loc, Campaign c) -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddoMaintenanceDamage(int d) voidfix()megamek.common.rolls.TargetRollgetAllMods(Person tech) intGets a string containing details regarding the part, e.g.getDetails(boolean includeRepairDetails) Gets a string containing details regarding the part, and optionally include information on its repair status.intintintintgetIntroductionDate(boolean clan) intintgetModel()Sticker price is the value of the part according to the rulebooksintmegamek.common.TechAdvancementdoubleintintintbooleanisClan()booleanisQuad()voidisReplacement(boolean value) Sets a value indicating whether this part is being used as a replacement.booleanisRightTechType(String skillType) booleanisSamePartType(Part part) protected voidbooleanbooleanvoidMake any changes to the part needed for adding to the campaignvoidremove(boolean salvage) voidsetTrooper(int i) voidupdateConditionFromEntity(boolean checkForDestruction) voidvoidwriteToXML(PrintWriter pw, int indent) Methods inherited from class mekhq.campaign.parts.Part
addChildPart, addTimeSpent, adjustCostsForCampaignOptions, adjustCostsForCampaignOptions, calcYearAvailability, cancelReservation, canChangeWorkMode, canNeverScrap, changeQuantity, checkScrappable, copyBaseData, decrementDaysToWait, decrementQuantity, fail, findPartImage, fixReferences, generateInstanceFromXML, getAcquisitionWork, getActualTime, getActualValue, getAllModsForMaintenance, getArrivalReport, getAvailability, getBaseAvailability, getCampaign, getChildParts, getCommonDate, getCommonDate, getCurrentModeName, getDaysToArrival, getDaysToWait, getDesc, getExtinctionDate, getExtinctionDate, getExtinctionDate, getHits, getId, getIntroductionDate, getMode, getName, getParentPart, getPartName, getProductionDate, getProductionDate, getProductionDate, getPrototypeDate, getPrototypeDate, getPrototypeDate, getQuality, getQualityName, getQuantity, getQuantityForPartsInUse, getQuantityName, getRefitUnit, getReintroductionDate, getReintroductionDate, getReintroductionDate, getRepairDesc, getRepairPartType, getReplacementPart, getReservedBy, getSellableQuantity, getShoppingListReport, getShorthandedMod, getSimpleTechLevel, getSimpleTechLevel, getSimpleTechLevel, getSkillMin, getStaticTechLevel, getStatus, getTech, getTechBase, getTechBaseName, getTechBaseName, getTechLevel, getTechRating, getTimeLeft, getTimeSpent, getTotalQuantity, getUndamagedValue, getUnit, getUnitTonnage, hasChildParts, hasParentPart, hasReplacementPart, hasWorkedOvertime, improveQuality, incrementQuantity, isBeingWorkedOn, isBrandNew, isClanTechBase, isInLocation, isInSupply, isIntroducedBy, isMixedTech, isMountedOnDestroyedLocation, isOmniPoddable, isOmniPodded, isPartForEquipmentNum, isPartUsedOrReserved, isPresent, isPriceAdjustedForAmount, isReservedForRefit, isReservedForReplacement, isSalvaging, isSamePartTypeAndStatus, isSameStatus, isSpare, isTeamSalvaging, isUnitTonnageMatters, isUsedForRefitPlanning, onBadHipOrShoulder, reduceQuality, removeAllChildParts, removeChildPart, reservePart, resetDaysToWait, resetModeToNormal, resetOvertime, resetRepairSettings, resetTimeSpent, scrap, setBrandNew, setCampaign, setDaysToArrival, setHits, setId, setMode, setOmniPodded, setParentPart, setQuality, setQuantity, setRefitUnit, setReplacementPart, setReservedBy, setShorthandedMod, setSkillMin, setTech, setUnit, setUsedForRefitPlanning, setWorkedOvertime, succeed, toString, writeToXMLBegin, writeToXMLEndMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface mekhq.campaign.work.IPartWork
cancelAssignmentMethods inherited from interface megamek.common.interfaces.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getAdvancedRange, getCodeFromIOAbbr, getCodeFromMMAbbr, getEraAvailabilityName, getEraAvailabilityName, getExperimentalRange, getExperimentalRange, getExtinctionRange, getExtinctionRange, getFullRatingName, getFullRatingName, getSimpleLevel, getSimpleLevel, getSimpleLevel, getStandardRange, getStandardRange, getTechLevel, getTechLevel, getTechRatingName, isAvailableIn, isAvailableIn, isAvailableIn, isExtinct, isExtinct, isExtinct, isIntroLevel, isLegal, isLegal, isUnofficial
-
Field Details
-
chassis
-
model
-
clan
protected boolean clan -
trooper
protected int trooper -
quad
protected boolean quad -
groundMP
protected int groundMP -
jumpMP
protected int jumpMP -
jumpType
protected megamek.common.units.EntityMovementMode jumpType -
weightClass
protected int weightClass
-
-
Constructor Details
-
BattleArmorSuit
public BattleArmorSuit() -
BattleArmorSuit
-
BattleArmorSuit
-
-
Method Details
-
clone
-
getTrooper
public int getTrooper() -
setTrooper
public void setTrooper(int i) -
getTonnage
public double getTonnage()- Specified by:
getTonnagein classPart
-
getStickerPrice
Description copied from interface:IPartWorkSticker price is the value of the part according to the rulebooks- Returns:
- the part's sticker price
-
isClan
public boolean isClan() -
isQuad
public boolean isQuad() -
getWeightClass
public int getWeightClass() -
getGroundMP
public int getGroundMP() -
getJumpMP
public int getJumpMP() -
getChassis
-
getModel
-
isSamePartType
- Specified by:
isSamePartTypein classPart
-
getSuitBV
public int getSuitBV() -
getWeaponTypeListHash
public int getWeaponTypeListHash() -
writeToXML
- Specified by:
writeToXMLin classPart
-
loadFieldsFromXmlNode
- Specified by:
loadFieldsFromXmlNodein classPart
-
fix
public void fix() -
getMissingPart
-
remove
public void remove(boolean salvage) -
updateConditionFromEntity
public void updateConditionFromEntity(boolean checkForDestruction) -
getBaseTime
public int getBaseTime() -
getDifficulty
public int getDifficulty()- Returns:
- the base difficulty of this work unit
-
getDetails
Description copied from class:PartGets a string containing details regarding the part, e.g. OmniPod or how many hits it has taken and its repair cost.- Specified by:
getDetailsin interfaceIPartWork- Overrides:
getDetailsin classPart- Returns:
- A string containing details regarding the part.
-
getDetails
Description copied from class:PartGets a string containing details regarding the part, and optionally include information on its repair status.- Specified by:
getDetailsin interfaceIPartWork- Overrides:
getDetailsin classPart- Parameters:
includeRepairDetails-trueif the details should include information such as the number of hits or how much it would cost to repair the part.- Returns:
- A string containing details regarding the part.
-
updateConditionFromPart
public void updateConditionFromPart() -
getAllMods
- Specified by:
getAllModsin interfaceIWork- Overrides:
getAllModsin classPart
-
isRightTechType
- Specified by:
isRightTechTypein interfaceIPartWork- Overrides:
isRightTechTypein classPart
-
needsFixing
public boolean needsFixing() -
checkFixable
-
doMaintenanceDamage
public void doMaintenanceDamage(int d) - Overrides:
doMaintenanceDamagein classPart
-
getLocationName
- Specified by:
getLocationNamein classPart
-
getLocation
public int getLocation() -
needsMaintenance
public boolean needsMaintenance()- Overrides:
needsMaintenancein classPart
-
isReplacement
public void isReplacement(boolean value) Sets a value indicating whether this part is being used as a replacement. -
postProcessCampaignAddition
public void postProcessCampaignAddition()Description copied from class:PartMake any changes to the part needed for adding to the campaign- Overrides:
postProcessCampaignAdditionin classPart
-
getIntroductionDate
public int getIntroductionDate()- Specified by:
getIntroductionDatein interfacemegamek.common.interfaces.ITechnology- Overrides:
getIntroductionDatein classPart
-
getIntroductionDate
public int getIntroductionDate(boolean clan) - Specified by:
getIntroductionDatein interfacemegamek.common.interfaces.ITechnology- Overrides:
getIntroductionDatein classPart
-
getTechAdvancement
public megamek.common.TechAdvancement getTechAdvancement()- Specified by:
getTechAdvancementin classPart
-
getMRMSOptionType
- Specified by:
getMRMSOptionTypein interfaceIPartWork- Overrides:
getMRMSOptionTypein classPart
-