public int getModForMetalContent(Entity en, Entity te) { // how much metal is affecting the entity? int metal = Compute.getMetalInPath(en, en.getPosition(), te.getPosition()); switch (type) { case (TYPE_MEK_MAGSCAN): case (TYPE_VEE_MAGSCAN): return metal; default: return 0; } }
public ECMInfo(int range, double strength, Entity e) { owningEntity = e; owner = e.getOwner(); pos = e.getPosition(); this.range = range; this.strength = strength; }
public int sideTableRam(Coords src, int facing) { int fa = (getPosition().degree(src) + ((6 - facing) * 60)) % 360; if (((fa > 30) && (fa <= 90)) || ((fa < 330) && (fa >= 270))) { return Aero.RAM_TOWARD_OBL; } else if ((fa > 150) && (fa < 210)) { return Aero.RAM_AWAY_DIR; } else if (((fa > 90) && (fa <= 150)) || ((fa < 270) && (fa >= 210))) { return Aero.RAM_AWAY_OBL; } else { return Aero.RAM_TOWARD_DIR; } }
public int compare(Entity entX, Entity entY) { int rangeToX = ce().getPosition().distance(entX.getPosition()); int rangeToY = ce().getPosition().distance(entY.getPosition()); if (rangeToX == rangeToY) { return ((entX.getId() < entY.getId()) ? -1 : 1); } return ((rangeToX < rangeToY) ? -1 : 1); } };
public int compare(Entity x, Entity y) { int rangeToX = ce().getPosition().distance(x.getPosition()); int rangeToY = ce().getPosition().distance(y.getPosition()); if (rangeToX == rangeToY) { return x.getId() < y.getId() ? -1 : 1; } return rangeToX < rangeToY ? -1 : 1; } };
/** * @param t * @param w * @param g * @param s */ public CLIATMHandler(ToHitData t, WeaponAttackAction w, IGame g, Server s) { super(t, w, g, s); isAngelECMAffected = ComputeECM.isAffectedByAngelECM(ae, ae.getPosition(), target.getPosition()); }
public MoveOption(IGame game, CEntity centity) { super(game, centity.entity); this.centity = centity; pos = centity.entity.getPosition(); facing = centity.entity.getFacing(); prone = centity.entity.isProne(); }
/** * Apply PSR modifier for difficult terrain in the current position * * @param roll the PSR to modify */ public void addPilotingModifierForTerrain(PilotingRollData roll) { if (getElevation() > 0) { return; } addPilotingModifierForTerrain(roll, getPosition()); }
static CoordFacingCombo createCoordFacingCombo(Entity e) { if (e == null) { return null; } return createCoordFacingCombo(e.getPosition(), e.getFacing()); }
@Override public Rectangle getBounds() { Rectangle tempBounds = new Rectangle(bv.hex_size).union(modelRect); tempBounds.setLocation(bv.getHexLocation(entity.getPosition())); bounds = tempBounds; return bounds; }
public GhostEntitySprite(BoardView1 boardView1, final Entity entity) { super(boardView1); this.entity = entity; String shortName = entity.getShortName(); Font font = new Font("SansSerif", Font.PLAIN, 10); //$NON-NLS-1$ modelRect = new Rectangle(47, 55, bv.getFontMetrics(font).stringWidth( shortName) + 1, bv.getFontMetrics(font).getAscent()); Rectangle tempBounds = new Rectangle(bv.hex_size).union(modelRect); tempBounds.setLocation(bv.getHexLocation(entity.getPosition())); bounds = tempBounds; image = null; }
/** * Jump to our next target. If there isn't one, well, don't do anything. */ private void jumpToNextTarget() { Entity targ = getNextTarget(); if (null == targ) { return; } clientgui.bv.centerOnHex(targ.getPosition()); clientgui.getBoardView().select(targ.getPosition()); target(targ); }
public List<Entity> getEntitiesOwned() { ArrayList<Entity> result = new ArrayList<>(); for (Entity entity : game.getEntitiesVector()) { if (entity.getOwner().equals(getLocalPlayer()) && (entity.getPosition() != null) && !entity.isOffBoard()) { result.add(entity); } } return result; }
public List<Entity> getFriendEntities() { List<Entity> result = new ArrayList<>(); for (Entity entity : game.getEntitiesVector()) { if (!entity.getOwner().isEnemyOf(getLocalPlayer()) && (entity.getPosition() != null) && !entity.isOffBoard()) { result.add(entity); } } return result; }
public void FieldofFire(Entity unit, int[][] ranges, int arc, int loc, int facing) { // do nothing here outside the arty targeting phase if (!(clientgui.getClient().getGame().getPhase() == Phase.PHASE_TARGETING)) return; clientgui.bv.fieldofFireUnit = unit; clientgui.bv.fieldofFireRanges = ranges; clientgui.bv.fieldofFireWpArc = arc; clientgui.bv.fieldofFireWpLoc = loc; clientgui.bv.setWeaponFieldofFire(facing, unit.getPosition()); }
public void FieldofFire(Entity unit, int[][] ranges, int arc, int loc, int facing) { // do nothing here outside the movement phase if (!(clientgui.getClient().getGame().getPhase() == Phase.PHASE_FIRING)) return; clientgui.bv.fieldofFireUnit = unit; clientgui.bv.fieldofFireRanges = ranges; clientgui.bv.fieldofFireWpArc = arc; clientgui.bv.fieldofFireWpLoc = loc; clientgui.bv.setWeaponFieldofFire(facing, unit.getPosition()); }
@Override public void finishedMovingUnits(BoardViewEvent b) { // Are we ignoring events? if (isIgnoringEvents()) { return; } if (clientgui.getClient().isMyTurn() && (ce() != null)) { clientgui.setDisplayVisible(true); clientgui.bv.centerOnHex(ce().getPosition()); } }
public ToHitData toHit(IGame game) { final Entity entity = game.getEntity(getEntityId()); return DfaAttackAction.toHit(game, getEntityId(), game.getTarget(getTargetType(), getTargetId()), entity.getPosition()); }
/** * To-hit number for a ram, assuming that movement has been handled */ public ToHitData toHit(IGame game) { final Entity entity = game.getEntity(getEntityId()); return toHit(game, game.getTarget(getTargetType(), getTargetId()), entity.getPosition(), entity.getElevation(), entity.moved); }
@Override public void finishedMovingUnits(BoardViewEvent b) { // Are we ignoring events? if (isIgnoringEvents()) { return; } if (clientgui.getClient().isMyTurn() && (ce() != null)) { clientgui.setDisplayVisible(true); clientgui.bv.centerOnHex(ce().getPosition()); } }