/** * Checks to see if this bipedmech has a vibroblade in this location. * * @param location * @return boolean <code>true</code> if the mech has vibroblades * <code>false</code> if not. */ public boolean hasVibrobladesInLocation(int location) { // Only arms have VibroBlades. if ((location != Mech.LOC_RARM) && (location != Mech.LOC_LARM)) { return false; } for (int slot = 0; slot < this.getNumberOfCriticals(location); slot++) { CriticalSlot cs = getCritical(location, slot); if (cs == null) { continue; } if (cs.getType() != CriticalSlot.TYPE_EQUIPMENT) { continue; } Mounted m = cs.getMount(); EquipmentType type = m.getType(); if ((type instanceof MiscType) && ((MiscType) type).isVibroblade()) { return !(m.isDestroyed() || m.isMissing() || m.isBreached()); } } return false; }
/** * Does the mech have any shields. a mech can have up to 2 shields. * * @return <code>true</code> if unit has a shield crit. */ @Override public boolean hasShield() { for (Mounted m : getMisc()) { boolean isShield = (m.getType() instanceof MiscType) && ((MiscType) m.getType()).isShield(); if (((m.getLocation() == Mech.LOC_LARM) || (m.getLocation() == Mech.LOC_RARM)) && isShield && !m.isInoperable() && (getInternal(m.getLocation()) > 0)) { for (int slot = 0; slot < this.getNumberOfCriticals(m.getLocation()); slot++) { CriticalSlot cs = getCritical(m.getLocation(), slot); if ((cs != null) && (cs.getType() == CriticalSlot.TYPE_EQUIPMENT) && cs.getMount().equals(m) && !cs.isDestroyed() && !cs.isMissing()) { // when all crits of a shield are destroyed, it // no longer hinders movement and stuff return true; } } } } return false; }
for (int slot = 0; slot < this.getNumberOfCriticals(location); slot++) { CriticalSlot cs = getCritical(location, slot);
for (int slot = 0; slot < this.getNumberOfCriticals(location); slot++) { CriticalSlot cs = getCritical(location, slot);
for (int slot = 0; slot < this.getNumberOfCriticals(location); slot++) { CriticalSlot cs = getCritical(location, slot);
for (int slot = 0; slot < this.getNumberOfCriticals(location); slot++) { CriticalSlot cs = getCritical(location, slot);