private void setupLightTarget() { Mockito.when(mockTarget.getInternal(Mockito.anyInt())).thenReturn(6); Mockito.when(mockTarget.getInternal(Mockito.eq(0))).thenReturn(3); Mockito.when(mockTarget.getArmor(Mockito.anyInt(), Mockito.anyBoolean())).thenReturn(12); Mockito.when(mockTarget.getArmor(Mockito.eq(0), Mockito.anyBoolean())).thenReturn(4); }
private void setupMediumTarget() { Mockito.when(mockTarget.getInternal(Mockito.anyInt())).thenReturn(10); Mockito.when(mockTarget.getInternal(Mockito.eq(0))).thenReturn(3); Mockito.when(mockTarget.getArmor(Mockito.anyInt(), Mockito.anyBoolean())).thenReturn(16); Mockito.when(mockTarget.getArmor(Mockito.eq(0), Mockito.anyBoolean())).thenReturn(9); }
/** * 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; }