Skip to content

Commit

Permalink
add tooltip to more of the reported rolls
Browse files Browse the repository at this point in the history
  • Loading branch information
kuronekochomusuke committed Nov 4, 2023
1 parent a47f0b7 commit f03fbbc
Show file tree
Hide file tree
Showing 3 changed files with 455 additions and 286 deletions.
8 changes: 5 additions & 3 deletions megamek/src/megamek/client/ui/swing/MovementDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -4208,15 +4208,17 @@ private void dumpBombs() {
dumpBombsDialog.getChoices();
// first make a control roll
PilotingRollData psr = ce().getBasePilotingRoll(overallMoveType);
int ctrlroll = Compute.d6(2);
Roll diceRoll = Compute.rollD6(2);
int rollValue = diceRoll.getIntValue();
String rollReport = diceRoll.getReport();
Report r = new Report(9500);
r.subject = ce().getId();
r.add(ce().getDisplayName());
r.add(psr);
r.add(ctrlroll);
r.addDataWithTooltip(String.valueOf(rollValue), rollReport);
r.newlines = 0;
r.indent(1);
if (ctrlroll < psr.getValue()) {
if (rollValue < psr.getValue()) {
r.choose(false);
String title = Messages.getString("MovementDisplay.DumpingBombs.title");
String body = Messages.getString("MovementDisplay.DumpFailure.message");
Expand Down
18 changes: 10 additions & 8 deletions megamek/src/megamek/common/Building.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,24 +432,26 @@ public boolean rollBasement(Coords coords, Board board, Vector<Report> vPhaseRep
Report r = new Report(2111, Report.PUBLIC);
r.add(getName());
r.add(coords.getBoardNum());
int basementRoll = Compute.d6(2);
r.add(basementRoll);
if (basementRoll == 2) {
Roll diceRoll = Compute.rollD6(2);
int rollValue = diceRoll.getIntValue();
String rollReport = diceRoll.getReport();
r.addDataWithTooltip(String.valueOf(rollValue), rollReport);
if (rollValue == 2) {
basement.put(coords, BasementType.TWO_DEEP_FEET);
hex.addTerrain(new Terrain(Terrains.BLDG_BASEMENT_TYPE, basement.get(coords).ordinal()));
} else if (basementRoll == 3) {
} else if (rollValue == 3) {
basement.put(coords, BasementType.ONE_DEEP_FEET);
hex.addTerrain(new Terrain(Terrains.BLDG_BASEMENT_TYPE, basement.get(coords).ordinal()));
} else if (basementRoll == 4) {
} else if (rollValue == 4) {
basement.put(coords, BasementType.ONE_DEEP_NORMAL);
hex.addTerrain(new Terrain(Terrains.BLDG_BASEMENT_TYPE, basement.get(coords).ordinal()));
} else if (basementRoll == 10) {
} else if (rollValue == 10) {
basement.put(coords, BasementType.ONE_DEEP_NORMAL);
hex.addTerrain(new Terrain(Terrains.BLDG_BASEMENT_TYPE, basement.get(coords).ordinal()));
} else if (basementRoll == 11) {
} else if (rollValue == 11) {
basement.put(coords, BasementType.ONE_DEEP_HEAD);
hex.addTerrain(new Terrain(Terrains.BLDG_BASEMENT_TYPE, basement.get(coords).ordinal()));
} else if (basementRoll == 12) {
} else if (rollValue == 12) {
basement.put(coords, BasementType.TWO_DEEP_HEAD);
hex.addTerrain(new Terrain(Terrains.BLDG_BASEMENT_TYPE, basement.get(coords).ordinal()));
} else {
Expand Down
Loading

0 comments on commit f03fbbc

Please sign in to comment.