@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"); }
/** * 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."); }
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"); }
/** * 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; }
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 MASC engaged. If so, * returns the target roll for the piloting skill check. */ public PilotingRollData checkSprintingWithMASC( EntityMovementType overallMoveType, int used) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); if ((overallMoveType == EntityMovementType.MOVE_SPRINT || overallMoveType == EntityMovementType.MOVE_VTOL_SPRINT) && (used > ((int) Math.ceil(2.0 * 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 MASC"); } addPilotingModifierForTerrain(roll); 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; }
/** * Checks if an entity is landing (from a jump) in heavy woods. */ public PilotingRollData checkLandingInHeavyWoods( EntityMovementType overallMoveType, IHex curHex) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); if (curHex.containsTerrain(Terrains.WOODS, 2)) { roll.append(new PilotingRollData(getId(), 0, "landing in heavy woods")); addPilotingModifierForTerrain(roll); } else if (curHex.containsTerrain(Terrains.WOODS, 3)) { roll.append(new PilotingRollData(getId(), 0, "landing in ultra woods")); addPilotingModifierForTerrain(roll); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "hex does not contain heavy or ultra woods"); } 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; }
/** * Checks if the entity is landing (from a jump) with a prototype JJ If so, * returns the target roll for the piloting skill check. */ public PilotingRollData checkLandingWithPrototypeJJ( EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); if (getJumpType() == Mech.JUMP_PROTOTYPE) { // append the reason modifier roll.append(new PilotingRollData(getId(), 3, "landing with prototype jump jets")); addPilotingModifierForTerrain(roll); } else { roll.addModifier( TargetRoll.CHECK_FALSE, "Entity does not have protype jump jets -- checking for purposes of determining PSR after jump."); } 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; }
@Override public void destroyLocation(int loc, boolean blownOff) { // If it's already destroyed, don't bother -- as of 12/06/28, super. // destroyLocation() will just return having done nothing itself and // then we'd potentially end up with a second PSR for an // already-destroyed // leg. if (getInternal(loc) < 0) { return; } super.destroyLocation(loc, blownOff); // if it's a leg, the entity falls if (locationIsLeg(loc) && canFall()) { game.addPSR(new PilotingRollData(getId(), TargetRoll.AUTOMATIC_FAIL, 5, "leg destroyed")); } }
/** * 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; }
public PilotingRollData checkBogDown(MoveStep step, IHex curHex, Coords lastPos, Coords curPos, boolean isPavementStep) { PilotingRollData roll = new PilotingRollData(getId(), 4, "entering boggy terrain"); int bgMod = curHex.getBogDownModifier(getMovementMode(), false); final boolean onBridge = (curHex.terrainLevel(Terrains.BRIDGE) > 0) && (getElevation() == curHex.terrainLevel(Terrains.BRIDGE_ELEV)); if (!lastPos.equals(curPos) && (bgMod != TargetRoll.AUTOMATIC_SUCCESS) && (step.getMovementType(false) != EntityMovementType.MOVE_JUMP) && (getMovementMode() != EntityMovementMode.HOVER) && (getMovementMode() != EntityMovementMode.VTOL) && (getMovementMode() != EntityMovementMode.WIGE) && (step.getElevation() == 0) && !isPavementStep && !onBridge) { roll.append(new PilotingRollData(getId(), bgMod, "avoid bogging down")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Not entering bog-down terrain, " + "or jumping/hovering over such terrain"); } 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; }
default PilotingRollData checkStall(MovePath md) { PilotingRollData roll = ((Entity) this).getBasePilotingRoll(md.getLastStepMovementType()); // if the entity has already moved, its movement got interrupted (probably by a hidden unit, not much else can interrupt an aero unit) // in which case, the movement is complete. We just need to allow the user to hit 'done'. if(((Entity) this).delta_distance > 0) { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: aero has already moved"); // an airborne, aerodyne aero is considered to "stall" if it's not moving anywhere, // hovering, landing, or going off board } else if ((md.getFinalVelocity() == 0) && !md.contains(MoveStepType.HOVER) && isAirborne() && !isSpheroid() && !((Entity) this).getGame().getBoard().inSpace() && !md.contains(MoveStepType.LAND) && !md.contains(MoveStepType.VLAND) && !md.contains(MoveStepType.RETURN) && !md.contains(MoveStepType.OFF) && !md.contains(MoveStepType.FLEE)) { roll.append(new PilotingRollData(((Entity) this).getId(), 0, "stalled out")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: entity not stalled out"); } return roll; }