mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-22 10:54:19 -04:00
Split buildings and units to 2 separate files and types - both are now IConstruction, and cityBuildings has been changed to cityConstructions will all that entails
This commit is contained in:
parent
f30ade602d
commit
98dbe3b844
@ -1,19 +1,5 @@
|
|||||||
[
|
[
|
||||||
|
|
||||||
{
|
|
||||||
name:"Worker",
|
|
||||||
description: "Can build improvements on tiles",
|
|
||||||
hurryCostModifier:20
|
|
||||||
cost:60
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name:"Settler",
|
|
||||||
description: "Founds a new city",
|
|
||||||
cost:106,
|
|
||||||
hurryCostModifier:20
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
name:"Palace",
|
name:"Palace",
|
||||||
description: "Indicates that this city is the capital",
|
description: "Indicates that this city is the capital",
|
||||||
@ -52,6 +38,25 @@
|
|||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
requiredTech:"Calendar"
|
requiredTech:"Calendar"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Stonehenge",
|
||||||
|
description: "",
|
||||||
|
culture:6,
|
||||||
|
isWonder:true,
|
||||||
|
greatPersonPoints:{production:1},
|
||||||
|
requiredTech:"Calendar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"The Great Library",
|
||||||
|
description: "Provides a free technology, and a library in the city it is built in",
|
||||||
|
science:3,
|
||||||
|
culture:1,
|
||||||
|
greatPersonPoints:{science:1},
|
||||||
|
isWonder:true,
|
||||||
|
providesFreeBuilding: "Library",
|
||||||
|
freeTechs:1,
|
||||||
|
requiredTech:"Writing"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
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.",
|
||||||
@ -69,27 +74,26 @@
|
|||||||
requiredTech:"Trapping"
|
requiredTech:"Trapping"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Great Library",
|
name:"The Pyramids",
|
||||||
description: "Provides a free technology, and a library in the city it is built in",
|
description: "Worker construction increased 25%, provides 2 free workers",
|
||||||
science:3,
|
|
||||||
culture:1,
|
culture:1,
|
||||||
|
greatPersonPoints:{production:1},
|
||||||
isWonder:true,
|
isWonder:true,
|
||||||
providesFreeBuilding: "Library",
|
unique:"WorkerConstruction",
|
||||||
freeTechs:1,
|
|
||||||
requiredTech:"Writing"
|
requiredTech:"Writing"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:"Temple",
|
name:"Temple",
|
||||||
description: "",
|
description: "",
|
||||||
culture:3,
|
culture:3,
|
||||||
|
specialistSlots:{culture:1},
|
||||||
requiredBuilding:"Monument",
|
requiredBuilding:"Monument",
|
||||||
maintainance:2,
|
maintainance:2,
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
requiredTech:"Philosophy"
|
requiredTech:"Philosophy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Oracle",
|
name:"The Oracle",
|
||||||
description: "Provides a free social policy - todo",
|
description: "Provides a free social policy - todo",
|
||||||
culture:3,
|
culture:3,
|
||||||
isWonder:true,
|
isWonder:true,
|
||||||
@ -143,10 +147,20 @@
|
|||||||
name:"Market",
|
name:"Market",
|
||||||
description: "",
|
description: "",
|
||||||
gold:2,
|
gold:2,
|
||||||
|
specialistSlots:{gold:1},
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
percentStatBonus:{gold:25},
|
percentStatBonus:{gold:25},
|
||||||
requiredTech:"Currency"
|
requiredTech:"Currency"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Monastery",
|
||||||
|
description: "",
|
||||||
|
maintainance:0,
|
||||||
|
requiredNearbyImprovedResources:["Wine","Incense"],
|
||||||
|
resourceBonusStats:{culture:2},
|
||||||
|
hurryCostModifier:25,
|
||||||
|
requiredTech:"Theology"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Notre Dame",
|
name:"Notre Dame",
|
||||||
description: "",
|
description: "",
|
||||||
@ -185,7 +199,6 @@
|
|||||||
name:"Aqueduct",
|
name:"Aqueduct",
|
||||||
description: "40% of food is carried over after a new citizen is born",
|
description: "40% of food is carried over after a new citizen is born",
|
||||||
maintainance:1,
|
maintainance:1,
|
||||||
food:2,
|
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
unique:"FoodCarriesOver"
|
unique:"FoodCarriesOver"
|
||||||
requiredTech:"Engineering"
|
requiredTech:"Engineering"
|
||||||
@ -195,6 +208,7 @@
|
|||||||
description: "",
|
description: "",
|
||||||
maintainance:2,
|
maintainance:2,
|
||||||
production:2,
|
production:2,
|
||||||
|
specialistSlots:{production:1},
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
percentStatBonus:{production:15},
|
percentStatBonus:{production:15},
|
||||||
requiredTech:"Metal Casting"
|
requiredTech:"Metal Casting"
|
||||||
@ -214,6 +228,7 @@
|
|||||||
maintainance:2,
|
maintainance:2,
|
||||||
hurryCostModifier:15,
|
hurryCostModifier:15,
|
||||||
percentStatBonus:{science:33},
|
percentStatBonus:{science:33},
|
||||||
|
specialistSlots:{science:2},
|
||||||
requiredBuilding:"Library",
|
requiredBuilding:"Library",
|
||||||
unique:"JunglesProvideScience",
|
unique:"JunglesProvideScience",
|
||||||
requiredTech:"Education"
|
requiredTech:"Education"
|
||||||
@ -259,6 +274,7 @@
|
|||||||
name:"Opera House",
|
name:"Opera House",
|
||||||
description: "",
|
description: "",
|
||||||
culture:4,
|
culture:4,
|
||||||
|
specialistSlots:{culture:1},
|
||||||
hurryCostModifier:10,
|
hurryCostModifier:10,
|
||||||
requiredBuilding:"Temple",
|
requiredBuilding:"Temple",
|
||||||
maintainance:2,
|
maintainance:2,
|
||||||
@ -276,11 +292,20 @@
|
|||||||
name:"Bank",
|
name:"Bank",
|
||||||
description: "",
|
description: "",
|
||||||
gold:2,
|
gold:2,
|
||||||
|
specialistSlots:{gold:1},
|
||||||
hurryCostModifier:15,
|
hurryCostModifier:15,
|
||||||
percentStatBonus:{gold:25},
|
percentStatBonus:{gold:25},
|
||||||
requiredBuilding:"Market",
|
requiredBuilding:"Market",
|
||||||
requiredTech:"Banking"
|
requiredTech:"Banking"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Forbidden Palace",
|
||||||
|
description: "Unhappiness from population decreased by 10%",
|
||||||
|
culture:1,
|
||||||
|
isWonder:true,
|
||||||
|
unique:"CitizenUnhappinessDecreased",
|
||||||
|
requiredTech:"Banking"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Theatre",
|
name:"Theatre",
|
||||||
description: "",
|
description: "",
|
||||||
@ -288,7 +313,7 @@
|
|||||||
hurryCostModifier:10,
|
hurryCostModifier:10,
|
||||||
maintainance:2,
|
maintainance:2,
|
||||||
requiredBuilding:"Colloseum",
|
requiredBuilding:"Colloseum",
|
||||||
requiredTech:"Banking"
|
requiredTech:"Printing Press"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Taj Mahal",
|
name:"Taj Mahal",
|
||||||
@ -303,6 +328,7 @@
|
|||||||
name:"Windmill",
|
name:"Windmill",
|
||||||
description: "",
|
description: "",
|
||||||
production:2,
|
production:2,
|
||||||
|
specialistSlots:{production:1},
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
maintainance:2,
|
maintainance:2,
|
||||||
percentStatBonus:{production:10},
|
percentStatBonus:{production:10},
|
||||||
@ -312,6 +338,7 @@
|
|||||||
name:"Museum",
|
name:"Museum",
|
||||||
description: "",
|
description: "",
|
||||||
culture:5,
|
culture:5,
|
||||||
|
specialistSlots:{culture:1},
|
||||||
requiredBuilding:"Opera House",
|
requiredBuilding:"Opera House",
|
||||||
maintainance:3,
|
maintainance:3,
|
||||||
hurryCostModifier:0,
|
hurryCostModifier:0,
|
||||||
@ -358,6 +385,8 @@
|
|||||||
name:"Factory",
|
name:"Factory",
|
||||||
description: "",
|
description: "",
|
||||||
production:4,
|
production:4,
|
||||||
|
percentStatBonus:{production:10},
|
||||||
|
specialistSlots:{production:1},
|
||||||
requiredBuilding:"Workshop",
|
requiredBuilding:"Workshop",
|
||||||
maintainance:3,
|
maintainance:3,
|
||||||
hurryCostModifier:0,
|
hurryCostModifier:0,
|
||||||
@ -369,6 +398,7 @@
|
|||||||
description: "",
|
description: "",
|
||||||
gold:3,
|
gold:3,
|
||||||
percentStatBonus:{gold:25},
|
percentStatBonus:{gold:25},
|
||||||
|
specialistSlots:{gold:2},
|
||||||
hurryCostModifier:15,
|
hurryCostModifier:15,
|
||||||
requiredBuilding:"Bank",
|
requiredBuilding:"Bank",
|
||||||
requiredTech:"Electricity"
|
requiredTech:"Electricity"
|
||||||
@ -382,7 +412,7 @@
|
|||||||
requiredTech:"Telegraph"
|
requiredTech:"Telegraph"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Broadcst Tower",
|
name:"Broadcast Tower",
|
||||||
description: "",
|
description: "",
|
||||||
culture:3,
|
culture:3,
|
||||||
percentStatBonus:{culture:33},
|
percentStatBonus:{culture:33},
|
||||||
@ -411,6 +441,7 @@
|
|||||||
description: "",
|
description: "",
|
||||||
science:4,
|
science:4,
|
||||||
percentStatBonus:{science:50},
|
percentStatBonus:{science:50},
|
||||||
|
specialistSlots:{science:1},
|
||||||
requiredBuilding:"Public School",
|
requiredBuilding:"Public School",
|
||||||
maintainance:3,
|
maintainance:3,
|
||||||
requiredTech:"Plastics"
|
requiredTech:"Plastics"
|
||||||
|
239
android/assets/jsons/Policies.json
Normal file
239
android/assets/jsons/Policies.json
Normal file
@ -0,0 +1,239 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
name:"Tradition",
|
||||||
|
description:"+3 culture in capital and increased rate of border expansion",
|
||||||
|
policies:[
|
||||||
|
{
|
||||||
|
name:"Aristocracy",
|
||||||
|
description:"+15% production when constructing wonders, +1 happiness for every 10 citizens in a city",
|
||||||
|
row;1,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Legalism",
|
||||||
|
description:"Free culture building in your first 4 cities",
|
||||||
|
row;1,
|
||||||
|
column:3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Oligarchy",
|
||||||
|
description:"Improves garrisons in cities - useless at this time",
|
||||||
|
row;1,
|
||||||
|
column:5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Landed Elite",
|
||||||
|
description:"+10% food growth and +2 food in capital",
|
||||||
|
requires:["Legalism"]
|
||||||
|
row;2,
|
||||||
|
column:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Monarchy",
|
||||||
|
description:"+1 gold and -1 unhappiness for every 2 citizens in capital",
|
||||||
|
requires:["Legalism"]
|
||||||
|
row;2,
|
||||||
|
column:4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Finisher",
|
||||||
|
description:"+15% growth and +2 food in all cities"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
name:"Liberty",
|
||||||
|
description:"+1 culture in evey city",
|
||||||
|
policies:[
|
||||||
|
{
|
||||||
|
name:"Collective Rule",
|
||||||
|
description:"Training of settlers increaed +50% in capital, recieve a new settler near capital",
|
||||||
|
row;1,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Citizenship",
|
||||||
|
description:"+25% construction rate of workers, recieve free worker near the capital",
|
||||||
|
row;1,
|
||||||
|
column:4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Republic",
|
||||||
|
description:"+1 construction in every city, +5% construction when constructing buildings",
|
||||||
|
requires:["Collective Rule"],
|
||||||
|
row;1,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Representation",
|
||||||
|
description:"Each city founded increases ulture cost of policies 33% less than normal. Starts a golden age.",
|
||||||
|
requires:["Citizenship"]
|
||||||
|
row;2,
|
||||||
|
column:3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Meritocracy",
|
||||||
|
description:"+1 happiness for every city connected to capital, -5% unhappiness from citizens",
|
||||||
|
requires:["Citizenship"]
|
||||||
|
row;2,
|
||||||
|
column:5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Finisher",
|
||||||
|
description:"Free Great Person of choice near capital - TODO"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
name:"Piety",
|
||||||
|
description:"Building time of culture buildings reduced by 15%",
|
||||||
|
policies:[
|
||||||
|
{
|
||||||
|
name:"Organized Religion",
|
||||||
|
description:"+1 happiness for each monument, temple and monastery",
|
||||||
|
row;1,
|
||||||
|
column:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Mandate Of Heaven",
|
||||||
|
description:"50% of excess happiness added to culture towards policies",
|
||||||
|
row;1,
|
||||||
|
column:5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Theocracy",
|
||||||
|
description:"Temples give +10% gold",
|
||||||
|
requires:["Organized Religion"],
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Reformation",
|
||||||
|
description:"+33% culture in all cities with a world wonder, immediately enter a golden age",
|
||||||
|
requires:["Organized Religion"]
|
||||||
|
row;2,
|
||||||
|
column:3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Free Religion",
|
||||||
|
description:"+1 culture for each monument, temple and monastery. Gain a free policy.",
|
||||||
|
requires:["Mandate of Heaven","Reformation"]
|
||||||
|
row;3,
|
||||||
|
column:4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Finisher",
|
||||||
|
description:"Reduce culture cost of future policies by 10%"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
name:"Commerce",
|
||||||
|
description:"+25% gold in capital",
|
||||||
|
policies:[
|
||||||
|
{
|
||||||
|
name:"Trade Unions",
|
||||||
|
description:"Maintainance on roads & railroads reduced by 33%, harbors+seaport +1 gold",
|
||||||
|
row;1,
|
||||||
|
column:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Mercantilism",
|
||||||
|
description:"-25% to purchasing items in cities",
|
||||||
|
row;1,
|
||||||
|
column:5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Protectionism",
|
||||||
|
description:"+1 from each luxury resource",
|
||||||
|
requires:["Organized Religion"],
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Finisher",
|
||||||
|
description:"+1 gold from each specialist"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
name:"Rationalism",
|
||||||
|
description:"+50% science from research agreements (??? maybe replace with `research projects`?)",
|
||||||
|
policies:[
|
||||||
|
{
|
||||||
|
name:"Secularism",
|
||||||
|
description:"+2 science from every specialist",
|
||||||
|
row;1,
|
||||||
|
column:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Humanism",
|
||||||
|
description:"+1 happiness from every university, observtory and public school",
|
||||||
|
row;1,
|
||||||
|
column:5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Free Thought",
|
||||||
|
description:"+1 science from every trading post, +17% science from universities",
|
||||||
|
requires:["Secularism"],
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Soveregnity",
|
||||||
|
description:"+15% science while empire is happy",
|
||||||
|
requires:["Humanism"],
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Scientific Revolution",
|
||||||
|
description:"Gain 2 free technologies",
|
||||||
|
requires:["Free Thought"],
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Finisher",
|
||||||
|
description:"+1 gold from all science buildings"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
name:"Freedon",
|
||||||
|
description:"+25% great people rate",
|
||||||
|
policies:[
|
||||||
|
{
|
||||||
|
name:"Constitution",
|
||||||
|
description:"+2 culture from each wonder",
|
||||||
|
row;1,
|
||||||
|
column:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Universal Sufferage",
|
||||||
|
description:"+33% city defence???",
|
||||||
|
row;1,
|
||||||
|
column:5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Civil Society",
|
||||||
|
description:"-50% food consumption by specialists",
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Free Speech",
|
||||||
|
description:"8 units are maintainance free",
|
||||||
|
requires:["Constitution"],
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Democracy",
|
||||||
|
description:"Specialists produce half normal unhappiness",
|
||||||
|
requires:["Civil Society"],
|
||||||
|
row;2,
|
||||||
|
column:1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Finisher",
|
||||||
|
description:"+1 gold from all science buildings"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
@ -376,7 +376,7 @@
|
|||||||
name:"Telegraph",
|
name:"Telegraph",
|
||||||
row:4,
|
row:4,
|
||||||
prerequisites:["Electricity"],
|
prerequisites:["Electricity"],
|
||||||
description:"Allows construction of the Crito Redentor, reducing cost of new policie"
|
description:"Allows construction of the Crito Redentor, reducing cost of new policies"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Radio",
|
name:"Radio",
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
name:"Marsh",
|
name:"Marsh",
|
||||||
type:"TerrainFeature",
|
type:"TerrainFeature",
|
||||||
food:-1,
|
food:-1,
|
||||||
movementCost:2,
|
movementCost:3,
|
||||||
unbuildable:true,
|
unbuildable:true,
|
||||||
occursOn:["Grassland"]
|
occursOn:["Grassland"]
|
||||||
},
|
},
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
name:"Farm",
|
name:"Farm",
|
||||||
terrainsCanBeBuiltOn:["Plains","Grassland","Desert","Flood plains"],
|
terrainsCanBeBuiltOn:["Plains","Grassland","Desert","Flood plains"],
|
||||||
food:1,
|
food:1,
|
||||||
turnsToBuild:6,
|
turnsToBuild:7,
|
||||||
improvingTech:"Fertilizer",
|
improvingTech:"Fertilizer",
|
||||||
improvingTechStats:{food:1}
|
improvingTechStats:{food:1}
|
||||||
},
|
},
|
||||||
@ -11,7 +11,7 @@
|
|||||||
name:"Lumber mill",
|
name:"Lumber mill",
|
||||||
terrainsCanBeBuiltOn:["Forest"],
|
terrainsCanBeBuiltOn:["Forest"],
|
||||||
production:1,
|
production:1,
|
||||||
turnsToBuild:6,
|
turnsToBuild:7,
|
||||||
techRequired:"Construction",
|
techRequired:"Construction",
|
||||||
improvingTech:"Scientific Theory",
|
improvingTech:"Scientific Theory",
|
||||||
improvingTechStats:{production:1}
|
improvingTechStats:{production:1}
|
||||||
@ -20,7 +20,7 @@
|
|||||||
name:"Mine",
|
name:"Mine",
|
||||||
terrainsCanBeBuiltOn:["Hill"],
|
terrainsCanBeBuiltOn:["Hill"],
|
||||||
production:1,
|
production:1,
|
||||||
turnsToBuild:6,
|
turnsToBuild:7,
|
||||||
techRequired:"Mining",
|
techRequired:"Mining",
|
||||||
improvingTech:"Chemistry",
|
improvingTech:"Chemistry",
|
||||||
improvingTechStats:{production:1}
|
improvingTechStats:{production:1}
|
||||||
@ -29,26 +29,26 @@
|
|||||||
name:"Trading post",
|
name:"Trading post",
|
||||||
terrainsCanBeBuiltOn:["Plains","Grassland","Desert","Hill","Tundra","Forest","Jungle","Flood plains"],
|
terrainsCanBeBuiltOn:["Plains","Grassland","Desert","Hill","Tundra","Forest","Jungle","Flood plains"],
|
||||||
gold:1,
|
gold:1,
|
||||||
turnsToBuild:6,
|
turnsToBuild:7,
|
||||||
techRequired:"Trapping",
|
techRequired:"Trapping",
|
||||||
improvingTech:"Economics",
|
improvingTech:"Economics",
|
||||||
improvingTechStats: {gold:1}
|
improvingTechStats: {gold:1}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Camp",
|
name:"Camp",
|
||||||
turnsToBuild:6,
|
turnsToBuild:7,
|
||||||
techRequired:"Trapping",
|
techRequired:"Trapping",
|
||||||
improvingTech:"Economics",
|
improvingTech:"Economics",
|
||||||
improvingTechStats:{gold:1}
|
improvingTechStats:{gold:1}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Oil well",
|
name:"Oil well",
|
||||||
turnsToBuild:6,
|
turnsToBuild:9,
|
||||||
techRequired:"Biology",
|
techRequired:"Biology",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Pasture",
|
name:"Pasture",
|
||||||
turnsToBuild:6,
|
turnsToBuild:8,
|
||||||
techRequired:"Animal Husbandry",
|
techRequired:"Animal Husbandry",
|
||||||
improvingTech:"Fertilizer",
|
improvingTech:"Fertilizer",
|
||||||
improvingTechStats:{food:1}
|
improvingTechStats:{food:1}
|
||||||
@ -63,31 +63,31 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Quarry",
|
name:"Quarry",
|
||||||
turnsToBuild:6,
|
turnsToBuild:8,
|
||||||
techRequired:"Masonry",
|
techRequired:"Masonry",
|
||||||
improvingTech:"Chemistry",
|
improvingTech:"Chemistry",
|
||||||
improvingTechStats:{production:1}
|
improvingTechStats:{production:1}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Road",
|
name:"Road",
|
||||||
turnsToBuild:6,
|
turnsToBuild:4,
|
||||||
techRequired:"The Wheel"
|
techRequired:"The Wheel"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Railroad",
|
name:"Railroad",
|
||||||
turnsToBuild:12,
|
turnsToBuild:4,
|
||||||
techRequired:"Railroad"
|
techRequired:"Railroad"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:"Remove Forest",
|
name:"Remove Forest",
|
||||||
turnsToBuild:6,
|
turnsToBuild:4,
|
||||||
terrainsCanBeBuiltOn:["Forest"],
|
terrainsCanBeBuiltOn:["Forest"],
|
||||||
techRequired:"Mining"
|
techRequired:"Mining"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Remove Jungle",
|
name:"Remove Jungle",
|
||||||
turnsToBuild:6,
|
turnsToBuild:7,
|
||||||
terrainsCanBeBuiltOn:["Jungle"],
|
terrainsCanBeBuiltOn:["Jungle"],
|
||||||
techRequired:"Bronze Working"
|
techRequired:"Bronze Working"
|
||||||
},
|
},
|
||||||
@ -97,4 +97,28 @@
|
|||||||
terrainsCanBeBuiltOn:["Marsh"],
|
terrainsCanBeBuiltOn:["Marsh"],
|
||||||
techRequired:"Masonry"
|
techRequired:"Masonry"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
name:"Academy",
|
||||||
|
science:8,
|
||||||
|
improvingTech:"Scientific Theory",
|
||||||
|
improvingTechStats:{science:2}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Landmark",
|
||||||
|
culture:6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Manufactory",
|
||||||
|
production:4,
|
||||||
|
improvingTech:"Chemistry",
|
||||||
|
improvingTechStats:{production:1}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Customs House",
|
||||||
|
gold:4,
|
||||||
|
improvingTech:"Economics",
|
||||||
|
improvingTechStats:{gold:1}
|
||||||
|
}
|
||||||
]
|
]
|
@ -59,7 +59,7 @@
|
|||||||
name:"Horses",
|
name:"Horses",
|
||||||
resourceType:"Strategic",
|
resourceType:"Strategic",
|
||||||
revealedBy:"Animal Husbandry",
|
revealedBy:"Animal Husbandry",
|
||||||
terrainsCanBeFoundOn:["Plains","Desert"],
|
terrainsCanBeFoundOn:["Plains","Grassland","Hill","Desert"],
|
||||||
production:1,
|
production:1,
|
||||||
improvement:"Pasture",
|
improvement:"Pasture",
|
||||||
improvementStats:{production:1},
|
improvementStats:{production:1},
|
||||||
@ -78,7 +78,7 @@
|
|||||||
{
|
{
|
||||||
name:"Coal",
|
name:"Coal",
|
||||||
resourceType:"Strategic",
|
resourceType:"Strategic",
|
||||||
revealedBy:"Industrialization",
|
revealedBy:"Scientific Theory",
|
||||||
terrainsCanBeFoundOn:["Grassland","Plains","Hill"],
|
terrainsCanBeFoundOn:["Grassland","Plains","Hill"],
|
||||||
production:1,
|
production:1,
|
||||||
improvement:"Mine",
|
improvement:"Mine",
|
||||||
@ -88,7 +88,7 @@
|
|||||||
name:"Oil",
|
name:"Oil",
|
||||||
resourceType:"Strategic",
|
resourceType:"Strategic",
|
||||||
revealedBy:"Biology",
|
revealedBy:"Biology",
|
||||||
terrainsCanBeFoundOn:["Desert","Coast","Tundra","Snow","Marsh"],
|
terrainsCanBeFoundOn:["Desert","Coast","Tundra","Snow","Marsh","Jungle"],
|
||||||
production:1,
|
production:1,
|
||||||
improvement:"Oil well",
|
improvement:"Oil well",
|
||||||
improvementStats:{production:3}
|
improvementStats:{production:3}
|
||||||
@ -106,7 +106,7 @@
|
|||||||
name:"Uranium",
|
name:"Uranium",
|
||||||
resourceType:"Strategic",
|
resourceType:"Strategic",
|
||||||
revealedBy:"Atomic Theory",
|
revealedBy:"Atomic Theory",
|
||||||
terrainsCanBeFoundOn:["Plains","Desert","Tundra","Hill","Snow"],
|
terrainsCanBeFoundOn:["Plains","Desert","Tundra","Hill","Snow","Forest","Desert","Marsh","Grassland"],
|
||||||
production:1,
|
production:1,
|
||||||
improvement:"Mine",
|
improvement:"Mine",
|
||||||
improvementStats:{production:2}
|
improvementStats:{production:2}
|
||||||
@ -129,6 +129,62 @@
|
|||||||
improvement:"Plantation",
|
improvement:"Plantation",
|
||||||
improvementStats:{gold:1}
|
improvementStats:{gold:1}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Dyes",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Jungle","Forest"],
|
||||||
|
gold:2,
|
||||||
|
improvement:"Plantation",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Gems",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Jungle","Grassland","Plains","Desert","Tundra","Hill"],
|
||||||
|
gold:3,
|
||||||
|
improvement:"Mine",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Gold",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Grassland","Plains","Desert","Hill"],
|
||||||
|
gold:2,
|
||||||
|
improvement:"Mine",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Silver",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Desert","Tundra","Hill"],
|
||||||
|
gold:2,
|
||||||
|
improvement:"Mine",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Incense",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Plains","Desert"],
|
||||||
|
gold:3,
|
||||||
|
improvement:"Plantation",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Ivory",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Plains"],
|
||||||
|
gold:2,
|
||||||
|
improvement:"Camp",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Silk",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Forest"],
|
||||||
|
gold:2,
|
||||||
|
improvement:"Plantation",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Spices",
|
name:"Spices",
|
||||||
resourceType:"Luxury",
|
resourceType:"Luxury",
|
||||||
@ -137,6 +193,14 @@
|
|||||||
improvement:"Plantation",
|
improvement:"Plantation",
|
||||||
improvementStats:{gold:1}
|
improvementStats:{gold:1}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Wine",
|
||||||
|
resourceType:"Luxury",
|
||||||
|
terrainsCanBeFoundOn:["Grassland","Plains"],
|
||||||
|
gold:2,
|
||||||
|
improvement:"Plantation",
|
||||||
|
improvementStats:{gold:1}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Sugar",
|
name:"Sugar",
|
||||||
resourceType:"Luxury",
|
resourceType:"Luxury",
|
||||||
|
41
android/assets/jsons/Units.json
Normal file
41
android/assets/jsons/Units.json
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
name:"Worker",
|
||||||
|
description: "Can build improvements on tiles",
|
||||||
|
movement:2,
|
||||||
|
hurryCostModifier:20,
|
||||||
|
cost:60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Settler",
|
||||||
|
description: "Founds a new city",
|
||||||
|
movement:2,
|
||||||
|
cost:106,
|
||||||
|
hurryCostModifier:20
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Great Artist",
|
||||||
|
description: "Can start an 8-turn golden age or construcct a landmark (+5 culture)",
|
||||||
|
unbuildable:true,
|
||||||
|
movement:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Great Scientist",
|
||||||
|
description: "Can discover a technology, or construct an academy (+4 science(",
|
||||||
|
unbuildable:true,
|
||||||
|
movement:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Great Merchant",
|
||||||
|
description: "Can undertake a trade mission, giving a large sum of gold, or construct a ?",
|
||||||
|
unbuildable:true,
|
||||||
|
movement:2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:"Great Engineer",
|
||||||
|
description: "Can speed up construction of a wonder, or construct a refinery, giving +? production?",
|
||||||
|
unbuildable:true,
|
||||||
|
movement:2
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
@ -49,6 +49,11 @@ public class CityConstructions
|
|||||||
}
|
}
|
||||||
}); }
|
}); }
|
||||||
|
|
||||||
|
public void addConstruction(int constructionToAdd){
|
||||||
|
if (!inProgressConstructions.containsKey(currentConstruction)) inProgressConstructions.put(currentConstruction, 0);
|
||||||
|
inProgressConstructions.put(currentConstruction, inProgressConstructions.get(currentConstruction) + constructionToAdd);
|
||||||
|
}
|
||||||
|
|
||||||
public void nextTurn(FullStats cityStats)
|
public void nextTurn(FullStats cityStats)
|
||||||
{
|
{
|
||||||
if (getCurrentConstruction()==null) return;
|
if (getCurrentConstruction()==null) return;
|
||||||
@ -66,9 +71,7 @@ public class CityConstructions
|
|||||||
}
|
}
|
||||||
else currentConstruction = saveCurrentConstruction;
|
else currentConstruction = saveCurrentConstruction;
|
||||||
|
|
||||||
if (!inProgressConstructions.containsKey(currentConstruction)) inProgressConstructions.put(currentConstruction, 0);
|
addConstruction(Math.round(cityStats.production));
|
||||||
inProgressConstructions.put(currentConstruction, inProgressConstructions.get(currentConstruction) + Math.round(cityStats.production));
|
|
||||||
|
|
||||||
if (inProgressConstructions.get(currentConstruction) >= construction.getProductionCost())
|
if (inProgressConstructions.get(currentConstruction) >= construction.getProductionCost())
|
||||||
{
|
{
|
||||||
construction.postBuildEvent(this);
|
construction.postBuildEvent(this);
|
||||||
|
@ -24,6 +24,7 @@ public class CivilizationInfo {
|
|||||||
public int baseHappiness = 15;
|
public int baseHappiness = 15;
|
||||||
public int numberOfGoldenAges=0;
|
public int numberOfGoldenAges=0;
|
||||||
public int turnsLeftForCurrentGoldenAge=0;
|
public int turnsLeftForCurrentGoldenAge=0;
|
||||||
|
public int pointsForNextGreatPerson=100;
|
||||||
public String civName = "Babylon";
|
public String civName = "Babylon";
|
||||||
|
|
||||||
public FullStats greatPersonPoints = new FullStats();
|
public FullStats greatPersonPoints = new FullStats();
|
||||||
@ -88,15 +89,16 @@ public class CivilizationInfo {
|
|||||||
if(isGoldenAge()) turnsLeftForCurrentGoldenAge--;
|
if(isGoldenAge()) turnsLeftForCurrentGoldenAge--;
|
||||||
|
|
||||||
if(civStats.happiness > happinessRequiredForNextGoldenAge()){
|
if(civStats.happiness > happinessRequiredForNextGoldenAge()){
|
||||||
|
civStats.happiness-=happinessRequiredForNextGoldenAge();
|
||||||
enterGoldenAge();
|
enterGoldenAge();
|
||||||
numberOfGoldenAges++;
|
numberOfGoldenAges++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enterGoldenAge(){
|
public void enterGoldenAge(){
|
||||||
civStats.happiness-=happinessRequiredForNextGoldenAge();
|
int turnsToGoldenAge = 10;
|
||||||
turnsLeftForCurrentGoldenAge = 10;
|
if(getBuildingUniques().contains("GoldenAgeLengthIncrease")) turnsToGoldenAge*=1.5;
|
||||||
if(getBuildingUniques().contains("GoldenAgeLengthIncrease")) turnsLeftForCurrentGoldenAge*=1.5;
|
turnsLeftForCurrentGoldenAge += turnsToGoldenAge;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CivStats getStatsForNextTurn() {
|
public CivStats getStatsForNextTurn() {
|
||||||
|
@ -22,7 +22,7 @@ import com.badlogic.gdx.utils.Align;
|
|||||||
import com.unciv.civinfo.CityInfo;
|
import com.unciv.civinfo.CityInfo;
|
||||||
import com.unciv.civinfo.IConstruction;
|
import com.unciv.civinfo.IConstruction;
|
||||||
import com.unciv.civinfo.TileInfo;
|
import com.unciv.civinfo.TileInfo;
|
||||||
import com.unciv.game.pickerscreens.BuildingPickerScreen;
|
import com.unciv.game.pickerscreens.ConstructionPickerScreen;
|
||||||
import com.unciv.models.gamebasics.Building;
|
import com.unciv.models.gamebasics.Building;
|
||||||
import com.unciv.models.stats.FullStats;
|
import com.unciv.models.stats.FullStats;
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ public class CityScreen extends com.unciv.game.utils.CameraStageBaseScreen {
|
|||||||
buildingPickButton.addListener(new ClickListener(){
|
buildingPickButton.addListener(new ClickListener(){
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
game.setScreen(new BuildingPickerScreen(game));
|
game.setScreen(new ConstructionPickerScreen(game));
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -17,11 +17,14 @@ import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
|
|||||||
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
import com.badlogic.gdx.utils.Predicate;
|
import com.badlogic.gdx.utils.Predicate;
|
||||||
|
import com.unciv.civinfo.CityConstructions;
|
||||||
import com.unciv.civinfo.TileInfo;
|
import com.unciv.civinfo.TileInfo;
|
||||||
|
import com.unciv.civinfo.Unit;
|
||||||
import com.unciv.game.pickerscreens.ImprovementPickerScreen;
|
import com.unciv.game.pickerscreens.ImprovementPickerScreen;
|
||||||
import com.unciv.game.pickerscreens.TechPickerScreen;
|
import com.unciv.game.pickerscreens.TechPickerScreen;
|
||||||
import com.unciv.game.utils.*;
|
import com.unciv.game.utils.*;
|
||||||
import com.unciv.models.LinqHashMap;
|
import com.unciv.models.LinqHashMap;
|
||||||
|
import com.unciv.models.gamebasics.Building;
|
||||||
import com.unciv.models.gamebasics.GameBasics;
|
import com.unciv.models.gamebasics.GameBasics;
|
||||||
import com.unciv.models.gamebasics.TileImprovement;
|
import com.unciv.models.gamebasics.TileImprovement;
|
||||||
import com.unciv.models.stats.CivStats;
|
import com.unciv.models.stats.CivStats;
|
||||||
@ -38,7 +41,7 @@ public class WorldScreen extends com.unciv.game.utils.CameraStageBaseScreen {
|
|||||||
ScrollPane scrollPane;
|
ScrollPane scrollPane;
|
||||||
|
|
||||||
float buttonScale = game.settings.buttonScale;
|
float buttonScale = game.settings.buttonScale;
|
||||||
Table TileTable = new Table();
|
Table tileTable = new Table();
|
||||||
Table CivTable = new Table();
|
Table CivTable = new Table();
|
||||||
TextButton TechButton = new TextButton("",skin);
|
TextButton TechButton = new TextButton("",skin);
|
||||||
public LinqHashMap<String,WorldTileGroup> tileGroups = new LinqHashMap<String, WorldTileGroup>();
|
public LinqHashMap<String,WorldTileGroup> tileGroups = new LinqHashMap<String, WorldTileGroup>();
|
||||||
@ -52,13 +55,13 @@ public class WorldScreen extends com.unciv.game.utils.CameraStageBaseScreen {
|
|||||||
new Label("",skin).getStyle().font.getData().setScale(game.settings.labelScale);
|
new Label("",skin).getStyle().font.getData().setScale(game.settings.labelScale);
|
||||||
|
|
||||||
addTiles();
|
addTiles();
|
||||||
stage.addActor(TileTable);
|
stage.addActor(tileTable);
|
||||||
|
|
||||||
Drawable tileTableBackground = new TextureRegionDrawable(new TextureRegion(new Texture("skin/tileTableBackground.png")))
|
Drawable tileTableBackground = new TextureRegionDrawable(new TextureRegion(new Texture("skin/tileTableBackground.png")))
|
||||||
.tint(new Color(0x004085bf));
|
.tint(new Color(0x004085bf));
|
||||||
tileTableBackground.setMinHeight(0);
|
tileTableBackground.setMinHeight(0);
|
||||||
tileTableBackground.setMinWidth(0);
|
tileTableBackground.setMinWidth(0);
|
||||||
TileTable.setBackground(tileTableBackground);
|
tileTable.setBackground(tileTableBackground);
|
||||||
OptionsTable.setBackground(tileTableBackground);
|
OptionsTable.setBackground(tileTableBackground);
|
||||||
|
|
||||||
TextureRegionDrawable civBackground = new TextureRegionDrawable(new TextureRegion(new Texture("skin/civTableBackground.png")));
|
TextureRegionDrawable civBackground = new TextureRegionDrawable(new TextureRegion(new Texture("skin/civTableBackground.png")));
|
||||||
@ -315,18 +318,18 @@ public class WorldScreen extends com.unciv.game.utils.CameraStageBaseScreen {
|
|||||||
|
|
||||||
private void updateTileTable() {
|
private void updateTileTable() {
|
||||||
if(selectedTile == null) return;
|
if(selectedTile == null) return;
|
||||||
TileTable.clearChildren();
|
tileTable.clearChildren();
|
||||||
FullStats stats = selectedTile.getTileStats();
|
FullStats stats = selectedTile.getTileStats();
|
||||||
TileTable.pad(20);
|
tileTable.pad(20);
|
||||||
TileTable.columnDefaults(0).padRight(10);
|
tileTable.columnDefaults(0).padRight(10);
|
||||||
|
|
||||||
Label cityStatsHeader = new Label("Tile Stats",skin);
|
Label cityStatsHeader = new Label("Tile Stats",skin);
|
||||||
cityStatsHeader.setFontScale(2);
|
cityStatsHeader.setFontScale(2);
|
||||||
TileTable.add(cityStatsHeader).colspan(2).pad(10);
|
tileTable.add(cityStatsHeader).colspan(2).pad(10);
|
||||||
TileTable.row();
|
tileTable.row();
|
||||||
|
|
||||||
TileTable.add(new Label(selectedTile.toString(),skin)).colspan(2);
|
tileTable.add(new Label(selectedTile.toString(),skin)).colspan(2);
|
||||||
TileTable.row();
|
tileTable.row();
|
||||||
|
|
||||||
|
|
||||||
HashMap<String,Float> TileStatsValues = new HashMap<String, Float>();
|
HashMap<String,Float> TileStatsValues = new HashMap<String, Float>();
|
||||||
@ -338,9 +341,9 @@ public class WorldScreen extends com.unciv.game.utils.CameraStageBaseScreen {
|
|||||||
|
|
||||||
for(String key : TileStatsValues.keySet()){
|
for(String key : TileStatsValues.keySet()){
|
||||||
if(TileStatsValues.get(key) == 0) continue; // this tile gives nothing of this stat, so why even display it?
|
if(TileStatsValues.get(key) == 0) continue; // this tile gives nothing of this stat, so why even display it?
|
||||||
TileTable.add(com.unciv.game.utils.ImageGetter.getStatIcon(key)).align(Align.right);
|
tileTable.add(com.unciv.game.utils.ImageGetter.getStatIcon(key)).align(Align.right);
|
||||||
TileTable.add(new Label(Math.round(TileStatsValues.get(key))+"",skin)).align(Align.left);
|
tileTable.add(new Label(Math.round(TileStatsValues.get(key))+"",skin)).align(Align.left);
|
||||||
TileTable.row();
|
tileTable.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -371,69 +374,152 @@ public class WorldScreen extends com.unciv.game.utils.CameraStageBaseScreen {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
TileTable.add(moveUnitButton).colspan(2)
|
tileTable.add(moveUnitButton).colspan(2)
|
||||||
.size(moveUnitButton.getWidth() * buttonScale, moveUnitButton.getHeight() * buttonScale);
|
.size(moveUnitButton.getWidth() * buttonScale, moveUnitButton.getHeight() * buttonScale);
|
||||||
|
|
||||||
if(selectedTile.unit.name.equals("Settler")){
|
if(selectedTile.unit.name.equals("Settler")) {
|
||||||
TextButton foundCityButton = new TextButton("Found City", skin);
|
addUnitAction(tileTable, "Found City", selectedTile.unit,
|
||||||
foundCityButton.getLabel().setFontScale(buttonScale);
|
!game.civInfo.tileMap.getTilesInDistance(selectedTile.position, 2).any(new Predicate<TileInfo>() {
|
||||||
foundCityButton.addListener(new ClickListener(){
|
@Override
|
||||||
@Override
|
public boolean evaluate(TileInfo arg0) {
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
return arg0.isCityCenter();
|
||||||
game.civInfo.addCity(selectedTile.position);
|
}
|
||||||
if(unitTile==selectedTile) unitTile = null; // The settler was in the middle of moving and we then founded a city with it
|
}),
|
||||||
selectedTile.unit = null; // Remove settler!
|
new ClickListener() {
|
||||||
update();
|
@Override
|
||||||
}
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
});
|
game.civInfo.addCity(selectedTile.position);
|
||||||
|
if (unitTile == selectedTile)
|
||||||
if(selectedTile.unit.currentMovement==0 ||
|
unitTile = null; // The settler was in the middle of moving and we then founded a city with it
|
||||||
game.civInfo.tileMap.getTilesInDistance(selectedTile.position,2).any(new Predicate<TileInfo>() {
|
selectedTile.unit = null; // Remove settler!
|
||||||
@Override
|
update();
|
||||||
public boolean evaluate(TileInfo arg0) {
|
}
|
||||||
return arg0.isCityCenter();
|
});
|
||||||
}
|
|
||||||
})){
|
|
||||||
foundCityButton.setTouchable(Touchable.disabled);
|
|
||||||
foundCityButton.setColor(Color.GRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
TileTable.row();
|
|
||||||
TileTable.add(foundCityButton).colspan(2)
|
|
||||||
.size(foundCityButton.getWidth() * buttonScale, foundCityButton.getHeight() * buttonScale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(selectedTile.unit.name.equals("Worker")) {
|
if(selectedTile.unit.name.equals("Worker")) {
|
||||||
String improvementButtonText = selectedTile.improvementInProgress == null ?
|
String improvementButtonText = selectedTile.improvementInProgress == null ?
|
||||||
"Construct\r\nimprovement" : selectedTile.improvementInProgress +"\r\nin progress";
|
"Construct\r\nimprovement" : selectedTile.improvementInProgress +"\r\nin progress";
|
||||||
TextButton improvementButton = new TextButton(improvementButtonText, skin);
|
addUnitAction(tileTable,improvementButtonText,selectedTile.unit, !selectedTile.isCityCenter() ||
|
||||||
improvementButton.getLabel().setFontScale(buttonScale);
|
GameBasics.TileImprovements.linqValues().any(new Predicate<TileImprovement>() {
|
||||||
improvementButton.addListener(new ClickListener() {
|
|
||||||
@Override
|
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
|
||||||
game.setScreen(new ImprovementPickerScreen(game, selectedTile));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(selectedTile.unit.currentMovement ==0 || selectedTile.isCityCenter() ||
|
|
||||||
!GameBasics.TileImprovements.linqValues().any(new Predicate<TileImprovement>() {
|
|
||||||
@Override
|
@Override
|
||||||
public boolean evaluate(TileImprovement arg0) {
|
public boolean evaluate(TileImprovement arg0) {
|
||||||
return selectedTile.canBuildImprovement(arg0);
|
return selectedTile.canBuildImprovement(arg0);
|
||||||
}
|
}
|
||||||
})){
|
})
|
||||||
improvementButton.setColor(Color.GRAY);
|
,new ClickListener() {
|
||||||
improvementButton.setTouchable(Touchable.disabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
TileTable.row();
|
@Override
|
||||||
TileTable.add(improvementButton).colspan(2)
|
public void clicked(InputEvent event, float x, float y) {game.setScreen(new ImprovementPickerScreen(game, selectedTile));}
|
||||||
.size(improvementButton.getWidth() * buttonScale, improvementButton.getHeight() * buttonScale);
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
if(selectedTile.unit.name.equals("Great Scientist")){
|
||||||
|
addUnitAction(tileTable, "Discover Technology",selectedTile.unit,true,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
game.civInfo.tech.freeTechs+=1;
|
||||||
|
selectedTile.unit=null;// destroy!
|
||||||
|
game.setScreen(new TechPickerScreen(game,true));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
addUnitAction(tileTable, "Construct Academy",selectedTile.unit,true,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
selectedTile.improvement="Academy";
|
||||||
|
selectedTile.unit=null;// destroy!
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(selectedTile.unit.name.equals("Great Artist")){
|
||||||
|
addUnitAction(tileTable, "Start Golden Age",selectedTile.unit,true,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
game.civInfo.enterGoldenAge();
|
||||||
|
selectedTile.unit=null;// destroy!
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
addUnitAction(tileTable, "Construct Landmark",selectedTile.unit,true,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
selectedTile.improvement="Landmark";
|
||||||
|
selectedTile.unit=null;// destroy!
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(selectedTile.unit.name.equals("Great Engineer")){
|
||||||
|
final CityConstructions cityConstructions = selectedTile.getCity().cityConstructions;
|
||||||
|
addUnitAction(tileTable, "Hurry Wonder",selectedTile.unit,selectedTile.isCityCenter() &&
|
||||||
|
cityConstructions.getCurrentConstruction() instanceof Building &&
|
||||||
|
((Building)cityConstructions.getCurrentConstruction()).isWonder,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
cityConstructions.addConstruction(300 + (30 * selectedTile.getCity().population)); //http://civilization.wikia.com/wiki/Great_engineer_(Civ5)
|
||||||
|
selectedTile.unit=null; // destroy!
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
addUnitAction(tileTable, "Construct Manufactory",selectedTile.unit,true,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
selectedTile.improvement="Manufactory";
|
||||||
|
selectedTile.unit=null;// destroy!
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(selectedTile.unit.name.equals("Great Merchant")){
|
||||||
|
final CityConstructions cityConstructions = selectedTile.getCity().cityConstructions;
|
||||||
|
addUnitAction(tileTable, "Conduct Trade Mission",selectedTile.unit,true,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
game.civInfo.civStats.gold+=350; // + 50 * era_number - todo!
|
||||||
|
selectedTile.unit=null; // destroy!
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
addUnitAction(tileTable, "Construct Customs House",selectedTile.unit,true,
|
||||||
|
new ClickListener(){
|
||||||
|
@Override
|
||||||
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
selectedTile.improvement="Customs House";
|
||||||
|
selectedTile.unit=null;// destroy!
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TileTable.pack();
|
tileTable.pack();
|
||||||
|
|
||||||
|
tileTable.setPosition(stage.getWidth()-10- tileTable.getWidth(), 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addUnitAction(Table tileTable, String actionText, Unit unit, boolean canAct, ClickListener action) {
|
||||||
|
TextButton actionButton = new TextButton(actionText, skin);
|
||||||
|
actionButton.getLabel().setFontScale(buttonScale);
|
||||||
|
actionButton.addListener(action);
|
||||||
|
if (selectedTile.unit.currentMovement == 0 || !canAct) {
|
||||||
|
actionButton.setColor(Color.GRAY);
|
||||||
|
actionButton.setTouchable(Touchable.disabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
tileTable.row();
|
||||||
|
tileTable.add(actionButton).colspan(2)
|
||||||
|
.size(actionButton.getWidth() * buttonScale, actionButton.getHeight() * buttonScale);
|
||||||
|
|
||||||
TileTable.setPosition(stage.getWidth()-10- TileTable.getWidth(), 10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTiles() {
|
private void updateTiles() {
|
||||||
@ -488,4 +574,3 @@ public class WorldScreen extends com.unciv.game.utils.CameraStageBaseScreen {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import com.unciv.game.UnCivGame;
|
|||||||
import com.unciv.models.gamebasics.Building;
|
import com.unciv.models.gamebasics.Building;
|
||||||
import com.unciv.models.gamebasics.GameBasics;
|
import com.unciv.models.gamebasics.GameBasics;
|
||||||
|
|
||||||
public class BuildingPickerScreen extends PickerScreen {
|
public class ConstructionPickerScreen extends PickerScreen {
|
||||||
public String selectedProduction;
|
public String selectedProduction;
|
||||||
|
|
||||||
TextButton getProductionButton(final String production, String buttonText,
|
TextButton getProductionButton(final String production, String buttonText,
|
||||||
@ -32,7 +32,7 @@ public class BuildingPickerScreen extends PickerScreen {
|
|||||||
return TB;
|
return TB;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuildingPickerScreen(final UnCivGame game) {
|
public ConstructionPickerScreen(final UnCivGame game) {
|
||||||
super(game);
|
super(game);
|
||||||
|
|
||||||
closeButton.clearListeners(); // Don't go back to the world screen, unlike the other picker screens!
|
closeButton.clearListeners(); // Don't go back to the world screen, unlike the other picker screens!
|
||||||
@ -57,16 +57,16 @@ public class BuildingPickerScreen extends PickerScreen {
|
|||||||
rightSideButton.setTouchable(Touchable.disabled);
|
rightSideButton.setTouchable(Touchable.disabled);
|
||||||
rightSideButton.setColor(Color.GRAY);
|
rightSideButton.setColor(Color.GRAY);
|
||||||
|
|
||||||
CityConstructions cityBuildings = game.civInfo.getCurrentCity().cityConstructions;
|
CityConstructions cityConstructions = game.civInfo.getCurrentCity().cityConstructions;
|
||||||
VerticalGroup regularBuildings = new VerticalGroup().space(10),
|
VerticalGroup regularBuildings = new VerticalGroup().space(10),
|
||||||
wonders = new VerticalGroup().space(10),
|
wonders = new VerticalGroup().space(10),
|
||||||
units = new VerticalGroup().space(10),
|
units = new VerticalGroup().space(10),
|
||||||
specials = new VerticalGroup().space(10);
|
specials = new VerticalGroup().space(10);
|
||||||
|
|
||||||
for(final Building building : GameBasics.Buildings.values()) {
|
for(final Building building : GameBasics.Buildings.values()) {
|
||||||
if(!building.isBuildable(cityBuildings)) continue;
|
if(!building.isBuildable(cityConstructions)) continue;
|
||||||
TextButton TB = getProductionButton(building.name,
|
TextButton TB = getProductionButton(building.name,
|
||||||
building.name +"\r\n"+cityBuildings.turnsToConstruction(building.name)+" turns",
|
building.name +"\r\n"+cityConstructions.turnsToConstruction(building.name)+" turns",
|
||||||
building.getDescription(true),
|
building.getDescription(true),
|
||||||
"Build "+building.name);
|
"Build "+building.name);
|
||||||
if(building.isWonder) wonders.addActor(TB);
|
if(building.isWonder) wonders.addActor(TB);
|
||||||
@ -76,7 +76,7 @@ public class BuildingPickerScreen extends PickerScreen {
|
|||||||
for(Unit unit : GameBasics.Units.values()){
|
for(Unit unit : GameBasics.Units.values()){
|
||||||
if(!unit.isConstructable()) continue;
|
if(!unit.isConstructable()) continue;
|
||||||
units.addActor(getProductionButton(unit.name,
|
units.addActor(getProductionButton(unit.name,
|
||||||
unit.name+"\r\n"+cityBuildings.turnsToConstruction(unit.name)+" turns",
|
unit.name+"\r\n"+cityConstructions.turnsToConstruction(unit.name)+" turns",
|
||||||
unit.description, "Train "+unit.name));
|
unit.description, "Train "+unit.name));
|
||||||
}
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user