From 28ae533acc94e3ee37d3a1994ac52df73cf3f075 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 2 Dec 2018 15:46:45 +0200 Subject: [PATCH] Added Landship, the first Armor unit! Added promotions for Armor units --- Credits.md | 4 ++++ android/Images/UnitIcons/Landship.png | Bin 0 -> 1803 bytes android/assets/jsons/UnitPromotions.json | 20 +++++++++--------- android/assets/jsons/Units.json | 14 ++++++++++++ android/build.gradle | 3 +++ build.gradle | 2 +- .../com/unciv/logic/battle/BattleDamage.kt | 4 ++-- .../com/unciv/logic/battle/CityCombatant.kt | 4 ++-- core/src/com/unciv/logic/battle/ICombatant.kt | 4 ++-- .../unciv/logic/battle/MapUnitCombatant.kt | 4 ++-- .../unciv/models/gamebasics/unit/UnitType.kt | 3 +++ core/src/com/unciv/ui/worldscreen/Minimap.kt | 2 +- .../ui/worldscreen/bottombar/BattleTable.kt | 4 ++-- 13 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 android/Images/UnitIcons/Landship.png 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 0000000000000000000000000000000000000000..9113e90e865e0aa0d37e78c7214295b6dc9bd848 GIT binary patch literal 1803 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k4M?tyST_$yu@pObhHwBu4M$1`kk47*5n0T@ zz%2~Ij105pNH8$4t@U(q45^s&_HKBGY^cP6kN?w>le#6U`Gv9#w8V5I3=VcRHFdDE z%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zb?P>uCu*H~%Z_+G5Q$3TOH6yZ{)zoTxB6q^2Sm60F@0<;bWiFF-%tM?7yta=t&p*p zEZ4iy^ySG*G6{l-UZ3u@g#XCvHUHL})nhPk8&d^;#l!U;x27&xqbBO1Zp`^z@9%`w or=r~@q&)6wx|3HAXubAdWw%oQl+nIpz}k$#)78&qol`;+0J?V}T>t<8 literal 0 HcmV?d00001 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)