@Override public PilotingRollData checkGetUp(MoveStep step, EntityMovementType moveType) { PilotingRollData roll = super.checkGetUp(step, moveType); if (roll.getValue() != TargetRoll.CHECK_FALSE) { addStandingPenalties(roll); } return roll; }
default PilotingRollData checkDown(int drop, EntityMovementType overallMoveType) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(overallMoveType); if (drop > 2) { // append the reason modifier roll.append(new PilotingRollData(((Entity) this).getId(), drop, "lost more than two altitudes")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: entity did not drop more than two altitudes"); } return roll; }
/** * * @param rollTarget * @param nagReport * @param psrList */ private static void checkNag(PilotingRollData rollTarget, StringBuffer nagReport, List<TargetRoll> psrList) { if (rollTarget.getValue() != TargetRoll.CHECK_FALSE) { psrList.add(rollTarget); Object[] objs = new Object[] { rollTarget.getValueAsString(), rollTarget.getDesc() }; nagReport .append(Messages.getString("MovementDisplay.addNag", objs));//$NON-NLS-1$ } }
/** * Checks if the entity is being swarmed. If so, returns the target roll for * the piloting skill check to dislodge them. */ public PilotingRollData checkDislodgeSwarmers(MoveStep step, EntityMovementType moveType) { // If we're not being swarmed, return CHECK_FALSE if (Entity.NONE == getSwarmAttackerId()) { return new PilotingRollData(getId(), TargetRoll.CHECK_FALSE, "Check false: No swarmers attached"); } // append the reason modifier PilotingRollData roll = getBasePilotingRoll(moveType); roll.append(new PilotingRollData(getId(), 0, "attempting to dislodge swarmers by dropping prone")); addPilotingModifierForTerrain(roll, step); return roll; }
r.subject = getId(); PilotingRollData base = new PilotingRollData(getId(), getCrew() .getPiloting(), "Base piloting skill"); base = new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL, "Pilot dead"); } else if (!getCrew().isActive()) { base = new PilotingRollData(getId(), TargetRoll.IMPOSSIBLE, "Pilot unconscious"); r.add(base.getValueAsString()); r.add(base.getDesc()); vPhaseReport.add(r); r = new Report(2290); r.newlines = 0; r.add(1); r.add(base.getPlainDesc()); vPhaseReport.add(r); int diceRoll = getCrew().rollPilotingSkill(); r = new Report(2300); r.subject = getId(); r.add(base.getValueAsString()); r.add(diceRoll); if (diceRoll < base.getValue()) { r.choose(false); setStalled(true);
public PilotingRollData addQuadPilotingBonus(PilotingRollData roll, int destroyedLegs) { if (destroyedLegs == 0) { roll.addModifier(-2, "Quad bonus"); } return roll; }
roll.addModifier(4, "superheavy mech moving in building"); roll.append(new PilotingRollData(getId(), mod, "moving through " + desc + " " + bldg.getName())); adjustDifficultTerrainPSRModifier(roll); roll.addModifier(6, "moved 25+ hexes"); } else if (distance >= 18) { roll.addModifier(5, "moved 18-24 hexes"); } else if (distance >= 10) { roll.addModifier(4, "moved 10+ hexes"); } else if (distance >= 7) { roll.addModifier(3, "moved 7-9 hexes"); } else if (distance >= 5) { roll.addModifier(2, "moved 5-6 hexes"); } else if (distance >= 3) { roll.addModifier(1, "moved 3-4 hexes");
/** * Protos don't take piloting skill rolls. */ // TODO: this is no longer true in TacOps. Protos sometimes make PSRs using // their gunnery skill @Override public PilotingRollData getBasePilotingRoll() { return new PilotingRollData(getId(), TargetRoll.CHECK_FALSE, "Protomeks never take PSRs."); }
/** * Resets the PSR list for a given entity. */ public void resetPSRs(Entity entity) { PilotingRollData roll; Vector<Integer> rollsToRemove = new Vector<Integer>(); int i = 0; // first, find all the rolls belonging to the target entity for (i = 0; i < pilotRolls.size(); i++) { roll = pilotRolls.elementAt(i); if (roll.getEntityId() == entity.getId()) { rollsToRemove.addElement(new Integer(i)); } } // now, clear them out for (i = rollsToRemove.size() - 1; i > -1; i--) { pilotRolls.removeElementAt(rollsToRemove.elementAt(i).intValue()); } }
r.subject = getId(); PilotingRollData base = new PilotingRollData(getId(), getCrew() .getPiloting(), "Base piloting skill"); base = new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL, "Pilot dead"); } else if (!getCrew().isActive()) { base = new PilotingRollData(getId(), TargetRoll.IMPOSSIBLE, "Pilot unconscious"); r.add(base.getValueAsString()); r.add(base.getDesc()); vPhaseReport.add(r); r = new Report(2290); r.newlines = 0; r.add(1); r.add(base.getPlainDesc()); vPhaseReport.add(r); int diceRoll = getCrew().rollPilotingSkill(); r = new Report(2300); r.subject = getId(); r.add(base.getValueAsString()); r.add(diceRoll); if (diceRoll < base.getValue()) { r.choose(false); vPhaseReport.add(r);
/** * Double-logging style for situations where the mech automatically falls, * but the pilot can still save to avoid damage. The game will later strip * out any automatic rolls when it lets the pilot roll to save. */ public PilotingRollData(int entityId, int value, int pilotValue, String desc) { super(value, desc); addModifier(pilotValue, desc); this.entityId = entityId; }
PilotingRollData roll = new PilotingRollData(((Entity) this).getId(), ((Entity) this).getCrew().getPiloting(), "Base piloting skill"); roll.addModifier(avihits, "Avionics Damage"); roll.addModifier(5, "Avionics Destroyed"); roll.addModifier(+2, "No life support"); roll.addModifier(getLandingGearPartialRepairs(), "landing gear misrepaired"); } else if (getLandingGearPartialRepairs() == 1) { roll.addModifier(getLandingGearPartialRepairs(), "landing gear misreplaced"); roll.addModifier(1, "misrepaired avionics"); } if (getAvionicsMisreplaced() == 1) { roll.addModifier(1, "misreplaced avionics"); roll.addModifier(velmod, "excess velocity"); roll.addModifier(+4, "Maneuvering thrusters damaged"); roll.addModifier(getLandingGearMod(false), "landing gear damaged"); roll.addModifier(+2, "nose armor destroyed"); roll.addModifier(+2, "thrust reduced to 50% or less of original"); roll.addModifier(+8, "no thrust"); } else {
@Override public PilotingRollData checkSkid(EntityMovementType moveType, IHex prevHex, EntityMovementType overallMoveType, MoveStep prevStep, MoveStep currStep, int prevFacing, int curFacing, Coords lastPos, Coords curPos, boolean isInfantry, int distance) { return new PilotingRollData(getId(), TargetRoll.CHECK_FALSE, "ProtoMechs can't skid"); }
/** * Resets the Control Roll list for a given entity. */ public void resetControlRolls(Entity entity) { PilotingRollData roll; Vector<Integer> rollsToRemove = new Vector<Integer>(); int i = 0; // first, find all the rolls belonging to the target entity for (i = 0; i < controlRolls.size(); i++) { roll = controlRolls.elementAt(i); if (roll.getEntityId() == entity.getId()) { rollsToRemove.addElement(new Integer(i)); } } // now, clear them out for (i = rollsToRemove.size() - 1; i > -1; i--) { controlRolls.removeElementAt(rollsToRemove.elementAt(i).intValue()); } }
default PilotingRollData checkThrustSITotal(int thrust, EntityMovementType overallMoveType) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(overallMoveType); if (thrust > getSI()) { // append the reason modifier roll.append(new PilotingRollData(((Entity) this).getId(), 0, "Thrust spent this turn exceeds current SI")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not exceeding SI"); } return roll; }
@Override public PilotingRollData checkGetUp(MoveStep step, EntityMovementType moveType) { PilotingRollData roll = super.checkGetUp(step, moveType); if (roll.getValue() != TargetRoll.CHECK_FALSE) { addStandingPenalties(roll); } return roll; }
public void getUnstuckModifier(int elev, PilotingRollData rollTarget) { switch (type) { case (Terrains.SWAMP): if (level > 1) { rollTarget.addModifier((3 + ((-3) * elev)), "Quicksand"); break; } rollTarget.addModifier(0, "Swamp"); break; case (Terrains.MAGMA): if (level == 2) { rollTarget.addModifier(0, "Liquid Magma"); } break; case (Terrains.MUD): rollTarget.addModifier(-1, "Mud"); break; case (Terrains.TUNDRA): rollTarget.addModifier(-1, "Tundra"); break; case (Terrains.SNOW): rollTarget.addModifier(-1, "Deep Snow"); break; default: break; } }
PilotingRollData roll = new PilotingRollData(getId(), getCrew().getPiloting(), "Base piloting skill"); if (locationIsLeg(loc)) { if (isLocationBad(loc)) { roll.addModifier(5, getLocationName(loc) + " destroyed"); required = true; } else { roll.addModifier(2, getLocationName(loc) + " Hip Actuator destroyed"); if (!game.getOptions().booleanOption(OptionsConstants.ADVGRNDMOV_TACOPS_LEG_DAMAGE)) { continue; roll.addModifier(1, getLocationName(loc) + " Upper Leg Actuator destroyed"); required = true; roll.addModifier(1, getLocationName(loc) + " Lower Leg Actuator destroyed"); required = true; roll.addModifier(1, getLocationName(loc) + " Foot Actuator destroyed"); required = true; roll.addModifier(0, "landing with gyro or leg damage"); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check not required for landing");
public PilotingRollData checkGliderLanding() { if (!isGlider) { return new PilotingRollData(getId(), TargetRoll.CHECK_FALSE, "Not a glider protomech."); } if (getCritsHit(LOC_LEG) > 2) { return new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL, "Landing with destroyed legs."); } if (!getCrew().isActive()) { return new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL, "Landing incapacitated pilot."); } if (getRunMP() < 4) { return new PilotingRollData(getId(), 8, "Forced landing with insufficient thrust."); } return new PilotingRollData(getId(), 4, "Attempting to land"); }
/** * Resets the extreme Gravity PSR list for a given entity. */ public void resetExtremeGravityPSRs(Entity entity) { PilotingRollData roll; Vector<Integer> rollsToRemove = new Vector<Integer>(); int i = 0; // first, find all the rolls belonging to the target entity for (i = 0; i < extremeGravityRolls.size(); i++) { roll = extremeGravityRolls.elementAt(i); if (roll.getEntityId() == entity.getId()) { rollsToRemove.addElement(new Integer(i)); } } // now, clear them out for (i = rollsToRemove.size() - 1; i > -1; i--) { extremeGravityRolls.removeElementAt(rollsToRemove.elementAt(i) .intValue()); } }