Added techs and buildings up to industral era

Added option to remove jungles, forests and marshes
This commit is contained in:
Yair Morgenstern 2017-12-06 23:13:49 +02:00
parent 635e8ce08a
commit ea5552f3a7
11 changed files with 217 additions and 46 deletions

View file

@ -174,6 +174,7 @@
maintainance:2,
percentStatBonus:{science:33},
requiredBuilding:"Library",
unique:"JunglesProvideScience",
requiredTech:"Metal Casting"
},
{
@ -194,6 +195,99 @@
isWonder:true,
unique:"NewTileCostReduction",
requiredTech:"Education"
}
},
{
name:"Ironworks",
description: "",
production:8,
culture:1,
isWonder:true,
requiredBuildingInAllCities:"Workshop",
requiredTech:"Machinery"
},
{
name:"Observatory",
description: "City must be bordering a mountain",
maintainance:2,
percentStatBonus:{science:50},
requiredBuilding:"Library",
requiredTech:"Metal Casting"
},
{
name:"Opera House",
description: "",
culture:4,
requiredBuilding:"Temple",
maintainance:2,
requiredTech:"Acoustics"
},
{
name:"Sistine Chapel",
description: "Culture in all cities increased by 25%",
culture:1,
isWonder:true,
unique:"CultureIncrease",
requiredTech:"Acoustics"
},
{
name:"Bank",
description: "",
gold:2,
percentStatBonus:{gold:25},
requiredBuilding:"Market",
requiredTech:"Banking"
},
{
name:"Theatre",
description: "",
happiness:3,
maintainance:2,
requiredBuilding:"Colloseum",
requiredTech:"Banking"
},
{
name:"Taj Mahal",
description: "Empire enters a golden age",
culture:1,
happiness:4,
isWonder:true,
unique:"EmpireEntersGoldenAge",
requiredTech:"Acoustics"
},
{
name:"Windmill",
description: "",
production:2,
maintainance:2,
percentStatBonus:{production:10},
requiredTech:"Economics"
},
{
name:"Museum",
description: "",
culture:5,
requiredBuilding:"Opera House",
maintainance:3,
requiredTech:"Archaeology"
},
{
name:"Hermitage",
description: "",
percentStatBonus:{culture:50},
culture:5,
isWonder:true,
requiredBuildingInAllCities:"Opera House",
requiredTech:"Archaeology"
},
{
name:"The Louvre",
description: "Free Great Artist appears near the city - TODO",
culture:1,
happiness:4,
isWonder:true,
unique:"FreeGreatArtistAppears",
requiredTech:"Archaeology"
},
]

View file

