motivePenalty += level; int nMP = getOriginalWalkMP() - motiveDamage; if (nMP > 0) { motiveDamage = getOriginalWalkMP() - (int) Math.ceil(nMP / 2.0); motiveDamage = getOriginalWalkMP(); immobilize();
public int getOriginalSprintMPwithoutMASC() { if (game != null && game.getOptions() .booleanOption(OptionsConstants.ADVGRNDMOV_VEHICLE_ADVANCED_MANEUVERS)) { return (int) Math.ceil(getOriginalWalkMP() * 2.0); } else { return getOriginalRunMP(); } }
@Override public double getBaseBattleForceMovement() { double move = getOriginalWalkMP(); if (getMisc().stream().filter(m -> m.getType().hasFlag(MiscType.F_MASC)) .map(m -> m.getType().getSubType()) .anyMatch(st -> st == MiscType.S_SUPERCHARGER)) { move *= 1.25; } return move; }
/** * Parse a movement tag for the given <code>Entity</code>. * * @param movementTag * @param entity */ private void parseMovement(Element movementTag, Entity entity){ String value = movementTag.getAttribute(MDAMAGE); try { int motiveDamage = Integer.parseInt(value); ((Tank) entity).setMotiveDamage(motiveDamage); if (motiveDamage >= ((Tank) entity).getOriginalWalkMP()) { ((Tank) entity).immobilize(); ((Tank) entity).applyDamage(); } } catch (Exception e) { warning.append("Invalid motive damage value in movement tag.\n"); } value = movementTag.getAttribute(MPENALTY); try { int motivePenalty = Integer.parseInt(value); ((Tank) entity).setMotivePenalty(motivePenalty); } catch (Exception e) { warning.append("Invalid motive penalty value in movement tag.\n"); } }
retVal = retVal.concat("immobile"); } else { retVal = retVal.concat(Integer.toString(e.getOriginalWalkMP()));
@Override public boolean isDmgLight() { if (getWalkMP() < getOriginalWalkMP()) { return true; } if ((getArmorRemainingPercent() <= 0.8) && (getArmorRemainingPercent() != IArmorState.ARMOR_NA)) { return true; } // If this is not a military vehicle, we don't need to do a weapon // check. if (!isMilitary()) { return false; } int totalWeapons = getTotalWeaponList().size(); int totalInoperable = 0; for (Mounted weap : getTotalWeaponList()) { if (weap.isCrippled()) { totalInoperable++; } } return ((double) totalInoperable / totalWeapons) >= 0.25; }
@Override public int getWalkMP(boolean gravity, boolean ignoreheat, boolean ignoremodulararmor) { int j = getOriginalWalkMP(); if (engineHit) { return 0;