mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Deprecated "can only attack water" unique
This commit is contained in:
parent
52867ec265
commit
e94033fc36
@ -75,21 +75,9 @@ object BattleHelper {
|
||||
}
|
||||
|
||||
fun containsAttackableEnemy(tile: TileInfo, combatant: ICombatant): Boolean {
|
||||
if (combatant is MapUnitCombatant) {
|
||||
if (combatant.unit.isEmbarked()) {
|
||||
if (tile.isWater) return false // can't attack water units while embarked, only land
|
||||
if (combatant.isRanged()) return false
|
||||
}
|
||||
|
||||
// "Can only attack water" unique deprecated since 3.15.7
|
||||
if (combatant.unit.hasUnique("Can only attack water")) {
|
||||
if (tile.isLand) return false
|
||||
//
|
||||
|
||||
// trying to attack lake-to-coast or vice versa
|
||||
if ((tile.baseTerrain == Constants.lakes) != (combatant.getTile().baseTerrain == Constants.lakes))
|
||||
return false
|
||||
}
|
||||
if (combatant is MapUnitCombatant && combatant.unit.isEmbarked()) {
|
||||
if (tile.isWater) return false // can't attack water units while embarked, only land
|
||||
if (combatant.isRanged()) return false
|
||||
}
|
||||
|
||||
val tileCombatant = Battle.getMapCombatantOfTile(tile) ?: return false
|
||||
@ -101,6 +89,7 @@ object BattleHelper {
|
||||
combatant.unit.getMatchingUniques("Can only attack [] units").none { tileCombatant.matchesCategory(it.params[0]) }
|
||||
)
|
||||
return false
|
||||
|
||||
if (combatant is MapUnitCombatant &&
|
||||
combatant.unit.hasUnique("Can only attack [] tiles") &&
|
||||
combatant.unit.getMatchingUniques("Can only attack [] tiles").none { tile.matchesFilter(it.params[0]) }
|
||||
|
@ -189,10 +189,6 @@ class CityStats {
|
||||
for (unique in civInfo.getMatchingUniques("Specialists only produce []% of normal unhappiness")) {
|
||||
unhappinessFromSpecialists *= (1f - unique.params[0].toFloat() / 100f)
|
||||
}
|
||||
// Deprecated since 3.15
|
||||
if (civInfo.hasUnique("Specialists produce half normal unhappiness"))
|
||||
unhappinessFromSpecialists *= 0.5f
|
||||
//
|
||||
|
||||
unhappinessFromCitizens -= cityInfo.population.getNumberOfSpecialists().toFloat() - unhappinessFromSpecialists
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user