@ -32,7 +32,7 @@
name:"Sailing",
row:1,
prerequisites:["Pottery"],
description:"Allows access to sea resources by building work boats"
description:"Does nothing since we have no sea tiles - In theory, Allows access to sea resources by building work boats"
},
{
name:"Calendar",
@ -83,7 +83,7 @@
cost:95,
row:1,
prerequisites:["Sailing"],
description:"Allows construction of lighthouses, providing more food for sea tiles"
description:"Does nothing since we have no sea tiles - In theory, Allows construction of lighthouses, providing more food for sea tiles"
},
{
name:"Philosophy",
@ -127,7 +127,7 @@
name:"Theology",
row:2,
prerequisites:["Calendar","Philosophy"],
description:"???"
description:"Unclear what this does in Vanilla civ"
},
{
name:"Civil Service",
@ -166,7 +166,7 @@
row:1,
cost:415,
prerequisites:["Optics"],
description:"???"
description:"Does nothing since we have no sea tiles - In theory, allows construction of harbors"
},
{
name:"Education",
@ -184,19 +184,19 @@
name:"Machinery",
row:8,
prerequisites:["Engineering"],
description:"???"
description:"Speeds movement speed on roads and allows you to construct the Ironworks wonder, which gives a massive boost in production"
},
{
name:"Physics",
row:9,
prerequisites:["Engineering","Metal Casting"],
description:"???"
description:"Contributes only war-relatied things - on hold until AI is introduced"
},
{
name:"Steel",
row:10,
prerequisites:["Metal Casting"],
description:"???"
description:"Contributes only war-relatied things - on hold until AI is introduced"
}
]
},
@ -210,31 +210,31 @@
name:"Astronomy",
row:2,
prerequisites:["Compass","Education"],
description:"This is a lie, change!!!"
description:"Enables construction of Observatories in cities near mountains"
},
{
name:"Acoustics",
row:4,
prerequisites:["Education","Chivalry"],
description:"This is a lie, change!!!"
description:"Enables construction of Opera Houses and the Sistine Chapel, providing culture"
},
{
name:"Banking",
row:6,
prerequisites:["Chivalry"],
description:"This is a lie, change!!!"
description:"Enables construction of banks, giving a serious boost in gold to your empire"
},
{
name:"Printing Press",
row:8,
prerequisites:["Machinery","Physics"],
description:"This is a lie, change!!!"
description:"Eables construction of the Theatre and Taj Mahal, increasing happiness"
},
{
name:"Gunpowder",
row:10,
prerequisites:["Physics","Steel"],
description:"This is a lie, change!!!"
description:"Contributes only war-relatied things - on hold until AI is introduced"
}
]
},
@ -248,25 +248,25 @@
name:"Navigation",
row:2,
prerequisites:["Astronomy"],
description:"This is a lie, change!!!"
description:"Does nothing since we have no sea tiles - In theory, allows construction of Frigates and Seaports"
},
{
name:"Economics",
row:6,
prerequisites:["Banking","Printing Press"],
description:"This is a lie, change!!!"
description:"Camps and Trading Posts provide +1 gold, allows construction of Windmill"
},
{
name:"Chemistry",
row:9,
prerequisites:["Gunpowder"],
description:"This is a lie, change!!!"
description:"Mines and Quarries provide +1 production"
},
{
name:"Metallurgy",
row:10,
prerequisites:["Gunpowder"],
description:"This is a lie, change!!!"
description:"Contributes only war-relatied things - on hold until AI is introduced"
}
]
},
@ -277,10 +277,10 @@
wonderCost:750,
techs:[
{
name:"Archaology",
name:"Archaeology",
row:2,
prerequisites:["Navigation"],
description:"This is a lie, change!!!"
description:"Allows construction of Museums and the Hermitage and Louvre wonders, providing culture"
},
{
name:"Scientific Theory",
@ -292,19 +292,71 @@
name:"Military Science",
row:6,
prerequisites:["Economics","Chemistry"],
description:"This is a lie, change!!!"
description:"Contributes only war-relatied things - on hold until AI is introduced"
},
{
name:"Fertilizer",
row:9,
prerequisites:["Chemistry"],
description:"This is a lie, change!!!"
description:"+1 food from Farms, Plantations and Pastures"
},
{
name:"Rifling",
row:10,
prerequisites:["Metallurgy"],
description:"This is a lie, change!!!"
description:"Contributes only war-relatied things - on hold until AI is introduced"
}
]
},
{
columnNumber: 9,
techCost: 2585,
buildingCost:360,
wonderCost:920,
techs:[
{
name:"Biology",
row:4,
prerequisites:["Archaeology","Scientific Theory"],
description:"Reveals oil and allows construction of oil wells - Todo"
},
{
name:"Steam Power",
row:6,
prerequisites:["Scientific Theory","Military Science"],
description:"Enables construction of factories and - Todo"
},
{
name:"Dynamite",
row:9,
prerequisites:["Military Science","Fertilizer","Rifling"],
description:"Contributes only war-relatied things - on hold until AI is introduced"
}
]
},
{
columnNumber: 10,
techCost: 3405,
buildingCost:500,
wonderCost:1060,
techs:[
{
name:"Electricity",
row:4,
prerequisites:["Biology","Steam Power"],
description:"Reveals Aluminium on map and allows construction of stock exchange, providing gold - todo"
},
{
name:"Replaceable Parts",
row:6,
prerequisites:["Steam Power"],
description:"Contributes only war-relatied things - on hold until AI is introduced - todo"
},
{
name:"Railroad",
row:8,
prerequisites:["Steam Power","Dynamite"],
description:"Allows construction of railroads, providing fast transport and a 25% production boost to cities - todo"
}
]
}

View file

@ -52,8 +52,7 @@
movementCost:2,
overrideStats:true,
unbuildable:true,
occursOn:["Tundra","Plains","Grassland"],
removalTech: "Mining"
occursOn:["Tundra","Plains","Grassland"]
},
{
name:"Jungle",
@ -62,8 +61,7 @@
movementCost:2,
overrideStats:true,
unbuildable:true,
occursOn:["Plains","Grassland"],
removalTech: "Bronze Working"
occursOn:["Plains","Grassland"]
},
{
name:"Marsh",
@ -71,8 +69,7 @@
food:-1,
movementCost:2,
unbuildable:true,
occursOn:["Grassland"],
removalTech: "Masonry"
occursOn:["Grassland"]
},
{
name:"Oasis",

View file

@ -43,7 +43,8 @@
},
{
name:"Oil well",
turnsToBuild:6
turnsToBuild:6,
techRequired:"Biology",
},
{
name:"Pasture",
@ -76,5 +77,24 @@
name:"Railroad",
turnsToBuild:12,
techRequired:"Railroad"
}
},
{
name:"Remove Forest",
turnsToBuild:6,
terrainsCanBeBuiltOn:["Forest"],
techRequired:"Mining"
},
{
name:"Remove Jungle",
turnsToBuild:6,
terrainsCanBeBuiltOn:["Jungle"],
techRequired:"Bronze Working"
},
{
name:"Remove Marsh",
turnsToBuild:6,
terrainsCanBeBuiltOn:["Marsh"],
techRequired:"Masonry"
},
]

View file

@ -105,10 +105,10 @@ public class TileInfo
return resource != null && getTileResource().improvement.equals(improvement.name);
}
public void startWorkingOnImprovement(TileImprovement improvement)
public void startWorkingOnImprovement(String improvementName,int turnsToBuild)
{
improvementInProgress = improvement.name;
turnsToImprovement = improvement.turnsToBuild;
improvementInProgress = improvementName;
turnsToImprovement = turnsToBuild;
}
public void stopWorkingOnImprovement()

