Class CoreRulesWeapons

java.lang.Object
megamek.common.rules.RulesWeapons
megamek.common.rules.core.CoreRulesWeapons

public class CoreRulesWeapons extends RulesWeapons
  • Constructor Details

    • CoreRulesWeapons

      public CoreRulesWeapons()
  • Method Details

    • getRACUnjamRestriction

      public boolean getRACUnjamRestriction()
      Does a RAC unjamming cause issues? RAC unjamming does not limit other actions outside of movement Core p.183
      Specified by:
      getRACUnjamRestriction in class RulesWeapons
      Returns:
      true if RAC unjamming has restrictions
    • getATMClusterSize

      public int getATMClusterSize()
      What size do ATMs cluster in. ATM cluster size Core p.186
      Specified by:
      getATMClusterSize in class RulesWeapons
      Returns:
      the ATM cluster size
    • canUACsJam

      public boolean canUACsJam()
      Can ultra autocannons jam? Core writes the ultra autocannon, of every kind, without a jam (Core p.183).
      Specified by:
      canUACsJam in class RulesWeapons
      Returns:
      true if ultra autocannons can jam
    • setACHit

      public void setACHit(CriticalSlot cs, Mounted<?> mounted, Vector<Report> reports, int entityId)
      Applies the autocannon exception to a weapon critical where the unit's critical-hit rules permit it. The first critical hit "applied to an autocannon of any class or variety" does not destroy it, which Core p.183 applies to the standard, LB-X, light, ProtoMek, rotary and ultra autocannons it lists. Capital-scale naval autocannons are not in Core and keep the Total Warfare critical hit.
      Specified by:
      setACHit in class RulesWeapons
      Parameters:
      cs - the critical slot being hit, or null for a unit without critical slots
      mounted - the mounted weapon
      reports - vector of reports describing the hit
      entityId - the ID of the entity being hit
    • getELRMMinimumRackSize

      public int getELRMMinimumRackSize(int rackSize)
      Do ELRMs reduce rack size under minimums? ELRMS under minimum do not reduce missiles that hit. Core p.186
      Specified by:
      getELRMMinimumRackSize in class RulesWeapons
      Parameters:
      rackSize - the rack size
      Returns:
      the minimum ELRM rack size
    • getMRMModifier

      public int getMRMModifier(int modifier)
      What is the modifier on MRMs. MRMs have no additional modifier Core p.186
      Specified by:
      getMRMModifier in class RulesWeapons
      Parameters:
      modifier - the base modifier
      Returns:
      the MRM modifier
    • getMRMClusterModifier

      public int getMRMClusterModifier(boolean apollo)
      What is the cluster modifier for MRMs. MRMs are -1 on the cluster hit Core p.186. With apollo they are 0. Core p.197
      Specified by:
      getMRMClusterModifier in class RulesWeapons
      Parameters:
      apollo - true if Apollo fire control is used
      Returns:
      the MRM cluster modifier
    • getApolloToHit

      public int getApolloToHit()
      Does Apollo change to-hit number. Apollo does not change the to-hit Core p.197
      Specified by:
      getApolloToHit in class RulesWeapons
      Returns:
      the Apollo to-hit modifier
    • flamerHeatAndDamage

      public boolean flamerHeatAndDamage(boolean bmmFlamers)
      Do flamers do damage and heat. Flamers do heat and damage Core p.183
      Specified by:
      flamerHeatAndDamage in class RulesWeapons
      Parameters:
      bmmFlamers - true if using alternate flamer rules
      Returns:
      true if flamers do both damage and heat
    • checkPPCCapacitor

      @Nullable public Report checkPPCCapacitor(int roll, Entity attackingEntity, WeaponMounted weapon)
      PPC Capacitor check. PPC Capacitors don't break on roll. Core p.188
      Specified by:
      checkPPCCapacitor in class RulesWeapons
      Parameters:
      roll - the dice roll result
      attackingEntity - the entity firing the PPC
      weapon - the PPC weapon being fired
      Returns:
      a report of the capacitor check result
    • getMGABonus

      public int getMGABonus()
      Increase the number of hits for MGA. MGA gives +2 to cluster roll. Core p.185
      Specified by:
      getMGABonus in class RulesWeapons
      Returns:
      the MGA bonus
    • canHGRTriggerPSR

      public boolean canHGRTriggerPSR(int mpUsed, int weightClass)
      Does the HGR trigger a PSR? Firing a heavy Gauss rifle does not cause a PSR (Core p.184)
      Specified by:
      canHGRTriggerPSR in class RulesWeapons
      Parameters:
      mpUsed - the movement points used
      weightClass - the weight class of the unit
      Returns:
      true if HGR can trigger a piloting skill roll
    • getApolloSaturationMode

      public boolean getApolloSaturationMode()
      Does Apollo have saturation mode? The Apollo FCS has a saturation mode (Core p.197)
      Overrides:
      getApolloSaturationMode in class RulesWeapons
      Returns:
      default of false. This is only in core and newer.
    • thunderboltMinimum

      public double thunderboltMinimum(double toReturn, int nRange, int minRange, boolean hotLoaded)
      Do thunderbolts halve their damage under minimums Core writes the Thunderbolt launcher without halving damage under minimum range (Core p.187)
      Specified by:
      thunderboltMinimum in class RulesWeapons
      Parameters:
      toReturn - the damage
      nRange - the range
      minRange - minimum range
      hotLoaded - are they hotloaded
      Returns:
      return the modified damage