Class PartialCover
Partial cover is a Mek rule: large support vehicles, grounded small craft and DropShips never receive it, even
though they rise more than one level, and ProtoMeks never do because they are only the height of vehicles (TW
p.102, p.171; Core p.66, p.136; TO:AR p.85). This class decides eligibility by unit type only. Whether the Mek is
standing, and whether the terrain, water or building actually covers it, is decided by the caller:
LosEffects for terrain, the building and water checks in the to-hit code and the bots for the rest.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanReceive(Targetable target) static booleanisInPartialWater(Entity target, Hex targetHex, int targetRelativeHeight) Whether water in the target's own hex covers its lower half.
-
Method Details
-
canReceive
- Parameters:
target- the unit being shot at- Returns:
trueif the target's unit type can receive partial cover at all. This says nothing about whether it currently does - a prone Mek is eligible by type but is not covered.
-
isInPartialWater
public static boolean isInPartialWater(@Nullable Entity target, @Nullable Hex targetHex, int targetRelativeHeight) Whether water in the target's own hex covers its lower half.The water has to be exactly as deep as the Mek is tall, and the Mek has to be standing on the bottom so that its top is level with the surface: Depth 1 for a standard Mek, Depth 2 for a superheavy, which stands three levels high (TW p.102; Core p.66, p.240). Shallower water covers nothing, deeper water submerges the Mek and blocks line of sight altogether, and a Mek held above the surface - on a bridge, or jumping - is in the open. Unlike cover from a neighbouring hex, this applies even when the attacker is higher than the target, because the water surrounds the Mek.
- Parameters:
target- the unit being shot attargetHex- the hex the target occupiestargetRelativeHeight- the height of the target's top above the surface of its own hex, asEntity.relHeight()reports it: 0 when the top is level with the surface- Returns:
trueif the target is standing in water that covers its lower half
-