Added Landship, the first Armor unit!

Added promotions for Armor units
This commit is contained in:
Yair Morgenstern 2018-12-02 15:46:45 +02:00
parent 5099ad4db4
commit 28ae533acc
13 changed files with 46 additions and 22 deletions

View File

@ -55,6 +55,10 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
* [Artillery](https://thenounproject.com/search/?q=Artillery&i=1165261) By Creative Mania
* [Ship](https://thenounproject.com/term/ship/1594793/) By Aisyah for Ironclad
### Modern
* [Tank](https://thenounproject.com/term/tank/1287510/) By corpus delicti for Landship
### Great People
* [Pallet](https://thenounproject.com/search/?q=Pallet&i=6862) By James Keuning for Great Artist

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -39,37 +39,37 @@
{
name:"Shock I",
effect:"Bonus vs units in open terrain 15%",
unitTypes:["Melee","Mounted"]
unitTypes:["Melee","Mounted","Armor"]
}
{
name:"Shock II",
prerequisites:["Shock I"],
effect:"Bonus vs units in open terrain 15%",
unitTypes:["Melee","Mounted"]
unitTypes:["Melee","Mounted","Armor"]
}
{
name:"Shock III",
prerequisites:["Shock II"],
effect:"Bonus vs units in open terrain 15%",
unitTypes:["Melee","Mounted"]
unitTypes:["Melee","Mounted","Armor"]
}
{
name:"Drill I",
effect:"Bonus vs units in rough terrain 15%",
unitTypes:["Melee","Mounted"]
unitTypes:["Melee","Mounted","Armor"]
}
{
name:"Drill II",
prerequisites:["Drill I"],
effect:"Bonus vs units in rough terrain 15%",
unitTypes:["Melee","Mounted"]
unitTypes:["Melee","Mounted","Armor"]
}
{
name:"Drill III",
prerequisites:["Drill II"],
effect:"Bonus vs units in rough terrain 15%",
unitTypes:["Melee","Mounted"]
unitTypes:["Melee","Mounted","Armor"]
}
{
@ -113,7 +113,7 @@
name:"Charge",
prerequisites:["Shock II","Drill II"],
effect:"Bonus vs wounded units 33%",
unitTypes:["Mounted"]
unitTypes:["Mounted","Armor"]
}
{
@ -121,7 +121,7 @@
prerequisites:["Shock II","Drill II","Targeting I",
"Bombardment I","Boarding Party I", "Coastal Raider I"],
effect:"+1 Movement",
unitTypes:["Mounted","WaterMelee","WaterRanged"]
unitTypes:["Mounted","WaterMelee","WaterRanged","Armor"]
}
{
@ -142,7 +142,7 @@
name:"Sentry",
prerequisites:["Accuracy I","Barrage I","Shock II","Drill II","Bombardment I","Targeting I"],
effect:"+1 Visibility Range",
unitTypes:["Melee","Mounted","WaterRanged"]
unitTypes:["Melee","Mounted","WaterRanged","Armor","WaterMelee"]
}
{
@ -176,7 +176,7 @@
name:"Blitz",
prerequisites:["Shock III","Drill III"],
effect:"1 additional attack per turn",
unitTypes:["Melee","Mounted"]
unitTypes:["Melee","Mounted","Armor"]
}
{

View File

@ -374,6 +374,20 @@
hurryCostModifier:20
},
// Modern era
{
name:"Landship",
unitType:"Armor",
movement:4,
strength:60,
cost: 350,
requiredTech:"Combustion",
requiredResource:"Oil",
uniques:["Can move after attacking","No defensive terrain bonus"],
hurryCostModifier:20
},
/* Great people */
{

View File

@ -25,6 +25,9 @@ android {
versionName "2.10.8"
}
// Had to add this crap for Travis to build, it wanted to sign the app
// but couldn't create the debug keystore for some reason
signingConfigs {
debug {
storeFile rootProject.file('debug.keystore')

View File

@ -63,7 +63,7 @@ project(":desktop") {
project(":android") {
apply plugin: "android"
//apply plugin: "kotlin-android"
//apply plugin: "kotlin-android" // This seems to have problems in Gradle 4.6
configurations { natives }

View File

@ -155,7 +155,7 @@ class BattleDamage{
*/
fun getAttackingStrength(attacker: ICombatant, defender: ICombatant): Float {
val attackModifier = modifiersToMultiplicationBonus(getAttackModifiers(attacker,defender))
return attacker.getAttackingStrength(defender) * attackModifier
return attacker.getAttackingStrength() * attackModifier
}
@ -165,7 +165,7 @@ class BattleDamage{
fun getDefendingStrength(attacker: ICombatant, defender: ICombatant): Float {
var defenceModifier = 1f
if(defender is MapUnitCombatant) defenceModifier = modifiersToMultiplicationBonus(getDefenceModifiers(attacker,defender))
return defender.getDefendingStrength(attacker) * defenceModifier
return defender.getDefendingStrength() * defenceModifier
}
fun calculateDamageToAttacker(attacker: ICombatant, defender: ICombatant): Int {

View File

@ -19,8 +19,8 @@ class CityCombatant(val city: CityInfo) : ICombatant {
}
override fun getUnitType(): UnitType = UnitType.City
override fun getAttackingStrength(defender: ICombatant): Int = getCityStrength()
override fun getDefendingStrength(attacker: ICombatant): Int{
override fun getAttackingStrength(): Int = getCityStrength()
override fun getDefendingStrength(): Int{
if(isDefeated()) return 1
return getCityStrength()
}

View File

@ -8,8 +8,8 @@ interface ICombatant{
fun getName(): String
fun getHealth():Int
fun getUnitType(): UnitType
fun getAttackingStrength(defender: ICombatant): Int
fun getDefendingStrength(attacker: ICombatant): Int
fun getAttackingStrength(): Int
fun getDefendingStrength(): Int
fun takeDamage(damage:Int)
fun isDefeated():Boolean
fun getCivilization(): CivilizationInfo

View File

@ -17,12 +17,12 @@ class MapUnitCombatant(val unit: MapUnit) : ICombatant {
if(isDefeated()) unit.destroy()
}
override fun getAttackingStrength(defender: ICombatant): Int { // todo remove defender
override fun getAttackingStrength(): Int {
if (isRanged()) return unit.baseUnit().rangedStrength
else return unit.baseUnit().strength
}
override fun getDefendingStrength(attacker: ICombatant): Int { // todo remove attacker
override fun getDefendingStrength(): Int {
if(unit.isEmbarked()) return 0
return unit.baseUnit().strength
}

View File

@ -7,6 +7,7 @@ enum class UnitType{
Ranged,
Scout,
Mounted,
Armor,
Siege,
WaterCivilian,
WaterMelee,
@ -15,6 +16,7 @@ enum class UnitType{
fun isMelee(): Boolean {
return this == Melee
|| this == Mounted
|| this == Armor
|| this == Scout
|| this == WaterMelee
}
@ -28,6 +30,7 @@ enum class UnitType{
return this == Civilian
|| this == Melee
|| this == Mounted
|| this == Armor
|| this == Scout
|| this == Ranged
|| this == Siege

View File

@ -79,7 +79,7 @@ class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){
if (!(exploredTiles.contains(tileInfo.position) || UnCivGame.Current.viewEntireMapForDebug)) hex.color = Color.BLACK
else if (tileInfo.isCityCenter() && !tileInfo.isWater()) hex.color = tileInfo.getOwner()!!.getNation().getSecondaryColor()
else if (tileInfo.getCity() != null && !tileInfo.isWater()) hex.color = tileInfo.getOwner()!!.getNation().getColor()
else hex.color = tileInfo.getBaseTerrain().getColor().lerp(Color.GRAY, 0.5f) // Todo add to baseterrain as function
else hex.color = tileInfo.getBaseTerrain().getColor().lerp(Color.GRAY, 0.5f)
}
}
}

View File

@ -73,8 +73,8 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
addSeparator().pad(0f)
add("{Strength}: ".tr()+attacker.getAttackingStrength(defender))
add("{Strength}: ".tr()+defender.getDefendingStrength(attacker)).row()
add("{Strength}: ".tr()+attacker.getAttackingStrength())
add("{Strength}: ".tr()+defender.getDefendingStrength()).row()
val attackerModifiers = BattleDamage().getAttackModifiers(attacker,defender) .map { it.key+": "+(if(it.value>0)"+" else "")+(it.value*100).toInt()+"%" }
val defenderModifiers = if (defender is MapUnitCombatant)