Skip to content

Commit fea135d

Browse files
committed
Adjusted randomness and highlighted turning points in scenarios
Updated the random chance for setting attached unit modifiers and turning points in Stratcon rules to trigger more frequently. Improved the ScenarioTableModel to visually highlight scenarios that are turning points when StratCon is enabled by using custom HTML styling.
1 parent 3a5530c commit fea135d

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

MekHQ/src/mekhq/campaign/stratcon/StratconRulesManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,18 +691,18 @@ private static void determineIfTurningPointScenario(AtBContract contract, Stratc
691691
switch (commandRights) {
692692
case INTEGRATED -> {
693693
scenario.setTurningPoint(true);
694-
if (randomInt(4) == 0) {
694+
if (randomInt(3) == 0) {
695695
setAttachedUnitsModifier(scenario, contract);
696696
}
697697
}
698698
case HOUSE, LIAISON -> {
699-
if (randomInt(4) == 0) {
699+
if (randomInt(3) == 0) {
700700
scenario.setTurningPoint(true);
701701
setAttachedUnitsModifier(scenario, contract);
702702
}
703703
}
704704
case INDEPENDENT -> {
705-
if (randomInt(4) == 0) {
705+
if (randomInt(3) == 0) {
706706
scenario.setTurningPoint(true);
707707
}
708708
}

MekHQ/src/mekhq/gui/model/ScenarioTableModel.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
import java.util.Objects;
3737
import java.util.ResourceBundle;
3838

39+
import static mekhq.utilities.ReportingUtilities.CLOSING_SPAN_TAG;
40+
import static mekhq.utilities.ReportingUtilities.spanOpeningWithCustomColor;
41+
3942
/**
4043
* A table model for displaying scenarios
4144
*/
@@ -109,6 +112,22 @@ public Object getValueAt(int row, int col) {
109112
}
110113

111114
if (col == COL_NAME) {
115+
if (campaign.getCampaignOptions().isUseStratCon()) {
116+
if (scenario instanceof AtBScenario) {
117+
StratconScenario stratconScenario = ((AtBScenario) scenario).getStratconScenario(campaign);
118+
119+
if (stratconScenario != null) {
120+
boolean isTurningPoint = stratconScenario.isTurningPoint();
121+
String openingSpan = isTurningPoint
122+
? spanOpeningWithCustomColor(MekHQ.getMHQOptions().getFontColorWarningHexColor())
123+
: "";
124+
String closingSpan = isTurningPoint ? CLOSING_SPAN_TAG : "";
125+
return String.format("<html>%s%s%s</html", openingSpan,
126+
scenario.getName(), closingSpan);
127+
}
128+
}
129+
}
130+
112131
return scenario.getName();
113132
} else if (col == COL_STATUS) {
114133
return scenario.getStatus();

0 commit comments

Comments
 (0)