if (!isMilitary()) { return false;
@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; }
@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; }
@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; }