Package megamek.common.compute.damage
Enum Class PreExistingDamageLevel
- All Implemented Interfaces:
Serializable,Comparable<PreExistingDamageLevel>,Constable
The pre-existing damage levels from the Pre-Existing Damage Table (First Succession War, p.145). Each level states
how many points of damage a unit receives per 5 tons of mass and how many guaranteed critical hits it suffers.
Damage is distributed randomly in 5-point (or fraction thereof) groups. LIGHT never rolls critical
hits, even when internal structure is damaged; MODERATE and HEAVY also roll for critical hits
caused by internal structure damage.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription1D6 roll of 6: 4 points per 5 tons, two guaranteed critical hits plus internal structure crits.1D6 roll of 2-3: 1 point per 5 tons, no critical hits even if internal structure is damaged.1D6 roll of 4-5: 2 points per 5 tons, one guaranteed critical hit plus internal structure crits.1D6 roll of 1: no pre-existing damage. -
Method Summary
Modifier and TypeMethodDescriptionintbooleaninttotalDamage(double weight) static PreExistingDamageLevelReturns the enum constant of this class with the specified name.static PreExistingDamageLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
1D6 roll of 1: no pre-existing damage. -
LIGHT
1D6 roll of 2-3: 1 point per 5 tons, no critical hits even if internal structure is damaged. -
MODERATE
1D6 roll of 4-5: 2 points per 5 tons, one guaranteed critical hit plus internal structure crits. -
HEAVY
1D6 roll of 6: 4 points per 5 tons, two guaranteed critical hits plus internal structure crits.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getGuaranteedCritCount
public int getGuaranteedCritCount()- Returns:
- the number of guaranteed critical hits rolled to a random location
-
rollsInternalStructureCrits
public boolean rollsInternalStructureCrits()- Returns:
trueif this level determines critical hits from internal structure damage
-
totalDamage
public int totalDamage(double weight) - Parameters:
weight- the unit's weight in tons- Returns:
- the total pre-existing damage for a unit of the given weight at this level
-