mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Resolved #758 - water melee units can now take cities (apparently this is a Vanilla vs G&K difference, I'll go with the G&K because it causes more interesting gameplay options)
This commit is contained in:
parent
862c714b47
commit
c98a6fc4d7
@ -175,6 +175,7 @@ class UnitAutomation{
|
||||
for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there
|
||||
val tilesInAttackRange = if (unit.hasUnique("Indirect Fire")) reachableTile.getTilesInDistance(rangeOfAttack)
|
||||
else reachableTile.getViewableTiles(rangeOfAttack, unit.type.isWaterUnit())
|
||||
|
||||
attackableTiles += tilesInAttackRange.asSequence().filter { it in tilesWithEnemies }
|
||||
.map { AttackableTile(reachableTile,it) }
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.unciv.logic.battle
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.unciv.Constants
|
||||
import com.unciv.logic.GameInfo
|
||||
import com.unciv.logic.automation.UnitAutomation
|
||||
import com.unciv.logic.city.CityInfo
|
||||
@ -8,7 +9,6 @@ import com.unciv.logic.civilization.AlertType
|
||||
import com.unciv.logic.civilization.PopupAlert
|
||||
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.Constants
|
||||
import com.unciv.models.gamebasics.unit.UnitType
|
||||
import java.util.*
|
||||
import kotlin.math.max
|
||||
@ -81,8 +81,7 @@ class Battle(val gameInfo:GameInfo) {
|
||||
|
||||
if(defender.isDefeated()
|
||||
&& defender is CityCombatant
|
||||
&& attacker.isMelee()
|
||||
&& attacker.getUnitType().isLandUnit()){
|
||||
&& attacker.isMelee()){
|
||||
conquerCity(defender.city, attacker)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user