/** * 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; }
public PilotingRollData addQuadPilotingBonus(PilotingRollData roll, int destroyedLegs) { if (destroyedLegs == 0) { roll.addModifier(-2, "Quad bonus"); } return roll; }
public PilotingRollData checkLandingInHeavyWoods( EntityMovementType overallMoveType, IHex curHex) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); roll.addModifier(TargetRoll.CHECK_FALSE, "Protomechs cannot fall"); return roll; } }
@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) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: VTOLs can't skid"); return roll; }
@Override public PilotingRollData checkThrustSITotal(int thrust, EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); roll.addModifier(TargetRoll.CHECK_FALSE,"Check false: Entity is not exceeding SI"); return roll; }
public PilotingRollData checkLandingInHeavyWoods( EntityMovementType overallMoveType, IHex curHex) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); roll.addModifier(TargetRoll.CHECK_FALSE, "Infantry cannot fall"); return roll; }
/** * Checks if the entity is getting up. If so, returns the target roll for * the piloting skill check. */ public PilotingRollData checkGetUp(MoveStep step, EntityMovementType moveType) { PilotingRollData roll = super.checkGetUp(step, moveType); roll.addModifier(4, "armless Mech"); return roll; }
@Override public PilotingRollData checkThrustSI(int thrust, EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); roll.addModifier(TargetRoll.CHECK_FALSE,"Check false: Entity is not exceeding SI"); return roll; }
@Override public PilotingRollData addEntityBonuses(PilotingRollData prd) { if (motivePenalty > 0) { prd.addModifier(motivePenalty, "Steering Damage"); } if (isDriverHit()) { prd.addModifier(2, "pilot injured"); } if (isStabiliserHit(LOC_ROTOR)) { prd.addModifier(3, "flight stabiliser damaged"); } // VDNI bonus? if (hasAbility(OptionsConstants.MD_VDNI) && !hasAbility(OptionsConstants.MD_BVDNI)) { prd.addModifier(-1, "VDNI"); } return prd; }
/** * calculate any changes to the PSR modifier for entering difficult terrain */ private void adjustDifficultTerrainPSRModifier(PilotingRollData psr) { if (hasQuirk(OptionsConstants.QUIRK_POS_EASY_PILOT) && (getCrew().getPiloting() > 3)) { psr.addModifier(-1, "easy to pilot"); } if (hasQuirk(OptionsConstants.QUIRK_NEG_UNBALANCED)) { psr.addModifier(+1, "unbalanced"); } }
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; }
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; }
/** * Checks if the entity is attempting to sprint with supercharger engaged. * If so, returns the target roll for the piloting skill check. */ public PilotingRollData checkSprintingWithSupercharger( EntityMovementType overallMoveType, int used) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); if ((overallMoveType == EntityMovementType.MOVE_SPRINT || overallMoveType == EntityMovementType.MOVE_VTOL_SPRINT) && (used > ((int) Math.ceil(2.5 * this.getWalkMP())))) { roll.append(new PilotingRollData(getId(), 0, "sprinting with active MASC/Supercharger")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not attempting to sprint with Supercharger"); } addPilotingModifierForTerrain(roll); return roll; }
default PilotingRollData checkThrustSI(int thrust, EntityMovementType overallMoveType) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(overallMoveType); if (thrust > getSI()) { // append the reason modifier roll.append(new PilotingRollData(((Entity) this).getId(), thrust - getSI(), "Thrust exceeds current SI in a single hex")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not exceeding SI"); } return roll; }
/** * Checks if the entity is attempting to sprint with supercharger engaged. * If so, returns the target roll for the piloting skill check. */ public PilotingRollData checkUsingOverdrive (EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); if ((overallMoveType == EntityMovementType.MOVE_SPRINT || overallMoveType == EntityMovementType.MOVE_VTOL_SPRINT) && (this instanceof Tank || (this instanceof QuadVee && getConversionMode() == QuadVee.CONV_MODE_VEHICLE))) { roll.append(new PilotingRollData(getId(), 0, "using overdrive")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not using overdrive"); } return roll; }
default PilotingRollData checkHover(MovePath md) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(md.getLastStepMovementType()); if (md.contains(MoveStepType.HOVER) && (md.getLastStepMovementType() == EntityMovementType.MOVE_OVER_THRUST)) { // append the reason modifier roll.append(new PilotingRollData(((Entity) this).getId(), 0, "hovering above safe thrust")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: entity did not hover"); } return roll; }
default PilotingRollData checkRolls(MoveStep step, EntityMovementType overallMoveType) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(overallMoveType); if (((step.getType() == MoveStepType.ROLL) || (step.getType() == MoveStepType.YAW)) && (step.getNRolls() > 1)) { // append the reason modifier roll.append(new PilotingRollData(((Entity) this).getId(), 0, "More than one roll in the same turn")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not rolling more than once"); } return roll; }
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; }
/** * Checks if the entity is landing (from a jump) on ice-covered water. */ public PilotingRollData checkLandingOnIce( EntityMovementType overallMoveType, IHex curHex) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); if (curHex.containsTerrain(Terrains.ICE) && (curHex.terrainLevel(Terrains.WATER) > 0)) { roll.append(new PilotingRollData(getId(), 0, "landing on ice-covered water")); addPilotingModifierForTerrain(roll); adjustDifficultTerrainPSRModifier(roll); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "hex is not covered by ice"); } return roll; }
/** * Checks if a maneuver requires a control roll */ default PilotingRollData checkManeuver(MoveStep step, EntityMovementType overallMoveType) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(overallMoveType); if ((step == null) || (step.getType() != MoveStepType.MANEUVER)) { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not attempting to get up."); return roll; } boolean sideSlipMod = (this instanceof ConvFighter) && isVSTOL(); roll.append( new PilotingRollData(((Entity) this).getId(), ManeuverType.getMod(step.getManeuverType(), sideSlipMod), ManeuverType.getTypeName(step.getManeuverType()) + " maneuver")); return roll; }