Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stratcon fix batch #2 #2611

Merged
merged 3 commits into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MekHQ/data/scenariomodifiers/EnemyDropship.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<AtBScenarioModifier>
<additionalBriefingText>An enemy dropship has been grounded in this area, but it's weapons are still active so pay attention.</additionalBriefingText>
<additionalBriefingText>An enemy dropship has been detected in the area.</additionalBriefingText>
<benefitsPlayer>false</benefitsPlayer>
<eventTiming>PostForceGeneration</eventTiming>
<forceDefinition>
Expand Down
2 changes: 1 addition & 1 deletion MekHQ/data/scenariomodifiers/GroundedEnemyDropship.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<AtBScenarioModifier>
<additionalBriefingText>An enemy dropship has been grounded in this area, but it's weapons are still active so pay attention.</additionalBriefingText>
<additionalBriefingText>An enemy dropship has been grounded in this area, but its weapons are still active so pay attention.</additionalBriefingText>
<benefitsPlayer>false</benefitsPlayer>
<eventTiming>PostForceGeneration</eventTiming>
<forceDefinition>
Expand Down
2 changes: 1 addition & 1 deletion MekHQ/data/scenariotemplates/Irregular Forces.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<additionalDetails/>
<description>Destroy, cripple or force the withdrawal of the following forces and units:</description>
<destinationEdge>NONE</destinationEdge>
<objectiveCriterion>Destroy</objectiveCriterion>
<objectiveCriterion>ForceWithdraw</objectiveCriterion>
<percentage>50</percentage>
<timeLimitAtMost>true</timeLimitAtMost>
<timeLimitType>None</timeLimitType>
Expand Down
7 changes: 6 additions & 1 deletion MekHQ/data/scenariotemplates/Low Atmo - Escort.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<name>Low Atmo - Escort</name>
<shortBriefing>Escort allied dropship.</shortBriefing>
<detailedBriefing>Escort designated dropship to its destination.</detailedBriefing>
<isHostileFacility>false</isHostileFacility>
<isAlliedFacility>false</isAlliedFacility>
<mapParameters>
<allowedTerrainTypes/>
<allowRotation>true</allowRotation>
Expand Down Expand Up @@ -41,6 +43,7 @@
<generationOrder>1</generationOrder>
<maxWeightClass>4</maxWeightClass>
<minWeightClass>0</minWeightClass>
<objectiveLinkedForces/>
<retreatThreshold>50</retreatThreshold>
<startingAltitude>5</startingAltitude>
<syncDeploymentType>None</syncDeploymentType>
Expand Down Expand Up @@ -69,6 +72,7 @@
<generationOrder>5</generationOrder>
<maxWeightClass>4</maxWeightClass>
<minWeightClass>0</minWeightClass>
<objectiveLinkedForces/>
<retreatThreshold>50</retreatThreshold>
<startingAltitude>5</startingAltitude>
<syncDeploymentType>OppositeEdge</syncDeploymentType>
Expand All @@ -89,7 +93,7 @@
<contributesToUnitCount>true</contributesToUnitCount>
<deployOffboard>false</deployOffboard>
<deploymentZones/>
<destinationZone>4</destinationZone>
<destinationZone>5</destinationZone>
<fixedUnitCount>1</fixedUnitCount>
<forceAlignment>1</forceAlignment>
<forceMultiplier>1.0</forceMultiplier>
Expand All @@ -98,6 +102,7 @@
<generationOrder>4</generationOrder>
<maxWeightClass>4</maxWeightClass>
<minWeightClass>1</minWeightClass>
<objectiveLinkedForces/>
<retreatThreshold>50</retreatThreshold>
<startingAltitude>5</startingAltitude>
<syncDeploymentType>SameEdge</syncDeploymentType>
Expand Down
6 changes: 3 additions & 3 deletions MekHQ/resources/mekhq/resources/AtBStratCon.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
supportPoint.text=Support Point
supportPointConvert.text=Will convert VP from SP
reinforcementRoll.Text=<span color="red">Reinforement Roll</span>
reinforcementRoll.Text=<span color="red">Reinforcement Roll</span>
fromChainedScenario.text=Lance already deployed
lanceInFightRole.text=Lance in Fight role
lanceInFightRole.text=Fight-Role Reinforcement Roll

