Steam Power and Astronomy now increase embarked units' movement

This commit is contained in:
Yair Morgenstern 2018-11-04 13:07:03 +02:00
parent fb2538524a
commit 937687a0f4
4 changed files with 21 additions and 16 deletions

View File

@ -262,16 +262,6 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
* [Riot Police](https://thenounproject.com/term/riot-police/43117/) By Dan Hetteix for Police State
## Others
* [Circle](https://thenounproject.com/term/circle/1841891/) By Aybige
* [Arrow](https://thenounproject.com/term/arrow/18123/) By Joe Mortell
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
* [Skull](https://thenounproject.com/search/?q=Skull&i=1030702) By Vladimir Belochkin
* [Crosshair](https://thenounproject.com/search/?q=crosshairs&i=916030) By Bakunetsu Kaito
* [City](https://thenounproject.com/search/?q=city&i=571332) By Felix Westphal
* [Fire](https://thenounproject.com/search/?q=Fire&i=96564) By Lloyd Humphreys
* [Sleep](https://thenounproject.com/search/?q=sleep&i=1760085) By Saeful Muslim
## Technologies
@ -352,4 +342,16 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
* [Nanoparticles](https://thenounproject.com/term/nanoparticles/822286/) By Gyan Lakhwani for Nanotechnology
* [Satellite](https://thenounproject.com/term/satellite/1466641/) By Ben Davis for Satellites
* [Atom](https://thenounproject.com/term/atom/1586852/) By Kelsey Armstrong for Particle Physics
* [Information Technology](https://thenounproject.com/term/information-technology/1927668/) By Vectors Markeet for Future Tech
* [Information Technology](https://thenounproject.com/term/information-technology/1927668/) By Vectors Markeet for Future Tech
## Others
* [Circle](https://thenounproject.com/term/circle/1841891/) By Aybige
* [Arrow](https://thenounproject.com/term/arrow/18123/) By Joe Mortell
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
* [Skull](https://thenounproject.com/search/?q=Skull&i=1030702) By Vladimir Belochkin
* [Crosshair](https://thenounproject.com/search/?q=crosshairs&i=916030) By Bakunetsu Kaito
* [City](https://thenounproject.com/search/?q=city&i=571332) By Felix Westphal
* [Fire](https://thenounproject.com/search/?q=Fire&i=96564) By Lloyd Humphreys
* [Sleep](https://thenounproject.com/search/?q=sleep&i=1760085) By Saeful Muslim
* [Banner](https://thenounproject.com/term/banner/866282/) By Emir Palavan for embarked units

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -221,6 +221,7 @@
{
name:"Astronomy",
row:2,
baseDescription:"Increases embarked movement +1",
prerequisites:[/*"Compass",*/"Education"]
},
{
@ -339,6 +340,7 @@
{
name:"Steam Power",
row:7,
baseDescription:"Increases embarked movement +1",
prerequisites:["Industrialization","Scientific Theory","Rifling"]
},
{

View File

@ -6,7 +6,6 @@ import com.unciv.logic.automation.UnitAutomation
import com.unciv.logic.automation.WorkerAutomation
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.tile.TerrainType
import com.unciv.models.gamebasics.unit.BaseUnit
import com.unciv.ui.utils.getRandom
import java.text.DecimalFormat
@ -43,6 +42,8 @@ class MapUnit {
fun getMovementString(): String = DecimalFormat("0.#").format(currentMovement.toDouble()) + "/" + getMaxMovement()
fun getTile(): TileInfo = currentTile
fun getMaxMovement(): Int {
if(isEmbarked()) return getEmbarkedMovement()
var movement = baseUnit.movement
movement += getUniques().count{it=="+1 Movement"}
@ -67,7 +68,7 @@ class MapUnit {
fun updateUniques(){
val uniques = ArrayList<String>()
val baseUnit = baseUnit()
if(baseUnit.uniques!=null) uniques.addAll(baseUnit.uniques!!)
uniques.addAll(baseUnit.uniques)
uniques.addAll(promotions.promotions.map { GameBasics.UnitPromotions[it]!!.effect })
tempUniques = uniques
}
@ -164,11 +165,11 @@ class MapUnit {
return currentTile.baseTerrain=="Ocean"||currentTile.baseTerrain=="Coast"
}
fun getEmbarkedMovement(){
fun getEmbarkedMovement(): Int {
var movement=2
movement += civInfo.tech.techsResearched.map { GameBasics.Technologies[it]!! }
.count { it.baseDescription!=null && it.baseDescription!! == "Increases embarked movement" }
if(civInfo.tech.isResearched("Steam Power")) movement += 1
.count { it.baseDescription!=null && it.baseDescription!! == "Increases embarked movement +1" }
return movement
}
//endregion