Class BattleArmorSuit

java.lang.Object
mekhq.campaign.parts.Part
mekhq.campaign.parts.BattleArmorSuit
All Implemented Interfaces:
megamek.common.ITechnology, IPartWork, IWork

public class BattleArmorSuit extends Part
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.
  • Field Details

    • chassis

      protected String chassis
    • model

      protected String 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

      public BattleArmorSuit(megamek.common.BattleArmor ba, int loc, Campaign c)
    • BattleArmorSuit

      public BattleArmorSuit(String ch, String m, int ton, int t, int w, int gmp, int jmp, boolean q, boolean clan, megamek.common.EntityMovementMode mode, Campaign c)
  • Method Details

    • clone

      public BattleArmorSuit clone()
      Specified by:
      clone in class Part
    • getTrooper

      public int getTrooper()
    • setTrooper

      public void setTrooper(int i)
    • getTonnage

      public double getTonnage()
      Specified by:
      getTonnage in class Part
    • getStickerPrice

      public Money 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()
      Specified by:
      isClan in interface megamek.common.ITechnology
      Overrides:
      isClan in class Part
    • isQuad

      public boolean isQuad()
    • getWeightClass

      public int getWeightClass()
    • getGroundMP

      public int getGroundMP()
    • getJumpMP

      public int getJumpMP()
    • getChassis

      public String getChassis()
    • getModel

      public String getModel()
    • isSamePartType

      public boolean isSamePartType(Part part)
      Specified by:
      isSamePartType in class Part
    • getSuitBV

      public int getSuitBV()
    • getWeaponTypeListHash

      public int getWeaponTypeListHash()
    • writeToXML

      public void writeToXML(PrintWriter pw, int indent)
      Specified by:
      writeToXML in class Part
    • loadFieldsFromXmlNode

      protected void loadFieldsFromXmlNode(Node wn)
      Specified by:
      loadFieldsFromXmlNode in class Part
    • fix

      public void fix()
      Specified by:
      fix in interface IPartWork
      Overrides:
      fix in class Part
    • getMissingPart

      public MissingPart 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

      public String 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 interface IPartWork
      Overrides:
      getDetails in class Part
      Returns:
      A string containing details regarding the part.
    • getDetails

      public String getDetails(boolean includeRepairDetails)
      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 interface IPartWork
      Overrides:
      getDetails in class Part
      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

      public megamek.common.TargetRoll getAllMods(Person tech)
      Specified by:
      getAllMods in interface IWork
      Overrides:
      getAllMods in class Part
    • isRightTechType

      public boolean isRightTechType(String skillType)
      Specified by:
      isRightTechType in interface IPartWork
      Overrides:
      isRightTechType in class Part
    • needsFixing

      public boolean needsFixing()
    • checkFixable

      @Nullable public String checkFixable()
    • doMaintenanceDamage

      public void doMaintenanceDamage(int d)
      Overrides:
      doMaintenanceDamage in class Part
    • getLocationName

      public String getLocationName()
      Specified by:
      getLocationName in class Part
    • getLocation

      public int getLocation()
    • needsMaintenance

      public boolean needsMaintenance()
      Overrides:
      needsMaintenance in class Part
    • 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 class Part
    • getIntroductionDate

      public int getIntroductionDate()
      Specified by:
      getIntroductionDate in interface megamek.common.ITechnology
      Overrides:
      getIntroductionDate in class Part
    • getIntroductionDate

      public int getIntroductionDate(boolean clan)
      Specified by:
      getIntroductionDate in interface megamek.common.ITechnology
      Overrides:
      getIntroductionDate in class Part
    • getTechAdvancement

      public megamek.common.TechAdvancement getTechAdvancement()
      Specified by:
      getTechAdvancement in class Part
    • getMRMSOptionType

      public PartRepairType getMRMSOptionType()
      Specified by:
      getMRMSOptionType in interface IPartWork
      Overrides:
      getMRMSOptionType in class Part