Class ShipReroller

java.lang.Object
megamek.client.ratgenerator.ShipReroller

public final class ShipReroller extends Object
Swaps one ship in a generated force for a different design that does the same job.

A player who does not want the Overlord the roll gave them can ask for another hull without rolling the whole force again. The replacement is drawn from the same faction table as the original and must be up to the same work: every kind of unit bay the current hull has, the candidate has at between half and double the capacity, and it keeps enough docking collars for the DropShips already docked to it. The same design is never drawn again unless it is the only one in the table that qualifies, and the log says when that happened.

What hangs under the ship follows it: docked DropShips stay docked, and a fighter complement is generated afresh to the new hull's bays, since a Union's two fighters would rattle around an Overlord's six.

  • Method Details

    • reroll

      @Nullable public static ShipReroller.Outcome reroll(ForceDescriptor ship)
      Replaces the ship's design with another that does the same job, and refits what hangs under it.
      Parameters:
      ship - the ship element to reroll
      Returns:
      what changed, or null when the node is not a ship or the table holds nothing that could take its place
    • isShip

      public static boolean isShip(ForceDescriptor node)
      Returns:
      true for a ship element: a DropShip, JumpShip, WarShip or space station