Package megamek.common.equipment
Record Class EMPMineEffectsTable
java.lang.Object
java.lang.Record
megamek.common.equipment.EMPMineEffectsTable
- Record Components:
noEffectMax- Maximum roll value for "No Effect" resultinterferenceMax- Maximum roll value for "Interference" result (above this is Shutdown)
EMP Mine Effects Table lookup based on unit type.
Thresholds per Tactical Operations: Advanced Rules (Experimental):
- BattleMek: 2-6 No Effect / 7-8 Interference / 9+ Shutdown
- IndustrialMek: 2-5 No Effect / 6-7 Interference / 8+ Shutdown
- ProtoMek: 2-5 No Effect / 6-8 Interference / 9+ Shutdown
- Battle Armor: 2-5 No Effect / 6-7 Interference / 8+ Shutdown
- Combat Vehicles: 2-5 No Effect / 6-7 Interference / 8+ Shutdown
- Support Vehicles: 2-4 No Effect / 5-6 Interference / 7+ Shutdown
- Aerospace/Small Craft: 2-6 No Effect / 7-8 Interference / 9+ Shutdown
- Conventional Fighters: 2-5 No Effect / 6-7 Interference / 8+ Shutdown
-
Constructor Summary
ConstructorsConstructorDescriptionEMPMineEffectsTable(int noEffectMax, int interferenceMax) Creates an instance of aEMPMineEffectsTablerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdetermineEffect(int rollValue) Determines the EMP effect based on the roll value.final booleanIndicates whether some other object is "equal to" this one.static EMPMineEffectsTablegetTableFor(Entity entity) Gets the appropriate effects table for the given entity.final inthashCode()Returns a hash code value for this object.intReturns the value of theinterferenceMaxrecord component.intReturns the value of thenoEffectMaxrecord component.static EMPEffectResultrollForEffect(Entity entity) Rolls for EMP effect and returns the full result.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EMPMineEffectsTable
public EMPMineEffectsTable(int noEffectMax, int interferenceMax) Creates an instance of aEMPMineEffectsTablerecord class.- Parameters:
noEffectMax- the value for thenoEffectMaxrecord componentinterferenceMax- the value for theinterferenceMaxrecord component
-
-
Method Details
-
getTableFor
Gets the appropriate effects table for the given entity.- Parameters:
entity- The entity to look up thresholds for- Returns:
- The EMPMineEffectsTable with appropriate thresholds
-
determineEffect
public int determineEffect(int rollValue) Determines the EMP effect based on the roll value.- Parameters:
rollValue- The 2D6 roll result (with modifiers applied)- Returns:
- The effect constant:
MMConstants.EMP_EFFECT_NONE,MMConstants.EMP_EFFECT_INTERFERENCE, orMMConstants.EMP_EFFECT_SHUTDOWN
-
rollForEffect
Rolls for EMP effect and returns the full result.- Parameters:
entity- The entity being affected- Returns:
- EMPEffectResult containing the roll, modifier, effect, and duration
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
noEffectMax
public int noEffectMax()Returns the value of thenoEffectMaxrecord component.- Returns:
- the value of the
noEffectMaxrecord component
-
interferenceMax
public int interferenceMax()Returns the value of theinterferenceMaxrecord component.- Returns:
- the value of the
interferenceMaxrecord component
-