Class CoreRulesPhysical

java.lang.Object
megamek.common.rules.RulesPhysical
megamek.common.rules.core.CoreRulesPhysical

public class CoreRulesPhysical extends RulesPhysical
  • Constructor Details

    • CoreRulesPhysical

      public CoreRulesPhysical()
  • Method Details

    • getShieldDamageBoost

      public int getShieldDamageBoost(Entity entity, int armLoc)
      Do shields boost punch damage. Shield rules for damage while punching. Core p.195
      Specified by:
      getShieldDamageBoost in class RulesPhysical
      Parameters:
      entity - the entity attacking
      armLoc - the arm location with the shield
      Returns:
      the damage boost from the shield
    • getShieldToHitModifier

      public void getShieldToHitModifier(ToHitData toHit, Entity attacker, Mounted<?> weapon)
      What is the to-hit modifier for attacking when there is a shield on the arm. Core rules shield no longer modifies shooting out
      Specified by:
      getShieldToHitModifier in class RulesPhysical
      Parameters:
      toHit - the to-hit data to modify
      attacker - the attacking entity
      weapon - the mounted weapon being used
    • getLanceToHitModifier

      public int getLanceToHitModifier()
      What is the lance's base to-hit modifier? core p.194
      Specified by:
      getLanceToHitModifier in class RulesPhysical
      Returns:
    • getClawToHitModifier

      public int getClawToHitModifier()
      Return the claw to-hit modifier. Claws now have a TN modifier of 0. Core p.194
      Specified by:
      getClawToHitModifier in class RulesPhysical
      Returns:
      the claw to-hit modifier
    • phaseChangeShield

      public boolean phaseChangeShield()
      Should the shield reset with phase change. Shields reset their state at the end of the phase
      Specified by:
      phaseChangeShield in class RulesPhysical
      Returns:
      true if the shield resets with phase change
    • retractableBladeArmCheck

      public boolean retractableBladeArmCheck(boolean toRetractableBlade)
      Can retractable blades be used during punch attacks. Retractable blades can be extended for punches. Core p.194
      Specified by:
      retractableBladeArmCheck in class RulesPhysical
      Parameters:
      toRetractableBlade - true if checking for retractable blade use
      Returns:
      true if retractable blades can be used
    • checkRetractableBladeBroke

      public boolean checkRetractableBladeBroke()
      Does a retractable blade break when used during the punch attack. Retractable blade breaks if it is used in a punch. Core p.195
      Specified by:
      checkRetractableBladeBroke in class RulesPhysical
      Returns:
      true if the retractable blade breaks
    • getMaceMissedPSR

      public boolean getMaceMissedPSR()
      Does a missed mace attack cause a PSR. Missed mace attacks do not cause PSR Core p.194
      Specified by:
      getMaceMissedPSR in class RulesPhysical
      Returns:
      true if a missed mace causes a piloting skill roll
    • getLanceTarget

      public int getLanceTarget()
      What is the target number for a lance to do internal damage. Lance does internal damage on 9+ Core p.194
      Specified by:
      getLanceTarget in class RulesPhysical
      Returns:
      the target number
    • isLanceCharging

      public boolean isLanceCharging()
      Does the lance do anything special on a charge? Lance can penetrate on a charge. Core p.194
      Specified by:
      isLanceCharging in class RulesPhysical
      Returns:
      true if the lance has special charge effects
    • shieldChargeDamage

      @Nullable public HitData shieldChargeDamage(Entity attackingEntity)
      Does a shield do anything in a charge? Charge with shield allocated damage to shield. Core p.195
      Specified by:
      shieldChargeDamage in class RulesPhysical
      Parameters:
      attackingEntity - the entity performing the charge
      Returns:
      the hit data from shield charge damage, or null if no shield damage
    • checkBreakSpikes

      public Report checkBreakSpikes(Entity entity, int loc)
      Do the spikes break? Check if the spikes break on a 1. Core p.196
      Specified by:
      checkBreakSpikes in class RulesPhysical
      Parameters:
      entity - the entity with spikes
      loc - the location being checked
      Returns:
      a report of whether spikes broke
    • hasTalons

      public boolean hasTalons(Entity entity)
      Can talons increase DFA damage. Require all limbs to have talons for a DFA damage boost. Core p.196
      Specified by:
      hasTalons in class RulesPhysical
      Parameters:
      entity - the entity to check
      Returns:
      true if the entity has talons
    • getKickModifier

      public int getKickModifier()
      What is the kick modifier. Kicks are -1 to hit. Core p.81
      Specified by:
      getKickModifier in class RulesPhysical
      Returns:
      the kick modifier
    • getPunchModifier

      public int getPunchModifier()
      Do we have a modifier for punching. Punches are -1 to hit. Core p.82
      Specified by:
      getPunchModifier in class RulesPhysical
      Returns:
      the punch modifier
    • getChargeDamage

      public int getChargeDamage(Entity entity, Entity target, boolean tacOps, int mos, int hexesMoved)
      What is the damage of the charge. Charges deal different damage Core p.78
      Specified by:
      getChargeDamage in class RulesPhysical
      Parameters:
      entity - the attacking entity
      target - the target entity
      tacOps - true if using tactical operations rules
      mos - the margin of success
      hexesMoved - the number of hexes moved in the charge
      Returns:
      the charge damage
    • getChargeDamageTakenBy

      public int getChargeDamageTakenBy(Entity entity, double effectiveTargetWeight, boolean tacOps, int distance)
      How much damage does the charge attacker take. Attacker damage from a charge. Core p.78
      Specified by:
      getChargeDamageTakenBy in class RulesPhysical
      Parameters:
      entity - the attacking entity
      effectiveTargetWeight - the effective weight of the target
      tacOps - true if using tactical operations rules
      distance - the distance traveled in the charge
      Returns:
      the damage taken by the attacker
    • getMissedChargeDisplacement

      public Coords getMissedChargeDisplacement(Game game, int entityId, Coords src, int direction)
      Missed charges, where does the attacker end up? Missed charges the attacker remains in place. Core p.78
      Specified by:
      getMissedChargeDisplacement in class RulesPhysical
      Parameters:
      game - the game instance
      entityId - the ID of the charging entity
      src - the source coordinates
      direction - the direction of the charge
      Returns:
      the final coordinates after a missed charge
    • cannotClubProne

      public boolean cannotClubProne(int targetElevation, int attackerElevation)
      Can you club a prone target? Can club prone enemies that are elevated or at your feet. Core p.77
      Specified by:
      cannotClubProne in class RulesPhysical
      Parameters:
      targetElevation - the elevation of the target
      attackerElevation - the elevation of the attacker
      Returns:
      true if the target cannot be clubbed while prone
    • getPilotDiffModifier

      public int getPilotDiffModifier(int attackerPiloting, int targetPiloting, boolean immobile)
      For Charge/DFA, get the pilot difference modifier. Charges and DFAs when attacking an immobile unit use a value of 4 for their piloting. Core p.77
      Specified by:
      getPilotDiffModifier in class RulesPhysical
      Parameters:
      attackerPiloting - the piloting skill of the attacking pilot
      targetPiloting - the piloting skill of the defending pilot
      immobile - true if one of the entities is immobile
      Returns:
      the pilot difference modifier
    • canChargeCancel

      public boolean canChargeCancel()
      Can a charge be cancelled. Can charge cancel under some circumstances. Core p.78
      Specified by:
      canChargeCancel in class RulesPhysical
      Returns:
      true if a charge can be cancelled
    • getFallFromAboveTable

      public HitData getFallFromAboveTable(Entity affaTarget)
      Get the right table for falls from above. Falls from above if the target is prone changes table. Core p.115
      Specified by:
      getFallFromAboveTable in class RulesPhysical
      Parameters:
      affaTarget - the entity that is the target of a fall from above
      Returns:
      the hit data for fall from above
    • getClubFindInRubble

      public int getClubFindInRubble()
      What kind of rubble can you find a club in? We can find clubs in any rubble. Core p.79
      Specified by:
      getClubFindInRubble in class RulesPhysical
      Returns:
      the level of the rubble needed
    • quadMuleKickImpossible

      public boolean quadMuleKickImpossible(int leg, Entity entity)
      Check if the quad can kick Core p.238
      Specified by:
      quadMuleKickImpossible in class RulesPhysical
      Parameters:
      leg - what leg is kicking
      entity - the entity that is kicking
      Returns:
      true if the kick is impossible