public int getBaMountLocation() { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { return mounted.getBaMountLoc(); } } return -1; }
protected void getMountedAmmo() { final String METHOD_NAME = "getMountedAmmo()"; for (int wId : weapon.getBayWeapons()) { Mounted bayW = ae.getEquipment(wId); // check the currently loaded ammo bayWAmmo = bayW.getLinked(); if (bayWAmmo == null) {// Can't happen. w/o legal ammo, the weapon // *shouldn't* fire. logDebug(METHOD_NAME, "Handler can't find any ammo! Oh no!"); } } }
@Override public int getBaseTime() { if(null != unit) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted) { if(!type.equals(mounted.getType())) { return 30; } } } return 15; }
public int countWeaponQuirks() { int count = 0; if ((null == game) || !game.getOptions().booleanOption(OptionsConstants.ADVANCED_STRATOPS_QUIRKS)) { return count; } for (Mounted m : getEquipment()) { count += m.countQuirks(); } return count; }
private JMenu createModeMenu() { JMenu menu = new JMenu("Modes"); int weaponNum = gui.mechD.wPan.getSelectedWeaponNum(); Mounted mounted = myEntity.getEquipment(weaponNum); if ((mounted != null) && mounted.getType().hasModes()) { for (int pos = 0; pos < mounted.getType().getModesCount(); pos++) { menu.add(createModeJMenuItem(mounted, pos)); } } return menu; }
public boolean hasNovaCEWS() { for (Mounted m : getEquipment()) { if ((m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_NOVA) && !m.isInoperable()) { return true; } } return false; }
private int calcBayDamageAndHeat() { int damage = 0; for (int wId : weapon.getBayWeapons()) { Mounted bayW = ae.getEquipment(wId); WeaponType bayWType = ((WeaponType) bayW.getType()); damage += (int) bayWType.getShortAV(); ae.heatBuildup += bayW.getCurrentHeat(); missileArmor = bayWType.missileArmor; } return damage; }
/** * Resets techAdvancement to initial value and adjusts for all installed equipment. */ public void recalculateTechAdvancement() { initTechAdvancement(); for (Mounted m : getEquipment()) { compositeTechLevel.addComponent(m.getType()); if (m.isArmored()) { compositeTechLevel.addComponent(TA_ARMORED_COMPONENT); } } }
protected long getPricePerTon() { //if on a unit, then use the ammo type on the existing entity, to avoid getting it wrong due to //ammo swaps EquipmentType curType = type; if(null != unit && null != unit.getEntity()) { Mounted mounted = unit.getEntity().getEquipment(equipmentNum); if(null != mounted && (mounted.getType() instanceof AmmoType)) { curType = mounted.getType(); } } return (long)curType.getRawCost(); }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { if ((game.getEntity(waa.getEntityId()).getEquipment(waa.getWeaponId()) .curMode().equals("Heat"))) { return new FlamerHeatHandler(toHit, waa, game, server); } return new FlamerHandler(toHit, waa, game, server); }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { Mounted weapon = game.getEntity(waa.getEntityId()).getEquipment( waa.getWeaponId()); if (weapon.curMode().equals("Rapid")) { return new RapidfireHVACWeaponHandler(toHit, waa, game, server); } return new HVACWeaponHandler(toHit, waa, game, server); }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { Mounted weapon = game.getEntity(waa.getEntityId()).getEquipment( waa.getWeaponId()); if (weapon.curMode().equals("Ultra")) { return new PrototypeISUltraWeaponHandler(toHit, waa, game, server); } return super.getCorrectHandler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { Mounted weapon = game.getEntity(waa.getEntityId()).getEquipment( waa.getWeaponId()); if (weapon.curMode().equals("Ultra")) { return new PrototypeCLUltraWeaponHandler(toHit, waa, game, server); } return super.getCorrectHandler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { AmmoType atype = (AmmoType) game.getEntity(waa.getEntityId()) .getEquipment(waa.getWeaponId()).getLinked().getType(); if (atype.getMunitionType() == AmmoType.M_CLUSTER) { return new PrototypeLBXHandler(toHit, waa, game, server); } return new PrototypeACWeaponHandler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { AmmoType atype = (AmmoType) game.getEntity(waa.getEntityId()) .getEquipment(waa.getWeaponId()).getLinked().getType(); if ((atype.getMunitionType() == AmmoType.M_NARC_EX) || (atype.getMunitionType() == AmmoType.M_EXPLOSIVE)) { return new NarcExplosiveHandler(toHit, waa, game, server); } return new NarcHandler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { AmmoType atype = (AmmoType) game.getEntity(waa.getEntityId()) .getEquipment(waa.getWeaponId()).getLinked().getType(); if (atype.hasFlag(AmmoType.F_TELE_MISSILE) && game.getBoard().inSpace()) return new KillerWhaleTHandler(toHit, waa, game, server); return new KillerWhaleHandler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { AmmoType atype = (AmmoType) game.getEntity(waa.getEntityId()) .getEquipment(waa.getWeaponId()).getLinked().getType(); if (atype.hasFlag(AmmoType.F_TELE_MISSILE) && game.getBoard().inSpace()) { return new TeleMissileHandler(toHit, waa, game, server); } return new AR10Handler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { AmmoType atype = (AmmoType) game.getEntity(waa.getEntityId()) .getEquipment(waa.getWeaponId()).getLinked().getType(); if (atype.hasFlag(AmmoType.F_TELE_MISSILE) && game.getBoard().inSpace()) return new WhiteSharkTHandler(toHit, waa, game, server); return new WhiteSharkHandler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { AmmoType atype = (AmmoType) game.getEntity(waa.getEntityId()) .getEquipment(waa.getWeaponId()).getLinked().getType(); if (atype.hasFlag(AmmoType.F_TELE_MISSILE) && game.getBoard().inSpace()) { return new TeleMissileHandler(toHit, waa, game, server); } return new KillerWhaleHandler(toHit, waa, game, server); } }
@Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { AmmoType atype = (AmmoType) game.getEntity(waa.getEntityId()) .getEquipment(waa.getWeaponId()).getLinked().getType(); if (atype.hasFlag(AmmoType.F_TELE_MISSILE) && game.getBoard().inSpace()) return new BarracudaTHandler(toHit, waa, game, server); return new BarracudaHandler(toHit, waa, game, server); } }