Record Class EMPMineEffectsTable

java.lang.Object
java.lang.Record
megamek.common.equipment.EMPMineEffectsTable
Record Components:
noEffectMax - Maximum roll value for "No Effect" result
interferenceMax - Maximum roll value for "Interference" result (above this is Shutdown)

public record EMPMineEffectsTable(int noEffectMax, int interferenceMax) extends Record
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 Details

    • EMPMineEffectsTable

      public EMPMineEffectsTable(int noEffectMax, int interferenceMax)
      Creates an instance of a EMPMineEffectsTable record class.
      Parameters:
      noEffectMax - the value for the noEffectMax record component
      interferenceMax - the value for the interferenceMax record component
  • Method Details

    • getTableFor

      public static EMPMineEffectsTable getTableFor(Entity entity)
      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, or MMConstants.EMP_EFFECT_SHUTDOWN
    • rollForEffect

      public static EMPEffectResult rollForEffect(Entity entity)
      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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • noEffectMax

      public int noEffectMax()
      Returns the value of the noEffectMax record component.
      Returns:
      the value of the noEffectMax record component
    • interferenceMax

      public int interferenceMax()
      Returns the value of the interferenceMax record component.
      Returns:
      the value of the interferenceMax record component