mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-22 02:42:16 -04:00
Fixed bugs
This commit is contained in:
parent
367f294774
commit
39ea64b870
@ -23,7 +23,6 @@ public class CityConstructions
|
||||
public CityConstructions(CityInfo cityInfo)
|
||||
{
|
||||
cityLocation = cityInfo.cityLocation;
|
||||
chooseNextConstruction();
|
||||
}
|
||||
|
||||
public LinqCollection<String> builtBuildings = new LinqCollection<String>();
|
||||
@ -84,7 +83,7 @@ public class CityConstructions
|
||||
|
||||
}
|
||||
|
||||
private void chooseNextConstruction() {
|
||||
void chooseNextConstruction() {
|
||||
currentConstruction = getBuildableBuildings().first(new Predicate<String>() {
|
||||
@Override
|
||||
public boolean evaluate(String arg0) {
|
||||
|
@ -57,12 +57,12 @@ public class CityInfo {
|
||||
CityInfo(CivilizationInfo civInfo, Vector2 cityLocation) {
|
||||
name = CityNames[civInfo.cities.size()];
|
||||
this.cityLocation = cityLocation;
|
||||
civInfo.cities.add(this);
|
||||
cityConstructions = new CityConstructions(this);
|
||||
if(civInfo.cities.size()==0) {
|
||||
cityConstructions.builtBuildings.add("Palace");
|
||||
cityConstructions.currentConstruction = "Worker"; // Default for first city only!
|
||||
}
|
||||
civInfo.cities.add(this);
|
||||
|
||||
for(TileInfo tileInfo : civInfo.tileMap.getTilesInDistance(cityLocation,1)) {
|
||||
tileInfo.owner = civInfo.civName;
|
||||
@ -194,8 +194,8 @@ public class CityInfo {
|
||||
statPercentBonuses.science+=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")) {
|
||||
if("Gold".equals(cityConstructions.currentConstruction)) stats.gold+=stats.production/4;
|
||||
if("Science".equals(cityConstructions.currentConstruction)) {
|
||||
float scienceProduced=stats.production/4;
|
||||
if (civInfo.getBuildingUniques().contains("ScienceConversionIncrease"))
|
||||
scienceProduced*=1.33;
|
||||
|
@ -52,7 +52,8 @@ public class CivilizationInfo {
|
||||
}
|
||||
|
||||
public void addCity(Vector2 location){
|
||||
new CityInfo(this,location);
|
||||
CityInfo newCity = new CityInfo(this,location);
|
||||
newCity.cityConstructions.chooseNextConstruction();
|
||||
}
|
||||
|
||||
public CityInfo getCapital(){
|
||||
@ -151,11 +152,13 @@ public class CivilizationInfo {
|
||||
|
||||
int transportationUpkeep = 0;
|
||||
for(TileInfo tile : tileMap.values()) {
|
||||
if(tile.isCityCenter()) continue;
|
||||
if (tile.roadStatus == RoadStatus.Road) transportationUpkeep+=1;
|
||||
else if(tile.roadStatus == RoadStatus.Railroad) transportationUpkeep+=2;
|
||||
}
|
||||
if(policies.contains("Trade Unions")) transportationUpkeep *= 2/3f;
|
||||
statsForTurn.gold -=transportationUpkeep;
|
||||
|
||||
if(policies.contains("Mandate Of Heaven"))
|
||||
statsForTurn.culture+=getHappinessForNextTurn()/2;
|
||||
return statsForTurn;
|
||||
|
@ -96,7 +96,7 @@ public class CityScreen extends CameraStageBaseScreen {
|
||||
|
||||
private Image getSpecialistIcon(String imageName, final boolean isFilled, final FullStats specialistType) {
|
||||
Image specialist = ImageGetter.getImage(imageName);
|
||||
specialist.setSize(20,20);
|
||||
specialist.setSize(30,30);
|
||||
if(!isFilled) specialist.setColor(Color.GRAY);
|
||||
specialist.addListener(new ClickListener(){
|
||||
@Override
|
||||
|
@ -261,10 +261,11 @@ public class WorldScreen extends CameraStageBaseScreen {
|
||||
Label happinessLabel = new Label(happinessText, skin);
|
||||
happinessLabel.setAlignment(Align.center);
|
||||
civTable.add(happinessLabel);
|
||||
String cultureString = "Culture: " + Math.round(currentStats.culture) + "(+" + Math.round(nextTurnStats.culture) +")\r\n"
|
||||
String cultureString = "Culture: " + "+" + Math.round(nextTurnStats.culture) +"\r\n"
|
||||
+"("+ ((int) game.civInfo.civStats.culture)+"/"+game.civInfo.getCultureNeededForNextPolicy()+")";
|
||||
|
||||
civTable.add(new Label(cultureString, skin));
|
||||
Label cultureLabel = new Label(cultureString, skin);
|
||||
cultureLabel.setAlignment(Align.center);
|
||||
civTable.add(cultureLabel);
|
||||
|
||||
civTable.pack();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user