Added Gatling Gun unit

Cannon upgrades to Artillery
This commit is contained in:
Yair Morgenstern
2018-12-03 16:00:29 +02:00
parent 23e55495d4
commit 53bac34b42
7 changed files with 257 additions and 232 deletions

View File

@ -334,6 +334,7 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
* [Dynamite](https://thenounproject.com/term/dynamite/610652/) By Simon Martin
### Modern
* [Gears](https://thenounproject.com/term/gears/1484672/) By Aiden Icons for Replacable Parts
* [Radio](https://thenounproject.com/term/radio/124575/) By Arthur Shlain
* [Piston](https://thenounproject.com/term/piston/1224/) By Proletkult Graphik for Combustion
* [Plastic](https://thenounproject.com/term/plastic/478826/) By Yu luck

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 780 KiB

After

Width:  |  Height:  |  Size: 782 KiB

View File

@ -186,6 +186,8 @@
rangedStrength:18,
cost: 120,
requiredTech:"Machinery",
upgradesTo:"Gatling Gun",
obsoleteTech:"Industrialization",
hurryCostModifier:20
},
{
@ -199,6 +201,8 @@
uniqueTo:"England",
cost: 120,
requiredTech:"Machinery",
upgradesTo:"Gatling Gun",
obsoleteTech:"Industrialization",
hurryCostModifier:20
},
{
@ -282,6 +286,8 @@
rangedStrength:20,
cost: 185,
requiredTech:"Chemistry",
upgradesTo:"Artillery",
obsoleteTech:"Dynamite",
uniques:["Bonus vs City 200%","No defensive terrain bonus","Must set up to ranged attack","Limited Visibility"],
hurryCostModifier:20
},
@ -334,6 +340,17 @@
// Industrial Era
{
name:"Gatling Gun",
unitType:"Ranged",
range:1,
movement:2,
strength:30,
rangedStrength:30,
cost: 225,
requiredTech:"Industrialization",
hurryCostModifier:20
},
{
name:"Rifleman",
unitType:"Melee",

View File

@ -10,6 +10,7 @@ import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.trade.Trade
import com.unciv.logic.trade.TradeOffersList
import com.unciv.ui.utils.*
import java.text.DecimalFormat
import kotlin.math.roundToInt
class EmpireOverviewScreen : CameraStageBaseScreen(){
@ -249,7 +250,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
table.add(unit.name.tr())
if(baseUnit.strength>0) table.add(baseUnit.strength.toString()) else table.add()
if(baseUnit.rangedStrength>0) table.add(baseUnit.rangedStrength.toString()) else table.add()
table.add(unit.currentMovement.toString()+"/"+unit.getMaxMovement())
table.add(DecimalFormat("0.#").format(unit.currentMovement)+"/"+unit.getMaxMovement())
val closestCity = unit.getTile().getTilesInDistance(3).firstOrNull{it.isCityCenter()}
if (closestCity!=null) table.add(closestCity.getCity()!!.name) else table.add()
table.row()

View File

@ -5,7 +5,6 @@ import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.InputEvent
import com.badlogic.gdx.scenes.scene2d.ui.*
import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener
import com.badlogic.gdx.utils.Align
import com.unciv.UnCivGame
import com.unciv.logic.HexMath
import com.unciv.logic.city.CityInfo
@ -195,7 +194,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
val tileGroup = CityTileGroup(cityInfo, tileInfo)
val tilesInRange = city.getTilesInRange()
// this needs to happen on pdate, because we can buy tiles, which changes the definition of the bought tiles...
// this needs to happen on update, because we can buy tiles, which changes the definition of the bought tiles...
if (tileInfo.getCity()!=city) { // outside of city
tileGroup.setColor(0f, 0f, 0f, 0.3f)
tileGroup.yieldGroup.isVisible = false
@ -259,15 +258,15 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
val stats = tile.getTileStats(city, city.civInfo)
tileTable.pad(20f)
tileTable.columnDefaults(0).padRight(10f)
tileTable.add(Label(tile.toString(), CameraStageBaseScreen.skin)).colspan(2)
tileTable.row()
val statsTable = Table()
statsTable.defaults().pad(2f)
for (entry in stats.toHashMap().filterNot { it.value==0f }) {
statsTable.add(ImageGetter.getStatIcon(entry.key.toString())).size(20f).align(Align.right)
statsTable.add(Label(Math.round(entry.value).toString() + "", CameraStageBaseScreen.skin)).align(Align.left)
statsTable.add(ImageGetter.getStatIcon(entry.key.toString())).size(20f)
statsTable.add(Label(Math.round(entry.value).toString() + "", CameraStageBaseScreen.skin))
statsTable.row()
}
tileTable.add(statsTable).row()