Class TWRulesMovement
java.lang.Object
megamek.common.rules.RulesMovement
megamek.common.rules.totalwarfare.TWRulesMovement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancannotRunInWater(EntityMovementMode movementMode, boolean amphibious) Can a unit use run / flank MP in water.booleancheckMPZeroCauseImmobile(int walkMP) Does 0 MP cause immobile? Only unconscious, shut down, or leg destruction causes immobilebooleancumulativeLegDamage(boolean bTOLegDamage) Do we add leg damage together, no unless TO.booleandominoEffectMovementCriteria(int direction, Entity entity, MovePath stepForward, MovePath stepBackwards, Entity violation) What are the criteria to allow for domino effect changes BMM p 56booleanenableBackwardsElevationChange(boolean toBackwardsElevation, Entity entity) Can you move backwards up elevation? Backwards elevation changes only if tacops rulegetAccidentalFallDisplacement(Game game, int entityId, Coords src, int direction, int range) How should we displace a unit that had another fall on it accidentally? Use a distribution and find the first valid hex we can displace intointgetAccidentalFallElevation(int fallElevation, int hitHeight) Do we change the accidental fall elevation? No.intgetDFAElevation(Game game, int attackerId, int targetId, MoveStep step) When performing a DFA, and we move closer to the target, what elevation is the attacker at?booleanDomino displacement costs MP, so return trueintgetMekRunMP(int badLegs, int walkMP, int runMP, boolean isQuad) What is our Running MP?intWhat is the MP cost of moving into a water hex that is fully submerged.booleanisDominoMoveLegal(int direction, Entity entity, MovePath movePath, boolean forwards) This is a helper for dominoEffectMovementCriteria.booleanisMoveIntoWaterDangerous(EntityMovementType movementType, EntityMovementMode movementMode) Moving into water always triggers PSR dangerbooleanreduceMaxElevation(Mek mek) Can it change more than 1 level when missing a leg? TW doesn't carebooleanUnits can skidMethods inherited from class megamek.common.rules.RulesMovement
reduceMovementWithShields
-
Constructor Details
-
TWRulesMovement
public TWRulesMovement()
-
-
Method Details
-
skidEnabled
public boolean skidEnabled()Units can skid- Specified by:
skidEnabledin classRulesMovement- Returns:
- true if skidding is enabled
-
cannotRunInWater
Can a unit use run / flank MP in water. Vehicles and 'Meks cannot- Specified by:
cannotRunInWaterin classRulesMovement- Parameters:
movementMode- the movement mode of the unitamphibious- true if the unit is amphibious- Returns:
- true if the unit cannot run in water
-
getUnderwaterMPCost
public int getUnderwaterMPCost()What is the MP cost of moving into a water hex that is fully submerged. The cost is 3MP- Specified by:
getUnderwaterMPCostin classRulesMovement- Returns:
- the MP cost for underwater movement
-
enableBackwardsElevationChange
Can you move backwards up elevation? Backwards elevation changes only if tacops rule- Specified by:
enableBackwardsElevationChangein classRulesMovement- Parameters:
toBackwardsElevation- true if moving backwards up elevationentity- the entity attempting to move- Returns:
- true if backwards elevation change is allowed
-
cumulativeLegDamage
public boolean cumulativeLegDamage(boolean bTOLegDamage) Do we add leg damage together, no unless TO.- Specified by:
cumulativeLegDamagein classRulesMovement- Parameters:
bTOLegDamage- true if TO leg damage is enabled- Returns:
- true if leg damage is cumulative
-
checkMPZeroCauseImmobile
public boolean checkMPZeroCauseImmobile(int walkMP) Does 0 MP cause immobile? Only unconscious, shut down, or leg destruction causes immobile- Overrides:
checkMPZeroCauseImmobilein classRulesMovement- Parameters:
walkMP- the walking movement points- Returns:
- true if 0 MP causes immobile status
-
getMekRunMP
public int getMekRunMP(int badLegs, int walkMP, int runMP, boolean isQuad) What is our Running MP? Lost a leg? No running- Specified by:
getMekRunMPin classRulesMovement- Parameters:
badLegs- the number of damaged legswalkMP- the walking movement pointsrunMP- the running movement pointsisQuad- is the unit a quad- Returns:
- the effective running movement points
-
isMoveIntoWaterDangerous
public boolean isMoveIntoWaterDangerous(EntityMovementType movementType, EntityMovementMode movementMode) Moving into water always triggers PSR danger- Specified by:
isMoveIntoWaterDangerousin classRulesMovement- Parameters:
movementType- the type of movementmovementMode- the movement mode of the unit- Returns:
- true if moving into water is dangerous
-
reduceMaxElevation
Can it change more than 1 level when missing a leg? TW doesn't care- Specified by:
reduceMaxElevationin classRulesMovement- Parameters:
mek- the Mek to check- Returns:
- true if maximum elevation can be reduced
-
dominoEffectMovementCriteria
public boolean dominoEffectMovementCriteria(int direction, Entity entity, MovePath stepForward, MovePath stepBackwards, Entity violation) What are the criteria to allow for domino effect changes BMM p 56- Specified by:
dominoEffectMovementCriteriain classRulesMovement- Parameters:
direction- The direction the violation is coming fromentity- the entity causing the domino effectstepForward- potential step forwardsstepBackwards- potential step backwardsviolation- entity being displaced- Returns:
- True if it can possibly step out of the way
-
getDominoDisplacementCostsMP
public boolean getDominoDisplacementCostsMP()Domino displacement costs MP, so return true- Specified by:
getDominoDisplacementCostsMPin classRulesMovement- Returns:
- false if there is no cost, true if there is
-
isDominoMoveLegal
This is a helper for dominoEffectMovementCriteria. It returns true if you can move in that direction Dominos- Specified by:
isDominoMoveLegalin classRulesMovement- Parameters:
direction- direction of source of dominoentity- entity being displacedmovePath- the movePath of the stepforwards- is it forwards or backwards- Returns:
-
getAccidentalFallElevation
public int getAccidentalFallElevation(int fallElevation, int hitHeight) Do we change the accidental fall elevation? No.- Specified by:
getAccidentalFallElevationin classRulesMovement- Parameters:
fallElevation- height of the fallhitHeight- height of the unit hit- Returns:
- the modified height for damage
-
getAccidentalFallDisplacement
@Nullable public Coords getAccidentalFallDisplacement(Game game, int entityId, Coords src, int direction, int range) How should we displace a unit that had another fall on it accidentally? Use a distribution and find the first valid hex we can displace into- Specified by:
getAccidentalFallDisplacementin classRulesMovement- Parameters:
game- the gameentityId- the entity being displacedsrc- the source hexdirection- the direction that it is coming fromrange- how far to displace (used for Dropships)- Returns:
- the destination Coords
-
getDFAElevation
When performing a DFA, and we move closer to the target, what elevation is the attacker at?- Specified by:
getDFAElevationin classRulesMovement- Parameters:
game- the game objectattackerId- entityId of the attackertargetId- entityId of the defenderstep- the movement step as accepted.- Returns:
- int, the elevation above the underlying terrain the attacker should be at
-