diff --git a/Credits.md b/Credits.md index f03ca43156..4deb71af57 100644 --- a/Credits.md +++ b/Credits.md @@ -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 diff --git a/android/Images/UnitIcons/Landship.png b/android/Images/UnitIcons/Landship.png new file mode 100644 index 0000000000..9113e90e86 Binary files /dev/null and b/android/Images/UnitIcons/Landship.png differ diff --git a/android/assets/jsons/UnitPromotions.json b/android/assets/jsons/UnitPromotions.json index 883fe65287..3d5a9c7cb3 100644 --- a/android/assets/jsons/UnitPromotions.json +++ b/android/assets/jsons/UnitPromotions.json @@ -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"] } { diff --git a/android/assets/jsons/Units.json b/android/assets/jsons/Units.json index 3261721245..08fe4f4164 100644 --- a/android/assets/jsons/Units.json +++ b/android/assets/jsons/Units.json @@ -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 */ { diff --git a/android/build.gradle b/android/build.gradle index 18f1c0fc7d..113426cac0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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') diff --git a/build.gradle b/build.gradle index 1eb3389bf8..c62b42f8d0 100644 --- a/build.gradle +++ b/build.gradle @@ -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 } diff --git a/core/src/com/unciv/logic/battle/BattleDamage.kt b/core/src/com/unciv/logic/battle/BattleDamage.kt index 4028dfbf15..dc4c9c98da 100644 --- a/core/src/com/unciv/logic/battle/BattleDamage.kt +++ b/core/src/com/unciv/logic/battle/BattleDamage.kt @@ -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 { diff --git a/core/src/com/unciv/logic/battle/CityCombatant.kt b/core/src/com/unciv/logic/battle/CityCombatant.kt index d141080ba6..bc6b1cc6bc 100644 --- a/core/src/com/unciv/logic/battle/CityCombatant.kt +++ b/core/src/com/unciv/logic/battle/CityCombatant.kt @@ -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() } diff --git a/core/src/com/unciv/logic/battle/ICombatant.kt b/core/src/com/unciv/logic/battle/ICombatant.kt index 5470a5bd70..b280373e98 100644 --- a/core/src/com/unciv/logic/battle/ICombatant.kt +++ b/core/src/com/unciv/logic/battle/ICombatant.kt @@ -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 diff --git a/core/src/com/unciv/logic/battle/MapUnitCombatant.kt b/core/src/com/unciv/logic/battle/MapUnitCombatant.kt index 54f2b9f871..3d41465d87 100644 --- a/core/src/com/unciv/logic/battle/MapUnitCombatant.kt +++ b/core/src/com/unciv/logic/battle/MapUnitCombatant.kt @@ -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 } diff --git a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt index b9fa8362f0..130e4d27b0 100644 --- a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt +++ b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt @@ -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 diff --git a/core/src/com/unciv/ui/worldscreen/Minimap.kt b/core/src/com/unciv/ui/worldscreen/Minimap.kt index dac4146a53..7ffc9eeb2e 100644 --- a/core/src/com/unciv/ui/worldscreen/Minimap.kt +++ b/core/src/com/unciv/ui/worldscreen/Minimap.kt @@ -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) } } } diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index 69b9fd3487..accc98f32a 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -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)