mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-24 22:59:34 +07:00
added "required nearby improved resource" limitation to some buildings
added circus, stone works and notre dame buildings
This commit is contained in:
@ -41,6 +41,17 @@
|
|||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
requiredTech:"Pottery"
|
requiredTech:"Pottery"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Stone Works",
|
||||||
|
description: "Stone and marble provide +1 production.",
|
||||||
|
happiness:1,
|
||||||
|
production:1
|
||||||
|
requiredNearbyImprovedResources:["Marble","Stone"]
|
||||||
|
resourceBonusStats:{production:1},
|
||||||
|
maintainance:1,
|
||||||
|
hurryCostModifier:25,
|
||||||
|
requiredTech:"Calendar"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Library",
|
name:"Library",
|
||||||
description: "Adds 1 science for each 2 population in the city.",
|
description: "Adds 1 science for each 2 population in the city.",
|
||||||
@ -49,6 +60,14 @@
|
|||||||
unique:"SciencePer2Pop",
|
unique:"SciencePer2Pop",
|
||||||
requiredTech:"Writing"
|
requiredTech:"Writing"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Circus",
|
||||||
|
description: "",
|
||||||
|
requiredNearbyImprovedResources:["Ivory","Horses"]
|
||||||
|
happiness:2,
|
||||||
|
hurryCostModifier:25,
|
||||||
|
requiredTech:"Trapping"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Great Library",
|
name:"Great Library",
|
||||||
description: "Provides a free technology, and a library in the city it is built in",
|
description: "Provides a free technology, and a library in the city it is built in",
|
||||||
@ -90,7 +109,7 @@
|
|||||||
name:"Stable",
|
name:"Stable",
|
||||||
description: "Cattle, sheep and horses provide +1 production.",
|
description: "Cattle, sheep and horses provide +1 production.",
|
||||||
maintainance:1,
|
maintainance:1,
|
||||||
resourceBoostingBuilding:true,
|
requiredNearbyImprovedResources:["Horses","Sheep","Cattle"]
|
||||||
resourceBonusStats:{production:1},
|
resourceBonusStats:{production:1},
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
requiredTech:"Horseback Riding"
|
requiredTech:"Horseback Riding"
|
||||||
@ -128,19 +147,27 @@
|
|||||||
percentStatBonus:{gold:25},
|
percentStatBonus:{gold:25},
|
||||||
requiredTech:"Currency"
|
requiredTech:"Currency"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Notre Dame",
|
||||||
|
description: "",
|
||||||
|
culture:1,
|
||||||
|
happiness:10,
|
||||||
|
isWonder:true,
|
||||||
|
requiredTech:"Theology"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Chichen Itza",
|
name:"Chichen Itza",
|
||||||
description: "Length of golden ages increased +50%",
|
description: "Length of golden ages increased +50%",
|
||||||
gold:5,
|
|
||||||
culture:1,
|
culture:1,
|
||||||
isWonder:true,
|
isWonder:true,
|
||||||
|
unique:"GoldenAgeLengthIncrease",
|
||||||
requiredTech:"Currency"
|
requiredTech:"Currency"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Mint",
|
name:"Mint",
|
||||||
description: "",
|
description: "",
|
||||||
maintainance:0,
|
maintainance:0,
|
||||||
resourceBoostingBuilding:true,
|
requiredNearbyImprovedResources:["Gold","Silver"],
|
||||||
resourceBonusStats:{gold:2},
|
resourceBonusStats:{gold:2},
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
requiredTech:"Currency"
|
requiredTech:"Currency"
|
||||||
@ -177,7 +204,7 @@
|
|||||||
description: "Iron provides +1 production",
|
description: "Iron provides +1 production",
|
||||||
maintainance:1,
|
maintainance:1,
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
resourceBoostingBuilding:true,
|
requiredNearbyImprovedResources:["Iron"],
|
||||||
resourceBonusStats:{production:1},
|
resourceBonusStats:{production:1},
|
||||||
requiredTech:"Metal Casting"
|
requiredTech:"Metal Casting"
|
||||||
},
|
},
|
||||||
|
@ -111,13 +111,13 @@ public class CityBuildings
|
|||||||
{
|
{
|
||||||
CivilizationInfo civInfo = UnCivGame.Current.civInfo;
|
CivilizationInfo civInfo = UnCivGame.Current.civInfo;
|
||||||
if(isBuilt(building.name)) return false;
|
if(isBuilt(building.name)) return false;
|
||||||
if(building.resourceBoostingBuilding) {
|
if(building.requiredNearbyImprovedResources!=null) {
|
||||||
boolean containsResourceWithImprovement = getCity().getTilesInRange()
|
boolean containsResourceWithImprovement = getCity().getTilesInRange()
|
||||||
.any(new Predicate<TileInfo>() {
|
.any(new Predicate<TileInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean evaluate(TileInfo tile) {
|
public boolean evaluate(TileInfo tile) {
|
||||||
return tile.resource != null
|
return tile.resource != null
|
||||||
&& building.name.equals(tile.getTileResource().building)
|
&& building.requiredNearbyImprovedResources.contains(tile.resource)
|
||||||
&& tile.getTileResource().improvement.equals(tile.improvement);
|
&& tile.getTileResource().improvement.equals(tile.improvement);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -17,10 +17,10 @@ public class Building extends NamedStats implements ICivilopedia {
|
|||||||
public FullStats percentStatBonus = new FullStats();
|
public FullStats percentStatBonus = new FullStats();
|
||||||
public int hurryCostModifier; // Extra cost percentage when purchasing
|
public int hurryCostModifier; // Extra cost percentage when purchasing
|
||||||
public boolean isWonder = false;
|
public boolean isWonder = false;
|
||||||
public boolean resourceBoostingBuilding = false;
|
|
||||||
public String requiredBuilding;
|
public String requiredBuilding;
|
||||||
public String requiredBuildingInAllCities;
|
public String requiredBuildingInAllCities;
|
||||||
public String requiredResource;
|
public String requiredResource; // A strategic resource that will be consumed by this building
|
||||||
|
public LinqCollection requiredNearbyImprovedResources; // City can only be built if one of these resources is nearby - it must be improved!
|
||||||
public String cannotBeBuiltWith;
|
public String cannotBeBuiltWith;
|
||||||
|
|
||||||
// Uniques
|
// Uniques
|
||||||
|
Reference in New Issue
Block a user