Package megamek.common.units
Interface IBomber
- All Known Implementing Classes:
Aero,AeroSpaceFighter,ConvFighter,Dropship,EscapePods,FighterSquadron,FixedWingSupport,Jumpship,LandAirMek,SmallCraft,SpaceStation,SupportVTOL,TeleMissile,VTOL,Warship
public interface IBomber
Common interface for all entities capable of carrying bombs and making bomb attacks, including Aero, LandAirMek, and
VTOL.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidIterate through the bomb choices that were configured prior to deployment and add the corresponding equipment.intavailableBombLocation(int cost) voidSets the count of each bomb to zerovoiddefault BombLoadoutdefault intdefault intgetBombPoints(boolean externalOnly) getBombs()default intdefault intintintdefault intintdefault intFighters and VTOLs can carry any size bomb up to the maximum number of points per location (internal/external), but LAMs are limited to the number of bays in a single location.intdefault TargetablevoidincreaseUsedInternalBombs(int b) Increase count of internal bombs used this turn.default booleanintreduceMPByBombLoad(int t) default voidBackwards compatibility bomb choice setter that only affects external stores.voidSets the bomb type selections for external mounts.voidSets the bomb type selections prior to deployment.voidsetUsedInternalBombs(int b) Set count of internal bombs used; this is used to reset, revert, or increase count of internal bombs a unit has dropped during a turn.default voidsetVTOLBombTarget(Targetable target) Used by VTOLs and LAMs in AirMek mode to declare the target hex for a bomb attack during the movement phase.
-
Field Details
-
SPACE_BOMB_ATTACK
- See Also:
-
DIVE_BOMB_ATTACK
- See Also:
-
ALT_BOMB_ATTACK
- See Also:
-
-
Method Details
-
setUsedInternalBombs
void setUsedInternalBombs(int b) Set count of internal bombs used; this is used to reset, revert, or increase count of internal bombs a unit has dropped during a turn. -
increaseUsedInternalBombs
void increaseUsedInternalBombs(int b) Increase count of internal bombs used this turn. -
getUsedInternalBombs
int getUsedInternalBombs()- Returns:
- the number of internal bombs used by this bomber during a turn, for IBB internal hit calculations.
-
getMaxBombPoints
int getMaxBombPoints()- Returns:
- The total number of bomb points that the bomber can carry.
-
getMaxIntBombSize
default int getMaxIntBombSize()Fighters and VTOLs can carry any size bomb up to the maximum number of points per location (internal/external), but LAMs are limited to the number of bays in a single location.- Returns:
- The largest single bomb that can be carried internally.
-
getMaxExtBombSize
default int getMaxExtBombSize()- Returns:
- The largest single bomb that can be carried externally.
-
getIntBombChoices
BombLoadout getIntBombChoices()- Returns:
- The number of each internally-mounted bomb type that was selected prior to deployment
-
getExtBombChoices
BombLoadout getExtBombChoices()- Returns:
- The number of each externally-mounted bomb type that was selected prior to deployment
-
setIntBombChoices
Sets the bomb type selections prior to deployment.- Parameters:
bc- An array with the count of each bomb type as the value of the bomb type's index
-
setExtBombChoices
Sets the bomb type selections for external mounts.- Parameters:
bc- An array with the count of each bomb type as the value of the bomb type's index
-
getBombChoices
- Returns:
- summed combination of internal and external choices
-
setBombChoices
Backwards compatibility bomb choice setter that only affects external stores. -
clearBombChoices
void clearBombChoices()Sets the count of each bomb to zero -
reduceMPByBombLoad
int reduceMPByBombLoad(int t) - Returns:
- The calculates movement factoring in the load of bombs currently on unit, t is current movement
-
availableBombLocation
int availableBombLocation(int cost) - Parameters:
cost- The cost of the bomb to be mounted- Returns:
- A location with sufficient space to mount the bomb, or Entity.LOC_NONE if the unit does not have the space.
-
setVTOLBombTarget
Used by VTOLs and LAMs in AirMek mode to declare the target hex for a bomb attack during the movement phase. -
getVTOLBombTarget
-
isVTOLBombing
default boolean isVTOLBombing() -
getBombs
List<BombMounted> getBombs() -
getBombPoints
default int getBombPoints()- Returns:
- the number of total bomb points for this unit
-
getExternalBombPoints
default int getExternalBombPoints()- Returns:
- the number of externally-mounted ordnance points (useful for MP calculations)
-
getInternalBombsDamageTotal
default int getInternalBombsDamageTotal()- Returns:
- total damage from remaining bombs
-
getBombPoints
default int getBombPoints(boolean externalOnly) - Returns:
- The number of points taken up by all mounted bombs, or just external
-
applyBombs
default void applyBombs()Iterate through the bomb choices that were configured prior to deployment and add the corresponding equipment. -
clearBombs
void clearBombs() -
getMaxExtBombPoints
int getMaxExtBombPoints()- Returns:
- maximum number of bomb points this bomber can mount externally
-
getMaxIntBombPoints
int getMaxIntBombPoints()- Returns:
- maximum number of bomb points this bomber can mount internally
-