int j = getOriginalWalkMP(); if (engineHits >= getMaxEngineHits()) { return 0;
@Override public void updateConditionFromPart() { if(null != unit) { if(unit.getEntity() instanceof Mech) { unit.destroySystem(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE); } if(unit.getEntity() instanceof Aero) { ((Aero)unit.getEntity()).setEngineHits(((Aero)unit.getEntity()).getMaxEngineHits()); } if(unit.getEntity() instanceof Tank) { ((Tank)unit.getEntity()).engineHit(); } if(unit.getEntity() instanceof Protomech) { ((Protomech)unit.getEntity()).setEngineHit(true); } } }
@Override public void remove(boolean salvage) { if(null != unit) { unit.destroySystem(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE); if(unit.getEntity() instanceof Aero) { ((Aero)unit.getEntity()).setEngineHits(((Aero)unit.getEntity()).getMaxEngineHits()); } Part spare = campaign.checkForExistingSparePart(this); if(!salvage) { campaign.removePart(this); } else if(null != spare) { spare.incrementQuantity(); campaign.removePart(this); } unit.removePart(this); Part missing = getMissingPart(); unit.addPart(missing); campaign.addPart(missing, 0); } setUnit(null); updateConditionFromEntity(false); }
@Override public void remove(boolean salvage) { if(null != unit) { if(unit.getEntity() instanceof Mech) { unit.destroySystem(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE); } if(unit.getEntity() instanceof Aero) { ((Aero)unit.getEntity()).setEngineHits(((Aero)unit.getEntity()).getMaxEngineHits()); } if(unit.getEntity() instanceof Tank) { ((Tank)unit.getEntity()).engineHit(); } if(unit.getEntity() instanceof Protomech) { ((Protomech)unit.getEntity()).setEngineHit(true); } Part spare = campaign.checkForExistingSparePart(this); if(!salvage) { campaign.removePart(this); } else if(null != spare) { spare.incrementQuantity(); campaign.removePart(this); } unit.removePart(this); Part missing = getMissingPart(); unit.addPart(missing); campaign.addPart(missing, 0); } setUnit(null); }
vLabels[6].setValue(getCriticalHitTally(t.getEngineHits(),t.getMaxEngineHits())); vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(),3)); vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(),3));
t.getMaxEngineHits())); vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(), 3)); vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(), 3));