Package megamek.common.rules.core
Class CoreRulesPhysical
java.lang.Object
megamek.common.rules.RulesPhysical
megamek.common.rules.core.CoreRulesPhysical
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCan a charge be cancelled.booleancannotClubProne(int targetElevation, int attackerElevation) Can you club a prone target?checkBreakSpikes(Entity entity, int loc) Do the spikes break?booleanDoes a retractable blade break when used during the punch attack.intgetChargeDamage(Entity entity, Entity target, boolean tacOps, int mos, int hexesMoved) What is the damage of the charge.intgetChargeDamageTakenBy(Entity entity, double effectiveTargetWeight, boolean tacOps, int distance) How much damage does the charge attacker take.intReturn the claw to-hit modifier.intWhat kind of rubble can you find a club in?getFallFromAboveTable(Entity affaTarget) Get the right table for falls from above.intWhat is the kick modifier.intWhat is the target number for a lance to do internal damage.intWhat is the lance's base to-hit modifier?booleanDoes a missed mace attack cause a PSR.getMissedChargeDisplacement(Game game, int entityId, Coords src, int direction) Missed charges, where does the attacker end up?intgetPilotDiffModifier(int attackerPiloting, int targetPiloting, boolean immobile) For Charge/DFA, get the pilot difference modifier.intDo we have a modifier for punching.intgetShieldDamageBoost(Entity entity, int armLoc) Do shields boost punch damage.voidgetShieldToHitModifier(ToHitData toHit, Entity attacker, Mounted<?> weapon) What is the to-hit modifier for attacking when there is a shield on the arm.booleanCan talons increase DFA damage.booleanDoes the lance do anything special on a charge?booleanShould the shield reset with phase change.booleanquadMuleKickImpossible(int leg, Entity entity) Check if the quad can kickbooleanretractableBladeArmCheck(boolean toRetractableBlade) Can retractable blades be used during punch attacks.shieldChargeDamage(Entity attackingEntity) Does a shield do anything in a charge?
-
Constructor Details
-
CoreRulesPhysical
public CoreRulesPhysical()
-
-
Method Details
-
getShieldDamageBoost
Do shields boost punch damage. Shield rules for damage while punching. Core p.195- Specified by:
getShieldDamageBoostin classRulesPhysical- Parameters:
entity- the entity attackingarmLoc- the arm location with the shield- Returns:
- the damage boost from the shield
-
getShieldToHitModifier
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:
getShieldToHitModifierin classRulesPhysical- Parameters:
toHit- the to-hit data to modifyattacker- the attacking entityweapon- the mounted weapon being used
-
getLanceToHitModifier
public int getLanceToHitModifier()What is the lance's base to-hit modifier? core p.194- Specified by:
getLanceToHitModifierin classRulesPhysical- Returns:
-
getClawToHitModifier
public int getClawToHitModifier()Return the claw to-hit modifier. Claws now have a TN modifier of 0. Core p.194- Specified by:
getClawToHitModifierin classRulesPhysical- 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:
phaseChangeShieldin classRulesPhysical- 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:
retractableBladeArmCheckin classRulesPhysical- 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:
checkRetractableBladeBrokein classRulesPhysical- 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:
getMaceMissedPSRin classRulesPhysical- 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:
getLanceTargetin classRulesPhysical- 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:
isLanceChargingin classRulesPhysical- Returns:
- true if the lance has special charge effects
-
shieldChargeDamage
Does a shield do anything in a charge? Charge with shield allocated damage to shield. Core p.195- Specified by:
shieldChargeDamagein classRulesPhysical- Parameters:
attackingEntity- the entity performing the charge- Returns:
- the hit data from shield charge damage, or null if no shield damage
-
checkBreakSpikes
Do the spikes break? Check if the spikes break on a 1. Core p.196- Specified by:
checkBreakSpikesin classRulesPhysical- Parameters:
entity- the entity with spikesloc- the location being checked- Returns:
- a report of whether spikes broke
-
hasTalons
Can talons increase DFA damage. Require all limbs to have talons for a DFA damage boost. Core p.196- Specified by:
hasTalonsin classRulesPhysical- 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:
getKickModifierin classRulesPhysical- 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:
getPunchModifierin classRulesPhysical- Returns:
- the punch modifier
-
getChargeDamage
What is the damage of the charge. Charges deal different damage Core p.78- Specified by:
getChargeDamagein classRulesPhysical- Parameters:
entity- the attacking entitytarget- the target entitytacOps- true if using tactical operations rulesmos- the margin of successhexesMoved- 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:
getChargeDamageTakenByin classRulesPhysical- Parameters:
entity- the attacking entityeffectiveTargetWeight- the effective weight of the targettacOps- true if using tactical operations rulesdistance- the distance traveled in the charge- Returns:
- the damage taken by the attacker
-
getMissedChargeDisplacement
Missed charges, where does the attacker end up? Missed charges the attacker remains in place. Core p.78- Specified by:
getMissedChargeDisplacementin classRulesPhysical- Parameters:
game- the game instanceentityId- the ID of the charging entitysrc- the source coordinatesdirection- 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:
cannotClubPronein classRulesPhysical- Parameters:
targetElevation- the elevation of the targetattackerElevation- 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:
getPilotDiffModifierin classRulesPhysical- Parameters:
attackerPiloting- the piloting skill of the attacking pilottargetPiloting- the piloting skill of the defending pilotimmobile- 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:
canChargeCancelin classRulesPhysical- Returns:
- true if a charge can be cancelled
-
getFallFromAboveTable
Get the right table for falls from above. Falls from above if the target is prone changes table. Core p.115- Specified by:
getFallFromAboveTablein classRulesPhysical- 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:
getClubFindInRubblein classRulesPhysical- Returns:
- the level of the rubble needed
-
quadMuleKickImpossible
Check if the quad can kick Core p.238- Specified by:
quadMuleKickImpossiblein classRulesPhysical- Parameters:
leg- what leg is kickingentity- the entity that is kicking- Returns:
- true if the kick is impossible
-