/** * Returns this entity's current jumping MP, not affected by terrain, * factored for gravity. */ public int getJumpMP() { return getJumpMP(true); }
/** * Returns this entity's current jumping MP, affected by terrain (like * water.) */ public int getJumpMPWithTerrain() { return getJumpMP(); }
/** * Worker function that calculates the AtB-rules walk MP for an entity, for deployment purposes. * @param entity The entity to examine. * @return The walk MP. */ private static int calculateAtBSpeed(Entity entity) { int speed = entity.getWalkMP(); if (entity.getJumpMP() > 0) { if (entity instanceof megamek.common.Infantry) { speed = entity.getJumpMP(); } else { speed++; } } return speed; }
/** * Whether this type of unit can perform DFA attacks */ public boolean canDFA() { return !isImmobile() && (getJumpMP() > 0) && !isStuck() && !isProne(); }
@Override public Object getValueAt(int rowIndex, int columnIndex) { final Entity en = entities.get(rowIndex); switch (columnIndex) { case COL_ENTITY: return en.getShortNameRaw(); case COL_BV: return en.calculateBattleValue(); case COL_MOVE: return en.getWalkMP() + "/" + en.getRunMPasString() + "/" + en.getJumpMP(); } return ""; }
public double getInfantryFuelCost(Entity e) { if (e instanceof BattleArmor) { if (e.getJumpMP() > 0) { return (e.getWeight() * .02 * 1000 * 4); } else { return 0; } } if (e.getMovementMode() == EntityMovementMode.INF_LEG) { return 0; } else { return (e.getWeight() *.02 * 1000 * 4); } }
ArrayList<WeightedPath> getAllWeightedPaths(Entity entity, IGame game) { final String METHOD_NAME = "getAllWeightedPaths(Entity, IGame)"; owner.methodBegin(getClass(), METHOD_NAME); try { ranker.initUnitTurn(entity, game); TreeMap<PathState, WeightedPath> pathmap = new TreeMap<PathState, WeightedPath>(); ArrayList<WeightedPath> start_path = new ArrayList<WeightedPath>(); MovePath empty_path = new MovePath(game, entity); double empty_rank = ranker.rankPath(empty_path, game).getRank(); WeightedPath start = new WeightedPath(empty_path, empty_rank); pathmap.put(new PathState(start.path), start); start_path.add(start); if (entity.getJumpMP() > 0) { //allow jumping MovePath jump_path = new MovePath(game, entity); jump_path.addStep(MoveStepType.START_JUMP); WeightedPath startjump = new WeightedPath(jump_path, empty_rank - 0.1); pathmap.put(new PathState(startjump.path), startjump); start_path.add(startjump); } return seeAllPaths(start_path, true, true, game, pathmap); } finally { owner.methodEnd(getClass(), METHOD_NAME); } }
/** * Returns true if a jump using mechanical jump boosters would cause falling * damage. Mechanical jump boosters are only designed to handle the stress * of falls from a height equal to their jumpMP; if a jump has a fall that * is further than the jumpMP of the unit, fall damage applies. * * @return */ public boolean shouldMechanicalJumpCauseFallDamage() { if (isJumping() && (getEntity().getJumpType() == Mech.JUMP_BOOSTER) && (getJumpMaxElevationChange() > getEntity().getJumpMP())) { return true; } return false; }
private void updateTurnButton() { final Entity ce = ce(); if (null == ce) { return; } setTurnEnabled(!ce.isImmobile() && !ce.isStuck() && ((ce.getWalkMP() > 0) || (ce.getJumpMP() > 0)) && !(cmd.isJumping() && (ce instanceof Mech) && (ce .getJumpType() == Mech.JUMP_BOOSTER))); }
/** * This method returns true if a unit is permanently immobilized either * because its crew is dead/gone or because of damage * * @return true if unit is permanently immobile */ public boolean isPermanentlyImmobilized(boolean checkCrew) { if (checkCrew && ((getCrew() == null) || getCrew().isDead())) { return true; } else if (((getOriginalWalkMP() > 0) || (getOriginalRunMP() > 0) || (getOriginalJumpMP() > 0)) /* * Need to make sure here that we're ignoring heat because * that's not actually "permanent": */ && ((getWalkMP(true, true, false) == 0) && (getRunMP(true, true, false) == 0) && (getJumpMP() == 0))) { return true; } else { return false; } }
if (myEntity.getJumpMP() > 0) { item = createJumpJetAttackJMenuItem();
(startingPath.isJumping() && (startingPath.getMpUsed() >= startingPath.getEntity().getJumpMP()))) { return retval;
switch (moveType) { case MOVE_JUMP: maxSafeMP = getJumpMP(false); break; case MOVE_SPRINT:
boolean destHexHasRoad = destHex.containsTerrain(Terrains.ROAD); int maxUpwardElevationChange = Math.max(entity.getJumpMP(), entity.getMaxElevationChange()); int maxDownwardElevationChange = entity.getJumpMP() > 0 ? 999 : entity.getMaxElevationDown(); int destHexElevation = calculateUnitElevationInHex(destHex, entity); int srcHexElevation = calculateUnitElevationInHex(srcHex, entity);
maxMP = ce().getJumpMP(); } else if (gear == GEAR_BACKUP) { maxMP = ce().getWalkMP();
boolean isAero = ce.isAero(); if (!isAero && !ce.isImmobile() && (ce.getJumpMP() > 0) && !(ce.isStuck() && !ce.canUnstickByJumping())) { if (gear != MovementDisplay.GEAR_JUMP) {