mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Better unique for defending vs units
This commit is contained in:
parent
1271c86d03
commit
183b94702e
@ -412,13 +412,13 @@
|
||||
// Mixed
|
||||
{
|
||||
"name": "Cover I",
|
||||
"effect": "[+33]% Strength when defending vs [Ranged]",
|
||||
"effect": "[+33]% Strength when defending vs [Ranged] units",
|
||||
"unitTypes": ["Melee","Ranged","Siege"]
|
||||
},
|
||||
{
|
||||
"name": "Cover II",
|
||||
"prerequisites": ["Cover I"],
|
||||
"effect": "[+33]% Strength when defending vs [Ranged]",
|
||||
"effect": "[+33]% Strength when defending vs [Ranged] units",
|
||||
"unitTypes": ["Melee","Ranged","Siege"]
|
||||
},
|
||||
|
||||
|
@ -646,9 +646,6 @@ object Battle {
|
||||
|
||||
private fun tryInterceptAirAttack(attacker: MapUnitCombatant, defender: ICombatant) {
|
||||
if (attacker.unit.hasUnique("Cannot be intercepted")) return
|
||||
// Deprecated since 3.15.6
|
||||
if (attacker.unit.hasUnique("Can not be intercepted")) return
|
||||
// End deprecation
|
||||
val attackedTile = defender.getTile()
|
||||
for (interceptor in defender.getCivInfo().getCivUnits().filter { it.canIntercept(attackedTile) }) {
|
||||
if (Random().nextFloat() > 100f / interceptor.interceptChance()) continue
|
||||
|
@ -196,7 +196,7 @@ object BattleDamage {
|
||||
)
|
||||
modifiers["Tile"] = (tileDefenceBonus * 100).toInt()
|
||||
|
||||
for (unique in defender.unit.getMatchingUniques("[]% Strength when defending vs []")) {
|
||||
for (unique in defender.unit.getMatchingUniques("[]% Strength when defending vs [] units")) {
|
||||
if (attacker.matchesCategory(unique.params[1]))
|
||||
modifiers.add("defence vs [${unique.params[1]}] ", unique.params[0].toInt())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user