* the <code>int</code> ID of the B Pod.
*/
private void triggerBPod(Entity entity, int podId, Entity target) {
// Get the mount for this pod.
Mounted mount = entity.getEquipment(podId);
// Confirm that this is, indeed, an Anti-BA Pod.
if (null == mount) {
System.err.print("Expecting to find an B Pod at ");
System.err.print(podId);
System.err.print(" on the unit, ");
System.err.print(entity.getDisplayName());
System.err.println(" but found NO equipment at all!!!");
return;
}
EquipmentType equip = mount.getType();
if (!(equip instanceof WeaponType) || !equip.hasFlag(WeaponType.F_B_POD)) {
System.err.print("Expecting to find an B Pod at ");
System.err.print(podId);
System.err.print(" on the unit, ");
System.err.print(entity.getDisplayName());
System.err.print(" but found ");
System.err.print(equip.getName());
System.err.println(" instead!!!");
return;
}
// Now confirm that the entity can trigger the pod.
// Ignore the "used this round" flag.
boolean oldFired = mount.isUsedThisRound();
mount.setUsedThisRound(false);
boolean canFire = mount.canFire();
mount.setUsedThisRound(oldFired);
if (!canFire) {
System.err.print("Can not trigger the B Pod at ");
System.err.print(podId);
System.err.print(" on the unit, ");
System.err.print(entity.getDisplayName());
System.err.println("!!!");
return;
}
Report r;
// Mark the pod as fired and log the action.
mount.setFired(true);
r = new Report(3011);
r.newlines = 0;
r.subject = entity.getId();
r.addDesc(entity);
addReport(r);