/** * The crew is considered unconscious as a whole if none are active and at least one is not dead. * @return Whether at least one crew member is alive but none are conscious. */ public boolean isUnconscious() { return !isDead() && !isActive(); }
public String getDesc(int pos) { if (isMissing(pos)) { return "[missing]"; } String s = new String(name[pos]); if (hits[pos] > 0) { s += " (" + hits[pos] + " hit(s)"; if (isUnconscious(pos)) { s += " [ko]"; } else if (isDead(pos)) { s += " [dead]"; } s += ")"; } else if (isUnconscious(pos)) { s += " [ko]"; } else if (isDead(pos)) { s += " [dead]"; } return s; }
public static boolean isDeadCrew(Entity e) { if (Compute.getFullCrewSize(e) == 0 || e.getCrew().isDead()) { return true; } return false; }
/** * @return A description of the status of crew as a whole */ public String getStatusDesc() { String s = new String(""); if (getHits() > 0) { s += getHits() + " hits"; if (isUnconscious()) { s += " (KO)"; } else if (isDead()) { s += " (dead)"; } } return s; }
/** * @return A description of the status of a single crew member */ public String getStatusDesc(int pos) { if (isMissing(pos)) { return "Missing"; } String s = new String(""); if (getHits(pos) > 0) { s += hits[pos] + " hits"; if (isUnconscious(pos)) { s += " (KO)"; } else if (isDead(pos)) { s += " (dead)"; } } return s; }
/** * @return the initiative bonus this Entity grants for quirks */ public int getQuirkIniBonus() { // command battlemech and and battle computer are not cumulative if (hasQuirk(OptionsConstants.QUIRK_POS_BATTLE_COMP) && !getCrew().isDead() && !getCrew().isUnconscious()) { return 2; } else if (hasQuirk(OptionsConstants.QUIRK_POS_COMMAND_MECH) && !getCrew().isDead() && !getCrew().isUnconscious()) { return 1; } return 0; }
public List<Entity> getEnemyEntities() { ArrayList<Entity> result = new ArrayList<>(); for (Entity entity : game.getEntitiesVector()) { if (entity.getOwner().isEnemyOf(getLocalPlayer()) && (entity.getPosition() != null) && !entity.isOffBoard() && (entity.getCrew() != null) && !entity.getCrew().isDead()) { result.add(entity); } } return result; }
private boolean isEnemyGunEmplacement(final Entity entity, final Coords coords) { return entity.hasETypeFlag(Entity.ETYPE_GUN_EMPLACEMENT) && entity.getOwner().isEnemyOf(getLocalPlayer()) && !getStrategicBuildingTargets().contains(coords) && (null != entity.getCrew()) && !entity.getCrew().isDead(); }
/** * Variation on getTargetableEnemyEntities. * Returns all possible enemy targets, regardless of LOS status. * @param player The player from whose perspective enemies are determined. * @param game The game being played. * @return A list of potential targets. */ static List<Targetable> getAllTargetableEnemyEntities(final IPlayer player, final IGame game, final FireControlState fireControlState) { final List<Targetable> targetableEnemyList = new ArrayList<>(); // Go through every unit in the game. for (final Entity entity : game.getEntitiesVector()) { // If they are my enemy and on the board, they're a target. if (entity.getOwner().isEnemyOf(player) && (null != entity.getPosition()) && !entity.isOffBoard() && entity.isTargetable() && (null != entity.getCrew()) && !entity.getCrew().isDead()) { targetableEnemyList.add(entity); } } // Add in potential building targets and the like. targetableEnemyList.addAll(fireControlState.getAdditionalTargets()); return targetableEnemyList; }
@Override protected void handleEntityDamage(Entity entityTarget, Vector<Report> vPhaseReport, Building bldg, int hits, int nCluster, int bldgAbsorbs) { Report r; // Is the target already swarmed? if (Entity.NONE != entityTarget.getSwarmAttackerId()) { r = new Report(3265); r.subject = subjectId; vPhaseReport.addElement(r); } // Did the target get destroyed by weapons fire? else if (entityTarget.isDoomed() || entityTarget.isDestroyed() || entityTarget.getCrew().isDead()) { r = new Report(3270); r.subject = subjectId; vPhaseReport.addElement(r); } else { // success r = new Report(3275); r.subject = subjectId; vPhaseReport.addElement(r); ae.setSwarmTargetId(waa.getTargetId()); entityTarget.setSwarmAttackerId(waa.getEntityId()); } }
if ((hits[i] > 0) || isUnconscious(i) || isDead(i)) { Report r2 = new Report(); r2.type = Report.PUBLIC; r2.messageId = 7060; r2.choose(true); } else if (isDead(i)) { r2.messageId = 7060; r2.choose(false); r2.messageId = 7065; r2.choose(true); } else if (isDead(i)) { r2.messageId = 7065; r2.choose(false);
/** * Gets all the entities that are potential targets * * @param shooter The unit doing the shooting. * @param game The game being played. * @return A list of potential targets. */ private List<Targetable> getTargetableEnemyEntities(final Entity shooter, final IGame game, final FireControlState fireControlState) { final List<Targetable> targetableEnemyList = new ArrayList<>(); // Go through every unit in the game. for (final Entity entity : game.getEntitiesVector()) { // If they are my enenmy and on the board, they're a target. if (entity.getOwner().isEnemyOf(shooter.getOwner()) && (null != entity.getPosition()) && !entity.isOffBoard() && entity.isTargetable() && (null != entity.getCrew()) && !entity.getCrew().isDead()) { final LosEffects effects = LosEffects.calculateLos(game, shooter.getId(), entity); if (effects.canSee()) { targetableEnemyList.add(entity); } } } // Add in potential building targets and the like. targetableEnemyList.addAll(fireControlState.getAdditionalTargets()); return targetableEnemyList; }
/** * This method returns a true if the unit can reasonably escape from the * board. It can be used to determine whether some non-destroyed units * should be considered possible salvage. * * @return */ public boolean canEscape() { if(null == getCrew()) { return false; } //if the crew is unconscious, dead, or ejected, no escape if(getCrew().isUnconscious() || getCrew().isDead() || (getCrew().isEjected() && !(this instanceof EjectedCrew))) { return false; } //what else? If its permaneantly immobilized or shutdown it can't escape //TODO: should stalled and stuck be here? return !isPermanentlyImmobilized(false) && !isShutDown(); }
/** * This method returns true if a unit is permanently immobilized either * because its crew is dead/gone or because of damage * * @return true if unit is permanently immobile */ public boolean isPermanentlyImmobilized(boolean checkCrew) { if (checkCrew && ((getCrew() == null) || getCrew().isDead())) { return true; } else if (((getOriginalWalkMP() > 0) || (getOriginalRunMP() > 0) || (getOriginalJumpMP() > 0)) /* * Need to make sure here that we're ignoring heat because * that's not actually "permanent": */ && ((getWalkMP(true, true, false) == 0) && (getRunMP(true, true, false) == 0) && (getJumpMP() == 0))) { return true; } else { return false; } }
int dead = 0; for (int i = 0; i < crew.getSlotCount(); i++) { if (crew.isDead(i)) { dead++;
int dead = 0; for (int i = 0; i < originalRide.getCrew().getSlotCount(); i++) { if (originalRide.getCrew().isDead(i)) { dead++;
+ String.valueOf(tgtEnt.getCrew().getToughness(i)); if (tgtEnt.getCrew().isDead(i) || tgtEnt.getCrew().getHits(i) >= Crew.DEATH) { crew +="\" hits=\"Dead"; } else if (tgtEnt.getCrew().getHits(i) > 0) {
.getPiloting(), "Base piloting skill"); if (getCrew().isDead() || getCrew().isDoomed() || (getCrew().getHits() >= 6)) { base = new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL,
if (getCrew().isDead() || getCrew().isDoomed() || (getCrew().getHits() >= 6)) { base = new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL,
pilot.setHits(crew.getHits(0), 0); pilot.setUnconscious(crew.isUnconscious(0), 0); pilot.setDead(crew.isDead(0), 0); pilot.setDoomed(crew.isDoomed()); pilot.setEjected(crew.isEjected());