/** * @return The number of points taken up by all mounted bombs or other external stores. */ default int getBombPoints() { int points = 0; for (Mounted bomb : getBombs()) { if (bomb.getUsableShotsLeft() > 0) { points += BombType.getBombCost(((BombType) bomb.getType()).getBombType()); } } return points; }
int slots = 1; if (mounted.getType() instanceof BombType) { slots = BombType.getBombCost(((BombType) mounted.getType()).getBombType()); } else if (mounted.getType() instanceof WeaponType) { int type = BombType.getBombTypeForWeapon(mounted.getType());
/** * Produce an int array of the number of bombs of each type based on the * current bomblist. Since this is a FighterSquadron, these numbers * represent the number of bombs in a salvo. That is, it is a count of the * number of fighters in the squadron that have a bomb of the particular * type mounted. * * @return */ @Override public int[] getBombLoadout() { int[] loadout = new int[BombType.B_NUM]; for (Integer fId : fighters) { Entity fighter = (Entity) game.getEntity(fId); for (Mounted m : fighter.getBombs()) { loadout[((BombType) m.getType()).getBombType()]++; } } return loadout; }
/** * produce an int array of the number of bombs of each type based on the * current bomblist * * @return */ public int[] getBombLoadout() { int[] loadout = new int[BombType.B_NUM]; for (Mounted bomb : getBombs()) { if ((bomb.getUsableShotsLeft() > 0) && (bomb.getType() instanceof BombType)) { int type = ((BombType) bomb.getType()).getBombType(); loadout[type] = loadout[type] + 1; } } return loadout; }
@Override public boolean isSamePartType(Part part) { if (part instanceof AmmoStorage) { if (getType() instanceof BombType) { return ((EquipmentPart)part).getType() instanceof BombType && ((BombType)getType()).getBombType() == ((BombType)((EquipmentPart)part).getType()).getBombType(); } else { return ((AmmoType)getType()).getMunitionType() == ((AmmoType)((AmmoStorage)part).getType()).getMunitionType() && ((AmmoType)getType()).equals( (Object)((EquipmentPart)part).getType()); } } return false; }
if (((BombType) bomb.getType()).getBombType() == type && !bomb.isDestroyed() && bomb.getUsableShotsLeft() > 0) { for (int salvo = 0; salvo < numSalvos; salvo++){ for (Mounted bomb : ae.getBombs()) { if (((BombType) bomb.getType()).getBombType() == type && !bomb.isDestroyed() && bomb.getUsableShotsLeft() > 0) { if (((BombType) bomb.getType()).getBombType() == type && !bomb.isDestroyed() && bomb.getUsableShotsLeft() > 0) {
if (BombType.B_CLUSTER == ((BombType) bomb.getType()).getBombType()) { for (int dir = 0; 5 >= dir; dir++) { affectedHexes.add(bombedHex.translated(dir));
@Override protected void useAmmo() { int[] payload = waa.getBombPayload(); if (!ae.isBomber() || (null == payload)) { return; } for (int type = 0; type < payload.length; type++) { for (int i = 0; i < payload[type]; i++) { // find the first mounted bomb of this type and drop it for (Mounted bomb : ae.getBombs()) { if (!bomb.isDestroyed() && (bomb.getUsableShotsLeft() > 0) && (((BombType) bomb.getType()).getBombType() == type)) { bomb.setShotsLeft(0); break; } } } } super.useAmmo(); }
bombPayload[((BombType) bomb.getType()).getBombType()]++;
Entity fighter = game.getEntity(fId); for (Mounted m : fighter.getBombs()) { if (((BombType) m.getType()).getBombType() == btype) { bombCount++;
&& (((BombType)type).getBombType() == BombType.B_ASEW)) { damagePerShot = 5;