/** * Force rapid fire mode to the highest level on RAC and UAC - this is for * aeros */ public void setRapidFire() { for (Mounted m : getTotalWeaponList()) { WeaponType wtype = (WeaponType) m.getType(); if (wtype.getAmmoType() == AmmoType.T_AC_ROTARY) { m.setMode("6-shot"); m.setModeSwitchable(false); } else if (wtype.getAmmoType() == AmmoType.T_AC_ULTRA) { m.setMode("Ultra"); m.setModeSwitchable(false); } } }
public void actionPerformed(ActionEvent e) { try { int modePosition = Integer.parseInt(e.getActionCommand()); int weaponNum = gui.mechD.wPan.getSelectedWeaponNum(); Mounted equip = myEntity.getEquipment(weaponNum); equip.setMode(modePosition); client.sendModeChange(myEntity.getId(), weaponNum, modePosition); } catch (Exception ex) { ex.printStackTrace(); } } });
public void deactivateRadicalHS() { for (Mounted m : getMisc()) { if (m.getType().hasFlag(MiscType.F_RADICAL_HEATSINK)) { m.setMode("Off"); // Can only have one radical heat sink break; } } }
/** * @param t * @param w * @param g * @param s */ public PPCHandler(ToHitData t, WeaponAttackAction w, IGame g, Server s) { super(t, w, g, s); // remember capacitor state and turn it off here, // so a crit in the firing phase does not cause an explosion, per the // rules in TO if (weapon.hasChargedCapacitor() != 0) { if (weapon.hasChargedCapacitor() == 2) { chargedCapacitor = 2; weapon.getCrossLinkedBy().setMode("Off"); } if (weapon.hasChargedCapacitor() == 1) { chargedCapacitor = 1; weapon.getLinkedBy().setMode("Off"); } } }
/** * Sets the equipment mode to the mode denoted by the given mode name * * @param newMode * the name of the desired new mode * @return new mode number on success, <code>-1<code> otherwise. */ public int setMode(String newMode) { for (int x = 0, e = type.getModesCount(); x < e; x++) { if (type.getMode(x).equals(newMode)) { setMode(x); return x; } } return -1; }
/** * Prepare the entity for a new round of action. */ @Override public void newRound(int roundNumber) { // Perform all base-class behavior. super.newRound(roundNumber); // If we're equipped with a Magnetic Mine // launcher, turn it to single shot mode. for (Mounted m : getMisc()) { EquipmentType equip = m.getType(); if (BattleArmor.MINE_LAUNCHER.equals(equip.getInternalName())) { m.setMode("Single"); } } }
public void applyChoice() { int n = m_choice.getSelectedIndex(); // If there's no selection, there's nothing we can do if (n == -1){ return; } AmmoType at = m_vTypes.get(n); m_mounted.changeAmmoType(at); m_mounted.setShotsLeft((Integer)m_num_shots.getSelectedItem()); if (chDump.isSelected()) { m_mounted.setShotsLeft(0); } if (clientgui.getClient().getGame().getOptions().booleanOption( OptionsConstants.ADVCOMBAT_TACOPS_HOTLOAD)) { if (chHotLoad.isSelected() != m_mounted.isHotLoaded()) { m_mounted.setHotLoad(chHotLoad.isSelected()); // Set the mode too, so vehicles can switch back int numModes = m_mounted.getType().getModesCount(); for (int m = 0; m < numModes; m++) { if (m_mounted.getType().getMode(m).getName() .equals("HotLoad")) { m_mounted.setMode(m); } } } } }
setMode(nMode); return nMode;
&& m.getLinked().isDestroyed() && m.getLinked().isBreached()) { m.setMode("Off");
/** * Set the retractable blade in the given location as extended Takes the * first piece of appropriate equipment */ public void extendBlade(int loc) { for (Mounted m : getEquipment()) { if ((m.getLocation() == loc) && !m.isDestroyed() && !m.isBreached() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_CLUB) && m.getType().hasSubType(MiscType.S_RETRACTABLE_BLADE)) { m.setMode("extended"); return; } } }
if (!m.equals(this) && m.getType().hasFlag(MiscType.F_COMMUNICATIONS)) { m.setMode(newMode);
for (int i = 0; i < numModes; i++) { if (m.getType().getMode(i).getName().equals("HotLoad")) { m.setMode(i);
/** * Override Entity#newRound() method. */ @Override public void newRound(int roundNumber) { if (hasWorkingMisc(MiscType.F_ELECTRIC_DISCHARGE_ARMOR) && !edpCharged) { for (Mounted misc : getMisc()) { if (misc.getType().hasFlag(MiscType.F_ELECTRIC_DISCHARGE_ARMOR) && misc.curMode().equals("charging")) { if (edpChargeTurns == 6) { setEDPCharged(true); misc.setMode("not charging"); edpChargeTurns = 0; } else { edpChargeTurns++; } } } } setSecondaryFacing(getFacing()); grappledThisRound = false; super.newRound(roundNumber); } // End public void newRound()
&& (m.curMode().getName().contains("-shot")) && (Integer.parseInt(m.curMode().getName().replace("-shot", "")) > ce().getTotalInternal())) { m.setMode(0);
mEquip.setMode(new_stealth); sendModeChange(check_ent.getId(), check_ent .getEquipmentNum(mEquip), new_stealth);
return; m.setMode(nMode);
if (test_type.hasFlag(MiscType.F_STEALTH)) { if (!test_equip.curMode().getName().equals("On")) { test_equip.setMode("On"); super.sendModeChange(entNum, getEntity(entNum) .getEquipmentNum(test_equip), 1);