diff --git a/android/assets/jsons/Nations.json b/android/assets/jsons/Nations.json index 981dd571b2..1be4baff7c 100644 --- a/android/assets/jsons/Nations.json +++ b/android/assets/jsons/Nations.json @@ -501,7 +501,7 @@ mainColor:[18,84,30], secondaryColor:[245,248,185], uniqueName:"Barbary Corsairs" - unique:"Pay only one third the usual cost for naval unit maintenance. All melee naval units have the Prize Ships promotion, allowing them to capture defeated ships.", + unique:"Pay only one third the usual cost for naval unit maintenance. Melee naval units have a 1/3 chance to capture defeated naval units.", cities:["Istanbul","Edirne","Ankara","Bursa","Konya","Samsun","Gaziantep","Diyabakir","Izmir","Kayseri","Malatya", "Marsin","Antalya","Zonguldak","Denizli","Ordu","Mugia","Eskishehir","Inebolu","Sinop","Adana","Artuin", "Bodrum","Eregli","Silifke","Sivas","Amasya","Marmaris","Trabzon","Erzurum","Urfa","Izmit","Afyonkarhisar", diff --git a/android/assets/jsons/Units.json b/android/assets/jsons/Units.json index 770303dd8a..c04d34a35f 100644 --- a/android/assets/jsons/Units.json +++ b/android/assets/jsons/Units.json @@ -838,6 +838,7 @@ hurryCostModifier:20, attackSound:"shot" }, + /* { name:"Triplane", unitType:"AirFighter", @@ -848,6 +849,7 @@ hurryCostModifier:20, attackSound:"shot" }, + */ /* { name:"Norvegian Ski Infantry", diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index d0f8b888b5..f80bf71768 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -108,6 +108,13 @@ class Battle(val gameInfo:GameInfo) { attacker.getCivInfo().addNotification("A barbarian [${defender.getName()}] has joined us!",attackedTile.position, Color.RED) } + // Similarly, Ottoman unique + if(defender.isDefeated() && defender.getUnitType().isWaterUnit() + && attacker.getCivInfo().getNation().unique== "Pay only one third the usual cost for naval unit maintenance. Melee naval units have a 1/3 chance to capture defeated naval units." + && Random().nextDouble() > 0.33){ + attacker.getCivInfo().placeUnitNearTile(attackedTile.position, defender.getName()) + } + // we're a melee unit and we destroyed\captured an enemy unit else if (attacker.isMelee() && (defender.isDefeated() || defender.getCivInfo()==attacker.getCivInfo()) @@ -135,23 +142,7 @@ class Battle(val gameInfo:GameInfo) { attacker.city.attackedThisTurn = true } - // XP! - fun addXp(thisCombatant:ICombatant, amount:Int, otherCombatant:ICombatant){ - if(thisCombatant !is MapUnitCombatant) return - if(thisCombatant.unit.promotions.totalXpProduced() >= 30 && otherCombatant.getCivInfo().isBarbarianCivilization()) - return - var amountToAdd = amount - if(thisCombatant.getCivInfo().policies.isAdopted("Military Tradition")) amountToAdd = (amountToAdd * 1.5f).toInt() - thisCombatant.unit.promotions.XP += amountToAdd - if(thisCombatant.getCivInfo().getNation().unique - == "Great general provides double combat bonus, and spawns 50% faster") - amountToAdd = (amountToAdd * 1.5f).toInt() - if(thisCombatant.unit.hasUnique("Combat very likely to create Great Generals")) - amountToAdd *= 2 - - thisCombatant.getCivInfo().greatPeople.greatGeneralPoints += amountToAdd - } if(attacker.isMelee()){ if(!defender.getUnitType().isCivilian()) // unit was not captured but actually attacked @@ -186,6 +177,24 @@ class Battle(val gameInfo:GameInfo) { attacker.unit.action=null } + // XP! + fun addXp(thisCombatant:ICombatant, amount:Int, otherCombatant:ICombatant){ + if(thisCombatant !is MapUnitCombatant) return + if(thisCombatant.unit.promotions.totalXpProduced() >= 30 && otherCombatant.getCivInfo().isBarbarianCivilization()) + return + var amountToAdd = amount + if(thisCombatant.getCivInfo().policies.isAdopted("Military Tradition")) amountToAdd = (amountToAdd * 1.5f).toInt() + thisCombatant.unit.promotions.XP += amountToAdd + + if(thisCombatant.getCivInfo().getNation().unique + == "Great general provides double combat bonus, and spawns 50% faster") + amountToAdd = (amountToAdd * 1.5f).toInt() + if(thisCombatant.unit.hasUnique("Combat very likely to create Great Generals")) + amountToAdd *= 2 + + thisCombatant.getCivInfo().greatPeople.greatGeneralPoints += amountToAdd + } + private fun conquerCity(city: CityInfo, attacker: ICombatant) { val cityCiv = city.civInfo val attackerCiv = attacker.getCivInfo()