public void createVictoryConditions() { victory = new Victory(getOptions()); }
public void handleInitiativeCompensation() { if (getOptions().booleanOption(OptionsConstants.INIT_INITIATIVE_STREAK_COMPENSATION)) { TurnOrdered.resetInitiativeCompensation(teams, getOptions().booleanOption(OptionsConstants.INIT_INITIATIVE_STREAK_COMPENSATION)); } }
public boolean gameTimerIsExpired() { return ((getOptions().booleanOption(OptionsConstants.VICTORY_USE_GAME_TURN_LIMIT)) && (getRoundCount() == getOptions() .intOption(OptionsConstants.VICTORY_GAME_TURN_LIMIT))); }
public boolean useVectorMove() { return getOptions().booleanOption(OptionsConstants.ADVAERORULES_ADVANCED_MOVEMENT) && board.inSpace(); }
public void rollInitAndResolveTies() { if (getOptions().booleanOption(OptionsConstants.RPG_INDIVIDUAL_INITIATIVE)) { Vector<TurnOrdered> vRerolls = new Vector<TurnOrdered>(); for (int i = 0; i < entities.size(); i++) { Entity e = entities.get(i); if (initiativeRerollRequests.contains(getTeamForPlayer(e.getOwner()))) { vRerolls.add(e); } } TurnOrdered.rollInitAndResolveTies(getEntitiesVector(), vRerolls, false); } else { TurnOrdered.rollInitAndResolveTies(teams, initiativeRerollRequests, getOptions().booleanOption(OptionsConstants.INIT_INITIATIVE_STREAK_COMPENSATION)); } initiativeRerollRequests.removeAllElements(); }
/** * Returns true if the player has any valid units this turn that are not * infantry, not protomechs, or not either of those. This method is * utitilized by the "A players Infantry moves after that players other * units", and "A players Protomechs move after that players other units" * options. */ public boolean checkForValidNonInfantryAndOrProtomechs(int playerId) { Iterator<Entity> iter = getPlayerEntities(getPlayer(playerId), false) .iterator(); while (iter.hasNext()) { Entity entity = iter.next(); boolean excluded = false; if ((entity instanceof Infantry) && getOptions().booleanOption(OptionsConstants.INIT_INF_MOVE_LATER)) { excluded = true; } else if ((entity instanceof Protomech) && getOptions().booleanOption(OptionsConstants.INIT_PROTOS_MOVE_LATER)) { excluded = true; } if (!excluded && getTurn().isValidEntity(entity, this)) { return true; } } return false; }
if (getOptions().booleanOption(OptionsConstants.INIT_INF_MOVE_MULTI) && (entity instanceof Infantry) && (phase == Phase.PHASE_MOVEMENT)) { if ((getInfantryLeft(entity.getOwnerId()) % getOptions().intOption( OptionsConstants.INIT_INF_PROTO_MOVE_MULTI)) != 1) { if (getOptions().booleanOption(OptionsConstants.INIT_PROTOS_MOVE_MULTI) && (entity instanceof Protomech) && (phase == Phase.PHASE_MOVEMENT)) { if ((getProtomechsLeft(entity.getOwnerId()) % getOptions() .intOption(OptionsConstants.INIT_INF_PROTO_MOVE_MULTI)) != 1) { if (getOptions().booleanOption(OptionsConstants.ADVGRNDMOV_VEHICLE_LANCE_MOVEMENT) && (entity instanceof Tank) && (phase == Phase.PHASE_MOVEMENT)) { if ((getVehiclesLeft(entity.getOwnerId()) % getOptions() .intOption(OptionsConstants.ADVGRNDMOV_VEHICLE_LANCE_MOVEMENT_NUMBER)) != 1) { if (getOptions().booleanOption(OptionsConstants.ADVGRNDMOV_MEK_LANCE_MOVEMENT) && (entity instanceof Mech) && (phase == Phase.PHASE_MOVEMENT)) { if ((getMechsLeft(entity.getOwnerId()) % getOptions() .intOption(OptionsConstants.ADVGRNDMOV_MEK_LANCE_MOVEMENT_NUMBER)) != 1) { if ((getOptions().booleanOption(OptionsConstants.INIT_INF_MOVE_LATER) && (entity instanceof Infantry)) || (getOptions().booleanOption(OptionsConstants.INIT_PROTOS_MOVE_LATER) && (entity instanceof Protomech))) { useInfantryMoveLaterCheck = false;
/** * Get a vector of entity objects that are "acceptable" to attack with this * entity */ public List<Entity> getValidTargets(Entity entity) { List<Entity> ents = new ArrayList<Entity>(); boolean friendlyFire = getOptions().booleanOption(OptionsConstants.BASE_FRIENDLY_FIRE); for (Entity otherEntity : entities) { // Even if friendly fire is acceptable, do not shoot yourself // Enemy units not on the board can not be shot. if ((otherEntity.getPosition() != null) && !otherEntity.isOffBoard() && otherEntity.isTargetable() && !otherEntity.isSensorReturn(entity.getOwner()) && otherEntity.hasSeenEntity(entity.getOwner()) && (entity.isEnemyOf(otherEntity) || (friendlyFire && (entity .getId() != otherEntity.getId())))) { // Air to Ground - target must be on flight path if (Compute.isAirToGround(entity, otherEntity)) { if (entity.getPassedThrough().contains( otherEntity.getPosition())) { ents.add(otherEntity); } } else { ents.add(otherEntity); } } } return Collections.unmodifiableList(ents); }
boolean useTeamInit = getOptions().getOption(OptionsConstants.BASE_TEAM_INITIATIVE) .booleanValue();
g.getOptions().initialize(); String optionFile = p.getString(PARAM_GAME_OPTIONS_FILE); if (optionFile == null) { g.getOptions().loadOptions(); } else { g.getOptions().loadOptions(new MegaMekFile(scenarioFile.getParentFile(), optionFile).getFile(), true);
Mockito.when(mockGame.getSmokeCloudList()).thenReturn( new ArrayList<SmokeCloud>()); Mockito.when(mockGame.getOptions()).thenReturn(mockOptions);
Mockito.when(mockGame.getSmokeCloudList()).thenReturn( new ArrayList<SmokeCloud>()); Mockito.when(mockGame.getOptions()).thenReturn(mockOptions);
&& getOptions().booleanOption(OptionsConstants.RPG_CONDITIONAL_EJECTION)) { ((Mech) entity).setAutoEject(true); if (((Mech) entity).hasCase()
Mockito.when(mockGame.getSmokeCloudList()).thenReturn( new ArrayList<SmokeCloud>()); Mockito.when(mockGame.getOptions()).thenReturn(mockOptions);