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; }
/** * 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; }
/** * Checks if the entity is moving into depth 1+ water. If so, returns the * target roll for the piloting skill check. */ public PilotingRollData checkWaterMove(int waterLevel, EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); int mod; if (waterLevel == 1) { mod = -1; } else if (waterLevel == 2) { mod = 0; } else { mod = 1; } if ((waterLevel > 1) && hasAbility(OptionsConstants.PILOT_TM_FROGMAN) && ((this instanceof Mech) || (this instanceof Protomech))) { roll.append(new PilotingRollData(getId(), -1, "Frogman")); } if (waterLevel > 0) { // append the reason modifier roll.append(new PilotingRollData(getId(), mod, "entering Depth " + waterLevel + " Water")); adjustDifficultTerrainPSRModifier(roll); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: No water here."); } return roll; }
/** * Checks if the entity is attempting to increase two speed categories. * If so, returns the target roll for the piloting skill check. */ public PilotingRollData checkGunningIt (EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); if (game.getOptions().booleanOption(OptionsConstants.ADVGRNDMOV_VEHICLE_ACCELERATION) && (this instanceof Tank || (this instanceof QuadVee && getConversionMode() == QuadVee.CONV_MODE_VEHICLE))) { if (((overallMoveType == EntityMovementType.MOVE_SPRINT || overallMoveType == EntityMovementType.MOVE_VTOL_SPRINT) && (movedLastRound == EntityMovementType.MOVE_WALK || movedLastRound == EntityMovementType.MOVE_VTOL_WALK)) || ((overallMoveType == EntityMovementType.MOVE_RUN || overallMoveType == EntityMovementType.MOVE_VTOL_RUN) && (movedLastRound == EntityMovementType.MOVE_NONE || movedLastRound == EntityMovementType.MOVE_JUMP || movedLastRound == EntityMovementType.MOVE_SKID))) { roll.append(new PilotingRollData(getId(), 0, "gunning it")); return roll; } } roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not gunning it"); 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; }
/** * Checks if the entity is landing (from a jump) with damage that would * force a PSR. If so, returns the target roll for the piloting skill check. */ public PilotingRollData checkLandingWithDamage( EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); int gyroHits = getBadCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO, Mech.LOC_CT); //Heavy duty gyro does not force PSR until second hit if (getGyroType() == Mech.GYRO_HEAVY_DUTY || getGyroType() == Mech.GYRO_SUPERHEAVY) { gyroHits--; } if (gyroHits > 0 || hasLegActuatorCrit()) { // append the reason modifier roll.append(new PilotingRollData(getId(), 0, "landing with damaged leg actuator or gyro")); addPilotingModifierForTerrain(roll); } else { roll.addModifier( TargetRoll.CHECK_FALSE, "Entity does not have gyro or leg actuator damage -- checking for purposes of determining PSR " + "after jump."); } return roll; }
/** * Checks if the entity is attempting to run with damage that would force a * PSR. If so, returns the target roll for the piloting skill check. */ public PilotingRollData checkRunningWithDamage( EntityMovementType overallMoveType) { PilotingRollData roll = getBasePilotingRoll(overallMoveType); int gyroDamage = getBadCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO, Mech.LOC_CT); if (getGyroType() == Mech.GYRO_HEAVY_DUTY) { gyroDamage--; // HD gyro ignores 1st damage } if (((overallMoveType == EntityMovementType.MOVE_RUN) || (overallMoveType == EntityMovementType.MOVE_SPRINT)) && canFall() && ((gyroDamage > 0) || hasHipCrit())) { // append the reason modifier roll.append(new PilotingRollData(getId(), 0, "running with damaged hip actuator or gyro")); } else { roll.addModifier(TargetRoll.CHECK_FALSE, "Check false: Entity is not attempting to run with damage"); } addPilotingModifierForTerrain(roll); 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; }
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; }