Class CoreRulesTarget

java.lang.Object
megamek.common.rules.RulesTarget
megamek.common.rules.core.CoreRulesTarget

public class CoreRulesTarget extends RulesTarget
  • Constructor Details

    • CoreRulesTarget

      public CoreRulesTarget()
  • Method Details

    • largeTargetModifier

      public int largeTargetModifier(int weightclass, boolean markedLarge)
      Check if the target is large and if there is a modifier. Large targets get a -1 modifier to hit them. Superheavy meks are large targets Core rules page 64, 240
      Specified by:
      largeTargetModifier in class RulesTarget
      Parameters:
      weightclass - the weight class of the target
      markedLarge - true if the target is marked as large
      Returns:
      the large target modifier
    • checkAimedLocation

      public boolean checkAimedLocation()
      Do we hit the aimed location? Aimed shots hit on d6 4+. Core p.70
      Specified by:
      checkAimedLocation in class RulesTarget
      Returns:
      true if the aimed location is hit
    • getSecondaryArcModifier

      public int getSecondaryArcModifier()
      What is the secondary arc modifier. Secondary arcs are +1. Core p.64
      Specified by:
      getSecondaryArcModifier in class RulesTarget
      Returns:
      the secondary arc modifier
    • proneFireWithOneArm

      public boolean proneFireWithOneArm(boolean toProneFire)
      Can you shoot with one arm while prone. Can shoot with one arm while prone. Core p.67
      Specified by:
      proneFireWithOneArm in class RulesTarget
      Parameters:
      toProneFire - true if checking prone fire capability
      Returns:
      true if you can shoot with one arm while prone
    • getArmActuatorHitMod

      public int getArmActuatorHitMod(Entity attacker, int location)
      What is the arm actuator hit mod for shooting. Only upper arm actuators increase the to hit for shooting. Core p.97
      Specified by:
      getArmActuatorHitMod in class RulesTarget
      Parameters:
      attacker - the attacking entity
      location - the arm location being used
      Returns:
      the arm actuator hit modifier
    • getBAPSmokeReduction

      public int getBAPSmokeReduction(LosEffects los)
      Do we reduce smoke? BAP reduces smoke within its range. It is blocked by ECM (Handled prior to this call) Core p.197, 124
      Specified by:
      getBAPSmokeReduction in class RulesTarget
      Parameters:
      los - the line of sight effects
      Returns:
      the BAP smoke reduction amount
    • addImmobileMod

      public void addImmobileMod(Targetable target, ToHitData toHit, int aimingAt, WeaponType weaponType, WeaponMounted weapon, AmmoType ammoType, EnumSet<AmmoType.Munitions> munition, Entity entityTarget, AimingMode aimingMode)
      Compute whether this specific target will get an immobile mod, and applies the mod if necessary Note: all Ranged attack roll calls _must_ go through addImmobileMod to get to getImmobileMod or they may illegally gain the -4 Immobile Target mod. Note: modifies the passed-in ToHitData toHit.
      Specified by:
      addImmobileMod in class RulesTarget
      Parameters:
      target - Targetable being attacked
      toHit - Existing ToHitData
      aimingAt - Aimed-at location, if applicable
      weaponType - Type of attacking weapon
      weapon - The weapon itself
      ammoType - Type of ammo
      munition - Collection of munition information
      entityTarget - Entity version of the target, if it's an entity, else null
      aimingMode - Aiming mode data

      Note: modifies the passed-in ToHitData toHit.