public boolean isSpaceborne() { // for now if you are in space, you are spaceborne, but this will become // more complicated when // we start adding multiple maps to the same game and so I should try to // replace most calls to // game.getBoard().inSpace() with this one return game != null && game.getBoard().inSpace(); }
public boolean useVectorMove() { return getOptions().booleanOption(OptionsConstants.ADVAERORULES_ADVANCED_MOVEMENT) && board.inSpace(); }
public EntitySprite(BoardView1 boardView1, final Entity entity, int secondaryPos, Image radarBlipImage) { super(boardView1); this.entity = entity; this.radarBlipImage = radarBlipImage; this.secondaryPos = secondaryPos; if (bv.game.getBoard().inSpace()) { LABEL_BACK = LABEL_SPACE_BACK; } else { LABEL_BACK = LABEL_GROUND_BACK; } getBounds(); }
@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 protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, IGame game, Server server) { if (game.getBoard().inSpace()) { return new KrakenTHandler(toHit, waa, game, server); } return new CapitalMissileHandler(toHit, waa, game, server); } }
private IBoard generateMockBoard() { // we'll be on a nice, empty, 20x20 board, not in space. final IBoard mockBoard = Mockito.mock(Board.class); final IHex mockHex = new Hex(); Mockito.when(mockBoard.getHex(Mockito.any(Coords.class))).thenReturn(mockHex); Mockito.when(mockBoard.contains(Mockito.any(Coords.class))).thenReturn(true); Mockito.when(mockBoard.inSpace()).thenReturn(false); return mockBoard; }
/** * All warships automatically have ECM if in space */ @Override public boolean hasActiveECM() { if (!game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ECM) || !game.getBoard().inSpace()) { return super.hasActiveECM(); } return getECMRange() >= 0; }
/** * All military space stations automatically have ECM if in space */ @Override public boolean hasActiveECM() { if (!game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ECM) || !game.getBoard().inSpace()) { return super.hasActiveECM(); } return getECMRange() >= 0; }
/** * All military small craft automatically have ECM if in space */ @Override public boolean hasActiveECM() { if (!game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ECM) || !game.getBoard().inSpace()) { return super.hasActiveECM(); } return getECMRange() >= 0; }
/** * All military dropships automatically have ECM if in space */ @Override public boolean hasActiveECM() { if (!game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ECM) || !game.getBoard().inSpace()) { return super.hasActiveECM(); } return getECMRange() > Entity.NONE; }
/** * All military jumpships automatically have ECM if in space */ @Override public boolean hasActiveECM() { if (!game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ECM) || !game.getBoard().inSpace()) { return super.hasActiveECM(); } return getECMRange() >= 0; }
/** * @return the strength of the ECCM field this unit emits */ @Override public double getECCMStrength() { if (!game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ECM) || !game.getBoard().inSpace()) { return super.getECCMStrength(); } if (hasActiveECCM()) { return 1; } return 0; }
@Override public void setAltitude(int altitude) { super.setAltitude(altitude); if ((getAltitude() == 0) && (game != null) && !game.getBoard().inSpace() && (getPosition() != null)) { secondaryPositions.put(0, getPosition()); secondaryPositions.put(1, getPosition().translated(getFacing())); secondaryPositions.put(2, getPosition().translated((getFacing() + 1) % 6)); secondaryPositions.put(3, getPosition().translated((getFacing() + 2) % 6)); secondaryPositions.put(4, getPosition().translated((getFacing() + 3) % 6)); secondaryPositions.put(5, getPosition().translated((getFacing() + 4) % 6)); secondaryPositions.put(6, getPosition().translated((getFacing() + 5) % 6)); } }
default PilotingRollData checkVelocityDouble(int velocity, EntityMovementType overallMoveType) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(overallMoveType); if ((velocity > (2 * ((Entity) this).getWalkMP())) && !((Entity) this).getGame().getBoard().inSpace()) { // append the reason modifier roll.append(new PilotingRollData(((Entity) this).getId(), 0, "Velocity greater than 2x safe thrust")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not exceeding 2x safe thrust"); } return roll; }
@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 CapitalMissileHandler (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); } }
@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); } }