mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04:00
Added Foreign Legion unique unit - #563
This commit is contained in:
parent
a969c8f479
commit
dc2f88765b
@ -68,6 +68,7 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
|
|||||||
### Modern
|
### Modern
|
||||||
|
|
||||||
* [Helmet](https://thenounproject.com/term/helmet/25216/) By Daniel Turner for Great War Infantry
|
* [Helmet](https://thenounproject.com/term/helmet/25216/) By Daniel Turner for Great War Infantry
|
||||||
|
* [Cap](https://thenounproject.com/search/?q=kepi&i=950267) By Creative Mania for Foreign Legion
|
||||||
* [Tank](https://thenounproject.com/term/tank/1287510/) By corpus delicti for Landship
|
* [Tank](https://thenounproject.com/term/tank/1287510/) By corpus delicti for Landship
|
||||||
* [Warship](https://thenounproject.com/term/warship/1597474/) By zidney for Destroyer
|
* [Warship](https://thenounproject.com/term/warship/1597474/) By zidney for Destroyer
|
||||||
* [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
|
||||||
|
BIN
android/Images/UnitIcons/Foreign Legion.png
Normal file
BIN
android/Images/UnitIcons/Foreign Legion.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -6763,7 +6763,7 @@
|
|||||||
German:"Panzerschiff"
|
German:"Panzerschiff"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modern units (do these, yes)
|
// Modern units
|
||||||
"Landship":{
|
"Landship":{
|
||||||
Italian:"Nave di terra"
|
Italian:"Nave di terra"
|
||||||
Romanian:"Vehicul terestru"
|
Romanian:"Vehicul terestru"
|
||||||
@ -6773,6 +6773,7 @@
|
|||||||
German:"Landschiff"
|
German:"Landschiff"
|
||||||
French:"Véhicule terrestre" //official translation but ugly
|
French:"Véhicule terrestre" //official translation but ugly
|
||||||
}
|
}
|
||||||
|
|
||||||
"Great War Infantry":{
|
"Great War Infantry":{
|
||||||
Italian:"Fante della Grande Guerra"
|
Italian:"Fante della Grande Guerra"
|
||||||
Romanian:"Infanteria Marelui Război"
|
Romanian:"Infanteria Marelui Război"
|
||||||
@ -6782,6 +6783,13 @@
|
|||||||
German:"Weltkriegs Infanterie"
|
German:"Weltkriegs Infanterie"
|
||||||
French:"Infanterie de la grande guerre"
|
French:"Infanterie de la grande guerre"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"Foreign Legion":{}
|
||||||
|
"+20% bonus outside friendly territory":{}
|
||||||
|
"Foreign Land":{ // for battle table combat percentage
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
"Destroyer":{
|
"Destroyer":{
|
||||||
Italian:"Cacciatorpediniere"
|
Italian:"Cacciatorpediniere"
|
||||||
Romanian:"Distrugător"
|
Romanian:"Distrugător"
|
||||||
|
@ -991,6 +991,20 @@
|
|||||||
obsoleteTech:"Plastics"
|
obsoleteTech:"Plastics"
|
||||||
attackSound:"shot"
|
attackSound:"shot"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Foreign Legion",
|
||||||
|
unitType:"Melee",
|
||||||
|
replaces:"Great War Infantry",
|
||||||
|
uniqueTo:"France",
|
||||||
|
movement:2,
|
||||||
|
strength:50,
|
||||||
|
cost: 320,
|
||||||
|
requiredTech:"Replaceable Parts",
|
||||||
|
hurryCostModifier:20,
|
||||||
|
upgradesTo:"Infantry",
|
||||||
|
obsoleteTech:"Plastics"
|
||||||
|
attackSound:"shot"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Infantry",
|
name:"Infantry",
|
||||||
unitType:"Melee",
|
unitType:"Melee",
|
||||||
|
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 226
|
versionCode 227
|
||||||
versionName "2.14.6"
|
versionName "2.14.7"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.unciv.logic.battle
|
package com.unciv.logic.battle
|
||||||
|
|
||||||
import com.unciv.logic.map.MapUnit
|
import com.unciv.logic.map.MapUnit
|
||||||
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.models.gamebasics.unit.UnitType
|
import com.unciv.models.gamebasics.unit.UnitType
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
@ -88,6 +89,8 @@ class BattleDamage{
|
|||||||
val modifiers = getGeneralModifiers(attacker, defender)
|
val modifiers = getGeneralModifiers(attacker, defender)
|
||||||
|
|
||||||
if(attacker is MapUnitCombatant) {
|
if(attacker is MapUnitCombatant) {
|
||||||
|
modifiers.putAll(getTileSpecificModifiers(attacker,defender.getTile()))
|
||||||
|
|
||||||
val defenderTile = defender.getTile()
|
val defenderTile = defender.getTile()
|
||||||
val isDefenderInRoughTerrain = defenderTile.baseTerrain=="Hill" || defenderTile.terrainFeature == "Forest" || defenderTile.terrainFeature == "Jungle"
|
val isDefenderInRoughTerrain = defenderTile.baseTerrain=="Hill" || defenderTile.terrainFeature == "Forest" || defenderTile.terrainFeature == "Jungle"
|
||||||
for (BDM in getBattleDamageModifiersOfUnit(attacker.unit)) {
|
for (BDM in getBattleDamageModifiersOfUnit(attacker.unit)) {
|
||||||
@ -112,11 +115,8 @@ class BattleDamage{
|
|||||||
modifiers["Attacker Bonus"] =modifiers["Attacker Bonus"]!! + bonus
|
modifiers["Attacker Bonus"] =modifiers["Attacker Bonus"]!! + bonus
|
||||||
else modifiers["Attacker Bonus"] = bonus
|
else modifiers["Attacker Bonus"] = bonus
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defenderTile.getOwner()!=null && !attacker.getCivInfo().isAtWarWith(defenderTile.getOwner()!!)
|
|
||||||
&& attacker.getCivInfo().getBuildingUniques().contains("+15% combat strength for units fighting in friendly territory"))
|
|
||||||
modifiers["Himeji Castle"] = 0.15f
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (attacker is CityCombatant) {
|
else if (attacker is CityCombatant) {
|
||||||
if (attacker.getCivInfo().policies.isAdopted("Oligarchy") && attacker.city.getCenterTile().militaryUnit != null)
|
if (attacker.getCivInfo().policies.isAdopted("Oligarchy") && attacker.city.getCenterTile().militaryUnit != null)
|
||||||
modifiers["Oligarchy"] = 0.5f
|
modifiers["Oligarchy"] = 0.5f
|
||||||
@ -144,6 +144,8 @@ class BattleDamage{
|
|||||||
|
|
||||||
val modifiers = getGeneralModifiers(defender, attacker)
|
val modifiers = getGeneralModifiers(defender, attacker)
|
||||||
|
|
||||||
|
modifiers.putAll(getTileSpecificModifiers(defender, defender.getTile()))
|
||||||
|
|
||||||
if (!defender.unit.hasUnique("No defensive terrain bonus")) {
|
if (!defender.unit.hasUnique("No defensive terrain bonus")) {
|
||||||
val tileDefenceBonus = defender.getTile().getDefensiveBonus()
|
val tileDefenceBonus = defender.getTile().getDefensiveBonus()
|
||||||
if (tileDefenceBonus > 0) modifiers["Terrain"] = tileDefenceBonus
|
if (tileDefenceBonus > 0) modifiers["Terrain"] = tileDefenceBonus
|
||||||
@ -170,16 +172,23 @@ class BattleDamage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defenderTile.getOwner()!=null && !defender.getCivInfo().isAtWarWith(defenderTile.getOwner()!!)
|
|
||||||
&& defender.getCivInfo().getBuildingUniques().contains("+15% combat strength for units fighting in friendly territory"))
|
|
||||||
modifiers["Himeji Castle"] = 0.15f
|
|
||||||
|
|
||||||
if (defender.unit.isFortified())
|
if (defender.unit.isFortified())
|
||||||
modifiers["Fortification"] = 0.2f * defender.unit.getFortificationTurns()
|
modifiers["Fortification"] = 0.2f * defender.unit.getFortificationTurns()
|
||||||
|
|
||||||
return modifiers
|
return modifiers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getTileSpecificModifiers(unit: MapUnitCombatant, tile: TileInfo): HashMap<String,Float> {
|
||||||
|
val modifiers = HashMap<String,Float>()
|
||||||
|
val isFriendlyTerritory = tile.getOwner()!=null && !unit.getCivInfo().isAtWarWith(tile.getOwner()!!)
|
||||||
|
if(isFriendlyTerritory && unit.getCivInfo().getBuildingUniques().contains("+15% combat strength for units fighting in friendly territory"))
|
||||||
|
modifiers["Himeji Castle"] = 0.15f
|
||||||
|
if(!isFriendlyTerritory && unit.unit.hasUnique("+20% bonus outside friendly territory"))
|
||||||
|
modifiers["Foreign Land"] = 0.2f
|
||||||
|
|
||||||
|
return modifiers
|
||||||
|
}
|
||||||
|
|
||||||
private fun modifiersToMultiplicationBonus(modifiers: HashMap<String, Float>): Float {
|
private fun modifiersToMultiplicationBonus(modifiers: HashMap<String, Float>): Float {
|
||||||
// modifiers are like 0.1 for a 10% bonus, -0.1 for a 10% loss
|
// modifiers are like 0.1 for a 10% bonus, -0.1 for a 10% loss
|
||||||
var finalModifier = 1f
|
var finalModifier = 1f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user