Revision: 9252
http://sourceforge.net/p/vassalengine/svn/9252
Author: swampwallaby
Date: 2017-06-29 06:38:19 +0000 (Thu, 29 Jun 2017)
Log Message:
-----------
Changes for GTS Crete
Modified Paths:
--------------
VSQL-src/trunk/tdc/ScenarioCardTabWidget.java
VSQL-src/trunk/tdc/TdcHighlighter.java
VSQL-src/trunk/tdc/TdcProperties.java
VSQL-src/trunk/tdc/TdcScenarioOptions.java
VSQL-src/trunk/tdc/TdcWizard.java
VSQL-src/trunk/tdc/UnitInfo.java
VSQL-src/trunk/tdc/attack/AttackModel.java
VSQL-src/trunk/tdc/attack/AttackView.java
Modified: VSQL-src/trunk/tdc/ScenarioCardTabWidget.java
===================================================================
--- VSQL-src/trunk/tdc/ScenarioCardTabWidget.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/ScenarioCardTabWidget.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -1,7 +1,7 @@
/*
* $Id: ScenarioCardTabWidget 7690 2011-07-07 23:44:55Z swampwallaby $
*
- * Copyright (c) 2012-2014 by Brent Easton
+ * Copyright (c) 2012-2017 by Brent Easton
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -159,8 +159,13 @@
return null;
}
- // Find the board name loaded on each scenario card. If is the Unused board,
- // hide the tab.
+ /*
+ * For TDC/TGD, Find the board name loaded on each scenario card. If is the Unused board,
+ hide the tab.
+
+ For Crete, check the Used-XXXX global variable matching the Map-Division property of the map on that tab
+
+ */
protected void updateVisibility() {
// Make a base set of widgets, if it has not already been done
@@ -185,8 +190,21 @@
// Too Early, no boards loaded yet
return;
}
+ if (UnitInfo.isCreteRules()) {
+ final String division = (String) wm.getProperty(TdcProperties.MAP_DIVISION);
+ final String useMap = (String) GameModule.getGameModule().getProperty("Used-"+division);
+
+ visible[i] = ! "false".equals(useMap);
+ }
+ else {
names[i] = it.next().getAttributeValueString(Board.IMAGE);
- visible[i] = !names[i].contains("unused");
+ if (names[i] == null) {
+ visible[i] = true;
+ }
+ else {
+ visible[i] = !names[i].contains("unused");
+ }
+ }
}
}
}
Modified: VSQL-src/trunk/tdc/TdcHighlighter.java
===================================================================
--- VSQL-src/trunk/tdc/TdcHighlighter.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/TdcHighlighter.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -25,7 +25,6 @@
import java.awt.Graphics;
import java.awt.Rectangle;
-
import VASSAL.counters.ColoredBorder;
import VASSAL.counters.GamePiece;
import VASSAL.counters.Labeler;
Modified: VSQL-src/trunk/tdc/TdcProperties.java
===================================================================
--- VSQL-src/trunk/tdc/TdcProperties.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/TdcProperties.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * Copyright (c) 2005-2010 by Brent Easton
+ * Copyright (c) 2005-2017 by Brent Easton
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -26,7 +26,7 @@
*/
public interface TdcProperties {
- public static final boolean DEBUG = false; // Debug Mode - Mouse over viewer shows ratings
+ public static final boolean DEBUG = true; // Debug Mode - Mouse over viewer shows ratings
public static final String STEP = "Step"; // Step Count Marker
public static final String ACTIVE = "Active"; // Unit can be Activated Marker
@@ -137,6 +137,7 @@
public static final String RULES_TGD = "TGD";
public static final String RULES_DDAY = "DDAY"; // For compatibility with early versions of module
public static final String RULES_TINIAN = "TINIAN";
+ public static final String RULES_CRETE = "CRETE";
public static final String SDZ_1AB = "SDZ-1AB";
public static final String SDZ_52AL = "SDZ-52AL";
@@ -223,6 +224,7 @@
public static final String TYPE_RUBBLE = "Rubble";
public static final String TYPE_DELAY_P = "Delay-P";
public static final String TYPE_DELAY_G = "Delay-G";
+ public static final String TYPE_DELAY_A = "Delay-A";
public static final String TYPE_COLUMN = "Column";
public static final String TYPE_EVENT = "Event";
public static final String TYPE_ARTILLERY_PARK = "APark";
@@ -276,6 +278,7 @@
public static final String NAVAL_LOADING = "Loading";
public static final String NAVAL_LANDING = "Landing";
public static final String COMBAT_NO_NEG = "CombatNoNeg"; // true if a unit attracts no negative modifiers on combat
+ public static final String COMBAT_NO_MOD = "CombatNoMod"; // true if a unit attracts no modifiers at all on combat
public static final String ADD_10_TO_SWORD_NAVAL_RANGE = "Add10ToSwordNavalRange"; // Global value to add to all Naval ranges on map
// Beach Attack Classes (BAC)
@@ -288,6 +291,31 @@
public static final String ZONE_LANDING_WAVE = "Landing Wave";
+ // Global properties belonging to Maps
+ public static final String MAP_DIVISION = "Map-Division";
+ // Crete
+ public static final String TERRAIN_SCRUB = "Scrub";
+
+ public static final String SUPPLY_FULL = "Full";
+ public static final String SUPPLY_REDUCED = "Reduced";
+ public static final String SUPPLY_DIMINISHED = "Diminished";
+ public static final String SUPPLY_EMERGENCY = "Emergency";
+
+ public static final String SUPPLY_MALEME_SUDA = "Maleme-Suda";
+ public static final String SUPPLY_RETHYMON = "Rethymon";
+ public static final String SUPPLY_HERAKLION = "Heraklion";
+
+ public static final String BOARD_KASTELLI = "Kastelli";
+ public static final String BOARD_MALEME = "Maleme";
+ public static final String BOARD_CANEA_SUDA = "Canea Suda";
+ public static final String BOARD_GEORGEOPOLIS = "Georgeopolis";
+ public static final String BOARD_RETHYMON = "Rethymon";
+ public static final String BOARD_HERAKLION = "Heraklion";
+
+ public static final String CLASS_PARTISAN = "Partisan";
+ public static final String SUBCLASS_GREEK = "Greek";
+
+
}
Modified: VSQL-src/trunk/tdc/TdcScenarioOptions.java
===================================================================
--- VSQL-src/trunk/tdc/TdcScenarioOptions.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/TdcScenarioOptions.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -1,7 +1,7 @@
/*
* $Id: TdcScenarioOptions.java 963 2006-08-25 12:48:03Z swampwallaby $
*
- * Copyright (c) 2006-2010 by Brent Easton
+ * Copyright (c) 2006-2017 by Brent Easton
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -65,21 +65,31 @@
protected AttachOption attach_Reinhold_Frundsberg;
protected AttachOption attach_Euling_Frundsberg;
protected ChillBooleanOption chill_reorg;
-
+
protected BooleanOption telephoneCommand736;
protected BooleanOption add10toSwordNavalRange;
protected AttachOption attach_22arm;
+
+ protected BooleanOption creteDiv2nz;
+ protected BooleanOption creteDivcrefor;
+ protected BooleanOption creteDiv5geb;
+ protected BooleanOption creteDiv7fl;
+ protected BooleanOption creteDiv14th;
+ protected BooleanOption creteDiv19th;
+ protected BooleanOption creteDivfjr1;
+ protected BooleanOption creteDivfjr2;
- public TdcScenarioOptions () {
+ public TdcScenarioOptions() {
super();
}
-
+
public Component getComponent() {
if (panel == null) {
+
panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
-
+
final Box optionBox = Box.createVerticalBox();
optionBox.setBorder(BorderFactory.createEtchedBorder());
optionBox.add(new JLabel("Scenario Options"));
@@ -87,150 +97,161 @@
final Box generalBox = Box.createVerticalBox();
generalBox.setBorder(BorderFactory.createEtchedBorder());
-
+
generalBox.add(new JLabel(" "));
generalBox.add(new JLabel("General"));
generalBox.add(new JLabel(" "));
-
+
aicAllied = new BooleanOption("AIC-Allied", "Allied units always in command");
generalBox.add(aicAllied.getControls());
-
+
aicGerman = new BooleanOption("AIC-German", "Axis units always in command");
generalBox.add(aicGerman.getControls());
+
+ generalBox.add(new JLabel(" "));
optionBox.add(generalBox);
-
- final Box ddBox = Box.createVerticalBox();
- ddBox.setBorder(BorderFactory.createEtchedBorder());
- ddBox.add(new JLabel(" "));
- ddBox.add(new JLabel("The Greatest Day"));
- ddBox.add(new JLabel(" "));
- telephoneCommand736 = new BooleanOption("736TelCom", "736 Rgt Command depends only on Phone Lines?");
- ddBox.add(telephoneCommand736.getControls());
- ddBox.add(new JLabel(" "));
-
-
- attach_22arm = new AttachOption("Attach-22Arm",
- "22 Arm Brigade are attached to division ", new String[] {
- TdcProperties.DIVISION_7TH, TdcProperties.DIVISION_50TH },
- "7th-v-50th");
- ddBox.add(attach_22arm.getControls());
-
- optionBox.add(ddBox);
-
- add10toSwordNavalRange = new BooleanOption(TdcProperties.ADD_10_TO_SWORD_NAVAL_RANGE, "+10 hexes to naval Range?");
- ddBox.add(add10toSwordNavalRange.getControls());
- ddBox.add(new JLabel(" "));
- optionBox.add(ddBox);
-
- final Box tdcBox = Box.createVerticalBox();
- tdcBox.setBorder(BorderFactory.createEtchedBorder());
- tdcBox.add(new JLabel(" "));
- tdcBox.add(new JLabel("The Devils Cauldron"));
- tdcBox.add(new JLabel(" "));
-
- aic505 = new BooleanOption("AIC-505 PIR", "505 PIR is always in command");
- tdcBox.add(aic505.getControls());
-
- commandBreakdown = new BooleanOption("Command-Breakdown", "Command Breakdown has occured (Scenario AD#1)");
- tdcBox.add(commandBreakdown.getControls());
-
- attach_CG_82AB = new AttachOption("Attach-CG",
- "Coldstream Guards are attached to division ", new String[] {
- TdcProperties.DIVISION_GDS, TdcProperties.DIVISION_82AB },
- "Gds-v-82AB");
- tdcBox.add(attach_CG_82AB.getControls());
+ optionBox.add(new JLabel(" "));
- attach_GdsInd_43rd = new AttachOption("Attach-GdsInd",
- "Guards Independent are attached to division ", new String[] {
- TdcProperties.DIVISION_GDS, TdcProperties.DIVISION_43RD },
- "Gds-v-43rd");
- tdcBox.add(attach_GdsInd_43rd.getControls());
+ if (UnitInfo.isCreteRules()) {
+
+ final Box creteBox = Box.createVerticalBox();
+ creteBox.setBorder(BorderFactory.createEtchedBorder());
+
+ creteBox.add(new JLabel(" "));
+ creteBox.add(new JLabel("Crete"));
+ creteBox.add(new JLabel(" "));
+
+ creteDiv2nz = new BooleanOption("Used-2nz", "2nd NZ division card used in scenario");
+ creteBox.add(creteDiv2nz.getControls());
+
+ creteDivcrefor = new BooleanOption("Used-crefor", "CREFOR division card used in scenario");
+ creteBox.add(creteDivcrefor.getControls());
+
+ creteDiv14th = new BooleanOption("Used-14th", "14th Brigade division card used in scenario");
+ creteBox.add(creteDiv14th.getControls());
+
+ creteDiv19th = new BooleanOption("Used-19th", "19th Brigade division card used in scenario");
+ creteBox.add(creteDiv19th.getControls());
+
+ creteDiv5geb = new BooleanOption("Used-5geb", "5th Gebirgs division card used in scenario");
+ creteBox.add(creteDiv5geb.getControls());
+
+ creteDiv7fl = new BooleanOption("Used-7fl", "7th Flieger division card used in scenario");
+ creteBox.add(creteDiv7fl.getControls());
+
+ creteDivfjr1 = new BooleanOption("Used-fjr1", "FJR 1 Regiment division card used in scenario");
+ creteBox.add(creteDivfjr1.getControls());
+
+ creteDivfjr2 = new BooleanOption("Used-fjr2", "FJR 2 Regiment division card used in scenario");
+ creteBox.add(creteDivfjr2.getControls());
+
+ creteBox.add(new JLabel(" "));
+
+ optionBox.add(creteBox);
+ optionBox.add(new JLabel(" "));
+
+ }
- attach_82ABArt_Gds = new AttachOption("Attach-82ABArt",
- "82AB Artillery are attached to division ", new String[] {
- TdcProperties.DIVISION_82AB, TdcProperties.DIVISION_GDS },
- "82AB-v-Gds");
- tdcBox.add(attach_82ABArt_Gds.getControls());
-
- attach_FrInd_Hoh = new AttachOption("Attach-FrInd",
- "Frundsberg Independents are attached to division ", new String[] {
- TdcProperties.DIVISION_FR, TdcProperties.DIVISION_HOH },
- "Fr-v-Hoh");
- tdcBox.add(attach_FrInd_Hoh.getControls());
-
- attach_Bruhn_Hoh = new AttachOption("Attach-Bruhn",
- "KG Bruhn are attached to division ", new String[] {
- TdcProperties.DIVISION_VT, TdcProperties.DIVISION_HOH },
- "VT-v-Hoh");
- tdcBox.add(attach_Bruhn_Hoh.getControls());
- tdcBox.add(new JLabel(" "));
-
- optionBox.add(tdcBox);
- optionBox.add(new JLabel(" "));
-
- final Box germanReconfigBox = Box.createVerticalBox();
- germanReconfigBox.setBorder(BorderFactory.createEtchedBorder());
-
- attach_Harder_Spindler = new AttachOption("Attach-Harder-Spindler",
- "KG Harder are attached to Formation ", new String[] {
- TdcProperties.FORMATION_HARDER, TdcProperties.FORMATION_SPINDLER },
- "S4.5.2-Harder");
-
- attach_Krafft_Spindler = new AttachOption("Attach-Krafft-Spindler",
- "KG Krafft are attached to Formation ", new String[] {
- TdcProperties.FORMATION_KRAFFT, TdcProperties.FORMATION_SPINDLER },
- "S4.5.2-Krafft");
-
- attach_vonAllwoerden_Spindler = new AttachOption("Attach-vonAllwoerden-Spindler",
- "KG von Allwoerden are attached to Formation ", new String[] {
- TdcProperties.FORMATION_VONALLWOERDEN, TdcProperties.FORMATION_SPINDLER },
- "S4.5.2-vonAllwoerden");
-
- attach_Henke_Frundsberg = new AttachOption("Attach-Henke-Frundsberg",
- "KG Henke are attached to Formation ", new String[] {
- TdcProperties.FORMATION_HENKE, TdcProperties.FORMATION_FRUNDSBERG },
- "S4.5.3-Henke");
-
- attach_Knaust_Frundsberg = new AttachOption("Attach-Knaust-Frundsberg",
- "KG Knaust are attached to Formation ", new String[] {
- TdcProperties.FORMATION_KNAUST, TdcProperties.FORMATION_FRUNDSBERG },
- "S4.5.3-Knaust");
-
- attach_Reinhold_Frundsberg = new AttachOption("Attach-Reinhold-Frundsberg",
- "KG Reinhold are attached to Formation ", new String[] {
- TdcProperties.FORMATION_REINHOLD, TdcProperties.FORMATION_FRUNDSBERG },
- "S4.5.3-Reinhold");
-
- attach_Euling_Frundsberg = new AttachOption("Attach-Euling-Frundsberg",
- "KG Euling are attached to Formation ", new String[] {
- TdcProperties.FORMATION_EULING, TdcProperties.FORMATION_FRUNDSBERG },
- "S4.5.3-Euling");
-
- chill_reorg = new ChillBooleanOption("Eindhoven-Chill", "Eindhoven R.C. has reorganised to KG Chill");
-
- germanReconfigBox.add(new JLabel(" "));
- germanReconfigBox.add(new JLabel("Where Eagles Dare"));
- germanReconfigBox.add(new JLabel(" "));
-
- germanReconfigBox.add(attach_Harder_Spindler.getControls());
- germanReconfigBox.add(attach_Krafft_Spindler.getControls());
- germanReconfigBox.add(attach_vonAllwoerden_Spindler.getControls());
- germanReconfigBox.add(new JLabel(" "));
-
- germanReconfigBox.add(attach_Henke_Frundsberg.getControls());
- germanReconfigBox.add(attach_Knaust_Frundsberg.getControls());
- germanReconfigBox.add(attach_Reinhold_Frundsberg.getControls());
- germanReconfigBox.add(attach_Euling_Frundsberg.getControls());
- germanReconfigBox.add(new JLabel(" "));
+ if (UnitInfo.isTgdRules()) {
- germanReconfigBox.add(chill_reorg.getControls());
- germanReconfigBox.add(new JLabel(" "));
-
- optionBox.add(germanReconfigBox);
-
+ final Box ddBox = Box.createVerticalBox();
+ ddBox.setBorder(BorderFactory.createEtchedBorder());
+ ddBox.add(new JLabel(" "));
+ ddBox.add(new JLabel("The Greatest Day"));
+ ddBox.add(new JLabel(" "));
+ telephoneCommand736 = new BooleanOption("736TelCom", "736 Rgt Command depends only on Phone Lines?");
+ ddBox.add(telephoneCommand736.getControls());
+ ddBox.add(new JLabel(" "));
+
+ attach_22arm = new AttachOption("Attach-22Arm", "22 Arm Brigade are attached to division ", new String[] { TdcProperties.DIVISION_7TH, TdcProperties.DIVISION_50TH }, "7th-v-50th");
+ ddBox.add(attach_22arm.getControls());
+
+ optionBox.add(ddBox);
+
+ add10toSwordNavalRange = new BooleanOption(TdcProperties.ADD_10_TO_SWORD_NAVAL_RANGE, "+10 hexes to naval Range?");
+ ddBox.add(add10toSwordNavalRange.getControls());
+ ddBox.add(new JLabel(" "));
+ optionBox.add(ddBox);
+
+ }
+
+ if (UnitInfo.isTdcRules()) {
+ final Box tdcBox = Box.createVerticalBox();
+ tdcBox.setBorder(BorderFactory.createEtchedBorder());
+ tdcBox.add(new JLabel(" "));
+ tdcBox.add(new JLabel("The Devils Cauldron"));
+ tdcBox.add(new JLabel(" "));
+
+ aic505 = new BooleanOption("AIC-505 PIR", "505 PIR is always in command");
+ tdcBox.add(aic505.getControls());
+
+ commandBreakdown = new BooleanOption("Command-Breakdown", "Command Breakdown has occured (Scenario AD#1)");
+ tdcBox.add(commandBreakdown.getControls());
+
+ attach_CG_82AB = new AttachOption("Attach-CG", "Coldstream Guards are attached to division ", new String[] { TdcProperties.DIVISION_GDS, TdcProperties.DIVISION_82AB }, "Gds-v-82AB");
+ tdcBox.add(attach_CG_82AB.getControls());
+
+ attach_GdsInd_43rd = new AttachOption("Attach-GdsInd", "Guards Independent are attached to division ", new String[] { TdcProperties.DIVISION_GDS, TdcProperties.DIVISION_43RD }, "Gds-v-43rd");
+ tdcBox.add(attach_GdsInd_43rd.getControls());
+
+ attach_82ABArt_Gds = new AttachOption("Attach-82ABArt", "82AB Artillery are attached to division ", new String[] { TdcProperties.DIVISION_82AB, TdcProperties.DIVISION_GDS }, "82AB-v-Gds");
+ tdcBox.add(attach_82ABArt_Gds.getControls());
+
+ attach_FrInd_Hoh = new AttachOption("Attach-FrInd", "Frundsberg Independents are attached to division ", new String[] { TdcProperties.DIVISION_FR, TdcProperties.DIVISION_HOH }, "Fr-v-Hoh");
+ tdcBox.add(attach_FrInd_Hoh.getControls());
+
+ attach_Bruhn_Hoh = new AttachOption("Attach-Bruhn", "KG Bruhn are attached to division ", new String[] { TdcProperties.DIVISION_VT, TdcProperties.DIVISION_HOH }, "VT-v-Hoh");
+ tdcBox.add(attach_Bruhn_Hoh.getControls());
+ tdcBox.add(new JLabel(" "));
+
+ optionBox.add(tdcBox);
+ optionBox.add(new JLabel(" "));
+
+ final Box germanReconfigBox = Box.createVerticalBox();
+ germanReconfigBox.setBorder(BorderFactory.createEtchedBorder());
+
+ attach_Harder_Spindler = new AttachOption("Attach-Harder-Spindler", "KG Harder are attached to Formation ", new String[] { TdcProperties.FORMATION_HARDER, TdcProperties.FORMATION_SPINDLER }, "S4.5.2-Harder");
+
+ attach_Krafft_Spindler = new AttachOption("Attach-Krafft-Spindler", "KG Krafft are attached to Formation ", new String[] { TdcProperties.FORMATION_KRAFFT, TdcProperties.FORMATION_SPINDLER }, "S4.5.2-Krafft");
+
+ attach_vonAllwoerden_Spindler = new AttachOption("Attach-vonAllwoerden-Spindler", "KG von Allwoerden are attached to Formation ", new String[] { TdcProperties.FORMATION_VONALLWOERDEN, TdcProperties.FORMATION_SPINDLER },
+ "S4.5.2-vonAllwoerden");
+
+ attach_Henke_Frundsberg = new AttachOption("Attach-Henke-Frundsberg", "KG Henke are attached to Formation ", new String[] { TdcProperties.FORMATION_HENKE, TdcProperties.FORMATION_FRUNDSBERG }, "S4.5.3-Henke");
+
+ attach_Knaust_Frundsberg = new AttachOption("Attach-Knaust-Frundsberg", "KG Knaust are attached to Formation ", new String[] { TdcProperties.FORMATION_KNAUST, TdcProperties.FORMATION_FRUNDSBERG }, "S4.5.3-Knaust");
+
+ attach_Reinhold_Frundsberg = new AttachOption("Attach-Reinhold-Frundsberg", "KG Reinhold are attached to Formation ", new String[] { TdcProperties.FORMATION_REINHOLD, TdcProperties.FORMATION_FRUNDSBERG }, "S4.5.3-Reinhold");
+
+ attach_Euling_Frundsberg = new AttachOption("Attach-Euling-Frundsberg", "KG Euling are attached to Formation ", new String[] { TdcProperties.FORMATION_EULING, TdcProperties.FORMATION_FRUNDSBERG }, "S4.5.3-Euling");
+
+ chill_reorg = new ChillBooleanOption("Eindhoven-Chill", "Eindhoven R.C. has reorganised to KG Chill");
+
+ germanReconfigBox.add(new JLabel(" "));
+ germanReconfigBox.add(new JLabel("Where Eagles Dare"));
+ germanReconfigBox.add(new JLabel(" "));
+
+ germanReconfigBox.add(attach_Harder_Spindler.getControls());
+ germanReconfigBox.add(attach_Krafft_Spindler.getControls());
+ germanReconfigBox.add(attach_vonAllwoerden_Spindler.getControls());
+ germanReconfigBox.add(new JLabel(" "));
+
+ germanReconfigBox.add(attach_Henke_Frundsberg.getControls());
+ germanReconfigBox.add(attach_Knaust_Frundsberg.getControls());
+ germanReconfigBox.add(attach_Reinhold_Frundsberg.getControls());
+ germanReconfigBox.add(attach_Euling_Frundsberg.getControls());
+ germanReconfigBox.add(new JLabel(" "));
+
+ germanReconfigBox.add(chill_reorg.getControls());
+ germanReconfigBox.add(new JLabel(" "));
+
+ optionBox.add(germanReconfigBox);
+
+ }
+
panel.add(optionBox);
-
+
}
return panel;
@@ -272,8 +293,7 @@
public BasicOption(String propertyName, String prompt) {
globalPropertyName = propertyName;
this.prompt = prompt;
- globalProperty = GameModule.getGameModule().getMutableProperty(
- globalPropertyName);
+ globalProperty = GameModule.getGameModule().getMutableProperty(globalPropertyName);
}
protected abstract Configurer createConfigurer();
@@ -318,8 +338,7 @@
}
protected Configurer createConfigurer() {
- return new BooleanConfigurer("", prompt, "true".equals(globalProperty
- .getPropertyValue()));
+ return new BooleanConfigurer("", prompt, "true".equals(globalProperty.getPropertyValue()));
}
protected PropertyChangeListener createGlobalListener() {
@@ -333,18 +352,17 @@
}
}
-
+
public static class ChillBooleanOption extends BooleanOption {
public ChillBooleanOption(String propertyName, String prompt) {
super(propertyName, prompt);
}
-
+
protected Configurer createConfigurer() {
- return new BooleanConfigurer("", prompt, "2".equals(globalProperty
- .getPropertyValue()));
+ return new BooleanConfigurer("", prompt, "2".equals(globalProperty.getPropertyValue()));
}
-
+
protected PropertyChangeListener createGlobalListener() {
return new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -355,7 +373,7 @@
}
};
}
-
+
protected PropertyChangeListener createLocalListener() {
return new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -364,9 +382,9 @@
}
};
}
-
+
}
-
+
/**
* A list of values option
*/
@@ -403,14 +421,13 @@
* can be attached to different Divisions. Whenever the option
* is changed, all units whose 'Attach' property match the supplied
* value must be notified to change the Division held as a Dynamic Property.
- *
+ *
*/
public static class AttachOption extends StringEnumOption {
protected String attachMarkerValue;
- public AttachOption(String propertyName, String prompt, String[] options,
- String markerValue) {
+ public AttachOption(String propertyName, String prompt, String[] options, String markerValue) {
this(propertyName, prompt, options);
this.attachMarkerValue = markerValue;
}
@@ -441,7 +458,8 @@
KeyStroke stroke;
if (index == 0) {
stroke = KeyStroke.getKeyStroke('1', InputEvent.ALT_MASK);
- } else {
+ }
+ else {
stroke = KeyStroke.getKeyStroke('2', InputEvent.ALT_MASK);
}
@@ -449,9 +467,11 @@
public String getComponentName() {
return "TdcScenarioOptions";
}
+
public String getComponentTypeName() {
return "TdcScenarioOptions";
- }});
+ }
+ });
gc.setKeyStroke(stroke);
PieceFilter filter = new AttachFilter(attachMarkerValue);
for (Iterator<Map> i = Map.getAllMaps(); i.hasNext(); gc.apply(i.next(), filter)) {
@@ -479,5 +499,4 @@
}
-
}
\ No newline at end of file
Modified: VSQL-src/trunk/tdc/TdcWizard.java
===================================================================
--- VSQL-src/trunk/tdc/TdcWizard.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/TdcWizard.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -117,12 +117,14 @@
units.clear();
targets.clear();
- if (TdcProperties.CLASS_AIRPOWER.equals(piece.getProperty(TdcProperties.CLASS))) {
+ // Air and Partisan attacks are special attacks on the same stack as the source, not LOS thread.
+ if (TdcProperties.CLASS_AIRPOWER.equals(piece.getProperty(TdcProperties.CLASS)) || TdcProperties.CLASS_PARTISAN.equals(piece.getProperty(TdcProperties.CLASS)) ) {
isAirPower = true;
attackCommand = new KeyCommand(ATTACK_COMMAND, attackKey, Decorator.getOutermost(this));
attackCommand.setEnabled(getMap() != null && getMap() instanceof TdcMap);
keyCommands.add(attackCommand);
}
+ // Attacks using an Artillery Park or Naval Target marker mus build a list of units in their matching Artillery Park/Naval Box
else if (TdcProperties.TYPE_ARTILLERY_PARK.equals(piece.getProperty(TdcProperties.TYPE))) {
if (TdcProperties.DIVISION_NAVAL.equals(piece.getProperty(TdcProperties.DIVISION))) {
buildAssaultForceCommands();
@@ -131,6 +133,7 @@
buildArtilleryParkCommands();
}
}
+ // Standard Attack
else {
attackCommand = new KeyCommand(ATTACK_COMMAND, attackKey, Decorator.getOutermost(this));
attackCommand.setEnabled(getMap() != null && getMap() instanceof TdcMap);
Modified: VSQL-src/trunk/tdc/UnitInfo.java
===================================================================
--- VSQL-src/trunk/tdc/UnitInfo.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/UnitInfo.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -1,7 +1,7 @@
/*
* $Id: UnitInfo 7690 2011-07-07 23:44:55Z swampwallaby $
*
- * Copyright (c) 2012-2014 by Brent Easton
+ * Copyright (c) 2012-2017 by Brent Easton
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -125,7 +125,9 @@
protected String beachAttackClass;
protected boolean isAirPower;
+ protected boolean isPartisanAttack;
protected boolean ignoreNegativeCombatModifiers;
+ protected boolean ignoreAllCombatModifiers;
protected boolean hasAirDefence;
protected int maxLOS = 99;
@@ -132,7 +134,6 @@
protected String maxLOSReason = "";
protected boolean hill = false;
protected boolean op = false;
-
public static String getRuleSet() {
if (ruleset == null) {
ruleset = (String) GameModule.getGameModule().getProperty(TdcProperties.RULESET);
@@ -147,17 +148,25 @@
}
public static boolean isGTS2Rules() {
- return isTgdRules() || isTinianRules();
+ return isTgdRules() || isTinianRules() || isCreteRules();
}
-
+
public static boolean isTgdRules() {
return TdcProperties.RULES_TGD.equals(getRuleSet()) || TdcProperties.RULES_DDAY.equals(getRuleSet());
}
-
+
+ public static boolean isTdcRules() {
+ return TdcProperties.RULES_TDC.equals(getRuleSet()) || TdcProperties.RULES_WED.equals(getRuleSet());
+ }
+
public static boolean isTinianRules() {
return TdcProperties.RULES_TINIAN.equals(getRuleSet());
}
+ public static boolean isCreteRules() {
+ return TdcProperties.RULES_CRETE.equals(getRuleSet());
+ }
+
public static int getArtilleryDirectRange() {
return isNqosRules() ? 5 : 4;
}
@@ -242,8 +251,7 @@
}
public boolean isFireWoodsReduced() {
- return TdcRatings.GREEN.equals(getFireColor()) || TdcRatings.ORANGE.equals(getFireColor()) || TdcRatings.YELLOW.equals(getFireColor())
- || TdcRatings.BROWN.equals(getFireColor()) || TdcRatings.BLACK.equals(getFireColor());
+ return TdcRatings.GREEN.equals(getFireColor()) || TdcRatings.ORANGE.equals(getFireColor()) || TdcRatings.YELLOW.equals(getFireColor()) || TdcRatings.BROWN.equals(getFireColor()) || TdcRatings.BLACK.equals(getFireColor());
}
public boolean isFireMarshReduced() {
@@ -355,6 +363,10 @@
return isAirPower;
}
+ public boolean isPartisanAttack() {
+ return isPartisanAttack;
+ }
+
public boolean hasAirDefence() {
return hasAirDefence;
}
@@ -363,6 +375,10 @@
return ignoreNegativeCombatModifiers;
}
+ public boolean isIgnoreAllCombatModifiers() {
+ return ignoreAllCombatModifiers;
+ }
+
public boolean isNoHighlighting() {
return isAirPower();
}
@@ -372,10 +388,9 @@
}
public boolean isIndirectFire() {
- return isNaval() ||
- (isTinianRules() && isArtillery() && "Saipan".equals(unit.getProperty(BasicPiece.CURRENT_ZONE)));
+ return isNaval() || (isTinianRules() && isArtillery() && "Saipan".equals(unit.getProperty(BasicPiece.CURRENT_ZONE)));
}
-
+
public int getNavalRange() {
int r = 0;
if (isIndirectFire()) {
@@ -434,7 +449,7 @@
}
public boolean isOp() {
- return op;
+ return op && ! rubbled;
}
public int getMaxLOS() {
@@ -530,17 +545,17 @@
terrainInfo.put(TdcProperties.TERRAIN_BOCAGE, new TerrainInfo(TdcProperties.TERRAIN_HEDGEROW, -2));
terrainInfo.put(TdcProperties.TERRAIN_HILL, new TerrainInfo(TdcProperties.TERRAIN_HILL, -2));
terrainInfo.put(TdcProperties.TERRAIN_VILLAGE, new TerrainInfo(TdcProperties.TERRAIN_VILLAGE, -1));
-
+
if (isTinianRules()) {
terrainInfo.put(TdcProperties.TERRAIN_BEACH, new TerrainInfo(TdcProperties.TERRAIN_BEACH, 0));
terrainInfo.put(TdcProperties.TERRAIN_MARSH, new TerrainInfo(TdcProperties.TERRAIN_MARSH, -2));
terrainInfo.put(TdcProperties.TERRAIN_TOWN, new TerrainInfo(TdcProperties.TERRAIN_TOWN, -2));
- terrainInfo.put(TdcProperties.TERRAIN_BUILDINGS, new TerrainInfo(TdcProperties.TERRAIN_BUILDINGS, -2));
+ terrainInfo.put(TdcProperties.TERRAIN_BUILDINGS, new TerrainInfo(TdcProperties.TERRAIN_BUILDINGS, -2));
terrainInfo.put(TdcProperties.TERRAIN_RUNWAY, new TerrainInfo(TdcProperties.TERRAIN_RUNWAY, 1));
terrainInfo.put(TdcProperties.TERRAIN_BRUSH, new TerrainInfo(TdcProperties.TERRAIN_BRUSH, -1));
terrainInfo.put(TdcProperties.TERRAIN_SUGAR_CANE, new TerrainInfo(TdcProperties.TERRAIN_SUGAR_CANE, -1));
terrainInfo.put(TdcProperties.TERRAIN_ROCKY, new TerrainInfo(TdcProperties.TERRAIN_ROCKY, -2));
- terrainInfo.put(TdcProperties.TERRAIN_CAVE, new TerrainInfo(TdcProperties.TERRAIN_CAVE, -3));
+ terrainInfo.put(TdcProperties.TERRAIN_CAVE, new TerrainInfo(TdcProperties.TERRAIN_CAVE, -3));
}
else {
terrainInfo.put(TdcProperties.TERRAIN_BEACH, new TerrainInfo(TdcProperties.TERRAIN_BEACH, 1));
@@ -562,18 +577,18 @@
terrainInfoArmoured.put(TdcProperties.TERRAIN_DESERT, new TerrainInfo(TdcProperties.TERRAIN_DESERT, 0));
terrainInfoArmoured.put(TdcProperties.TERRAIN_BOCAGE, new TerrainInfo(TdcProperties.TERRAIN_BOCAGE, -1));
terrainInfoArmoured.put(TdcProperties.TERRAIN_HEDGEROW, new TerrainInfo(TdcProperties.TERRAIN_HEDGEROW, -1));
- terrainInfoArmoured.put(TdcProperties.TERRAIN_HILL, new TerrainInfo(TdcProperties.TERRAIN_HILL, -1));
+ terrainInfoArmoured.put(TdcProperties.TERRAIN_HILL, new TerrainInfo(TdcProperties.TERRAIN_HILL, -1));
terrainInfoArmoured.put(TdcProperties.TERRAIN_VILLAGE, new TerrainInfo(TdcProperties.TERRAIN_VILLAGE, 0));
-
+
if (isTinianRules()) {
terrainInfo.put(TdcProperties.TERRAIN_BEACH, new TerrainInfo(TdcProperties.TERRAIN_BEACH, 0));
terrainInfo.put(TdcProperties.TERRAIN_MARSH, new TerrainInfo(TdcProperties.TERRAIN_MARSH, -2));
terrainInfo.put(TdcProperties.TERRAIN_TOWN, new TerrainInfo(TdcProperties.TERRAIN_TOWN, -2));
- terrainInfo.put(TdcProperties.TERRAIN_BUILDINGS, new TerrainInfo(TdcProperties.TERRAIN_BUILDINGS, -2));
+ terrainInfo.put(TdcProperties.TERRAIN_BUILDINGS, new TerrainInfo(TdcProperties.TERRAIN_BUILDINGS, -2));
terrainInfo.put(TdcProperties.TERRAIN_RUNWAY, new TerrainInfo(TdcProperties.TERRAIN_RUNWAY, 1));
terrainInfo.put(TdcProperties.TERRAIN_BRUSH, new TerrainInfo(TdcProperties.TERRAIN_BRUSH, -1));
terrainInfo.put(TdcProperties.TERRAIN_SUGAR_CANE, new TerrainInfo(TdcProperties.TERRAIN_SUGAR_CANE, -1));
- terrainInfo.put(TdcProperties.TERRAIN_ROCKY, new TerrainInfo(TdcProperties.TERRAIN_ROCKY, -2));
+ terrainInfo.put(TdcProperties.TERRAIN_ROCKY, new TerrainInfo(TdcProperties.TERRAIN_ROCKY, -2));
terrainInfo.put(TdcProperties.TERRAIN_CAVE, new TerrainInfo(TdcProperties.TERRAIN_CAVE, 0));
}
else {
@@ -764,7 +779,9 @@
}
isAirPower = TdcProperties.CLASS_AIRPOWER.equals(unit.getProperty(TdcProperties.CLASS));
+ isPartisanAttack = TdcProperties.CLASS_PARTISAN.equals(unit.getProperty(TdcProperties.CLASS));
ignoreNegativeCombatModifiers = "true".equals(unit.getProperty(TdcProperties.COMBAT_NO_NEG));
+ ignoreAllCombatModifiers = "true".equals(unit.getProperty(TdcProperties.COMBAT_NO_MOD));
final String flakRating = baseRatings.get(TdcRatings.FLAK_RATING);
hasAirDefence = flakRating != null && flakRating.length() > 0 && !flakRating.equals("No");
}
@@ -856,7 +873,7 @@
}
final String hill = (String) TdcMap.getTerrainProperty(unit, TdcProperties.HILL);
- if ("true".equals(hill) & ! column) {
+ if ("true".equals(hill) & !column) {
final int modifier = isArmoured() ? -2 : -1;
adjustSpecialDefence("Hill", modifier);
addDefenceModifier("Hill", modifier, true, false, true);
@@ -966,7 +983,7 @@
if (TdcProperties.TIME_NIGHT.equals(time)) {
weatherAdjusted = true;
- final int nightRange = (isNqosRules() || isTgdRules()) ? 3 : 2;
+ final int nightRange = (isNqosRules() || isTgdRules() || isCreteRules()) ? 3 : 2;
adjustSpecialFire("Night", -2);
addAttackModifier("Night", -2);
adjustSpecialAssault("Night", -2);
@@ -1056,10 +1073,14 @@
// Check for Rubble Counter in City or Fortified hex
if (!rubbled) {
if (TdcProperties.TYPE_RUBBLE.equals(type)) {
+ final String rubbleLevel = (String) piece.getProperty("Rubble_Level");
+
if (TdcProperties.TERRAIN_CITY.equals(terrain) || TdcProperties.TERRAIN_FORTIFIED.equals(terrain)) {
- adjustSpecialDefence("Rubble", -1);
- addDefenceModifier("Rubble", -1);
rubbled = true;
+ if ("1".equals(rubbleLevel)) {
+ adjustSpecialDefence("Rubble", -1);
+ addDefenceModifier("Rubble", -1);
+ }
}
}
}
@@ -1187,6 +1208,17 @@
}
}
+ // Air Landing Delay
+ else if (TdcProperties.TYPE_DELAY_A.equals(type)) {
+ adjustFireRating("Air Landing Delay", -2);
+ addAttackModifier("Air Landing Delay", -2);
+ adjustAssaultRating("Air Landing Delay", -2);
+ adjustDefenceRating("Air Landing Delay", 2);
+ addDefenceModifier("Air Landing Delay", 2, unit);
+ adjustTqrRating("Air Landing Delay", -1);
+ setMoveRating("Air Landing Delay", "No");
+ }
+
// IP/Entrenchement CCounter
else if (TdcProperties.TYPE_IP.equals(type)) {
if (!entrench && !ip) {
@@ -1271,7 +1303,7 @@
adjustDefenceRating("Hero", -2);
addDefenceModifier("Hero", -2, unit);
}
-
+
// Cave (Tinian)
else if (TdcProperties.TYPE_CAVE.equals(type)) {
adjustDefenceRating("In Cave", -3);
@@ -1426,6 +1458,44 @@
if (tqAdjust != 0) {
adjustSpecialTqr("Divisional TQR Adjustment", tqAdjust);
}
+
+ /* --- CRETE Supply Levels -- */
+ final Map map = unit.getMap();
+ if (map == null) {
+ return;
+ }
+
+ // Work out which 'set' of maps, based on board name
+ final String boardName = (String) unit.getProperty(BasicPiece.CURRENT_BOARD);
+ if (boardName == null) {
+ return;
+ }
+
+ if (TdcProperties.SUBCLASS_GREEK.equals(unitSubClass)) {
+ return;
+ }
+
+ String supplyVar = null;
+ if (boardName.startsWith(TdcProperties.BOARD_KASTELLI) || boardName.startsWith(TdcProperties.BOARD_MALEME) || boardName.startsWith(TdcProperties.BOARD_CANEA_SUDA) || boardName.startsWith(TdcProperties.BOARD_GEORGEOPOLIS)) {
+ supplyVar = TdcProperties.SUPPLY_MALEME_SUDA;
+ }
+ else if (boardName.startsWith(TdcProperties.BOARD_RETHYMON)) {
+ supplyVar = TdcProperties.SUPPLY_RETHYMON;
+ }
+ else if (boardName.startsWith(TdcProperties.BOARD_HERAKLION)) {
+ supplyVar = TdcProperties.SUPPLY_HERAKLION;
+ }
+
+ supplyVar = "Supply-" + army + "-" + supplyVar;
+ String supplyLevel = (String) GameModule.getGameModule().getProperty(supplyVar);
+
+ if (TdcProperties.SUPPLY_DIMINISHED.equals(supplyLevel)) {
+ adjustSpecialTqr("Diminished Supply", -1);
+ }
+ else if (TdcProperties.SUPPLY_EMERGENCY.equals(supplyLevel)) {
+ adjustSpecialTqr("Emergency Supply", -2);
+ adjustSpecialFire("Emergency Supply", -1);
+ }
}
protected boolean isSouthOfRhine(GamePiece p) {
@@ -1447,8 +1517,7 @@
return !"north".equals(southInd);
}
- if (board.startsWith("All American") || board.startsWith("Groesbeek") || board.startsWith("Grave") || board.startsWith("The Island")
- || board.equals("Cuijk")) {
+ if (board.startsWith("All American") || board.startsWith("Groesbeek") || board.startsWith("Grave") || board.startsWith("The Island") || board.equals("Cuijk")) {
return true;
}
Modified: VSQL-src/trunk/tdc/attack/AttackModel.java
===================================================================
--- VSQL-src/trunk/tdc/attack/AttackModel.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/attack/AttackModel.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -45,6 +45,7 @@
public static final String COUNTER_BATTERY_FIRE = "Counter-Battery Fire";
public static final String AIR_DEFENCE = "Air Defence";
public static final String AIR_STRIKE = "Air Strike";
+ public static final String PARTISAN_ATTACK = "Partisan Attack";
protected GamePiece source;
protected UnitInfo sourceInfo;
@@ -196,10 +197,19 @@
return sourceInfo.isIgnoreNegativeCombatModifiers();
}
+ public boolean isIgnoreAllModifiers() {
+ return sourceInfo.isIgnoreAllCombatModifiers();
+ }
+
public boolean isAirPower() {
return sourceInfo.isAirPower();
}
+ public boolean isPartisanAttack() {
+ return sourceInfo.isPartisanAttack();
+ }
+
+
public static int[] xOffsets = new int[] {0, 100, 100, 0, -100, -100};
public static int[] yOffsets = new int[] {-100, -50, 50, 100, -50, 50};
@@ -325,6 +335,9 @@
else if (sourceInfo.isAirPower()) {
return AIR_STRIKE;
}
+ else if (sourceInfo.isPartisanAttack()) {
+ return PARTISAN_ATTACK;
+ }
else {
return MODES[mode] + " Fire";
}
@@ -341,7 +354,7 @@
modeEnabled[i] = true;
}
- if (isSpecialAttack() || isAirPower() || isAirDefence()) {
+ if (isSpecialAttack() || isAirPower() || isAirDefence() || isPartisanAttack()) {
mode = MODE_DIRECT;
modeEnabled[MODE_INDIRECT] = false;
modeEnabled[MODE_OPPORTUNITY] = false;
@@ -530,6 +543,9 @@
if (isIgnoreNegativeModifiers()) {
text.add("Ignoring negative defence modifiers");
}
+ if (isIgnoreAllModifiers()) {
+ text.add("Ignoring all modifiers");
+ }
}
else {
if (specialAttackType == AttackWizard.BEACH_SPECIAL_ATTACK) {
@@ -760,13 +776,13 @@
}
protected void addAttackModifier(FireModifier modifier) {
- if (!isIgnoreNegativeModifiers() || modifier.getValue() >= 0) {
+ if (! isIgnoreAllModifiers() && (!isIgnoreNegativeModifiers() || modifier.getValue() >= 0)) {
attackModifiers.add(modifier);
}
}
protected void addDefenceModifier(FireModifier modifier) {
- if (!isIgnoreNegativeModifiers() || modifier.getValue() >= 0) {
+ if (! isIgnoreAllModifiers() && (!isIgnoreNegativeModifiers() || modifier.getValue() >= 0)) {
defenceModifiers.add(modifier);
}
}
Modified: VSQL-src/trunk/tdc/attack/AttackView.java
===================================================================
--- VSQL-src/trunk/tdc/attack/AttackView.java 2017-01-21 23:51:39 UTC (rev 9251)
+++ VSQL-src/trunk/tdc/attack/AttackView.java 2017-06-29 06:38:19 UTC (rev 9252)
@@ -120,7 +120,7 @@
if (rating != null) {
rating.refresh();
}
- specialAttack.setVisible(myModel.isCounterBatteryFire() || myModel.isAirPower());
+ specialAttack.setVisible(myModel.isCounterBatteryFire() || myModel.isAirPower() || myModel.isPartisanAttack());
}
protected void pack() {
@@ -156,6 +156,9 @@
else if (myModel.isAirDefence()) {
heading = new JLabel("Air Defence");
}
+ else if (myModel.isPartisanAttack()) {
+ heading = new JLabel("Partisan Attack");
+ }
else if (myModel.specialAttackType > AttackWizard.NO_SPECIAL_ATTACK) {
heading = new JLabel(AttackWizard.SPECIAL_ATTACKS[myModel.specialAttackType]);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
vassalengine-svn mailing list
vas...@li...
https://lists.sourceforge.net/lists/listinfo/vassalengine-svn
|