View file

@ -8,7 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
import java.util.HashMap;
public class ImageGetter {
static HashMap<String, TextureRegion> textureRegionByFileName = new HashMap<String, TextureRegion>();
public static HashMap<String, TextureRegion> textureRegionByFileName = new HashMap<String, TextureRegion>();
public static Image getImageByFilename(String fileName) {
if (!textureRegionByFileName.containsKey(fileName))

View file

@ -6,6 +6,8 @@ import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Container;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.unciv.civinfo.CivilizationInfo;
import com.unciv.civinfo.RoadStatus;
import com.unciv.civinfo.TileInfo;
@ -48,6 +50,9 @@ public class TileGroup extends Group {
void update() {
String terrainFileName ="TerrainIcons/" + tileInfo.getLastTerrain().name.replace(' ','_') + "_(Civ5).png";
terrainImage.setDrawable(new TextureRegionDrawable(ImageGetter.textureRegionByFileName.get(terrainFileName))); // In case we e.g. removed a jungle
if (tileInfo.hasViewableResource() && resourceImage == null) { // Need to add the resource image!
String fileName = "ResourceIcons/" + tileInfo.resource + "_(Civ5).png";
Image image = ImageGetter.getImageByFilename(fileName);

View file

@ -82,8 +82,8 @@ public class UnCivGame extends Game {
GameBasics.Technologies.put(tech.name,tech);
}
}
for(Building building : GameBasics.Buildings.values()){
if(building.requiredTech == null) continue;
for(Building building : GameBasics.Buildings.values()) {
if (building.requiredTech == null) continue;
TechColumn column = building.GetRequiredTech().column;
building.cost = building.isWonder ? column.wonderCost : column.buildingCost;
}

View file

@ -180,12 +180,12 @@ public class WorldScreen extends CameraStageBaseScreen {
CivStats nextTurnStats = game.civInfo.getStatsForNextTurn();
CivTable.add(new Label("gold: " + Math.round(currentStats.gold)
CivTable.add(new Label("Gold: " + Math.round(currentStats.gold)
+ "(" +(nextTurnStats.gold >0?"+":"") + Math.round(nextTurnStats.gold) +")", skin));
CivTable.add(new Label("science: +" + Math.round(nextTurnStats.science), skin));
CivTable.add(new Label("happiness: " + Math.round(nextTurnStats.happiness), skin));
CivTable.add(new Label("culture: " + Math.round(currentStats.culture) + "(+" + Math.round(nextTurnStats.culture) +")", skin));
CivTable.add(new Label("Science: +" + Math.round(nextTurnStats.science), skin));
CivTable.add(new Label("Happiness: " + Math.round(nextTurnStats.happiness), skin));
CivTable.add(new Label("Culture: " + Math.round(currentStats.culture) + "(+" + Math.round(nextTurnStats.culture) +")", skin));
CivTable.pack();

View file

@ -6,12 +6,14 @@ import com.badlogic.gdx.scenes.scene2d.Touchable;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.unciv.civinfo.CivilizationInfo;
import com.unciv.game.UnCivGame;
import com.unciv.models.gamebasics.GameBasics;
import com.unciv.models.gamebasics.TileImprovement;
public class ImprovementPickerScreen extends PickerScreen {
TileImprovement SelectedImprovement;
String SelectedImprovement;
int TurnsToImprovement;
public ImprovementPickerScreen(final UnCivGame game, final com.unciv.civinfo.TileInfo tileInfo) {
super(game);
@ -21,7 +23,7 @@ public class ImprovementPickerScreen extends PickerScreen {
rightSideButton.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
tileInfo.startWorkingOnImprovement(SelectedImprovement);
tileInfo.startWorkingOnImprovement(SelectedImprovement, TurnsToImprovement);
game.setWorldScreen();
dispose();
}
@ -38,9 +40,10 @@ public class ImprovementPickerScreen extends PickerScreen {
TB.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
SelectedImprovement = improvement;
SelectedImprovement = improvement.name;
TurnsToImprovement = improvement.turnsToBuild;
rightSideButton.setTouchable(Touchable.enabled);
rightSideButton.setText("Construct "+improvement.name);
rightSideButton.setText(improvement.name);
rightSideButton.setColor(Color.WHITE);
descriptionLabel.setText(improvement.getDescription());
}

View file

@ -100,14 +100,14 @@ public class TechPickerScreen extends PickerScreen {
}
for (Technology technology : GameBasics.Technologies.linqValues()) {
techMatrix[technology.column.columnNumber][technology.row - 1] = technology;
techMatrix[technology.column.columnNumber-1][technology.row - 1] = technology;
}
// Table topTable = new Table();
for (int i = 0; i < 10; i++) {
topTable.row().pad(5);
for (int j = 0; j < 8; j++) {
for (int j = 0; j < 9; j++) {
final Technology tech = techMatrix[j][i];
if (tech == null) topTable.add(); // empty cell
else {