/** * Defines how many spaces each arc has for weapons. Large units can add more by increasing weight * of master fire control systems. */ public static int slotsPerArc(Aero aero) { if (aero.hasETypeFlag(Entity.ETYPE_WARSHIP) || aero.hasETypeFlag(Entity.ETYPE_SPACE_STATION)) { return 20; } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP) || aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { return 12; } else { return 5; } }
/** * @return Minimum crew requirements based on unit type and equipment crew requirements. */ public static int minimumBaseCrew(Aero aero) { if (aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { return TestSmallCraft.minimumBaseCrew((SmallCraft) aero); } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP)) { return TestAdvancedAerospace.minimumBaseCrew((Jumpship) aero); } else { return 1; } }
/** * @param aero A large craft * @return The maximum number of bay doors. Aerospace units that are not large craft have * a maximum of zero. */ public static int maxBayDoors(Aero aero) { if (aero.hasETypeFlag(Entity.ETYPE_WARSHIP)) { return 8 + (int)Math.ceil(aero.getWeight() / 100000); } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP)) { return 8 + (int)Math.ceil(aero.getWeight() / 75000); } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP) || (aero.hasETypeFlag(Entity.ETYPE_DROPSHIP))) { return 7 + (int)Math.ceil(aero.getWeight() / 50000); } else if (aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { return aero.isSpheroid()? 4 : 2; } else { return 0; } }
@Override public double getWeightMisc() { // VSTOL equipment weighs extra forr conventional fighters if ((aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) && aero.isVSTOL()){ // Weight = tonnage * 0.05 rounded up to nearest half ton return Math.ceil(0.05 * aero.getWeight()*2) / 2.0; } return 0.0f; }
if (aero.hasETypeFlag(Entity.ETYPE_SPACE_STATION)) { return 2500000; } else if (aero.hasETypeFlag(Entity.ETYPE_WARSHIP)) { if (((Jumpship) aero).getDriveCoreType() == Jumpship.DRIVE_CORE_SUBCOMPACT) { return 25000; } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP)) { if (aero.isPrimitive()) { return getPrimitiveJumpshipMaxTonnage(aero, faction); } else if (aero.hasETypeFlag(Entity.ETYPE_DROPSHIP)) { if (aero.isPrimitive()) { return getPrimitiveDropshipMaxTonnage(aero); } else if (aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT) || aero.hasETypeFlag(Entity.ETYPE_FIXED_WING_SUPPORT)) { return 200; } else if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { return 50; } else {
@Override public String getName() { if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { return "Conventional Fighter: " + aero.getDisplayName(); } else { return "Aerospace Fighter: " + aero.getDisplayName(); } }
@Override public int getCountHeatSinks() { if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { return heatNeutralHSRequirement(); } return aero.getHeatSinks(); }
public static int weightFreeHeatSinks(Aero aero) { if (aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { return TestSmallCraft.weightFreeHeatSinks((SmallCraft) aero); } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP)) { return TestAdvancedAerospace.weightFreeHeatSinks((Jumpship) aero); } else if (aero.hasEngine()) { return aero.getEngine().getWeightFreeEngineHeatSinks(); } else { return 0; } }
@Override public double getWeightHeatSinks() { if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { int required = heatNeutralHSRequirement(); return Math.max(0, required - engine.getWeightFreeEngineHeatSinks()); } else { return Math.max(getCountHeatSinks() - engine.getWeightFreeEngineHeatSinks(), 0); } }
/** * Calculate the structural integrity weight */ public double getWeightStructure() { double tonnage = 0; if (aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { tonnage = aero.getSI() * aero.getWeight(); if (aero.isSpheroid()) { tonnage /= 500; } else { tonnage /= 200; } } else if (aero.hasETypeFlag(Entity.ETYPE_SPACE_STATION)) { tonnage = aero.getWeight() / 100; } else if (aero.hasETypeFlag(Entity.ETYPE_WARSHIP)) { // SI * weight / 1000, rounded up to half ton tonnage = aero.getSI() * aero.getWeight() / 1000; } else if (aero.hasETypeFlag(Entity.ETYPE_JUMPSHIP)) { tonnage = aero.getWeight() / 150; } else { // Fighters do not allocate weight to structure return 0; } return Math.ceil(tonnage * 2) / 2.0; }
/** * Checks that Conventional fighters only have a standard cockpit and that * Aerospace fighters have a valid cockpit (standard, small, primitive, * command console). * * @param buff * @return */ public boolean correctControlSystems(StringBuffer buff){ if ((aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) && aero.getCockpitType() != Aero.COCKPIT_STANDARD){ buff.append( "Conventional fighters may only have standard cockpits!"); return false; } else if (aero.getCockpitType() < Aero.COCKPIT_STANDARD || aero.getCockpitType() > Aero.COCKPIT_PRIMITIVE){ buff.append( "Invalid cockpit type!"); return false; } return true; }
int rating; long eType = unit.getEntityType(); if (unit.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { rating = (tonnage * desiredSafeThrust); } else if (eType == Entity.ETYPE_AERO){
@Override public double getWeightControls() { // Controls for Aerospace Fighters and Conventional Fighters consists // of the cockpit and the fuel double weight; if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { // Weight = tonnage * 0.1 rounded to nearest half ton weight = Math.round(0.1 * aero.getWeight()*2) / 2.0; } else { weight = 3.0; if (aero.getCockpitType() == Aero.COCKPIT_SMALL) { weight = 2.0; } else if (aero.getCockpitType() == Aero.COCKPIT_COMMAND_CONSOLE){ weight = 6.0; } else if (aero.getCockpitType() == Aero.COCKPIT_PRIMITIVE) { weight = 5.0; } } return weight; }
if (hasETypeFlag(Entity.ETYPE_DROPSHIP)) { for (Sensor sensor : getSensors()) { if (sensor.getType() == Sensor.TYPE_SPACECRAFT_ESM) { } else if (hasETypeFlag(Entity.ETYPE_AERO)) { for (Sensor sensor : getSensors()) { if (sensor.getType() == Sensor.TYPE_AERO_THERMAL) { if (hasETypeFlag(Entity.ETYPE_DROPSHIP) || hasETypeFlag(Entity.ETYPE_SPACE_STATION) || hasETypeFlag(Entity.ETYPE_JUMPSHIP) || hasETypeFlag(Entity.ETYPE_WARSHIP)) { } else if (hasETypeFlag(Entity.ETYPE_AERO) || hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) {
/** * Computes and returns the maximum number of turns the given unit could * fly at safe thrust given its fuel payload. Aerospace fighters consume * 1 fuel point per thrust point spent up the the maximum safe thrust, * whereas conventional fighters with turbine engines consume 0.5 fuel * points per thrust point spent up to the maximum safe thrust. * See Strategic Operations pg 34. * * @param aero * @return */ public static float calculateMaxTurnsAtSafe(Aero aero){ int fuelPoints = aero.getFuel(); float fuelPerTurn; if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER) && aero.hasEngine() && (aero.getEngine().getEngineType() == Engine.COMBUSTION_ENGINE)) { fuelPerTurn = aero.getWalkMP() * 0.5f; } else if (aero.getWalkMP() == 0) { fuelPerTurn = 0.2f; } else { fuelPerTurn = aero.getWalkMP(); } return fuelPoints/fuelPerTurn; }
/** * One gunner is required for each capital weapon and each six standard scale weapons, rounding up * @return The vessel's minimum gunner requirements. */ public static int requiredGunners(Aero aero) { if (!aero.isLargeCraft() && !aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) { return 0; } int capitalWeapons = 0; int stdWeapons = 0; for (Mounted m : aero.getTotalWeaponList()) { if (m.getType() instanceof BayWeapon) { continue; } if ((((WeaponType)m.getType()).getLongRange() <= 1) // MML range depends on ammo, and getLongRange() returns 0 && (((WeaponType) m.getType()).getAmmoType() != AmmoType.T_MML)) { continue; } if (((WeaponType)m.getType()).isCapital() || (m.getType() instanceof ScreenLauncherWeapon)) { capitalWeapons++; } else { stdWeapons++; } } return capitalWeapons + (int)Math.ceil(stdWeapons / 6.0); }
&& !aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { buff.append("Heat Sinks:\n"); buff.append(" Engine "
@Override public double getWeightPowerAmp() { // Conventional Fighters with ICE engines may need a power amp if ((aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) && aero.hasEngine() && (aero.getEngine().getEngineType() == Engine.COMBUSTION_ENGINE)) { double weight = 0; for (Mounted m : aero.getWeaponList()) { WeaponType wt = (WeaponType) m.getType(); if (wt.hasFlag(WeaponType.F_ENERGY) && !(wt instanceof CLChemicalLaserWeapon) && !(wt instanceof VehicleFlamerWeapon)) { weight += wt.getTonnage(aero); } Mounted linkedBy = m.getLinkedBy(); if ((linkedBy != null) && (linkedBy.getType() instanceof MiscType) && linkedBy.getType().hasFlag(MiscType.F_PPC_CAPACITOR)){ weight += ((MiscType)linkedBy.getType()).getTonnage(aero); } } // Power amp weighs: // energy weapon tonnage * 0.1 rounded to nearest half ton return Math.ceil(0.1 * weight*2) / 2.0; } return 0; }
addFluff(); setModelData("isOmni", aero.isOmni()); setModelData("isConventional", aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)); final TestAero testAero = new TestAero(aero, verifier.aeroOption, null); setModelData("engineName", stripNotes(aero.getEngine().getEngineName()));
int fuelPoints = aero.getFuel(); float fuelPerTurn; if (aero.hasETypeFlag(Entity.ETYPE_CONV_FIGHTER)) { fuelPerTurn = aero.getWalkMP() * 0.5f; if(aero.hasEngine()) {