if (mount.getEntity().usesWeaponBays()) { output.append("\" capacity=\"") .append(String.valueOf(mount.getAmmoCapacity()));
mounted.setOriginalShots(slots * row.munitions.get(i).getShots()); mounted.setAmmoCapacity(slots * row.munitions.get(i).getTonnage(entity)); remainingWeight -= mounted.getAmmoCapacity(); mountIndex++; Mounted m = row.ammoMounts.get(0); AmmoType at = (AmmoType) m.getType(); m.setAmmoCapacity(m.getAmmoCapacity() + remainingWeight); m.setOriginalShots((int) Math.floor(m.getAmmoCapacity() / (at.getShots() * at.getTonnage(entity))));
tonnage = ammoMounts.stream().mapToDouble(m -> m.getAmmoCapacity()).sum(); Map<String,Integer> starting = new HashMap<>(); ammoMounts.forEach(m -> starting.merge(m.getType().getInternalName(), m.getBaseShotsLeft(), Integer::sum));
if (null == part) { part = new LargeCraftAmmoBin((int)entity.getWeight(), m.getType(), eqNum, m.getOriginalShots() - m.getBaseShotsLeft(), m.getAmmoCapacity(), campaign); ((LargeCraftAmmoBin) part).setBay(entity.getBayByAmmo(m)); toAdd.add(part);
@Override public void updateConditionFromEntity(boolean checkForDestruction) { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { capacity = mounted.getAmmoCapacity(); type = mounted.getType(); if(mounted.isMissing() || mounted.isDestroyed()) { mounted.setShotsLeft(0); return; } shotsNeeded = getFullShots() - mounted.getBaseShotsLeft(); } } }
if (mounted.getAmmoCapacity() == 0) { continue;
} else if (entity.usesWeaponBays()) { apart = new LargeCraftAmmoBin((int) entity.getWeight(), m.getType(), eqnum, fullShots - m.getBaseShotsLeft(), m.getAmmoCapacity(), campaign); ((LargeCraftAmmoBin) apart).setBay(entity.getBayByAmmo(m)); } else {
((AmmoBin) p).getEquipmentNum(), ((AmmoBin) p).getShotsNeeded(), ammo.getAmmoCapacity(), retVal); ((LargeCraftAmmoBin) p).setBay(u.getEntity().getBayByAmmo(ammo)); } else { ((MissingAmmoBin) p).getType(), ((MissingAmmoBin) p).getEquipmentNum(), ammo.getAmmoCapacity(), retVal); ((MissingLargeCraftAmmoBin) p).setBay(u.getEntity().getBayByAmmo(ammo));