private boolean hasFireExtinguisher() { if (myEntity.getWeaponList().size() < 1) { return false; } for (Mounted weapon : myEntity.getWeaponList()) { if (((WeaponType) weapon.getType() instanceof ISFireExtinguisher) || ((WeaponType) weapon.getType() instanceof CLFireExtinguisher)) { return true; } } return false; }
@Override public boolean hasArmoredChassis() { for (Mounted misc : miscList) { if (misc.getType().hasFlag(MiscType.F_ARMORED_CHASSIS)) { return true; } } return false; }
ProtomechMunitionChoicePanel(Mounted m, ArrayList<AmmoType> vTypes) { super(m, vTypes, null); m_origAmmo = (AmmoType) m.getType(); m_origShotsLeft = m.getBaseShotsLeft(); }
public List<Mounted> getClubs() { List<Mounted> rv = new ArrayList<Mounted>(); for (Mounted m : getMisc()) { if (m.getType().hasFlag(MiscType.F_CLUB)) { rv.add(m); } } return rv; }
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 CriticalSlot(Mounted mount) { this(TYPE_EQUIPMENT, -1, mount.getType().isHittable(), mount .isArmored()); this.mount = mount; }
public boolean hasTAG() { for (Mounted m : getWeaponList()) { WeaponType equip = (WeaponType) (m.getType()); if ((equip != null) && (equip.hasFlag(WeaponType.F_TAG))) { return true; } } return false; }
public Vector<Mounted> getBombs(BigInteger flag) { Vector<Mounted> bombs = new Vector<Mounted>(); for (Mounted bomb : getBombs()) { BombType btype = (BombType) bomb.getType(); if (!bomb.isInoperable() && (bomb.getUsableShotsLeft() > 0) && btype.hasFlag(flag)) { bombs.add(bomb); } } return bombs; } /**
public boolean usedTag() { for (Mounted weapon : getWeaponList()) { WeaponType wtype = (WeaponType) weapon.getType(); if (weapon.isUsedThisRound() && wtype.hasFlag(WeaponType.F_TAG)) { return true; } } return false; }
@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; }
/** * Attempts to load all weapons with ammo */ public void loadAllWeapons() { for (Mounted mounted : getTotalWeaponList()) { WeaponType wtype = (WeaponType) mounted.getType(); if (wtype.getAmmoType() != AmmoType.T_NA) { loadWeapon(mounted); } } }
public boolean hasActivatedRadicalHS() { for (Mounted m : getMisc()) { if (m.getType().hasFlag(MiscType.F_RADICAL_HEATSINK) && m.curMode().equals("On")) { return true; } } return false; }
/** * @return The number of points taken up by all mounted bombs or other external stores. */ default int getBombPoints() { int points = 0; for (Mounted bomb : getBombs()) { if (bomb.getUsableShotsLeft() > 0) { points += BombType.getBombCost(((BombType) bomb.getType()).getBombType()); } } return points; }
public boolean hasLinkedMGA(Mounted mounted) { for (Mounted m : getWeaponList()) { if ((m.getLocation() == mounted.getLocation()) && m.getType().hasFlag(WeaponType.F_MGA) && !(m.isDestroyed() || m.isBreached()) && m.getBayWeapons().contains(getEquipmentNum(mounted)) && m.getType().hasModes() && m.curMode().equals("Linked")) { return true; } } return false; }
/** * 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); } } }
@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); } }