public boolean isDetectedByEnemy() { // If double blind isn't on, the unit is always detected if ((game != null) && !game.getOptions().booleanOption(OptionsConstants.ADVANCED_DOUBLE_BLIND)) { return true; } return detectedByEnemy; }
/** * Checks to see if the basic conditions needed for point defenses to work are in place * Artillery weapons need to change this slightly */ protected boolean checkPDConditions() { advancedPD = game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ADV_POINTDEF); if ((target == null) || !advancedPD) { return false; } return true; }
/** * @param t * @param w * @param g */ public ArtilleryBayWeaponIndirectHomingHandler(ToHitData t, WeaponAttackAction w, IGame g, Server s) { super(t, w, g, s); advancedPD = g.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ADV_POINTDEF); }
@Override public void autoSetFatalThresh() { int baseThresh = 2; if ((null != game) && game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)) { baseThresh = 20; } fatalThresh = Math.max(baseThresh, (int) Math.ceil(capitalArmor / 4.0)); }
public static double getBVSkillMultiplier(int gunnery, int piloting, IGame game) { if ((game != null) && game.getOptions().booleanOption(OptionsConstants.ADVANCED_ALTERNATE_PILOT_BV_MOD)) { return alternateBvMod[Math.max(Math.min(8, gunnery), 0)][Math.max(Math.min(8, piloting), 0)]; } return bvMod[Math.max(Math.min(8, gunnery), 0)][Math.max(Math.min(8, piloting), 0)]; }
@Override public void autoSetCapArmor() { double divisor = 10.0; if ((null != game) && game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)) { divisor = 1.0; } capitalArmor_orig = (int) Math.round(getTotalOArmor() / divisor); capitalArmor = (int) Math.round(getTotalArmor() / divisor); }
/** * Count all the quirks for this "mounted" object, positive and negative */ public int countQuirks() { if ((null == entity) || (null == entity.game) || !entity.game.getOptions().booleanOption(OptionsConstants.ADVANCED_STRATOPS_QUIRKS)) { return 0; } return quirks.count(); }
public boolean hasQuirk(String name) { if ((null == game) || !game.getOptions().booleanOption(OptionsConstants.ADVANCED_STRATOPS_QUIRKS)) { return false; } return quirks.booleanOption(name); }
/** * count the quirks for this unit, for a given group name */ public int countQuirks(String grpKey) { if ((null == game) || !game.getOptions().booleanOption(OptionsConstants.ADVANCED_STRATOPS_QUIRKS)) { return 0; } return quirks.count(grpKey); }
private void setupBombs() { GridBagLayout gbl = new GridBagLayout(); panBombs.setLayout(gbl); int techlvl = Arrays.binarySearch(TechConstants.T_SIMPLE_NAMES, client .getGame().getOptions().stringOption(OptionsConstants.ALLOWED_TECHLEVEL)); //$NON-NLS-1$ boolean allowNukes = client.getGame().getOptions() .booleanOption(OptionsConstants.ADVAERORULES_AT2_NUKES); //$NON-NLS-1$ m_bombs = new BombChoicePanel((IBomber) entity, allowNukes, techlvl >= TechConstants.T_SIMPLE_ADVANCED); panBombs.add(m_bombs, GBC.std()); }
@Override public void autoSetCapArmor() { double divisor = 10.0; if ((null != game) && game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)) { divisor = 1.0; } capitalArmor_orig = (int) Math.round(getTotalOArmor() / divisor); capitalArmor = (int) Math.round(getTotalArmor() / divisor); }
@Override public boolean hasActiveECM() { if (!game.getOptions() .booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ECM) || !game.getBoard().inSpace()) { return super.hasActiveECM(); } return fighters.stream().map(fid -> game.getEntity(fid)) .filter(ACTIVE_CHECK).filter(ent -> ent.hasActiveECM()) .findFirst().isPresent(); }
@Override public int getRunMP(boolean gravity, boolean ignoreheat, boolean ignoremodulararmor) { boolean fastMove = (game != null) && game.getOptions().booleanOption(OptionsConstants.ADVGRNDMOV_TACOPS_FAST_INFANTRY_MOVE); if(fastMove) { return getWalkMP(gravity, ignoreheat, ignoremodulararmor, false, false) + 1; } return getWalkMP(gravity, ignoreheat, ignoremodulararmor, false, false); }
public int getOriginalSprintMPwithoutMASC() { if (getConversionMode() == CONV_MODE_VEHICLE && (game == null || !game.getOptions() .booleanOption(OptionsConstants.ADVGRNDMOV_VEHICLE_ADVANCED_MANEUVERS))) { return getOriginalRunMP(); } else { return (int) Math.ceil(getOriginalWalkMP() * 2.0); } } /*
/** * Um, basically everything can spot for LRM indirect fire. * * @return true, if the entity is active */ public boolean canSpot() { if (game.getOptions().booleanOption(OptionsConstants.ADVANCED_PILOTS_CANNOT_SPOT) && (this instanceof MechWarrior)) { return false; } return isActive() && !isOffBoard(); }
@Override public boolean usesWeaponBays() { if (null == game) { return true; } return !game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_IND_WEAPONS_GROUNDED_DROPPER) || (isAirborne() || isSpaceborne()); }
/** * Creates new <code>GameOptionsDialog</code> for a <code>Client</code> * * @param client * - the <code>Client</code> parent of this dialog. */ public GameOptionsDialog(ClientGUI client) { super(client.frame, Messages.getString("GameOptionsDialog.title"), true); //$NON-NLS-1$ this.client = client; init(client.frame, client.getClient().getGame().getOptions()); }
@Override public boolean isEjectionPossible() { return game.getOptions().booleanOption(OptionsConstants.ADVGRNDMOV_VEHICLES_CAN_EJECT) && getCrew().isActive() && !hasQuirk(OptionsConstants.QUIRK_NEG_NO_EJECT); }
protected static GameOptions getGameOptions() { if (Server.getServerInstance() == null) { return null; } else if (Server.getServerInstance().getGame() == null) { return null; } return Server.getServerInstance().getGame().getOptions(); }
private void setForwardIniEnabled(boolean enabled) { // forward initiative can only be done if Teams have an initiative! if (clientgui.getClient().getGame().getOptions() .booleanOption(OptionsConstants.BASE_TEAM_INITIATIVE)) { getBtn(MoveCommand.MOVE_FORWARD_INI).setEnabled(enabled); clientgui.getMenuBar().setMoveForwardIniEnabled(enabled); } else { // turn them off regardless what is said! getBtn(MoveCommand.MOVE_FORWARD_INI).setEnabled(false); clientgui.getMenuBar().setMoveForwardIniEnabled(false); } }