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 String
protected boolean
protected int
protected int
protected megamek.common.EntityMovementMode
protected String
protected boolean
protected int
protected int
Fields inherited from class mekhq.campaign.parts.Part
brandNew, campaign, childParts, daysToArrival, daysToWait, hits, id, mode, name, omniPodded, parentPart, quality, quantity, resources, shorthandedMod, skillMin, T_BOTH, T_CLAN, T_IS, T_UNKNOWN, TA_GENERIC, TA_POD, tech, timeSpent, unit, unitTonnage, unitTonnageMatters, usedForRefitPlanning, workingOvertime
Fields inherited from interface megamek.common.ITechnology
DATE_ES, DATE_NONE, DATE_PS, ERA_CLAN, ERA_DA, ERA_NUM, ERA_SL, ERA_SW, F_CBR, F_CBS, F_CC, F_CCC, F_CCY, F_CF, F_CFM, F_CGB, F_CGS, F_CHH, F_CIH, F_CJF, F_CLAN, F_CMN, F_CNC, F_CP, F_CS, F_CSA, F_CSF, F_CSJ, F_CSR, F_CSV, F_CWF, F_CWM, F_CWV, F_CWX, F_DC, F_EI, F_FC, F_FR, F_FS, F_FW, F_IS, F_LC, F_MC, F_MERC, F_MH, F_NONE, F_OA, F_PER, F_RA, F_RD, F_RS, F_RW, F_TA, F_TC, F_TH, F_WB, IO_FACTION_CODES, MM_FACTION_CODES, RATING_A, RATING_B, RATING_C, RATING_D, RATING_E, RATING_F, RATING_FSTAR, RATING_X, ratingNames, TECH_BASE_ALL, TECH_BASE_CLAN, TECH_BASE_IS
-
Constructor Summary
ConstructorsConstructorDescriptionBattleArmorSuit
(String ch, String m, int ton, int t, int w, int gmp, int jmp, boolean q, boolean clan, megamek.common.EntityMovementMode mode, Campaign c) BattleArmorSuit
(megamek.common.BattleArmor ba, int loc, Campaign c) -
Method Summary
Modifier and TypeMethodDescriptionclone()
void
doMaintenanceDamage
(int d) void
fix()
megamek.common.TargetRoll
getAllMods
(Person tech) int
Gets 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.int
int
int
int
getIntroductionDate
(boolean clan) int
int
getModel()
Sticker price is the value of the part according to the rulebooksint
megamek.common.TechAdvancement
double
int
int
int
boolean
isClan()
boolean
isQuad()
void
isReplacement
(boolean value) Sets a value indicating whether or not this part is being used as a replacement.boolean
isRightTechType
(String skillType) boolean
isSamePartType
(Part part) protected void
boolean
boolean
void
Make any changes to the part needed for adding to the campaignvoid
remove
(boolean salvage) void
setTrooper
(int i) void
updateConditionFromEntity
(boolean checkForDestruction) void
void
writeToXML
(PrintWriter pw, int indent) Methods inherited from class mekhq.campaign.parts.Part
addChildPart, addTimeSpent, adjustCostsForCampaignOptions, adjustCostsForCampaignOptions, calcYearAvailability, cancelAssignment, 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, getQuantityName, getRefitUnit, getReintroductionDate, getReintroductionDate, getReintroductionDate, getRepairDesc, getRepairPartType, getReplacementPart, getSellableQuantity, getShoppingListReport, getShorthandedMod, getSimpleTechLevel, getSimpleTechLevel, getSimpleTechLevel, getSkillMin, getStaticTechLevel, getStatus, getTech, getTechBase, getTechBaseName, getTechBaseName, getTechLevel, getTechRating, getTimeLeft, getTimeSpent, getUndamagedValue, getUnit, getUnitTonnage, hasChildParts, hasParentPart, hasReplacementPart, hasWorkedOvertime, improveQuality, incrementQuantity, isBeingWorkedOn, isBrandNew, isClanTechBase, isInLocation, isInSupply, isIntroducedBy, isMixedTech, isMountedOnDestroyedLocation, isOmniPoddable, isOmniPodded, isPartForEquipmentNum, 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, writeToXMLEnd
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface megamek.common.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getAdvancedRange, 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.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:
getTonnage
in classPart
-
getStickerPrice
Description copied from interface:IPartWork
Sticker 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:
isSamePartType
in classPart
-
getSuitBV
public int getSuitBV() -
getWeaponTypeListHash
public int getWeaponTypeListHash() -
writeToXML
- Specified by:
writeToXML
in classPart
-
loadFieldsFromXmlNode
- Specified by:
loadFieldsFromXmlNode
in 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:Part
Gets a string containing details regarding the part, e.g. OmniPod or how many hits it has taken and its repair cost.- Specified by:
getDetails
in interfaceIPartWork
- Overrides:
getDetails
in classPart
- Returns:
- A string containing details regarding the part.
-
getDetails
Description copied from class:Part
Gets a string containing details regarding the part, and optionally include information on its repair status.- Specified by:
getDetails
in interfaceIPartWork
- Overrides:
getDetails
in classPart
- Parameters:
includeRepairDetails
-true
if 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:
getAllMods
in interfaceIWork
- Overrides:
getAllMods
in classPart
-
isRightTechType
- Specified by:
isRightTechType
in interfaceIPartWork
- Overrides:
isRightTechType
in classPart
-
needsFixing
public boolean needsFixing() -
checkFixable
-
doMaintenanceDamage
public void doMaintenanceDamage(int d) - Overrides:
doMaintenanceDamage
in classPart
-
getLocationName
- Specified by:
getLocationName
in classPart
-
getLocation
public int getLocation() -
needsMaintenance
public boolean needsMaintenance()- Overrides:
needsMaintenance
in classPart
-
isReplacement
public void isReplacement(boolean value) Sets a value indicating whether or not this part is being used as a replacement. -
postProcessCampaignAddition
public void postProcessCampaignAddition()Description copied from class:Part
Make any changes to the part needed for adding to the campaign- Overrides:
postProcessCampaignAddition
in classPart
-
getIntroductionDate
public int getIntroductionDate()- Specified by:
getIntroductionDate
in interfacemegamek.common.ITechnology
- Overrides:
getIntroductionDate
in classPart
-
getIntroductionDate
public int getIntroductionDate(boolean clan) - Specified by:
getIntroductionDate
in interfacemegamek.common.ITechnology
- Overrides:
getIntroductionDate
in classPart
-
getTechAdvancement
public megamek.common.TechAdvancement getTechAdvancement()- Specified by:
getTechAdvancement
in classPart
-
getMRMSOptionType
- Specified by:
getMRMSOptionType
in interfaceIPartWork
- Overrides:
getMRMSOptionType
in classPart
-