Revision: 9226
http://sourceforge.net/p/vassalengine/svn/9226
Author: swampwallaby
Date: 2016-05-09 07:59:14 +0000 (Mon, 09 May 2016)
Log Message:
-----------
GTS Tinian Support
Modified Paths:
--------------
VSQL-src/trunk/tdc/AttackWizard.java
VSQL-src/trunk/tdc/CommandRangeChecker.java
VSQL-src/trunk/tdc/TdcCounterDetailViewer.java
VSQL-src/trunk/tdc/TdcProperties.java
VSQL-src/trunk/tdc/TdcRatings.java
VSQL-src/trunk/tdc/TdcWizard.java
VSQL-src/trunk/tdc/UnitInfo.java
VSQL-src/trunk/tdc/attack/AttackModel.java
Modified: VSQL-src/trunk/tdc/AttackWizard.java
===================================================================
--- VSQL-src/trunk/tdc/AttackWizard.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/AttackWizard.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -169,7 +169,7 @@
specialAttackType = NO_SPECIAL_ATTACK;
setSource(source);
setArtilleryPark(artilleryPark);
- if (sourceInfo.isNaval()) {
+ if (sourceInfo.isIndirectFire()) {
GamePiece assaultForceMarker = null;
// Find the matching assault force counter
@@ -181,7 +181,8 @@
for (int i = 0; i < s.getPieceCount(); i++) {
GamePiece u = s.getPieceAt(i);
if (TdcProperties.TYPE_ARTILLERY_PARK.equals(u.getProperty(TdcProperties.TYPE))) {
- if (TdcProperties.DIVISION_NAVAL.equals(u.getProperty(TdcProperties.DIVISION))) {
+ if (TdcProperties.DIVISION_NAVAL.equals(u.getProperty(TdcProperties.DIVISION))
+ || (UnitInfo.isTinianRules() && TdcProperties.DIVISION_4MARINES.equals(u.getProperty(TdcProperties.DIVISION)))) {
String park = (String) u.getProperty(TdcProperties.ARTILLERY_PARK_ID);
if (park != null && park.equals(parkId)) {
assaultForceMarker = u;
@@ -190,6 +191,17 @@
}
}
}
+ else {
+ if (TdcProperties.TYPE_ARTILLERY_PARK.equals(un.getProperty(TdcProperties.TYPE))) {
+ if (TdcProperties.DIVISION_NAVAL.equals(un.getProperty(TdcProperties.DIVISION))
+ || (UnitInfo.isTinianRules() && TdcProperties.DIVISION_4MARINES.equals(un.getProperty(TdcProperties.DIVISION)))) {
+ String park = (String) un.getProperty(TdcProperties.ARTILLERY_PARK_ID);
+ if (park != null && park.equals(parkId)) {
+ assaultForceMarker = un;
+ }
+ }
+ }
+ }
}
}
// Launch an attack with an indirect range
Modified: VSQL-src/trunk/tdc/CommandRangeChecker.java
===================================================================
--- VSQL-src/trunk/tdc/CommandRangeChecker.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/CommandRangeChecker.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -186,6 +186,7 @@
}
}
+ // NQOS Artillery units in Artillery Parks
if (TdcProperties.BIR_HACHEIM.equals(piece.getProperty("CurrentBoard"))) {
final String location = (String) piece.getProperty("LocationName");
if (location != null && location.startsWith(TdcProperties.ARTILLERY_PARK)) {
@@ -199,6 +200,14 @@
return true;
}
}
+
+ // Tinian Artillery units in Artillery Parks
+ if (UnitInfo.isTinianRules()) {
+ final String zone = (String) piece.getProperty(BasicPiece.CURRENT_ZONE);
+ if ("Saipan".equals(zone) || TdcProperties.TGD_ARTY_PARK.equals(zone)) {
+ return true;
+ }
+ }
// Units of the 736th Regiment are Always in command if the 736TelCmd option
// is true and
Modified: VSQL-src/trunk/tdc/TdcCounterDetailViewer.java
===================================================================
--- VSQL-src/trunk/tdc/TdcCounterDetailViewer.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/TdcCounterDetailViewer.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -681,6 +681,11 @@
if (inBirHachiem)
terrain += ", In Bir Hachiem";
+ String poi = (String) hgrid.getProperty(TdcProperties.TERRAIN_POI, snapPt);
+ if (poi != null) {
+ terrain += "("+poi+")";
+ }
+
time = (String) GameModule.getGameModule().getProperty(TdcProperties.TIME);
if (time == null)
time = "";
Modified: VSQL-src/trunk/tdc/TdcProperties.java
===================================================================
--- VSQL-src/trunk/tdc/TdcProperties.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/TdcProperties.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -136,6 +136,7 @@
public static final String RULES_NQOS = "NQOS";
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 SDZ_1AB = "SDZ-1AB";
public static final String SDZ_52AL = "SDZ-52AL";
@@ -166,8 +167,6 @@
public static final String ARTILLERY_PARK = "Artillery Park";
// D-DAY
-
- //
public static final String TERRAIN_CLEAR = "Clear";
public static final String TERRAIN_POLDER = "Polder";
public static final String TERRAIN_OOIJ_POLDER = "Ooij Polder";
@@ -187,6 +186,26 @@
public static final String TERRAIN_MARSH = "Marsh";
public static final String TERRAIN_HILL = "Hill";
+ // TINIAN
+ public static final String TERRAIN_RUNWAY = "Runway";
+ public static final String TERRAIN_SUGAR_CANE = "Sugar Cane";
+ public static final String TERRAIN_BRUSH = "Brush";
+ public static final String TERRAIN_CAVE = "Cave";
+ public static final String TERRAIN_ROCKY = "Rocky";
+ public static final String TERRAIN_BUILDINGS = "Buildings";
+ public static final String TERRAIN_SLOPE = "Slope";
+ public static final String TERRAIN_STEEP_SLOPE = "Steep Slope";
+ public static final String TERRAIN_STACKING = "Stacking";
+ public static final String TERRAIN_TRAIL = "Trail";
+ public static final String TERRAIN_POI = "POI";
+ public static final String TERRAIN_OVERRIDE = "Terrain"; // Counter overriding hex terrain
+ public static final String TERRAIN_BLOCKING = "Blocking"; // Counter overriding terrain blocking
+ public static final String SUBCLASS_NAVAL_GUN = "NavalGun";
+ public static final String DIVISION_2MARINES = "2mar";
+ public static final String DIVISION_4MARINES = "4mar";
+ public static final String DIVISION_IMP_ARMY = "jp-army";
+ public static final String DIVISION_IMP_NAVY = "jp-navy";
+
public static final String RATINGS = "Ratings";
public static final String RATING_INDIRECT = "Rating-Indirect";
@@ -212,7 +231,8 @@
public static final String TYPE_ARTILLERY_MARKER = "ArtilleryMarker";
public static final String TYPE_BEACH_DEFENCE = "BeachDefence";
public static final String TYPE_AIR = "Air";
-
+ public static final String TYPE_CAVE = "Cave";
+
public static final String CLASS_HEROIC = "Heroic";
public static final String CLASS_LANDING_CRAFT = "LandingCraft";
public static final String CLASS_LCS = "LCS";
@@ -251,6 +271,7 @@
public static final String NAVAL_LONG_RANGE = "Long";
public static final String NAVAL_MEDIUM_RANGE = "Medium";
public static final String NAVAL_SHORT_RANGE = "Short";
+ public static final String NAVAL_SAIPAN_RANGE = "Saipan";
public static final String NAVAL_EN_ROUTE = "En Route";
public static final String NAVAL_LOADING = "Loading";
public static final String NAVAL_LANDING = "Landing";
Modified: VSQL-src/trunk/tdc/TdcRatings.java
===================================================================
--- VSQL-src/trunk/tdc/TdcRatings.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/TdcRatings.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -88,7 +88,7 @@
"24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38",
"39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53",
"54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68",
- "69", "70" };
+ "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83" };
protected static final String[] DEF_RATINGS = new String[] { "-5", "-4", "-3", "-2", "-1", "0",
"+1", "+2", "+3", "+4", "+5" };
Modified: VSQL-src/trunk/tdc/TdcWizard.java
===================================================================
--- VSQL-src/trunk/tdc/TdcWizard.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/TdcWizard.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -209,6 +209,9 @@
final String aparkMap = (String) piece.getProperty(TdcProperties.ARTILLERY_PARK_MAP);
final String parkId = (String) piece.getProperty(TdcProperties.ARTILLERY_PARK_ID);
final Map map = Map.getMapById(aparkMap);
+ if (map == null) {
+ return;
+ }
// Locate all Artillery Units in the matching Artillery Park on the matching
// Division display
@@ -220,7 +223,7 @@
if ("true".equals(unit.getProperty(TdcProperties.IS_ARTILLERY))) {
final String zone = (String) unit.getProperty(BasicPiece.CURRENT_ZONE);
final String location = (String) unit.getProperty(BasicPiece.LOCATION_NAME);
- if (TdcProperties.TGD_ARTY_PARK.equals(zone) && parkId.equals(location)) {
+ if (zone != null && zone.startsWith(TdcProperties.TGD_ARTY_PARK) && parkId.equals(location)) {
units.add(unit);
}
}
Modified: VSQL-src/trunk/tdc/UnitInfo.java
===================================================================
--- VSQL-src/trunk/tdc/UnitInfo.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/UnitInfo.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -146,9 +146,17 @@
return TdcProperties.RULES_NQOS.equals(getRuleSet());
}
+ public static boolean isGTS2Rules() {
+ return isTgdRules() || isTinianRules();
+ }
+
public static boolean isTgdRules() {
return TdcProperties.RULES_TGD.equals(getRuleSet()) || TdcProperties.RULES_DDAY.equals(getRuleSet());
}
+
+ public static boolean isTinianRules() {
+ return TdcProperties.RULES_TINIAN.equals(getRuleSet());
+ }
public static int getArtilleryDirectRange() {
return isNqosRules() ? 5 : 4;
@@ -163,7 +171,7 @@
else if (TdcProperties.NAVAL_MEDIUM_RANGE.equals(boxname)) {
r = 20;
}
- else if (TdcProperties.NAVAL_SHORT_RANGE.equals(boxname)) {
+ else if (TdcProperties.NAVAL_SHORT_RANGE.equals(boxname) || TdcProperties.NAVAL_SAIPAN_RANGE.equals(boxname)) {
r = 10;
}
@@ -363,9 +371,14 @@
return TdcProperties.DIVISION_NAVAL.equals(division) && !TdcProperties.CLASS_LANDING_CRAFT.equals(unitClass);
}
+ public boolean isIndirectFire() {
+ return isNaval() ||
+ (isTinianRules() && isArtillery() && "Saipan".equals(unit.getProperty(BasicPiece.CURRENT_ZONE)));
+ }
+
public int getNavalRange() {
int r = 0;
- if (isNaval()) {
+ if (isIndirectFire()) {
r = UnitInfo.calculateNavalAddRange((String) unit.getProperty(TdcProperties.NAVAL_BOX));
}
return r;
@@ -510,16 +523,30 @@
terrainInfo.put(TdcProperties.TERRAIN_BRUSHWOODS, new TerrainInfo(TdcProperties.TERRAIN_BRUSHWOODS, -2));
terrainInfo.put(TdcProperties.TERRAIN_SWAMP, new TerrainInfo(TdcProperties.TERRAIN_SWAMP, 1));
terrainInfo.put(TdcProperties.TERRAIN_SAND_DUNES, new TerrainInfo(TdcProperties.TERRAIN_SAND_DUNES, -1));
- terrainInfo.put(TdcProperties.TERRAIN_VILLAGE, new TerrainInfo(TdcProperties.TERRAIN_VILLAGE, -1));
- terrainInfo.put(TdcProperties.TERRAIN_TOWN, new TerrainInfo(TdcProperties.TERRAIN_TOWN, -2));
terrainInfo.put(TdcProperties.TERRAIN_CITY, new TerrainInfo(TdcProperties.TERRAIN_CITY, -3));
terrainInfo.put(TdcProperties.TERRAIN_FORTIFIED, new TerrainInfo(TdcProperties.TERRAIN_FORTIFIED, -4));
terrainInfo.put(TdcProperties.TERRAIN_DESERT, new TerrainInfo(TdcProperties.TERRAIN_DESERT, 0));
- terrainInfo.put(TdcProperties.TERRAIN_BEACH, new TerrainInfo(TdcProperties.TERRAIN_BEACH, 1));
- terrainInfo.put(TdcProperties.TERRAIN_MARSH, new TerrainInfo(TdcProperties.TERRAIN_MARSH, 1));
terrainInfo.put(TdcProperties.TERRAIN_BOCAGE, new TerrainInfo(TdcProperties.TERRAIN_BOCAGE, -2));
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_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));
+ }
+ else {
+ terrainInfo.put(TdcProperties.TERRAIN_BEACH, new TerrainInfo(TdcProperties.TERRAIN_BEACH, 1));
+ terrainInfo.put(TdcProperties.TERRAIN_MARSH, new TerrainInfo(TdcProperties.TERRAIN_MARSH, 1));
+ terrainInfo.put(TdcProperties.TERRAIN_TOWN, new TerrainInfo(TdcProperties.TERRAIN_TOWN, -2));
+ }
terrainInfoArmoured = new HashMap<String, TerrainInfo>();
terrainInfoArmoured.put(TdcProperties.TERRAIN_CLEAR, new TerrainInfo(TdcProperties.TERRAIN_CLEAR, 0));
@@ -530,16 +557,30 @@
terrainInfoArmoured.put(TdcProperties.TERRAIN_BRUSHWOODS, new TerrainInfo(TdcProperties.TERRAIN_BRUSHWOODS, -2));
terrainInfoArmoured.put(TdcProperties.TERRAIN_SWAMP, new TerrainInfo(TdcProperties.TERRAIN_SWAMP, 1));
terrainInfoArmoured.put(TdcProperties.TERRAIN_SAND_DUNES, new TerrainInfo(TdcProperties.TERRAIN_SAND_DUNES, -1));
- terrainInfoArmoured.put(TdcProperties.TERRAIN_VILLAGE, new TerrainInfo(TdcProperties.TERRAIN_VILLAGE, 0));
- terrainInfoArmoured.put(TdcProperties.TERRAIN_TOWN, new TerrainInfo(TdcProperties.TERRAIN_TOWN, -1));
terrainInfoArmoured.put(TdcProperties.TERRAIN_CITY, new TerrainInfo(TdcProperties.TERRAIN_CITY, -2));
terrainInfoArmoured.put(TdcProperties.TERRAIN_FORTIFIED, new TerrainInfo(TdcProperties.TERRAIN_FORTIFIED, -3));
terrainInfoArmoured.put(TdcProperties.TERRAIN_DESERT, new TerrainInfo(TdcProperties.TERRAIN_DESERT, 0));
- terrainInfoArmoured.put(TdcProperties.TERRAIN_BEACH, new TerrainInfo(TdcProperties.TERRAIN_BEACH, 0));
- terrainInfoArmoured.put(TdcProperties.TERRAIN_MARSH, new TerrainInfo(TdcProperties.TERRAIN_MARSH, 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_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, 0));
+ }
+ else {
+ terrainInfoArmoured.put(TdcProperties.TERRAIN_TOWN, new TerrainInfo(TdcProperties.TERRAIN_TOWN, -1));
+ terrainInfoArmoured.put(TdcProperties.TERRAIN_BEACH, new TerrainInfo(TdcProperties.TERRAIN_BEACH, 0));
+ terrainInfoArmoured.put(TdcProperties.TERRAIN_MARSH, new TerrainInfo(TdcProperties.TERRAIN_MARSH, 0));
+ }
}
protected String getDetails(ArrayList<String> details) {
@@ -683,7 +724,7 @@
if (hex == null)
hex = "";
- terrain = (String) TdcMap.getTerrainProperty(unit, TerrainBasicPiece.CURRENT_TERRAIN);
+ terrain = (String) unit.getProperty(TerrainBasicPiece.CURRENT_TERRAIN);
if (terrain == null)
terrain = "";
@@ -1230,6 +1271,12 @@
adjustDefenceRating("Hero", -2);
addDefenceModifier("Hero", -2, unit);
}
+
+ // Cave (Tinian)
+ else if (TdcProperties.TYPE_CAVE.equals(type)) {
+ adjustDefenceRating("In Cave", -3);
+ addDefenceModifier("In Cave", -3, unit);
+ }
}
}
Modified: VSQL-src/trunk/tdc/attack/AttackModel.java
===================================================================
--- VSQL-src/trunk/tdc/attack/AttackModel.java 2016-04-27 14:11:01 UTC (rev 9225)
+++ VSQL-src/trunk/tdc/attack/AttackModel.java 2016-05-09 07:59:14 UTC (rev 9226)
@@ -710,7 +710,7 @@
int massBonus = 0;
String massDesc = "";
- if (UnitInfo.isTgdRules()) {
+ if (UnitInfo.isTgdRules() ) {
if (mass >= 8) {
massBonus = 3;
massDesc = "8+";
@@ -742,7 +742,7 @@
massDesc = "5-6";
}
}
- if (massBonus > 0) {
+ if (massBonus != 0) {
addDefenceModifier(new FireModifier("Mass " + massDesc + " steps", massBonus, FireModifier.BASIC, true, true, true, this));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
vassalengine-svn mailing list
vas...@li...
https://lists.sourceforge.net/lists/listinfo/vassalengine-svn
|