/** * @return A description of the status of a single crew member */ public String getStatusDesc(int pos) { if (isMissing(pos)) { return "Missing"; } String s = new String(""); if (getHits(pos) > 0) { s += hits[pos] + " hits"; if (isUnconscious(pos)) { s += " (KO)"; } else if (isDead(pos)) { s += " (dead)"; } } return s; }
public String getSummaryFor(Person person, Unit unit) { String toReturn = "<html><font size='2'><b>" + person.getFullTitle() + "</b><br/>"; toReturn += person.getSkillSummary() + " " + person.getRoleDesc(); if(null != unit && null != unit.getEntity() && null != unit.getEntity().getCrew() && unit.getEntity().getCrew().getHits() > 0) { toReturn += "<br><font color='red' size='2'>" + unit.getEntity().getCrew().getHits() + " hit(s)"; } toReturn += "</font></html>"; return toReturn; }
@Override public boolean isDmgModerate() { if (getArmorRemainingPercent() <= 0.5) { return true; } if ((getCrew() != null) && (getCrew().getHits() == 2)) { return true; } int totalWeapons = getTotalWeaponList().size(); int totalInoperable = 0; for (Mounted weap : getTotalWeaponList()) { if (weap.isCrippled()) { totalInoperable++; } } return ((double) totalInoperable / totalWeapons) >= 0.5; }
@Override public boolean isDmgHeavy() { if (getArmorRemainingPercent() <= 0.25) { return true; } if ((getCrew() != null) && (getCrew().getHits() == 3)) { return true; } int totalWeapons = getTotalWeaponList().size(); int totalInoperable = 0; for (Mounted weap : getTotalWeaponList()) { if (weap.isCrippled()) { totalInoperable++; } } return ((double) totalInoperable / totalWeapons) >= 0.75; }
@Override public boolean isDmgLight() { if (getArmorRemainingPercent() <= 0.75) { return true; } if ((getCrew() != null) && (getCrew().getHits() == 1)) { return true; } int totalWeapons = getTotalWeaponList().size(); int totalInoperable = 0; for (Mounted weap : getTotalWeaponList()) { if (weap.isCrippled()) { totalInoperable++; } } return ((double) totalInoperable / totalWeapons) >= 0.25; }
@Override public boolean isDmgHeavy() { if (getArmorRemainingPercent() <= 0.33) { return true; } if (getInternalRemainingPercent() < 0.67) { return true; } if ((getCrew() != null) && (getCrew().getHits() == 3)) { return true; } // If this is not a military unit, we don't care about weapon status. if (!isMilitary()) { return false; } List<Mounted> weaponList = getTotalWeaponList(); int totalWeapons = weaponList.size(); int totalInoperable = 0; for (Mounted weap : weaponList) { if (weap.isCrippled()) { totalInoperable++; } } return ((double) totalInoperable / totalWeapons) >= 0.75; }
int hits = entity.getCrew().getHits(); int health = 6 - hits;
@Override public boolean isCrippled() { if ((getCrew() != null) && (getCrew().getHits() >= 4)) { if (PreferenceManager.getClientPreferences().debugOutputOn()) { System.out.println(getDisplayName() + " CRIPPLED: Pilot has taken 4+ damage."); } return true; } for (Mounted weap : getWeaponList()) { if (!weap.isCrippled()) { return false; } } if (PreferenceManager.getClientPreferences().debugOutputOn()) { System.out.println(getDisplayName() + " CRIPPLED: has no more viable weapons."); } return true; }
@Override public boolean isDmgLight() { if (getArmorRemainingPercent() <= 0.75) { return true; } if (getInternalRemainingPercent() < 0.9) { return true; } if ((getCrew() != null) && (getCrew().getHits() == 1)) { return true; } // If this is not a military unit, we don't care about weapon status. 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 boolean isDmgModerate() { if (getArmorRemainingPercent() <= 0.5) { return true; } if (getInternalRemainingPercent() < 0.75) { return true; } if ((getCrew() != null) && (getCrew().getHits() == 2)) { return true; } // If this is not a military unit, we don't care about weapon status. if (!isMilitary()) { return false; } int totalWeapons = getTotalWeaponList().size(); int totalInoperable = 0; for (Mounted weap : getTotalWeaponList()) { if (weap.isCrippled()) { totalInoperable++; } } return ((double) totalInoperable / totalWeapons) >= 0.5; }
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()); }
if ((getCrew() != null) && (getCrew().getHits() == 1)) { logger.log(Mech.class, METHOD_NAME, LogLevel.DEBUG, getDisplayName() + " LIGHT DAMAGE: crew hit");
|| (getCrew().getHits() >= 6)) { base = new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL, "Pilot dead");
if ((getCrew() != null) && (getCrew().getHits() == 2)) { logger.log(Mech.class, METHOD_NAME, LogLevel.DEBUG, getDisplayName() + " MODERATE DAMAGE: 2 crew hits");
int hits = 0; if (null != partWork.getUnit().getEntity().getCrew()) { hits = partWork.getUnit().getEntity().getCrew().getHits(); } else { hits = 6;
pilot.setGunneryAeroB(crew.getGunneryB()); pilot.setGunneryAeroM(crew.getGunneryM()); pilot.setHits(crew.getHits(0), 0); pilot.setUnconscious(crew.isUnconscious(0), 0); pilot.setDead(crew.isDead(0), 0);