/** * A method to determine if an aero has suffered 3 sensor hits. * When double-blind is on, this affects both standard visibility and sensor rolls */ public boolean isAeroSensorDestroyed() { return getSensorHits() >= 3; }
/** * get modifications to the cluster hit table for critical hits */ @Override public int getClusterMods() { return -1 * (getFCSHits() + getSensorHits()); }
critVal = critVal.concat("\""); if (a.getSensorHits() > 0) { critVal = critVal.concat(" sensors=\""); critVal = critVal.concat(Integer.toString(a.getSensorHits())); critVal = critVal.concat("\"");
if (a.getSensorHits() > 0) { critVal = critVal.concat(" sensors=\""); critVal = critVal.concat(Integer.toString(a.getSensorHits())); critVal = critVal.concat("\"");
public int getECCMTarget() { return getCrew().getPiloting() + getSensorHits() + getCICHits() + getFCSHits(); }
panSystem.add(new JLabel("<html><b>" + "Sensor" + "</b><br></html>"), gridBagConstraints); sensorCrit = new CheckCritPanel(3, aero.getSensorHits()); gridBagConstraints.gridx = 1; gridBagConstraints.weightx = 1.0;
/** * Update sensors. Use the active sensor of the first fighter in the squadron that hasn't taken 3 sensor hits * BAPs don't count as active sensors in space, but they do make detection rolls easier */ public void updateSensors() { if (getActiveSensor() == null) { for (Integer fId : fighters) { Entity entity = game.getEntity(fId); Aero fighter = (Aero) entity; if (fighter.getSensorHits() > 2) { // Sensors destroyed. Check the next fighter continue; } if (fighter.getActiveSensor().isBAP()) { //BAP active. Check the next fighter continue; } if (fighter.getActiveSensor() != null) { for (Sensor sensor : fighter.getSensors()) { getSensors().add(sensor); } setNextSensor(getSensors().firstElement()); break; } } } }
public void setEntity(Entity e) { Aero t = (Aero) e; int armor = t.getCapArmor(); int armorO = t.getCap0Armor(); armorVLabel.setValue(Integer.toString(armor)); if (t.getGame().getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)) { armor = (int) Math.ceil(armor / 10.0); armorO = (int) Math.ceil(armorO / 10.0); } drawArmorImage(armorImage, armor, armorO); drawCrits(avCritImage, t.getAvionicsHits()); drawCrits(engineCritImage, t.getEngineHits()); drawCrits(fcsCritImage, t.getFCSHits()); drawCrits(sensorCritImage, t.getSensorHits()); drawCrits(pilotCritImage, t.getCrew().getHits()); }
@Override public void updateConditionFromEntity(boolean checkForDestruction) { int priorHits = hits; if(null != unit && unit.getEntity() instanceof Aero) { hits = ((Aero)unit.getEntity()).getSensorHits(); if(checkForDestruction && hits > priorHits && (hits < 3 && !campaign.getCampaignOptions().useAeroSystemHits()) && Compute.d6(2) < campaign.getCampaignOptions().getDestroyPartTarget()) { remove(false); return; } else if (hits >= 3) { remove(false); return; } } }
public String getCritDamageString() { String toReturn = ""; boolean first = true; if (getSensorHits() > 0) { if (!first) { toReturn += ", "; toReturn += "Sensors (" + getSensorHits() + ")"; first = false;
vLabels[6].setValue(getCriticalHitTally(t.getEngineHits(),t.getMaxEngineHits())); vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(),3)); vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(),3)); if(t instanceof SmallCraft) {
t.getMaxEngineHits())); vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(), 3)); vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(), 3)); if (t instanceof SmallCraft) {
return false; } else { tn += aero.getSensorHits();
return false; } else { tn += aero.getSensorHits();
int sensors = aero.getSensorHits();
int sensors = aero.getSensorHits();