lblDefensiveMinefieldCount.text=Defensive Minefield Count: %d
lblSelectIndividualUnits.text=Select individual units (%d max)

lblDefensivePostureInstructions.Text=This lance is on a defensive deployment and you may deploy additional infantry, battle armor, or minefields.
lblLeadershipInstructions.Text=The force commander's leadership allows the deployment of additional auxiliary units - choose from the list below.
lblFCLeadershipAvailable.Text=<html>Force commander's leadership: %d%s%s
lblFCLeadershipAvailable.Text=<html>Force commander's leadership: %d%s%s</html>
lblLeaderUnitsUsed.Text=<br/>%d units already assigned
lblLeadershipReinforcementsUnavailable.Text=<br/>Leadership reinforcements unavailable

Expand Down
5 changes: 5 additions & 0 deletions MekHQ/src/mekhq/campaign/mission/AtBDynamicScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ public int getMapX() {
public int getMapY() {
return getMapSizeY();
}

@Override
public void setMapSize() {
AtBDynamicScenarioFactory.setScenarioMapSize(this);
}

/**
* Adds a bot force to this scenario.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ private static void setPlanetaryConditions(AtBDynamicScenario scenario, AtBContr
*
* @param scenario The scenario to process.
*/
private static void setScenarioMapSize(AtBDynamicScenario scenario) {
public static void setScenarioMapSize(AtBDynamicScenario scenario) {
int mapSizeX;
int mapSizeY;
ScenarioTemplate template = scenario.getTemplate();
Expand Down
7 changes: 5 additions & 2 deletions MekHQ/src/mekhq/gui/StratconPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,12 @@ private void buildRightClickMenu(StratconCoords coords) {

StratconScenario scenario = getSelectedScenario();

if (scenario == null) {
// can't stack more than one force on hex
// can't "deploy" a force to a scenario (have to reinforce instead)
if ((scenario == null) &&
!currentTrack.getAssignedCoordForces().containsKey(coords)) {
menuItemManageForceAssignments = new JMenuItem();
menuItemManageForceAssignments.setText("Manage Force Assignments");
menuItemManageForceAssignments.setText("Manage Force Assignment");
menuItemManageForceAssignments.setActionCommand(RCLICK_COMMAND_MANAGE_FORCES);
menuItemManageForceAssignments.addActionListener(this);
rightClickMenu.add(menuItemManageForceAssignments);
Expand Down
2 changes: 1 addition & 1 deletion MekHQ/src/mekhq/gui/stratcon/StratconScenarioWizard.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ private String buildForceCost(int forceID) {
costBuilder.append(resourceMap.getString("fromChainedScenario.text"));
break;
case FightLance:
costBuilder.append("lanceInFightRole.text");
costBuilder.append(resourceMap.getString("lanceInFightRole.text"));
break;
default:
costBuilder.append("Error: Invalid Reinforcement Type");
Expand Down
2 changes: 2 additions & 0 deletions MekHQ/src/mekhq/gui/stratcon/TrackForceAssignmentUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;

import mekhq.campaign.Campaign;
import mekhq.campaign.force.Force;
Expand Down Expand Up @@ -86,6 +87,7 @@ private void initializeUI() {
StratconRulesManager.getAvailableForceIDs(ScenarioForceTemplate.SPECIAL_UNIT_TYPE_ATB_MIX,
campaign, ownerPanel.getCurrentTrack(), false, null));

availableForceList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
availableForceList.setModel(lanceModel);
availableForceList.setCellRenderer(new ScenarioWizardLanceRenderer(campaign));

Expand Down