costs[costIdx++] += 5000 * (getNCrew() + getNPassenger()); costs[costIdx++] += 10000 * getArcswGuns(); costs[costIdx++] += 100000 * getSI(); costs[costIdx++] += 10 * getWeight(); if (isClan()) { engineMultiplier = 0.061; double engineWeight = getOriginalWalkMP() * weight * engineMultiplier; costs[costIdx++] += engineWeight * 1000; costs[costIdx++] += (500 * getOriginalWalkMP() * weight) / 100.0; costs[costIdx++] += (200 * getFuel()) / getFuelPointsPerTon() * 1.02; costs[costIdx++] += getArmorWeight() * EquipmentType.getArmorCost(armorType[0]); int sinkCost = 2000 + (4000 * getHeatType());// == HEAT_DOUBLE ? 6000: costs[costIdx++] += sinkCost * getHeatSinks(); costs[costIdx++] += getWeaponsAndEquipmentCost(ignoreAmmo); for (Bay next : getTransportBays()) { baydoors += next.getDoors(); if ((next instanceof MechBay) || (next instanceof ASFBay) || (next instanceof SmallCraftBay)) {
/** * Return the height of this dropship above the terrain. */ @Override public int height() { if (isAirborne()) { return 0; } if (isSpheroid()) { return 9; } return 4; }
private static String getDropshipCritString(Dropship a) { String retVal = " <dcriticals"; String critVal = ""; //crits if (a.isDockCollarDamaged()) { critVal = critVal.concat(" dockingcollar=\"none\""); } if (a.isKFBoomDamaged()) { critVal = critVal.concat(" kfboom=\"none\""); } if (!critVal.equals("")) { // then add beginning and end retVal = retVal.concat(critVal); retVal = retVal.concat("/>\n"); } else { return critVal; } return retVal; }
/** * Parse a dropCrit tag for the given <code>Entity</code>. * @param dropCritTag * @param entity */ private void parseDropCrit(Element dropCritTag, Entity entity){ String dockingcollar = dropCritTag.getAttribute(DOCKING_COLLAR); String kfboom = dropCritTag.getAttribute(KFBOOM); Dropship d = (Dropship) entity; if (dockingcollar.length() > 0) { d.setDamageDockCollar(true); } if (kfboom.length() > 0) { d.setDamageKFBoom(true); } }
Dropship a = new Dropship(); a.setChassis(dataFile.getDataAsString("Name")[0]); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { a.setModel(dataFile.getDataAsString("Model")[0]); } else { a.setModel(""); a.setSource(dataFile.getDataAsString("source")[0]); a.setOriginalBuildYear(dataFile.getDataAsInt("originalBuildYear")[0]); a.setNCrew(dataFile.getDataAsInt("crew")[0]); a.setNOfficers(dataFile.getDataAsInt("officers")[0]); a.setNGunners(dataFile.getDataAsInt("gunners")[0]); a.setNPassenger(dataFile.getDataAsInt("passengers")[0]); a.setNBattleArmor(dataFile.getDataAsInt("battlearmor")[0]); a.setNMarines(dataFile.getDataAsInt("marines")[0]); a.setNOtherPassenger(dataFile.getDataAsInt("otherpassenger")[0]); a.setLifeBoats(dataFile.getDataAsInt("life_boat")[0]);
bvText.append(getChassis()); bvText.append(" "); bvText.append(getModel()); bvText.append("</b></CENTER>"); bvText.append(nl); for (Mounted mounted : getEquipment()) { if ((mounted.getType() instanceof MiscType) && mounted.getType().hasFlag(MiscType.F_MODULAR_ARMOR)) { modularArmor += mounted.getBaseDamageCapacity() - mounted.getDamageTaken(); dbv += (getTotalArmor() + modularArmor); double dbvSI = getSI() * 2.0; dbv += dbvSI; bvText.append(getSI()); bvText.append(" x 2"); bvText.append(endColumn); double screenAmmoBV = 0; double defEqBV = 0; for (Mounted mounted : getEquipment()) { EquipmentType etype = mounted.getType(); bvText.append(endColumn); bvText.append(startColumn); bvText.append(getBVTypeModifier()); dbv *= getBVTypeModifier(); bvText.append(endColumn);
astechs += 6; when(mockSeeker.getEntityType()).thenReturn(Entity.ETYPE_DROPSHIP); when(mockSeeker.getUnitType()).thenCallRealMethod(); when(mockSeekerUnit.getEntity()).thenReturn(mockSeeker); Bay transportBay; transportBay = new InfantryBay(4.0, 0, 4, InfantryBay.PlatoonType.FOOT); bayList.add(transportBay); when(mockSeeker.getTransportBays()).thenReturn(bayList); crew = new ArrayList<>(20); for (int i = 0; i < 20; i++) { doReturn(mockDropPilot.getLevel()).when(mockSeekerCrew).getPiloting(); doReturn(mockDropGunnery.getLevel()).when(mockSeekerCrew).getGunnery(); when(mockSeeker.getCrew()).thenReturn(mockSeekerCrew);
@Override public boolean usesWeaponBays() { if (null == game) { return true; } return !game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_IND_WEAPONS_GROUNDED_DROPPER) || (isAirborne() || isSpaceborne()); }
((Dropship) entity).getCollarType()); addPart(dropCollar); partsToAdd.add(dropCollar);
Mockito.when(mockDropship.isAirborne()).thenReturn(false); Mockito.when(mockDropship.isAirborneVTOLorWIGE()).thenReturn(false); expected = new ToHitData(); expected.addModifier(FireControl.TH_TAR_GROUND_DS);
private void updateBayCount(Dropship ds) { // ToDo Superheavy Bays. for (Bay bay : ds.getTransportBays()) { if (bay instanceof MechBay) { setMechBayCount(getMechBayCount() + (int)bay.getCapacity()); } else if (bay instanceof BattleArmorBay) { setBaBayCount(getBaBayCount() + (int)bay.getCapacity()); } else if (bay instanceof InfantryBay) { setInfantryBayCount(getInfantryBayCount() + (int) (bay.getCapacity() / ((InfantryBay) bay).getPlatoonType().getWeight())); } else if (bay instanceof LightVehicleBay) { setLightVeeBayCount(getLightVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof HeavyVehicleBay) { setHeavyVeeBayCount(getHeavyVeeBayCount() + (int) bay.getCapacity()); } else if (bay instanceof ASFBay) { setFighterBayCount(getFighterBayCount() + (int) bay.getCapacity()); } else if (bay instanceof SmallCraftBay) { setSmallCraftBayCount(getSmallCraftBayCount() + (int) bay.getCapacity()); } } }
/** * get a vector of launchable units. This is different from loaded in that * units in recovery cannot launch */ public Vector<Entity> getLaunchableUnits() { Vector<Entity> launchable = new Vector<Entity>(); for (int i = 0; i < troops.size(); i++) { Entity nextUnit = game.getEntity(troops.elementAt(i)); if ((nextUnit.getRecoveryTurn() == 0) && !damaged) { if (nextUnit instanceof Dropship) { Dropship ds = (Dropship) nextUnit; if (!ds.isDockCollarDamaged()) { launchable.add(nextUnit); } } } } return launchable; }
@Override public boolean isLocationProhibited(Coords c, int currElevation) { IHex hex = game.getBoard().getHex(c); if (isAirborne()) { if (hex.containsTerrain(Terrains.IMPASSABLE)) { return true;
@Override public void updateConditionFromPart() { if(null != unit && unit.getEntity() instanceof Dropship) { ((Dropship) unit.getEntity()).setDamageDockCollar(hits > 0); ((Dropship) unit.getEntity()).setDamageKFBoom(boomDamaged); } }
blk.writeBlockData("cockpit_type", ((Aero)t).getCockpitType()); } else if ((t instanceof Dropship) && ((Aero)t).isPrimitive()) { blk.writeBlockData("collartype", ((Dropship)t).getCollarType());
if (ds.isDockCollarDamaged()) { result = false;
@Override public void updateConditionFromPart() { if(null != unit && unit.getEntity() instanceof Dropship) { ((Dropship)unit.getEntity()).setDamageDockCollar(true); ((Dropship)unit.getEntity()).setDamageKFBoom(true); } }
public String getCritDamageString() { String toReturn = super.getCritDamageString(); boolean first = toReturn.isEmpty(); if (isDockCollarDamaged()) { if (!first) { toReturn += ", "; } toReturn += "Docking Collar"; first = false; } if (isKFBoomDamaged()) { if (!first) { toReturn += ", "; } toReturn += "K-F Boom"; first = false; } return toReturn; }
&& (((Dropship)this).getCollarType() == Dropship.COLLAR_NO_BOOM)) { setPotCrit(CRIT_AVIONICS);
@Override public void fix() { super.fix(); boomDamaged = false; if(null != unit && unit.getEntity() instanceof Dropship) { ((Dropship)unit.getEntity()).setDamageDockCollar(false); ((Dropship)unit.getEntity()).setDamageKFBoom(false); } }