Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data/mods/bryce/specification.xml | 0
- data/rules/classic/specification.xml | 7 +++--
- data/rules/freecol/specification.xml | 3 ++
- data/strings/FreeColMessages.properties | 3 ++
- .../freecol/client/control/InGameController.java | 33 ++++++++++++++++------
- src/net/sf/freecol/common/model/GameOptions.java | 4 +++
- 6 files changed, 40 insertions(+), 10 deletions(-)
- diff --git a/data/rules/classic/specification.xml b/data/rules/classic/specification.xml
- index 1a12abc..687d059 100644
- --- a/data/rules/classic/specification.xml
- +++ b/data/rules/classic/specification.xml
- @@ -3124,7 +3124,7 @@ resources of 400, lost city rumours of 500
- <!-- Per turn probability that an angry AI will continue to
- honour a recent peace treaty -->
- <percentageOption id="model.option.peaceProbability"
- - defaultValue="90"/>
- + defaultValue="90"/>
- <!-- Per turn immigration penalty for units in Europe. -->
- <integerOption id="model.option.europeanUnitImmigrationPenalty"
- defaultValue="-4" minimumValue="-100" maximumValue="0"/>
- @@ -3149,6 +3149,9 @@ resources of 400, lost city rumours of 500
- <!-- Whether to educate the least skilled unit first -->
- <booleanOption id="model.option.allowStudentSelection"
- defaultValue="false"/>
- + <!-- Interval minimum distance to create a new colony. -->
- + <integerOption id="model.option.intervalBetweenColonies"
- + defaultValue="0" value="0" minimumValue="0" maximumValue="4" />
- <!-- Enable upkeep requirement on buildings. -->
- <booleanOption id="model.option.enableUpkeep"
- defaultValue="false"/>
- @@ -3157,7 +3160,7 @@ resources of 400, lost city rumours of 500
- defaultValue="true" />
- <!-- Enable natural disasters striking colonies. -->
- <percentageOption id="model.option.naturalDisasters"
- - defaultValue="0"/>
- + defaultValue="0"/>
- </optionGroup>
- <optionGroup id="gameOptions.victoryConditions">
- <!-- Victory condition: Should the player who first defeats
- diff --git a/data/rules/freecol/specification.xml b/data/rules/freecol/specification.xml
- index 7c7dd75..25a5c51 100644
- --- a/data/rules/freecol/specification.xml
- +++ b/data/rules/freecol/specification.xml
- @@ -192,6 +192,9 @@
- <!-- Whether to educate the least skilled unit first -->
- <booleanOption id="model.option.allowStudentSelection"
- defaultValue="true"/>
- + <!-- Interval minimum distance to create a new colony. -->
- + <integerOption id="model.option.intervalBetweenColonies"
- + defaultValue="0" value="0" minimumValue="0" maximumValue="4"/>
- </optionGroup>
- </optionGroup>
- </options>
- diff --git a/data/strings/FreeColMessages.properties b/data/strings/FreeColMessages.properties
- index 55d8efe..611e630 100644
- --- a/data/strings/FreeColMessages.properties
- +++ b/data/strings/FreeColMessages.properties
- @@ -686,6 +686,8 @@ gameOptions.colony.name=Colony Options
- gameOptions.colony.shortDescription=Contains options relating to the behavior of colonies.
- model.option.customIgnoreBoycott.name=Custom house ignores boycott
- model.option.customIgnoreBoycott.shortDescription=The Custom house can sell goods under boycott.
- +model.option.intervalBetweenColonies.name=Interval minimum distance to create a new colony
- +model.option.intervalBetweenColonies.shortDescription=Limits the creation of colonies next according to the value specified
- model.option.expertsHaveConnections.name=Experts have connections
- model.option.expertsHaveConnections.shortDescription=Experts can use their connections to provide minimal amounts of resources for production in factories.
- model.option.foundColonyDuringRebellion.name=Found colonies during rebellion
- @@ -1367,6 +1369,7 @@ buildColony.noBuildingMaterials=Your new colony would produce very little %goods
- buildColony.IndianLand=Part of your new colony's land is already claimed by natives.
- buildColony.EuropeanLand=Part of your new colony's land is already owned by Europeans.
- buildColony.ownLand=Part of your new colony's land is already owned by you.
- +buildColony.ownLandForbidden=Not permitted to create a new colony's at a distance of %interval% tiles of another European colony!
- buildColony.yes=Lay the foundations!
- buildColony.no=We should reconsider.
- buildColony.others=The %nation% have founded the new colony of %colony% in %region%.
- diff --git a/src/net/sf/freecol/client/control/InGameController.java b/src/net/sf/freecol/client/control/InGameController.java
- index ace6e0d..d575476 100644
- --- a/src/net/sf/freecol/client/control/InGameController.java
- +++ b/src/net/sf/freecol/client/control/InGameController.java
- @@ -1522,19 +1522,36 @@ public final class InGameController implements NetworkConstants {
- if (!requireOurTurn()) return;
- final Specification spec = getSpecification();
- final Player player = freeColClient.getMyPlayer();
- -
- + final Unit unit = gui.getActiveUnit();
- + final Tile tile = unit.getTile();
- +
- // Check unit can build, and is on the map.
- - // Show the colony warnings if required.
- - Unit unit = gui.getActiveUnit();
- - if (unit == null) {
- - return;
- - } else if (!unit.canBuildColony()) {
- + if (!unit.canBuildColony()) {
- gui.showInformationMessage(unit,
- StringTemplate.template("buildColony.badUnit")
- .addName("%unit%", unit.getName()));
- return;
- }
- - Tile tile = unit.getTile();
- +
- + // Check if this next to a European colony
- + int interval = player.getGame().getSpecification().getInteger(GameOptions.CUSTOM_INTERVAL_BETWEEN_COLONIES);
- + if (interval > 0) {
- + boolean nextColonia = false;
- + for (Tile ownTile : tile.getSurroundingTiles(interval)) {
- + Colony colony = ownTile.getColony();
- + if (colony != null && colony.getOwner().isEuropean()) {
- + nextColonia = true;
- + break;
- + }
- + }
- + if (nextColonia == true) {
- + gui.showInformationMessage(StringTemplate.template("buildColony.ownLandForbidden")
- + .addName("%interval%", String.valueOf(interval)));
- + return;
- + }
- + }
- +
- + // Show the colony warnings if required.
- if (tile.getColony() != null) {
- askServer().joinColony(unit, tile.getColony());
- return;
- @@ -1562,7 +1579,7 @@ public final class InGameController implements NetworkConstants {
- // One more check that founding can now proceed.
- if (!player.canClaimToFoundSettlement(tile)) return;
- }
- -
- +
- // Get and check the name.
- String name = player.getSettlementName(null);
- name = gui.showInputDialog(true, tile,
- diff --git a/src/net/sf/freecol/common/model/GameOptions.java b/src/net/sf/freecol/common/model/GameOptions.java
- index c2e7805..f654a11 100644
- --- a/src/net/sf/freecol/common/model/GameOptions.java
- +++ b/src/net/sf/freecol/common/model/GameOptions.java
- @@ -106,6 +106,10 @@ public class GameOptions {
- public static final String CUSTOM_IGNORE_BOYCOTT
- = "model.option.customIgnoreBoycott";
- + /** Interval minimum distance to create a new colony */
- + public static final String CUSTOM_INTERVAL_BETWEEN_COLONIES
- + = "model.option.intervalBetweenColonies";
- +
- /**
- * Whether experts have connections, producing without raw
- * materials in factories.
Add Comment
Please, Sign In to add comment