Tech tree total overhaul - Based it on G&K but removed all war-only techs, normalized bonuses across techs

This commit is contained in:
Yair Morgenstern
2017-12-21 14:45:49 +02:00
parent d81cb8cda7
commit 14c75d7cc4
7 changed files with 217 additions and 300 deletions

View File

@ -129,11 +129,12 @@ public class CityInfo {
//idle ppl
stats.production += getFreePopulation();
CivilizationInfo civInfo = CivilizationInfo.current();
if(!isCapital() && isConnectedToCapital(RoadStatus.Road)) {
// Calculated by http://civilization.wikia.com/wiki/Trade_route_(Civ5)
double goldFromTradeRoute = CivilizationInfo.current().getCapital().population * 0.15
double goldFromTradeRoute = civInfo.getCapital().population * 0.15
+ population * 1.1 - 1;
if(CivilizationInfo.current().getBuildingUniques().contains("TradeRouteGoldIncrease")) goldFromTradeRoute*=1.25; // Machu Pichu speciality
if(civInfo.getBuildingUniques().contains("TradeRouteGoldIncrease")) goldFromTradeRoute*=1.25; // Machu Pichu speciality
stats.gold += goldFromTradeRoute;
}
@ -141,22 +142,26 @@ public class CityInfo {
FullStats statPercentBonuses = cityConstructions.getStatPercentBonuses();
if(isCapital() || isConnectedToCapital(RoadStatus.Railroad)) statPercentBonuses.production += 25;
if(CivilizationInfo.current().isGoldenAge()) statPercentBonuses.production+=20;
if(civInfo.isGoldenAge()) statPercentBonuses.production+=20;
IConstruction currentConstruction = cityConstructions.getCurrentConstruction();
if(currentConstruction instanceof Building && ((Building)currentConstruction).isWonder &&
CivilizationInfo.current().getCivResources().containsKey(GameBasics.TileResources.get("Marble")))
civInfo.getCivResources().containsKey(GameBasics.TileResources.get("Marble")))
statPercentBonuses.production+=15;
stats.production*=1+statPercentBonuses.production/100; // So they get bonuses for production and gold/science
if(cityConstructions.currentConstruction.equals("Gold")) stats.gold+=stats.production/4;
if(cityConstructions.currentConstruction.equals("Science")) stats.science+=stats.production/4;
if(cityConstructions.currentConstruction.equals("Science")) {
if (civInfo.getBuildingUniques().contains("ScienceConversionIncrease"))
stats.science += stats.production / 3;
else stats.science += stats.production / 4;
}
stats.gold*=1+statPercentBonuses.gold/100;
stats.science*=1+statPercentBonuses.science/100;
stats.culture*=1+statPercentBonuses.culture/100;
boolean isUnhappy =CivilizationInfo.current().getHappinessForNextTurn() < 0;
boolean isUnhappy = civInfo.getHappinessForNextTurn() < 0;
if (!isUnhappy) stats.food*=1+statPercentBonuses.food/100; // Regular food bonus revoked when unhappy per https://forums.civfanatics.com/resources/complete-guide-to-happiness-vanilla.25584/
stats.food -= population * 2; // Food reduced after the bonus
if(isUnhappy) stats.food /= 4; // Reduce excess food to 1/4 per the same

View File

@ -31,7 +31,7 @@ public class TechPickerScreen extends PickerScreen {
public TechPickerScreen(final UnCivGame game) {
super(game);
Technology[][] techMatrix = new Technology[16][10]; // Divided into columns, then rows
Technology[][] techMatrix = new Technology[17][10]; // Divided into columns, then rows
for (Technology technology : GameBasics.Technologies.linqValues()) {
techMatrix[technology.column.columnNumber-1][technology.row - 1] = technology;

View File

@ -102,19 +102,6 @@ public class Building extends NamedStats implements IConstruction, ICivilopedia
public boolean isBuildable(CityConstructions construction){
CivilizationInfo civInfo = UnCivGame.Current.civInfo;
if(construction.isBuilt(name)) return false;
if(requiredNearbyImprovedResources!=null) {
boolean containsResourceWithImprovement = construction.getCity().getTilesInRange()
.any(new Predicate<TileInfo>() {
@Override
public boolean evaluate(TileInfo tile) {
return tile.resource != null
&& requiredNearbyImprovedResources.contains(tile.resource)
&& tile.getTileResource().improvement.equals(tile.improvement);
}
});
if(!containsResourceWithImprovement) return false;
}
if (requiredTech != null && !civInfo.tech.isResearched(requiredTech)) return false;
if (isWonder && civInfo.cities
.any(new Predicate<CityInfo>() {
@ -145,6 +132,20 @@ public class Building extends NamedStats implements IConstruction, ICivilopedia
!civInfo.getCivResources().keySet().contains(GameBasics.TileResources.get(requiredResource)))
return false; // Only checks if exists, doesn't check amount - todo
if(requiredNearbyImprovedResources!=null) {
boolean containsResourceWithImprovement = construction.getCity().getTilesInRange()
.any(new Predicate<TileInfo>() {
@Override
public boolean evaluate(TileInfo tile) {
return tile.resource != null
&& requiredNearbyImprovedResources.contains(tile.resource)
&& tile.getTileResource().improvement.equals(tile.improvement);
}
});
if(!containsResourceWithImprovement) return false;
}
if("SpaceshipPart".equals(unique)){
if(!civInfo.getBuildingUniques().contains("ApolloProgram")) return false;
if(civInfo.scienceVictory.requiredParts.get(name)==0) return false; // Don't need to build any more of these!

View File

@ -2,12 +2,12 @@ package com.unciv.models.gamebasics;
import java.util.ArrayList;
public class TechColumn
{
public int columnNumber;
public GameBasics gameBasics;
public ArrayList<Technology> techs = new ArrayList<Technology>();
public int techCost;
public int buildingCost;
public int wonderCost;
public class TechColumn {
public int columnNumber;
public String era;
public GameBasics gameBasics;
public ArrayList<Technology> techs = new ArrayList<Technology>();
public int techCost;
public int buildingCost;
public int wonderCost;
}