@Override protected boolean doChecks(Vector<Report> vPhaseReport) { if ((roll <= 2) && !(ae instanceof Infantry)) { int caselesscrit = Compute.d6(2); Report r = new Report(3164); r.subject = subjectId; r.add(caselesscrit); if (caselesscrit >= 8) { // Round explodes destroying weapon weapon.setDestroyed(true); r.choose(false); } else { // Just a jam weapon.setJammed(true); r.choose(true); } vPhaseReport.addElement(r); return true; } return false; } }
mounted.setDestroyed(true);
mounted.setDestroyed(hitFlag || destFlag);
@Override public void updateConditionFromPart() { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { mounted.setHit(false); mounted.setDestroyed(false); mounted.setRepairable(true); unit.repairSystem(CriticalSlot.TYPE_EQUIPMENT, equipmentNum); mounted.setShotsLeft(getFullShots() - shotsNeeded); } } }
@Override public void updateConditionFromPart() { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { mounted.setHit(true); mounted.setDestroyed(true); mounted.setRepairable(false); unit.destroySystem(CriticalSlot.TYPE_EQUIPMENT, unit.getEntity().getEquipmentNum(mounted)); } } }
@Override public void fix() { super.fix(); if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { mounted.setHit(false); mounted.setMissing(false); mounted.setDestroyed(false); unit.repairSystem(CriticalSlot.TYPE_EQUIPMENT, equipmentNum); } checkWeaponBay(); } }
@Override public void updateConditionFromPart() { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { mounted.setMissing(false); if(hits >= 1) { mounted.setDestroyed(true); mounted.setHit(true); mounted.setRepairable(true); unit.damageSystem(CriticalSlot.TYPE_EQUIPMENT, equipmentNum, hits); } else { mounted.setHit(false); mounted.setDestroyed(false); mounted.setRepairable(true); unit.repairSystem(CriticalSlot.TYPE_EQUIPMENT, equipmentNum); } setOmniPodded(mounted.isOmniPodMounted()); } checkWeaponBay(); } }
@Override public void updateConditionFromPart() { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { mounted.setHit(false); mounted.setDestroyed(false); mounted.setRepairable(true); unit.repairSystem(CriticalSlot.TYPE_EQUIPMENT, equipmentNum); mounted.setShotsLeft(getFullShots() - shotsNeeded/getNumTroopers()); } } }
/** * Method to destroy a single spotlight on an entity. Spotlights can be * destroyed on a roll of 7+ on a torso hit on a mek or on a front/side hit * on a combat vehicle. */ public void destroyOneSpotlight() { if (!hasSpotlight()) { return; } // A random spotlight should be destroyed, but this is easier... if (hasExternalSpotlight) { hasExternalSpotlight = false; } for (Mounted m : getMisc()) { if (m.getType().hasFlag(MiscType.F_SEARCHLIGHT) && !m.isInoperable()) { m.setDestroyed(true); break; } } // Turn off the light all spot lights were destroyed if (!hasSpotlight()) { setSpotlightState(false); } }
@Override public void updateConditionFromPart() { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { mounted.setHit(false); mounted.setDestroyed(false); mounted.setRepairable(true); mounted.changeAmmoType((AmmoType) type); unit.repairSystem(CriticalSlot.TYPE_EQUIPMENT, equipmentNum); mounted.setShotsLeft(getFullShots() - shotsNeeded); mounted.setAmmoCapacity(capacity); } } }
/** * Marks all equipment in a location on an <code>Entity<code> as destroyed. * * @param en * - the <code>Entity</code> whose location is destroyed. * @param loc * - the <code>int</code> index of the destroyed location. */ private void destroyLocation(Entity en, int loc) { // mark armor, internal as destroyed en.setArmor(IArmorState.ARMOR_DESTROYED, loc, false); en.setInternal(IArmorState.ARMOR_DESTROYED, loc); if (en.hasRearArmor(loc)) { en.setArmor(IArmorState.ARMOR_DESTROYED, loc, true); } // equipment marked missing for (Mounted mounted : en.getEquipment()) { if (mounted.getLocation() == loc) { mounted.setDestroyed(true); } } // all critical slots set as missing for (int i = 0; i < en.getNumberOfCriticals(loc); i++) { final CriticalSlot cs = en.getCritical(loc, i); if (cs != null) { cs.setDestroyed(true); } } }
weaponBay.setHit(false); weaponBay.setMissing(false); weaponBay.setDestroyed(false); unit.repairSystem(CriticalSlot.TYPE_EQUIPMENT, wBayIndex); return; weaponBay.setHit(false); weaponBay.setMissing(false); weaponBay.setDestroyed(false); unit.repairSystem(CriticalSlot.TYPE_EQUIPMENT, wBayIndex); return; weaponBay.setDestroyed(true); weaponBay.setRepairable(true); unit.destroySystem(CriticalSlot.TYPE_EQUIPMENT, wBayIndex);
@Override public void updateConditionFromPart() { if(null != unit) { unit.getEntity().setInternal((int)Math.round(percent * unit.getEntity().getOInternal(loc)), loc); //TODO: we need to cycle through slots and remove crits on non-hittable ones //We shouldn't have to do this, these slots should not be hit in MM for (int i = 0; i < unit.getEntity().getNumberOfCriticals(loc); i++) { CriticalSlot slot = unit.getEntity().getCritical(loc, i); if ((slot != null) && !slot.isEverHittable()) { slot.setDestroyed(false); slot.setHit(false); slot.setRepairable(true); slot.setMissing(false); Mounted m = slot.getMount(); m.setHit(false); m.setDestroyed(false); m.setMissing(false); m.setRepairable(true); } } } }
- mount.damageTaken; mount.damageTaken = mount.baseDamageAbsorptionRate; mount.setDestroyed(true); mount.setHit(true);
if(null != mounted) { mounted.setHit(true); mounted.setDestroyed(true); mounted.setRepairable(false); unit.destroySystem(CriticalSlot.TYPE_EQUIPMENT, equipmentNum);
if(null != m) { m.setHit(true); m.setDestroyed(true); m.setRepairable(false); if(m.getLocation() == loc || m.getSecondLocation() == loc) { m.setHit(true); m.setDestroyed(true); m.setRepairable(false);
if (null != crit) { int hits = crit.getHits(); m.setDestroyed(hits > 0); m.setHit(hits > 0); entity.damageSystem(CriticalSlot.TYPE_EQUIPMENT, eqNum, hits);