public boolean isTurretEverJammed(int turret) { if (turret == getLocTurret()) { return m_bTurretEverJammed; } else if (turret == getLocTurret2()) { return m_bDualTurretEverJammed; } return false; }
public boolean isTurretLocked(int turret) { if (turret == getLocTurret()) { return m_bTurretLocked || m_bTurretJammed; } else if (turret == getLocTurret2()) { return m_bDualTurretLocked || m_bDualTurretJammed; } return false; }
public void lockTurret(int turret) { if (turret == getLocTurret()) { m_bTurretLocked = true; } else if (turret == getLocTurret2()) { m_bDualTurretLocked = true; } }
public void jamTurret(int turret) { if (turret == getLocTurret()) { m_bTurretEverJammed = true; m_bTurretJammed = true; } else if (turret == getLocTurret2()) { m_bDualTurretEverJammed = true; m_bDualTurretJammed = true; } }
public void unjamTurret(int turret) { if (turret == getLocTurret()) { m_bTurretJammed = false; } else if (turret == getLocTurret2()) { m_bDualTurretJammed = false; } }
/** * Parse a turret2lock tag for the given <code>Entity</code>. * * @param turret2LockTag * @param entity */ private void parseTurret2Lock(Element turret2LockTag, Entity entity){ String value = turret2LockTag.getAttribute(DIRECTION); try { int turDir = Integer.parseInt(value); ((Tank) entity).setDualTurretOffset(turDir); ((Tank) entity).lockTurret(((Tank)entity).getLocTurret2()); } catch (Exception e) { System.err.println(e); e.printStackTrace(); warning.append("Invalid turret2 lock direction value in " + "movement tag.\n"); } }
if (tank.isTurretLocked(tank.getLocTurret2())) { for (JRadioButton button : facings) { button.setEnabled(false);
for (int loc = 0; loc < tank.locations(); loc++) { if ((loc == Tank.LOC_BODY) || (loc == tank.getLocTurret()) || (loc == tank.getLocTurret2())) { continue;
public boolean isTurretJammed(int turret) { // this is rather a hack but the only idea I came up with. // for the first time this is checked. If this is a partially repaired // turret it will be jammed. // so just set it to jammed and change the partial repair value to // false. if (getPartialRepairs().booleanOption("veh_locked_turret")) { m_bTurretJammed = true; m_bDualTurretJammed = true; getPartialRepairs().getOption("veh_locked_turret").setValue(false); } if (turret == getLocTurret()) { return m_bTurretJammed; } else if (turret == getLocTurret2()) { return m_bDualTurretJammed; } return false; }
/** * clear turret */ private void doClearTurret() { String title = Messages.getString("FiringDisplay.ClearTurret.title"); //$NON-NLS-1$ String body = Messages.getString("FiringDisplay.ClearTurret.message"); //$NON-NLS-1$ if (!clientgui.doYesNoDialog(title, body)) { return; } if ((((attacks.size() == 0) && (ce() instanceof Tank) && (((Tank) ce()) .isTurretJammed(((Tank) ce()).getLocTurret()))) || ((Tank) ce()) .isTurretJammed(((Tank) ce()).getLocTurret2()))) { UnjamTurretAction uta = new UnjamTurretAction(ce().getId()); attacks.add(uta); ready(); } }
/** * apply the effects of an "engine hit" crit */ public void engineHit() { engineHit = true; immobilize(); lockTurret(getLocTurret()); lockTurret(getLocTurret2()); for (Mounted m : getWeaponList()) { WeaponType wtype = (WeaponType) m.getType(); if (wtype.hasFlag(WeaponType.F_ENERGY) // Chemical lasers still work even after an engine hit. && !(wtype instanceof CLChemicalLaserWeapon) // And presumably vehicle flamers should, too; we can always // remove this again if ruled otherwise. && !(wtype instanceof VehicleFlamerWeapon)) { m.setBreached(true); // not destroyed, just unpowered } } }
public double getTankWeightDualTurret() { double weight = 0; // For omni vees, the base chassis sets a turret weight if (tank.isOmni() && tank.getBaseChassisTurret2Weight() >= 0) { weight = tank.getBaseChassisTurret2Weight(); } else { // For non-omnis, count up the weight of eq in the turret for (Mounted m : tank.getEquipment()) { if ((m.getLocation() == tank.getLocTurret2()) && !(m.getType() instanceof AmmoType)) { weight += m.getType().getTonnage(tank); } } // Turrets weight 10% of the weight of weapons in them weight = weight / 10.0f; } return TestEntity.ceilMaxHalf(weight, getWeightCeilingTurret()); }
if (!hasNoDualTurret() && ((getArmor(getLocTurret2()) < 1) && (getOArmor(getLocTurret2()) > 0))) { if (PreferenceManager.getClientPreferences().debugOutputOn()) { System.out.println(getDisplayName()
if ((ae instanceof Tank) && (ae.getEquipment(weaponId).getLocation() == ((Tank) ae) .getLocTurret2())) { facing = ((Tank) ae).getDualTurretFacing();
Tank t = (Tank) entity; t.unjamTurret(t.getLocTurret()); t.unjamTurret(t.getLocTurret2()); t.resetJammedWeapons();
double turret2Weight = 0; for (Mounted m : tank.getEquipment()) { if ((m.getLocation() == tank.getLocTurret2()) && !(m.getType() instanceof AmmoType)) { turret2Weight += m.getType().getTonnage(tank);
turretWeight += wt.getTonnage(this) / 10.0; if (!hasNoDualTurret() && (m.getLocation() == getLocTurret2())) { turretWeight += wt.getTonnage(this) / 10.0;
armor_values[max_index] = target.getArmor(((Tank) target).getLocTurret2());
} else if ((loc == getLocTurret()) || (loc == getLocTurret2())) { switch (roll) { case 6:
int roll = Compute.d6() - 2; if (roll <= 3) { nArmorLoc = getLocTurret2(); } else { nArmorLoc = getLocTurret();