mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Added Great Wall wonder
This commit is contained in:
parent
064488ca37
commit
12719c1e0e
@ -158,6 +158,7 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
|
|||||||
* [Bazaar](https://thenounproject.com/term/bazaar/902288/) By Tokka Elkholy
|
* [Bazaar](https://thenounproject.com/term/bazaar/902288/) By Tokka Elkholy
|
||||||
* [Shekel Coin](https://thenounproject.com/term/shekel-coin/204154/) By Till Teenck for Mint
|
* [Shekel Coin](https://thenounproject.com/term/shekel-coin/204154/) By Till Teenck for Mint
|
||||||
* [Aqueduct](https://thenounproject.com/term/aqueduct/24639/) By Arthur Shlain
|
* [Aqueduct](https://thenounproject.com/term/aqueduct/24639/) By Arthur Shlain
|
||||||
|
* [Great Wall](https://thenounproject.com/search/?q=great%20wall&i=545909) By icon 54
|
||||||
|
|
||||||
### Medieval Era
|
### Medieval Era
|
||||||
|
|
||||||
|
BIN
android/Images/BuildingIcons/Great Wall.png
Normal file
BIN
android/Images/BuildingIcons/Great Wall.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 939 KiB After Width: | Height: | Size: 947 KiB |
@ -42,6 +42,13 @@
|
|||||||
greatPersonPoints:{production:1},
|
greatPersonPoints:{production:1},
|
||||||
requiredTech:"Calendar"
|
requiredTech:"Calendar"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Library",
|
||||||
|
hurryCostModifier:25,
|
||||||
|
maintenance:1,
|
||||||
|
uniques:["+1 Science Per 2 Population"],
|
||||||
|
requiredTech:"Writing"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"The Great Library",
|
name:"The Great Library",
|
||||||
science:3,
|
science:3,
|
||||||
@ -52,13 +59,6 @@
|
|||||||
freeTechs:1,
|
freeTechs:1,
|
||||||
requiredTech:"Writing"
|
requiredTech:"Writing"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name:"Library",
|
|
||||||
hurryCostModifier:25,
|
|
||||||
maintenance:1,
|
|
||||||
uniques:["+1 Science Per 2 Population"],
|
|
||||||
requiredTech:"Writing"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name:"Paper Maker",
|
name:"Paper Maker",
|
||||||
replaces:"Library",
|
replaces:"Library",
|
||||||
@ -234,6 +234,16 @@
|
|||||||
uniques:["40% of food is carried over after a new citizen is born"]
|
uniques:["40% of food is carried over after a new citizen is born"]
|
||||||
requiredTech:"Engineering"
|
requiredTech:"Engineering"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Great Wall",
|
||||||
|
culture:1,
|
||||||
|
greatPersonPoints:{production:1},
|
||||||
|
isWonder:true,
|
||||||
|
providesFreeBuilding: "Walls",
|
||||||
|
freeTechs:1,
|
||||||
|
uniques:["Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)"]
|
||||||
|
requiredTech:"Engineering"
|
||||||
|
},
|
||||||
|
|
||||||
// Medieval Era
|
// Medieval Era
|
||||||
|
|
||||||
|
@ -47,6 +47,9 @@ class CivilizationInfo {
|
|||||||
@Transient var viewableTiles = HashSet<TileInfo>()
|
@Transient var viewableTiles = HashSet<TileInfo>()
|
||||||
@Transient var viewableInvisibleUnitsTiles = HashSet<TileInfo>()
|
@Transient var viewableInvisibleUnitsTiles = HashSet<TileInfo>()
|
||||||
|
|
||||||
|
// This is for performance since every movement calculation depends on this, see MapUnit comment
|
||||||
|
@Transient var hasActiveGreatWall = false
|
||||||
|
|
||||||
var gold = 0
|
var gold = 0
|
||||||
var happiness = 15
|
var happiness = 15
|
||||||
@Deprecated("As of 2.11.1") var difficulty = "Chieftain"
|
@Deprecated("As of 2.11.1") var difficulty = "Chieftain"
|
||||||
@ -351,6 +354,12 @@ class CivilizationInfo {
|
|||||||
}
|
}
|
||||||
setCitiesConnectedToCapitalTransients()
|
setCitiesConnectedToCapitalTransients()
|
||||||
updateViewableTiles()
|
updateViewableTiles()
|
||||||
|
updateHasActiveGreatWall()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateHasActiveGreatWall(){
|
||||||
|
hasActiveGreatWall = !tech.isResearched("Dynamite") &&
|
||||||
|
getBuildingUniques().contains("Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startTurn(){
|
fun startTurn(){
|
||||||
@ -402,6 +411,7 @@ class CivilizationInfo {
|
|||||||
goldenAges.endTurn(happiness)
|
goldenAges.endTurn(happiness)
|
||||||
getCivUnits().forEach { it.endTurn() }
|
getCivUnits().forEach { it.endTurn() }
|
||||||
diplomacy.values.forEach{it.nextTurn()}
|
diplomacy.values.forEach{it.nextTurn()}
|
||||||
|
updateHasActiveGreatWall()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getGreatPersonPointsForNextTurn(): Stats {
|
fun getGreatPersonPointsForNextTurn(): Stats {
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
package com.unciv.logic.map
|
package com.unciv.logic.map
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2
|
import com.badlogic.gdx.math.Vector2
|
||||||
|
import com.unciv.logic.civilization.CivilizationInfo
|
||||||
|
|
||||||
class UnitMovementAlgorithms(val unit:MapUnit) {
|
class UnitMovementAlgorithms(val unit:MapUnit) {
|
||||||
val tileMap = unit.getTile().tileMap
|
val tileMap = unit.getTile().tileMap
|
||||||
|
|
||||||
|
private fun getMovementCostBetweenAdjacentTiles(from: TileInfo, to: TileInfo, civInfo: CivilizationInfo): Float {
|
||||||
|
var cost = getMovementCostBetweenAdjacentTiles(from,to)
|
||||||
|
|
||||||
|
val toOwner = to.getOwner()
|
||||||
|
if(toOwner!=null && civInfo.isAtWarWith(toOwner) && toOwner.hasActiveGreatWall) cost += 1
|
||||||
|
return cost
|
||||||
|
}
|
||||||
|
|
||||||
private fun getMovementCostBetweenAdjacentTiles(from: TileInfo, to: TileInfo): Float {
|
private fun getMovementCostBetweenAdjacentTiles(from: TileInfo, to: TileInfo): Float {
|
||||||
|
|
||||||
if(unit.type.isLandUnit() && (from.isLand() != to.isLand()))
|
if(unit.type.isLandUnit() && (from.isLand() != to.isLand()))
|
||||||
@ -50,7 +59,7 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||||||
// cities and units goes kaput.
|
// cities and units goes kaput.
|
||||||
|
|
||||||
else {
|
else {
|
||||||
val distanceBetweenTiles = getMovementCostBetweenAdjacentTiles(tileToCheck, neighbor)
|
val distanceBetweenTiles = getMovementCostBetweenAdjacentTiles(tileToCheck, neighbor, unit.civInfo)
|
||||||
totalDistanceToTile = distanceToTiles[tileToCheck]!! + distanceBetweenTiles
|
totalDistanceToTile = distanceToTiles[tileToCheck]!! + distanceBetweenTiles
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,12 +178,12 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||||||
reversedList.add(currentTile)
|
reversedList.add(currentTile)
|
||||||
val distanceToCurrentTile = distanceToTiles[currentTile]!!
|
val distanceToCurrentTile = distanceToTiles[currentTile]!!
|
||||||
if(currentUnitTile in currentTile.neighbors
|
if(currentUnitTile in currentTile.neighbors
|
||||||
&& getMovementCostBetweenAdjacentTiles(currentUnitTile,currentTile) == distanceToCurrentTile)
|
&& getMovementCostBetweenAdjacentTiles(currentUnitTile,currentTile,unit.civInfo) == distanceToCurrentTile)
|
||||||
return reversedList.reversed()
|
return reversedList.reversed()
|
||||||
|
|
||||||
for(tile in currentTile.neighbors)
|
for(tile in currentTile.neighbors)
|
||||||
currentTile = currentTile.neighbors.first{it in distanceToTiles
|
currentTile = currentTile.neighbors.first{it in distanceToTiles
|
||||||
&& getMovementCostBetweenAdjacentTiles(it,currentTile) == distanceToCurrentTile - distanceToTiles[it]!!}
|
&& getMovementCostBetweenAdjacentTiles(it,currentTile,unit.civInfo) == distanceToCurrentTile - distanceToTiles[it]!!}
|
||||||
}
|
}
|
||||||
throw Exception("We couldn't get the path between the two tiles")
|
throw Exception("We couldn't get the path between the two tiles")
|
||||||
}
|
}
|
||||||
|
@ -265,6 +265,8 @@ class Building : NamedStats(), IConstruction{
|
|||||||
city.population.autoAssignPopulation()
|
city.population.autoAssignPopulation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)" in uniques ->
|
||||||
|
civInfo.updateHasActiveGreatWall()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (freeTechs != 0) civInfo.tech.freeTechs += freeTechs
|
if (freeTechs != 0) civInfo.tech.freeTechs += freeTechs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user