Package megamek.common.rules.core
Class CoreRulesTarget
java.lang.Object
megamek.common.rules.RulesTarget
megamek.common.rules.core.CoreRulesTarget
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImmobileMod(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 necessarybooleanDo we hit the aimed location?intgetArmActuatorHitMod(Entity attacker, int location) What is the arm actuator hit mod for shooting.intDo we reduce smoke?intWhat is the secondary arc modifier.intlargeTargetModifier(int weightclass, boolean markedLarge) Check if the target is large and if there is a modifier.booleanproneFireWithOneArm(boolean toProneFire) Can you shoot with one arm while prone.Methods inherited from class megamek.common.rules.RulesTarget
getSecondaryTargetModifier, largeTargetModifier, largeTargetModifier
-
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:
largeTargetModifierin classRulesTarget- Parameters:
weightclass- the weight class of the targetmarkedLarge- 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:
checkAimedLocationin classRulesTarget- 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:
getSecondaryArcModifierin classRulesTarget- 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:
proneFireWithOneArmin classRulesTarget- Parameters:
toProneFire- true if checking prone fire capability- Returns:
- true if you can shoot with one arm while prone
-
getArmActuatorHitMod
What is the arm actuator hit mod for shooting. Only upper arm actuators increase the to hit for shooting. Core p.97- Specified by:
getArmActuatorHitModin classRulesTarget- Parameters:
attacker- the attacking entitylocation- the arm location being used- Returns:
- the arm actuator hit modifier
-
getBAPSmokeReduction
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:
getBAPSmokeReductionin classRulesTarget- 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:
addImmobileModin classRulesTarget- Parameters:
target- Targetable being attackedtoHit- Existing ToHitDataaimingAt- Aimed-at location, if applicableweaponType- Type of attacking weaponweapon- The weapon itselfammoType- Type of ammomunition- Collection of munition informationentityTarget- Entity version of the target, if it's an entity, else nullaimingMode- Aiming mode dataNote: modifies the passed-in ToHitData toHit.
-