public String toString() { return getName(); } }
@Override protected boolean handleSpecialMiss(Entity entityTarget, boolean bldgDamagedOnMiss, Building bldg, Vector<Report> vPhaseReport) { int priority = 1; EquipmentMode mode = (weapon.curMode()); if (mode != null) { if (mode.getName().equals("1-shot")) { priority = 1; } else if (mode.getName().equals("2-shot")) { priority = 2; } else if (mode.getName().equals("3-shot")) { priority = 3; } else if (mode.getName().equals("4-shot")) { priority = 4; } } // add even misses, as they waste homing missiles. TagInfo info = new TagInfo(ae.getId(), target.getTargetType(), target, priority, true); game.addTagInfo(info); return false; }
/** * Method computes how much damage a dial down weapon has done * * @param weapon * @param wtype * @param range * @return new damage */ public static int dialDownDamage(Mounted weapon, WeaponType wtype, int range) { int toReturn = wtype.getDamage(range); if (!wtype.hasModes()) { return toReturn; } String damage = weapon.curMode().getName(); // Vehicle flamers have damage and heat modes so lets make sure this is // an actual dial down Damage. if ((damage.trim().toLowerCase().indexOf("damage") == 0) && (damage.trim().length() > 6)) { toReturn = Integer.parseInt(damage.substring(6).trim()); } return Math.min(wtype.getDamage(range), toReturn); }
/** * Can the switch from the current mode to the new mode happen instantly? * * @param newMode * - integer for the new mode * @return */ public boolean canInstantSwitch(int newMode) { String newModeName = type.getMode(newMode).getName(); String curModeName = curMode().getName(); return getType().hasInstantModeSwitch() && !type.isNextTurnModeSwitch(newModeName) && !type.isNextTurnModeSwitch(curModeName); }
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); } } } } }
if (m.getType().getMode(i).getName().equals("HotLoad")) { m.setMode(i);
use_mode = weapon.curMode().getName();
|| (wt.getAmmoType() == AmmoType.T_AC_ULTRA_THB) || (wt.getAmmoType() == AmmoType.T_AC_ROTARY)) { if ((weapon.curMode().getName().equals("Ultra")) || (weapon.curMode().getName().equals("2-shot")) || (weapon.curMode().getName().equals("3-shot")) || (weapon.curMode().getName().equals("4-shot")) || (weapon.curMode().getName().equals("5-shot")) || (weapon.curMode().getName().equals("6-shot"))) { use_table = true; || (wt.getAmmoType() == AmmoType.T_AC_ULTRA_THB) || (wt.getAmmoType() == AmmoType.T_AC_ROTARY)) { if ((weapon.curMode().getName().equals("Ultra")) || (weapon.curMode().getName().equals("2-shot"))) { fHits = expectedHitsByRackSize[2]; if (weapon.curMode().getName().equals("3-shot")) { fHits = expectedHitsByRackSize[3]; if (weapon.curMode().getName().equals("4-shot")) { fHits = expectedHitsByRackSize[4]; if (weapon.curMode().getName().equals("5-shot")) { fHits = expectedHitsByRackSize[5]; if (weapon.curMode().getName().equals("6-shot")) { fHits = expectedHitsByRackSize[6];
MiscType test_type = (MiscType) test_equip.getType(); if (test_type.hasFlag(MiscType.F_STEALTH)) { if (!test_equip.curMode().getName().equals("On")) { test_equip.setMode("On"); super.sendModeChange(entNum, getEntity(entNum)