Added Iroquois civilization

This commit is contained in:
Yair Morgenstern 2019-09-15 12:13:14 +03:00
parent bad10370de
commit d645ae4478
16 changed files with 621 additions and 557 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 MiB

After

Width:  |  Height:  |  Size: 1 MiB

View file

@ -333,14 +333,14 @@
production:2,
specialistSlots:{production:1},
hurryCostModifier:25,
percentStatBonus:{production:15},
percentStatBonus:{production:10},
requiredTech:"Metal Casting"
},
/*
{
name:"Longhouse",
replaces:"Workshop",
uniqueTo:"Iroquois",
cost:140,
maintenance:2,
production:2,
specialistSlots:{production:1},
@ -348,7 +348,6 @@
uniques:["Forests provide +1 production"],
requiredTech:"Metal Casting"
},
*/
{
name:"Forge",
maintenance:1,

View file

@ -542,7 +542,6 @@
"Rason","Gyeongju","Chungju","Sacheon","Gimje","Anju"]
},
/*
{
name:"Iroquois",
leaderName:"Hiawatha",
@ -571,7 +570,7 @@
afterPeace:"I thank you for your mercy. I pray that we can now be friends."
tradeRequest:"Does this trade work for you, my friend?"
outerColor:[88,109,109],
outerColor:[54,72,72],
innerColor:[246,205,137],
uniqueName:"The Great Warpath"
unique:"All units move through Forest and Jungle tiles in friendly territory as if it is Road. These tiles can be used to establish City Connections upon researching the Wheel.",
@ -580,6 +579,8 @@
"Chondote","Canajoharie","Nedrow","Oneida Lake","Kanonwalohale","Green Bay","Southwold","Mohawk Valley",
"Schoharie","Bay of Quinte","Kanawale","Kanatsiokareke","Tyendinaga","Hahta"]
},
/*
{
name:"Australia",
leaderName:"John Curtin",

View file

@ -743,9 +743,8 @@
German:"Werkstatt"
Polish:"Warsztat"
}
/*
"Longhouse":{ //Irochese unique
"Longhouse":{ // Iroquois unique
Italian:"Casa Lunga"
French:"Longère"
Polish:"Długi dom"
@ -756,7 +755,6 @@
French:"+1 production pour chaque cases de forêt exploitées par la ville."
Polish:"+1 do produkcji za każde pracujące pole lasu"
}
*/
"Forge":{
Italian:"Fucina"

View file

@ -1218,13 +1218,15 @@
Russian:"+2 Наука для всех специалистов и улучшений клеток Великими людьми."
}
/*
"Iroquois":{
Italian:"Irochese"
French:"Iroquois"
Portuguese:"Tribo Iroquois" //tribo meaning tribe of course
}
"Hiawatha":{
}
"Units move through Forest and Jungle in friendly territory as if it is a Road. These tiles can be used to establish Trade Routes upon searching The Wheel.":{
Italian:"Le caselle di Foreste e Giungle in territorio amico agiscono come strade, e sono usate per stabilire Rotte Commerciali quando si scopre la Ruota."
@ -1232,6 +1234,7 @@
French:"Les Forêt et les Jungles en territoire alliés ont les mêmes attributs que les routes. A la découverte de la Roue, elles peuvent établir des routes commerciales."
}
/*
"Aztecs":{
Italian:"Azteca"
French:"Aztèques"

View file

@ -439,6 +439,12 @@
German:"Schwertkämpfer"
}
"Mohawk Warrior":{
}
"+33% combat bonus in Forest/Jungle":{
}
"Legion":{
Italian:"Legionario"
Romanian:"Legionar"

View file

@ -322,6 +322,21 @@
hurryCostModifier:20,
attackSound:"metalhit"
},
{
name:"Mohawk Warrior",
unitType:"Melee",
replaces:"Swordsman",
uniqueTo:"Iroquois",
movement:2,
strength:14,
cost: 75,
requiredTech:"Iron Working",
upgradesTo:"Longswordsman",
obsoleteTech:"Steel",
uniques:["+33% combat bonus in Forest/Jungle"]
hurryCostModifier:20,
attackSound:"metalhit"
},
{
name:"Legion",
unitType:"Melee",

View file

@ -143,9 +143,12 @@ open class TileInfo {
if (terrainFeature == Constants.jungle && city != null
&& city.containsBuildingUnique("Jungles provide +2 science"))
stats.science += 2f
if(terrainFeature=="Oasis" && city!=null
if (terrainFeature == "Oasis" && city != null
&& city.containsBuildingUnique("+2 Gold for each source of Oil and oasis"))
stats.gold += 2
if (terrainFeature == Constants.forest && city != null
&& city.containsBuildingUnique("Forests provide +1 production"))
stats.production += 1
}
if (hasViewableResource(observingCiv)) {

View file

@ -21,7 +21,7 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
if (from.roadStatus === RoadStatus.Railroad && to.roadStatus === RoadStatus.Railroad)
return 1 / 10f + extraCost
if (from.roadStatus !== RoadStatus.None && to.roadStatus !== RoadStatus.None) //Road
if (hasRoad(from,civInfo) && hasRoad(to,civInfo))
{
if (unit.civInfo.tech.movementSpeedOnRoadsImproved) return 1 / 3f + extraCost
else return 1 / 2f + extraCost
@ -40,6 +40,13 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
return to.getLastTerrain().movementCost.toFloat() + extraCost // no road
}
fun hasRoad(tileInfo:TileInfo, civInfo: CivilizationInfo): Boolean {
if(tileInfo.roadStatus!==RoadStatus.None) return true
if(civInfo.nation.forestsAndJunglesAreRoads && tileInfo.terrainFeature!=null
&& (tileInfo.terrainFeature==Constants.jungle || tileInfo.terrainFeature==Constants.forest)) return true
return false
}
class ParentTileAndTotalDistance(val parentTile:TileInfo, val totalDistance: Float)
fun getDistanceToTilesWithinTurn(origin: Vector2, unitMovement: Float): PathsToTilesWithinTurn {

View file

@ -27,7 +27,7 @@ object GameBasics {
fun <T> getFromJson(tClass: Class<T>, name: String): T {
val jsonText = Gdx.files.internal("jsons/$name.json").readString()
return Json().apply { ignoreUnknownFields=true }.fromJson(tClass, jsonText)
return Json().apply { ignoreUnknownFields = true }.fromJson(tClass, jsonText)
}
fun <T : INamed> createHashmap(items: Array<T>): LinkedHashMap<String, T> {
@ -38,43 +38,49 @@ object GameBasics {
}
init {
Buildings += createHashmap(getFromJson(Array<Building>::class.java, "Buildings"))
Terrains += createHashmap(getFromJson(Array<Terrain>::class.java, "Terrains"))
TileResources += createHashmap(getFromJson(Array<TileResource>::class.java, "TileResources"))
TileImprovements += createHashmap(getFromJson(Array<TileImprovement>::class.java, "TileImprovements"))
Units += createHashmap(getFromJson(Array<BaseUnit>::class.java, "Units"))
UnitPromotions += createHashmap(getFromJson(Array<Promotion>::class.java, "UnitPromotions"))
PolicyBranches += createHashmap(getFromJson(Array<PolicyBranch>::class.java, "Policies"))
Nations += createHashmap(getFromJson(Array<Nation>::class.java, "Nations/Nations"))
Difficulties += createHashmap(getFromJson(Array<Difficulty>::class.java, "Difficulties"))
val techColumns = getFromJson(Array<TechColumn>::class.java, "Techs")
for (techColumn in techColumns) {
for (tech in techColumn.techs) {
tech.cost = techColumn.techCost
tech.column = techColumn
Technologies[tech.name] = tech
}
val techColumns = getFromJson(Array<TechColumn>::class.java, "Techs")
for (techColumn in techColumns) {
for (tech in techColumn.techs) {
tech.cost = techColumn.techCost
tech.column = techColumn
Technologies[tech.name] = tech
}
for (building in Buildings.values) {
if (building.requiredTech == null) continue
val column = building.getRequiredTech().column
if (building.cost == 0)
building.cost = if (building.isWonder || building.isNationalWonder) column!!.wonderCost else column!!.buildingCost
}
for (branch in PolicyBranches.values) {
branch.requires = ArrayList()
branch.branch = branch.name
for (policy in branch.policies) {
policy.branch = branch.name
if (policy.requires == null) policy.requires = arrayListOf(branch.name)
}
branch.policies.last().name = branch.name + " Complete"
}
for(file in Gdx.files.internal("jsons/Translations").list())
Translations.add(file.readString())
}
Buildings += createHashmap(getFromJson(Array<Building>::class.java, "Buildings"))
for (building in Buildings.values) {
if (building.requiredTech == null) continue
val column = building.getRequiredTech().column
if (building.cost == 0)
building.cost = if (building.isWonder || building.isNationalWonder) column!!.wonderCost else column!!.buildingCost
}
Terrains += createHashmap(getFromJson(Array<Terrain>::class.java, "Terrains"))
TileResources += createHashmap(getFromJson(Array<TileResource>::class.java, "TileResources"))
TileImprovements += createHashmap(getFromJson(Array<TileImprovement>::class.java, "TileImprovements"))
Units += createHashmap(getFromJson(Array<BaseUnit>::class.java, "Units"))
UnitPromotions += createHashmap(getFromJson(Array<Promotion>::class.java, "UnitPromotions"))
PolicyBranches += createHashmap(getFromJson(Array<PolicyBranch>::class.java, "Policies"))
for (branch in PolicyBranches.values) {
branch.requires = ArrayList()
branch.branch = branch.name
for (policy in branch.policies) {
policy.branch = branch.name
if (policy.requires == null) policy.requires = arrayListOf(branch.name)
}
branch.policies.last().name = branch.name + " Complete"
}
Nations += createHashmap(getFromJson(Array<Nation>::class.java, "Nations/Nations"))
for(nation in Nations.values) nation.setTransients()
Difficulties += createHashmap(getFromJson(Array<Difficulty>::class.java, "Difficulties"))
for (file in Gdx.files.internal("jsons/Translations").list())
Translations.add(file.readString())
}
}

View file

@ -50,19 +50,29 @@ class Nation : INamed {
var innerColor: List<Int>?=null
var startBias = ArrayList<String>()
@Transient private lateinit var outerColorObject:Color
fun getOuterColor(): Color = outerColorObject
fun getOuterColor(): Color {
return colorFromRGB(outerColor[0], outerColor[1], outerColor[2])
}
fun getInnerColor(): Color {
if(innerColor==null) return Color.BLACK
return colorFromRGB(innerColor!![0], innerColor!![1], innerColor!![2])
}
@Transient private lateinit var innerColorObject:Color
fun getInnerColor(): Color = innerColorObject
fun isCityState()= cityStateType != null
fun isMajorCiv() = !isBarbarian() && !isCityState()
fun isBarbarian() = name=="Barbarians"
// This is its own transient because we'll need to check this for every tile-to-tile movement which is harsh
@Transient var forestsAndJunglesAreRoads = false
fun setTransients(){
outerColorObject = colorFromRGB(outerColor[0], outerColor[1], outerColor[2])
if(innerColor==null) innerColorObject = Color.BLACK
else innerColorObject = colorFromRGB(innerColor!![0], innerColor!![1], innerColor!![2])
if(unique == "All units move through Forest and Jungle tiles in friendly territory as if it is Road. These tiles can be used to establish City Connections upon researching the Wheel.")
forestsAndJunglesAreRoads = true
}
lateinit var cities: List<String>
}

View file

@ -36,6 +36,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* [Catapult](https://thenounproject.com/search/?q=Spear&i=1233840) By Jakub Ukrop
* [Unloaded Crossbow](https://thenounproject.com/term/unloaded-crossbow/815992/) By Hamish as Ballista
* [Sword](https://thenounproject.com/search/?q=Sword&i=1215443) By Guilherme Furtado for Swordsman
* [Mohawk](https://thenounproject.com/search/?q=mohawk&i=1426649) By Dairy Free Design for Mohawk Warrior
* [Roman Helmet](https://thenounproject.com/search/?q=legion&i=440134) By parkjisun for Legion
* [Horse](https://thenounproject.com/search/?q=Horse&i=1373793) By AFY Studio for Horseman
* [Horse Head](https://thenounproject.com/search/?q=Cavalry&i=374037) By Juan Pablo Bravo for Companion Cavalry
@ -189,6 +190,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* [Forge](https://thenounproject.com/term/forge/1044767/) By Monjin Friends
* [Anchor](https://thenounproject.com/term/anchor/1258518/) By Saeful Muslim for Harbor
* [Hand saw](https://thenounproject.com/term/hand-saw/990902/) By b farias for Workshop
* [House](https://thenounproject.com/search/?q=house&i=1651759) By sofy for Longhouse
* [Hagia Sophia](https://thenounproject.com/term/hagia-sophia/1907752/) By Felipe Alvarado
* [Factory](https://thenounproject.com/term/factory/1624235/) By Maxim Kulikov for Ironworks
* [Notre Dame](https://thenounproject.com/term/notre-dame/1361725/) By Marco Livolsi