Added Anti-Aircraft gun unit, and intercept range on non-ranged units

This commit is contained in:
Yair Morgenstern 2019-07-19 14:40:29 +03:00
parent b565489fd5
commit 558bba44cc
9 changed files with 535 additions and 497 deletions

View file

@ -9,7 +9,7 @@ Trees for the jungle tiles in the "Fantasy Hex" are extracted from [Desert Strik
Tile icons for the "ThorfMaps tileset belong to Thorfinn Tait and are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Based on work at www.thorfmaps.com. Tile icons for the "ThorfMaps tileset belong to Thorfinn Tait and are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Based on work at www.thorfmaps.com.
All the following are from [the Noun Project](https://thenounproject.com) licenced under either Creative Commons or Public Domain Unless otherwise specified, all the following are from [the Noun Project](https://thenounproject.com) licenced under either Creative Commons or Public Domain
## Units ## Units
@ -81,7 +81,9 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
* [Battleship](https://thenounproject.com/search/?q=battleship&i=1986807) By Vitaliy Gorbachev, KZ for Battleship * [Battleship](https://thenounproject.com/search/?q=battleship&i=1986807) By Vitaliy Gorbachev, KZ for Battleship
* [Submarine](https://thenounproject.com/search/?q=submarine&i=589519) By Hea Poh Lin, MY * [Submarine](https://thenounproject.com/search/?q=submarine&i=589519) By Hea Poh Lin, MY
* [xm8](https://thenounproject.com/term/xm8/172007/) By Xela Ub for Infantry * [xm8](https://thenounproject.com/term/xm8/172007/) By Xela Ub for Infantry
* [machine-gun](https://thenounproject.com/search/?q=machine%20gun&i=591058) By Joana Pereira * [machine-gun](https://thenounproject.com/search/?q=machine%20gun&i=591058) By Joana Pereira for Machine Gun
* Icon for Anti-Aircraft made by Yair Morgenstern, based on a free design
[on Vectorstock](https://www.vectorstock.com/royalty-free-vector/flat-icon-design-collection-anti-aircraft-gun-vector-16396060)
* [Anti-Tank Gun](https://thenounproject.com/term/anti-tank-gun/1802450/) By Tom Fricker * [Anti-Tank Gun](https://thenounproject.com/term/anti-tank-gun/1802450/) By Tom Fricker
* [Tank](https://thenounproject.com/search/?q=tank&i=981914) By jeff * [Tank](https://thenounproject.com/search/?q=tank&i=981914) By jeff
* [Tank](https://thenounproject.com/manueldixken/collection/german-tanks/?i=960769) Manuel Dixken, DE for Panzer * [Tank](https://thenounproject.com/manueldixken/collection/german-tanks/?i=960769) Manuel Dixken, DE for Panzer
@ -450,9 +452,10 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
* [Resistance](https://thenounproject.com/term/revolution/1315305/) By HeadsOfBirds * [Resistance](https://thenounproject.com/term/revolution/1315305/) By HeadsOfBirds
* [Viking Hat](https://thenounproject.com/search/?q=pillage&i=185405) By my name is mud for pillaging improvements * [Viking Hat](https://thenounproject.com/search/?q=pillage&i=185405) By my name is mud for pillaging improvements
* [Aim](https://thenounproject.com/search/?q=aim&i=2034920) By Kaviashri for ranged strength * [Aim](https://thenounproject.com/search/?q=aim&i=2034920) By Kaviashri for ranged strength
* [Capitol](https://thenounproject.com/search/?q=capitol&i=160031) By Loren Klein for city states * [Capitol](https://thenounproject.com/search/?q=capitol&i=160031) By Loren Klein for City states
* [Aircraft](https://thenounproject.com/search/?q=aircraft&i=1629000) By Tom Fricker * [Aircraft](https://thenounproject.com/search/?q=aircraft&i=1629000) By Tom Fricker for aircraft icon in city button
* [radar scan](https://thenounproject.com/search/?q=range&i=1500234) By icon 54 * [radar scan](https://thenounproject.com/search/?q=range&i=1500234) By icon 54 for Range
* [short range radar](https://thenounproject.com/search/?q=air%20range&i=2612731) by Vectors Point for Intercept range
# Sound credits # Sound credits

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,008 KiB

After

Width:  |  Height:  |  Size: 1 MiB

View file

@ -1072,6 +1072,18 @@
hurryCostModifier:20, hurryCostModifier:20,
attackSound:"machinegun" attackSound:"machinegun"
}, },
{
name:"Anti-Aircraft Gun",
unitType:"Melee",
movement:2,
interceptRange:2,
strength:50,
cost: 375,
requiredTech:"Ballistics"
uniques:["[100]% chance to intercept air attacks","Bonus vs air units 150%"]
hurryCostModifier:20,
attackSound:"machinegun"
},
{ {
name:"Tank", name:"Tank",
unitType:"Armor", unitType:"Armor",

View file

@ -46,6 +46,8 @@ class BattleDamage{
addToModifiers(BDM) addToModifiers(BDM)
if(BDM.vs == "water units" && enemy.getUnitType().isWaterUnit()) if(BDM.vs == "water units" && enemy.getUnitType().isWaterUnit())
addToModifiers(BDM) addToModifiers(BDM)
if(BDM.vs == "air units" && enemy.getUnitType().isAirUnit())
addToModifiers(BDM)
} }
//https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php //https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php

View file

@ -24,6 +24,7 @@ class BaseUnit : INamed, IConstruction, ICivilopedia {
var strength:Int = 0 var strength:Int = 0
var rangedStrength:Int = 0 var rangedStrength:Int = 0
var range:Int = 2 var range:Int = 2
var interceptRange = 0
lateinit var unitType: UnitType lateinit var unitType: UnitType
internal var unbuildable: Boolean = false // for special units like great people internal var unbuildable: Boolean = false // for special units like great people
var requiredTech:String? = null var requiredTech:String? = null

View file

@ -137,6 +137,12 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
unitDescriptionTable.add(unit.getRange().toString()).padRight(10f) unitDescriptionTable.add(unit.getRange().toString()).padRight(10f)
} }
if(unit.baseUnit.interceptRange > 0){
unitDescriptionTable.add(ImageGetter.getStatIcon("InterceptRange")).size(20f)
val range = if(unit.type.isRanged()) unit.getRange() else unit.baseUnit.interceptRange
unitDescriptionTable.add(range.toString()).padRight(10f)
}
if (!unit.type.isCivilian()) { if (!unit.type.isCivilian()) {
unitDescriptionTable.add("XP") unitDescriptionTable.add("XP")
unitDescriptionTable.add(unit.promotions.XP.toString()+"/"+unit.promotions.xpForNextPromotion()) unitDescriptionTable.add(unit.promotions.XP.toString()+"/"+unit.promotions.xpForNextPromotion())