|
From: <ste...@us...> - 2010-09-08 21:41:40
|
Revision: 1416
http://rails.svn.sourceforge.net/rails/?rev=1416&view=rev
Author: stefanfrey
Date: 2010-09-08 21:41:33 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
Issues:
a) In 1889 the port tile can be laid on a hex already containing
a yellow broad curve town tile.
b) In 18AL the lumberjack tile can be laid on a hex already containig
a yellow broad curve tile.
c) In 1830 the D&H allows upgrading to green tiles.
Possible Solution:
- Special tile lays always increase tile colour number.
- Special tile lays always check the allowed tile colour of the current phase.
- Add tile="57" to D&H special property
Modified Paths:
--------------
trunk/18xx/data/1830/CompanyManager.xml
trunk/18xx/rails/game/OperatingRound.java
trunk/18xx/rails/ui/swing/UpgradesPanel.java
Modified: trunk/18xx/data/1830/CompanyManager.xml
===================================================================
--- trunk/18xx/data/1830/CompanyManager.xml 2010-09-07 19:42:01 UTC (rev 1415)
+++ trunk/18xx/data/1830/CompanyManager.xml 2010-09-08 21:41:33 UTC (rev 1416)
@@ -39,7 +39,7 @@
<Blocking hex="F16"/>
<SpecialProperties>
<SpecialProperty condition="ifOwnedByCompany" when="tileLayingStep" class="rails.game.special.SpecialTileLay">
- <SpecialTileLay location="F16" extra="no" free="no"/>
+ <SpecialTileLay location="F16" extra="no" free="no" tile="57" />
</SpecialProperty>
<SpecialProperty condition="ifOwnedByCompany" when="tokenLayingStep" class="rails.game.special.SpecialTokenLay">
<SpecialTokenLay location="F16" extra="no" free="yes"/>
Modified: trunk/18xx/rails/game/OperatingRound.java
===================================================================
--- trunk/18xx/rails/game/OperatingRound.java 2010-09-07 19:42:01 UTC (rev 1415)
+++ trunk/18xx/rails/game/OperatingRound.java 2010-09-08 21:41:33 UTC (rev 1416)
@@ -1339,11 +1339,11 @@
if (!operatingCompany.get().canUseSpecialProperties()) return;
for (SpecialTileLay stl : getSpecialProperties(SpecialTileLay.class)) {
- if (stl.isExtra() || !currentNormalTileLays.isEmpty()) {
- /*
- * If the special tile lay is not extra, it is only allowed if
- * normal tile lays are also (still) allowed
- */
+ if (getCurrentPhase().isTileColourAllowed(stl.getTile().getColourName())
+ // if a tile is specified it must have a tile colour currently available
+ && (stl.isExtra() || !currentNormalTileLays.isEmpty())) {
+ // If the special tile lay is not extra, it is only allowed if
+ // normal tile lays are also (still) allowed
currentSpecialTileLays.add(new LayTile(stl));
}
}
Modified: trunk/18xx/rails/ui/swing/UpgradesPanel.java
===================================================================
--- trunk/18xx/rails/ui/swing/UpgradesPanel.java 2010-09-07 19:42:01 UTC (rev 1415)
+++ trunk/18xx/rails/ui/swing/UpgradesPanel.java 2010-09-08 21:41:33 UTC (rev 1416)
@@ -100,6 +100,9 @@
}
} else {
for (TileI tile : tiles) {
+ // special check: does the tile increase the colour number?
+ // this avoids that a special tile lay down or equalgrades existing tiles
+ if (tile.getColourNumber() <= uiHex.getCurrentTile().getColourNumber()) continue;
if (!orUIManager.tileUpgrades.contains(tile))
orUIManager.tileUpgrades.add(tile);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|