@Override public int getWalkHeat() { int extra = bDamagedCoolantSystem?1:0; return extra + (hasEngine() ? getEngine().getWalkHeat(this) : 0); }
/** * Depends on engine type */ @Override public int getSprintHeat() { int extra = bDamagedCoolantSystem?1:0; return extra + (hasEngine() ? getEngine().getSprintHeat() : 0); }
public TestMech(Mech mech, TestEntityOption option, String fileString) { super(option, mech.getEngine(), getArmor(mech), getStructure(mech)); this.mech = mech; this.fileString = fileString; }
/** * Depends on engine type */ @Override public int getRunHeat() { int extra = bDamagedCoolantSystem?1:0; return extra + (hasEngine() ? getEngine().getRunHeat(this) : 0); }
@Override public int getStandingHeat() { return hasEngine() ? getEngine().getStandingHeat() : 0; }
/** * Used to set this Mech's original walk mp * * @return this units calculated walking speed, dependent on engine rating * and weight */ protected int calculateWalk() { if(!hasEngine()) { return 0; } if (isPrimitive()) { double rating = getEngine().getRating(); rating /= 1.2; if ((rating % 5) != 0) { return (int) ((rating - (rating % 5)) + 5) / (int) weight; } return (int) (rating / (int) weight); } return getEngine().getRating() / (int) weight; }
/** * set this mech's <code>Engine</code> * * @param e * the <code>Engine</code> to set */ @Override public void setEngine(Engine e) { super.setEngine(e); if(hasEngine() && getEngine().engineValid) { setOriginalWalkMP(calculateWalk()); } }
public static Integer maxJumpMP(Mech mech) { if (mech.isSuperHeavy()) { return 0; } if (mech.getJumpType() == Mech.JUMP_BOOSTER) { return null; } else if (!mech.hasEngine() || (!mech.getEngine().isFusion() && (mech.getEngine().getEngineType() != Engine.FISSION))) { return 0; } else if ((mech.getJumpType() == Mech.JUMP_IMPROVED) || (mech.getJumpType() == Mech.JUMP_PROTOTYPE_IMPROVED)) { return (int)Math.ceil(mech.getOriginalWalkMP() * 1.5); } else { return mech.getOriginalWalkMP(); } }
/** * base for adding engine sinks. Newer method allows externals to say how * much are engine HS. * * @param totalSinks * the amount of heatsinks to add to the engine * @param sinkName * the <code>String</code> determining the type of heatsink to * add. must be a lookupname of a heatsinktype */ public void addEngineSinks(int totalSinks, String sinkName) { if(!hasEngine()) { return; } EquipmentType sinkType = EquipmentType.get(sinkName); if (sinkType == null) { System.out.println("Mech: can't find heat sink to add to engine"); } int toAllocate = Math.min( totalSinks, getEngine().integralHeatSinkCapacity( sinkType.hasFlag(MiscType.F_COMPACT_HEAT_SINK))); addEngineSinks(sinkName, toAllocate); }
if (getEngine().hasFlag(Engine.LARGE_ENGINE)) { switch (getEngine().getEngineType()) { case Engine.XL_ENGINE: battleForceEngineType = 5; switch (getEngine().getEngineType()) { case Engine.XL_ENGINE: battleForceEngineType = 4; if (getEngine().hasFlag(Engine.LARGE_ENGINE)) { switch (getEngine().getEngineType()) { case Engine.XL_ENGINE: battleForceEngineType = 5; switch (getEngine().getEngineType()) { case Engine.XL_ENGINE: battleForceEngineType = 5;
@Override public int getJumpHeat(int movedMP) { int extra = bDamagedCoolantSystem?1:0; // don't count movement granted by Partial Wing for (Mounted mount : getMisc()) { if (mount.getType().hasFlag(MiscType.F_PARTIAL_WING)) { movedMP -= getPartialWingJumpBonus(mount); break; } } switch (getJumpType()) { case JUMP_IMPROVED: return extra + (hasEngine() ? getEngine().getJumpHeat((movedMP / 2) + (movedMP % 2)) : 0); case JUMP_PROTOTYPE_IMPROVED: // min 6 heat, otherwise 2xJumpMp, XTRO:Succession Wars pg17 return extra + (hasEngine() ? Math.max(6, getEngine().getJumpHeat(movedMP * 2)) : 0); case JUMP_BOOSTER: case JUMP_DISPOSABLE: return extra; case JUMP_NONE: return 0; default: return extra + (hasEngine() ? getEngine().getJumpHeat(movedMP) : 0); } }
specialAbilities.put(BattleForceSPA.MAS, null); } else if (isIndustrial() && m.getType().hasFlag(MiscType.F_ENVIRONMENTAL_SEALING) && getEngine().getEngineType() != Engine.COMBUSTION_ENGINE) { specialAbilities.put(BattleForceSPA.SOA, null); } else if (m.getType().hasFlag(MiscType.F_NULLSIG)
int centerSlots[] = getEngine().getCenterTorsoCriticalSlots( getGyroType()); if (getEmptyCriticals(LOC_CT) < centerSlots.length) { int sideSlots[] = getEngine().getSideTorsoCriticalSlots(); if ((getEmptyCriticals(LOC_LT) < sideSlots.length) || (getEmptyCriticals(LOC_RT) < sideSlots.length) || !success) {
@Override public double getWeightPowerAmp() { if (mech.isIndustrial() && (!mech.hasEngine() || (mech.getEngine().getEngineType() == Engine.COMBUSTION_ENGINE) || (mech.getEngine().getEngineType() == Engine.FUEL_CELL))) { double powerAmpWeight = 0; for (Mounted m : mech.getWeaponList()) { WeaponType wt = (WeaponType) m.getType(); if (wt instanceof EnergyWeapon) { powerAmpWeight += wt.getTonnage(mech); } if ((m.getLinkedBy() != null) && (m.getLinkedBy().getType() instanceof MiscType) && m.getLinkedBy().getType().hasFlag(MiscType.F_PPC_CAPACITOR)) { powerAmpWeight += ((MiscType) m.getLinkedBy().getType()) .getTonnage(mech); } } return TestEntity.ceil(powerAmpWeight / 10f, getWeightCeilingPowerAmp()); } return 0; }
@Override protected void addSystemTechAdvancement(CompositeTechLevel ctl) { super.addSystemTechAdvancement(ctl); // battlemechs with non-fusion engines are experimental if (hasEngine() && !isIndustrial() && !getEngine().isFusion()) { ctl.addComponent(new TechAdvancement().setStaticTechLevel(SimpleTechLevel.EXPERIMENTAL)); } if (getGyroTechAdvancement() != null) { ctl.addComponent(getGyroTechAdvancement()); } if (getCockpitTechAdvancement() != null) { ctl.addComponent(getCockpitTechAdvancement()); } if (hasFullHeadEject()) { ctl.addComponent(getFullHeadEjectAdvancement()); } //FIXME: Clan interface cockpit has higher tech rating //if (getCockpitType() == COCKPIT_INTERFACE && isClan()) { // techAdvancement.setTechRating(Math.max(techAdvancement.getTechRating(), RATING_F)); //} }
if (!isShutDown() && getEngine().isFusion()) { engineCritHeat += 5 * getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_CT);
@Override public Vector<Report> doCheckEngineStallRoll(Vector<Report> vPhaseReport) { if(hasEngine() && (getEngine().getEngineType() == Engine.COMBUSTION_ENGINE)) { Report r = new Report(2280); r.addDesc(this);
@Override public void checkUnstall(Vector<Report> vPhaseReport) { if (stalled && !stalledThisTurn && hasEngine() && (getEngine().getEngineType() == Engine.COMBUSTION_ENGINE)) { Report r = new Report(2280); r.addDesc(this);
@Override public int getBattleForceTotalHeatGeneration(boolean allowRear) { int totalHeat = 0; // finish the max heat calculations if (this.getJumpMP() > 0) { totalHeat += getJumpHeat(getJumpMP()); } else if (!isIndustrial() && hasEngine()) { totalHeat += getEngine().getRunHeat(this); } for (Mounted mount : getWeaponList()) { WeaponType weapon = (WeaponType) mount.getType(); if (weapon.hasFlag(WeaponType.F_ONESHOT) || (allowRear && !mount.isRearMounted()) || (!allowRear && mount.isRearMounted())) { continue; } if (weapon.getAmmoType() == AmmoType.T_AC_ROTARY) { totalHeat += weapon.getHeat() * 6; } else if (weapon.getAmmoType() == AmmoType.T_AC_ULTRA || weapon.getAmmoType() == AmmoType.T_AC_ULTRA_THB) { totalHeat += weapon.getHeat() * 2; } else { totalHeat += weapon.getHeat(); } } if (hasWorkingMisc(MiscType.F_STEALTH, -1)) { totalHeat += 10; } return totalHeat; }
: EquipmentType.getStructureTypeName(mech.getStructureType())); setModelData("isMass", NumberFormat.getInstance().format(testMech.getWeightStructure())); setModelData("engineName", stripNotes(mech.getEngine().getEngineName())); setModelData("engineMass", NumberFormat.getInstance().format(testMech.getWeightEngine())); setModelData("walkMP", mech.getWalkMP());