Skip to content

Commit

Permalink
Add unofficial toggle for dropship uncontrolled crash destruction and…
Browse files Browse the repository at this point in the history
… clean up code
  • Loading branch information
Sleet01 committed Aug 3, 2024
1 parent c054827 commit 8af3671
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions megamek/i18n/megamek/common/options/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ GameOptionsInfo.option.cargo_bay_damage.displayableName=(Unofficial) Damage Carg
GameOptionsInfo.option.cargo_bay_damage.description= If a Cargo critical hit is taken, the cargo/transport bay itself suffers damage in addition to the cargo/units inside.
GameOptionsInfo.option.aero_artillery_munitions.displayableName=(Unofficial) DropShips can use alternate artillery munitions
GameOptionsInfo.option.aero_artillery_munitions.description=If checked, DropShips mounting artillery weapons can load and use alternate munitions
GameOptionsInfo.option.crashed_dropships_survive.displayableName=(Unofficial) Uncontrolled Crashing DropShips can survive
GameOptionsInfo.option.crashed_dropships_survive.description=If checked, DropShips (and larger) that crash while out of control are not instantly destroyed.
GameOptionsInfo.option.expanded_kf_drive_damage.displayableName=(Unofficial) Damage individual K-F Drive components on K-F Drive Critical Hit
GameOptionsInfo.option.expanded_kf_drive_damage.description=If a K-F Drive critical hit is taken, a random component is hit (per BattleSpace rules).
Expand Down
1 change: 1 addition & 0 deletions megamek/src/megamek/common/options/GameOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public synchronized void initialize() {
addOption(advAeroRules, OptionsConstants.ADVAERORULES_ALLOW_LARGE_SQUADRONS, false);
addOption(advAeroRules, OptionsConstants.ADVAERORULES_SINGLE_NO_CAP, false);
addOption(advAeroRules, OptionsConstants.ADVAERORULES_AERO_ARTILLERY_MUNITIONS, false);
addOption(advAeroRules, OptionsConstants.ADVAERORULES_CRASHED_DROPSHIPS_SURVIVE, false);
addOption(advAeroRules, OptionsConstants.ADVAERORULES_EXPANDED_KF_DRIVE_DAMAGE, false);

IBasicOptionGroup initiative = addGroup("initiative");
Expand Down
1 change: 1 addition & 0 deletions megamek/src/megamek/common/options/OptionsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ public class OptionsConstants {
public static final String ADVAERORULES_ALLOW_LARGE_SQUADRONS = "allow_large_squadrons";
public static final String ADVAERORULES_SINGLE_NO_CAP = "single_no_cap";
public static final String ADVAERORULES_AERO_ARTILLERY_MUNITIONS = "aero_artillery_munitions";
public static final String ADVAERORULES_CRASHED_DROPSHIPS_SURVIVE = "crashed_dropships_survive";
public static final String ADVAERORULES_EXPANDED_KF_DRIVE_DAMAGE = "expanded_kf_drive_damage";
public static final String INIT_INF_MOVE_EVEN = "inf_move_even";
public static final String INIT_INF_DEPLOY_EVEN = "inf_deploy_even";
Expand Down
5 changes: 2 additions & 3 deletions megamek/src/megamek/server/GameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -4936,7 +4936,6 @@ private Vector<Report> processCrash(Entity entity, int vel, Coords c) {
crateredElevation = h.getLevel() - 2;
}
if (entity instanceof Dropship) {
Dropship ds = (Dropship) entity;
for (int i = 0; i < 6; i++) {
Coords adjCoords = c.translated(i);
if (!game.getBoard().contains(adjCoords)) {
Expand Down Expand Up @@ -5168,7 +5167,8 @@ private Vector<Report> processCrash(Entity entity, int vel, Coords c) {
}
}

if (destroyDropShip) {
if (destroyDropShip
&& game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_CRASHED_DROPSHIPS_SURVIVE)) {
// Out-of-control DropShip that crashes is automatically destroyed.
r = new Report(9708, Report.PUBLIC);
r.indent();
Expand Down Expand Up @@ -18645,7 +18645,6 @@ else if ((entity.heat >= 14) && !entity.isShutDown()) {
if (entity.getCrew().hasActiveTechOfficer()) {
rollValue += 2;
String rollCalc = rollValue + " [" + diceRoll.getIntValue() + " + 2]";
;
r.addDataWithTooltip(rollCalc, diceRoll.getReport());
} else {
r.add(diceRoll);
Expand Down

0 comments on commit 8af3671

Please sign in to comment.