Package megamek.client.ratgenerator
Class ShipReroller
java.lang.Object
megamek.client.ratgenerator.ShipReroller
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.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisShip(ForceDescriptor node) static ShipReroller.Outcomereroll(ForceDescriptor ship) Replaces the ship's design with another that does the same job, and refits what hangs under it.
-
Method Details
-
reroll
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
nullwhen the node is not a ship or the table holds nothing that could take its place
-
isShip
- Returns:
truefor a ship element: a DropShip, JumpShip, WarShip or space station
-